cancel
Showing results for 
Search instead for 
Did you mean: 

Getting properties of a custom content

pradeepsimha
Champ in-the-making
Champ in-the-making
Hi Team,

Don't know if this question has been already answered, but I searched lot didn't get any useful result. So I am posting here. Basically I created a custom content model and added few properties to it. I followed the tutorial by Jeff Potts. I got most of the things up, but one thing I am having issue is getting properties of my custom content, say I have added
ti:category
to my content model. Now I should be able to get this property for a particular content. In the tutorial in the section of "Searching for a content", it only displays following data:


Result 1:
id:c7c1a94e-8d9c-4434-89b0-cbe14ef94455;1.0
name:test1.txt
created:Jan 22, 2014 2:22:00 PM


I think it doesn't include custom properties, even I tried following REST APIs like : alfresco/service/api/dictionary etc. So my query is, is there any API available to get properties of a custom content? If yes, can you please guide me? Sorry if I am not making sense.
2 REPLIES 2

kaynezhang
World-Class Innovator
World-Class Innovator

Is your custom  property  indexed? to enable the content repository to query on a property value, you must set
 <index enabled="true"> 
in the index element of your custom model.

jpotts
World-Class Innovator
World-Class Innovator
Nothing special is needed to access custom properties. The same API calls apply. Maybe if you post the code that is giving you trouble we can give you more specific advice.

Jeff