Saturday 29 June 2013

Custom Portlet for File Upload in database in Liferay.

Hi friends this time i am going to show you how to create custom portlet that can upload file in database.Follow this steps and you will see that your portlet is uploading files.

Service.xml

1)open service.xml and write down the following entity

<entity name="FileUploader" table="fileuploader" local-service="true">
<column name="fid" type="long" primary="true"/>
    <column name="content" type="String"/>

</entity>

2)Now do Ant-build service for the portlet you created

Friday 28 June 2013

What is Liferay? User Guide


To understand liferay we first have to understand about portal,so question arise here what is portal?
Portal is a platform for building websites and also web applications.



Portal
This is image of one kind of portal in liferay.
Now,Liferay is one type of CMS based on java . Liferay is open source portal.
Here are the Liferay Features

Thursday 27 June 2013

where to find portal-exp.properties & configure database connectivity ?

Hi Friend ,

In liferay  portal-exp.properties is most important file & in that we have to write code of connectivity with database & so many other thing.

Path : \liferay-portal-6.1.1\tomcat-7.0.35\webapps\ROOT\WEB-INF\classes

If not exist then create new file with properties extension.

MySql connection configuration code :

jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/schemename?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=xxxx


If any query plz do comment or mail us at:
chiragmsc007it@gmail.com
mehdisunasara@gmail.com

Wednesday 26 June 2013

Retrieve Data from Database in Liferay.

Hi friends today i am going to show you how to retrieve data from database.In my previous post i have shown you how to insert data in database.Here are the steps to retrieve data:

Finder Method


1)Open Service.xml and write the finder method by which field you want to retrieve data.As shown below i have searched for title so code is as below.

             <finder name="title" return-type="Collection">
<finder-column name="title" />
             </finder>

Tuesday 25 June 2013

Create Image zoom Jquery using Structure and templates.

Hi friends i am back with new stuff for liferay.Follow this Steps and you will see template working

Create Structure

1)Go to Control panel click on web content in left panel.
2)Now Click on structure on top side of page now add name and description of the your template.
3)Now at bottom there is XML Schema Definition.
4)Click on Add Row and create whole xml schema as below figure.

Friday 21 June 2013

Get List of web service & authenticate web service

For Getting List Of web service Hint below URL in browser

http://localhost:8080/api/jsonws

It will display all json web service If you are log in then you used that

Now question is how to authenticate web service for use ?

Its simple try below Syntax

http://emailid:password@localhost:8080/api/secure/jsonws/user/get-user-by-email-address/company-id/10154/email-address/ccc@gmail.com

Thanks
Chirag@India

Thursday 20 June 2013

Get ThemeDisplay Object in Velocity Liferay

#set ($serviceContext = $portal.getClass().forName("com.liferay.portal.service.ServiceContextThreadLocal").getServiceContext())
#set ($httpServletRequest = $serviceContext.getRequest())
##get the real themeDisplay object, not the $themeDisplay map
#set ($objThemeDisplay = $httpServletRequest.getAttribute("THEME_DISPLAY"))

Chirag@India

velocity multiple line comments

For provide multiple line comment simply used

Same in java we used /*......*/

#*
velocity code.
..
.
.
.
..
*#


Database Operation liferay using Service Builder(CRUD Portlet)

In this Blog we will learn how to insert data in database using  Service Builder.

Create a new Liferay Project:-
1)Click on New Liferay Project as shown below:

2)Give the project name as "prac"
3)Check "Liferay Plugin SDK" and Liferay Portal Runtime are Properly configured.
4)Check "Portlet" option
5)Put Portlet Name as "pracportlet"
6)put java package as "com.control"

Wednesday 19 June 2013

Prevent Duplication resubmit form in portlet

Write Below line in liferay-portlet.xml file to avoid duplicate submission of from data

1<action-url-redirect>true</action-url-redirect>


Chirag@India