LibreOffice Module xmerge (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
org.openoffice.xmerge.converter.xml.sxc.DocumentMergerImpl Class Reference

Generic small device implementation of DocumentMerger for the SxcPluginFactory. More...

Inheritance diagram for org.openoffice.xmerge.converter.xml.sxc.DocumentMergerImpl:
[legend]
Collaboration diagram for org.openoffice.xmerge.converter.xml.sxc.DocumentMergerImpl:
[legend]

Public Member Functions

 DocumentMergerImpl (org.openoffice.xmerge.Document doc, ConverterCapabilities cc)
 Constructor. More...
 
void merge (Document modifiedDoc) throws MergeException
 This method will find the changes that had happened in the modifiedDoc Document object given the designated original Document. More...
 
void merge (Document modifiedDoc) throws MergeException
 This method will find the changes that had happened in the modifiedDoc Document object given the designated original Document. More...
 

Private Member Functions

Node matchWorkSheet (Node orgSheet, NodeList modSheetList)
 Try to find a WorkSheet from the modified WorkSheetList that has a matching table name from the original WorkSheet. More...
 

Private Attributes

final ConverterCapabilities cc_
 
final org.openoffice.xmerge.Document orig
 

Detailed Description

Generic small device implementation of DocumentMerger for the SxcPluginFactory.

Used with SXC Document objects.

Definition at line 49 of file sxc/DocumentMergerImpl.java.

Constructor & Destructor Documentation

◆ DocumentMergerImpl()

org.openoffice.xmerge.converter.xml.sxc.DocumentMergerImpl.DocumentMergerImpl ( org.openoffice.xmerge.Document  doc,
ConverterCapabilities  cc 
)
inline

Constructor.

Parameters
docThe original "Office" Document to merge.
ccThe ConverterCapabilities.

Definition at line 60 of file sxc/DocumentMergerImpl.java.

References org.openoffice.xmerge.converter.xml.sxc.DocumentMergerImpl.cc_, and org.openoffice.xmerge.converter.xml.sxc.DocumentMergerImpl.orig.

Member Function Documentation

◆ matchWorkSheet()

Node org.openoffice.xmerge.converter.xml.sxc.DocumentMergerImpl.matchWorkSheet ( Node  orgSheet,
NodeList  modSheetList 
)
inlineprivate

Try to find a WorkSheet from the modified WorkSheetList that has a matching table name from the original WorkSheet.

Parameters
orgSheetThe original WorkSheet.
modSheetListThe modified WorkSheet.
Returns
The Node in modSheetList that matches the orgSheet.

Definition at line 155 of file sxc/DocumentMergerImpl.java.

References org.openoffice.xmerge.converter.xml.OfficeConstants.ATTRIBUTE_TABLE_NAME, i, and String.

Referenced by org.openoffice.xmerge.converter.xml.sxc.DocumentMergerImpl.merge().

◆ merge()

void org.openoffice.xmerge.converter.xml.sxc.DocumentMergerImpl.merge ( Document  modifiedDoc) throws MergeException
inline

This method will find the changes that had happened in the modifiedDoc Document object given the designated original Document.

Note that this process may need the knowledge of the conversion process since some conversion process are lossy. Items/Data that are lost during the conversion process are not classified as changes. The main target of this method is to apply the changes done in modifiedDoc into the assigned original Document object, thus it also will try to preserve items that were originally in the original Document, but never got transferred during the serialize process/method call. After this method call, the original Document object will contain the changes applied.

This method may or may not be thread-safe. Also, it is expected that the user uses only one instance of a DocumentMerger object per merge process. Create another DocumentMerger object for another merge process.

Parameters
modifiedDocdevice Document object.
Exceptions
MergeExceptionIf any merge error occurs.

Implements org.openoffice.xmerge.DocumentMerger.

Definition at line 66 of file sxc/DocumentMergerImpl.java.

References org.openoffice.xmerge.merger.MergeAlgorithm.applyDifference(), org.openoffice.xmerge.converter.xml.sxc.DocumentMergerImpl.cc_, org.openoffice.xmerge.merger.DiffAlgorithm.computeDiffs(), org.openoffice.xmerge.merger.Difference.debug(), org.openoffice.xmerge.util.XmlUtil.deepClone(), i, org.openoffice.xmerge.util.Debug.INFO, org.openoffice.xmerge.util.Debug.isFlagSet(), org.openoffice.xmerge.util.Debug.log(), org.openoffice.xmerge.converter.xml.sxc.DocumentMergerImpl.matchWorkSheet(), org.openoffice.xmerge.converter.xml.sxc.DocumentMergerImpl.orig, org.openoffice.xmerge.converter.xml.OfficeConstants.TAG_OFFICE_BODY, and org.openoffice.xmerge.converter.xml.OfficeConstants.TAG_TABLE.

Member Data Documentation

◆ cc_

final ConverterCapabilities org.openoffice.xmerge.converter.xml.sxc.DocumentMergerImpl.cc_
private

◆ orig

final org.openoffice.xmerge.Document org.openoffice.xmerge.converter.xml.sxc.DocumentMergerImpl.orig
private

The documentation for this class was generated from the following file: