cancel
Showing results for 
Search instead for 
Did you mean: 

Not the attribute value of node

nyszhangyong
Champ in-the-making
Champ in-the-making
hello

The version of the software I use is 4.0.d.

I uploaded a picture, and I set up a category for this picture , now I want to get to this title of picture ,  inside in webscript code ,I tested
, I can get the value of ‘node.name’ but not ‘cm:title’ to have value ,There are several reasons for this situation it? Please help me analyze the reasons . thank you very much !


function doSearch()
{
// The initial template
var alfQuery =
' PATH:"/app:company_home/app:guest_home//*"' +
' AND NOT TYPE:"{http://www.alfresco.org/model/content/1.0}thumbnail"' +
' AND NOT TYPE:"{http://www.alfresco.org/model/content/1.0}folder"';

// Perform fts-alfresco language query for articles
var queryDef = {
query: alfQuery,
language: "fts-alfresco",
page: {maxItems: maxResults},
templates: []
};

// Get article nodes
var nodes = search.query(queryDef),
articles = [],
item;

// Turn nodes into article objects
for (var i = 0, j = nodes.length; i < j; i++)
{
// Create core object
node = nodes;
item =
{
nodeRef: node.nodeRef.toString(),
type: node.typeShort,
name: node.name,
title: node.properties["cm:title"]
};
}

}
3 REPLIES 3

jpotts
World-Class Innovator
World-Class Innovator
If you look at the node in the node browser, does it have a title set?

Jeff

nyszhangyong
Champ in-the-making
Champ in-the-making
Yes, I'm sure , I added a title , and I can see the details in .

As shown below:


http://b100.photo.store.qq.com/psb?/V13vOWFy2erqYu/B*a*S4VucLFSdkuHN7QTz69AZfURlJHQp21j9EJ4HfE!/b/YY...

jpotts
World-Class Innovator
World-Class Innovator
Must be a data problem because your code looks fine (assuming you are defining maxResults somewhere).

You showed me a screenshot of the Explorer UI, but to be absolutely sure, you really should be looking at the data through the node browser. The node browser is available in both Explorer and in Share.

Jeff