tag:blogger.com,1999:blog-41779462977204316802024-03-21T22:12:27.922-07:00GSoC 2014 - Outliner for Calligra AuthorAnonymoushttp://www.blogger.com/profile/16265932691559800151noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-4177946297720431680.post-22799009649988929532014-08-18T11:07:00.002-07:002014-08-18T12:09:06.072-07:00Author Outliner progressSo GSoC 2014 is ending and I were hurrying up to introduce more features to the outliner (<a href="http://calligra-author-outliner.blogspot.ru/2014/06/calligra-words-and-author-section.html">read more</a>). My project was to implement an outliner for the Calligra Author. This app is based on Words and should be an ideal tool for writing books. It has support of exporting your creation to different mobile formats, like EPub. But there is no way to write a plan for your work in the app. For example, novelists need to add a descriptions of the story actors and refer them during writing. That is why Author need an outliner.<br />
<br />
The biggest problems I tackled on the last stage of work were in the RDF implementation in Calligra and my understanding of RDF.<br />
<br />
At first I was struggling with an XML-style writing of objects. Such way of storing RDF easily hides actual RDF-triples it has. For example:<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><cau:Section rdf:about="someuri"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <cau:descr>Some description</cau:descr></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"></cau:Section></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>This hides 2 triples (one with rdf:type isn't obvious for me):<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><someuri> rdf:type cau:Section</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><someuri> cau:descr "Some description"</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: inherit;">Maybe it doesn't look too complicated, but if you're newbie in RDF I </span>recommend<span style="font-family: inherit;"> to read all the basic documentation for RDF that is available on the Internet, especially RDF XML Syntax helped me a lot.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">And if you want to register a custom file to be saved inside ODT package you can add such triples to manifest.rdf (all this done through KoDocumentRdf class in Calligra and a special manifest context that you can retrieve with this class)</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><filenode> rdf:type odf:MetaDataFile</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><filenode> pkg:path "filename.rdf"</span><br />
<br />
and then use resource node with url:<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">KoDocumentRdf::rdfPathContextPrefix() + "filename.rdf"</span><br />
<br />
as a context for the triples you want to put on this file. And don't forget that modification of RDF doesn't make Author or Words to mark your document as changed. So it is possible that changes will be lost. So it is necessary to modify this flag from code (see KWDocument::setModified(bool) method).<br />
<br />
Now, I have a full understanding of all technical parts of storing metadata for the outliner. As I said, the plan was to save all the notes, descriptions, created when you are planning, as RDF metadata. It is open format and openDocument supports it. So it will be possible to open any ODT file with Author to work with it, then the saved version could be used outside Author (of course if this another app supports RDF and will not remove Author metadata from package).<br />
<br />
By now you can edit Section's data: add descriptions, change its state (draft, edit or finished).<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgouTqCRgL5WRKdSol1bA803yyda9lc9vKf1MUO18Ohs81BevikHZAbYJu_5y-aBS2ReYIP-wP6CyTxPbrMAj60a1QrcdvuYRbyK9wU-8LRImiMedhS_pneEgD2zj-iRkBR1UiuRMchSGZZ/s1600/outliner-blog-18.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgouTqCRgL5WRKdSol1bA803yyda9lc9vKf1MUO18Ohs81BevikHZAbYJu_5y-aBS2ReYIP-wP6CyTxPbrMAj60a1QrcdvuYRbyK9wU-8LRImiMedhS_pneEgD2zj-iRkBR1UiuRMchSGZZ/s1600/outliner-blog-18.png" height="320" width="266" /></a></div>
<br />
<br />
I can't say that the outliner is finished, but I have done much of work improving sections support (which I weren't planning at the beginning of GSoC), that is needed to implement outliner. And while working on outliner, I found that some aspects of sections implementation should be improved (I want to introduce a special section model for easy integration of it to any view). So there is many work to do and definitely I won't stop with GSoC and will continue working on Calligra. And I would be glad to work with the Calligra team at GSoC 2015.<br />
<br />Anonymoushttp://www.blogger.com/profile/16265932691559800151noreply@blogger.com0tag:blogger.com,1999:blog-4177946297720431680.post-67972484874560929412014-07-06T05:34:00.001-07:002014-07-06T05:34:49.744-07:00Final updates to section implementationAs I have <a href="http://calligra-author-outliner.blogspot.ru/2014/06/calligra-words-and-author-section.html">mentioned earlier</a>, sections API is essential part for outliner's implemenation. And now I am ending with basic functionality of it. Indication of sections for multipage documents is fixed. New <i>KoSectionManager</i> is introduced to handle all sections in the document and updating information about them. So here is visible for user changes.<br />
<br />
I have picked up better icons for "New section" button and fresh-added "Configure sections" commands:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivQpvpLODSI977XfIvgW8ztzU2536alWJlnMR-W3Zpdofof1kkD_tYxvdBsBire2P-4dDvN8h6VwXbzmvjel5vT7QaGMVAvCHCpVAQ9CxpuVcbAVf49rsYqZfcZNHqYjJYg4RPSAaGmmzu/s1600/sections-blog-14.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivQpvpLODSI977XfIvgW8ztzU2536alWJlnMR-W3Zpdofof1kkD_tYxvdBsBire2P-4dDvN8h6VwXbzmvjel5vT7QaGMVAvCHCpVAQ9CxpuVcbAVf49rsYqZfcZNHqYjJYg4RPSAaGmmzu/s1600/sections-blog-14.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Rightmost two buttons is "New section" and "Configure sections"</td></tr>
</tbody></table>
<div>
That's how "Configure sections" dialog looks:</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgLtYFdxzMrzCtWmMoacIHQGa8S34ZsfmvMKspLdyKiT86VztVMDYQoZUXQbXSzHLQQZCibsE-Eq7aU0FJNu405pmCSwWxUanHFPD8s5eLYdqIbiO2SsHSKGDq5BicN_q6L5BwJEHXlNWh/s1600/sections-blog-15.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgLtYFdxzMrzCtWmMoacIHQGa8S34ZsfmvMKspLdyKiT86VztVMDYQoZUXQbXSzHLQQZCibsE-Eq7aU0FJNu405pmCSwWxUanHFPD8s5eLYdqIbiO2SsHSKGDq5BicN_q6L5BwJEHXlNWh/s1600/sections-blog-15.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">On the left you can see sections tree, and sections parameters on the right part of dialog. </td></tr>
</tbody></table>
<div>
Only basic "Section name" parameter is present. I hope future development will lead to a new features will be added, and this dialog will be populated with new items.</div>
<div>
<br /></div>
<div>
Sections changes now are fully integrated with undo menu. You can undo/redo every insertion and renaming of sections:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrPTgrE1U_WiRrfYJaMIPKDsZMXh3CcLa7nMVkZoAtmBFJ_MfZWmL-lEFT1mv0yYVU5tt7WVfwIKGa195Jr_oHdZ5RhBSkmW9XmUCqDNHJLBzlTERP6GTzYqVnsud1mD_KFuaaebSI_H11/s1600/sections-blog-16.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrPTgrE1U_WiRrfYJaMIPKDsZMXh3CcLa7nMVkZoAtmBFJ_MfZWmL-lEFT1mv0yYVU5tt7WVfwIKGa195Jr_oHdZ5RhBSkmW9XmUCqDNHJLBzlTERP6GTzYqVnsud1mD_KFuaaebSI_H11/s1600/sections-blog-16.png" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaM7pHLtDfcZOUj1u8ILnkk6Y41KbG5GXkhP64EYrdobgY3p-7EMG0h1SDoEiwo5kqQYiAhBup1Pqf3FLu9ZeuDeHbdN_KhOz2Gu0yEXh9shBAnvuD91G0r5WAUy7BKis4PY3E9X74MqO_/s1600/sections-blog-17.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaM7pHLtDfcZOUj1u8ILnkk6Y41KbG5GXkhP64EYrdobgY3p-7EMG0h1SDoEiwo5kqQYiAhBup1Pqf3FLu9ZeuDeHbdN_KhOz2Gu0yEXh9shBAnvuD91G0r5WAUy7BKis4PY3E9X74MqO_/s1600/sections-blog-17.png" /></a></div>
<div>
Now I can start working on outliner. And all this changes are gonna be merged to master after unit-tests will be added.</div>
Anonymoushttp://www.blogger.com/profile/16265932691559800151noreply@blogger.com0tag:blogger.com,1999:blog-4177946297720431680.post-58168924091661296982014-06-23T04:05:00.000-07:002014-06-23T04:05:39.614-07:00Section handling progressIt's the middle of the GSoC 2014 and <a href="http://calligra-author-outliner.blogspot.ru/2014/06/calligra-words-and-author-section.html">my work on section handling</a> isn't stopping. And I have some things to show you.<div>
<br /></div>
<div>
New indication of sections is implemented, I decided to use grey horizontal brackets that denotes starts and ends of the sections. Also they can stack like on "sdlfnglkn" paragraph on picture, so you will not miss multiple sections that end at one place. Margin of brackets from the borders denotes section level: the deeper it is the more margin is added.</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW_zuu6m311khVAPjbLr8bLAL2ZG4qeaKdF3sxGNzwNc_8j4sYdRW657OLO23imqBOUJvOP9onLR38VzweIcb2FAnXUln7EDPiJaHnUDa_bnD5hoS98DPFXDv2kVzgEoeFLtc1pvvidGHf/s1600/sections-blog-10.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW_zuu6m311khVAPjbLr8bLAL2ZG4qeaKdF3sxGNzwNc_8j4sYdRW657OLO23imqBOUJvOP9onLR38VzweIcb2FAnXUln7EDPiJaHnUDa_bnD5hoS98DPFXDv2kVzgEoeFLtc1pvvidGHf/s1600/sections-blog-10.png" height="235" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">New section indication.</td></tr>
</tbody></table>
<div>
And, of course, now you can toggle this thing off the same way you are turning off formatting characters.</div>
<div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM0pbeJKXuzJ3f1qa9mSoVl3lANItZIShpYP4j-Iac-U_Rsy3vmWucfcsr7jHnu_0jGCoANQm4UY8P0qW506orXIARFqLY5R6ZrjqQfcsEcJkVzjKWUgntQ7YEkbjkruLTgy0DJvcy5Y7P/s1600/sections-blog-11.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM0pbeJKXuzJ3f1qa9mSoVl3lANItZIShpYP4j-Iac-U_Rsy3vmWucfcsr7jHnu_0jGCoANQm4UY8P0qW506orXIARFqLY5R6ZrjqQfcsEcJkVzjKWUgntQ7YEkbjkruLTgy0DJvcy5Y7P/s1600/sections-blog-11.png" height="320" width="204" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Look at the 4th checkable option.</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Also the bug of section indication in table is fixed. Below you can see sections in the second and the third cells.</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsUe4sE3uQZLl3Gv_cVZlzyCMusCchMKxr3lEYACzIyAUdbMs-Zy4DuIyvfb1g6FdON82CLcQExJVGfVmDKMwJFK7lVr_chLsCdRcPxqD3PxfNcBkx00nG1y7OjaAUmuFs1yl5GRe7OfI1/s1600/sections-blog-12.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsUe4sE3uQZLl3Gv_cVZlzyCMusCchMKxr3lEYACzIyAUdbMs-Zy4DuIyvfb1g6FdON82CLcQExJVGfVmDKMwJFK7lVr_chLsCdRcPxqD3PxfNcBkx00nG1y7OjaAUmuFs1yl5GRe7OfI1/s1600/sections-blog-12.png" height="253" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Fixed indication in tables</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: left;">
Also the ability to insert section is implemented. I'm <a href="http://forum.kde.org/viewtopic.php?f=285&t=121713">working now</a> with Visual Design Group to paint/choose appropriate icon for it.</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRX6qALye0pLW75nQvlff6ygLjRghgPnNtYDIS-HpNPsyLf7FsB1zh5kP0M7j8Y9Rpar2Gos9m_18DYSYUTiVdhgJ27kyCO7ebe9ReUN2jjcXnlcUBMEI4YvXcDi6G2ySoWRj-Mxk0pJm7/s1600/sections-blog-13.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRX6qALye0pLW75nQvlff6ygLjRghgPnNtYDIS-HpNPsyLf7FsB1zh5kP0M7j8Y9Rpar2Gos9m_18DYSYUTiVdhgJ27kyCO7ebe9ReUN2jjcXnlcUBMEI4YvXcDi6G2ySoWRj-Mxk0pJm7/s1600/sections-blog-13.png" height="170" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Look at the "B" on the bottom. It is "New section" functionality. Search for the new icon is in progress.</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/16265932691559800151noreply@blogger.com0tag:blogger.com,1999:blog-4177946297720431680.post-28989817814640838172014-06-04T08:19:00.001-07:002014-06-04T08:42:43.080-07:00Calligra Words and Author section handling state.<a href="https://www.google-melange.com/gsoc/homepage/google/gsoc2014">GSoC 2014</a> is running and I am working now on implementing <a href="https://en.wikipedia.org/wiki/Outliner">outliner</a> for Calligra Author.<br />
<br />
Calligra Author is a special application to make creating novels and textbooks, those are usually big in size and require some specific tools during their creation to help their authors. As planned, Author should support <a href="http://ingwa2.blogspot.se/2013/08/calligra-author-next-step.html">4 basic steps</a> of developing a book:<br />
<br />
<ol>
<li>Concept and Planning</li>
<li>Writing</li>
<li>Review</li>
<li>Publishing</li>
</ol>
<br />
The last 3 phases are already present in Author as a set of really helpful features. The goal of this project is to implement the tools for the first step and implement an outliner. It should support organizing scenes into some hierarchy and store additional data for them. You write each scene separately and define actors, items, time and date, etc. for it. Then outliner help you to check that all is consistent. You can see, for example, when some actor first time appears.<br />
<br />
So I plan to use RDF meta-data to save outliner info and use openDocument sections to mark heirarchy of scenes.<br />
<br />
I've started from implementing section handling. When I started to work on project, I found that current Calligra Words doesn't support sections at all (you can only open and without changing save document with sections). Fixing this is a first step for me and I'm still struggling with it, but have some results.<br />
<br />
Below you can see current state of section boundary indication, it is for debug now, final version will be better.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHqtEOizOqjABcbuM4MxFWnZEVVZ9BLhyCW9Xj4UEpV-G3wn8Tnw4G0y4Hj3tucMr1_ppMhMvrprJu38iiEjDZxebhY92c5jJv6LzELmvGlIxKWYgFITfi3BbXEgxOQetUvbw2Qz8wyMUb/s1600/sections-blog-1.jpeg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHqtEOizOqjABcbuM4MxFWnZEVVZ9BLhyCW9Xj4UEpV-G3wn8Tnw4G0y4Hj3tucMr1_ppMhMvrprJu38iiEjDZxebhY92c5jJv6LzELmvGlIxKWYgFITfi3BbXEgxOQetUvbw2Qz8wyMUb/s1600/sections-blog-1.jpeg" height="200" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Section boundary indication.</td></tr>
</tbody></table>
Next picture shows you how text insertion, deletion and copy-paste works:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie4llQIC1gMqMl5xh9tneMMernSRvmRu-KQA0NGXRkk0L94uRywoINKxz7_eSvT8rv8_KTcCLAmutOr_a0PxJ8LKjbJ1OJFJ2HzdfJI3L2nFWkt-_pZkSjwKpCkiWCCBrEluNhRjstR6YL/s1600/section-blog-action.gif" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie4llQIC1gMqMl5xh9tneMMernSRvmRu-KQA0NGXRkk0L94uRywoINKxz7_eSvT8rv8_KTcCLAmutOr_a0PxJ8LKjbJ1OJFJ2HzdfJI3L2nFWkt-_pZkSjwKpCkiWCCBrEluNhRjstR6YL/s1600/section-blog-action.gif" height="200" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Section handling in action</td></tr>
</tbody></table>
<div>
You can find all the code in words-section-deniskup branch on KDE Git of Calligra. And if you have some ideas or have found some bugs don't hesitate to write me.</div>
<div>
<div>
<br />
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/16265932691559800151noreply@blogger.com0