Monday, January 20, 2014

Introduction to Web Applications Part-II

Introduction:

We already know web application can be categories into two types
  1. Static web applications
  2. Dynamic Web Applications

Go through following links to web application introduction part  I


Static Web Applications

A static web application deliver response to user what exactly stored in server. The response is always same for all users when they requested to server. It means static html pages, pdf files and images.

These resources are available in server so that when the user requested to server and the server will serve as response. The user will be requested as simple http request to the server so that server will serve the static recourses as response. To handle request and manage these recourse we will use web server.

What is web server?

A web server is server to handle or process the http request and serve the response to the end users.

We already know http request is simple URL and it will ask the web server for response on behalf of user.

The popular web server in the market is Apache Web Server. In the world most of the web servers are Apache Web servers


For example we will request for one html page that html page contains the company information.


When we send above request to the web server it will always give the static data which is presented in requested html page. It means the response data always same for all user requests.
.

The following is more information about Apache Http server


The final bottom line is static web applications always serve same response to users and to manage these static web applications we will use web servers.

Dynamic Web Application

Dynamic web application serves the response based on user demand and the response is varying based on user request.

It will generate dynamic response to end user when they request to the server. Here http request is same but based on user the content/data will be changed.

For example it will use same resource for every request but the resource will be generating the dynamic content based on user request.

We can assume we want employee information and for this each request we call same resource but it will give different employee information


If we observe above request, based on employee Id we will get different employee information but each time it will execute same resource in server.

The following diagram shows the web application in server


In above diagram user send the request to get employee information and server execute same resource and that recourse get employee data from information system and give response back to the user.

Who will produce Dynamic Response?

In dynamic web applications to produce dynamic response we need special kind of resources and these resources are called helper applications.

Helper application are kind of recourses will be executes in server to prepare dynamic response. To execute helper applications we need containers.

Helper application is server side technology to produce dynamic response based on users demand.

What is container?

Containers are managing helper applications it means it will process helper application to produce dynamic response. Processing of helper application is like execution of helper applications.

Containers are responsible for managing liferay cycle of helper application when they producing dynamic response. The example for helper application in Java is servlet

Servlet is helper appellation or server side component to produce dynamic request to the user.
To execute servlet we need servlet container. The servlet container is responsible for execution of servlet or manages the life cycle of servlet when they produce dynamic request.

We have different containers in java like servlet container, EJB container and JMS container.
Static Web application can be served by Web servers but dynamic applications cannot so that dynamic web application needs application servers.

What is Application Server?

Application server is like web server to handle http request besides that it will also manage the dynamic applications.

We already know to execute dynamic application we need containers. Application server has ability to integrate with many containers like servlet, EJB and JSM containers.

Application server is used to manage dynamic web application.

We already know we need helper application or servlet to process dynamic request. To produce dynamic response it will use some information system for getting the data. Those information systems are like databases.

Servlet need database to produces dynamic response. The response is in the form of browser understandable language that is html.

Servlet can produce response in the form of HTML or other formats like text, images and files formats but all these formats should understand by browser.

Note:

In the real environment we will use combination of Web server and Application Server

General Request flow in Dynamic Web application
  • The user/client sends the request to the server.
  • Server will identify the request whether it is dynamic request or static request.
  • If static request then web server handle the request means it will process request and produces the response.
  • If dynamic request then web server delegates the request to helper application so that helper application processes the dynamic request and it will generate the response. Helper application will take the container help to produce the response.
  • The response will give to the web server and web server is responsible to send response to client.

The following diagram depicts the flow of dynamic request.



In java we will use servlet to process dynamic request and we use servlet to build dynamic web applications.

What is servlet?

Servlet is server side technology to produce dynamic response. Servlet will be executed in servlet containers when they produce dynamic response. Servlet container will manage the lifecycle of servlet.

Important Points
  • We have two different kinds of web applications static and dynamic.
  • Static application will be managed by web servers and dynamic applications are managed by application server.
  • To produce dynamic response we need helper applications and these helper application need container to execute and produce response.
  • Helper application is server side technology and example in java is servlet.
  • Application server has ability to accommodate different container like servlet, EJB and JMS containers.
