Class NuxeoPrincipalJsonWriter

All Implemented Interfaces:
Marshaller<NuxeoPrincipal>, Writer<NuxeoPrincipal>

@Setup(mode=SINGLETON, priority=2000) public class NuxeoPrincipalJsonWriter extends ExtensibleEntityJsonWriter<NuxeoPrincipal>
Convert NuxeoPrincipal to Json.

This marshaller is enrichable: register class implementing AbstractJsonEnricher and managing NuxeoPrincipal.

This marshaller is also extensible: extend it and simply override ExtensibleEntityJsonWriter.extend(Object, JsonGenerator).

Format is:

 
 {
   "entity-type":"user",
   "id":"USERNAME",
   "properties":{   <- depending on the user schema / format is managed by {@link DocumentPropertyJsonWriter }
     "firstName":"FIRSTNAME",
     "lastName":"LASTNAME",
     "username":"USERNAME",
     "email":"[email protected]",
     "company":"COMPANY",
     "password":"", <- ALWAYS EMPTY
     "groups":[
       "GROUP1 NAME OF THE USER",
       "GROUP2 NAME OF THE USER",
       ...
     ]
   },
   "extendedGroups":[
     {
       "name":"GROUP1NAME",
       "label":"GROUP1 DISPLAY NAME",
       "url":"GROUP1 URL"
     },
     ...
   ],
   "isAdministrator":true|false,
   "isAnonymous":false|false
             <-- contextParameters if there are enrichers activated
             <-- additional property provided by extend() method
 }
 
 
Since:
7.2