com.atlassian.confluence.importexport.impl
Class ReverseDatabinder
java.lang.Object
org.xml.sax.helpers.DefaultHandler
com.atlassian.confluence.importexport.impl.ReverseDatabinder
- All Implemented Interfaces:
- ContentHandler, DTDHandler, EntityResolver, ErrorHandler
- public class ReverseDatabinder
- extends DefaultHandler
Converts the XML backups into Hibernate data structures for restoring space, site
- See Also:
XMLDatabinder
Constructor Summary |
ReverseDatabinder(net.sf.hibernate.engine.SessionFactoryImplementor factory,
net.sf.hibernate.engine.SessionImplementor session,
boolean preserveIds,
LabelManager labelManager)
|
Method Summary |
void |
characters(char[] ch,
int start,
int length)
|
protected void |
deferAddCollectionElement(TransientHibernateHandle[] keys,
TransientHibernateHandle target,
String collectionName,
TransientHibernateHandle objectToInsertKey)
|
protected void |
deferSetObjectPropertyOnId(TransientHibernateHandle key,
TransientHibernateHandle objectKey,
String propertyName)
|
protected void |
deferWriteObject(Object object,
Object objectId,
Class objectClass,
List nonNullPropertySetOperations)
|
void |
endElement(String uri,
String localName,
String qName)
|
void |
fromXML(BackupImporter importer,
net.sf.hibernate.Session session,
ProgressMeter meter)
|
List |
getAttachmentIds()
|
String |
getContents()
|
List |
getImportedSpaces()
|
protected net.sf.hibernate.persister.ClassPersister |
getPersister(Class clazz)
|
Long |
getUnfixedIdFor(Class clazz,
Long pageId)
|
Set |
getWrittenIds()
|
protected boolean |
isPersistentObject(TransientHibernateHandle key)
Has the object referenced by the handle been |
protected Object |
lookupPersistentObject(TransientHibernateHandle key)
|
protected com.atlassian.confluence.importexport.impl.ReverseDatabinder.SetObjectPropertyOnObject |
makeSetObjectPropertyOperation(Object object,
String propertyName,
TransientHibernateHandle key)
|
void |
startElement(String uri,
String localName,
String qName,
Attributes attributes)
|
protected void |
writeObject(Object object,
Object objectId,
Class objectClass)
|
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReverseDatabinder
public ReverseDatabinder(net.sf.hibernate.engine.SessionFactoryImplementor factory,
net.sf.hibernate.engine.SessionImplementor session,
boolean preserveIds,
LabelManager labelManager)
fromXML
public void fromXML(BackupImporter importer,
net.sf.hibernate.Session session,
ProgressMeter meter)
throws net.sf.hibernate.HibernateException,
ImportExportException,
IOException
- Throws:
net.sf.hibernate.HibernateException
ImportExportException
IOException
startElement
public void startElement(String uri,
String localName,
String qName,
Attributes attributes)
throws SAXException
- Throws:
SAXException
endElement
public void endElement(String uri,
String localName,
String qName)
throws SAXException
- Throws:
SAXException
characters
public void characters(char[] ch,
int start,
int length)
throws SAXException
- Throws:
SAXException
getContents
public String getContents()
getWrittenIds
public Set getWrittenIds()
getUnfixedIdFor
public Long getUnfixedIdFor(Class clazz,
Long pageId)
deferAddCollectionElement
protected void deferAddCollectionElement(TransientHibernateHandle[] keys,
TransientHibernateHandle target,
String collectionName,
TransientHibernateHandle objectToInsertKey)
deferSetObjectPropertyOnId
protected void deferSetObjectPropertyOnId(TransientHibernateHandle key,
TransientHibernateHandle objectKey,
String propertyName)
makeSetObjectPropertyOperation
protected com.atlassian.confluence.importexport.impl.ReverseDatabinder.SetObjectPropertyOnObject makeSetObjectPropertyOperation(Object object,
String propertyName,
TransientHibernateHandle key)
deferWriteObject
protected void deferWriteObject(Object object,
Object objectId,
Class objectClass,
List nonNullPropertySetOperations)
writeObject
protected void writeObject(Object object,
Object objectId,
Class objectClass)
throws Exception
- Throws:
Exception
getPersister
protected net.sf.hibernate.persister.ClassPersister getPersister(Class clazz)
throws net.sf.hibernate.MappingException
- Throws:
net.sf.hibernate.MappingException
getAttachmentIds
public List getAttachmentIds()
isPersistentObject
protected boolean isPersistentObject(TransientHibernateHandle key)
- Has the object referenced by the handle been
- Parameters:
key
-
lookupPersistentObject
protected Object lookupPersistentObject(TransientHibernateHandle key)
throws net.sf.hibernate.HibernateException
- Throws:
net.sf.hibernate.HibernateException
getImportedSpaces
public List getImportedSpaces()
throws ImportExportException
- Returns:
- the list of imported spaces (each a com.atlassian.confluence.spaces.Space).
- Throws:
ImportExportException
- if the space object cannot be retrieved from Hibernate