Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Portlet with Web Service, store data in DB Rafa Quinonero March 26, 2012 2:46 AM
RE: Portlet with Web Service, store data in DB Bharani Ravi Kanth March 26, 2012 3:26 AM
RE: Portlet with Web Service, store data in DB Rafa Quinonero March 26, 2012 5:46 AM
RE: Portlet with Web Service, store data in DB Rafa Quinonero March 26, 2012 6:06 AM
RE: Portlet with Web Service, store data in DB Bharani Ravi Kanth March 26, 2012 7:32 AM
RE: Portlet with Web Service, store data in DB Danial Mustofa Habibi March 26, 2012 10:01 PM
RE: Portlet with Web Service, store data in DB Rafa Quinonero March 27, 2012 8:53 AM
RE: Portlet with Web Service, store data in DB rzn adm May 30, 2012 9:18 PM
RE: Portlet with Web Service, store data in DB Rafa Quinonero May 31, 2012 12:00 AM
RE: Portlet with Web Service, store data in DB rzn adm May 31, 2012 12:11 AM
RE: Portlet with Web Service, store data in DB Rafa Quinonero May 31, 2012 12:27 AM
RE: Portlet with Web Service, store data in DB rzn adm May 31, 2012 1:50 AM
RE: Portlet with Web Service, store data in DB Rafa Quinonero May 31, 2012 1:57 AM
RE: Portlet with Web Service, store data in DB rzn adm May 31, 2012 6:49 PM
RE: Portlet with Web Service, store data in DB Rafa Quinonero June 1, 2012 1:01 AM
RE: Portlet with Web Service, store data in DB Riccardo Ferrari June 1, 2012 4:02 AM
RE: Portlet with Web Service, store data in DB Danial Mustofa Habibi June 1, 2012 7:42 AM
RE: Portlet with Web Service, store data in DB rzn adm June 3, 2012 7:33 PM
RE: Portlet with Web Service, store data in DB Danial Mustofa Habibi June 4, 2012 3:56 AM
RE: Portlet with Web Service, store data in DB rzn adm June 4, 2012 7:15 PM
RE: Portlet with Web Service, store data in DB Danial Mustofa Habibi June 5, 2012 9:35 PM
Rafa Quinonero
Portlet with Web Service, store data in DB
March 26, 2012 2:46 AM
Answer

Rafa Quinonero

Rank: Junior Member

Posts: 37

Join Date: March 22, 2012

Recent Posts

Hi all,

I'm new to liferay and exploring web services in portlets by myself. With some tutorials and help, I've been able to make a portlet with a working web service. What I'd like to do now is to add some data in the DB via HTTP POST from my portlet, but I'm a little bit lost due to my little concept knowledge of portlets and liferay API.

I'd like to show a text field in my portlet so that the user can write there a name, and when the click button (with aui) is pushed, we call the HTTP POST and create a new row in the DB. I created my portlet with an entity Employee with 2 columns: id (PK) and name.

Trying to build that, I have some questions I'd like to ask and hope you can help me:

1st) Where and how should I write the code to send the HTTP POST after getting the name that the user entered? I did something like that:

<portlet:actionURL var="post_url" />

<aui:form method="post" action="<%=post_url%>">
<aui:input label="New Employee: " name="name" type="text" value="<%=employee%>" />
<aui:button type="submit" />
</aui:form>

But it seems that the post_url is never really filled.

2nd) Looking at my EmployeeServiceUtil.java, I can see that the create method I need to call, has a Model as an argument, how can I send a Model via HTTP to store a new row in the DB? I put that code in my processAction() method without succes:

public void processAction (ActionRequest actionRequest, ActionResponse actionResponse) throws IOException, PortletException
{
PortletPreferences prefs = actionRequest.getPreferences();
String name = prefs.getValue("name", "Noname"); /* This should be the name inserted by the user to be stored as a new Employee */

/* URL to be sent as a POST call to store the new row in DB */
String post = "http://localhost:8080/c/portal/json_service?serviceClassName:com.liferay.test.service.EmployeeServiceUtil" +
"&serviceMethodName:create&servletContextName:EmployeePlugin-portlet&serviceParameters=&var=" + name;

actionResponse.setRenderParameter("post_url", post);

super.processAction(actionRequest, actionResponse);
}

