org.eaglei.repository.model.workflow
Class WorkflowTransition

java.lang.Object
  extended by org.eaglei.repository.model.ImmutableObjectModel
      extended by org.eaglei.repository.model.WritableObjectModel
          extended by org.eaglei.repository.model.workflow.WorkflowTransition

public final class WorkflowTransition
extends WritableObjectModel

WorkflowTransition object model, reflects the :WorkflowTransition object in RDF database.

Version:
$Id: $
Author:
Larry Stone Started October, 2010

Nested Class Summary
static class WorkflowTransition.WFTHandler
          Tuple query result handler to gather list of all transitions (or one); removes duplicates since data errors can produce them.
 
Field Summary
static java.lang.String SIMPLE_TRANSITION_QUERY
          SPARQL Query to get all transitions and labels..
 
Method Summary
static WorkflowTransition create(javax.servlet.http.HttpServletRequest request, org.openrdf.model.URI prefURI, java.lang.String label, java.lang.String comment, org.openrdf.model.URI initialState, org.openrdf.model.URI finalState)
          Make a new WorkflowTransition
 void delete(javax.servlet.http.HttpServletRequest request)
          Obliterate all trace of this transition.
 boolean equals(java.lang.Object other)
           Transitions are equal if their subject URI is the same.
static WorkflowTransition find(javax.servlet.http.HttpServletRequest request, org.openrdf.model.URI uri)
          Get the WorkflowTransition for a known URI,
static java.util.List<WorkflowTransition> findAccessibleByAttributes(javax.servlet.http.HttpServletRequest request, org.openrdf.model.URI single, org.openrdf.model.URI initialStateMatch, org.openrdf.model.URI workspaceMatch, org.openrdf.model.URI accessible)
          Get all Transitions matching criteria dictated by args; null is a wildcard, so all nulls means get all transactions.
static java.util.List<WorkflowTransition> findAll(javax.servlet.http.HttpServletRequest request)
          Get all Transitions in an aesthetic order
 WorkflowAction getAction()
          Getter for action
 org.openrdf.model.Value getActionParameter()
          Getter for action parameter
 java.lang.String getComment()
          Getter for the field comment.
 org.openrdf.model.URI getFinal()
          Getter for final transition uri
 java.lang.String getFinalLabel()
          Getter for label of final transition
 org.openrdf.model.URI getInitial()
          Getter for initial transition
 java.lang.String getInitialLabel()
          Getter for label of initial transition
 java.lang.String getLabel()
          Getter for the field label.
 java.lang.String getOrder()
          getter for order
 org.openrdf.model.URI getURI()
          getURI - getter
 org.openrdf.model.URI getWorkspace()
          Getter for field workspace
 java.lang.String getWorkspaceLabel()
          Getter for field workspaceLabel
 int hashCode()
          
 boolean isErrorAction()
          predicate true if action indicates an error
 void setAction(javax.servlet.http.HttpServletRequest request, java.lang.String val)
          Setter for action class
 void setActionParameter(javax.servlet.http.HttpServletRequest request, java.lang.String str)
          Setter for ActionParameter
 void setActionParameter(javax.servlet.http.HttpServletRequest request, org.openrdf.model.Value val)
          Setter for action parameter
 void setComment(javax.servlet.http.HttpServletRequest request, java.lang.String val)
          Setter for comment field - null clears the comment.
 void setFinal(javax.servlet.http.HttpServletRequest request, org.openrdf.model.URI val)
          setter for final state
 void setInitial(javax.servlet.http.HttpServletRequest request, org.openrdf.model.URI val)
          Setter for initial staet
 void setLabel(javax.servlet.http.HttpServletRequest request, java.lang.String val)
          Setter for the field label.
 void setOrder(javax.servlet.http.HttpServletRequest request, java.lang.String val)
          setter for order
 void setWorkspace(javax.servlet.http.HttpServletRequest request, org.openrdf.model.URI val)
          Setter for workspace field - null clears it
 java.lang.String toString()
          toString
 org.openrdf.model.URI write(javax.servlet.http.HttpServletRequest request, boolean makeURI)
          Write the properties of a WorkflowTransition into RDF database.
 
