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

Class: ManifestDocument

Source Location: /manifest/ManifestDocument.php

Class Overview

DOMDocument
   |
   --AbstractDocument
      |
      --ManifestDocument

ManifestDocument class


Author(s):

  • Norman Markgraf (nmarkgraf(at)user.sourceforge.net)

Version:

  • $Revision: 182 $

Copyright:

  • Copyright in 2006, 2007 by The OpenDocumentPHP Team

Constants

Methods


Inherited Constants

Inherited Variables

Inherited Methods

Class: 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.

Class Details

[line 68]
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>

$Id: ManifestDocument.php 182 2007-06-11 13:32:34Z nmarkgraf $




Tags:

author:  Norman Markgraf (nmarkgraf(at)user.sourceforge.net)
version:  $Revision: 182 $
copyright:  Copyright in 2006, 2007 by The OpenDocumentPHP Team
todo:  We need to support encryption data.
todo:  Also we need to support the optional size part.
since:  0.5.0 - 08.02.2007
license:  GNU General Public License 2.0.


[ Top ]


Class Methods


constructor __construct [line 93]

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

Constructor



Tags:

since:  0.5.0 - 08.02.2007
access:  public


Overrides AbstractDocument::__construct() (Constructor method.)

Parameters:

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

[ Top ]

method addFileEntry [line 171]

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.




Tags:

since:  0.5.0 - 08.02.2007
access:  public


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.

[ Top ]

method getFileEntry [line 198]

void getFileEntry( $fullpath)

Get File Entry



Tags:

since:  0.5.0 - 08.02.2007
access:  public


Parameters:

   $fullpath  

[ Top ]

method getFilelist [line 215]

void getFilelist( )



Tags:

since:  0.5.0 - 08.02.2007
access:  public


[ Top ]

method getMimeType [line 267]

string getMimeType( )

Returns mime type of the archive.



Tags:

return:  Mime type of this archive
since:  0.5.0 - 08.02.2007
access:  public


[ Top ]

method load [line 317]

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.




Tags:

since:  0.5.0 - 08.02.2007
access:  public


Parameters:

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

[ Top ]

method loadXML [line 299]

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.




Tags:

since:  0.5.0 - 08.02.2007
access:  public


Parameters:

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

[ Top ]

method removeFileEntry [line 183]

void removeFileEntry( string $fullpath)

Remove a full path from this manifest document.



Tags:

since:  0.5.0 - 08.02.2007
access:  public


Parameters:

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

[ Top ]

method renameFileEntry [line 237]

void renameFileEntry( string $fullpath, string $newfullpath)

Rename a file name entry in this manifest document.



Tags:

since:  0.5.0 - 08.02.2007
access:  public


Parameters:

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

[ Top ]

method setMimeType [line 256]

void setMimeType( string $mimetype)

Set mime type of the archive.



Tags:

since:  0.5.0 - 08.02.2007
access:  public


Parameters:

string   $mimetype   mimetype New mime type of this archive.

[ Top ]

method _setRoot [line 107]

void _setRoot( [ $documentRoot = 0])



Tags:

access:  protected


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

Parameters:

   $documentRoot  

[ Top ]


Class Constants

odmDOCTYPE =  '<!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd">'

[line 72]

Doctype information for Manifest DOM documents


[ Top ]

odmROOT =  'manifest:manifest'

[line 76]

Root Tag for Mainifest DOM documents


[ Top ]



Documentation generated on Tue, 12 Jun 2007 10:00:04 +0200 by phpDocumentor 1.3.2