August 16, 2016

Know Module And Component

The main reason for LIFERAY to move into module framework is,

  • Creating small modules (Tightly coupled)
  • Publish and consume other modules features (Inflexible)
  • Working without static dependencies (Dynamic dependencies)
To use module framework,
You mainly need to understand below 3 concepts :
  1. Modules
  2. Components
  3. Application Lifecycle 






Module:

Module is something which is group of Java classes, other optional resources, and a MANIFEST.MF file, packaged together as into a  single JAR file. Liferay 7 uses three modules/bundles.
Modules can have multiple components.

Component:

Component is nothing but implementation of interface like the way we were doing with *LocalServiceImpl class in older fashion. So here what you need to do is, you just will have to load components through annotations in implementation class.These loaded/declared components would be part of modules.

Here Lifecycle of modules and component will be handled through Liferay's OSGi based module framework.

What is OSGi ?

OSGi :  Open Service Gateway Initiative

OSGi is architecture to develop and deploy a modules in modular (Some times refers as Micro Services) application.
OSGi containers such as knopflerfish, Equinox and Apache Felix are responsible to divide and load your modules dependencies.

OSGi Specifications:
=> Set of services that OSGi container implements
=> Contract between your application and container

Benefits to use OSGi:

  • Easier to manage dependencies across module or plugin level
  • And the most interesting feature is,Modules can be installed and uninstalled during running server itself and no need to bounce the server.
  • module versionoing will helpful developers to reduce/stop class conflict for individual version of modules
  • Deployment would be quit easy once you understand the build and deployment process through blade tool
  • Service contract are loosely coupled. It means, services can be publish and consume from service registry.
  • Its very fast due to small and secure with small package/bundle.
  • One more interesting stuff here is, during development you dont need to be dependent on Liferay SDK untill and unless your module or individual project follows Liferay's OSGi standards.
  • In-short, this new framework will give very good flexibility to developer for the development and will increase productivity as well.
  • All application servers supports OSGi modules

July 22, 2016

Sharepoint REST API call



Guys, I am sure this snippet will help you a lot when you do sharepoint REST integration to read files

March 30, 2016

Useful Roles and permission API

Reading portlet resources and model resources:
<pre>
List<String> portletResources = ResourceActionsUtil.getPortletResourceActions(PortletLocalServiceUtil.getPortletById(portletId).getPortletId());

List<String> modelResource = ResourceActionsUtil.getPortletModelResources(portletId);
</pre>

March 9, 2016

OpenAM (OpenSSO) + Liferay 6.2

We are starting OpenAM integration by considering we have setup OpenDJ with Liferay. See http://www.liferaysolution.com/2016/03/opendj-liferay-62.html

Install OpenDJ

1) Download OpenAM-11.0.0.war from https://backstage.forgerock.com/#!/downloads/OpenAM/OpenAM%20Enterprise/11.0.0/OpenAM%2011#list

2)  You can deploy this war file in the same tomcat where your liferay is runinng or you can deploy in separate tomcat server (apache-tomcat-7.0.68). My recommendation is , use separate tomcat server for that

3) For our comfort, rename war file from OpenAM-11.0.0.war to OpenSSO.war and start tomcat server for deployment

4) Once it's deployed into tomcat, you can access it through  http://jignesh.openam.com:7070/OpenSSO. Here jignesh.openam.com:7070 is the host name which i configured for newly installed tomcat server.
Also make sure that server have enough JVM memory allocation using below line in startup.bat
set JAVA_OPTS=-Dfile.encoding=UTF-8 -Xms128m -Xmx1024m -XX:PermSize=64m -XX:MaxPermSize=256m