AdvancedCompareOptions

Inheritance: java.lang.Object

public class AdvancedCompareOptions

Allows to set advanced compare options.

Remarks:

These options have no equivalence in Microsoft Word and might help to produce more precise comparison result.

Methods

MethodDescription
getIgnoreDmlUniqueId()Specifies whether to ignore difference in DrawingML unique Id.
getIgnoreStoreItemId()Specifies whether to ignore difference in StructuredDocumentTag store item Id.
setIgnoreDmlUniqueId(boolean value)Specifies whether to ignore difference in DrawingML unique Id.
setIgnoreStoreItemId(boolean value)Specifies whether to ignore difference in StructuredDocumentTag store item Id.

getIgnoreDmlUniqueId()

public boolean getIgnoreDmlUniqueId()

Specifies whether to ignore difference in DrawingML unique Id.

Remarks:

Default value is false .

Returns: boolean - The corresponding boolean value.

getIgnoreStoreItemId()

public boolean getIgnoreStoreItemId()

Specifies whether to ignore difference in StructuredDocumentTag store item Id.

Remarks:

Default value is false .

Examples:

Shows how to compare SDT with same content but different store item id.


 Document docA = new Document(getMyDir() + "Document with SDT 1.docx");
 Document docB = new Document(getMyDir() + "Document with SDT 2.docx");

 // Configure options to compare SDT with same content but different store item id.
 CompareOptions compareOptions = new CompareOptions();
 compareOptions.getAdvancedOptions().setIgnoreStoreItemId(false);

 docA.compare(docB, "user", new Date(), compareOptions);
 Assert.assertEquals(8, docA.getRevisions().getCount());

 compareOptions.getAdvancedOptions().setIgnoreStoreItemId(true);

 docA.getRevisions().rejectAll();
 docA.compare(docB, "user", new Date(), compareOptions);
 Assert.assertEquals(0, docA.getRevisions().getCount());
 

Returns: boolean - The corresponding boolean value.

setIgnoreDmlUniqueId(boolean value)

public void setIgnoreDmlUniqueId(boolean value)

Specifies whether to ignore difference in DrawingML unique Id.

Remarks:

Default value is false .

Parameters:

ParameterTypeDescription
valuebooleanThe corresponding boolean value.

setIgnoreStoreItemId(boolean value)

public void setIgnoreStoreItemId(boolean value)

Specifies whether to ignore difference in StructuredDocumentTag store item Id.

Remarks:

Default value is false .

Examples:

Shows how to compare SDT with same content but different store item id.


 Document docA = new Document(getMyDir() + "Document with SDT 1.docx");
 Document docB = new Document(getMyDir() + "Document with SDT 2.docx");

 // Configure options to compare SDT with same content but different store item id.
 CompareOptions compareOptions = new CompareOptions();
 compareOptions.getAdvancedOptions().setIgnoreStoreItemId(false);

 docA.compare(docB, "user", new Date(), compareOptions);
 Assert.assertEquals(8, docA.getRevisions().getCount());

 compareOptions.getAdvancedOptions().setIgnoreStoreItemId(true);

 docA.getRevisions().rejectAll();
 docA.compare(docB, "user", new Date(), compareOptions);
 Assert.assertEquals(0, docA.getRevisions().getCount());
 

Parameters:

ParameterTypeDescription
valuebooleanThe corresponding boolean value.