|
SAP NetWeaver 7.30 (SP02) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sap.portal.httpconnectivity.transformationservice.AbstractTransformerHolder
com.sap.portal.httpconnectivity.transformationservice.TransformersProvider
public class TransformersProvider
A class that implements a simple transformer provider for the transformation
service.
Content developers providing their own persistent transformers must supply
a PAR file that declares TransformersProvider as its class
name property in portalapp.xml (see the example below).
Providers supplying SAX handlers must extend this class and overwrite the
method
com.sap.portal.httpconnectivity.transformationservice.ITransformerInformation.getSAXHandler.
Providers supplying a resource bundle must extend this class and overwrite
the method
Locale.getResourceBundle.
For SAX handlers and resource bundles, the class name property must point
to the new derived class. The provider must also register in the portal
runtime registry by adding the name of the PAR to portalapp.xml.
The following is an example of a 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>
2.Transformers.xml
<?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 String |
KEY
The service key. |
static String |
PROVIDER_RESOURCE_BUNDLE_NAME
A constant that defines the default name for the resource bundle. |
| 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()
If the service is defined as a startup service, this method is called during server startup after all other services have been initialized (that is, after the init methods of all other services have been called). |
void |
configure(IServiceConfiguration configuration)
Configures the service. |
ITransformerInformation |
createTransformerInformation(String componentName,
String transformerName,
Float transformerVersion,
TransformerType transformerType,
String fromUri,
String toUri,
String description)
Creates a new instance of ITransformerInformation. |
void |
destroy()
Destroys the service. |
IServiceContext |
getContext()
Gets the context of the provider service set by the Portal Runtime (PRT). |
String |
getKey()
Gets a unique key. |
ResourceBundle |
getResourceBundle(Locale locale)
Gets the resource bundle for the provider according to the specified locale. |
EPSAXDefaultHandler |
getSAXHandler(ITransformerInformation tInfo)
Gets the SAX handlers. |
void |
release()
Releases the service. |
protected void |
releaseAllTransformers()
Releases all the transformers from 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 String PROVIDER_RESOURCE_BUNDLE_NAME
public static final String KEY
| Constructor Detail |
|---|
public TransformersProvider()
| Method Detail |
|---|
public final void configure(IServiceConfiguration configuration)
configuration - a configuration key and valueIServicepublic final void destroy()
IServicepublic final void release()
IServicepublic final IServiceContext getContext()
IServicepublic final String getKey()
IServicepublic final void afterInit()
IService
public ITransformerInformation createTransformerInformation(String componentName,
String transformerName,
Float transformerVersion,
TransformerType transformerType,
String fromUri,
String toUri,
String description)
throws TransformationServiceException
AbstractTransformerHolderITransformerInformation.
This method is used mainly when registering new transformers.
createTransformerInformation in class AbstractTransformerHoldercomponentName - the component nametransformerName - the transformer nametransformerVersion - the transformer versiontransformerType - the transformer typefromUri - the source schemetoUri - the result schemedescription - the transformer description
TransformationServiceException - if the source data is corrupt,
if it cannot write to the result,
if one of the transformers doesn't
exist or if an error occurs
during the transformationprotected void releaseAllTransformers()
AbstractTransformerHolder
releaseAllTransformers in class AbstractTransformerHolder
public EPSAXDefaultHandler getSAXHandler(ITransformerInformation tInfo)
throws TransformationServiceException
AbstractTransformerHolder
getSAXHandler in class AbstractTransformerHoldertInfo - transformer information
TransformationServiceException - if the source data is corrupt,
if it cannot write to the result,
if one of the transformers doesn't
exist or if an error occurs
during the transformationpublic ResourceBundle getResourceBundle(Locale locale)
locale - the locale of the current call to the provider
| Access Rights |
|---|
| SC | DC | Public Part | ACH |
|---|---|---|---|
[sap.com] EP-ADMIN
|
[sap.com] tc/ep/admin/api/extd
|
api
|
EP-PIN
|
|
SAP NetWeaver 7.30 (SP02) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||