Related Articles



Author
Liferay Top Contributor Award Winner

Wednesday, January 15, 2014

Introduction to Web Applications Part-I

Introduction:

A web application is set of resources which will be available in universally. Resources are like files, images and any data which is informative.

Each web application has its own unique location in the internet so that we can access the web application.

To represent any web application in internet we will use domain or IP address this is called address of application. This address is unique in the web world or internet which gives you the destination point of web application.

When we talk about web application we need to consider two things that are Server and Client.
As we know web application have destination point these destination point is server. Server is one kind of software which manages the web application. A client is requesting for server to get response from server.

Web application is implemented by Client Server Architecture.

Client Server Architecture:


Client server architecture is working based on request and response mechanism. Client is always request for the server to get response. The response is like file, images or data.
We know response is generated by server and request is send by client.

What is client in real world?

In internet world a client is software which is able to send request to the server. Once it gets server response it should able to view the response to real world. Here we can say client is able to view the response and response consist of images, files and data.

In web application world a client is web browser. We are very familiar with web browser so some web browsers like Internet Explorer, Mozilla Fire Fox and Chrome.

So the bottom line is client is web browser that can send request to server and it can view the service response to out side world.

What is server in real World?

A server is also software which manages the web application that means it is managing resources. It is always serving the response to the client when client sends request to server. We have many servers in real world like Apache server, Tomcat Server and JBoss server.

Well we understand server and client.

Client Server Communication

We are talking client sends request and serve will give the response to client. How the request will be sent to server and how response will be reached by client.

We need a language that should communicate client and server. That language should understand by both server and client.

This language is called HTTP. Http is mechanism which will used to communicate client and server.

Hyper Text Transfer Protocol (http) is making the communication between client and server and it has some set of rules that will be followed by client and server.

In the real world http is like URL it represent the client request. Http can understand by only client that’s web browser and server.

Whenever client needs some resource or data it will send his request in the form of URL. This URL request can be understand by server so that it will send required response to the client based on what client is looking for.

Each URL request has some parameters these parameters will be decide what kind of response should be generated by server.

How client can display response?

In web world client is web browser how do browser can view the server response, here we need some specialize language that should be understand by browser the language is called HTML.
HTML is way of view the response in browser. The browser can understand only one language called Hyper Text Markup Language (HTML) so that server which is going to send to the browser should be HTML format.

Apart from HTML browsers can display different format data like images, PDF and some file formats. The default response format is always HTML format.

What is HTML?

HTML is specialize language for web browsers. It is tag based language it have many tags to display data in browsers.

The more about HTML go through following link


Html is just tag based language it only show the content in the page but if we want perform some actions or events in the browser it will use another language that is called scripting language.
Scripting languages are specialize languages for browser so that  we can perform some actions and events in the web page.

Java Script is very popular scripting language for the web browsers.

The following link will give more information about java script


We already know HTML can view the response in browser to real world people. The data which we displayed in the browser need some styles or colors so that it will be better look and feel to people.

To make content beautiful in the browser we need some other language that is called Cascading Style Sheets (CSS)

CSS will give better look and feel to the data so that I will be attractable.

The following is more about CSS


The bottom line is the response is in the form of HTML and html data need some other languages support to make content beautiful and perform some action in browser for this reason we need another languages like CSS and Java Script.

Well we have good understanding about web application and it working in real world.

In real world web application can categorized in two types
  1. Static Web Applications
  2. Dynamic Web Applications
We will discuss more in the next part of my articles

Author

Monday, January 13, 2014

Introduction to Liferay Portal

Liferay is Portlet technology which follows the JSR 168 and JSR 286 Compliants.

Liferay is very good open source for portlet technology have very good working group and community.

Portlet technology is similar to servlet technology but portlet is small part of dynamic content in web page.

In normal web application when we send request then server serve the response to the client or browser. Here entire page will be served by one response.

