ServiceNow connector deployment guide 1.0.0.0

Difference Between the Liferay 6.2 and Liferay 7/DXP

  1. Basic Difference Between the Liferay 6.2 and Liferay 7/DXP

Sr.No

Parameters

Liferay 6.2

Liferay 7/DXP

1.

Modularity Development

Liferay 6.2 partially support and it’s an experiment and it need more effort to achieve the modularity.

Liferay 7 support modularity development using OSGi framework.

2.

Bootstrap Version

Support Bootstrap 2 UI framework.

Liferay 7 support Bootstrap 3 UI framework.

3.

AUI Version

AUI 2.x components are used.

AUI 3.x components are used.

4.

Application Development

Liferay Application Development based on Plugins.

Liferay Application Development based on OSGi bundles.

5.

Enterprises Editions name

We simply call Liferay 6.2 EE or CE

Liferay 7 EE called Liferay DXP

6.

Application Packaged method

Liferay Applications packaged as war files and deployed in traditional application server.

Liferay Applications packaged as OSGi bundle jar files and deployed in OSGi container. It support WAR deployment as well.

7.

Isolation

Liferay 6.2 core portal and its default portlets all available in ROOT directory and deployed in Application Server.

Liferay 7 separate core portal and its default portlets. Core portal only have core features rest of features made it as portlets and packaged as bundles. Core portal files in ROOT directory deployed in Application Server. All portlet bundles available in data/OSGI directory. It means bundles deployed in OSGi container.

8.

Search Engine

Liferay 6.2 in built search engine is Apache Lucene. Liferay 6.2 have SOLR web to enable SOLR search.

Liferay 7 inbuilt search engine Elastic Search. It support SOLR search as well.

9.

Single Page Application

Liferay 6.2 does not have inbuilt Single Page Application support but we can integrate SPA framework to achieve it.

Liferay 7 have Single Page Application inbuilt support using Senna.js

10.

Build tools Support

Liferay 6.2 support MAVEN, ANT.

Liferay 7 support MAVEN, GRADLE build tools.

11.

Application development tools.

Liferay 6.2 have Plugins SDK Command Line Interface to create portlet, hook, theme and layout.

Liferay 7 introduce new tool called BLADE CLI to develop Liferay 7 Application as bundles. Internally its uses the Build tools GRADLE flavor.

12.

Activate/Deactivate Application

Liferay 6.2 it is not possible. We should un-deploy the plugins from the server so that we can remove the unused features.

We can activate/deactivate Liferay Application Bundles simply using Apache Gogo shell Command Line Interface without un-deploy the bundle from the container.

13.

Languages For UI

Liferay 6.2 does not have design languages like Clay and Lexicon. But it supports all necessary UI Languages like HTML, CSS, Bootstrap, JQuery, Alloy-UI etc

Liferay 7 have introduced Clay and Lexicon language to design UI. Lexicon is a design language that provides a common framework for building interfaces. Clay is web implementation of Lexicon.It’s built with HTML, CSS, and Javascript with Bootstrap as a foundation

14.

Flexibility

Not So flexible environment, we need to perform code changes for any single change. like We cannot deactivate default portlets without change in the code.

Provide more flexible environment like We can easily deactivate default portlets if we are not using. We simply deactivate portlet bundle.

 

 

 

ServiceNow connector deployment guide 1.0.0.0

Liferay Service Builder – Connect to External/Seperate Database

  • Create a  Liferay plugin project
  • Create a service.xml , ex like below.


<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE service-builder PUBLIC “-//Liferay//DTD Service Builder 6.2.0//EN” “http://www.liferay.com/dtd/liferay-service-builder_6_2_0.dtd”>
<service-builder package-path=”com.dinacs” auto-namespace-tables=”false”>
<author>vishnu</author>
<namespace>dinacs</namespace>
<entity name=”Feedback” local-service=”true” remote-service=”true”>

<column name=”feedbackId” type=”long” primary=”true” />

<column name=”feedbackTitle” type=”String” />
<column name=”feedbackText” type=”String” />
</entity>
</service-builder>

  • Build the service
  • Add your separate database details in portal-ext.properties ex like below.

# liferay default db
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=root

# seperate database
jdbc.dinacs.driverClassName=com.mysql.jdbc.Driver
jdbc.dinacs.url=jdbc:mysql://localhost/dinacsdb?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.dinacs.username=root
jdbc.dinacs.password=root

  • Create ext-spring.xml file under docroot/WEB-INF/src/META-INF
  • Place the content like below in ext-spring.xml

<?xml version=”1.0″?>

<beans xmlns=”http://www.springframework.org/schema/beans”
xmlns:aop=”http://www.springframework.org/schema/aop” xmlns:context=”http://www.springframework.org/schema/context”
xmlns:tx=”http://www.springframework.org/schema/tx” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=”http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd”>

<bean id=”basePersistence” abstract=”true”>
<property name=”dataSource” ref=”dinacsDS” />
<property name=”sessionFactory” ref=”dinacsSessionFactory” />
</bean>

<bean id=”dinacsHibernateSessionFactory”
class=”com.liferay.portal.spring.hibernate.PortletHibernateConfiguration”
lazy-init=”true”>
<property name=”dataSource” ref=”dinacsDS” />
</bean>

<bean id=”dinacsSessionFactory” class=”com.liferay.portal.dao.orm.hibernate.SessionFactoryImpl”
lazy-init=”true”>
<property name=”sessionFactoryImplementor” ref=”dinacsHibernateSessionFactory” />
</bean>

