How to declare a java.util.Set as entry parameter of {m:template} - m2doc

I have a m2doc docx template to generate a Word document from my eclipseRCP application.
I would like to declare a java.util.Set objet as an entry parameter of a {m:template}.
My code is the following :
{m:template t_templateTest(req:request::Request, filters: Set)}
I've got this error message :
{m:template <--- missing classifier literalt_templateTest(req:request::Request, filters: Set)} <---Expression "filters" is invalid: missing classifier literal
I don't know how to declare the classifier for the Set.
Thanks for your help

AQL only support Sequence and OrderedSet and not all collection types you can find in OCL. The definition of an OrderSet also need to define what type of elements will be contained inside it, for instance:
OrderedSet(String)
You can have a look at the type syntax of the AQL documentation for more details.

Related

How to use optional Parameter Store parameters in a CloudFormation template?

I'd like to make CloudFormation look in Parameter Store for a particular parameter - and if not found, look for a different one.
The actual use case is that stacks are deployed for different branches and we'd like to have top-level parameters for all branches that can optionally be overridden by creating a branch-specific parameter. Something like this:
dev-param = 120 <-- top-level, applies if branch-specific parameter doesn't exist
dev-param.mybranch = 60 <-- branch-specific parameter
Have tried a couple of ways but got an error when deploying the stack for both - see below.
When attempting to use dynamic references:
Parameters: [ssm:dev-param.mybranch] cannot be found.
When attempting to use CloudFormation SSM Parameter Types.
Template format error: Every Default member must be a string.
For the latter, the Default: field specifies the Parameter Store key name. This needs to be generated dynamically from other CloudFormation parameters, e.g. there is a parameter for the environment type so development key names begin with dev- and production keys begin with prod-.
Is there another way to achieve this?
You can't do that without a custom resource or a macro.

invalid type literal import - How to import and use my custom service

So I created a simple service with a single class, without constructor : services.RecursiveQuery and added it as a plugin to my Eclipse instance as described in this question.
According to the documentation the next step would be to import it in my template file file so I tried this:
{m:import:services.RecursiveQuery}
However I get this error in the validation file:
Expression "import:services.RecursiveQuery:services" is invalid: invalid type literal import:
What am I doing wrong ? It feels like I'm missing something. Also I was wondering how to use the getAllChildren() method of this service. I would have tried
{m:for child | services.RecursiveQuery.getAllChildren(self)} but that doesnt feel right.
The M2Doc documentation may be unclear on this point: {m:import...} is not a valid statement in a M2Doc template file. It should be used in MS Word document properties, not in the docx template file.
You should use the template properties wizard to change imports along with the solution you mentionned here.
For a better understanding of how to use custom services you can check examples in M2Doc sources.

Swagger2.0 - oneOf operator in definition properties [duplicate]

What is the equivalent of anyof in Swagger version 2.0, Please tell me how to update my json file because I want to upgrade my documentation from swagger 1.0 to 2.0.
Thank You for your Help.
I don't think there is one and it feels like a big shortcoming. It's definitely not mentioned in the Schema Object portion of the specification. They call out the elements there that have been adopted from the JSON Schema and anyOf isn't among them:
The following properties are taken directly from the JSON Schema definition and follow the same specifications:
$ref - As a JSON Reference
format (See Data Type Formats for further details)
title
description (GFM syntax can be used for rich text representation)
default (Unlike JSON Schema, the value MUST conform to the defined type for the Schema Object)
multipleOf
maximum
exclusiveMaximum
minimum
exclusiveMinimum
maxLength
minLength
pattern
maxItems
minItems
uniqueItems
maxProperties
minProperties
required
enum
type
The following properties are taken from the JSON Schema definition but their definitions were adjusted to the Swagger Specification. Their definition is the same as the one from JSON Schema, only where the original definition references the JSON Schema definition, the Schema Object definition is used instead.
items
allOf
properties
additionalProperties
I think the closest thing is the discriminator field, but that means you've got to structure your output to accommodate Swagger.
anyOf and oneOf are now supported in OpenAPI Specification 3.0 (released on July 26, 2017).

How can I print a ctemplate::TemplateDictionary in JSON form?

Using the Google CTemplate library, I have built a TemplateDictionary of params. Such a dictionary is a map of string keys to a variety of value types.
Typically, one passes CTemplate a template file wherein placeholders for each key in the dictionary are found and substituted.
In one case, though, I wish to emit the entire dictionary in JSON form, and the template language syntax doesn't appear to provide reflection such that I can write placeholders to loop over an unknown number of unknown keys in any arbitrary dictionary.
Did I miss some functionality?
If so, how can I add it?
Will I have to patch the CTemplate code? Much of what I seem to need for the job appears to be marked private i.e. for internal use only...
I've ended up hacking the CTemplate source in template_dictionary.h and template_dictionary.cc, cloning class class TemplateDictionary::DictionaryPrinter to produce a new class class TemplateDictionary::DictionaryJsonPrinter, adapting its member functions to emit JSON syntax.

How to set default value with InterfaceGL?

So, doing something like this:
paramsInterface->addParam("EpsilonUpper",&mKinectModule->mEpsilon,"min=0 max=1 step=.001");
Seems to set the value to whatever the cpp class assigns. Is there a parameter string way of doing it? Its just nice/quicker to see your initializers in the same spot, i.e. where the initializer string containing your min/max is.
The Doc
http://libcinder.org/docs/v0.8.2/classcinder_1_1params_1_1_interface_gl.html
No, there's not.
P.S. under the hood, the Params interface in Cinder is an implementation of AntTweakBar. You can see the available parameters here, though there's not a 1:1 feature mapping between AntTweakBar and Cinder's Params class.