SAP NetWeaver '04

com.sapportals.wcm.repository.service.statemanagement
Interface IStepList

[contained in: com.sap.km.cm.repository.service.base.par - km.shared.repository.service.statemanagement_api.jar]
public interface IStepList

The IStepList interface represents an approval workflow in the user interface while defining or displaying the approval workflow. An approval workflow is defined by a series of steps with approvers assigned to each step.

See Also:
IStep

Method Summary
 IApprover addApproverToSelectedStep(com.sapportals.portal.security.usermanagement.IUMPrincipal impPrincipal)
          Adds a single approver to the selected steps.
 IApprover addApproverToSelectedStep(com.sapportals.portal.security.usermanagement.IUMPrincipal impPrincipal, int impApproverTyp)
          Deprecated. as of NW04. Please use addApproverToSelectedStep(IUMPrincipal impPrincipal)
 IApprover addApproverToSelectedStep(java.lang.String impApproverId, int impApproverTyp)
          Adds a single approver to the selected steps.
 void appendStep()
          Appends a new, empty step to the end of the approver list.
 boolean containsApprover(com.sapportals.portal.security.usermanagement.IUser impUser, int impStep)
          Checks whether a principal is contained in one of the approvers assigned to the specified step
 void deleteEmptySteps()
          Removes steps with no approvers.
 java.util.List deleteSelectedApprovers()
          Removes the selected approvers from the workflow.
 java.util.List deleteSelectedSteps()
          Removes the selected steps from the approver list.
 java.util.List getApproverOfStep(int impStep)
          Returns a list of IApprover that are assigned to the specified step.
 java.util.List getApproverStringList()
          This method returns a list with strings that can be used to persist the defined workflow as a multi-value application property of a resource.
 java.util.List getEmptySteps()
          Returns a list of steps without approvers.
 java.lang.String getStepDisplayName(int impStep)
          Gets the display name of a step.
 IStepListState getStepListState()
          Gets the IStepListState from a steplist in order to persist the steplist.
 java.lang.String getStepListString()
          This method serializes the current state of the IStepList into a string that can be used to persist the steplist in an HTML Page.
 void insertStep(int impPosition)
          Inserts a new, empty step into the approver list at the specified position.
 boolean isStepSelected(int impStep)
          Checks whether a step is selected
 java.util.List moveSelectedStepDown()
          Moves the selected step one position down.
 java.util.List moveSelectedStepUp()
          Moves the selected step one position up.
 void setApproverStringList(java.util.List impApproverList)
          This method is used to restore the IStepList from the List returned by getApproverStringList().
 void setStepDisplayName(int impStep, java.lang.String impName)
          Sets the display name of a step
 void setStepListString(java.lang.String impStepListString)
          This method deserializes the IStepList from a string returned by getCompleteApproverList.
 void setStepSelected(int impStep, boolean impSelected)
          Sets the selected flag for a step
 int size()
          The size of the IStepList
 

Method Detail

getStepListState

public IStepListState getStepListState()
Gets the IStepListState from a steplist in order to persist the steplist. The IStepList can be restored using IStatemanagementUtilsResource.restoreSteplist(IStepListState state) .
Returns:
the state of the steplist

getStepListString

public java.lang.String getStepListString()
                                   throws WcmException
This method serializes the current state of the IStepList into a string that can be used to persist the steplist in an HTML Page. The complete IStepList can be deserialized using this string with the method setStepListString(String impStepListString).
Returns:
a string encoding the complete steplist
Throws:
WcmException - exception raised in failure situation

setStepListString

public void setStepListString(java.lang.String impStepListString)
                       throws WcmException
This method deserializes the IStepList from a string returned by getCompleteApproverList. In the user interface, the state of the steplist has to be persisted in an HTML Page. To restore the object, this method has to be used.
Parameters:
impStepListString - the string persisted in the HTML page
Throws:
WcmException - exception raised in failure situation

getApproverStringList

public java.util.List getApproverStringList()
                                     throws WcmException
This method returns a list with strings that can be used to persist the defined workflow as a multi-value application property of a resource. The IStepList can be restored from this List using method setApproverStringList(java.util.List).
Returns:
List with String values to persist the workflow
Throws:
WcmException - exception raised in failure situation

setApproverStringList

public void setApproverStringList(java.util.List impApproverList)
                           throws WcmException
This method is used to restore the IStepList from the List returned by getApproverStringList(). This List is normally persisted as an application property for a resource.
Parameters:
impApproverList - a list of strings as returned by getApproverList()
Throws:
WcmException - exception raised in failure situation

addApproverToSelectedStep

public IApprover addApproverToSelectedStep(java.lang.String impApproverId,
                                           int impApproverTyp)
                                    throws WcmException
Adds a single approver to the selected steps. This method is used to assign an additional user to the selected steps of the steplist. A step can be selected using method setStepSelected(int impStep, boolean impSelected). Any type of principal known in the user management, such as user, group, or role can be used as an approver. The approver in this method is identified by the ID and type of the principal.
Parameters:
impApproverId - principal ID of the approver to be added
impApproverTyp - principal type of the approver to be added
Returns:
approver added to the step
Throws:
WcmException - exception raised in failure situation

addApproverToSelectedStep

public IApprover addApproverToSelectedStep(com.sapportals.portal.security.usermanagement.IUMPrincipal impPrincipal,
                                           int impApproverTyp)
                                    throws WcmException
Deprecated. as of NW04. Please use addApproverToSelectedStep(IUMPrincipal impPrincipal)

