com.groiss.org
Interface OrgData

All Superinterfaces:
java.rmi.Remote, RemoteOrgData

public interface OrgData
extends RemoteOrgData

This interface allows access to the organizational data stored in @enterprise.


Method Summary
 java.util.List<java.lang.String> checkPasswordPolicy(java.lang.String password)
          Check a password against the password policy.
 OrgTree createOrgTree()
          Return a new organizational tree.
 OrgUnit createOrgUnit()
          Create a new OrgUnit object.
 Permission createPermission()
          Create a new Permission
 PermissionList createPermissionList()
          Create a new PermissionList
 Right createRight()
          Create a new Right.
 Role createRole()
          Create a new Role object.
 User createUser()
          Create a new User object.
 UserRole createUserRole()
          Create a new user-role relation
 void delete(Persistent o)
          Delete the object including right check.
 void deleteCascade(OrgUnit ou)
          Delete the passed organizational unit and also objects which are of no use without it.
 void deleteObjectExtension(Persistent obj, java.lang.String formclass)
          delete the object extension for the given object.
<T> T
get(java.lang.Class<? extends T> c, long oid)
          Get an object from the org-data database.
<T> T
get(java.lang.String classname, long oid)
          Get an object from the org-data database.
 Application getApplication(long oid)
          Get an application from the org-data database.
<T> T
getById(java.lang.Class<? extends T> c, java.lang.String id)
          Get an object from the org-data database.
<T> T
getById(java.lang.String classname, java.lang.String id)
          Get an object from the org-data database.
 OrgUnit getHomeOrg(User u)
          Return the Org.unit where the user has the home role.
 java.util.List<LogEntry> getLogEntries(java.lang.String classname, long oid, java.util.Date from, java.util.Date to)
          Returns a list of log entries for the specified object (identified by passed oid and classname) which were made withing the specified time range
 Persistent getObjectExtension(Persistent obj, java.lang.String formclass, boolean create)
          Returns the extension object to a persistent.
 OrgUnit getOrgUnit(long oid)
          Get an OrgUnit from the org-data database.
 java.lang.String getPolicyInfoText(User u)
          Checks if there are any hints for the user according to the password policy.
 Right getRight(long oid)
          Get an Right from the org-data database.
 Role getRole(long oid)
          Get an Role from the org-data database.
 java.util.Map<? extends Role,java.util.Set<java.lang.String>> getRoles(User u)
          Returns a Map of the roles - and depts - of a user.
 java.util.List<Role> getRoles(User u, OrgUnit d)
          Return the roles a user has in a OrgUnit.
 java.util.List<OrgUnit> getSubOrgs(OrgUnit ou, OrgTree tree)
          Return the list of the organizational units that are below the given oe in the given tree.
 OrgUnit getSuperOrg(OrgUnit ou, OrgTree tree)
          Return the organizational unit that is above the given oe in the given tree.
 User getUser(long oid)
          Get an user from the org-data database.
 java.lang.String getUserProperty(User u, java.lang.String key)
          Use this method to get a user property.
<T extends Persistent>
T
getVersion(T o, java.util.Date d)
          Returns the version of the object at a given date.
 boolean hasRight(User u, Right r, java.lang.Object o)
          Checks whether the given user has the given right on the given object.
 boolean hasRole(User u, Role r, OrgUnit d, Application appl)
          Has the user u the role r in the org.unit d?
 void insert(Persistent o)
          Insert the object including right check.
 boolean isInTree(OrgUnit ou, OrgTree tree)
          Is the given org-unit in the specified org-tree.
<T> java.util.List<T>
list(java.lang.Class<? extends T> c, java.lang.String cond, java.lang.String order)
          Deprecated. since ep 8.0, use list(Class, String, String, Object[])
<T> java.util.List<T>
list(java.lang.Class<? extends T> c, java.lang.String cond, java.lang.String order, java.lang.Object[] bindVars)
          Get a list of objects from the org-data database.
 java.util.List<Persistent> list(java.lang.String classname, java.lang.String cond, java.lang.String order, java.lang.Object[] bindVars)
          Get a list of objects from the org-data database.
 java.util.Map<User,java.lang.Object> listUsersWithRole(Role r, OrgUnit ou, Application appl)
          List the users that have a role
<T> java.util.List<T>
listWithRightCheck(User u, java.lang.Class<? extends T> clazz, java.lang.String condition, java.lang.String order, java.lang.Object[] args, Right right, Application app, boolean ignoreDepts)
          Returns a list of all objects of the specified object class for which the specified user has the specified right and for which the condition matches.
<T extends Persistent>
java.util.List<T>
listWithRightCheck(User u, java.lang.String classname, java.lang.String condition, java.lang.String order, java.lang.Object[] bindVars, Right right, Application app, boolean ignoreDepts)
          Returns a list of all objects of the specified object class for which the specified user has the specified right and for which the condition matches.
 boolean mayDelete(User u, Persistent o)
          Check whether the user may delete the object.
 boolean mayExecute(User u, Persistent o)
          Check whether the user may execute the object (function).
 boolean mayInsert(User u, Persistent o)
          Check whether the user may create the object (insert it into the database).
 boolean mayUpdate(User u, Persistent o)
          Check whether the user may edit the object.
 boolean mayView(User u, Persistent o)
          Check whether the user may view the object.
 void placeOrgInTree(OrgUnit parent, OrgUnit child, OrgTree tree)
          Change the organizational hierarchy.
 User setPassword(User u, java.lang.String password)
          Set the password of a user.
 void setUserProperty(User u, java.lang.String key, java.lang.String value)
          Set a user property.
 void update(Persistent o)
          Update the object including right check.
 

Method Detail

get

<T> T get(java.lang.Class<? extends T> c,
          long oid)
Get an object from the org-data database. The class is one of User, Right, Role, OrgUnit, Application, OrgTree. All of them from this package.

Specified by:
get in interface RemoteOrgData
Parameters:
c - the class
oid - the unique oid of the object
Returns:
the object, you can cast the result to the class you specified in the first argument

get

<T> T get(java.lang.String classname,
          long oid)
Get an object from the org-data database. The classname is one of User, Right, Role, OrgUnit, Application, OrgTree. All of them from this package.

Specified by:
get in interface RemoteOrgData
Parameters:
classname - the classname
oid - the unique oid of the object
Returns:
the object, you can cast the result to the class you specified in the first argument

getUser

User getUser(long oid)
Get an user from the org-data database.

Specified by:
getUser in interface RemoteOrgData
Parameters:
oid - the unique oid of the object
Returns:
the requested user

getUserProperty

java.lang.String getUserProperty(User u,
                                 java.lang.String key)
Use this method to get a user property. The method accesses system defined as well as application defined properties.

Specified by:
getUserProperty in interface RemoteOrgData
Parameters:
u - The user of which you want to get a property.
key - The property key.
Returns:
Returns the property value as String or null if no such property exists.

setUserProperty

void setUserProperty(User u,
                     java.lang.String key,
                     java.lang.String value)
Set a user property. The method accesses system defined as well as application defined properties.

Specified by:
setUserProperty in interface RemoteOrgData
Parameters:
u - The user of which you want to get a property.
key - The property key.
value - the property value

getRole

Role getRole(long oid)
Get an Role from the org-data database.

Specified by:
getRole in interface RemoteOrgData
Parameters:
oid - the unique oid of the object
Returns:
the requested Role

getRight

Right getRight(long oid)
Get an Right from the org-data database.

Specified by:
getRight in interface RemoteOrgData
Parameters:
oid - the unique oid of the object
Returns:
the requested Right

getOrgUnit

OrgUnit getOrgUnit(long oid)
Get an OrgUnit from the org-data database.

Specified by:
getOrgUnit in interface RemoteOrgData
Parameters:
oid - the unique oid of the object
Returns:
the requested OrgUnit

getApplication

Application getApplication(long oid)
Get an application from the org-data database.

Specified by:
getApplication in interface RemoteOrgData
Parameters:
oid - the unique oid of the object
Returns:
the requested application

getById

<T> T getById(java.lang.Class<? extends T> c,
              java.lang.String id)
Get an object from the org-data database. The class is one of User, Right, Role, OrgUnit, Application, OrgTree. All of them from this package.

Specified by:
getById in interface RemoteOrgData
Parameters:
c - the class
id - the id of the object
Returns:
the object, you can cast the result to the class you specified in the first argument

getById

<T> T getById(java.lang.String classname,
              java.lang.String id)
Get an object from the org-data database. The classname is one of User, Right, Role, OrgUnit, Application, OrgTree. All of them from this package.

Specified by:
getById in interface RemoteOrgData
Parameters:
classname - the classname
id - the id of the object
Returns:
the object, you can cast the result to the class you specified in the first argument

getHomeOrg

OrgUnit getHomeOrg(User u)
Return the Org.unit where the user has the home role.

Specified by:
getHomeOrg in interface RemoteOrgData
Parameters:
u - the User
Returns:
the OrgUnit

list

@Deprecated
<T> java.util.List<T> list(java.lang.Class<? extends T> c,
                                      java.lang.String cond,
                                      java.lang.String order)
Deprecated. since ep 8.0, use list(Class, String, String, Object[])

Get a list of objects from the org-data database. The class is one of User, Right, Role, OrgUnit, Application, OrgTree. All of them from this package.

Specified by:
list in interface RemoteOrgData
Parameters:
c - the class
cond - the condition expression
order - the order attribute(s), comma-separated if more than one
Returns:
a list of objects of the given class

list

<T> java.util.List<T> list(java.lang.Class<? extends T> c,
                           java.lang.String cond,
                           java.lang.String order,
                           java.lang.Object[] bindVars)
Get a list of objects from the org-data database. The class is one of User, Right, Role, OrgUnit, Application, OrgTree. All of them from this package.

Specified by:
list in interface RemoteOrgData
Parameters:
c - the class
cond - the condition expression
order - the order attribute(s), comma-separated if more than one
bindVars - if the condition contains place holders for binding variables this array should contain the values
Returns:
a list of objects of the given class

list

java.util.List<Persistent> list(java.lang.String classname,
                                java.lang.String cond,
                                java.lang.String order,
                                java.lang.Object[] bindVars)
Get a list of objects from the org-data database. The classname is one of fully qualified name of User, Right, Role, OrgUnit, Application, OrgTree. All of them from this package.

Specified by:
list in interface RemoteOrgData
Parameters:
classname - the fully qualified name of the class of the object
cond - the condition expression
order - the order attribute(s), comma-separated if more than one
bindVars - if the condition contains place holders for binding variables this array should contain the values
Returns:
a list of objects of the given class

getRoles

java.util.Map<? extends Role,java.util.Set<java.lang.String>> getRoles(User u)
Returns a Map of the roles - and depts - of a user.

Specified by:
getRoles in interface RemoteOrgData
Parameters:
u - the user
Returns:
a Map where the first keys are the roles, the values are Sets again, containing strings of the form deptoid or form deptoid*depttreeoid. If the role is global, this Set is empty.

getRoles

java.util.List<Role> getRoles(User u,
                              OrgUnit d)
Return the roles a user has in a OrgUnit.

Specified by:
getRoles in interface RemoteOrgData
Parameters:
u - the user
d - the OrgUnit
Returns:
a list of roles

hasRole

boolean hasRole(User u,
                Role r,
                OrgUnit d,
                Application appl)
Has the user u the role r in the org.unit d?

Specified by:
hasRole in interface RemoteOrgData
Parameters:
u - the user
r - the role
d - the OrgUnit
Returns:
true, if the user has the role.

hasRight

boolean hasRight(User u,
                 Right r,
                 java.lang.Object o)
Checks whether the given user has the given right on the given object. See the description of the @enterprise right system for details.

Specified by:
hasRight in interface RemoteOrgData
Parameters:
u - the user
r - the right
o - the object (may be null)
Returns:
true if the user has the right

listWithRightCheck

<T> java.util.List<T> listWithRightCheck(User u,
                                         java.lang.Class<? extends T> clazz,
                                         java.lang.String condition,
                                         java.lang.String order,
                                         java.lang.Object[] args,
                                         Right right,
                                         Application app,
                                         boolean ignoreDepts)
Returns a list of all objects of the specified object class for which the specified user has the specified right and for which the condition matches.

Specified by:
listWithRightCheck in interface RemoteOrgData
Parameters:
u - the user
clazz - class which instances are wanted
condition - a SQL condition
order - a comma separated list of attribute names of the given class.
args - if the condition contains place holders for binding variables this array should contain the values
right - the right
app - the application which departement tree should be used for checking
ignoreDepts - ignore the right a user has via dept scope
Returns:
the list

listWithRightCheck

<T extends Persistent> java.util.List<T> listWithRightCheck(User u,
                                                            java.lang.String classname,
                                                            java.lang.String condition,
                                                            java.lang.String order,
                                                            java.lang.Object[] bindVars,
                                                            Right right,
                                                            Application app,
                                                            boolean ignoreDepts)
Returns a list of all objects of the specified object class for which the specified user has the specified right and for which the condition matches.

Specified by:
listWithRightCheck in interface RemoteOrgData
Parameters:
u - the user
classname - the fully qualified name of the class of the object
condition - a SQL condition
order - a comma separated list of attribute names of the given class.
bindVars - if the condition contains place holders for binding variables this array should contain the values
right - the right
app - the application which departement tree should be used for checking
ignoreDepts - ignore the right a user has via dept scope
Returns:
the list

mayInsert

boolean mayInsert(User u,
                  Persistent o)
Check whether the user may create the object (insert it into the database).

Specified by:
mayInsert in interface RemoteOrgData
Parameters:
u - the user requesting the access
o - the object
Returns:
true, if access is allowed.

mayUpdate

boolean mayUpdate(User u,
                  Persistent o)
Check whether the user may edit the object.

Specified by:
mayUpdate in interface RemoteOrgData
Parameters:
u - the user requesting the access
o - the object
Returns:
true, if access is allowed.

mayView

boolean mayView(User u,
                Persistent o)
Check whether the user may view the object.

Specified by:
mayView in interface RemoteOrgData
Parameters:
u - the user requesting the access
o - the object
Returns:
true, if access is allowed.

mayExecute

boolean mayExecute(User u,
                   Persistent o)
Check whether the user may execute the object (function).

Specified by:
mayExecute in interface RemoteOrgData
Parameters:
u - the user requesting the access
o - the object
Returns:
true, if access is allowed.

mayDelete

boolean mayDelete(User u,
                  Persistent o)
Check whether the user may delete the object.

Specified by:
mayDelete in interface RemoteOrgData
Parameters:
u - the user requesting the access
o - the object
Returns:
true, if access is allowed.

insert

void insert(Persistent o)
Insert the object including right check.

Specified by:
insert in interface RemoteOrgData
Parameters:
o - the object

update

void update(Persistent o)
Update the object including right check.

Specified by:
update in interface RemoteOrgData
Parameters:
o - the object

delete

void delete(Persistent o)
Delete the object including right check.

Specified by:
delete in interface RemoteOrgData
Parameters:
o - the object

getVersion

<T extends Persistent> T getVersion(T o,
                                    java.util.Date d)
Returns the version of the object at a given date.

Specified by:
getVersion in interface RemoteOrgData
Parameters:
o - the object
Returns:
a Persistent

getLogEntries

java.util.List<LogEntry> getLogEntries(java.lang.String classname,
                                       long oid,
                                       java.util.Date from,
                                       java.util.Date to)
Returns a list of log entries for the specified object (identified by passed oid and classname) which were made withing the specified time range

Specified by:
getLogEntries in interface RemoteOrgData
Parameters:
classname - the fully qualified name of the class of the object
oid - the oid of the object
from - the date for the start of the range
to - the date for the end of the range
Returns:
a list of log entries

listUsersWithRole

java.util.Map<User,java.lang.Object> listUsersWithRole(Role r,
                                                       OrgUnit ou,
                                                       Application appl)
List the users that have a role

Specified by:
listUsersWithRole in interface RemoteOrgData
Parameters:
r - the role
ou - optional: the orgunit where the role is assigned
appl - optional application, necessary when checking hierarchic roles to use the correct department tree. if the argument is null the default tree is used.
Returns:
a map where the keys are users the values are lists of the departments where the user have the role. For global roles the values are Boolean.TRUE instead of a department list.

