|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.sap.portal.httpconnectivity.transformationservice.AbstractTransformerHolder
|
+--com.sap.portal.httpconnectivity.transformationservice.TransformersProvider
Service that implements a simple transformers provider for the transformation
service.
Content developer that would like to provide his own persistent
transformers should supply par file that declares this class as it's class name
property in the portalapp.xml (see example).
Providers that would like to supply SAX handlers must extend this
class and overwrite method getSAXHandler(). Providers that would like
to provide ResourceBundle that will be used in their transformers must extend this
class ans overwrite getResourceBundle() method. The new derived class must be
located in the core part of the service.
In both last cases the class name property must point to the new implemented derived class.
The provider must also register the provider in the portal runtime
registry by adding the name of the par to the portalapp.xml.
Example of provider where the par name is com.sap.portal.SimpleTransformerProvider:
1. portalapp.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<application>
<registry>
<entry path="runtime/transformers/com.sap.portal.SimpleTransformerProvider"
name="TransformersProvider"
type="service"/>
</registry>
<application-config>
<property name="ServicesReference" value="com.sap.portal.htmlb,com.sap.portal.transformationservice"/>
<property name="releasable" value="false"/>
<property name="startup" value="true"/>
</application-config>
<components/>
<services>
<service name="TransformersProvider">
<service-config>
<property name="className" value="com.sap.portal.httpconnectivity.transformationservice.TransformersProvider"/>
<property name="classNameFactory" value=""/>
<property name="classNameManager" value=""/>
<property name="SecurityZone" value="com.sap.portal/no_safety" />
</service-config>
</service>
</services>
</application>
<?xml version="1.0" encoding="utf-8"?>
<transformation-resources>
<transformers type="XSL"><!-- Holder of XSL transformers -->
<transformer> <!-- Represet single transforemr -->
<property name="Name" value="SIMPLE_TRANSFORMER"/> <!-- Name of the transformer-->
<property name="Description" value="Transform from my scheme to XHTMLB"/>
<property name="FromURI" value="MY_SCHEME"/> <!-- Source scheme URI -->
<property name="ToURI" value="XHTMLB"/> <!-- result scheme URI -->
<property name="SourceName" value="MY_SCHEME_TO_XHTMLB.xsl"/><!-- XSL file name -->
<!-- Transformer version, allows you to add new versions of transformers without the need to
change the code that use these transformers -->
<property name="Version" value="1.0"/>
</transformer>
<!-- You can add more transformers here -->
</transformers>
</transformation-resources>
| Field Summary | |
static java.lang.String |
KEY
Key of the service. |
static java.lang.String |
PROVIDER_RESOURCE_BUNDLE_NAME
Default name for the resource bundle name |
| Fields inherited from class com.sap.portal.httpconnectivity.transformationservice.AbstractTransformerHolder |
m_serviceContext, TRNS_HLDR_CATEGORY, TRNS_HLDR_LOCATION, TRNS_HLDR_LOG_SUBLOC |
| Constructor Summary | |
TransformersProvider()
|
|
| Method Summary | |
void |
afterInit()
|
void |
configure(com.sapportals.portal.prt.service.IServiceConfiguration configuration)
configure the service |
ITransformerInformation |
createTransformerInformation(java.lang.String componentName,
java.lang.String transformerName,
java.lang.Float transformerVersion,
TransformerType transformerType,
java.lang.String fromUri,
java.lang.String toUri,
java.lang.String description)
Create new instance of ITransformerInformation. |
void |
destroy()
This method is called by the portal runtime when the service is destroyed. |
com.sapportals.portal.prt.service.IServiceContext |
getContext()
Get the context of the provider service |
java.lang.String |
getKey()
This method should return a string that is unique to this service amongst all other services deployed in the portal runtime. |
java.util.ResourceBundle |
getResourceBundle(java.util.Locale locale)
Get the resource bundle assosiated with the provider according to a locale. |
EPSAXDefaultHandler |
getSAXHandler(ITransformerInformation tInfo)
Method that is used to get the SAX handlers. |
void |
release()
This method is called by the portal runtime when the service is released. |
protected void |
releaseAllTransformers()
Release all the transformers of the holder |
| Methods inherited from class com.sap.portal.httpconnectivity.transformationservice.AbstractTransformerHolder |
getSAXClassName, getTransformersResourcePath, getXSLTransformerPath, init, loadTransformers, setTransformers |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static java.lang.String PROVIDER_RESOURCE_BUNDLE_NAME
public static final java.lang.String KEY
| Constructor Detail |
public TransformersProvider()
| Method Detail |
public final void configure(com.sapportals.portal.prt.service.IServiceConfiguration configuration)
configuration - public final void destroy()
public final void release()
public final com.sapportals.portal.prt.service.IServiceContext getContext()
public final java.lang.String getKey()
public final void afterInit()
public ITransformerInformation createTransformerInformation(java.lang.String componentName,
java.lang.String transformerName,
java.lang.Float transformerVersion,
TransformerType transformerType,
java.lang.String fromUri,
java.lang.String toUri,
java.lang.String description)
throws TransformationServiceException
AbstractTransformerHoldercreateTransformerInformation in class AbstractTransformerHoldercom.sap.portal.httpconnectivity.transformationservice.AbstractTransformerHoldercomponentName - the component nametransformerName - the transformer nametransformerVersion - the version of the transformertransformerType - type of transformerfromUri - source schemetoUri - result schemedescription - transformer descriptionTransformationServiceException - when input data is missingby the defining it's propertiesprotected void releaseAllTransformers()
AbstractTransformerHolderreleaseAllTransformers in class AbstractTransformerHolder
public EPSAXDefaultHandler getSAXHandler(ITransformerInformation tInfo)
throws TransformationServiceException
AbstractTransformerHoldergetSAXHandler in class AbstractTransformerHoldercom.sap.portal.httpconnectivity.transformationservice.AbstractTransformerHoldertInfo - the transformer informationTransformationServiceException - when cannot instancite SAX handlerpublic java.util.ResourceBundle getResourceBundle(java.util.Locale locale)
locale - the locale of current call to the provider
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||