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

List:       jetspeed-user
Subject:    RE: Need Help for use event action with JspPortletAction
From:       "Richard Berger" <richard.berger () actiontech ! com>
Date:       2004-01-29 16:40:11
Message-ID: EA7BD8FBFE2B674D84722D3BFB3941FED5CF01 () fargo ! corp ! actiontech ! com
[Download RAW message or body]

One other thought (possibly misguided), but it occurred to me that
perhaps your action class is not in the right location.  I recall
reading that all action class is placed in the module path,
conventionally under the portlets directory - and the examples I have
seen all look like portlets.Discipline action.  

Good luck,
RB 



Twenty Years | One Mission | Accelerating Business Processes 


Richard Berger 
Action Technologies, Inc. 
VP, Product Management 
510.748.1017 (Office) 
510.769.0596 (Fax) 
www.actiontech.com 

NOTE: The opinions expressed herein are those of the writer and not necessarily those \
                of Action Technologies, Inc. or its employees or its affiliates. 
-----Original Message-----
From: Benoit Tramblay [mailto:benoit.tramblay@technomedia.ca] 
Sent: Thursday, January 29, 2004 6:26 AM
To: jetspeed-user@jakarta.apache.org
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: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: 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