Hi Nico,

thank you - yes, that's exactly what I was looking for.  Just so you know -
the web-in-a-box src package doesn't contain the source, it has 2 war files
instead.

Regards
Emile

----- Original Message -----
From: "Nico Klasens" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 17, 2004 4:43 AM
Subject: RE: Editwizard question


> 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
>


Reply via email to