|
ImagingTools Core SDK
|
Converts document metadata to/from JSON representation. More...
#include <IJsonBasedMetaInfoDelegate.h>
Inherits istd::IPolymorphic.
Inherited by imtdbgql::TSdlBasedMetaInfoDelegate< sdl::controlsgallery::ContactInfos::CContactInfoItemData::V1_0 > [virtual], imtdb::CJsonBasedMetaInfoDelegateComp [virtual], and imtdbgql::TSdlBasedMetaInfoDelegate< MetaInfoRepresentation > [virtual].
Public Member Functions | |
| virtual bool | ToJsonRepresentation (const idoc::IDocumentMetaInfo &metaInfo, QByteArray &json, const QByteArray &typeId) const =0 |
| Converts metadata to JSON representation. | |
| virtual bool | FromJsonRepresentation (const QByteArray &json, idoc::IDocumentMetaInfo &metaInfo, const QByteArray &typeId) const =0 |
| Creates metadata from JSON representation. | |
Converts document metadata to/from JSON representation.
IJsonBasedMetaInfoDelegate provides bidirectional conversion between structured metadata (IDocumentMetaInfo) and JSON format for database storage. This enables rich, schema-less metadata to be persisted in JSON/JSONB database columns.
Metadata in imtdb applications includes:
This interface standardizes the JSON schema for metadata storage, ensuring consistency across different components and enabling JSON-based queries.
Typical metadata JSON structure:
Definition at line 89 of file IJsonBasedMetaInfoDelegate.h.
|
pure virtual |
Creates metadata from JSON representation.
Deserializes a JSON byte array into an IDocumentMetaInfo object, parsing the JSON according to the delegate's schema and populating the metadata with fields and values.
| json | The JSON byte array to parse (UTF-8 encoded) | |
| [out] | metaInfo | Receives the deserialized metadata |
| typeId | The type identifier of the document being deserialized |
Example:
|
pure virtual |
Converts metadata to JSON representation.
Serializes an IDocumentMetaInfo object to a JSON byte array following the delegate's JSON schema. The resulting JSON can be stored in database JSONB/JSON columns.
| metaInfo | The metadata object to serialize | |
| [out] | json | Receives the JSON representation (UTF-8 encoded) |
| typeId | The type identifier of the document being serialized |
Example: