com.ibm.workplace.wcm.api.extensions.operation
Interface OperationCheckPlugin


public interface OperationCheckPlugin

Represents an OperationCheckPlugin plugin.

An OperationCheckPlugin plugin is used to control whether an operation within the system should continue or whether it should be stopped.

There are any number of checks that can be performed. Some examples include:

The plugin is registered with WCM by providing a plugin.xml in the JAR file including the implementation and specifying and extension provider similar to this:

    <extension
      point="com.ibm.workplace.wcm.api.OperationCheckPlugin" id="SampleOperationCheckPlugin">
      <provider class="com.yourco.validation.SampleOperationCheckPlugin"/>
    </extension>
    

Each OperationCheckPlugin plugin must also have a constructor with no arguments

Since:
8.5CF8
Note:
This interface is designed to be implemented by clients.

Nested Class Summary
static class OperationCheckPlugin.Operation
          The set of possible operations that can be enforced via the OperationCheckPlugin.
 
Method Summary
 OperationCheckResult checkOperation(OperationContext context)
          Determine whether the requested operation can be performed in the current context.
 OperationCheckPlugin.Operation scope()
          On registration of this plugin the scope method will be called once to associate this plugin with the specified operation.
 

Method Detail

scope

OperationCheckPlugin.Operation scope()
On registration of this plugin the scope method will be called once to associate this plugin with the specified operation. A non-null Operation must be returned.

Returns:
the Operation which this plugin will be executed against.

checkOperation

OperationCheckResult checkOperation(OperationContext context)
Determine whether the requested operation can be performed in the current context.

Note: The item can be changed in this method, typically by updating fields on the item. However, any action performed on the item that causes a commit to the database will result in an exception being thrown and a warning printed to the logs. For instance, the item's workflow can be changed, but the item can not be moved to the next workflow stage.

Parameters:
context - Contextual information on the operation being performed.
Returns:
OperationCheckResult to define if the operation should continue to execute. If null is returned then the operation will be allowed to continue.