pear:packages:opendocument

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
pear:packages:opendocument [2011/08/24 02:14] – Some initial notes. samwilsonpear:packages:opendocument [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 3: Line 3:
 ^ Current version:   | 0.2.0 (alpha) was released on 2009-07-28 | ^ Current version:   | 0.2.0 (alpha) was released on 2009-07-28 |
 ^ Source repository: | https://github.com/pear/OpenDocument | ^ Source repository: | https://github.com/pear/OpenDocument |
 +^ Bug tracker:       | [[http://pear.php.net/bugs/search.php?cmd=display&package_name[]=OpenDocument]] |
  
 OpenDocument is a package to create, read and update [[http://en.wikipedia.org/wiki/OpenDocument|Open Document Format]] files.  ODF is an XML-based file format for office  documents such as spreadsheets, charts, presentations and word processing documents, with a standardised specification as an //OASIS Committee Specification// ([[http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html|v.1.2]]) and //ISO/IEC 26300:2006// (v.1.0 with v.1.1 currently a Draft Amendment).  The former specification is the most recently updated, is publicly available, and is the one we're working from for this PEAR package. OpenDocument is a package to create, read and update [[http://en.wikipedia.org/wiki/OpenDocument|Open Document Format]] files.  ODF is an XML-based file format for office  documents such as spreadsheets, charts, presentations and word processing documents, with a standardised specification as an //OASIS Committee Specification// ([[http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html|v.1.2]]) and //ISO/IEC 26300:2006// (v.1.0 with v.1.1 currently a Draft Amendment).  The former specification is the most recently updated, is publicly available, and is the one we're working from for this PEAR package.
Line 70: Line 71:
   * [[http://cvs.php.net/viewvc.cgi/pear/OpenDocument/examples/create.php?view=markup]]   * [[http://cvs.php.net/viewvc.cgi/pear/OpenDocument/examples/create.php?view=markup]]
   * https://github.com/pear/OpenDocument/blob/master/examples/create.php   * https://github.com/pear/OpenDocument/blob/master/examples/create.php
 +
 +===== Future Development =====
 +
 +Some notes about possibilities for the further development of this package...
 +
 +  * ''OpenDocument_Element'' to be a sub-class of ''DOMElement'';
 +  * All elements to be sub-classes of ''OpenDocument_Element'', grouped by namespace;
 +  * The five root elements to be subclasses of ''DOMDOcument'' (these get used only by the storage class, usually);
 +  * Each of the seven ODF document types to be represented by ''OpenDocument'' sub-classes (these are the primary means of using the API).
 +  * The ''OpenDocument'' class is the means of interacting with the eight second-level elements (office:automatic-styles, office:body, office:font-face-decls, office:master-styles, office:meta, office:scripts, office:settings, and office:styles)
 +  * A couple of use cases:
 +    * <code php>
 +      // A new text document, saved.
 +      $textDoc = new OpenDocument_Text();
 +      $heading = new OpenDocument_Element_Text_H();
 +      $heading->textContent = 'Hello World';
 +      $textDoc->getBody()->insertBefore($heading, null);
 +      $textDoc->save('hello.odt');
 +      </code>
 +    * <code php>
 +      // An existing spreadsheet, as a stand-alone file.
 +      $spreadsheet = new OpenDocument_Spreadsheet('existing.ods');
 +      $spreadsheet->setStorage(new OpenDocument_Storage_Single());
 +      $spreadsheet->save();
 +      </code>
 +    * There will be additional convenience methods at various levels, things like ''$spreadsheet->getTable(1)->addRows($dataArray)'' and ''$textDoc->toHtml()''.
 +
 +The (incomplete) hierarchy would then be along these lines:
 +
 +^Super-class            ^ Class                                        ^ Sub-class                          |
 +|                       | OpenDocument                                 | OpenDocument_Chart                 |
 +|                                                                    | OpenDocument_Database              |
 +|                                                                    | OpenDocument_Drawing               |
 +|                                                                    | OpenDocument_Image                 |
 +|                                                                    | OpenDocument_Presentation          |
 +|                                                                    | OpenDocument_Spreadsheet           |
 +|                                                                    | OpenDocument_Text                  |
 +|                       | OpenDocument_Storage                         | OpenDocument_Storage_Single                 |
 +|                                                                    | OpenDocument_Storage_Zip                    |
 +|                                                                    | OpenDocument_Storage_ZipManifest            |
 +| DOMDocument           | OpenDocument_Element_Office_Document                                                     |
 +|                       | OpenDocument_Element_Office_DocumentContent  |                                             |
 +|                       | OpenDocument_Element_Office_DocumentStyles                                               |
 +|                       | OpenDocument_Element_Office_DocumentMeta                                                 |
 +|                       | OpenDocument_Element_Office_DocumentSettings |                                             |
 +| PEAR_Exception        | OpenDocument_Exception                                                                   |
 +| DOMElement            | OpenDocument_Element                         | OpenDocument_Element_Office_AutomaticStyles |
 +|                                                                    | OpenDocument_Element_Office_FontFaceDecls   |
 +|                                                                    | OpenDocument_Element_Office_MasterStyles    |
 +|                                                                    | OpenDocument_Element_Office_Meta            |
 +|                                                                    | OpenDocument_Element_Office_Scripts         |
 +|                                                                    | OpenDocument_Element_Office_Settings        |
 +|                                                                    | OpenDocument_Element_Office_Styles          |
 +|                                                                    | //OpenDocument_Element_Office_Chart//           |
 +|                                                                    | //OpenDocument_Element_Office_Database//        |
 +|                                                                    | //OpenDocument_Element_Office_Drawing//         |
 +|                                                                    | //OpenDocument_Element_Office_Image//           |
 +|                                                                    | //OpenDocument_Element_Office_Presentation//    |
 +|                                                                    | //OpenDocument_Element_Office_Spreadsheet//     |
 +|                                                                    | //OpenDocument_Element_Office_Text//            |
 +|                                                                    | OpenDocument_Element_Office_Forms           |
 +|                                                                    | OpenDocument_Element_Dr3d_Scene             |
 +|                                                                    | OpenDocument_Element_Draw_A                 |
 +|                                                                    | OpenDocument_Element_Draw_Caption           |
 +|                                                                    | OpenDocument_Element_Draw_Circle            |
 +|                                                                    | OpenDocument_Element_Draw_Connector         |
 +|                                                                    | OpenDocument_Element_Draw_Control           |
 +|                                                                    | OpenDocument_Element_Draw_Custom-shape      |
 +|                                                                    | OpenDocument_Element_Draw_Ellipse           |
 +|                                                                    | OpenDocument_Element_Draw_Frame             |
 +|                                                                    | OpenDocument_Element_Draw_G                 |
 +|                                                                    | OpenDocument_Element_Draw_Line              |
 +|                                                                    | OpenDocument_Element_Draw_Measure           |
 +|                                                                    | OpenDocument_Element_Draw_PageThumbnail     |
 +|                                                                    | OpenDocument_Element_Draw_Path              |
 +|                                                                    | OpenDocument_Element_Draw_Polygon           |
 +|                                                                    | OpenDocument_Element_Draw_Polyline          |
 +|                                                                    | OpenDocument_Element_Draw_Rect               |
 +|                                                                    | OpenDocument_Element_Draw_RegularPolygon     |
 +|                                                                    | OpenDocument_Element_Table_CalculationSettings     |
 +|                                                                    | OpenDocument_Element_Table_Consolidation     |
 +|                                                                    | OpenDocument_Element_Table_ContentValidations     |
 +|                                                                    | OpenDocument_Element_Table_DatabaseRanges     |
 +|                                                                    | OpenDocument_Element_Table_DataPilotTables     |
 +|                                                                    | OpenDocument_Element_Table_DdeLinks     |
 +|                                                                    | OpenDocument_Element_Table_LabelRanges     |
 +|                                                                    | OpenDocument_Element_Table_namedExpressions     |
 +|                                                                    | OpenDocument_Element_Table_Table                        |
 +|                                                                    | OpenDocument_Element_Text_AlphabeticalIndex             |
 +|                                                                    | OpenDocument_Element_Text_AlphabeticalIndexAutoMarkFile |
 +|                                                                    | OpenDocument_Element_Text_Bibliography     |
 +|                                                                    | OpenDocument_Element_Text_Change     |
 +|                                                                    | OpenDocument_Element_Text_ChangeEnd     |
 +|                                                                    | OpenDocument_Element_Text_ChangeStart     |
 +|                                                                    | OpenDocument_Element_Text_DdeConnectionDecls     |
 +|                                                                    | OpenDocument_Element_Text_H     |
 +|                                                                    | OpenDocument_Element_Text_IllustrationIndex     |
 +|                                                                    | OpenDocument_Element_Text_List     |
 +|                                                                    | OpenDocument_Element_Text_NumberedParagraph     |
 +|                                                                    | OpenDocument_Element_Text_ObjectIndex     |
 +|                                                                    | OpenDocument_Element_Text_P     |
 +|                                                                    | OpenDocument_Element_Text_PageSequence     |
 +|                                                                    | OpenDocument_Element_Text_Section     |
 +|                                                                    | OpenDocument_Element_Text_SequenceDecls     |
 +|                                                                    | OpenDocument_Element_Text_SoftPageBreak     |
 +|                                                                    | OpenDocument_Element_Text_TableIndex     |
 +|                                                                    | OpenDocument_Element_Text_TableOfContent     |
 +|                                                                    | OpenDocument_Element_Text_TrackedChanges     |
 +|                                                                    | OpenDocument_Element_Text_UserFieldDecls     |
 +|                                                                    | OpenDocument_Element_Text_UserIndex     |
 +|                                                                    | OpenDocument_Element_Text_VariableDecls |
 +|                                                                    | //And so on, for all elements...//            |
 +
  
pear/packages/opendocument.1314152061.txt.gz · Last modified: 2017/09/22 13:28 (external edit)