Methods inherited from class org.eaglei.repository.model.WritableObjectModel
commit, decacheInstance, isDirty, setDirty, update
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SIMPLE_TRANSITION_QUERY

public static final java.lang.String SIMPLE_TRANSITION_QUERY
SPARQL Query to get all transitions and labels.. bind ?uri to get a single transition object. Used by Transporter class to grovel objects out of import.

Method Detail

find

public static WorkflowTransition find(javax.servlet.http.HttpServletRequest request,
                                      org.openrdf.model.URI uri)
                               throws javax.servlet.ServletException
Get the WorkflowTransition for a known URI,

Parameters:
request - a HttpServletRequest object.
uri - URI of the transition
Returns:
a org.eaglei.repository.WorkflowTransition object
Throws:
javax.servlet.ServletException - if any.

findAll

public static java.util.List<WorkflowTransition> findAll(javax.servlet.http.HttpServletRequest request)
                                                  throws javax.servlet.ServletException
Get all Transitions in an aesthetic order

Parameters:
request - a HttpServletRequest object.
Returns:
all transitions in a java.lang.Collection object.
Throws:
javax.servlet.ServletException - if any.

findAccessibleByAttributes

public static java.util.List<WorkflowTransition> findAccessibleByAttributes(javax.servlet.http.HttpServletRequest request,
                                                                            org.openrdf.model.URI single,
                                                                            org.openrdf.model.URI initialStateMatch,
                                                                            org.openrdf.model.URI workspaceMatch,
                                                                            org.openrdf.model.URI accessible)
                                                                     throws javax.servlet.ServletException
Get all Transitions matching criteria dictated by args; null is a wildcard, so all nulls means get all transactions. Note that this does NOT inherently do access control since it only shows internal metadata.

Parameters:
request - a HttpServletRequest object.
single - if not null, then only find transition whose subject matches that URI
initialStateMatch - filter only transitions with given initial state
workspaceMatch - filter only transitions on either ALL workspaces or this one
accessible - filter transitions accessible to this user or Role URI
Returns:
all matching transitions in a java.lang.Collection object.
Throws:
javax.servlet.ServletException - if any.

getURI

public org.openrdf.model.URI getURI()

getURI - getter

Specified by:
getURI in class ImmutableObjectModel
Returns:
URI subject of the WorkflowTransition, a URI object.

getLabel

public java.lang.String getLabel()

Getter for the field label.

Specified by:
getLabel in class ImmutableObjectModel
Returns:
label of the WorkflowTransition, a String object.

getComment

public java.lang.String getComment()

Getter for the field comment.

Returns:
comment of the WorkflowTransition, a String object, MIGHT be null.

getWorkspace

public org.openrdf.model.URI getWorkspace()
Getter for field workspace

Returns:
the workspace (can be null)

getWorkspaceLabel

public java.lang.String getWorkspaceLabel()
Getter for field workspaceLabel

Returns:
workspaceLabel - can be null

getInitial

public org.openrdf.model.URI getInitial()
Getter for initial transition

Returns:
initial transition URI, should never be null

getInitialLabel

public java.lang.String getInitialLabel()
Getter for label of initial transition

Returns:
label of initial transition, should not be null but might be

getFinal

public org.openrdf.model.URI getFinal()
Getter for final transition uri

Returns:
final transition uri, should never be null

getFinalLabel

public java.lang.String getFinalLabel()
Getter for label of final transition

Returns:
label should not be null

getOrder

public java.lang.String getOrder()
getter for order

Returns:
order as string, or null if none set

getAction

public WorkflowAction getAction()
Getter for action

Returns:
action - instance of specificed class, or null if not set

isErrorAction

public boolean isErrorAction()
predicate true if action indicates an error

Returns:
true if there was an error setting action (e.g. import of illegal class)

getActionParameter

public org.openrdf.model.Value getActionParameter()
Getter for action parameter

Returns:
parameter value or null if none set

create

