dpillot     2005/11/30 17:11:12 CET

  Modified files:
    core/src/java/org/jahia/ajax/actionmenus 
                                             GetMenuItemsAction.java 
  Log:
  added readable debug
  
  Revision  Changes    Path
  1.6       +34 -5     
jahia/core/src/java/org/jahia/ajax/actionmenus/GetMenuItemsAction.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/java/org/jahia/ajax/actionmenus/GetMenuItemsAction.java.diff?r1=1.5&r2=1.6&f=h
  
  
  
  Index: GetMenuItemsAction.java
  ===================================================================
  RCS file: 
/home/cvs/repository/jahia/core/src/java/org/jahia/ajax/actionmenus/GetMenuItemsAction.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- GetMenuItemsAction.java   24 Nov 2005 16:11:31 -0000      1.5
  +++ GetMenuItemsAction.java   30 Nov 2005 16:11:12 -0000      1.6
  @@ -63,15 +63,13 @@
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
   import java.io.IOException;
  -import java.util.HashMap;
  -import java.util.Iterator;
  -import java.util.Map;
  -import java.util.Vector;
  +import java.util.*;
   
   /**
    * Gets the items of a specific Action Menu
    *
    * @author Xavier Lawrence
  + * @version $Id: GetMenuItemsAction.java,v 1.6 2005/11/30 16:11:12 dpillot 
Exp $
    */
   public class GetMenuItemsAction extends AjaxAction {
   
  @@ -219,7 +217,8 @@
   
               // Get all the information regarding the Action entries
               final Map info = getActionsInfo(bean, jParams);
  -            // logger.debug("ActionsInfo:\n" + info);
  +            // to display ajax response sended
  +            logger.debug(getReadableInfo(info));
   
               jParams.resetSubstituteEntryLoadRequest();
   
  @@ -347,4 +346,37 @@
   
           return result;
       }
  +
  +    /**
  +     * internal method to debug the ajax responses
  +     * @param map
  +     * @return a string
  +     */
  +    private String getReadableInfo(Map map){
  +        String launchers=(String)map.get(AJAX_LAUNCHER);
  +        String methods=(String)map.get(AJAX_METHOD);
  +        String images=(String)map.get(AJAX_IMAGE);
  +
  +        String[] launcherarrays=launchers.split(";{2}");
  +        String[] methodarrays=methods.split(";{2}");
  +        String[] imagearrays=images.split(";{2}");
  +        StringBuffer result=new StringBuffer();
  +        result.append("ACTIONS INFO\n");
  +        for(int i=0;i<launcherarrays.length;i++){
  +            result.append("[").append(i).append("] - LAUNCHERS: 
").append(launcherarrays[i].replaceAll("\\n",""));
  +            if(i<methodarrays.length) result.append(" METHODS: 
").append(methodarrays[i].replaceAll("\\n",""));
  +            else result.append(" METHODS: NA");
  +            if(i<imagearrays.length)result.append(" IMAGES: 
").append(imagearrays[i].replaceAll("\\n",""));
  +            else result.append(" IMAGES:NA");
  +            result.append("\n");
  +        }
  +        return result.toString();
  +    }
   }
  +
  +/**
  +*  $Log: GetMenuItemsAction.java,v $
  +*  Revision 1.6  2005/11/30 16:11:12  dpillot
  +*  added readable debug
  +*
  +*/
  \ No newline at end of file
  

Reply via email to