ANDS_TPA Class Reference

For creating RIF-CS metadata to meet the requirement of ANDS. More...

Inheritance diagram for ANDS_TPA:
ANDS_RIFCS

List of all members.

Public Member Functions

 __construct ($ands_response_doc, $metadata_node, $db)
 create_obj_node ($set_name, $key)

Private Member Functions

 create_activity ($table_name, $id_project)
 create_collection ($table_name, $id_collect)
 create_party ($table_name, $id_party)
 create_person ($table_name, $id_party)
 create_group ($table_name, $id_party)

Private Attributes

 $db

Detailed Description

Class ANDS_RIFCS provides all essential functionalities for creating ANDS RIF-CS records. The protected member functions are the backbone functions which can be used for creating any ANDS RIF-CS records. At the time of design only data source is database and there is only one set of outputs. Therefore there is only one class has been designed. Ideally, there should be a separated class for creating actual records which reflect data source and data models.

Example usage: publish records meet ANDS RIF-CS requirements

 $metadata_node = $outputObj->create_metadata($cur_record);
 $obj_node = new ANDS_TPA($outputObj, $metadata_node, $db);
 try {
        $obj_node->create_obj_node($record[$SQL['set']], $identifier);
 } catch (Exception $e) {
                echo 'Caught exception: ',  $e->getMessage(), " when adding $identifier\n";
 } 
See also:
Code in action can be seen in record_rif.php

Constructor & Destructor Documentation

ANDS_TPA::__construct ( ands_response_doc,
metadata_node,
db 
)

Constructor The first two parameters are used by its parent class ANDS_RIFCS. The third is its own private property.

Parameters:
$ands_response_doc ANDS_Response_XML. A XML Doc acts as the parent node.
$metadata_node DOMElement. The meta node which all subsequent nodes will be added to.
$db Type: PDO. The database connection of the data source.

Member Function Documentation

ANDS_TPA::create_obj_node ( set_name,
key 
)

This is the general entrence of creating actual content. It calls different functions for different type of RIF-CS model. When anything goes wrong, e.g. found no record, or $set_name is not recognised, an exception will be thrown. And for this implementation, data are stored in a database therefore a PDO is needed. But the source can be any.

Parameters:
$set_name Type: string. The name of set is going to be created. Can be one of activity, collection or party.
$key Type: string. The main identifier used in ANDS system. There can be other identifier.
See also:
create_activity, create_collection, create_party
ANDS_TPA::create_activity ( table_name,
id_project 
) [private]

The processor for creating metadata node of Activity. Called from create_obj_node.

Parameters:
$table_name Type: string. The table name will be used to retrieve data from.
$id_project Type: integer. Internal project id associated to this activity-project.
See also:
Function create_obj_node.
ANDS_TPA::create_collection ( table_name,
id_collect 
) [private]

The processor for creating metadata node of Collection. Called from create_obj_node.

Parameters:
$table_name Type: string. The table name will be used to retrieve data from.
$id_collect Type: integer. Internal collection id associated to this collection-dataset.
See also:
Function create_obj_node.
ANDS_TPA::create_party ( table_name,
id_party 
) [private]

The processor for creating metadata node of Party. Called from create_obj_node. As party-person is different to party-group, there are two sub-functions are called accordingly.

Parameters:
$table_name Type: string. The table name will be used to retrieve data from.
$id_party Type: integer. Internal party id associated to this party.
See also:
Function create_obj_node.
ANDS_TPA::create_person ( table_name,
id_party 
) [private]

The processor for creating metadata node of Party. Called from create_obj_node. As party-person is different to party-group, there are two sub-functions are called accordingly.

Parameters:
$table_name Type: string. The table name will be used to retrieve data from.
$id_party Type: integer. Internal party id associated to this party-person.
See also:
Function create_party.
ANDS_TPA::create_group ( table_name,
id_party 
) [private]

The processor for creating metadata node of Party. Called from create_obj_node. As party-person is different to party-group, there are two sub-functions are called accordingly.

Parameters:
$table_name Type: string. The table name will be used to retrieve data from.
$id_party Type: integer. Internal party id associated to this party-group.
See also:
Function create_party.

Member Data Documentation

ANDS_TPA::$db [private]

Type: PDO. The database connection of the data source.

See also:
__construct.

The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Enumerations
Generated on Thu Jun 16 12:49:22 2011 for OAI PHP by  doxygen 1.6.3