simple-oai-pmh/doc/classANDS__TPA.html

386 lines
20 KiB
HTML

<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OAI PHP: ANDS_TPA Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.6.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<img id="MSearchSelect" src="search/search.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</div>
</li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>ANDS_TPA Class Reference</h1><!-- doxytag: class="ANDS_TPA" --><!-- doxytag: inherits="ANDS_RIFCS" -->
<p>For creating RIF-CS metadata to meet the requirement of ANDS.
<a href="#_details">More...</a></p>
<div class="dynheader">
Inheritance diagram for ANDS_TPA:</div>
<div class="dynsection">
<div class="center">
<img src="classANDS__TPA.png" usemap="#ANDS_TPA_map" alt=""/>
<map id="ANDS_TPA_map" name="ANDS_TPA_map">
<area href="classANDS__RIFCS.html" alt="ANDS_RIFCS" shape="rect" coords="0,0,90,24"/>
</map>
</div>
</div>
<p><a href="classANDS__TPA-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classANDS__TPA.html#a352d8aa9c0c6064217b9c3c56762251c">__construct</a> ($ands_response_doc, $metadata_node, $db)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classANDS__TPA.html#a240dd35f9a2b3b15d77e424e467a64ad">create_obj_node</a> ($set_name, $key)</td></tr>
<tr><td colspan="2"><h2>Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classANDS__TPA.html#a60be97e07248063124c462d64cb8e397">create_activity</a> ($table_name, $id_project)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classANDS__TPA.html#acdddc8970b706a7eb9a41ed44fccee3d">create_collection</a> ($table_name, $id_collect)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classANDS__TPA.html#ac18cba5160570e97d6fc816a6a9ff8f9">create_party</a> ($table_name, $id_party)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classANDS__TPA.html#aff4cb4a5d6c8a5aff1e13e798078e5e3">create_person</a> ($table_name, $id_party)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classANDS__TPA.html#ab9ca4cf6faf9628b67e83b56305ae90c">create_group</a> ($table_name, $id_party)</td></tr>
<tr><td colspan="2"><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classANDS__TPA.html#a071ca263f04dc5ebb53f5c11918f47ea">$db</a></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Class <a class="el" href="classANDS__RIFCS.html" title="For creating RIF-CS metadata to meet the requirement of ANDS.">ANDS_RIFCS</a> 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.</p>
<p>Example usage: publish records meet ANDS RIF-CS requirements</p>
<div class="fragment"><pre class="fragment"> $metadata_node = $outputObj-&gt;create_metadata($cur_record);
$obj_node = <span class="keyword">new</span> <a class="code" href="classANDS__TPA.html" title="For creating RIF-CS metadata to meet the requirement of ANDS.">ANDS_TPA</a>($outputObj, $metadata_node, <a class="code" href="classANDS__TPA.html#a071ca263f04dc5ebb53f5c11918f47ea">$db</a>);
<span class="keywordflow">try</span> {
$obj_node-&gt;create_obj_node($record[$SQL[<span class="stringliteral">&#39;set&#39;</span>]], $identifier);
} <span class="keywordflow">catch</span> (Exception $e) {
echo <span class="stringliteral">&#39;Caught exception: &#39;</span>, $e-&gt;getMessage(), <span class="stringliteral">&quot; when adding $identifier\n&quot;</span>;
}
</pre></div> <dl class="see"><dt><b>See also:</b></dt><dd>Code in action can be seen in <a class="el" href="record__rif_8php.html" title="Definition of RIF-CS handler.">record_rif.php</a> </dd></dl>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a352d8aa9c0c6064217b9c3c56762251c"></a><!-- doxytag: member="ANDS_TPA::__construct" ref="a352d8aa9c0c6064217b9c3c56762251c" args="($ands_response_doc, $metadata_node, $db)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ANDS_TPA::__construct </td>
<td>(</td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>ands_response_doc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>metadata_node</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>db</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructor The first two parameters are used by its parent class <a class="el" href="classANDS__RIFCS.html" title="For creating RIF-CS metadata to meet the requirement of ANDS.">ANDS_RIFCS</a>. The third is its own private property.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>$ands_response_doc</em>&nbsp;</td><td><a class="el" href="classANDS__Response__XML.html">ANDS_Response_XML</a>. A XML Doc acts as the parent node. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>$metadata_node</em>&nbsp;</td><td>DOMElement. The meta node which all subsequent nodes will be added to. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>$db</em>&nbsp;</td><td>Type: PDO. The database connection of the data source. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a240dd35f9a2b3b15d77e424e467a64ad"></a><!-- doxytag: member="ANDS_TPA::create_obj_node" ref="a240dd35f9a2b3b15d77e424e467a64ad" args="($set_name, $key)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ANDS_TPA::create_obj_node </td>
<td>(</td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>set_name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>key</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>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.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>$set_name</em>&nbsp;</td><td>Type: string. The name of set is going to be created. Can be one of activity, collection or party. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>$key</em>&nbsp;</td><td>Type: string. The main identifier used in ANDS system. There can be other identifier.</td></tr>
</table>
</dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classANDS__TPA.html#a60be97e07248063124c462d64cb8e397">create_activity</a>, <a class="el" href="classANDS__TPA.html#acdddc8970b706a7eb9a41ed44fccee3d">create_collection</a>, <a class="el" href="classANDS__TPA.html#ac18cba5160570e97d6fc816a6a9ff8f9">create_party</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a60be97e07248063124c462d64cb8e397"></a><!-- doxytag: member="ANDS_TPA::create_activity" ref="a60be97e07248063124c462d64cb8e397" args="($table_name, $id_project)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ANDS_TPA::create_activity </td>
<td>(</td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>table_name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>id_project</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [private]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>The processor for creating metadata node of Activity. Called from create_obj_node. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>$table_name</em>&nbsp;</td><td>Type: string. The table name will be used to retrieve data from. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>$id_project</em>&nbsp;</td><td>Type: integer. Internal project id associated to this activity-project. </td></tr>
</table>
</dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd>Function <a class="el" href="classANDS__TPA.html#a240dd35f9a2b3b15d77e424e467a64ad">create_obj_node</a>. </dd></dl>
</div>
</div>
<a class="anchor" id="acdddc8970b706a7eb9a41ed44fccee3d"></a><!-- doxytag: member="ANDS_TPA::create_collection" ref="acdddc8970b706a7eb9a41ed44fccee3d" args="($table_name, $id_collect)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ANDS_TPA::create_collection </td>
<td>(</td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>table_name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>id_collect</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [private]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>The processor for creating metadata node of Collection. Called from create_obj_node. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>$table_name</em>&nbsp;</td><td>Type: string. The table name will be used to retrieve data from. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>$id_collect</em>&nbsp;</td><td>Type: integer. Internal collection id associated to this collection-dataset. </td></tr>
</table>
</dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd>Function <a class="el" href="classANDS__TPA.html#a240dd35f9a2b3b15d77e424e467a64ad">create_obj_node</a>. </dd></dl>
</div>
</div>
<a class="anchor" id="ac18cba5160570e97d6fc816a6a9ff8f9"></a><!-- doxytag: member="ANDS_TPA::create_party" ref="ac18cba5160570e97d6fc816a6a9ff8f9" args="($table_name, $id_party)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ANDS_TPA::create_party </td>
<td>(</td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>table_name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>id_party</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [private]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>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. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>$table_name</em>&nbsp;</td><td>Type: string. The table name will be used to retrieve data from. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>$id_party</em>&nbsp;</td><td>Type: integer. Internal party id associated to this party. </td></tr>
</table>
</dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd>Function <a class="el" href="classANDS__TPA.html#a240dd35f9a2b3b15d77e424e467a64ad">create_obj_node</a>. </dd></dl>
</div>
</div>
<a class="anchor" id="aff4cb4a5d6c8a5aff1e13e798078e5e3"></a><!-- doxytag: member="ANDS_TPA::create_person" ref="aff4cb4a5d6c8a5aff1e13e798078e5e3" args="($table_name, $id_party)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ANDS_TPA::create_person </td>
<td>(</td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>table_name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>id_party</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [private]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>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. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>$table_name</em>&nbsp;</td><td>Type: string. The table name will be used to retrieve data from. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>$id_party</em>&nbsp;</td><td>Type: integer. Internal party id associated to this party-person. </td></tr>
</table>
</dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd>Function <a class="el" href="classANDS__TPA.html#ac18cba5160570e97d6fc816a6a9ff8f9">create_party</a>. </dd></dl>
</div>
</div>
<a class="anchor" id="ab9ca4cf6faf9628b67e83b56305ae90c"></a><!-- doxytag: member="ANDS_TPA::create_group" ref="ab9ca4cf6faf9628b67e83b56305ae90c" args="($table_name, $id_party)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ANDS_TPA::create_group </td>
<td>(</td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>table_name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>id_party</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [private]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>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. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>$table_name</em>&nbsp;</td><td>Type: string. The table name will be used to retrieve data from. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>$id_party</em>&nbsp;</td><td>Type: integer. Internal party id associated to this party-group. </td></tr>
</table>
</dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd>Function <a class="el" href="classANDS__TPA.html#ac18cba5160570e97d6fc816a6a9ff8f9">create_party</a>. </dd></dl>
</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a071ca263f04dc5ebb53f5c11918f47ea"></a><!-- doxytag: member="ANDS_TPA::$db" ref="a071ca263f04dc5ebb53f5c11918f47ea" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ANDS_TPA::$db<code> [private]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Type: PDO. The database connection of the data source. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classANDS__TPA.html#a352d8aa9c0c6064217b9c3c56762251c">__construct</a>. </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="ands__tpa_8php.html">ands_tpa.php</a></li>
</ul>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&nbsp;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&nbsp;</span>Enumerations</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Thu Jun 16 12:49:22 2011 for OAI PHP by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>