Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Retrieving data from existing database Madhuri Sonawane August 17, 2012 11:22 PM
RE: Retrieving data from existing database Amit Doshi August 18, 2012 12:59 AM
RE: Retrieving data from existing database devaraj s August 18, 2012 3:28 AM
RE: Retrieving data from existing database Madhuri Sonawane August 18, 2012 3:34 AM
RE: Retrieving data from existing database Mayur Patel August 18, 2012 4:20 AM
RE: Retrieving data from existing database Rewati Raman August 18, 2012 6:27 AM
RE: Retrieving data from existing database David H Nebinger August 18, 2012 7:52 AM
RE: Retrieving data from existing database Mayur Patel August 18, 2012 12:22 PM
RE: Retrieving data from existing database Rewati Raman August 20, 2012 5:18 AM
RE: Retrieving data from existing database Mayur Patel August 20, 2012 7:23 AM
RE: Retrieving data from existing database David H Nebinger August 20, 2012 7:46 AM
RE: Retrieving data from existing database Sagar A Vyas August 20, 2012 9:46 AM
RE: Retrieving data from existing database Madhuri Sonawane August 21, 2012 1:54 AM
RE: Retrieving data from existing database David H Nebinger August 21, 2012 5:22 AM
RE: Retrieving data from existing database Ramkumar Chandran August 31, 2012 8:59 AM
RE: Retrieving data from existing database David H Nebinger August 31, 2012 9:02 AM
RE: Retrieving data from existing database Sagar A Vyas September 1, 2012 2:42 AM
RE: Retrieving data from existing database Hitoshi Ozawa September 1, 2012 5:34 AM
RE: Retrieving data from existing database Madhuri Sonawane September 2, 2012 9:55 PM
RE: Retrieving data from existing database Rewati Raman October 18, 2012 3:51 AM
RE: Retrieving data from existing database Sagar A Vyas August 18, 2012 4:29 AM
Madhuri Sonawane
Retrieving data from existing database
August 17, 2012 11:22 PM
Answer

Madhuri Sonawane

Rank: New Member

Posts: 10

Join Date: August 5, 2012

Recent Posts

hi,
I want to retrieve the data from existing database and display it on new port-let of life-ray.
Please can some one help me..?
Amit Doshi
RE: Retrieving data from existing database
August 18, 2012 12:59 AM
Answer

Amit Doshi

Rank: Liferay Master

Posts: 549

Join Date: December 29, 2010

Recent Posts

Madhuri Sonawane:
hi,
I want to retrieve the data from existing database and display it on new port-let of life-ray.
Please can some one help me..?


xxxLocalServiceUtil Class and use there respective functions to get appropriate data.
devaraj s
RE: Retrieving data from existing database
August 18, 2012 3:28 AM
Answer

devaraj s

Rank: Regular Member

Posts: 207

Join Date: May 21, 2012

Recent Posts

Madhuri Sonawane:
hi,
I want to retrieve the data from existing database and display it on new port-let of life-ray.
Please can some one help me..?



refer attached pdf.. so it will definitly help you.
Attachments: liferay-portlet-development.pdf (609.7k)
Madhuri Sonawane
RE: Retrieving data from existing database
August 18, 2012 3:34 AM
Answer

Madhuri Sonawane

Rank: New Member

Posts: 10

Join Date: August 5, 2012

Recent Posts

I have already use this pdf and display data on same portlet, but I want to access that database & display on new portlet for doing some operation.
Mayur Patel
RE: Retrieving data from existing database
August 18, 2012 4:20 AM
Answer

Mayur Patel

Rank: Expert

Posts: 343

Join Date: November 17, 2010

Recent Posts

Can you just share information in more detail?

1 I want to access that database & display on new portlet for doing some operation.


If you want to access database, Have you made entry in portal-ext.properties for DB connection?

Do you want to access custom table which is created by service builder or any OOTB table?

As Amit specified, you can use xxxLocalServiceUtil for performing any operation say add,view,update,delete etc.

Thanks.
Sagar A Vyas
RE: Retrieving data from existing database
August 18, 2012 4:29 AM
Answer

Sagar A Vyas

Rank: Liferay Master

Posts: 656

Join Date: April 17, 2009

Recent Posts

Madhuri Sonawane:
hi,
I want to retrieve the data from existing database and display it on new port-let of life-ray.
Please can some one help me..?


Madhuri,

1st : For which from which table you want to retrieve data.
2nd : Try to find out name of that portlet from (\liferay-portal-src\portal-web\docroot\WEB-INF\portlet-custom.xml)
3rd : for example portlet name is User then you will find userLocalServiceUtil by which you can access all relative information of user
(This is same as we build the service and access that by ***LocalServiceUtil)

Hope this clear.

Thanks,
Sagar Vyas
Rewati Raman
RE: Retrieving data from existing database
August 18, 2012 6:27 AM
Answer

Rewati Raman

Rank: Junior Member

Posts: 97

Join Date: February 24, 2012

Recent Posts

Hi Mayur,
I think she has created the service.xml in one portlet project and trying to access in other portlet project

so as i did
i had copied the jar file from the portlet's lib folder and copied in Liferay-portal/tomcat/lib/ext and it worked for me
then i was able to access all the implemented methods from that portlet

Regards,
Rewati Raman
David H Nebinger
RE: Retrieving data from existing database
August 18, 2012 7:52 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 9493

Join Date: September 1, 2006

Recent Posts