<bean id=”dinacsDS”
class=”org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy”>
<property name=”targetDataSource”>
<bean class=”com.liferay.portal.dao.jdbc.util.DataSourceFactoryBean”>
<property name=”propertyPrefix” value=”jdbc.dinacs.” />
</bean>
</property>
</bean>
</beans>

  • Edit the service.xml and add data-source , session-factory and tx-manager attributes to the entity tag.
  • Ex like below.

<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE service-builder PUBLIC “-//Liferay//DTD Service Builder 6.2.0//EN” “http://www.liferay.com/dtd/liferay-service-builder_6_2_0.dtd”>
<service-builder package-path=”com.dinacs” auto-namespace-tables=”false”>
<author>vishnu</author>
<namespace>dinacs</namespace>
<entity name=”Feedback” local-service=”true” remote-service=”true” data-source=”dinacsDS” session-factory=”dinacsSessionFactory” tx-manager=”dinacsTransactionManager” >

<column name=”feedbackId” type=”long” primary=”true” />

<column name=”feedbackTitle” type=”String” />
<column name=”feedbackText” type=”String” />
</entity>
</service-builder>

  • Build the service again.
  • Deploy the portlet.


Note : tables will be created in the liferay default database only , need to manually create the tables in separate database.

ServiceNow connector deployment guide 1.0.0.0

Integrating Solr Search Engine with Liferay portal

Step 1: Setting up Solr server

1.1 download solr 4.3.1 from http://archive.apache.org/dist/lucene/solr/4.3.1/
1.2 Unzip it and navigate to solr-4.3.1\example and double click on start.jar
1.3 browse localhost:8983 and verify solr is up and running

Step 2: Install Solr 4 search Engine plugin on Liferay  Portal

2.1 Copy solr plugin war file to deploy folder (liferay.home/deploy)

Step 3 : Integrating Liferay Portal With Solr

Change the solr url as follows in solr-spring.xml which is located in liferay.home/tomcat/webapps/solr-web/WEB-INF/classes/META-INF/
Set the value of constructor-arg from

<bean id=”solrServer”
class=”com.liferay.portal.search.solr.server.BasicAuthSolrServer”>
<constructor-arg type=”java.lang.String” value=”” />
</bean>
to this :
<bean id=”solrServer”
class=”com.liferay.portal.search.solr.server.BasicAuthSolrServer”>
<constructor-arg type=”java.lang.String” value=” http://${solr.host.domain}:${solr.port.number}/solr” /> </bean>
</bean>

Step 4: Restart Liferay and solr servers.

ServiceNow connector deployment guide 1.0.0.0

Integrating OKTA SSO With Liferay Portal Using SAML

1 : Installing SAML Plugin on Liferay Portal.

1.1 Download and Copy saml plugin war file to deploy folder (liferay.home/deploy)

If you do not have saml plugin war file.

1.1 Login to the Liferay portal as admin and go to the control panel
1.2 Click on apps and then purchased tab.
1.3 In purchased tab click on EE.
1.4 Search for SAML 2.0 and click on install.

2 : Creating Chicklet in OKTA For Liferay , We can create developer okta account for this trial.

2.1 Get the service provider url (liferay sp) . ex http://your domain or ip /c/portal/saml/acs
2.2  Create Okta Chicklet with following details
service provider url ex: http://your domain or ip /c/portal/saml/acs
Audience restriction ex : Liferay
Okta Metadata file : save it in xml and put it in the liferay.home/data/ directory

3: Creating keystore

Create keystore in the liferay.home/data/ directory using below command
keytool -genkey -keyalg RSA -alias Dinacs -keystore keystore.jks -storepass dinacs-validity 360           -keysize 2048

Enter the details and keep alias password as same as the keystore password.
It creates keystore.jks file in the liferay.home/data directory.

4:  Modify portal-ext.properties file

Navigate to liferay.home and open portal-ext.properties file .
Add below entries to the file and save it.

##
## SAML
##
# Enable SAML Plugin
saml.enabled=true
# Set the role to sp on the Service Provider side
saml.role=sp
# Set the SAML entity id, it matches the alias we used to setup the keystore
saml.entity.id=Dinacs
# The metadata location for Identity Provider
saml.metadata.paths=${liferay.home}/data/OktaMetadata.xml
#
# Keystore
#
# keystore type
saml.keystore.type=jks
# location of the keystore
saml.keystore.path=${liferay.home}/data/keystore.jks
# pwd for accessing the keystore
saml.keystore.password=dinacs
# pwd for accessing the certificate of the entity in the keystore
saml.keystore.credential.password[dinacs]=dinacs
#
# Service Provider
# the chicklet url from okta
saml.sp.default.idp.entity.id=http://www.okta.com/ – your idp url
saml.sp.sign.authn.request=true
saml.sp.assertion.signature.required=false
saml.sp.clock.skew=3000
saml.sp.session.keepalive.url=http://your ip or domain :8080/c/portal/saml/idp/keepalive
# Service Provider user attribute mappings
saml.sp.user.attribute.mappings=UserName=emailAddress\nFirstName=firstName\nLastName=lastName
#Set this to true to enable reminder queries that are used to help reset a user’s password.
users.reminder.queries.enabled=false
# auto generate screen names
users.screen.name.always.autogenerate=true

Step 5: Restart Server and Test SSO

Hit your liferay url and if you are not logged in then it will redirect you to the okta login page , after entering login credentials , Okta will redirect back to the liferay . User will be created in the liferay portal and will see it logged in.