Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

To the author: How to locate various data from remote portal or data sources?

 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeff and David,

In case I need gather various data from different remote portal, what communication channel should I choose?

In addition to RMI and Web Services, are there any other ways for that?

Also, how about if the portlet needs to communicate to external data sources? What should I do?

Thanks for your opinion.

Nick
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A portlet is very much like any other web application with regard to how you use remote data sources, be it a database, a web service, or a proprietary management system.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But are there any special ways to achieve this in Portal?

Nick
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nicholas Cheung:
But are there any special ways to achieve this in Portal?

Nick


Today : you can use same web application (Datasource refer to remote database server)

In the future , WebService is best. (Today have problem about Security system)
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are currently using WebService already, however, we need to develop our own WebServices to access remote portals.

What we are worried about is, in case, in future, there is a standard suddenly comes out, our system becomes non-JSR compliant.

Nick
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nicholas Cheung:
What we are worried about is, in case, in future, there is a standard suddenly comes out, our system becomes non-JSR compliant.

How many standards have you seen that have "suddenly came out"...?
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

How many standards have you seen that have "suddenly came out"...?

I mean, in case there are new stuffs come out, not now, but in future, our system will then violate with the standard, as we dont have it now.

It is always a problem, however, as we need to make sure our Portlets could be communicated with Portlets that developed based on the new standard.

Any thoughts? Shall we really go for our own development for Portal applications communication? Or we wait?

Nick
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Portal should only any kind of view to back end systems? Isn't it?
Than you should communicate with back end system, not with the portal itself.
Am I wrong?
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Portal should only any kind of view to back end systems? Isn't it?
Than you should communicate with back end system, not with the portal itself.


Not really.

In case we have a portlet that need to get data from Yahoo, Yahoo will not allow us to access it directly (just like Web Services, only some part of the system can be accessed). Thus, we might only be able to access the portlet from Yahoo, which has already render some data for us to display.

In such sense, we will not be able to access the backend system. We can only access the portlet. It is just the same case for EJB that, EJB is going to access another EJB via EJBObject (or EJBLocalObject), but not the EJB itself. However, there is a well-defined communication methods for EJBs, while there is still no formal method for portal application communication.

Nick
 
Jeff Linwood
Author
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The only specification that specifically has to do with portals is the Web Services for Remote Portlets (WSRP) specification. We discuss WSRP in one chapter of our book.

With WSRP, you can have portlets executing on one server that are displayed in a portal running on another server. This is a little confusing, so let me give an example. A car company might create a "Build your own Car" portlet that lets a user pick options for a car and get a price. The car company would host the "Build your own car" portlet on its server, and then make it available over WSRP. Each car dealer would have their own portal, and they would subscribe to the "Build your own car" portlet that runs on the other server. When a customer comes to the car dealer portal, they would see the WSRP remote portlet just like any other portlet that runs locally. But when they interact with the portlet, the car dealer portal sends the request to the car manufacturer's server, which then passes the response back.

The advantage here is that the car manufacturer does all the upgrading, installation, maintenance, etc. for the "Build your own car" portlet. The car dealers only need to add the portlet through their portal's administrative interface, they do not need to install the portlet locally.

Another advantage is that this is technology-agnostic - as long as the portal understands WSRP, it doesn't matter whether it is Java, .NET, PHP, etc.

Hope this helps,
Jeff
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeff, thanks for the detailed explanation.

In your example, I suddenly has a thought on that.

For example, the "screen" contains 4 portlets, one for wheel, one for body, one for the inner structure, and one for color. If, say, I choose a wheel, a body, a type of structure, and color in grey, and then click submit, what should happen? All 4 portlets have been updated accordingly, or only one of them being updated, and the rest 3 data lost?

Thanks

Nick
 
Dave Minter
Author
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nicholas Cheung:

For example, the "screen" contains 4 portlets, one for wheel, one for body, one for the inner structure, and one for color. If, say, I choose a wheel, a body, a type of structure, and color in grey, and then click submit, what should happen? All 4 portlets have been updated accordingly, or only one of them being updated, and the rest 3 data lost?


Only one of them will have been updated, and the rest will be left as-is. Unless you choose to have them behave differently; if they all communicate with a common back-end of information, they will all get the opportunity to update their output in response to the change.

But the general case is that actions carried out on one portlet do not affect other portlets.

Dave.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David.

I have written down my case in another thread. But anyway, to my understanding, the page presents to the user is just a plain HTML page, he has no knowledge that this page is composed of, say, 4 portlets. Thus, he might just click a button to submit data for 1 portlet, however, will the rest 3 portlets being triggered with this action, get the data, and doing the redisplay?

We have tried before but with no luck for this at all, when page refreshes, except the portlet that triggers the newly retrieved data, the data in the rest 3 portlets lost.

Are there any magic that I needed?

Nick
 
Dave Minter
Author
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


We have tried before but with no luck for this at all, when page refreshes, except the portlet that triggers the newly retrieved data, the data in the rest 3 portlets lost.


When the page refreshes all portlets receive a render request. This is their opportunity to reflect any changes in underlying data. It doesn't matter which portlet received the action that caused the refresh.

Dave.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do I need special handling? As the current case is that the rest 3 portlets seems dont receive any render request.

Nick
 
Dave Minter
Author
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, actually I think I misunderstood your last question; you're speaking of (for instance) entering form data on four distinct portlets, aren't you?

Portlets can't share forms, so yes, in this case you'll lose changes.

There are various work-arounds for that; probably the best is to only allow form-changes to be made on one portlet at a time. You could also "force" submit any changes to a field once focus is lost.

This problem is not fundamentally different to the usual situation when you have two forms with distinct action urls on one page.

Dave.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, do you mean each portlet should subsribe to each other, so that whenever there are changes, every portlet knows ALL changes, and no matter which "portion" of portlet to be submitted, all changes are going to submit?

Thanks Dave.

Nick
[ November 12, 2004: Message edited by: Nicholas Cheung ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic