[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jetspeed-user
Subject:    RE: Event Handling in JSPPortlet
From:       "Javed Mahmud" <jmsyed () it ! uts ! edu ! au>
Date:       2002-12-24 0:34:18
[Download RAW message or body]

Hi Mark,
I have certain questions below if you can answer them i will be gratefull.

> Javed,
>
> I'm way too busy now to try to setup your portlets in my environment and
> test them that way. Here's some excerpts from a working JSP portlet:

Thanks for taking this much interest ....

>
> JSP:
> ===========================
> ....
> <%
> RunData data = (RunData)request.getAttribute("rundata");
> String jspeid = (String) request.getAttribute("js_peid");
>
> try {
> %>
> <FORM METHOD="POST" ACTION="<jetspeed:uriLookup type="Home"/>">
>   <INPUT TYPE="hidden" NAME="js_peid" VALUE="<%=jspeid%>">
>   Enter symbol(s) separated with commas: <input name="symbols"
> type="TEXT"><INPUT TYPE="SUBMIT" NAME="eventSubmit_doRefresh" VALUE="Get
> Quotes">
>   <TABLE BORDER="0" WIDTH="100%">
> ...

It seems that the following entry in the form tag is not required??

<input type="hidden" name="action" value="portlets.UserDetailAction"/>


>
> ACTION CLASS:
> ===========================
> package com.mycompany.modules.actions.portlets;
> ...
> public class YahooStockQuoteAction extends JspPortletAction
> {
>     /**
>      * Subclasses must override this method to provide default behavior
> * for the portlet action
>      */
>     protected void buildNormalContext(Portlet portlet, RunData rundata)
> {
>
>         this.doRefresh(rundata, portlet);
>     }
>
>     /**
>      * Portlet refresh event handler
>      *
>      * @param data
>      */
>     public void doRefresh(RunData rundata, Portlet portlet)
>     {
> ...


It does not make sense to me in that you are calling the event from
handler with in buildNormalcontext. I have a perception that doRefresh
shud be called before buildNormalContext correct me if I am wron. But if
this is not the case and one has to call doRefresh frm within the
buildNormalcontext in my opinion we dont require an events then. I doubt
that we have to call it frm inside buildNormalContext though.


>
> XREG:
> ===========================
> <portlet-entry name="StockQuotePortlet" hidden="false" type="ref"
> parent="JSP" application="false">
> 		<parameter name="template" value="YahooStockQuote.jsp" hidden="true"
> cachedOnName="true" cachedOnValue="true"/>
> 		<parameter name="action" value="portlets.YahooStockQuoteAction"
> hidden="true" cachedOnName="true" cachedOnValue="true"/>
> 		...
> 		<media-type ref="html"/>
> 		<url cachedOnURL="true"/>
> 		<category group="Jetspeed">finance.stocks</category>
> </portlet-entry>
>

I have an entry <classname> I guess this entry is not requied???
Can you plz explain what cachedOnName and cachedOnValue means??
What is the significance of category group tag??

> MY.PROPERTIES:
> ============================
> module.packages = com.mycompany.modules
>
>
> I noticed that you're overriding the default properties in my.properties
> file. Therefore I'm assuming that you've left the original property
> files unchanged. If that is the case, then you're missing the
> "module.packages" property (module.packages=com.adm.modules).

I have put in the
module.packages=com.adm.modules
entry in TurbineResources.properties file
other things are unchanged

> Also, I'm
> assuming that your .jsp files are located in
> /WEB-INF/templates/jsp/portlets/html. You are using 1.4b3, right?

jsp files are in  /WEB-INF/templates/jsp/portlets/html
================================================
but I am using 1.4b2 SHUD I CHANGE ??????
================================================

>
> BTW: There's no need to duplicate entries from tr.props or jr.props -
> put only things there that want to override.
>

I dont do that ecept I have certain things in mind that I have to change
in future...

> I don't recommend overriding torque properties in my.properties (I don't
> think that my documentation does that). This may work for now but may
> cause some problems in the future.  Hope this helps.
>

So u think its not a good practise to do this. Well what I was trying was
less dependency on the properties file frm Jetspeed. Do u recommend using
only the jar file from jetspeed or we shud download the whole suite???

Thanks Again
Javed

> Best regards,
>
> Mark Orciuch - morciuch@apache.org
> Jakarta Jetspeed - Enterprise Portal in Java
> http://jakarta.apache.org/jetspeed/




--
To unsubscribe, e-mail:   <mailto:jetspeed-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:jetspeed-user-help@jakarta.apache.org>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic