Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
MetadataDataObjectAdapter Class Reference
Inheritance diagram for MetadataDataObjectAdapter:
PersistableFilter Filter DataObject Dc11SchemaArticleAdapter MetadataDescriptionDummyAdapter Mods34SchemaSubmissionAdapter Nlm30CitationSchemaCitationAdapter Mods34SchemaArticleAdapter

Public Member Functions

 addLocalizedStatements (&$metadataDescription, $propertyName, $localizedValues)
 
extractMetadataFromDataObject (&$sourceDataObject)
 
 extractUnmappedDataObjectMetadataFields (&$dataObject, &$metadataDescription)
 
 getAssocType ()
 
 getDataObjectClass ()
 
 getDataObjectMetadataFieldNames ($translated=true)
 
 getDataObjectName ()
 
 getMetadataFieldNames ($translated=true)
 
 getMetadataNamespace ()
 
getMetadataSchema ()
 
 getMetadataSchemaName ()
 
getTargetDataObject ()
 
injectMetadataIntoDataObject (&$metadataDescription, &$targetDataObject)
 
 injectUnmappedDataObjectMetadataFields (&$metadataDescription, &$dataObject)
 
instantiateDataObject ()
 
instantiateMetadataDescription ()
 
 MetadataDataObjectAdapter (&$filterGroup)
 
process (&$input)
 
 setTargetDataObject (&$targetDataObject)
 
- Public Member Functions inherited from PersistableFilter
 addSetting (&$setting)
 
 getClassName ()
 
getFilterGroup ()
 
 getInternalSettings ()
 
 getIsTemplate ()
 
 getLocalizedSettingNames ()
 
 getParentFilterId ()
 
getSetting ($settingName)
 
 getSettingNames ()
 
getSettings ()
 
 hasSetting ($settingName)
 
 hasSettings ()
 
 PersistableFilter (&$filterGroup)
 
 setIsTemplate ($isTemplate)
 
 setParentFilterId ($parentFilterId)
 
 tempGroup ($inputType, $outputType)
 
- Public Member Functions inherited from Filter
 addError ($message)
 
 clearErrors ()
 
execute (&$input)
 
 Filter ($inputType, $outputType)
 
 getDisplayName ()
 
 getErrors ()
 
getInputType ()
 
getLastInput ()
 
getLastOutput ()
 
getOutputType ()
 
getRuntimeEnvironment ()
 
 getSeq ()
 
 hasErrors ()
 
 isCompatibleWithRuntimeEnvironment ()
 
process (&$input)
 
 setDisplayName ($displayName)
 
 setRuntimeEnvironment (&$runtimeEnvironment)
 
 setSeq ($seq)
 
 setTransformationType (&$inputType, &$outputType)
 
 supportedRuntimeEnvironmentSettings ()
 
 supports (&$input, &$output)
 
 supportsAsInput (&$input)
 
- Public Member Functions inherited from DataObject
 addSupportedMetadataAdapter (&$metadataAdapter)
 
 DataObject ($callHooks=true)
 
extractMetadata (&$metadataSchema)
 
 getAdditionalMetadataFieldNames ()
 
getAllData ()
 
getData ($key, $locale=null)
 
 getHasLoadableAdapters ()
 
 getId ()
 
 getLocaleMetadataFieldNames ()
 
getLocalizedData ($key)
 
 getMetadataFieldNames ($translated=true)
 
 getSetMetadataFieldNames ($translated=true)
 
getSupportedExtractionAdapters ()
 
getSupportedInjectionAdapters ()
 
getSupportedMetadataSchemas ()
 
 hasData ($key, $locale=null)
 
 injectMetadata (&$metadataDescription)
 
 removeSupportedMetadataAdapter ($metadataSchemaName)
 
 setAllData (&$data)
 
 setData ($key, $value, $locale=null)
 
 setHasLoadableAdapters ($hasLoadableAdapters)
 
 setId ($id)
 
upcastTo (&$targetObject)
 

Additional Inherited Members

- Public Attributes inherited from DataObject
 $_data = array()
 

Detailed Description

Class that injects/extracts a meta-data description into/from an application entity object (DataObject).

See Also
DataObject
MetadataSchema
MetadataDescription

These adapters have to be persistable as they'll be provided by plug-ins via the filter registry.

Definition at line 26 of file MetadataDataObjectAdapter.inc.php.

Member Function Documentation

MetadataDataObjectAdapter::addLocalizedStatements ( $metadataDescription,
  $propertyName,
  $localizedValues 
)

Set several localized statements in a meta-data schema.

Parameters
$metadataDescriptionMetadataDescription
$propertyNamestring
$localizedValuesarray (keys: locale, values: localized values)

Definition at line 324 of file MetadataDataObjectAdapter.inc.php.

Referenced by Mods34SchemaSubmissionAdapter\extractMetadataFromDataObject(), and extractUnmappedDataObjectMetadataFields().

& MetadataDataObjectAdapter::extractMetadataFromDataObject ( $sourceDataObject)

Extract a MetadataDescription from a source DataObject.

Parameters
$sourceDataObjectDataObject
Returns
MetadataDescription

Definition at line 194 of file MetadataDataObjectAdapter.inc.php.

Referenced by process().

MetadataDataObjectAdapter::extractUnmappedDataObjectMetadataFields ( $dataObject,
$metadataDescription 
)

Directly extract all fields that are not mapped to the data object from the data object's data array.

Parameters
$dataObjectDataObject
$metadataDescriptionMetadataDescription

Definition at line 372 of file MetadataDataObjectAdapter.inc.php.

