Installation d'un socle esup-uportal 4 sous centos 7
cette installation de socle se fait sur un serveur virtuel openvz - centos 7
[root@esup4dz ~]# cat /etc/redhat-release CentOS Linux release 7.1.1503 (Core) [root@esup4dz ~]# free total used free shared buff/cache available Mem: 2097152 1348 2044888 68 50916 2038945 Swap: 0 0 0 [root@esup4dz ~]# arch x86_64
[root@esup4dz ~]# diff -ur /etc/security/limits.conf /etc/security/limits.conf.orig --- /etc/security/limits.conf 2015-05-20 09:33:34.602811037 +0200 +++ /etc/security/limits.conf.orig 2015-05-20 09:32:23.273060121 +0200 @@ -14,7 +14,6 @@ #Each line describes a limit for a user in the form: # #<domain> <type> <item> <value> -uportal hard nofile 8192 #
doc postgres: http://wiki.postgresql.org/wiki/YUM_Installation
disposer d'un serveur de BD (orientation postgres plutot que le traditionel mysql)
[root@esup4dz ~]# yum install postgresql-server Installed: postgresql-server.x86_64 0:9.2.10-2.el7_1 Dependency Installed: postgresql.x86_64 0:9.2.10-2.el7_1 postgresql-libs.x86_64 0:9.2.10-2.el7_1
lancement automatique
[root@esup4dz ~]# systemctl enable postgresql.service ln -s '/usr/lib/systemd/system/postgresql.service' '/etc/systemd/system/multi-user.target.wants/postgresql.service'
initialisation postgres
[root@esup4dz ~]# postgresql-setup initdb Initializing database ... OK
demarrage au boot et manuel
[root@esup4dz ~]# systemctl start postgresql.service [root@esup4dz ~]# systemctl status postgresql.service postgresql.service - PostgreSQL database server Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled) Active: active (running) since Wed 2015-05-20 09:39:45 CEST; 1s ago Process: 504 ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT} -w -t 300 (code=exited, status=0/SUCCESS) Process: 497 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS) CGroup: /system.slice/postgresql.service |-507 /usr/bin/postgres -D /var/lib/pgsql/data -p 5432 |-508 postgres: logger process |-510 postgres: checkpointer process |-511 postgres: writer process |-512 postgres: wal writer process |-513 postgres: autovacuum launcher process `-514 postgres: stats collector process May 20 09:39:44 esup4dz systemd[1]: Starting PostgreSQL database server...
create database et user, ref: http://www.cyberciti.biz/faq/howto-add-postgresql-user-account/
LANG/LOCALE: http://www.postgresql.org/docs/8.4/static/multibyte.html
[root@esup4dz ~]# su - postgres -bash-4.2$ psql psql (9.2.10) Type "help" for help. postgres=# CREATE DATABASE uportaldz WITH ENCODING 'UTF8' LC_COLLATE='fr_FR.UTF-8' LC_CTYPE='fr_FR.UTF-8' TEMPLATE=template0; CREATE DATABASE postgres=# create USER uportaluz with password 'secretpass'; CREATE ROLE postgres=# grant all privileges on database uportaldz to uportaluz; GRANT postgres-# \q -bash-4.2$ psql -l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges -----------+----------+-----------+-------------+-------------+------------------------ postgres | postgres | SQL_ASCII | C | C | template0 | postgres | SQL_ASCII | C | C | =c/postgres + | | | | | postgres=CTc/postgres template1 | postgres | SQL_ASCII | C | C | =c/postgres + | | | | | postgres=CTc/postgres uportaldz | postgres | UTF8 | fr_FR.UTF-8 | fr_FR.UTF-8 | =Tc/postgres + | | | | | postgres=CTc/postgres + | | | | | uportaluz=CTc/postgres (4 rows)
ensuite, faut-il appliquer ce patch : https://www.esup-portail.org/pages/viewpage.action?pageId=269090823 ?
suite a une mise a jour a chaud sur le container openvz, apres un redemrrage des services (tomcat, postgres …) le portail ne marchait plus !
uPortal.log:
[esup4] WARN [main] Jan/09 09:26:33,041 jdbc.TomcatDataSourceFactory.[] - Failed to register connection pool with MBeanServer. JMX information will not be available for: RawEventsDb org.postgresql.util.PSQLException: FATAL: database locale is incompatible with operating system Detail: The database was initialized with LC_COLLATE "fr_FR.UTF-8", which is not recognized by setlocale(). Hint: Recreate the database with another locale or install the missing locale.
cette erreure est expliquée sur http://serverfault.com/questions/491237/postgresql-9-2-invalid-locale-name-on-ubuntu-12-04
où la conclusion est :
If PostgreSQL hasn't been restarted after the new locale has been created, that would be the reason. service postgresql restart should suffice. This is presumably due to how locales are implemented in Linux libc. The new locales don't get seamlessly imported into the environment of already running processes.
donc simplement en redemarrant la VM , tout repart sans soucis !
ouverture acces BD en mode trust (ident par defaut n'autorise pas )
-bash-4.2$ diff -ur /var/lib/pgsql/data/pg_hba.conf.orig /var/lib/pgsql/data/pg_hba.conf --- /var/lib/pgsql/data/pg_hba.conf.orig 2015-05-20 11:26:51.151797968 +0200 +++ /var/lib/pgsql/data/pg_hba.conf 2015-05-20 11:28:02.209761561 +0200 @@ -79,7 +79,8 @@ # "local" is for Unix domain socket connections only local all all peer # IPv4 local connections: -host all all 127.0.0.1/32 ident +host all all 127.0.0.1/32 trust # IPv6 local connections: host all all ::1/128 ident # Allow replication connections from localhost, by a user with the
verification
[root@esup4dz ~]# psql -d uportaldz -U uportaluz -h 127.0.0.1 -W Password for user uportaluz: gl..usernamefull psql (9.2.10) Type "help" for help. uportaldz=> uportaldz=> \d No relations found. uportaldz=> \q
https://github.com/openshift/postgresql/issues/97
$ systemctl status postgresql.service * postgresql.service - PostgreSQL database server Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Wed 2016-05-25 14:58:07 CEST; 1min 38s ago Process: 326 ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT} -w -t 300 (code=exited, status=1/FAILURE May 25 14:58:06 esup4dz pg_ctl[326]: DETAIL: Failed system call was shmget(key=5432001, size=41222144, 03600). May 25 14:58:06 esup4dz pg_ctl[326]: HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter. You can ... May 25 14:58:06 esup4dz pg_ctl[326]: If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raisin...called for. May 25 14:58:06 esup4dz pg_ctl[326]: The PostgreSQL documentation contains more information about shared memory configuration. May 25 14:58:07 esup4dz pg_ctl[326]: pg_ctl: could not start server May 25 14:58:07 esup4dz pg_ctl[326]: Examine the log output. May 25 14:58:07 esup4dz systemd[1]: postgresql.service: control process exited, code=exited status=1
resolution : http://www.cyber-neurones.org/2015/11/postgresql-maximum-de-connexion-en-simultanes/
reduction du nombre de connexion max par defaut et augmentation shmmax
[root@esup4dz /var/log] $ grep max_connections /var/lib/pgsql/data/postgresql.conf max_connections = 25 # (change requires restart) $ cat /proc/sys/kernel/shmmax 33554432 [root@esup4dz /var/log] $ sysctl -w kernel.shmmax=44554432 kernel.shmmax = 44554432 [root@esup4dz /var/log] $ cat /proc/sys/kernel/shmmax 44554432 $ systemctl start postgresql.service [root@esup4dz /var/log] $ systemctl status postgresql.service * postgresql.service - PostgreSQL database server Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2016-05-25 15:22:31 CEST; 4s ago
options JVM cf desciptions de script sur la video1 du tuto esup 3.2 en 2012 (~20mn cf video dernier chapitre)
Les centos/redhat proposent par defaut un environement Java a base de openjdk et gcj . initialement pas entierement compatible avec esup-uPortal, mais ici nous utiliserons les packages openjdk de la redhat/centos.
[root@esup4dz ~]# yum install java-1.7.0-openjdk-devel Installed: java-1.7.0-openjdk-devel.x86_64 1:1.7.0.79-2.5.5.1.el7_1 Install 1 Package (+65 Dependent packages) Total download size: 49 M Installed size: 180 M Is this ok [y/d/N]: y Installed: java-1.7.0-openjdk-devel.x86_64 1:1.7.0.79-2.5.5.1.el7_1 Dependency Installed: alsa-lib.x86_64 0:1.0.28-2.el7 atk.x86_64 0:2.8.0-4.el7 cairo.x86_64 0:1.12.14-6.el7 flac-libs.x86_64 0:1.3.0-5.el7_1 fontconfig.x86_64 0:2.10.95-7.el7 fontpackages-filesystem.noarch 0:1.44-8.el7 freetype.x86_64 0:2.4.11-10.el7_1.1 gdk-pixbuf2.x86_64 0:2.28.2-4.el7 giflib.x86_64 0:4.1.6-9.el7 graphite2.x86_64 0:1.2.2-5.el7 gsm.x86_64 0:1.0.13-11.el7 gtk2.x86_64 0:2.24.22-5.el7_0.1 harfbuzz.x86_64 0:0.9.20-4.el7 hicolor-icon-theme.noarch 0:0.12-7.el7 hwdata.x86_64 0:0.252-7.8.el7_1 jasper-libs.x86_64 0:1.900.1-26.el7_0.3 java-1.7.0-openjdk.x86_64 1:1.7.0.79-2.5.5.1.el7_1 java-1.7.0-openjdk-headless.x86_64 1:1.7.0.79-2.5.5.1.el7_1 javapackages-tools.noarch 0:3.4.1-6.el7_0 jbigkit-libs.x86_64 0:2.0-11.el7 lcms2.x86_64 0:2.5-4.el7 libICE.x86_64 0:1.0.8-7.el7 libSM.x86_64 0:1.2.1-7.el7 libX11.x86_64 0:1.6.0-2.1.el7 libX11-common.noarch 0:1.6.0-2.1.el7 libXau.x86_64 0:1.0.8-2.1.el7 libXcomposite.x86_64 0:0.4.4-4.1.el7 libXcursor.x86_64 0:1.1.14-2.1.el7 libXdamage.x86_64 0:1.1.4-4.1.el7 libXext.x86_64 0:1.3.2-2.1.el7 libXfixes.x86_64 0:5.0.1-2.1.el7 libXfont.x86_64 0:1.4.7-2.el7_0 libXft.x86_64 0:2.3.1-5.1.el7 libXi.x86_64 0:1.7.2-2.1.el7 libXinerama.x86_64 0:1.1.3-2.1.el7 libXrandr.x86_64 0:1.4.1-2.1.el7 libXrender.x86_64 0:0.9.8-2.1.el7 libXtst.x86_64 0:1.2.2-2.1.el7 libXxf86vm.x86_64 0:1.1.3-2.1.el7 libasyncns.x86_64 0:0.8-7.el7 libdrm.x86_64 0:2.4.56-2.el7 libfontenc.x86_64 0:1.1.1-5.el7 libjpeg-turbo.x86_64 0:1.2.90-5.el7 libogg.x86_64 2:1.3.0-7.el7 libpciaccess.x86_64 0:0.13.1-4.1.el7 libpng.x86_64 2:1.5.13-5.el7 libsndfile.x86_64 0:1.0.25-9.el7 libthai.x86_64 0:0.1.14-9.el7 libtiff.x86_64 0:4.0.3-14.el7 libvorbis.x86_64 1:1.3.3-8.el7 libxcb.x86_64 0:1.9-5.el7 libxslt.x86_64 0:1.1.28-5.el7 mesa-libEGL.x86_64 0:10.2.7-5.20140910.el7 mesa-libGL.x86_64 0:10.2.7-5.20140910.el7 mesa-libgbm.x86_64 0:10.2.7-5.20140910.el7 mesa-libglapi.x86_64 0:10.2.7-5.20140910.el7 pango.x86_64 0:1.34.1-5.el7 pixman.x86_64 0:0.32.4-3.el7 pulseaudio-libs.x86_64 0:3.0-30.el7 python-javapackages.noarch 0:3.4.1-6.el7_0 python-lxml.x86_64 0:3.2.1-4.el7 ttmkfdir.x86_64 0:3.0.9-41.el7 tzdata-java.noarch 0:2015d-1.el7 xorg-x11-font-utils.x86_64 1:7.5-18.1.el7 xorg-x11-fonts-Type1.noarch 0:7.5-9.el7 Complete!
installer git
[root@esup4dz /etc/tomcat] $ yum install git Transaction Summary ========================== Install 1 Package (+4 Dependent packages) Total download size: 4.5 M Installed size: 22 M Is this ok [y/d/N]: y Installed: git.x86_64 0:1.8.3.1-4.el7 Dependency Installed: libgnome-keyring.x86_64 0:3.8.0-3.el7 perl-Error.noarch 1:0.17020-2.el7 perl-Git.noarch 0:1.8.3.1-4.el7 perl-TermReadKey.x86_64 0:2.30-20.el7 Complete!
Installation de tomcat7 et des admin-webapps pour disposer le temps du deploiement du tomcat manager .
[root@esup4dz ~]# yum install tomcat-7 tomcat-admin-webapps Transaction Summary ========================================= Install 1 Package (+21 Dependent packages) Total download size: 11 M Installed size: 14 M Is this ok [y/d/N]: y Installed: tomcat-admin-webapps.noarch 0:7.0.54-2.el7_1 Dependency Installed: apache-commons-collections.noarch 0:3.2.1-21.el7 apache-commons-daemon.x86_64 0:1.0.13-6.el7 apache-commons-dbcp.noarch 0:1.4-17.el7 apache-commons-logging.noarch 0:1.1.2-7.el7 apache-commons-pool.noarch 0:1.6-9.el7 avalon-framework.noarch 0:4.3-10.el7 avalon-logkit.noarch 0:2.1-14.el7 ecj.x86_64 1:4.2.1-8.el7 geronimo-jms.noarch 0:1.1.1-19.el7 geronimo-jta.noarch 0:1.1.1-17.el7 javamail.noarch 0:1.4.6-8.el7 log4j.noarch 0:1.2.17-15.el7 tomcat.noarch 0:7.0.54-2.el7_1 tomcat-el-2.2-api.noarch 0:7.0.54-2.el7_1 tomcat-jsp-2.2-api.noarch 0:7.0.54-2.el7_1 tomcat-lib.noarch 0:7.0.54-2.el7_1 tomcat-servlet-3.0-api.noarch 0:7.0.54-2.el7_1 xalan-j2.noarch 0:2.7.1-23.el7 xerces-j2.noarch 0:2.11.0-17.el7_0 xml-commons-apis.noarch 0:1.4.01-16.el7 xml-commons-resolver.noarch 0:1.2-15.el7 Complete!
root@esup4dz ~] $ systemctl list-unit-files | grep -i tomcat tomcat.service disabled tomcat@.service disabled root@esup4dz ~] $ systemctl enable tomcat.service ln -s '/usr/lib/systemd/system/tomcat.service' '/etc/systemd/system/multi-user.target.wants/tomcat.service' [root@esup4dz ~] $ systemctl start tomcat.service [root@esup4dz ~] $ systemctl status tomcat.service tomcat.service - Apache Tomcat Web Application Container Loaded: loaded (/usr/lib/systemd/system/tomcat.service; enabled) Active: active (running) since Wed 2015-05-20 14:57:37 CEST; 3s ago Main PID: 1777 (java) CGroup: /system.slice/tomcat.service `-1777 java -classpath /usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:/usr/share/java/commons-daemon.jar -Dcatalina.base=/usr/share/tomcat -Dcata... May 20 14:57:40 esup4dz server[1777]: May 20, 2015 2:57:40 PM org.apache.catalina.startup.HostConfig deployDirectory ...
$ git diff bec5455 tomcat.conf diff --git a/tomcat.conf b/tomcat.conf index f28eb1d..920d3a1 100644 --- a/tomcat.conf +++ b/tomcat.conf @@ -29,6 +29,7 @@ CATALINA_TMPDIR="/var/cache/tomcat/temp" # You can pass some parameters to java here if you wish to #JAVA_OPTS="-Xminf0.1 -Xmaxf0.3" +JAVA_OPTS="-server -Xms256m -Xmx2048m -XX:MaxPermSize=256m -XX:+UseParallelGC -Djava.net.preferIPv4Stack=true -Dnetworkaddress.cache.ttl=3600 -Djava.awt.headless=true -Dcom.sun.manageme # Use JAVA_OPTS to set java.library.path for libtcnative.so #JAVA_OPTS="-Djava.library.path=/usr/lib"
on commence par versionner par git l'arborescence de fichier de conf tomcat
[root@esup4dz /etc/tomcat] $ git add * [root@esup4dz /etc/tomcat] $ git commit -a -m "add etc/tomcat/* files " 11 files changed, 5617 insertions(+) create mode 100644 catalina.policy create mode 100644 catalina.properties create mode 100644 catalina.properties.orig create mode 100644 context.xml create mode 100644 log4j.properties create mode 100644 logging.properties create mode 100644 server.xml create mode 100644 server.xml.orig create mode 100644 tomcat-users.xml create mode 100644 tomcat.conf
edition et commit de tomcat-users.xml
$ vim tomcat-users.xml [root@esup4dz /etc/tomcat] $ git status # On branch master # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: tomcat-users.xml # no changes added to commit (use "git add" and/or "git commit -a") [root@esup4dz /etc/tomcat] $ git commit -a -m " ajout disi user a tomcat-users.xml" [master df788ae] ajout disi user a tomcat-users.xml 1 file changed, 9 insertions(+), 8 deletions(-)
[root@esup4dz /etc/tomcat] $ git log tomcat-users.xml commit df788ae3a20b5888c025c0b30508f879c624bc23 Author: jehan <jehan.procaccia@tem-tsp.eu> Date: Wed May 20 15:22:08 2015 +0200 ajout disi user a tomcat-users.xml commit bec5455c1d272a3522d713295dfcf7e97775644c Author: root <root@esup4dz.tem-tsp.eu> Date: Wed May 20 15:02:16 2015 +0200 add etc/tomcat<C3><82>/* files [root@esup4dz /etc/tomcat] $ git diff df788ae3a20b5888c025c0b30508f879c624bc23 tomcat-users.xml [root@esup4dz /etc/tomcat] $ git diff df788ae3a20b5888c025c0b30508f879c624bc23 bec5455c1d272a3522d713295dfcf7e97775644c tomcat-users.xml diff --git a/tomcat-users.xml b/tomcat-users.xml index 22898b9..7224d60 100644 --- a/tomcat-users.xml +++ b/tomcat-users.xml @@ -33,15 +33,14 @@ <user username="both" password="tomcat" roles="tomcat,role1"/> <user username="role1" password="tomcat" roles="role1"/> --> -<user username="dsi" password="s3cret" roles="manager-gui,manager-script,manager-jmx,manager-status"/> -<role rolename="admin"/> -<role rolename="admin-gui"/> -<role rolename="admin-script"/> -<role rolename="manager"/> -<role rolename="manager-gui"/> -<role rolename="manager-script"/> -<role rolename="manager-jmx"/> -<role rolename="manager-status"/> +<!-- <role rolename="admin"/> --> +<!-- <role rolename="admin-gui"/> --> +<!-- <role rolename="admin-script"/> --> +<!-- <role rolename="manager"/> --> +<!-- <role rolename="manager-gui"/> --> +<!-- <role rolename="manager-script"/> --> +<!-- <role rolename="manager-jmx"/> --> +<!-- <role rolename="manager-status"/> --> <!-- <user name="admin" password="adminadmin" roles="admin,manager,admin-gui,admin-script,manager-gui,manager-script,manager-jmx,manager-status" /> --> </tomcat-users>
un acces http://esup4dz.tem-tsp.eu:8080/manager/html avec auth + pass affiche la liste des webapps dans le navigateur .
en tomcat5 il y avait des librairies dans common et shared, depuis le 6 il y a seulement un repertoire lib. pour la compatibilité avec les anciens canaux esup , il faut recreer cette arborescence de lib.
cf https://www.esup-portail.org/pages/viewpage.action?pageId=257949820
[root@esupdev3 /usr/share/tomcat5] $ ls -al total 12 drwxr-xr-x 3 root root 4096 oct 15 2009 . drwxr-xr-x 50 root root 4096 jun 19 2009 .. drwxr-xr-x 2 root root 4096 oct 15 2009 bin lrwxrwxrwx 1 root root 23 oct 15 2009 common -> /var/lib/tomcat5/common lrwxrwxrwx 1 root root 12 oct 15 2009 conf -> /etc/tomcat5 lrwxrwxrwx 1 root root 16 oct 15 2009 logs -> /var/log/tomcat5 lrwxrwxrwx 1 root root 23 oct 15 2009 server -> /var/lib/tomcat5/server lrwxrwxrwx 1 root root 23 oct 15 2009 shared -> /var/lib/tomcat5/shared lrwxrwxrwx 1 root root 23 oct 15 2009 temp -> /var/cache/tomcat5/temp lrwxrwxrwx 1 root root 24 oct 15 2009 webapps -> /var/lib/tomcat5/webapps lrwxrwxrwx 1 root root 23 oct 15 2009 work -> /var/cache/tomcat5/work
[root@esup4dz /usr/share/tomcat] $ ls -l total 4 drwxr-xr-x 2 root root 4096 May 20 11:40 bin lrwxrwxrwx 1 root tomcat 11 May 20 11:40 conf -> /etc/tomcat lrwxrwxrwx 1 root tomcat 22 May 20 11:40 lib -> /usr/share/java/tomcat lrwxrwxrwx 1 root tomcat 15 May 20 11:40 logs -> /var/log/tomcat lrwxrwxrwx 1 root tomcat 22 May 20 11:40 temp -> /var/cache/tomcat/temp lrwxrwxrwx 1 root tomcat 23 May 20 11:40 webapps -> /var/lib/tomcat/webapps lrwxrwxrwx 1 root tomcat 22 May 20 11:40 work -> /var/cache/tomcat/work
adaptation
$ cd /var/lib/tomcat [root@esup4dz /var/lib/tomcat] $ ls -l total 4 drwxrwxr-x 4 root tomcat 4096 May 20 11:40 webapps [root@esup4dz /var/lib/tomcat] $ mkdir -p /var/lib/tomcat/common/classes ; mkdir -p /var/lib/tomcat/common/endorsed ; mkdir -p /var/lib/tomcat/common/lib ; mkdir -p /var/lib/tomcat/shared/classes ; mkdir -p /var/lib/tomcat/shared/lib [root@esup4dz /var/lib/tomcat] $ ls -l total 12 drwxr-xr-x 5 root root 4096 May 20 11:50 common drwxr-xr-x 4 root root 4096 May 20 11:50 shared drwxrwxr-x 4 root tomcat 4096 May 20 11:40 webapps
modification de catalina.properties
[root@esup4dz /var/lib/tomcat] $ diff /etc/tomcat/catalina.properties.orig /etc/tomcat/catalina.properties 49c49 < common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar --- > common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/common/classes,${catalina.home}/common/endorsed/*.jar,${catalina.home}/common/lib/*.jar
pb deja rencontré par le passé, cf https://listes.esup-portail.org/sympa/arc/esup-utilisateurs/2010-05/msg00073.html
cf https://www.esup-portail.org/pages/viewpage.action?pageId=257949820
[root@esup4dz /etc/tomcat] $ diff server.xml.orig server.xml 92c92 < <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> --- > <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" connectionTimeout="20000" emptySessionPath="true"/>
c'est bien openjdk-1.7 que nous avons installé :
[root@esup4dz /etc/tomcat] $ /usr/sbin/alternatives --config java There is 1 program that provides 'java'. Selection Command ----------------------------------------------- *+ 1 /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.79-2.5.5.1.el7_1.x86_64/jre/bin/java
Tentative initiale avec ant depuis les packages originaux de la centos , mais on verra plus bas qu'on va finalement se rabattre sur du tar.gz, je laisse ces installations rpm car elles apportent peut-etre des dépendances necessaires par ailleurs.
[root@esup4dz /etc/tomcat] $ yum install ant Installed: ant.noarch 0:1.9.2-9.el7 Complete!
si au premier lancement de ant sur le package esup il plante sur :
[esup@esup3re7 esup-install]$ ant usage Buildfile: build.xml BUILD FAILED /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/build.xml:14: Problem: failed to create task or type replaceregexp Cause: the class org.apache.tools.ant.taskdefs.optional.ReplaceRegExp was not found. ...
il manque alors le package ant-nodeps
[root@esup3re7 ~]# yum install ant-nodeps Total download size: 695 k Installed size: 1.6 M Is this ok [y/N]: y Installed: ant-nodeps.i686 0:1.7.1-13.el6
en 4.0 il faut ant 1.8.2
<code> [esup@esup4dev esup-uportal]$ ant usage Buildfile: build.xml BUILD FAILED /home/esup/esup-uportal/build.xml:127: The following error occurred while executing this line: /home/esup/esup-uportal/bootstrap/build_includes.xml:25: 1.8.2 is required, version Apache Ant version 1.7.1 compiled on November 10 2010 is not supported Total time: 0 seconds
ant en tar.gz
[root@esup4dev local]# wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.8.2-bin.tar.gz [root@esup4dev local]# tar xvfz apache-ant-1.8.2-bin.tar.gz [root@esup4dev local]# ln -s apache-ant-1.8.2 apache-ant
application sur l'environement utilisateur
[root@esup4dev profile.d]# cat /etc/profile.d/ant.sh export ANT_HOME=/usr/local/apache-ant export PATH=$PATH:$ANT_HOME/bin [esup@esup4dev ~]$ env | grep ANT ANT_HOME=/usr/local/apache-ant
[root@esup4dz /etc/tomcat] $ yum install maven Transaction Summary ========================= Install 1 Package (+55 Dependent packages) Total download size: 11 M Installed size: 14 M Is this ok [y/d/N]: y Installed: maven.noarch 0:3.0.5-16.el7 Dependency Installed: aether-api.noarch 0:1.13.1-13.el7 aether-connector-wagon.noarch 0:1.13.1-13.el7 aether-impl.noarch 0:1.13.1-13.el7 aether-spi.noarch 0:1.13.1-13.el7 aether-util.noarch 0:1.13.1-13.el7 aopalliance.noarch 0:1.0-8.el7 apache-commons-cli.noarch 0:1.2-13.el7 apache-commons-codec.noarch 0:1.8-7.el7 apache-commons-io.noarch 1:2.4-12.el7 apache-commons-lang.noarch 0:2.6-15.el7 apache-commons-net.noarch 0:3.2-8.el7.centos atinject.noarch 0:1-13.20100611svn86.el7 bcel.noarch 0:5.2-18.el7 cal10n.noarch 0:0.7.7-4.el7 cdi-api.noarch 0:1.0-11.SP4.el7 cglib.noarch 0:2.2-18.el7 easymock2.noarch 0:2.5.2-12.el7 felix-framework.noarch 0:4.2.1-5.el7 geronimo-annotation.noarch 0:1.0-15.el7 google-guice.noarch 0:3.1.3-9.el7 guava.noarch 0:13.0-6.el7 hamcrest.noarch 0:1.3-6.el7 httpcomponents-client.noarch 0:4.2.5-5.el7_0 httpcomponents-core.noarch 0:4.2.4-6.el7 jakarta-commons-httpclient.noarch 1:3.1-16.el7_0 javassist.noarch 0:3.16.1-10.el7 jboss-ejb-3.1-api.noarch 0:1.0.2-10.el7 jboss-el-2.2-api.noarch 0:1.0.1-0.7.20120212git2fabd8.el7 jboss-interceptors-1.1-api.noarch 0:1.0.2-0.9.20120319git49a904.el7 jboss-jaxrpc-1.1-api.noarch 0:1.0.1-7.el7 jboss-servlet-3.0-api.noarch 0:1.0.1-9.el7 jboss-transaction-1.1-api.noarch 0:1.0.1-8.el7 jline.noarch 0:1.0-8.el7 jsch.noarch 0:0.1.50-5.el7 jsoup.noarch 0:1.6.1-10.el7 junit.noarch 0:4.11-8.el7 jzlib.noarch 0:1.1.1-6.el7 maven-wagon.noarch 0:2.4-3.el7 nekohtml.noarch 0:1.9.14-13.el7 objectweb-asm.noarch 0:3.3.1-9.el7 plexus-cipher.noarch 0:1.7-5.el7 plexus-classworlds.noarch 0:2.4.2-8.el7 plexus-component-api.noarch 0:1.0-0.16.alpha15.el7 plexus-containers-component-annotations.noarch 0:1.5.5-14.el7 plexus-containers-container-default.noarch 0:1.5.5-14.el7 plexus-interactivity.noarch 0:1.0-0.14.alpha6.el7 plexus-interpolation.noarch 0:1.15-8.el7 plexus-sec-dispatcher.noarch 0:1.4-13.el7 plexus-utils.noarch 0:3.0.9-9.el7 qdox.noarch 0:1.12.1-9.el7 regexp.noarch 0:1.5-13.el7 sisu-inject-bean.noarch 0:2.3.0-11.el7 sisu-inject-plexus.noarch 0:2.3.0-11.el7 slf4j.noarch 0:1.7.4-3.el7 xbean.noarch 0:3.13-6.el7 Complete!
ancien centos6 Pour maven seul jpackage fournis des RPM, on va donc configurer jpackage exclusivement pour maven, pour rester dans une tradition RPM, suivre
http://www.davehodgkinson.com/blog/2011/04/installing-maven-on-a-fresh-redhatcentos-5-5/
[root@esup3re7 yum.repos.d]# wget http://www.jpackage.org/jpackage50.repo
Autrement installer maven en tar.gz
http://pwong-tipsandtricks.blogspot.com/2009/02/install-and-test-maven-on-centos-52.html
[root@esup4dev ~]# cd /usr/local/ [root@esup4dev local]# [root@esup4dev local]# wget http://www.dsgnwrld.com/am/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz [root@esup4dev local]# tar xvfz apache-maven-3.0.5-bin.tar.gz apache-maven-3.0.5/LICENSE.txt ... apache-maven-3.0.5/lib/aether-connector-wagon-1.13.1.jar [root@esup4dev local]# ln -s apache-maven-3.0.5 apache-maven [root@esup4dev local]# apache-maven/bin/mvn -version Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 14:51:28+0100) Maven home: /usr/local/maven Java version: 1.6.0_30, vendor: Sun Microsystems Inc. Java home: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "2.6.32-042stab085.20", arch: "i386", family: "unix"
Application de variables d'environement pour aller chercher cette instance maven par defaut
[root@esup4dev profile.d]# cat /etc/profile.d/maven.sh export M2_HOME=/usr/local/apache-maven export PATH=$PATH:$M2_HOME/bin
verification apres reconnexion
[esup@esup4dev ~]$ env | grep M2 M2_HOME=/usr/local/apache-maven
tous les travaux de parametrage, compilation se feront avec un utilisateur dedié non privilégié: esup
[root@esup4dz /etc/tomcat] $ useradd esup -d /home/esup -s /bin/bash -g tomcat [root@esup4dz /etc/tomcat] $ passwd esup Changing password for user esup. New password: Retype new password: passwd: all authentication tokens updated successfully. $ su - esup [esup@esup4dz ~] $
anticiper les droits d'acces au deploy d'esup
[esup@esup4dz ~] $ mkdir /usr/share/tomcat/webapps/uPortal [esup@esup4dz ~] $ ls -ald /usr/share/tomcat/webapps/uPortal drwxr-xr-x 2 esup tomcat 4096 May 20 14:46 /usr/share/tomcat/webapps/uPortal [esup@esup4dz ~] $ mkdir /usr/share/tomcat/webapps/ResourceServingWebapp [esup@esup4dz ~] $ ls -ald /usr/share/tomcat/webapps/ResourceServingWebapp drwxr-xr-x 2 esup tomcat 4096 May 20 14:46 /usr/share/tomcat/webapps/ResourceServingWebapp
Variables d'environement pour l'utilisateur esup
export MAVEN_OPTS="-Xms256m -Xmx1024m -XX:MaxPermSize=1024m -XX:+UseParallelGC" export ANT_OPTS="-Xms128m -Xmx1024m -XX:MaxPermSize=256m -XX:+UseParallelGC"
au lancement de ant clean initportal , l'utilisateur esup va lancer parfois jusqu'a 2 JVM et ainsi consommer beaucoup de memoire
on peux verifier que notre tunning de memoire JVM est bien pris en compte via la commande ps -auxwww :
[root@esup4dz ~] $ ps auxwww | grep java esup 19783 30.8 2.7 4224404 174320 pts/1 Sl+ 12:11 0:15 /usr/lib/jvm/java/bin/java -Xms128m -Xmx1024m -XX:MaxPermSize=256m -XX:+UseParallelGC -classpath /usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/usr/share/java/jaxp_parser_impl.jar:/usr/share/java/xml-commons-apis.jar:/usr/lib/jvm/java/lib/tools.jar -Dant.home=/usr/share/ant -Dant.library.dir=/usr/share/ant/lib org.apache.tools.ant.launch.Launcher -cp -Dmaven.test.skip=true clean initportal esup 19977 220 5.1 4688332 324836 pts/1 Sl+ 12:11 0:19 /usr/lib/jvm/java/bin/java -Xms256m -Xmx1024m -XX:MaxPermSize=1024m -XX:+UseParallelGC -classpath /usr/share/maven/boot/plexus-classworlds.jar -Dclassworlds.conf=/usr/share/maven/bin/m2.conf -Dmaven.home=/usr/share/maven org.codehaus.plexus.classworlds.launcher.Launcher -Djasig.ignore -Djasig.ignore -s/usr/share/maven/conf/settings.xml -B -Dmaven.test.skip=true -Djasig.ignore -Denv=esup -Djasig.ignore install -Djasig.ignore -Djasig.ignore -Djasig.ignore -Djasig.ignore -Djasig.ignore -Djasig.ignore -Djasig.ignore -Djasig.ignore -Djasig.ignore root 20014 0.0 0.0 8984 828 pts/2 S+ 12:12 0:00 grep --color=auto java
pour git cf https://www.esup-portail.org/pages/viewpage.action?pageId=259096667
recuperer le projet depuis https://github.com/EsupPortail/esup-uportal.git
travailler en tant qu'utilisateur esup.
[esup@esup4dz ~] $ time git clone git://github.com/EsupPortail/esup-uportal.git Cloning into 'esup-uportal'... remote: Counting objects: 195471, done. remote: Compressing objects: 100% (21/21), done. remote: Total 195471 (delta 8), reused 0 (delta 0), pack-reused 195450 Receiving objects: 100% (195471/195471), 141.08 MiB | 2.94 MiB/s, done. Resolving deltas: 100% (111999/111999), done. real 0m59.728s user 0m13.740s sys 0m3.754s
[esup@esup4dz ~] $ cd esup-uportal/ [esup@esup4dz ~/esup-uportal] $ ls LICENSE NOTICE.template README-JASIG bootstrap build.xml filters gource releaseNotes.html uportal-ear uportal-search-api NOTICE README assembly build.properties.sample docs findProperties.groovy pom.xml src uportal-portlets-overlay uportal-war
[esup@esup4dz ~/esup-uportal] $ git tag | grep esup uportal-4.0.11-esup-1 uportal-4.0.12-esup-1 uportal-4.0.13-esup-1 uportal-4.0.13.1-esup-1 uportal-4.0.14-esup-1 uportal-4.0.15-esup-1 uportal-4.0.15-esup-2 uportal-4.0.8-esup-0-avant-presta-1 uportal-4.1.2-esup-0
faire une branche locale de la derniere version uportal-esup
[esup@esup4dz ~/esup-uportal] $ git checkout -b ecampusdz uportal-4.0.15-esup-2 Switched to a new branch 'ecampusdz'
etat des lieux
[esup@esup4dz ~/esup-uportal] $ git branch -a * ecampusdz master remotes/origin/HEAD -> origin/master remotes/origin/esup-4.1 remotes/origin/esup-4.2 remotes/origin/master
[esup@esup4dz ~/esup-uportal] $ ln -s build.properties.sample build.properties
et edition de la version ant 1.9.2 (au lieu de 1.8.2) dans bootstrap/build_includes.xml
commit des modifications
[esup@esup4dz ~/esup-uportal] $ git commit -a -m "modif env build via build.properties.sample ln vers build.properties et ant version 1.9.2 dans bootstrap/build_includes.xml" [ecampusdz bbd3321] modif env build via build.properties.sample ln vers build.properties et ant version 1.9.2 dans bootstrap/build_includes.xml 2 files changed, 4 insertions(+), 4 deletions(-)
parametrer l'environement de developpement et deploiment a notre systeme
Edition du build.properties et commit, voici le diff da la modification via git
[esup@esup4dz ~/esup-uportal] $ git log --oneline build.properties.sample bbd3321 modif env build via build.properties.sample ln vers build.properties et ant version 1.9.2 dans bootstrap/build_includes.xml beaab64 I18N FR : Traduction FR de default_entities et quickstart_entities [esup@esup4dz ~/esup-uportal] $ git diff beaab64 build.properties.sample diff --git a/build.properties.sample b/build.properties.sample index 732d4dd..dc70e88 100644 --- a/build.properties.sample +++ b/build.properties.sample @@ -32,7 +32,7 @@ ##### Replace server.home with the location of Tomcat 6 on your machine ##### # path to tomcat binaries -server.home=@server.home@ +server.home=/var/lib/tomcat # path to tomcat servlet container (defaults to same directory as the tomcat binaries) server.base=${server.home} @@ -41,7 +41,7 @@ server.base=${server.home} server.webapps=${server.base}/webapps # If the mvn executable isn't on your path you can set the location here or set it on your path. -#maven.home= +maven.home=/usr/share/maven
et la version de ant
[esup@esup4dz ~/esup-uportal] $ git diff 14f1469 bootstrap/build_includes.xml diff --git a/bootstrap/build_includes.xml b/bootstrap/build_includes.xml index b376c5a..7c19f36 100644 --- a/bootstrap/build_includes.xml +++ b/bootstrap/build_includes.xml @@ -22,11 +22,11 @@ <project name="uPortal_Includes" basedir="." xmlns:artifact="urn:maven-artifact-ant"> <dirname property="imported.basedir" file="${ant.file.uPortal_Includes}"/> - <fail message="1.8.2 is required, version ${ant.version} is not supported"> + <fail message="1.9.2 is required, version ${ant.version} is not supported"> <condition> <not> <or> - <antversion exactly="1.8.2"/> + <antversion exactly="1.9.2"/> </or> </not> </condition>
et pour eviter les tests a chaque lancement de tache ant
[esup@esup4dev esup-uportal]$ git commit -a -m "edit build.properties.sample ajout maven.test.skip=true" [ecampusdev efd4ab3] edit build.properties.sample ajout maven.test.skip=true 1 files changed, 1 insertions(+), 0 deletions(-)
Voici les taches ant disponiblent dans le build.xml:
[esup@esup4dz ~/esup-uportal] $ ant help Buildfile: /home/esup/esup-uportal/build.xml help: [echo] ==== [echo] Licensed to Jasig under one or more contributor license [echo] agreements. See the NOTICE file distributed with this work [echo] for additional information regarding copyright ownership. [echo] Jasig licenses this file to you under the Apache License, [echo] Version 2.0 (the "License"); you may not use this file [echo] except in compliance with the License. You may obtain a [echo] copy of the License at: [echo] [echo] http://www.apache.org/licenses/LICENSE-2.0 [echo] [echo] Unless required by applicable law or agreed to in writing, [echo] software distributed under the License is distributed on [echo] an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY [echo] KIND, either express or implied. See the License for the [echo] specific language governing permissions and limitations [echo] under the License. [echo] ==== [echo] [echo] Introduction: [echo] -------------------------------------------------------------------------------- [echo] This file, /docs/antHelp.txt, provides some default help text for the uPortal [echo] ant build. The build.xml is configured to print this file by default in the [echo] case where no other specific target is specified. [echo] [echo] [echo] Other help with our build file: [echo] -------------------------------------------------------------------------------- [echo] Type "ant -p" to see a list of ant targets and the descriptions of those targets [echo] as recorded directly in the build.xml file. [echo] [echo] [echo] Running the targets: [echo] -------------------------------------------------------------------------------- [echo] Your run the targets by specifying the specific target to the GUI in which you [echo] are running Ant (Eclipse is highly recommended) or by invoking ant with the name [echo] of the desired task as the first argument. [echo] [echo] Example: ant compile [echo] [echo] [echo] Available targets: [echo] -------------------------------------------------------------------------------- [echo] "help" - The target that prints this file [echo] [echo] "initportal" - The target that will deploy uPortal and load your database, but [echo] you must first set up the JDBC properties in rdbm.properties and set up the [echo] path to your servlet container in build.properties. [echo] [echo] The "initportal" target runs all the targets necessary to deploy the portal [echo] and prepare the portal database: bootstrap, deploy-ear, db, pubchan, i18n-db. [echo] [echo] *IMPORTANT* Do not run this task against a database the contents of which [echo] you care about, as it initializes the database by first dropping all tables. [echo] [echo] "deploy-war" - The "deploy-war" target first makes sure everything is compiled [echo] and up-to-date and then copies the extracted uPortal Web Application Archive [echo] (WAR) to the location required by your servlet container as specified in [echo] build.properties. [echo] [echo] "deploy-ear" - The "deploy-ear" target first makes sure everything is compiled [echo] and up-to-date and builds an Enterprise Application Archive (EAR) composed [echo] of the uPortal WAR and the WARs of all the portlets being deployed. The EAR [echo] is then extracted to the location required by your servlet container as [echo] specified in build.properties. [echo] [echo] "db" - The "db" target runs uPortal's DbLoader program to load the database. [echo] WARNING: THIS MAY ERASE EXISTING uPORTAL TABLES!!! [echo] [echo] The "db" target accepts command line arguments which override values [echo] read from the dbloader.xml file: [echo] [echo] Options: [echo] To use /properties/db/mytables.xml instead of the tables file specified [echo] in dbloader.xml: [echo] ant db -Dusetable=-t -Dtablefile=/properties/db/mytables.xml [echo] [echo] To use /properties/db/mydata.xml instead of the data file specified in [echo] dbloader.xml: [echo] ant db -Dusedata=-d -Ddatafile=/properties/db/mydata.xml [echo] [echo] Note: the tables and data files can both be overridden by combining the [echo] arguments. The usetable and tablefile must be used in tandem and [echo] sequentially on the command line. Similarly, usedata and datafile must but [echo] used in tandem. [echo] [echo] To set createScript=true [echo] ant db -Dcreatescript=-c [echo] [echo] To set createScript=false [echo] ant db -Dcreatescript=-nc [echo] [echo] To set dropTables=true [echo] ant db -Ddroptables=-D [echo] [echo] To set dropTables=false [echo] ant db -Ddroptables=-nD [echo] [echo] To set createTables=true [echo] ant db -Dcreatetables=-C [echo] [echo] To set createTables=false [echo] ant db -Dcreatetables=-nC [echo] [echo] To set populateTables=true [echo] ant db -Dpopulatetables=-P [echo] [echo] To set populateTables=false [echo] ant db -Dpopulatetables=-nP [echo] [echo] The -c, -nc, -D, -nD, -C, -nC, -P, -nP arguements may all be used [echo] independantly or in any combination although it would not make sense to, [echo] for example, use both -c and -nc. [echo] [echo] "i18n-db" - The "i18n-db" target loads internationalization tables and data. [echo] [echo] "l10n-db" - The "l10n-db" target loads localization database settings. [echo] [echo] "dbunload" - The "dbunload" target runs uPortal's DbUnload program to dump a [echo] database table. To run this target, you must specify the table name and [echo] output file parameters on the command line. [echo] [echo] Example: [echo] ant dbunload -Dtablename=up_channel -Dxmlfile=- [echo] [echo] "dbtest" - The "dbtest" target runs uPortal's DbTest program to display [echo] information about the database defined in rdbm.properties [echo] [echo] "md5passwd" - The "md5passwd" target runs uPortal's md5passwd program to create [echo] an entry for a user in the UP_PERSON_DIR table. To run this target, you must [echo] specify the username parameter in the command line. For example: [echo] [echo] Example: [echo] ant md5passwd -Dusername=ken [echo] [echo] "deluser" - The "deluser" target runs uPortal's DeleteUser program to delete all [echo] traces of a uportal user from the uPortal database. [echo] [echo] Examples: [echo] ant deluser -Duser=username [echo] [echo] "regchantype" - The "regchantype" target runs uPortal's RegisterChannelType [echo] program to create an entry for a new generic channel in the UP_CHAN_TYPE [echo] table. To run this target, you must specify the class, name, description, [echo] and uri parameters in the command line. [echo] [echo] Example: [echo] ant regchantype [echo] -Dclass=org.jasig.portal.channels.CImage [echo] -Dname="Image Channel" [echo] -Ddescription="Displays image with optional title and subtitle" [echo] -Duri=/org/jasig/portal/channels/CImage/CImage.cpd [echo] [echo] "addstylesheet" - The "addstylesheet" target runs uPortal's RegisterStylesheet [echo] program to add core framework stylesheets used to create structures and themes. [echo] [echo] Example: [echo] ant addstylesheet [echo] -DstylesheetType=-t [echo] -DstylesheetUri=/org/jasig/portal/layout/tab-column/nested-tables/nested-tables.xsl [echo] -DdescriptionUri=/org/jasig/portal/layout/tab-column/nested-tables/nested-tables.sdf [echo] [echo] where -s = specify structure stylesheet [echo] -t = specify theme stylesheet [echo] [echo] "modstylesheet" - The "modstylesheet" target runs uPortal's RegisterStylesheet [echo] program to update core framework stylesheets used to create structures and [echo] themes. [echo] [echo] Example: [echo] ant modstylesheet [echo] -DstylesheetType=-s [echo] -DstylesheetUri=/org/jasig/portal/layout/tab-column/tab-column.xsl [echo] -DdescriptionUri=/org/jasig/portal/layout/tab-column/tab-column.sdf [echo] -DstylesheetId=1 [echo] [echo] where -s = specify structure stylesheet [echo] -t = specify theme stylesheet [echo] [echo] "delstylesheet" - The "delstylesheet" target runs uPortal's RegisterStylesheet [echo] program to delete core framework stylesheets used to create structures and [echo] themes. [echo] [echo] Example: [echo] ant delstylesheet -DstylesheetType=-t -DstylesheetId=1 [echo] [echo] where -s = specify structure stylesheet [echo] -t = specify theme stylesheet [echo] [echo] "pubchan" - The "pubchan" target runs the ChannelPublisher tool. Channel [echo] definitions are defined in XML files. Each channel definition is published [echo] or modified if one already existed with the same functional name. You can [echo] publish all the channel definitions at once or just one at a time. [echo] [echo] Examples: [echo] ant pubchan -Dchannel=all [echo] ant pubchan -Dchannel=daily-business-cartoon.xml [echo] [echo] "deployPortletApp" - The "deployPortletApp" target runs the portlet Deployer [echo] tool. This tool takes a portlet WAR file, rewrites the web.xml file and [echo] deploys the results to the servlet container. [echo] [echo] Example: [echo] ant deployPortletApp -DportletApp=C:/TEMP/myPortlet.war [echo] [echo] "hsql" - The "hsql" target starts an HSQLDB server instance consistent with [echo] the default rdbm.properties data access configuration of uPortal. Note that [echo] this Ant target does not return in a normal execution -- the Ant "build" [echo] kicks off the database server but then just keeps on running. [echo] You'll need to kill it manually, e.g. via control-C or via a stop build [echo] control in your IDE. [echo] [echo] [echo] Metadata about this file: [echo] $Revision$ $Date$ [echo] [echo] ********** Run 'ant help | more' to make this document easier to read ********** BUILD SUCCESSFUL Total time: 0 seconds
target ant
[esup@esup4dz ~/esup-uportal] $ ant -p Buildfile: /home/esup/esup-uportal/build.xml Main targets: clean Runs 'mvn clean' clean-shared Removes ALL shared libraries from the servlet container. clean-tomcat Removes the deployed uPortal from the servlet container data-delete Deletes the specified entity data-export Exports the specified entity or entities to XML on the file system data-import Imports the specified XML file or files data-list Lists portal data types and portal data for a type. Use the -Dtype parameter to specify a specific type db Loads legacy database tables and data. See: initdb db-ddl Create a SQL script of commands to drop and create the uPortal database db-hibernate Drops then creates Hibernate managed tables db-hibernate-aggr-events Drops then creates Hibernate managed tables used for aggregate portal event storage db-hibernate-aggr-events-update Makes required changes to the portal database for patch upgrades for aggregate portal event storage db-hibernate-portal Drops then creates Hibernate managed tables for the portal db-hibernate-portal-update Makes required changes to the portal database for patch upgrades for the portal schema db-hibernate-portlets Drops then creates Hibernate managed tables for bundled portlets db-hibernate-raw-events Drops then creates Hibernate managed tables used for raw portal event storage db-hibernate-raw-events-update Makes required changes to the portal database for patch upgrades for raw portal event storage db-hibernate-update Makes required changes to the portal database for patch upgrades for both the portal and event schemas db-import Imports the default XML files to the database db-import-default Imports the default data files to the database db-import-quickstart Imports the quickstart data files to the database db-import-required Imports the required data files to the database db-update Updates an existing database from one patch version to the next dbtest Displays information about the database defined in rdbm.properties deluser Delete traces of a user from the portal database deploy-ear Deploy uPortal and dependent libraries and portlets to the servlet container deploy-war Deploy the uPortal web application to the servlet container deployPortletApp Deploys a portlet application help Prints information about using this ant build file. hsql Start a HSQLDB instance consistent with the default RDBMS requirements of uPortal hsql-shutdown Compacts then cleanly shuts down hsql, useful if the 'hsql' task was run with '-Dspawn=true' initdb Drops all tables, then runs all the targets necessary prepare the portal database initportal Runs all the targets necessary to deploy the portal and prepare the portal database md5passwd Creates a user in the UP_PERSON_DIR table portlet-data-import Imports the default portlet-specific data test-macros Test macrodefs defined in this file up-shell Run a uPortal Groovy Shell. Interactive or scripted using -Dscript= Default target: help
les taches ant peuvent comsomer beaucoup de ressources, ici sur notre serveur virtuel (container) openvz, l'allocation de 2048M de ram n'est pas suffisante quand tomcat7 tourne en parallele .
[esup@esup4dz ~/esup-uportal] $ ant help Error occurred during initialization of VM Could not reserve enough space for object heap Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
en effet
[root@esup4dz /etc/tomcat] $ cat /proc/user_beancounters Version: 2.5 uid resource held maxheld barrier limit failcnt 10050: kmemsize 47088893 50130944 9223372036854775807 9223372036854775807 0 lockedpages 0 0 4096 4096 0 privvmpages 304784 417864 524288 524288 69
cf le failcnt = 69 pour privvmpages
on passe a 3G
# vzctl set 10050 --privvmpages 3072M:3072M --save
[esup@esup4dz ~/esup-uportal] $ git commit -a -m "custom filters/esup.properties JP" [ecampusdz e5c6be7] custom filters/esup.properties JP 1 file changed, 15 insertions(+), 15 deletions(-) $ git diff 94c1ec7 filters/esup.properties diff --git a/filters/esup.properties b/filters/esup.properties index b04a0c0..baaf2d4 100644 --- a/filters/esup.properties +++ b/filters/esup.properties @@ -38,8 +38,8 @@ environment.build.hsql.port=8887 ## Server Path configuration -environment.build.server.webapps=/home/esup4/webapps -environment.build.server.home=/home/esup4/apache-tomcat-6.0.35 +environment.build.server.webapps=/usr/share/tomcat/webapps +environment.build.server.home=/usr/share/tomcat ################################################################################ ## Database configuration section ## @@ -54,10 +54,10 @@ environment.build.server.home=/home/esup4/apache-tomcat-6.0.35 #environment.build.hibernate.connection.password=esup4 # PostGreSQL properties to uncomment : -#environment.build.hibernate.connection.driver_class=org.postgresql.Driver -#environment.build.hibernate.connection.url=jdbc:postgresql://sql.univ.fr:5432/esup4 -#environment.build.hibernate.connection.username=esup4 -#environment.build.hibernate.connection.password=esup4 +environment.build.hibernate.connection.driver_class=org.postgresql.Driver +environment.build.hibernate.connection.url=jdbc:postgresql://localhost:5432/uportaldz +environment.build.hibernate.connection.username=uportaluz +environment.build.hibernate.connection.password=secret environment.build.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect environment.build.hibernate.connection.validationQuery=select 1 @@ -66,23 +66,23 @@ environment.build.hibernate.connection.validationQuery=select 1 #environment.build.hibernate.connection.jndiname=jdbc/uPortalDB # uPortal server configuration properties -environment.build.uportal.server=esup4.univ.fr -environment.build.real.uportal.server=esup4.univ.fr +environment.build.uportal.server=esup4dz.tem-tsp.eu +environment.build.real.uportal.server=esup4dz.tem-tsp.eu environment.build.uportal.protocol=https environment.build.uportal.context=/uPortal environment.build.real.uportal.context=/uPortal environment.build.uportal.email.fromAddress=portal4@univ.fr # CAS server configuration properties -environment.build.cas.server=auth.univ.fr +environment.build.cas.server=cas.tem-tsp.eu environment.build.cas.protocol=https environment.build.cas.context=/cas # LDAP -environment.build.ldap.url=ldaps://ldap1.univ.fr:636 ldaps://ldap2.univ.fr:636 -environment.build.ldap.baseDn=dc=univ,dc=fr -environment.build.ldap.userName= -environment.build.ldap.password= +environment.build.ldap.url=ldap://ldap44.tem-tsp.eu ldap://ldap33.tem-tsp.eu +environment.build.ldap.baseDn=dc=int-evry,dc=fr +environment.build.ldap.userName=cn=mcibind,ou=system,dc=int-evry,dc=fr +environment.build.ldap.password=secret environment.build.ldap.pooled=false environment.build.ldap.uidAttr=uid @@ -94,7 +94,7 @@ environment.build.smartldapgroupstore.ldap.baseDn=ou=groups,${environment.build. environment.build.smartldapgroupstore.groupsTreeRefreshIntervalSeconds=900 # Logs -environment.build.log.logfileDirectory=/home/esup4/logs +environment.build.log.logfileDirectory=/var/log/tomcat environment.build.log.logfileName=uPortal.log environment.build.log.size=1024 environment.build.log.rootLevel=INFO @@ -103,7 +103,7 @@ environment.build.log.rollingLogFileDatePattern=yyyy-MM-dd-HH # Esup # NOT USE NOW -environment.build.host.logicalName=esup1 +environment.build.host.logicalName=esup4dz environment.build.xsl.debug=ERROR environment.build.xsl.cache=
dans le pom.xml de uportal-portlets-overlay on retire les portlet inutiles (le CAS interne et pluto-testsuite)
[esup@esup4dz ~/esup-uportal] $ git diff 8b0957b uportal-portlets-overlay/pom.xml diff --git a/uportal-portlets-overlay/pom.xml b/uportal-portlets-overlay/pom.xml index 9c64f72..93fb831 100644 --- a/uportal-portlets-overlay/pom.xml +++ b/uportal-portlets-overlay/pom.xml @@ -19,12 +19,10 @@ <module>AnnouncementsPortlet</module> <module>BookmarksPortlet</module> <module>CalendarPortlet</module> - <module>cas</module> <module>cas-proxy-test-portlet</module> <module>email-preview</module> <module>FunctionalTestsPortlet</module> <module>jasig-widget-portlets</module> - <module>pluto-testsuite</module> <module>NewsReaderPortlet</module> <module>NotificationPortlet</module> <module>SimpleContentPortlet</module>
[esup@esup4dz ~/esup-uportal] $ git diff 8b0957b uportal-ear/pom.xml diff --git a/uportal-ear/pom.xml b/uportal-ear/pom.xml index 4df5217..cb6bb82 100755 --- a/uportal-ear/pom.xml +++ b/uportal-ear/pom.xml @@ -46,13 +46,6 @@ <dependency> <groupId>org.jasig.portal.portlets-overlay</groupId> - <artifactId>cas</artifactId> - <version>${project.version}</version> - <type>war</type> - </dependency> - - <dependency> - <groupId>org.jasig.portal.portlets-overlay</groupId> <artifactId>cas-proxy-test-portlet</artifactId> <version>${project.version}</version> <type>war</type> @@ -80,13 +73,6 @@ </dependency> <dependency> - <groupId>org.jasig.portal.portlets-overlay</groupId> - <artifactId>pluto-testsuite</artifactId> - <version>${project.version}</version> - <type>war</type> - </dependency> - - <dependency> <groupId>org.jasig.resourceserver</groupId> <artifactId>resource-server-webapp</artifactId> <version>${resource-server.version}</version>
[esup@esup4dz ~/esup-uportal] $ git diff 7ea6bc0 pom.xml diff --git a/pom.xml b/pom.xml index b73d907..98044aa 100644 --- a/pom.xml +++ b/pom.xml @@ -98,11 +98,9 @@ --> <!-- POSTGRESQL driver. Uncomment if you need to --> - <!-- <jdbc.groupId>postgresql</jdbc.groupId> <jdbc.artifactId>postgresql</jdbc.artifactId> <jdbc.version>9.0-801.jdbc4</jdbc.version> - --> <!-- MYSQL driver. Uncomment if you need to --> <!--
$ env | grep OPT ANT_OPTS=-Xms128m -Xmx1024m -XX:MaxPermSize=256m -XX:+UseParallelGC JAVA_OPTS=-Xms256m -Xmx1024m -XX:MaxPermSize=1024m -XX:+UseParallelGC -Djava.net.preferIPv4Stack=true -Dnetworkaddress.cache.ttl=3600 -Djava.awt.headless=true -Dcom.sun.management.jmxremote -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false MAVEN_OPTS=-Xms256m -Xmx1024m -XX:MaxPermSize=1024m -XX:+UseParallelGC [esup@esup4dz ~/esup-uportal] $ time ant -Dmaven.test.skip=true clean initportal ... [exec] [INFO] ------------------------------------------------------------------------ [exec] [INFO] Reactor Summary: [exec] [INFO] [exec] [INFO] uPortal Portlets .................................. SUCCESS [0.033s] [exec] [INFO] Announcements Portlet ............................. SUCCESS [2.165s] [exec] [INFO] Bookmarks Portlet ................................. SUCCESS [0.000s] [exec] [INFO] Calendar Portlet .................................. SUCCESS [4.557s] [exec] [INFO] CAS Proxy Test Portlet ............................ SUCCESS [0.001s] [exec] [INFO] Email Preview Portlet ............................. SUCCESS [0.000s] [exec] [INFO] Functional Tests Portlet .......................... SUCCESS [0.001s] [exec] [INFO] Jasig Widget Portlets ............................. SUCCESS [0.001s] [exec] [INFO] News Reader Portlet ............................... SUCCESS [4.327s] [exec] [INFO] Jasig Notification Portlet ........................ SUCCESS [0.001s] [exec] [INFO] Simple Content Portlet ............................ SUCCESS [0.001s] [exec] [INFO] Weather Portlet ................................... SUCCESS [0.001s] [exec] [INFO] Web Proxy Portlet ................................. SUCCESS [0.001s] [exec] [INFO] ------------------------------------------------------------------------ [exec] [INFO] BUILD SUCCESS [exec] [INFO] ------------------------------------------------------------------------ [exec] [INFO] Total time: 12.394s [exec] [INFO] Finished at: Thu May 21 16:07:05 CEST 2015 [exec] [INFO] Final Memory: 36M/478M ... [java] INFO [07:29,895] Running DbLoader with: DbLoaderConfigBuilder[tablesFile=/properties/db/tables.xml,dataFile=/properties/db/data.xml,scriptFile=<null>,dropTables=true,createTables=true,populateTables=true] [java] INFO [07:29,906] Dropping existing tables [java] INFO [07:29,906] drop table if exists UP_USER cascade [java] INFO [07:29,908] drop table if exists UP_USER_LOCALE cascade ... [java] INFO [07:29,920] Creating tables [java] INFO [07:29,920] create table UP_USER (USER_ID int4 not null, USER_NAME varchar(35), USER_DFLT_USR_ID int4, USER_DFLT_LAY_ID int4, NEXT_STRUCT_ID int4, LST_CHAN_UPDT_DT timestamp, primary key (USER_ID), unique (USER_NAME)) ... [java] INFO [07:30,430] create sequence UP_UNIQUE_STR_SEQ start 1 increment 1000 [java] INFO [07:30,432] create table hibernate_sequences ( sequence_name varchar(255) not null , next_val int8, primary key ( sequence_name ) ) [java] INFO [07:30,432] PostInit - Set AggrEventsDb version to 4.0.12 [java] INFO [07:30,437] [java] INFO [07:30,437] [java] INFO [07:30,437] Importing Data from: /home/esup/esup-uportal/uportal-war/src/main/data/required_entities that matches [java] INFO [07:30,443] Scanning for files to Import from: /home/esup/esup-uportal/uportal-war/src/main/data/required_entities [java] INFO [07:30,598] Found 17 files to Import from: /home/esup/esup-uportal/uportal-war/src/main/data/required_entities [java] INFO [07:30,598] Importing 7 files of type <entity-type script="classpath://org/jasig/portal/io/import-entity-type_v3-2.crn"> [java] INFO [07:30,814] Imported : entity-type/org.jasig.portal.security.IPerson.entity-type.xml [java] INFO [07:30,870] Imported : entity-type/org.jasig.portal.groups.IEntityGroup.entity-type.xml [java] INFO [07:30,927] Imported : entity-type/org.jasig.portal.services.entityproperties.EntityProperties.entity-type.xml [java] INFO [07:30,981] Imported : entity-type/org.jasig.portal.groups.IEntity.entity-type.xml [java] INFO [07:31,020] Imported : entity-type/java.lang.Object.entity-type.xml [java] INFO [07:31,073] Imported : entity-type/org.jasig.portal.security.IPermissionSet.entity-type.xml [java] INFO [07:31,127] Imported : entity-type/org.jasig.portal.portlet.om.IPortletDefinition.entity-type.xml [java] INFO [07:31,128] Importing 2 files of type <{https://source.jasig.org/schemas/uportal/io/stylesheet-descriptor}stylesheet-descriptor version="4.0"> [java] INFO [07:31,216] Imported : stylesheet-descriptor/DLMXHTML.stylesheet-descriptor.xml [java] INFO [07:31,259] Imported : stylesheet-descriptor/DLMTabsColumns.stylesheet-descriptor.xml [java] INFO [07:31,259] Importing 1 files of type <{https://source.jasig.org/schemas/uportal/io/user}template-user version="4.0"> [java] INFO [07:31,293] Imported : user/defaultTemplateUser.user.xml [java] INFO [07:31,294] Importing 2 files of type <{https://source.jasig.org/schemas/uportal/io/user}user version="4.0"> [java] INFO [07:31,304] Imported : user/guest.user.xml [java] INFO [07:31,313] Imported : user/system.user.xml [java] INFO [07:31,314] Importing 1 files of type <{https://source.jasig.org/schemas/uportal/io/portlet-type}portlet-type version="4.0"> [java] INFO [07:31,326] Imported : portlet-type/Portlet.portlet-type.xml [java] INFO [07:31,327] Importing 2 files of type <profile script="classpath://org/jasig/portal/io/import-profile_v3-2.crn"> [java] INFO [07:31,602] Looking up bean 'counterStore' in ApplicationContext due to context not yet being initialized [java] INFO [07:31,782] Imported : profile/system_default.profile.xml [java] INFO [07:31,815] Imported : profile/defaultTemplateUser_default.profile.xml [java] INFO [07:31,815] Importing 2 files of type <layout script="classpath://org/jasig/portal/io/import-layout_v3-2.crn"> [java] INFO [07:31,873] Imported : layout/defaultTemplateUser.layout.xml [java] INFO [07:31,904] Imported : layout/system.layout.xml [java] INFO [07:31,904] For a detailed report on the data import see /home/esup/esup-uportal/target/data-import-reports/data-import.txt [java] INFO [07:31,905] [java] INFO [07:31,905] [java] INFO [07:31,905] Importing Data from: /home/esup/esup-uportal/uportal-war/src/main/data/default_entities that matches [java] INFO [07:31,905] Scanning for files to Import from: /home/esup/esup-uportal/uportal-war/src/main/data/default_entities [java] INFO [07:31,954] Found 102 files to Import from: /home/esup/esup-uportal/uportal-war/src/main/data/default_entities [java] INFO [07:31,954] Importing 3 files of type <{https://source.jasig.org/schemas/uportal/io/stylesheet-descriptor}stylesheet-descriptor version="4.0"> [java] INFO [07:31,969] Imported : stylesheet-descriptor/UniversalityMobile.stylesheet-descriptor.xml [java] INFO [07:31,979] Imported : stylesheet-descriptor/JsonLayout.stylesheet-descriptor.xml [java] INFO [07:31,995] Imported : stylesheet-descriptor/DLMMobileColumns.stylesheet-descriptor.xml [java] INFO [07:31,995] Importing 3 files of type <{https://source.jasig.org/schemas/uportal/io/user}user version="4.0"> [java] INFO [07:32,026] Imported : user/admin.user.xml [java] INFO [07:32,039] Imported : user/admin-lo.user.xml [java] INFO [07:32,053] Imported : user/fragmentTemplate.user.xml [java] INFO [07:32,053] Importing 12 files of type <group script="classpath://org/jasig/portal/io/import-group_membership_v3-2.crn" version="GROUP"> [java] INFO [07:32,139] Imported : group_membership/Administration.group-membership.xml [java] INFO [07:32,149] Imported : group_membership/uPortal.group-membership.xml ... [java] INFO [07:37,536] Closing JPA EntityManagerFactory for persistence unit 'RawEventsDb' [echo] Finished initializing database [echo] Finished initializing uPortal BUILD SUCCESSFUL Total time: 2 minutes 14 seconds real 2m15.282s user 4m40.832s sys 0m20.426s
au final on a le portail et les portlet associées qui sont deployés
[esup@esup4dz ~/esup-uportal] $ ls -ltr /var/lib/tomcat/webapps/ total 68 drwxr-xr-x 5 root tomcat 4096 May 20 11:40 host-manager drwxr-xr-x 5 root tomcat 4096 May 20 11:40 manager drwxr-xr-x 7 esup tomcat 4096 May 21 15:47 probe drwxr-xr-x 5 esup tomcat 4096 May 21 16:06 uPortal drwxr-xr-x 5 esup tomcat 4096 May 21 16:06 ResourceServingWebapp drwxr-xr-x 10 esup tomcat 4096 May 21 16:06 Announcements drwxr-xr-x 7 esup tomcat 4096 May 21 16:06 BookmarksPortlet drwxr-xr-x 8 esup tomcat 4096 May 21 16:06 CalendarPortlet drwxr-xr-x 5 esup tomcat 4096 May 21 16:06 cas-proxy-test-portlet drwxr-xr-x 8 esup tomcat 4096 May 21 16:06 email-preview drwxr-xr-x 5 esup tomcat 4096 May 21 16:06 FunctionalTestsPortlet drwxr-xr-x 7 esup tomcat 4096 May 21 16:06 jasig-widget-portlets drwxr-xr-x 8 esup tomcat 4096 May 21 16:06 NewsReaderPortlet drwxr-xr-x 8 esup tomcat 4096 May 21 16:06 NotificationPortlet drwxr-xr-x 7 esup tomcat 4096 May 21 16:06 SimpleContentPortlet drwxr-xr-x 8 esup tomcat 4096 May 21 16:06 WeatherPortlet drwxr-xr-x 4 esup tomcat 4096 May 21 16:06 WebProxyPortlet
Au final, on a une base de donnée remplie de plusieurs tables et sequences:
[esup@esup4dz ~/esup-uportal] $ psql -d uportaldz -U uportaluz -h 127.0.0.1 -W Password for user uportaluz: psql (9.2.10) Type "help" for help. uportaldz=> \d List of relations Schema | Name | Type | Owner --------+-------------------------------+----------+----------- public | admins | table | uportaluz public | announcement | table | uportaluz public | announcement_attachment | table | uportaluz public | audience | table | uportaluz public | authors | table | uportaluz public | calendar_configuration | table | uportaluz public | calendar_parameter | table | uportaluz public | calendar_preference | table | uportaluz public | calendar_role | table | uportaluz public | calendar_store | table | uportaluz public | hibernate_sequence | sequence | uportaluz public | hibernate_sequences | table | uportaluz public | moderators | table | uportaluz public | news_configuration | table | uportaluz public | news_definition | table | uportaluz public | news_parameter | table | uportaluz public | news_preference | table | uportaluz public | news_role | table | uportaluz public | news_set | table | uportaluz public | scm_attachment | table | uportaluz public | subscription | table | uportaluz public | topic | table | uportaluz public | up_academic_term_detail | table | uportaluz public | up_academic_term_detail_seq | sequence | uportaluz public | up_aggr_group_mapping | table | uportaluz public | up_aggr_group_mapping_seq | sequence | uportaluz public | up_aggr_portlet_mapping | table | uportaluz public | up_aggr_portlet_mapping_seq | sequence | uportaluz public | up_aggr_tab_mapping | table | uportaluz public | up_aggr_tab_mapping_seq | sequence | uportaluz public | up_attachment_seq | sequence | uportaluz public | up_concurrent_user_aggr | table | uportaluz public | up_concurrent_user_aggr_seq | sequence | uportaluz public | up_date_dimension | table | uportaluz public | up_date_dimension_seq | sequence | uportaluz public | up_dlm_evaluator | table | uportaluz public | up_dlm_evaluator_paren | table | uportaluz public | up_dlm_evaluator_seq | sequence | uportaluz public | up_entity_cache_invalidation | table | uportaluz public | up_entity_lock | table | uportaluz public | up_entity_prop | table | uportaluz public | up_entity_type | table | uportaluz public | up_event_aggr_conf_groups | table | uportaluz public | up_event_aggr_conf_groups_exc | table | uportaluz public | up_event_aggr_conf_groups_inc | table | uportaluz public | up_event_aggr_conf_groups_seq | sequence | uportaluz public | up_event_aggr_conf_intrvl | table | uportaluz public | up_event_aggr_conf_intrvl_exc | table | uportaluz public | up_event_aggr_conf_intrvl_inc | table | uportaluz public | up_event_aggr_conf_intrvl_seq | sequence | uportaluz public | up_event_aggr_status | table | uportaluz public | up_event_aggr_status_seq | sequence | uportaluz public | up_event_session | table | uportaluz public | up_event_session_groups | table | uportaluz public | up_event_session_seq | sequence | uportaluz public | up_group | table | uportaluz public | up_group_membership | table | uportaluz public | up_jgroups_auth | table | uportaluz public | up_jgroups_ping | table | uportaluz public | up_layout_param | table | uportaluz public | up_layout_struct | table | uportaluz public | up_login_event_aggr | table | uportaluz public | up_login_event_aggr_seq | sequence | uportaluz public | up_message | table | uportaluz public | up_message_seq | sequence | uportaluz public | up_mutex | table | uportaluz public | up_mutex_seq | sequence | uportaluz public | up_permission | table | uportaluz public | up_permission_activity | table | uportaluz public | up_permission_activity_seq | sequence | uportaluz public | up_permission_owner | table | uportaluz public | up_permission_owner_seq | sequence | uportaluz public | up_person_attr | table | uportaluz public | up_person_attr_seq | sequence | uportaluz public | up_person_attr_values | table | uportaluz public | up_person_dir | table | uportaluz public | up_person_dir_seq | sequence | uportaluz public | up_portal_cookies | table | uportaluz public | up_portal_cookies_seq | sequence | uportaluz public | up_portlet_cookies | table | uportaluz public | up_portlet_cookies_seq | sequence | uportaluz public | up_portlet_def | table | uportaluz public | up_portlet_def_mdata | table | uportaluz public | up_portlet_def_param | table | uportaluz public | up_portlet_def_param_seq | sequence | uportaluz public | up_portlet_def_seq | sequence | uportaluz public | up_portlet_ent | table | uportaluz public | up_portlet_ent__states | table | uportaluz public | up_portlet_ent_seq | sequence | uportaluz public | up_portlet_exec_aggr | table | uportaluz public | up_portlet_exec_aggr_seq | sequence | uportaluz public | up_portlet_layout_aggr | table | uportaluz public | up_portlet_pref | table | uportaluz public | up_portlet_pref_seq | sequence | uportaluz public | up_portlet_pref_values | table | uportaluz public | up_portlet_prefs | table | uportaluz public | up_portlet_prefs_seq | sequence | uportaluz public | up_portlet_type | table | uportaluz public | up_portlet_type_seq | sequence | uportaluz public | up_quarter_detail | table | uportaluz public | up_quarter_detail_seq | sequence | uportaluz public | up_raw_events | table | uportaluz public | up_raw_events_seq | sequence | uportaluz public | up_search_req_aggr | table | uportaluz public | up_sequence | table | uportaluz public | up_ss_desc | table | uportaluz public | up_ss_desc_lay_attr | table | uportaluz public | up_ss_desc_lay_attr_elms | table | uportaluz public | up_ss_desc_lay_attr_seq | sequence | uportaluz public | up_ss_desc_output_prop | table | uportaluz public | up_ss_desc_output_prop_seq | sequence | uportaluz public | up_ss_desc_param | table | uportaluz public | up_ss_desc_param_seq | sequence | uportaluz public | up_ss_desc_seq | sequence | uportaluz public | up_ss_user_pref | table | uportaluz public | up_ss_user_pref_lay_attr | table | uportaluz public | up_ss_user_pref_lay_attr_seq | sequence | uportaluz public | up_ss_user_pref_lay_attr_val | table | uportaluz public | up_ss_user_pref_output_prop | table | uportaluz public | up_ss_user_pref_param | table | uportaluz public | up_ss_user_pref_seq | sequence | uportaluz public | up_tab_render_aggr | table | uportaluz public | up_tab_render_aggr_seq | sequence | uportaluz public | up_time_dimension | table | uportaluz public | up_time_dimension_seq | sequence | uportaluz public | up_unique_str | table | uportaluz public | up_unique_str_segment | table | uportaluz public | up_unique_str_segment__uids | table | uportaluz public | up_unique_str_segment_seq | sequence | uportaluz public | up_unique_str_seq | sequence | uportaluz public | up_user | table | uportaluz public | up_user_fragment_sub_seq | sequence | uportaluz public | up_user_fragment_subscription | table | uportaluz public | up_user_layout | table | uportaluz public | up_user_locale | table | uportaluz public | up_user_profile | table | uportaluz public | up_version | table | uportaluz public | up_version_seq | sequence | uportaluz (138 rows)
Les groupes initiaux:
uportaldz=> select * from up_group; group_id | creator_id | entity_type_id | group_name | description ----------+------------+----------------+------------------------+------------------------------------------ 19 | system | 16 | Actualités | Portlets d'actualités 10 | system | 16 | Administration | Portlets d'administration 20 | system | 16 | Divertissement | Portlets de divertissement 11 | system | 16 | uPortal | Portlets intégrées dans uPortal 21 | system | 10 | Students | Tous les étudiants 12 | system | 16 | Information | Portlets d'information 0 | system | 10 | Everyone | Toutes les personnes 13 | system | 10 | Fragment Owners | Propriétaires de fragments 14 | system | 10 | Subscribable Fragments | These are fragment layout owner accounts 22 | system | 16 | Enseignement | Portlets d'enseignement 23 | system | 16 | Travail | Portlets métier 1 | system | 16 | All categories | Toutes les catégories de portlets 15 | system | 16 | Développement | Portlets pour développeurs 24 | system | 16 | Démonstration | Portlets de démonstration 25 | system | 16 | Tests | Portlets de tests 26 | system | 16 | Bibliothèque | Portlets de documentation 27 | system | 16 | Finances | Portlets financières et comptables 2 | system | 10 | Portal Administrators | Administrateurs du portail 28 | system | 16 | Services | Portlets de services 29 | system | 10 | Faculty | Tous les enseignants 30 | system | 10 | Staff | Tout le personnel 16 | system | 10 | Portal Developers | Développeurs autour du portail 31 | system | 16 | Recherche | Portlets de recherche 32 | system | 16 | Enseignants | Portlets pour les enseignants 33 | system | 16 | Conseil | Portlets pour les conseillers 17 | system | 10 | Guests | Anonymes 18 | system | 10 | Portal System | Comptes systèmes du portail (27 rows) uportaldz=> select * from up_group_membership; group_id | member_service | member_key | member_is_group ----------+----------------+---------------------+----------------- 11 | local | 1 | F 11 | local | 2 | F 15 | local | 3 | F 11 | local | 4 | F 10 | local | 7 | F 10 | local | 8 | F 11 | local | 10 | F 11 | local | 11 | F 11 | local | 12 | F 11 | local | 13 | F 11 | local | 14 | F 11 | local | 15 | F 10 | local | 15 | F 11 | local | 17 | F 15 | local | 18 | F 10 | local | 19 | F 10 | local | 20 | F 11 | local | 21 | F 12 | local | 22 | F 11 | local | 23 | F 10 | local | 24 | F 11 | local | 25 | F 15 | local | 26 | F 10 | local | 27 | F 12 | local | 28 | F 21 | local | student | F 21 | local | student-lo | F 0 | pags | authenticated_users | T 0 | pags | pags_root | T 0 | local | 29 | T 0 | local | 17 | T 0 | local | 18 | T 0 | local | 30 | T 0 | local | 21 | T 13 | local | academics-lo | F 13 | local | admin-lo | F 13 | local | all-lo | F 13 | local | campus-lo | F 13 | local | developer-lo | F 13 | local | faculty-lo | F 13 | local | fragmentTemplate | F 13 | local | guest-lo | F 13 | local | news-lo | F 13 | local | staff-lo | F 13 | local | student-lo | F 13 | local | welcome-lo | F 13 | local | 14 | T 14 | local | ent-lo | F 14 | local | news-lo | F 1 | local | 22 | T 1 | local | 10 | T 1 | local | 33 | T 1 | local | 24 | T 1 | local | 15 | T 1 | local | 20 | T 1 | local | 27 | T 1 | local | 12 | T 1 | local | 32 | T 1 | local | 26 | T 1 | local | 19 | T 1 | local | 31 | T 1 | local | 28 | T 1 | local | 25 | T 1 | local | 23 | T 1 | local | 11 | T 2 | local | admin | F 2 | local | admin-lo | F 29 | local | faculty | F 29 | local | faculty-lo | F 30 | local | staff | F 30 | local | staff-lo | F 16 | local | admin | F 16 | local | admin-lo | F 16 | local | developer | F 16 | local | developer-lo | F 16 | local | staff | F 16 | local | staff-lo | F 17 | local | guest | F 17 | local | guest-lo | F 18 | local | 13 | T 18 | local | 2 | T .... 12 | local | 82 | F (134 rows)
pb connu d'encodage, cf https://www.esup-portail.org/pages/viewpage.action?pageId=269090823
l'acces au portail sans ce patch affiche (noter le ? sur implémenté ci-dessous)
uPortal est un portail web libre et open source impl�ment� en Java
afin de mnipuler git git, ici on fait usage d'un branche temporaire pour appliquer le patch postgres
[esup@esup4dev esup-uportal]$ git checkout -b ecampusdb ecampusdev [esup@esup4dev esup-uportal]$ git branch ecampusdb * ecampusdev master [esup@esup4dev esup-uportal]$ git checkout ecampusdb Switched to branch 'ecampusdb'
[esup@esup4dev esup-uportal]$ git pull https://github.com/vbonamy/esup-uportal.git UP-3488 remote: Counting objects: 30, done. remote: Compressing objects: 100% (25/25), done. remote: Total 30 (delta 0), reused 24 (delta 0) Unpacking objects: 100% (30/30), done. From https://github.com/vbonamy/esup-uportal * branch UP-3488 -> FETCH_HEAD Auto-merging uportal-war/src/main/java/org/jasig/portal/events/handlers/db/PersistentPortalEvent.java Auto-merging uportal-war/src/main/java/org/jasig/portal/portlet/dao/jpa/PortletPreferenceImpl.java Auto-merging uportal-war/src/test/java/org/jasig/portal/portlet/dao/jpa/JpaPortletDaoTest.java Merge made by recursive. .../events/handlers/db/PersistentPortalEvent.java | 1 + .../portlet/dao/jpa/PortletPreferenceImpl.java | 3 +++ .../portal/portlet/dao/jpa/JpaPortletDaoTest.java | 7 +++++-- 3 files changed, 9 insertions(+), 2 deletions(-)
cela ne concerne que uportal-war, donc un ant deploy-war doit suffir
Buildfile: /home/esup/esup-uportal/build.xml checkForTomcat: deploy-war: install-parent-pom: [artifact:install] [INFO] Installing /home/esup/esup-uportal/pom.xml to /home/esup/.m2/repository/org/jasig/portal/uportal-parent/4.0.13/uportal-parent-4.0.13.pom ... fastWarDeploy: [echo] extractWars=true [echo] removeExisting=true [mkdir] Created dir: /home/esup/esup-uportal/target/tmp/uPortal [unwar] Expanding: /home/esup/esup-uportal/uportal-war/target/uPortal.war into /home/esup/esup-uportal/target/tmp/uPortal [delete] Deleting directory /var/lib/tomcat6/webapps/uPortal [echo] Moving /home/esup/esup-uportal/target/tmp/uPortal to /var/lib/tomcat6/webapps BUILD SUCCESSFUL Total time: 38 seconds
un acces sur
http://esup4dev.tem-tsp.eu:8080/uPortal/f/welcome/normal/render.uP
affiche bien
uPortal est un portail web libre et open source implémenté en Java
pour finir l'exercice de manipulations Git , on merge nos deux branche puisqu'on est satifait du resultat
[esup@esup4dev esup-uportal]$ git branch * ecampusdb ecampusdev master [esup@esup4dev esup-uportal]$ git checkout ecampusdev Switched to branch 'ecampusdev' [esup@esup4dev esup-uportal]$ git merge ecampusdb Updating f352068..f1552d0 Fast-forward filters/esup.properties | 10 +++++----- .../events/handlers/db/PersistentPortalEvent.java | 1 + .../portlet/dao/jpa/PortletPreferenceImpl.java | 3 +++ .../portal/portlet/dao/jpa/JpaPortletDaoTest.java | 7 +++++-- 4 files changed, 14 insertions(+), 7 deletions(-) [esup@esup4dev esup-uportal]$ git status # On branch ecampusdev nothing to commit (working directory clean) [esup@esup4dev esup-uportal]$ git log -3 commit f1552d09e61fa79cb6ee3982d11c4024b82f3776 Author: Jehan <jehan.procaccia@tem-tsp.Eu> Date: Wed May 21 10:04:59 2014 +0200 modif title dans filter/esup.properties commit cd0cdbb69812fa1c4c688b0ebd65325996cee76a Merge: f352068 ae0cc08 Author: Jehan <jehan.procaccia@tem-tsp.Eu> Date: Wed May 21 09:42:29 2014 +0200 Merge branch 'UP-3488' of https://github.com/vbonamy/esup-uportal into ecampusdb
On met apache en frontal avec le proxy-ajp
https://listes.esup-portail.org/sympa/arc/esup-utilisateurs/2010-04/msg00003.html
[root@esup4dz ~] $ yum install mod_ssl Installed: mod_ssl.x86_64 1:2.4.6-31.el7.centos Complete!
il importe de configurer la partie SSL: ssl.conf d'apache !
[root@esup4dz /etc/httpd/conf.d] $ grep SSLCertificate /etc/httpd/conf.d/ssl.conf SSLCertificateFile /etc/pki/tls/certs/cert-2877-_.tem-tsp.eu.pem SSLCertificateKeyFile /etc/pki/tls/private/cert-2877.key SSLCertificateChainFile /etc/pki/tls/certs/chain-2877-_.tem-tsp.eu.pem
[root@esup4dz /etc/httpd/conf.d] $ tail -9 /etc/httpd/conf/httpd.conf ProxyPass /uPortal ajp://localhost:8009/uPortal retry=1 ProxyPass /ResourceServingWebapp ajp://localhost:8009/ResourceServingWebapp retry=1 ProxyPass /BookmarksPortlet ajp://localhost:8009/BookmarksPortlet retry=1 ProxyPass /cas-proxy-test-portlet ajp://localhost:8009/cas-proxy-test-portlet retry=1 ProxyPass /RssPortlet ajp://localhost:8009/RssPortlet retry=1 ProxyPass /WeatherPortlet ajp://localhost:8009/WeatherPortlet retry=1 ProxyPass /WebProxyPortlet ajp://localhost:8009/WebProxyPortlet retry=1 ProxyPass /manager ajp://localhost:8009/manager retry=1
ResourceServingWebapp, ressources indispensables au portail, jqueries … video esup 3.2 79mn WebProxyPortlet egalement necessaire sinon cela plante
optimisation apache sur les caches
https://www.esup-portail.org/wiki/pages/viewpage.action?pageId=260145154
plutot que l'ancienne methode a jvmRoute= dans server.xml de tomcat , on ajoute maintenant a apache
ProxySet stickysession=TOMCAT_STICKY nofailover=Off </Proxy> Header add Set-Cookie "TOMCAT_STICKY=sticky.%{BALANCER_WORKER_ROUTE}e;path=/;" env=BALANCER_ROUTE_CHANGED
et donc on remplace notre ancien JSESSIONID (valable uniquement dans un contexte de cluster de tomcat) par ce TOMCAT_STICKY (que l'on peut nommer comme on veux)
#ProxyPass / balancer://ecampus-cluster/ stickysession=JSESSIONID ProxyPass / balancer://ecampus-cluster/ stickysession=TOMCAT_STICKY
definition du context uPortal et /ResourceServingWebapp pour tomcat, cf http://www.esup-portail.org/display/ESUPMU/Tomcat+en+production
context ajoutés dans le server.xml de tomcat, sous section de <Host name=“localhost” appBase=“webapps” :
<!-- contexts Esup --> <Context path="/manager" docBase="${catalina.base}/webapps/manager" privileged="true"> <Manager pathname=""/> </Context> <Context path="/uPortal" docBase="/var/lib/tomcat6/webapps/uPortal" crossContext="true"> <ResourceLink name="jdbc/uPortalDb" global="PortalDb" type="javax.sql.DataSource" /> <Manager pathname="" /> </Context>
jdbc a relier avec le parametrage esup-uportal
# JNDI property to uncomment : environment.build.hibernate.connection.jndiname=jdbc/uPortalDB
crossContext a true pour les portlet
le portail sera accessible dans ces conditions (ProxyPass /uportal) sur l'URL
http://esup4dev.tem-tsp.eu/uPortal/render.userLayoutRootNode.uP
doc esup sur pool de DB
https://www.esup-portail.org/wiki/pages/viewpage.action?pageId=260898894
il faut une confiance entre le serveur CAS et le serveur du portail esup. c'est en certifiant le frontend apache que cette confiance (communication https entre CAS et uPortal/tomcat/apache) est réalisée. autrement on reçoit suite a une auth CAS ce genre d'erreure
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
⇒ cf ordre CA-chain ci-dessous !!
sur le serveur uPortal on met en place un frontend apache pour recptionner les requetes https (443) du serveur CAS
[root@esup4dev ~] $ yum install mod_ssl
signature d'un request de certificat par TCS, puis paramtrage apache mod_ssl
[root@esup4dev certs]# grep SSLCertificate /etc/httpd/conf.d/ssl.conf SSLCertificateFile /etc/pki/tls/certs/cert-10605--.tem-tsp.eu.pem SSLCertificateKeyFile /etc/pki/tls/private/tem-tsp_star_nop.key SSLCertificateChainFile /etc/pki/tls/certs/chain-10605--.tem-tsp.eu.pem
https://listes.esup-portail.org/sympa/arc/esup-utilisateurs/2010-06/msg00049.html
Mathieu LARCHET a écrit : > Oui une dernière idée. > On a eu des soucis car la chaîne de certification présentée par Apache était dans le désordre (fichier addtrust_chain.pem) et provoquait ce genre d'erreur. > > Voici l'ordre tel qu'il doit être (à vérifier côté Apache CAS et Apache ENT) : > > subject= /C=NL/O=TERENA/CN=TERENA SSL CA > subject= /C=US/ST=UT/L=Salt Lake City/O=The USERTRUST Network/OU=http://www.usertrust.com/CN=UTN-USERFirst-Hardware > subject= /C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root Jehan Procaccia a ecrit : le site "officiel" une chaine AddTrust/Tenrena: $ wget http://www.cru.fr/_media/services/tcs/cachain.pem je renomme pour faire apparaitre l'ordre dans le nom de fichier $ cp cachain.pem cachain-TERENA_UTN-USERFirst-Hardware_AddTrust.pem effectivement celui livré à la signature (il y a ~3semaines) par la PKI TCS est en ordre inverse chain-1073-esup3dev.it-sudparis.eu.pem = Addtrust, puis UTN-USERFirst-Hardware et enfin TERENA :-( ! je corrige mes 2 frontaux apache (esup et CAS) avec : SSLCertificateChainFile /etc/pki/tls/certs/cachain-TERENA_UTN-USERFirst-Hardware_AddTrust.pem Cela marche .
$ openssl s_client -connect esup4dev.tem-tsp.eu:443 -CAfile /etc/pki/tls/certs/add_trust_external_ca_root.pem -verify 3 verify depth is 3 CONNECTED(00000003) depth=3 C = SE, O = AddTrust AB, OU = AddTrust External TTP Network, CN = AddTrust External CA Root verify return:1 depth=2 C = US, ST = UT, L = Salt Lake City, O = The USERTRUST Network, OU = http://www.usertrust.com, CN = UTN-USERFirst-Hardware verify return:1 depth=1 C = NL, O = TERENA, CN = TERENA SSL CA verify return:1 depth=0 C = FR, O = Telecom Ecole de Management et Telecom SudParis, OU = DISI, CN = *.tem-tsp.eu verify return:1 --- Certificate chain 0 s:/C=FR/O=Telecom Ecole de Management et Telecom SudParis/OU=DISI/CN=*.tem-tsp.eu i:/C=NL/O=TERENA/CN=TERENA SSL CA 1 s:/C=NL/O=TERENA/CN=TERENA SSL CA i:/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST Network/OU=http://www.usertrust.com/CN=UTN-USERFirst-Hardware 2 s:/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST Network/OU=http://www.usertrust.com/CN=UTN-USERFirst-Hardware i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root 3 s:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root ---
il faut rendre accessible a tomcat le driver mysql et/ou postgresql, autrement au demarrage du serveur on a ce type d'erreur:
INFO: Portlet Container [/uPortal-PlutoPortletContainer]: Container initialized successfully. Cannot load JDBC driver class 'com.mysql.jdbc.Driver' java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
il ne semble plus necessaire de copier le driver, le build / ant se chargeant de le mettre en place dans webapps
[root@esup4dev conf]# locate postgresql-9.0-801.jdbc4.jar /home/esup/.m2/repository/postgresql/postgresql/9.0-801.jdbc4/postgresql-9.0-801.jdbc4.jar ... /var/lib/tomcat6/webapps/WebProxyPortlet/WEB-INF/lib/postgresql-9.0-801.jdbc4.jar /var/lib/tomcat6/webapps/uPortal/WEB-INF/lib/postgresql-9.0-801.jdbc4.jar
ou en mysql
[root@ecampusdev ~]# locate mysql-connector-java-5.1.9.jar /home/esup/.m2/repository/mysql/mysql-connector-java/5.1.9/mysql-connector-java-5.1.9.jar ... /usr/local/apache-tomcat-6.0.36-esup/webapps/WebProxyPortlet/WEB-INF/lib/mysql-connector-java-5.1.9.jar /usr/local/apache-tomcat-6.0.36-esup/webapps/uPortal/WEB-INF/lib/mysql-connector-java-5.1.9.jar
il faut imperativement changer le mot de passe admin
video2 esup3.2 5mn
[esup@esup4dev esup-uportal]$ locate admin.user.xml /home/esup/esup-uportal/uportal-war/src/main/data/default_entities/user/admin.user.xml
generation d'une chaine md5 sur http://www.md5.net/ par exempl, adaptation du fichier de définition du compte admin
[esup@esup4dev esup-uportal]$ cat /home/esup/esup-uportal/uportal-war/src/main/data/default_entities/user/admin.user.xml <user xmlns="https://source.jasig.org/schemas/uportal/io/user" xmlns:ns2="https://source.jasig.org/schemas/uportal/io/permission-owner" xmlns:ns3="https://source.jasig.org/schemas/uportal/io/stylesheet-descriptor" xmlns:ns4="https://source.jasig.org/schemas/uportal/io/portlet-definition" xmlns:ns5="https://source.jasig.org/schemas/uportal" xmlns:ns6="https://source.jasig.org/schemas/uportal/io/portlet-type" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" username="admin" version="4.0" xsi:schemaLocation="https://source.jasig.org/schemas/uportal/io/user https://source.jasig.org/schemas/uportal/io/user/user-4.0.xsd"> <default-user>defaultTemplateUser</default-user> <password>(MD5)64a24fed9cf544cfe09249ddc6e56795</password> <attribute> <name>givenName</name> <value>Amy</value> </attribute> ...
import
[esup@esup4dev esup-uportal]$ ant data-import -Dfile=uportal-war/src/main/data/default_entities/user/admin.user.xml
Si pb de memoire java
java.io.IOException: error=12, Cannot allocate memory
alors on reduit l'empreinte memoire lié au process ant
[esup@esup3re7 esup-install]$ cat ~/.ant/ant.conf ANT_OPTS="-Xms200M -Xmx200M"
Nous allons travailler dans une arborescence de personnalisation (custom) propre a cette plateforme de developpement. Pour ce faire nous creeons un directory de custom spécifique et le lien qui va avec
[esup@esup4dev esup-uportal]$ cd uportal-war/src/main/data/ [esup@esup4dev data]$ ls default_entities quickstart_entities required_entities [esup@esup4dev data]$ mkdir tem-tsp [esup@esup4dev data]$ cd /home/esup/esup-uportal/ [esup@esup4dev esup-uportal]$ ln -s uportal-war/src/main/data/tem-tsp/ custom [esup@esup4dev esup-uportal]$ ls -l custom lrwxrwxrwx 1 esup tomcat 34 Jul 16 15:18 custom -> uportal-war/src/main/data/tem-tsp/
ici nous recuperons le sous repertoire custom d'une autre machine de develoopement , pour profitons de l'outil git pour ce faire plutot que les traditionels “scp” !
http://jasonkarns.com/blog/subdirectory-checkouts-with-git-sparse-checkout/
[esup@esup4dev custom]$ git remote add ecampusdev-esup-uportal ssh://gituser@gitshare.tem-tsp.eu/~/ecampus/ecampusdev-esup-uportal.git [esup@esup4dev custom]$ git branch -a [esup@esup4dev custom]$ git remote -v show ecampusdev-esup-uportal ssh://gituser@gitshare.tem-tsp.eu/~/ecampus/ecampusdev-esup-uportal.git (fetch) ecampusdev-esup-uportal ssh://gituser@gitshare.tem-tsp.eu/~/ecampus/ecampusdev-esup-uportal.git (push) [esup@esup4dev custom]$ ls -al total 12 drwxr-xr-x 3 esup tomcat 4096 Jul 16 15:21 . drwxr-xr-x 6 esup tomcat 4096 Jul 16 15:14 .. drwxr-xr-x 7 esup tomcat 4096 Jul 16 15:33 .git
https://wiki.jasig.org/pages/viewpage.action?pageId=52953648
groups sur attributs utilisateur
Rechercher les attributs utilisateur dans ldap, les attributs qu'on souhaite mapper pour chaque utilisateur dans ldap.
[esup@esup4dev esup-uportal]$ diff /tmp/personDirectoryContext.xml /home/esup/esup-uportal/uportal-war/src/main/resources/properties/contexts/personDirectoryContext.xml 161c161 < <ref bean="uPortalLdapAttributeSource"/> --- > <ref bean="uPortalLdapAttributeSource"/> 242c242 < <!-- Rajout ci-dessous pour retirer le "Unrecognized Person" --> --- > 246,247d245 < <!-- AND NOT FOUND BEFORE ?? --> < <property name="baseDN" value="${ldap.baseDn}" /> 281,285d278 < <entry key="departmentNumber"> <value>departmentNumber</value></entry> < <entry key="Title"> <value>Title</value></entry> < <entry key="employeeType"> <value>employeeType</value></entry> < <entry key="eduPersonScopedAffiliation"> <value>eduPersonScopedAffiliation</value></entry> < <entry key="eduPersonPrimaryOrgUnitDN"> <value>eduPersonPrimaryOrgUnitDN</value></entry> [esup@esup4dev esup-uportal]$ cp /tmp/personDirectoryContext.xml /home/esup/esup-uportal/uportal-war/src/main/resources/properties/contexts/personDirectoryContext.xml
import d'utilisateur modele pour les layout (user-lo.xml …)
[esup@esup4dev esup-uportal]$ ant data-import -Dfile=custom/uportal-war/src/main/data/tem-tsp/user/application-lo.user.xml ... [java] INFO [21:55,276] Importing Data from: custom/uportal-war/src/main/data/tem-tsp/user/application-lo.user.xml [java] INFO [21:55,440] Imported : file:/home/esup/esup-uportal/custom/uportal-war/src/main/data/tem-tsp/user/application-lo.user.xml [java] INFO [21:55,489] Closing JPA EntityManagerFactory for persistence unit 'PortalDb' [java] INFO [21:55,500] Closing JPA EntityManagerFactory for persistence unit 'AggrEventsDb' [java] INFO [21:55,506] Closing JPA EntityManagerFactory for persistence unit 'RawEventsDb' BUILD SUCCESSFUL Total time: 22 seconds
[esup@esup4dev esup-uportal]$ ant data-import -Dfile=custom/uportal-war/src/main/data/tem-tsp/group_membership/Academics.group-membership.xml [java] INFO [19:13,736] Importing Data from: custom/uportal-war/src/main/data/tem-tsp/group_membership/Academics.group-membership.xml [java] INFO [19:13,867] Imported : file:/home/esup/esup-uportal/custom/uportal-war/src/main/data/tem-tsp/group_membership/Academics.group-membership.xml [java] INFO [19:13,872] Imported : file:/home/esup/esup-uportal/custom/uportal-war/src/main/data/tem-tsp/group_membership/Academics.group-membership.xml [java] INFO [19:13,944] Closing JPA EntityManagerFactory for persistence unit 'PortalDb' [java] INFO [19:13,955] Closing JPA EntityManagerFactory for persistence unit 'AggrEventsDb' [java] INFO [19:13,961] Closing JPA EntityManagerFactory for persistence unit 'RawEventsDb' BUILD SUCCESSFUL Total time: 22 seconds [esup@esup4dev esup-uportal]$ ant data-import -Dfile=custom/uportal-war/src/main/data/tem-tsp/group_membership/Applications.group-membership.xml ... [java] INFO [21:02,889] Importing Data from: custom/uportal-war/src/main/data/tem-tsp/group_membership/Applications.group-membership.xml [java] INFO [21:03,036] Looking up bean 'counterStore' in ApplicationContext due to context not yet being initialized [java] INFO [21:03,059] Imported : file:/home/esup/esup-uportal/custom/uportal-war/src/main/data/tem-tsp/group_membership/Applications.group-membership.xml [java] INFO [21:03,064] Imported : file:/home/esup/esup-uportal/custom/uportal-war/src/main/data/tem-tsp/group_membership/Applications.group-membership.xml [java] INFO [21:03,140] Closing JPA EntityManagerFactory for persistence unit 'PortalDb' [java] INFO [21:03,152] Closing JPA EntityManagerFactory for persistence unit 'AggrEventsDb' [java] INFO [21:03,160] Closing JPA EntityManagerFactory for persistence unit 'RawEventsDb' BUILD SUCCESSFUL Total time: 22 seconds
exemple avec portlet esup-filemanager
[esup@esup4dev esup-uportal]$ ant data-import -Ddir=custom/uportal-war/src/main/data/tem-tsp/portlet-definition/ -Dpattern=esup-filemanager.portlet-definition.xml ... [java] INFO [19:54,195] Importing Data from: custom/uportal-war/src/main/data/tem-tsp/portlet-definition/ that matches esup-filemanager.portlet-definition.xml [java] INFO [19:54,201] Scanning for files to Import from: custom/uportal-war/src/main/data/tem-tsp/portlet-definition [java] INFO [19:54,244] Found 1 files to Import from: custom/uportal-war/src/main/data/tem-tsp/portlet-definition [java] INFO [19:54,244] Importing 1 files of type <{https://source.jasig.org/schemas/uportal/io/portlet-definition}portlet-definition version="4.0"> [java] INFO [19:54,329] Looking up bean 'referenceEntitySearcher' in ApplicationContext due to context not yet being initialized [java] INFO [19:54,396] Looking up bean 'entityTypes' in ApplicationContext due to context not yet being initialized [java] INFO [19:54,423] Looking up bean 'entityCachingService' in ApplicationContext due to context not yet being initialized [java] INFO [19:54,477] Looking up bean 'authorizationService' in ApplicationContext due to context not yet being initialized [java] INFO [19:54,545] Imported : esup-filemanager.portlet-definition.xml [java] INFO [19:54,549] For a detailed report on the data import see /home/esup/esup-uportal/target/data-import-reports/data-import.txt [java] INFO [19:54,606] Closing JPA EntityManagerFactory for persistence unit 'PortalDb' [java] INFO [19:54,633] Closing JPA EntityManagerFactory for persistence unit 'AggrEventsDb' [java] INFO [19:54,649] Closing JPA EntityManagerFactory for persistence unit 'RawEventsDb' BUILD SUCCESSFUL Total time: 21 seconds
au fur et a mesure que j'atteind ces etapes, je les modifies et/ou retire suivant leur pertinance en uPortal 4.x
http://esup32dev.it-sudparis.eu/uPortal/EsupMonitor?xml
<runtimeinfo> <memory free="339299720" total="500563968" max="954466304"/> <sessions total="1" guest="1" connected="0"/> <users> </users> </runtimeinfo>
et toutes les autres (/services, /private , /manager ) a proteger par des Locations dans le proxy_ajp.conf
[root@esup32dev /] $ cat /etc/httpd/conf.d/proxy_ajp.conf <Location /> Order deny,allow Allow from all </Location> <Location "/uPortal/EsupMonitor"> Order deny,allow Deny from all Allow from 157.159. </Location> <Location "/uPortal/services"> Order deny,allow Deny from all Allow from 157.159.21. 157.159.50. </Location> <Location "/uPortal/private"> Order deny,allow Deny from all Allow from 157.159. #AuthName "Administration ENT" #AuthType CAS #require user ... </Location> <Location "/manager"> Order deny,allow Deny from all Allow from 157.159. </Location> <Proxy *> Order deny,allow Allow from all </Proxy>
Rechercher les attributs utilisateur dans ldap, les attributs qu'on souhaite mapper pour chaque utilisateur dans ldap. video2 3.2 14mn
[esup@esup3re7 esup-install]$ grep ldap.persondirs config.properties esup.ldap.persondirs.use=true [esup@esup3re7 esup-install]$ mkdir -p custom/uPortal/uportal-impl/src/main/resources/properties/contexts
cela active la partie ldap du fichier personDirectoryContext.xml
on copie ce fichier pour éventuellement le customiser:
[esup@esup3re7 esup-install] $ cp /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/update/uPortal/uportal-impl/src/main/resources/properties/contexts/personDirectoryContext.xml custom/uPortal/uportal-impl/src/main/resources/properties/contexts/personDirectoryContext.xml
par exemple à ligne 265 *<bean id=“cachinguPortalLdapUserSource”* partie gauche nom de l'attribut ldap, droite nom de l'attribut uPortal
Par exemple nos groups PAGS (plus bas …) utiliseront un filtre sur des attributs non définis (matchés) par defaut comme eduPersonOrgUnitDN et eduPersonPrimaryOrgUnitDN
<entry key="eduPersonAffiliation"> <value>eduPersonAffiliation</value></entry> <entry key="eduPersonOrgUnitDN"> <value>eduPersonOrgUnitDN</value></entry> <entry key="eduPersonPrimaryOrgUnitDN"> <value>eduPersonPrimaryOrgUnitDN</value></entry> <entry key="supannaffectation"> <value>supannaffectation</value></entry>
les groupes PAGS sont constitués sur des attributs utilisateurs et non sur des groupes ldap.
Apres ce custom de personDirectoryContext.xml, on relance un
ant init ant deploy
Ensuite on peux vérifier la récupération d'attribut ldap pour un utilisateur en se connectant admin au portail puis Accueil → Administration → Echange d'attributs, on recherche un utilisateur “test” par exemple
Informations détaillées sur l'utilisateur : test Attribut Valeur(s) cn compte de test s2ia Nom usuel (displayName) tuti TEST eduPersonAffiliation NONE eduPersonPrimaryAffiliation employee eduPersonOrgUnitDN sn=DISI,sn=SECG,sn=TMSP,ou=structures.... eduPersonPrimaryOrgUnitDN sn=DISI,sn=SECG,sn=TMSP,ou=structures.... ...
on a bien récupéré des attributs ldap qualifiant cet utilisateur tels que definit dans personDirectoryContext.xml
video3 0mn (5mn40s arrivée d'une trottinette )
les groupes locaux sont des groups dans la BD esup . il servent a un usage de petits groupes, par exemple les personnes autorisées a publier dans l'intranet . Pour les autres groupes plus “macro” on utilisera plutot persondDir + groupPags ⇒ groups basés sur des attrribut utilisateur . (rappel, plus besoin de “groupLoader”, maintenant usage de db.import !)
ce qui est deployé a l'initialisation d'esup (jasig)
[esup@esup3re7 esup-install]$ ls Portail/uPortal_rel-3.2.4/uportal-impl/src/main/resources/properties/db/mini/ channel channel-type fragment-layout layout permission_set structure user channel-esup entity-type group_membership permission profile theme [esup@esup3re7 esup-install]$ ls -l Portail/uPortal_rel-3.2.4/uportal-impl/src/main/resources/properties/db/mini/group_membership/ total 44 -rw-rw-r-- 1 esup esup 362 Jul 9 19:26 Administrateurs_Portail.group_membership -rw-rw-r-- 1 esup esup 343 Jul 9 19:26 Anonymes.group_membership -rw-rw-r-- 1 esup esup 267 Jul 9 19:26 Applications.group_membership -rw-rw-r-- 1 esup esup 265 Jul 9 19:26 Canaux_eSup.group_membership -rw-rw-r-- 1 esup esup 271 Jul 9 19:26 Canaux_uPortal.group_membership -rw-rw-r-- 1 esup esup 266 Jul 9 19:26 Demonstration.group_membership -rw-rw-r-- 1 esup esup 260 Jul 9 19:26 Information.group_membership -rw-rw-r-- 1 esup esup 378 Jul 9 19:26 Portal System.group_membership -rw-rw-r-- 1 esup esup 454 Jul 9 19:26 Proprietaires_de_fragment.group_membership -rw-rw-r-- 1 esup esup 459 Jul 9 19:26 Toutes_les_categories.group_membership -rw-rw-r-- 1 esup esup 433 Jul 9 19:26 Tout_le_monde.group_membership
suite a db.init initial on a cette arborescence de groupes uportal/esup par defaut
Root Groups Réduire le groupe Toutes les categories Groupe Applications Etendre le groupe Canaux eSup Etendre le groupe Canaux uPortal Groupe Demonstration Etendre le groupe Information Réduire le groupe Tout le monde Etendre le groupe Administrateurs Portail Etendre le groupe Anonymes Etendre le groupe PAGS Root Etendre le groupe Proprietaires de fragment
Ici pour “jouer” avec les groupes locaux, on va creer une arborescence de groupes locaux a la place de “PAGS Root”.
ces groupes “conteneurs” sont issuent du tutoriel, il seront rattachés au parent Mes_groupes_locaux lui meme rataché au macro group Tout_le_monde
[esup@esup3re7 esup-install]$ mkdir -p custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/group_membership/ [esup@esup3re7 esup-install]$ cp ~/src-tuto-julien/*group_membership custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/group_membership/ [esup@esup3re7 esup-install]$ ls -l custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/group_membership/ total 16 -rw-r--r-- 1 esup esup 371 Jul 10 11:21 Mes_groupes_locaux.group_membership -rw-r--r-- 1 esup esup 485 Jul 10 11:21 Tout_le_monde.group_membership -rw-r--r-- 1 esup esup 323 Jul 10 11:21 Utilisateurs_apogee.group_membership -rw-r--r-- 1 esup esup 323 Jul 10 11:21 Utilisateurs_harpege.group_membership [esup@esup3re7 ~/esup-install] $ cat ../src-tuto-julien/Tout_le_monde.group_membership <group script="classpath://org/jasig/portal/io/import-group_membership_v3-0.crn"> <name>Tout le monde</name> <entity-type>org.jasig.portal.security.IPerson</entity-type> <creator>system</creator> <description>Toutes les personnes</description> <children> <group>Anonymes</group> <group>Proprietaires de fragment</group> <group>Administrateurs Portail</group> <group>Mes groupes locaux</group> <literal>defaultTemplateUser</literal> </children> [esup@esup3re7 esup-install]$ diff Portail/uPortal_rel-3.2.4/uportal-impl/src/main/resources/properties/db/mini/group_membership/Tout_le_monde.group_membership custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/group_membership/Tout_le_monde.group_membership 11c11,12 < <group>PAGS Root</group> --- > <group>Mes groupes locaux</group> > <literal>defaultTemplateUser</literal>
on procede a l'import de ces groupes
[esup@esup3re7 esup-install]$ ant db.import -Ddir=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/group_membership/ Buildfile: build.xml Trying to override old definition of task java Trying to override old definition of task javac db.import: prodPrompt: crn-import: install-parent-pom: [artifact:install] [INFO] Installing /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/pom.xml to /home/esup/.m2/repository/org/jasig/portal/uportal-parent/3.2.4/uportal-parent-3.2.4.pom [touch] Creating /tmp/jasig/uportal-parent.pom-1859255917-marker [echo] Artifact '/home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/uportal-impl/target/uportal-impl-3.2.4.jar' is up-to-date [artifact:install] [INFO] Installing /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/uportal-impl/target/uportal-impl-3.2.4.jar to /home/esup/.m2/repository/org/jasig/portal/uportal-impl/3.2.4/uportal-impl-3.2.4.jar [java] [java] INFO Creating new lazily initialized GenericApplicationContext for the portal [java] INFO Created new MemoryContext with environment '{java.naming.factory.url.pkgs=tyrex.naming, java.naming.provider.url=, java.naming.factory.initial=org.jasig.portal.jndi.DisposableMemoryContextFactory}' [java] INFO Initialized portal JNDI context [java] INFO Failed to load bean 'PortalDb.JNDI' from ApplicationContext expecting type: interface javax.sql.DataSource. Will try to load the next bean in the list instead. Error message from the attempt to load this bean ('PortalDb.JNDI'): Error creating bean with name 'PortalDb.JNDI' defined in class path resource [properties/contexts/datasourceContext.xml]: Invocation of init method failed; nested exception is javax.naming.NotContextException: comp is not a subcontext (enable debug for stack trace) [java] INFO Loaded bean for name PortalDb.direct [java] INFO Setting CacheProvider 'org.jasig.portal.utils.cache.hibernate.EhCacheProvider@d9b071' on ThreadLocal [java] INFO Created new lazily initialized GenericApplicationContext for the portal in 4096ms [java] Base Import Directory=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/group_membership/ [java] FILE_PATTERN=.* [java] Import Group_Membership: Mes_groupes_locaux.group_membership [java] INFO Looking up bean 'counterStore' in ApplicationContext due to context not yet being initialized [java] Import Group_Membership: Tout_le_monde.group_membership [java] Import Group_Membership: Utilisateurs_apogee.group_membership [java] Import Group_Membership: Utilisateurs_harpege.group_membership [java] Import Group_Membership: Mes_groupes_locaux.group_membership [java] INFO Parsing group service configuration. [java] INFO RDBMEntityGroupStore.initialize(): Node separator set to . [java] INFO Looking up bean 'cacheFactory' in ApplicationContext due to context not yet being initialized [java] INFO Looking up bean 'PortalDb' in ApplicationContext due to context not yet being initialized [java] INFO Looking up bean 'entityCachingService' in ApplicationContext due to context not yet being initialized [java] Import Group_Membership: Tout_le_monde.group_membership [java] Import Group_Membership: Utilisateurs_apogee.group_membership [java] Import Group_Membership: Utilisateurs_harpege.group_membership [java] Import of /home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/group_membership/ Complete in 5186 milliseconds. BUILD SUCCESSFUL Total time: 10 seconds
une fois réalisé voici la visibilté “graphique” depuis le gestionnaire de groupe
Root Groups Réduire le groupe Toutes les categories Groupe Applications Etendre le groupe Canaux eSup Etendre le groupe Canaux uPortal Groupe Demonstration Etendre le groupe Information Réduire le groupe Tout le monde Etendre le groupe Administrateurs Portail Etendre le groupe Anonymes Réduire le groupe Mes groupes locaux Etendre le groupe Utilisateurs apogée Etendre le groupe Utilisateurs harpege Etendre le groupe Proprietaires de fragment
avec db.import , chaque éléments de la BD uPortal est une “entité”, on peut appercevoir une liste d'entité (layout, channel, user …)
import des groupes definis ci-dessus
[esup@esup32dev ~/esup-install] $ ant db.import -Ddir=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/group_membership/ Buildfile: build.xml [java] Base Import Directory=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/group_membership/ [java] FILE_PATTERN=.* [java] Import Group_Membership: Mes_groupes_locaux.group_membership [java] INFO Looking up bean 'counterStore' in ApplicationContext due to context not yet being initialized [java] Import Group_Membership: Tout_le_monde.group_membership [java] Import Group_Membership: Utilisateurs_apogee.group_membership [java] Import Group_Membership: Utilisateurs_harpege.group_membership [java] Import Group_Membership: Mes_groupes_locaux.group_membership [java] INFO Parsing group service configuration. [java] INFO RDBMEntityGroupStore.initialize(): Node separator set to . [java] INFO Looking up bean 'cacheFactory' in ApplicationContext due to context not yet being initialized [java] INFO Looking up bean 'PortalDb' in ApplicationContext due to context not yet being initialized [java] INFO Looking up bean 'entityCachingService' in ApplicationContext due to context not yet being initialized [java] Import Group_Membership: Tout_le_monde.group_membership [java] Import Group_Membership: Utilisateurs_apogee.group_membership [java] Import Group_Membership: Utilisateurs_harpege.group_membership [java] Import of /home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/group_membership/ Complete in 20308 milliseconds. BUILD SUCCESSFUL Total time: 37 seconds
Définition dans la tache crn-export du build.xml de uPortal:
[esup@esup3re7 ~/esup-install] $ vim Portail/uPortal_rel-3.2.4/build.xml <target name="crn-export" description="Exports the specified entity or entities to XML on the file system"> <uportal-impl-macro> <!-- Three properties control the export: dir, type, and sysid --> <fail unless="type"> You must specify a "type" parameter (-Dtype={something}) from the following: all, layout, all-layouts, channel, all-channels, all-permissions, all-memberships, group, all-groups, user, all-users. </fail>
on voit donc qu'on peux exporter plein de chose avec le -Dtype .
exemple d'export des groups
[esup@esup3re7 esup-install]$ mkdir -p custom/db-export [esup@esup3re7 esup-install]$ ls custom/db-export [esup@esup3re7 esup-install]$ ant db.export -Ddir=/home/esup/esup-install/custom/db-export/ -Dtype=all-groups Buildfile: build.xml Trying to override old definition of task java Trying to override old definition of task javac db.export: crn-export: install-parent-pom: [artifact:install] [INFO] Installing /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/pom.xml to /home/esup/.m2/repository/org/jasig/portal/uportal-parent/3.2.4/uportal-parent-3.2.4.pom [touch] Creating /tmp/jasig/uportal-parent.pom-169575416-marker [echo] Artifact '/home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/uportal-impl/target/uportal-impl-3.2.4.jar' is up-to-date [artifact:install] [INFO] Installing /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/uportal-impl/target/uportal-impl-3.2.4.jar to /home/esup/.m2/repository/org/jasig/portal/uportal-impl/3.2.4/uportal-impl-3.2.4.jar [java] [java] INFO Creating new lazily initialized GenericApplicationContext for the portal [java] INFO Created new MemoryContext with environment '{java.naming.factory.url.pkgs=tyrex.naming, java.naming.provider.url=, java.naming.factory.initial=org.jasig.portal.jndi.DisposableMemoryContextFactory}' [java] INFO Initialized portal JNDI context [java] INFO Failed to load bean 'PortalDb.JNDI' from ApplicationContext expecting type: interface javax.sql.DataSource. Will try to load the next bean in the list instead. Error message from the attempt to load this bean ('PortalDb.JNDI'): Error creating bean with name 'PortalDb.JNDI' defined in class path resource [properties/contexts/datasourceContext.xml]: Invocation of init method failed; nested exception is javax.naming.NotContextException: comp is not a subcontext (enable debug for stack trace) [java] INFO Loaded bean for name PortalDb.direct [java] INFO Setting CacheProvider 'org.jasig.portal.utils.cache.hibernate.EhCacheProvider@b1fea4' on ThreadLocal [java] INFO Created new lazily initialized GenericApplicationContext for the portal in 3782ms [java] Begin uPortal Export 'all-groups': 1341919464612 [java] Export Group: GROUP_NAME=Tout le monde [java] Export Group: GROUP_NAME=Toutes les categories [java] Export Group: GROUP_NAME=Anonymes [java] Export Group: GROUP_NAME=Applications [java] Export Group: GROUP_NAME=Canaux eSup [java] Export Group: GROUP_NAME=Canaux uPortal [java] Export Group: GROUP_NAME=Demonstration [java] Export Group: GROUP_NAME=Information [java] Export Group: GROUP_NAME=Portal System [java] Export Group: GROUP_NAME=Proprietaires de fragment [java] Export Group: GROUP_NAME=Administrateurs Portail [java] Export Group: GROUP_NAME=Mes groupes locaux [java] Export Group: GROUP_NAME=Utilisateurs apogée [java] Export Group: GROUP_NAME=Utilisateurs harpege [java] uPortal Export 'all-groups' Complete in 452 milliseconds. BUILD SUCCESSFUL Total time: 10 seconds [esup@esup3re7 esup-install]$ ls custom/db-export/group/ Administrateurs_Portail-2.group Demonstration-15.group Toutes_les_categories-1.group Anonymes-11.group Information-16.group Tout_le_monde-0.group Applications-12.group Mes_groupes_locaux-21.group Utilisateurs_apogée-22.group Canaux_eSup-13.group Portal_System-17.group Utilisateurs_harpege-23.group Canaux_uPortal-14.group Proprietaires_de_fragment-18.group
Attention, export par défaut en version 2.6 ! c'est évoqué dans video3 ~vers 13mn.
[esup@esup32dev ~/esup-install] $ vim Portail/uPortal_rel-3.2.4/uportal-impl/src/main/resources/properties/export.properties
mais tout n'est pas là …
De plus certain canaux peuvent enregistrer les ID des groups et pas leur nom, donc lors d'une migration d'une version esup a une autre cela peu poser probleme si les groupes ne sont pas ré-importer dans le meme ordre que lors de la version precedente , (video3 16mn)
cf
[esup@esup32dev ~/esup-install] $ vim Portail/uPortal_rel-3.2.4/uportal-impl/target/classes/org/jasig/portal/io/generate-group-id.crn
dans le portail en tant qu'admin, administration → gestion des groupes , on retrouve la liste initiale des groupes esup
Groupe Root Groups Réduire le groupe Toutes les categories Groupe Applications Etendre le groupe Canaux eSup Etendre le groupe Canaux uPortal Groupe Demonstration Etendre le groupe Information Réduire le groupe Tout le monde Etendre le groupe Administrateurs Portail Etendre le groupe Anonymes Etendre le groupe PAGS Root Etendre le groupe Proprietaires de fragment
video3 7mn30s
pour voir apparaître (rapidement) nos nouveaux groupes, on profite du gestionnaire de cache d'esup, qui va nous permettre de mettre a jour immédiatement l'information en vidant le cache concernant les groups ici.
Statistiques du cache org.jasig.portal.groups.IEntityGroup Propriétés du cache Valeur Nb d'objets 16 Accès au cache réussis 17609 Accès au cache ratés 58 Nb d'objets en mémoire 16 Accès en m00e9moire 17609 Nb d'objets sur disque 0 Accès au disque 0 Nb de suppressions du cache 0 Méthode statistique Best Effort
on retrouve alors les groups locaux qu'on viens d'importer
Groupe Root Groups Réduire le groupe Toutes les categories Groupe Applications Etendre le groupe Canaux eSup Etendre le groupe Canaux uPortal Groupe Demonstration Etendre le groupe Information Réduire le groupe Tout le monde Groupe Administrateurs Portail Groupe Anonymes Réduire le groupe Mes groupes locaux Etendre le groupe Utilisateurs apogée Etendre le groupe Utilisateurs harpege Groupe Proprietaires de fragment
video3 17mn30s
reference http://www.esup-portail.org/display/ESUPMU/Groupes+%28esup-3%29 https://wiki.jasig.org/display/UPM32/Person+Attribute+Group+Store+%28PAGS%29
attention au group “PAGS root” de base qui n'est souvent pas repris dans une implementation locale personalisée de PAGSGroupStoreConfig.xml, cela plante les groupes initiaux de base du db.init cf https://listes.esup-portail.org/sympa/arc/esup-utilisateurs/2011-06/msg00034.html
Les groups PAGS se basent sur des attributs utilisateur uPortal ⇒ il faut avoir fait le mapping d'attributs dans le “persondir” au prealable . L'appartenance a un groupe est calculée à la connexion au portail, on recupere ses attributs utilisateur puis on verifie dans le fichier PAGS les groupes auquels il appartient ⇒ performance, mais pas de possibilité de lister les membres d'un groupe PAGS
Activer la fonctionnalité groupePAGS:
s'etait necessaire en 3.1
[esup@esup3dev ~/src/esup-3.1.2-esup-0.5-RC3] $ echo "esup.ldap.groups.use=true" >> custom.properties
maintenant en 3.2 c'est activé par defaut.
configurer les group PAGS, lesquels, sur quels attributs:
[esup@esup3re7 esup-install] $ mkdir -p custom/uPortal/uportal-impl/src/main/resources/properties/groups [esup@esup3re7 esup-install] $ cp Portail/uPortal_rel-3.2.4/uportal-impl/src/main/resources/properties/groups/PAGSGroupStoreConfig.xml custom/uPortal/uportal-impl/src/main/resources/properties/groups
Attention au nom des clés de group, dans une definition de type
<group-key>TousPers</group-key>
le clée sera Pags.TousPers !
et type de filtrage d'attribut: http://www.esup-portail.org/display/ESUPMU/Groupes+(esup-3)
exemple ajout de serv_disi et etab_tmsp:
<group> <group-key>serv_disi</group-key> <group-name>Service DISI (LDAP)</group-name> <group-description>Tous les personnels de la DISI Evry</group-description> <selection-test> <test-group> <test> <attribute-name>supannAffectation</attribute-name> <tester-class>org.jasig.portal.groups.pags.testers.StringEqualsIgnoreCaseTester</tester-class> <test-value>DISI</test-value> </test> </test-group> </selection-test> </group> <group> <group-key>etab_tmsp</group-key> <group-name>Etablissement TMSP (LDAP)</group-name> <group-description>Tous les personnels de TMSP</group-description> <selection-test> <test-group> <test> <attribute-name>eduPersonOrgUnitDN</attribute-name> <tester-class>org.jasig.portal.groups.pags.testers.ValueExistsTester</tester-class> <test-value>TMSP</test-value> </test> </test-group> </selection-test> </group>
on modifie aussi les racines
[esup@esup3re7 esup-install]$ diff Portail/uPortal_rel-3.2.4/uportal-impl/src/main/resources/properties/groups/PAGSGroupStoreConfig.xml custom/uPortal/uportal-impl/src/main/resources/properties/groups/PAGSGroupStoreConfig.xml ... < Group pags_root: "PAGS Root" < IMPORTANT: The PAGS Root group is REQUIRED for uPortal to function. It Must be a member of the Everyone group in the < local group store < --> < <group> < <group-key>pags_root</group-key> < <group-name>PAGS Root</group-name> < <group-description>Root group for all PAGS groups. Convenience for adding PAGS groups to a local group.</group-description> < <members> < <member-key>all_users</member-key> < </members> < </group> ... < 75c38 < <group-name>LDAP Tout le personnel</group-name> --- > <group-name>Tout le personnel</group-name> 80c43 < <attribute-name>eduPersonAffiliation</attribute-name> --- > <attribute-name>eduPersonPrimaryAffiliation</attribute-name> 87c50 ... > <group> 126c104 < <group-name>LDAP Tous les invites</group-name> --- > <group-name>Tous les invites</group-name> 131c109
Deployer ce PAGSGroupStoreConfig.xml via un ant init puis ant deploy, apres un redemarrage du portail on doit retrouver ces definitions de groupes. En tant qu'admin, dans le group Manager → *search group of person contains LDAP* on voit alors apparaitre nos definitions de groupe.
L'etape suivante est de ratacher ces groupes PAGS a des groupes locaux afin qu'ils apparaissent “proprement” dans le group Manager mais aussi qu'il y ait un hierarchie de groupe, donc heritage “deepMemberOf” …
Ici on recopie nos definitions de groups depuis la version 3.1
Adaptation des groupes a l'organisation de noter campus
[esup@esup3re7 group_membership]$ diff Tout_le_monde.group_membership /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/uportal-impl/src/main/resources/properties/db/itsp/group_membership/Tout_le_monde.group_membership 0a1 > 11d11 < <group>ITSP groupes LDAP</group> 14c14 < </group> --- > </group> \ No newline at end of file
[esup@esup3re7 group_membership]$ ls -l total 24 -rw-r--r-- 1 esup esup 371 Jul 10 11:21 Mes_groupes_locaux.group_membership -rw-r--r-- 1 esup esup 485 Jul 10 11:21 Tout_le_monde.group_membership -rw-r--r-- 1 esup esup 323 Jul 10 11:21 Utilisateurs_apogee.group_membership -rw-r--r-- 1 esup esup 323 Jul 10 11:21 Utilisateurs_harpege.group_membership [esup@esup3re7 group_membership]$ pwd /home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/group_membership [esup@esup3re7 group_membership]$ cp /home/esup/esup32devdata/*.group_membership . [esup@esup3re7 group_membership]$ ls -l total 48 -rw-r--r-- 1 esup esup 295 Jul 10 11:33 Divers.group_membership -rw-r--r-- 1 esup esup 395 Jul 10 11:33 Etablissements.group_membership -rw-r--r-- 1 esup esup 305 Jul 10 11:33 Information.group_membership -rw-r--r-- 1 esup esup 517 Jul 10 11:33 ITSP_groupes_LDAP.group_membership -rw-r--r-- 1 esup esup 371 Jul 10 11:33 Mes_groupes_locaux.group_membership -rw-r--r-- 1 esup esup 329 Jul 10 11:33 OutilsCom.group_membership -rw-r--r-- 1 esup esup 625 Jul 10 11:33 Proprietaires_de_fragment.group_membership -rw-r--r-- 1 esup esup 389 Jul 10 11:33 Services.group_membership -rw-r--r-- 1 esup esup 479 Jul 10 11:33 Toutes_les_categories.group_membership -rw-r--r-- 1 esup esup 484 Jul 10 11:33 Tout_le_monde.group_membership -rw-r--r-- 1 esup esup 322 Jul 10 11:33 Utilisateurs_apogee.group_membership -rw-r--r-- 1 esup esup 323 Jul 10 11:33 Utilisateurs_harpege.group_membership
Ce sont nos groupes LDAP et leur dependances hierarchiques .
ensuite on lance le db.import en s'assurant que l'on a pas fait d'erreur de syntaxe dans les noms de groupe ⇒ correspondance exacte entre le PAGSGroupStoreConfig.xml et les diffrents groupes attachés dans les fichier *.group_membership ! , autrement on reçoit des erreurs a l'import .
Exemple si dans PAGSGroupStoreConfig.xml on a definit ce nom de groupe <group-name>Stagiaires Apprentis Doctorants</group-name> alors dans ITSP_groupes_LDAP.group_membership on appel le meme nom : <group>Stagiaires Apprentis Doctorants</group>
[esup@esup3re7 esup-install]$ ant db.import -Ddir=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/group_membership/ Buildfile: build.xml Trying to override old definition of task java Trying to override old definition of task javac db.import: prodPrompt: crn-import: install-parent-pom: [artifact:install] [INFO] Installing /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/pom.xml to /home/esup/.m2/repository/org/jasig/portal/uportal-parent/3.2.4/uportal-parent-3.2.4.pom [touch] Creating /tmp/jasig/uportal-parent.pom-525510887-marker [echo] Artifact '/home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/uportal-impl/target/uportal-impl-3.2.4.jar' is up-to-date [artifact:install] [INFO] Installing /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/uportal-impl/target/uportal-impl-3.2.4.jar to /home/esup/.m2/repository/org/jasig/portal/uportal-impl/3.2.4/uportal-impl-3.2.4.jar [java] [java] INFO Creating new lazily initialized GenericApplicationContext for the portal [java] INFO Created new MemoryContext with environment '{java.naming.factory.url.pkgs=tyrex.naming, java.naming.provider.url=, java.naming.factory.initial=org.jasig.portal.jndi.DisposableMemoryContextFactory}' [java] INFO Initialized portal JNDI context [java] INFO Failed to load bean 'PortalDb.JNDI' from ApplicationContext expecting type: interface javax.sql.DataSource. Will try to load the next bean in the list instead. Error message from the attempt to load this bean ('PortalDb.JNDI'): Error creating bean with name 'PortalDb.JNDI' defined in class path resource [properties/contexts/datasourceContext.xml]: Invocation of init method failed; nested exception is javax.naming.NotContextException: comp is not a subcontext (enable debug for stack trace) [java] INFO Loaded bean for name PortalDb.direct [java] INFO Setting CacheProvider 'org.jasig.portal.utils.cache.hibernate.EhCacheProvider@c6b80e' on ThreadLocal [java] INFO Created new lazily initialized GenericApplicationContext for the portal in 3654ms [java] Base Import Directory=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/group_membership/ [java] FILE_PATTERN=.* [java] Import Group_Membership: Divers.group_membership [java] INFO Looking up bean 'counterStore' in ApplicationContext due to context not yet being initialized [java] Import Group_Membership: Etablissements.group_membership [java] Import Group_Membership: ITSP_groupes_LDAP.group_membership [java] Import Group_Membership: Information.group_membership [java] Import Group_Membership: Mes_groupes_locaux.group_membership [java] Import Group_Membership: OutilsCom.group_membership [java] Import Group_Membership: Proprietaires_de_fragment.group_membership [java] Import Group_Membership: Services.group_membership [java] Import Group_Membership: Tout_le_monde.group_membership [java] Import Group_Membership: Toutes_les_categories.group_membership [java] Import Group_Membership: Utilisateurs_apogee.group_membership [java] Import Group_Membership: Utilisateurs_harpege.group_membership [java] Import Group_Membership: Divers.group_membership [java] Import Group_Membership: Etablissements.group_membership [java] INFO Parsing group service configuration. [java] INFO RDBMEntityGroupStore.initialize(): Node separator set to . [java] INFO Looking up bean 'cacheFactory' in ApplicationContext due to context not yet being initialized [java] INFO Looking up bean 'PortalDb' in ApplicationContext due to context not yet being initialized [java] INFO Looking up bean 'entityCachingService' in ApplicationContext due to context not yet being initialized [java] Import Group_Membership: ITSP_groupes_LDAP.group_membership [java] Import Group_Membership: Information.group_membership [java] Import Group_Membership: Mes_groupes_locaux.group_membership [java] Import Group_Membership: OutilsCom.group_membership [java] Import Group_Membership: Proprietaires_de_fragment.group_membership [java] Import Group_Membership: Services.group_membership [java] Import Group_Membership: Tout_le_monde.group_membership [java] Import Group_Membership: Toutes_les_categories.group_membership [java] Import Group_Membership: Utilisateurs_apogee.group_membership [java] Import Group_Membership: Utilisateurs_harpege.group_membership [java] Import of /home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/group_membership/ Complete in 1185 milliseconds. BUILD SUCCESSFUL Total time: 10 seconds
On a ainsi rattaché dans la BD uPortal les “enfants” du groupe local “Etablissements” qui comprendra (clés de groups) “pags.etab_tsp”, “pags.etab_tem” … dont les filtres ldap sont definis dans PAGSgroupStoreConfig.xml . Ce fichier étant chargé au démarrage du portail, il faut le redémarrer pour toutes modifications
une fois redemarré ,en tant qu'admin on peut controler la présence et la hiérarchie des groupes
Root Groups Réduire le groupe Toutes les categories Groupe Applications Etendre le groupe Canaux eSup Etendre le groupe Canaux uPortal Réduire le groupe Tout le monde Etendre le groupe Administrateurs Portail Etendre le groupe Anonymes Réduire le groupe ITSP groupes LDAP Réduire le groupe Etablissements Groupe Etablissement TEM Groupe Etablissement TMSP Groupe Etablissement TSP Réduire le groupe Services Groupe CRMP Groupe Departement INF Groupe Departement RST Réduire le groupe DISI Groupe DISI_ISR Groupe DISI_SI Groupe Stagiaires Apprentis Doctorants Groupe Tous les enseignants Groupe Tous les etudiants Groupe Tout le personnel Réduire le groupe Mes groupes locaux Etendre le groupe Utilisateurs apogée Etendre le groupe Utilisateurs harpege Etendre le groupe Proprietaires de fragment
et on peu verifier l'appartenance a des groupe d'un utilisateur en le recherchant
⇒ rechercer → person contenant → procacci → info
cn Jehan PROCACCIA Containing Groups DISI_ISR, DISI, Etablissement TMSP, Tout le monde, Tout le personnel displayName Jehan PROCACCIA eduPersonAffiliation employee ...
cf Vidéo3 27mn question sur le rattachement de groupes locaux vs gestion integrale depuis groupPags avec des members …
compositeGroupServices.xml definit le mecanisme de branchement des types de groupes. on constate qu'il y a a coté du PAGSGroupstore un LDAPGroupStoreConfig.xml qui fait des filtre ldap mais avec des performances tres mediocres !. smartldap autre gestionnaire qui se base sur le portail, pas les attributs ldap !.
doc/reference: http://www.esup-portail.org/display/ESUPMU/Publication+de+canaux+%28esup-3%29
Pb de listing de channels (finalement lié au une mauvaise gestion de groupes, cf chapitres precedents sur les PAGS)
https://listes.esup-portail.org/sympa/arc/esup-utilisateurs/2011-06/msg00028.html
Inline Frame revue par une portlet qui les “emules” maintenant (video3 38mn) Alternate Apparence, possibilité d'affiché un css pour ce canal en fonction du skin choisit ! vide3 40mn), masquet pour les mobiles etc …
Sidebar (de droite) possibilkité de la retirer dans custom.properties (video3 45mn)
On positione les sources dans un arborescence dediée au canaux
[esup@esup3re7 esup-install]$ mkdir -p src/canaux $ cd src/canaux/ [esup@esup32dev ~/esup-install] $ mkdir -p src/canaux $ cd src/canaux/ [esup@esup3re7 canaux] $ cp /home/esup/INSTALLATION/partage/portail/canaux/esup-canal-hello-1.00.zip . [esup@esup3re7 ~/esup-install/src/canaux] $ unzip esup-canal-hello-1.00.zip Archive: /home/esup/esup-canal-hello-1.00.zip creating: CHelloWorld-1.00/ creating: CHelloWorld-1.00/build/ creating: CHelloWorld-1.00/build/WEB-INF/ ...
recuperation du build.properties et adaptation des chemins a notre installation de package systemes a base de RPM (tomcat.home,
[esup@esup3re7 CHelloWorld-1.00]$ diff build.properties.orig build.properties 11c11 < tomcat.home = D:/uPortal_rel-2-4-3-quick-start/Tomcat_5-0-28 --- > tomcat.home = /usr/share/tomcat6 14c14 < uportal.home = D:/uPortal_rel-2-4-3-quick-start/uPortal_rel-2-4-3 --- > uportal.home = /home/esup/esup-install/Portail/uPortal_rel-3.2.4 17c17 < deploy.home = D:/uPortal_rel-2-4-3-quick-start/Tomcat_5-0-28/webapps/uPortal --- > deploy.home = /usr/share/tomcat6/webapps/uPortal
Pour la partie tomcat , dans les build.xml des canaux il y a une reference au common/lib de tomcat, d'où l'astuce de créer un lien de common/lib vers lib de tomcat , autrement le canal plante lors du deploiement (ne trouve pas servlet.jar, xmlapi …)
[esup@esup3re7 CHelloWorld-1.00]$ ant deploy Buildfile: build.xml prepare: [mkdir] Created dir: /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/src/canaux/CHelloWorld-1.00/docs/api [mkdir] Created dir: /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/src/canaux/CHelloWorld-1.00/tests [mkdir] Created dir: /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/src/canaux/CHelloWorld-1.00/properties [mkdir] Created dir: /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/src/canaux/CHelloWorld-1.00/lib [mkdir] Created dir: /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/src/canaux/CHelloWorld-1.00/webpages/media/org/esupportail/portal/channels/CHelloWorld [mkdir] Created dir: /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/src/canaux/CHelloWorld-1.00/db prepareINSTALL: prepareUPGRADE: prepareREADME: prepareLICENCE: prepareCHANGELOG: compile: deploy: [copy] Copying 5 files to /usr/share/tomcat6/webapps/uPortal BUILD SUCCESSFUL Total time: 0 seconds
il faut faire connetre ce cannal au portail .
Répertoire custom pour heberger les fichier xml de publication systeme des canaux (equivalent de pubchan en 2.5)
[esup@esup3re7 esup-install] $ mkdir custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/channel
Copie du fichier de publication
[esup@esup3re7 esup-install]$ cp src/canaux/CHelloWorld-1.00/CHello.channel custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/channel/
publication
[esup@esup3re7 esup-install] $ ant db.import -Ddir=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/channel -Dpattern="CHello.channel" Buildfile: build.xml [java] Base Import Directory=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/channel [java] FILE_PATTERN=CHello.channel [java] Import Channel: CHello.channel [java] Import of /home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/channel Complete in 1484 milliseconds. BUILD SUCCESSFUL Total time: 10 seconds
avec l'expression reguliere -Dpattern=“.*\.channel” on import tous le fichiers de definition de canal
[esup@esup3dev ~/src/esup-install] $ ant db.import -Ddir=/home/esup/src/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/channel -Dpattern=".*\.channel" .... [java] Base Import Directory=/home/esup/src/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/channel [java] FILE_PATTERN=.*\.channel [java] Import Channel: Administration.channel [java] INFO Looking up bean 'channelRegistryStore' in ApplicationContext due to context not yet being initialized [java] INFO Join test failed: org.jasig.portal.rdbm.DatabaseMetaDataImpl$OracleDb on statement: 'SELECT COUNT(UP_USER.USER_ID) FROM UP_USER, UP_USER_LAYOUT WHERE UP_USER.USER_ID = UP_USER_LAYOUT.USER_ID(+) AND UP_USER.USER_ID=0': [java] StatementCallback; bad SQL grammar [SELECT COUNT(UP_USER.USER_ID) FROM UP_USER, UP_USER_LAYOUT WHERE UP_USER.USER_ID = UP_USER_LAYOUT.USER_ID(+) AND UP_USER.USER_ID=0]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND UP_USER.USER_ID=0' at line 1 [java] INFO Using join test: org.jasig.portal.rdbm.DatabaseMetaDataImpl$PostgreSQLDb [java] INFO MySQL (5.0.77) / MySQL-AB JDBC Driver (mysql-connector-java-5.1.6 ( Revision: ${svn.Revision} )) database/driver [java] Connected To: jdbc:mysql://bd3.it-sudparis.eu/uportal3dev [java] Supports: [java] Outer Joins: true [java] {ts metasyntax: true [java] TO_DATE(): false [java] INFO Creating singleton instance for bean 'scopedTarget.sessionAttributesOverridesMap' [java] INFO Adding destruction callback singleton for bean 'scopedTarget.sessionAttributesOverridesMap' [java] INFO Using existing singleton instance for bean 'scopedTarget.sessionAttributesOverridesMap' [java] INFO Using existing singleton instance for bean 'scopedTarget.sessionAttributesOverridesMap' [java] INFO Using existing singleton instance for bean 'scopedTarget.sessionAttributesOverridesMap' [java] INFO Looking up bean 'PortalDb' in ApplicationContext due to context not yet being initialized [java] INFO Looking up bean 'jpaInterceptor' in ApplicationContext due to context not yet being initialized [java] INFO Parsing group service configuration. [java] INFO RDBMEntityGroupStore.initialize(): Node separator set to . [java] INFO Looking up bean 'cacheFactory' in ApplicationContext due to context not yet being initialized [java] INFO Looking up bean 'entityCachingService' in ApplicationContext due to context not yet being initialized [java] Import Channel: AssosAnciens.channel [java] Import Channel: AssosEtudiants.channel [java] Import Channel: CAnnuaire.channel [java] WARN Unable to load class 'org.esupportail.portal.channels.CAnnuaire.CAnnuaire' for channel id=44, fname='null' [java] WARN Unable to load class 'org.esupportail.portal.channels.CAnnuaire.CAnnuaire' for channel id=44, fname='CAnnuaire' [java] Import Channel: CHello.channel [java] WARN Unable to load class 'org.esupportail.portal.channels.CHelloWorld.CHelloWorld' for channel id=36, fname='null' [java] WARN Unable to load class 'org.esupportail.portal.channels.CHelloWorld.CHelloWorld' for channel id=36, fname='canal-hello' [java] Import Channel: CImap.channel [java] WARN Unable to load class 'org.esupportail.portal.channels.CImap.CImap' for channel id=45, fname='null' [java] WARN Unable to load class 'org.esupportail.portal.channels.CImap.CImap' for channel id=45, fname='Cimap' [java] Import Channel: CStockage.channel [java] WARN Unable to load class 'org.esupportail.portal.channels.CStockage.CStockage' for channel id=46, fname='null' [java] WARN Unable to load class 'org.esupportail.portal.channels.CStockage.CStockage' for channel id=46, fname='CStockage' [java] Import Channel: CanalU.channel [java] Import Channel: Catalogues.channel [java] Import Channel: EvryPratique.channel [java] Import Channel: Gaspar.channel [java] Import Channel: Handicap.channel [java] Import Channel: Infopedia.channel [java] Import Channel: MaisonEleves.channel [java] Import Channel: MotPasse.channel [java] Import Channel: Nuxeo.channel [java] Import Channel: OpenPortal.channel [java] Import Channel: Presentation.channel [java] Import Channel: ReglementScola.channel [java] Import Channel: Signets.channel [java] WARN Unable to load class 'org.esupportail.portal.channels.CSignet2.CSignet2' for channel id=59, fname='null' [java] WARN Unable to load class 'org.esupportail.portal.channels.CSignet2.CSignet2' for channel id=59, fname='CSignet2' [java] Import Channel: Sympa.channel [java] WARN Unable to load class 'org.esupportail.portal.channels.CSympaMultiServeur.CSympaMultiServeur' for channel id=60, fname='null' [java] WARN Unable to load class 'org.esupportail.portal.channels.CSympaMultiServeur.CSympaMultiServeur' for channel id=60, fname='Sympa' [java] Import Channel: Webmail.channel [java] Import Channel: Wifi.channel [java] INFO Property [org.jasig.portal.MediaManager.HTMLPublicId] was requested but not found. [java] INFO Property [org.jasig.portal.MediaManager.HTMLSystemId] was requested but not found. [java] INFO Property [org.jasig.portal.MediaManager.XHTMLPublicId] was requested but not found. [java] INFO Property [org.jasig.portal.MediaManager.XHTMLSystemId] was requested but not found. [java] INFO Property [org.jasig.portal.MediaManager.WMLPublicId] was requested but not found. [java] INFO Property [org.jasig.portal.MediaManager.WMLSystemId] was requested but not found. [java] Import Channel: inlineMeteo.channel [java] Import of /home/esup/src/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/channel Complete: 4456 BUILD SUCCESSFUL Total time: 8 seconds
video3 51mn 30s
ils permettent d'affecter automatiquement un ensemble de contenu a une population. il faut preparer des contenus ciblés, onglet, colonne , canaux pour qu'une population ait ce pre-remplissage à la connexion .
Deux composantes:
un fragment ce n'est pas necessairement un seul onglet.
ownerID pour trouver le contenu de ce fragment, on crée un utilisateur pour lequel on crée un environement onglets/canaux/colones et on definit le fragment X comme etant l'environement de l'utilisateur X-lo (LayOut) .
bonne pratique creer un fragment par onglet afin de pouvoir intercaler de nouveaux onglets en cours d'année, idem pour les precedences (10-20-30 …), se garder du mou …
audiance ⇒ deepMemberOf de “tout le monde” (heritage), mais memberOf “eteblissement X” = attachement direct a ce group (feuille).
l'utilisateur se connecte au portail, on verifie son appartenance a des groupes (pags et locaux), puis on parcourt un a un les fragments et ainsi on construit ce qui va s'afficher pour son profile .
l'option d'import/création d'un utilisateur pour gérer les fragments façon 2.6 n'est plus recommandée: *ant useradd + mot de passe*
en Esup3 la simple déclaration du user-lo dans le fichier dlm.xml créé automatiquement l'utilisateur . comme il n'a pas de mot de passe, on peut se connecter en tant qu'admin puis graphiquement → fragment Administrator → guest → on est connecté en tant que guest-lo et ainsi on peux manipuler graphiquement son environnement (memorisé en BD) puis fait un BD.export du layout .
Principes d'usage, la partie anonyme du portail sur le compte guest-lo, puis personnel-lo et etudiants-lo.
le contenu du fragment est associé a un utilisateur “modele” video3 58mn
[esup@esup3re7 ~/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp] $ mkdir user/ [esup@esup3re7 ~/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/user] $ ls -l total 32 -rw-r--r-- 1 esup esup 157 Aug 16 17:54 accueil-guest-lo.user -rw-r--r-- 1 esup esup 151 Aug 16 17:54 accueil-lo.user -rw-r--r-- 1 esup esup 153 Aug 16 17:54 aide-auth-lo.user -rw-r--r-- 1 esup esup 154 Aug 16 17:54 aide-guest-lo.user -rw-r--r-- 1 esup esup 150 Aug 16 17:54 campus-lo.user -rw-r--r-- 1 esup esup 148 Aug 16 17:54 disi-lo.user -rw-r--r-- 1 esup esup 147 Aug 16 17:54 tem-lo.user -rw-r--r-- 1 esup esup 147 Aug 16 17:54 tsp-lo.user [esup@esup3re7 ~/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/user] $ cat tsp-lo.user <user script="classpath://org/jasig/portal/io/import-user_v3-0.crn" username="tsp-lo"> <default-user>defaultTemplateUser</default-user> </user>
[esup@esup3re7 ~/esup-install] $ ant db.import -Ddir=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/user/ ... [java] Base Import Directory=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/user/ [java] FILE_PATTERN=.* [java] Import User: accueil-guest-lo.user [java] INFO Looking up bean 'counterStore' in ApplicationContext due to context not yet being initialized [java] Import User: accueil-lo.user [java] Import User: aide-auth-lo.user [java] Import User: aide-guest-lo.user [java] Import User: campus-lo.user [java] Import User: disi-lo.user [java] Import User: tem-lo.user [java] Import User: tsp-lo.user [java] Import of /home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/user/ Complete in 653 milliseconds. BUILD SUCCESSFUL Total time: 9 seconds
il est de bon usage d'ajouter ces utilisateurs au groupe “proprietaire de fragment” pour faciliter la gestion graphique de ces comptes
[esup@esup3re7 ~/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/group_membership] $ cat Proprietaires_de_fragment.group_membership <group script="classpath://org/jasig/portal/io/import-group_membership_v3-0.crn"> <name>Proprietaires de fragment</name> <entity-type>org.jasig.portal.security.IPerson</entity-type> <creator>system</creator> <description>These are fragment layout owner accounts</description> <children> <literal>admin-lo</literal> <literal>all-lo</literal> <literal>fragmentTemplate</literal> <literal>campus-lo</literal> <literal>disi-lo</literal> <literal>accueil-guest-lo</literal> <literal>accueil-lo</literal> <literal>aide-auth-lo</literal> <literal>aide-guest-lo</literal> <literal>tem-lo</literal> <literal>tsp-lo</literal> </children> </group>
db import
[esup@esup3re7 ~/esup-install] $ ant db.import -Ddir=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/group_membership/ -Dpattern="Proprietaires_de_fragment.*\.group_membership" [java] Base Import Directory=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/group_membership/ [java] FILE_PATTERN=Proprietaires_de_fragment.*\.group_membership [java] Import Group_Membership: Proprietaires_de_fragment.group_membership [java] Import Group_Membership: Proprietaires_de_fragment.group_membership [java] Import of /home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/group_membership/ Complete in 607 milliseconds. BUILD SUCCESSFUL Total time: 10 seconds
a des fin de test des fragments / profiles, il peut-etre utile d'effacer un utilisateur de la BD uPortal afin de verifier le layout (profil dlm) qu'il reçoit initialement.
Litse de tache ant et description: http://www.esup-portail.org/pages/viewpage.action?pageId=84213994
ici c'est “ant user.del -Dusername=test” qui va etre utiliser
[esup@esup3dev ~/src/esup-install] $ ant user.del -Dusername=test [echo] Invoking DeleteUser ... [java] DeleteUser.main(): Got portal UID for test: 271 .... [java] DeleteUser.main(): Removed 271 from portal db. BUILD SUCCESSFUL
pour constater pleinement le changement, il est preferable de refaire un ant init, ant deploy et tomcat restart apres ce delete.
on prepare nos fragments par type de population (associées aux utilisateurs modeles)
[esup@esup3re7 ~/src/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/] [esup@esup3re7 itsp]$ mkdir fragment-layout [esup@esup3re7 itsp]$ ll fragment-layout/ total 40 -rw-r--r-- 1 root root 1973 Aug 16 00:08 crmp-lo.fragment-layout -rw-r--r-- 1 root root 2108 Aug 16 00:08 disi-lo.fragment-layout -rw-r--r-- 1 root root 9494 Aug 16 00:08 enseignant-lo.fragment-layout -rw-r--r-- 1 root root 3916 Aug 16 00:08 etudiant-lo.fragment-layout -rw-r--r-- 1 root root 1538 Aug 16 00:08 guest-lo.fragment-layout -rw-r--r-- 1 root root 9668 Aug 16 00:08 personnel-lo.fragment-layout
on peux aussi les administrer via l'interface web du portail, via le Canal “Fragment Administration”
import des modele xml de la formation esup, fragment layouts au format 3.2
[esup@esup32dev ~/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/fragments] $ ll total 12 -rw-r--r-- 1 root root 2665 Jul 2 16:12 enseignant-lo.fragment-layout -rw-r--r-- 1 root root 3873 Jul 2 16:12 etudiant-lo.fragment-layout -rw-r--r-- 1 root root 2742 Jul 2 16:12 personnel-lo.fragment-layout [esup@esup32dev ~/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/fragments] $ cat enseignant-lo.fragment-layout <layout xmlns:dlm="http://www.uportal.org/layout/dlm" script="classpath://org/jasig/portal/io/import-layout_v3-2.crn" username="enseignant-lo"> <folder hidden="false" immutable="false" name="Root folder" type="root" unremovable="true"> <folder hidden="false" immutable="true" name="Header folder" type="header" unremovable="true"> <channel fname="header" unremovable="false" hidden="false" immutable="false"/> <channel fname="portal_login_general" unremovable="false" hidden="false" immutable="false"/> <channel fname="user-locales-selector" unremovable="false" hidden="false" immutable="false"/> <channel fname="fragment-admin" unremovable="false" hidden="false" immutable="false"/> </folder> <folder name="Enseignant" dlm:deleteAllowed="true" dlm:editAllowed="true" dlm:moveAllowed="true" dlm:addChildAllowed="true" type="regular"> <structure-attribute> <name>externalId</name> <value>enseignant</value> </structure-attribute> <folder hidden="false" name="Column 1" type="regular"> <structure-attribute> <name>width</name> <value>50%</value> </structure-attribute> <channel fname="canal-hello" dlm:deleteAllowed="true" dlm:moveAllowed="true"/> </folder> <folder hidden="false" name="Column 2" type="regular"> <structure-attribute> <name>width</name> <value>50%</value> </structure-attribute> <channel fname="canal-hello" dlm:deleteAllowed="true" dlm:moveAllowed="true"/> </folder> </folder> ... <folder hidden="false" immutable="false" name="Footer folder" type="footer" unremovable="false"> <channel fname="footer" unremovable="false" hidden="false" immutable="false"/> </folder> </folder> </layout>
db import des fragments
[esup@esup32dev ~/esup-install] $ ant db.import -Ddir=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/fragments/ Buildfile: build.xml ... [java] Base Import Directory=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/fragments/ [java] FILE_PATTERN=.* [java] Import DLM Fragment Layout: enseignant-lo.fragment-layout ... [java] INFO RDBMEntityGroupStore.initialize(): Node separator set to . [java] INFO Looking up bean 'cacheFactory' in ApplicationContext due to context not yet being initialized [java] Import DLM Fragment Layout: etudiant-lo.fragment-layout [java] Import DLM Fragment Layout: personnel-lo.fragment-layout [java] Import of /home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/fragments/ Complete in 19997 milliseconds. BUILD SUCCESSFUL Total time: 49 seconds
Questions fragment video3 1H10mn
il s'agit juste de la definition des fragment, pas les contenus …(layouts)
on reprend le dlm.xml dans notre arborescence de custom
[esup@esup3re7 esup-install]$ cp /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/update/uPortal/uportal-impl/src/main/resources/properties/dlm.xml custom/uPortal/uportal-impl/src/main/resources/properties/
et on adapte a notre besoin
[esup@esup3re7 esup-install]$ diff /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/update/uPortal/uportal-impl/src/main/resources/properties/dlm.xml custom/uPortal/uportal-impl/src/main/resources/properties/dlm.xml 47,48c47,80 < < <dlm:fragment name='All' ownerID='all-lo' precedence='2'> --- > > <dlm:fragment name='Personnel' ownerID='personnel-lo' precedence='30'> > <dlm:audience evaluatorFactory='org.jasig.portal.layout.dlm.providers.GroupMembershipEvaluatorFactory'> > <paren mode="AND"> > <attribute mode='deepMemberOf' name='Tout le personnel'/> > </paren> > </dlm:audience> > </dlm:fragment> > > <dlm:fragment name='Enseignant' ownerID='enseignant-lo' precedence='30'> ...
Admin c'est un PersonEvaluatorFactory .
si une personne est personel et etudiant, il recupere les 2 fragment si un fragment pour ces 2 population . video3 55mn
un fragment ce n'est pas necessairement un seul onglet. il peu y en avoir +sieurs
si +sieurs, si etudiant à 3 frag, 3 frag aussi pour le personnel, et un onglet commun entre personnel et etudiants, si un personne est personnel et etudiants, si 2 fragments de 3 onglets il va avoir les 6 onglets dont 2 doubles
alors que si on gere 6 fregments de un onglet avec pour celui qui est en commun aux 2 populations, alors celui ci ne s'affichera qu'une fois .
On peu avoir le meme fragment pour les 2 populations et gerer des droits d'acces a un canal en particulier pour telle population . il ne vera que les cannuax auquels il a droit .
[esup@esup3re7 esup-install]$ ll /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/update/uPortal/uportal-impl/src/main/resources/properties/dlm.xml -rw-r--r-- 1 esup esup 2705 Feb 14 2011 dlm.xml [esup@esup3re7 esup-install]$ ll /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/custom/uPortal/uportal-impl/src/main/resources/properties/dlm.xml -rw-r--r-- 1 esup esup 4078 Jul 10 18:31 /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/custom/uPortal/uportal-impl/src/main/resources/properties/dlm.xml [esup@esup3re7 esup-install]$ diff /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/update/uPortal/uportal-impl/src/main/resources/properties/dlm.xml /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/custom/uPortal/uportal-impl/src/main/resources/properties/dlm.xml 47,48c47,80 < < <dlm:fragment name='All' ownerID='all-lo' precedence='2'> --- > > <dlm:fragment name='Personnel' ownerID='personnel-lo' precedence='30'> > <dlm:audience evaluatorFactory='org.jasig.portal.layout.dlm.providers.GroupMembershipEvaluatorFactory'> > <paren mode="AND"> > <attribute mode='deepMemberOf' name='Tout le personnel'/> > </paren> > </dlm:audience> > </dlm:fragment> > > <dlm:fragment name='Enseignant' ownerID='enseignant-lo' precedence='30'> > <dlm:audience evaluatorFactory='org.jasig.portal.layout.dlm.providers.GroupMembershipEvaluatorFactory'> > <paren mode="AND"> > <attribute mode='deepMemberOf' name='Tous les enseignants'/> > </paren> > </dlm:audience> > </dlm:fragment> > > <dlm:fragment name='Etudiant' ownerID='etudiant-lo' precedence='30'> > <dlm:audience evaluatorFactory='org.jasig.portal.layout.dlm.providers.GroupMembershipEvaluatorFactory'> > <paren mode="AND"> > <attribute mode='deepMemberOf' name='Tous les etudiants'/> > </paren> > </dlm:audience> > </dlm:fragment> > > <dlm:fragment name='SAD' ownerID='sad-lo' precedence='30'> > <dlm:audience evaluatorFactory='org.jasig.portal.layout.dlm.providers.GroupMembershipEvaluatorFactory'> > <paren mode="AND"> > <attribute mode='deepMemberOf' name='Stagiaires Apprentis Doctorants'/> > </paren> > </dlm:audience> > </dlm:fragment> > > <!-- <dlm:fragment name='All' ownerID='all-lo' precedence='2'> 64c96 < </dlm:fragment> --- > </dlm:fragment> -->
Ant init et ant deploy pour deplacer ce nouveau dlm.xml aux bons endrois
ant init deplace notre dlm.xml custom dans l'espace de compilation du portail
[esup@esup3re7 ~/esup-install] $ ant init [esup@esup3re7 esup-install]$ ll /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/uportal-impl/src/main/resources/properties/dlm.xml -rw-rw-r-- 1 esup esup 4078 Jul 11 09:30 /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/uportal-impl/src/main/resources/properties/dlm.xml
ant deploy le deplace dans le webapps de l'arborescence du serveur d'application
[esup@esup3re7 esup-install]$ ll /var/lib/tomcat6/webapps/uPortal/WEB-INF/classes/properties/dlm.xml -rw-rw-r-- 1 esup esup 4078 Jul 11 09:30 /var/lib/tomcat6/webapps/uPortal/WEB-INF/classes/properties/dlm.xml
video3 1H13mn30s
principe de separation entre le html et la css, distinction fond / forme. cinematique: recup de l'environement user dans la BD , le portail en fait du XML qui passe au travers de XSLT, pour finalement aboutir a du Xhtml et enfin application de CSS sur ce html ⇒ cela permet de faire a partir du meme xml de le passer au travers de 2 xsl differents xsl universality et xsl m-universality pour avoir 2 rendu differents .
en phase developpement on commente le cache des css pour diposer immediatement de nos modif, cf themes/web.xml comment de pageCachingFilter et CacheExpiresFilter , video3 1H16
on peux avoir plusieurs css et l'utilisateur passe de l'une a l'autre. Quand on desactive la css on a un portail “serialisé” voire “accessible” …
2 Fichiers skinList.xml de base avec 4 skin
uportal-war/src/main/webapp/media/skins/universality/skinList.xml uportal-war/src/main/webapp/media/skins/muniversality/skinList.xml
pour nos skin on reprend le fichier dans custom
[esup@esup3re7 custom]$ mkdir -p uPortal/uportal-war/src/main/webapp/media/skins/universality/ [esup@esup3re7 custom]$ mkdir -p uPortal/uportal-war/src/main/webapp/media/skins/muniversality/ [esup@esup3re7 esup-uPortal-3.2.4-esup-1.0.0-RC3]$ cp Portail/uPortal_rel-3.2.4/uportal-war/src/main/webapp/media/skins/universality/skinList.xml custom/uPortal/uportal-war/src/main/webapp/media/skins/universality/ [esup@esup3re7 esup-uPortal-3.2.4-esup-1.0.0-RC3]$ cp Portail/uPortal_rel-3.2.4/uportal-war/src/main/webapp/media/skins/muniversality/skinList.xml custom/uPortal/uportal-war/src/main/webapp/media/skins/muniversality/
et on l'edite pour ajouter les notres (formation et itsp)
[esup@esup3re7 esup-uPortal-3.2.4-esup-1.0.0-RC3]$ vim custom/uPortal/uportal-war/src/main/webapp/media/skins/universality/skinList.xml [esup@esup3re7 esup-install]$ diff Portail/uPortal_rel-3.2.4/uportal-war/src/main/webapp/media/skins/universality/skinList.xml custom/uPortal/uportal-war/src/main/webapp/media/skins/universality/skinList.xml 31a32,48 > > <skin> > <skin-key>formation</skin-key> > <skin-name>Theme de formation</skin-name> > <skin-description> > Theme de formation. > </skin-description> > </skin> > > <skin> > <skin-key>itsp</skin-key> > <skin-name>Campus ITSP</skin-name> > <skin-description> > Skin de Telecom SudParis et Telecom Ecole de Management. > </skin-description> > </skin> >
En 3.2 il y a des changement, video3 1H19 skin.xml pour le definition du skin dedans on y retrouve le chargement des css de base (fluid ⇒ carcan pour faire de la css, normaliser les class et nom de fichiers …) import des css uportal3, les javascripts + surchage des css
Creation d'une skin itsp a partir de celui de “formation”, preparation de l'arborescence custom et definition des css etc … (ici reprise de la formation esup3.2)
recup des skin depuis une VM esup32dev
[esup@esup32dev ~/esup-install/custom/uPortal/uportal-war/src/main/webapp/media/skins/universality] $ scp -r formation itsp tem tsp root@cnossos:/vz/private/10234/home/esup/esup-install/custom/uPortal/uportal-war/src/main/webapp/media/skins/universality/
recopie du skin 3.2 “formation” en itsp
[esup@esup32dev ~/esup-install/custom/uPortal/uportal-war/src/main/webapp/media/skins/universality] $ cp -a formation itsp
le point d'entrée est formation.css qui fait des import des autres.
ensuite pour mettre en ligne on init et deploy
le changement du theme par defaut se via le fichier qui gere le profile DLM XML DLM_XHTML.theme a recopier dans notre custom .
[esup@esup3re7 ~/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp] $ ls admin channel fragment-layout group_membership user [esup@esup3re7 ~/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp] $ mkdir theme [esup@esup3re7 ~/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp] $ cp /home/esup/INSTALLATION/partage/portail/theme/DLM_XHTML.theme ./theme/
modification
[esup@esup3re7 ~/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp] $ diff /home/esup/INSTALLATION/partage/portail/theme/DLM_XHTML.theme theme/DLM_XHTML.theme 23,24c23,24 < <value>formation</value> < <description>Design skin name</description> --- > <value>itsp</value> > <description>campus ITSP</description> 28c28 < </theme> \ No newline at end of file --- > </theme>
importation de cette nouvelle xsl
[esup@esup3re7 ~/esup-install] $ ant db.import -Ddir=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/theme/ Buildfile: build.xml [java] INFO Setting CacheProvider 'org.jasig.portal.utils.cache.hibernate.EhCacheProvider@1e6743e' on ThreadLocal [java] INFO Created new lazily initialized GenericApplicationContext for the portal in 4162ms [java] Base Import Directory=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/theme/ [java] FILE_PATTERN=.* [java] Import Theme: DLM_XHTML.theme [java] Import of /home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/theme/ Complete in 541 milliseconds. BUILD SUCCESSFUL Total time: 12 seconds
Tout utilisateur ayant deja personnelement changer son skin, le gardera , donc si on le fait trop tard il faut modifier dans le BD le choix du skin pour chaque users !
retirer la sidebar de droite sur la page par defaut.
[esup@esup3re7 ~/esup-install] $ grep use.sidebar config.properties esup.xsl.use.sidebar=true esup.xsl.use.sidebar.focused=true #esup.xsl.use.sidebar.guest=true esup.xsl.use.sidebar.guest=false
il est possible d'affecter une theme (skin) par type de population video4 0mn
il faut mapper un attribut sur le uPortalTemplateUserName
[esup@esup3re7 ~/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/contexts] $ diff -ur personDirectoryContext.xml personDirectoryContext.xml.new --- personDirectoryContext.xml 2012-08-25 21:29:30.000000000 +0200 +++ personDirectoryContext.xml.new 2012-08-25 21:28:58.000000000 +0200 @@ -305,6 +305,13 @@ <entry key="employeeType"> <value>employeeType</value></entry> <entry key="title"> <value>title</value></entry> <entry key="supannaffectation"> <value>supannaffectation</value></entry> + <entry key="supannentiteaffectationprincipale"> + <set> + <value>uPortalTemplateUserName</value> + <value>supannentiteaffectationprincipale</value> + </set> + </entry> + <entry key="objectclass"> <value>objectclass</value></entry> <entry key="supannorganisme"> <value>supannorganisme</value></entry> </map>
definir un utilisateur modele / template associé a cette population
un layout “creux/vide” (header + footer) pour cette population, juste pour que l'utilisateur herite de la partie skin de ce layout .
definition du skin pour le user template de la population en question
video4 4mn recapitulatif; mappage d'un attribut caracterisant notre population sur uPortalTemplateUserNamer, Le portail va aller chercher l'utilisateur qui porte le nom de la valeur associée a l'utilisateur connecté→ il herite alors de l'environement utilisateur template, puis herite du profile où on change la partie skin. Cela n'a d'effet que si l'utilisateur de c'est jamais connecté, il faudra detruite l'utilisateur pour que cela s'applique .
[esup@esup3re7 ~/esup-install] $ mkdir custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/template_account [esup@esup3re7 ~/esup-install] $ ll /home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/template_account/ total 36 -rw-r--r-- 1 esup esup 410 Aug 26 14:40 tem-default.profile -rw-r--r-- 1 esup esup 481 Aug 26 14:40 tem.layout -rw-r--r-- 1 esup esup 86 Aug 26 14:41 tem.template-user -rw-r--r-- 1 esup esup 411 Aug 26 14:41 tmsp-default.profile -rw-r--r-- 1 esup esup 481 Aug 26 14:41 tmsp.layout -rw-r--r-- 1 esup esup 86 Aug 26 14:42 tmsp.template-user -rw-r--r-- 1 esup esup 410 Aug 26 14:42 tsp-default.profile -rw-r--r-- 1 esup esup 481 Aug 26 14:42 tsp.layout -rw-r--r-- 1 esup esup 86 Aug 26 14:43 tsp.template-user $ cat tmsp.template-user <user script="classpath://org/jasig/portal/io/import-user_v3-2.crn" username="241"/> $ cat tmsp-default.profile <profile script="classpath://org/jasig/portal/io/import-profile_v3-2.crn" username="241"> <name>HTML browser profile</name> <fname>default</fname> <description>A sample profile for common web browsers</description> <structure name="DLM Tabs and columns"/> <theme name="DLM XHTML"> <parameter> <name>skin</name> <value>formation</value> </parameter> </theme> </profile> $ cat tmsp.layout <?xml version="1.0"?> <layout xmlns:dlm="http://www.uportal.org/layout/dlm" script="classpath://org/jasig/portal/io/import-layout_v3-2.crn" username="241"> <folder hidden="false" immutable="false" name="Root folder" type="root" unremovable="true"> <folder hidden="false" immutable="true" name="Header folder" type="header" unremovable="true"/> <folder hidden="false" immutable="false" name="Footer folder" type="footer" unremovable="false"/> </folder> </layout>
import template-user
[esup@esup3re7 ~/esup-install] $ ant db.import -Ddir=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/template_account/ -Dpattern=".*\.template-user" Buildfile: build.xml ... install-parent-pom: [artifact:install] [INFO] Installing /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/pom.xml to /home/esup/.m2/repository/org/jasig/portal/uportal-parent/3.2.4/uportal-parent-3.2.4.pom [touch] Creating /tmp/jasig/uportal-parent.pom-1153366062-marker [echo] Artifact '/home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/uportal-impl/target/uportal-impl-3.2.4.jar' is up-to-date [artifact:install] [INFO] Installing /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/uportal-impl/target/uportal-impl-3.2.4.jar to /home/esup/.m2/repository/org/jasig/portal/uportal-impl/3.2.4/uportal-impl-3.2.4.jar [java] [java] INFO Creating new lazily initialized GenericApplicationContext for the portal [java] INFO Created new MemoryContext with environment '{java.naming.factory.url.pkgs=tyrex.naming, java.naming.provider.url=, java.naming.factory.initial=org.jasig.portal.jndi.DisposableMemoryContextFactory}' [java] INFO Initialized portal JNDI context [java] INFO Failed to load bean 'PortalDb.JNDI' from ApplicationContext expecting type: interface javax.sql.DataSource. Will try to load the next bean in the list instead. Error message from the attempt to load this bean ('PortalDb.JNDI'): Error creating bean with name 'PortalDb.JNDI' defined in class path resource [properties/contexts/datasourceContext.xml]: Invocation of init method failed; nested exception is javax.naming.NotContextException: comp is not a subcontext (enable debug for stack trace) [java] INFO Loaded bean for name PortalDb.direct [java] INFO Setting CacheProvider 'org.jasig.portal.utils.cache.hibernate.EhCacheProvider@8c39d7' on ThreadLocal [java] INFO Created new lazily initialized GenericApplicationContext for the portal in 3624ms [java] Base Import Directory=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/template_account/ [java] FILE_PATTERN=.*\.template-user [java] Import Template User: tem.template-user [java] INFO Looking up bean 'counterStore' in ApplicationContext due to context not yet being initialized [java] Import Template User: tmsp.template-user [java] Import Template User: tsp.template-user [java] Import of /home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/template_account/ Complete in 824 milliseconds. BUILD SUCCESSFUL Total time: 10 seconds
import profile
[esup@esup3re7 ~/esup-install] $ ant db.import -Ddir=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/template_account/ -Dpattern=".*\.profile" Buildfile: build.xml ... install-parent-pom: [artifact:install] [INFO] Installing /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/pom.xml to /home/esup/.m2/repository/org/jasig/portal/uportal-parent/3.2.4/uportal-parent-3.2.4.pom [touch] Creating /tmp/jasig/uportal-parent.pom-1700626302-marker [echo] Artifact '/home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/uportal-impl/target/uportal-impl-3.2.4.jar' is up-to-date [artifact:install] [INFO] Installing /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/uportal-impl/target/uportal-impl-3.2.4.jar to /home/esup/.m2/repository/org/jasig/portal/uportal-impl/3.2.4/uportal-impl-3.2.4.jar [java] [java] INFO Creating new lazily initialized GenericApplicationContext for the portal [java] INFO Created new MemoryContext with environment '{java.naming.factory.url.pkgs=tyrex.naming, java.naming.provider.url=, java.naming.factory.initial=org.jasig.portal.jndi.DisposableMemoryContextFactory}' [java] INFO Initialized portal JNDI context [java] INFO Failed to load bean 'PortalDb.JNDI' from ApplicationContext expecting type: interface javax.sql.DataSource. Will try to load the next bean in the list instead. Error message from the attempt to load this bean ('PortalDb.JNDI'): Error creating bean with name 'PortalDb.JNDI' defined in class path resource [properties/contexts/datasourceContext.xml]: Invocation of init method failed; nested exception is javax.naming.NotContextException: comp is not a subcontext (enable debug for stack trace) [java] INFO Loaded bean for name PortalDb.direct [java] INFO Setting CacheProvider 'org.jasig.portal.utils.cache.hibernate.EhCacheProvider@1a3f178' on ThreadLocal [java] INFO Created new lazily initialized GenericApplicationContext for the portal in 3677ms [java] Base Import Directory=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/template_account/ [java] FILE_PATTERN=.*\.profile [java] Import Profile: tem-default.profile [java] INFO Looking up bean 'counterStore' in ApplicationContext due to context not yet being initialized [java] Import Profile: tmsp-default.profile [java] Import Profile: tsp-default.profile [java] Import of /home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/template_account/ Complete in 806 milliseconds. BUILD SUCCESSFUL Total time: 10 seconds
import layout
[esup@esup3re7 ~/esup-install] $ ant db.import -Ddir=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/template_account/ -Dpattern=".*\.layout" Buildfile: build.xml ... install-parent-pom: [artifact:install] [INFO] Installing /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/pom.xml to /home/esup/.m2/repository/org/jasig/portal/uportal-parent/3.2.4/uportal-parent-3.2.4.pom [touch] Creating /tmp/jasig/uportal-parent.pom-1829337587-marker [echo] Artifact '/home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/uportal-impl/target/uportal-impl-3.2.4.jar' is up-to-date [artifact:install] [INFO] Installing /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/uportal-impl/target/uportal-impl-3.2.4.jar to /home/esup/.m2/repository/org/jasig/portal/uportal-impl/3.2.4/uportal-impl-3.2.4.jar [java] [java] INFO Creating new lazily initialized GenericApplicationContext for the portal [java] INFO Created new MemoryContext with environment '{java.naming.factory.url.pkgs=tyrex.naming, java.naming.provider.url=, java.naming.factory.initial=org.jasig.portal.jndi.DisposableMemoryContextFactory}' [java] INFO Initialized portal JNDI context [java] INFO Failed to load bean 'PortalDb.JNDI' from ApplicationContext expecting type: interface javax.sql.DataSource. Will try to load the next bean in the list instead. Error message from the attempt to load this bean ('PortalDb.JNDI'): Error creating bean with name 'PortalDb.JNDI' defined in class path resource [properties/contexts/datasourceContext.xml]: Invocation of init method failed; nested exception is javax.naming.NotContextException: comp is not a subcontext (enable debug for stack trace) [java] INFO Loaded bean for name PortalDb.direct [java] INFO Setting CacheProvider 'org.jasig.portal.utils.cache.hibernate.EhCacheProvider@3f58bb' on ThreadLocal [java] INFO Created new lazily initialized GenericApplicationContext for the portal in 3396ms [java] Base Import Directory=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/template_account/ [java] FILE_PATTERN=.*\.layout [java] Import Layout: tem.layout [java] INFO Looking up bean 'PortalDb' in ApplicationContext due to context not yet being initialized [java] INFO Looking up bean 'PortalDB.metadata' in ApplicationContext due to context not yet being initialized [java] INFO Join test failed: org.jasig.portal.rdbm.DatabaseMetaDataImpl$OracleDb on statement: 'SELECT COUNT(UP_USER.USER_ID) FROM UP_USER, UP_USER_LAYOUT WHERE UP_USER.USER_ID = UP_USER_LAYOUT.USER_ID(+) AND UP_USER.USER_ID=0': [java] StatementCallback; bad SQL grammar [SELECT COUNT(UP_USER.USER_ID) FROM UP_USER, UP_USER_LAYOUT WHERE UP_USER.USER_ID = UP_USER_LAYOUT.USER_ID(+) AND UP_USER.USER_ID=0]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND UP_USER.USER_ID=0' at line 1 [java] INFO Using join test: org.jasig.portal.rdbm.DatabaseMetaDataImpl$PostgreSQLDb [java] INFO MySQL (5.0.95) / MySQL-AB JDBC Driver (mysql-connector-java-5.1.6 ( Revision: ${svn.Revision} )) database/driver [java] Connected To: jdbc:mysql://bd3.it-sudparis.eu/uportal32re7 [java] Supports: [java] Outer Joins: true [java] {ts metasyntax: true [java] TO_DATE(): false [java] INFO Looking up bean 'channelRegistryStore' in ApplicationContext due to context not yet being initialized [java] INFO Creating singleton instance for bean 'scopedTarget.sessionAttributesOverridesMap' [java] INFO Adding destruction callback singleton for bean 'scopedTarget.sessionAttributesOverridesMap' [java] INFO Looking up bean 'counterStore' in ApplicationContext due to context not yet being initialized [java] INFO Looking up bean 'personManager' in ApplicationContext due to context not yet being initialized [java] INFO Looking up bean 'dlmConfigurationLoader' in ApplicationContext due to context not yet being initialized [java] INFO Parsing group service configuration. [java] INFO RDBMEntityGroupStore.initialize(): Node separator set to . [java] INFO Looking up bean 'cacheFactory' in ApplicationContext due to context not yet being initialized [java] Import Layout: tmsp.layout [java] Import Layout: tsp.layout [java] Import of /home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/template_account/ Complete in 4518 milliseconds. BUILD SUCCESSFUL Total time: 10 seconds
Tous les fichiers d'un coup
[esup@esup3re7 ~/esup-install] $ ll /home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/template-account/ total 36 -rw-r--r-- 1 esup esup 410 Jan 16 12:33 tem-default.profile -rw-r--r-- 1 esup esup 1998 Jan 16 12:31 tem.layout -rw-r--r-- 1 esup esup 86 Jan 16 12:02 tem.template-user -rw-r--r-- 1 esup esup 411 Jan 16 12:34 tmsp-default.profile -rw-r--r-- 1 esup esup 1889 Jan 16 12:32 tmsp.layout -rw-r--r-- 1 esup esup 86 Jan 16 12:02 tmsp.template-user -rw-r--r-- 1 esup esup 410 Jan 16 12:33 tsp-default.profile -rw-r--r-- 1 esup esup 1900 Jan 16 12:30 tsp.layout -rw-r--r-- 1 esup esup 86 Jan 16 12:02 tsp.template-user [esup@esup3re7 ~/esup-install] $ ant db.import -Ddir=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/template-account/ Buildfile: build.xml Trying to override old definition of task java Trying to override old definition of task javac db.import: prodPrompt: crn-import: install-parent-pom: [artifact:install] [INFO] Installing /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/pom.xml to /home/esup/.m2/repository/org/jasig/portal/uportal-parent/3.2.4/uportal-parent-3.2.4.pom [touch] Creating /tmp/jasig/uportal-parent.pom-1673432325-marker [echo] Artifact '/home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/uportal-impl/target/uportal-impl-3.2.4.jar' is up-to-date [artifact:install] [INFO] Installing /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/uportal-impl/target/uportal-impl-3.2.4.jar to /home/esup/.m2/repository/org/jasig/portal/uportal-impl/3.2.4/uportal-impl-3.2.4.jar [java] [java] INFO Creating new lazily initialized GenericApplicationContext for the portal [java] INFO Created new MemoryContext with environment '{java.naming.factory.url.pkgs=tyrex.naming, java.naming.provider.url=, java.naming.factory.initial=org.jasig.portal.jndi.DisposableMemoryContextFactory}' [java] INFO Initialized portal JNDI context [java] INFO Failed to load bean 'PortalDb.JNDI' from ApplicationContext expecting type: interface javax.sql.DataSource. Will try to load the next bean in the list instead. Error message from the attempt to load this bean ('PortalDb.JNDI'): Error creating bean with name 'PortalDb.JNDI' defined in class path resource [properties/contexts/datasourceContext.xml]: Invocation of init method failed; nested exception is javax.naming.NotContextException: comp is not a subcontext (enable debug for stack trace) [java] INFO Loaded bean for name PortalDb.direct [java] INFO Setting CacheProvider 'org.jasig.portal.utils.cache.hibernate.EhCacheProvider@5dc268' on ThreadLocal [java] INFO Created new lazily initialized GenericApplicationContext for the portal in 3555ms [java] Base Import Directory=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/template-account/ [java] FILE_PATTERN=.* [java] Import Template User: tem.template-user [java] INFO Looking up bean 'counterStore' in ApplicationContext due to context not yet being initialized [java] Import Template User: tmsp.template-user [java] Import Template User: tsp.template-user [java] Import Profile: tem-default.profile [java] Import Profile: tmsp-default.profile [java] Import Profile: tsp-default.profile [java] Import Layout: tem.layout [java] INFO Looking up bean 'PortalDb' in ApplicationContext due to context not yet being initialized [java] INFO Looking up bean 'PortalDB.metadata' in ApplicationContext due to context not yet being initialized [java] INFO Join test failed: org.jasig.portal.rdbm.DatabaseMetaDataImpl$OracleDb on statement: 'SELECT COUNT(UP_USER.USER_ID) FROM UP_USER, UP_USER_LAYOUT WHERE UP_USER.USER_ID = UP_USER_LAYOUT.USER_ID(+) AND UP_USER.USER_ID=0': [java] StatementCallback; bad SQL grammar [SELECT COUNT(UP_USER.USER_ID) FROM UP_USER, UP_USER_LAYOUT WHERE UP_USER.USER_ID = UP_USER_LAYOUT.USER_ID(+) AND UP_USER.USER_ID=0]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND UP_USER.USER_ID=0' at line 1 [java] INFO Using join test: org.jasig.portal.rdbm.DatabaseMetaDataImpl$PostgreSQLDb [java] INFO MySQL (5.0.95) / MySQL-AB JDBC Driver (mysql-connector-java-5.1.6 ( Revision: ${svn.Revision} )) database/driver [java] Connected To: jdbc:mysql://bd3.it-sudparis.eu/uportal32re7 [java] Supports: [java] Outer Joins: true [java] {ts metasyntax: true [java] TO_DATE(): false [java] INFO Looking up bean 'channelRegistryStore' in ApplicationContext due to context not yet being initialized [java] INFO Creating singleton instance for bean 'scopedTarget.sessionAttributesOverridesMap' [java] INFO Adding destruction callback singleton for bean 'scopedTarget.sessionAttributesOverridesMap' [java] INFO Looking up bean 'personManager' in ApplicationContext due to context not yet being initialized [java] INFO Looking up bean 'dlmConfigurationLoader' in ApplicationContext due to context not yet being initialized [java] INFO Parsing group service configuration. [java] INFO RDBMEntityGroupStore.initialize(): Node separator set to . [java] INFO Looking up bean 'cacheFactory' in ApplicationContext due to context not yet being initialized [java] Import Layout: tmsp.layout [java] Import Layout: tsp.layout [java] Import of /home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/template-account/ Complete in 2281 milliseconds. BUILD SUCCESSFUL Total time: 10 seconds
video4 15mn12s
Maintenant les traductions se font dans un fichier XML à part : uportal-war/src/main/resources/layout/theme/universality/messages.xml
video4 18mn
la XSL principal est decomposé en 6 fichiers par “fonctionnalité” ⇒ structure page, navigation, blocs login, search etc … structure des colonnes, des contenus et preferences
uportal-war/src/main/resources/layout/theme/universality/universality.xsl
Pour travailler a chaud sur les xls directement dans le repertoire webapps (comme pour CSS et javascritps) Lors du travail sur les xsl il vous est possible de désactiver le cache (dans le custom.properties : esup.xsl.cache=false) il faut que l'URL change pour que la XSL change (changer d'onglet )
Eviter d'en modifier trop car a chaque changement de version c'est bcp de travail. Nancy a modifié essentiellement le fait d'afficher un seul canal quand on clique sur un onglet plutot que tous .
exemple de retrait du lien “Plan du site”
[esup@esup32dev ~/esup-install] $ mkdir -p custom/uPortal/uportal-war/src/main/resources/layout/theme/universality/ [esup@esup32dev ~/esup-install] $ cp update/uPortal/uportal-war/src/main/resources/layout/theme/universality/components.xsl custom/uPortal/uportal-war/src/main/resources/layout/theme/universality/ $ vim components.xsl [esup@esup32dev ~/esup-install/custom/uPortal/uportal-war/src/main/resources/layout/theme/universality] $ diff components.xsl /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/update/uPortal/uportal-war/src/main/resources/layout/theme/universality/components.xsl 187d186 < <!-- Retrait du plan du site JP 196d194 < -->
video 4 21mn40s
24mn30 Portlet Path est recherché dans le portlet.xml la servlet “pluto invoquer” doit demarrer dès le démarrage du tomcat (web.xml : <load-on-startup>1) pour que le context soit deja pret et que le portail puisse la lister ⇒ du coup le portail met plus de tps a demarrer car demarrage du portail + les contexts des portlets + servlets des points d'entrée qui les demarrent .
[esup@esup3re7 canaux]$ wget https://sourcesup.renater.fr/frs/download.php/2983/esup-canal-annuaire-3.2.1.zip --2012-07-10 17:39:58-- https://sourcesup.renater.fr/frs/download.php/2983/esup-canal-annuaire-3.2.1.zip [esup@esup3re7 CAnnuaire-3.2.1]$ diff build.exemple.properties build.properties 11c11 < tomcat.home = E:/esupdev/esupdev-x.x/uPortal_rel-x-x-x-quick-start/Tomcat_x-x-x --- > tomcat.home = /usr/share/tomcat6 14c14 < uportal.home = E:/esupdev/esupdev-x.x/uPortal_rel-x-x-x-quick-start/uPortal_rel-x-x-x --- > uportal.home = /home/esup/esup-install/Portail/uPortal_rel-3.2.4 17c17 < deploy.home = E:/esupdev/esupdev-x.x/uPortal_rel-x-x-x-quick-start/webapps/uPortal --- > deploy.home = /usr/share/tomcat6/webapps/uPortal
adapter un properties/CAnnuaire.xml selon les exemples fournis dans le repertoire properties .
[esup@esup3re7 CAnnuaire-3.2.1]$ ant deploy ... [copy] Copying 5 files to /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/src/canaux/CAnnuaire-3.2.1/build/WEB-INF/classes/properties/channels/org_esup/CAnnuaire [copy] Copying 8 files to /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/src/canaux/CAnnuaire-3.2.1/build/WEB-INF/classes/org/esupportail/portal/channels/CAnnuaire [copy] Copying 5 files to /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/src/canaux/CAnnuaire-3.2.1/build/media/org/esupportail/portal/channels/CAnnuaire [copy] Copying 2 files to /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/src/canaux/CAnnuaire-3.2.1/build/WEB-INF/classes/org/esupportail/portal/channels/CAnnuaire/languages deploy: [copy] Copying 59 files to /usr/share/tomcat6/webapps/uPortal BUILD SUCCESSFUL Total time: 2 seconds
si pb au ant deploy sur le repartoire $tomcat_home/common/lib ⇒ le creer avec droits d'acces a l'utilisateur esup.
on creer un fichier de deinition/publication du canal selon les exemple fournis: http://www.esup-portail.org/display/ESUPMU/Publication+de+canaux+%28esup-3%29
[esup@esup3re7 CAnnuaire-3.2.1]$ cat /home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/channel/esup-annuaire.channel <channel-definition script="classpath://org/jasig/portal/io/import-channel_v3-1.crn"> <title>Annuaires</title> <name>Annuaires</name> <fname>esup-annuaire</fname> <desc>Annuaires</desc> <type>Custom</type> <class>org.esupportail.portal.channels.CAnnuaire.CAnnuaire</class> <timeout>30000</timeout> <hasedit>N</hasedit> <hashelp>N</hashelp> <hasabout>N</hasabout> <secure>N</secure> <locale>en_US</locale> <categories> <category>Canaux eSup</category> </categories> <groups> <group>Tout le monde</group> </groups> <parameters/> </channel-definition>
en mode “cli” avec un fichier de definition .channel suivit d'un db.import
[esup@esup3re7 esup-install]$ ant db.import -Ddir=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/channel -Dpattern="esup-annuaire.*\.channel" ... [java] Base Import Directory=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/channel [java] FILE_PATTERN=esup-annuaire.*\.channel [java] Import Channel: esup-annuaire.channel [java] Import of /home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/channel Complete in 1171 milliseconds. BUILD SUCCESSFUL Total time: 10 seconds
apres s'etre assurer d'avoir integrer tous les groups membership correspondants (categoris de cannaux)
[esup@esup3re7 ~/esup-install] $ ant db.import -Ddir=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/group_membership/ Buildfile: build.xml ... [java] Base Import Directory=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/group_membership/ [java] FILE_PATTERN=.* [java] Import Group_Membership: Administration.group_membership [java] Import Group_Membership: Assistance.group_membership [java] Import Group_Membership: Divers.group_membership [java] Import Group_Membership: Etablissements.group_membership [java] Import Group_Membership: Etudiants.group_membership [java] Import Group_Membership: Google.group_membership [java] Import Group_Membership: ITSP_groupes_LDAP.group_membership [java] Import Group_Membership: Information.group_membership [java] Import Group_Membership: Mes_groupes_locaux.group_membership [java] Import Group_Membership: Offres.group_membership [java] Import Group_Membership: OutilsCom.group_membership [java] Import Group_Membership: OutilsComm.group_membership [java] INFO Looking up bean 'counterStore' in ApplicationContext due to context not yet being initialized [java] Import Group_Membership: Pratique.group_membership [java] Import Group_Membership: Proprietaires_de_fragment.group_membership [java] Import Group_Membership: Services.group_membership [java] Import Group_Membership: Tests.group_membership [java] Import Group_Membership: Tout_le_monde.group_membership [java] Import Group_Membership: Toutes_les_categories.group_membership [java] Import Group_Membership: Utilisateurs_apogee.group_membership [java] Import Group_Membership: Utilisateurs_harpege.group_membership [java] Import Group_Membership: Administration.group_membership [java] Import Group_Membership: Assistance.group_membership [java] Import Group_Membership: Divers.group_membership [java] Import Group_Membership: Etablissements.group_membership [java] INFO Parsing group service configuration. [java] INFO RDBMEntityGroupStore.initialize(): Node separator set to . [java] INFO Looking up bean 'cacheFactory' in ApplicationContext due to context not yet being initialized [java] INFO Looking up bean 'PortalDb' in ApplicationContext due to context not yet being initialized [java] INFO Looking up bean 'entityCachingService' in ApplicationContext due to context not yet being initialized [java] Import Group_Membership: Etudiants.group_membership [java] Import Group_Membership: Google.group_membership [java] Import Group_Membership: ITSP_groupes_LDAP.group_membership [java] Import Group_Membership: Information.group_membership [java] Import Group_Membership: Mes_groupes_locaux.group_membership [java] Import Group_Membership: Offres.group_membership [java] Import Group_Membership: OutilsCom.group_membership [java] Import Group_Membership: OutilsComm.group_membership [java] Import Group_Membership: Pratique.group_membership [java] Import Group_Membership: Proprietaires_de_fragment.group_membership [java] Import Group_Membership: Services.group_membership [java] Import Group_Membership: Tests.group_membership [java] Import Group_Membership: Tout_le_monde.group_membership [java] Import Group_Membership: Toutes_les_categories.group_membership [java] Import Group_Membership: Utilisateurs_apogee.group_membership [java] Import Group_Membership: Utilisateurs_harpege.group_membership [java] Import of /home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/group_membership/ Complete in 4907 milliseconds. BUILD SUCCESSFUL Total time: 10 seconds
on peux integrer tous les canaux
[esup@esup3re7 ~/esup-install] $ ant db.import -Ddir=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/channel -Dpattern=".*\.channel" Buildfile: build.xml [java] FILE_PATTERN=.*\.channel [java] Import Channel: AccesECampus.channel [java] INFO Looking up bean 'channelRegistryStore' in ApplicationContext due to context not yet being initialized [java] INFO Creating singleton instance for bean 'scopedTarget.sessionAttributesOverridesMap' [java] INFO Adding destruction callback singleton for bean 'scopedTarget.sessionAttributesOverridesMap' [java] INFO Looking up bean 'jpaInterceptor' in ApplicationContext due to context not yet being initialized [java] INFO Parsing group service configuration. [java] INFO RDBMEntityGroupStore.initialize(): Node separator set to . [java] INFO Looking up bean 'cacheFactory' in ApplicationContext due to context not yet being initialized [java] INFO Looking up bean 'PortalDb' in ApplicationContext due to context not yet being initialized [java] INFO Looking up bean 'entityCachingService' in ApplicationContext due to context not yet being initialized [java] INFO Looking up bean 'portletDefinitionRegistry' in ApplicationContext due to context not yet being initialized [java] INFO Looking up bean 'channelPublishingService' in ApplicationContext due to context not yet being initialized [java] Import Channel: Actualites.channel [java] Import Channel: Administration.channel [java] Import Channel: Apple.channel [java] Import Channel: Arcentel.channel [java] Import Channel: AssosAnciens.channel [java] Import Channel: AssosEtudiants.channel [java] Import Channel: Bookmark.channel [java] Import Channel: Brochure.channel [java] Import Channel: CAnnuaire.channel [java] Import Channel: CE.channel [java] Import Channel: CHello.channel [java] Import Channel: CInfos.channel [java] Import Channel: CSuggestion.channel [java] Import Channel: CanalU.channel [java] Import Channel: Carrefourinternational.channel [java] Import Channel: Catalogues.channel [java] Import Channel: EvryPratique.channel [java] Import Channel: Filez.channel [java] Import Channel: Graife.channel [java] Import Channel: Handicap.channel [java] Import Channel: Helpdesk.channel [java] Import Channel: Infopedia.channel [java] Import Channel: Intro.channel [java] Import Channel: LienUtilesPerm.channel [java] Import Channel: MSDNAA.channel [java] Import Channel: MaisonEleves.channel [java] Import Channel: Mediatheque.channel [java] Import Channel: Moodle.channel [java] Import Channel: MotPasse.channel [java] Import Channel: Nuxeo.channel [java] Import Channel: OpenPortal.channel [java] Import Channel: Parrains.channel [java] Import Channel: ProgTV.channel [java] Import Channel: Rapport_fin_de_sejour.channel [java] Import Channel: Rdvz.channel [java] Import Channel: ReglementScola.channel [java] Import Channel: Relations_entreprises.channel [java] Import Channel: STP.channel [java] Import Channel: Signets.channel [java] Import Channel: Specificite_europe_bourse_erasmus.channel [java] Import Channel: Stats.channel [java] Import Channel: Supervis.channel [java] Import Channel: Sympa.channel [java] Import Channel: Titresejour.channel [java] Import Channel: Trombi.channel [java] Import Channel: Ubicast.channel [java] Import Channel: Voila.channel [java] Import Channel: Webmail.channel [java] Import Channel: Wifi.channel [java] Import Channel: Wikiadmin.channel [java] Import Channel: Wikipedia.channel [java] Import Channel: calendar.channel [java] Import Channel: cms.channel [java] Import Channel: dictionnaire-portlet.channel [java] Import Channel: esup-annuaire.channel [java] Import Channel: google-maps-portlet.channel [java] Import Channel: google-portlet.channel [java] Import Channel: google-translate-portlet.channel [java] Import Channel: inlineMeteo.channel [java] Import of /home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/channel Complete in 7763 milliseconds. BUILD SUCCESSFUL Total time: 12 seconds
On peux aussi commencer sur ce premier canal par le publier via l'interface web esup.
Connexion Admin au portail ⇒ clique sur Gestionnaire de Cannaux (uPortal/render.userLayoutRootNode.uP?uP_fname=portlet-admin) → referencer une nouvelle portlet → type obsolete Custom → suivre les menus (Suivant), categorie, groupes … on fini par la gestion du cycle de vie ⇒ publié ! helas cela plante …
ERROR [org.jasig.portal.ChannelManager#55] Sep/22 15:34:56,115 portlet.DispatcherPortlet.[] - Could not complete request org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing [AnnotatedAction@57f36c targetAction = [EvaluateAction@2e68de expression = portletAdministrationHelper.savePortletRegistration(channel, person), resultExposer = [null]], attributes = map[[empty]]] in state 'reviewPortlet' of flow 'edit-portlet' -- action execution attributes were 'map[[empty]]' at org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:60) ... Caused by: org.springframework.binding.expression.EvaluationException: An OgnlException occurred getting the value for expression 'portletAdministrationHelper.savePortletRegistration(channel, person)' on context [class org.springframework.webflow.engine.impl.RequestControlContextImpl] ... Caused by: ognl.MethodFailedException: Method "savePortletRegistration" failed for object org.jasig.portal.portlets.portletadmin.PortletAdministrationHelper@99a52c [org.springframework.dao.InvalidDataAccessApiUsageException: clazz can not be null; nested exception is java.lang.IllegalArgumentException: clazz can not be null] ... Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: clazz can not be null; nested exception is java.lang.IllegalArgumentException: clazz can not be null ... Caused by: java.lang.IllegalArgumentException: clazz can not be null
[esup@esup32dev ~/esup-install/src/canaux/CAnnuaire-3.2.1] $ ls -ald /usr/share/tomcat6/common/lib/ drwxrwxr-x 2 root esup 4096 Sep 22 11:42 /usr/share/tomcat6/common/lib/
Exporter le contenu de la base de données:
[esup@esup32dev ~/esup-install] $ mkdir db-exports [esup@esup32dev ~/esup-install] $ ant db.export -Dtype=all -Ddir=/home/esup/esup-install/db-exports [esup@esup32dev ~/esup-install] $ ls -l db-exports/ total 44 drwxrwxr-x 2 esup esup 4096 Sep 22 15:31 channel drwxrwxr-x 2 esup esup 4096 Sep 22 15:31 channel-type drwxrwxr-x 2 esup esup 4096 Sep 22 15:32 entity-type drwxrwxr-x 2 esup esup 4096 Sep 22 15:31 fragment-layout drwxrwxr-x 2 esup esup 4096 Sep 22 15:32 group_membership drwxrwxr-x 2 esup esup 4096 Sep 22 15:31 layout drwxrwxr-x 2 esup esup 4096 Sep 22 15:31 permission_set drwxrwxr-x 2 esup esup 4096 Sep 22 15:31 profile drwxrwxr-x 2 esup esup 4096 Sep 22 15:32 structure drwxrwxr-x 2 esup esup 4096 Sep 22 15:31 theme drwxrwxr-x 2 esup esup 4096 Sep 22 15:31 user
https://www.esup-portail.org/wiki/display/PROJCANSTOCK/Esup+File+Manager
on va utiliser git pour recuperer le source
[esup@esup4dz ~/portlet] $ git clone https://github.com/EsupPortail/esup-filemanager.git Cloning into 'esup-filemanager'... remote: Counting objects: 5383, done. remote: Total 5383 (delta 0), reused 0 (delta 0), pack-reused 5383 Receiving objects: 100% (5383/5383), 1.89 MiB | 1.18 MiB/s, done. Resolving deltas: 100% (1908/1908), done. [esup@esup4dz ~/portlet] $ cd esup-filemanager/ [esup@esup4dz ~/portlet/esup-filemanager] $ ls LICENSE NOTICE pom.xml src
visualisation de l'existant
[esup@esup4dz ~/portlet/esup-filemanager] $ git config --global color.ui auto [esup@esup4dz ~/portlet/esup-filemanager] $ git branch -a * master remotes/origin/HEAD -> origin/master remotes/origin/esup-filemanager-portlet_1_0 remotes/origin/master [esup@esup4dz ~/portlet/esup-filemanager] $ git remote -v origin https://github.com/EsupPortail/esup-filemanager.git (fetch) origin https://github.com/EsupPortail/esup-filemanager.git (push) [esup@esup4dz ~/portlet/esup-filemanager] $ tig [esup@esup4dz ~/portlet/esup-filemanager] $ git tag esup-filemanager-2.1.0 esup-filemanager-2.2.0 esup-filemanager-2.2.1 esup-filemanager-2.2.2 esup-filemanager-3.0.0 esup-filemanager-3.1.0
on se met le dernier tag/release plutot que de rester sur les “nigthly build” (cf tig) et on met notre propre branche .
[esup@esup4dz ~/portlet/esup-filemanager] $ git checkout -b esup-filemanager-3.1.0-tem-tsp esup-filemanager-3.1.0 Switched to a new branch 'esup-filemanager-3.1.0-tem-tsp' [esup@esup4dz ~/portlet/esup-filemanager] $ git branch * esup-filemanager-3.1.0-tem-tsp master
pluto container de portlet (tomcat container de servlet …) permet de tester la portlet simplement
on lance la portlet dans la container pluto
[esup@esup4dz ~/portlet/esup-filemanager] $ mvn clean portlet-prototyping:run [INFO] Scanning for projects... Downloading: http://repo.jlehtinen.net/maven2/org/apache/maven/plugins/maven-compiler-plugin/2.5.1/maven-compiler-plugin-2.5.1.pom May 26, 2016 12:05:06 PM org.apache.pluto.driver.PortalStartupListener contextInitialized INFO: Starting up Pluto Portal Driver. . . May 26, 2016 12:05:06 PM org.springframework.web.context.ContextLoader initWebApplicationContext INFO: Root WebApplicationContext: initialization started May 26, 2016 12:05:06 PM org.mortbay.log.Slf4jLog info INFO: Loading Spring root WebApplicationContext May 26, 2016 12:05:06 PM org.springframework.core.CollectionFactory <clinit> INFO: JDK 1.4+ collections available May 26, 2016 12:05:06 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/pluto-portal-driver-services-config.xml] May 26, 2016 12:05:06 PM org.springframework.context.support.AbstractRefreshableApplicationContext refreshBeanFactory INFO: Bean factory for application context [Root WebApplicationContext]: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [PortletContainer,PlutoServices,PortalDriverServices,PortalContext,DriverConfiguration,AdminConfiguration,ResourceConfigFactory,PortalURLParser,RenderConfigService,SupportedModesService,SupportedWindowStatesService,PortletRequestContextService,EventCoordinationService,FilterManagerService,PortletURLListenerService,PortletContextService,RequestDispatcherService]; root of BeanFactory hierarchy May 26, 2016 12:05:06 PM org.springframework.context.support.AbstractApplicationContext refresh INFO: 17 beans defined in application context [Root WebApplicationContext] May 26, 2016 12:05:06 PM org.springframework.context.support.AbstractApplicationContext initMessageSource INFO: Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@a54379e] May 26, 2016 12:05:06 PM org.springframework.context.support.AbstractApplicationContext initApplicationEventMulticaster INFO: Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@7b93bc9d] May 26, 2016 12:05:06 PM org.springframework.ui.context.support.UiApplicationContextUtils initThemeSource INFO: Unable to locate ThemeSource with name 'themeSource': using default [org.springframework.ui.context.support.ResourceBundleThemeSource@65ad7f3f] May 26, 2016 12:05:06 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons INFO: Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [PortletContainer,PlutoServices,PortalDriverServices,PortalContext,DriverConfiguration,AdminConfiguration,ResourceConfigFactory,PortalURLParser,RenderConfigService,SupportedModesService,SupportedWindowStatesService,PortletRequestContextService,EventCoordinationService,FilterManagerService,PortletURLListenerService,PortletContextService,RequestDispatcherService]; root of BeanFactory hierarchy] May 26, 2016 12:05:06 PM net.jlehtinen.portlet.prototyping.portal.PortletPrototypingRenderConfigServiceImpl addPortletPrototypingPage INFO: Configuring Pluto portal for portlet prototyping May 26, 2016 12:05:06 PM net.jlehtinen.portlet.prototyping.portal.PortletPrototypingRenderConfigServiceImpl addPortletPrototypingPage INFO: Portlet context path = /esup-filemanager May 26, 2016 12:05:06 PM net.jlehtinen.portlet.prototyping.portal.PortletPrototypingRenderConfigServiceImpl addPortletPrototypingPage INFO: Portlet names = esup-filemanager May 26, 2016 12:05:06 PM net.jlehtinen.portlet.prototyping.portal.PortletPrototypingRenderConfigServiceImpl addPortletPrototypingPage INFO: Configured 1 portlets May 26, 2016 12:05:06 PM org.apache.pluto.container.impl.PortletContainerImpl infoWithName INFO: Portlet Container [pluto-portal-driver]: Container initialized successfully. May 26, 2016 12:05:06 PM org.springframework.web.context.ContextLoader initWebApplicationContext INFO: Using context class [org.springframework.web.context.support.XmlWebApplicationContext] for root WebApplicationContext May 26, 2016 12:05:06 PM org.springframework.web.context.ContextLoader initWebApplicationContext INFO: Root WebApplicationContext: initialization completed in 408 ms May 26, 2016 12:05:06 PM org.apache.pluto.driver.PortalStartupListener contextInitialized INFO: Initializing Portlet Container. . . May 26, 2016 12:05:06 PM org.apache.pluto.driver.PortalStartupListener contextInitialized INFO: Pluto portlet container started. May 26, 2016 12:05:06 PM org.apache.pluto.driver.PortalStartupListener contextInitialized INFO: ********** Pluto Portal Driver Started ********** May 26, 2016 12:05:06 PM org.mortbay.log.Slf4jLog info INFO: Started SelectChannelConnector@0.0.0.0:8080 [INFO] Started Jetty Server May 26, 2016 12:05:07 PM org.apache.pluto.driver.container.PortletContextManager fireRegistered INFO: Portlet Context '/pluto' registered. May 26, 2016 12:05:07 PM org.apache.pluto.driver.container.PortletContextManager register INFO: Registered portlet application for context '/pluto' May 26, 2016 12:05:07 PM org.apache.pluto.driver.container.PortletContextManager register INFO: Registering 3 portlets for context //pluto May 26, 2016 12:05:07 PM org.apache.pluto.driver.container.PortletContextManager register INFO: Portlet application for context '/pluto' already registered. May 26, 2016 12:05:07 PM org.apache.pluto.driver.container.PortletContextManager register INFO: Portlet application for context '/pluto' already registered. May 26, 2016 12:05:16 PM org.apache.pluto.driver.container.PortletContextManager fireRegistered INFO: Portlet Context '/esup-filemanager' registered. May 26, 2016 12:05:16 PM org.apache.pluto.driver.container.PortletContextManager register INFO: Registered portlet application for context '/esup-filemanager' May 26, 2016 12:05:16 PM org.apache.pluto.driver.container.PortletContextManager register INFO: Registering 1 portlets for context //esup-filemanager May 26, 2016 12:05:16 PM org.mortbay.log.Slf4jLog info INFO: Initializing Spring FrameworkPortlet 'esup-filemanager'
c'est accessible via localhost:8080/ (mais si tomcat tourne conflit de port ⇒ arreter tomcat )
on peux aussi y acceder sur le FQDN http://esup4dz.tem-tsp.eu:8080/pluto/portal
ne pas tenir compte du “404” (pas de context par defaut, il liste les 2 ) il suffit de cliquer sur le 2eme lien /pluto
Error 404 - Not Found. No context on this server matched or handled this request. Contexts known to this server are: /esup-filemanager ---> org.mortbay.jetty.plugin.Jetty6PluginWebAppContext@3605ce8f{/esup-filemanager,/home/esup/portlet/esup-filemanager/src/main/webapp} /pluto ---> org.mortbay.jetty.webapp.WebAppContext@7a3fafbd{/pluto,/home/esup/.m2/repository/net/jlehtinen/portlet/portlet-prototyping-portal/0.9/portlet-prototyping-portal-0.9.war}
definir le serveur cas
[esup@esup4dz ~/portlet/esup-filemanager] $ vim ./src/main/webapp/WEB-INF/web.xml [esup@esup4dz ~/portlet/esup-filemanager] $ cp ./src/main/webapp/WEB-INF/web.xml ./src/main/webapp/WEB-INF/web.xml.orig [esup@esup4dz ~/portlet/esup-filemanager] $ vim ./src/main/webapp/WEB-INF/web.xml [esup@esup4dz ~/portlet/esup-filemanager] $ diff -ur ./src/main/webapp/WEB-INF/web.xml ./src/main/webapp/WEB-INF/web.xml.orig --- ./src/main/webapp/WEB-INF/web.xml 2016-05-26 17:16:18.430542157 +0200 +++ ./src/main/webapp/WEB-INF/web.xml.orig 2016-05-26 17:15:44.944549896 +0200 @@ -80,7 +80,7 @@ <servlet-class>edu.yale.its.tp.cas.proxy.ProxyTicketReceptor</servlet-class> <init-param> <param-name>edu.yale.its.tp.cas.proxyUrl</param-name> - <param-value>https://cas16.tem-tsp.eu/proxy</param-value> + <param-value>https://cas.mon-univ.fr/proxy</param-value> </init-param> </servlet>
definir les drives que l'on vaux afficher dans le filemanager
[esup@esup4dz ~/portlet/esup-filemanager] $ cp ./src/main/webapp/WEB-INF/context/drives.xml ./src/main/webapp/WEB-INF/context/drives.xml.orig [esup@esup4dz ~/portlet/esup-filemanager] $ vim ./src/main/webapp/WEB-INF/context/drives.xml
[esup@esup4dz ~/portlet/esup-filemanager] $ mvn clean package [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building esup-filemanager 3.1.0 [INFO] ------------------------------------------------------------------------ Downloading: http://repo.jlehtinen.net/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.10/maven-surefire-plugin-2.10.pom ... [INFO] Exploding webapp... [INFO] Assembling webapp esup-filemanager in /home/esup/portlet/esup-filemanager/target/esup-filemanager [INFO] Copy webapp webResources to /home/esup/portlet/esup-filemanager/target/esup-filemanager [INFO] Generating war /home/esup/portlet/esup-filemanager/target/esup-filemanager.war [INFO] Building war: /home/esup/portlet/esup-filemanager/target/esup-filemanager.war [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 12.007s [INFO] Finished at: Thu May 26 17:25:41 CEST 2016 [INFO] Final Memory: 20M/309M [INFO] ------------------------------------------------------------------------
ant deployPortletApp ⇒ ajoute dans le web.xml le fait que c'est le portail qui va lancer cette portlet (via pluto) et pousse le .war dans webapps .
le deploy se fait depuis la racine des sources du portail
[esup@esup4dz ~/esup-uportal] $ cd /home/esup/esup-uportal
puis deploy via ant deployPortletApp
[esup@esup4dz ~/esup-uportal] $ ant deployPortletApp -DportletApp=/home/esup/portlet/esup-filemanager/target/esup-filemanager.war Buildfile: /home/esup/esup-uportal/build.xml checkForTomcat: deployPortletApp: install-parent-pom: [artifact:install] [INFO] Installing /home/esup/esup-uportal/pom.xml to /home/esup/.m2/repository/org/jasig/portal/uportal-parent/4.0.16-SNAPSHOT/uportal-parent-4.0.16-SNAPSHOT.pom [touch] Creating /home/esup/esup-uportal/target/tmp/uportal-parent.pom-41461427-marker [echo] Artifact '/home/esup/esup-uportal/bootstrap/pluto-assembler/target/pluto-assembler-4.0.16-SNAPSHOT.jar' is not available or out-of-date, calling 'mvn install' mvn: [exec] [INFO] Scanning for projects... [exec] [INFO] [exec] [INFO] ------------------------------------------------------------------------ [exec] [INFO] Building Bootstrap - Pluto Assembler Dependencies 4.0.16-SNAPSHOT [exec] [INFO] ------------------------------------------------------------------------ [exec] Downloading: http://repo.maven.apache.org/maven2/org/apache/portals/pluto/pluto-ant-tasks/2.1.0-M3/pluto-ant-tasks-2.1.0-M3.pom [exec] Downloaded: http://repo.maven.apache.org/maven2/org/apache/portals/pluto/pluto-ant-tasks/2.1.0-M3/pluto-ant-tasks-2.1.0-M3.pom (2 KB at 2.6 KB/sec) [exec] Downloading: http://repo.maven.apache.org/maven2/org/apache/portals/pluto/pluto-ant-tasks/2.1.0-M3/pluto-ant-tasks-2.1.0-M3.jar [exec] Downloaded: http://repo.maven.apache.org/maven2/org/apache/portals/pluto/pluto-ant-tasks/2.1.0-M3/pluto-ant-tasks-2.1.0-M3.jar (12 KB at 42.1 KB/sec) [exec] [INFO] [exec] [INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ pluto-assembler --- [exec] [INFO] [exec] [INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-versions) @ pluto-assembler --- [exec] [INFO] [exec] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ pluto-assembler --- [exec] [INFO] Using 'UTF-8' encoding to copy filtered resources. [exec] [INFO] skip non existing resourceDirectory /home/esup/esup-uportal/bootstrap/pluto-assembler/src/main/resources [exec] [INFO] [exec] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ pluto-assembler --- [exec] [INFO] No sources to compile [exec] [INFO] [exec] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ pluto-assembler --- [exec] [INFO] Using 'UTF-8' encoding to copy filtered resources. [exec] [INFO] skip non existing resourceDirectory /home/esup/esup-uportal/bootstrap/pluto-assembler/src/test/resources [exec] [INFO] [exec] [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ pluto-assembler --- [exec] [INFO] No sources to compile [exec] [INFO] [exec] [INFO] --- maven-surefire-plugin:2.15:test (default-test) @ pluto-assembler --- [exec] [INFO] No tests to run. [exec] [INFO] [exec] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ pluto-assembler --- [exec] [WARNING] JAR will be empty - no content was marked for inclusion! [exec] [INFO] Building jar: /home/esup/esup-uportal/bootstrap/pluto-assembler/target/pluto-assembler-4.0.16-SNAPSHOT.jar [exec] [INFO] [exec] [INFO] --- maven-site-plugin:3.1.r1174614:attach-descriptor (attach-descriptor) @ pluto-assembler --- [exec] [INFO] [exec] [INFO] --- maven-install-plugin:2.4:install (default-install) @ pluto-assembler --- [exec] [INFO] Installing /home/esup/esup-uportal/bootstrap/pluto-assembler/target/pluto-assembler-4.0.16-SNAPSHOT.jar to /home/esup/.m2/repository/org/jasig/portal/pluto-assembler/4.0.16-SNAPSHOT/pluto-assembler-4.0.16-SNAPSHOT.jar [exec] [INFO] Installing /home/esup/esup-uportal/bootstrap/pluto-assembler/pom.xml to /home/esup/.m2/repository/org/jasig/portal/pluto-assembler/4.0.16-SNAPSHOT/pluto-assembler-4.0.16-SNAPSHOT.pom [exec] [INFO] ------------------------------------------------------------------------ [exec] [INFO] BUILD SUCCESS [exec] [INFO] ------------------------------------------------------------------------ [exec] [INFO] Total time: 3.805s [exec] [INFO] Finished at: Thu May 26 17:43:42 CEST 2016 [exec] [INFO] Final Memory: 16M/310M [exec] [INFO] ------------------------------------------------------------------------ [assemblePortlet] Assembling '/home/esup/portlet/esup-filemanager/target/esup-filemanager.war' to '/home/esup/esup-uportal/target/tmp' [assemblePortlet] SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". [assemblePortlet] SLF4J: Defaulting to no-operation (NOP) logger implementation [assemblePortlet] SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. fastWarDeploy: [echo] extractWars=true [echo] removeExisting=true [mkdir] Created dir: /home/esup/esup-uportal/target/tmp/esup-filemanager [unwar] Expanding: /home/esup/esup-uportal/target/tmp/esup-filemanager.war into /home/esup/esup-uportal/target/tmp/esup-filemanager [echo] Moving /home/esup/esup-uportal/target/tmp/esup-filemanager to /opt/tomcat/webapps [delete] Deleting: /home/esup/esup-uportal/target/tmp/esup-filemanager.war BUILD SUCCESSFUL Total time: 10 seconds
voir les options de personnalisation sur l'interface web (si css les caches)
https://esup4dz.tem-tsp.eu/uPortal/f/welcome/p/esup-filemanager.u32l1n15/max/render.uP?pCmd=edit
[esup@esup3re7 ~/esup-install/canaux] $ wget https://sourcesup.renater.fr/frs/download.php/4021/esup-filemanager-2.2.0.tgz $ tar tvfz esup-filemanager-2.2.0.tgz $ ln -s esup-filemanager-2.2.0 esup-filemanager $ cd esup-filemanager
[esup@esup3re7 ~/esup-install/canaux/esup-filemanager/src/main/webapp/WEB-INF] $ cp web.xml web.xml.orig $ cp context/drives.xml context/drives.xml.orig $ cp log4j.properties log4j.properties.orig
[esup@esup3re7 ~/esup-install/canaux/esup-filemanager/src/main/webapp/WEB-INF] $ diff web.xml.orig web.xml 115c115 < <param-value>https://cas.mon-univ.fr/proxy</param-value> --- > <param-value>https://cas.tem-tsp.eu/cas/proxy</param-value>
[esup@esup3re7 ~/esup-install/canaux/esup-filemanager/src/main/webapp/WEB-INF] $ diff context/drives.xml.orig context/drives.xml | more 36c36 < <util:constant id="isPortlet" static-field="java.lang.Boolean.FALSE"/> --- > <util:constant id="isPortlet" static-field="java.lang.Boolean.TRUE"/> 42,52c42,52 < <util:map id="drivesCategories"> < <entry key="Shared"> < <bean class="org.esupportail.portlet.filemanager.beans.DrivesCategory"> < <property name="icon" value="/esup-filemanager/img/drives/house.png" /> < <property name="drives"> < <list> < <value>Toto</value> < <value>bob</value> < </list> < </property> < </bean> --- > <util:map id="drivesCategories"> > <entry key="Mes fichiers"> > <bean class="org.esupportail.portlet.filemanager.beans.DrivesCategory"> > <property name="icon" value="/esup-filemanager/img/drives/house.png" /> > <property name="drives"> > <list> > <value>Espace personnel</value> > <value>Web spaces</value> ....
export JAVA_HOME=/usr/lib/jvm/java-1.6.0 [esup@esup3re7 ~/esup-install/canaux/esup-filemanager] $ /usr/local/apache-maven-2.2.1/bin/mvn clean package .... Downloading: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-archiver/1.0-alpha-7/plexus-archiver-1.0-alpha-7.jar 138K downloaded (plexus-archiver-1.0-alpha-7.jar) [INFO] [war:war {execution: default-war}] [INFO] Exploding webapp... [INFO] Assembling webapp esup-filemanager in /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/canaux/esup-filemanager-2.2.0/target/esup-filemanager [INFO] Copy webapp webResources to /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/canaux/esup-filemanager-2.2.0/target/esup-filemanager [INFO] Generating war /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/canaux/esup-filemanager-2.2.0/target/esup-filemanager.war [INFO] Building war: /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/canaux/esup-filemanager-2.2.0/target/esup-filemanager.war [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1 minute 24 seconds [INFO] Finished at: Thu Aug 30 15:42:11 CEST 2012 [INFO] Final Memory: 27M/91M [INFO] ------------------------------------------------------------------------ <code> === deploy === <code> [esup@esup3re7 ~/esup-install/canaux/esup-filemanager] $ ant -f /home/esup/esup-install/build.xml portlet.deploy -DportletApp=/home/esup/esup-install/canaux/esup-filemanager/target/esup-filemanager.war Buildfile: /home/esup/esup-install/build.xml Trying to override old definition of task java Trying to override old definition of task javac portlet.deploy: checkForTomcat: deployPortletApp: install-parent-pom: [artifact:install] [INFO] Installing /home/esup/esup-install/Portail/uPortal_rel-3.2.4/pom.xml to /home/esup/.m2/repository/org/jasig/portal/uportal-parent/3.2.4/uportal-parent-3.2.4.pom [touch] Creating /tmp/jasig/uportal-parent.pom-1990999528-marker [artifact:dependencies] Downloading: org/apache/pluto/pluto-ant-tasks/1.1.7/pluto-ant-tasks-1.1.7.pom from central [artifact:dependencies] Transferring 2K from central [artifact:dependencies] Downloading: org/apache/pluto/pluto-ant-tasks/1.1.7/pluto-ant-tasks-1.1.7.jar from central [artifact:dependencies] Transferring 11K from central [assemblePortlet] Assembling '/home/esup/esup-install/canaux/esup-filemanager/target/esup-filemanager.war' to '/tmp/jasig' [assemblePortlet] Aug 30, 2012 3:46:07 PM org.exolab.castor.mapping.Mapping loadMapping [assemblePortlet] INFO: Loading mapping descriptors from jar:file:/home/esup/.m2/repository/org/apache/pluto/pluto-descriptor-impl/1.1.7/pluto-descriptor-impl-1.1.7.jar!/org/apache/pluto/descriptors/services/castor/castor-web-xml-mapping.xml [assemblePortlet] Aug 30, 2012 3:46:07 PM org.exolab.castor.mapping.Mapping loadMapping [assemblePortlet] INFO: Loading mapping descriptors from jar:file:/home/esup/.m2/repository/org/apache/pluto/pluto-descriptor-impl/1.1.7/pluto-descriptor-impl-1.1.7.jar!/org/apache/pluto/descriptors/services/castor/castor-portlet-xml-mapping.xml [assemblePortlet] Aug 30, 2012 3:46:08 PM org.exolab.castor.mapping.Mapping loadMapping [assemblePortlet] INFO: Loading mapping descriptors from jar:file:/home/esup/.m2/repository/org/apache/pluto/pluto-descriptor-impl/1.1.7/pluto-descriptor-impl-1.1.7.jar!/org/apache/pluto/descriptors/services/castor/castor-web-xml-mapping.xml fastWarDeploy: [echo] extractWars=true [echo] removeExisting=false [mkdir] Created dir: /tmp/jasig/esup-filemanager [unwar] Expanding: /tmp/jasig/esup-filemanager.war into /tmp/jasig/esup-filemanager [echo] Moving /tmp/jasig/esup-filemanager to /usr/share/tomcat6/webapps [delete] Deleting: /tmp/jasig/esup-filemanager.war BUILD SUCCESSFUL Total time: 7 seconds [esup@esup3re7 ~/esup-install/canaux/esup-filemanager] $ ll /usr/share/tomcat6/webapps/esup-filemanager/ total 20 drwxrwsr-x 3 esup esup 4096 Aug 30 15:46 css drwxrwsr-x 7 esup esup 4096 Aug 30 15:46 img drwxrwsr-x 3 esup esup 4096 Aug 30 15:46 js drwxrwsr-x 3 esup esup 4096 Aug 30 15:46 META-INF drwxrwsr-x 6 esup esup 4096 Aug 30 15:46 WEB-INF
dans /etc/tomcat6/server.xml
<Context path="/esup-filemanager" docBase="/usr/share/tomcat6/webapps/esup-filemanager" reloadable="true"> <Manager pathname=""/> </Context>
[esup@esup3re7 ~/esup-install] $ ant db.import -Ddir=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/channel -Dpattern="esup-filemanager\.channel" Buildfile: build.xml Trying to override old definition of task java Trying to override old definition of task javac db.import: prodPrompt: crn-import: install-parent-pom: [artifact:install] [INFO] Installing /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/pom.xml to /home/esup/.m2/repository/org/jasig/portal/uportal-parent/3.2.4/uportal-parent-3.2.4.pom [touch] Creating /tmp/jasig/uportal-parent.pom-1944894708-marker [echo] Artifact '/home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/uportal-impl/target/uportal-impl-3.2.4.jar' is up-to-date [artifact:install] [INFO] Installing /home/esup/esup-uPortal-3.2.4-esup-1.0.0-RC3/Portail/uPortal_rel-3.2.4/uportal-impl/target/uportal-impl-3.2.4.jar to /home/esup/.m2/repository/org/jasig/portal/uportal-impl/3.2.4/uportal-impl-3.2.4.jar [java] [java] INFO Creating new lazily initialized GenericApplicationContext for the portal [java] INFO Created new MemoryContext with environment '{java.naming.factory.url.pkgs=tyrex.naming, java.naming.provider.url=, java.naming.factory.initial=org.jasig.portal.jndi.DisposableMemoryContextFactory}' [java] INFO Initialized portal JNDI context [java] INFO Failed to load bean 'PortalDb.JNDI' from ApplicationContext expecting type: interface javax.sql.DataSource. Will try to load the next bean in the list instead. Error message from the attempt to load this bean ('PortalDb.JNDI'): Error creating bean with name 'PortalDb.JNDI' defined in class path resource [properties/contexts/datasourceContext.xml]: Invocation of init method failed; nested exception is javax.naming.NotContextException: comp is not a subcontext (enable debug for stack trace) [java] INFO Loaded bean for name PortalDb.direct [java] INFO Setting CacheProvider 'org.jasig.portal.utils.cache.hibernate.EhCacheProvider@1843ca4' on ThreadLocal [java] INFO Created new lazily initialized GenericApplicationContext for the portal in 4186ms [java] Base Import Directory=/home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/channel [java] FILE_PATTERN=esup-filemanager\.channel [java] Import Channel: esup-filemanager.channel [java] INFO Looking up bean 'channelRegistryStore' in ApplicationContext due to context not yet being initialized [java] INFO Creating singleton instance for bean 'scopedTarget.sessionAttributesOverridesMap' [java] INFO Adding destruction callback singleton for bean 'scopedTarget.sessionAttributesOverridesMap' [java] INFO Looking up bean 'jpaInterceptor' in ApplicationContext due to context not yet being initialized [java] INFO Parsing group service configuration. [java] INFO RDBMEntityGroupStore.initialize(): Node separator set to . [java] INFO Looking up bean 'cacheFactory' in ApplicationContext due to context not yet being initialized [java] INFO Looking up bean 'PortalDb' in ApplicationContext due to context not yet being initialized [java] INFO Looking up bean 'entityCachingService' in ApplicationContext due to context not yet being initialized [java] INFO Looking up bean 'portletDefinitionRegistry' in ApplicationContext due to context not yet being initialized [java] INFO Looking up bean 'channelPublishingService' in ApplicationContext due to context not yet being initialized [java] Import of /home/esup/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/channel Complete in 5874 milliseconds. BUILD SUCCESSFUL Total time: 12 seconds
reference: http://www.esup-portail.org/display/PROJCANSTOCK/Canal+stockage
[esup@esup3dev ~/src/canaux] $ wget https://sourcesup.cru.fr/frs/download.php/2900/esup-canal-stockage-4.7-RC-2.zip [esup@esup3dev ~/src/canaux] $ unzip esup-canal-stockage-4.7-RC-2.zip
http://www.esup-portail.org/pages/viewpage.action?pageId=5865511
[esup@esup3dev ~/src/canaux] $ wget http://www.esup-portail.org/download/attachments/5865511/esup-utils-mag-2.5.zip [esup@esup3dev ~/src/canaux] $ unzip esup-utils-mag-2.5.zip [esup@esup3dev ~/src/canaux/esup-utils-mag-2.5] $ diff -ur build.properties.orig build.properties --- build.properties.orig 2010-08-25 16:38:19.000000000 +0200 +++ build.properties 2010-08-25 16:39:33.000000000 +0200 @@ -8,14 +8,13 @@ #R�pertoire d'installation de Tomcat -tomcat.home = /home/uportal/PROD/Tomcat +tomcat.home = /usr/share/tomcat6 -#R�pertoire d'installation d'uPortal -uportal.home = /home/uportal/BUILD/uPortal-sources - -#R�pertoire de d�ploiement -deploy.home = /home/uportal/PROD/webapps/uPortal +#Repertoire d'installation d'uPortal +uportal.home = /home/esup/src/esup-install/Portail/uPortal_rel-3.1.2 +#Repertoire de deploiement +deploy.home = /usr/share/tomcat6/webapps/uPortal
[esup@esup3dev ~/src/canaux/esup-utils-mag-2.5] $ ant all BUILD FAILED /home/esup/src/canaux/esup-utils-mag-2.5/build.xml:155: /home/esup/src/esup-install/Portail/uPortal_rel-3.1.2/lib not found.
alors
[esup@esup3dev ~/src/canaux/esup-utils-mag-2.5] $ mkdir /home/esup/src/esup-install/Portail/uPortal_rel-3.1.2/lib
puis erreur
compile: [javac] Compiling 25 source files to /home/esup/src/canaux/esup-utils-mag-2.5/build/WEB-INF/classes [javac] /home/esup/src/canaux/esup-utils-mag-2.5/source/org/esupportail/portal/utils/channels/ConfigChannel.java:7: package javax.servlet.jsp does not exist
alors
$ diff -ur build.xml.orig build.xml --- build.xml.orig 2010-08-25 17:15:38.000000000 +0200 +++ build.xml 2010-08-25 17:17:05.000000000 +0200 @@ -62,6 +62,9 @@ <!-- Les lib de Tomcat --> <fileset dir="${tomcat.home}/common/lib" includes="**/*.jar" /> + <!-- https://listes.esup-portail.org/sympa/arc/esup-utilisateurs/2010-02/msg00099.html --> + <fileset dir="${tomcat.home}/lib" includes="**/*.jar" /> +
[esup@esup3dev ~/src/canaux/esup-utils-mag-2.5] $ ant all Buildfile: build.xml clean: [delete] Deleting directory /home/esup/src/canaux/esup-utils-mag-2.5/build undeploy: prepare: [mkdir] Created dir: /home/esup/src/canaux/esup-utils-mag-2.5/build [mkdir] Created dir: /home/esup/src/canaux/esup-utils-mag-2.5/build/WEB-INF/classes prepareINSTALL: prepareUPGRADE: prepareREADME: prepareLICENCE: prepareCHANGELOG: compile: [javac] Compiling 25 source files to /home/esup/src/canaux/esup-utils-mag-2.5/build/WEB-INF/classes [javac] /home/esup/src/canaux/esup-utils-mag-2.5/source/org/esupportail/portal/utils/channels/ConfigChannel.java:59: warning: [deprecation] DEBUG in org.apache.log4j.Priority has been deprecated [javac] logLevel = Priority.DEBUG; [javac] ^ [javac] /home/esup/src/canaux/esup-utils-mag-2.5/source/org/esupportail/portal/utils/channels/SubChannel.java:201: warning: [deprecation] getBaseWorkerURL(java.lang.String,boolean) in org.jasig.portal.ChannelRuntimeData has been deprecated [javac] xslParameters.put("baseDownloadURL",runtimeData.getBaseWorkerURL(UPFileSpec.FILE_DOWNLOAD_WORKER, true).replaceAll("%2F", "/")); [javac] ^ [javac] /home/esup/src/canaux/esup-utils-mag-2.5/source/org/esupportail/portal/utils/channels/SubChannelAjax.java:116: warning: [deprecation] getBaseActionURL(boolean) in org.jasig.portal.ChannelRuntimeData has been deprecated [javac] getXSLParameter().put("baseActionURL",runtimeData.getBaseActionURL(true)); [javac] ^ [javac] /home/esup/src/canaux/esup-utils-mag-2.5/source/org/esupportail/portal/utils/channels/SubChannelAjax.java:211: warning: [deprecation] getBaseActionURL(boolean) in org.jasig.portal.ChannelRuntimeData has been deprecated [javac] String redirect = runtimeData.getBaseActionURL(true) + "?"; [javac] ^ [javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. [javac] 4 warnings [copy] Copying 2 files to /home/esup/src/canaux/esup-utils-mag-2.5/build/WEB-INF/classes/properties/channels/org_esup/esup-utils-mag [copy] Copying 5 files to /home/esup/src/canaux/esup-utils-mag-2.5/build/WEB-INF/classes [copy] Copying 10 files to /home/esup/src/canaux/esup-utils-mag-2.5/build/media deploy: [copy] Copying 42 files to /usr/share/tomcat6/webapps/uPortal all: BUILD SUCCESSFUL Total time: 1 second
Retour au deployement de CStockage maintenant que MAG est disponible:
[esup@esup3dev ~/src/canaux/CStockage-4.7-RC-2] $ ant all Buildfile: build.xml clean: [delete] Deleting directory /home/esup/src/canaux/CStockage-4.7-RC-2/build undeploy: prepareBuild: [mkdir] Created dir: /home/esup/src/canaux/CStockage-4.7-RC-2/build [mkdir] Created dir: /home/esup/src/canaux/CStockage-4.7-RC-2/build/WEB-INF/classes compile: [javac] Compiling 123 source files to /home/esup/src/canaux/CStockage-4.7-RC-2/build/WEB-INF/classes [javac] /home/esup/src/canaux/CStockage-4.7-RC-2/source/org/esupportail/portal/channels/CStockage/CStockage.java:1036: warning: [deprecation] getBaseWorkerURL(java.lang.String,boolean) in org.jasig.portal.ChannelRuntimeData has been deprecated [javac] String downloadUrl = runtimeData.getBaseWorkerURL(UPFileSpec.FILE_DOWNLOAD_WORKER,true).replaceAll("%2F","/"); [javac] ^ [javac] /home/esup/src/canaux/CStockage-4.7-RC-2/source/org/esupportail/portal/channels/CStockage/provider/access/WebdavAccessImpl.java:336: warning: [deprecation] getReasonCode() in org.apache.commons.httpclient.HttpException has been deprecated [javac] int reasonCode = ex.getReasonCode(); [javac] ^ [javac] /home/esup/src/canaux/CStockage-4.7-RC-2/source/org/esupportail/portal/channels/CStockage/provider/access/WebdavAccessImpl.java:2580: warning: [deprecation] setReasonCode(int) in org.apache.commons.httpclient.HttpException has been deprecated [javac] ex.setReasonCode(status); [javac] ^ [javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. [javac] 3 warnings [copy] Copying 8 files to /home/esup/src/canaux/CStockage-4.7-RC-2/build/WEB-INF/classes/properties/channels/org_esup/CStockage [copy] Copying 47 files to /home/esup/src/canaux/CStockage-4.7-RC-2/build/WEB-INF/classes/org/esupportail/portal/channels/CStockage [copy] Copying 109 files to /home/esup/src/canaux/CStockage-4.7-RC-2/build/media/org/esupportail/portal/channels/CStockage deploy: [copy] Copying 288 files to /usr/share/tomcat6/webapps/uPortal all: BUILD SUCCESSFUL Total time: 2 seconds
fichier de publication du canal
[esup@esup3dev ~/src/esup-install] $ cat custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/channel/CStockage.channel <channel-definition script="classpath://org/jasig/portal/io/import-channel_v3-1.crn"> <title>Mes fichiers</title> <name>Mes fichiers</name> <fname>CStockage</fname> <desc>Canal de stockage - Acces fichiers</desc> <type>Custom</type> <class>org.esupportail.portal.channels.CStockage.CStockage</class> <timeout>5000</timeout> <hasedit>N</hasedit> <hashelp>N</hashelp> <hasabout>N</hasabout> <secure>N</secure> <locale>en_US</locale> <categories> <category>Applications</category> </categories> <groups> <group>Tout le monde</group> </groups> <users/> <portletPreferences/> </channel-definition>
publication
[esup@esup3dev ~/src/esup-install] $ ant db.import -Ddir=/home/esup/src/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/channel -Dpattern="CStockage.channel" ... [java] Base Import Directory=/home/esup/src/esup-install/custom/uPortal/uportal-impl/src/main/resources/properties/db/itsp/channel [java] FILE_PATTERN=CStockage.channel [java] Import Channel: CStockage.channel
video4 39mn30s
Par defaut le portail agrège un fichier de stats definis dns le config.propoerties
# STATS Options esup.stats.file=${esup.log.dir}/stats.log
video4 43mn
Par defaut le portail dispose de deux themes mobiles, iphone et android detectés sur le user-agent. pour les canaux portlet … c'est a eux de le gerer. Mais la navigation générale du portail est gérée .
UNR IDF ⇒ esup-mobile .
video 4 46mn30s
javascript jquery … exemple redimensionner dynamiquement une iframe et afficher aussi un bouton pour sortir l'Iframe du portail (nouvelle fenetre 52mn)
Penser a desagreger les CSS afin de rendre les codes source CSS de la page lisibles
Vidéo tutoriel eSup V3
http://mediatheque.parisdescartes.fr/rubrique.php3?id_rubrique=706&tri=titre
http://www.esup-portail.org/pages/viewpage.action?pageId=88244244
9mn tomcat5 → tomcat6 /lib (vs common - shared)
34mn context /cas et serialisation de sessions au demarrage/arret
39mn installation du portail
41,30 java_home build.properties
42 tomcat.update mettre les jar dont esup a besoin dans tomcat, lors du deployement il les met là où il faut . true une fois, puis a false , sauf si necessité d'une MAJ
47 real.host quand load balancing
/guest acces a un canal en mode non authentifié
48 context uportal et contexServingWebapps
54 sidebar de gauche uportalv3 desactivé
60 ant get-components (chercher le uportal du jasig)
61 ant unzip decompacte les zip des package exterieurs esup* ant init prend les update esup les copie dans uportal et customisation dans uportal * ant deploy compile les class (1 milliers !) et les deploient dans webapps/esup-portail * ant db_init cree les tables
handler file webapps/cas/WEB-INF/usersFile login::md5password
vim coller via buffer mouse du xml sans indentation automatique set paste set noposte
passage en mysql
vim filters/esup.properties
environment.build.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
commenter <!– POSTGRESQL driver. Uncomment if you need to decommenter mysql
<!– MYSQL driver. Uncomment if you need to –>
<jdbc.groupId>mysql</jdbc.groupId> <jdbc.artifactId>mysql-connector-java</jdbc.artifactId> <jdbc.version>5.1.9</jdbc.version>
https://github.com/psi-probe/psi-probe
[esup@esup1 portlet]$ git clone https://github.com/psi-probe/psi-probe.git Cloning into 'psi-probe'... remote: Counting objects: 10958, done. remote: Compressing objects: 100% (32/32), done. remote: Total 10958 (delta 14), reused 6 (delta 6), pack-reused 10918 Receiving objects: 100% (10958/10958), 15.25 MiB | 621.00 KiB/s, done. Resolving deltas: 100% (6445/6445), done. [esup@esup1 portlet]$ cd psi-probe/ [esup@esup1 psi-probe]$ git branch -a * master remotes/origin/1.7 remotes/origin/2.0 remotes/origin/2.1 remotes/origin/2.2 remotes/origin/2.3 remotes/origin/HEAD -> origin/master remotes/origin/gh-pages remotes/origin/master [esup@esup1 psi-probe]$ git checkout -b probe-disi-2.3.3 2.3.3 Switched to a new branch 'probe-disi-2.3.3'
[esup@esup4dz ~/portlet] $ git clone https://github.com/psi-probe/psi-probe.git Cloning into 'psi-probe'... remote: Counting objects: 10958, done. remote: Compressing objects: 100% (32/32), done. remote: Total 10958 (delta 14), reused 6 (delta 6), pack-reused 10918 Receiving objects: 100% (10958/10958), 15.25 MiB | 1.09 MiB/s, done. Resolving deltas: 100% (6445/6445), done. [esup@esup4dz ~/portlet] $ ls psi-probe [esup@esup4dz ~/portlet] $ cd psi-probe/ [esup@esup4dz ~/portlet/psi-probe] $ git branch -a * master remotes/origin/1.7 remotes/origin/2.0 remotes/origin/2.1 remotes/origin/2.2 remotes/origin/2.3 remotes/origin/HEAD -> origin/master remotes/origin/gh-pages remotes/origin/master [esup@esup4dz ~/portlet/psi-probe] $ git checkout origin/master Note: checking out 'origin/master'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b new_branch_name HEAD is now at 46cb78f... Update README.md [esup@esup4dz ~/portlet/psi-probe] $ git checkout master Switched to branch 'master' [esup@esup4dz ~/portlet/psi-probe] $ mvn clean package [INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for com.googlecode.psiprobe:core:jar:2.4.0-SNAPSHOT [WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-changelog-plugin is missing. @ com.googlecode.psiprobe:psi-probe:2.4.0-SNAPSHOT, /home/esup/portlet/psi-probe/pom.xml, line 510, column 12 [WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-project-info-reports-plugin is missing. @ com.googlecode.psiprobe:psi-probe:2.4.0-SNAPSHOT, /home/esup/portlet/psi-probe/pom.xml, line 514, column 12 [WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-jxr-plugin is missing. @ com.googlecode.psiprobe:psi-probe:2.4.0-SNAPSHOT, /home/esup/portlet/psi-probe/pom.xml, line 527, column 12 [WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-report-plugin is missing. @ com.googlecode.psiprobe:psi-probe:2.4.0-SNAPSHOT, /home/esup/portlet/psi-probe/pom.xml, line 531, column 12 [WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-checkstyle-plugin is missing. @ com.googlecode.psiprobe:psi-probe:2.4.0-SNAPSHOT, /home/esup/portlet/psi-probe/pom.xml, line 538, column 12 [WARNING] 'reporting.plugins.plugin.version' for org.codehaus.mojo:findbugs-maven-plugin is missing. @ com.googlecode.psiprobe:psi-probe:2.4.0-SNAPSHOT, /home/esup/portlet/psi-probe/pom.xml, line 542, column 12 [WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-pmd-plugin is missing. @ com.googlecode.psiprobe:psi-probe:2.4.0-SNAPSHOT, /home/esup/portlet/psi-probe/pom.xml, line 546, column 12 [WARNING] 'reporting.plugins.plugin.version' for com.googlecode.l10n-maven-plugin:l10n-maven-plugin is missing. @ com.googlecode.psiprobe:psi-probe:2.4.0-SNAPSHOT, /home/esup/portlet/psi-probe/pom.xml, line 553, column 12 [WARNING] Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-filtering/1.3/maven-filtering-1.3.jar (50 KB at 312.4 KB/sec) [INFO] Packaging webapp [INFO] Assembling webapp [web] in [/home/esup/portlet/psi-probe/web/target/war_exploded] [INFO] Processing war project [INFO] Copying webapp webResources [/home/esup/portlet/psi-probe/web/src/main/conf] to [/home/esup/portlet/psi-probe/web/target/war_exploded] [INFO] Copying webapp webResources [/home/esup/portlet/psi-probe/web/src/main/conf/META-INF] to [/home/esup/portlet/psi-probe/web/target/war_exploded] [INFO] Copying webapp resources [/home/esup/portlet/psi-probe/web/src/main/webapp] [INFO] Webapp assembled in [704 msecs] [INFO] Building war: /home/esup/portlet/psi-probe/web/target/probe.war [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] PSI Probe ......................................... SUCCESS [5.680s] [INFO] PSI Probe Core .................................... SUCCESS [1:09.799s] [INFO] PSI Probe Tomcat 5.0.x Adaptor .................... SUCCESS [3.445s] [INFO] PSI Probe Tomcat 5.5.x Adaptor .................... SUCCESS [3.192s] [INFO] PSI Probe Tomcat 6.0.x Adaptor .................... SUCCESS [11.333s] [INFO] PSI Probe Tomcat 7.0.x Adaptor .................... SUCCESS [11.465s] [INFO] PSI Probe Tomcat 8.0.x Adaptor .................... SUCCESS [14.527s] [INFO] PSI Probe Web Application ......................... SUCCESS [14.794s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2:14.659s [INFO] Finished at: Thu May 21 15:44:28 CEST 2015 [INFO] Final Memory: 42M/271M [INFO] ------------------------------------------------------------------------ [esup@esup4dz ~/portlet/psi-probe]
2mem
[esup@esup4dz ~/portlet/psi-probe] $ git checkout -b disi-psi-probe-master master Switched to a new branch 'disi-psi-probe-master' [esup@esup4dz ~/portlet/psi-probe] $ mvn clean package [INFO] Scanning for projects... ... INFO] Building war: /home/esup/portlet/psi-probe/web/target/probe.war [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] PSI Probe ......................................... SUCCESS [1.018s] [INFO] PSI Probe Core .................................... SUCCESS [5.617s] [INFO] PSI Probe Tomcat 5.0.x Adaptor .................... SUCCESS [0.410s] [INFO] PSI Probe Tomcat 5.5.x Adaptor .................... SUCCESS [0.212s] [INFO] PSI Probe Tomcat 6.0.x Adaptor .................... SUCCESS [0.163s] [INFO] PSI Probe Tomcat 7.0.x Adaptor .................... SUCCESS [0.173s] [INFO] PSI Probe Tomcat 8.0.x Adaptor .................... SUCCESS [0.163s] [INFO] PSI Probe Web Application ......................... SUCCESS [2.821s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 10.871s [INFO] Finished at: Thu May 21 15:45:55 CEST 2015 [INFO] Final Memory: 56M/468M [INFO] ------------------------------------------------------------------------ [esup@esup4dz ~/portlet/psi-probe]
installation manuelle
[esup@esup4dz ~/portlet/psi-probe] $ cd /var/lib/tomcat/webapps/ [esup@esup4dz /var/lib/tomcat/webapps] $ mkdir probe [esup@esup4dz /var/lib/tomcat/webapps] $ cd probe/ [esup@esup4dz /var/lib/tomcat/webapps/probe] $ unzip /home/esup/portlet/psi-probe/web/target/probe.war ... inflating: META-INF/maven/com.googlecode.psiprobe/web/pom.xml inflating: META-INF/maven/com.googlecode.psiprobe/web/pom.properties
definition du context
[esup@esup4dz /var/lib/tomcat/webapps/probe] $ cp WEB-INF/context.xml /etc/tomcat/Catalina/localhost/probe.xml
reload du context
[root@esup4dz ~] $ systemctl restart tomcat.service
acces
une correction sur simplecontent portlet a été corrigé sur la branche master, on v a mettre a jour notre branche maison dessus
[esup@esup4dz ~/esup-uportal] $ git pull origin master remote: Counting objects: 3, done. remote: Compressing objects: 100% (3/3), done. remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (3/3), done. From git://github.com/EsupPortail/esup-uportal * branch master -> FETCH_HEAD Auto-merging pom.xml CONFLICT (content): Merge conflict in pom.xml Automatic merge failed; fix conflicts and then commit the result.
Merger pom.xml
<!-- POSTGRESQL driver. Uncomment if you need to --> <<<<<<< HEAD <jdbc.groupId>postgresql</jdbc.groupId> <jdbc.artifactId>postgresql</jdbc.artifactId> <jdbc.version>9.0-801.jdbc4</jdbc.version> ======= <!-- <jdbc.groupId>org.postgresql</jdbc.groupId> <jdbc.artifactId>postgresql</jdbc.artifactId> <jdbc.version>9.3-1102-jdbc41</jdbc.version> --> >>>>>>> fb40a9781a992e4501713691bcc9cc14b91e8ed9
on commit localement
[esup@esup4dz ~/esup-uportal] $ git commit -a -m "mise a jour sur master de pom.xml pour drivers postgres simplecontent ... JP " [ecampusdz 726fd1f] mise a jour sur master de pom.xml pour drivers postgres simplecontent ... JP
tig affiche bien tout ça
2015-05-22 09:49 jehan M─┐ [ecampusdz] mise a jour sur master de pom.xml pour drivers postgres simplecontent ... JP 2015-05-22 09:03 vincent │ o MAJ postgresql jdbc version - notamment pour issue sur CMSPLT - #114 2015-05-20 18:12 jehan o │ activation driver postgresql dans pom.xml JP