com.aspose.words

Class OdsoRecipientData

  • java.lang.Object
    • 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() + "OdsoData.doc");

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

Assert.assertEquals(odsoRecipientDataCollection.getCount(), 70);
int index = 0;

for (OdsoRecipientData data : odsoRecipientDataCollection) {
    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));

    Assert.assertNotEquals(data, data.deepClone());
}

Constructor Summary
 
Property Getters/Setters Summary
booleangetActive()
void
setActive(booleanvalue)
           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()
void
setColumn(intvalue)
           Specifies the column within the data source that contains unique data for the current record. The default value is 0.
intgetHash()
void
setHash(intvalue)
           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()
void
setUniqueTag(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() + "OdsoData.doc");
        
        // Records in this collection that do not have the "Active" flag set to true will be excluded from the mail merge
        OdsoRecipientDataCollection odsoRecipientDataCollection = doc.getMailMergeSettings().getOdso().getRecipientDatas();
        
        Assert.assertEquals(odsoRecipientDataCollection.getCount(), 70);
        int index = 0;
        
        for (OdsoRecipientData data : odsoRecipientDataCollection) {
            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));
        
            Assert.assertNotEquals(data, data.deepClone());
        }
      • 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() + "OdsoData.doc");
        
        // Records in this collection that do not have the "Active" flag set to true will be excluded from the mail merge
        OdsoRecipientDataCollection odsoRecipientDataCollection = doc.getMailMergeSettings().getOdso().getRecipientDatas();
        
        Assert.assertEquals(odsoRecipientDataCollection.getCount(), 70);
        int index = 0;
        
        for (OdsoRecipientData data : odsoRecipientDataCollection) {
            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));
        
            Assert.assertNotEquals(data, data.deepClone());
        }
      • 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() + "OdsoData.doc");
        
        // Records in this collection that do not have the "Active" flag set to true will be excluded from the mail merge
        OdsoRecipientDataCollection odsoRecipientDataCollection = doc.getMailMergeSettings().getOdso().getRecipientDatas();
        
        Assert.assertEquals(odsoRecipientDataCollection.getCount(), 70);
        int index = 0;
        
        for (OdsoRecipientData data : odsoRecipientDataCollection) {
            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));
        
            Assert.assertNotEquals(data, data.deepClone());
        }
      • 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() + "OdsoData.doc");
        
        // Records in this collection that do not have the "Active" flag set to true will be excluded from the mail merge
        OdsoRecipientDataCollection odsoRecipientDataCollection = doc.getMailMergeSettings().getOdso().getRecipientDatas();
        
        Assert.assertEquals(odsoRecipientDataCollection.getCount(), 70);
        int index = 0;
        
        for (OdsoRecipientData data : odsoRecipientDataCollection) {
            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));
        
            Assert.assertNotEquals(data, data.deepClone());
        }
    • 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() + "OdsoData.doc");
        
        // Records in this collection that do not have the "Active" flag set to true will be excluded from the mail merge
        OdsoRecipientDataCollection odsoRecipientDataCollection = doc.getMailMergeSettings().getOdso().getRecipientDatas();
        
        Assert.assertEquals(odsoRecipientDataCollection.getCount(), 70);
        int index = 0;
        
        for (OdsoRecipientData data : odsoRecipientDataCollection) {
            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));
        
            Assert.assertNotEquals(data, data.deepClone());
        }