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:
JetspeedSerializer

public class JetspeedSerializerSecondaryImpl
extends JetspeedSerializerBase
implements 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
 
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(ComponentManager cm)
          hand over existing component manager
JetspeedSerializerSecondaryImpl(java.lang.String appRoot, java.lang.String[] bootConfig, java.lang.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
protected  java.lang.Class getSerializerDataClass()
          return the class for the serializer data , for example JSSeedData.class)
protected  java.lang.String getSerializerDataTag()
          return the XML tag for the serializer data , for example "JSSnapShot")
protected  void getSnapshotData()
          On import, get the basic SnapShot data
protected  void processExport(java.lang.String name, javolution.xml.XMLBinding binding)
          The workhorse for exporting data
protected  void processImport()
          The workhorse for importing data
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
 

Constructor Detail

JetspeedSerializerSecondaryImpl

public JetspeedSerializerSecondaryImpl()

JetspeedSerializerSecondaryImpl

public JetspeedSerializerSecondaryImpl(ComponentManager cm)
hand over existing component manager

Parameters:
cm -

JetspeedSerializerSecondaryImpl

public JetspeedSerializerSecondaryImpl(java.lang.String appRoot,
                                       java.lang.String[] bootConfig,
                                       java.lang.String[] appConfig)
                                throws 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:
SerializerException
Method Detail

getSerializerDataClass

protected java.lang.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 java.lang.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

processImport

protected void processImport()
                      throws SerializerException
The workhorse for importing data

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

processExport

protected void processExport(java.lang.String name,
                             javolution.xml.XMLBinding binding)
                      throws 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 -


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