Hi emile,

If you mean with 'final step' hitting the save or cancel button on the
main/first wizard and return to another url then my answer would be YES. You
could use the referrer parameter to the wizard.jsp. This referrer parameter
was used in earlier versions to extend the templates of the wizards. Now
there is a templates parameter which can be used to override xsl's,
javascript and css. You still have to watch out because you can't use urls
with querystrings.

I like to add 2 jsp pages (or struts actions) which surround the editwizard
process. You can do all kinds of stuff to control your wizard process. In a
project these 2 jsp pages get polluted with all kinds of session attritubes
to pass in extra information to the wizards. The closewizard.jsp has to
clean all session attributes. The openwizard has to be robust enough to
recover from attributes still on the session. People always find a way to
not visit the closewizard.jsp.

The /editors/openwizard.jsp looks like this;
----------------------------------------------------------------------------
-----
<%!
   private static String REFERRER_URL = "/editors/closewizard,jsp";
   private static String TEMPLATES = "/editors/editwizards";
   private static String WIZARD_JSP =
"../mmbase/edit/wizard/jsp/wizard.jsp";
   private static String PARAMS = "language=nl";
%>
<%
  String objectNumber = null;

  String action = request.getParameter("action");
  if ("create".equals(action)) {
         objectNumber = "new";
  } else {
         objectNumber = request.getParameter("objectnumber");
  }

  String wizardConfigName = request.getParameter("wizard");
  if (wizardConfigName != null && !"".equals(wizardConfigName)) {
         throw new RuntimeException(
                           "No wizard available. Provide a wizard
parameter");
  }

  String returnurl = request.getParameter("returnurl");
  if (returnurl != null && !"".equals(returnurl)) {
    session.setAttribute("returnurl", returnurl);
  }
  else {
    session.removeAttribute("returnurl");
  {

  // Editwizard starten:
  response.sendRedirect(WIZARD_JSP + "?" + PARAMS +
        "&wizard=" + wizardConfigName + "&objectnumber=" + objectNumber +
        "&templates=" + TEMPLATES + "&referrer=" + REFERRER_URL);
%>
----------------------------------------------------------------------------
-----
The second /editors/closewizard,jsp
----------------------------------------------------------------------------
-----
<%
String returnurl = request.getParameter("returnurl");
if (returnurl == null || "".equals(returnurl)) {
  returnurl = (String) session.getAttribute("returnurl");
  session.removeAttribute("returnurl");
}
if (returnurl != null && !"".equals(returnurl)) {
  response.sendRedirect(returnurl);
}
else {
  response.sendRedirect("empty.html");
}
%>
----------------------------------------------------------------------------
-----


The 'famous' projects I worked on (Web-In-A-Box and leeuwarden.nl) have
these 2 things to add workflow settings to the wizards. The returnurl
parameter on the openwizard.jsp will return you to any page you want. In
some projects I added some extra parameters to the return url. For example,
the last edited node number and the action (save/cancel) could be nice to
get back.

Nico

> -----Oorspronkelijk bericht-----
> Van: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] Namens Emile
> Verzonden: zaterdag 17 juli 2004 0:59
> Aan: [EMAIL PROTECTED]
> Onderwerp: Editwizard question
> 
> 
> Hi All
> 
> is it possible to call another jsp as a final step in an 
> editwizard process?
> 
> Thanks
> 
> Regards
> Emile


Reply via email to