Search This Blog

Showing posts with label portlets portal servers. Show all posts
Showing posts with label portlets portal servers. Show all posts

Wednesday, July 17, 2013

XML Validation in Liferay

The property 'xml.validation.enabled' must be added to the Portal-ext.properties file.
If set false,

xml.validation.enabled=false

The xml files won't be validated inside the liferay. In some cases,where the xml,DTD ..etc files are kept external. This property can be used to avoid the validation errors.

Tuesday, July 16, 2013

How to get the current logged in user in liferay

There are more than one way to do this. Let's look at some of the options available.
  1. User user = (User) request.getAttribute(WebKeys.USER);
    The User class is the Liferay's model User class.

  2. ThemeDisplay td  = (ThemeDisplay) request.getAttribute( WebKeys.THEME_DISPLAY );
    User user = td.getUser();


    This ' ThemeDisplay 'class can be used to get various information about the portal page,user and theme. Classes ThemeDisplay, User and WebKeys are available in portal-service.jar

  3. User currentUser = PortalUtil.getUser( request );

    The 'PortalUtil' has various utility functions , which come handy during Liferay Programming. This is also a part of the Portal-service.jar.

  4. LiferayFacesContext liferayFacesContext = LiferayFacesContext.getInstance();
    User currentUser=liferayFacesContext.getUser();


    The class 'PortalFacesContext' has been renamed to 'LiferayFacesContext'.This class exists in order to assist with migrating old JSF 1.2 based projects from the legacy PortletFaces-Tools project to the new LiferayFaces project.

    Hope It helps you in your portal programming. Happy Coding :)


Friday, July 16, 2010

Add Javascript to Ice Faces or Facelets

There are several ways to add JavaScript code to an ice faces page. One of which is explained here.The "Direct to Dom" (akaD2D) rendering of icefaces makes it difficult to add javascript or any other code to it.

Q. Where to add the code? .
Ans. The answer is to put the < script type="text/javascript"> just code after the < ice:root> between < html> < head> .add the javascript in the similar way as you add it in jsp/html. then close the tag and at the end before closing the root (i.e < /ice:root> ) add the < /html> tag.

Q. How to call an icefaces componet?
Ans. Use the formname:componentid format to use it in the javascript function.

Q. How to use the body onload thing without using body tag.
Ans. The answer lies in using the window event.

Here is an example which makes everything clear


< jsp:root version="2.0" f="http://java.sun.com/jsf/core" h="http://java.sun.com/jsf/html" ice="http://www.icesoft.com/icefaces/component" jsp="http://java.sun.com/JSP/Page">
< f:view>
< script type="text/javascript>
function setFocusOnLogin(){ document.getElementById("icefaces_formaname:icefaces_component_id").focus(); }//its used to call the icefaces component's focus event
window.attachEvent("onload", setFocusOnLogin);//like body onload , its called on page load < /script>
< ice:portlet>
< ice:form id="icefaces_formaname">
< ice:inputtext id="icefaces_component_id" size="10">
< /ice:inputtext>
< /ice:form>
< /ice:portlet>
< /f:view>
< /jsp:root>

Hope you get it. For any concerns feel free to post a comment.

Tuesday, January 27, 2009

ProcessAction Method

ProcessAction() Method

The JSR-168 Specification defines a portlet container that manages portlets.Each portlet’s life cycle contain some specific methods as per JSR-168 namely init(),ProcessAction(),destroy() method etc. . The portlet developer can implement these methods to provide the desired functionality.Among all the life-cycle methods of a portlet one of the most important method is the ProcessAction() method.This ProcessAction() method is Called after the user submits changes to a jsr-168 compliant portlet. It is Intended to process input from a user Interaction.The user must interact with the portlet giving some or the other kind of data to it which must be processed by a portlet.This way we can say that the portlet processing is done in the ProcessAction() method.Even if one tries to maximize the size of the portlet window it calls the ProcessAction() method.

public void processAction(ActionRequest request, ActionResponse response)
throws PortletException, IOException
{
}

