com.sap.nw.pcc.km.service.editor.component

Class AbstractEditorComponent

java.lang.Object
  extended by com.sap.nw.pcc.km.service.editor.component.AbstractEditorComponent
All Implemented Interfaces:
IEditorComponent

public abstract class AbstractEditorComponent
extends Object
implements IEditorComponent

Abstract for editor components to extend. Implements common component methods


Field Summary
protected  ResourceBundle bundle
           
protected  ComponentConfig componentConfig
           
static String CORE_VALUE
           
protected  AbstractEditorObject editorObject
           
static String TITLE_VALUE
           
 
Constructor Summary
AbstractEditorComponent()
           
AbstractEditorComponent(AbstractEditorObject editorObject)
           
 
Method Summary
 String getCoreValue()
          Gets the value registered as the core or key value by the component
 Element getDefaultXMLElement(Document document, String elementId, String tagName, String defaultValue, IPropertyName propName)
          Creates default XML element represented by this component should contain default value.
protected  Element getGenericXML(Document document, String elementId, String tagName, boolean includePropertyValues)
          Creates an XML element for the generic case when the component is an inputfield.
 com.sapportals.htmlb.Component getHtmlbComponent()
          Gets the htmlb component of this editor component
 String getLabel(String key)
          Gets a locale specific label from a resurce bundle for the given key
 Collection<String> getReferences()
          Returns list of referenced objects (paths)
abstract  Element getXMLElement(Document document, String string, String tagName, boolean includePropertyValues)
          Creates the XML element represented by this component
 void init(AbstractEditorObject editorObject, ComponentConfig cc)
           
 void initializeFromPageContext(AbstractEditorObject editorObject, com.sapportals.htmlb.rendering.IPageContext context, ComponentConfig cc)
          Called by the editor framework to initialise the component after it has created in an editor document.
 void registerLink(IResource parent)
          Called by framework when document is saved to allow the component to register any links it knows about with the link manager service
 void setCoreValue(String s)
           
 void setHtmlbComponent(com.sapportals.htmlb.Component comp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sap.nw.pcc.km.service.editor.component.IEditorComponent
initialiseFromXML
 

Field Detail

CORE_VALUE

public static final String CORE_VALUE
See Also:
Constant Field Values

TITLE_VALUE

public static final String TITLE_VALUE
See Also:
Constant Field Values

editorObject

protected AbstractEditorObject editorObject

componentConfig

protected ComponentConfig componentConfig

bundle

protected ResourceBundle bundle
Constructor Detail

AbstractEditorComponent

public AbstractEditorComponent(AbstractEditorObject editorObject)

AbstractEditorComponent

public AbstractEditorComponent()
Method Detail

init

public void init(AbstractEditorObject editorObject,
                 ComponentConfig cc)

initializeFromPageContext

public void initializeFromPageContext(AbstractEditorObject editorObject,
                                      com.sapportals.htmlb.rendering.IPageContext context,
                                      ComponentConfig cc)
Description copied from interface: IEditorComponent
Called by the editor framework to initialise the component after it has created in an editor document. Allows the component to be initialised from the page context/configuration to set for example locale specific labels.

Specified by:
initializeFromPageContext in interface IEditorComponent
Parameters:
editorObject - corresponding editor object
context - HTMLB page context from which the component has to retrieve its value as entered by the user.
cc - an object representing the configuration for this editor component type.

getXMLElement

public abstract Element getXMLElement(Document document,
                                      String string,
                                      String tagName,
                                      boolean includePropertyValues)
Description copied from interface: IEditorComponent
Creates the XML element represented by this component

Specified by:
getXMLElement in interface IEditorComponent
Returns:

getHtmlbComponent

public com.sapportals.htmlb.Component getHtmlbComponent()
Description copied from interface: IEditorComponent
Gets the htmlb component of this editor component

Specified by:
getHtmlbComponent in interface IEditorComponent

setHtmlbComponent

public void setHtmlbComponent(com.sapportals.htmlb.Component comp)

getDefaultXMLElement

public Element getDefaultXMLElement(Document document,
                                    String elementId,
                                    String tagName,
                                    String defaultValue,
                                    IPropertyName propName)
Description copied from interface: IEditorComponent
Creates default XML element represented by this component should contain default value.

Specified by:
getDefaultXMLElement in interface IEditorComponent
Returns:

getGenericXML

protected Element getGenericXML(Document document,
                                String elementId,
                                String tagName,
                                boolean includePropertyValues)
Creates an XML element for the generic case when the component is an inputfield. This is a common case (eg. inputfield, image select, date select etc.)

Parameters:
document -
Returns:

getCoreValue

public String getCoreValue()
Description copied from interface: IEditorComponent
Gets the value registered as the core or key value by the component

Specified by:
getCoreValue in interface IEditorComponent
Returns:

setCoreValue

public void setCoreValue(String s)

getLabel

public String getLabel(String key)
Gets a locale specific label from a resurce bundle for the given key

Parameters:
key -
Returns:

registerLink

public void registerLink(IResource parent)
Description copied from interface: IEditorComponent
Called by framework when document is saved to allow the component to register any links it knows about with the link manager service

Specified by:
registerLink in interface IEditorComponent

getReferences

public Collection<String> getReferences()
Description copied from interface: IEditorComponent
Returns list of referenced objects (paths)

Specified by:
getReferences in interface IEditorComponent
Returns:
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM


Copyright 2011 SAP AG Complete Copyright Notice