If I remember correctly, at some point there was a restriction on how method
should be called. It only accepted "doSomething": starts with "do" and only
one capital letter thereafter.
I don't know if this is still true; I switched to Struts for my portlets.

-----Original Message-----
From: Benoit Tramblay [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 29, 2004 9:02 AM
To: Jetspeed Users List
Subject: RE: Need Help for use event action with JspPortletAction


 
Thanks for your response, but it doesn'work again.

The signature of event action in action class must be :

1 - void doEventAction(RunData rundata, Context context) throws
Exception 

OR

2 -void doEventAction(RunData rundata, Portlet portlet) throws Exception


Thanks
-----Original Message-----
From: Dmitry Sklyut [mailto:[EMAIL PROTECTED] 
Sent: 29 janvier 2004 09:37
To: 'Jetspeed Users List'
Subject: RE: Need Help for use event action with JspPortletAction

Remove <input type="hidden" name="action" value="DisciplineAction">

from your JSP.  If you have it in there Turbine Action will be invocked
not Jetspeed one.

Take a look here (From Jetspeed FAQ):
Most common mistake with portlets is to use the hidden action variable
and set it to the portlet's action class:

<form name="form" action="http://myhost/ThingWeb/portal"; method="get">
<input type="hidden" name="js_peid" value="<%=jspeid%>"/> <input
type="hidden" name="action" value="ThingieSearchAction"/> <input
type="submit" name="eventSubmit_doSearch" value="Search"> <input
type="reset" value="Clear Fields"> <input type="text" name="thingieid"
size="20"> </form>
In the above example, Turbine executes the action before the portlet and
therefore the context is null. The above should be rewrittern as
follows:

<form name="form" action="<js:portletlink template="" />" method="get">
<input type="hidden" name="js_peid" value="<%=jspeid%>"/> <input
type="submit" name="eventSubmit_doSearch" value="Search"> <input
type="reset" value="Clear Fields"> <input type="text" name="thingieid"
size="20"> </form> 

Dmitry



-----Original Message-----
From: Benoit Tramblay [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 29, 2004 9:26 AM
To: [EMAIL PROTECTED]
Subject: Need Help for use event action with JspPortletAction


 
Hello,
 
My event action doesn't work in my portlet, I don't know why:
 
Xreg File :
 
    <portlet-entry name="DisciplinePortlet" hidden="false"
        type="instance" parent="JSP" application="false">
        <meta-info>
            <title>Disciplines</title>
            <description>     Affiche la liste des disciplines
</description>
        </meta-info>
 
<classname>org.apache.jetspeed.portal.portlets.JspPortlet</classname>
        <parameter name="template" value="Discipline.jsp" hidden="true"
            cachedOnName="true" cachedOnValue="true"/>
        <parameter name="edit.template" value="EditDiscipline.jsp"
            hidden="true" cachedOnName="true" cachedOnValue="true"/>
        <parameter name="action" value="DisciplineAction" hidden="true"
            cachedOnName="true" cachedOnValue="true"/>
        <media-type ref="html"/>
        <url cachedOnURL="true"/>
    </portlet-entry>

Action Class :
 
public class DisciplineAction extends JspPortletAction implements
IAttributeRequest, IAttributeSession, IWebAction {

....

/**
* Static initialization of the logger for this class */ 

private static final JetspeedLogger logger =
JetspeedLogFactoryService.getLogger(DisciplineAction.class.getName()); 

// Gestion de la cache
protected CacheManager cache;

/**
* Build the normal state content for this portlet.
*
* @param portlet The jsp-based portlet that is being built.
* @param rundata The turbine rundata context for this request.
*/

protected void buildNormalContext(Portlet portlet, RunData rundata) {
try {
        doList(rundata,portlet);
}
catch(Exception e) {
        rundata.setMessage("Error : " + e);
}
}

public void doList(RunData rundata, Portlet portlet) throws
SigalAppException {

logger.info("Enter dans doList");
List parameters = transformToBeanList(getAllDiscipline(rundata,portlet),
transformer); Collections.sort(parameters);
rundata.getRequest().setAttribute(ATTRIBUT_PARAMETER_BEAN_LIST,
parameters); logger.info("Enter dans doList");

}

public void doGetBean(RunData rundata, Portlet portlet) throws Exception
{

System.out.println("Enter dans doGetBean"); int parameterId =
Integer.parseInt((String)
rundata.getRequest().getParameter(ATTRIBUT_PARAMETER_ID));
rundata.getRequest().setAttribute(ATTRIBUT_PARAMETER_BEAN,
transformer.transformToBean(getDiscipline(rundata, portlet,
parameterId)));

String editTemplate =
portlet.getPortletConfig().getInitParameter("edit.template",
"EditDiscipline.jsp");


setTemplate(rundata, editTemplate, true);

System.out.println("Sortie dans doGetBean");

}

JSP:

<form method="post" action="<jetspeed:dynamicUri/>">

 <input type="hidden" name="js_peid" value="<%=jspeid%>">  <input
type="hidden" name="action" value="DisciplineAction">  <INPUT
TYPE="hidden" NAME="<%= IAttributeRequest.ATTRIBUT_PARAMETER_ID
%>" VALUE="1">              
 <input type="submit" name="eventSubmit_doGetBean" value="Save"/> <input
type="submit" name="eventSubmit_doList" value="Liste"/> </form> </TABLE>

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to