|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.deltaxml.odf.merge.OdtMerger
public class OdtMerger
Merges two or more ODT (ISO/IEC 26300 v1.1) files and generates a result which contains changes relative to the first input (or base document) in the tracked-changes format.
NB: the ODT Merger only supports ODF packages, not single-file ODF XML documents.
| Constructor Summary | |
|---|---|
OdtMerger()
Constructs an OdtMerger. |
|
| Method Summary | |
|---|---|
void |
finalise(File mergeResult,
File finalisedDoc)
Finalises a merge result file. |
void |
finalise(File mergeResult,
File finalisedDoc,
boolean acceptChanges)
Finalises a merge result file. |
void |
finalise(File mergeResult,
File finalisedDoc,
boolean acceptChanges,
ClassLoader cl)
Finalises a merge result file. |
void |
finalise(File mergeResult,
OutputStream finalisedDoc,
boolean acceptChanges,
ClassLoader cl)
Finalises a merge result file. |
static String |
getVersion()
Returns the version of the OdtMerger currently in use. |
void |
merge(File base,
List<File> edits,
File result)
Merges two or more ODT files and produces an ODT result that contains changes relative to the base file as tracked-changes. |
void |
merge(File base,
List<File> edits,
File result,
ClassLoader cl)
Merges two or more ODT files and produces an ODT result that contains changes relative to the base file as tracked-changes. |
void |
merge(File base,
List<File> edits,
OutputStream result,
ClassLoader cl)
Merges two or more ODT files and produces an ODT result that contains changes relative to the base file as tracked-changes. |
void |
setAddedBackground(Color color)
Sets the background color of the text marked as added in an individual editor's version of a merge-unit |
void |
setAddedColor(Color color)
Sets the color of the text marked as added in an individual editor's version of a merge-unit |
void |
setAddedDecoration(FontDecoration decoration)
Sets the font decoration of the text marked as added in an individual editor's version of a merge-unit. |
void |
setAddedStyle(FontStyle style)
Sets the font style of the text marked as added in an individual editor's version of a merge-unit. |
void |
setAddedWeight(FontWeight weight)
Sets the font weight of the text marked as added in an individual editor's version of a merge-unit. |
void |
setDeletedBackground(Color color)
Sets the background color of the text marked as deleted in an individual editor's version of a merge-unit |
void |
setDeletedColor(Color color)
Sets the color of the text marked as deleted in an individual editor's version of a merge-unit |
void |
setDeletedDecoration(FontDecoration decoration)
Sets the font decoration of the text marked as deleted in an individual editor's version of a merge-unit. |
void |
setDeletedStyle(FontStyle style)
Sets the font style of the text marked as deleted in an individual editor's version of a merge-unit. |
void |
setDeletedWeight(FontWeight weight)
Sets the font weight of the text marked as deleted in an individual editor's version of a merge-unit. |
void |
setDisplayCharacterStyleChanges(boolean value)
Sets whether to display character style changes when comparing edits against the base. |
void |
setDisplayFrameAttributeChanges(boolean value)
Sets whether to display frame attribute changes when comparing edits against the base. |
void |
setDisplayMergeUnitStyleChanges(boolean value)
Sets whether to display merge-unit style changes when comparing edits against the base. |
void |
setEditBackgroundColor(Color color)
Sets the background color to use to mark edit sections. |
void |
setEditorColor(Color color)
Sets the color to use for text that describes an editor's change. |
void |
setEditorDecoration(FontDecoration decoration)
Sets the font decoration to use for text that describes an editors change. |
void |
setEditorStyle(FontStyle style)
Sets the font style to use for text that describes an editors change. |
void |
setEditorWeight(FontWeight weight)
Sets the font weight to use for text that describes an editors change. |
void |
setEditOutput(EditOutput value)
Sets which EditOutput option to use in the result. |
void |
setExtendibleResult(boolean value)
Sets whether the merge result should be extendible with more versions. |
void |
setImageEditOutput(ImageEditOutput value)
Sets which ImageEditOutput option to use in the result. |
void |
setKeyTablesByName(boolean value)
Sets whether or not to use table names as keys for table alignment. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OdtMerger()
throws OdtMergerConfigurationException
Constructs an OdtMerger. If necessary, the Object should then be configured by calling the various set methods to set the desired parameters before calling one of the merge methods.
OdtMergerConfigurationException - when there is a problem configuring the OdtMerger. This could be caused by the wrong
version of Saxon being available on the classpath.| Method Detail |
|---|
public static String getVersion()
Returns the version of the OdtMerger currently in use.
public void setDisplayMergeUnitStyleChanges(boolean value)
Sets whether to display merge-unit style changes when comparing edits against the base.
Merge-unit style changes are not shown as tracked changes in the result file so this setting only has an effect if individual
editors' changes are being shown in edit sections. If they are, passing a value of true to this method will
cause an edit section to be displayed for merge-units that have had their style changed. The edit unit will use the style
specified in the editor's version of the document.
Default: false - these style changes are not displayed
value - a boolean stating whether to display merge-unit style changessetEditOutput(EditOutput)public void setDisplayCharacterStyleChanges(boolean value)
Sets whether to display character style changes when comparing edits against the base.
Character-level style changes are not shown as tracked changes in the result file so this setting only has an effect if
individual editors' changes are being shown in edit sections. If they are, passing a value of true to this
method will cause an edit section to be displayed when the style of individual words or characters is changed within a merge
unit. The edit unit will use the style specified in the editor's version of the document.
Default: false - these style changes are not displayed
value - a boolean stating whether or not to display character style changespublic void setDisplayFrameAttributeChanges(boolean value)
Sets whether to display frame attribute changes when comparing edits against the base.
Changes to the size, position and z-index of frames containing text boxes, images or objects are not shown as tracked changes
in the result file so this setting only has effect if individual editors' changes are being shown in edit sections. If they
are,passing a value of true to this method will cause an edit section to be displayed when a frame's attributes
change.
Default: false - frame attribute changes are not displayed
value - a boolean stating whether or not to display frame attribute changespublic void setEditBackgroundColor(Color color)
Sets the background color to use to mark edit sections.
Edit sections can be marked with this background color to distinguish them from the main parts of the document.
Note: only the RGB value of the Color will be used, any Alpha component will be ignored.
Default: the Color with the RGB value 999999
color - the Color to use to mark edit sectionspublic void setEditorColor(Color color)
Sets the color to use for text that describes an editor's change.
If edit sections are being displayed, the Color of the text that describes the change that has taken place and
details of who performed the change can be set using this method.
Note: only the RGB value of the Color will be used, any Alpha component will be ignored.
Default: the Color with the RGB value 0000FF
color - the Color used for edit section textpublic void setEditorWeight(FontWeight weight)
Sets the font weight to use for text that describes an editors change.
If edit sections are being displayed, the FontWeight of the text that describes the change that has taken place and
details of who performed the change can be set using this method.
Default: FontWeight.NONE
weight - the FontWeight used for edit section textpublic void setEditorStyle(FontStyle style)
Sets the font style to use for text that describes an editors change.
If edit sections are being displayed, the FontStyle of the text that describes the change that has taken place and
details of who performed the change can be set using this method.
Default: FontStyle.ITALIC
style - the FontStyle used for edit section textpublic void setEditorDecoration(FontDecoration decoration)
Sets the font decoration to use for text that describes an editors change.
If edit sections are being displayed, the FontDecoration of the text that describes the change that has taken place
and details of who performed the change can be set using this method.
Default: FontDecoration.NONE
decoration - the FontDecoration used for edit section textpublic void setAddedColor(Color color)
Sets the color of the text marked as added in an individual editor's version of a merge-unit
Note: only the RGB value of the Color will be used, any Alpha component will be ignored.
Default: none, i.e. the added text takes its color from its style as defined in the editor's version of the document.
color - the Color whose RGB value will be used for added textpublic void setAddedWeight(FontWeight weight)
Sets the font weight of the text marked as added in an individual editor's version of a merge-unit.
Default: FontWeight.NONE
weight - the FontWeight to be used for added textFontWeightpublic void setAddedStyle(FontStyle style)
Sets the font style of the text marked as added in an individual editor's version of a merge-unit.
Default: FontStyle.NONE
style - the FontStyle to be used for added textFontStylepublic void setAddedDecoration(FontDecoration decoration)
Sets the font decoration of the text marked as added in an individual editor's version of a merge-unit.
Default: FontDecoration.NONE
decoration - the FontDecoration to be used for added textFontDecorationpublic void setAddedBackground(Color color)
Sets the background color of the text marked as added in an individual editor's version of a merge-unit
Note: only the RGB value of the Color will be used, any Alpha component will be ignored.
Default: the Color with RGB value 90EE90 (light green)
color - the Color whose RGB value will be used for the background to added textpublic void setDeletedColor(Color color)
Sets the color of the text marked as deleted in an individual editor's version of a merge-unit
Note: only the RGB value of the Color will be used, any Alpha component will be ignored.
Default: none, i.e. the deleted text takes its color from its style as defined in the editor's version of the document.
color - the Color whose RGB value will be used for deleted textpublic void setDeletedWeight(FontWeight weight)
Sets the font weight of the text marked as deleted in an individual editor's version of a merge-unit.
Default: FontWeight.NONE
weight - the FontWeight to be used for deleted textFontWeightpublic void setDeletedStyle(FontStyle style)
Sets the font style of the text marked as deleted in an individual editor's version of a merge-unit.
Default: FontStyle.NONE
style - the FontStyle to be used for deleted textFontStylepublic void setDeletedDecoration(FontDecoration decoration)
Sets the font decoration of the text marked as deleted in an individual editor's version of a merge-unit.
Default: FontDecoration.STRIKETHROUGH
decoration - the FontDecoration to be used for deleted textFontDecorationpublic void setDeletedBackground(Color color)
Sets the background color of the text marked as deleted in an individual editor's version of a merge-unit
Note: only the RGB value of the Color will be used, any Alpha component will be ignored.
Default: the Color with RGB value FF5555 (light red)
color - the Color whose RGB value will be used for the background to deleted textpublic void setExtendibleResult(boolean value)
Sets whether the merge result should be extendible with more versions.
A merge result can optionally be extended with more documents derived from the base at a later stage. This method allows the
user to specify whether this should be possible with the result produced. Passing a value of false to this
method (i.e stating that the result will not be extendible) may improve the speed of the merge.
Default: true
value - whether the result should be extendible or notpublic void setEditOutput(EditOutput value)
Sets which EditOutput option to use in the result.
When a merge unit change occurs, the result contains the change in tracked change format (where the format allows). An
optional edit unit can also be output that shows just an individual editor's changes. This method is used to set which type
of output is used when generating the result. See EditOutput for more details.
value - the EditOutput type to use in the resultEditOutput,
setImageEditOutput(ImageEditOutput)public void setImageEditOutput(ImageEditOutput value)
Sets which ImageEditOutput option to use in the result.
Because image an object changes cannot always be displayed using tracked changes in all ODT viewers/editors, changes to them
may only be noticeable using edit units. Thus, control of the edit units for images and objects is separate from that for
other merge unit types and is controlled using this method. See ImageEditOutput for more details.
value - the ImageEditOutput type to use in the resultImageEditOutput,
setEditOutput(EditOutput)public void setKeyTablesByName(boolean value)
Sets whether or not to use table names as keys for table alignment.
value - whether to use table names as keys
public void merge(File base,
List<File> edits,
File result)
throws FileNotFoundException,
OdtMergerException,
InvalidOdtFileException,
NonExtendibleMergeResultException,
OdtInputException,
OdtOutputException,
StylesheetLoadException,
OdfLicensingException
Merges two or more ODT files and produces an ODT result that contains changes relative to the base file as tracked-changes.
Uses the context ClassLoader (that returned by : Thread.getContextClassLoader() called from the result of
Thread.currentThread()) to locates resources it needs during the merge. See the other merge methods if an alternative
ClassLoader is required due to application server or IDE restrictions.
base - the base File against which all other inputs are comparededits - the List of edit Files that are compared against the baseresult - specifies an ODT File which will be created to contain the tracked changes
FileNotFoundException - if the input files or the result destination cannot be located
OdtMergerException - if there is a problem during the merge. See the nested cause for more information
InvalidOdtFileException - if one of the input files is not an ODT file in the expected packaging format
NonExtendibleMergeResultException - if the base file is a merge result that cannot be extended
OdtInputException - if there is a problem reading one of the input files
OdtOutputException - if there is a problem writing to the output file
StylesheetLoadException - if a required stylesheet cannot be loaded. See the exception documentation for more details
OdfLicensingException - if there is a problem with the software license. NB the actual exception
thrown will be a sub-type of OdfLicensingException. See the exception documentation for more details
public void merge(File base,
List<File> edits,
File result,
ClassLoader cl)
throws FileNotFoundException,
OdtMergerException,
InvalidOdtFileException,
NonExtendibleMergeResultException,
OdtInputException,
OdtOutputException,
StylesheetLoadException,
OdfLicensingException
Merges two or more ODT files and produces an ODT result that contains changes relative to the base file as tracked-changes.
base - the base File against which all other inputs are comparededits - the List of edit Files that are compared against the baseresult - specifies an ODT File which will be created to contain the tracked changescl - the ClassLoader used to locate resources during the merge
FileNotFoundException - if the input files or the result destination cannot be located
OdtMergerException - if there is a problem during the merge. See the nested cause for more information
InvalidOdtFileException - if one of the input files is not an ODT file in the expected packaging format
NonExtendibleMergeResultException - if the base file is a merge result that cannot be extended
OdtInputException - if there is a problem reading one of the input files
OdtOutputException - if there is a problem writing to the output file
StylesheetLoadException - if a required stylesheet cannot be loaded. See the exception documentation for more details
OdfLicensingException - if there is a problem with the software license. NB the actual exception
thrown will be a sub-type of OdfLicensingException. See the exception documentation for more details
public void merge(File base,
List<File> edits,
OutputStream result,
ClassLoader cl)
throws OdtMergerException,
InvalidOdtFileException,
NonExtendibleMergeResultException,
OdtInputException,
OdtOutputException,
StylesheetLoadException,
OdfLicensingException
Merges two or more ODT files and produces an ODT result that contains changes relative to the base file as tracked-changes.
base - the base File against which all other inputs are comparededits - the List of edit Files that are compared against the baseresult - specifies an OutputStream which will be used as the basis for a ZipOutputStream to which to
write the result that contains the tracked changescl - the ClassLoader used to locate resources during the merge
OdtMergerException - if there is a problem during the merge. See the nested cause for more information
InvalidOdtFileException - if one of the input files is not an ODT file in the expected packaging format
NonExtendibleMergeResultException - if the base file is a merge result that cannot be extended
OdtInputException - if there is a problem reading one of the input files
OdtOutputException - if there is a problem writing to the output
StylesheetLoadException - if a required stylesheet cannot be loaded. See the exception documentation for more details
OdfLicensingException - if there is a problem with the software license. NB the actual exception
thrown will be a sub-type of OdfLicensingException. See the exception documentation for more details
public void finalise(File mergeResult,
File finalisedDoc)
throws FileNotFoundException,
OdtMergerException,
InvalidOdtFileException,
OdtInputException,
OdtOutputException,
StylesheetLoadException
Finalises a merge result file. This means that all units showing an individual editor's changes are removed and merge metadata is also removed.
Note: The result file produced by this operation can no longer have edited versions added to it.
mergeResult - a File that is the result of running merge on two or more input documentsfinalisedDoc - a File in which to write the finalised document
FileNotFoundException - if the result file cannot be created
OdtMergerException - if there is a problem during the operation. See the nested cause for more information
InvalidOdtFileException - if the input file is not an ODT file in the expected packaging format
OdtInputException - if there is a problem reading the input file
OdtOutputException - if there is a problem writing to the output file
StylesheetLoadException - if a required stylesheet cannot be loaded. See the exception documentation for more details
public void finalise(File mergeResult,
File finalisedDoc,
boolean acceptChanges)
throws FileNotFoundException,
OdtMergerException,
InvalidOdtFileException,
OdtInputException,
OdtOutputException,
StylesheetLoadException
Finalises a merge result file. This means that all units showing an individual editor's changes are removed and merge metadata is also removed. Any remaining tracked changes can optionally be automatically accepted.
Note: The result file produced by this operation can no longer have edited versions added to it.
mergeResult - a File that is the result of running merge on two or more input documentsfinalisedDoc - a File in which to write the finalised documentacceptChanges - whether or not to accept any remaining changes in the document
FileNotFoundException - if the result file cannot be created
OdtMergerException - if there is a problem during the operation. See the nested cause for more information
InvalidOdtFileException - if the input file is not an ODT file in the expected packaging format
OdtInputException - if there is a problem reading the input file
OdtOutputException - if there is a problem writing to the output file
StylesheetLoadException - if a required stylesheet cannot be loaded. See the exception documentation for more details
public void finalise(File mergeResult,
File finalisedDoc,
boolean acceptChanges,
ClassLoader cl)
throws FileNotFoundException,
OdtMergerException,
InvalidOdtFileException,
OdtInputException,
OdtOutputException,
StylesheetLoadException
Finalises a merge result file. This means that all units showing an individual editor's changes are removed and merge metadata is also removed. Any remaining tracked changes can optionally be automatically accepted.
Note: The result file produced by this operation can no longer have edited versions added to it.
mergeResult - a File that is the result of running merge on two or more input documentsfinalisedDoc - a File in which to write the finalised documentacceptChanges - whether or not to accept any remaining changes in the documentcl - the ClassLoader used to locate resources during the operation
FileNotFoundException - if the result file cannot be created
OdtMergerException - if there is a problem during the operation. See the nested cause for more information
InvalidOdtFileException - if the input file is not an ODT file in the expected packaging format
OdtInputException - if there is a problem reading the input file
OdtOutputException - if there is a problem writing to the output file
StylesheetLoadException - if a required stylesheet cannot be loaded. See the exception documentation for more details
public void finalise(File mergeResult,
OutputStream finalisedDoc,
boolean acceptChanges,
ClassLoader cl)
throws OdtMergerException,
InvalidOdtFileException,
OdtInputException,
OdtOutputException,
StylesheetLoadException
Finalises a merge result file. This means that all units showing an individual editor's changes are removed and merge metadata is also removed. Any remaining tracked changes can optionally be automatically accepted.
Note: The result file produced by this operation can no longer have edited versions added to it.
mergeResult - a File that is the result of running merge on two or more input documentsfinalisedDoc - specifies an OutputStream which will be used as the basis for a ZipOutputStream to which
to write the finalised document.acceptChanges - whether or not to accept any remaining changes in the documentcl - the ClassLoader used to locate resources during the operation
OdtMergerException - if there is a problem during the operation. See the nested cause for more information
InvalidOdtFileException - if the input file is not an ODT file in the expected packaging format
OdtInputException - if there is a problem reading the input file
OdtOutputException - if there is a problem writing to the output
StylesheetLoadException - if a required stylesheet cannot be loaded. See the exception documentation for more details
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||