checkPasswordPolicy

java.util.List<java.lang.String> checkPasswordPolicy(java.lang.String password)
Check a password against the password policy.

Specified by:
checkPasswordPolicy in interface RemoteOrgData
Parameters:
password - - the password string to check against the policy
Returns:
a vector of strings representing the reasons, why password does not fit the policy. null if password is ok

getPolicyInfoText

java.lang.String getPolicyInfoText(User u)
Checks if there are any hints for the user according to the password policy.

Specified by:
getPolicyInfoText in interface RemoteOrgData
Parameters:
u - - the user
Returns:
a String with a policy info message, null if ther is no neccessary message.

setPassword

User setPassword(User u,
                 java.lang.String password)
Set the password of a user. Note: Be aware that the User Object is updated and a BeanManager.commit() is called in this method.

Specified by:
setPassword in interface RemoteOrgData
Parameters:
u - the user, whose password should be changed
password - - the new password (plain string)
Returns:
the updated user object

createUser

User createUser()
Create a new User object.

Specified by:
createUser in interface RemoteOrgData
Returns:
a new User

createRole

Role createRole()
Create a new Role object.

Specified by:
createRole in interface RemoteOrgData
Returns:
a new Role

createRight

Right createRight()
Create a new Right.

Specified by:
createRight in interface RemoteOrgData
Returns:
a new Right

createOrgUnit

OrgUnit createOrgUnit()
Create a new OrgUnit object.

Specified by:
createOrgUnit in interface RemoteOrgData
Returns:
a new OrgUnit

createUserRole

UserRole createUserRole()
Create a new user-role relation

Specified by:
createUserRole in interface RemoteOrgData
Returns:
a new UserRole

createPermission

Permission createPermission()
Create a new Permission

Specified by:
createPermission in interface RemoteOrgData
Returns:
a new Permission

createPermissionList

PermissionList createPermissionList()
Create a new PermissionList

Specified by:
createPermissionList in interface RemoteOrgData
Returns:
a new PermissionList

deleteCascade

void deleteCascade(OrgUnit ou)
Delete the passed organizational unit and also objects which are of no use without it.

Specified by:
deleteCascade in interface RemoteOrgData
Parameters:
ou - the organizational unit to delete

getSubOrgs

java.util.List<OrgUnit> getSubOrgs(OrgUnit ou,
                                   OrgTree tree)
Return the list of the organizational units that are below the given oe in the given tree. If the argument ou is null, it returns the top level org-units of the given tree.

Specified by:
getSubOrgs in interface RemoteOrgData

getSuperOrg

OrgUnit getSuperOrg(OrgUnit ou,
                    OrgTree tree)
Return the organizational unit that is above the given oe in the given tree.

Specified by:
getSuperOrg in interface RemoteOrgData

createOrgTree

OrgTree createOrgTree()
Return a new organizational tree.

Specified by:
createOrgTree in interface RemoteOrgData

placeOrgInTree

void placeOrgInTree(OrgUnit parent,
                    OrgUnit child,
                    OrgTree tree)
Change the organizational hierarchy. Note that each org.unit has zero or one parent org.units in an org.tree.

Specified by:
placeOrgInTree in interface RemoteOrgData
tree - the tree

isInTree

boolean isInTree(OrgUnit ou,
                 OrgTree tree)
Is the given org-unit in the specified org-tree.

Specified by:
isInTree in interface RemoteOrgData
Returns:
true if the org-unit is part of the tree.

getObjectExtension

Persistent getObjectExtension(Persistent obj,
                              java.lang.String formclass,
                              boolean create)
Returns the extension object to a persistent. If none exists and create is true, the extension is created.

Specified by:
getObjectExtension in interface RemoteOrgData
Parameters:
obj - an object having extensions
formclass - the name of a form-class
create - if true extensions are created
Returns:
the extension object

deleteObjectExtension

void deleteObjectExtension(Persistent obj,
                           java.lang.String formclass)
delete the object extension for the given object.

Specified by:
deleteObjectExtension in interface RemoteOrgData


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.