In audit trail for some properties names getting null for OOB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2018 07:05 AM
Hi ,
Audit trails for some property names getting null for OOB model, written condition for checking properties using dictionaryServices but not getting properties names. I wrote substring condition for getting name with property definition. find the Java snippet:
Map propMap = (Map) o;
propMap.forEach((k, v) -> {
if (dictionaryService.getProperty((QName) k) != null) {
cell.append(dictionaryService.getProperty((QName) k).getTitle(dictionaryService) + " = " + v + "\n");
} else {
cell.append(k.toString().substring(k.toString().lastIndexOf("}") + 1, k.toString().length()) + v + "\n");
}
});
Mainly getting issue when I clicked document for edit offline at that time for some properties getting null. Find the below pictures for the issue:
- Labels:
-
Alfresco Content Services
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2018 07:22 AM
Some properties are defined without a Title value in the Data Dictionary.
In this case, Working Copy Label property has no title defined:
You can include alternatively the Name instead of the Title.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2018 07:27 AM
Title attribute of property is not mandatory in content model of alfresco.So when you retrieve title of a property which does not exist , than it will return null.
cell.append(dictionaryService.getProperty((QName) k).getTitle(dictionaryService) + " = " + v + "\n");
You need to put if condition for title as well, If title is null than you can display the QNAME as it is or may be something else.
