Generate groovy DSL using swagger - spring-cloud-contract

The first question I get from most of the developers I get is, Is there any way to auto generate your groovy file by by using swagger or may be plain json file?
Is there any way to do it?

I don't understand the question. What do you want to achieve? Do you NOT want to use Groovy file to define a contract? If that's the case then the answer is - you can use the Pact file (a json) to define the contract or you can plugin whatever you want. It's all written in the documentation - http://cloud.spring.io/spring-cloud-static/Dalston.SR4/multi/multi__pluggable_architecture.html.
As for Swagger we don't support it mainly because it's a schema. The reasons behind this decision are in this issue - https://github.com/spring-cloud/spring-cloud-contract/issues/136

Related

Requiring a Module With Alloy MVC

Right, so, if I was simply using Titanium, I could write:
var platino = require("co.lanica.platino");
And I'd be good to go. Since moving to Alloy, I don't know how to replicate the same line in the afforementioned MVC framework.
Do I add it under the global namespace? I already added the module in tiapp.xml, but I have no idea how to access it as a variable "platino".
The docs for Alloy are pretty sparse...any suggestions?
Require method is almost same in Alloy, you can use the require keyword in your js file and implement as in classic approach.
checkout the docs.

Compile-time XQuery validation

Which tools exist for static analysis of XQuery functions?
Example tasks: given two XSD schemas A and B and some XQuery f, check that for any document d of type A its transformation f(d) is valid against B.
Or for given query generate its inverse, when exists.
This topic is unfortunately hard for googling.
Yes, I think OxygenXML is fantastic for XQuery analysis, it has its own manual static-analysis tools built in.
You can use the manual validation instead: Document > Validate > Validate after configuring a transformation or a validation scenario that specified the xDB connection as the engine.
Other resources I found which where interesting on this topic Using XML Editor to Create or Validate an OLAC Static Repository and Where can I find static/dynamic code analysis tools for XSLT? (Oxygen can be used with X-Query, X-Path, XLink to name a few).

How to internationalize a handlebars + backbone view?

I would like to be able to internationalize a backbone + Handlebars application but I am not clear what the best way to do it. Are there any specific best practices for internationalizing backbone + Handlebar views?
On the server side I am using SpringMVC and have access to standard java internationalization facilities.
Here are some very good resources on internationalization for the client side.
http://2012.jsconf.eu/speaker/2012/08/28/client-side-internationalization.html really worth watching it provides a good explanation of the issues with internationalization and is java-script focused.
http://alexsexton.com/blog/2012/03/the-ux-of-language/ Good article about the internationalization
JavaScript libraries for internationalization:
https://github.com/SlexAxton/messageformat.js
http://slexaxton.github.com/Jed/
Standards:
http://userguide.icu-project.org/formatparse/messages (very useful read)
http://cldr.unicode.org/ (more of a reference)
Currently I'm working with an app with (very limited) internationalization, and I mix in an object with the model before sending it to the template in the Backbone.Marionette.Renderer.render function. If you have a similar central function which renders your templates (which I assume you have) you can do this logic there. You could for instance mix the internationalized content (language preselected in) in a namespace, for instance
data = _.extend(model, {t: translations(:dutch))
Leaves how to get the translations from the backend to the frontend, but I don't know enough of SpringMVC to give you advise on that.
We use i18next (http://i18next.com) in our Require/Backbone/Handlebars app with very good results. It supports plural and context forms and there are converters from PO to JSON and vice versa. (PO is widely used for translations here.) The documentation is clean and full of helpfull examples.
It's possible to use it in Handlebars with both static keys (strings) or dynamic variables. You will have to setup your own Handlebars helpers but the documentation of i18next provides example code for this.
In this post, I've added more implementation details:
https://stackoverflow.com/a/17728920/621690

How to call calabash xml from a Java program

I try to set up a web based application using spring and xslt. Since i always use xslt in a pipelining style, i would like to use calabash. Is there a possibility to call calabash from Java? I read thru the documentation on http://xmlcalabash.com but there is only a description how to use it from command line. I also tired to find some javadoc on githup but wasn't successful. Obviously, there is the Main class with the main() method and i could supply the command line parameters as a string array...
I wonder if there is a better way to do it.
I looked into this recently too. I took a pragmatic approach where I call Main.run(), and pass in a string array that I generate from a (File)Properties object. It doesn't allow passing in file inputs as streams or sources however, they must reside on the file-system.
Likely there are nicer ways. You could for instance look into http://expath.org/ . There should be sources of that project. The webapp modules (formerly known as servlex?) seems to provide XMLCalabash integration.
HTH!

Using WF Rules without using workflow activities or the embedded rule set editor

Has any one used WF Rules engine outside workflow activities WITHOUT using Rules Editor or CodeDOM?
Scenario
I am trying to use the Rule engine that ships with Workflow foundation classes with .Net Framework for a web based application. We evaluate hundreds of Validation Rules before proceeding towards a calculation engine for a complex calculation.
I have gone through many blogs which state how to use Rules engine without having to have Workflow Activities including https://github.com/geersch/WorkflowRulesEngine.
However they all eventually end up using a Rule Set Editor for defining rules. I want to declaratively define rules in an XML file
What I am looking for
I need to be able to specify Rules in simple XML without dealing with CODEDOM. CodeDOM seems to be very complex to write.
I should not be dependent on RuleSet Editor for defining rules.
Any thoughts any one ?
Don't know what kind of rules you are evaluating, but if you search a good open source rule engine, here is one.
Have a look at the following article for a strategy (not a solution) to approach the problem.
http://code.msdn.microsoft.com/windowsdesktop/Creating-Rules-Using-the-23c5d561
The serialization format for WF Rules is CodeDom.
It does not have another serialization format built-in.
If you want an alternate XML representation, you would need to create a tool to map between the representations.

Resources