KS 1.1 Integration into an Existing Portal
1 Overview
We are introducing two ways to integrate KS with an existing portal:
- Binary integration : for those who just want to deploy KS in their portal
- Source integration : for those building a custom product
This tutorial shows how to deploy KS 1.1 applications into an eXo product based on portal 2.5. If you need to deploy on another basis, the steps should be similar, provided you take care of
Dependencies
2 Binaries Integration
If you don't want to build KS from sources, you can simply get the binaries and integrate to your existing portal installation.
2.1 Prerequisites
Make sure your portal installation is binary compatible with your version of KS.
KS 1.1 is based on Portal 2.5 So any product based on portal 2.5 should be compatible with KS 1.1.
2.2 Deploy KS Artifacts
- Copy war files from KS to .../webapp in your bunble :
- forum.war
- faq.war
- ksResources.war
- Copy jar files from KS to ../lib in your bundle :
- exo.ks.eXoApplication.common-1.1.jar
- exo.ks.eXoApplication.faq.service-1.1.jar
- exo.ks.eXoApplication.forum.service-1.1.jar
- exo.ks.web.webservice-1.1.jar
2.3 Add KS Configuration
- Copy ks folder from .../webapp/portal/WEB-INF/conf in KS to the same place in your bundle
- Import KS configuration into .../webapp/portal/WEB-INF/conf/configuration.xml in your bunle
<import>war:/conf/ks/jcr-component-plugins-configuration.xml</import>
<import>war:/conf/ks/ks-plugins-configuration.xml</import>
Alternatively, you can externalize these files as explained in
this article
2.4 Add apps
Now you can add the apps to your portal pages :
- Import apps in Application Registry
- Install them on any page of your portal
2.5 Restart
Restart tomcat.
3 Sources Integration
If you have a custom product built from eXo sources, you may want to add KS applications to your product.
3.1 Prerequisites
The idea here is to use
Exo Build to build and deploy a custom product.
So, make sure you have a working ExoBuild environment. Read
Building from sources to learn how to setup eXoBuild.
The KS version used for this tutorial is 1.1, but maybe work for the earlier versions
3.2 Update Product Build
You need to add the following KS artifacts in your product exbuild descriptors :
- forum.war
- faq.war
- ksResources.war
- webservice.jar
- common.jar
In tools project, add to your
modules/XXX/YYY/module.js file, where
XXX is your project and
YYY is the version as the following code:
var ksversion = "1.1" ;
module.eXoApplication = {};
module.eXoApplication.common = new Project("org.exoplatform.ks", exo.ks.eXoApplication.common","jar",module.version) ;
module.eXoApplication.faq =
new Project("org.exoplatform.ks", "exo.ks.eXoApplication.faq.webapp", "war", module.version).
addDependency(new Project("rome", "rome", "jar", "0.8")).
addDependency(new Project("jdom", "jdom", "jar", "1.0")).
addDependency(new Project("org.exoplatform.ks", "exo.ks.eXoApplication.faq.service", "jar", module.version));
module.eXoApplication.faq.deployName = "faq";
module.eXoApplication.forum =
new Project("org.exoplatform.ks", "exo.ks.eXoApplication.forum.webapp", "war", module.version).
addDependency(new Project("org.exoplatform.ws", "exo.ws.frameworks.json", "jar", "1.3.1")).
addDependency(ws.frameworks.cometd).
addDependency(new Project("org.exoplatform.ks", "exo.ks.eXoApplication.forum.service", "jar", module.version));
module.eXoApplication.forum.deployName = "forum";
module.web = {}
module.web.ksResources =
new Project("org.exoplatform.ks", "exo.ks.web.ksResources", "war", module.version) ;
module.web.webservice =
new Project("org.exoplatform.ks", "exo.ks.web.webservice", "jar", module.version);
Then declare deployment dependencies to your product assembly descriptor
products/XXX/YYY.js
var ks = Module.GetModule("ks/tags/1.1", {kernel : kernel, core : core, ws : ws, eXoPortletContainer : eXoPortletContainer, eXoJcr : eXoJcr, portal : portal});
product.addDependencies(ks.eXoApplication.forum) ;
product.addDependencies(ks.eXoApplication.faq) ;
product.addDependencies(ks.eXoApplication.common) ;
product.addDependencies(ks.web.ksResources) ;
product.addDependencies(ks.web.webservice) ;
3.3 Adjust Your Pom
To make sure KS product is compiled with your project, add the following to your project's
pom.xml :
<org.exoplatform.ks.version>1.1</org.exoplatform.ks.version>
3.4 Add KS Configuration
- Copy KS configuration files to your portal project's WEB-INF folder.
Copy the KS folder from
KS/tags/1.2/web/ksportal/src/main/webapp/WEB-INF/conf/ks to
XXX/YYY/web/portal/src/main/webapp/WEB-INF/conf/ks
- Import KS configuration files in WEB-INF/conf/configuration.xml :
<import>war:/conf/ks/jcr-component-plugins-configuration.xml</import>
<import>war:/conf/ks/ks-plugins-configuration.xml</import>
3.5 Edit Portal Configuration
This step is not mandatory as you can very well do it manually as described in
binary integration.
You may want to add a page for each application and add those pages in your navigation.
For exemple, to add the apps to the classic portal public pages, you should complete the following steps:
- Add pages in XXX/YYY/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/classic/pages.xml
<page>
<page-id>portal::classic::forum</page-id>
<owner-type>portal</owner-type>
<owner-id>classic</owner-id>
<name>forum</name>
<access-permissions>Everyone</access-permissions>
<edit-permission>*:/platform/administrators</edit-permission>
<application>
<instance-id>portal#classic:/forum/ForumPortlet/forum</instance-id>
<title>Forum Portlet</title>
<show-info-bar>false</show-info-bar>
<show-application-state>false</show-application-state>
<show-application-mode>false</show-application-mode>
</application>
</page>
<page>
<page-id>portal::classic::faq</page-id>
<owner-type>portal</owner-type>
<owner-id>classic</owner-id>
<name>faq</name>
<access-permissions>Everyone</access-permissions>
<edit-permission>*:/platform/administrators</edit-permission>
<application>
<instance-id>portal#classic:/faq/FAQPortlet/faq</instance-id>
<title>FAQ Portlet</title>
<show-info-bar>false</show-info-bar>
<show-application-state>false</show-application-state>
<show-application-mode>false</show-application-mode>
</application>
</page>
- Add navigations in XXX/YYY/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/classic/navigation.xml
<node>
<uri>forum</uri>
<name>forum</name>
<label>#{portal.classic.forum}</label>
<page-reference>portal::classic::forum</page-reference>
</node>
<node>
<uri>faq</uri>
<name>faq</name>
<label>#{portal.classic.faq}</label>
<page-reference>portal::classic::faq</page-reference>
</node>
- Edit menu labels in resource bundles in XXX/YYY/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/portal/classic_en.properties
portal.classic.forum=Forum
portal.classic.faq=Faq
3.6 Customize FCKEditor Configuration
- Copy FCKeditor configuration files to your portal project's webapp
Copy the exo folder from
ks/tags/1.1/web/ksportal/src/main/webapp/fckeditor/exo to
XXX/YYY/web/portal/src/main/webapp/fckeditor/
- Edit your fckconfig.js file and add:
FCKConfig.CustomConfigurationsPath = '../exo/exoconfig.js' ;
3.7 Build and Deploy
exobuild --product=XXX --version=YYY --update --build --deploy
Now start from
exo-tomcat/bin