company logo

Property :: exportData - Export data to file

The function exports data from the current property to a file. Data can be exported in XML, CSV, ESDF or OIF format. The export format type will be derived from the file extension.

  • .xml - export to an XML file
  • .csv - export data to comma separated file (CSV)
  • .esdf - export data to extended self delimiter format (ESDF)
  • .oif - create object interchange format (OIF)

When a filter condition has been set (filter()), only filtered instances are exported. The way instances are exported depends on the copy type.

The function uses standard data exchange functionality for exporting data, i.e. it creates a default export format for the required file type. More sophisticated data exchange facilities are provided with the fromFile OSI operation or the Property::loadData() function.

Notes:

When running import/export in a client/server environment, the file name passed in sFilePath has to be a symbolic file name which is defined in the file catalog on client and server side. The export/import is executed on server. The result is transferred finally to the client location defined in the client's file catalog.

Implementation overview

Implementation details

  1. Export all instances and depending data
    Property  :: exportData ( odaba::String &sFilePath )

    The function exports all (filtered) instances from the collection including dependent and owned instances. Not owning collections (relationships) are exported as key properties (key attributes, only). The function has the same effect as calling exportData() with copy type CopyAll.

    • sFilePath - Complete file path
  2. to list
  3. Export data by copy type
    Property  :: exportData ( odaba::String &sFilePath, odaba::CopyTypes eCopyType )

    The function exports all (filtered) instances from the collection depending on the copy option passed to the function (eCopyType).

    Passing CopyInstances in eCopyType will copy instance data (attribute values) for all instances without copying referenced instances.

    Passing CopyLocal will export attribute values for all instances and and all instances referenced in owning collections (references, owning relationships and generic attributes).

    Passing CopyRelationships exports instances and owned instances (as CopyLocal). In addition, locators (position or order key values) are exported for all not owning relationships.

    For copying sufficient data for reimporting exported instances, CopyAll or CopyDeep should be passed. Passing CopyAll causes exporting instances and owned instances (as CopyLocal). In addition, attribute values are exported for all referenced instances in primary not owning relationships.

    In addition to CopyAll, CopyDeep copies also attribute values referenced in not owning secondary relationships.

    CopyModel exports data as being defined in the copy model.

    • sFilePath - Complete file path
    • eCopyType - Copy type

      The copy type defines the amount of data to be copied or exported.

  4. to list