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 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
           
 
Field Summary
static java.lang.String SIMPLE_TRANSITION_QUERY
          SPARQL Query to get all transitions and labels..
 
Fields inherited from class org.eaglei.repository.model.WritableObjectModel
dirty
 
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)
           
 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()
           
 org.openrdf.model.Value getActionParameter()
           
 java.lang.String getComment()
          Getter for the field comment.
 org.openrdf.model.URI getFinal()
           
 java.lang.String getFinalLabel()
           
 org.openrdf.model.URI getInitial()
           
 java.lang.String getInitialLabel()
           
 java.lang.String getLabel()
          Getter for the field label.
 java.lang.String getOrder()
           
 org.openrdf.model.URI getURI()
          getURI
 org.openrdf.model.URI getWorkspace()
           
 java.lang.String getWorkspaceLabel()
           
 int hashCode()
          
 boolean isErrorAction()
           
 void setAction(javax.servlet.http.HttpServletRequest request, java.lang.String val)
           
 void setActionParameter(javax.servlet.http.HttpServletRequest request, java.lang.String str)
          ActionParameter may be stringified URI or literal; parse out URI or literal from val..
 void setActionParameter(javax.servlet.http.HttpServletRequest request, org.openrdf.model.Value val)
           
 void setComment(javax.servlet.http.HttpServletRequest request, java.lang.String val)
           
 void setFinal(javax.servlet.http.HttpServletRequest request, org.openrdf.model.URI val)
           
 void setInitial(javax.servlet.http.HttpServletRequest request, org.openrdf.model.URI val)
           
 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)
           
 void setWorkspace(javax.servlet.http.HttpServletRequest request, org.openrdf.model.URI val)
           
 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, 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

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()

getWorkspaceLabel

public java.lang.String getWorkspaceLabel()

getInitial

public org.openrdf.model.URI getInitial()

getInitialLabel

public java.lang.String getInitialLabel()

getFinal

public org.openrdf.model.URI getFinal()

getFinalLabel

public java.lang.String getFinalLabel()

getOrder

public java.lang.String getOrder()

getAction

public WorkflowAction getAction()

isErrorAction

public boolean isErrorAction()

getActionParameter

public org.openrdf.model.Value getActionParameter()

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.
label - short name for Transition. SHOULD be non-null
comment - longer description of WorkflowTransition may be null
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.
Throws:
javax.servlet.ServletException - if any.

delete

public void delete(javax.servlet.http.HttpServletRequest request)
            throws javax.servlet.ServletException
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.
label - a new label value
Throws:
javax.servlet.ServletException - if any.

setComment

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

setWorkspace

public void setWorkspace(javax.servlet.http.HttpServletRequest request,
                         org.openrdf.model.URI val)
                  throws javax.servlet.ServletException
Throws:
javax.servlet.ServletException

setInitial

public void setInitial(javax.servlet.http.HttpServletRequest request,
                       org.openrdf.model.URI val)
                throws javax.servlet.ServletException
Throws:
javax.servlet.ServletException

setFinal

public void setFinal(javax.servlet.http.HttpServletRequest request,
                     org.openrdf.model.URI val)
              throws javax.servlet.ServletException
Throws:
javax.servlet.ServletException

setOrder

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

setAction

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

setActionParameter

public void setActionParameter(javax.servlet.http.HttpServletRequest request,
                               java.lang.String str)
                        throws javax.servlet.ServletException
ActionParameter may be stringified URI or literal; parse out URI or literal from val..

Throws:
javax.servlet.ServletException

setActionParameter

public void setActionParameter(javax.servlet.http.HttpServletRequest request,
                               org.openrdf.model.Value val)
                        throws javax.servlet.ServletException
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.