I am new to rythm and cant seem to find enough documentation to read through s posting the Questions here.
@args String subTitle
@args String title
@args String description
@args String locale
@args java.util.List<String> pictureURL
@args java.util.Map<String,Object> itemSpecifics
@args String productIds
@args Integer order
{
"localizedProductDetails":[
{
"subTitle":"@subTitle",
"title":"@title",
"description":"@description",
"locale":"@locale",
@if(itemSpecifics != null) {
"attributes":{
@for( Map.Entry<String,Object> e: itemSpecifics.entrySet()){
"@(e.getKey())" : @(e.getValue()) ,
}
}
}
}
],
@if(pictureURL != null){
"pictures":[ {
@for( String pic : pictureURL ){
"order":"@(order+1)",
"pictureURL":"@pic"
}
}
]
,
}
}
and then i pass the hashmap of values to be populated.
But i get compile issue:
org.rythmengine.exception.CompileException: Duplicate parameter e
Template: Product_Template.txt
Relevant template source lines:
-------------------------------------------------
18: @if(itemSpecifics != null) {
19:
20: "attributes":{
21:
22: @for( Map.Entry<String,Object> e: itemSpecifics.entrySet()){
>> 23: "@(e.getKey())" : @(e.getValue()) ,
24: }
25:
26: }
27:
28: }
29: }
Relevant Java source lines:
-------------------------------------------------
217: org.rythmengine.internal.LoopUtil e_utils = new org.rythmengine.internal.LoopUtil(e_isFirst, e_isLast); //line: 22
218: org.rythmengine.internal.LoopUtil e__utils = new org.rythmengine.internal.LoopUtil(e_isFirst, e_isLast, e); //line: 22
219: __pushItrVar("e", e); //line: 22
220: p(" \""); //line: 23
221:
>> 222: try{pe((e.getKey()));} catch (RuntimeException e) {__handleTemplateExecutionException(e);} //line: 23
223: p("\" : "); //line: 23
224:
225: try{pe((e.getValue()));} catch (RuntimeException e) {__handleTemplateExecutionException(e);} //line: 23
226: p(" ,\n"); //line: 23
227:
228: __popItrVar();
Can someone please guide?
Thanks