You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2003/08/28 12:10:22 UTC

cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/task CocoonTaskWrapper.java

andreas     2003/08/28 03:10:22

  Modified:    src/java/org/apache/lenya/cms/cocoon/task
                        CocoonTaskWrapper.java
  Log:
  some bugfixes, improved log messages
  
  Revision  Changes    Path
  1.3       +27 -6     cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/task/CocoonTaskWrapper.java
  
  Index: CocoonTaskWrapper.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/task/CocoonTaskWrapper.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CocoonTaskWrapper.java	25 Aug 2003 15:40:55 -0000	1.2
  +++ CocoonTaskWrapper.java	28 Aug 2003 10:10:22 -0000	1.3
  @@ -55,6 +55,7 @@
   */
   package org.apache.lenya.cms.cocoon.task;
   
  +import java.util.Iterator;
   import java.util.Map;
   
   import org.apache.avalon.framework.parameters.Parameters;
  @@ -93,6 +94,8 @@
        * @throws ExecutionException when something went wrong.
        */
       public CocoonTaskWrapper(Map objectModel, Parameters parameters) throws ExecutionException {
  +        
  +        log.debug("Creating CocoonTaskWrapper");
   
           Publication publication;
           try {
  @@ -113,7 +116,7 @@
           String webappUrl = ServletHelper.getWebappURI(request);
           initialize(taskId, publication, webappUrl, taskParameters);
   
  -        String eventName = (String) request.getParameter(WorkflowInvoker.EVENT_REQUEST_PARAMETER);
  +        String eventName = request.getParameter(WorkflowInvoker.EVENT_REQUEST_PARAMETER);
           if (eventName != null) {
               Identity identity = Identity.getIdentity(request.getSession(false));
               Role[] roles;
  @@ -133,13 +136,30 @@
        */
       protected void setNotifying(Request request) {
   
  -        log.debug("Initializing Notification");
  +        log.debug("Trying to initialize notification ...");
   
           Map requestParameters = ServletHelper.getParameterMap(request);
  +
  +        log.debug("    Request parameters:");
  +        for (Iterator i = requestParameters.keySet().iterator(); i.hasNext(); ) {
  +            Object key = i.next();
  +            log.debug("        [" + key + "] = [" + requestParameters.get(key) + "]");
  +        }
  +
           NamespaceMap notificationMap =
               new NamespaceMap(requestParameters, Notifier.NOTIFICATION_PREFIX);
   
  -        if (!notificationMap.getMap().isEmpty()) {
  +        log.debug("    Notification parameters:");
  +        for (Iterator i = notificationMap.getMap().keySet().iterator(); i.hasNext(); ) {
  +            Object key = i.next();
  +            log.debug("        [" + key + "] = [" + notificationMap.getMap().get(key) + "]");
  +        }
  +
  +        if (notificationMap.getMap().isEmpty()) {
  +            log.debug("    No notification parameters found.");
  +        }
  +        else {
  +            log.debug("    Initializing notification");
   
               String toKey =
                   NamespaceMap.getFullName(Notifier.NOTIFICATION_PREFIX, Notifier.PARAMETER_TO);
  @@ -151,10 +171,11 @@
               }
   
               for (int i = 0; i < toValues.length; i++) {
  -                if (i > 0) {
  +                if (i > 0 && !"".equals(toString)) {
                       toString += ",";
                   }
  -                toString += toValues[i];
  +                log.debug("    Adding notification address [" + toValues[i].trim() + "]");
  +                toString += toValues[i].trim();
               }
   
               notificationMap.put(Notifier.PARAMETER_TO, toString);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org