com.ibm.portal.app.component
Interface Externalizable


public interface Externalizable

Externalizable is one of the Application Component Interfaces, implemented by a composite application component. It is used to save the state of your component into an application XML.

Note: The component instance identifier input parameter used in the serializeInstance(String) method is the identifer returned by the Templateable#createFromTemplate(Reader, ListModel) method if it was created from a template, otherwise it is the id from the Lifecycle.createInstance(ListModel) method.

Since:
6.0

Method Summary
 javax.xml.transform.Source serializeInstance(java.lang.String id)
          This method is called to serialize the business component instance.
 

Method Detail

serializeInstance

javax.xml.transform.Source serializeInstance(java.lang.String id)
                                             throws ComponentException
This method is called to serialize the business component instance. That is marshaling all information needed to recreate the same instance back again. The data written does usually not contain the business data itself as this might be a complete business system. For best performance a SAXSource object should be returned. This allows for streaming the business component data into the aggregated XML document. It is however also valid to return any other Source object as long as it results in a well-formed XML document. If your component can only generate the content as a String or DOM the following can be used:
 java.io.Reader reader = new StringReader("<data>my data</data>"); 
 javax.xml.transform.Source source = new javax.xml.transform.stream.StreamSource(reader);
 
 javax.xml.transform.Source source = new javax.xml.transform.dom.DOMSource(document);
 

Parameters:
id - component instance identifier, must not be null.
Returns:
the Source object delivering the XML document for this business component instance
Throws:
ComponentException - if you throw this exception the serialization process of the application instance will fail