Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 4f217fcd authored by Anne-Gaëlle Bergé's avatar Anne-Gaëlle Bergé
Browse files

first commit

parents
No related branches found
No related tags found
No related merge requests found
Showing
with 393 additions and 0 deletions
target/
*.toc
*.out
*.aux
*.log
.idea
*.bak
*.iml
ruby-2.3.1
/target
SHELL := /bin/bash
include ../Makefile.generic
---
title: Administration manual
subtitle: Assertion Manager
author: Anne-Gaëlle BERGE
function: Engineer
date: 16/10/2017
toolversion: 4.x
version: 1.02
status: Approved
reference: KER3-MAN-IHE-ASSERTION_MANAGER_ADMIN-1_02
customer: IHE-EUROPE
---
# How to update page numbers in Assertion Manager ?
Assertion Manager is the Gazelle tool to handle the assertions that vendors shall respect to be compliant with a profile.
Each profile is identified with a unique idScheme, which is associated with a PDF document, the official reference of the profile.
When someone enters a new assertion, he needs to fill in the page number where the assertion is found, and the section / figure / table number.
The main problem is when the document is updated, the pages numbers are not good anymore, and it’s then needed to update every assertion, which could be very time consuming manually. This guide will help you to automate the process at best.
## Get the table of contents
This step requires to use Microsoft Word if the document is in doc/docx format. With OpenOffice / LibreOffice the content may be shift, and the page number won’t be the same as in the official documentation.
The first step consists in extracting the table of contents from the technical reference.
The technical reference is often published in both DOC and PDF. If available in DOC format, consider downloading this file, and check that the document is properly formated (with numbered sections).
The document have probably a table of content, but it may not be fully detailed. It’s very important to have the most detailed table of contents you can have.
To do this, go to the bottom of the page of your doc document and insert a table of content as the following :
1. Click on the “References” tab
1. Click on the “Table of contents” arrow button
1. Go to the table of contents tab
1. Put the maximum number at the “levels” section
1. To add tables to the table of contents, click on the "Options" button
1. Find the entry "Table Title", and add any number in the "Level" field
1. Validate
![](./media/admin/tableOfContent.png)
![](./media/admin/inserttable.png)
![](./media/admin/optionsInsertTableTitle.png)
It’s important to insert the table of content at the bottom of the document, otherwise the page numbers will be shift by your new table of contents.
Now, you should have a detailed table of contents like below, with the section (or table) number on the left, and the page number on the right.
![](./media/admin/result.png)
Once you have a properly formated table of contents, the next step will be to transform it into an association between sections and page numbers.
## Associate the section and the page number
The easiest way to associate the section and the page number is to use regular expression (regex) to delete the useless content. You can do regex with many software (vim, oxygen) but one of the most user-friendly way to check in real time your regex is to use an online regex editor as regex101.com
Copy and paste your table of contents in the “Test String” section. With a table of content generated through Word, you can use the following regex :
With /gm option enabled (the regex will apply on multiple lines) :
```
^\[a-zA-Z ]\*((\d?\.?)\*(-\d)?).+\t(.+)
```
This regex will work for a table of contents which uses digits or letters as first indices.
```
^(-Text- )*(\[A-Z](\.\d(\.\d)?)*)*(-\d)?.+\t(.+)
```
This regex will work for a table of contents which has text before listing the first index of each content line. Simply replace "-Text-" with the text to separate (eg. : "Appendix A" can be returned as "A").
It will seperate the section number in different groups, depending on the regex, as you can see in the image below :
![](./media/admin/regex101.png)
It’s then easy to apply an sql script which updates page number from the section number.
A PL/SQL function can be found in the gazelle-assertion-gui project (under src/main/database/update), and is named “update_page_number_based_on_document_id_ignore_section_or_table”. It takes 3 input parameters :
The document's id (which you can find in the 'Documents' section of Assertion Manager)
The section
The page number
Then, you just have to use the “Substitution” function of regex101 to replace the content with :
```
select update_page_number_based_on_scheme('IDDOCUMENT', '\1', '\3');
```
* IDDOCUMENT must be replaced with the id of the document you work on
* \1 will put the content of the group captured in the firsts parenthesis (section number)
* \3 will put the content of the group captured in the thirds parenthesis (page number)
(Be sure to check the group numbers which may change depending on the regex you use)
A typical page update query will then look like the following :
```
select update_page_number_based_on_document_id_ignore_section_or_table(24, '1.1', '12');
```
This will update the document id n°24 to point any section marked as "Section 1.1" to page 12.
## Create and apply the SQL script
The last step simply consists in creating a SQL file with the result of the regex substitution and apply it.
Create a new SQL file and copy / paste the content of the regex substitution function
Apply the script on assertion-manager database with plsql :
```
psql -U gazelle -d assertion-manager < ~/yourPageUpdateFileName.sql
```
The assertion-manager database has a caching system. You may have to wait 3 minutes before seeing the changes on the pages numbers.
![](./media/admin/pagenumbersafter.png)
## Updating section or table numbers
As the documents evolve, the sections or tables and their content might be updated (or deleted), and the assertion might not be up to date and point to the wrong section of the document.
To update this, a PL/SQL function can be found in the gazelle-assertion-gui project (under src/main/database/updateSection.sql), called "update_section_number_based_scheme_and_assertion_id".
It requires 3 parameters :
* idscheme, the assertion scheme's name (eg. : ATNA)
* assertion_id, the assertion's identifier (eg. : ATNA-1)
* sectionnumber, the updated section number to which you want the assertion to point
A fourth, optional parameter allows you to modify the name between a section, a table, or a figure (if the content of an assertion moved from a section to a table, for example) :
* name, which can be 'Section', 'Table', or 'Figure'.
For ease of use, it is recommended to create an SQL file in which you update all the assertions where you found the section to be wrong.
An example of a typical section update :
```
select update_section_number_based_scheme_and_assertion_id('ATNA', 'ATNA-10', '9.1-1');
```
An example of a name update :
```
select update_section_number_based_scheme_and_assertion_id('ATNA', 'ATNA-10', '9.1.1', 'Section');
```
The above line would change the tag from, for example, "Table 9.1-1" to "Section 9.1.1".
Once your file is complete, you can apply the script using plsql, as before :
```
psql -U gazelle -d assertion-manager < ~/yourSectionUpdateFileName.sql
```
\ No newline at end of file
---
title: Installation Manual
subtitle: Assertion Manager
author: Jean-Francois LABBE
function: Engineer
date: 02/09/2016
toolversion: 4.x
version: 1.02
status: Approved document
reference: KER3-MAN-IHE\_EUROPE-ASSERTION\_MANAGER\_INSTALLATION-1\_02
customer: IHE-EUROPE
---
# Purpose
Here is a guide to help you install Assertion Manager.
# Requirements
* Debian squeeze or ubuntu 12.04 64bits with an Internet access.
* Database : PostGresql 8.4
* Java virtual machine : JDK 1.6 or other
* Application server : Jboss 5.1.0-GA
* It must be installed in: `/usr/local/jboss`
* A server named gazelle must be here: `/usr/local/jboss/server/gazelle/`
To install those requirements you can run this as root:
```bash
wget https://gazelle.ihe.net/jenkins/job/gazelle-public-release/ws/gazelle-tm-ear/src/main/scripts/setup.sh
chmod +x setup.sh
./setup.sh
```
# Quick start
Assertion manager can be installed
As a gazelle user on your server:
```bash
wget https://gazelle.ihe.net/jenkins/job/AssertionManager-Gui-SNAPSHOT/ws/install_assertion_manager_gui.sh
chmod +x install_assertion_manager_gui.sh
sudo install_assertion_manager_gui.sh
```
It will:
* Backup the previous EAR
* Get the latest released version of Assertion Manager and deploy it in your jboss.
* Create the database if it doesn't exists.
## Insert configuration values
Go to [*insert configuration values chapter*](https://gazelle.ihe.net/content/configurationsValues) to configure your Assertion manager
## Restart Jboss service
```bash
sudo service jboss restart
```
**Assertion manager is now deployed.**
# Compile from sources
The following chapters will explain how to build and configure Assertion manager from sources.
This is useful only to change the database configuration.
Assertion Manager is an open source project under Apache2 licence. The sources are available on the INRIA's Forge:
```bash
sudo apt-get install maven2 subversion
svn checkout svn://scm.gforge.inria.fr/svn/gazelle/Maven/gazelle-assertion-gui/trunk/ assertion-manager-gui
svn checkout svn://scm.gforge.inria.fr/svn/gazelle/Maven/gazelle-assertion-gui/trunk/ assertion-manager
cd assertion-manager
mvn clean install
cd ../assertion-manager-gui
mvn clean package -U -Pproduction
```
If maven cannot download dependencies checkout the maven configuration guide: [*https://gazelle.ihe.net/content/development-support-tools*](https://gazelle.ihe.net/content/development-support-tools)
## Database creation and initialization
The names of the databases are defined in the pom.xml file. Use the following commands with the adaptations you want:
```bash
su postgres
psql
postgres=\# CREATE USER gazelle;
postgres=\# ALTER USER gazelle WITH ENCRYPTED PASSWORD 'password';
postgres=\# CREATE DATABASE "assertion-manager" OWNER gazelle ENCODING UTF-8;
postgres=\# CREATE DATABASE "assertion-manager-gui" OWNER gazelle ENCODING UTF-8;
postgres=\# \\q
exit
```
### Insert configuration values
Configuration can be done through the Administration interface, or with a sql script
Each time a configuration is modified, the application needs to be restarted.
To restart the application there are 2 options:
* Restart jboss: *sudo service jboss restart*
* Touch the ear: *touch /pathToJbossServer/deploy/AssertionManagerGui.ear*
![](./media/application_preference_menu.png)
Here is the list of configuration variables that must be defined:
| Variable| Default value| Description|
|---------|--------------|------------|
| application_url |http://server_domain:8080/AssertionManager| URL to reach the tool|
| application_works_without_cas | true | Indicates authentication mechanism to use|
| ip_login | true | Indicates authentication mechanism to use|
| ip_login_admin | .\* | Pattern to grant users as admin based on their IP address|
| cas_url | Not defined| URL of the CAS service|
| upload_max_size | 100000000| Used to limit uploaded files size|
| assertion_manager_rest_path_to_assertion | /testAssertion/assertion| do not change|
| assertion_manager_rest_url | https://server_domain:8080/AssertionManagerGui/rest| update server_domain:8080 to fit your needs.|
| security-policies | true | Enable security features|
| X-Frame-Options | SAMEORIGIN| https://developer.mozilla.org/en-US/docs/Web/HTTP/X-Frame-Options|
| Cache-Control | private, no-cache, no-store, must-revalidate, max-age=0| https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers#Cache-control|
| Strict-Transport-Security | max-age=31536000 ; includeSubDomains| https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers#Cache-control|
| X-Content-Security-Policy | | https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers#Cache-control|
| X-WebKit-CSP | Use X-Content-Security-Policy values | |
| X-WebKit-CSP-Report-Only | Use X-Content-Security-Policy-Report-Only values | |
| X-Content-Security-Policy-Report-Only | default-src self \*.ihe-europe.net; script-src self unsafe-eval unsafe-inline ; style-src self unsafe-inline ; | https://developer.mozilla.org/en-US/docs/Web/Security/CSP/Using_Content_Security_Policy |
| sql_injection_filter_switch | true | Enable sql injection filtering|
| gazelle_test-managment-url | https://server_domain:8080/gazelle/rest/ | points to gazelle test managment rest interface|
| application_documentation | https://gazelle.ihe.net/content/assertion-manager| |
| documentation_url | https://gazelle.ihe.net/content/assertion-manager| |
| application_release_notes_url | https://gazelle.ihe.net/jira/browse/AS#selectedTab=com.atlassian.jira.plugin.system.project%3Achangelog-panel | |
| application_issue_tracker_url | https://gazelle.ihe.net/browse/EVSCLT| URL of the project in the issue tracking system |
To insert values with a sql script, connect to the database
```bash
su postgres
psql assertion-manager-gui
```
Then copy paste the folowing script:
```sql
SET statement\_timeout = 0;
SET lock\_timeout = 0;
SET client\_encoding = 'UTF8';
SET standard\_conforming\_strings = on;
SET check\_function\_bodies = false;
SET client\_min\_messages = warning;
SET search\_path = public, pg\_catalog;
SET default\_tablespace = '';
SET default\_with\_oids = false;
--
-- Name: app\_configuration; Type: TABLE; Schema: public; Owner: gazelle; Tablespace:
--
CREATE TABLE app\_configuration (
id integer NOT NULL,
value character varying(255),
variable character varying(255)
);
ALTER TABLE public.app\_configuration OWNER TO gazelle;
--
-- Name: app\_configuration\_pkey; Type: CONSTRAINT; Schema: public; Owner: gazelle; Tablespace:
--
ALTER TABLE ONLY app\_configuration
ADD CONSTRAINT app\_configuration\_pkey PRIMARY KEY (id);
--
-- Name: variable\_unique; Type: CONSTRAINT; Schema: public; Owner: gazelle; Tablespace:
--
ALTER TABLE ONLY app\_configuration
ADD CONSTRAINT variable\_unique UNIQUE (variable);
--
-- Data for Name: app\_configuration; Type: TABLE DATA; Schema: public; Owner: gazelle
--
INSERT INTO app\_configuration VALUES (1, 'false', 'ip\_login');
INSERT INTO app\_configuration VALUES (2, '.\*', 'ip\_login\_admin');
INSERT INTO app\_configuration VALUES (3, '100000000', 'upload\_max\_size');
INSERT INTO app\_configuration VALUES (4, '/testAssertion/assertion', 'assertion\_manager\_rest\_path\_to\_assertion');
INSERT INTO app\_configuration VALUES (5, 'https://server_domain:8080/AssertionManagerGui/rest', 'assertion\_manager\_rest\_url'); --update with your server domain example: https://gazelle.ihe.net/AssertionManagerGui/rest
INSERT INTO app\_configuration VALUES (6, 'true', 'security-policies');
INSERT INTO app\_configuration VALUES (7, 'SAMEORIGIN', 'X-Frame-Options');
INSERT INTO app\_configuration VALUES (8, 'private, no-cache, no-store, must-revalidate, max-age=0', 'Cache-Control');
INSERT INTO app\_configuration VALUES (9, 'max-age=31536000 ; includeSubDomains', 'Strict-Transport-Security');
INSERT INTO app\_configuration VALUES (10, '', 'X-Content-Security-Policy');
INSERT INTO app\_configuration VALUES (11, 'Use X-Content-Security-Policy values', 'X-WebKit-CSP');
INSERT INTO app\_configuration VALUES (12, 'Use X-Content-Security-Policy-Report-Only values', 'X-WebKit-CSP-Report-Only');
INSERT INTO app\_configuration VALUES (13, 'default-src self \*.ihe-europe.net; script-src self unsafe-eval unsafe-inline ; style-src self unsafe-inline ;', 'X-Content-Security-Policy-Report-Only');
INSERT INTO app\_configuration VALUES (14, 'true', 'sql\_injection\_filter\_switch');
INSERT INTO app\_configuration VALUES (15, 'https://server_domain:8080/AssertionManagerGui', 'application\_url'); --update with your server domain
INSERT INTO app\_configuration VALUES (16, 'false', 'application\_works\_without\_cas');
INSERT INTO app\_configuration VALUES (17, 'https://server_domain:8080/cas', 'cas\_url'); --update with your server domain
INSERT INTO app\_configuration VALUES (18, 'https://server_domain:8080/gazelle/rest/', 'gazelle\_test-managment-url'); --update with your server domain
INSERT INTO app\_configuration VALUES (19, 'https://gazelle.ihe.net/content/assertion-manager', 'application\_documentation');
INSERT INTO app\_configuration VALUES (20, 'https://gazelle.ihe.net/content/assertion-manager', 'documentation\_url');
INSERT INTO app\_configuration VALUES (21, 'https://gazelle.ihe.net/jira/browse/AS\#selectedTab=com.atlassian.jira.plugin.system.project%3Achangelog-panel', 'application\_release\_notes\_url');
```
## Compile
Before compiling, go to the directory gazelle-tm and edit the file pom.xml. Open this file and adapt the properties of profile prod to your case :
* jdbc.connection.url : jdbc:postgresql:assertion-manager-gui
* jdbc.connection.url2 : jdbc:postgresql:assertion-manager
* jdbc.connection.user / jdbc.connection.password : credentials for database access
Then, create the EAR archive with the command line:
```bash
cd assertion-manager
mvn install
cd ..
cd assertion-manager-gui
mvn clean package -Pproduction
```
The archive (EAR) and the distribution file are created and placed into assertion-manager-gui/AssertionManagerGui-ear/target directory.
## Deployment
Copy the AssertionManagerGui.ear into the "server/gazelle/deploy" directory of your JBoss server. Finally, start your server.
When the application is deployed, open a browser and go to http://yourserver/AssertionManagerGui.
If the deployment and the database initialization are successful you should see the home page.
![](./media/home_page.png)
Assertion-Manager/media/IdSchemes_create.png

1.68 KiB

Assertion-Manager/media/IdSchemes_creation.png

14.3 KiB

Assertion-Manager/media/IdSchemes_edit_page.png

12.9 KiB

Assertion-Manager/media/IdSchemes_importAssertions.png

24.6 KiB

Assertion-Manager/media/IdSchemes_review_page.png

397 KiB

Assertion-Manager/media/IdSchemes_save.png

954 B

Assertion-Manager/media/IdSchemes_view_page.png

22.9 KiB

Assertion-Manager/media/Scope_add_selection.png

1.63 KiB

Assertion-Manager/media/Scope_create.png

1.1 KiB

Assertion-Manager/media/Scope_create_page.png

10.8 KiB

Assertion-Manager/media/Scope_edit_page1.png

60.7 KiB

Assertion-Manager/media/Scope_edit_page2.png

105 KiB

Assertion-Manager/media/Scope_link_selection.png

1.52 KiB

Assertion-Manager/media/Scope_remove_selection.png

1.91 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment