cancel
Showing results for 
Search instead for 
Did you mean: 

List custom properties of a custom type [SOLVED]

palba
Champ in-the-making
Champ in-the-making
Hi.

Is there any way, using the javascript API, of getting the custom properties of a custom type?

Or, at least, is there any way to list all the custom properties of a node, although the property isn't set? Using

node.properties

I get all the properties of a node, but only the properties with a value. I need to know also what are the properties that the node can had (because it is a node of the custom type).

Any help, please?
2 REPLIES 2

patil
Champ on-the-rise
Champ on-the-rise
Hi
Below are the options of showing the property value

1.node.properties["{http://www.alfresco.org/model/content/1.0}modified"]
2.node.properties["cm:modified"]
3. node.properties["modified"] — > applicable only for the namespace http://www.alfresco.org/model/content/1.0
4. node.properties.modified — > applicable only for the namespace http://www.alfresco.org/model/content/1.0

For your custom fields go for first or second option whichever you fell comfortable.

Thanks,
Patil
Cignex Technologies
Bangalore

palba
Champ in-the-making
Champ in-the-making
Ok, I found it, at least with a Java Backend


For getting the list of posible properties of a typeName, you should do:

DictionaryService dd = serviceRegistry.getDictionaryService();
QName qName=QName.createQName(typeName);
TypeDefinition def=  dd.getType(qName);
Map<QName, PropertyDefinition> list=def.getProperties();