Please correct me if I'm wrong with my code or with the next concepts: First we render the portlet by reading the view.jsp or the init parameters at portlet.xml, maybe with the init() method too. Then, when the user writes a name in the text field and clicks on submit, we are calling the processAction method, that should take the name, concatenate it to the needed URL and send it as POST to store it in database. Then, we render our portlet again, after the action has been finished. So the action is called and then we render the portlet again, but I don't understand much well how must the view.jsp structured to achieve that.

Thank you very much, hope you can help to improve my skills with liferay and portlets concepts.

Cheers,

Rafa
Bharani Ravi Kanth
RE: Portlet with Web Service, store data in DB
March 26, 2012 3:26 AM
Answer

Bharani Ravi Kanth

Rank: Junior Member

Posts: 63

Join Date: January 19, 2012

Recent Posts

HEY Rafa

I think this blog will help you out.
http://michi-path.blogspot.in/2012/03/create-form-and-submit-values-to.html

and i am also attaching a sample code in this reply..please find and go through it it may help you

Regards bharani
Attachments: Sample_Portlet-portlet.zip (141.5k)
Rafa Quinonero
RE: Portlet with Web Service, store data in DB
March 26, 2012 5:46 AM
Answer

Rafa Quinonero

Rank: Junior Member

Posts: 37

Join Date: March 22, 2012

Recent Posts

Hi! Thanks a lot! emoticon
Rafa Quinonero
RE: Portlet with Web Service, store data in DB
March 26, 2012 6:06 AM
Answer

Rafa Quinonero

Rank: Junior Member

Posts: 37

Join Date: March 22, 2012

Recent Posts

Bharani Ravi Kanth:
HEY Rafa

I think this blog will help you out.
http://michi-path.blogspot.in/2012/03/create-form-and-submit-values-to.html

and i am also attaching a sample code in this reply..please find and go through it it may help you

Regards bharani


How can I take a quick look at the database to see if data has been stored correctly? is it possible via http GET?

Thanks a lot ;)
Bharani Ravi Kanth
RE: Portlet with Web Service, store data in DB
March 26, 2012 7:32 AM
Answer

Bharani Ravi Kanth

Rank: Junior Member

Posts: 63

Join Date: January 19, 2012

Recent Posts

Hey Rafa

by default Liferay comes with its own database.HSQL so you can configure to your existing database by doing some small manipulations

i am explaining for MYSQL

1. first create a database withname lportal which is having a chartype utf8 then go to this location
2. liferay-portal-6.0.6\tomcat-6.0.29\webapps\ROOT\WEB-INF\classes
3. then create a file naming portlet-ext.properties
4. add the following content there
5. save the portal-ext.properties file

jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost:3306/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=enter your database username
jdbc.default.password=enter your database password
schema.run.enabled=true
schema.run.minimal=true

and restart your liferay server you see the tables added in your lportal and from now what ever tables you add by using service.xml and service builder classes it will store in this lportal database so you can you see the values in tables easily.

try this and let me know.

regards
bharani
Danial Mustofa Habibi
RE: Portlet with Web Service, store data in DB
March 26, 2012 10:01 PM
Answer

Danial Mustofa Habibi

Rank: Regular Member

Posts: 141

Join Date: November 1, 2011

Recent Posts

hi there if you want to use your own database than lportal database u can use this on your service.xml on entity tag
1data-source="myAppDataSource" session-factory="myAppSessionFactory" tx-manager="myAppTransactionManager"

sample from my entity
1    <entity name="Jadwal" local-service="true" remote-service="true" table="jadwal" data-source="myAppDataSource" session-factory="myAppSessionFactory" tx-manager="myAppTransactionManager">
2    <column name="kode_jadwal" type="int" primary="true" ></column>
3    <column name="stasiun_asal" type="String"></column>
4    <column name="stasiun_tujuan" type="String"></column>
5        <column name="kode_kereta" type="String"></column>
6    </entity>
7   

then modify/create ext-spring.xml on your meta-inf folder
 1<?xml version="1.0"?>
 2<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
 3"http://www.springframework.org/dtd/spring-beans.dtd">
 4<beans>
 5  <bean class="
 6org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
 7  </bean>
 8  <bean id="myAppDataSourceTarget"               
 9     class="org.springframework.jdbc.datasource.DriverManagerDataSource">
