Pages

Monday, 8 July 2013

What is a Portlet??

Portlet





Wednesday, 3 July 2013

What is Portal

Portal
  • A Portal is generally defined as a software platform for building websites and web applications. 
  • Modern portals have added multiple features that make them the best choice for a wide array of web applications.

Sothat we can use a Portal as a 

1.Web Platform

2.Integration Platform
3.Social Office
4.Collabration Platform
5.Web Content Management Platform

For more description refer this link:

http://www.liferay.com/products/what-is-a-portal/web-platform




What is Liferay Portal???

Liferay Portal



It is distributed in two different editions:
  • Liferay Portal Community Edition — A version with the latest features and support through the active community.
  • Liferay Portal Enterprise Edition — A commercial offering that includes services including updates and full support. This release goes through additional quality assurance cycles and is usually available around 1 or 2 months after the Community Edition and comes under a non-free license.
Liferay comes with certain portlets preinstalled.[20] These comprise the core functionality of the portal system. They include:
  • Alerts and Announcements
  • Alfresco, Documentum, and other document library integration
  • Asset Publishing
  • Blogs and blog aggregation
  • Breadcrumbs
  • Calendar
  • Chat
  • Document and Image management
  • Document Library Manager, Recent Documents
  • Image Gallery
  • Knowledge Base
  • LDAP Integration
  • Mail
  • Message Boards
  • Nested Portlets
  • Page Ratings & Flags
  • Polls
  • Site Map
  • Site Navigation
  • Social Equity
  • Software Catalog
  • Tags and Categories
  • Themes, supporting Velocity and FreeMarker markup
  • User Directory
  • Web Content
  • Web Form Builder
  • WebDAV Integration
  • Website Tools
  • Wiki (supports Creole as well as MediaWiki syntax)

for more reference go this link

Thursday, 27 June 2013

What is View and Edit Mode in Liferay Portlet?

View mode is what is displayed a user logs in to the liferay portal and various portlets are displayed to him.

Edit mode is the configuration options that are displayed when the edit button is clicked on the portlet.

Difference between Liferay Hook and Ext plugins

Hook:
Hooks is a feature to catch hold of the properties and JSP files into an instance of the portal as if catching them with a hook. Hook plugins are more powerful plugins that come to complement portlets, themes, layout templates, and web modules. A hook plugin is always combined with a portlet plugin. For instance, the portlet social-portlet is a portlet plugin for Social Office with hooks. In general, hooks would be very helpful tools to customize the portal without touching the code part of the portal. In addition, you would use hooks to provide patches for the portal systems or social office products.
source:Liferay Portal 6 Enterprise Intranets
EXT:
EXT is used to customize and extend the Liferay portal. EXT builds a new ROOT webapp and replaces by a huge build mechanism your existing Liferay portal.
The Liferay EXT Environment is where you would ideally make changes to the portal itself. In other words, this is where you customize or “extend” the portal. You may ask, “Why can’t we just make the changes to the portal source directly?” The answer is that you technically CAN, but if and when you have to upgrade, you will have a tough time sorting out what is out-of-the-box and what is customized. EXT Environment keeps things separate.



Hooks Plugins
Ext Plugins

Hook Plugins are used to customize or override the default behavior of liferay in the form of properties and jsp files.

Ext Plugins are used to customize and extend the Liferay Portal.i.e almost customize everything.
Nothing but we can create new Root Web app.
Using Hooks we can override
a).Event Handlers(Application startup events,Login events,Service Events).
b).Language Bundles.
c).Jsp files(either portal or portlet folder).
d).Model Listners.
e).Services.
Using Exts we can customize
a).portal-impl as ext-portal-impl.
b).portal-service as ext-portal-service.
c).util-bridges as ext-portal-utilbridges..
d).util-java as ext-util-java.
e).util-taglib as ext-taglib.
f).web as ext-portal-web.

These are recommended way of extension and maintaince easy.

These are recommended when there is no way of implementing required functionality  using hooks.

Hot deployable

Not hot deployable and server must restart

Combine with other plugins like portlets.

These are some difficulty and customize almost everything.



What is the flow of http request in Liferay

Flow of Request in Liferay:-


Browser » App Server (eg Tomcat) » Liferay(Main Servlet) » layout (Database Table of Liferay) 

>>Creates and construsts Theme display object » Page Layout » Portlets » portlet.vm » portal_normal.vm » HTML


1).When a url is request by browser, the application server (Tomcat or any other server running Liferay) handles the request and forwards it to Liferay(MainServlet in portal.jar). and then creates and construts themedisplay object which contain all the various configuration parameters and values
2). From the request URL Liferay get the ‘page’ that is requested. This page is searched for the corresponding record in table ‘layout’ to check the page layout.
3). From page layout the portlets on pages is retrieved. The portlets are processed and out is placed in ‘portlet.vm’. This velocity file with parsed data is set in page layout to construct the whole page and output is then set to ‘portal_normal.vm’. 
4).Finally ‘portal_normal.vm’ is converted to HTML that is presented to the user.

For Breif Discussion in depth.

Many time we think like when we hit a url in browser what is the intermediate class by which request comes to our class. Below steps describes the flow of a browser request thru the Liferay code from request of the page, all the way down to rendering an individual portlet: 
  1. The initial request comes into the portal server from the browser, and hits the service() method of the class com.liferay.portal.servlet.MainServlet. Here, a variety of objects are created and added to the request for use by code downstream (such as company Id, user objects, etc.)
  2. Code passes through the servicePre() method of the class com.liferay.portal.events.ServicePreAction. Here is where the ThemeDisplay object is created and populated for downstream code use.
  3. The theme infrastucture code will call into the class com.liferay.taglib.util.ThemeUtil to render the content of a theme. It will call either the mehod includeJSP() to include JSP rendered content, or includeVM() to include Velocity rendered content.
  4. When using a Velocity based theme, the request will flow thru the class com.liferay.portal.velocity.VelocityVariables and the method insertVariables(). That method is where various Velocity variables for use by the theme system is added to the Velocity context.
  5. For each column in the page's layout, the PortletColumnLogic class processes each portlet using the processContent() method. In this method, the HTML that surrounds every portlet is generated. Further processing is then delegated to the RuntimePortletUtil via the processPortlet() method. Then on to the actual rendering...
  6. An individual portlet is rendered by the render_portlet.jsp code located (in Tomcat) in the webapps/ROOT/html/portal directory. This JSP is called to render each portlet on the page. Debug code can be added to this file to see exactly what is going on just before and just after the code in your custom portlet is executed.
  7. As will be found by looking through the JSP code, render_portlet.jsp uses InvokerPortletImpl's render() method to render portlets. The primary function of this method is to check if a portlet's expiration-cache has been set or has expired. If the expiration-cache has been set, InvokerPortletImpl then checks whether the portlet's most recently cached content is fresh enough to use.


Reference Link - See more at: http://www.opensourceforlife.com/2011/11/browser-request-thru-liferay-code.html#sthash.SJfqpfkZ.dpuf

Friday, 21 June 2013

What is the difference between application server and web server?


ApplicationServer: takes care of Security, Transaction, Multithreading, Resource pooling, load balancing, clustering, performence, highly availability, scalability, etc. Exposes business logic to client applications through various protocols, possibly including HTTP. Supports deployment of .war and .ear filesApplication server = webserver + EJB container.

Webserver: handles HTTP protocol. Receives HTTP request, it responds with an HTTP response.