com.sap.portal.admin.wizard.validators

Interface IValidator

All Known Implementing Classes:
ObjectIdValidator

Deprecated. Use Admin Studio Wizard Framework, as described in Creating Administration Interfaces (Web Dynpro) on the Help Portal documentation (help.sap.com).

public interface IValidator

The interface used to validate pane input.
Panes that display a user interface should use this interface in the implementation of the method AbstractWizardComponent.getErrorMessages(IWizardContext).
Always call the isValid(java.lang.Object, com.sapportals.admin.wizardframework.api.IWizardContext) method and provide the key for the input to check.
Typically, each IValidator implementer should perform validations on a single parameter, such as the object ID or selected layouts. For invalid input, it gets the error list from the implementer that holds the resource bundle keys.
For example:


 public List getErrorMessages(IWizardContext ctx)
 {
                PageLayoutsValidator validator = new PageLayoutsValidator();
                StringBuffer validatorKey = new StringBuffer(getPath())
                                                                        .append(PageLayoutsPane.LAYOUTS_AVAILABLE_LIST_KEY) 
                                                                        .append(WizardSession.PATH_SEPERATOR) 
                                                                        .append(MultiSelectionComponent.VALUE);
                if (!validator.isValid(validatorKey.toString(), ctx))
                {
                        List errKeyList = validator.getErrorKeyList(ctx);
                        LinkedList errValList = new LinkedList();
                        for (Iterator iter = errKeyList.iterator(); iter.hasNext();) 
                        {
                                String key = (String) iter.next();
                                errValList.add(_basicObjService.getBundleString(key, ctx));
                        }
                        return errValList;
                }
 } 
 


Method Summary
 List getErrorKeyList(IWizardContext context)
          Deprecated. Gets a list of resource bundle keys for the errors collected when the validity check fails.
 boolean isValid(Object key, IWizardContext context)
          Deprecated. Indicates whether the required field/input/key/value is valid.
 

Method Detail

isValid

boolean isValid(Object key,
                IWizardContext context)
Deprecated. 
Indicates whether the required field/input/key/value is valid.

Parameters:
key - a key to check
context - the current wizard context
Returns:
true if valid, false if not

getErrorKeyList

List getErrorKeyList(IWizardContext context)
Deprecated. 
Gets a list of resource bundle keys for the errors collected when the validity check fails.

Parameters:
context - the current wizard context
Returns:
the error list (an empty list if no errors found)
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] EP-RUNTIME [sap.com] tc/ep/admin/api api EP-PIN


Copyright 2011 SAP AG Complete Copyright Notice