Command chain design

Workflow definition

From the functional specification (see the section called “Functions”) can following workflow for the Application be defined:

Figure 16.2. Part of a workflow

Part of a workflow

Definition of command-chains

Login
Description

This command-chain is executed when a user requests the Application to be authenticated see the section called “Login” for more about the functionallity.

Normal flow

The LoginContext authenticates the user, based on username and password, and associates the user with current session.

Precondition

None

Postcondition

User information available in UserBean.

Parameters

None

Logout
Description

This command-chain is executed when a user requests the Application to become anonymous or ends the session see the section called “Logout” for more about the functionallity.

Normal flow

Current user is removed from current session.

Precondition

None

Postcondition

No valid user information is available in current session.

Parameters

None

Main
Description

This is the default command-chain, executed when no explicit command-chain is requested. Presents a JSP from which different services of the Application can be reached.

Normal flow

Presents a JSP from which the services of the Application can be reached.

Postcondition

Requests to this command-chain is added to session request history.

Precondition

None

Parameters

None

Create portfolio
Description

This command-chain is executed when an Administrator requests the Application for a new Portfolio to be added, se the section called “Create portfolio” for more about the functionallity.

Normal flow

A manifest is created with the Owners identity as identifier and an empty model of the metadata is created.

Precondition

The user must be an Administrator.

Postcondition

The metadata model is available in the ModelBean

Parameters

The identity of the Owner (mandatory).

Backup portfolio
Description

This command-chain is executed when an Administrator requests the Application to backing up all Portfolios , see the section called “Backup portfolio” for more about the functionallity.

Normal flow

Precondition

The user must be an Administrator

Postcondition

None

Parametrs

A portfolio identifier (the Owner identity) for backup of a single portfolio (optinally).

Restore portfolio
Description

This command-chain is executed when an Administrator requests the Application to restore all Portfolios , see the section called “Restore portfolio” for more about the functionallity.

Normal flow

Precondition

The user must be an Administrator

Postcondition

None

Parameters

A portfolio identifier (the Owner identity) to restore a single portfolio (optionally).

Remove portfolio
Description

This command-chain is executed when an Administrator requests the Application to remove a set of Portfolios, see the section called “Remove portfolio” for more about the functionallity.

Normal flow

Precondition

The user must be an Administrator

Postcondition

None

Parameters

Identifiers (the Owners identity) of Portfolios to remove.

Query
Description

This command-chain is executed when a user requests the Application to initiate a query, see the section called “Make component queries” for more about the functionallity.

Normal flow

User is presented with a query form.

Precondition

None

Postcondition

None

Parameters

None

Search
Description

This command-chain is executed as a response to a qury-form submitted to the Application, see the section called “Make component queries” for more about the functionallity.

Normal flow

Resolve field values for exact match methods and perform a regualar RDQL search. If no values are provided then resolve field values for string pattern match methods and perform a string pattern RDQL search.

Precondition

None

Postcondition

ListResultBean contains the result from the query.

Parameters

[metadata fields available for queries]

List
Description

This command-chain is executed in response to request to traverse a result set, see the section called “Make component queries” for more about the functionallity.

Normal flow

The result set, contained in a ListResultBean, is divided into a set of pages. Use the first page as current page if no page is explicitly requested.

Fetch metadata for each Component in current page.

Present metadata for Components in the current page to the user.

Precondition

A ListResultBean must have been made available prior to executing this command-chain.

Postcondition

ModelBean contains the metadata for each Component in current page. Properties of ListResultBean reflects the current page. Requests to this command-chain is added to the session request history.

Parameters

page represents the requested pagenumber, start is an index to the first Component in requested page and length which represents the number of Components in the requested page.

The parameters page and start are to be used exclusive.

Open
Description

This command-chain is executed in response to a user request to access a Components intellectual content, see the section called “Open component” for more about the functioanllity.

Normal flow

Extract relevant and valid metadata for the Component, which must include component type information.

The normal flow of this comamnd-chain depends on the Components type:

file
Download the file content, this is done by requesting the content from the repository.
url
Redirect the request to the external URL associated with the Component.
folder
Present a hierachical view of the organization associated with the Component to the user.
person
Present the metadata that is associated with the Component to the user.

Precondition

The URI, identifying the Component must be available.

Postcondition

For Components of folder- and person-type is the request to this command-chain added to session request history.

Parameters

uri represents the URI identifying the Component.

View
Description

This command-chain is executed in response to a user request for a Components metadata, including annotations.

Normal flow

Extract relevant and valid metadata for the Component.

Since different types of Components has different metadata schemas must different views be presented to the user, so, resolve which view to present to the user.

Present a view of the Components metadata to the user.

Precondition

An URI identifying the Component must be available.

Postcondition

None

Parameters

uri represents the URI that identifies the Component.

Edit
Description

This command-chain is executed in response to a request to start a editing session for a Components metadata

Normal flow

Extract relevant and valid metadata for the Component.

Initialize scamEditor with the metadata and information about the metadata schema.

Present a JSP implementing the scamEditor visualization.

Precondition

The user must have write privileges to the Component.

An URI identifying the Component must be available.

Postcondition

ModelBean contains the Components metadata and FiledMapBean contains information used by scamEditor, theese objects must be available for next command-chain.

Parameters

uri represents the URI that identifies the Component.

Add property
Description

This command-chain is executed in response to a user request to add a set of properties to an editing session.

Normal flow

Update FiledMapBean with submitted form data.

Extract the set of properties to be added and add new instances of theese properties to the current editing session.

Update ModelBean with the updated metadata model.

Initialize scamEditor with the metadata and information about the metadata schema.

Present a JSP implementing the scamEditor visualization.

Precondition

The request must be made in an editing session.

Postcondition

ModelBean contains the Components metadata and FiledMapBean contains information used by scamEditor, theese objects must be available for next command-chain.

Parameters

uri represents the URI that identifies the Component. A set of parameters used by scamEditor to hold metadata values. add represents the set of porpeties requested to be added.

Remove property
Description

This command-chain is executed in response to a user request to remove a set of properties.

Normal flow

Update FiledMapBean with submitted form data.

Extract the set of properties to be removed and remove theese properties from the current editing session.

Update ModelBean with the updated metadata model.

Initialize scamEditor with the metadata and information about the metadata schema.

Present a JSP implementing the scamEditor visualization.

Precondition

The request must be made in an editing session.

Postcondition

ModelBean contains the Components metadata and FiledMapBean contains information used by scamEditor, theese objects must be available for next command-chain.

Parameters

uri represents the URI that identifies the Component. A set of parameters used by scamEditor to hold metadata values. del represents the set of porpeties requested to be removed

Save
Description

This command-chain is executed in response to a user request to end an editing session and to save metadata for a Component.

Normal flow

Update FieldMapBean with formdata, and provide the updated metadata model in ModelBean.

Update all live properties in ModelBean.

Store current metadata, located in ModelBean, in the repository.

Redirect the user to last initiating request in session request hhistory.

Precondition

The user must have write privileges to the Component.

FieldMapBean must be available.

Postcondition

ModelBean contains new valid metadata for the Component and the user is presented the view from which the edit request was initiated.

Parameters

uri represents the URI that identifies the Component. A set of parameters used by scamEditor to hold metadata values.

Abort edit
Description

This command-chain is executed in response to a request, from the user, to abort a editing session.

Normal flow

The user is presented the view from which the edit request was initiated.

Precondition

None

Postcondition

Metadata in the repository remains unchanged, with respect to the aborted editing session.

Parameters

None

Add new component
Description

This command-chain is executed in a response to a user request to add a new component to a Folder Component.

Normal flow

The user is presented a JSP form to choose the type for the new Component.

Precondition

The user must have write privileges to the Folder Component.

Postcondition

None

Parameters

None

Create component
Description

This command chain is executed in response to a user request to create a new Component to a Folder Component.

Normal flow

Create a new item in the organization of the Folder Component to hook the new Component to.

Upload content, if available, to the repository.

Create an metadata model and populate it with values for relevant live properties.

Initialize scamEditor with the metadata and information about the metadata schema.

Present a JSP implementing the scamEditor visualization.

Precondition

The user must have write privileges to the Folder Component.

Postcondition

None

Parameters

type describes what type of Component to create. content an identifier to the intellectual content.

Create annotation
Description

This command-chain is executed in response to a user request to add a new annotation association to Component.

Normal flow

Create a new metadata model, containing a annotation skeleton.

Update ModelBean with the new metadata model.

Initialize scamEditor with the metadata and information about the metadata schema.

Present a JSP implementing the scamEditor visualization.

Precondition

None

Postcondition

ModelBean contains a partial annotaion associated to the Component.

Parameters

uri represents the URI that identifies the subject Component in the annotation.

body represents the annotaion body, the message.

Remove annotation
Description

This command-chain is executed in response to a user request to remove annotations, in a timeframe, that is associated to a Component. If the time frame is not specified in the request, remove all annotations associated to the Component.

Normal flow

Extract relevant and valid metadata for the Component, including annotations.

Remove each annotations, that is in the time frame if such is specified.

Precondition

The user must have write privileges to the Component.

Postcondition

All annotations, in the specified time frame, for the Component is no longer available.

Parameters

uri represents the URI that identifies the subject Component in the annotations to be removed.

days remove annotations older than this value (optional).