public final class ComponentFactory extends Object implements IFactoryInfoProvider, IClassLoaderRegistryListener
IComponents. When the factory is called for
the first time or when it receives a ConfigEvent , it reads out
information from the config framework. This information allows a mapping of a
descriptive name ("alias") to a java-class. This allows a usage of the descriptive name
throughout the configuration of the other parts of the rendering framework.
If a mapping points to a not-existing or non-loadable class or if the class
found does not implement the needed interface, an error message is written in
the log.files, stating the name of the alias and the mapped java-class.IFactoryInfoProvider.MappingInformation| Modifier and Type | Field and Description |
|---|---|
static String |
COMPONENT_PAGER
Deprecated.
key to retrieve a pager class instance from the factory using the factory's
getComponent method and stating this constant as alias-parameter |
static String |
COMPONENT_PATH
Deprecated.
key to retrieve a path class instance (a.k.a.
|
static String |
COMPONENT_SORT_HEADER
Deprecated.
key to retrieve a sort header class instance from the factory using the factory's
getComponent method and stating this constant as alias-parameter |
static String |
DATA_KEY_PAGER_DATA
Deprecated.
key to use when transferring data to an
IComponent instance
using its setData method. |
static String |
DATA_KEY_PARENT
Deprecated.
key to use when transferring data to an
IComponent instance
using its setData method. |
static String |
DATA_KEY_RESOURCE_LIST
Deprecated.
key to use when transferring data to an
IComponent instance
using its setData method. |
static String |
DATA_KEY_RID_LIST
Deprecated.
key to use when transferring data to an
IComponent instance
using its setData method. |
static String |
DATA_KEY_SEARCH_SESSION
Deprecated.
key to use when transferring data to an
IComponent instance
using its setData method. |
static String |
DATA_KEY_SORT_DATA
Deprecated.
key to use when transferring data to an
IComponent instance
using its setData method. |
static String |
LINE_BREAK
Deprecated.
constant used to separate debugging information
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkComponentAlias(String alias)
Deprecated.
As of NetWeaver 7.1
|
void |
classLoaderAdded(String id,
ClassLoader newLoader)
Deprecated.
As of NetWeaver 7.1
|
void |
classLoaderReplaced(String id,
ClassLoader newLoader,
ClassLoader oldLoader)
Deprecated.
As of NetWeaver 7.1
|
String |
createLinkID(IComponent component,
ArrayList values)
Deprecated.
As of NetWeaver 7.1
|
String |
createStaticLinkID(IComponent component,
ArrayList values,
String id)
Deprecated.
As of NetWeaver 7.1
|
IComponentEvent |
decodeEvent(ICollectionRenderer renderer,
IProxy proxy,
com.sapportals.htmlb.event.Event event,
Map values)
Deprecated.
As of NetWeaver 7.1
|
IComponent |
getComponent(IProxy proxy,
IResource res,
IFlavor impFlavor,
String alias)
Deprecated.
As of NetWeaver 7.1
|
IComponent |
getComponent(String alias,
IProxy proxy)
Deprecated.
As of NetWeaver 7.1
|
IComponent |
getComponent(String alias,
IProxy proxy,
ICollectionRenderer renderer)
Deprecated.
As of NetWeaver 7.1
|
IComponent |
getComponent(String alias,
IProxy proxy,
ICollectionRenderer renderer,
IResource res,
IFlavor flavor)
Deprecated.
As of NetWeaver 7.1
|
IComponent |
getComponent(String alias,
IProxy proxy,
IFlavor flavor)
Deprecated.
As of NetWeaver 7.1
|
String |
getFactoryName()
Deprecated.
As of NetWeaver 7.1
|
static ComponentFactory |
getInstance()
Deprecated.
As of NetWeaver 7.1
|
long |
getLastReloadTime()
Deprecated.
As of NetWeaver 7.1
|
List |
getMappings(Locale locale)
Deprecated.
As of NetWeaver 7.1
|
List |
getPresentConfiguration(IResourceContext context)
Deprecated.
As of NetWeaver 7.1
|
String |
getPresentConfiguration(IResourceContext context,
String style,
boolean showJavaClassNames)
Deprecated.
As of NetWeaver 7.1
|
Status |
getStatus()
Deprecated.
As of NetWeaver 7.1
|
public static final String LINE_BREAK
public static final String COMPONENT_PAGER
getComponent method and stating this constant as alias-parameterpublic static final String COMPONENT_PATH
getComponent method and stating this
constant as alias-parameterpublic static final String COMPONENT_SORT_HEADER
getComponent method and stating this constant as alias-parameterpublic static final String DATA_KEY_SORT_DATA
IComponent instance
using its setData method. It is used as the key for a
Map entry that must be of class SortDefinition.public static final String DATA_KEY_PAGER_DATA
IComponent instance
using its setData method. It is used as the key for a
Map entry that must be of class PagerData.public static final String DATA_KEY_RESOURCE_LIST
IComponent instance
using its setData method. It is used as the key for a
Map entry that must be of class IResourceList.public static final String DATA_KEY_RID_LIST
IComponent instance
using its setData method. It is used as the key for a
Map entry that must be of class IRidList.public static final String DATA_KEY_SEARCH_SESSION
IComponent instance
using its setData method. It is used as the key for a
Map entry that must be of class ISearchSession.public static final String DATA_KEY_PARENT
IComponent instance
using its setData method. It is used as the key for a
Map entry that must be of class ICollection.public static ComponentFactory getInstance()
public IComponent getComponent(String alias, IProxy proxy, ICollectionRenderer renderer)
IComponent that is defined for the
given alias or null, if no component is defined for the given
alias.
The components attributes alias, flavor, proxy, renderer, resource, startUri
will be set with the values obtained from the given parameters.public IComponent getComponent(IProxy proxy, IResource res, IFlavor impFlavor, String alias)
public IComponent getComponent(String alias, IProxy proxy, ICollectionRenderer renderer, IResource res, IFlavor flavor)
public IComponent getComponent(String alias, IProxy proxy)
IComponent that is defined for the
given alias or null, if no component is defined for the given
alias.
The components attributes alias, proxy, resource, startUri
will be set with the values obtained from the given parameters.public IComponent getComponent(String alias, IProxy proxy, IFlavor flavor)
public IComponentEvent decodeEvent(ICollectionRenderer renderer, IProxy proxy, com.sapportals.htmlb.event.Event event, Map values) throws WcmException
IComponent from the component's alias found inside
the given event and let's it fire the returned IComponentEvent or
null.
If the id of the Htmlb-Component that fired the Event
was not created using the factory's createLinkID or
createStaticLinkID, this method might throw an WcmException
or simply return null. Otherwise, a new Component
instance is created, its attributes alias, proxy, renderer are set
with the parameters given and its decodeEvent method is called,
using again the given parameters. The created instance of the IComponent
will not be reused by the factory in later calls.WcmExceptionpublic String createLinkID(IComponent component, ArrayList values) throws WcmException
IComponent's alias
and all the entries of the given ArrayList. It also adds a
String obtained from IDCounter.currentID(). Therefore,
the ID created by this method cannot be reproduced at a later time. If you
need to access the htmlb-Component inside your IComponent
after an http-request-cycle, use the factory's createStaticLinkID
method.
None of the given parameters must be null.WcmException - if the creation of the linkID failed. This exception might
wrap a WdfException.public String createStaticLinkID(IComponent component, ArrayList values, String id) throws WcmException
IComponent's alias
and all the entries of the given ArrayList. It also adds the
id-parameter given. Therefore, the ID created by this method can be reproduced
at a later time. Note that if you create two htmlb-Components within
the same IComponent and the same ArrayList and id,
there will be a NonUniqueIDException thrown when rendering the html-page.
None of the given parameters must be null.WcmException - if the creation of the linkID failed. This exception might
wrap a WdfException.public String getPresentConfiguration(IResourceContext context, String style, boolean showJavaClassNames)
context - the current context of the user, sets e.g. the language
of the labels for the commandsstyle - currently not usedshowJavaClassNames - flag to show (true) or hide (false) java class names
in the returned stringpublic List getPresentConfiguration(IResourceContext context)
String to avoid ClassCastException
s.context - Description of the parampublic String getFactoryName()
getFactoryName in interface IFactoryInfoProvidernullpublic List getMappings(Locale locale)
getMappings in interface IFactoryInfoProviderlocale - defines the language to use, if the factory offers translated information,
must not be nullIFactoryInfoProvider.MappingInformation,
must not be nullpublic Status getStatus()
getStatus in interface IFactoryInfoProviderStatus.ERRORpublic long getLastReloadTime()
getLastReloadTime in interface IFactoryInfoProviderSystem.currentTimeMillis().
An implementing class might also return -1 to indicate, that
no information is available.public boolean checkComponentAlias(String alias)
alias - true if a component with the given alias exists, otherwise falsepublic void classLoaderAdded(String id, ClassLoader newLoader)
IClassLoaderRegistryListenerclassLoaderAdded in interface IClassLoaderRegistryListenerid - the ID of the application being registered with CRTnewLoader - the class loader of the applicationpublic void classLoaderReplaced(String id, ClassLoader newLoader, ClassLoader oldLoader)
IClassLoaderRegistryListenerclassLoaderReplaced in interface IClassLoaderRegistryListenerid - the ID of the application being registered with CRTnewLoader - the new class loaderoldLoader - the old class loader| Access Rights |
|---|
| SC | DC | Public Part | ACH |
|---|---|---|---|
[sap.com] KMC-CM
|
[sap.com]
|
api
|
EP-KM-CM
|
[sap.com] KMC-WPC
|
[sap.com] tc/kmc/wpc/wpcfacade
|
api
|
EP-PIN-WPC-WCM
|
Copyright 2021 SAP SE Complete Copyright Notice