Fesapi 2.9.0.1
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
|
An abstract data object. More...
#include <AbstractObject.h>
Public Types | |
enum class | numericalDatatypeEnum { UNKNOWN = 0 , DOUBLE = 1 , FLOAT = 2 , INT64 = 3 , UINT64 = 4 , INT32 = 5 , UINT32 = 6 , INT16 = 7 , UINT16 = 8 , INT8 = 9 , UINT8 = 10 } |
Public Member Functions | |
bool | isPartial () const |
virtual bool | isTopLevelElement () const |
std::string | getUuid () const |
std::string | getTitle () const |
std::string | getEditor () const |
time_t | getCreation () const |
tm | getCreationAsTimeStructure () const |
std::string | getOriginator () const |
std::string | getDescription () const |
time_t | getLastUpdate () const |
tm | getLastUpdateAsTimeStructure () const |
std::string | getFormat () const |
std::string | getDescriptiveKeywords () const |
std::string | getVersion () const |
void | setTitle (const std::string &title) |
void | setEditor (const std::string &editor) |
void | setCreation (time_t creation) |
void | setCreation (const tm &creation) |
void | setOriginator (const std::string &originator) |
void | setDescription (const std::string &description) |
void | setLastUpdate (time_t lastUpdate) |
void | setLastUpdate (const tm &lastUpdate) |
void | setDescriptiveKeywords (const std::string &descriptiveKeywords) |
void | setVersion (const std::string &version) |
void | setMetadata (const std::string &title, const std::string &editor, time_t creation, const std::string &originator, const std::string &description, time_t lastUpdate, const std::string &descriptiveKeywords) |
void | serializeIntoStream (std::ostream *stream) |
gsoap_resqml2_0_1::eml20__AbstractCitedDataObject * | getEml20GsoapProxy () const |
void | setGsoapProxy (gsoap_resqml2_0_1::eml20__AbstractCitedDataObject *gsoapProxy) |
gsoap_eml2_3::eml23__AbstractObject * | getEml23GsoapProxy () const |
void | setGsoapProxy (gsoap_eml2_3::eml23__AbstractObject *gsoapProxy) |
soap * | getGsoapContext () const |
int | getGsoapType () const |
gsoap_resqml2_0_1::eml20__DataObjectReference * | newResqmlReference () const |
gsoap_eml2_3::eml23__DataObjectReference * | newEml23Reference () const |
gsoap_resqml2_0_1::resqml20__ContactElementReference * | newContactElementReference2_0_1 () const |
gsoap_eml2_3::resqml22__ContactElement * | newContactElementReference2_2 () const |
common::DataObjectRepository * | getRepository () const |
virtual std::string | getXmlNamespace () const =0 |
virtual std::string | getXmlTag () const =0 |
virtual std::string | getXmlNamespaceVersion () const |
virtual std::string | getContentType () const |
virtual std::string | getQualifiedType () const |
virtual std::string | getPartNameInEpcDocument () const |
std::string | serializeIntoString () |
void | addAlias (const std::string &authority, const std::string &title) |
unsigned int | getAliasCount () const |
std::string | getAliasAuthorityAtIndex (unsigned int index) const |
std::string | getAliasTitleAtIndex (unsigned int index) const |
std::vector< eml2 ::Activity * > | getActivitySet () const |
unsigned int | getActivityCount () const |
eml2::Activity * | getActivity (unsigned int index) const |
void | pushBackExtraMetadata (const std::string &key, const std::string &value) |
std::unordered_map< std::string, std::string > | getExtraMetadataSet () const |
std::vector< std::string > | getExtraMetadata (const std::string &key) const |
unsigned int | getExtraMetadataCount () const |
std::string | getExtraMetadataKeyAtIndex (unsigned int index) const |
std::string | getExtraMetadataStringValueAtIndex (unsigned int index) const |
std::string | buildEtp12Uri () const |
void | setUriSource (const std::string &uriSource) |
const std::string & | getUriSource () const |
std::string | getEpcSourceFolder () const |
void | changeToPartialObject () |
virtual void | loadTargetRelationships ()=0 |
Static Public Member Functions | |
static void | setFormat (const std::string &vendor, const std::string &applicationName, const std::string &applicationVersionNumber) |
Friends | |
bool | common::DataObjectRepository::addDataObject (common ::AbstractObject *proxy) |
common::AbstractObject * | common::DataObjectRepository::addOrReplaceDataObject (AbstractObject *proxy, bool replaceOnlyContent) |
An abstract data object.
void common::AbstractObject::addAlias | ( | const std::string & | authority, |
const std::string & | title ) |
Adds an alias for this data object
std::invalid_argument | If this instance is actually a partial object. |
std::range_error | If authority or title is more than 64 chars long. |
authority | The authority of the alias. |
title | The title of the alias. |
|
inline |
Build and return an ETP1.2 URI from an Energistics dataobject. If its URI source has not been set, the Energistics dataobject is considered belonging to the default ETP dataspace.
void common::AbstractObject::changeToPartialObject | ( | ) |
Transform a non partial object into a partial one It is particularly useful when a dataobject happens to be unvalid.
eml2::Activity * common::AbstractObject::getActivity | ( | unsigned int | index | ) | const |
Gets an associated activity at a particular index
std::invalid_argument | If this instance is actually a partial object or if there is no underlying gSOAP proxy. |
std::out_of_range | If index is out of range. |
index | Zero-based index of the asked activity. |
index
. unsigned int common::AbstractObject::getActivityCount | ( | ) | const |
Gets the count of the activities where this instance is involved
std::out_of_range | If the count of activities is strictly greater than unsigned int max. |
std::vector< eml2 ::Activity * > common::AbstractObject::getActivitySet | ( | ) | const |
Gets all the activities where this instance is involved
std::string common::AbstractObject::getAliasAuthorityAtIndex | ( | unsigned int | index | ) | const |
Gets the alias authority at a particular index in the aliases set
std::invalid_argument | If this instance is actually a partial object or if there is no underlying gSOAP proxy. |
std::out_of_range | If index is out of range. |
index | Zero-based index of the asked alias authority. |
index
. unsigned int common::AbstractObject::getAliasCount | ( | ) | const |
Gets the count of aliases in this instance
std::invalid_argument | If this instance is actually a partial object. |
std::range_error | If the count of aliases is strictly greater than unsigned int max. |
std::string common::AbstractObject::getAliasTitleAtIndex | ( | unsigned int | index | ) | const |
Gets the alias title at a particular index in the aliases set
std::invalid_argument | If this instance is actually a partial object or if there is no underlying gSOAP proxy. |
std::out_of_range | If index is out of range. |
index | Zero-based index of the asked alias title. |
index
.
|
virtual |
Gets the content type of this instance according to EPC recommendation
time_t common::AbstractObject::getCreation | ( | ) | const |
Gets the date and time the data object was created in the source application or, if that information is not available, when it was saved to the file. This is the equivalent of the ISO 19115 CI_Date
where the CI_DateTypeCode
is creation
std::invalid_argument | If this instance is actually a partial object or if no available gSOAP proxy instance is associated to this data object. |
tm common::AbstractObject::getCreationAsTimeStructure | ( | ) | const |
Same as getCreation()
. Please use this method if you want to read some dates out of the range of time_t
std::invalid_argument | If this instance is actually a partial object or if no available gSOAP proxy instance is associated to this data object. |
std::string common::AbstractObject::getDescription | ( | ) | const |
Gets the user descriptive comments about this data object. Intended for end-user use (human readable); not necessarily meant to be used by software. This is the equivalent of the ISO 19115 abstract.CharacterString
std::invalid_argument | If this instance is actually a partial object. |
std::string common::AbstractObject::getDescriptiveKeywords | ( | ) | const |
Gets the key words to describe the activity, for example, history match or volumetric calculations, relevant to this data object. Intended to be used in a search function by software. This is the equivalent in ISO 19115 of descriptiveKeywords.MD_Keywords
std::invalid_argument | If this instance is actually a partial object. |
std::string common::AbstractObject::getEditor | ( | ) | const |
Gets the name (or other human-readable identifier) of the last person who updated the object. In ISO 19115, this is equivalent to the CI_Individual.name
or the CI_Organization.name
of the citedResponsibleParty
whose role is editor
std::invalid_argument | If this instance is actually a partial object. |
|
inline |
Get the EML2.0 gSOAP proxy which is wrapped by this entity
|
inline |
Get the EML2.3 gSOAP proxy which is wrapped by this entity
|
inline |
Get the absolute folder path where the source EPC document is located. Returns empty if this dataobject does not come from an EPC document.
std::vector< std::string > common::AbstractObject::getExtraMetadata | ( | const std::string & | key | ) | const |
Gets an extra metadata of this instance according to its key
std::logic_error | If the underlying gSOAP instance is not a RESQML2.0 one. |
key | The key of an extra metadata. |
key
(empty vector if there is no such value). unsigned int common::AbstractObject::getExtraMetadataCount | ( | ) | const |
Get the count of extra metadata in this instance
std::logic_error | If the underlying gSOAP instance is not a RESQML2.0 or EML2.2 one. |
std::string common::AbstractObject::getExtraMetadataKeyAtIndex | ( | unsigned int | index | ) | const |
Get the key of a key value pair at a particular index in the extra metadata set of this instance
std::logic_error | If the underlying gSOAP instance is not a RESQML2.0 or EML2.2 one. |
index | Zero-based index of the asked key. |
index
. std::unordered_map< std::string, std::string > common::AbstractObject::getExtraMetadataSet | ( | ) | const |
Gets all the extra metadata of this instance in read only mode
std::logic_error | If the underlying gSOAP instance is not a RESQML2.0 one. |
std::string common::AbstractObject::getExtraMetadataStringValueAtIndex | ( | unsigned int | index | ) | const |
Get the value of a key value pair at a particular index in the extra metadata set of this instance
std::logic_error | If the underlying gSOAP instance is not a RESQML2.0 or EML2.2 one. |
index | Zero-based index of the asked value. |
index
. std::string common::AbstractObject::getFormat | ( | ) | const |
Gets the identifier of the software or service that was used to originate the data object and to create the file. Must be human and machine readable and unambiguously identify the software by including the company name, software name and software version. This is the equivalent in ISO 19115 to the istributionFormat.MD_Format
. The ISO format for this is [vendor:applicationName]/fileExtension
where the application name includes the version number of the application. In our case, fileExtension
is not relevant and will be ignored if present. vendor
and applicationName
are mandatory
std::invalid_argument | If this instance is actually a partial object or if no available gSOAP proxy instance is associated to this data object. |
soap * common::AbstractObject::getGsoapContext | ( | ) | const |
Get the gSOAP context where the underlying gSOAP proxy is defined
int common::AbstractObject::getGsoapType | ( | ) | const |
Gets the gSOAP type of the wrapped element
std::invalid_argument | It there is no available gSOAP proxy instance. |
time_t common::AbstractObject::getLastUpdate | ( | ) | const |
Gets the date and time the data object was last modified in the source application or, if that information is not available, when it was last saved to the file. This is the equivalent of the ISO 19115 CI_Date
where the CI_DateTypeCode
is lastUpdate
std::invalid_argument | If this instance is actually a partial object. |
tm common::AbstractObject::getLastUpdateAsTimeStructure | ( | ) | const |
Same as getLastUpdate()
. Please use this method if you want to read some dates out of the range of time_t
std::invalid_argument | If this instance is actually a partial object. |
std::string common::AbstractObject::getOriginator | ( | ) | const |
Gets the name (or other human-readable identifier) of the person who initially originated this data object or document in the source application. If that information is not available, then this is the user of the session during the file creation. The originator remains the same as the object is subsequently edited. This is the equivalent in ISO 19115 to the CI_Individual.name
or the CI_Organization.name
of the citedResponsibleParty
whose role is originator
std::invalid_argument | If this instance is actually a partial object or if no available gSOAP proxy instance is associated to this data object. |
|
virtual |
Gets the part name of this XML top level instance in the EPC document
|
virtual |
Get the qualified type of the instance i.e. "namespace.datatype"
|
inline |
Returns the data object repository which contains this instance
std::string common::AbstractObject::getTitle | ( | ) | const |
Gets the title (i.e. the name) of this data object. This is the equivalent of CI_Citation.title
in ISO 19115
std::invalid_argument | If no available gSOAP proxy instance is associated to this data object. |
|
inline |
Get the EPC document absolute path or the ETP dataspace URI where this dataobject comes from.
std::string common::AbstractObject::getUuid | ( | ) | const |
Gets the UUID (https://tools.ietf.org/html/rfc4122#page-3) of this data object. The UUID intends to give an id to the "thing" (i.e. the business object), not to this instance
std::invalid_argument | If no available gSOAP proxy instance is associated to this data object. |
std::string common::AbstractObject::getVersion | ( | ) | const |
Gets the version of this data object. An empty version indicates that this is the latest (and ideally also the unique) version of this data object.
|
pure virtual |
Gets the XML namespace for the tags for the XML serialization of this instance
|
virtual |
Gets the version of the XML namespace (i.e. WITSML, RESQML, PRODML) for the XML serialization of this instance
|
pure virtual |
Gets the standard XML tag without XML namespace for serializing this data object.
bool common::AbstractObject::isPartial | ( | ) | const |
Indicates if this data object is actually a partial object. A partial object just contains a mime type, an UUID and a title as a minimum amount of information. A partial object is never explicit in an EPC document: it is not a file
|
pure virtual |
Reads the forward relationships of this data object and update the .rels
of the associated data repository.
gsoap_resqml2_0_1::resqml20__ContactElementReference * common::AbstractObject::newContactElementReference2_0_1 | ( | ) | const |
Creates an returns an EML2.0 contact data object reference which targets this data object
gsoap_eml2_3::resqml22__ContactElement * common::AbstractObject::newContactElementReference2_2 | ( | ) | const |
Creates an returns an EML2.2 contact data object reference which targets this data object
gsoap_eml2_3::eml23__DataObjectReference * common::AbstractObject::newEml23Reference | ( | ) | const |
Creates an returns an EML2.2 data object reference which targets this data object
gsoap_resqml2_0_1::eml20__DataObjectReference * common::AbstractObject::newResqmlReference | ( | ) | const |
Creates an returns an EML2.0 data object reference which targets this data object
void common::AbstractObject::pushBackExtraMetadata | ( | const std::string & | key, |
const std::string & | value ) |
Pushes back an extra metadata (not a standard one) onto this instance
std::logic_error | If the underlying gSOAP instance is not a RESQML2.0, EML2.1 or EML2.2 one. |
key | The key of the metadata. |
value | The value of the metadata. |
void common::AbstractObject::serializeIntoStream | ( | std::ostream * | stream | ) |
Serializes this instance into a stream
std::invalid_argument | If this instance is actually a partial object or if stream is null. |
[out] | stream | A stream. It must be opened for writing and won't be closed. |
std::string common::AbstractObject::serializeIntoString | ( | ) |
Serializes the gSOAP proxy of this instance into a string
void common::AbstractObject::setCreation | ( | const tm & | creation | ) |
Same as setCreation()
. Please use this method if you want to set some dates out of the range of time_t
std::invalid_argument | If this instance is actually a partial object. |
creation | The creation date and time to set to this data object. |
void common::AbstractObject::setCreation | ( | time_t | creation | ) |
Sets the date and time the data object was created in the source application or, if that information is not available, when it was saved to the file. This is the equivalent of the ISO 19115 CI_Date
where the CI_DateTypeCode
is creation
std::invalid_argument | If this instance is actually a partial object. |
creation | The creation date and time to set to this data object. |
void common::AbstractObject::setDescription | ( | const std::string & | description | ) |
Sets a user descriptive comments about this data object. Intended for end-user use (human readable); not necessarily meant to be used by software. This is the equivalent of the ISO 19115 abstract.CharacterString
std::invalid_argument | If this instance is actually a partial object. |
std::range_error | If description is too long (more than 4000 chars for RESQML2.0 or more than 2000 chars for EML2.1 and EML2.2). |
description | The description to set to this data object. |
void common::AbstractObject::setDescriptiveKeywords | ( | const std::string & | descriptiveKeywords | ) |
Set the key words to describe the activity, for example, history match or volumetric calculations, relevant to this object. Intended to be used in a search function by software. This is the equivalent in ISO 19115 of descriptiveKeywords.MD_Keywords
std::invalid_argument | If this instance is actually a partial object. |
std::range_error | If descriptiveKeywords is too long (more than 4000 chars for RESQML2.0 or more than 2000 chars for EML2.1 and EML2.2). |
descriptiveKeywords | The key words to describe the activity relevant to this data object. |
void common::AbstractObject::setEditor | ( | const std::string & | editor | ) |
Sets the name (or other human-readable identifier) of the last person who updated the object. In ISO 19115, this is equivalent to the CI_Individual.name
or the CI_Organization.name
of the citedResponsibleParty
whose role is editor
std::invalid_argument | If this instance is actually a partial object. |
std::range_error | If editor is more than 64 chars long. |
editor | The editor to set to this data object. |
|
static |
Sets the default citation format which is going to be written in each created object. A maximum of 256 chars is allowed.
std::range_error | If the format is more than 256 chars long. |
vendor | The name of the vendor which is exporting the data objects. |
applicationName | The name of the application which is exporting the data objects. |
applicationVersionNumber | The version of the application which is exporting the data objects. |
|
inline |
Sets the underlying EML2.3 gSOAP proxy of this data object
[in] | gsoapProxy | If non-null, the gSOAP proxy. |
|
inline |
Sets the underlying RESQML2.0 gSOAP proxy of this data object
[in] | gsoapProxy | If non-null, the gSOAP proxy. |
void common::AbstractObject::setLastUpdate | ( | const tm & | lastUpdate | ) |
Same as setLastUpdate()
. Please use this method if you want to read some dates out of the range of time_t
lastUpdate | The last update date and time to set to this data object. |
void common::AbstractObject::setLastUpdate | ( | time_t | lastUpdate | ) |
Sets the date and time the data object was last modified in the source application or, if that information is not available, when it was last saved to the file. This is the equivalent of the ISO 19115 CI_Date
where the CI_DateTypeCode
is lastUpdate
std::invalid_argument | If this instance is actually a partial object. |
lastUpdate | The last update date and time to set to this data object. |
void common::AbstractObject::setMetadata | ( | const std::string & | title, |
const std::string & | editor, | ||
time_t | creation, | ||
const std::string & | originator, | ||
const std::string & | description, | ||
time_t | lastUpdate, | ||
const std::string & | descriptiveKeywords ) |
Sets a title and other common metadata for this instance.
std::invalid_argument | If this instance is actually a partial object. |
std::range_error | If title is more than 256 chars long. |
std::range_error | If editor title is more than 64 chars long. |
std::range_error | If originator title is more than 64 chars long. |
std::range_error | If description is too long (more than 4000 chars for RESQML2.0 or more than 2000 chars for EML2.1 and EML2.2). |
std::range_error | If descriptiveKeywords is too long (more than 4000 chars for RESQML2.0 or more than 2000 chars for EML2.1 and EML2.2). |
title | The title to set to this instance. If empty then "unknown" title will be set. |
editor | The editor to set to this instance. Set to empty string or zero if you don't want to use. |
creation | The creation date and time to set to this instance. |
originator | The originator name or identifier to set to this instance. If empty, the user id is set if available, "unknown" if it is not. |
description | The description to set to this instance. Set to empty string or zero if you don't want to use. |
lastUpdate | The last update date and time to set to this data object. |
descriptiveKeywords | The key words to describe the activity relevant to this data object. Set to empty string or zero if you don't want to use. |
void common::AbstractObject::setOriginator | ( | const std::string & | originator | ) |
Sets the name (or other human-readable identifier) of the person who initially originated this data object or document in the source application. If that information is not available, then this is the user of the session during the file creation. The originator remains the same as the object is subsequently edited. This is the equivalent in ISO 19115 to the CI_Individual.name
or the CI_Organization.name
of the citedResponsibleParty
whose role is originator
std::invalid_argument | If this instance is actually a partial object. |
std::range_error | If originator is more than 64 chars long. |
originator | The originator name or identifier to set to this data object. If empty, the user id is set if available, "unknown" if it is not. |
void common::AbstractObject::setTitle | ( | const std::string & | title | ) |
Sets the title (i.e. the name) of this data object. This is the equivalent of CI_Citation.title
in ISO 19115
std::invalid_argument | If this instance is actually a partial object. |
std::range_error | If title is more than 256 chars long. |
title | The title to set to this data object. If empty then "unknown" title will be set. |
|
inline |
Set the EPC document absolute path or the ETP dataspace URI where this dataobject comes from.
void common::AbstractObject::setVersion | ( | const std::string & | version | ) |
Set the version of this data object
std::invalid_argument | If version is empty. |
std::range_error | If version is more than 64 chars long. |
version | The version to set to this data object. |