10    <property name="driverClassName" value="com.mysql.jdbc.Driver" />
11    <property name="url" value="jdbc:mysql://localhost:3306/db_kereta" />
12    <property name="username" value="root" />
13    <property name="password" value="" />
14  </bean>
15  <bean id="myAppDataSource"                        
16      class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
17    <property name="targetDataSource">
18      <ref bean="myAppDataSourceTarget" />
19    </property>
20  </bean>
21  <bean id="myAppHibernateSessionFactory"
22      class="com.liferay.portal.spring.hibernate.PortletHibernateConfiguration">
23    <property name="dataSource">
24      <ref bean="myAppDataSource" />
25    </property>
26  </bean>
27  <bean id="myAppSessionFactory"                
28      class="com.liferay.portal.dao.orm.hibernate.SessionFactoryImpl">
29    <property name="sessionFactoryImplementor">
30      <ref bean="myAppHibernateSessionFactory" />
31    </property>
32  </bean>
33  <bean id="myAppTransactionManager"
34      class="org.springframework.orm.hibernate3.HibernateTransactionManager">         
35    <property name="dataSource">
36      <ref bean="myAppDataSource" />
37    </property>
38    <property name="sessionFactory">
39      <ref bean="myAppHibernateSessionFactory" />
40    </property>
41  </bean>
42</beans>

run service builder again.

Regards

Danial
Attachments: ext-spring.xml (1.6k)
Rafa Quinonero
RE: Portlet with Web Service, store data in DB
March 27, 2012 8:53 AM
Answer

Rafa Quinonero

Rank: Junior Member

Posts: 37

Join Date: March 22, 2012

Recent Posts

Hi guys!! Thanks for your answers!!

Finally I found the way, I just needed to learn how to use <form> in the right way to make a call to the web service to store/retrieve info into/from the Liferay database. Anyway, you informatoin is also good for me, I didn't know about that you wrote. emoticon

To make this thread usefull, I paste here my solution and a little explanation of what I did.

After being able to get a response from the web service with a GET request (although I was getting an exception, it was a good signal that things were going in the right way), I wanted to store new rows in the database so that the GET request had a real response. What I didn't know was how to make that call to GET/POST from code, as I was doing it via browser, and the answer was just the <form> tag. I needed to make the following GETcall for looking for a user in the DB:

http://localhost:8080/c/portal/json_service?serviceClassName=com.liferay.test.service.TrabajadorServiceUtil&serviceMethodName=findByName&servletContextName=TrabajadorPlugin-portlet&serviceParameters=&param=Name

and that's how your <form> should look:

1<form method="get" action="http://localhost:8080/c/portal/json_service">
2    <input name="serviceClassName" type="hidden" value="com.liferay.test.service.TrabajadorServiceUtil" />
3    <input name="serviceMethodName" type="hidden" value="findByName" />
4    <input name="servletContextName" type="hidden" value="TrabajadorPlugin-portlet" />
5    <input name="serviceParameters" type="hidden" value="[param]" />
6    <input name="param" type="text" value="<%=searching%>" />
7    <input type="submit" value="Search" />
8</form>


And the same for the POST call, to store data in the database:

http://localhost:8080/c/portal/json_service?serviceClassName=com.liferay.test.service.TrabajadorServiceUtil&serviceMethodName=create&servletContextName=TrabajadorPlugin-portlet&serviceParameters=&param=Name

1<form method="post" action="http://localhost:8080/c/portal/json_service">
2    <input name="serviceClassName" type="hidden" value="com.liferay.test.service.TrabajadorServiceUtil" />
3    <input name="serviceMethodName" type="hidden" value="create" />
4    <input name="servletContextName" type="hidden" value="TrabajadorPlugin-portlet" />
5    <input name="serviceParameters" type="hidden" value="[param]" />
6    <input name="param" type="text" value="<%=employee%>" />
7    <input type="submit" value="Submit"/>
8</form>


NOTE that I use my methods created from the Liferay Build Service: findByName() and create() in the URLs.

1value="<%=searching%>"
AND
1value="<%=employee%>"
is used to get what user inputs in the fields created by <input name="param" type="text" ... /> lines.

and

1PortletPreferences prefs = renderRequest.getPreferences();
2String employee = (String)prefs.getValue("name", "New Employee"); 
3
4PortletPreferences prefs2 = renderRequest.getPreferences();
5String searching = (String)prefs2.getValue("search", "Search an Employee");


to get the user input and concatenate it to the end of the URL; it is in fact, almost the most important thing of these URLs, since it is the parameter that we're really looking for.

