08-28-2017 05:19 AM
How to print this variable? How to work with this?
PropertyDefinition propertyDefinition = someProperty;
08-28-2017 07:15 AM
I am not sure I understand what you mean by your question? For what would you want to "print" the variable? You simply interact with that via its APIs e.g. to retrieve the details of a property as defined in the content model / dictionary.
08-29-2017 04:44 AM
I used this
Map<QName, PropertyDefinition> prop = dictionaryService.getType(folder).getProperties();
And then print data with this
for (Entry<QName, PropertyDefinition> entry : prop.entrySet()) {
logger.debug(entry.getKey());
logger.debug(entry.getValue());}
Problem is that entry.getValue() is type ProperyDefinition and I don't know how to work with this.
entry.getValue().toString();
Return:
Name: {http://www.alfresco.org/model/content/1.0}name
Title: Name
Description: null
Default Value: null
DataType Name: {http://www.alfresco.org/model/dictionary/1.0}text
ContainerClass Name: {http://www.alfresco.org/model/content/1.0}cmobject
isMultiValued: false
isMandatory: true
isMandatoryEnforced: true
isProtected: false
isIndexed: true
isStoredInIndex: false
isIndexedAtomically: true
indexTokenisationMode: BOTH
The question is: how to read data from dictionaryService(Is this way right?)? And then how to work with returned values?
Thanks.
08-29-2017 10:20 PM
What do you want to read?
The property value from a specific object?
If that is the case, then what you need is nodeService instead of dictionaryService.
08-30-2017 03:36 AM
Yes, but I want to create a form and some properties are only created when they are filled. So I want to read all properties from content model, because there are all properties that exist for some specific object.
08-30-2017 06:06 AM
It's funny. This code is running. I misinterpreted results.
Explore our Alfresco products with the links below. Use labels to filter content by product module.