com.sap.portal.admin.wizard
Interface IBasicObjectCreationService


public interface IBasicObjectCreationService

IBasicObjectCreationService provides utilities methods, and handles the creation of the new object on top of the new PCM layer.


Field Summary
static java.lang.String KEY
          Service key
 
Method Summary
 java.util.Map getAttributes2SummariesMap(IWizardContext context)
          Returns a map that holds the following entries:
Key = attribute id (String), value = Pair{summary caption, value}.
 java.lang.String getAttributeValueFromTarget(java.lang.String attrId, IWizardContext context)
          Gets an attribute value from the target object (template or portal component), in order to retain the concept of inheritance (e.g description, locale, etc).
 java.lang.String getBundleString(java.lang.String key, IWizardContext context)
          Gets a string from the resource bundle.
 java.lang.String getCreateModeParam(IWizardContext context)
          Gets the object's OCLASS (oClass parameter from Portal Content Catalog), implying whether it is based on a template or a par.
 java.lang.String getDefaultHandlerKey(IWizardContext context)
           
 java.lang.String getEditorIdParam(IWizardContext context)
          Gets the editor id param(editorID parameter from Portal Content Catalog).
 java.lang.String getMetaAttributeValueFromTarget(java.lang.String attrId, java.lang.String metaAttrId, IWizardContext context)
          Gets a meta-attribute value from the target object (template or portal component), in order to retain the concept of inheritance.
 java.lang.String getObjectTypeParam(IWizardContext context)
          Gets the new object's type (ComponentType or com.sap.portal.ComponentType parameter from Portal Content Catalog).
 com.sapportals.common.PPLogger getPPLogger(IWizardContext context)
          Deprecated.  
 java.lang.String getSaveLocationParam(IWizardContext context)
          Gets the object's save location (where parameter from Portal Content Catalog).
 java.lang.String getTargetIdParam(IWizardContext context)
          Gets the target object id (what parameter from Portal Content Catalog), implying the template/par id.
 boolean isInHouseMode()
           
 void setComponentAsAttribute(AbstractInputComponent component, java.lang.String attrId, boolean addAsSummary, IWizardContext context)
          Set the specified component's value to be an attribute for the object.
 void setPPLogger(java.lang.String subCategoryName, java.lang.String locationName, IWizardContext context)
          Deprecated.  
 void setSummaryCaption(java.lang.String attrId, java.lang.String caption, IWizardContext context)
          Sets the summary caption resource bundle key.
 

Field Detail

KEY

public static final java.lang.String KEY
Service key
Method Detail

getBundleString

public java.lang.String getBundleString(java.lang.String key,
                                        IWizardContext context)
Gets a string from the resource bundle. First it looks for the key in the local resource bundle (taken from the request), if not found it looks in the object's default wizard resource bundle, and finally it looks for the string in the toolkit's common resource bundle.

Example: Suppose the implemented wizard is designed to create an iview.It defines its own resource bundle with various strings specific to the wizard implementation. In addition, it uses the toolkit's common panes. There are 3 scenarios when asking for strings:

  1. Asking for a string which is specific for that wizard - it exists only in the wizard's resource bundle, and fetched from there.
  2. Asking for a string that is not specific to this wizard, but is general for iview wizards (e.g. iView Name) ,therefore it exists in the resource bundle of the default iview wizard. It is then fetched from the default wizard's resource bundle. Note: The toolkit's common panes naturally ask for those common strings, so using those panes inherently gives the wizard developer those strings without having to ask for them.
  3. Asking for a general string that is not specific for any type of object, therefore exists in the toolkit's resource bundle, and fetched from there (e.g. "close the wizard").
Parameters:
key - the requested key.
context - wizard context.
Returns:
translated string. If not found, returns the key.

getAttributeValueFromTarget

public java.lang.String getAttributeValueFromTarget(java.lang.String attrId,
                                                    IWizardContext context)
Gets an attribute value from the target object (template or portal component), in order to retain the concept of inheritance (e.g description, locale, etc).
Parameters:
attrId - the requested attribute id.
context - wizard context.
Returns:
attribute value. If it is an attribute of type text it returns the value according to the target's locale. If the target has no locale definition the portal locale is used. Null is returned if the attribute id is invalid or the attribute does not exist.
See Also:
IAttributeSet.getAttribute(String)

getMetaAttributeValueFromTarget

public java.lang.String getMetaAttributeValueFromTarget(java.lang.String attrId,
                                                        java.lang.String metaAttrId,
                                                        IWizardContext context)
