[prev in list] [next in list] [prev in thread] [next in thread] 

List:       calligra-devel
Subject:    Re: Review Request 109393: a new library for traversing odf files and a new export filter
From:       "Inge Wallin" <inge () lysator ! liu ! se>
Date:       2013-03-18 18:39:43
Message-ID: 20130318183943.30513.51131 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/109393/
-----------------------------------------------------------

(Updated March 18, 2013, 6:39 p.m.)


Review request for Calligra.


Changes
-------

This is version 4 of this patch.  Changes:

 - Simplified the backend API.  It's now only one callback function per tag and an \
                added parameter that tells if it's the start or the end of the tag.
 - Put the Context in it's own file.
 - Heavily extended the comments and made Doxygen class documentations from the \
expanded ones.

I know that this is not the final solution. This library is going to see more \
development, especially in the table and frame departments. I am also open to change \
into using a QXmlStreamReader based approach. However, I think that the current code \
is good enough to merge now and further development should be based on some real \
usecase, e.g. the docx export filter that is the target for this library. The first \
version is only going to export text and simple formatting and for that it's good \
enough already.


Description
-------

This patch creates a new library in filters/odftraverse. The purpose of this library \
is to create classes to make it easier to create export filters for ODF files. What \
you do to use this library is that you inherit a base class for backends to this \
parser / traverser and in the many callbacks you write the output that is relevant \
for your output format.

To show how it can be used I have also created a very simple proof of concept filter \
that exports to text format, something Calligra actually lacked before.

The current implementation traverses only ODT files and there are still a number of \
NYI functions that I want to finish before the actual merge. But I thought I'd get \
some opinions early. In other words, I expect at least one, maybe two iterations \
before this branch can be merged.


Diffs (updated)
-----

  filters/CMakeLists.txt 8bcd640 
  filters/libodftraverse/CMakeLists.txt PRE-CREATION 
  filters/libodftraverse/OdfParser.h PRE-CREATION 
  filters/libodftraverse/OdfParser.cpp PRE-CREATION 
  filters/libodftraverse/OdfTraverserContext.h PRE-CREATION 
  filters/libodftraverse/OdfTraverserContext.cpp PRE-CREATION 
  filters/libodftraverse/OdtTraverser.h PRE-CREATION 
  filters/libodftraverse/OdtTraverser.cpp PRE-CREATION 
  filters/libodftraverse/OdtTraverserBackend.h PRE-CREATION 
  filters/libodftraverse/OdtTraverserBackend.cpp PRE-CREATION 
  filters/libodftraverse/odftraverse_export.h PRE-CREATION 
  filters/words/ascii/AsciiExport.h PRE-CREATION 
  filters/words/ascii/AsciiExport.cpp PRE-CREATION 
  filters/words/ascii/CMakeLists.txt d36de47 
  filters/words/ascii/OdtTraverserAsciiBackend.h PRE-CREATION 
  filters/words/ascii/OdtTraverserAsciiBackend.cpp PRE-CREATION 
  filters/words/ascii/TODO ceb1a24 
  filters/words/ascii/words_ascii_export.desktop PRE-CREATION 

Diff: http://git.reviewboard.kde.org/r/109393/diff/


Testing
-------

Tested with a lengthy text file.


Thanks,

Inge Wallin


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/109393/">http://git.reviewboard.kde.org/r/109393/</a>
  </td>
    </tr>
   </table>
   <br />




<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for Calligra.</div>
<div>By Inge Wallin.</div>


<p style="color: grey;"><i>Updated March 18, 2013, 6:39 p.m.</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">This is version 4 of this patch.  Changes:

 - Simplified the backend API.  It&#39;s now only one callback function per tag and \
                an added parameter that tells if it&#39;s the start or the end of the \
                tag.
 - Put the Context in it&#39;s own file.
 - Heavily extended the comments and made Doxygen class documentations from the \
expanded ones.

I know that this is not the final solution. This library is going to see more \
development, especially in the table and frame departments. I am also open to change \
into using a QXmlStreamReader based approach. However, I think that the current code \
is good enough to merge now and further development should be based on some real \
usecase, e.g. the docx export filter that is the target for this library. The first \
version is only going to export text and simple formatting and for that it&#39;s good \
enough already.</pre>  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">This patch creates a new library in filters/odftraverse. The purpose of \
this library is to create classes to make it easier to create export filters for ODF \
files. What you do to use this library is that you inherit a base class for backends \
to this parser / traverser and in the many callbacks you write the output that is \
relevant for your output format.

To show how it can be used I have also created a very simple proof of concept filter \
that exports to text format, something Calligra actually lacked before.

The current implementation traverses only ODT files and there are still a number of \
NYI functions that I want to finish before the actual merge. But I thought I&#39;d \
get some opinions early. In other words, I expect at least one, maybe two iterations \
before this branch can be merged.</pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Tested with a lengthy text file.</pre>  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> \
(updated)</h1> <ul style="margin-left: 3em; padding-left: 0;">

 <li>filters/CMakeLists.txt <span style="color: grey">(8bcd640)</span></li>

 <li>filters/libodftraverse/CMakeLists.txt <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>filters/libodftraverse/OdfParser.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>filters/libodftraverse/OdfParser.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>filters/libodftraverse/OdfTraverserContext.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>filters/libodftraverse/OdfTraverserContext.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>filters/libodftraverse/OdtTraverser.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>filters/libodftraverse/OdtTraverser.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>filters/libodftraverse/OdtTraverserBackend.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>filters/libodftraverse/OdtTraverserBackend.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>filters/libodftraverse/odftraverse_export.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>filters/words/ascii/AsciiExport.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>filters/words/ascii/AsciiExport.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>filters/words/ascii/CMakeLists.txt <span style="color: \
grey">(d36de47)</span></li>

 <li>filters/words/ascii/OdtTraverserAsciiBackend.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>filters/words/ascii/OdtTraverserAsciiBackend.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>filters/words/ascii/TODO <span style="color: grey">(ceb1a24)</span></li>

 <li>filters/words/ascii/words_ascii_export.desktop <span style="color: \
grey">(PRE-CREATION)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/109393/diff/" style="margin-left: \
3em;">View Diff</a></p>







  </td>
 </tr>
</table>




  </div>
 </body>
</html>



_______________________________________________
calligra-devel mailing list
calligra-devel@kde.org
https://mail.kde.org/mailman/listinfo/calligra-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic