phpDocumentor OpenDocumentPHP
manifest
[ class tree: OpenDocumentPHP ] [ index: OpenDocumentPHP ] [ all elements ]

Class: ManifestDocument

Source Location: /manifest/ManifestDocument.php

Class ManifestDocument

Class Overview

ManifestDocument class

This class extends DOMDocument to fit a manifest document as it is used by OpenDocumentArchives to store the meta information into it.

Example:

  1.       $manifest new ManifestDocument'application/vnd.oasis.opendocument.text' );
  2.       $manifest->addFileEntry'Configurations2/',
  3.                                   'application/vnd.sun.xml.ui.configuration' );
  4.       $manifest->addFileEntry'content.xml''text/xml' );
This code will create a manifest DOM document as follows:
  1.  <?xml version="1.0" encoding="UTF-8"?>
  2.  <!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN"
  3.                                     "Manifest.dtd">
  4.   <manifest:manifest
  5.             xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0">
  6.     <manifest:file-entry
  7.             manifest:media-type="application/vnd.oasis.opendocument.text"
  8.             manifest:full-path="/"/>
  9.     <manifest:file-entry
  10.            manifest:media-type="application/vnd.sun.xml.ui.configuration"
  11.            manifest:full-path="Configurations2/"/>
  12.     <manifest:file-entry
  13.            manifest:media-type="text/xml"
  14.            manifest:full-path="content.xml"/>
  15.   </manifest:manifest>

Located in /manifest/ManifestDocument.php [line 98]

DOMDocument
   |
   --AbstractDocument
      |
      --ManifestDocument
Author(s):
  • Norman Markgraf (nmarkgraf(at)user.sourceforge.net)
Information Tags:
Version:  Release: @package_version@
Copyright:  Copyright in 2006, 2007 by The OpenDocumentPHP Team
Link:  http://opendocumentphp.org
Todo:  We need to support encryption data.
Todo:  Also we need to support the optional size part.
Since:  0.5.0 - 08. Feb. 2007
License:  GNU General Public License 2.0.

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From AbstractDocument

AbstractDocument::$root
AbstractDocument::$xpath

Inherited From AbstractDocument

AbstractDocument::__construct()
Constructor method.
AbstractDocument::createDCElement()
Create an DOMElement in the DC namespace with tag $tag.
AbstractDocument::createDefaultStyleElement()
Create an ODPElement as '<style:default-style>'.
AbstractDocument::createGraphicPropertiesElement()
Create an ODPElement as '<style:graphic-properties>'.
AbstractDocument::createManifestElement()
Create an DOMElement in the Manifest namespace with tag $tag.
AbstractDocument::createMetaElement()
Create an DOMElement in the Meta namespace with tag $tag.
AbstractDocument::createOfficeElement()
Create an DOMElement in the Office namespace with tag $tag.
AbstractDocument::createParagraphPropertiesElement()
Create an ODPElement as '<style:paragraph-properties>'.
AbstractDocument::createStyleElement()
Create an DOMElement in the Meta namespace with tag $tag.
AbstractDocument::createStyleStyleElement()
Create an ODPElement as '<style:style>'.
AbstractDocument::createTextPropertiesElement()
Create an ODPElement as '<style:text-properties>'.
AbstractDocument::getElementNS()
Retrieve the value of an element by its namespace and tag.
AbstractDocument::initXpath()
Initialize xpath. You must do this before using xpath.
AbstractDocument::loadHTML()
This function is not needed, so we always return false!
AbstractDocument::loadHTMLFile()
This function is not needed, so we always return false!
AbstractDocument::saveHTML()
This function is not needed, so we always return false!
AbstractDocument::saveHTMLFile()
This function is not needed, so we always return false!
AbstractDocument::saveXML()
Dumps the internal XML tree back into a string.
AbstractDocument::_setRoot()
Set the root Element of this document.

[ Top ]
Constant Summary
odmDOCTYPE   Doctype information for Manifest DOM documents
odmROOT   Root Tag for Mainifest DOM documents

[ Top ]
Method Summary
ManifestDocument   __construct()   Constructor
void   addFileEntry()   Add a full path to the file entry list in this manifest document.
void   getFileEntry()   Get File Entry
void   getFilelist()  
string   getMimeType()   Returns mime type of the archive.
void   load()   Loads an XML document from a file.
boolean   loadXML()   Loads an XML document from a string.
void   removeFileEntry()   Remove a full path from this manifest document.
void   renameFileEntry()   Rename a file name entry in this manifest document.
void   setMimeType()   Set mime type of the archive.
void   _setRoot()  

[ Top ]
Methods
Constructor __construct  [line 122]

  ManifestDocument __construct( [string $mimetype = ''], [string $encoding = 'UTF-8']  )

Constructor

Parameters:
string   $mimetype:  mimetype Mime type of the archive
string   $encoding:  encoding Encoding of the manifest file. The default is 'UTF-8'.

API Tags:
Access:  public

Information Tags:
Since:  0.5.0 - 08. Feb. 2007

Redefinition of:
AbstractDocument::__construct()
Constructor method.

[ Top ]
addFileEntry  [line 227]

  void addFileEntry( string $fullpath, string $mimetype, [int $size = -1]  )

Add a full path to the file entry list in this manifest document.

Example:

  1.      $manifest new ManifestDocument();
  2.      ...
  3.      $manifest->addFileEntry('test/feature.xml''text/xml');
  4.      ...

will add

  1.    <manifest-file-entry manifest:full-path="test/feature.xml"
  2.                            manifest:media-type="text/xml" />

to the manifest DOM document.

Parameters:
string   $fullpath:  fullpath The full path of the file that has been added.
string   $mimetype:  mimetype The mime type of this file
int   $size:  size The size of this file.

API Tags:
Access:  public

Information Tags:
Since:  0.5.0 - 08. Feb. 2007

[ Top ]
getFileEntry  [line 254]

  void getFileEntry( $fullpath  )

Get File Entry

Parameters:
   $fullpath: 

API Tags:
Access:  public

Information Tags:
Since:  0.5.0 - 08. Feb. 2007

[ Top ]
getFilelist  [line 271]

  void getFilelist( )


API Tags:
Access:  public

Information Tags:
Since:  0.5.0 - 08. Feb. 2007

[ Top ]
getMimeType  [line 329]

  string getMimeType( )

Returns mime type of the archive.


API Tags:
Return:  Mime type of this archive
Access:  public

Information Tags:
Since:  0.5.0 - 08. Feb. 2007

[ Top ]
load  [line 379]

  void load( string $filename, [int $options = 0]  )

Loads an XML document from a file.

This method may also be called statically to load and create a DOMDocument object. The static invocation may be used when no ManifestDocument properties need to be set prior to loading.

Parameters:
string   $filename:  filename The path to the XML document.
int   $options:  options

API Tags:
Access:  public

Information Tags:
Since:  0.5.0 - 08. Feb. 2007

[ Top ]
loadXML  [line 361]

  boolean loadXML( string $source, [ $options = 0]  )

Loads an XML document from a string.

This method may also be called statically to load and create a ManifestDocument object. The static invocation may be used when no ManifestDocument properties need to be set prior to loading.

Parameters:
string   $source:  source The string containing the XML.
   $options: 

API Tags:
Access:  public

Information Tags:
Since:  0.5.0 - 08. Feb. 2007

[ Top ]
removeFileEntry  [line 239]

  void removeFileEntry( string $fullpath  )

Remove a full path from this manifest document.

Parameters:
string   $fullpath:  fullpath File to remove (given as a full path).

API Tags:
Access:  public

Information Tags:
Since:  0.5.0 - 08. Feb. 2007

[ Top ]
renameFileEntry  [line 293]

  void renameFileEntry( string $fullpath, string $newfullpath  )

Rename a file name entry in this manifest document.

Parameters:
string   $fullpath:  fullpath Old file name (as a full path).
string   $newfullpath:  newfullpath New file name (as a full path).

API Tags:
Access:  public

Information Tags:
Since:  0.5.0 - 08. Feb. 2007

[ Top ]
setMimeType  [line 312]

  void setMimeType( string $mimetype  )

Set mime type of the archive.

Parameters:
string   $mimetype:  mimetype New mime type of this archive.

API Tags:
Access:  public

Information Tags:
Since:  0.5.0 - 08. Feb. 2007

[ Top ]
_setRoot  [line 152]

  void _setRoot( [ $documentRoot = 0]  )

Parameters:
   $documentRoot: 

API Tags:
Access:  protected


Redefinition of:
AbstractDocument::_setRoot()
Set the root Element of this document.

[ Top ]
Constants
odmDOCTYPE = '<!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd">' [line 102]

Doctype information for Manifest DOM documents


[ Top ]
odmROOT = 'manifest:manifest' [line 106]

Root Tag for Mainifest DOM documents


[ Top ]

Documentation generated on Wed, 18 Jun 2008 06:29:28 +0200 by phpDocumentor 1.3.2