com.sap.portal.admin.wizard
Class AbstractPCMWizard

java.lang.Object
  |
  +--com.sapportals.portal.prt.component.AbstractPortalComponent
        |
        +--com.sapportals.admin.wizardframework.AbstractDynamicWizard
              |
              +--com.sapportals.admin.wizardframework.templates.AbstractWizard
                    |
                    +--com.sap.portal.admin.wizard.AbstractPCMWizard
All Implemented Interfaces:
IDynamicWizardConfigurator, com.sapportals.portal.prt.component.IEventListenerComponent, com.sapportals.portal.prt.component.IPortalComponent, com.sapportals.portal.prt.component.IPortalComponentInit, IWizardConfigurator

public class AbstractPCMWizard
extends AbstractWizard

AbstractPCMWizard is a default wizard that initiates the common panes and transitions. Wizards that use this toolkit needs to extend this class. The wizard adds the common panes and transitions, and the wizard developer needs to add his/her panes and transitions, or completely override the implementation. In addition, it provides extension points API for the wizard developer for finalizing the object before and after save, handling the summaries, and overriding the common strings of the toolkit.


Inner Class Summary
protected static class AbstractPCMWizard.InfoPaneInputKeys
          InfoPaneInputKeys holds constants for the keys of the attributes that are collected by the InfoPane.
 
Field Summary
static java.lang.String BUNDLE_CUSTOMIZED_KEYS
          Session key for the strings that the wizard developer overrides.
protected static java.lang.String END_PANE
          Alias that points to the summary pane, which is the end point that the wizard developer connects his/her panes to.
static java.lang.String META_ATTRIBUTE_DELIMITER
          Delimeter for meta attribute IDs.
protected static java.lang.String START_PANE
          Alias that points to the info pane, which is the starting point that the wizard developer connects his/her panes to.
 
Fields inherited from class com.sapportals.admin.wizardframework.AbstractDynamicWizard
BACK, CANCEL, FINISH, NEXT, PREV, STEP_NO_OFFSET, WIZARD_PARAMETERS
 
Constructor Summary
AbstractPCMWizard()
           
 
Method Summary
protected  void addDependencies(IConfigurableWizard wizard)
          Adds wizard's dependencies, if exist.
protected  void addPanes(IConfigurableWizard wizard)
          Adds common panes.
protected  void addTransitions(IConfigurableWizard wizard)
          Adds default transitions among the common panes, except transitions among user panes.
protected  void addUserPanes(IConfigurableWizard wizard)
          Adds user panes.
protected  void addUserTransitions(IConfigurableWizard wizard)
          Adds user transitions.
 void finalizeDescriptor(java.util.Map attributes, java.lang.Object descriptor, IWizardContext context)
          Finalizes the descriptor before saving.
 void finalizeObject(IWizardContext context)
          Finalize the new saved object.
 void finalizeSummaries(java.util.Map summaries, IWizardContext context)
          Finalizes the summaries.
 void initWizardSession(IWizardContext context)
          Checks if there are any strings that the wizard developer has override, by calling setUIStrings(Map), and puts them in the session.
protected  void setUIStrings(java.util.Map map)
          Override the common strings that are provided by the toolkit with your strings.
 void setupWizard(IConfigurableWizard wizard, com.sapportals.portal.prt.component.IPortalComponentProfile profile, java.util.Map params, java.util.ResourceBundle languageResources)
          setup your wizard in this function by adding panes, transitions and dependencies.
 
Methods inherited from class com.sapportals.admin.wizardframework.AbstractDynamicWizard
doContent, processWizardParams
 
Methods inherited from class com.sapportals.portal.prt.component.AbstractPortalComponent
destroy, doAbout, doAfterContent, doBeforeContent, doComponentEvent, doEdit, doHandleEditData, doHelp, doOnNodeReady, doOnNodeRemove, doOnPOMReady, doPreview, doRefresh, doRequestEvent, getCacheDiscriminant, getCachingLevel, handleEvent, hasExpired, init, init, init, service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUNDLE_CUSTOMIZED_KEYS

public static final java.lang.String BUNDLE_CUSTOMIZED_KEYS
Session key for the strings that the wizard developer overrides.

META_ATTRIBUTE_DELIMITER

public static final java.lang.String META_ATTRIBUTE_DELIMITER
Delimeter for meta attribute IDs.

START_PANE

protected static final java.lang.String START_PANE
Alias that points to the info pane, which is the starting point that the wizard developer connects his/her panes to.

END_PANE

protected static final java.lang.String END_PANE
Alias that points to the summary pane, which is the end point that the wizard developer connects his/her panes to.
Constructor Detail

AbstractPCMWizard

public AbstractPCMWizard()
Method Detail

initWizardSession

public void initWizardSession(IWizardContext context)
Checks if there are any strings that the wizard developer has override, by calling setUIStrings(Map), and puts them in the session.
Overrides:
initWizardSession in class AbstractDynamicWizard
See Also:
IWizardConfigurator.initWizardSession(com.sapportals.admin.wizardframework.api.IWizardContext)

setupWizard

public void setupWizard(IConfigurableWizard wizard,
                        com.sapportals.portal.prt.component.IPortalComponentProfile profile,
                        java.util.Map params,
                        java.util.ResourceBundle languageResources)
Description copied from interface: IDynamicWizardConfigurator
setup your wizard in this function by adding panes, transitions and dependencies.
Following copied from interface: com.sapportals.admin.wizardframework.api.IDynamicWizardConfigurator
Parameters:
wizard - - the IConfigurableWizard instance used to set up the wizard.
profile - - the IPortalComponentProfile of the wizard.
params - - the parameters to the initial request to the wizard
languageResources - - the appropriate resource bundle for the request locale (based on localization*.properties)

setUIStrings

protected void setUIStrings(java.util.Map map)
Override the common strings that are provided by the toolkit with your strings. Fill up this map (provided empty) as follows:
The key is taken from the pane (each common pane encapsulates an inner class holding its ui keys as constants). The value is your key, under which you override the default string.

Example: In order to override the string that asks the end-user for the next step after the wizard is finished (this is displayed in the last pane, after the object is saved). Your resource bundle contains an entry with key = FINISH_QUESTION_STR, and your string. You need to put in the map that is passed as a parameter the entry:
key = FinishPane.UiStrings.POST_COMPLETION_CHOICE_CAPTION_BUNDLE_KEY
value = FINISH_QUESTION_STR.

Parameters:
map - the map that needs to be filled with the customized keys (it is passed empty).

finalizeSummaries

public void finalizeSummaries(java.util.Map summaries,
                              IWizardContext context)
Finalizes the summaries. Called by the summary pane before it displays the summaries. The summaries map holds the summaries that were registered by the developer using the service API. Each entry in this map holds a String as key (the attribute/meta-attribute ID), and a Pair instance as value. The Pair instance holds the summary caption, and the attribute value. The summaries that are registered by the user are held as {String, Pair} entries. The SummaryPane looks for the value's nice name for those entries, using the PropertyEditor API. The developer can modify the entries or/and add entries:
First, look for the key with the required attribute id. Now, there are several options to modify the value that are supported.

finalizeDescriptor

public void finalizeDescriptor(java.util.Map attributes,
                               java.lang.Object descriptor,
                               IWizardContext context)
Finalizes the descriptor before saving. Puts the attributes that were registered by the developer using IBasicObjectCreationService.setComponentAsAttribute(com.sapportals.admin.wizardframework.components.AbstractInputComponent, java.lang.String, boolean, com.sapportals.admin.wizardframework.api.IWizardContext) It can be override in order to add or modify attributes. The developer has 2 ways to add or modify attributes:
  1. Putting them directly into the descriptor. In this case those attributes should not have entries in the map, because the super implementation reads everything from the map. The descriptor can be casted to the semantic descriptor to perform additional actions.
  2. Putting/modifying attributes in the map. In this case they would be automatically put into the descriptor by the super implementation.
The overriding method eventually needs to call super.finalizeDescriptor for 2 reasons: automatic copy from the map into the descriptor, and the handling of common attributes, e.g. title, description, locale etc (registered by the info pane). The method assumes that the descriptor is an instance of INewObjectDescriptor, therefore it does not support other types of descriptors.
Important: The object is always created as a non-template object. This is set in this method, therefore if the descriptor is not of INewObjectDescriptor type, the wizard developer needs to take care of this attribute.
Example:
 	descriptor.putAttribute(IAttrPcmGeneral.ATTRIBUTE_IS_TEMPLATE, "false");
 
Parameters:
descriptor - the pre-created object descriptor
attributes - a map that holds the following entries: {attributeId, Pair{summaryCaption, value}}.
context - wizard context
Throws:
DescriptorNotCreatedException - if the descriptor is not an instance of INewObjectDescriptor

finalizeObject

public void finalizeObject(IWizardContext context)
Finalize the new saved object. In order to get the semantic object, perform a lookup of the semantic object.
Parameters:
context - wizard context

addPanes

protected void addPanes(IConfigurableWizard wizard)
Adds common panes. The wizard developer needs to add only his/her panes in addUserPanes implementation in his/her wizard. Another option is to completely override this method with all panes.
Note: keep in mind that when a wizard developer wants to add arguments to one of the common panes, he/she doesn't have to override this method, instead he/she can simply add the pane with the required arguments in his/her addUserpanes implementation, and that would override the previous instance of that pane.
Parameters:
wizard - running wizard

addUserPanes

protected void addUserPanes(IConfigurableWizard wizard)
Adds user panes. Override to add your panes.The default implementation adds common panes.
Parameters:
wizard - running wizard

addTransitions

protected void addTransitions(IConfigurableWizard wizard)
Adds default transitions among the common panes, except transitions among user panes. Wizard developer needs to add his/her transitions in addUserTransitions implementation, or completely override this method with a complete set of transitions.
Parameters:
wizard - running wizard

addUserTransitions

protected void addUserTransitions(IConfigurableWizard wizard)
Adds user transitions. Override to add your transitions. The default implementation adds transitions between info pane and summary pane.
Parameters:
wizard - running wizard

addDependencies

protected void addDependencies(IConfigurableWizard wizard)
Adds wizard's dependencies, if exist. The default - no dependencies.
Parameters:
wizard - running wizard