Rewati Raman:
i had copied the jar file from the portlet's lib folder and copied in Liferay-portal/tomcat/lib/ext and it worked for me
then i was able to access all the implemented methods from that portlet


Wrong wrong wrong.

The service consuming plugin must add the service providing plugin as a required deployment context in the IDE. Everything else will be taken care of.
Mayur Patel
RE: Retrieving data from existing database
August 18, 2012 12:22 PM
Answer

Mayur Patel

Rank: Expert

Posts: 343

Join Date: November 17, 2010

Recent Posts

Right David, only required plugins we can add in liferay-plugin-package.xml instead of making it global by putting same in lib/ext
Rewati Raman
RE: Retrieving data from existing database
August 20, 2012 5:18 AM
Answer

Rewati Raman

Rank: Junior Member

Posts: 97

Join Date: February 24, 2012

Recent Posts

Thanks Mayur
for correcting me
mayur if you have some sample file where you have included the plugins in liferay-plugin-package.xml
it would be good for me
because till now i used in above mentioned method

Regards,
Rewati Raman
Mayur Patel
RE: Retrieving data from existing database
August 20, 2012 7:23 AM
Answer

Mayur Patel

Rank: Expert

Posts: 343

Join Date: November 17, 2010

Recent Posts

Just you need to add jars entry like below,

1portal-dependency-jars=\
2    jstl-api.jar,\
3    jstl-impl.jar,\
4    sample-portlet-service.jar // which is there in web-inf/lib
Thanks.
David H Nebinger
RE: Retrieving data from existing database
August 20, 2012 7:46 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 9493

Join Date: September 1, 2006

Recent Posts

Mayur Patel:
Just you need to add jars entry like below,

1portal-dependency-jars=\
2    jstl-api.jar,\
3    jstl-impl.jar,\
4    sample-portlet-service.jar // which is there in web-inf/lib
Thanks.


Wrong wrong wrong.

You cannot use portal-dependency-jars unless it comes from ROOT/WEB-INF/lib. Since it does not, you must use required-deployment-contexts. If the portlet providing the service is named "service-provider-portlet", your entry in liferay-plugin-package.properties would be:

1required-deployment-contexts=\
2    service-provider-portlet


The IDE will do the right thing and pull the jar in for you...
Sagar A Vyas
RE: Retrieving data from existing database
August 20, 2012 9:46 AM
Answer

Sagar A Vyas

Rank: Liferay Master

Posts: 656

Join Date: April 17, 2009

Recent Posts

This is something interested, Thank You David for sharing this.

Thanks,
Sagar Vyas
Madhuri Sonawane
RE: Retrieving data from existing database
August 21, 2012 1:54 AM
Answer

Madhuri Sonawane

Rank: New Member

Posts: 10

Join Date: August 5, 2012

Recent Posts

Please give me steps to perform this procedure to access database in new portlet.

Thank you
David H Nebinger
RE: Retrieving data from existing database
August 21, 2012 5:22 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 9493

Join Date: September 1, 2006

Recent Posts

Madhuri Sonawane:
Please give me steps to perform this procedure to access database in new portlet.


Sure.

Step #1: Read the documentation about Service Builder.
Step #2: Repeat step #1 until you understand how to build and understand database access.
Ramkumar Chandran
RE: Retrieving data from existing database
August 31, 2012 8:59 AM
Answer

Ramkumar Chandran

Rank: Junior Member

Posts: 28

Join Date: November 15, 2011

Recent Posts

I'm couldn't understand the concept of service builder.
Like accessing other tables data(using foreign key). etc.
Is thee any forum post or any other doc which explain the concept ,....
David H Nebinger
RE: Retrieving data from existing database
August 31, 2012 9:02 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 9493

Join Date: September 1, 2006

Recent Posts

Liferay doesn't use FKeys at all in SB as it imposes restrictions during upgrade handling.

For the most part you're left to manage relationships on your own via code in your XxxLocalServiceImpl classes.
Sagar A Vyas
RE: Retrieving data from existing database
September 1, 2012 2:42 AM
Answer

Sagar A Vyas

Rank: Liferay Master

Posts: 656

Join Date: April 17, 2009

Recent Posts

Ramkumar Chandran:
I'm couldn't understand the concept of service builder.
Like accessing other tables data(using foreign key). etc.
Is thee any forum post or any other doc which explain the concept ,....


Hi Ramkumar,

There are lots of thing you can do by using service builder.

Like you don't need to create table manually in DB or Utill classes which helps you to communicate with DB.

More information you can see SB

HTH.

Thanks,
Sagar Vyas
Hitoshi Ozawa
RE: Retrieving data from existing database
September 1, 2012 5:34 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

I'm couldn't understand the concept of service builder.
Like accessing other tables data(using foreign key). etc.


You're missing the main thought behind service builder - developers uses entity services and not database tables. Forgot everything about using database table and only think about using entity services. This is also the main idea behind Amazon's systems - applications use entities and not database. This is how they keep their system flexible and also how applications build with service builder can be flexible.
Madhuri Sonawane
RE: Retrieving data from existing database
September 2, 2012 9:55 PM
Answer

Madhuri Sonawane

Rank: New Member

Posts: 10

Join Date: August 5, 2012

Recent Posts

You refer this link,
it might be help you

Doc of Service Builder


Thanks,
Madhuri
Rewati Raman
RE: Retrieving data from existing database
October 18, 2012 3:51 AM
Answer

Rewati Raman

Rank: Junior Member

Posts: 97

Join Date: February 24, 2012

Recent Posts

thanx david
your suggestions worked for me.