Index

DKBlobOD

Purpose:

The DKAnnotationOD class is a wrapper of OD CsvNote. The data structure provides information about an annotation affiliated with an object.

Heirarchy:     
 
        dkDataObjectBase
          dkXDOBase
            dkXDO
             dkBlob
               DKBlobOD

Class summary:

class DKEXPORT DKBlobOD : public dkBlob
{
  public:
      DKBlobOD (DKDatastoreOD* dsOD);
      DKBlobOD (DKDatastoreOD* dsOD, const DKString& data);
      DKBlobOD (const DKBlobOD& blob);
 
      virtual ~DKBlobOD ();
 
      virtual DKString  getObjectType () const;
      virtual void      setNull ();
      virtual DKBoolean isNull () const;
 
      virtual dkXDOBase& operator= (const dkXDOBase& xdo);
      virtual DKBoolean  operator== (const dkXDOBase& xdo) const;
      virtual DKBoolean  operator!= (const dkXDOBase& xdo) const;
 
      virtual void  deletingValue ();
      virtual void  open ();
      virtual void  setPidObject (const DKPidXDO* pid);
      virtual const DKPidXDO*  getPidObject ();
 
      virtual dkXDO&  add ();
      virtual dkXDO&  retrieve ();
      virtual dkXDO&  update ();
      virtual dkXDO&  del ();
 
      virtual dkXDO&     copyData (const dkXDO& xdo);
      virtual DKBoolean  compareData (const dkXDO& xdo);
      virtual DKBoolean  isContentChanged () const;
      virtual DKBoolean  isSet () const;
 
      virtual dkXDO* cloneSkeleton ();
 
      virtual DKString  getContent () const;
      virtual dkXDO&    setContent (const DKString& data);
      virtual dkXDO&    setContent(const char* aByteArray, ULONG size);
 
      virtual dkBlob&  getContentToClientFile (const char* fName,
                                               int fOpt) const;
      virtual dkBlob&  setContentFromClientFile (const char* fName);
 
      virtual dkBlob&  operator += (const dkBlob& blob);
      virtual dkBlob&  operator += (const DKString& data);
 
      virtual long  length () const;
      virtual long  indexOf (const DKString& data,
                             long startPos = 1) const;
      virtual long  indexOf (const dkBlob& blob,long startPos = 1) const;
      virtual DKString  subString (long startPos, long len) const;
      virtual dkBlob&  remove (long startPos, long len);
      virtual dkBlob&  insert (const DKString& data, long startPos);
      virtual dkBlob&  insert (const dkBlob& blob, long  startPos);
      virtual void  open (const char*  fName);
      virtual void  setClassOpenHandler (const char* hOpen, DKBoolean sysFlag);
      virtual void  setInstanceOpenHandler (const char* hOpen, DKBoolean sysFlag);
      virtual DKString   getOpenHandler ();
      virtual DKBoolean  isOpenSynchronous ();
 
      virtual dkBlob&  add (const char* fName);
      virtual dkBlob&  retrieve (const char* fName);
      virtual dkBlob&  update (const char* fName);
      virtual dkBlob&  del (DKBoolean flush);
 
      long           getEntityId();
      void           setEntityId(long id);
      DKString       getItemId () const;
      void           setItemId (const char* itemId);
      unsigned long  getPartId () const;
      void           setPartId (unsigned long partId);
      DKString       getRepType () const;
      void           setRepType (const char* repType);
 
      unsigned long  getContentClass ();
      void           setContentClass (unsigned long ccls);
 
      virtual unsigned long  getAffiliatedType ();
      virtual void           setAffiliatedType (unsigned long affType);
 
      virtual DKString getMimeType();
      virtual void     setMimeType(const char* mimeType);
      virtual void     setContentType(const char* contentType);
 
      DKAnnotation&  getAffiliatedData ();
      void           setAffiliatedData (const DKAnnotation& affData);
      DKString       mimeType ();
 
      long  getSize ();
      void  setSize (long size);
 
      virtual DKBlobOD&  operator= (const DKBlobOD& aDKBlobOD);
      virtual DKBlobOD&  operator+ (const DKBlobOD& blob) const;
      virtual DKBlobOD&  operator+ (const DKString& data) const;
      friend  DKBlobOD&  operator+ (const DKString& data, const DKBlobOD& blob);
      virtual DKBlobOD&  subLob (long startPos, long len) const;
      DKBoolean  getIndexFlag ();
      void       setIndexFlag (DKBoolean flag);
      void       setAffTocFlag (DKBoolean flag);
 