Adds a single approver to the selected steps. This method is deprecated because the type is ignored in here.
Parameters:
impPrincipal - principal to be added as approver
impApproverTyp - principal type of the approver to be added
Returns:
approver added to the step
Throws:
WcmException - exception raised in failure situation

addApproverToSelectedStep

public IApprover addApproverToSelectedStep(com.sapportals.portal.security.usermanagement.IUMPrincipal impPrincipal)
                                    throws WcmException
Adds a single approver to the selected steps. In contrast to addApproverToSelectedStep(String impApproverId, int impApproverTyp) the approver here is identified by the IUMPrincipal .
Parameters:
impPrincipal - principal to be added as approver
Returns:
approver added to the step
Throws:
WcmException - exception raised in failure situation

appendStep

public void appendStep()
Appends a new, empty step to the end of the approver list. The new step receives a default name and has no approvers assigned to it.

insertStep

public void insertStep(int impPosition)
Inserts a new, empty step into the approver list at the specified position. The new step receives a default name and has no approvers assigned to it.
Parameters:
impPosition - position of the new step
Throws:
java.lang.ArrayIndexOutOfBoundsException - if impStep < 0 or >= size

moveSelectedStepUp

public java.util.List moveSelectedStepUp()
Moves the selected step one position up. For example, if step 1 is selected, it becomes step 2. Up specifies the direction pointing to the end of the workflow, not the direction in which the steplist is displayed in the list, whereby the uppermost step is the first step. A step can be selected using method setStepSelected(int impStep, boolean impSelected).
Returns:
a list with the steps moved

moveSelectedStepDown

public java.util.List moveSelectedStepDown()
Moves the selected step one position down. For example, if step 2 is selected, it becomes step 1. Down specifies the direction pointing to the start of the workflow, not the direction in which the steplist is displayed in the list, whereby the uppermost step is the first one. A step can be selected using method setStepSelected(int impStep, boolean impSelected).
Returns:
a list with the steps moved

getApproverOfStep

public java.util.List getApproverOfStep(int impStep)
                                 throws java.lang.ArrayIndexOutOfBoundsException
Returns a list of IApprover that are assigned to the specified step. Each element of the returned List implements the IApprover interface. This method is used to render and handle the approvers asigned to one step within the user interface.
Parameters:
impStep - number of the step
Returns:
list with IApprover objects
Throws:
java.lang.ArrayIndexOutOfBoundsException - if impStep < 0 or >= size
See Also:
IApprover

containsApprover

public boolean containsApprover(com.sapportals.portal.security.usermanagement.IUser impUser,
                                int impStep)
                         throws java.lang.ArrayIndexOutOfBoundsException
Checks whether a principal is contained in one of the approvers assigned to the specified step
Parameters:
impStep - number of step
impUser - principal to check
Returns:
true if the principal is contained in the approver list
Throws:
java.lang.ArrayIndexOutOfBoundsException - if impStep < 0 or >= size
See Also:
IApprover

size

public int size()
The size of the IStepList
Returns:
number of steps in the IStepList

getStepDisplayName

public java.lang.String getStepDisplayName(int impStep)
                                    throws java.lang.ArrayIndexOutOfBoundsException
Gets the display name of a step. The name of a step is normally maintained via the user interface.
Parameters:
impStep - the index of the step
Returns:
string with name of step
Throws:
java.lang.ArrayIndexOutOfBoundsException - if impStep < 0 or >= size

setStepDisplayName

public void setStepDisplayName(int impStep,
                               java.lang.String impName)
                        throws java.lang.ArrayIndexOutOfBoundsException
Sets the display name of a step
Parameters:
impStep - the index of the step
impName - the new display name of the step
Throws:
java.lang.ArrayIndexOutOfBoundsException - if impStep < 0 or >= size

isStepSelected

public boolean isStepSelected(int impStep)
                       throws java.lang.ArrayIndexOutOfBoundsException
Checks whether a step is selected
Parameters:
impStep - the index of the step
Returns:
true, if the step is selected
Throws:
java.lang.ArrayIndexOutOfBoundsException - if impStep < 0 or >= size

setStepSelected

public void setStepSelected(int impStep,
                            boolean impSelected)
                     throws java.lang.ArrayIndexOutOfBoundsException
Sets the selected flag for a step
Parameters:
impStep - the index of the step
impSelected - true to select the step, false to deselect the step
Throws:
java.lang.ArrayIndexOutOfBoundsException - if impStep < 0 or >= size

deleteSelectedSteps

public java.util.List deleteSelectedSteps()
Removes the selected steps from the approver list. A step can be selected using method setStepSelected(int impStep, boolean impSelected). All selected steps are removed from the steplist even if they are not empty.
Returns:
list with all deleted steps

deleteEmptySteps

public void deleteEmptySteps()
Removes steps with no approvers. A workflow is not useful if there are steps with no approvers assigned to them. Sometimes you may want to save a temporary state of the workflow where some steps do not have an approver assigned, but this method has to be used before the workflow starts.

getEmptySteps

public java.util.List getEmptySteps()
Returns a list of steps without approvers. Must not return null even if no empty steps exist. This method can be used to give the user information on which steps are not yet useful.
Returns:
a list with all steps without approvers

deleteSelectedApprovers

public java.util.List deleteSelectedApprovers()
Removes the selected approvers from the workflow. An approver can be selected using getApproverOfStep(int impStep) and then IApprover.setSelected(boolean impSelected) for the returned approvers.
Returns:
list of IApprovers with all deleted approvers

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.