The processAction() method is called only by the ActionURL. The other URL i.e RenderURL doesnt invoke the processAction() method.When the form submit button is pressed, the action url is used. The action url indicates to the portal that it is an action request. Responding to the action request, the portal invokes the processAction() method before invoking the render() method.

The request values are obtained from the actionURL in the following way

public void processAction(ActionRequest request, ActionResponse response)
throws PortletException, IOException
{
// get the values submitted with the form

String identity = request.getParameter("parameter1");
String color = request.getParameter("parameter2");

......
}

the way we set the render parameters for the render() method is

public void processAction(ActionRequest request, ActionResponse response)
throws PortletException, IOException
{

......

response.setRenderParameter("parameter1", value1);
response.setRenderParameter("parameter2", value2);
}

Thursday, January 22, 2009

List of some of the most Popular Portal Servers

List of Popular Portal servers
• Liferay - Liferay deploy portlets that adhere to the Portlet API (JSR 168).Its one of the most popular and most talked upon potal server in the recent market. It has lots of portlets bundled with the portal (Mail,Workflow, Document Library, Calendar, Message Boards,Wiki, to name a few) and can be used to develop for adding your own custom portlets.The Ext environment in the portal server is used for extending the portal towith custom generated portlets and make it compatible with newer additions of incremental development.

• Exo - The eXo platform is a one of the major Open Source - JSR 168 compliant - enterprise portal built from various modules.It provides virtualization of the work space through an advanced WebOS interface.

• Pluto - Reference Implementation of the JSR168.It now supports JSR286 also. Apache Pluto is a subproject of the Apache Portals Project.

• JA-SIG uPortal - uPortal is a free, sharable portal under development by institutions of higher-education. Community tools, such as chat, forums, survey, and so on, build relationships among campus constituencies. uPortal is an open-standard effort using Java, XML, JSP and J2EE.

• ByLine - Byline is an open source (LGPL) content management, portal, and collaboration system built on top of a sophisticated web development framework. Byline includes content authoring, versioning, workflow, categorization, and lifecycle management capabilities. Byline has been used to build sophisticated content and document management systems for customers such as the APLAWS consortium, FranceTV (www.france2.fr), Deutsche Post, the United Nations, and many others. Byline has been used to power systems that have over 400GB of data, thousands of content contributors, and tens of thousands of content visitors.

• Jakarta Jetspeed 2 Enterprise Portal - Jetspeed-2 is the next-generation enterprise portal at Apache. Jetspeed-2 offers several architectural enhancements and improvements over Jetspeed 1.0. First, Jetspeed-2 is conformant to the Java Portlet Standard and provides a standard mechanism for the deployment of portlets. Second, Jetspeed-2 has matured to a more scalable architecture featuring multi-threaded functionality. Third, Jetspeed-2 is decoupled from several legacy open source projects. Fourth, Jetspeed-2 is based on a component architecture.

• JBoss Portal - JBoss Enterprise Portal Platform provides an integrated open source platform for hosting and serving a portal's web interface, aggregating, publishing, and managing its content, and personalizing its experience.

• Websynergy-project WebSynergy SB 2 is the next-generation web aggregation and presentation platform from SunTM Microsystems. This platform includes developer tools and an enterprise-grade presentation runtime based on Liferay Portal Server, GlassFishTM version 3, and MySQLTM software.

• Portals in Cocoon - The portal framework is a portal server that runs inside Cocoon - or to be more precise inside the Cocoon servlet. It contains a portlet container that is called coplet container. Coplet stands for Cocoon Portlet and is the Cocoon equivalent to portlet.Due to the highly extensible nature of Cocoon, the portal is configurable and extensible as well and provides many hooks and switches to easily adapt the portal for specific needs. As the portal is integrated in Cocoon it has the advantage that all features of Cocoon can easily be used. Cocoon is very strong in fetching data from various source and delivering it in the various output formats requested by different clients (like HTML, WML, PDF etc.).

My Blog List