      virtual long  getRank ();
      virtual void  setRank (long r);
 
      void  getOption (long option, DKAny& value);
      void  setOption (long option, DKAny& value);
      int   getOptionInt(int option);
 
      DKBoolean  isCategoryOf (long cat);
      long  retrieveObjectState (long object);
 
      void  addExtension (const DKString& name, const dkExtension* object);
      void  removeExtension (const DKString& name);
      void  setExtension (const DKString& name, const dkExtension* object);
      const dkExtension*  getExtension (const DKString& name);
};

Members:

Constructors and destructor
DKBlobOD provides three constructors including a copy constructor. Each constructor requires a DKDatastoreOD object, representing the OnDemand datastore associated with this object. The content of the object may be set by supplying a byte array stream.
DKBlobOD (DKDatastoreOD* dsOD);
DKBlobOD (DKDatastoreOD* dsOD, const DKString& data);
DKBlobOD (const DKBlobOD& blob);
 
virtual ~DKBlobOD ();
 

Member functions

getObjectType
Gets the object type.
   virtual DKString getObjectType () const;

setNull
Sets the part content to null (in memory).
   virtual void setNull ();

isNull
Checks if the part content is null (in memory).
   virtual DKBoolean  isNull () const;

operator=
Assignment operator.
   virtual dkXDOBase&  operator= (const dkXDOBase& xdo);

operator==
Compares this object with the specified object. Returns true if both objects have the same value for each data member.
   virtual DKBoolean   operator== (const dkXDOBase& xdo) const;

operator!=
Compares this object with the specified object. Returns true if both objects do not have the same value for each data member.
   virtual DKBoolean   operator!= (const dkXDOBase& xdo) const;

deletingValue
deletingValue is deprecated.
   virtual void deletingValue ();

open
Unloads the object content to a client file with a system generated name, then synchronously invokes a default handler against the file.
   virtual void open ();

setPid
setPid is deprecated.
   virtual void setPid (const DKPidXDO* pid);

getPid
getPid is deprecated.
   virtual const DKPidXDO*  getPid ();

setPidObject
Sets the PID information of this object with the new provided PID.
   virtual void setPidObject (const DKPidXDO* pid);

getPidObject
Gets a copy of the persistent ID object of this object.
   virtual const DKPidXDO*  getPidObject ();

add
Adds the object content from memory to the datastore.
   virtual dkXDO&  add ();

retrieve
Retrieves the object content from the datastore to the memory buffer.
   virtual dkXDO&  retrieve ();

update
Updates the object content in datastore with the content in memory. Gets the value for an option returned as an integer.
   virtual dkXDO&  update ();

del
Deletes the object content from datastore.
   virtual dkXDO&  del ();

copyData
Replaces the content of this object with the content of the other XDO object.
   virtual dkXDO& copyData (const dkXDO& xdo);

compareData
Compares the content of this object with the content of the other XDO object.
   virtual DKBoolean  compareData (const dkXDO& xdo);

isContentChanged
Checks if the part content changed (in memory).
   virtual DKBoolean  isContentChanged () const;

isSet
Checks if the part content is set (in memory).
   virtual DKBoolean  isSet () const;

cloneSkeleton
Clones this extended data object (XDO) with its persistent ID only (that is, with its data content set to empty).
   virtual dkXDO& cloneSkeleton ();

getContent
Gets the content of this object.
   virtual DKString  getContent () const;

setContent
Sets the content of this object with a byte array stream argument.
   virtual dkXDO& setContent (const DKString& data);

getContentToClientFile
Copies the large object (lob) data of this object to the given file.
   virtual dkBlob& getContentToClientFile (const char* fName, int fOpt) const;

setContentFromClientFile
Replaces the lob data of this object with the contents of the file name.
  virtual dkBlob&  setContentFromClientFile (const char* fName);

operator +=
Concatenates this object with another DKBlobOD object. The resulting object replaces the existing contents of this object.
   virtual dkBlob&  operator += (const dkBlob& blob);

operator +=
Concatenates this object with another string. The resulting object replaces the existing contents of this object.
   virtual dkBlob&  operator += (const DKString& data);

length
Gets the length of this object content in memory.
   virtual long  length () const;

indexOf
indexOf is deprecated.
   virtual long  indexOf (const DKString& data,long startPos = 1) const;

indexOf
indexO fis deprecated.
virtual long  indexOf (const dkBlob& blob,long startPos = 1) const;

subString
subString is deprecated.
   virtual DKString  subString (long startPos, long len) const;

remove
remove is deprecated.
   virtual dkBlob&  remove (long startPos, long len);

