Coder Social home page Coder Social logo

eellak / gsoc2018-librecust Goto Github PK

View Code? Open in Web Editor NEW
13.0 10.0 2.0 64.84 MB

LibreOffice customization and creation of legal Templates

Home Page: https://eellak.github.io/gsoc2018-librecust/

License: GNU General Public License v3.0

Shell 5.95% Python 94.05%
libreoffice libreoffice-extension legal-templates page numbering basic macro libreoffice-customization lo-customization gsoc

gsoc2018-librecust's Introduction

LibreOffice customization and creation of legal Templates - librecust

Welcome to Google Summer of Code 2018 project LibreOffice customization and creation of legal Templates (or librecust). The project is adding open source software in employee's workflow, applying currently on Greek legal services (mainly on The Council of State and extending to other services such "Administrative Court of Appeal" departments).

Overview

Brief description

Project outline

This GSOC project, librecust, includes the following substeps:

  • Development of specific menu, UI customizations and extensions(add-ons) to achieve MS Office familiar interface without undermining LO functionality.
  • Creation of extensions to automate editing and creation of Greek legal documents as an alternative to template usage in services that do not follow a standardized document format, in order to introduce LO mechanisms as a tool for Greek Public Services.
  • Documentation of LO customization and extension development as well as development of deployment approaches for real case scenarios (testing on Specific Court Department (The Council of State) with multiple active workstations)

This project was suggested by GFOSS - Open Technologies Alliance in the context of Google Summer of Code 2018.

UI customization

  • Menubar

Users have developed MS Office related muscle memory while using this tool. LO includes a superset of MS Office functionality so we reorder all menubar options while including each additional in another submenu.

  • Toolbar

The corresponding, in terms of MS Office functionality, toolbar items are included with similar appearance (small icon size is defined as default (MS Office 2003) with similar icons) while leaving space for additional buttons relative to the extension development. The icon set included in the set of modifications is created by @charliecnr.

Simple basic macros to inspect and access certain sub-menus (e.g. Page Setup Dialog) that are not accessible through default dispatch Commands (.uno:*) Code.

Extension development

Extension elements are prototyped in LO Basic for API abstraction, then ported and finalized to Python to access a more active and populated developer community.

  • Page Numbering Addon

Page numbering Addon, providing interface for page offsets, starting pages, and different numbering types in the same documents, avoiding manual insertion of Page Styles and Breaks.Code

  • Notes

Page style nesting is not developed so an approach of style inheritance through cloning style property set is implemented (XPropertySet service).

Approach followed in librecust

  • Legal paper assisting toolbar (LawAddon)

All template related extension modules are compatible with existing management software used in certain departments. While more info is included in the corresponding page, the elements compiling LawAddon are the following:

  • Insert Law: Extension that fetches Greek law text body to current cursor position. The API used for law fetching is provided by another GSOC project from GFOSS. gsoc2018-3gm.
  • Insert external document: Extension that inserts an external document as reference link to current cursor position using relative parts for document portability.
  • Insert contents table: Insert contents table simulating the corresponding tool from menubar.
  • Update contents table: Update all content tables without leaving current cursor position, speeding up the default process for long documents.

All the aforementioned utilities are implemented in the LawAddon python script.

Template creation

While there are few public departments that use standardized law documents (and have already implemented them), most services and court departments produce and use non-standardized documents. This is the reason why we decided to engineer a different approach for automation of document creation. The base of this approach is the AutoText functionality that is implemented in LibreOffice/OpenOffice.

Utilizing feedback from employees, we developed an AutoText addon that allows simultaneous usage of autotexts and editing of document. AutoTexts can save not only plain text but also tables and format data so repeating parts of documnts are saved as documents, optimizing the whole relevant to Law document editing. Code

Additionally, AutoTexts provide the ability to distribute certain text segments across a local network, so an AutoText database can be created for each department.

Deployment

In every possible service the deployment part is a crucial process. Some of our customizations are distributed through extensions while others (menu customizations) require editing user directory configuration files (.xml). Achieving a unified installation interface includes the development of an interactive bash script giving options for partial or complete installation of librecust. Regarding certain settings application (e.g. default toolbar size) we took advantage of the LO SAX XML parsing and just add certain xml elements to the file head, letting LO to reconstruct the XML on application startup. The whole project requires continuous testing and feedback so deployment was our first concern and the installation approach is already implemented. See installation script

The previous approach can be used in almost any Linux distribution. However, in order to massively install our customizations in public service workstations (that use Debian based distributions), we packaged the whole librecust process in a deb package. The package elements are included in the corresponding directory.

Documentation

Throughout this GSOC project, documentation for each part will be compiled. We follow an example centric approach, describing each step related to our project, creating a wiki that can be the base for great number of different LO customization/extension projects.

Developer documentation

The wiki includes documentation pages for developers.

End User documentation

End user man pages are included as meta-data in LibreOffice Help at install. An example of this inclusion for reference can be observed at each extension's meta-data.

However, it is not mandatory to install extensions or the whole project to access those man-pages. They are also part of the project's Github page.

Challenges

While LO Basic is the most documented language, mainly because of its abstraction, developers keen on using modern languages (e.g. Python, Java). LibreOffice Python UNO bridge is poorly documented with helping topics spread across multiple forum posts, so our documentation will be of much help for new developers.

Installing and building librecust

Installation

The installation process is described in the corresponding wiki page

Building librecust

Building and packaging instructions for developers are provided in the corresponding wiki page.

Implementation

Menu customizations are implemented by editing user configuration .xml files and adding UI functionality through predefined dispatch commands and macro scripts. Any unimplemented feature is developed using macro scripts and inspecting tools for access to different menu items (e.g. tabs, radio buttons...) simulating the corresponding menu items of MS Office. The must-see reference for LibreOffice Macro development that is of great use throughout this project is Andrew Pitonyak's OpenOffice Macro Information.

Then, we need to harvest Greek legal documents for template creation. Some relevant sources are websites of associations such as EANDA and DSA. Those sources provide templates that do not have any specific format. Most of them are created by employees or lawyers thus their undefined structure.

Templates include "User defined fields" for static information (e.g. date and members of court) and "Bookmarks" for case specific info (e.g. description of law case) as well as properties for classification. Those can be tracked and used through the Java or Basic API as shown in LibreOffice examples.

Finally, after observing template details, we engineered addons that automate their creation taking into account their non-standard nature across different services.

We started with the intention to build a LibreOffice extension providing an interface for template selection and filling. However, most public services already used such an interface, so we decided to implement a different approach of document filling automation through AutoTexts.

A large part of the project and its composing functions is implemented (or inspired) by the following sources:

Timeline

The timeline followed throughout librecust development is included in the corresponding timeline gist

Final Report

The final report for GSOC 2018, as written by Arvanitis Christos, and in the form of a gist file, can be found here.

Future Work

The following future work can be done to improve the state of librecust project:

  1. Add more sources to Insert Law functionality for uneventful access to the vast majority of law documents (Only access to gsoc2018-3gm database)
  2. Merge current document with external elements: By the end of the project, for every external document a bookmark is provided to give access to external element positions to future developers that attempt to implement this functionality. Complete merging requires canvas writing to external document elements (e.g. png, pdf...) in order for page numbering to be included. The exported document can be a pdf including all documents referenced in the main editing one.
  3. Page Numbering add-on: Add further functionality to page numbering add on (even/odd pages numbered). The LIbreOffice API already includes functions that lead to such additions.
  4. Completely open source template management software.
  5. Solution for distribution of AutoTexts among workstations of same departments (replacing proprietary/outdated management software in such services).
  6. Automatic extraction of AutoText elements from a huge number of documents for each public service.
  7. Packaging for multiple other distributions

The team

Student

Mentors

Mentors overseeing the development process:

  • Kostas Papadimas
  • Theodoros Karounos

gsoc2018-librecust's People

Contributors

arvchristos avatar simonc56 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gsoc2018-librecust's Issues

No autotext for libreoffice-l10n-el package in official apt repos

Describe the bug
While on other l10n-* deb packages, an autotext directory is created in /usr/lib/libreoffice/share/autotext this is not the case for libreoffice-l10n-el package.

To Reproduce
Steps to reproduce the behavior:

  1. sudo apt install libreoffice-l10n-el
  2. change ui language to Greek
  3. restart libreoffice
  4. Open default AutoText dialog from menubar
Error:
The file:///usr/lib/libreoffice/share/autotext/el does not exist.

Expected behavior
No error message and created directory in the aforementioned pah

Desktop (please complete the following information):

  • OS: Ubuntu based
  • Suite: [e.g. LibreOffice/ OpenOffice]
  • Version [e.g. 5,6]

Additional context
Add any other context about the problem here.

Complete removal of librecust

Should we completely remove interface customizations on apt remove | apt purge or just reinstall the previous ones

The current postrm does the latter

Page numbering extension: header position bug

There is at least a bug in the managing the style.
If you compare the position of page number as set with the default LibO (v. 6.0.6.2) and by usin Numbering addon extension you see what is reported in the attached image1.jpg and image2.jpg
image1
image2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.