public static WorkflowTransition create(javax.servlet.http.HttpServletRequest request,
                                        org.openrdf.model.URI prefURI,
                                        java.lang.String label,
                                        java.lang.String comment,
                                        org.openrdf.model.URI initialState,
                                        org.openrdf.model.URI finalState)
                                 throws javax.servlet.ServletException

Make a new WorkflowTransition

including creating a URI for it.

Parameters:
request - a HttpServletRequest object.
prefURI -
label - short name for Transition. SHOULD be non-null
comment - longer description of WorkflowTransition may be null
finalState -
initialState -
Returns:
Throws:
javax.servlet.ServletException - if any.

write

public org.openrdf.model.URI write(javax.servlet.http.HttpServletRequest request,
                                   boolean makeURI)
                            throws javax.servlet.ServletException

Write the properties of a WorkflowTransition into RDF database. Used when creating new instance (either creat() or from import) to record the RDF.

Parameters:
request - a HttpServletRequest object.
makeURI - option to create a new subject URI.
Returns:
Throws:
javax.servlet.ServletException - if any.

delete

public void delete(javax.servlet.http.HttpServletRequest request)
            throws javax.servlet.ServletException
Obliterate all trace of this transition.

Parameters:
request -
Throws:
javax.servlet.ServletException

setLabel

public void setLabel(javax.servlet.http.HttpServletRequest request,
                     java.lang.String val)
              throws javax.servlet.ServletException

Setter for the field label.

Parameters:
request - a HttpServletRequest object.
val -
Throws:
javax.servlet.ServletException - if any.

setComment

public void setComment(javax.servlet.http.HttpServletRequest request,
                       java.lang.String val)
                throws javax.servlet.ServletException
Setter for comment field - null clears the comment.

Parameters:
request -
val - new value
Throws:
javax.servlet.ServletException

setWorkspace

public void setWorkspace(javax.servlet.http.HttpServletRequest request,
                         org.openrdf.model.URI val)
                  throws javax.servlet.ServletException
Setter for workspace field - null clears it

Parameters:
request -
val - new value (null to clear it)
Throws:
javax.servlet.ServletException

setInitial

public void setInitial(javax.servlet.http.HttpServletRequest request,
                       org.openrdf.model.URI val)
                throws javax.servlet.ServletException
Setter for initial staet

Parameters:
request -
val - new value, must be URI of workflow state
Throws:
javax.servlet.ServletException

setFinal

public void setFinal(javax.servlet.http.HttpServletRequest request,
                     org.openrdf.model.URI val)
              throws javax.servlet.ServletException
setter for final state

Parameters:
request -
val - new value, must be workflow stte
Throws:
javax.servlet.ServletException

setOrder

public void setOrder(javax.servlet.http.HttpServletRequest request,
                     java.lang.String val)
              throws javax.servlet.ServletException
setter for order

Parameters:
request -
val - new value, should be string encoding of integer or null to clear it
Throws:
javax.servlet.ServletException

setAction

public void setAction(javax.servlet.http.HttpServletRequest request,
                      java.lang.String val)
               throws javax.servlet.ServletException
Setter for action class

Parameters:
request -
val - new value, fully-qualifed name of a class implementing WorkflowAction
Throws:
javax.servlet.ServletException

setActionParameter

public void setActionParameter(javax.servlet.http.HttpServletRequest request,
                               java.lang.String str)
                        throws javax.servlet.ServletException
Setter for ActionParameter

Parameters:
request -
str - new value - may be stringified URI or literal; parse out URI or literal.
Throws:
javax.servlet.ServletException

setActionParameter

public void setActionParameter(javax.servlet.http.HttpServletRequest request,
                               org.openrdf.model.Value val)
                        throws javax.servlet.ServletException
Setter for action parameter

Parameters:
request -
val - new value or null to clear it.
Throws:
javax.servlet.ServletException

toString

public java.lang.String toString()

toString

Overrides:
toString in class java.lang.Object
Returns:
a detailed String representation of the object.

equals

public boolean equals(java.lang.Object other)
Transitions are equal if their subject URI is the same.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object


Copyright © 2009-2011 Eagle-I. All Rights Reserved.