Package com.simplicite.util
Class GroupDB
- java.lang.Object
-
- com.simplicite.util.GroupDB
-
- All Implemented Interfaces:
java.io.Serializable
public class GroupDB extends java.lang.Object implements java.io.Serializable
Group rights and hierarchy- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GroupDB.GroupUserFilter
Group user filterstatic class
GroupDB.ObjectDefinition
Object rights within group
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
TYPE_DOCUMENT
Document rightsstatic java.lang.String
TYPE_GRANT
Objects rightsstatic java.lang.String
TYPE_NOTIFICATION
Notification group or topicstatic java.lang.String
TYPE_REGISTRY
Registration rightsstatic java.lang.String
TYPE_WORKFLOW
Workflow rights
-
Constructor Summary
Constructors Constructor Description GroupDB(java.lang.String id, java.lang.String name, java.lang.String type)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addChild(GroupDB group)
Add a group to childrenvoid
addDomain(java.lang.String domain)
Add an accessible domainGroupDB.ObjectDefinition
addObject(java.lang.String object, boolean intern, java.lang.String module, java.lang.String scriptId, java.lang.String dbtable, java.lang.String location)
Add an object in groupvoid
addProcess(java.lang.String process)
Add a process to accessible processes for the groupvoid
addProfile(GroupDB group)
Add a group to profilevoid
addShortcut(Shortcut shortcut)
Add a shortcut to accessible shortcutsvoid
addSimpleView(View view)
Add simple viewvoid
addUserFilter(java.lang.String field, java.lang.String object)
Add user filter to accessible user filtersvoid
addWebZone(WebZone webzone)
Add a web zone to accessible web zonesvoid
clearShortcuts()
Clear accessible shortcutsvoid
clearWebZones()
Clear accessible web zonesjava.util.List<GroupDB>
getChildren()
Get the childrenjava.lang.String
getDisplay(java.lang.String lang)
Get group display labeljava.util.List<java.lang.String>
getDomains()
Get Accessible domainsstatic java.lang.String
getGroupId(java.lang.String name)
Returns group ID for specified namestatic java.util.List<java.lang.String[]>
getGroups(java.lang.String type, java.lang.String lang)
List non-cached groupsjava.lang.String
getHelp(java.lang.String lang)
Get short descriptionjava.lang.String
getHomePage()
Get related home page to determine a scopejava.lang.String
getId()
Get the group IDjava.lang.String
getName()
Get the group nameGroupDB.ObjectDefinition
getObject(java.lang.String object)
Get an accessible object for the groupjava.util.Map<java.lang.String,GroupDB.ObjectDefinition>
getObjects()
Get all accessible objects for the groupGroupDB
getParent()
Get the parent groupjava.util.List<java.lang.String>
getProcesses()
Get all accessible processes for the groupjava.util.List<GroupDB>
getProfile()
Get the profile (set of groups)java.util.List<Shortcut>
getShortcuts()
Get all accessible Shortcuts for the groupjava.util.List<View>
getSimpleViews()
Get all accessible Views for the groupjava.util.List<GroupDB.GroupUserFilter>
getUserFilters()
Get all accessible user filtersstatic java.lang.String
getUserId(java.lang.String login)
Deprecated.Use Grant.getUserIdstatic java.lang.String
getUserLogin(java.lang.String userId)
Deprecated.Use Grant.getUserLoginstatic java.lang.String
getUserModuleId(java.lang.String login)
Deprecated.Use Grant.getUserModuleIdstatic java.util.List<java.lang.String>
getUsers(java.lang.String group, java.lang.String date, java.lang.Boolean activ)
List users granted to one groupjava.util.List<WebZone>
getWebZones()
Get all accessible web zones for the groupboolean
hasDateRangeFilter()
Does the group contains at least one object with a date range for the user filtering?boolean
hasType(java.lang.String type)
Has type?static boolean
isDesignerUser(java.lang.String login)
Deprecated.Use Grant.isDesignerUserstatic boolean
isPublicUser(java.lang.String login)
Deprecated.Use Grant.isPublicUserstatic boolean
isSystemGroup(java.lang.String name)
Indicates whether specified group is a system groupstatic boolean
isSystemUser(java.lang.String login)
Deprecated.Use Grant.isSystemUservoid
removeChild(GroupDB group)
Remove a group from childrenvoid
removeProfile(GroupDB group)
Remove a group in profilevoid
setDateRangeFilter(boolean b)
Set whether the group contains at least one object with a date range for the user filteringvoid
setDisplay(java.lang.String lang, java.lang.String label)
Set group display labelvoid
setHelp(java.lang.String lang, java.lang.String help)
Set short descriptionvoid
setHomePage(java.lang.String home)
Set related home page to determine a scopevoid
setParent(GroupDB group)
Set the parent groupvoid
setType(java.lang.String type)
Set typejava.lang.String
toString()
Get string representation
-
-
-
Field Detail
-
TYPE_GRANT
public static final java.lang.String TYPE_GRANT
Objects rights- See Also:
- Constant Field Values
-
TYPE_DOCUMENT
public static final java.lang.String TYPE_DOCUMENT
Document rights- See Also:
- Constant Field Values
-
TYPE_WORKFLOW
public static final java.lang.String TYPE_WORKFLOW
Workflow rights- See Also:
- Constant Field Values
-
TYPE_REGISTRY
public static final java.lang.String TYPE_REGISTRY
Registration rights- See Also:
- Constant Field Values
-
TYPE_NOTIFICATION
public static final java.lang.String TYPE_NOTIFICATION
Notification group or topic- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
public java.lang.String getId()
Get the group ID- Returns:
- Group ID
-
getName
public java.lang.String getName()
Get the group name- Returns:
- Group name
-
getDisplay
public java.lang.String getDisplay(java.lang.String lang)
Get group display label- Returns:
- Display label
-
setDisplay
public void setDisplay(java.lang.String lang, java.lang.String label)
Set group display label- Parameters:
lang
- Languagelabel
- Display label
-
getHelp
public java.lang.String getHelp(java.lang.String lang)
Get short description- Parameters:
lang
- Language- Returns:
- SHort description
-
setHelp
public void setHelp(java.lang.String lang, java.lang.String help)
Set short description- Parameters:
lang
- Languagehelp
- Short description
-
setType
public void setType(java.lang.String type)
Set type- Parameters:
type
- Type (one of GroupDB.TYPE_*)
-
hasType
public boolean hasType(java.lang.String type)
Has type?- Parameters:
type
- Type (one of GroupDB.TYPE_*)- Returns:
- True if has type
-
getParent
public GroupDB getParent()
Get the parent group- Returns:
- Parent group
-
setParent
public void setParent(GroupDB group)
Set the parent group- Parameters:
group
- Parent group
-
getChildren
public java.util.List<GroupDB> getChildren()
Get the children- Returns:
- List of childern groups
-
addChild
public void addChild(GroupDB group)
Add a group to children- Parameters:
group
- Child group to add
-
removeChild
public void removeChild(GroupDB group)
Remove a group from children- Parameters:
group
- Child group to remove
-
getProfile
public java.util.List<GroupDB> getProfile()
Get the profile (set of groups)- Returns:
- Profile
-
addProfile
public void addProfile(GroupDB group)
Add a group to profile- Parameters:
group
- Group to add
-
removeProfile
public void removeProfile(GroupDB group)
Remove a group in profile- Parameters:
group
- Group to remove
-
getHomePage
public java.lang.String getHomePage()
Get related home page to determine a scope- Returns:
- Home page name
-
setHomePage
public void setHomePage(java.lang.String home)
Set related home page to determine a scope- Parameters:
home
- Home page name
-
getDomains
public java.util.List<java.lang.String> getDomains()
Get Accessible domains- Returns:
- List of accessible domains
-
addDomain
public void addDomain(java.lang.String domain)
Add an accessible domain- Parameters:
domain
- Domain to add
-
getObjects
public java.util.Map<java.lang.String,GroupDB.ObjectDefinition> getObjects()
Get all accessible objects for the group- Returns:
- All accessible objects definitions for the group
-
getObject
public GroupDB.ObjectDefinition getObject(java.lang.String object)
Get an accessible object for the group- Returns:
- An accessible object definitions for the group
-
addObject
public GroupDB.ObjectDefinition addObject(java.lang.String object, boolean intern, java.lang.String module, java.lang.String scriptId, java.lang.String dbtable, java.lang.String location)
Add an object in group- Parameters:
object
- Object nameintern
- Internal or Externalmodule
- Module namescriptId
- Optional scriptdbtable
- Table name definition (may be in the form datasource;table)location
- Implementation location
-
getSimpleViews
public java.util.List<View> getSimpleViews()
Get all accessible Views for the group
-
addSimpleView
public void addSimpleView(View view)
Add simple view- Parameters:
view
- View
-
getProcesses
public java.util.List<java.lang.String> getProcesses()
Get all accessible processes for the group- Returns:
- List of processes
-
addProcess
public void addProcess(java.lang.String process)
Add a process to accessible processes for the group- Parameters:
process
- Process
-
getShortcuts
public java.util.List<Shortcut> getShortcuts()
Get all accessible Shortcuts for the group- Returns:
- List of shortcuts
-
clearShortcuts
public void clearShortcuts()
Clear accessible shortcuts
-
addShortcut
public void addShortcut(Shortcut shortcut)
Add a shortcut to accessible shortcuts- Parameters:
shortcut
- Shortcut
-
getWebZones
public java.util.List<WebZone> getWebZones()
Get all accessible web zones for the group- Returns:
- List of web zones
-
clearWebZones
public void clearWebZones()
Clear accessible web zones
-
addWebZone
public void addWebZone(WebZone webzone)
Add a web zone to accessible web zones- Parameters:
webzone
- Web zone
-
getUserFilters
public java.util.List<GroupDB.GroupUserFilter> getUserFilters()
Get all accessible user filters- Returns:
- List of user filters
-
addUserFilter
public void addUserFilter(java.lang.String field, java.lang.String object)
Add user filter to accessible user filters- Parameters:
field
- Fieldobject
- Object
-
hasDateRangeFilter
public boolean hasDateRangeFilter()
Does the group contains at least one object with a date range for the user filtering?- Returns:
- True if the group contains at least one object with a date range for the user filtering
-
setDateRangeFilter
public void setDateRangeFilter(boolean b)
Set whether the group contains at least one object with a date range for the user filtering- Parameters:
b
- Contains?
-
isSystemGroup
public static boolean isSystemGroup(java.lang.String name)
Indicates whether specified group is a system group- Parameters:
name
- Group name
-
getGroupId
public static java.lang.String getGroupId(java.lang.String name)
Returns group ID for specified name- Parameters:
name
- Group name
-
isSystemUser
@Deprecated public static boolean isSystemUser(java.lang.String login)
Deprecated.Use Grant.isSystemUser
-
isPublicUser
@Deprecated public static boolean isPublicUser(java.lang.String login)
Deprecated.Use Grant.isPublicUser
-
isDesignerUser
@Deprecated public static boolean isDesignerUser(java.lang.String login)
Deprecated.Use Grant.isDesignerUser
-
getUserId
@Deprecated public static java.lang.String getUserId(java.lang.String login)
Deprecated.Use Grant.getUserId
-
getUserLogin
@Deprecated public static java.lang.String getUserLogin(java.lang.String userId)
Deprecated.Use Grant.getUserLogin
-
getUserModuleId
@Deprecated public static java.lang.String getUserModuleId(java.lang.String login)
Deprecated.Use Grant.getUserModuleId
-
getUsers
public static java.util.List<java.lang.String> getUsers(java.lang.String group, java.lang.String date, java.lang.Boolean activ)
List users granted to one group- Parameters:
group
- Group namedate
- Optional responsibility date YYYY-MM-DDactiv
- Optional responsibility active flag- Returns:
- List of logins
-
getGroups
public static java.util.List<java.lang.String[]> getGroups(java.lang.String type, java.lang.String lang)
List non-cached groups- Parameters:
type
- optional group type (ex TYPE_GRANT)lang
- optional language- Returns:
- List of groups name + label
-
toString
public java.lang.String toString()
Get string representation- Overrides:
toString
in classjava.lang.Object
- Returns:
- String representation
-
-