You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Davide Mora <d_...@yahoo.com> on 2002/02/20 13:04:15 UTC

input from databases

Hi,

i new to jetspeed, i need to query a database for
populate a grid, since i've not found a portlet for
this job, i'm thinking about write one.
I can connect the db, execute the query (taken from
the parameters), and run a velocity macro putting the
jdbc recordset in the velocity's context.
I think it's a quite common problem, maybe can be
included in the portlet catalog?

Regards,
Davide


__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: input from databases

Posted by David Sean Taylor <da...@bluesunrise.com>.
Hi Davide,

I think this is a good concept for a portlet.
This is just my two cents, not a requirement or anything:

I've been thinking about a general 'dataview' or 'grid' portlet too.
Perhaps a even more generalized portlet: 'scrolling' portlet, one that
supports iframe and one that doesn't.
The grid portlet would inherit from the scrolling portlet, to support a
scrolling 'dataview' grid with the typical controls for next record,
previous, next page etc... The connection to the database would be
configured from the 'customize' view of the portlet. You should be able
to select a table to view, or enter a SQL query from a visual query
builder... ;)

> > o Use pool services to maintain database
> > connections.  This it is
> > minimize database open and close operations.  Their
> > could be 100+ 
> > instance of this portlet.
> 
> can you give me a hint where i have to search? i
> suppose turbine have something like that, but i'm not
> familiar with it.

If you use the Turbine connection pooling, don't use the DBConnection
classes. The problem with this, as far as I can see, is that you have to
setup your database connections in the TurbineResources.properties. A
true generic grid would be able to take connection parameters at
runtime, and make connections then.

However, I believe you can use the connection pooling directly without
all the Turbine db framework, see the javadocs

http://www.bluesunrise.com/jetspeed-docs/turbine-2001-1124-javadocs/org/
apache/turbine/util/db/pool/ConnectionPool.html






> -----Original Message-----
> From: Davide Mora [mailto:d_mora@yahoo.com] 
> Sent: Wednesday, February 20, 2002 7:38 AM
> To: Jetspeed Users List
> Subject: Re: input from databases
> 
> 
> 
> Hi,
> i need some clarifications:
> 
> > o Everything must be configurable, specifically the
> > database connection.
> 
> the test (quick&dirty) i made today my portlet accept
> this parameters:
> 
> <parameter name="query" value="select
> regione,categoria,prezzo from tariffe order by
> regione" hidden="false"/>
> <parameter name="driver" value="oracle.jdbc.driver.OracleDriver"/>
> <parameter name="url" value="jdbc:oracle:thin:@sputnik:1521:rgdb"/>
> <parameter name="user" value="system"/>
> <parameter name="password" value="manager"/>
> <parameter name="template" value="tariffe"
> hidden="false"/>
> 
> i'm thinking also about add a transaction level
> parameter.
> 
> > My preference is to registry parameters over JR.p.
> 
> what is "JR.p"?
> 
> I used the same approach i found in the velocity
> portlet:
> 
> String template = getPortletConfig().getInitParameter("template");
> 
> 
> > o Use pool services to maintain database
> > connections.  This it is
> > minimize database open and close operations.  Their
> > could be 100+ 
> > instance of this portlet.
> 
> can you give me a hint where i have to search? i
> suppose turbine have something like that, but i'm not
> familiar with it.
> 
> 
> > o Use the localization facility (i10.xxx).  The
> > portlet MUST support
> > many languages.
> 
> any example? i took a look to the velocity/cocoon/poll 
> portlets, and i've not found anything about localization.
> 
> > o Keep the implementation general
> 
> no problem about this. :)
> 
> Davide
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Sports - Coverage of the 2002 Olympic Games 
http://sports.yahoo.com

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: input from databases

Posted by Davide Mora <d_...@yahoo.com>.
Hi,
i need some clarifications:

> o Everything must be configurable, specifically the
> database connection. 

the test (quick&dirty) i made today my portlet accept
this parameters:

<parameter name="query" value="select
regione,categoria,prezzo from tariffe order by
regione" hidden="false"/>
<parameter name="driver"
value="oracle.jdbc.driver.OracleDriver"/>
<parameter name="url"
value="jdbc:oracle:thin:@sputnik:1521:rgdb"/>
<parameter name="user" value="system"/>
<parameter name="password" value="manager"/>
<parameter name="template" value="tariffe"
hidden="false"/>

i'm thinking also about add a transaction level
parameter.

> My preference is to registry parameters over JR.p.

what is "JR.p"?

I used the same approach i found in the velocity
portlet:

String template =
getPortletConfig().getInitParameter("template");


> o Use pool services to maintain database
> connections.  This it is 
> minimize database open and close operations.  Their
> could be 100+ 
> instance of this portlet.

can you give me a hint where i have to search? i
suppose turbine have something like that, but i'm not
familiar with it.


> o Use the localization facility (i10.xxx).  The
> portlet MUST support 
> many languages.

any example? i took a look to the velocity/cocoon/poll
portlets, and i've not found anything about
localization.

> o Keep the implementation general

no problem about this. :)

Davide



__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: input from databases

Posted by Paul Spencer <pa...@apache.org>.
Davide,

I look forward to the implementation.  A few suggestions:

o Everything must be configurable, specifically the database connection. 
My preference is to registry parameters over JR.p.

o Use pool services to maintain database connections.  This it is 
minimize database open and close operations.  Their could be 100+ 
instance of this portlet.

o Use the localization facility (i10.xxx).  The portlet MUST support 
many languages.

o Keep the implementation general

Paul Spencer


Davide Mora wrote:

> Hi,
> 
> i new to jetspeed, i need to query a database for
> populate a grid, since i've not found a portlet for
> this job, i'm thinking about write one.
> I can connect the db, execute the query (taken from
> the parameters), and run a velocity macro putting the
> jdbc recordset in the velocity's context.
> I think it's a quite common problem, maybe can be
> included in the portlet catalog?
> 
> Regards,
> Davide
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Sports - Coverage of the 2002 Olympic Games
> http://sports.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>