References addLocalizedStatements(), getDataObjectMetadataFieldNames(), and getMetadataSchema().

Referenced by Mods34SchemaSubmissionAdapter\extractMetadataFromDataObject().

MetadataDataObjectAdapter::getAssocType ( )

Get the association type corresponding to the data object type.

Returns
integer

Definition at line 154 of file MetadataDataObjectAdapter.inc.php.

Referenced by instantiateMetadataDescription().

MetadataDataObjectAdapter::getDataObjectClass ( )

Return the data object class name (without the package prefix)

Returns
string

Definition at line 139 of file MetadataDataObjectAdapter.inc.php.

References getDataObjectName().

Referenced by instantiateDataObject(), MetadataDataObjectAdapter(), and process().

MetadataDataObjectAdapter::getDataObjectMetadataFieldNames (   $translated = true)

Return the additional field names introduced by the meta-data schema that need to be persisted in the ..._settings table corresponding to the DataObject which is supported by this adapter. NB: The field names must be prefixed with the meta-data schema namespace identifier.

Parameters
$translatedboolean if true, return localized field names, otherwise return additional field names.
Returns
array an array of field names to be persisted.

Definition at line 210 of file MetadataDataObjectAdapter.inc.php.

References getMetadataFieldNames().

Referenced by Nlm30CitationSchemaCitationAdapter\extractMetadataFromDataObject(), extractUnmappedDataObjectMetadataFields(), and injectUnmappedDataObjectMetadataFields().

MetadataDataObjectAdapter::getDataObjectName ( )

Get the supported application entity (class) name

Returns
string

Definition at line 129 of file MetadataDataObjectAdapter.inc.php.

Referenced by getDataObjectClass(), instantiateDataObject(), and process().

MetadataDataObjectAdapter::getMetadataFieldNames (   $translated = true)

Return all field names introduced by the meta-data schema that might have to be persisted.

Parameters
$translatedboolean if true, return localized field names, otherwise return additional field names.
Returns
array an array of field names to be persisted.

Definition at line 292 of file MetadataDataObjectAdapter.inc.php.

References getMetadataSchema().

Referenced by getDataObjectMetadataFieldNames().

MetadataDataObjectAdapter::getMetadataNamespace ( )

Convenience method that returns the meta-data name space.

Returns
string

Definition at line 120 of file MetadataDataObjectAdapter.inc.php.

References getMetadataSchema().

Referenced by Nlm30CitationSchemaCitationAdapter\extractMetadataFromDataObject(), and Nlm30CitationSchemaCitationAdapter\injectMetadataIntoDataObject().

MetadataDataObjectAdapter::getMetadataSchemaName ( )

Get the fully qualified class name of the supported meta-data schema.

Returns
string

Definition at line 95 of file MetadataDataObjectAdapter.inc.php.

Referenced by getMetadataSchema(), and instantiateMetadataDescription().

& MetadataDataObjectAdapter::getTargetDataObject ( )

Get the target data object for meta-data injection.

Parameters
$targetDataObjectDataObject

Definition at line 170 of file MetadataDataObjectAdapter.inc.php.

Referenced by process().

& MetadataDataObjectAdapter::injectMetadataIntoDataObject ( $metadataDescription,
$targetDataObject 
)

Inject a MetadataDescription into the target DataObject

Parameters
$metadataDescriptionMetadataDescription
$targetDataObjectDataObject
Returns
DataObject

Definition at line 184 of file MetadataDataObjectAdapter.inc.php.

Referenced by process().

MetadataDataObjectAdapter::injectUnmappedDataObjectMetadataFields ( $metadataDescription,
$dataObject 
)

Directly inject all fields that are not mapped to the data object into the data object's data array for automatic persistence by the meta-data framework.

Parameters
$metadataDescriptionMetadataDescription
$dataObjectDataObject

Definition at line 344 of file MetadataDataObjectAdapter.inc.php.

References getDataObjectMetadataFieldNames().

Referenced by Mods34SchemaSubmissionAdapter\injectMetadataIntoDataObject().

& MetadataDataObjectAdapter::instantiateDataObject ( )

Instantiate a new data object of the correct type.

NB: This can be overridden by sub-classes for more complex data objects. The standard implementation assumes there are no constructor args to be set or configurations to be made.

Returns
DataObject

Definition at line 268 of file MetadataDataObjectAdapter.inc.php.

References getDataObjectClass(), and getDataObjectName().

Referenced by process().

& MetadataDataObjectAdapter::instantiateMetadataDescription ( )
MetadataDataObjectAdapter::MetadataDataObjectAdapter ( $filterGroup)

Constructor

Parameters
$filterGroupFilterGroup

Definition at line 49 of file MetadataDataObjectAdapter.inc.php.

References getDataObjectClass(), Filter\getInputType(), Filter\getOutputType(), and Filter\setDisplayName().

& MetadataDataObjectAdapter::process ( $input)

Convert a MetadataDescription to an application object or vice versa.

See Also
Filter::process()
Parameters
$inputmixed either a MetadataDescription or an application object
Returns
mixed either a MetadataDescription or an application object

Definition at line 226 of file MetadataDataObjectAdapter.inc.php.

References extractMetadataFromDataObject(), getDataObjectClass(), getDataObjectName(), getTargetDataObject(), injectMetadataIntoDataObject(), and instantiateDataObject().

MetadataDataObjectAdapter::setTargetDataObject ( $targetDataObject)

Set the target data object for meta-data injection.

Parameters
$targetDataObjectDataObject

Definition at line 162 of file MetadataDataObjectAdapter.inc.php.


The documentation for this class was generated from the following file: