Location: PHPKode > projects > Aukyla Document Management System > doc/html/a00102.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <title>Aukyla PHP Framework</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="StyleSheet" href="auton.css" type="text/css" media="screen">
  </head>

  <body>
    <div id="mainmenu">
      <a href="http://www.auton.nl/" class="home">Home</a>
    </div>
    <div id="submenu">
      <a class="logo" href="http://www.auton.nl/"></a>

      <div class="head">Ads</div>
      <a href="http://sourceforge.net/"><img src="http://sourceforge.net/sflogo.php?group_id=116358&amp;type=1" alt="SourceForge.net Logo" style="padding: 2px 4px; width: 88px; height: 31px; border: 0px"></a>
      <a href="http://getfirefox.com/" title="Get Firefox - The Browser, Reloaded."><img src="http://www.mozilla.org/products/firefox/buttons/getfirefox_small.png" alt="Get Firefox" style="width: 110px; height: 32px; border: 0px"></a>
    </div>
    <div id="main">
<!-- Generated by Doxygen 1.3.9.1 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<h1>DocumentHandler Class Reference</h1><a href="a00016.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
Base class for implementing new document handlers. 
<p>
To create a document handler you need to at least implement the <a class="el" href="a00102.html#e1">view()</a> to get a document handler which supports viewing, or re-implement the <a class="el" href="a00102.html#e0">supportsViewing()</a> function to return <code>false</code> if you want a document handler without viewer. To let your handler also support editing of documents you should implement the <a class="el" href="a00102.html#e3">edit()</a> and <a class="el" href="a00102.html#e4">save()</a> functions, and then you should also reimplement the * function <a class="el" href="a00102.html#e2">supportsEditing()</a> and let it return <code>true</code>. To support indexing of documents, implement the <a class="el" href="a00102.html#e6">index()</a> function and let <a class="el" href="a00102.html#e5">supportsIndexing()</a> return <code>true</code>.<p>
You should name your class like the MIME type of the documents it handles, with all non-alphanumeric characters replaced with an underscore and with "_DocumentHandler" appended, like for example: "text_plain_DocumentHandler". The class should then be stored in a file with the same name (with ".php" extension) in the "plugins/DocumentHandlers" directory. This way the handler can be automatically opened when needed.<p>
<code><a class="el" href="a00102.html#e1">view()</a></code>, <a class="el" href="a00102.html#e3">edit()</a>, <a class="el" href="a00102.html#e4">save()</a>, <a class="el" href="a00102.html#e6">index()</a>, <a class="el" href="a00102.html#e0">supportsViewing()</a>, <a class="el" href="a00102.html#e2">supportsEditing()</a>, <a class="el" href="a00102.html#e5">supportsIndexing()</a> 
<p>

<p>
Definition at line <a class="el" href="a00214.html#l00049">49</a> of file <a class="el" href="a00214.html">DocumentHandler.php</a>.<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00102.html#e0">supportsViewing</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00102.html#e1">view</a> (<a class="el" href="a00096.html">Container</a> $parent, $uri)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00102.html#e2">supportsEditing</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00102.html#e3">edit</a> (<a class="el" href="a00096.html">Container</a> $parent, $id, $uri= '')</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00102.html#e4">save</a> ($id, $uri)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00102.html#e5">supportsIndexing</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00102.html#e6">index</a> ($documentId, $uri)</td></tr>

</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="e3" doxytag="DocumentHandler::edit"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">DocumentHandler::edit           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a00096.html">Container</a> $&nbsp;</td>
          <td class="mdname" nowrap> <em>parent</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>$&nbsp;</td>
          <td class="mdname" nowrap> <em>id</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>$&nbsp;</td>
          <td class="mdname" nowrap> <em>uri</em> = <code>''</code></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Opens a document for editing.<p>
Your implementation should open the document specified with the given <code>uri</code> and should create an appropriate editor with the said document preloaded.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>parent</em>&nbsp;</td><td>The parent widget to which the <a class="el" href="a00101.html">DocumentEditor</a> is added. Any children you add to the parent are shown by the <a class="el" href="a00101.html">DocumentEditor</a>. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>The ID of the editor. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>uri</em>&nbsp;</td><td><a class="el" href="a00163.html">URI</a> to the document to be opened. If the <a class="el" href="a00163.html">URI</a> is empty, the editor should simply have no contents preloaded.</td></tr>
  </table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00102.html#e4">save()</a>, <a class="el" href="a00102.html#e2">supportsEditing()</a></dd></dl>

<p>
Definition at line <a class="el" href="a00214.html#l00120">120</a> of file <a class="el" href="a00214.html">DocumentHandler.php</a>.    </td>
  </tr>
</table>
<a class="anchor" name="e6" doxytag="DocumentHandler::index"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">DocumentHandler::index           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">$&nbsp;</td>
          <td class="mdname" nowrap> <em>documentId</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>$&nbsp;</td>
          <td class="mdname" nowrap> <em>uri</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Indexes a document.<p>
Your implementation should open the document specified with the given <code>uri</code> and index all (key)words found in the document. The document's contents should then be indexed with the Search::indexText() function.<p>
<dl compact><dt><b>Note:</b></dt><dd>The default implementation of <a class="el" href="a00102.html#e6">index()</a> still indexes a document's meta-data as stored by the <a class="el" href="a00163.html">URI</a> handler, making this function at least somewhat useful, even without a re-implemented indexer. The meta-data keys which are indexed are: <code>name</code>, <code>comment</code>, <code>keywords</code> and <code>author</code>.</dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>documentId</em>&nbsp;</td><td>ID in the search database of the document to index. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>uri</em>&nbsp;</td><td><a class="el" href="a00163.html">URI</a> of the document to be indexed.</td></tr>
  </table>
</dl>
<dl compact><dt><b>Since:</b></dt><dd>Aukyla 1.1</dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00145.html">Search</a>, <a class="el" href="a00102.html#e5">supportsIndexing()</a></dd></dl>

<p>
Definition at line <a class="el" href="a00214.html#l00189">189</a> of file <a class="el" href="a00214.html">DocumentHandler.php</a>.
<p>
References <a class="el" href="a00231.html#l00107">Search::instance()</a>, and <a class="el" href="a00237.html#l01097">URI::metaData()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="e4" doxytag="DocumentHandler::save"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">DocumentHandler::save           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">$&nbsp;</td>
          <td class="mdname" nowrap> <em>id</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>$&nbsp;</td>
          <td class="mdname" nowrap> <em>uri</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Saves an edited document.<p>
Your implementation should take the contents of the document which was uploaded from the <a class="el" href="a00101.html">DocumentEditor</a> specified with <code>id</code> and save it under the given <code>uri</code>.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>The ID of the editor through which the document was edited. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>uri</em>&nbsp;</td><td><a class="el" href="a00163.html">URI</a> where the document should be saved.</td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd><code>true</code> if the document was successfully saved, <code>false</code> otherwise.</dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00102.html#e3">edit()</a>, <a class="el" href="a00102.html#e2">supportsEditing()</a></dd></dl>

<p>
Definition at line <a class="el" href="a00214.html#l00141">141</a> of file <a class="el" href="a00214.html">DocumentHandler.php</a>.    </td>
  </tr>
</table>
<a class="anchor" name="e2" doxytag="DocumentHandler::supportsEditing"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">DocumentHandler::supportsEditing           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Returns whether the handler supports editing of documents.<p>
Reimplement this function to return <code>true</code> if you have implemented both the <a class="el" href="a00102.html#e3">edit()</a> and <a class="el" href="a00102.html#e4">save()</a> functions.<p>
<dl compact><dt><b>Returns:</b></dt><dd><code>true</code> if the handler supports editing of documents, <code>false</code> otherwise.</dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00102.html#e3">edit()</a>, <a class="el" href="a00102.html#e4">save()</a></dd></dl>

<p>
Definition at line <a class="el" href="a00214.html#l00099">99</a> of file <a class="el" href="a00214.html">DocumentHandler.php</a>.    </td>
  </tr>
</table>
<a class="anchor" name="e5" doxytag="DocumentHandler::supportsIndexing"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">DocumentHandler::supportsIndexing           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Returns whether the handler supports indexing of documents for use with search functionality.<p>
Reimplement this function to return <code>true</code> if you have implemented the <a class="el" href="a00102.html#e6">index()</a> function.<p>
<dl compact><dt><b>Note:</b></dt><dd>The default implementation of <a class="el" href="a00102.html#e6">index()</a> still indexes a document's meta-data as stored by the <a class="el" href="a00163.html">URI</a> handler.</dd></dl>
<dl compact><dt><b>Returns:</b></dt><dd><code>true</code> if the handler supports indexing of documents, <code>false</code> otherwise.</dd></dl>
<dl compact><dt><b>Since:</b></dt><dd>Aukyla 1.1</dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00102.html#e6">index()</a></dd></dl>

<p>
Definition at line <a class="el" href="a00214.html#l00163">163</a> of file <a class="el" href="a00214.html">DocumentHandler.php</a>.    </td>
  </tr>
</table>
<a class="anchor" name="e0" doxytag="DocumentHandler::supportsViewing"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">DocumentHandler::supportsViewing           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Returns whether the handler supports viewing of documents.<p>
Reimplement this function to return <code>false</code> if your handler does not implement the <a class="el" href="a00102.html#e1">view()</a> function.<p>
<dl compact><dt><b>Returns:</b></dt><dd><code>true</code> if the handler supports viewing documents, <code>false</code> otherwise.</dd></dl>
<dl compact><dt><b>Since:</b></dt><dd>Aukyla 1.1</dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00102.html#e1">view()</a></dd></dl>

<p>
Definition at line <a class="el" href="a00214.html#l00064">64</a> of file <a class="el" href="a00214.html">DocumentHandler.php</a>.    </td>
  </tr>
</table>
<a class="anchor" name="e1" doxytag="DocumentHandler::view"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">DocumentHandler::view           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a00096.html">Container</a> $&nbsp;</td>
          <td class="mdname" nowrap> <em>parent</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>$&nbsp;</td>
          <td class="mdname" nowrap> <em>uri</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Opens a document for viewing.<p>
Your implementation should open the document specified with the given <code>uri</code> and should create the document viewer as a child widget, formatted as an Aukyla XML document.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>parent</em>&nbsp;</td><td>The parent widget to which the <a class="el" href="a00103.html">DocumentViewer</a> is added. Any children you add to the parent are shown by the <a class="el" href="a00103.html">DocumentViewer</a>. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>uri</em>&nbsp;</td><td><a class="el" href="a00163.html">URI</a> to the document to be opened.</td></tr>
  </table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00102.html#e0">supportsViewing()</a></dd></dl>

<p>
Definition at line <a class="el" href="a00214.html#l00083">83</a> of file <a class="el" href="a00214.html">DocumentHandler.php</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="a00214.html">DocumentHandler.php</a></ul>
    </div>
  </body>
</html>
Return current item: Aukyla Document Management System