org.imixs.workflow.jee.ejb
Interface EntityService

All Known Subinterfaces:
EntityServiceRemote

public interface EntityService

The EntityService is used to save and load instances of ItemCollection into a Database. The EntityService throws an AccessDeniedException if the CallerPrincipal is not allowed to save or read a specific ItemCollection from the database. So the EntityService can be used to save business objects into a database with individual read- or writeAccess restrictions.

Version:
1.0
Author:
rsoika

Field Summary
static String ACCESSLEVEL_AUTHORACCESS
           
static String ACCESSLEVEL_EDITORACCESS
           
static String ACCESSLEVEL_MANAGERACCESS
           
static String ACCESSLEVEL_NOACCESS
           
static String ACCESSLEVEL_READERACCESS
           
static int TYP_AUTHOR
           
static int TYP_CALENDAR
           
static int TYP_DOUBLE
           
static int TYP_INT
           
static int TYP_READER
           
static int TYP_TEXT
           
 
Method Summary
 void addIndex(String stitel, int ityp)
          Adds an EntityIndex to the current list of external properties.
 Collection<org.imixs.workflow.ItemCollection> findAllEntities(String query, int startpos, int count)
          The method returns a collection of ItemCollections.
 Collection<EntityIndex> findAllEntityIndices()
          The method returns a list of EntityIndex which defines external properties
 Collection<org.imixs.workflow.ItemCollection> findChildEntities(org.imixs.workflow.ItemCollection entity, int startpos, int count)
          The method returns a collection of child ItemCollections.
 org.imixs.workflow.ItemCollection findParentEntity(org.imixs.workflow.ItemCollection entity)
          The method returns the parent ItemCollection to a given ItemCollection.
 String getAccessRoles()
          Returns additional AccessRoles defined for the EJB instance
 String getReadAccessFields()
          Returns additional ReadAccessFields defined for the EJB instance.
 String getWriteAccessFields()
          Returns additional WriteAccessFields defined for the EJB instance.
 org.imixs.workflow.ItemCollection load(String id)
          This method loads an ItemCollection from the Database.
 void remove(org.imixs.workflow.ItemCollection itemcol)
          This method removes an ItemCollection from the database.
 void removeIndex(String stitel)
          Removes an EntityIndex from the current list of external properties.
 org.imixs.workflow.ItemCollection save(org.imixs.workflow.ItemCollection itemcol)
          This Method saves an ItemCollection into a database.
 

Field Detail

TYP_TEXT

static final int TYP_TEXT
See Also:
Constant Field Values

TYP_INT

static final int TYP_INT
See Also:
Constant Field Values

TYP_DOUBLE

static final int TYP_DOUBLE
See Also:
Constant Field Values

TYP_CALENDAR

static final int TYP_CALENDAR
See Also:
Constant Field Values

TYP_READER

static final int TYP_READER
See Also:
Constant Field Values

TYP_AUTHOR

static final int TYP_AUTHOR
See Also:
Constant Field Values

ACCESSLEVEL_NOACCESS

static final String ACCESSLEVEL_NOACCESS
See Also:
Constant Field Values

ACCESSLEVEL_READERACCESS

static final String ACCESSLEVEL_READERACCESS
See Also:
Constant Field Values

ACCESSLEVEL_AUTHORACCESS

static final String ACCESSLEVEL_AUTHORACCESS
See Also:
Constant Field Values

ACCESSLEVEL_EDITORACCESS

static final String ACCESSLEVEL_EDITORACCESS
See Also:
Constant Field Values

ACCESSLEVEL_MANAGERACCESS

static final String ACCESSLEVEL_MANAGERACCESS
See Also:
Constant Field Values
Method Detail

getAccessRoles

String getAccessRoles()
Returns additional AccessRoles defined for the EJB instance

Returns:

getReadAccessFields

String getReadAccessFields()
Returns additional ReadAccessFields defined for the EJB instance. Default=$ReadAccess

Returns:

getWriteAccessFields

String getWriteAccessFields()
Returns additional WriteAccessFields defined for the EJB instance. Default=$WriteAccess

Returns:

save

org.imixs.workflow.ItemCollection save(org.imixs.workflow.ItemCollection itemcol)
                                       throws org.imixs.workflow.exceptions.AccessDeniedException
