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

Class: OpenDocument_Storage

Source Location: /OpenDocument-0.2.1/OpenDocument/Storage.php

Class Overview


Generic OpenDocument data and file storage interface.


Author(s):

Methods


Inherited Variables

Inherited Methods


Class Details

[line 34]
Generic OpenDocument data and file storage interface.

Each storage mechanism needs to implement this interface.

The OpenDocument specification defines two document representations:

  • one single large XML document
  • a ZIP file containing several subdocuments
By providing an implementation agnostic interface, we can easily support both modes.



[ Top ]


Method Detail

addFile   [line 175]

string addFile( string $path, [string $mimetype = null])

Adds a file to the document.

Returns the file name that has to be used to reference the file in the document content.


Parameters:

string   $path   —  File path
string   $mimetype   —  MIME type of the file. Leave it null for auto detection.

[ Top ]

create   [line 52]

void create( string $type, [string $file = null])

Creates a new file.

The file name may be passed, but can be omitted if the final storage location is not known yet.

Storage drivers may choose to create temporary files or directories in case no file name is given here.

  • Throws: OpenDocument_Exception In case creating the given file is not possible.
  • Access: public

Parameters:

string   $type   —  Document type ('text', 'spreadsheet')
string   $file   —  Name of the file to be created

[ Top ]

getContentDom   [line 83]

DOMDocument getContentDom( )

Returns the Dom object containing the content.
  • Access: public

[ Top ]

getMetaDom   [line 90]

DOMDocument getMetaDom( )

Returns the Dom object containing the meta data.
  • Access: public

[ Top ]

getMimeType   [line 76]

string getMimeType( )

Returns the MIME type of the opened file.
  • Return: MIME Type.
  • Access: public

[ Top ]

getSettingsDom   [line 97]

DOMDocument getSettingsDom( )

Returns the Dom object containing the settings.
  • Access: public

[ Top ]

getStylesDom   [line 104]

DOMDocument getStylesDom( )

Returns the Dom object containing the styles.
  • Access: public

[ Top ]

import   [line 200]

void import( OpenDocument_Storage $storage)

Imports data from another storage object
  • Throws: OpenDocument_Exception In case something goes wrong
  • Access: public

Parameters:

OpenDocument_Storage   $storage   —  Storage object

[ Top ]

open   [line 69]

void open( string $file)

Opens the given file.

An implementation might open the zip file or verify that the file itself exists.


Parameters:

string   $file   —  Path of the file to open.

[ Top ]

removeFile   [line 187]

void removeFile( string $relpath)

Removes an already added file from the document.

Parameters:

string   $relpath   —  Relative path that was returned by addFile()

[ Top ]

save   [line 119]

void save( [string $file = null])

Saves the file as the given file name.

Parameters:

string   $file   —  Path of the file to open.

[ Top ]

setContentDom   [line 129]

void setContentDom( DOMDocument $content)

Sets the DOM object containing the content.

<office:document-content>

  • Access: public

Parameters:

DOMDocument   $content   —  Content object

[ Top ]

setMetaDom   [line 139]

void setMetaDom( DOMDocument $meta)

Sets the DOM object containing the meta data.

<office:document-meta>

  • Access: public

Parameters:

DOMDocument   $meta   —  Meta object

[ Top ]

setSettingsDom   [line 149]

void setSettingsDom( DOMDocument $settings)

Sets the DOM object containing the settings.

<office:document-settings>

  • Access: public

Parameters:

DOMDocument   $settings   —  Settings object

[ Top ]

setStylesDom   [line 159]

void setStylesDom( DOMDocument $styles)

Sets the DOM object containing the styles..

<office:document-styles>

  • Access: public

Parameters:

DOMDocument   $styles   —  Styles object

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:51:01 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.