insert
insert is deprecated.
   virtual dkBlob&  insert (const DKString& data, long startPos);
virtual dkBlob&  insert (const dkBlob& blob, long  startPos);

open
Unloads the object content to a file afileName provided by the application, then synchronously invokes a default handler against the file.
virtual void  open (const char*  fName);

setClassOpenHandler
Sets the executable handler program name and whether this handler should be invoked synchronously or asynchronously for this object class.
   virtual void  setClassOpenHandler (const char* hOpen, DKBoolean sysFlag);

setInstanceOpenHandler
Sets the executable handler program name and whether this handler should be invoked synchronously or asynchronously for this object instance.
   virtual void  setInstanceOpenHandler (const char* hOpen, DKBoolean sysFlag);

getOpenHandler
Gets the current program name of the handler for this object instance.
   virtual DKString getOpenHandler ();

isOpenSynchronous
Gets the current synchronization property.
   virtual DKBoolean  isOpenSynchronous ();

add
This function is not supported by the OnDemand datastore.
   virtual dkBlob&  add (const char* fName);

retrieve
This function is not supported by the OnDemand datastore.
   virtual dkBlob&  retrieve (const char* fName);

update
This function is not supported by the OnDemand datastore.
   virtual dkBlob&  update (const char* fName);

del
Deletes the object content from datastore.
   virtual dkBlob&  del (DKBoolean flush);

getItemId
Gets the OD item ID of the object content.
   DKString getItemId () const;

setItemId
Sets the OD item ID of the object content.
   void setItemId (const char* itemId);

getPartId
Gets the current synchronization property.
   virtual DKBoolean  isOpenSynchronous ();

setPartId
Sets the part ID of this XDO.
   void setPartId (unsigned long partId);

getRepType
Gets the OD representation type of the object content.
   DKString getRepType () const;

setRepType
Sets the OD representation type of the object content.
   void setRepType (const char* repType);

getContentClass
Gets the content class of the object.
   unsigned long  getContentClass ();

setContentClass
Sets the content class of the object.
   void setContentClass (unsigned long ccls);

getAffiliatedType
Gets the affiliated type of the object.
   virtual unsigned long  getAffiliatedType ();

setAffiliatedType
Sets the affiliated type of the object.
   virtual void setAffiliatedType (unsigned long affType);

mimeType
mimeType has been deprecated and replaced by getMimeType.
   DKString  mimeType ();

getMimeType
Returns the mime type that corresponds to the object's content class. If the mime type is not defined in OnDemand for the specified content class, the program will get the mime type from the cmbcc2mime.ini file specified by the user. If the cmbcc2mime.ini does not exist or if the mime type is not defined for the specified content class in the cmbcc2mime.ini file, then the default mime type text/plain will be returned.
   virtual DKString getMimeType();

setMimeType
Sets the mime type that corresponds to the object's content class.
   virtual void setMimeType(const char* mimeType);
 

setContentType
Sets the document's file extension.
   virtual void setContentType(const char* contentType);

getAffiliatedData
getAffiliatedData has been deprecated and replaced by getExtension.

   DKAnnotation&  getAffiliatedData ();

setAffiliatedData
setAffiliatedData has been deprecated and replaced by setExtension.

void setAffiliatedData (const DKAnnotation& affData);

getSize
Gets the size of this object without retrieving the object content.

   long  getSize ();

setSize
Sets the size of this object.
   void  setSize (long size);

operator=
Assign the specified object to this object.
   virtual DKBlobOD&  operator= (const DKBlobOD& aDKBlobOD);

operator+
Concatenates this object with another DKBlobOD object and returns the resulting DKBlobOD object.
   virtual DKBlobOD&  operator+ (const DKBlobOD& blob) const;

operator+
Concatenates this object with a specified string object and returns the resulting object.
   virtual DKBlobOD&  operator+ (const DKString& data) const;

operator+
Concatenates the special string object and the specified DKBlobOD object and returns the resulting object.
   friend  DKBlobOD&  operator+ (const DKString& data, const DKBlobOD& blob);

subLob
subLob is deprecated.
virtual DKBlobOD&  subLob (long startPos, long len) const;

getRank
Gets the search result ranking value of the current object. The default setting is --1.
   long  getRank ();

setRank
Sets the search result ranking value of the current object. The default setting is --1.
   void  setRank (long r);

getOption
Gets the value for an option.
void  getOption (long option, DKAny& value);
 
The valid options and values are as follows: 
 

DK_CM_OPT_XDO_TEXT_CONVERSION
Sets the text (line) data conversion option for this object. Valid value:

