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>
ConvertNuxeoGroup
to Json.This marshaller is enrichable: register class implementing
AbstractJsonEnricher
and managingNuxeoGroup
.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
Fields Modifier and Type Field Description static String
ENTITY_TYPE
static String
GROUP_LABEL_COMPATIBILITY_FIELD
static String
GROUP_NAME_COMPATIBILITY_FIELD
static String
MEMBER_GROUPS_FETCH_PROPERTY
static String
MEMBER_USERS_FETCH_PROPERTY
static String
PARENT_GROUPS_FETCH_PROPERTY
-
Fields inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
ctx, registry
-
-
Constructor Summary
Constructors Constructor Description NuxeoGroupJsonWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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 Detail
-
ENTITY_TYPE
public static final String ENTITY_TYPE
- See Also:
- Constant Field Values
-
MEMBER_USERS_FETCH_PROPERTY
public static final String MEMBER_USERS_FETCH_PROPERTY
- Since:
- 9.3
- See Also:
- Constant Field Values
-
MEMBER_GROUPS_FETCH_PROPERTY
public static final String MEMBER_GROUPS_FETCH_PROPERTY
- Since:
- 9.3
- See Also:
- Constant Field Values
-
PARENT_GROUPS_FETCH_PROPERTY
public static final String PARENT_GROUPS_FETCH_PROPERTY
- Since:
- 9.3
- See Also:
- Constant Field Values
-
GROUP_NAME_COMPATIBILITY_FIELD
public static final String GROUP_NAME_COMPATIBILITY_FIELD
- Since:
- 9.3
- See Also:
- Constant Field Values
-
GROUP_LABEL_COMPATIBILITY_FIELD
public static final String GROUP_LABEL_COMPATIBILITY_FIELD
- Since:
- 9.3
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
-
-