Blackhold

Instalar extensiones alfresco con amp

Posted on novembre 1st, 2014 by admin

Con una instancia recién instalada de alfresco, vamos a instalar los paquetes amp con el alfresco-mmt.jar.

En alfresco 5 ya no existe la apariencia antigua de alfresco, así que sólo tenemos alfresco share.

Las extensiones las instalamos sobre el .war que corresponde a la instancia dentro de tomcat alojado en /opt/alfresco-5.0.b/tomcat/webapps/ en este caso share.war.

Los comandos básicos son install, uninstall y list.

Vamos a instalar por ejemplo la extensión htmlwebpreviewer que nos va a permitir visualizar documentos de texto, html, imágenes, etc. en nuestra instancia de alfresco, ya que por defecto sólo se nos muestran los pdf.

root@Aludra-alfrescoADV:/opt/alfresco-5.0.b/bin# java -jar alfresco-mmt.jar install ../amps_share/form4.alfresco.htmlwebpreviewer-1.0.0.amp ../tomcat/webapps/share.war

Para ver las extensiones instaladas en el alfresco_share:

root@Aludra-alfrescoADV:/opt/alfresco-5.0.b/bin# java -jar alfresco-mmt.jar list ../tomcat/webapps/share.war
Module 'htmlwebpreviewer' installed in '../tomcat/webapps/share.war'
   -    Title:        Html Web Previewer - Share Extension
   -    Version:      1.0.0.1409151936
   -    Install Date: Sat Nov 01 12:16:28 CET 2014
   -    Description:   Html Web Previewer: Extends Alfresco Share to show HTML, Text and other plain files to be shown inline and accessible on document details pages (and not as rendered PDF)
Module 'org.alfresco.integrations.share.google.docs' installed in '../tomcat/webapps/share.war'
   -    Title:        Alfresco / Google Docs Share Module
   -    Version:      2.0.7
   -    Install Date: Fri Oct 24 16:44:25 CEST 2014
   -    Description:   The Share side artifacts of the Alfresco / Google Docs Integration.

Para desinstalar el htmlwebpreviewer sería:

root@Aludra-alfrescoADV:/opt/alfresco-5.0.b/bin# java -jar alfresco-mmt.jar uninstall htmlwebpreviewer ../tomcat/webapps/share.war
   - Removing file '/components/htmlwebpreview/htmlwebpreview-min.js' from war
   - Removing file '/components/htmlwebpreview/htmlwebpreview.css' from war
   - Removing file '/components/htmlwebpreview/htmlwebpreview.js' from war
   - Removing file '/components/htmlwebpreview/htmlwebpreview.lib-min.js' from war
   - Removing file '/components/htmlwebpreview/htmlwebpreview.lib.js' from war
   - Removing file '/WEB-INF/lib/htmlwebpreviewer-1.0.0.jar' from war
   - Removing file '/WEB-INF/licenses/LICENSE.txt' from war
   - Removing file '/WEB-INF/classes/alfresco/module/htmlwebpreviewer/module-context.xml' from war
   - Removing file '/WEB-INF/classes/alfresco/web-extension/messages/htmlwebpreviewer.properties' from war
   - Removing file '/WEB-INF/classes/alfresco/web-extension/messages/htmlwebpreviewer_de.properties' from war
   - Removing file '/WEB-INF/classes/alfresco/web-extension/site-data/extensions/form4-htmlwebpreview-extension.xml' from war
   - Removing file '/WEB-INF/classes/alfresco/web-extension/site-webscripts/de/form4/customization/preview/web-preview.get.html.ftl' from war
   - Removing file '/WEB-INF/classes/alfresco/web-extension/site-webscripts/de/form4/customization/preview/web-preview.get.js' from war
   - Removing file '/WEB-INF/classes/alfresco/web-extension/custom-slingshot-application-context.xml' from war
   - Removing file '/WEB-INF/classes/alfresco/web-extension/share-config-custom.xml_dev' from war
   - Removing file '/components/htmlwebpreview' from war
   - Removing file '/WEB-INF/classes/alfresco/web-extension/messages' from war
   - Removing file '/WEB-INF/classes/alfresco/web-extension/site-data/extensions' from war
   - Removing file '/WEB-INF/classes/alfresco/web-extension/site-data' from war
   - Removing file '/WEB-INF/classes/alfresco/web-extension/site-webscripts/de/form4/customization/preview' from war
   - Removing file '/WEB-INF/classes/alfresco/web-extension/site-webscripts/de/form4/customization' from war
   - Removing file '/WEB-INF/classes/alfresco/web-extension/site-webscripts/de/form4' from war
   - Removing file '/WEB-INF/classes/alfresco/web-extension/site-webscripts/de' from war
   - Removing file '/WEB-INF/classes/alfresco/web-extension/site-webscripts' from war
   - Removing file '/WEB-INF/classes/alfresco/module/htmlwebpreviewer/modifications.install' from war
   - Removing file '/WEB-INF/classes/alfresco/module/htmlwebpreviewer/module.properties' from war

Mirando la página web de extensiones de alfresco vemos que podemos hacer un filtro por método de instalación, y definirlo a amp, pero no todas las extensiones nos lo dejan tan fácil como que nos dan el fichero .amp y nos dirigen directamente a un git con el código. Para crear los .amp vamos a usar maven.

Vamos a tratar de instalar pues la extensión de libreoffice que nos permite modificar ficheros online (alfresco-libreoffice-online-edit).

