org.apache.jetspeed.serializer
Class JetspeedSerializerSecondaryImpl

java.lang.Object
  extended by org.apache.jetspeed.serializer.JetspeedSerializerBase
      extended by org.apache.jetspeed.serializer.JetspeedSerializerSecondaryImpl
All Implemented Interfaces:
org.apache.jetspeed.serializer.JetspeedSerializer

public class JetspeedSerializerSecondaryImpl
extends JetspeedSerializerBase
implements org.apache.jetspeed.serializer.JetspeedSerializer

Jetspeed Serializer - Secondary Data

The Serializer is capable of reading and writing additional content of the Jetspeed environment such as entities and preferences to and from XML files. The component can be used from a standalone java application for seeding a new database or from a running portal as an administrative backup/restore function.

Version:
$Id: $
Author:
Hajo Birthelmer

Field Summary
private  org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent entityAccess
           
(package private)  boolean overwrite
           
private  org.apache.jetspeed.prefs.PreferencesProvider prefProvider
           
(package private)  int refCouter
           
private  org.apache.jetspeed.components.portletregistry.PortletRegistry registry
           
 
Fields inherited from class org.apache.jetspeed.serializer.JetspeedSerializerBase
log
 
Fields inherited from interface org.apache.jetspeed.serializer.JetspeedSerializer
DECODING_SUPPORTED, ERROR_DECODING, INVALID_PASSWORDS, KEY_BACKUP_BEFORE_PROCESS, KEY_OVERWRITE_EXISTING, KEY_PROCESS_CAPABILITIES, KEY_PROCESS_ENTITIES, KEY_PROCESS_PERMISSIONS, KEY_PROCESS_PORTAL_PREFERENCES, KEY_PROCESS_PREFERENCES, KEY_PROCESS_PROFILER, KEY_PROCESS_USER_PREFERENCES, KEY_PROCESS_USERS, NO_DECODING, PASSTHRU_REQUIRED, TAG_SECONDARYSNAPSHOT, TAG_SNAPSHOT
 
Constructor Summary
JetspeedSerializerSecondaryImpl()
           
JetspeedSerializerSecondaryImpl(org.apache.jetspeed.components.ComponentManager cm)
          hand over existing component manager
JetspeedSerializerSecondaryImpl(String appRoot, String[] bootConfig, String[] appConfig)
          This constructor takes the application root, the search path for the boot component configuration files and the search path for the application component configuration files.
 
Method Summary
private  JSApplications exportEntities()
           
(package private)  JSEntity exportEntityPref(org.apache.jetspeed.om.common.portlet.MutablePortletEntity entity)
           
private  JSApplication exportPA(org.apache.jetspeed.om.common.portlet.MutablePortletApplication pa)
           
private  JSPortlet exportPD(org.apache.pluto.om.portlet.PortletDefinition pd)
           
protected  Class getSerializerDataClass()
          return the class for the serializer data , for example JSSeedData.class)
protected  String getSerializerDataTag()
          return the XML tag for the serializer data , for example "JSSnapShot")
protected  void getSnapshotData()
          On import, get the basic SnapShot data
private  void importEntities()
           
private  void importEntityPref(JSEntity entity, org.apache.jetspeed.om.common.portlet.MutablePortletEntity portletEntity)
           
(package private)  void importPA(JSApplication app, org.apache.jetspeed.om.common.portlet.MutablePortletApplication pa)
           
private  void importPD(JSPortlet portlet, org.apache.pluto.om.portlet.PortletDefinition pd)
           
private  void importPreferenceNode(JSEntityPreference preference, org.apache.jetspeed.om.common.portlet.MutablePortletEntity entity)
           
protected  void processExport(String name, javolution.xml.XMLBinding binding)
          The workhorse for exporting data
protected  void processImport()
          The workhorse for importing data
(package private)  JSEntityPreference processPreferenceNode(org.apache.jetspeed.om.common.portlet.MutablePortletEntity entity, String child)
           
protected  void resetSettings()
          reset instruction flags to default settings (all true)
protected  void setSnapshotData()
          On export, set the basic SnapShot data
protected  void setupAliases(javolution.xml.XMLBinding binding)
          Setup the binding for the different classes, mapping each extracted class to a unique tag name in the XML
 
Methods inherited from class org.apache.jetspeed.serializer.JetspeedSerializerBase
checkSettings, closeUp, createUniqueBackupFilename, doBackupOfCurrent, exportData, getCM, getDefaultIndent, getObjectBehindPath, getSetting, getSnapshot, getTokens, importData, initializeComponentManager, logMe, openWriter, readFile, recreatePassword, removeFromString, setComponentManager, setDefaultIndent, setSetting, setSnapshot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jetspeed.serializer.JetspeedSerializer
, closeUp, exportData, getDefaultIndent, importData, initializeComponentManager, setComponentManager, setDefaultIndent
 

Field Detail

overwrite

boolean overwrite

refCouter

int refCouter

entityAccess

private org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent entityAccess

