jAPS2.0 entando - Upgrading from jAPS 2.0.10 to 2.2.0

Do It The jAPS Way

Eugenio Santoboni

First and complete version in Italian 
Chief Solution Engineer
AgileTec s.r.l.

William Ghelfi

Porting to DocBook 4.5 and translation to English 
Chief Interaction Designer
AgileTec s.r.l.

Matteo Emanuele Minnai

First dreaft in English 
Software Developer
AgileTec s.r.l.

Legal Notice

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the Appendix entitled "GNU Free Documentation License".

The copyright holders make no representation about the suitability of this Document for any purpose. It is provided “as is” without expressed or implied warranty. If you modify this Document in any way, identify your resulting Document as a variant of this Document.

2011-03-04

Revision History
Revision 1.02011-03-03MEM

First public release

Abstract

This document explains how to migrate your existing jAPS installation from the version 2.0.10[.1] to the 2.2.0


Chapter 1. Scope of the document

Introduction

This documents explains how to migrate from version 2.0.10 to 2.2.0

Target audience

This document is for developers aiming to build new plugins for jAPS 2.0 entando.

Prerequisites

In order to take maximum advantage from the present document, it is necessary to have basic knowledge about: the Java platform, the Eclipse IDE, the Apache Tomcat servlet engine, the PosgreSQL DBMS.

Resources

Additional informations may be obtained through the official mailing-lists:

Is it also possible to refer to the documentation found in the:

jAPS 2.0 entando Project - Developer Website

Chapter 2. Definition of the jAPS 2.0 entando platform

Description of the jAPS 2.0 entando

The definition that fits jAPS 2.0 entando is the one of a professional, open source "Enterprise Accessible Information Platform" that helps the aggregation, the publishing, the access and the customization of the informations, services and company resources. This is done in the full respect of the Italian Law "Stanca" as specified in the Accessibility requirements Attachment A - D.M. 8 July 2005 ( accesso dei soggetti disabili agli strumenti informatici, Italian only)

The jAPS 2.0 entando Platform incorporates in a unique solution all the Enterprise characteristics of performances, reliability and scalability proper of the professional Portal systems. Moreover it enables the users with disabilities to manage and consult their own informations in an accessible way. jAPS itself is strongly oriented to information handling with its powerful Content Management System that makes the entire framework the ideal platform to realize application based on contents (Content Enabled Vertical Application).

Chapter 3. System Upgrade

Upgrading an existing installation from jAPS 2.0.10 to jAPS 2.2.0

As a convention we refer to MY_PROJECT as your existing installation of jAPS 2.0.10 in a way that the databases used by such application are <MY_PROJECT>Port and <MY_PROJECT>Serv. Please note that this document refers to the upgrade from jAPS 2.0.10 to 2.2.0 only: to update older versions please refer to the proper documentation to make incremental upgrade(s) until the version 2.0.10. Furthermore, we refer to both jAPS 2.0.10 and 2.0.10.1 indistinctly.

Please also note that, except where otherwise specified, the word system always refers to your jAPS 2.0 entando installation and not the underlying operating system. Before proceeding with the installation process you are strongly advised to make a full backup of the system databases and read the Changelog in the root of the downloaded package.

