com.stratelia.webactiv.organization
Class GroupTable

java.lang.Object
  extended by com.stratelia.webactiv.organization.Table<GroupRow>
      extended by com.stratelia.webactiv.organization.GroupTable

public class GroupTable
extends Table<GroupRow>

A GroupTable object manages the ST_Group table.


Constructor Summary
GroupTable(OrganizationSchema schema)
           
 
Method Summary
 void addUserInGroup(int userId, int groupId)
          Add an user in this group.
 void addUsersInGroup(String[] userIds, int groupId, boolean checkRelation)
          Add an user in this group.
 void createGroup(GroupRow group)
          Insert a new group row.
protected  GroupRow fetchGroup(ResultSet rs)
          Fetch the current group row from a resultSet.
protected  GroupRow fetchRow(ResultSet rs)
          Fetch the current group row from a resultSet.
 String[] getAllGroupIds()
          Returns all the Group ids.
 GroupRow[] getAllGroups()
          Returns all the Groups.
 GroupRow[] getAllGroupsOfDomain(int domainId)
          Returns all the Groups having a given domain id.
 GroupRow[] getAllMatchingGroups(GroupRow sampleGroup)
          Returns the Group whose fields match those of the given sample group fields.
 String[] getAllRootGroupIds()
          Returns all the Groups without a superGroup.
 String[] getAllRootGroupIdsOfDomain(int domainId)
          Returns all the Root Group Ids having a given domain id.
 GroupRow[] getAllRootGroups()
          Returns all the Groups without a superGroup.
 GroupRow[] getAllRootGroupsOfDomain(int domainId)
          Returns all the Root Groups having a given domain id.
 String[] getDirectGroupIdsInGroupUserRole(int groupUserRoleId)
          Returns all the group ids in a given groupUserRole (not recursive).
 String[] getDirectGroupIdsInSpaceUserRole(int spaceUserRoleId)
          Returns all the group ids in a given spaceUserRole (not recursive).
 String[] getDirectGroupIdsInUserRole(int userRoleId)
          Returns all the groups in a given userRole (not recursive).
 GroupRow[] getDirectGroupsInGroupUserRole(int groupUserRoleId)
          Returns all the groups in a given groupUserRole (not recursive).
 GroupRow[] getDirectGroupsOfUser(int userId)
          Returns all the groups of a given user (not recursive).
 String[] getDirectSubGroupIds(int superGroupId)
          Returns all the Group ids having a given superGroup.
 GroupRow[] getDirectSubGroups(int superGroupId)
          Returns all the Groups having a given superGroup.
 GroupRow getGroup(int id)
          Returns the Group whith the given id.
 GroupRow getGroup(int superGroupId, String name)
          Returns the Group whith the given name in the given super group.
 GroupRow getGroupBySpecificId(int domainId, String specificId)
          Returns Group whith the given specificId and domainId.
 GroupRow getGroupOfGroupUserRole(int groupUserRoleId)
          Returns the Group of a given group user role.
 GroupRow getRootGroup(String name)
          Returns the root Group whith the given name.
 GroupRow getSuperGroup(int subGroupId)
          Returns the superGroup of a given subGroup.
 GroupRow[] getSynchronizedGroups()
          Returns all the Groups.
protected  void prepareInsert(String insertQuery, PreparedStatement insert, GroupRow row)
          Set all the parameters of the insert PreparedStatement built from the insertQuery in order to insert the given row.
protected  void prepareUpdate(String updateQuery, PreparedStatement update, GroupRow row)
          Set all the parameters of the update PreparedStatement built from the updateQuery in order to update the given row.
 void removeGroup(int id)
          Delete the group and all the sub-groups
 void removeUserFromGroup(int userId, int groupId)
          Removes an user from this group.
 void removeUsersFromGroup(String[] userIds, int groupId, boolean checkRelation)
          Add an user in this group.
 GroupRow[] searchGroups(GroupRow groupModel, boolean isAnd)
          Returns all the Groups satiffying the model
 String[] searchGroupsIds(boolean isRootGroup, int componentId, int[] aRoleId, GroupRow groupModel)
          Returns all the Groups satifying the model that are direct childs of a specific group
 void updateGroup(GroupRow group)
          Updates a group row.
 
Methods inherited from class com.stratelia.webactiv.organization.Table
addIdToQuery, addParamToQuery, addParamToQuery, addParamToQuery, aliasColumns, getCount, getCount, getIds, getIds, getIds, getIds, getInteger, getInteger, getMatchingRows, getNextId, getRows, getRows, getRows, getRows, getUniqueRow, getUniqueRow, getUniqueRow, insertRow, performPrepareStatementParams, truncate, updateRelation, updateRelation, updateRelation, updateRow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupTable

public GroupTable(OrganizationSchema schema)
Method Detail

fetchGroup

protected GroupRow fetchGroup(ResultSet rs)
                       throws SQLException
Fetch the current group row from a resultSet.

Parameters:
rs -
Returns:
Throws:
SQLException

getGroup

public GroupRow getGroup(int id)
                  throws AdminPersistenceException
Returns the Group whith the given id.

Parameters:
id -
Returns:
the Group whith the given id.
Throws:
AdminPersistenceException

getGroupBySpecificId

public GroupRow getGroupBySpecificId(int domainId,
                                     String specificId)
                              throws AdminPersistenceException
Returns Group whith the given specificId and domainId.

Parameters:
domainId -
specificId -
Returns:
Group whith the given specificId and domainId.
Throws:
AdminPersistenceException

getRootGroup

public GroupRow getRootGroup(String name)
                      throws AdminPersistenceException
Returns the root Group whith the given name.

Parameters:
name -
Returns:
the root Group whith the given name.
Throws:
AdminPersistenceException

getGroup

public GroupRow getGroup(int superGroupId,
                         String name)
                  throws AdminPersistenceException
Returns the Group whith the given name in the given super group.

Parameters:
superGroupId -
name -
Returns:
the Group whith the given name in the given super group.
Throws:
AdminPersistenceException

getAllGroups

public GroupRow[] getAllGroups()
                        throws AdminPersistenceException
Returns all the Groups.

Returns:
all the Groups.
Throws:
AdminPersistenceException

getSynchronizedGroups

public GroupRow[] getSynchronizedGroups()
                                 throws AdminPersistenceException
Returns all the Groups.

Throws:
AdminPersistenceException

getAllGroupIds

public String[] getAllGroupIds()
                        throws AdminPersistenceException
Returns all the Group ids.

Returns:
all the Group ids.
Throws:
AdminPersistenceException

getAllRootGroups

public GroupRow[] getAllRootGroups()
                            throws AdminPersistenceException
Returns all the Groups without a superGroup.

Returns:
all the Groups without a superGroup.
Throws:
AdminPersistenceException

getAllRootGroupIds

public String[] getAllRootGroupIds()
                            throws AdminPersistenceException
Returns all the Groups without a superGroup.

Returns:
all the Groups without a superGroup.
Throws:
AdminPersistenceException

getDirectSubGroups

public GroupRow[] getDirectSubGroups(int superGroupId)
                              throws AdminPersistenceException
Returns all the Groups having a given superGroup.

Parameters:
superGroupId -
Returns:
all the Groups having a given superGroup.
Throws:
AdminPersistenceException

getDirectSubGroupIds

public String[] getDirectSubGroupIds(int superGroupId)
                              throws AdminPersistenceException
Returns all the Group ids having a given superGroup.

Parameters:
superGroupId -
Returns:
Throws:
AdminPersistenceException

getAllRootGroupsOfDomain

public GroupRow[] getAllRootGroupsOfDomain(int domainId)
                                    throws AdminPersistenceException
Returns all the Root Groups having a given domain id.

Parameters:
domainId -
Returns:
all the Root Groups having a given domain id.
Throws:
AdminPersistenceException

getAllRootGroupIdsOfDomain

public String[] getAllRootGroupIdsOfDomain(int domainId)
                                    throws AdminPersistenceException
Returns all the Root Group Ids having a given domain id.

Parameters:
domainId -
Returns:
all the Root Group Ids having a given domain id.
Throws:
AdminPersistenceException

getAllGroupsOfDomain

public GroupRow[] getAllGroupsOfDomain(int domainId)
                                throws AdminPersistenceException
Returns all the Groups having a given domain id.

Parameters:
domainId -
Returns:
all the Groups having a given domain id.
Throws:
AdminPersistenceException

getSuperGroup

public GroupRow getSuperGroup(int subGroupId)
                       throws AdminPersistenceException
Returns the superGroup of a given subGroup.

Parameters:
subGroupId -
Returns:
the superGroup of a given subGroup.
Throws:
AdminPersistenceException

getDirectGroupsOfUser

public GroupRow[] getDirectGroupsOfUser(int userId)
                                 throws AdminPersistenceException
Returns all the groups of a given user (not recursive).

Parameters:
userId -
Returns:
all the groups of a given user (not recursive).
Throws:
AdminPersistenceException

getDirectGroupIdsInUserRole

public String[] getDirectGroupIdsInUserRole(int userRoleId)
                                     throws AdminPersistenceException
Returns all the groups in a given userRole (not recursive).

Parameters:
userRoleId -
Returns:
all the groups in a given userRole (not recursive).
Throws:
AdminPersistenceException

getDirectGroupIdsInSpaceUserRole

public String[] getDirectGroupIdsInSpaceUserRole(int spaceUserRoleId)
                                          throws AdminPersistenceException
Returns all the group ids in a given spaceUserRole (not recursive).

