Not the attribute value of node

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2012 07:48 AM
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"]
};
}
}
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"]
};
}
}
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2012 10:02 AM
If you look at the node in the node browser, does it have a title set?
Jeff
Jeff

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2012 11:28 PM
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...
As shown below:
http://b100.photo.store.qq.com/psb?/V13vOWFy2erqYu/B*a*S4VucLFSdkuHN7QTz69AZfURlJHQp21j9EJ4HfE!/b/YY...
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2012 12:05 AM
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
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