Before starting the upgrade process make sure to have the <MY_PROJECT>Port and <MY_PROJECT>Serv databases properly installed.

  1. rename the your project <MY_PROJECT> in <MY_PROJECT_OLD>

  2. download the source package jAPS2.0_entando-2.2.0-src- from Sourceforge

    The package is inside the directory jAPS 2.0 entando src/jAPS2.0_entando-2.2.0-src. Choose and download the version and the format the fits your needs.

  3. Use the task ant admin/build_newPortal.xml create a new project named <MY_PROJECT>

  4. In the directory WebContent substitute the directories WEB-INF\aps\jsp\models and WEB-INF\aps\jsp\showlets in the package just created with the old ones of the project to update (in the <MY_PROJECT_OLD> the directories above are inside webroot).

  5. In the directory WebContent substitute the directories resources/cms and resources/static in the package just created with the old ones of the project to update (in the <MY_PROJECT_OLD> the directories above are inside webroot).

  6. The scripts below are intended for the PostgreSQL database: those for the MySQL database are provided in the next chapter.

    Update the Port database <MY_PROJECT>Port with the following queries

    ALTER TABLE pages ADD COLUMN extraconfig character varying;
    
    ALTER TABLE contents ALTER descr TYPE character varying(260);
    
    ALTER TABLE resources ALTER descr TYPE character varying(260);
    
    CREATE TABLE workcontentrelations
    (
      contentid character varying(16) NOT NULL,
      refcategory character varying(30),
      CONSTRAINT workcontentrelations_contentid_fkey FOREIGN KEY (contentid)
          REFERENCES contents (contentid) MATCH SIMPLE
          ON UPDATE NO ACTION ON DELETE NO ACTION
    )
    WITH (OIDS=TRUE);
    
    ALTER TABLE resources ADD COLUMN masterfilename character varying(100);
    UPDATE resources SET masterfilename = 'temp';
    ALTER TABLE resources ALTER COLUMN masterfilename SET NOT NULL;
    
    
    UPDATE sysconfig SET config = '<?xml version="1.0" encoding="UTF-8"?>
    <Params>
    	<Param name="urlStyle">classic</Param>
    	<Param name="hypertextEditor">fckeditor</Param>
    	<Param name="treeStyle_page">classic</Param>
    	<Param name="treeStyle_category">classic</Param>
    	<Param name="startLangFromBrowser">false</Param>
    	<SpecialPages>
    		<Param name="notFoundPageCode">notfound</Param>
    		<Param name="homePageCode">homepage</Param>
    		<Param name="errorPageCode">errorpage</Param>
    		<Param name="loginPageCode">login</Param>
    	</SpecialPages>
    	<ExtendendPrivacyModule>
    		<Param name="extendedPrivacyModuleEnabled">false</Param>
    		<Param name="maxMonthsSinceLastAccess">6</Param>
    		<Param name="maxMonthsSinceLastPasswordChange">3</Param>
    	</ExtendendPrivacyModule>
    </Params>' WHERE item = 'params';
    
    ALTER TABLE contentsearch ALTER COLUMN contentid SET NOT NULL;
    ALTER TABLE contentsearch ALTER COLUMN attrname SET NOT NULL;
    ALTER TABLE contentrelations ALTER COLUMN contentid SET NOT NULL;
    
    CREATE INDEX contents_idx
        ON contents USING btree (contenttype, maingroup);
    CREATE INDEX contentrelations_idx
        ON contentrelations USING btree (contentid, refcategory, refgroup);
    CREATE INDEX contentsearch_idx
        ON contentsearch USING btree (contentid, attrname);
    
    INSERT INTO localstrings(keycode, langcode, stringvalue)
        VALUES ('ADMINISTRATION_BASIC','it','Normale');
    INSERT INTO localstrings(keycode, langcode, stringvalue)
        VALUES ('ADMINISTRATION_BASIC','en','Normal');
    INSERT INTO localstrings(keycode, langcode, stringvalue)
        VALUES ('ADMINISTRATION_MINT','it','Avanzata');
    INSERT INTO localstrings(keycode, langcode, stringvalue)
        VALUES ('ADMINISTRATION_MINT','en','Advanced');
    INSERT INTO localstrings(keycode, langcode, stringvalue)
        VALUES ('ADMINISTRATION_BASIC_GOTO','it','Accedi con client normale');
    INSERT INTO localstrings(keycode, langcode, stringvalue)
        VALUES ('ADMINISTRATION_BASIC_GOTO','en',
            'Go to the administration with normal client');
    INSERT INTO localstrings(keycode, langcode, stringvalue)
        VALUES ('ADMINISTRATION_MINT_GOTO','it','Accedi con client avanzato');
    INSERT INTO localstrings(keycode, langcode, stringvalue)
        VALUES ('ADMINISTRATION_MINT_GOTO','en','Go to the administration with
            advanced client');
    
    
    ALTER TABLE uniquekeys DROP CONSTRAINT sequence_pkey;
    ALTER TABLE uniquekeys ADD CONSTRAINT uniquekeys_pkey PRIMARY KEY(id);
    			
  7. The scripts below are intended for the PostgreSQL database: those for the MySQL database are provided in the next chapter.

    Upgrade the <MY_PROJECT>Serv with the following queries:

    CREATE TABLE authusershortcuts
    (
      username character varying(40) NOT NULL,
      config character varying NOT NULL,
      CONSTRAINT authusershortcuts_pkey PRIMARY KEY (username)
    )
    WITH (OIDS=TRUE);
    
    INSERT INTO authusershortcuts(username, config)
        VALUES ('admin', '<shortcuts>
    	<box pos="0">core.component.user.list</box>
    	<box pos="1">core.component.categories</box>
    	<box pos="2">core.component.labels.list</box>
    	<box pos="3">jacms.content.new</box>
    	<box pos="4">jacms.content.list</box>
    	<box pos="5">jacms.contentType</box>
    	<box pos="6">core.portal.pageTree</box>
    	<box pos="7">core.portal.showletType</box>
    	<box pos="8">core.tools.entities</box>
    	<box pos="9">core.tools.setting</box>
    </shortcuts>');
    			
  8. Access the administration interface then reload the content references. Please note that a restart of the project from the Eclipse IDE may result in a blank page shown in your browser: in this case you have to invoke the login action appending the following code to the resource base URL <BASE_URL>/do/login

  9. Execute the following action <BASE_URL>/do/jacms/Resource/Porting22/intro

Table of Contents

Upgrade scripts for MySQL

Upgrade scripts for MySQL

The following update scripts are intended for MySQL database. After the database update process is complete, resume the porting process interrupted in the last chapter.

  1. Update the Port database <MY_PROJECT>Port with the following queries

    ALTER TABLE pages ADD COLUMN extraconfig longtext;
    
    ALTER TABLE contents MODIFY descr  character varying(260);
    
    ALTER TABLE resources MODIFY descr character varying(260);
    
    CREATE TABLE workcontentrelations
    (
      contentid character varying(16) NOT NULL,
      refcategory character varying(30),
      CONSTRAINT workcontentrelations_contentid_fkey FOREIGN KEY (contentid)
          REFERENCES contents (contentid) MATCH SIMPLE
          ON UPDATE NO ACTION ON DELETE NO ACTION
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
    
    ALTER TABLE resources ADD COLUMN masterfilename 
        character varying(100) NOT NULL;
    UPDATE resources SET masterfilename = 'temp';
    
    UPDATE sysconfig SET config = '<?xml version="1.0" encoding="UTF-8"?>
    <Params>
    	<Param name="urlStyle">classic</Param>
    	<Param name="hypertextEditor">fckeditor</Param>
    	<Param name="treeStyle_page">classic</Param>
    	<Param name="treeStyle_category">classic</Param>
    	<Param name="startLangFromBrowser">false</Param>
    	<SpecialPages>
    		<Param name="notFoundPageCode">notfound</Param>
    		<Param name="homePageCode">homepage</Param>
    		<Param name="errorPageCode">errorpage</Param>
    		<Param name="loginPageCode">login</Param>
    	</SpecialPages>
    	<ExtendendPrivacyModule>
    		<Param name="extendedPrivacyModuleEnabled">false</Param>
    		<Param name="maxMonthsSinceLastAccess">6</Param>
    		<Param name="maxMonthsSinceLastPasswordChange">3</Param>
    	</ExtendendPrivacyModule>
    </Params>' WHERE item = 'params';
    
    ALTER TABLE contentsearch MODIFY contentid varchar(16) NOT NULL;
    ALTER TABLE contentsearch MODIFY attrname varchar(30) NOT NULL;
    ALTER TABLE contentrelations MODIFY contentid varchar(16) NOT NULL;
    
    
    ALTER TABLE contents ADD INDEX USING BTREE (contenttype, maingroup);
    ALTER TABLE contentrelations ADD INDEX 
        USING BTREE (contentid, refcategory, refgroup);
    ALTER TABLE contentsearch ADD INDEX USING BTREE (contentid, attrname);
    
    
    INSERT INTO localstrings(keycode, langcode, stringvalue)
        VALUES ('ADMINISTRATION_BASIC','it','Normale');
    INSERT INTO localstrings(keycode, langcode, stringvalue)
        VALUES ('ADMINISTRATION_BASIC','en','Normal');
    INSERT INTO localstrings(keycode, langcode, stringvalue)
        VALUES ('ADMINISTRATION_MINT','it','Avanzata');
    INSERT INTO localstrings(keycode, langcode, stringvalue)
        VALUES ('ADMINISTRATION_MINT','en','Advanced');
    INSERT INTO localstrings(keycode, langcode, stringvalue)
        VALUES ('ADMINISTRATION_BASIC_GOTO','it','Accedi con client normale');
    INSERT INTO localstrings(keycode, langcode, stringvalue)
        VALUES ('ADMINISTRATION_BASIC_GOTO','en',
            'Go to the administration with normal client');
    INSERT INTO localstrings(keycode, langcode, stringvalue)
        VALUES ('ADMINISTRATION_MINT_GOTO','it','Accedi con client avanzato');
    INSERT INTO localstrings(keycode, langcode, stringvalue)
        VALUES ('ADMINISTRATION_MINT_GOTO','en',
            'Go to the administration with advanced client');
    
    
    ALTER TABLE uniquekeys MODIFY id INT DEFAULT '0';
    			
  2. Update the Port database <MY_PROJECT>Serv with the following queries

    CREATE TABLE authusershortcuts
    (
      username character varying(40) NOT NULL,
      config longtext NOT NULL,
      CONSTRAINT authusershortcuts_pkey PRIMARY KEY (username)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
    
    INSERT INTO authusershortcuts(username, config)
        VALUES ('admin', '<shortcuts>
    	<box pos="0">core.component.user.list</box>
    	<box pos="1">core.component.categories</box>
    	<box pos="2">core.component.labels.list</box>
    	<box pos="3">jacms.content.new</box>
    	<box pos="4">jacms.content.list</box>
    	<box pos="5">jacms.contentType</box>
    	<box pos="6">core.portal.pageTree</box>
    	<box pos="7">core.portal.showletType</box>
    	<box pos="8">core.tools.entities</box>
    	<box pos="9">core.tools.setting</box>
    </shortcuts>');