Once with that in my view.jsp (without any java class) I was able to store rows in my database and to retrieve the information.

I hope to help anybody with the same problem that me!! And thanks again for the help given to me!! emoticon
rzn adm
RE: Portlet with Web Service, store data in DB
May 30, 2012 9:18 PM
Answer

rzn adm

Rank: New Member

Posts: 8

Join Date: April 11, 2012

Recent Posts

Danial Mustofa Habibi:
hi there if you want to use your own database than lportal database u can use this on your service.xml on entity tag
1data-source="myAppDataSource" session-factory="myAppSessionFactory" tx-manager="myAppTransactionManager"

sample from my entity
1    <entity name="Jadwal" local-service="true" remote-service="true" table="jadwal" data-source="myAppDataSource" session-factory="myAppSessionFactory" tx-manager="myAppTransactionManager">
2    <column name="kode_jadwal" type="int" primary="true" ></column>
3    <column name="stasiun_asal" type="String"></column>
4    <column name="stasiun_tujuan" type="String"></column>
5        <column name="kode_kereta" type="String"></column>
6    </entity>
7   

then modify/create ext-spring.xml on your meta-inf folder
 1<?xml version="1.0"?>
 2<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
 3"http://www.springframework.org/dtd/spring-beans.dtd">
 4<beans>
 5  <bean class="
 6org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
 7  </bean>
 8  <bean id="myAppDataSourceTarget"               
 9     class="org.springframework.jdbc.datasource.DriverManagerDataSource">
10    <property name="driverClassName" value="com.mysql.jdbc.Driver" />
11    <property name="url" value="jdbc:mysql://localhost:3306/db_kereta" />
12    <property name="username" value="root" />
13    <property name="password" value="" />
14  </bean>
15  <bean id="myAppDataSource"                        
16      class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
17    <property name="targetDataSource">
18      <ref bean="myAppDataSourceTarget" />
19    </property>
20  </bean>
21  <bean id="myAppHibernateSessionFactory"
22      class="com.liferay.portal.spring.hibernate.PortletHibernateConfiguration">
23    <property name="dataSource">
24      <ref bean="myAppDataSource" />
25    </property>
26  </bean>
27  <bean id="myAppSessionFactory"                
28      class="com.liferay.portal.dao.orm.hibernate.SessionFactoryImpl">
29    <property name="sessionFactoryImplementor">
30      <ref bean="myAppHibernateSessionFactory" />
31    </property>
32  </bean>
33  <bean id="myAppTransactionManager"
34      class="org.springframework.orm.hibernate3.HibernateTransactionManager">         
35    <property name="dataSource">
36      <ref bean="myAppDataSource" />
37    </property>
38    <property name="sessionFactory">
39      <ref bean="myAppHibernateSessionFactory" />
40    </property>
41  </bean>
42</beans>

run service builder again.

Regards

Danial


Hello Danial,

Can u provide full tutorial for using external database for portlet?
Really appreciate if U can help.
Rafa Quinonero
RE: Portlet with Web Service, store data in DB
May 31, 2012 12:00 AM
Answer

Rafa Quinonero

Rank: Junior Member

Posts: 37

Join Date: March 22, 2012

Recent Posts

Hello Danial,

Can u provide full tutorial for using external database for portlet?
Really appreciate if U can help.

External DB like MySQL or external DB in a different server?
rzn adm
RE: Portlet with Web Service, store data in DB
May 31, 2012 12:11 AM
Answer

rzn adm

Rank: New Member

Posts: 8

Join Date: April 11, 2012

Recent Posts

Rafa Quinonero:
Hello Danial,

Can u provide full tutorial for using external database for portlet?
Really appreciate if U can help.

External DB like MySQL or external DB in a different server?


External DB like MySQL in different server. the settings itself in the portlet not in the Liferay.

Thanks.
Rafa Quinonero
RE: Portlet with Web Service, store data in DB
May 31, 2012 12:27 AM
Answer

Rafa Quinonero

Rank: Junior Member

Posts: 37

Join Date: March 22, 2012

Recent Posts

So what you need is a "Server Connection String". I can't hel you more because I have never used it, but it seems an interesting thing to know. Possibly with that you can research a little bit more about your issue.

Hope that helps.

Rafa
rzn adm
RE: Portlet with Web Service, store data in DB
May 31, 2012 1:50 AM
Answer

rzn adm

Rank: New Member

