ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r792480 - in /incubator/ace/trunk: core/ webui/src/org/apache/ace/client/ webui/src/org/apache/ace/client/services/ webui/src/org/apache/ace/server/ webui/war/ webui/war/WEB-INF/
Date Thu, 09 Jul 2009 10:16:50 GMT
Author: marrs
Date: Thu Jul  9 10:16:50 2009
New Revision: 792480

URL: http://svn.apache.org/viewvc?rev=792480&view=rev
Log:
ACE-26 applied patch, added zip to main build (for webui based server)

Added:
    incubator/ace/trunk/webui/src/org/apache/ace/client/GroupTable.java   (with props)
    incubator/ace/trunk/webui/src/org/apache/ace/client/LicenseTable.java   (with props)
    incubator/ace/trunk/webui/src/org/apache/ace/client/ObjectTable.java   (with props)
    incubator/ace/trunk/webui/src/org/apache/ace/client/services/GroupDescriptor.java   (with
props)
    incubator/ace/trunk/webui/src/org/apache/ace/client/services/GroupService.java   (with
props)
    incubator/ace/trunk/webui/src/org/apache/ace/client/services/GroupServiceAsync.java  
(with props)
    incubator/ace/trunk/webui/src/org/apache/ace/client/services/LicenseDescriptor.java  
(with props)
    incubator/ace/trunk/webui/src/org/apache/ace/client/services/LicenseService.java   (with
props)
    incubator/ace/trunk/webui/src/org/apache/ace/client/services/LicenseServiceAsync.java
  (with props)
    incubator/ace/trunk/webui/src/org/apache/ace/server/GroupServiceImpl.java   (with props)
    incubator/ace/trunk/webui/src/org/apache/ace/server/LicenseServiceImpl.java   (with props)
Modified:
    incubator/ace/trunk/core/build.xml
    incubator/ace/trunk/webui/src/org/apache/ace/client/Main.java
    incubator/ace/trunk/webui/src/org/apache/ace/client/TargetTable.java
    incubator/ace/trunk/webui/src/org/apache/ace/server/TargetServiceImpl.java
    incubator/ace/trunk/webui/war/WEB-INF/web.xml
    incubator/ace/trunk/webui/war/webui.html

Modified: incubator/ace/trunk/core/build.xml
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/core/build.xml?rev=792480&r1=792479&r2=792480&view=diff
==============================================================================
--- incubator/ace/trunk/core/build.xml (original)
+++ incubator/ace/trunk/core/build.xml Thu Jul  9 10:16:50 2009
@@ -891,6 +891,7 @@
 	    <mkdir dir="deploy/releases" />
 	    <ziptarget target="dev-server" />
 	    <ziptarget target="dev-server-filebased" />
+        <ziptarget target="dev-server-webui" />
 	    <ziptarget target="dev-obr" />
 	    <ziptarget target="dev-gateway" />
 	    <ziptarget target="dev-client" />

Added: incubator/ace/trunk/webui/src/org/apache/ace/client/GroupTable.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/webui/src/org/apache/ace/client/GroupTable.java?rev=792480&view=auto
==============================================================================
--- incubator/ace/trunk/webui/src/org/apache/ace/client/GroupTable.java (added)
+++ incubator/ace/trunk/webui/src/org/apache/ace/client/GroupTable.java Thu Jul  9 10:16:50
2009
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.client;
+
+import org.apache.ace.client.Main.StatusHandler;
+import org.apache.ace.client.services.GroupDescriptor;
+import org.apache.ace.client.services.GroupService;
+import org.apache.ace.client.services.GroupServiceAsync;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+/**
+ * Table class for the groups.
+ */
+public class GroupTable extends ObjectTable<GroupDescriptor> {
+    private GroupServiceAsync m_groupService = GWT.create(GroupService.class);
+
+    GroupTable(StatusHandler handler) {
+        super(handler, "Name");
+    }
+
+    @Override
+    protected void callService(AsyncCallback<GroupDescriptor[]> callback) {
+        m_groupService.getGroups(callback);
+    }
+
+    @Override
+    protected String getValue(GroupDescriptor gd, int column) {
+        switch(column) {
+        case 0: return gd.getName();
+        }
+        return null;
+    }
+
+}

Propchange: incubator/ace/trunk/webui/src/org/apache/ace/client/GroupTable.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/ace/trunk/webui/src/org/apache/ace/client/LicenseTable.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/webui/src/org/apache/ace/client/LicenseTable.java?rev=792480&view=auto
==============================================================================
--- incubator/ace/trunk/webui/src/org/apache/ace/client/LicenseTable.java (added)
+++ incubator/ace/trunk/webui/src/org/apache/ace/client/LicenseTable.java Thu Jul  9 10:16:50
2009
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.client;
+
+import org.apache.ace.client.Main.StatusHandler;
+import org.apache.ace.client.services.LicenseDescriptor;
+import org.apache.ace.client.services.LicenseService;
+import org.apache.ace.client.services.LicenseServiceAsync;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+/**
+ * Table class for the licenses.
+ */
+public class LicenseTable extends ObjectTable<LicenseDescriptor> {
+    private LicenseServiceAsync m_licenseService = GWT.create(LicenseService.class);
+
+    LicenseTable(StatusHandler handler) {
+        super(handler, "Name");
+    }
+
+    @Override
+    protected void callService(AsyncCallback<LicenseDescriptor[]> callback) {
+        m_licenseService.getLicenses(callback);
+    }
+
+    @Override
+    protected String getValue(LicenseDescriptor ld, int column) {
+        switch(column) {
+        case 0: return ld.getName();
+        }
+        return null;
+    }
+
+}

Propchange: incubator/ace/trunk/webui/src/org/apache/ace/client/LicenseTable.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/ace/trunk/webui/src/org/apache/ace/client/Main.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/webui/src/org/apache/ace/client/Main.java?rev=792480&r1=792479&r2=792480&view=diff
==============================================================================
--- incubator/ace/trunk/webui/src/org/apache/ace/client/Main.java (original)
+++ incubator/ace/trunk/webui/src/org/apache/ace/client/Main.java Thu Jul  9 10:16:50 2009
@@ -23,7 +23,6 @@
 
 import com.google.gwt.core.client.EntryPoint;
 import com.google.gwt.user.client.Timer;
-import com.google.gwt.user.client.ui.HorizontalPanel;
 import com.google.gwt.user.client.ui.Label;
 import com.google.gwt.user.client.ui.RootPanel;
 import com.google.gwt.user.client.ui.ScrollPanel;
@@ -34,6 +33,8 @@
 public class Main implements EntryPoint {
     private static final int REFRESH_INTERVAL = 2000;
     private StatusLabel m_statusLabel = new StatusLabel();
+    private GroupTable m_groupTable = new GroupTable(m_statusLabel);
+    private LicenseTable m_licenseTable = new LicenseTable(m_statusLabel);
     private TargetTable m_targetTable = new TargetTable(m_statusLabel);
     
     /**
@@ -49,8 +50,16 @@
      * This is the entry point method.
      */
     public void onModuleLoad() {
-        // Create a scrollpanel with our only table in it
-        ScrollPanel scrollPanel = new ScrollPanel(m_targetTable);
+        // Create some scrollpanels with our tables
+        ScrollPanel scrollPanel = new ScrollPanel(m_groupTable);
+        scrollPanel.setHeight("30em");
+        scrollPanel.setStyleName("objectTable");
+        RootPanel.get("groupColumnContainer").add(scrollPanel);
+        scrollPanel = new ScrollPanel(m_licenseTable);
+        scrollPanel.setHeight("30em");
+        scrollPanel.setStyleName("objectTable");
+        RootPanel.get("licenseColumnContainer").add(scrollPanel);
+        scrollPanel = new ScrollPanel(m_targetTable);
         scrollPanel.setHeight("30em");
         scrollPanel.setStyleName("objectTable");
         RootPanel.get("targetColumnContainer").add(scrollPanel);
@@ -75,6 +84,8 @@
      * Triggers an update of UI.
      */
     void updateUI() {
+        m_groupTable.updateTable();
+        m_licenseTable.updateTable();
         m_targetTable.updateTable();
     }
     

Added: incubator/ace/trunk/webui/src/org/apache/ace/client/ObjectTable.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/webui/src/org/apache/ace/client/ObjectTable.java?rev=792480&view=auto
==============================================================================
--- incubator/ace/trunk/webui/src/org/apache/ace/client/ObjectTable.java (added)
+++ incubator/ace/trunk/webui/src/org/apache/ace/client/ObjectTable.java Thu Jul  9 10:16:50
2009
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.client;
+
+import org.apache.ace.client.Main.StatusHandler;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.ui.FlexTable;
+
+/**
+ * Basic table for using a valueobject per row. Remember to call the constructor with 
+ * the right colunm names.
+ */
+public abstract class ObjectTable<T> extends FlexTable {
+    private final String[] m_columnNames;
+    private final StatusHandler m_handler;
+
+    public ObjectTable(StatusHandler handler, String... columnNames) {
+        m_handler = handler;
+        m_columnNames = columnNames;
+        for (int i = 0; i < m_columnNames.length; i++) {
+            setText(0, i, m_columnNames[i]);
+        }
+    }
+
+    /**
+     * Interprets the given value object for some column.
+     */
+    protected abstract String getValue(T object, int column);
+    
+    /**
+     * Invokes the necessary service call to get the latest
+     * set of value objects from the server, passing the given callback.
+     */
+    protected abstract void callService(AsyncCallback<T[]> callback);
+    
+    void updateTable() {
+        callService(new AsyncCallback<T[]>() {
+            public void onFailure(Throwable caught) {
+                m_handler.handleFail(getClass());
+            }
+            public void onSuccess(T[] result) {
+                m_handler.handleSuccess(getClass());
+                int row = 1;
+                for (T t : result) {
+                    for (int i = 0; i < m_columnNames.length; i++) {
+                        setText(row, i, getValue(t, i));
+                    }
+                    row++;
+                }
+                while (row < getRowCount()) {
+                    // Looks like we removed something...
+                    removeRow(row);
+                }
+            }
+        });
+    }
+}

Propchange: incubator/ace/trunk/webui/src/org/apache/ace/client/ObjectTable.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/ace/trunk/webui/src/org/apache/ace/client/TargetTable.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/webui/src/org/apache/ace/client/TargetTable.java?rev=792480&r1=792479&r2=792480&view=diff
==============================================================================
--- incubator/ace/trunk/webui/src/org/apache/ace/client/TargetTable.java (original)
+++ incubator/ace/trunk/webui/src/org/apache/ace/client/TargetTable.java Thu Jul  9 10:16:50
2009
@@ -25,35 +25,29 @@
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.google.gwt.user.client.ui.FlexTable;
 
 /**
  * Table class for the targets.
  */
-public class TargetTable extends FlexTable {
+public class TargetTable extends ObjectTable<TargetDescriptor> {
     private TargetServiceAsync m_targetService = GWT.create(TargetService.class);
-    private final StatusHandler m_handler;
 
     TargetTable(StatusHandler handler) {
-        m_handler = handler;
-        setText(0, 0, "Name");
-        setText(0, 1, "Status");
+        super(handler, "Name", "Status");
     }
-    
-    void updateTable() {
-        m_targetService.getTargets(new AsyncCallback<TargetDescriptor[]>() {
-            public void onFailure(Throwable caught) {
-                m_handler.handleFail(getClass());
-            }
-            public void onSuccess(TargetDescriptor[] result) {
-                m_handler.handleSuccess(getClass());
-                int row = 1;
-                for (TargetDescriptor td : result) {
-                    setText(row, 0, td.getName());
-                    setText(row, 1, td.getProvisioningState().toString());
-                    row++;
-                }
-            }
-        });
+
+    @Override
+    protected void callService(AsyncCallback<TargetDescriptor[]> callback) {
+        m_targetService.getTargets(callback);
+    }
+
+    @Override
+    protected String getValue(TargetDescriptor td, int column) {
+        switch(column) {
+        case 0: return td.getName();
+        case 1: return td.getProvisioningState().toString();
+        }
+        return null;
     }
+
 }

Added: incubator/ace/trunk/webui/src/org/apache/ace/client/services/GroupDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/webui/src/org/apache/ace/client/services/GroupDescriptor.java?rev=792480&view=auto
==============================================================================
--- incubator/ace/trunk/webui/src/org/apache/ace/client/services/GroupDescriptor.java (added)
+++ incubator/ace/trunk/webui/src/org/apache/ace/client/services/GroupDescriptor.java Thu
Jul  9 10:16:50 2009
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.client.services;
+
+import java.io.Serializable;
+
+/**
+ * Value object for communicating group status between the server and the client.
+ */
+public class GroupDescriptor implements Serializable {
+    /**
+     * Generated serialVersionUID
+     */
+    private static final long serialVersionUID = 6703134869983034189L;
+
+    private String m_name;
+    
+    public GroupDescriptor() {}
+
+    public GroupDescriptor(String name) {
+        m_name = name;
+    }
+
+    public String getName() {
+        return m_name;
+    }
+}

Propchange: incubator/ace/trunk/webui/src/org/apache/ace/client/services/GroupDescriptor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/ace/trunk/webui/src/org/apache/ace/client/services/GroupService.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/webui/src/org/apache/ace/client/services/GroupService.java?rev=792480&view=auto
==============================================================================
--- incubator/ace/trunk/webui/src/org/apache/ace/client/services/GroupService.java (added)
+++ incubator/ace/trunk/webui/src/org/apache/ace/client/services/GroupService.java Thu Jul
 9 10:16:50 2009
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.client.services;
+
+import com.google.gwt.user.client.rpc.RemoteService;
+import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
+
+/**
+ * Service that can get us all groups.
+ */
+@RemoteServiceRelativePath("groups")
+public interface GroupService extends RemoteService {
+    /**
+     * Gets group descriptors for all available groups.
+     */
+    GroupDescriptor[] getGroups() throws Exception;
+}

Propchange: incubator/ace/trunk/webui/src/org/apache/ace/client/services/GroupService.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/ace/trunk/webui/src/org/apache/ace/client/services/GroupServiceAsync.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/webui/src/org/apache/ace/client/services/GroupServiceAsync.java?rev=792480&view=auto
==============================================================================
--- incubator/ace/trunk/webui/src/org/apache/ace/client/services/GroupServiceAsync.java (added)
+++ incubator/ace/trunk/webui/src/org/apache/ace/client/services/GroupServiceAsync.java Thu
Jul  9 10:16:50 2009
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.client.services;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+/**
+ * Asynchronous GroupService (GWT boiler plate)
+ */
+public interface GroupServiceAsync {
+    void getGroups(AsyncCallback<GroupDescriptor[]> callback);
+}

Propchange: incubator/ace/trunk/webui/src/org/apache/ace/client/services/GroupServiceAsync.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/ace/trunk/webui/src/org/apache/ace/client/services/LicenseDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/webui/src/org/apache/ace/client/services/LicenseDescriptor.java?rev=792480&view=auto
==============================================================================
--- incubator/ace/trunk/webui/src/org/apache/ace/client/services/LicenseDescriptor.java (added)
+++ incubator/ace/trunk/webui/src/org/apache/ace/client/services/LicenseDescriptor.java Thu
Jul  9 10:16:50 2009
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.client.services;
+
+import java.io.Serializable;
+
+/**
+ * Value object for communicating license status between the server and the client.
+ */
+public class LicenseDescriptor implements Serializable {
+    /**
+     * Generated serialVersionUID
+     */
+    private static final long serialVersionUID = 5386417593195995864L;
+
+    private String m_name;
+    
+    public LicenseDescriptor() {}
+
+    public LicenseDescriptor(String name) {
+        m_name = name;
+    }
+
+    public String getName() {
+        return m_name;
+    }
+}

Propchange: incubator/ace/trunk/webui/src/org/apache/ace/client/services/LicenseDescriptor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/ace/trunk/webui/src/org/apache/ace/client/services/LicenseService.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/webui/src/org/apache/ace/client/services/LicenseService.java?rev=792480&view=auto
==============================================================================
--- incubator/ace/trunk/webui/src/org/apache/ace/client/services/LicenseService.java (added)
+++ incubator/ace/trunk/webui/src/org/apache/ace/client/services/LicenseService.java Thu Jul
 9 10:16:50 2009
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.client.services;
+
+import com.google.gwt.user.client.rpc.RemoteService;
+import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
+
+/**
+ * Service that can get us all licenses.
+ */
+@RemoteServiceRelativePath("licenses")
+public interface LicenseService extends RemoteService {
+    /**
+     * Gets license descriptors for all available licenses.
+     */
+    LicenseDescriptor[] getLicenses() throws Exception;
+}

Propchange: incubator/ace/trunk/webui/src/org/apache/ace/client/services/LicenseService.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/ace/trunk/webui/src/org/apache/ace/client/services/LicenseServiceAsync.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/webui/src/org/apache/ace/client/services/LicenseServiceAsync.java?rev=792480&view=auto
==============================================================================
--- incubator/ace/trunk/webui/src/org/apache/ace/client/services/LicenseServiceAsync.java
(added)
+++ incubator/ace/trunk/webui/src/org/apache/ace/client/services/LicenseServiceAsync.java
Thu Jul  9 10:16:50 2009
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.client.services;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+/**
+ * Asynchronous LicenseService (GWT boiler plate)
+ */
+public interface LicenseServiceAsync {
+    void getLicenses(AsyncCallback<LicenseDescriptor[]> callback);
+}

Propchange: incubator/ace/trunk/webui/src/org/apache/ace/client/services/LicenseServiceAsync.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/ace/trunk/webui/src/org/apache/ace/server/GroupServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/webui/src/org/apache/ace/server/GroupServiceImpl.java?rev=792480&view=auto
==============================================================================
--- incubator/ace/trunk/webui/src/org/apache/ace/server/GroupServiceImpl.java (added)
+++ incubator/ace/trunk/webui/src/org/apache/ace/server/GroupServiceImpl.java Thu Jul  9 10:16:50
2009
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.server;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.ace.client.repository.object.GroupObject;
+import org.apache.ace.client.repository.repository.GroupRepository;
+import org.apache.ace.client.services.GroupDescriptor;
+import org.apache.ace.client.services.GroupService;
+
+import com.google.gwt.user.server.rpc.RemoteServiceServlet;
+
+public class GroupServiceImpl extends RemoteServiceServlet implements GroupService {
+    /**
+     * Generated serialVersionUID
+     */
+    private static final long serialVersionUID = -5744202709461660202L;
+
+    public GroupDescriptor[] getGroups() throws Exception {
+        GroupRepository lr = Activator.getService(getThreadLocalRequest(), GroupRepository.class);
+        
+        List<GroupDescriptor> result = new ArrayList<GroupDescriptor>();
+        
+        for (GroupObject g : lr.get()) {
+            result.add(new GroupDescriptor(g.getName()));
+        }
+        
+        return result.toArray(new GroupDescriptor[result.size()]);
+    }
+}

Propchange: incubator/ace/trunk/webui/src/org/apache/ace/server/GroupServiceImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/ace/trunk/webui/src/org/apache/ace/server/LicenseServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/webui/src/org/apache/ace/server/LicenseServiceImpl.java?rev=792480&view=auto
==============================================================================
--- incubator/ace/trunk/webui/src/org/apache/ace/server/LicenseServiceImpl.java (added)
+++ incubator/ace/trunk/webui/src/org/apache/ace/server/LicenseServiceImpl.java Thu Jul  9
10:16:50 2009
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.server;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.ace.client.repository.object.LicenseObject;
+import org.apache.ace.client.repository.repository.LicenseRepository;
+import org.apache.ace.client.services.LicenseDescriptor;
+import org.apache.ace.client.services.LicenseService;
+
+import com.google.gwt.user.server.rpc.RemoteServiceServlet;
+
+public class LicenseServiceImpl extends RemoteServiceServlet implements LicenseService {
+    /**
+     * Generated serialVersionUID
+     */
+    private static final long serialVersionUID = -8435568874637903362L;
+
+    public LicenseDescriptor[] getLicenses() throws Exception {
+        LicenseRepository lr = Activator.getService(getThreadLocalRequest(), LicenseRepository.class);
+        
+        List<LicenseDescriptor> result = new ArrayList<LicenseDescriptor>();
+        
+        for (LicenseObject l : lr.get()) {
+            result.add(new LicenseDescriptor(l.getName()));
+        }
+        
+        return result.toArray(new LicenseDescriptor[result.size()]);
+    }
+}

Propchange: incubator/ace/trunk/webui/src/org/apache/ace/server/LicenseServiceImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/ace/trunk/webui/src/org/apache/ace/server/TargetServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/webui/src/org/apache/ace/server/TargetServiceImpl.java?rev=792480&r1=792479&r2=792480&view=diff
==============================================================================
--- incubator/ace/trunk/webui/src/org/apache/ace/server/TargetServiceImpl.java (original)
+++ incubator/ace/trunk/webui/src/org/apache/ace/server/TargetServiceImpl.java Thu Jul  9
10:16:50 2009
@@ -57,7 +57,6 @@
         
         for (StatefulGatewayObject sgo : sgr.get()) {
             result.add(new TargetDescriptor(sgo.getID(), from(sgo.getProvisioningState())));
-            System.err.println("Added " + sgo);
         }
         
         return result.toArray(new TargetDescriptor[result.size()]);

Modified: incubator/ace/trunk/webui/war/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/webui/war/WEB-INF/web.xml?rev=792480&r1=792479&r2=792480&view=diff
==============================================================================
--- incubator/ace/trunk/webui/war/WEB-INF/web.xml (original)
+++ incubator/ace/trunk/webui/war/WEB-INF/web.xml Thu Jul  9 10:16:50 2009
@@ -12,6 +12,26 @@
   
   <!-- Servlets -->
   <servlet>
+    <servlet-name>groupServlet</servlet-name>
+    <servlet-class>org.apache.ace.server.GroupServiceImpl</servlet-class>
+  </servlet>
+  
+  <servlet-mapping>
+    <servlet-name>groupServlet</servlet-name>
+    <url-pattern>/webui/groups</url-pattern>
+  </servlet-mapping>
+
+  <servlet>
+    <servlet-name>licenseServlet</servlet-name>
+    <servlet-class>org.apache.ace.server.LicenseServiceImpl</servlet-class>
+  </servlet>
+  
+  <servlet-mapping>
+    <servlet-name>licenseServlet</servlet-name>
+    <url-pattern>/webui/licenses</url-pattern>
+  </servlet-mapping>
+
+  <servlet>
     <servlet-name>targetServlet</servlet-name>
     <servlet-class>org.apache.ace.server.TargetServiceImpl</servlet-class>
   </servlet>

Modified: incubator/ace/trunk/webui/war/webui.html
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/webui/war/webui.html?rev=792480&r1=792479&r2=792480&view=diff
==============================================================================
--- incubator/ace/trunk/webui/war/webui.html (original)
+++ incubator/ace/trunk/webui/war/webui.html Thu Jul  9 10:16:50 2009
@@ -45,8 +45,8 @@
     <tr><td><h3>Bundles</h3></td><td><h3>Groups</h3></td><td><h3>Licenses</h3></td><td><h3>Targets</h3></td></tr>
     <tr>
         <td>Bundles column goes here</td>
-        <td>Groups column goes here</td>
-        <td>Licenses column goes here</td>
+        <td id="groupColumnContainer"></td>
+        <td id="licenseColumnContainer"></td>
         <td id="targetColumnContainer"></td>
     </tr>
     </table>



Mime
View raw message