Class NuxeoGroupJsonWriter
java.lang.Object
org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter<EntityType>
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 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
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
ctx, registry
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
writeEntityBody
(NuxeoGroup group, com.fasterxml.jackson.core.JsonGenerator jg) Implement this method to write the entity body.protected void
writeMemberGroups
(NuxeoGroup group, com.fasterxml.jackson.core.JsonGenerator jg) protected void
writeMemberUsers
(NuxeoGroup group, com.fasterxml.jackson.core.JsonGenerator jg) protected void
writeParentGroups
(NuxeoGroup group, com.fasterxml.jackson.core.JsonGenerator jg) protected void
writeProperties
(NuxeoGroup group, com.fasterxml.jackson.core.JsonGenerator jg) Methods inherited from class org.nuxeo.ecm.core.io.marshallers.json.ExtensibleEntityJsonWriter
extend, write
Methods 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:ExtensibleEntityJsonWriter
Implement this method to write the entity body.- Specified by:
writeEntityBody
in classExtensibleEntityJsonWriter<NuxeoGroup>
- Parameters:
group
- The Java entity.jg
- AJsonGenerator
ready 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
-