registry

private org.apache.jetspeed.components.portletregistry.PortletRegistry registry

prefProvider

private org.apache.jetspeed.prefs.PreferencesProvider prefProvider
Constructor Detail

JetspeedSerializerSecondaryImpl

public JetspeedSerializerSecondaryImpl()

JetspeedSerializerSecondaryImpl

public JetspeedSerializerSecondaryImpl(org.apache.jetspeed.components.ComponentManager cm)
hand over existing component manager

Parameters:
cm -

JetspeedSerializerSecondaryImpl

public JetspeedSerializerSecondaryImpl(String appRoot,
                                       String[] bootConfig,
                                       String[] appConfig)
                                throws org.apache.jetspeed.serializer.SerializerException
This constructor takes the application root, the search path for the boot component configuration files and the search path for the application component configuration files.

For example: new JetspeedSerializerImpl("./", "assembly/boot/*.xml", "assembly/*.xml") will establish the current directory as the root, process all xml files in the assembly/boot directory before processing all xml files in the assembly directory itself.

Parameters:
appRoot - working directory
bootConfig - boot (primary) file or files (wildcards are allowed)
appConfig - application (secondary) file or files (wildcards are allowed)
Throws:
org.apache.jetspeed.serializer.SerializerException
Method Detail

getSerializerDataClass

protected Class getSerializerDataClass()
Description copied from class: JetspeedSerializerBase
return the class for the serializer data , for example JSSeedData.class)

Specified by:
getSerializerDataClass in class JetspeedSerializerBase
Returns:

getSerializerDataTag

protected String getSerializerDataTag()
Description copied from class: JetspeedSerializerBase
return the XML tag for the serializer data , for example "JSSnapShot")

Specified by:
getSerializerDataTag in class JetspeedSerializerBase
Returns:

resetSettings

protected void resetSettings()
reset instruction flags to default settings (all true)

Specified by:
resetSettings in class JetspeedSerializerBase

getSnapshotData

protected void getSnapshotData()
On import, get the basic SnapShot data

Overrides:
getSnapshotData in class JetspeedSerializerBase

setSnapshotData

protected void setSnapshotData()
On export, set the basic SnapShot data

Overrides:
setSnapshotData in class JetspeedSerializerBase

exportPD

private JSPortlet exportPD(org.apache.pluto.om.portlet.PortletDefinition pd)
                    throws org.apache.jetspeed.serializer.SerializerException
Throws:
org.apache.jetspeed.serializer.SerializerException

exportEntityPref

JSEntity exportEntityPref(org.apache.jetspeed.om.common.portlet.MutablePortletEntity entity)

processPreferenceNode

JSEntityPreference processPreferenceNode(org.apache.jetspeed.om.common.portlet.MutablePortletEntity entity,
                                         String child)

exportPA

private JSApplication exportPA(org.apache.jetspeed.om.common.portlet.MutablePortletApplication pa)
                        throws org.apache.jetspeed.serializer.SerializerException
Throws:
org.apache.jetspeed.serializer.SerializerException

exportEntities

private JSApplications exportEntities()
                               throws org.apache.jetspeed.serializer.SerializerException
Throws:
org.apache.jetspeed.serializer.SerializerException

processImport

protected void processImport()
                      throws org.apache.jetspeed.serializer.SerializerException
The workhorse for importing data

Specified by:
processImport in class JetspeedSerializerBase
Parameters:
binding - established XML binding
Throws:
SerializerException

processExport

protected void processExport(String name,
                             javolution.xml.XMLBinding binding)
                      throws org.apache.jetspeed.serializer.SerializerException
The workhorse for exporting data

Specified by:
processExport in class JetspeedSerializerBase
Parameters:
binding - established XML binding
Throws:
SerializerException

setupAliases

protected void setupAliases(javolution.xml.XMLBinding binding)
Setup the binding for the different classes, mapping each extracted class to a unique tag name in the XML

Specified by:
setupAliases in class JetspeedSerializerBase
Parameters:
binding -

importEntities

private void importEntities()
                     throws org.apache.jetspeed.serializer.SerializerException
Throws:
org.apache.jetspeed.serializer.SerializerException

importPA

void importPA(JSApplication app,
              org.apache.jetspeed.om.common.portlet.MutablePortletApplication pa)
        throws org.apache.jetspeed.serializer.SerializerException
Throws:
org.apache.jetspeed.serializer.SerializerException

importPD

private void importPD(JSPortlet portlet,
                      org.apache.pluto.om.portlet.PortletDefinition pd)
               throws org.apache.jetspeed.serializer.SerializerException
Throws:
org.apache.jetspeed.serializer.SerializerException

importEntityPref

private void importEntityPref(JSEntity entity,
                              org.apache.jetspeed.om.common.portlet.MutablePortletEntity portletEntity)

importPreferenceNode

private void importPreferenceNode(JSEntityPreference preference,
                                  org.apache.jetspeed.om.common.portlet.MutablePortletEntity entity)


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.