ANDS_RIFCS Class Reference

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

Inheritance diagram for ANDS_RIFCS:
ANDS_TPA

List of all members.

Public Member Functions

 __construct ($ands_response_doc, $metadata_node)

Protected Member Functions

 addChild ($mom_node, $name, $value='')
 create_regObjects ()
 create_regObject ($group, $key, $originatingSource)
 create_rifcs_node ($set_name, $set_type)
 create_name_node ($name_type= 'primary')
 create_namePart ($name_node, $value, $part_type= '')
 create_relatedObject ($key, $relation_type)
 create_description_node ($value, $des_type='brief')
 create_identifier_node ($key, $i_type='local')
 create_location_node ()
 create_address_node ($location_node)
 create_e_node ($addr_node, $e_node, $e_type= 'email')
 create_physcial_fone_fax ($addr_node, $number, $fone_fax='telephoneNumber')
 create_physcial_addr_txt ($addr_node, $txt_addr, $phys_type='streetAddress')
 create_spatial_node ($location_node, $value= '138.6396,-34.97063', $sp_type= 'kmlPolyCoords')
 create_coverage_tempo ($values)
 create_subject_node ($value, $subject_type= 'anzsrc-for')

Protected Attributes

 $oai_pmh
 $working_node

Private Member Functions

 create_coverage_tempo_date ($t, $value)

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.


Constructor & Destructor Documentation

ANDS_RIFCS::__construct ( ands_response_doc,
metadata_node 
)

Constructor

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.

Member Function Documentation

ANDS_RIFCS::addChild ( mom_node,
name,
value = '' 
) [protected]

A worker function for easily adding a newly created node to current XML Doc.

Parameters:
$mom_node Type: DOMElement. Node the new child will be attached to.
$name Type: sting. The name of the child node is being added.
$value Type: sting. The text content of the child node is being added. The default is ''.
Returns:
DOMElement. The added child node
ANDS_RIFCS::create_regObjects (  )  [protected]

Create a registryObjects node to hold individual registryObject's. This is only a holder node.

ANDS_RIFCS::create_regObject ( group,
key,
originatingSource 
) [protected]

Create a single registryObject node. Each set has its own structure but they all have an attribute of group, a key node and an originatingSource node. The newly created node will be used as the working node.

Parameters:
$group string, group attribute of the new registryObject node .
$key string, key node, used as an identifier.
$originatingSource string, an url of the data provider.
ANDS_RIFCS::create_rifcs_node ( set_name,
set_type 
) [protected]

RIF-CS node is the content node of RIF-CS metadata node which starts from regObjects. Each set supportted in RIF-CS has its own content model. The created node will be used as the root node of this record for following nodes will be created.

Parameters:
$set_name string, the name of set. For ANDS, they are Activity, Party and Collection
$set_type string, the type of set. For example, Activity can have project as a type.
ANDS_RIFCS::create_name_node ( name_type = 'primary'  )  [protected]

Create a top level name node.

Parameters:
$name_type string. Text for the types, can be either primary or abbreviated. Default: primary
Returns:
DOMElement $added_name_node. The newly created node, it will be used for further expansion by adding namePart.
ANDS_RIFCS::create_namePart ( name_node,
value,
part_type = '' 
) [protected]

Create a namePart of a name node.

Parameters:
$name_node Type: DOMElement. Node of name_node created previously
$value Type: string. Text fror this namePart
$part_type Type: string, used for group:person record. Types can be: titile, given, family
ANDS_RIFCS::create_relatedObject ( key,
relation_type 
) [protected]

Create related object. One RIF-CS can have more than one related object nodes, each object is described by one node.

Parameters:
$key Type: string. The identifier of the related object.
$relation_type Type: string. Type of relationship.
ANDS_RIFCS::create_description_node ( value,
des_type = 'brief' 
) [protected]

Create description node. One RIF-CS can have more than one description nodes. Each description node has only one description.