This Method saves an ItemCollection into a database. If the ItemCollection is saved the first time the method generates a uniqueID ('$uniqueid') which can be used to identify the ItemCollection by its ID. If the ItemCollection was saved before the method updates the ItemCollection stored in the database. The Method returns an updated instance of the ItemCollection containing the attributes $modified, $created, and $uniqueid

The method throws an AccessDeniedException if the CallerPrincipal is not allowed to save or update the ItemCollection in the database. The CallerPrincipial should have at least the access Role org.imixs.ACCESSLEVEL.AUTHORACCESS

Parameters:
ItemCollection - to be saved
Returns:
updated ItemCollection
Throws:
org.imixs.workflow.exceptions.AccessDeniedException

load

org.imixs.workflow.ItemCollection load(String id)
This method loads an ItemCollection from the Database. The method expects a valid $unqiueID to identify the ItemCollection saved before into the database. The method returns null if no ItemCollection with the corresponding ID exists.

The method checks also if the CallerPrincipal has read access to ItemCollection stored in the database. If not the method returns null. The method dose not throw an AccessDeniedException if the user is not allowed to read the entity to prevent a aggressor with informations about the existence of that specific ItemCollection.

CallerPrincipial should have at least the access Role org.imixs.ACCESSLEVEL.READACCESS

Parameters:
id - the $unqiueid of the ItemCollection to be loaded
Returns:
ItemCollection object or null if the ItemColleciton dose not exist or the CallerPrincipal hat insufficient read access.

remove

void remove(org.imixs.workflow.ItemCollection itemcol)
            throws org.imixs.workflow.exceptions.AccessDeniedException,
                   org.imixs.workflow.exceptions.InvalidWorkitemException
This method removes an ItemCollection from the database. If the CallerPrincipal is not allowed to access the ItemColleciton the method throws an AccessDeniedException.

The CallerPrincipial should have at least the access Role org.imixs.ACCESSLEVEL.AUTHORACCESS

Parameters:
ItemCollection - to be removed
Throws:
Exception
org.imixs.workflow.exceptions.AccessDeniedException
org.imixs.workflow.exceptions.InvalidWorkitemException

addIndex

void addIndex(String stitel,
              int ityp)
              throws Exception
Adds an EntityIndex to the current list of external properties. A EntityIndex defines a Index to a specific Attribute provided by ItemCollections saved to the database. The method throws an AccessDeniedException if the CallerPrinciapal is not in the role org.imixs.ACCESSLEVEL.MANAGERACCESS.

Parameters:
stitel -
ityp - - Type of EntityIndex
Throws:
Exception

removeIndex

void removeIndex(String stitel)
                 throws Exception
Removes an EntityIndex from the current list of external properties. The method throws an AccessDeniedException if the CallerPrinciapal is not in the role org.imixs.ACCESSLEVEL.MANAGERACCESS.

Parameters:
stitel -
Throws:
Exception

findAllEntityIndices

Collection<EntityIndex> findAllEntityIndices()
The method returns a list of EntityIndex which defines external properties

Returns:

findAllEntities

Collection<org.imixs.workflow.ItemCollection> findAllEntities(String query,
                                                              int startpos,
                                                              int count)
The method returns a collection of ItemCollections. The method expects an valid EQL statement. The method returns only ItemCollections which are readable by the CallerPrincipal. With the startpos and count parameters it is possible to read chunks of entities.

Parameters:
query -
startpos -
count -
Returns:

findParentEntity

org.imixs.workflow.ItemCollection findParentEntity(org.imixs.workflow.ItemCollection entity)
The method returns the parent ItemCollection to a given ItemCollection. A parent entity is referenced by an other entity by the property $uniqueidRef which points to a parent entity.

Parameters:
childentity -
Returns:
parent entity

findChildEntities

Collection<org.imixs.workflow.ItemCollection> findChildEntities(org.imixs.workflow.ItemCollection entity,
                                                                int startpos,
                                                                int count)
The method returns a collection of child ItemCollections. A child entity is defined by the property $uniqueidRef which points to a parent entity. The method returns only ItemCollections which are readable by the CallerPrincipal. With the startPos and count parameters it is possible to read chunks of entities.

Parameters:
parententity -
startpos -
count -
Returns:
See Also:
findParentEntity


Copyright © 2006-2012 Imixs Software Solutions GmbH. All Rights Reserved.