com.aspose.words
Class OdsoRecipientData

java.lang.Object
    extended by com.aspose.words.OdsoRecipientData
All Implemented Interfaces:
java.lang.Cloneable

public class OdsoRecipientData 
extends java.lang.Object

Represents information about a single record within an external data source that is to be excluded from the mail merge.

If a record shall be merged into a merged document, then no information is needed about that record. However, if a given record shall not be merged into a merged document, then the value of the unique key for that record shall be stored in the UniqueTag property of this object to indicate this exclusion.

Example:

Shows how to access the collection of data that designates merge data source records to be excluded from a merge.
Document doc = new Document(getMyDir() + "Odso data.docx");

// Records in this collection that do not have the "Active" flag set to true will be excluded from the mail merge
OdsoRecipientDataCollection dataCollection = doc.getMailMergeSettings().getOdso().getRecipientDatas();
Assert.assertEquals(70, dataCollection.getCount());

int index = 0;

for (OdsoRecipientData data : dataCollection) {
    System.out.println(MessageFormat.format("Odso recipient data index #{0}, will {1}be imported upon mail merge.", index++, (data.getActive() ? "" : "not ")));
    System.out.println(MessageFormat.format("\tColumn #{0}", data.getColumn()));
    System.out.println(MessageFormat.format("\tHash code: {0}", data.getHash()));
    System.out.println(MessageFormat.format("\tContents array length: {0}", data.getUniqueTag().length));
}

// Elements of the collection can be cloned
Assert.assertNotEquals(dataCollection.get(0), dataCollection.get(0).deepClone());

// The collection can have individual entries removed or be cleared like this
dataCollection.removeAt(0);
dataCollection.clear();

Constructor Summary
OdsoRecipientData()
          
 
Property Getters/Setters Summary
booleangetActive()
voidsetActive(boolean value)
           Specifies whether the record from the data source shall be imported into a document when the mail merge is performed. The default value is true.
intgetColumn()
voidsetColumn(int value)
           Specifies the column within the data source that contains unique data for the current record. The default value is 0.
intgetHash()
voidsetHash(int value)
           Represents the hash code for this record. Sometimes Microsoft Word uses Hash of a whole record instead of a UniqueTag value. The default value is 0.
byte[]getUniqueTag()
voidsetUniqueTag(byte[] value)
           Specifies the contents of a given record in the column containing unique data. The default value is null.
 
Method Summary
OdsoRecipientDatadeepClone()
           Returns a deep clone of this object.
 

Constructor Detail

OdsoRecipientData

public OdsoRecipientData()

Property Getters/Setters Detail

getActive/setActive

public boolean getActive() / public void setActive(boolean value)
Specifies whether the record from the data source shall be imported into a document when the mail merge is performed. The default value is true.

Example:

Shows how to access the collection of data that designates merge data source records to be excluded from a merge.
Document doc = new Document(getMyDir() + "Odso data.docx");

// Records in this collection that do not have the "Active" flag set to true will be excluded from the mail merge
OdsoRecipientDataCollection dataCollection = doc.getMailMergeSettings().getOdso().getRecipientDatas();
Assert.assertEquals(70, dataCollection.getCount());

int index = 0;

for (OdsoRecipientData data : dataCollection) {
    System.out.println(MessageFormat.format("Odso recipient data index #{0}, will {1}be imported upon mail merge.", index++, (data.getActive() ? "" : "not ")));
    System.out.println(MessageFormat.format("\tColumn #{0}", data.getColumn()));
    System.out.println(MessageFormat.format("\tHash code: {0}", data.getHash()));
    System.out.println(MessageFormat.format("\tContents array length: {0}", data.getUniqueTag().length));
}

// Elements of the collection can be cloned
Assert.assertNotEquals(dataCollection.get(0), dataCollection.get(0).deepClone());

// The collection can have individual entries removed or be cleared like this
dataCollection.removeAt(0);
dataCollection.clear();

getColumn/setColumn

public int getColumn() / public void setColumn(int value)
Specifies the column within the data source that contains unique data for the current record. The default value is 0.

Example:

Shows how to access the collection of data that designates merge data source records to be excluded from a merge.
Document doc = new Document(getMyDir() + "Odso data.docx");

// Records in this collection that do not have the "Active" flag set to true will be excluded from the mail merge
OdsoRecipientDataCollection dataCollection = doc.getMailMergeSettings().getOdso().getRecipientDatas();
Assert.assertEquals(70, dataCollection.getCount());

int index = 0;

