portals-jetspeed-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Olsen" <danrol...@utah.gov>
Subject Re: Portlets with Forms and Communication with a database
Date Fri, 18 Apr 2008 19:49:48 GMT
How about when talking to the database? All the portlets will be talking to the same database
and I don't want to have to change all the portlets code to point to the new production database.
Is there a way I can define the database properties and use that and make it so I only have
to update the database information in one place? Something like a preferences file? 
 
I'm new to Java web programming so I'm not sure how this is all done. I know with PHP I could
just have a config file where I can read the information from. I'd like to do something like
that in Java with my portlets.

>>> "Andrew Strickland" <strickla@gmail.com> 4/18/2008 1:44 PM >>>
Don't have time to post examples but...

Using a form on the edit page shouldn't be any different than using a
form on the view or help page.  I've done it and there's really
nothing exceptional.  Just handle the form submission in your
portlet's processAction method.

You can put a hidden input into your form with a name like "action"
and give it a value of "edit" or "save" so that you can differentiate
between which portlet page the submission is coming from.  There might
be better ways to do that but this way is easy and simple.

The way I use the edit page is as the page that can modify the portlet
preferences.  So any form submission from the edit page is a change to
a preference which the portlet then makes use of  Jetspeed's
preference database to store.

On Fri, Apr 18, 2008 at 3:36 PM, Dan Olsen <danrolsen@utah.gov> wrote:
> Does anyone know of any example portlets that use forms in the Edit window state and
the new information from the form is then stored in a database? I need to do this for my project
and I'm looking for some best practices on how to do this.
>
>  - Dan
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org 
For additional commands, e-mail: jetspeed-user-help@portals.apache.org 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message