Parameters:
spaceUserRoleId -
Returns:
all the group ids in a given spaceUserRole (not recursive).
Throws:
AdminPersistenceException

getDirectGroupsInGroupUserRole

public GroupRow[] getDirectGroupsInGroupUserRole(int groupUserRoleId)
                                          throws AdminPersistenceException
Returns all the groups in a given groupUserRole (not recursive).

Parameters:
groupUserRoleId -
Returns:
all the groups in a given groupUserRole (not recursive).
Throws:
AdminPersistenceException

getGroupOfGroupUserRole

public GroupRow getGroupOfGroupUserRole(int groupUserRoleId)
                                 throws AdminPersistenceException
Returns the Group of a given group user role.

Parameters:
groupUserRoleId -
Returns:
the Group of a given group user role.
Throws:
AdminPersistenceException

getDirectGroupIdsInGroupUserRole

public String[] getDirectGroupIdsInGroupUserRole(int groupUserRoleId)
                                          throws AdminPersistenceException
Returns all the group ids in a given groupUserRole (not recursive).

Parameters:
groupUserRoleId -
Returns:
all the group ids in a given groupUserRole (not recursive).
Throws:
AdminPersistenceException

getAllMatchingGroups

public GroupRow[] getAllMatchingGroups(GroupRow sampleGroup)
                                throws AdminPersistenceException
Returns the Group whose fields match those of the given sample group fields.

Parameters:
sampleGroup -
Returns:
the Group whose fields match those of the given sample group fields.
Throws:
AdminPersistenceException

searchGroupsIds

public String[] searchGroupsIds(boolean isRootGroup,
                                int componentId,
                                int[] aRoleId,
                                GroupRow groupModel)
                         throws AdminPersistenceException
Returns all the Groups satifying the model that are direct childs of a specific group

Parameters:
isRootGroup -
componentId -
aRoleId -
groupModel -
Returns:
all the Groups satifying the model that are direct childs of a specific group
Throws:
AdminPersistenceException

searchGroups

public GroupRow[] searchGroups(GroupRow groupModel,
                               boolean isAnd)
                        throws AdminPersistenceException
Returns all the Groups satiffying the model

Parameters:
groupModel -
isAnd -
Returns:
Throws:
AdminPersistenceException

createGroup

public void createGroup(GroupRow group)
                 throws AdminPersistenceException
Insert a new group row.

Parameters:
group -
Throws:
AdminPersistenceException

prepareInsert

protected void prepareInsert(String insertQuery,
                             PreparedStatement insert,
                             GroupRow row)
                      throws SQLException
Description copied from class: Table
Set all the parameters of the insert PreparedStatement built from the insertQuery in order to insert the given row.

Specified by:
prepareInsert in class Table<GroupRow>
Throws:
SQLException

updateGroup

public void updateGroup(GroupRow group)
                 throws AdminPersistenceException
Updates a group row.

Parameters:
group -
Throws:
AdminPersistenceException

prepareUpdate

protected void prepareUpdate(String updateQuery,
                             PreparedStatement update,
                             GroupRow row)
                      throws SQLException
Description copied from class: Table
Set all the parameters of the update PreparedStatement built from the updateQuery in order to update the given row.

Specified by:
prepareUpdate in class Table<GroupRow>
Throws:
SQLException

removeGroup

public void removeGroup(int id)
                 throws AdminPersistenceException
Delete the group and all the sub-groups

Parameters:
id -
Throws:
AdminPersistenceException

addUserInGroup

public void addUserInGroup(int userId,
                           int groupId)
                    throws AdminPersistenceException
Add an user in this group.

Parameters:
userId -
groupId -
Throws:
AdminPersistenceException

addUsersInGroup

public void addUsersInGroup(String[] userIds,
                            int groupId,
                            boolean checkRelation)
                     throws AdminPersistenceException
Add an user in this group.

Parameters:
userIds -
groupId -
checkRelation -
Throws:
AdminPersistenceException

removeUserFromGroup

public void removeUserFromGroup(int userId,
                                int groupId)
                         throws AdminPersistenceException
Removes an user from this group.

Parameters:
userId -
groupId -
Throws:
AdminPersistenceException

removeUsersFromGroup

public void removeUsersFromGroup(String[] userIds,
                                 int groupId,
                                 boolean checkRelation)
                          throws AdminPersistenceException
Add an user in this group.

Parameters:
userIds -
groupId -
checkRelation -
Throws:
AdminPersistenceException

fetchRow

protected GroupRow fetchRow(ResultSet rs)
                     throws SQLException
Fetch the current group row from a resultSet.

Specified by:
fetchRow in class Table<GroupRow>
Parameters:
rs -
Returns:
Throws:
SQLException


Copyright © 2016 Silverpeas. All Rights Reserved.