for (OdsoRecipientData data : dataCollection) {
    System.out.println(MessageFormat.format("Odso recipient data index #{0}, will {1}be imported upon mail merge.", index++, (data.getActive() ? "" : "not ")));
    System.out.println(MessageFormat.format("\tColumn #{0}", data.getColumn()));
    System.out.println(MessageFormat.format("\tHash code: {0}", data.getHash()));
    System.out.println(MessageFormat.format("\tContents array length: {0}", data.getUniqueTag().length));
}

// Elements of the collection can be cloned
Assert.assertNotEquals(dataCollection.get(0), dataCollection.get(0).deepClone());

// The collection can have individual entries removed or be cleared like this
dataCollection.removeAt(0);
dataCollection.clear();

getHash/setHash

public int getHash() / public void setHash(int value)
Represents the hash code for this record. Sometimes Microsoft Word uses Hash of a whole record instead of a UniqueTag value. The default value is 0.

Example:

Shows how to access the collection of data that designates merge data source records to be excluded from a merge.
Document doc = new Document(getMyDir() + "Odso data.docx");

// Records in this collection that do not have the "Active" flag set to true will be excluded from the mail merge
OdsoRecipientDataCollection dataCollection = doc.getMailMergeSettings().getOdso().getRecipientDatas();
Assert.assertEquals(70, dataCollection.getCount());

int index = 0;

for (OdsoRecipientData data : dataCollection) {
    System.out.println(MessageFormat.format("Odso recipient data index #{0}, will {1}be imported upon mail merge.", index++, (data.getActive() ? "" : "not ")));
    System.out.println(MessageFormat.format("\tColumn #{0}", data.getColumn()));
    System.out.println(MessageFormat.format("\tHash code: {0}", data.getHash()));
    System.out.println(MessageFormat.format("\tContents array length: {0}", data.getUniqueTag().length));
}

// Elements of the collection can be cloned
Assert.assertNotEquals(dataCollection.get(0), dataCollection.get(0).deepClone());

// The collection can have individual entries removed or be cleared like this
dataCollection.removeAt(0);
dataCollection.clear();

getUniqueTag/setUniqueTag

public byte[] getUniqueTag() / public void setUniqueTag(byte[] value)
Specifies the contents of a given record in the column containing unique data. The default value is null.

Example:

Shows how to access the collection of data that designates merge data source records to be excluded from a merge.
Document doc = new Document(getMyDir() + "Odso data.docx");

// Records in this collection that do not have the "Active" flag set to true will be excluded from the mail merge
OdsoRecipientDataCollection dataCollection = doc.getMailMergeSettings().getOdso().getRecipientDatas();
Assert.assertEquals(70, dataCollection.getCount());

int index = 0;

for (OdsoRecipientData data : dataCollection) {
    System.out.println(MessageFormat.format("Odso recipient data index #{0}, will {1}be imported upon mail merge.", index++, (data.getActive() ? "" : "not ")));
    System.out.println(MessageFormat.format("\tColumn #{0}", data.getColumn()));
    System.out.println(MessageFormat.format("\tHash code: {0}", data.getHash()));
    System.out.println(MessageFormat.format("\tContents array length: {0}", data.getUniqueTag().length));
}

// Elements of the collection can be cloned
Assert.assertNotEquals(dataCollection.get(0), dataCollection.get(0).deepClone());

// The collection can have individual entries removed or be cleared like this
dataCollection.removeAt(0);
dataCollection.clear();

Method Detail

deepClone

public OdsoRecipientData deepClone()
Returns a deep clone of this object.

Example:

Shows how to access the collection of data that designates merge data source records to be excluded from a merge.
Document doc = new Document(getMyDir() + "Odso data.docx");

// Records in this collection that do not have the "Active" flag set to true will be excluded from the mail merge
OdsoRecipientDataCollection dataCollection = doc.getMailMergeSettings().getOdso().getRecipientDatas();
Assert.assertEquals(70, dataCollection.getCount());

int index = 0;

for (OdsoRecipientData data : dataCollection) {
    System.out.println(MessageFormat.format("Odso recipient data index #{0}, will {1}be imported upon mail merge.", index++, (data.getActive() ? "" : "not ")));
    System.out.println(MessageFormat.format("\tColumn #{0}", data.getColumn()));
    System.out.println(MessageFormat.format("\tHash code: {0}", data.getHash()));
    System.out.println(MessageFormat.format("\tContents array length: {0}", data.getUniqueTag().length));
}

// Elements of the collection can be cloned
Assert.assertNotEquals(dataCollection.get(0), dataCollection.get(0).deepClone());

// The collection can have individual entries removed or be cleared like this
dataCollection.removeAt(0);
dataCollection.clear();

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.