Parameters:
$value Type: string. The content of the description.
$des_type Type: string. Type of the description. Types can be brief, full, acessRights and note. Default is 'brief'.
ANDS_RIFCS::create_identifier_node ( key,
i_type = 'local' 
) [protected]

Create local or other type of identifier inside of RIF-CS metadata node

Parameters:
$key Type string. The indentifier itself.
$i_type Type string. Type of identifier. Can be abn, uri, local, etc.. Default is local.
ANDS_RIFCS::create_location_node (  )  [protected]

Location node is a holder node for either address or spatial nodes

Returns:
DOMElement node, for adding address or spatial nodes.
ANDS_RIFCS::create_address_node ( location_node  )  [protected]

Address node is a holder node for phiscal or electrical nodes.

Parameters:
$location_node Type: DOMElement. Location node created previously.
Returns:
DOMElement
ANDS_RIFCS::create_e_node ( addr_node,
e_node,
e_type = 'email' 
) [protected]

Electrical address node. Used for email, url, etc

Parameters:
$addr_node Type: DOMElement. Previously created address node.
$e_node Type: string. The content of the adding node.
$e_type Type: string. Default is email.
ANDS_RIFCS::create_physcial_fone_fax ( addr_node,
number,
fone_fax = 'telephoneNumber' 
) [protected]

Physical node is a holder node for phone or fax nodes.

Parameters:
$addr_node Type: DOMelement. Address node created before to which the new phiscial->addressPart will be attached.
$number Type: string. Telephone or fax number as a string.
$fone_fax Type: string. Either telehoneNumber or faxNumber.
ANDS_RIFCS::create_physcial_addr_txt ( addr_node,
txt_addr,
phys_type = 'streetAddress' 
) [protected]

create address node under location node, either streetAddress or postalAddress. But they are in text (one block) format.

Parameters:
$addr_node Type: DOMelement. Address node created before to which the new phiscial->addressPart will be attached.
$txt_addr string, full street address in text block format
$phys_type string, default is 'streetAddress', can be 'postalAddress'
ANDS_RIFCS::create_spatial_node ( location_node,
value = '138.6396,
-34.97063'  ,
sp_type = 'kmlPolyCoords' 
) [protected]

Create spatial node under a location node.

Parameters:
$location_node Type: DOMElement. Location node where spatial node is being added to.
$value Type: string. The value of spatial information. Default is local latitude and longitude.
$sp_type Type: string. Type of spaitial informaion. Default is kmlPolyCoords.
ANDS_RIFCS::create_coverage_tempo ( values  )  [protected]

Create temporal coverage node for collection or activity records.

Parameters:
$values Type: 2-D array. The values of temporal coverage. It can has maximal two elements: one from 'dateFrom' and another for 'dateTo'. Either can be ommited according to RIF-CS schema. Each element of $values is an array and has keys: date, type and format. ['date'] is a string represents date. It has to be in W3CDTF or UTC format. ['type'] has to be either 'dateFrom' or 'dateTo'. ['format'] is optional and its default is 'W3CDTF'. UTC format requires date has to be in UTC: dateTtimeZ. It throws an exception if the input parameter is not an array.
ANDS_RIFCS::create_coverage_tempo_date ( t,
value 
) [private]

Create temporal coverage node for collection or activity records.

Parameters:
$t Type: DOMElement. The <coverage><temporal/></coverage> node to which <date> nodes will be attached to.
$value Type: array. The value of temporal coverage. It has maxmimal three elements with keys: type, date and format. It throws an exception if the input parameter is not an array.
See also:
create_coverage_tempo
ANDS_RIFCS::create_subject_node ( value,
subject_type = 'anzsrc-for' 
) [protected]

Create a subject node for a researcher, project, project, etc

Parameters:
$value Type: string. A string representing the new namePart.
$subject_type Type: string. A string representing the type of subject. The default value is anzsrc-for.

Member Data Documentation

ANDS_RIFCS::$oai_pmh [protected]

Type: ANDS_Response_XML. Assigned by constructor.

See also:
__construct
ANDS_RIFCS::$working_node [protected]

Type: DOMElement. Assigned by constructor.

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