|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ItemValidationPlugin
Represents an ItemValidation plugin.
An ItemValidation plugin is used to validate a TemplatedDocument
prior
to it being committed to the repository. It will be invoked as part of the standard item validation
step.
There are any number of validation 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.ItemValidationPlugin" id="SampleItemValidation"> <provider class="com.yourco.validation.SampleItemValidation"/> </extension>
Each ItemValidationPlugin plugin must also have a constructor with no arguments
This interface is designed to be implemented by clients. |
Field Summary | |
---|---|
static DocumentId<? extends AbstractAuthoringTemplate>[] |
ALL_TEMPLATES
Validation scope value to identify that this plugin should be invoked against all templated items. |
Method Summary | |
---|---|
ItemValidationResult |
validate(ItemContext context)
Validate the item being committed and determine whether the item in its current state should be stored in the WCM repository. |
DocumentId<? extends AbstractAuthoringTemplate>[] |
validationScope()
The validation scope defines when the validation plugin will be invoked. |
Methods inherited from interface com.ibm.portal.Localized |
---|
getDescription, getLocales, getTitle |
Methods inherited from interface com.ibm.workplace.wcm.api.plugin.AuthoringPlugin |
---|
isShownInAuthoringUI |
Field Detail |
---|
static final DocumentId<? extends AbstractAuthoringTemplate>[] ALL_TEMPLATES
ItemValidationPlugin.validationScope()
Method Detail |
---|
DocumentId<? extends AbstractAuthoringTemplate>[] validationScope()
The validation scope will be called once when the plugin is loaded. To change the scope the plugin will need to be removed and re-installed or the system restarted.
DocumentIds
to identify the items based on these templates
when saved should invoke the validation pluginItemValidationResult validate(ItemContext 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.
context
- context for this validation. The item being validated and additional information on the context of this action.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |