Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit e3c28c47 authored by nunejoa's avatar nunejoa
Browse files

Initial commit LEOS-3.2.0

parents
No related branches found
No related tags found
No related merge requests found
Showing
with 1792 additions and 0 deletions
# Set default to normalize and convert to native line endings on checkout.
* text=auto
# Declare files that will always have CRLF line endings on checkout.
*.bat text eol=crlf
# Declare files that will always have LF line endings on checkout.
*.sh text eol=lf
# Declare files that are truly binary and should not be modified.
*.doc binary
*.docx binary
*.eap binary
*.eot binary
*.gif binary
*.ico binary
*.jpg binary
*.pdf binary
*.png binary
*.swf binary
*.ttf binary
*.woff binary
*.xls binary
*.xlsx binary
# -- Windows.gitignore --------------------------------------------------------
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
# -- Linux.gitignore ----------------------------------------------------------
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# -- OSX.gitignore ------------------------------------------------------------
*.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# -- JetBrains.gitignore ------------------------------------------------------
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
.idea/
*.iml
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# -- Eclipse.gitignore --------------------------------------------------------
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
.settings/
.loadpath
.recommenders
# Eclipse Core
.project
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# PyDev specific (Python IDE for Eclipse)
*.pydevproject
# CDT-specific (C/C++ Development Tooling)
.cproject
# JDT-specific (Eclipse Java Development Tools)
.classpath
# Java annotation processor (APT)
.factorypath
# PDT-specific (PHP Development Tools)
.buildpath
# sbteclipse plugin
.target
# Tern plugin
.tern-project
# TeXlipse plugin
.texlipse
# STS (Spring Tool Suite)
.springBeans
# Code Recommenders
.recommenders/
# -- NetBeans.gitignore -------------------------------------------------------
nbproject/private/
build/
nbbuild/
dist/
nbdist/
nbactions.xml
.nb-gradle/
# -- SVN.gitignore ------------------------------------------------------------
.svn/
# -- Maven.gitignore ----------------------------------------------------------
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# -- Java.gitignore -----------------------------------------------------------
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
#*.jar
#*.war
*.ear
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
# -- Archives.gitignore -------------------------------------------------------
# It's better to unpack these files and commit the raw source because
# git has its own built in compression methods.
*.7z
#*.jar
*.rar
*.zip
*.gz
*.bzip
*.bz2
*.xz
*.lzma
*.cab
#packing-only formats
*.iso
*.tar
#package management formats
*.dmg
*.xpi
*.gem
*.egg
*.deb
*.rpm
*.msi
*.msm
*.msp
# -- MicrosoftOffice.gitignore ------------------------------------------------
*.tmp
# Word temporary
~$*.doc*
# Excel temporary
~$*.xls*
# Excel Backup File
*.xlk
# PowerPoint temporary
~$*.ppt*
# Visio autosave temporary files
*.~vsdx
# -- LEOS specific.gitignore---------------------------------------------------
styles.css
# -- .gitignore ---------------------------------------------------------------
# You can override the included template(s) by including variable overrides
# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings
# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings
# Container Scanning customization: https://docs.gitlab.com/ee/user/application_security/container_scanning/#customizing-the-container-scanning-settings
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
include:
- template: Auto-DevOps.gitlab-ci.yml
- template: Security/Dependency-Scanning.gitlab-ci.yml
**SUMMARY**
_\<Bug summaries should identify what the problem is, the area it occurs and what it’s impacting on.\>_
**RELEASE AND BUILD VERSION**
_\<The version where the issue has been identified \>_
**STEPS TO REPRODUCE**
_\<List of exact steps needed to reproduce the issue - add screenshots if needed to help contextualize\>_
**SUMMARY**
_\<Story summaries should be structured as follows: As [**the actor**], I want [**the something**] so I can [**the goal**].
Example: As a user, I want a button to open the milestone explorer so I can consult the containing documents of a milestone\>_
**ACCEPTANCE CRITERIAS / GOALS**
_\<Checklist to confirm the work done on a ticket meets the intended purpose and maps the deliverable into smaller outcomes. Also helps Q&A to better structure the validation tests._
Example:
- _A "Open Milestone" button is present on the UI_
- _Clicking on the button opens the milestone explorer_
- _Milestone explorer contains a tab for each document_
- _Each tab presents the HTML rendition for the selected document_
- _Each tab presents the annotations client on read mode for the selected document\>_
**OTHER DESCRIPTIONS / DOCUMENTATION**
_\<Mockups, images and or documentation pages, if available\>_
EUROPEAN UNION PUBLIC LICENCE v. 1.2
EUPL © the European Union 2007, 2016
This European Union Public Licence (the ‘EUPL’) applies to the Work (as defined below) which is provided under the
terms of this Licence. Any use of the Work, other than as authorised under this Licence is prohibited (to the extent such
use is covered by a right of the copyright holder of the Work).
The Work is provided under the terms of this Licence when the Licensor (as defined below) has placed the following
notice immediately following the copyright notice for the Work:
Licensed under the EUPL
or has expressed by any other means his willingness to license under the EUPL.
1.Definitions
In this Licence, the following terms have the following meaning:
— ‘The Licence’:this Licence.
— ‘The Original Work’:the work or software distributed or communicated by the Licensor under this Licence, available
as Source Code and also as Executable Code as the case may be.
— ‘Derivative Works’:the works or software that could be created by the Licensee, based upon the Original Work or
modifications thereof. This Licence does not define the extent of modification or dependence on the Original Work
required in order to classify a work as a Derivative Work; this extent is determined by copyright law applicable in
the country mentioned in Article 15.
— ‘The Work’:the Original Work or its Derivative Works.
— ‘The Source Code’:the human-readable form of the Work which is the most convenient for people to study and
modify.
— ‘The Executable Code’:any code which has generally been compiled and which is meant to be interpreted by
a computer as a program.
— ‘The Licensor’:the natural or legal person that distributes or communicates the Work under the Licence.
— ‘Contributor(s)’:any natural or legal person who modifies the Work under the Licence, or otherwise contributes to
the creation of a Derivative Work.
— ‘The Licensee’ or ‘You’:any natural or legal person who makes any usage of the Work under the terms of the
Licence.
— ‘Distribution’ or ‘Communication’:any act of selling, giving, lending, renting, distributing, communicating,
transmitting, or otherwise making available, online or offline, copies of the Work or providing access to its essential
functionalities at the disposal of any other natural or legal person.
2.Scope of the rights granted by the Licence
The Licensor hereby grants You a worldwide, royalty-free, non-exclusive, sublicensable licence to do the following, for
the duration of copyright vested in the Original Work:
— use the Work in any circumstance and for all usage,
— reproduce the Work,
— modify the Work, and make Derivative Works based upon the Work,
— communicate to the public, including the right to make available or display the Work or copies thereof to the public
and perform publicly, as the case may be, the Work,
— distribute the Work or copies thereof,
— lend and rent the Work or copies thereof,
— sublicense rights in the Work or copies thereof.
Those rights can be exercised on any media, supports and formats, whether now known or later invented, as far as the
applicable law permits so.
In the countries where moral rights apply, the Licensor waives his right to exercise his moral right to the extent allowed
by law in order to make effective the licence of the economic rights here above listed.
The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to any patents held by the Licensor, to the
extent necessary to make use of the rights granted on the Work under this Licence.
3.Communication of the Source Code
The Licensor may provide the Work either in its Source Code form, or as Executable Code. If the Work is provided as
Executable Code, the Licensor provides in addition a machine-readable copy of the Source Code of the Work along with
each copy of the Work that the Licensor distributes or indicates, in a notice following the copyright notice attached to
the Work, a repository where the Source Code is easily and freely accessible for as long as the Licensor continues to
distribute or communicate the Work.
4.Limitations on copyright
Nothing in this Licence is intended to deprive the Licensee of the benefits from any exception or limitation to the
exclusive rights of the rights owners in the Work, of the exhaustion of those rights or of other applicable limitations
thereto.
5.Obligations of the Licensee
The grant of the rights mentioned above is subject to some restrictions and obligations imposed on the Licensee. Those
obligations are the following:
Attribution right: The Licensee shall keep intact all copyright, patent or trademarks notices and all notices that refer to
the Licence and to the disclaimer of warranties. The Licensee must include a copy of such notices and a copy of the
Licence with every copy of the Work he/she distributes or communicates. The Licensee must cause any Derivative Work
to carry prominent notices stating that the Work has been modified and the date of modification.
Copyleft clause: If the Licensee distributes or communicates copies of the Original Works or Derivative Works, this
Distribution or Communication will be done under the terms of this Licence or of a later version of this Licence unless
the Original Work is expressly distributed only under this version of the Licence — for example by communicating
‘EUPL v. 1.2 only’. The Licensee (becoming Licensor) cannot offer or impose any additional terms or conditions on the
Work or Derivative Work that alter or restrict the terms of the Licence.
Compatibility clause: If the Licensee Distributes or Communicates Derivative Works or copies thereof based upon both
the Work and another work licensed under a Compatible Licence, this Distribution or Communication can be done
under the terms of this Compatible Licence. For the sake of this clause, ‘Compatible Licence’ refers to the licences listed
in the appendix attached to this Licence. Should the Licensee's obligations under the Compatible Licence conflict with
his/her obligations under this Licence, the obligations of the Compatible Licence shall prevail.
Provision of Source Code: When distributing or communicating copies of the Work, the Licensee will provide
a machine-readable copy of the Source Code or indicate a repository where this Source will be easily and freely available
for as long as the Licensee continues to distribute or communicate the Work.
Legal Protection: This Licence does not grant permission to use the trade names, trademarks, service marks, or names
of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and
reproducing the content of the copyright notice.
6.Chain of Authorship
The original Licensor warrants that the copyright in the Original Work granted hereunder is owned by him/her or
licensed to him/her and that he/she has the power and authority to grant the Licence.
Each Contributor warrants that the copyright in the modifications he/she brings to the Work are owned by him/her or
licensed to him/her and that he/she has the power and authority to grant the Licence.
Each time You accept the Licence, the original Licensor and subsequent Contributors grant You a licence to their contributions
to the Work, under the terms of this Licence.
7.Disclaimer of Warranty
The Work is a work in progress, which is continuously improved by numerous Contributors. It is not a finished work
and may therefore contain defects or ‘bugs’ inherent to this type of development.
For the above reason, the Work is provided under the Licence on an ‘as is’ basis and without warranties of any kind
concerning the Work, including without limitation merchantability, fitness for a particular purpose, absence of defects or
errors, accuracy, non-infringement of intellectual property rights other than copyright as stated in Article 6 of this
Licence.
This disclaimer of warranty is an essential part of the Licence and a condition for the grant of any rights to the Work.
8.Disclaimer of Liability
Except in the cases of wilful misconduct or damages directly caused to natural persons, the Licensor will in no event be
liable for any direct or indirect, material or moral, damages of any kind, arising out of the Licence or of the use of the
Work, including without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, loss
of data or any commercial damage, even if the Licensor has been advised of the possibility of such damage. However,
the Licensor will be liable under statutory product liability laws as far such laws apply to the Work.
9.Additional agreements
While distributing the Work, You may choose to conclude an additional agreement, defining obligations or services
consistent with this Licence. However, if accepting obligations, You may act only on your own behalf and on your sole
responsibility, not on behalf of the original Licensor or any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against such Contributor by
the fact You have accepted any warranty or additional liability.
10.Acceptance of the Licence
The provisions of this Licence can be accepted by clicking on an icon ‘I agree’ placed under the bottom of a window
displaying the text of this Licence or by affirming consent in any other similar way, in accordance with the rules of
applicable law. Clicking on that icon indicates your clear and irrevocable acceptance of this Licence and all of its terms
and conditions.
Similarly, you irrevocably accept this Licence and all of its terms and conditions by exercising any rights granted to You
by Article 2 of this Licence, such as the use of the Work, the creation by You of a Derivative Work or the Distribution
or Communication by You of the Work or copies thereof.
11.Information to the public
In case of any Distribution or Communication of the Work by means of electronic communication by You (for example,
by offering to download the Work from a remote location) the distribution channel or media (for example, a website)
must at least provide to the public the information requested by the applicable law regarding the Licensor, the Licence
and the way it may be accessible, concluded, stored and reproduced by the Licensee.
12.Termination of the Licence
The Licence and the rights granted hereunder will terminate automatically upon any breach by the Licensee of the terms
of the Licence.
Such a termination will not terminate the licences of any person who has received the Work from the Licensee under
the Licence, provided such persons remain in full compliance with the Licence.
13.Miscellaneous
Without prejudice of Article 9 above, the Licence represents the complete agreement between the Parties as to the
Work.
If any provision of the Licence is invalid or unenforceable under applicable law, this will not affect the validity or
enforceability of the Licence as a whole. Such provision will be construed or reformed so as necessary to make it valid
and enforceable.
The European Commission may publish other linguistic versions or new versions of this Licence or updated versions of
the Appendix, so far this is required and reasonable, without reducing the scope of the rights granted by the Licence.
New versions of the Licence will be published with a unique version number.
All linguistic versions of this Licence, approved by the European Commission, have identical value. Parties can take
advantage of the linguistic version of their choice.
14.Jurisdiction
Without prejudice to specific agreement between parties,
— any litigation resulting from the interpretation of this License, arising between the European Union institutions,
bodies, offices or agencies, as a Licensor, and any Licensee, will be subject to the jurisdiction of the Court of Justice
of the European Union, as laid down in article 272 of the Treaty on the Functioning of the European Union,
— any litigation arising between other parties and resulting from the interpretation of this License, will be subject to
the exclusive jurisdiction of the competent court where the Licensor resides or conducts its primary business.
15.Applicable Law
Without prejudice to specific agreement between parties,
— this Licence shall be governed by the law of the European Union Member State where the Licensor has his seat,
resides or has his registered office,
— this licence shall be governed by Belgian law if the Licensor has no seat, residence or registered office inside
a European Union Member State.
Appendix
‘Compatible Licences’ according to Article 5 EUPL are:
— GNU General Public License (GPL) v. 2, v. 3
— GNU Affero General Public License (AGPL) v. 3
— Open Software License (OSL) v. 2.1, v. 3.0
— Eclipse Public License (EPL) v. 1.0
— CeCILL v. 2.0, v. 2.1
— Mozilla Public Licence (MPL) v. 2
— GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3
— Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) for works other than software
— European Union Public Licence (EUPL) v. 1.1, v. 1.2
— Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) or Strong Reciprocity (LiLiQ-R+).
The European Commission may update this Appendix to later versions of the above licences without producing
a new version of the EUPL, as long as they provide the rights granted in Article 2 of this Licence and protect the
covered Source Code from exclusive appropriation.
All other changes or additions to this Appendix require the production of a new EUPL version.
Copyright 2017 European Commission
Licensed under the EUPL, Version 1.2 or – as soon they will be approved by the European Commission - subsequent versions of the EUPL (the "Licence");
You may not use this work except in compliance with the Licence.
You may obtain a copy of the Licence at:
https://joinup.ec.europa.eu/software/page/eupl
Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an "AS IS" basis,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the Licence for the specific language governing permissions and limitations under the Licence.
\ No newline at end of file
# LEOS
## Getting started test 3
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
## Add your files
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
```
cd existing_repo
git remote add origin https://code.europa.eu/leos-core/leos.git
git branch -M main
git push -uf origin main
```
## Integrate with your tools
- [ ] [Set up project integrations](https://code.europa.eu/leos-core/leos/-/settings/integrations)
## Collaborate with your team
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
## License
For open source projects, say how it is licensed.
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
PROJECT: LEOS
Joinup Release: 3.2.0
Date: 2022-10-03
INTRODUCTION
============
This is a joinup release of Project LEOS (pilot) which enables users to edit legal texts in AkomaNtoso XML format.
IMPORTANT NOTES
===============
This release is intended to provide an experience with the software and is stripped of several important components to enable ease of use.
* This software is adapted to run on a local server for demo purposes and without proper security mechanisms.
* This software provides two options for running CMIS repository. For more information see point B4.
* This software is still under active development so some features may be added, removed or changed over course of time.
DEPENDENCIES
============
To compile the supplied source files and run the generated WAR the following software should be configured:
* Java SDK version 8.0
* Maven version 3.3.9+
(Maven runtime memory might need to be set: MAVEN_OPTS=-Xms256m -Xmx512m)
(Maven settings, proxy and mirrors, might need to be adjusted to your environment and internet access requirements)
* Supported browser is Google Chrome version 45+
(Mozilla Firefox ESR version 38.3 and Microsoft Internet Explorer version 11 are known to work with minor issues)
DEMO
====
You can experience LEOS on your local machine by executing a few steps in order, following the instructions for option A OR option B.
OPTION A)
If your machine's operating system is Microsoft Windows, you can simply execute the provided script: run-all.bat.
If your machine's operating system is Linux based, you can simply execute the provided script: run-all.sh.
This script will execute individual scripts that will compile AND run each of the required software components.
Open the browser and navigate to the LEOS web interface available at the following URL:
http://localhost:8080/leos-pilot/ui
LEOS is pre-configured with these demo users:
+-----------+-------+----------+--------+
| NAME | LOGIN | PASSWORD |ROLE |
+-----------+-------+----------+--------+
| Demo User | demo | demo |Normal |
+-----------+-------+----------+--------+
| John Doe | john | demo |Normal |
+-----------+-------+----------+--------+
| Jane Doe | jane | demo |Support |
+-----------+-------+----------+--------+
| S Leo | leos | demo |Support |
+-----------+-------+----------+--------+
OPTION B)
If your machine's operating system is not windows or Linux based or you want to run components one by one, you should follow below steps.
B1. UNZIP ARCHIVE
=================
You must unzip the distribution archive.
1) Unzip the distribution archive in the local file system
a) A new directory should now be present: {LEOS}
B2. RUNNING ANNOTATE
====================
You must compile and run annotate on the command line.
1) Traverse to folder {LEOS}/modules/annotate
2) Execute the following command to compile source code.
mvn clean install -Dmaven.test.skip=true
3) Traverse to folder {LEOS}/modules/annotate/server
4) Execute the following command to run annotate server.
mvn spring-boot:run -Dspring-boot.run.profiles=h2 -Dspring-boot.run.directories=../config/target/generated-config/
Once you'll run LEOS, annotate sidebar will be available to annotate documents
For more details about DB and running this module, check {LEOS}/modules/annotate/README.txt file
B3. RUNNING USER DATABASE
=========================
You must compile and run the user database on the command line.
1) Traverse to folder {LEOS}/tools/user-repo
2) Execute the following command to compile source code.
mvn clean install
3) Execute the following command to run it.
mvn spring-boot:run -Drun.profiles=h2
B4. RUNNING REPOSITORY
======================
There are two options for running CMIS repository.
1. Use the OpenCMIS InMemory repository version included with this LEOS distribution.
To run OpenCMIS InMemory repository server, You must compile and run the repository on the command line.
1) Traverse to folder {LEOS}/tools/cmis/chemistry-opencmis-server-inmemory
2) Execute the following command to clean source code.
mvn clean
3) Execute the following command to run it.
mvn jetty:run-war
2. Use a persistent CMIS Open Source server version.
To use and connect LEOS to persistent CMIS Open source, please go through document present at the following folder location inside this release:
{LEOS}/docs/CMIS Open Source/LEOS-CMISOpenSource-v1.0.0.pdf
B5. RUNNING LEOS
================
Notes:
- User database and repository must already be running.
- LEOS can use SAML protocol to authenticate with an IDP.
- To use SAML it is needed modify SAML configuration defined in "securityContext.xml" file inside module "security-saml".
You must run LEOS on the command line.
1) Traverse to folder {LEOS}
2) Execute the following command to compile source code.
- For default authentication: mvn clean install
- For SAML authentication: mvn clean install -Dsaml
3) Traverse to folder {LEOS}/modules/web
4) Execute the following command to run LEOS.
- For default authentication: mvn jetty:run-war
- For SAML authentication: mvn jetty:run-war -Dsaml
B6. RUNNING AKN4EUUTIL
======================
You must compile and run akn4euutil on the command line.
1) Traverse to folder {LEOS}/tools/akn4euutil
2) Execute the following command to compile source code.
mvn clean install
3) Execute the following command to run it.
mvn spring-boot:run
Open the browser and navigate to the LEOS web interface available at the following URL:
http://localhost:8080/leos-pilot/ui
ABOUT LEOS
================================================================================
LEOS is a software that was created under ISA2 Action 2016.38 Legislation
Interoperability Tools - LegIT to address the need of the public administration
and European Institutions to generate draft legislation in a legal XML format.
It is a legislation editor and this current prototype supports the drafting
of the 'secondary' legislation of the EU law which has to be adopted under the
Ordinary Legislative Procedure.
Therefore, it covers the writing of Proposals for Directive, Decision and
Regulation submitted by the Commission to the Council and the Parliament.
If you want to find out more about this procedure, please read the European
Parliament's article.
europarl.europa.eu/about-parliament/en/powers-and-procedures/legislative-powers
Given the high diversity of legislative traditions encountered across the
Union and the different levels of modernisation, it was extremely difficult to
provide a universal single turnkey ICT solution that adapts to each specific
context.
Even if a significant part of the business logic can be found embedded in
the code, we design with the goal of delivering re-usable building blocks so
LEOS is released Open Source as we believe that some parts of it could be reused
and adapted by some other Public Administration having similar needs.
For more information on the features please follow us on Joinup:
joinup.ec.europa.eu/solution/leos-open-source-software-editing-legislation
The code is available for free under EUPL licence (version 1.2 or – as soon they
will be approved by the European Commission - subsequent
versions of the EUPL (the "Licence")), and the development team
paid attention to organise the code in a structured way to ease its reusability
(modules, plugins…).
For more information on the EUPL licence:
https://joinup.ec.europa.eu/collection/eupl
The LEOS demo provided in our release comes with an example user interface
that includes the logo of the European Commission.
This is just for demonstration purpose and please note that the logo of the
European Commission may be used by third parties only if:
- Permission is requested and granted before the logo is used
- There is no likelihood of the user of the logo being confused with the
European Commission
- It is not used in connection with objectives or activities which are
incompatible with the aims and principles of the European Commission
- It is not used to imply or suggest unintended endorsement or promotion of the
objectives and activities of the user of the logo by the European Commission
For more information please visit :
ec.europa.eu/info/resources-partners/european-commission-visual-identity_en
WHAT'S NEW?
================================================================================
The main differences compared to the previous version are:
- Improved Annotations with new bulk actions and revisited logic for orphan handling as well as enhanced UI for better user experience;
- New Search&Replace functionality with fine grained occurrences detection option, improved navigation over results and enhanced replace functionality;
- Core XML handling library migrated to Xerces, resulting in revised Architecture, better code testing coverage and performance enhancements;
- Enhanced collaborators management feature;
- First iteration of new standalone export module that enables the extraction of HTML renditions given a .leg package;
- Several bug fixes and enhanced editing experience;
WHAT'S GONE?
================================================================================
Nothing this time.
ACKNOWLEDGMENTS
================================================================================
We would like to thank our collaborators from Ref2Link project for providing us the Ref2Link version 1.2.0 .
https://joinup.ec.europa.eu/collection/justice-law-and-security/solution/ref2link
We welcome further contributions. So have your say! We count on your feedback.
GET IN TOUCH
================================================================================
We are envisaging to create an open source community on software for
legislation drafting, in order to share best practices, experiences, expertise,
and why not code!!
Should you be interested in joining our open source community, or you would just
like to share with us some observations on our work, please contact us at:
DIGIT-LEOS-FEEDBACK@ec.europa.eu.
We are looking forward to hearing from you,
The LEOS Team
CHANGE LOG
================================================================================
3.1.2 (LEOS)
------------------
* Patch fix for Log4Shell error: CVE-2021-45046, CVE-2021-45105 and CVE-2021-44832.
3.1.1 (LEOS)
------------------
* Patch fix for Log4Shell error: CVE-2021-44228
3.1.0 (LEOS)
------------------
* Proposal Viewer
- Management support for collaborators that belong to more than a single group;
* Annotations
- New button to disable annotations popup;
- New Bulk actions over annotations:
- Multi selection of annotations;
- Possibility to accept / reject / delete several annotations in bulk;
- Improved orphan detection algorithm for suggestions;
- Improved orphan contextualization for suggestions: include preceding and succeeding text to help the drafter to locate the exact placement;
- New Comment feature for suggestions;
- UI improvements on annotations panel:
- Scrollable annotations pane;
- New clear filter button;
- CKEditor added allowing text styling and URLs to be added to comment annotations;
- Annotation card display date format reviewed;
* Annex Viewer
- Show annex number on UI;
* Document Viewer
- New Search&Replace functionality:
- New occurrences counter and possibility to navigate over occurrences;
- New match case & whole words search features;
- Possibility to replace single occurrence or all occurrences in one step;
- New enriched Spellcheck & grammar checker;
- Implicit save: improved trigger detection functionality to optimize user experience;
* Table of Content
- Improved user experience by allowing user to close details pane when selecting an element;
* AKN4EU Utils
- New export export service available: export HTML Renditions;
* Technical Tasks & Improvements
- Ref2link updated to 1.2.0 version;
- Migrated from VTD to Xerces library;
- Navigation between editing instances with explicit need to save&close first;
- CKEditor plugins placement reviewed: no longer overlaps preceding document text;
- Performance improvements;
- Interface rename: "Legal Text" to "Legal Act";
* Bug Fixes
* Editor
- Table plugin revisited and fixed several corner cases that were making structure inconsistent upon save;
- In case of triple click, edition box opened and the annotation toolbar was displayed;
- Shortcut plugins behavior consistency reviewed;
- Fixed corner cases for navigation between CKEditor instances with double click functionality;
- User was not able to delete all elements of mandate Article;
- Removing heading of Article from CKEditor leaves empty node;
- In specific corner cases, CKEditor was able to be saved with empty sub-paragraphs;
* Proposal Viewer
- After creation of a new proposal, independently if the chosen template, the heading would always be the same;
* Annexes
- Alinea of point (a) could not be edited;
- Corner case issue fixed where annexes were lost when importing a new proposal;
- Editor focus lost upon Level indent/outdent;
- Corner case issue fixed where loading annotations on annexes was not performing correctly;
- Show co-edition message on save fixed;
- Soft enter was missing for Annex at paragraphs;
* Annotations
- Fixed corner case that would prevent annotations panel to open;
- Removed "Disable annotations" button on Milestone Explorer;
- Annotation: conflicts with requirejs;
- Fixed issue: Users were able to create comments on Milestone explorer view under certain circumstances;
- Notification of displayed annotations now working for posting groups (not only to Collaborators);
- Author filter reviewed;
* Milestone Explorer
- Corner case issue fixed where annexes inclusion on milestone was not correct;
* Document Viewer
- Ref2link URLs styling fixes;
- Fixed corner cases working with articles without heading;
* Table of Content
- Deleting point on moved list caused invalid numbering;
- Moved list of points could not be moved back to original position;
- Edition of TOC on annexes errors fixed;
* Diffing feature
- Styling issues fixed;
* Versions management
- Wrong list remained displayed after revert followed by save;
- Recent changes list with invalid versions fixed;
- Last edited time on versions synched with real last edition;
3.0.0 (LEOS-Pilot)
------------------
* Updated HOWTO documentation
* Proposal Viewer
- Milestone explorer:
- Display all documents contained in a Milestone with version information;
- Show annotations up to the selected milestone version for each document;
* Legal Text Viewer
- New Inline Table of content edition, replacing pre-existing pop-up window.
- New versions management.
- New comparison view in split mode replacing pre-existing pop-up window.
- Improved Internal references:
- Display all referenceable documents in internal references pop-up window;
- New Inter-document referencing feature;
* Explanatory Memorandum Viewer
- New versions management.
- New comparison view in split mode replacing pre-existing pop-up window.
* Annex Viewer
- New Inline Table of content edition, replacing pre-existing pop-up.
- New versions management.
- New comparison view in split mode replacing pre-existing pop-up window.
- New structured annexes:
- Level annexes: Annexes composed by AKN4EU Level elements;
- Article annexes: Annexes composed by Article elements;
* Repository Viewer
- New filters by template and by role in the proposal
- Proposal can be opened by selecting proposal card.
* Annotations
- Improved user interface and usability.
- New filters with possibility to use composed conditions.
- New guidelines functionality connecting document anchors (highlights) to the specific annotation it relates to.
- Allow multi-selection of annotations.
- Annotation: Overlapping document anchors with distinct layout colors.
- Support role now able to see all available groups for posting.
- Removal of the annotations from the milestones. Comments should not leave Leos
* LEOS configuration
- Templates configuration improvements. Support for your ANK format
- Configure autonumbering
- AKN elements and rules
- CKEditor behaviour with AKN elements
- Templates versioning improvements
* LEOS services
- New services for the integration with other systems
* Technical improvements
- SAML authentication Integration.
- New PDF export integrated. (Spain contribution)
* Bug fixes
* Updated dependencies (frameworks and libraries)
- Upgrade Vaadin to 8.8.6
- Upgrade to CKEditor 4.12.1
2.1.0 (LEOS-Pilot)
------------------
* Updated HOWTO documentation
* Proposal Viewer
- Improved user interface
- Milestone.
- Co-edition icon and alerts
- New template "Council Decision"
* Legal Text Viewer
- Improved user interface
- Improved Toc edition
- Edition of Citations and Recitals at unit level
- Co-edition icon and alerts.
- Implicit save
- Internal references pattern changed
- Restore to a previous version
- Styles improved for the display of the document
- Grammatical and spell checker added in Editor
* Explanatory Memorandum Viewer
- Improved user interface
- Improved Toc edition
- Co-edition icon and alerts
- Implicit save
- Restore to a previous version
- Styles improved for the display of the document
- Grammatical and spell checker added in Editor
* Annex Viewer
- Improved user interface
- Improved Toc edition
- Co-edition icon and alerts
- Implicit save
- Restore to a previous version
- Styles improved for the display of the document
- Grammatical and spell checker added in Editor
* Annotations
- Improved user interface
* LEOS configuration
- New roles/actions configuration to ease customization
- Templates configuration improvements
- Possibility to support templates that don't have memorandum mandatory by default
- Integration with ISA2 Open CMIS Repo
* LEOS services
- New services for the integration with other systems
* Technical improvements
- Removed Kotlin layer and dependencies
- Refactored i18 (internationalization) module
* Bug fixes
* Updated dependencies (frameworks and libraries)
- Ref2link version 1.0.3
* Removed
- Context menu to update list number styles
- Smart break feature to identify the id attribute
2.0.0 (LEOS-Pilot)
------------------
* Updated HOWTO documentation
* Repository Browser
- New upload feature
* Proposal Viewer
- Improved user interface
- Download
- Styles for XML added to the downloaded file.
* Legal Text Viewer
- Improved user interface
- Sync scrolling between edit and changes pane
- Improved Toc edition
- Internal reference auto label generation
- LEOS Editor
- Improved image plugin
- Context menu to update list number styles
- Smart break feature to identify the id attribute
- Validating AKN xml documents asynchronously
* Explanatory Memorandum Viewer
- Improved user interface
- Improved Toc edition
* Annex Viewer
- Improved user interface
- Improved Toc edition
- LEOS Editor
- New justify and centre text plugin.
* Annotations
- Add comments and highlights on Legal text
- Provide suggestions on a part of text
- Accept or reject a suggestion
* Technical improvements
* Bug fixes
* Updated dependencies (frameworks and libraries)
1.0.0 (LEOS-Pilot)
------------------
* Updated HOWTO documentation
* Repository Browser
- Redesigned user interface
- Create proposal
- Documents list as proposals
- Switch to display documents/proposals
- Document list filters
* Proposal Viewer
- View/Edit proposal metadata
- Download a proposal
- Delete a proposal
- Management of contributors
- Management of Annexes
* Legal Text Viewer
- View/Edit legal text
- LEOS Editor
- Save/Close
- Paste from MS-Word
- Switch to UnNumbered Paragraph
- Improved document changes pane
- Version selector
- Change markers
- Change navigation
- Timeline window
- Single/Two column comparison
- Show/Hide intermediate version for comparison
- Version navigation using slider
- Change marker navigation
- Save as major version
- Import from Official Journal
- User guidance
- Search and replace text
* Explanatory Memorandum Viewer
- View/Edit explanatory memorandum text
- Improved document changes pane
- Version selector
- Change markers
- Change navigation
- Timeline window
- Single/Two column comparison
- Show/Hide intermediate version for comparison
- Version navigation using slider
- Change marker navigation
- Save as major version
- User guidance
- View/Edit table of contents
* Annex Viewer
- View/Edit annex text
- Improved document changes pane
- Version selector
- Change markers
- Change navigation
- Timeline window
- Single/Two column comparison
- Show/Hide intermediate version for comparison
- Version navigation using slider
- Change marker navigation
- Save as major version
* Updated dependencies (frameworks and libraries)
* Updated user database management with roles
* Technical improvements and enhanced user experience
Note: Some features/sections which were part of the previous releases are
removed for e.g. Comments viewer, suggestions, document locking as they are
currently being re-developed in Pilot.
3.1.0 (Prototype)
-----------------
* Comments Viewer
- Feature to suggest a change in the text
* Document Viewer
- Accept or delete suggested changes
- Comments deletion with button
* Updated dependencies (frameworks and libraries)
* Technical improvements and bug fixes
3.0.0 (Prototype)
-----------------
* Updated HOWTO documentation
* Document Viewer
- Document changes pane
- Version selector
- Change markers
- Change navigation
* Editor
- New inline edition
- Improved user comments
* Updated dependencies (frameworks and libraries)
* Technical improvements, updated module structure and bug fixes
2.0.0 (Prototype)
-----------------
* New HOWTO documentation
* New user interface theme
- Colors
- Fonts
- Icons
* Repository Browser
- Redesigned user interface
- Document list filters
- Deletion of documents
- Management of contributors
* LEOS Editor
- User comments
- Text highlights
- Cross-references
- Sub-paragraphs
* Comments viewer
- View, add, edit and delete comments
* Collaborative work
- Document author (Role)
- Document contributor (Role)
- Document stages (Workflow)
* Updated dependencies (frameworks and libraries)
* Fixes (incomplete) for Firefox (ESR 38.3) and Internet Explorer (11)
1.0.0 (Prototype)
-----------------
* Initial joinup open source release.
BUGS
================================================================================
There might be bugs or incomplete features present in this version as pilot
is still under active development.
This diff is collapsed.
This diff is collapsed.
<?xml version='1.0'?>
<?xml-stylesheet href="../2008/09/xsd.xsl" type="text/xsl"?>
<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns ="http://www.w3.org/1999/xhtml"
xml:lang="en">
<xs:annotation>
<xs:documentation>
<div>
<h1>About the XML namespace</h1>
<div class="bodytext">
<p>
This schema document describes the XML namespace, in a form
suitable for import by other schema documents.
</p>
<p>
See <a href="http://www.w3.org/XML/1998/namespace.html">
http://www.w3.org/XML/1998/namespace.html</a> and
<a href="http://www.w3.org/TR/REC-xml">
http://www.w3.org/TR/REC-xml</a> for information
about this namespace.
</p>
<p>
Note that local names in this namespace are intended to be
defined only by the World Wide Web Consortium or its subgroups.
The names currently defined in this namespace are listed below.
They should not be used with conflicting semantics by any Working
Group, specification, or document instance.
</p>
<p>
See further below in this document for more information about <a
href="#usage">how to refer to this schema document from your own
XSD schema documents</a> and about <a href="#nsversioning">the
namespace-versioning policy governing this schema document</a>.
</p>
</div>
</div>
</xs:documentation>
</xs:annotation>
<xs:attribute name="lang">
<xs:annotation>
<xs:documentation>
<div>
<h3>lang (as an attribute name)</h3>
<p>
denotes an attribute whose value
is a language code for the natural language of the content of
any element; its value is inherited. This name is reserved
by virtue of its definition in the XML specification.</p>
</div>
<div>
<h4>Notes</h4>
<p>
Attempting to install the relevant ISO 2- and 3-letter
codes as the enumerated possible values is probably never
going to be a realistic possibility.
</p>
<p>
See BCP 47 at <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt">
http://www.rfc-editor.org/rfc/bcp/bcp47.txt</a>
and the IANA language subtag registry at
<a href="http://www.iana.org/assignments/language-subtag-registry">
http://www.iana.org/assignments/language-subtag-registry</a>
for further information.
</p>
<p>
The union allows for the 'un-declaration' of xml:lang with
the empty string.
</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:union memberTypes="xs:language">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="space">
<xs:annotation>
<xs:documentation>
<div>
<h3>space (as an attribute name)</h3>
<p>
denotes an attribute whose
value is a keyword indicating what whitespace processing
discipline is intended for the content of the element; its
value is inherited. This name is reserved by virtue of its
definition in the XML specification.</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:NCName">
<xs:enumeration value="default"/>
<xs:enumeration value="preserve"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="base" type="xs:anyURI"> <xs:annotation>
<xs:documentation>
<div>
<h3>base (as an attribute name)</h3>
<p>
denotes an attribute whose value
provides a URI to be used as the base for interpreting any
relative URIs in the scope of the element on which it
appears; its value is inherited. This name is reserved
by virtue of its definition in the XML Base specification.</p>
<p>
See <a
href="http://www.w3.org/TR/xmlbase/">http://www.w3.org/TR/xmlbase/</a>
for information about this attribute.
</p>
</div>
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="id" type="xs:ID">
<xs:annotation>
<xs:documentation>
<div>
<h3>id (as an attribute name)</h3>
<p>
denotes an attribute whose value
should be interpreted as if declared to be of type ID.
This name is reserved by virtue of its definition in the
xml:id specification.</p>
<p>
See <a
href="http://www.w3.org/TR/xml-id/">http://www.w3.org/TR/xml-id/</a>
for information about this attribute.
</p>
</div>
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attributeGroup name="specialAttrs">
<xs:attribute ref="xml:base"/>
<xs:attribute ref="xml:lang"/>
<xs:attribute ref="xml:space"/>
<xs:attribute ref="xml:id"/>
</xs:attributeGroup>
<xs:annotation>
<xs:documentation>
<div>
<h3>Father (in any context at all)</h3>
<div class="bodytext">
<p>
denotes Jon Bosak, the chair of
the original XML Working Group. This name is reserved by
the following decision of the W3C XML Plenary and
XML Coordination groups:
</p>
<blockquote>
<p>
In appreciation for his vision, leadership and
dedication the W3C XML Plenary on this 10th day of
February, 2000, reserves for Jon Bosak in perpetuity
the XML name "xml:Father".
</p>
</blockquote>
</div>
</div>
</xs:documentation>
</xs:annotation>
<xs:annotation>
<xs:documentation>
<div xml:id="usage" id="usage">
<h2><a name="usage">About this schema document</a></h2>
<div class="bodytext">
<p>
This schema defines attributes and an attribute group suitable
for use by schemas wishing to allow <code>xml:base</code>,
<code>xml:lang</code>, <code>xml:space</code> or
<code>xml:id</code> attributes on elements they define.
</p>
<p>
To enable this, such a schema must import this schema for
the XML namespace, e.g. as follows:
</p>
<pre>
&lt;schema . . .>
. . .
&lt;import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
</pre>
<p>
or
</p>
<pre>
&lt;import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
</pre>
<p>
Subsequently, qualified reference to any of the attributes or the
group defined below will have the desired effect, e.g.
</p>
<pre>
&lt;type . . .>
. . .
&lt;attributeGroup ref="xml:specialAttrs"/>
</pre>
<p>
will define a type which will schema-validate an instance element
with any of those attributes.
</p>
</div>
</div>
</xs:documentation>
</xs:annotation>
<xs:annotation>
<xs:documentation>
<div id="nsversioning" xml:id="nsversioning">
<h2><a name="nsversioning">Versioning policy for this schema document</a></h2>
<div class="bodytext">
<p>
In keeping with the XML Schema WG's standard versioning
policy, this schema document will persist at
<a href="http://www.w3.org/2009/01/xml.xsd">
http://www.w3.org/2009/01/xml.xsd</a>.
</p>
<p>
At the date of issue it can also be found at
<a href="http://www.w3.org/2001/xml.xsd">
http://www.w3.org/2001/xml.xsd</a>.
</p>
<p>
The schema document at that URI may however change in the future,
in order to remain compatible with the latest version of XML
Schema itself, or with the XML namespace itself. In other words,
if the XML Schema or XML namespaces change, the version of this
document at <a href="http://www.w3.org/2001/xml.xsd">
http://www.w3.org/2001/xml.xsd
</a>
will change accordingly; the version at
<a href="http://www.w3.org/2009/01/xml.xsd">
http://www.w3.org/2009/01/xml.xsd
</a>
will not change.
</p>
<p>
Previous dated (and unchanging) versions of this schema
document are at:
</p>
<ul>
<li><a href="http://www.w3.org/2009/01/xml.xsd">
http://www.w3.org/2009/01/xml.xsd</a></li>
<li><a href="http://www.w3.org/2007/08/xml.xsd">
http://www.w3.org/2007/08/xml.xsd</a></li>
<li><a href="http://www.w3.org/2004/10/xml.xsd">
http://www.w3.org/2004/10/xml.xsd</a></li>
<li><a href="http://www.w3.org/2001/03/xml.xsd">
http://www.w3.org/2001/03/xml.xsd</a></li>
</ul>
</div>
</div>
</xs:documentation>
</xs:annotation>
</xs:schema>
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
import org.apache.chemistry.opencmis.client.api.CmisObject
import org.apache.chemistry.opencmis.client.api.ObjectId
import org.apache.chemistry.opencmis.client.api.Session
import org.apache.chemistry.opencmis.commons.PropertyIds
import org.apache.chemistry.opencmis.commons.data.ContentStream
import org.apache.chemistry.opencmis.commons.enums.BaseTypeId
import org.apache.chemistry.opencmis.commons.enums.VersioningState
import org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException
import org.apache.chemistry.opencmis.commons.impl.dataobjects.ContentStreamImpl
// NOTE set variables with full path on local file system
// ex. C:/devel/sources/pilot/releases/1.0.0-alpha7-council/CMIS/resources
def resourcesLocalPath = '<TODO>'
// ex. C:/devel/sources/pilot/releases/1.0.0-alpha7-council/CMIS/scripts/repository
def repoPropertiesLocalPath = '<TODO>'
def loader = new LeosLoader(resourcesLocalPath, repoPropertiesLocalPath, session)
loader.loadRepository()
/*-----------------------------------------------------------------------------
Groovy class LeosLoader adapted from LeosInMemoryServiceFactory.java
-----------------------------------------------------------------------------*/
class LeosLoader {
static final CMIS_PATH_SEPARATOR = '/'
static final CMIS_ROOT_FOLDER_PATH = '/'
static final CMIS_FOLDER_TYPE_ID = BaseTypeId.CMIS_FOLDER.value()
static final LEOS_CATEGORY_PROP_ID = 'leos:category'
static final PROPS_KEY_MAPPING = [
// leos XML properties
'language' : 'leos:language',
'template' : 'leos:template',
'title' : 'leos:title',
// leos COMMON metadata properties
'metadata.docTemplate' : 'metadata:docTemplate',
'metadata.docStage' : 'metadata:docStage',
'metadata.docType' : 'metadata:docType',
'metadata.docPurpose' : 'metadata:docPurpose',
'metadata.procedureType' : 'metadata:procedureType',
'metadata.actType' : 'metadata:actType',
'metadata.eeaRelevance' : 'metadata:eeaRelevance',
// TODO leos MEMORANDUM specific metadata properties
// use sub-key metadata.memorandum.<>
// TODO leos BILL specific metadata properties
// use sub-key metadata.bill.<>
// leos ANNEX specific metadata properties
'metadata.annex.docIndex' : 'annex:docIndex',
'metadata.annex.docNumber': 'annex:docNumber',
'metadata.annex.docTitle' : 'annex:docTitle'
]
static final PROPS_TYPE_MAPPING = [
// only for non-String type properties
'annex:docIndex': BigInteger.class
]
static final ENABLED = '.enabled'
static final RESOURCE = '.resource'
static final FOLDER = '.folder'
static final REPOSITORY_ID = 'InMemoryServer.RepositoryId'
static final TYPES_CREATOR_CLASS = 'InMemoryServer.TypesCreatorClass'
static final LEOS_SECONDARY_TYPES_CREATOR_CLASS = 'eu.europa.ec.leos.cmis.types.LeosSecondaryTypesTypeSystemCreator'
final String RESOURCES_LOCAL_PATH
final Map<String, String> PARAMETERS
final Session SESSION
LeosLoader(String resourcesLocalPath, String repoPropertiesLocalPath, Session session) {
this.RESOURCES_LOCAL_PATH = resourcesLocalPath
def repoPropertiesFilePropsPath = repoPropertiesLocalPath + '/repository_os.properties'
println "Loading properties file: $repoPropertiesFilePropsPath"
def properties = new java.util.Properties()
def propsFile = new File(repoPropertiesFilePropsPath)
propsFile.withInputStream { s ->
properties.load(s)
}
PARAMETERS = (Map) properties
SESSION = session
}
void loadRepository() {
String repositoryId = PARAMETERS.get(REPOSITORY_ID)
println "Loading LEOS CMIS repository... [id=$repositoryId]"
processConfiguration(PARAMETERS)
println "...finished!"
}
private void processConfiguration(Map<String, String> parameters) {
println "Processing configuration parameters..."
Set<String> enabledKeys = filter(parameters.keySet(), null, ENABLED)
for (String key : enabledKeys) {
String featureKey = key.substring(0, key.length() - ENABLED.length())
if (Boolean.parseBoolean(parameters.get(key))) {
println "LEOS feature [$featureKey] is enabled..."
processFolders(featureKey, parameters)
processResources(featureKey, parameters)
} else {
println "LEOS feature [$featureKey] is disabled!"
}
}
}
private void processResources(String featureKey, Map<String, String> parameters) {
println "Processing resources... [feature=$featureKey]"
Set<String> resourceKeys = filter(parameters.keySet(), featureKey, RESOURCE)
for (String key : resourceKeys) {
String path = parameters.get(key)
InputStream inStream = loadResource(path)
if (inStream != null) {
String documentKey = key.substring(0, key.length() - RESOURCE.length())
processDocument(documentKey, parameters, inStream)
} else {
println "Resource not found! [$path]"
}
}
}
private void processFolders(String featureKey, Map<String, String> parameters) {
println "Processing folders... [feature=$featureKey]"
String repositoryId = parameters.get(REPOSITORY_ID)
Set<String> folderKeys = filter(parameters.keySet(), featureKey, FOLDER)
for (String key : folderKeys) {
String path = parameters.get(key)
String folderId = createFolder(repositoryId, path)
}
}
private Set<String> filter(Set<String> keys, String prefix, String suffix) {
Set<String> validKeys = new HashSet<>()
for (String key : keys) {
boolean validPrefix = (prefix == null) || key.startsWith(prefix)
boolean validSuffix = (suffix == null) || key.endsWith(suffix)
if (validPrefix && validSuffix) {
validKeys.add(key)
}
}
return validKeys
}
private InputStream loadResource(String path) {
def localResourcePath = RESOURCES_LOCAL_PATH + path
println "Loading resource: [$localResourcePath]"
return new FileInputStream(localResourcePath)
}
private void processDocument(String documentKey, Map<String, String> parameters, InputStream inStream) {
println "Processing document... [document=$documentKey]"
String repositoryId = parameters.get(REPOSITORY_ID)
String path = parameters.get(documentKey + ".path")
String name = parameters.get(documentKey + ".name")
String fileName = parameters.get(documentKey + ".fileName")
String mimeType = parameters.get(documentKey + ".mimeType")
String primaryTypeId = parameters.get(documentKey + ".primaryTypeId")
String category = parameters.get(documentKey + ".category")
Map<String, String> optionalProps = processOptionalProperties(documentKey, parameters)
List<String> secondaryTypeIds = processOptionalSecondaryTypes(documentKey, parameters)
String folderId = createFolder(repositoryId, path)
createDocument(repositoryId, folderId, name, fileName, mimeType, inStream, primaryTypeId, category, optionalProps, secondaryTypeIds)
}
private Map<String, String> processOptionalProperties(String documentKey, Map<String, String> parameters) {
Map<String, String> props = new HashMap<>()
for (String propAlias : PROPS_KEY_MAPPING.keySet()) {
String configKey = documentKey + "." + propAlias
if (parameters.containsKey(configKey)) {
props.put(PROPS_KEY_MAPPING.get(propAlias), parameters.get(configKey))
}
}
return props
}
private String createFolder(String repositoryId, String path) {
String folderPath = (!CMIS_ROOT_FOLDER_PATH.equals(path) && path.endsWith(CMIS_PATH_SEPARATOR)) ?
path.substring(0, path.length() - CMIS_PATH_SEPARATOR.length()) : path
String folderId = findObjectId(repositoryId, folderPath)
if (folderId != null) {
println "Folder exists: $folderId => $folderPath"
} else {
int sepIndex = folderPath.lastIndexOf(CMIS_PATH_SEPARATOR)
String folderName = folderPath.substring(sepIndex + 1, folderPath.length())
String parentPath = folderPath.substring(0, sepIndex + 1)
String parentId = createFolder(repositoryId, parentPath)
Map<String, Object> properties = [
(PropertyIds.OBJECT_TYPE_ID): CMIS_FOLDER_TYPE_ID,
(PropertyIds.NAME) : folderName
]
ObjectId parentObjectId = SESSION.createObjectId(parentId)
folderId = SESSION.createFolder(properties, parentObjectId).getId()
println "Folder created: $folderId => $folderPath"
}
return folderId
}
private void createDocument(String repositoryId, String folderId, String name,
String fileName, String mimeType, InputStream inStream,
String primaryTypeId, String category, Map<String, String> optionalProps,
List<String> secondaryTypeIds) {
println "Creating document... [type=$primaryTypeId, category=$category, name=$name]"
Map<String, Object> properties = [
(PropertyIds.OBJECT_TYPE_ID): primaryTypeId,
(PropertyIds.NAME) : name,
(LEOS_CATEGORY_PROP_ID) : category
]
for (Map.Entry<String, String> entry : optionalProps.entrySet()) {
String propKey = entry.getKey()
String propValue = entry.getValue()
if (PROPS_TYPE_MAPPING.containsKey(propKey)) {
Class propType = PROPS_TYPE_MAPPING.get(propKey)
if ((propType != null) && BigInteger.class.isAssignableFrom(propType)) {
properties.put(propKey, new BigInteger(propValue))
} else {
println "Unable to handle optional property type! [key=$propKey, type=$propType]"
}
} else {
properties.put(propKey, propValue)
}
}
properties.put(PropertyIds.SECONDARY_OBJECT_TYPE_IDS, secondaryTypeIds)
ContentStream cs = new ContentStreamImpl(fileName, null, mimeType, inStream)
ObjectId parentObjectId = SESSION.createObjectId(folderId)
String id = SESSION.createDocument(properties, parentObjectId, cs, VersioningState.MAJOR)
println "Document created: $id => $name"
}
private String findObjectId(String repositoryId, String objectPath) {
try {
CmisObject cmisObject = SESSION.getObjectByPath(objectPath)
return cmisObject.getId()
} catch (CmisObjectNotFoundException ex) {
return null
}
}
private List<String> processOptionalSecondaryTypes(String documentKey, Map<String, String> parameters) {
final String typesCreatorClassName = parameters.get(TYPES_CREATOR_CLASS)
final boolean enabled = LEOS_SECONDARY_TYPES_CREATOR_CLASS.equals(typesCreatorClassName)
return enabled ? split(parameters.get(documentKey + ".secondaryTypeIds"), ";") : Collections.<String> emptyList()
}
private List<String> split(String input, String separator) {
List<String> values = Collections.emptyList()
if ((input != null) && (separator != null)) {
StringTokenizer tokenizer = new StringTokenizer(input, separator, false)
if (tokenizer.countTokens() > 0) {
values = new ArrayList<>(tokenizer.countTokens())
while (tokenizer.hasMoreTokens()) {
values.add(tokenizer.nextToken())
}
}
}
return values
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment