As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
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());}
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}nameTitle: NameDescription: nullDefault Value: nullDataType Name: {http://www.alfresco.org/model/dictionary/1.0}textContainerClass Name: {http://www.alfresco.org/model/content/1.0}cmobjectisMultiValued: falseisMandatory: trueisMandatoryEnforced: trueisProtected: falseisIndexed: trueisStoredInIndex: falseisIndexedAtomically: trueindexTokenisationMode: BOTH
Name: {http://www.alfresco.org/model/content/1.0}nameTitle: NameDescription: nullDefault Value: nullDataType Name: {http://www.alfresco.org/model/dictionary/1.0}textContainerClass Name: {http://www.alfresco.org/model/content/1.0}cmobjectisMultiValued: falseisMandatory: trueisMandatoryEnforced: trueisProtected: falseisIndexed: trueisStoredInIndex: falseisIndexedAtomically: trueindexTokenisation
Mode: 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.