Laliwala IT Services

Laliwala IT Services
Website Development

Monday, March 28, 2011

Simple Struts Portlet, tutorial, portlet, struts tutorial, liferay strusts portlet

Code Snippets for various examples.

Prepared by Aasif and Ahmed under the guidance of Irshad Mansuri

Attune Infocom
----------------------------------------------------------------------------------
===============================================================2. Simple Struts Portlet

2.1. portlet-ext.xml
--------------------
<portlet>
<portlet-name>library</portlet-name>
<display-name>library Portlet</display-name>
<portlet-class>com.liferay.portlet.StrutsPortlet</portlet-class>
<init-param>
<name>view-action</name>
<value>/ext/library/view</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
</supports>
<resource-bundle>com.liferay.portlet.StrutsResourceBundle</resource-bundle>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
</portlet>

2.2. liferay-portlet-ext.xml
----------------------------
<portlet>
<portlet-name>library</portlet-name>
<struts-path>ext/library</struts-path>
<use-default-template>false</use-default-template>
</portlet>

2.3. liferay-display.xml
------------------------

add

<portlet id="library" />

inside

<category name="category.example">

2.4. struts-config.xml
----------------------
<action path="/ext/library/view" forward="portlet.ext.library.view" />

2.5. tiles-defs.xml
-------------------
<definition name="portlet.ext.library" extends="portlet" />
<definition name="portlet.ext.library.view" extends="portlet.ext.library">
<put name="portlet_content" value="/portlet/ext/library/view.jsp" />
</definition>


(create the following two jsp files under "/ext/ext-web/docroot/html/portlet/ext/library")

2.6. init.jsp
-------------
<%@ include file="/html/portlet/init.jsp" %>
<p>Add commonly used variables and declarations here!</p>

2.7. view.jsp
-------------
<%@ include file="/html/portlet/ext/library/init.jsp" %>
Simple Struts Portlet!

2.8 Language-ext.properties
---------------------------

Add a new entry in the above file,
javax.portlet.title.library=library Portlet

2.9 Deploy and verify
---------------------

run "ant deploy" from ext to move all the changes we have done so far both under "ext-web" and "ext-impl"

Restart the server and check the new library portlet is working perfectly fine.

This portlet will be the basis for all other concepts we are going to learn in the subsequent chapters.

All the best !!







Check that Library Portlet is available under Training Categroty.





Check out that Library Portlet is added successfully.









Simple Struts Portlet, tutorial, portlet, struts tutorial, liferay strusts portlet

Friday, March 25, 2011

liferay tutorial, simple jsp portlet, basic jsp, portlet

Code Snippets for various examples.

Prepared by Aasif and Ahmed under the guidance of Irshad Mansuri

Attune Infocom pvt. ltd.
----------------------------------------------------------------------------------

===============================================================
1.Basic JSP Portlet
===============================================================

[the xml files are located under "ext/ext-web/docroot/WEB-INF"]

1.1. portlet-ext.xml
--------------------

(insert the below content)

<portlet>
<portlet-name>EXT_2</portlet-name>
<display-name>JSP Portlet Introduction</display-name>
<portlet-class>com.liferay.util.bridges.jsp.JSPPortlet</portlet-class>
<init-param>
<name>view-jsp</name>
<value>/html/portlet/ext/jsp_portlet/view.jsp</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
</supports>
<resource-bundle>com.liferay.portlet.StrutsResourceBundle</resource-bundle>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
</portlet>

1.2. liferay-portlet-ext.xml
----------------------------

(insert the below content)

<portlet>
<portlet-name>EXT_2</portlet-name>
</portlet>


1.3. liferay-display.xml
------------------------

(insert the below content)

<category name="category.example">
<portlet id="EXT_2" />
</category>

1.4. view.jsp
-------------

(create this file under "ext/ext-web/docroot/html/portlet/ext/jsp_portlet"
and enter the below contents)

Welcome to simple Basic JSP Portlet

Note: after this step do "ant deploy" from "ext-web"

1.5 Language-ext.properties
---------------------------

(under /ext/ext-impl/src/content)

Add two new entries in the above file,

javax.portlet.title.EXT_2=JSP Portlet

category.example=Training

Note: after this step do "ant deploy" from "ext-impl"

1.6 Restart the server and check
--------------------------------

Restart the server and check you get the new portlet under the "Training" category








Goto to Add application




See new category Training is made under which there is newly created JSP portlet.






JSP Portlet is successfully added.



Liferay tutorial JSP Portlet

Liferay tutorial JSP Portlet
Liferay portlet development training
Liferay training attune infocom
Liferay JSP portlet development


Code Snippets for various examples.

Prepared by : Irshad Mansuri

Attune Infocom
----------------------------------------------------------------------------------

===============================================================
1.Basic JSP Portlet
===============================================================

[the xml files are located under "ext/ext-web/docroot/WEB-INF"]

1.1. portlet-ext.xml
--------------------

(insert the below content)

<portlet>
<portlet-name>EXT_2</portlet-name>
<display-name>JSP Portlet Introduction</display-name>
<portlet-class>com.liferay.util.bridges.jsp.JSPPortlet</portlet-class>
<init-param>
<name>view-jsp</name>
<value>/html/portlet/ext/jsp_portlet/view.jsp</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
</supports>
<resource-bundle>com.liferay.portlet.StrutsResourceBundle</resource-bundle>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
</portlet>

1.2. liferay-portlet-ext.xml
----------------------------

(insert the below content)

<portlet>
<portlet-name>EXT_2</portlet-name>
</portlet>


1.3. liferay-display.xml
------------------------

(insert the below content)

<category name="category.example">
<portlet id="EXT_2" />
</category>

1.4. view.jsp
-------------

(create this file under "ext/ext-web/docroot/html/portlet/ext/jsp_portlet"
and enter the below contents)

Welcome to simple Basic JSP Portlet

Note: after this step do "ant deploy" from "ext-web"

1.5 Language-ext.properties
---------------------------

(under /ext/ext-impl/src/content)

Add two new entries in the above file,

javax.portlet.title.EXT_2=JSP Portlet

category.example=Training

Note: after this step do "ant deploy" from "ext-impl"

1.6 Restart the server and check
--------------------------------

Restart the server and check you get the new portlet under the "Training" category

Wednesday, March 16, 2011

tomcat liferay

liferay language navigation portlet

liferay language navigation portlet

problems faced in liferay 6

1.) In Blogs portlet, on clicking “Publish” button in while editing comments, Bolgs portlet shows error – “Blogs is temporarily unavailable”.