Class NuxeoGroupJsonWriter
java.lang.Object
org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter<NuxeoGroup>
org.nuxeo.ecm.core.io.marshallers.json.ExtensibleEntityJsonWriter<NuxeoGroup>
org.nuxeo.ecm.platform.usermanager.io.NuxeoGroupJsonWriter
- All Implemented Interfaces:
Marshaller<NuxeoGroup>,Writer<NuxeoGroup>
@Setup(mode=SINGLETON,
priority=2000)
public class NuxeoGroupJsonWriter
extends ExtensibleEntityJsonWriter<NuxeoGroup>
Convert
NuxeoGroup to Json.
This marshaller is enrichable: register class implementing AbstractJsonEnricher and managing
NuxeoGroup.
This marshaller is also extensible: extend it and simply override
ExtensibleEntityJsonWriter.extend(Object, JsonGenerator).
Format is:
{
"entity-type":"group",
"groupname": "GROUP_NAME", <- deprecated, for backward compatibility
"grouplabel": "GROUP_DISPLAY_NAME", <- deprecated, for backward compatibility
"id": "GROUP_NAME",
"properties":{ <- depending on the group schema / format is managed by {@link org.nuxeo.ecm.core.io.marshallers.json.document.DocumentPropertyJsonWriter}
"groupname":"GROUP_NAME",
"grouplabel":"GROUP_DISPLAY_NAME",
"description": "GROUP_DESCRIPTION"
},
"memberUsers": [
"USERNAME1",
"USERNAME2",
...
],
"memberGroups": [
"GROUPNAME1",
"GROUPNAME2",
...
],
"parentGroups": [
"GROUPNAME1",
"GROUPNAME2",
...
]
<-- contextParameters if there are enrichers activated
<-- additional property provided by extend() method
}
- Since:
- 7.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
ctx, registry -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidwriteEntityBody(NuxeoGroup group, com.fasterxml.jackson.core.JsonGenerator jg) Implement this method to write the entity body.protected voidwriteMemberGroups(NuxeoGroup group, com.fasterxml.jackson.core.JsonGenerator jg) protected voidwriteMemberUsers(NuxeoGroup group, com.fasterxml.jackson.core.JsonGenerator jg) protected voidwriteParentGroups(NuxeoGroup group, com.fasterxml.jackson.core.JsonGenerator jg) protected voidwriteProperties(NuxeoGroup group, com.fasterxml.jackson.core.JsonGenerator jg) Methods inherited from class org.nuxeo.ecm.core.io.marshallers.json.ExtensibleEntityJsonWriter
extend, writeMethods inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
accept, getGenerator, write, writeEntity, writeEntity, writeEntityField, writeSerializable, writeSerializableField, writeSerializableListField, writeSerializableMapField
-
Field Details
-
ENTITY_TYPE
- See Also:
-
MEMBER_USERS_FETCH_PROPERTY
- Since:
- 9.3
- See Also:
-
MEMBER_GROUPS_FETCH_PROPERTY
- Since:
- 9.3
- See Also:
-
PARENT_GROUPS_FETCH_PROPERTY
- Since:
- 9.3
- See Also:
-
GROUP_NAME_COMPATIBILITY_FIELD
- Since:
- 9.3
- See Also:
-
GROUP_LABEL_COMPATIBILITY_FIELD
- Since:
- 9.3
- See Also:
-
-
Constructor Details
-
NuxeoGroupJsonWriter
public NuxeoGroupJsonWriter()
-
-
Method Details
-
writeEntityBody
protected void writeEntityBody(NuxeoGroup group, com.fasterxml.jackson.core.JsonGenerator jg) throws IOException Description copied from class:ExtensibleEntityJsonWriterImplement this method to write the entity body.- Specified by:
writeEntityBodyin classExtensibleEntityJsonWriter<NuxeoGroup>- Parameters:
group- The Java entity.jg- AJsonGeneratorready to write your entity as Json.- Throws:
IOException
-
writeProperties
protected void writeProperties(NuxeoGroup group, com.fasterxml.jackson.core.JsonGenerator jg) throws IOException - Throws:
IOException
-
writeMemberUsers
protected void writeMemberUsers(NuxeoGroup group, com.fasterxml.jackson.core.JsonGenerator jg) throws IOException - Throws:
IOException
-
writeMemberGroups
protected void writeMemberGroups(NuxeoGroup group, com.fasterxml.jackson.core.JsonGenerator jg) throws IOException - Throws:
IOException
-
writeParentGroups
protected void writeParentGroups(NuxeoGroup group, com.fasterxml.jackson.core.JsonGenerator jg) throws IOException - Throws:
IOException
-