Show TOC

Background documentationModule is Exported or Imported Locate this document in the navigation structure

 

These events occur when a workspace, in which the module is running, is added to or restored from a transport package. You can implement handling of these events to export or import the module‘s external resources, such as documents or records (note that module storage is transported automatically).

To register for the export and import events, you need to create a property com.sap.workspaces.module.metadata.extension~transport in the portalapp.xml , for example:

<property name="com.sap.workspaces.module.metadata.extension~transport" value="prt_service:com.yourname.portal.workspaces.modules.MyExtensionService"/>.

The following example illustrates how to add module-related entries to a workspace transport package during export.

Example Example

  1. public IExportEntry[] getExportEntries(IModuleContext context)
    {
    	// Create an array of export entries
    	IExportEntry[] exportEntries = new IExportEntry[1];
    
    	// Create an entry to export; can be more than one
    	IExportEntry exportEntry = new MyExportEntryImpl(context); 
    
    	exportEntries[0] = exportEntry;
    
    	return exportEntries;
    }
    
    
End of the source code.

The following example illustrates how to retrieve module-related entries from a workspace transport package during import.

Example Example

  1. public void importEntries(IModuleContext context, IImportEntry[] importEntries) throws IOException
    {
    // Iterate through the entries 
    for(int i=0; i<importEntries.length; i++)
    {
    	IImportEntry importEntry = importEntries[i];
    
    	InputStream stream = importEntry.getInputStream();
    
    	// Do something with the stream
    	}
    }
    
End of the source code.