com.atlassian.confluence.importexport.impl
Class AbstractXmlExporter

java.lang.Object
  extended by com.atlassian.confluence.importexport.Exporter
      extended by com.atlassian.confluence.importexport.impl.AbstractExporterImpl
          extended by com.atlassian.confluence.importexport.impl.AbstractXmlExporter
Direct Known Subclasses:
FileXmlExporter

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
 
Constructor Summary
AbstractXmlExporter()
           
 
Method Summary
protected  void backupEntities(HibernateObjectHandleTranslator translator, com.atlassian.core.util.ProgressMeter progress)
           
protected  void backupEverything(HibernateObjectHandleTranslator translator, com.atlassian.core.util.ProgressMeter progress)
           
 String doExport(HibernateObjectHandleTranslator translator, com.atlassian.core.util.ProgressMeter progress)
           
protected  OutputStream getDescriptorOutputStream()
           
protected  ExportScope getExportScope()
           
protected  String getExportType()
          Deprecated. since 4.2 use getExportScope() instead.
protected abstract  List<TransientHibernateHandle> getHandlesOfObjectsForExport(HibernateObjectHandleTranslator translator, net.sf.hibernate.Session session)
           
protected  List<ConfluenceEntityObject> getObjectsExcludedFromExport()
          Gets a list of actual objects (not handles) to exclude from export.
protected  SettingsManager getSettingsManager()
           
protected abstract  List getSourceTemplateDirForCopying()
           
protected  OutputStream getXmlOutputStream()
          output stream to write XML object information to
 void setBootstrapManager(BootstrapManager bootstrapManager)
           
protected  void setCustomProperties(ExportDescriptor exportDescriptor)
          Override this in subclasses to add extra properties to the export descriptor.
 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, createAndSetExportDirectory, createExportDirectory, ensureDirectoryCreated, getSpaceKeyForExportFileName, getWorkingExportContext, prepareExportFileName, setExportFileNameGenerator
 
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<TransientHibernateHandle> getHandlesOfObjectsForExport(HibernateObjectHandleTranslator translator,
                                                                               net.sf.hibernate.Session session)
                                                                        throws ImportExportException
Throws:
ImportExportException

setSessionFactory

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

setBootstrapManager

public void setBootstrapManager(BootstrapManager bootstrapManager)

getObjectsExcludedFromExport

protected List<ConfluenceEntityObject> getObjectsExcludedFromExport()
                                                             throws ImportExportException
Gets a list of actual objects (not handles) to exclude from export.

Throws:
ImportExportException

doExport

public String doExport(HibernateObjectHandleTranslator translator,
                       com.atlassian.core.util.ProgressMeter progress)
                throws ImportExportException
Throws:
ImportExportException

backupEverything

protected void backupEverything(HibernateObjectHandleTranslator translator,
                                com.atlassian.core.util.ProgressMeter progress)
                         throws ImportExportException
Throws:
ImportExportException

writeBackupDescriptor

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

setCustomProperties

protected void setCustomProperties(ExportDescriptor exportDescriptor)
Override this in subclasses to add extra properties to the export descriptor.


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:
the XMLOutputStream
Throws:
ImportExportException
FileNotFoundException
IOException

getExportType

@Deprecated
protected String getExportType()
                        throws ImportExportException
Deprecated. since 4.2 use getExportScope() instead.

Returns getExportScope() as a string instead of an enum.

Throws:
ImportExportException

getExportScope

protected ExportScope getExportScope()
                              throws ImportExportException
Throws:
ImportExportException

getSourceTemplateDirForCopying

protected abstract List getSourceTemplateDirForCopying()

backupEntities

protected void backupEntities(HibernateObjectHandleTranslator translator,
                              com.atlassian.core.util.ProgressMeter progress)
                       throws ImportExportException
Throws:
ImportExportException

setSettingsManager

public void setSettingsManager(SettingsManager settingsManager)

setSpaceManager

public void setSpaceManager(SpaceManager spaceManager)

getSettingsManager

protected SettingsManager getSettingsManager()


Copyright © 2003-2012 Atlassian. All Rights Reserved.