com.sapportals.wcm.repository.service.statemanagement

Interface IStepList

All Known Subinterfaces:
IStepListExt

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.sap.security.api.IPrincipal impPrincipal)
          Adds a single approver to the selected steps.
 IApprover addApproverToSelectedStep(com.sapportals.portal.security.usermanagement.IUMPrincipal impPrincipal)
          Deprecated. As of NetWeaver 7.1, replaced by addApproverToSelectedStep(com.sap.security.api.IPrincipal)
 IApprover addApproverToSelectedStep(com.sapportals.portal.security.usermanagement.IUMPrincipal impPrincipal, int impApproverTyp)
          Deprecated. as of NW04. Please use addApproverToSelectedStep(IUMPrincipal impPrincipal)
 IApprover addApproverToSelectedStep(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)
          Deprecated. As of NetWeaver 7.1, replaced by containsApprover(com.sap.security.api.IUser,int)
 boolean containsApprover(com.sap.security.api.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.
 List deleteSelectedApprovers()
          Removes the selected approvers from the workflow.
 List deleteSelectedSteps()
          Removes the selected steps from the approver list.
 List getApproverOfStep(int impStep)
          Returns a list of IApprover that are assigned to the specified step.
 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.
 List getEmptySteps()
          Returns a list of steps without approvers.
 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.
 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
 List moveSelectedStepDown()
          Moves the selected step one position down.
 List moveSelectedStepUp()
          Moves the selected step one position up.
 void setApproverStringList(List impApproverList)
          This method is used to restore the IStepList from the List returned by getApproverStringList().
 void setStepDisplayName(int impStep, String impName)
          Sets the display name of a step
 void setStepListString(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

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

String getStepListString()
                         throws com.sapportals.wcm.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:
com.sapportals.wcm.WcmException - exception raised in failure situation

setStepListString

void setStepListString(String impStepListString)
                       throws com.sapportals.wcm.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:
com.sapportals.wcm.WcmException - exception raised in failure situation

getApproverStringList

List getApproverStringList()
                           throws com.sapportals.wcm.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:
com.sapportals.wcm.WcmException - exception raised in failure situation

setApproverStringList

void setApproverStringList(List impApproverList)
                           throws com.sapportals.wcm.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:
com.sapportals.wcm.WcmException - exception raised in failure situation

addApproverToSelectedStep

IApprover addApproverToSelectedStep(String impApproverId,
                                    int impApproverTyp)
                                    throws com.sapportals.wcm.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:
com.sapportals.wcm.WcmException - exception raised in failure situation

addApproverToSelectedStep

IApprover addApproverToSelectedStep(com.sapportals.portal.security.usermanagement.IUMPrincipal impPrincipal,
                                    int impApproverTyp)
                                    throws com.sapportals.wcm.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:
com.sapportals.wcm.WcmException - exception raised in failure situation

addApproverToSelectedStep

IApprover addApproverToSelectedStep(com.sapportals.portal.security.usermanagement.IUMPrincipal impPrincipal)
                                    throws com.sapportals.wcm.WcmException
Deprecated. As of NetWeaver 7.1, replaced by addApproverToSelectedStep(com.sap.security.api.IPrincipal)

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:
com.sapportals.wcm.WcmException - exception raised in failure situation

addApproverToSelectedStep

IApprover addApproverToSelectedStep(com.sap.security.api.IPrincipal impPrincipal)
                                    throws com.sapportals.wcm.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:
com.sapportals.wcm.WcmException - exception raised in failure situation
Since:
NetWeaver 7.1

appendStep

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

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:
ArrayIndexOutOfBoundsException - if impStep < 0 or >= size

moveSelectedStepUp

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

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

List getApproverOfStep(int impStep)
                       throws 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:
ArrayIndexOutOfBoundsException - if impStep < 0 or >= size
See Also:
IApprover

containsApprover

boolean containsApprover(com.sapportals.portal.security.usermanagement.IUser impUser,
                         int impStep)
                         throws ArrayIndexOutOfBoundsException
Deprecated. As of NetWeaver 7.1, replaced by containsApprover(com.sap.security.api.IUser,int)

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:
ArrayIndexOutOfBoundsException - if impStep < 0 or >= size
See Also:
IApprover

containsApprover

boolean containsApprover(com.sap.security.api.IUser impUser,
                         int impStep)
                         throws 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:
ArrayIndexOutOfBoundsException - if impStep < 0 or >= size
Since:
NetWeaver 7.1
See Also:
IApprover

size

int size()
The size of the IStepList

Returns:
number of steps in the IStepList

getStepDisplayName

String getStepDisplayName(int impStep)
                          throws 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:
ArrayIndexOutOfBoundsException - if impStep < 0 or >= size

setStepDisplayName

void setStepDisplayName(int impStep,
                        String impName)
                        throws ArrayIndexOutOfBoundsException
Sets the display name of a step

Parameters:
impStep - the index of the step
impName - the new display name of the step
Throws:
ArrayIndexOutOfBoundsException - if impStep < 0 or >= size

isStepSelected

boolean isStepSelected(int impStep)
                       throws ArrayIndexOutOfBoundsException
Checks whether a step is selected

Parameters:
impStep - the index of the step
Returns:
true, if the step is selected
Throws:
ArrayIndexOutOfBoundsException - if impStep < 0 or >= size

setStepSelected

void setStepSelected(int impStep,
                     boolean impSelected)
                     throws 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:
ArrayIndexOutOfBoundsException - if impStep < 0 or >= size

deleteSelectedSteps

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

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

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

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
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM


Copyright 2011 SAP AG Complete Copyright Notice