How to print this variable? How to work with this?
PropertyDefinition propertyDefinition = someProperty;
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.
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.
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.
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.
It's funny. This code is running. I misinterpreted results.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.