it.eng.spagobi.analiticalmodel.functionalitytree.service
Class DetailFunctionalityModule
java.lang.Object
it.eng.spago.dispatching.service.DefaultRequestContext
it.eng.spago.dispatching.service.DefaultHttpRequestContext
it.eng.spago.dispatching.module.AbstractHttpModule
it.eng.spagobi.analiticalmodel.functionalitytree.service.DetailFunctionalityModule
- All Implemented Interfaces:
- it.eng.spago.dispatching.module.ModuleIFace, it.eng.spago.dispatching.service.HttpRequestContextIFace, it.eng.spago.dispatching.service.RequestContextIFace, it.eng.spago.dispatching.service.ServiceIFace, it.eng.spago.init.InitializerIFace, java.io.Serializable
public class DetailFunctionalityModule
- extends it.eng.spago.dispatching.module.AbstractHttpModule
Implements a module which handles all low functionalities management: has
methods for low functionalities load, detail, modify/insertion and deleting
operations. The service
method has a switch for all these
operations, differentiated the ones from the others by a message
String.
- Author:
- sulis
- See Also:
- Serialized Form
Method Summary |
LowFunctionality |
eraseRolesFromFunctionality(LowFunctionality func,
java.lang.String roleId,
java.lang.String permission)
Erases the defined input role from a functionality object, if this one
has the role.The updated functionality object is returned. |
void |
init(it.eng.spago.base.SourceBean config)
|
boolean |
isParentRule(java.lang.String rule,
LowFunctionality parentLowFunct,
java.lang.String permission)
Controls if a particular role belongs to the parent functionality. |
void |
loadRolesToErase(LowFunctionality lowFuncParent,
java.util.Set rolesToErase)
Defines all roles that have to be erased in order to keep functionalities
tree consistence. |
void |
service(it.eng.spago.base.SourceBean request,
it.eng.spago.base.SourceBean response)
Reads the operation asked by the user and calls the insertion, modify,
detail and deletion methods. |
Methods inherited from class it.eng.spago.dispatching.module.AbstractHttpModule |
getConfig, getModule, getModuleMethod, getPage, getSharedData, setModule, setModuleMethod, setPage, setSharedData |
Methods inherited from class it.eng.spago.dispatching.service.DefaultHttpRequestContext |
freezeHttpResponse, getHttpRequest, getHttpResponse, getServletConfig, isHttpResponseFreezed, setRequestContext, unfreezeHttpResponse |
Methods inherited from class it.eng.spago.dispatching.service.DefaultRequestContext |
getErrorHandler, getRequestContainer, getResponseContainer, getServiceRequest, getServiceResponse |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface it.eng.spago.dispatching.service.RequestContextIFace |
getErrorHandler, getRequestContainer, getResponseContainer, getServiceRequest, getServiceResponse |
MODULE_PAGE
public static final java.lang.String MODULE_PAGE
- See Also:
- Constant Field Values
FUNCTIONALITY_OBJ
public static final java.lang.String FUNCTIONALITY_OBJ
- See Also:
- Constant Field Values
PATH
public static final java.lang.String PATH
- See Also:
- Constant Field Values
DetailFunctionalityModule
public DetailFunctionalityModule()
init
public void init(it.eng.spago.base.SourceBean config)
- Specified by:
init
in interface it.eng.spago.init.InitializerIFace
- Overrides:
init
in class it.eng.spago.dispatching.module.AbstractHttpModule
service
public void service(it.eng.spago.base.SourceBean request,
it.eng.spago.base.SourceBean response)
throws java.lang.Exception
- Reads the operation asked by the user and calls the insertion, modify,
detail and deletion methods.
- Parameters:
request
- The Source Bean containing all request parametersresponse
- The Source Bean containing all response parameters
- Throws:
exception
- If an exception occurs
java.lang.Exception
- the exception
isParentRule
public boolean isParentRule(java.lang.String rule,
LowFunctionality parentLowFunct,
java.lang.String permission)
- Controls if a particular role belongs to the parent functionality. It is
called inside functionalities Jsp in ordet to identify those roles that a
child functionality is able to select.
- Parameters:
rule
- The role id string identifying the roleparentLowFunct
- the parent low functionality objectpermission
- The role's permission
- Returns:
- True if the role belongs to the parent funct, else false
loadRolesToErase
public void loadRolesToErase(LowFunctionality lowFuncParent,
java.util.Set rolesToErase)
throws it.eng.spago.error.EMFUserError
- Defines all roles that have to be erased in order to keep functionalities
tree consistence. When we leave some permissions to a functionality,
those permissions will not be assignable to all the children
functionality. If any child has a permission that his parent anymore has,
this permission mus be deleted for all father's children and descendants.
This metod recusively scans all father's descendants and saves inside a
Set all roles that must be erased from the Database.
- Parameters:
lowFuncParent
- the parent FunctionalityrolesToErase
- the set containing all roles to erase
- Throws:
it.eng.spago.error.EMFUserError
- if any EMFUserError exception occurs
BuildOperationException
- if any BuildOperationException exception occurs
OperationExecutionException
- if any OperationExecutionException exception occurs
eraseRolesFromFunctionality
public LowFunctionality eraseRolesFromFunctionality(LowFunctionality func,
java.lang.String roleId,
java.lang.String permission)
- Erases the defined input role from a functionality object, if this one
has the role.The updated functionality object is returned.
- Parameters:
func
- the input functionality objectroleId
- the role id for the role to erasepermission
- the permission of the role to erase
- Returns:
- the updated functionality