dsl

Why does HttpSecurity configuration via DSL not seem to work the same as explicit configuration?

一曲冷凌霜 提交于 2019-12-13 15:01:11
问题 I went through the trouble to write a DSL to configure the HttpSecurity for my custom authentication mechanism, but most of the configuration I apply to it doesn't seem to be in effect when the application runs, while everything works perfectly when I configure it all manually in the webapp. First, the manual configuration, which results in my EntryPoint firing, authenticationProvider being queried, the filter being added to the chain, and my rememberMeServices being added to that filter.

Use of Clojure macros for DSLs

房东的猫 提交于 2019-12-13 11:56:29
问题 I am working on a Clojure project and I often find myself writing Clojure macros for DSLs, but I was watching a Clojure video of how a company uses Clojure in their real work and the speaker said that in practical use they do not use macros for their DSLs, they only use macros to add a little syntactic sugar. Does this mean I should write my DSL in using standard functions and then add a few macros at the end? Update : After reading the many varied (and entertaining) responses to this

DSL-Json with RESTEasy - Getting NoMessageBodyWriterFoundFailure error

£可爱£侵袭症+ 提交于 2019-12-13 05:50:55
问题 I'm integrating RestEasy with Dsl-JSON but I'm getting the following error: Failed executing GET /json/sample/get org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: Could not find MessageBodyWriter for response object of type My code is as below: @Path("/json/sample") public class JSONService { @GET @Path("/get") @Produces(MediaType.APPLICATION_JSON) public Sample getProductInJSON() { Sample product = new Sample(); product.setName("abcd"); product.setAge(12); return product; } } My pom

camel split/aggregate and merge List<A> that contains List<B> that contains List<C>

余生颓废 提交于 2019-12-13 03:47:38
问题 Given a structure similar to this one: @Data public class A { //..other fields.. private List<B> bs; } @Data public class B { //..other fields.. private List<C> cs; } I have to process a list of type A in multiple steps/routes. Some operation are in the A level, others in other levels like C. The problem I'm trying to solve is to process every single C given an A and then some logic afterwards have to work with the updated A model. I can successfully split and aggregate back the list<C> but

UDF in Spark SQL DSL

淺唱寂寞╮ 提交于 2019-12-13 00:49:24
问题 I am trying to use DSL over pure SQL in Spark SQL jobs but I cannot get my UDF works. sqlContext.udf.register("subdate",(dateTime: Long)=>dateTime.toString.dropRight(6)) This doesn't work rdd1.toDF.join(rdd2.toDF).where("subdate(rdd1(date_time)) === subdate(rdd2(dateTime))") I also would like to add another join condition like in this working pure SQL val results=sqlContext.sql("select * from rdd1 join rdd2 on rdd1.id=rdd2.idand subdate(rdd1.date_time)=subdate(rdd2.dateTime)") Thanks for your

Spring Integration Java DSL — Configuration of aggregator

喜欢而已 提交于 2019-12-12 11:09:09
问题 I have a very simple integration flow, where a RESTful request is forwarded to two providers using a publish-subscribe channel. The result from both RESTful services is then aggregated in a single array. The sketch of the integration flow is as shown below: @Bean IntegrationFlow flow() throws Exception { return IntegrationFlows.from("inputChannel") .publishSubscribeChannel(s -> s.applySequence(true) .subscribe(f -> f .handle(Http.outboundGateway("http://provider1.com/...") .httpMethod

Apache Camel REST DSL - Validating Request Payload and return error response

吃可爱长大的小学妹 提交于 2019-12-12 09:11:13
问题 I am exposing a rest service using "CamelHttpTransportServlet" that receive orders and place in jms queue. The code works fine on happy path and returns 200 response. I have written Processor to validate the input JSON, and set http_response_code based on the input. The issue is - for invalid requests though failure response code - 400 is set, the flow continues to the next route and pushes the data to the queue instead of sending the 400 response back to the calling app. rest("

IronPython DSL casting constants to C# types

不想你离开。 提交于 2019-12-12 06:30:09
问题 I am implementing a DSL in IronPython. Suppose I have a value hierachy implemented in C# to be used in iron python: public abstract Value { } public abstract DoubleValue : Value { // Constructors... public double magnitude; // Arithmetic operators overloaded... } public abstract FractionValue : Value { // Constructors.... public int numerator; public int denominator; // Arithmetic operators overloaded... } Due to the operator overloading in C#, i can do this in Python: # a, b are of type

how to add a separator in in xtext list?

[亡魂溺海] 提交于 2019-12-11 18:33:54
问题 I have the following grammar fragment: FixtureGroup: name = ID ':' fixtures += [Fixture]* ';'; And in the instance I can type for the above rule the following: FrontLeft: FrontLeft1 FrontLeft2; However, what I like to type is a plus in between: FrontLeft: FrontLeft1 + FrontLeft2; How should I change the grammar to accomplish this? 回答1: the ususal pattern is ':' (fixtures += [Fixture] ('+' fixtures += [Fixture])*)? 来源: https://stackoverflow.com/questions/55929123/how-to-add-a-separator-in-in

DSL for triggering cron with a parameter. I have defined the parameter in the job above but unable to pass it in the cron using dsl scripts

早过忘川 提交于 2019-12-11 17:25:03
问题 I have created the parameter but i am unable to pass that variable while creating the cron job. job("dev_testing") { parameters { booleanParam('security_scan', true) choiceParam('OPTION', ['false (default)', 'true',]) } triggers { cron('H 23 * * 6 %security_scan; true') } } Following is the error: ERROR: Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object (javaposse.jobdsl.dsl.helpers.triggers.TriggerContext parameterizedTimerTrigger