DK_CM_TEXT_ASCII
Convert EBCDIC data to ASCII.

DK_CM_OPT_XDO_AFP_CONVERSION
Sets the AFP data conversion option for this object. Valid values:

DK_CM_AFP_HTML
Converts AFP data to HTML.

DK_CM_AFP_PDF
Converts AFP data to PDF.

DK_CM_OPT_XDO_VIEWER
Sets the viewer option for this object. Valid values:

DK_CM_APPLET
The data will be viewed with an applet.

DK_CM_PLUGIN
The data will be viewed with a plugin.

Example code:
DKDatastoreOD dsOD; DKBlobOD* axdo = new DKBlobOD(&dsOD); DKAny opt; axdo >getOption(DK_CM_OPT_XDO_TEXT_CONVERSION, opt); long lopt = opt; if (lopt == DK_CM_TEXT_ASCII) cout << "The text will be converted to ACII" << endl;

getOptionInt
Gets the value for an option returned as an integer.
   int getOptionInt(int option);
 
The valid options and values are as follows: 
 

DK_CM_OPT_XDO_TEXT_CONVERSION
Sets the text (line) data conversion option for this object. Valid value:

DK_CM_TEXT_ASCII
Convert EBCDIC data to ASCII.

DK_CM_OPT_XDO_AFP_CONVERSION
Sets the AFP data conversion option for this object. Valid values:

DK_CM_AFP_HTML
Converts AFP data to HTML.

DK_CM_AFP_PDF
Converts AFP data to PDF.

DK_CM_OPT_XDO_VIEWER
Sets the viewer option for this object. Valid values:

DK_CM_APPLET
The data will be viewed with an applet.

DK_CM_PLUGIN
The data will be viewed with a plugin.

Example code:
DKDatastoreOD dsOD; DKBlobOD* axdo = new DKBlobOD(&dsOD); int iopt = axdo->getOptionInt(DK_CM_OPT_XDO_TEXT_CONVERSION); if (iopt == DK_CM_TEXT_ASCII) cout << "The text will be converted to ACII" << endl;

setOption
Sets the value for an option.
   void  setOption (long option, DKAny& value);
 
The valid options and values are as follows: 
 

DK_CM_OPT_XDO_TEXT_CONVERSION
Sets the text (line) data conversion option for this object. Valid value:

DK_CM_TEXT_ASCII
Convert EBCDIC data to ASCII.

DK_CM_OPT_XDO_AFP_CONVERSION
Sets the AFP data conversion option for this object. Valid values:

DK_CM_AFP_HTML
Converts AFP data to HTML.

DK_CM_AFP_PDF
Converts AFP data to PDF.

DK_CM_OPT_XDO_VIEWER
Sets the viewer option for this object. Valid values:

DK_CM_APPLET
The data will be viewed with an applet.

DK_CM_PLUGIN
The data will be viewed with a plugin.

Example code:
DKDatastoreOD dsOD; DKBlobOD* axdo = new DKBlobOD(&dsOD); DKAny convOpt = DK_CM_TEXT_ASCII; axdo->setOption(DK_CM_OPT_XDO_TEXT_CONVERSION, convOpt);

isCategoryOf
The function always returns false. DKBoolean isCategoryOf (long cat);

retrieveObjectState
The function always returns 0. long retrieveObjectState (long object);

addExtension
Add the extension object for this object. The valid extension object names are the same as for the setExtensionfunction. void addExtension(const char* extensionName, const dkExtension* extensionObj);

removeExtension
Removes the extension object. void removeExtension (const DKString& name);

setExtension
void setExtension (const DKString& name,const dkExtension* object); Valid extension object names are:

DKAnnotationOD
For an annotation object, this extension object must be set to hold the OnDemand annotation note information.

DKViewDataDefOD
For an OnDemand default view object, this extension object must be set to hold the OnDemand default view information.

DKFixedViewDataOD
For an OnDemand view object, this extension object must be set to hold the OnDemand logical view data.

DKPermissionsOD
For an OnDemand permissions object, this extension object must be set to hold the permissions (privileges) data.

getExtension
Gets the extension object for this object. const dkExtension* getExtension (const DKString& name);

Valid extension names are:
DKAnnotationOD DKViewDataDefOD DKFixedViewDataOD DKPermissionsOD

Exceptions:

DKXDOError
For general operation errors.

DKXDOAccessError
For the OnDemand API calling errors.

(c) Copyright International Business Machines Corporation 1996, 2003. IBM Corp. All rights reserved.