09-04-2009 09:01 AM
function main()
{
var results = search.luceneSearch("TYPE:\"{http://www.mysite.nl/model/content/1.0}job\"");
logger.log(">>>>>>>>>>>>>>>NODE LENGTH:" + results.length);
model.results = results;
}
main();
The logger gives me "3" and that's correct; I have 3 content items of that type.
[
<#if results?exists>
<#– This works, specifying the first item in the array, just a test –>
"jobtype" : "${results[0].properties["bla:jobtype"]}"
<#– Now this is where it gets "weird" for me at least –>
<#list results as result>
{
${result}
${result_index}
<#– This does NOT work, the bla:jobtype property is a custom property from my custom model –>
<#– "jobtype" : "${result.properties["bla:jobtype"]}" –>
<#if result_has_next>,</#if>
}
</#list>
</#if>
]
I CAN call a standard Alfresco property like name, though by doing result.name or even result.properties.name.
[
"jobtype" : "Accountant"
{
Node Type: {http://www.mysite.nl/model/content/1.0}job Node Ref: workspace://SpacesStore/f1371de1-a1c0-461b-b863-f89fbd535953
0
,
}
{
Node Type: {http://www.mysite.nl/model/content/1.0}job Node Ref: workspace://SpacesStore/5bf98860-e93f-4cfd-8e9d-a177076abc65
1
,
}
{
Node Type: {http://www.mysite.nl/model/content/1.0}job Node Ref: workspace://SpacesStore/bd3aaf7b-0d2d-454b-bc0c-bb54c808739c
2
}
]
As you can see, the index returns correct amount of items (3), but is the data in the model correct? I thought so, because if i do the search based on XPATH in my .js file, I get the exact same JSON output and the result.properties["customProperty"] does work then!
var results = companyhome.childrenByXPath("*//.[@bla:topjob='true']");
09-07-2009 05:04 AM
09-09-2009 06:05 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.