Gets a meta-attribute value from the target object (template or portal component), in order to retain the concept of inheritance.
Parameters:
attrId - the requested attribute id.
metaAttrId - the requested meta-attribute id.
context - wizard context
Returns:
meta-attribute value. If it is a meta-attribute of type text it returns the value according to the target's locale. If the target has no locale definition the portal locale is used. Null is returned if the meta-attribute id is invalid or the meta-attribute does not exist.
See Also:
IAttributeSet.getMetaAttribute(String, String)

setComponentAsAttribute

public void setComponentAsAttribute(AbstractInputComponent component,
                                    java.lang.String attrId,
                                    boolean addAsSummary,
                                    IWizardContext context)
Set the specified component's value to be an attribute for the object. This way the link between the UI control and the object attribute is made automatically. As standard, the attribute id would be provided by the developer. If it has '-' delimiter it indicates a meta attribute (same notation like the PCM). The option to display this component in the summary view is also common, therefore a flag is given for this purpose.
Parameters:
component - the UI component that the attribute value is taken from.
attrId - the attribute id. If it's a meta-attribute, like the PCM, the attribute id and the meta-attribute id should be separated by a '-' character. For cases of text attributes, the toolkit would identify it by asking the attribute type from the PCM.
addAsSummary - if true, a summary item is added as follows: the summary name would be the caption of the component, and the value would be the component's value. It can be modified by using setSummaryCaption(String, String, IWizardContext).
context - wizard context.

setSummaryCaption

public void setSummaryCaption(java.lang.String attrId,
                              java.lang.String caption,
                              IWizardContext context)
Sets the summary caption resource bundle key. The given key would be translated in the summary pane. The purpose is to allow changes in the name of the summary rather than the component's caption.
Parameters:
attrId - the attribute id that was set along with the component.
caption - the caption to be displayed as summary name.
context - wizard context.
See Also:
setComponentAsAttribute(com.sapportals.admin.wizardframework.components.AbstractInputComponent, java.lang.String, boolean, com.sapportals.admin.wizardframework.api.IWizardContext)

getAttributes2SummariesMap

public java.util.Map getAttributes2SummariesMap(IWizardContext context)
Returns a map that holds the following entries:
Key = attribute id (String), value = Pair{summary caption, value}. The map holds all the components that were registered by the wizard developer, using the method setComponentAsAttribute(com.sapportals.admin.wizardframework.components.AbstractInputComponent, java.lang.String, boolean, com.sapportals.admin.wizardframework.api.IWizardContext)
Parameters:
context - wizard context.
Returns:
the map that holds all the registered attributes and summaries.

getDefaultHandlerKey

public java.lang.String getDefaultHandlerKey(IWizardContext context)

getSaveLocationParam

public java.lang.String getSaveLocationParam(IWizardContext context)
Gets the object's save location (where parameter from Portal Content Catalog).
Parameters:
context - wizard context.
Returns:
save location.

getTargetIdParam

public java.lang.String getTargetIdParam(IWizardContext context)
Gets the target object id (what parameter from Portal Content Catalog), implying the template/par id.
Parameters:
context - wizard context.
Returns:
target ID, or null if the object has no target.

getObjectTypeParam

public java.lang.String getObjectTypeParam(IWizardContext context)
Gets the new object's type (ComponentType or com.sap.portal.ComponentType parameter from Portal Content Catalog).
Parameters:
context - wizard context.
Returns:
object type, or null if not exists.

getCreateModeParam

public java.lang.String getCreateModeParam(IWizardContext context)
Gets the object's OCLASS (oClass parameter from Portal Content Catalog), implying whether it is based on a template or a par.
Parameters:
context - wizard context.
Returns:
create mode, or null if not exists.

getEditorIdParam

public java.lang.String getEditorIdParam(IWizardContext context)
Gets the editor id param(editorID parameter from Portal Content Catalog).
Parameters:
context - wizard context.
Returns:
editor id.

isInHouseMode

public boolean isInHouseMode()

setPPLogger

public void setPPLogger(java.lang.String subCategoryName,
                        java.lang.String locationName,
                        IWizardContext context)
Deprecated.  

Sets the parameters for the PPLogger instance of the wizard.
Parameters:
subCategoryName -  
locationName -  
context -  

getPPLogger

public com.sapportals.common.PPLogger getPPLogger(IWizardContext context)
Deprecated.  

Gets the PPLogger of the wizard.
Parameters:
context - wizard context
Returns:
PPLogger instance.