com.flexive.shared.interfaces
Interface BriefcaseEngine

All Known Subinterfaces:
BriefcaseEngineLocal

public interface BriefcaseEngine

Bean handling Briefcases.

A briefcase is a object store which may be accessed with flexive SQL or the API provided by this beans.

Author:
Gregor Schober (gregor.schober@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)

Method Summary
 void addItems(long id, long[] objectIds)
          Add the given items to the briefcase.
 void clear(long id)
          Removes all items of the given briefcase.
 long create(java.lang.String name, java.lang.String description, java.lang.Long aclId)
          Creates a new empty briefcase.
 long[] getItems(long id)
          Load all item IDs stored in the given briefcase.
 Briefcase load(long id)
          Loads the briefcase with the given id.
 java.util.List<Briefcase> loadAll(boolean includeShared)
          Gets a list of all briefcase for the calling user.
 void modify(long id, java.lang.String name, java.lang.String description, java.lang.Long aclId)
          Modifies a briefcase.
 void remove(long id)
          Removes the briefcase with the specified id.
 void removeItems(long id, long[] objectIds)
          Removes the given items from the briefcase.
 void setItems(long id, long[] objectIds)
          Replace the current briefcase content with the given objects (i.e.
 void updateItems(long id, long[] addObjectIds, long[] removeObjectIds)
          Adds/removes the given items for the briefcase.
 

Method Detail

create

long create(java.lang.String name,
            java.lang.String description,
            java.lang.Long aclId)
            throws FxApplicationException
Creates a new empty briefcase.

Parameters:
name - the name of the briefcase.
description - the description (may be empty)
aclId - the ACL to use if the briefcase should be shared, or null if the briefcase is only visible for the owner.
Returns:
the unique briefcase id
Throws:
FxApplicationException - if the create failed

loadAll

java.util.List<Briefcase> loadAll(boolean includeShared)
                                  throws FxApplicationException
Gets a list of all briefcase for the calling user.

Parameters:
includeShared - if enabled shared briefcases will be included, if disabled only the briefcases created by the calling user will be returned
Returns:
the briefcases
Throws:
FxApplicationException - if the function fails

load

Briefcase load(long id)
               throws FxApplicationException
Loads the briefcase with the given id.

Parameters:
id - the id
Returns:
the briefcase
Throws:
FxApplicationException - if a error occured
FxNotFoundException - if it could not be found or was not readable by the calling user.

remove

void remove(long id)
            throws FxApplicationException
Removes the briefcase with the specified id.

The calling user may remove a briefcase if he is the owner, or if he has ben granted the remove permission via the briefcases ACL.
A global supervisor may remove and briefcase.
A mandator supervisor may remove all briefcases that belong to his domain.

Parameters:
id - the id
Throws:
FxApplicationException - if the calling user lacks the remove permission and is not the owner, or if a other error occured.

modify

void modify(long id,
            java.lang.String name,
            java.lang.String description,
            java.lang.Long aclId)
            throws FxApplicationException
Modifies a briefcase.

Parameters:
name - the new name of the briefcase, or null to keep the old value
description - the new description, or null to keep the old value
aclId - the new ACL, or -1 to remove a old acl, or null to keep the old value
id - the id of the briefcase to modify
Throws:
FxApplicationException - if the modify operation failed

clear

void clear(long id)
           throws FxApplicationException
Removes all items of the given briefcase.

Parameters:
id - the briefcase ID
Throws:
FxApplicationException - if the briefcase could not be cleared

addItems

void addItems(long id,
              long[] objectIds)
              throws FxApplicationException
Add the given items to the briefcase.

Parameters:
id - the briefcase ID
objectIds - the object IDs to be added
Throws:
FxApplicationException - if the items could not be added

setItems

void setItems(long id,
              long[] objectIds)
              throws FxApplicationException
Replace the current briefcase content with the given objects (i.e. clear the briefcase, then add the given objects).

Parameters:
id - the briefcase ID
objectIds - the new briefcase content
Throws:
FxApplicationException - if the content could not be replaced

updateItems

void updateItems(long id,
                 long[] addObjectIds,
                 long[] removeObjectIds)
                 throws FxApplicationException
Adds/removes the given items for the briefcase.

Parameters:
id - the briefcase ID
addObjectIds - items to be added
removeObjectIds - items to be removed
Throws:
FxApplicationException - if the briefcase could not be updated

removeItems

void removeItems(long id,
                 long[] objectIds)
                 throws FxApplicationException
Removes the given items from the briefcase.

Parameters:
id - the briefcase ID
objectIds - the objects to be removed
Throws:
FxApplicationException - if the items could not be removed

getItems

long[] getItems(long id)
                throws FxApplicationException
Load all item IDs stored in the given briefcase.

Parameters:
id - the briefcase ID
Returns:
the item IDs
Throws:
FxApplicationException - if the items could not be loaded