com.atlassian.confluence.importexport.impl
Class AbstractXmlExporter

java.lang.Object
  extended bycom.atlassian.confluence.importexport.Exporter
      extended bycom.atlassian.confluence.importexport.impl.AbstractExporterImpl
          extended bycom.atlassian.confluence.importexport.impl.AbstractXmlExporter
Direct Known Subclasses:
FileXmlExporter, MemoryXmlExporter

public abstract class AbstractXmlExporter
extends AbstractExporterImpl

abstract class that deals strictly with the conversion of a objects to an xml stream


Field Summary
static String ATTACHMENTS_DIRECTORY
          Directory into which attachments will be placed in the exported ZIP file
protected  BootstrapManager bootstrapManager
           
static String ENTITIES_FILE_NAME
           
static String EXPORT_DESCRIPTOR_FILE_NAME
           
protected  net.sf.hibernate.SessionFactory sessionFactory
           
protected  SpaceManager spaceManager
           
static String TEMPLATES_DIRECTORY
          Directory into which template overrides will be placed in the exported ZIP file
 
Fields inherited from class com.atlassian.confluence.importexport.Exporter
context, log
 
Constructor Summary
AbstractXmlExporter()
           
 
Method Summary
protected  void addPropertiesForContent(List contentList, ContentEntityObject contentObject)
           
protected  void backupEntities(ObjectHandleTranslator translator)
           
protected  void backupEverything(ObjectHandleTranslator translator)
           
 String doExport(ObjectHandleTranslator translator)
           
protected  List expandSpaces(List workingEntities)
          Deprecated. - just use getContentAndContentPropertiesFromSpace()
protected  List getContentAndContentPropertiesFromSpace(Space space)
           
protected  OutputStream getDescriptorOutputStream()
           
protected  String getExportType()
           
protected abstract  List getHandlesOfObjectsForExport()
           
protected  List getObjectsExcludedFromExport()
           
protected abstract  List getSourceTemplateDirForCopying()
           
protected  OutputStream getXmlOutputStream()
          output stream to write XML object information to
 void setBootstrapManager(BootstrapManager bootstrapManager)
           
 void setPropertySetManager(ConfluencePropertySetManager propertySetManager)
           
 void setSessionFactory(net.sf.hibernate.SessionFactory sessionFactory)
           
 void setSettingsManager(SettingsManager settingsManager)
           
 void setSpaceManager(SpaceManager spaceManager)
           
protected  void writeBackupDescriptor(String baseExportPath)
           
 
Methods inherited from class com.atlassian.confluence.importexport.impl.AbstractExporterImpl
checkHaveSomethingToExport, ensureDirectoryCreated, ensurePathExists, getSpaceKeyForExportFileName, getWorkingExportContext, prepareExportFileName
 
Methods inherited from class com.atlassian.confluence.importexport.Exporter
doExport, getContext, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXPORT_DESCRIPTOR_FILE_NAME

public static final String EXPORT_DESCRIPTOR_FILE_NAME
See Also:
Constant Field Values

ENTITIES_FILE_NAME

public static final String ENTITIES_FILE_NAME
See Also:
Constant Field Values

ATTACHMENTS_DIRECTORY

public static final String ATTACHMENTS_DIRECTORY
Directory into which attachments will be placed in the exported ZIP file

See Also:
Constant Field Values

TEMPLATES_DIRECTORY

public static final String TEMPLATES_DIRECTORY
Directory into which template overrides will be placed in the exported ZIP file

See Also:
Constant Field Values

sessionFactory

protected net.sf.hibernate.SessionFactory sessionFactory

bootstrapManager

protected BootstrapManager bootstrapManager

spaceManager

protected SpaceManager spaceManager
Constructor Detail

AbstractXmlExporter

public AbstractXmlExporter()
Method Detail

getHandlesOfObjectsForExport

protected abstract List getHandlesOfObjectsForExport()
                                              throws ImportExportException
Throws:
ImportExportException

setSessionFactory

public void setSessionFactory(net.sf.hibernate.SessionFactory sessionFactory)

setBootstrapManager

public void setBootstrapManager(BootstrapManager bootstrapManager)

getObjectsExcludedFromExport

protected List getObjectsExcludedFromExport()
                                     throws ImportExportException
Throws:
ImportExportException

doExport

public String doExport(ObjectHandleTranslator translator)
                throws ImportExportException
Overrides:
doExport in class AbstractExporterImpl
Throws:
ImportExportException

backupEverything

protected void backupEverything(ObjectHandleTranslator translator)
                         throws ImportExportException
Throws:
ImportExportException

writeBackupDescriptor

protected void writeBackupDescriptor(String baseExportPath)
                              throws ImportExportException
Throws:
ImportExportException

getDescriptorOutputStream

protected OutputStream getDescriptorOutputStream()
                                          throws ImportExportException,
                                                 FileNotFoundException
Throws:
ImportExportException
FileNotFoundException

getXmlOutputStream

protected OutputStream getXmlOutputStream()
                                   throws ImportExportException,
                                          IOException
output stream to write XML object information to

Returns:
Throws:
ImportExportException
FileNotFoundException
IOException

getExportType

protected String getExportType()
                        throws ImportExportException
Throws:
ImportExportException

getSourceTemplateDirForCopying

protected abstract List getSourceTemplateDirForCopying()

backupEntities

protected void backupEntities(ObjectHandleTranslator translator)
                       throws ImportExportException
Throws:
ImportExportException

expandSpaces

protected List expandSpaces(List workingEntities)
Deprecated. - just use getContentAndContentPropertiesFromSpace()

Expand a space into pages, blogs and mail objects to be exported. We must build an exceptions entities list because the databinder seems to bind everything in the space. The only way we can remove entities that the user cannot see is via XMLDatabinder.unbindAll(). We pass the exception entities list into this method. We cannot pass a ContentTree to the databinder unfortunately.

Parameters:
workingEntities -
Returns:
a list of entity objects

getContentAndContentPropertiesFromSpace

protected List getContentAndContentPropertiesFromSpace(Space space)
Parameters:
space -
Returns:
list of all the content (and the associated properties of content) in a space

addPropertiesForContent

protected void addPropertiesForContent(List contentList,
                                       ContentEntityObject contentObject)

setSettingsManager

public void setSettingsManager(SettingsManager settingsManager)

setSpaceManager

public void setSpaceManager(SpaceManager spaceManager)

setPropertySetManager

public void setPropertySetManager(ConfluencePropertySetManager propertySetManager)


Confluence is developed by Atlassian.