In audit trail for some properties names getting null for OOB

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Active Member II

In audit trail for some properties names getting null for OOB

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:

2 Replies
Highlighted
Alfresco Employee

Re: In audit trail for some properties names getting null for OOB

Some properties are defined without a Title value in the Data Dictionary. 

In this case, Working Copy Label property has no title defined:

https://github.com/Alfresco/alfresco-repository/blob/d8f828324419f101d6e1f7a19020864d801b3b64/src/ma...

You can include alternatively the Name instead of the Title.

Software Engineer in Alfresco Search Team.
Highlighted
Senior Member II

Re: In audit trail for some properties names getting null for OOB

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.