Posts: 8

Join Date: April 11, 2012

Recent Posts

Rafa Quinonero:
So what you need is a "Server Connection String". I can't hel you more because I have never used it, but it seems an interesting thing to know. Possibly with that you can research a little bit more about your issue.

Hope that helps.

Rafa


Yes, I know that but I dunno how to do it.

Can you share with me about your web services in portlet tutorial?

Thanks.
Rafa Quinonero
RE: Portlet with Web Service, store data in DB
May 31, 2012 1:57 AM
Answer

Rafa Quinonero

Rank: Junior Member

Posts: 37

Join Date: March 22, 2012

Recent Posts

rzn adm:
Rafa Quinonero:
So what you need is a "Server Connection String". I can't hel you more because I have never used it, but it seems an interesting thing to know. Possibly with that you can research a little bit more about your issue.

Hope that helps.

Rafa


Yes, I know that but I dunno how to do it.

Can you share with me about your web services in portlet tutorial?

Thanks.


Take a look at this page. I think that's what you are looking for to beginn with the portlet implementation.

Try it, if that's not what you are looking for, specify it a bit more, or ask here if you get issues while following that page.

http://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/service-build-5
rzn adm
RE: Portlet with Web Service, store data in DB
May 31, 2012 6:49 PM
Answer

rzn adm

Rank: New Member

Posts: 8

Join Date: April 11, 2012

Recent Posts

Rafa Quinonero:
rzn adm:
Rafa Quinonero:
So what you need is a "Server Connection String". I can't hel you more because I have never used it, but it seems an interesting thing to know. Possibly with that you can research a little bit more about your issue.

Hope that helps.

Rafa


Yes, I know that but I dunno how to do it.

Can you share with me about your web services in portlet tutorial?

Thanks.


Take a look at this page. I think that's what you are looking for to beginn with the portlet implementation.

Try it, if that's not what you are looking for, specify it a bit more, or ask here if you get issues while following that page.

http://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/service-build-5


I'm currently lost here. The page explain about web services and not a full tutorial which I can follow.
Rafa Quinonero
RE: Portlet with Web Service, store data in DB
June 1, 2012 1:01 AM
Answer

Rafa Quinonero

Rank: Junior Member

Posts: 37

Join Date: March 22, 2012

Recent Posts

rzn adm:
Rafa Quinonero:
rzn adm:
Rafa Quinonero:
So what you need is a "Server Connection String". I can't hel you more because I have never used it, but it seems an interesting thing to know. Possibly with that you can research a little bit more about your issue.

Hope that helps.

Rafa


Yes, I know that but I dunno how to do it.

Can you share with me about your web services in portlet tutorial?

Thanks.


Take a look at this page. I think that's what you are looking for to beginn with the portlet implementation.

Try it, if that's not what you are looking for, specify it a bit more, or ask here if you get issues while following that page.

http://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/service-build-5


I'm currently lost here. The page explain about web services and not a full tutorial which I can follow.


So, you need a tutorial for Service Builder or for connecting to your external database server?
I'm sorry, if you don't specify exactly what you need, I can't help you.
Riccardo Ferrari
RE: Portlet with Web Service, store data in DB
June 1, 2012 4:02 AM
Answer

Riccardo Ferrari

Rank: Regular Member

Posts: 137

Join Date: November 13, 2010

Recent Posts

Hi,

I think this link should help you. I tested and is working nicely.

http://bairdblog.wordpress.com/2011/02/11/using-liferay-6-0-x-service-builder-with-external-databases/

Regards,

Riccardo
Danial Mustofa Habibi
RE: Portlet with Web Service, store data in DB
June 1, 2012 7:42 AM
Answer

Danial Mustofa Habibi

Rank: Regular Member

Posts: 141

Join Date: November 1, 2011

Recent Posts

rzn adm:
Danial Mustofa Habibi:
hi there if you want to use your own database than lportal database u can use this on your service.xml on entity tag
1data-source="myAppDataSource" session-factory="myAppSessionFactory" tx-manager="myAppTransactionManager"

sample from my entity
1    <entity name="Jadwal" local-service="true" remote-service="true" table="jadwal" data-source="myAppDataSource" session-factory="myAppSessionFactory" tx-manager="myAppTransactionManager">
2    <column name="kode_jadwal" type="int" primary="true" ></column>
3    <column name="stasiun_asal" type="String"></column>
4    <column name="stasiun_tujuan" type="String"></column>
5        <column name="kode_kereta" type="String"></column>
6    </entity>
7   

