chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r893298 - in /hadoop/chukwa/trunk/src: java/org/apache/hadoop/chukwa/datastore/ViewStore.java java/org/apache/hadoop/chukwa/rest/bean/PagesBean.java java/org/apache/hadoop/chukwa/rest/bean/ParametersBean.java web/hicc/js/workspace/workspace.js
Date Tue, 22 Dec 2009 20:00:55 GMT
Author: eyang
Date: Tue Dec 22 20:00:55 2009
New Revision: 893298

URL: http://svn.apache.org/viewvc?rev=893298&view=rev
Log:
CHUKWA-438. Fixed column resizing issue in HICC (Eric Yang)

Modified:
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datastore/ViewStore.java
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/rest/bean/PagesBean.java
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/rest/bean/ParametersBean.java
    hadoop/chukwa/trunk/src/web/hicc/js/workspace/workspace.js

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datastore/ViewStore.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datastore/ViewStore.java?rev=893298&r1=893297&r2=893298&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datastore/ViewStore.java (original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datastore/ViewStore.java Tue Dec
22 20:00:55 2009
@@ -29,8 +29,8 @@
   private static String viewPath = config.get("fs.default.name")+File.separator+chukwaConf.get("chukwa.data.dir")+File.separator+"hicc"+File.separator+"views";
   private static String publicViewPath = viewPath+File.separator+"public";
   private static String usersViewPath = viewPath+File.separator+"users";
-  private static String PUBLIC = "PUBLIC".intern();
-  private static String PRIVATE = "PRIVATE".intern();
+  private static String PUBLIC = "public".intern();
+  private static String PRIVATE = "private".intern();
 
   public ViewStore() throws IllegalAccessException {
     ViewStore.config = HiccWebServer.getConfig();

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/rest/bean/PagesBean.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/rest/bean/PagesBean.java?rev=893298&r1=893297&r2=893298&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/rest/bean/PagesBean.java (original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/rest/bean/PagesBean.java Tue Dec
22 20:00:55 2009
@@ -36,6 +36,13 @@
         ColumnBean c = new ColumnBean(layout.getJSONArray(i));
         this.layout[i]=c;
       }
+      if(json.has("colSize")) {
+        JSONArray ja = json.getJSONArray("colSize");
+        columnSizes = new int[ja.length()];
+        for(int i=0; i< ja.length(); i++) {
+          columnSizes[i] = ja.getInt(i);
+        }
+      }
     } catch (JSONException e) {
       log.error(ExceptionUtil.getStackTrace(e));
       throw new ParseException(ExceptionUtil.getStackTrace(e), 0);
@@ -77,7 +84,7 @@
   }
   
   public void setColSize(int[] size) {
-    this.columnSizes = size;    
+    this.columnSizes = size;
   }
 
   @XmlElement(name="columns")

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/rest/bean/ParametersBean.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/rest/bean/ParametersBean.java?rev=893298&r1=893297&r2=893298&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/rest/bean/ParametersBean.java (original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/rest/bean/ParametersBean.java Tue
Dec 22 20:00:55 2009
@@ -1,6 +1,8 @@
 package org.apache.hadoop.chukwa.rest.bean;
 
 import java.text.ParseException;
+import java.util.Collection;
+import java.util.HashSet;
 
 import javax.xml.bind.annotation.XmlElement;
 import org.apache.commons.logging.Log;
@@ -14,9 +16,11 @@
   private static Log log = LogFactory.getLog(ParametersBean.class);
   private String name=null;
   private String type=null;
-  private String value=null;
+  private Collection<String> value=null;
   private String control=null;
   private String label=null;
+  private String callback=null;
+  private int edit=1;
   private OptionBean[] options=null;
   
   public ParametersBean() {    
@@ -26,7 +30,20 @@
     try {
       name=json.getString("name");
       type=json.getString("type");
-      value=json.getString("value");
+      if(json.has("value")) {
+        if(json.get("value").getClass()==JSONArray.class) {
+          JSONArray ja = json.getJSONArray("value");
+          Collection<String> c = new HashSet<String>();
+          for(int i = 0; i < ja.length(); i++) {
+            c.add(ja.getString(i));
+          }
+          this.value = c;
+        } else {
+          Collection<String> c = new HashSet<String>();
+          c.add(json.getString("value"));
+          this.value = c;
+        }        
+      }
       if(json.has("label")) {
         label=json.getString("label");
       } else {
@@ -35,6 +52,9 @@
       if(json.get("type").toString().intern()=="custom".intern()) {
         control=json.getString("control");
       }
+      if(json.has("callback")) {
+        callback=json.getString("callback");
+      }
       if(json.has("options")) {
         JSONArray aj = json.getJSONArray("options");
         options = new OptionBean[aj.length()];
@@ -43,6 +63,9 @@
           options[i]=o;
         }
       }
+      if(json.has("edit")) {
+        edit=json.getInt("edit");
+      }
     } catch (Exception e) {
       log.error(ExceptionUtil.getStackTrace(e));
       throw new ParseException(ExceptionUtil.getStackTrace(e), 0);
@@ -60,10 +83,10 @@
   }
 
   @XmlElement
-  public String getValue() {
+  public Collection<String> getValue() {
     return value;
   }
-  
+
   @XmlElement
   public String getControl() {
     return control;  
@@ -79,6 +102,16 @@
    return options; 
   }
   
+  @XmlElement
+  public int getEdit() {
+    return edit;
+  }
+
+  @XmlElement
+  public String getCallback() {
+    return callback;
+  }
+
   public void setName(String name) {
     this.name = name;
   }
@@ -86,8 +119,8 @@
   public void setType(String type) {
     this.type = type;
   }
-  
-  public void setValue(String value) {
+
+  public void setValue(Collection<String> value) {
     this.value = value;
   }
   
@@ -103,22 +136,40 @@
     this.options = options;
   }
   
+  public void setEdit(int edit) {
+    this.edit = edit;
+  }
+  
+  public void setCallback(String callback) {
+    this.callback = callback;  
+  }
+
   public JSONObject deserialize() {
     JSONObject json = new JSONObject();
     try {
       json.put("name",this.name);
       json.put("type",this.type);
-      json.put("value",this.value);
+      if(this.value!=null) {
+        JSONArray ja = new JSONArray();
+        for(String s : this.value) {
+          ja.put(s);
+        }
+        json.put("value", ja);
+      }
       if(control!=null) {
         json.put("control",this.control);
       }
       json.put("label",this.label);
+      json.put("edit",this.edit);
+      if(this.callback!=null) {
+        json.put("callback", callback);
+      }
       if(options!=null) {
         JSONArray ja = new JSONArray();
         for(int i=0;i<options.length;i++) {
           ja.put(this.options[i].deserialize());          
         }
-        json.put("options", (JSONArray) ja);
+        json.put("options", ja);
       }
     } catch (Exception e) {
       log.error(ExceptionUtil.getStackTrace(e));

Modified: hadoop/chukwa/trunk/src/web/hicc/js/workspace/workspace.js
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/web/hicc/js/workspace/workspace.js?rev=893298&r1=893297&r2=893298&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/web/hicc/js/workspace/workspace.js (original)
+++ hadoop/chukwa/trunk/src/web/hicc/js/workspace/workspace.js Tue Dec 22 20:00:55 2009
@@ -1628,7 +1628,7 @@
     	            }
                     p.layout[colIndex]=new Object();
 	    	    p.layout[colIndex].widgets=c;
-		    p.colSize[colIndex]=getWidth(cols[j]);
+		    p.colSize[colIndex]=""+getWidth(cols[j]);
                     colIndex++;
 	        }
 	    }



Mime
View raw message