I have just committed a demo JspPortlet illustrating usage of JspPortletAction and action events (see "JspStockQuote" entry in demo-portlets.xreg or select "Jsp Stock Portfolio" in the customizer, finance.stocks category). Please note that you have to check out current CVS tree to get this portlet.
Best regards, Mark Orciuch - [EMAIL PROTECTED] Jakarta Jetspeed - Enterprise Portal in Java http://jakarta.apache.org/jetspeed/ > -----Original Message----- > From: Javed Mahmud [mailto:[EMAIL PROTECTED]] > Sent: Monday, December 23, 2002 6:34 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: RE: Event Handling in JSPPortlet > > > 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 - [EMAIL PROTECTED] > > Jakarta Jetspeed - Enterprise Portal in Java > > http://jakarta.apache.org/jetspeed/ > > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