then modify/create ext-spring.xml on your meta-inf folder
1<?xml version="1.0"?>
2<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
3"http://www.springframework.org/dtd/spring-beans.dtd">
4<beans>
5  <bean class="
6org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
7  </bean>
8  [code][code]
<bean id="myAppDataSourceTarget"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/db_kereta" />
<property name="username" value="root" />
<property name="password" value="" />
</bean>
<bean id="myAppDataSource"
class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
<property name="targetDataSource">
<ref bean="myAppDataSourceTarget" />
</property>
</bean>
<bean id="myAppHibernateSessionFactory"
class="com.liferay.portal.spring.hibernate.PortletHibernateConfiguration">
<property name="dataSource">
<ref bean="myAppDataSource" />
</property>
</bean>
<bean id="myAppSessionFactory"
class="com.liferay.portal.dao.orm.hibernate.SessionFactoryImpl">
<property name="sessionFactoryImplementor">
<ref bean="myAppHibernateSessionFactory" />
</property>
</bean>
<bean id="myAppTransactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="dataSource">
<ref bean="myAppDataSource" />
</property>
<property name="sessionFactory">
<ref bean="myAppHibernateSessionFactory" />
</property>
</bean>
</beans>
run service builder again.

Regards

Danial


Hello Danial,

Can u provide full tutorial for using external database for portlet?
Really appreciate if U can help.

hi there from my last post..that's more than enough if you want to use your own database,different server,...so what exactly what do you want to achieve??
just change this to meet your own requirement
1<bean id="myAppDataSourceTarget"               
2     class="org.springframework.jdbc.datasource.DriverManagerDataSource">
3    <property name="driverClassName" value="com.mysql.jdbc.Driver" />
4    <property name="url" value="jdbc:mysql://localhost:3306/db_kereta" />
5    <property name="username" value="root" />
6    <property name="password" value="" />
7  </bean>

and if you use oracle,ibm or other database, just put the driver on the bin folder

Regards

Danial
rzn adm
RE: Portlet with Web Service, store data in DB
June 3, 2012 7:33 PM
Answer

rzn adm

Rank: New Member

Posts: 8

Join Date: April 11, 2012

Recent Posts

Thanks guys.

I managed to make the portlet using external database using service.xml and ext-spring.xml.
Before run the portlet, I need to create the external database first.


p/s: anyone know how to implement web services in portlet? I need web services to retrieve data from other database server.
Danial Mustofa Habibi
RE: Portlet with Web Service, store data in DB
June 4, 2012 3:56 AM
Answer

Danial Mustofa Habibi

Rank: Regular Member

Posts: 141

Join Date: November 1, 2011

Recent Posts

rzn adm:
Thanks guys.

I managed to make the portlet using external database using service.xml and ext-spring.xml.
Before run the portlet, I need to create the external database first.


p/s: anyone know how to implement web services in portlet? I need web services to retrieve data from other database server.

Glad To hear that !!.....
what do you want to do?implementing your own service?or call other web service??
rzn adm
RE: Portlet with Web Service, store data in DB
June 4, 2012 7:15 PM
Answer

rzn adm

Rank: New Member

Posts: 8

Join Date: April 11, 2012

Recent Posts

Danial Mustofa Habibi:
rzn adm:
Thanks guys.

I managed to make the portlet using external database using service.xml and ext-spring.xml.
Before run the portlet, I need to create the external database first.


p/s: anyone know how to implement web services in portlet? I need web services to retrieve data from other database server.

Glad To hear that !!.....
what do you want to do?implementing your own service?or call other web service??


Thanks Danial, Its help a lot.

I want to create my own web services and the portlet is the web service's client. Any tutorial how to do this?
Danial Mustofa Habibi
RE: Portlet with Web Service, store data in DB
June 5, 2012 9:35 PM
Answer

Danial Mustofa Habibi

Rank: Regular Member

Posts: 141

Join Date: November 1, 2011

Recent Posts

Usually if you want to implement your own webservice, the things u need to do is enable the remote-service in your entity tag to true
1<entity name="Jadwal" local-service="true" remote-service="true"
2   

and just implement your code in your entityImpl. when you ant build-service ,its automatically web service, for your reference may be u can check this
WebService Liferay
Hope this help


Regards
Danial