Coming to portlet technology in one web page there may be many portlets and each portlet have its own request and response.

Each portlet can send request and get the response from server then the response belongs to only the portlet which send the request.

We can say portlet is small fragment of dynamic content in the page. Page is aggregation of multiple fragments of dynamic content and each dynamic fragment is managed by one portlet in the web page.

In one page we can accommodate multiple portlet and each portlet is responsible for generate dynamic content for page. Multiple portlet together generate the dynamic content and all the portlet dynamic content aggregation will be generated as one web page.


Liferay

Liferay is implemented portlet technology and it exposed as opens source.

Liferay portlet technology  follows the JSR 168 and JSR 286 Compliant which was given by java community people. Portlet technology should follow the JSR portlet specification.

Like that liferay have implemented portlet specification and give to us as open source. Anybody can get source code and they can customize and add new features to Liferay portal.

Liferay portal consist set of portlets and ready to build web application and we can also develop new portlet application using liferay. Liferay have its own frame work and standards to add new feature and customize existed portal.

Liferay have given two kinds of portal

  1. Liferay Enterprise Edition
  2. Liferay Community Edition


Liferay Enterprise Edition:

Liferay Enter Price Edition is paid portal which have enterprise license from liferay Inc. Liferay Enter Price Edition  have support from Liferay Inc and it’s have more benefits than Liferay Community Edition version.

Liferay Community Edition

Liferay Community Edition is available to public and anybody can get source code and then can add or customize. Very good working group and community people working for this. We can also contribute our effort to liferay community.

The following is Difference between CE and EE


Major Liferay Versions:


Liferay 6.2.x CE&EE, Liferay 6.1.x CE&EE, Liferay 6.0.x CE&EE and Liferay 5.2.x CE&EE


Features of Liferay
  • Liferay is ready to use web application
  • Liferay have many portlet to full fill dynamic web application functionality
  • Very Good Enterprise Web Content Management System
  • Sites, Organization and User Groups
  • Social Network Portlet
  • Document Library Management
  • Collaboration (Blogs, Wikis and Forums)
  •  Service Oriented Architecture Support.
  • Dynamic Look and Feel from Themes
  • Changing page layouts
  • Good Portal Administration User Interface.
  • Roles and Permission System
  • Easy Customization and Development
  • Support Many Integrations
  • Different Application Servers Support.
  • Device based Page View
  • Liferay Market Place

Liferay is ready to use web application

Liferay already is web application so that simple we can download and deploy in any machines. It’s ready to use application. Once we deploy we can directly.

The following tutorial for setup liferay


Liferay have many portlet to full fill dynamic web application functionality

Liferay have given many portlet to  build dynamic web application they have give more than 40 portlet in source code along with that we can also get many portlets from liferay market place.
Liferay market place is place where we get many real time portlets to use in our liferay web application. There we can get CE and EE portlet. Simple we can down lad and deploy in our liferay portal.

The following are links to get portlets



Very Good Enterprise Web Content Management System

 Web application consists of many web pages. Each web pages its own design and content. In real world application to manage content in application people came up with Web Content Management Systems. There are many web content management systems in market and liferay also have very good content management support. With this feature we can create web content, design content and publish content.

The WCM provide content management, content creation and content publishing.
Liferay have its own great feature that is called structures and templates from which we can design content without knowledge of CSS and html.

Admin will provide structures and templates by using that anyone can add web content without knowledge of CSS and HTML.

The following is information about liferay web content management


Sites, Organization and User Groups

Liferay has given sites, organization and User Groups. Based on our requirement we can take any one, so that we will get some generic feature to our application.
The following is link to get more about Sites and Organization


Social Network Portlet

Liferay have given many social networking portlet so that we can build social network web sites. These portlet have functionality to full fill basic needs for social network platforms.

The following is link to get more information


Document Library Management

Document Management system is for managed documents. Liferay have very good document management system winch implemented by Java Content Repository (JCR).
Liferay already integrated with Apache Jackrabbit JCR implementation and we can also integrate with other document management system like Alfresco.