Vamos a un directorio de nuestro sistema y nos descargamos los ficheros ahí. Si quieres tener la maquina lo más limpia posible, te recomiendo hacer el .amp en otra máquina y luego pasar el .amp.

Preparamos el entorno:

root@debian-tablet:~# apt-get install git openjdk-7-jdk
root@debian-tablet:~# wget http://www.motorlogy.com/apache/maven/maven-3/3.2.3/binaries/apache-maven-3.2.3-bin.tar.gz
root@debian-tablet:~# tar xvzf apache-maven-3.2.3-bin.tar.gz
root@debian-tablet:~# mkdir /usr/local/apache-maven
root@debian-tablet:~# mv apache-maven-3.2.3 /usr/local/apache-maven/
root@debian-tablet:~# vi .bashrc
#maven
export M2_HOME=/usr/local/apache-maven/apache-maven-3.2.3
export M2=$M2_HOME/bin
export MAVEN_OPTS="-Xms256m -Xmx512m"
export PATH=$M2:$PATH
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export JAVA_HOME

root@debian-tablet:~# ^D
laura@debian-tablet:~$ su

root@debian-tablet:~# mvn --version
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11T22:58:10+02:00)
Maven home: /usr/local/apache-maven/apache-maven-3.2.3
Java version: 1.7.0_65, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: ca_ES, platform encoding: UTF-8
OS name: "linux", version: "3.16-2-amd64", arch: "amd64", family: "unix"

Descargando y empaquetando la extensión:

root@debian-tablet:~# mkdir alfresco
root@debian-tablet:~# cd alfresco
root@debian-tablet:~/alfresco# git clone git://github.com/Redpill-Linpro/alfresco-libreoffice-online-edit.git
root@debian-tablet:~/alfresco# cd alfresco-libreoffice-online-edit/
root@debian-tablet:~/alfresco/alfresco-libreoffice-online-edit# mvn clean package
root@debian-tablet:~/alfresco# cd alfresco-libreoffice-online-edit/libreoffice-online-edit-share/target/
root@debian-tablet:~/alfresco/alfresco-libreoffice-online-edit/libreoffice-online-edit-share/target# ls -l
total 52
drwxr-xr-x 2 root root  4096 nov  1 13:23 classes
drwxr-xr-x 5 root root  4096 nov  1 13:23 libreoffice-online-edit-share-1.2.3
-rw-r--r-- 1 root root 36907 nov  1 13:23 libreoffice-online-edit-share-1.2.3.amp
drwxr-xr-x 2 root root  4096 nov  1 13:23 maven-archiver
root@debian-tablet:~/alfresco/alfresco-libreoffice-online-edit/libreoffice-online-edit-share/target# 

Ahora copiamos el .amp a nuestra instancia de alfresco

root@debian-tablet:~/alfresco/alfresco-libreoffice-online-edit/libreoffice-online-edit-share/target# scp -6 libreoffice-online-edit-share-1.2.3.amp root@[2a00:1508:6001::166]:/opt/alfresco-5.0.b/amps_share/

Paramos alfresco, lo instalamos y lo volvemos a arrancar

root@Aludra-alfrescoADV:/opt/alfresco-5.0.b/bin# /etc/init.d/alfresco stop
root@Aludra-alfrescoADV:/opt/alfresco-5.0.b/bin# java -jar alfresco-mmt.jar install ../amps_share/libreoffice-online-edit-share-1.2.3.amp ../tomcat/webapps/share.war
root@Aludra-alfrescoADV:/opt/alfresco-5.0.b/bin# java -jar alfresco-mmt.jar list ../tomcat/webapps/share.war
Module 'libreoffice-online-edit-share' installed in '../tomcat/webapps/share.war'
   -    Title:        Alfresco Share Module for LibreOffice Edit Online functionality
   -    Version:      1.2.3
   -    Install Date: Sat Nov 01 13:38:28 CET 2014
   -    Description:   Alfresco Share Module for LibreOffice Edit Online functionality
Module 'htmlwebpreviewer' installed in '../tomcat/webapps/share.war'
   -    Title:        Html Web Previewer - Share Extension
   -    Version:      1.0.0.1409151936
   -    Install Date: Sat Nov 01 12:19:08 CET 2014
   -    Description:   Html Web Previewer: Extends Alfresco Share to show HTML, Text and other plain files to be shown inline and accessible on document details pages (and not as rendered PDF)
Module 'org.alfresco.integrations.share.google.docs' installed in '../tomcat/webapps/share.war'
   -    Title:        Alfresco / Google Docs Share Module
   -    Version:      2.0.7
   -    Install Date: Fri Oct 24 16:44:25 CEST 2014
   -    Description:   The Share side artifacts of the Alfresco / Google Docs Integration.
root@Aludra-alfrescoADV:/opt/alfresco-5.0.b/bin# /etc/init.d/alfresco start
root@Aludra-alfrescoADV:/opt/alfresco-5.0.b/bin# cd ../tomcat/logs/
root@Aludra-alfrescoADV:/opt/alfresco-5.0.b/tomcat/logs# tail -f catalina.out 

La última línea es importante tenerla en cuenta cada vez que hagamos cambios a alfresco, el motivo es para verificar que no haya errores.

Ahora necesitaremos instalar un plugin en nuestro ordenador para poder modificar ficheros libreoffice desde el navegador:

root@carboni:/home/laura# apt-get install browser-plugin-libreoffice

O instalar el plugin de libreoffice del navegador.

Más información sobre éste plugin.

This entry was posted on dissabte, novembre 1st, 2014 at 13:59 and is filed under Alfresco. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

« »

guy fawkes