Set Alfresco portlet di Liferay 6.0.3
Tadi pagi habis subuh tiba-tiba pingin ngulik liferay yang lama banget gak nyentuh.
Baca-baca buku yang saya dulu pernah saya download waktu di Tulodong, tentang Liferay Administrations.
Jadi keinget buat Alfresco jadi portletnya Liferay, langsung menuju ke TKP jadinya.
1.Sebelumnya download dulu alfresco.war, atau jika kita sudah pernah install alfresco di komputer kita, tinggal ambil aja filenya di $Alfresco_Home/tomcat/webapps.
Jika bingung bagaimana cara install Alfresco, bisa mampir ke postingan saya dulu di sini.
2.Setelah itu ekstrak file alfresco.war di folder yang kita inginkan.
3.Ganti dir.root Alfresco ke folder untuk calon repository kita, gantinya di file repository.properties yang ada di $Alfresco_Home/WEB-INF/classess/alfresco/repository.properties
4.Buat database dengan nama "alfresco" dan username "alfresco" untuk database tersebut
mysql>create database alfresco;
mysql>grant all on alfresco.* to alfresco@localhost identified by 'alfresco';
5. Hapus file portlet-api-lib.jar di $Alfresco_Home/WEB-INF/lib/portlet-api-lib.jar
6.Edit file web.xml yang ada di $Alfresco_Home/WEB-INF/web.xml.Sisipkan baris kode berikut yang berguna untuk membaca beberapa file-file xml
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml,/WEB-INF/faces-config-
app.xml,/WEB-INF/faces-config-beans.xml,
/WEB-INF/faces-config-navigation.xml,/WEB-INF/faces-config-
common.xml,
/WEB-INF/faces-config-repo.xml,/WEB-INF/faces-config-wcm.xml,/WEB-
INF/faces-config-custom.xml</param-value>
</context-param>
7.buat file face-config.xml di $Alfresco_home/WEB-INF. ketikan baris berikut di file face-config.xml tersebut
<?xml version="1.0"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config xmlns="http://java.sun.com/JSF/Configuration">
<factory>
<faces-context-factory>com.liferay.util.bridges.jsf.myfaces.MyFacesContextFactoryImpl</faces-context-factory>
</factory>
</faces-config>
8.Buat file liferay-display.xml dan ketikkan baris berikut
<?xml version="1.0"?>
<!DOCTYPE display PUBLIC "-//Liferay//DTD Display 6.0.0//EN" "http://www.liferay.com/dtd/liferay-display_6_0_0.dtd">
<display>
<category name="category.alfresco">
<portlet id="AlfrescoClient"/>
<portlet id="AlfrescoMyTasks"/>
<portlet id="AlfrescoDocList"/>
<portlet id="AlfrescoMySpaces"/>
<portlet id="AlfrescoMyWebForms"/>
<portlet id="AlfrescoMyWebFiles"/>
</category>
</display>
9.Buat file dengan nama liferay-portlet.xml, isi dengan baris berikut
<?xml version="1.0"?>
<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 6.0.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_6_0_0.dtd">
<liferay-portlet-app>
<portlet>
<portlet-name>AlfrescoClient</portlet-name>
<use-default-template>true</use-default-template>
<restore-current-view>true</restore-current-view>
</portlet>
<portlet>
<portlet-name>AlfrescoMyTasks</portlet-name>
<use-default-template>true</use-default-template>
<restore-current-view>true</restore-current-view>
</portlet>
<portlet>
<portlet-name>AlfrescoDocList</portlet-name>
<use-default-template>true</use-default-template>
<restore-current-view>true</restore-current-view>
</portlet>
<portlet>
<portlet-name>AlfrescoMySpaces</portlet-name>
<use-default-template>true</use-default-template>
<restore-current-view>true</restore-current-view>
</portlet>
<portlet>
<portlet-name>AlfrescoMyWebForms</portlet-name>
<use-default-template>true</use-default-template>
<restore-current-view>true</restore-current-view>
</portlet>
<portlet>
<portlet-name>AlfrescoMyWebFiles</portlet-name>
<use-default-template>true</use-default-template>
<restore-current-view>true</restore-current-view>
</portlet>
</liferay-portlet-app>
10.Buat file portlet.xml dan isi dengan baris berikut
<?xml version="1.0" encoding="UTF-8"?>
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
<portlet>
<description>Alfresco Client Portlet</description>
<portlet-name>AlfrescoClient</portlet-name>
<portlet-class>org.alfresco.web.app.portlet.AlfrescoFacesPortlet</portlet-class>
<init-param>
<name>default-view</name>
<value>/jsp/login.jsp</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
<portlet-mode>HELP</portlet-mode>
</supports>
<portlet-info>
<title>Alfresco Client Portlet</title>
<short-title>alfresco-client-portlet</short-title>
</portlet-info>
</portlet>
<portlet>
<description>My Tasks</description>
<portlet-name>AlfrescoMyTasks</portlet-name>
<portlet-class>org.alfresco.web.scripts.portlet.WebScriptPortlet</portlet-class>
<init-param>
<name>authenticator</name>
<value>webscripts.authenticator.jsr168.webclient</value>
</init-param>
<init-param>
<name>scriptUrl</name>
<value>/alfresco/168s/ui/mytasks</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-info>
<title>My Tasks</title>
<short-title>My Tasks</short-title>
</portlet-info>
</portlet>
<portlet>
<description>Document List</description>
<portlet-name>AlfrescoDocList</portlet-name>
<portlet-class>org.alfresco.web.scripts.portlet.WebScriptPortlet</portlet-class>
<init-param>
<name>authenticator</name>
<value>webscripts.authenticator.jsr168.webclient</value>
</init-param>
<init-param>
<name>scriptUrl</name>
<value>/alfresco/168s/ui/doclist</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-info>
<title>Document List</title>
<short-title>Document List</short-title>
</portlet-info>
</portlet>
<portlet>
<description>My Spaces</description>
<portlet-name>AlfrescoMySpaces</portlet-name>
<portlet-class>org.alfresco.web.scripts.portlet.WebScriptPortlet</portlet-class>
<init-param>
<name>authenticator</name>
<value>webscripts.authenticator.jsr168.webclient</value>
</init-param>
<init-param>
<name>scriptUrl</name>
<value>/alfresco/168s/ui/myspaces</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-info>
<title>My Spaces</title>
<short-title>My Spaces</short-title>
</portlet-info>
</portlet>
<portlet>
<description>My Web Forms</description>
<portlet-name>AlfrescoMyWebForms</portlet-name>
<portlet-class>org.alfresco.web.scripts.portlet.WebScriptPortlet</portlet-class>
<init-param>
<name>authenticator</name>
<value>webscripts.authenticator.jsr168.webclient</value>
</init-param>
<init-param>
<name>scriptUrl</name>
<value>/alfresco/168s/ui/mywebforms</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-info>
<title>My Web Forms</title>
<short-title>My Web Forms</short-title>
</portlet-info>
</portlet>
<portlet>
<description>My Web Files</description>
<portlet-name>AlfrescoMyWebFiles</portlet-name>
<portlet-class>org.alfresco.web.scripts.portlet.WebScriptPortlet</portlet-class>
<init-param>
<name>authenticator</name>
<value>webscripts.authenticator.jsr168.webclient</value>
</init-param>
<init-param>
<name>scriptUrl</name>
<value>/alfresco/168s/ui/mywebfiles</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-info>
<title>My Web Files</title>
<short-title>My Web Files</short-title>
</portlet-info>
</portlet>
<user-attribute>
<name>user.home-info.online.email</name>
</user-attribute>
</portlet-app>
Semua file .xml tersebut diletakkan di $Alfesco_home/WEB-INF/
11. Compress file alfrsco yang tadi kita ekstrak menjadi file alfresco.war dengan perintah jar -cvf alfresco.war *
12. Selanjutnya letakkan file alfresco.war yng baru saja kita buat di $Lifray_Home/deploy
Coba jalankan liferay kita, jika tidak ada masalah, portlet Alfresco akan muncul di Liferay di menu Add Component liferay kita.
Selanjutnya tinggal custom deh..