The following is link to get more information



Collaboration (Blogs, Wikis and Forums)

Liferay have support for managing Blogs, Wikis and Forums. They have given portlet to meat wikis, blogs and forum functionality.

The following is link to get more information


Service Oriented Architecture (SOA) Support

Liferay have very good support for SOA. Liferay can support SOAP and REST web service. We can expose liferay services in either ways. In liferay creating web services and accessing web services very easy.

Because of these web services we can integrate liferay portal with other applications. We can also develop mobile application by using these web services. In recent days liferay have came up with mobile SDK to build mobile applications
.
The following are links to get more information.





Dynamic Look and Feel from Themes

Liferay Look and feel can be changes by themes. Themes are very easy way to change liferay look and feel. In liferay we can develop themes very easy.

The following is link to get more information about themes in liferay.


Page layouts

Layout is page template and its portlet arrangement in page. Liferay have many page layouts apart from that we can develop our own layouts.

The following is more information about layouts.


Good Portal Administration User Interface.

Liferay have very good User Interface to manage liferay portal. Manage liferay portal is nothing but manage users, manage sites, manage organization, manage role and permissions and server management.

Liferay have control panel there we can manage all the things

The following is more information about liferay administration control panel.


Roles and Permission System

Liferay have very good permission system which archives from user roles. In liferay each user has role and each role have permissions. Permissions will decide accessibility or scope of user in the website.

Liferay by default have default roles and permission apart from that we can create roles and assign permission to role.

The following links is from more information about Roles and Permissions


Easy Customization and Development

Liferay have its own mechanisms to customize or develop new thing for portal.

Liferay have Plugins SDK from which we can do customization and development.

Liferay have following Plugins SDK to customize and development in liferay portal


Portlets Hook, Themes, Ext and Layouts


The following is link to get more information about Plugins SDK


Support Many Integrations

Liferay support many integration like Service Oriented Integration, SSO Integration, DAP Integration and Learning Management Tools Integration.

The following are links to get more information about integrations



Different Application Servers Support

Liferay have support for many application servers. Liferay releases portal with different application server flavors

The followings is liferay portal available in different servers support


Device based Page View

Liferay can render pages based on devices this is very useful when we show application in mobiles and tablets.

Liferay have responsive theme mechanism based on the device the view will be rendered in browser.

Liferay have Bootstrap theme support and its having own administration panel there we can define device rules. Based on device rules page will be rendered.

The following is link to get more information about liferay view in mobiles


Liferay Market Place

Liferay market place is the liferay applications hub there we can get liferay applications. We can get CE and EE liferay applications. We can also place applications in market place. In market place liferay applications will be packaged and once we download the application we can deploy in portal this task is very easy.

The following is link to get more information about market place


Resources

Liferay official releases and downloads


Liferay CE Public SVN Repository (username: guest & password: guest)


Liferay CE Current working source code


Liferay Documentation

https://www.liferay.com/documentation/liferay-portal/6.2/user-guide

Author

Sunday, January 12, 2014

Liferay Service Builder Many to Many Relation in Plugin Portlet Part-III

Objective:

Implement Many to Many Relation in liferay development using service builder tool.



Environment:

Liferay 6.2 +Tomcat 7.x+MySQL 5.1

Note:

The code will work for portal 6.2 version you can try for 6.1 too.

Download Liferay Many To Many Portlet from following location

You can find source and war file 


Portlet Screen:


Procedure for deploy portlet:

You can use war file and directly place in your portal deploy folder and test or you can also use source to deploy portlet.

Once portlet is deployed successfully you can see the portlet in sample category name as Many To Many.

How To use Portlet?

One portlet successfully deployed then portlet available in sample category.

Login as Liferay Admin and add portlet to any page.

Add some students in the database using Add Student Screen


Add some courses in database using Add course screen


 Map Courses to Student from following screen


Map Students to course from following screen


Display students and his/her courses



Author
Meera Prince

Recent Posts

Recent Posts Widget

Popular Posts