Package org.ametys.plugins.core.group
Class GroupHelper
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.core.group.GroupHelper
-
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
public class GroupHelper extends AbstractLogEnabled implements Component, Serviceable
Helper class for groups, for common operations onGroup
-
-
Constructor Summary
Constructors Constructor Description GroupHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>
group2JSON(Group group, boolean users)
Get group as JSON objectList<Map<String,Object>>
groups2JSON(List<Group> groups, boolean users)
Get groups as JSON objectvoid
saxGroup(Group group, ContentHandler handler)
Sax a Groupvoid
saxGroup(Group group, ContentHandler handler, String tagName)
Sax a Groupvoid
saxGroup(Group group, ContentHandler handler, String tagName, boolean withUsers)
Sax a Groupvoid
saxGroupIdentity(GroupIdentity groupIdentity, ContentHandler handler)
Sax a Group identityvoid
saxGroupIdentity(GroupIdentity groupIdentity, ContentHandler handler, String tagName)
Sax a Group identityvoid
saxGroupIdentity(GroupIdentity groupIdentity, ContentHandler handler, String tagName, boolean withUsers)
Sax a Group identityvoid
service(ServiceManager manager)
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Constructor Detail
-
GroupHelper
public GroupHelper()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
saxGroupIdentity
public void saxGroupIdentity(GroupIdentity groupIdentity, ContentHandler handler) throws SAXException
Sax a Group identity- Parameters:
groupIdentity
- the group identity to saxhandler
- the content handler- Throws:
SAXException
- If a SAX error occurs
-
saxGroupIdentity
public void saxGroupIdentity(GroupIdentity groupIdentity, ContentHandler handler, String tagName) throws SAXException
Sax a Group identity- Parameters:
groupIdentity
- the group identity to saxhandler
- the content handlertagName
- the XML tag for saxed group- Throws:
SAXException
- If a SAX error occurs
-
saxGroupIdentity
public void saxGroupIdentity(GroupIdentity groupIdentity, ContentHandler handler, String tagName, boolean withUsers) throws SAXException
Sax a Group identity- Parameters:
groupIdentity
- the group identity to saxhandler
- the content handlertagName
- the XML tag for saxed groupwithUsers
- if true, users of the group will be saxed with the group- Throws:
SAXException
- If a SAX error occurs
-
saxGroup
public void saxGroup(Group group, ContentHandler handler) throws SAXException
Sax a Group- Parameters:
group
- the group to saxhandler
- the content handler- Throws:
SAXException
- If a SAX error occurs
-
saxGroup
public void saxGroup(Group group, ContentHandler handler, String tagName) throws SAXException
Sax a Group- Parameters:
group
- the group to saxhandler
- the content handlertagName
- the XML tag for saxed group- Throws:
SAXException
- If a SAX error occurs
-
saxGroup
public void saxGroup(Group group, ContentHandler handler, String tagName, boolean withUsers) throws SAXException
Sax a Group- Parameters:
group
- the group to saxhandler
- the content handlertagName
- the XML tag for saxed groupwithUsers
- if true, users of the group will be saxed with the group- Throws:
SAXException
- If a SAX error occurs
-
group2JSON
public Map<String,Object> group2JSON(Group group, boolean users)
Get group as JSON object- Parameters:
group
- the groupusers
- true to get users' group- Returns:
- the group as JSON object
-
-