incubator-ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1200655 [1/2] - in /incubator/ace/trunk/ace-webui-vaadin: ./ src/main/java/org/apache/ace/webui/domain/ src/main/java/org/apache/ace/webui/vaadin/
Date Fri, 11 Nov 2011 00:14:45 GMT
Author: marrs
Date: Fri Nov 11 00:14:44 2011
New Revision: 1200655

URL: http://svn.apache.org/viewvc?rev=1200655&view=rev
Log:
ACE-206 applied the patch

Added:
    incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/
    incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/NamedArtifactObject.java
    incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/NamedDistributionObject.java
    incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/NamedFeatureObject.java
    incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/NamedTargetObject.java
    incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/OBREntry.java
    incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/AddArtifactWindow.java
    incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/GenericAddWindow.java
    incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/LoginWindow.java
Modified:
    incubator/ace/trunk/ace-webui-vaadin/pom.xml
    incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/AbstractAddWindow.java
    incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/Associations.java
    incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/EditWindow.java
    incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/NamedArtifactObject.java
    incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/NamedDistributionObject.java
    incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/NamedFeatureObject.java
    incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/NamedTargetObject.java
    incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/OBREntry.java
    incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/VaadinClient.java

Modified: incubator/ace/trunk/ace-webui-vaadin/pom.xml
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-webui-vaadin/pom.xml?rev=1200655&r1=1200654&r2=1200655&view=diff
==============================================================================
--- incubator/ace/trunk/ace-webui-vaadin/pom.xml (original)
+++ incubator/ace/trunk/ace-webui-vaadin/pom.xml Fri Nov 11 00:14:44 2011
@@ -52,6 +52,7 @@
         </import.package>
         <private.package>
             org.apache.ace.webui.vaadin,
+            org.apache.ace.webui.domain,
             org.apache.ace.test.utils
         </private.package>
         <bundle.activator>

Added: incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/NamedArtifactObject.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/NamedArtifactObject.java?rev=1200655&view=auto
==============================================================================
--- incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/NamedArtifactObject.java (added)
+++ incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/NamedArtifactObject.java Fri Nov 11 00:14:44 2011
@@ -0,0 +1,33 @@
+package org.apache.ace.webui.domain;
+
+import org.apache.ace.client.repository.RepositoryObject;
+import org.apache.ace.client.repository.object.ArtifactObject;
+import org.apache.ace.webui.NamedObject;
+
+public class NamedArtifactObject implements NamedObject {
+    private final ArtifactObject m_target;
+
+    public NamedArtifactObject(ArtifactObject target) {
+        m_target = target;
+    }
+
+    public String getName() {
+        return m_target.getName();
+    }
+
+    public String getDescription() {
+        return m_target.getDescription();
+    }
+
+    public void setDescription(String description) {
+        m_target.setDescription(description);
+    }
+
+    public RepositoryObject getObject() {
+        return m_target;
+    }
+
+    public String getDefinition() {
+        return m_target.getDefinition();
+    }
+}
\ No newline at end of file

Added: incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/NamedDistributionObject.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/NamedDistributionObject.java?rev=1200655&view=auto
==============================================================================
--- incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/NamedDistributionObject.java (added)
+++ incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/NamedDistributionObject.java Fri Nov 11 00:14:44 2011
@@ -0,0 +1,33 @@
+package org.apache.ace.webui.domain;
+
+import org.apache.ace.client.repository.RepositoryObject;
+import org.apache.ace.client.repository.object.LicenseObject;
+import org.apache.ace.webui.NamedObject;
+
+public class NamedDistributionObject implements NamedObject {
+    private final LicenseObject m_target;
+
+    public NamedDistributionObject(LicenseObject target) {
+        m_target = target;
+    }
+
+    public String getName() {
+        return m_target.getName();
+    }
+
+    public String getDescription() {
+        return m_target.getDescription();
+    }
+
+    public void setDescription(String description) {
+        m_target.setDescription(description);
+    }
+
+    public RepositoryObject getObject() {
+        return m_target;
+    }
+
+    public String getDefinition() {
+        return m_target.getDefinition();
+    }
+}
\ No newline at end of file

Added: incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/NamedFeatureObject.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/NamedFeatureObject.java?rev=1200655&view=auto
==============================================================================
--- incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/NamedFeatureObject.java (added)
+++ incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/NamedFeatureObject.java Fri Nov 11 00:14:44 2011
@@ -0,0 +1,33 @@
+package org.apache.ace.webui.domain;
+
+import org.apache.ace.client.repository.RepositoryObject;
+import org.apache.ace.client.repository.object.GroupObject;
+import org.apache.ace.webui.NamedObject;
+
+public class NamedFeatureObject implements NamedObject {
+    private final GroupObject m_target;
+
+    public NamedFeatureObject(GroupObject target) {
+        m_target = target;
+    }
+
+    public String getName() {
+        return m_target.getName();
+    }
+
+    public String getDescription() {
+        return m_target.getDescription();
+    }
+
+    public void setDescription(String description) {
+        m_target.setDescription(description);
+    }
+
+    public RepositoryObject getObject() {
+        return m_target;
+    }
+
+    public String getDefinition() {
+        return m_target.getDefinition();
+    }
+}
\ No newline at end of file

Added: incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/NamedTargetObject.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/NamedTargetObject.java?rev=1200655&view=auto
==============================================================================
--- incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/NamedTargetObject.java (added)
+++ incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/NamedTargetObject.java Fri Nov 11 00:14:44 2011
@@ -0,0 +1,44 @@
+package org.apache.ace.webui.domain;
+
+import org.apache.ace.client.repository.RepositoryObject;
+import org.apache.ace.client.repository.object.GatewayObject;
+import org.apache.ace.client.repository.stateful.StatefulGatewayObject;
+import org.apache.ace.webui.NamedObject;
+
+public class NamedTargetObject implements NamedObject {
+    private final RepositoryObject m_target;
+
+    public NamedTargetObject(StatefulGatewayObject target) {
+        m_target = target;
+    }
+
+    public NamedTargetObject(GatewayObject target) {
+        m_target = target;
+    }
+
+    public String getName() {
+        if (m_target instanceof StatefulGatewayObject) {
+            return ((StatefulGatewayObject) m_target).getID();
+        }
+        else if (m_target instanceof GatewayObject) {
+            return ((GatewayObject) m_target).getID();
+        }
+        return null;
+    }
+
+    public String getDescription() {
+        return "";
+    }
+
+    public void setDescription(String description) {
+        throw new IllegalArgumentException();
+    }
+
+    public RepositoryObject getObject() {
+        return m_target;
+    }
+
+    public String getDefinition() {
+        return m_target.getDefinition();
+    }
+}
\ No newline at end of file

Added: incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/OBREntry.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/OBREntry.java?rev=1200655&view=auto
==============================================================================
--- incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/OBREntry.java (added)
+++ incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/domain/OBREntry.java Fri Nov 11 00:14:44 2011
@@ -0,0 +1,35 @@
+package org.apache.ace.webui.domain;
+
+public class OBREntry {
+    private final String m_symbolicName;
+    private final String m_version;
+    private final String m_uri;
+
+    public OBREntry(String symbolicName, String version, String uri) {
+        m_symbolicName = symbolicName;
+        m_version = version;
+        m_uri = uri;
+    }
+
+    public String getVersion() {
+        return m_version;
+    }
+
+    public String getSymbolicName() {
+        return m_symbolicName;
+    }
+
+    public String getUri() {
+        return m_uri;
+    }
+
+    @Override
+    public int hashCode() {
+        return m_uri.hashCode();
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        return m_uri.equals(((OBREntry) obj).m_uri);
+    }
+}
\ No newline at end of file

Modified: incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/AbstractAddWindow.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/AbstractAddWindow.java?rev=1200655&r1=1200654&r2=1200655&view=diff
==============================================================================
--- incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/AbstractAddWindow.java (original)
+++ incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/AbstractAddWindow.java Fri Nov 11 00:14:44 2011
@@ -1,63 +0,0 @@
-package org.apache.ace.webui.vaadin;
-
-import com.vaadin.ui.Alignment;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.TextField;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Button.ClickEvent;
-
-public abstract class AbstractAddWindow extends Window {
-    private final Window m_main;
-    private final TextField m_name;
-
-    public AbstractAddWindow(final Window main, String caption) {
-        m_main = main;
-        setModal(true);
-        setWidth("15em");
-        setCaption(caption);
-
-        // Configure the windws layout; by default a VerticalLayout
-        VerticalLayout layout = (VerticalLayout) getContent();
-        layout.setMargin(true);
-        layout.setSpacing(true);
-
-        m_name = new TextField("name");
-        final TextField description = new TextField("description");
-
-        layout.addComponent(m_name);
-        layout.addComponent(description);
-
-        Button close = new Button("Ok", new Button.ClickListener() {
-            // inline click-listener
-            public void buttonClick(ClickEvent event) {
-                // close the window by removing it from the parent window
-                (getParent()).removeWindow(AbstractAddWindow.this);
-                // create the feature
-                create((String) m_name.getValue(), (String) description.getValue());
-            }
-        });
-        // The components added to the window are actually added to the window's
-        // layout; you can use either. Alignments are set using the layout
-        layout.addComponent(close);
-        layout.setComponentAlignment(close, Alignment.BOTTOM_RIGHT);
-    }
-
-    public void show() {
-        if (getParent() != null) {
-            // window is already showing
-            m_main.getWindow().showNotification("Window is already open");
-        } else {
-            // Open the subwindow by adding it to the parent
-            // window
-            m_main.getWindow().addWindow(this);
-        }
-        setRelevantFocus();
-    }
-
-    private void setRelevantFocus() {
-        m_name.focus();
-    }
-
-    protected abstract void create(String name, String description);
-}
\ No newline at end of file

Added: incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/AddArtifactWindow.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/AddArtifactWindow.java?rev=1200655&view=auto
==============================================================================
--- incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/AddArtifactWindow.java (added)
+++ incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/AddArtifactWindow.java Fri Nov 11 00:14:44 2011
@@ -0,0 +1,502 @@
+/*
+ * 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.webui.vaadin;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+
+import org.apache.ace.client.repository.helper.bundle.BundleHelper;
+import org.apache.ace.client.repository.object.ArtifactObject;
+import org.apache.ace.client.repository.repository.ArtifactRepository;
+import org.apache.ace.webui.domain.OBREntry;
+import org.osgi.service.log.LogService;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+
+import com.vaadin.data.Item;
+import com.vaadin.event.dd.DragAndDropEvent;
+import com.vaadin.event.dd.DropHandler;
+import com.vaadin.event.dd.acceptcriteria.AcceptAll;
+import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
+import com.vaadin.terminal.StreamVariable;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.DragAndDropWrapper;
+import com.vaadin.ui.DragAndDropWrapper.WrapperTransferable;
+import com.vaadin.ui.Html5File;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.Upload;
+import com.vaadin.ui.Upload.FailedEvent;
+import com.vaadin.ui.Upload.SucceededEvent;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.Window;
+
+@SuppressWarnings("serial")
+class AddArtifactWindow extends Window {
+    private volatile LogService m_log;
+    private volatile ArtifactRepository m_artifactRepository;
+    private File m_file;
+    private Window m_main;
+    private List<File> m_uploadedArtifacts = new ArrayList<File>();
+    private File m_sessionDir;
+    private List<OBREntry> m_obrList;
+    private URL m_obrUrl;
+
+    public AddArtifactWindow(final Window main, LogService log,
+        File sessionDir, List<OBREntry> obrList, URL obrUrl,
+        ArtifactRepository artifactRepository) {
+        super();
+        m_main = main;
+        m_log = log;
+        m_sessionDir = sessionDir;
+        m_obrList = obrList;
+        m_obrUrl = obrUrl;
+        m_artifactRepository = artifactRepository;
+
+        setModal(true);
+        setCaption("Add artifact");
+        setWidth("50em");
+
+        VerticalLayout layout = (VerticalLayout) getContent();
+        layout.setMargin(true);
+        layout.setSpacing(true);
+
+        final TextField search = new TextField("search");
+        final Table artifacts = new ArtifactTable(main);
+        final Table uploadedArtifacts = new ArtifactTable(main);
+        final Upload uploadArtifact = new Upload("Upload Artifact",
+            new Upload.Receiver() {
+                public OutputStream receiveUpload(String filename,
+                    String MIMEType) {
+                    FileOutputStream fos = null;
+                    try {
+                        m_file = new File(m_sessionDir, filename);
+                        if (m_file.exists()) {
+                            throw new IOException(
+                                "Uploaded file already exists.");
+                        }
+                        fos = new FileOutputStream(m_file);
+                    }
+                    catch (final IOException e) {
+                        m_main.showNotification(
+                            "Upload artifact failed",
+                            "File "
+                                + m_file.getName()
+                                + "<br />could not be accepted on the server.<br />"
+                                + "Reason: " + e.getMessage(),
+                            Notification.TYPE_ERROR_MESSAGE);
+                        m_log.log(LogService.LOG_ERROR, "Upload of "
+                            + m_file.getAbsolutePath() + " failed.", e);
+                        return null;
+                    }
+                    return fos;
+                }
+            });
+
+        final DragAndDropWrapper finalUploadedArtifacts = new DragAndDropWrapper(
+            uploadedArtifacts);
+
+        final StreamVariable html5uploadStreamVariable = new StreamVariable() {
+            FileOutputStream fos = null;
+
+            public OutputStream getOutputStream() {
+                return fos;
+            }
+
+            public boolean listenProgress() {
+                return false;
+            }
+
+            public void streamingStarted(StreamingStartEvent event) {
+                try {
+                    m_file = new File(m_sessionDir, event.getFileName());
+                    if (m_file.exists()) {
+                        throw new IOException("Uploaded file already exists: "
+                            + event.getFileName());
+                    }
+                    fos = new FileOutputStream(m_file);
+                }
+                catch (final IOException e) {
+                    m_main.showNotification(
+                        "Upload artifact failed",
+                        "File "
+                            + m_file.getName()
+                            + "<br />could not be accepted on the server.<br />"
+                            + "Reason: " + e.getMessage(),
+                        Notification.TYPE_ERROR_MESSAGE);
+                    m_log.log(LogService.LOG_ERROR,
+                        "Upload of " + m_file.getAbsolutePath()
+                            + " failed.", e);
+                    fos = null;
+                }
+            }
+
+            public void streamingFinished(StreamingEndEvent event) {
+                try {
+                    URL artifact = m_file.toURI().toURL();
+                    Item item = uploadedArtifacts.addItem(artifact);
+                    item.getItemProperty("symbolic name").setValue(
+                        m_file.getName());
+                    item.getItemProperty("version").setValue("");
+                    m_uploadedArtifacts.add(m_file);
+                    fos.close();
+                }
+                catch (IOException e) {
+                    m_main.showNotification(
+                        "Upload artifact processing failed",
+                        "<br />Reason: " + e.getMessage(),
+                        Notification.TYPE_ERROR_MESSAGE);
+                    m_log.log(LogService.LOG_ERROR,
+                        "Processing of " + m_file.getAbsolutePath()
+                            + " failed.", e);
+                }
+                finally {
+                    fos = null;
+                }
+            }
+
+            public void streamingFailed(StreamingErrorEvent event) {
+                m_main.showNotification("Upload artifact failed", "File "
+                    + m_file.getName()
+                    + "<br />could not be accepted on the server.<br />"
+                    + "Reason: " + event.getException().getMessage(),
+                    Notification.TYPE_ERROR_MESSAGE);
+                m_log.log(LogService.LOG_ERROR,
+                    "Upload of " + event.getFileName() + " failed.");
+                m_file.delete();
+                fos = null;
+            }
+
+            public boolean isInterrupted() {
+                return fos == null;
+            }
+
+            public void onProgress(StreamingProgressEvent event) {
+                // Do nothing, no progress indicator (yet ?)
+            }
+
+        };
+
+        final DropHandler html5uploadDropHandler = new DropHandler() {
+
+            public void drop(DragAndDropEvent dropEvent) {
+                // expecting this to be an html5 drag
+                WrapperTransferable tr = (WrapperTransferable) dropEvent
+                    .getTransferable();
+                Html5File[] files = tr.getFiles();
+                if (files != null) {
+                    for (final Html5File html5File : files) {
+                        html5File.setStreamVariable(html5uploadStreamVariable);
+                    }
+                }
+            }
+
+            public AcceptCriterion getAcceptCriterion() {
+                // TODO only accept .jar files ?
+                return AcceptAll.get();
+            }
+
+        };
+
+        finalUploadedArtifacts.setDropHandler(html5uploadDropHandler);
+
+        this.addListener(new Window.CloseListener() {
+            public void windowClose(CloseEvent e) {
+                for (File artifact : m_uploadedArtifacts) {
+                    artifact.delete();
+                }
+            }
+        });
+
+        artifacts.setCaption("Artifacts in repository");
+        uploadedArtifacts.setCaption("Uploaded artifacts");
+        uploadedArtifacts.setSelectable(false);
+
+        search.setValue("");
+        try {
+            getBundles(artifacts);
+        }
+        catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        uploadArtifact.setImmediate(true);
+
+        uploadArtifact.addListener(new Upload.SucceededListener() {
+
+            public void uploadSucceeded(SucceededEvent event) {
+                try {
+                    URL artifact = m_file.toURI().toURL();
+                    Item item = uploadedArtifacts.addItem(artifact);
+                    item.getItemProperty("symbolic name").setValue(
+                        m_file.getName());
+                    item.getItemProperty("version").setValue("");
+                    m_uploadedArtifacts.add(m_file);
+                }
+                catch (IOException e) {
+                    m_main.showNotification(
+                        "Upload artifact processing failed",
+                        "<br />Reason: " + e.getMessage(),
+                        Notification.TYPE_ERROR_MESSAGE);
+                    m_log.log(LogService.LOG_ERROR,
+                        "Processing of " + m_file.getAbsolutePath()
+                            + " failed.", e);
+                }
+            }
+        });
+        uploadArtifact.addListener(new Upload.FailedListener() {
+            public void uploadFailed(FailedEvent event) {
+                m_main.showNotification("Upload artifact failed", "File "
+                    + event.getFilename()
+                    + "<br />could not be uploaded to the server.<br />"
+                    + "Reason: " + event.getReason().getMessage(),
+                    Notification.TYPE_ERROR_MESSAGE);
+                m_log.log(
+                    LogService.LOG_ERROR,
+                    "Upload of " + event.getFilename() + " size "
+                        + event.getLength() + " type "
+                        + event.getMIMEType() + " failed.",
+                    event.getReason());
+            }
+        });
+
+        layout.addComponent(search);
+        layout.addComponent(artifacts);
+        layout.addComponent(uploadArtifact);
+        layout.addComponent(finalUploadedArtifacts);
+
+        Button close = new Button("Add", new Button.ClickListener() {
+            // inline click-listener
+            public void buttonClick(ClickEvent event) {
+                List<ArtifactObject> added = new ArrayList<ArtifactObject>();
+                // TODO add the selected artifacts
+                for (Object id : artifacts.getItemIds()) {
+                    if (artifacts.isSelected(id)) {
+                        for (OBREntry e : m_obrList) {
+                            if (e.getUri().equals(id)) {
+                                try {
+                                    ArtifactObject ao = importBundle(e);
+                                    added.add(ao);
+                                }
+                                catch (Exception e1) {
+                                    m_main.showNotification(
+                                        "Import artifact failed",
+                                        "Artifact "
+                                            + e.getSymbolicName()
+                                            + " "
+                                            + e.getVersion()
+                                            + "<br />could not be imported into the repository.<br />"
+                                            + "Reason: "
+                                            + e1.getMessage(),
+                                        Notification.TYPE_ERROR_MESSAGE);
+                                    m_log.log(LogService.LOG_ERROR,
+                                        "Import of " + e.getSymbolicName()
+                                            + " " + e.getVersion()
+                                            + " failed.", e1);
+                                }
+                            }
+                        }
+                    }
+                }
+                for (File artifact : m_uploadedArtifacts) {
+                    try {
+                        ArtifactObject ao = importBundle(artifact.toURI()
+                            .toURL());
+                        added.add(ao);
+                    }
+                    catch (Exception e) {
+                        m_main.showNotification(
+                            "Import artifact failed",
+                            "Artifact "
+                                + artifact.getAbsolutePath()
+                                + "<br />could not be imported into the repository.<br />"
+                                + "Reason: " + e.getMessage(),
+                            Notification.TYPE_ERROR_MESSAGE);
+                        m_log.log(LogService.LOG_ERROR,
+                            "Import of " + artifact.getAbsolutePath()
+                                + " failed.", e);
+                    }
+                    finally {
+                        artifact.delete();
+                    }
+                }
+                // close the window by removing it from the parent window
+                (AddArtifactWindow.this.getParent())
+                    .removeWindow(AddArtifactWindow.this);
+                // TODO: make a decision here
+                // so now we have enough information to show a list of imported
+                // artifacts (added)
+                // but do we want to show this list or do we just assume the
+                // user will see the new
+                // artifacts in the left most column? do we also report
+                // failures? or only report
+                // if there were failures?
+            }
+        });
+        // The components added to the window are actually added to the window's
+        // layout; you can use either. Alignments are set using the layout
+        layout.addComponent(close);
+        layout.setComponentAlignment(close, Alignment.MIDDLE_RIGHT);
+        search.focus();
+    }
+
+    public void getBundles(Table table) throws Exception {
+        getBundles(table, m_obrUrl);
+    }
+
+    public void getBundles(Table table, URL obrBaseUrl) throws Exception {
+        // retrieve the repository.xml as a stream
+        URL url = null;
+        try {
+            url = new URL(obrBaseUrl, "repository.xml");
+        }
+        catch (MalformedURLException e) {
+            m_log.log(LogService.LOG_ERROR,
+                "Error retrieving repository.xml from " + obrBaseUrl);
+            throw e;
+        }
+
+        InputStream input = null;
+        NodeList resources = null;
+        try {
+            URLConnection connection = url.openConnection();
+            connection.setUseCaches(false); // We always want the newest
+            // repository.xml file.
+            input = connection.getInputStream();
+
+            try {
+                XPath xpath = XPathFactory.newInstance().newXPath();
+                // this XPath expressing will find all 'resource' elements which
+                // have an attribute 'uri'.
+                resources = (NodeList) xpath.evaluate(
+                    "/repository/resource[@uri]", new InputSource(input),
+                    XPathConstants.NODESET);
+            }
+            catch (XPathExpressionException e) {
+                m_log.log(LogService.LOG_ERROR,
+                    "Error evaluating XPath expression.", e);
+                throw e;
+            }
+        }
+        catch (IOException e) {
+            m_log.log(LogService.LOG_ERROR,
+                "Error reading repository metadata.", e);
+            throw e;
+        }
+        finally {
+            if (input != null) {
+                try {
+                    input.close();
+                }
+                catch (IOException e) {
+                    // too bad, no worries.
+                }
+            }
+        }
+
+        m_obrList = new ArrayList<OBREntry>();
+        for (int nResource = 0; nResource < resources.getLength(); nResource++) {
+            Node resource = resources.item(nResource);
+            NamedNodeMap attr = resource.getAttributes();
+            String uri = getNamedItemText(attr, "uri");
+            String symbolicname = getNamedItemText(attr, "symbolicname");
+            String version = getNamedItemText(attr, "version");
+            m_obrList.add(new OBREntry(symbolicname, version, uri));
+        }
+
+        // Create a list of filenames from the ArtifactRepository
+        List<OBREntry> fromRepository = new ArrayList<OBREntry>();
+        List<ArtifactObject> artifactObjects = m_artifactRepository.get();
+        artifactObjects.addAll(m_artifactRepository.getResourceProcessors());
+        for (ArtifactObject ao : artifactObjects) {
+            String artifactURL = ao.getURL();
+            if (artifactURL.startsWith(obrBaseUrl.toExternalForm())) {
+                // we now know this artifact comes from the OBR we are querying,
+                // so we are interested.
+                fromRepository.add(new OBREntry(ao.getName(), ao
+                    .getAttribute(BundleHelper.KEY_VERSION), new File(
+                    artifactURL).getName()));
+            }
+        }
+
+        // remove all urls we already know
+        m_obrList.removeAll(fromRepository);
+        if (m_obrList.isEmpty()) {
+            m_log.log(LogService.LOG_INFO, "No new data in OBR.");
+            return;
+        }
+
+        // Create a list of all bundle names
+        for (OBREntry s : m_obrList) {
+            String uri = s.getUri();
+            String symbolicName = s.getSymbolicName();
+            String version = s.getVersion();
+            try {
+                Item item = table.addItem(uri);
+                if (symbolicName == null || symbolicName.length() == 0) {
+                    item.getItemProperty("symbolic name").setValue(uri);
+                }
+                else {
+                    item.getItemProperty("symbolic name")
+                        .setValue(symbolicName);
+                }
+                item.getItemProperty("version").setValue(version);
+            }
+            catch (Exception ex) {
+                ex.printStackTrace();
+            }
+        }
+    }
+
+    private static String getNamedItemText(NamedNodeMap attr, String name) {
+        Node namedItem = attr.getNamedItem(name);
+        if (namedItem == null) {
+            return null;
+        }
+        else {
+            return namedItem.getTextContent();
+        }
+    }
+
+    public ArtifactObject importBundle(OBREntry bundle) throws IOException {
+        return m_artifactRepository.importArtifact(
+            new URL(m_obrUrl, bundle.getUri()), false);
+    }
+
+    public ArtifactObject importBundle(URL artifact) throws IOException {
+        return m_artifactRepository.importArtifact(artifact, true);
+    }
+}
\ No newline at end of file

Modified: incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/Associations.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/Associations.java?rev=1200655&r1=1200654&r2=1200655&view=diff
==============================================================================
--- incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/Associations.java (original)
+++ incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/Associations.java Fri Nov 11 00:14:44 2011
@@ -12,6 +12,10 @@ import org.apache.ace.client.repository.
 import org.apache.ace.client.repository.object.LicenseObject;
 import org.apache.ace.client.repository.stateful.StatefulGatewayObject;
 import org.apache.ace.webui.NamedObject;
+import org.apache.ace.webui.domain.NamedArtifactObject;
+import org.apache.ace.webui.domain.NamedDistributionObject;
+import org.apache.ace.webui.domain.NamedFeatureObject;
+import org.apache.ace.webui.domain.NamedTargetObject;
 
 import com.vaadin.data.Property.ValueChangeEvent;
 import com.vaadin.ui.Table;
@@ -23,38 +27,38 @@ public class Associations {
     private Table m_activeTable;
     private Set<?> m_activeSelection;
     private SelectionListener m_activeSelectionListener;
-	
+
     public void removeAssociatedItem(RepositoryObject item) {
-    	m_associatedItems.remove(item);
+        m_associatedItems.remove(item);
     }
-    
+
     public void clear() {
-    	m_associatedItems.clear();
-    	m_relatedItems.clear();
+        m_associatedItems.clear();
+        m_relatedItems.clear();
     }
-    
+
     public boolean isActiveTable(Table table) {
-    	return (m_activeTable != null) ? m_activeTable.equals(table) : false;
+        return (m_activeTable != null) ? m_activeTable.equals(table) : false;
     }
-    
+
     public Set<?> getActiveSelection() {
-    	return m_activeSelection;
+        return m_activeSelection;
     }
-    
+
     public RepositoryObject lookupInActiveSelection(Object item) {
-    	return m_activeSelectionListener.lookup(item);
+        return m_activeSelectionListener.lookup(item);
     }
-    
+
     public void addAssociatedItems(List items) {
-    	m_associatedItems.addAll(items);
+        m_associatedItems.addAll(items);
     }
-    
+
     public void addRelatedItems(List items) {
-    	m_relatedItems.addAll(items);
+        m_relatedItems.addAll(items);
     }
-    
+
     public CellStyleGenerator createCellStyleGenerator() {
-    	return new CellStyleGenerator() {
+        return new CellStyleGenerator() {
             public String getStyle(Object itemId, Object propertyId) {
                 if (propertyId == null) {
                     // no propertyId, styling row
@@ -71,43 +75,46 @@ public class Associations {
                 }
                 return null;
             }
+
             public boolean equals(Object itemId, RepositoryObject object) {
                 return (getNamedObject(object).getDefinition().equals(itemId));
             }
-    	};
+        };
     }
-    
+
     public NamedObject getNamedObject(RepositoryObject object) {
-    	if (object instanceof ArtifactObject) {
-    		return new NamedArtifactObject((ArtifactObject) object);
-    	}
-    	else if (object instanceof GroupObject) {
-    		return new NamedFeatureObject((GroupObject) object);
-    	}
-    	else if (object instanceof LicenseObject) {
-    		return new NamedDistributionObject((LicenseObject) object);
-    	}
-    	else if (object instanceof StatefulGatewayObject) {
-    		return new NamedTargetObject((StatefulGatewayObject) object);
-    	}
-    	else if (object instanceof GatewayObject) {
-    		return new NamedTargetObject((GatewayObject) object);
-    	}
-    	return null;
+        if (object instanceof ArtifactObject) {
+            return new NamedArtifactObject((ArtifactObject) object);
+        }
+        else if (object instanceof GroupObject) {
+            return new NamedFeatureObject((GroupObject) object);
+        }
+        else if (object instanceof LicenseObject) {
+            return new NamedDistributionObject((LicenseObject) object);
+        }
+        else if (object instanceof StatefulGatewayObject) {
+            return new NamedTargetObject((StatefulGatewayObject) object);
+        }
+        else if (object instanceof GatewayObject) {
+            return new NamedTargetObject((GatewayObject) object);
+        }
+        return null;
     }
-    
+
     /**
      * Helper method to find all related {@link RepositoryObject}s in a given 'direction'
      */
-    private <FROM extends RepositoryObject, TO extends RepositoryObject> List<TO> getRelated(FROM from, Class<TO> toClass) {
+    private <FROM extends RepositoryObject, TO extends RepositoryObject> List<TO> getRelated(FROM from,
+        Class<TO> toClass) {
         // if the SGO is not backed by a GO yet, this will cause an exception
         return from.getAssociations(toClass);
     }
-    
+
     /**
      * Helper method to find all related {@link RepositoryObject}s in a given 'direction', starting with a list of objects
      */
-    private <FROM extends RepositoryObject, TO extends RepositoryObject> List<TO> getRelated(List<FROM> from, Class<TO> toClass) {
+    private <FROM extends RepositoryObject, TO extends RepositoryObject> List<TO> getRelated(List<FROM> from,
+        Class<TO> toClass) {
         List<TO> result = new ArrayList<TO>();
         for (RepositoryObject o : from) {
             result.addAll(getRelated(o, toClass));
@@ -115,24 +122,24 @@ public class Associations {
         return result;
     }
 
-    
     public class SelectionListener implements Table.ValueChangeListener {
         private final Table m_table;
         private final Table[] m_tablesToRefresh;
         private final ObjectRepository<? extends RepositoryObject> m_repository;
         private final Class[] m_left;
         private final Class[] m_right;
-                    
-        public SelectionListener(final Table table, final ObjectRepository<? extends RepositoryObject> repository, final Class[] left, final Class[] right, final Table[] tablesToRefresh) {
-        	m_table = table;
-        	m_repository = repository;
-        	m_left = left;
-        	m_right = right;
-        	m_tablesToRefresh = tablesToRefresh;
+
+        public SelectionListener(final Table table, final ObjectRepository<? extends RepositoryObject> repository,
+            final Class[] left, final Class[] right, final Table[] tablesToRefresh) {
+            m_table = table;
+            m_repository = repository;
+            m_left = left;
+            m_right = right;
+            m_tablesToRefresh = tablesToRefresh;
         }
-        
+
         public void valueChange(ValueChangeEvent event) {
-            
+
             if (m_activeSelection != null && m_activeTable != null) {
                 if (!m_activeTable.equals(m_table)) {
                     for (Object val : m_activeSelection) {
@@ -141,12 +148,12 @@ public class Associations {
                     m_table.requestRepaint();
                 }
             }
-            
+
             m_activeSelectionListener = SelectionListener.this;
-            
+
             // set the active table
             m_activeTable = m_table;
-            
+
             // in multiselect mode, a Set of itemIds is returned,
             // in singleselect mode the itemId is returned directly
             Set<?> value = (Set<?>) event.getProperty().getValue();
@@ -190,25 +197,27 @@ public class Associations {
         }
 
         public RepositoryObject lookup(Object value) {
-        	RepositoryObject object = null;
-        	if (value instanceof String) {
-				object = m_repository.get((String) value);
-				if (object instanceof StatefulGatewayObject) {
-					StatefulGatewayObject sgo = (StatefulGatewayObject) object;
-					if (sgo.isRegistered()) {
-						object = sgo.getGatewayObject();
-					} else {
-						object = null;
-					}
-				}
+            RepositoryObject object = null;
+            if (value instanceof String) {
+                object = m_repository.get((String) value);
+                if (object instanceof StatefulGatewayObject) {
+                    StatefulGatewayObject sgo = (StatefulGatewayObject) object;
+                    if (sgo.isRegistered()) {
+                        object = sgo.getGatewayObject();
+                    }
+                    else {
+                        object = null;
+                    }
+                }
             }
             return object;
         }
-		
-    	
+
     }
-    
-    public SelectionListener createSelectionListener(final Table table, final ObjectRepository<? extends RepositoryObject> repository, final Class[] left, final Class[] right, final Table[] tablesToRefresh) {
-    	return new SelectionListener(table, repository, left, right, tablesToRefresh);
+
+    public SelectionListener createSelectionListener(final Table table,
+        final ObjectRepository<? extends RepositoryObject> repository, final Class[] left, final Class[] right,
+        final Table[] tablesToRefresh) {
+        return new SelectionListener(table, repository, left, right, tablesToRefresh);
     }
 }

Modified: incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/EditWindow.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/EditWindow.java?rev=1200655&r1=1200654&r2=1200655&view=diff
==============================================================================
--- incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/EditWindow.java (original)
+++ incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/EditWindow.java Fri Nov 11 00:14:44 2011
@@ -21,6 +21,7 @@ package org.apache.ace.webui.vaadin;
 import com.vaadin.ui.*;
 import org.apache.ace.webui.NamedObject;
 import org.apache.ace.webui.UIExtensionFactory;
+import org.apache.ace.webui.domain.NamedTargetObject;
 
 import java.util.HashMap;
 import java.util.List;
@@ -70,8 +71,12 @@ public class EditWindow extends Window {
             public void buttonClick(Button.ClickEvent event) {
                 // close the window by removing it from the parent window
                 getParent().removeWindow(EditWindow.this);
-                // create the feature
-                object.setDescription((String) description.getValue());
+                if (object instanceof NamedTargetObject) {
+                    // do nothing
+                }
+                else {
+                    object.setDescription((String) description.getValue());
+                }
             }
         });
         // The components added to the window are actually added to the window's

Added: incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/GenericAddWindow.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/GenericAddWindow.java?rev=1200655&view=auto
==============================================================================
--- incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/GenericAddWindow.java (added)
+++ incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/GenericAddWindow.java Fri Nov 11 00:14:44 2011
@@ -0,0 +1,77 @@
+package org.apache.ace.webui.vaadin;
+
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.Window;
+import com.vaadin.ui.Button.ClickEvent;
+
+@SuppressWarnings("serial")
+public class GenericAddWindow extends Window {
+
+    public interface AddFunction {
+        void create(String name, String description);
+    };
+
+    private final Window m_main;
+    private final TextField m_name;
+    private AddFunction m_addFunction;
+
+    public GenericAddWindow(final Window main, String caption) {
+        m_main = main;
+
+        setModal(true);
+        setWidth("15em");
+        setCaption(caption);
+
+        // Configure the windws layout; by default a VerticalLayout
+        VerticalLayout layout = (VerticalLayout) getContent();
+        layout.setMargin(true);
+        layout.setSpacing(true);
+
+        m_name = new TextField("name");
+        final TextField description = new TextField("description");
+
+        layout.addComponent(m_name);
+        layout.addComponent(description);
+
+        Button close = new Button("Ok", new Button.ClickListener() {
+            // inline click-listener
+            public void buttonClick(ClickEvent event) {
+                // close the window by removing it from the parent window
+                (getParent()).removeWindow(GenericAddWindow.this);
+                // create the feature
+                if (m_addFunction != null) {
+                    m_addFunction.create((String) m_name.getValue(),
+                        (String) description.getValue());
+                }
+            }
+        });
+        // The components added to the window are actually added to the window's
+        // layout; you can use either. Alignments are set using the layout
+        layout.addComponent(close);
+        layout.setComponentAlignment(close, Alignment.BOTTOM_RIGHT);
+    }
+
+    public void setOkListeren(AddFunction addFunction) {
+        m_addFunction = addFunction;
+    }
+
+    public void show() {
+        if (getParent() != null) {
+            // window is already showing
+            m_main.getWindow().showNotification("Window is already open");
+        }
+        else {
+            // Open the subwindow by adding it to the parent
+            // window
+            m_main.getWindow().addWindow(this);
+        }
+        setRelevantFocus();
+    }
+
+    private void setRelevantFocus() {
+        m_name.focus();
+    }
+}
\ No newline at end of file

Added: incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/LoginWindow.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/LoginWindow.java?rev=1200655&view=auto
==============================================================================
--- incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/LoginWindow.java (added)
+++ incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/LoginWindow.java Fri Nov 11 00:14:44 2011
@@ -0,0 +1,78 @@
+package org.apache.ace.webui.vaadin;
+
+import org.osgi.service.log.LogService;
+
+import com.vaadin.terminal.UserError;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.PasswordField;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.Window;
+import com.vaadin.ui.Button.ClickEvent;
+
+@SuppressWarnings("serial")
+public class LoginWindow extends Window {
+
+    public interface LoginFunction {
+        boolean login(String name, String password);
+    };
+
+    private volatile LogService m_log;
+    private TextField m_name;
+    private PasswordField m_password;
+    private Button m_loginButton;
+    private LoginFunction m_loginFunction;
+
+    public LoginWindow(final LogService log, final LoginFunction loginFunction) {
+        super("Apache ACE Login");
+        m_log = log;
+        m_loginFunction = loginFunction;
+        setResizable(false);
+        setModal(true);
+        setWidth("15em");
+
+        LoginPanel p = new LoginPanel();
+        setContent(p);
+    }
+
+    public void closeWindow() {
+        getParent().removeWindow(this);
+    }
+
+    public class LoginPanel extends VerticalLayout {
+        public LoginPanel() {
+            setSpacing(true);
+            setMargin(true);
+            setClosable(false);
+            setSizeFull();
+            m_name = new TextField("Name", "");
+            m_password = new PasswordField("Password", "");
+            m_loginButton = new Button("Login");
+            addComponent(m_name);
+            addComponent(m_password);
+            addComponent(m_loginButton);
+            setComponentAlignment(m_loginButton, Alignment.BOTTOM_CENTER);
+            m_name.focus();
+            m_name.selectAll();
+            m_loginButton.addListener(new Button.ClickListener() {
+                public void buttonClick(ClickEvent event) {
+                    if (m_loginFunction.login((String) m_name.getValue(),
+                        (String) m_password.getValue())) {
+                        m_log.log(LogService.LOG_INFO,
+                            "Apache Ace WebUI succesfull login by user: " + (String) m_name.getValue());
+                        closeWindow();
+                    }
+                    else {
+                        // TODO provide some feedback, login failed, for now
+                        // don't close the login window
+                        m_log.log(LogService.LOG_WARNING, "Apache Ace WebUI invalid username or password entered.");
+                        m_loginButton.setComponentError(new UserError(
+                            "Invalid username or password."));
+                    }
+                }
+            });
+        }
+    }
+
+}
\ No newline at end of file

Modified: incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/NamedArtifactObject.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/NamedArtifactObject.java?rev=1200655&r1=1200654&r2=1200655&view=diff
==============================================================================
--- incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/NamedArtifactObject.java (original)
+++ incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/NamedArtifactObject.java Fri Nov 11 00:14:44 2011
@@ -1,33 +0,0 @@
-package org.apache.ace.webui.vaadin;
-
-import org.apache.ace.client.repository.RepositoryObject;
-import org.apache.ace.client.repository.object.ArtifactObject;
-import org.apache.ace.webui.NamedObject;
-
-public class NamedArtifactObject implements NamedObject {
-    private final ArtifactObject m_target;
-
-    public NamedArtifactObject(ArtifactObject target) {
-        m_target = target;
-    }
-
-    public String getName() {
-        return m_target.getName();
-    }
-
-    public String getDescription() {
-        return m_target.getDescription();
-    }
-
-    public void setDescription(String description) {
-        m_target.setDescription(description);
-    }
-    
-    public RepositoryObject getObject() {
-        return m_target;
-    }
-    
-    public String getDefinition() {
-        return m_target.getDefinition();
-    }
-}
\ No newline at end of file

Modified: incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/NamedDistributionObject.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/NamedDistributionObject.java?rev=1200655&r1=1200654&r2=1200655&view=diff
==============================================================================
--- incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/NamedDistributionObject.java (original)
+++ incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/NamedDistributionObject.java Fri Nov 11 00:14:44 2011
@@ -1,33 +0,0 @@
-package org.apache.ace.webui.vaadin;
-
-import org.apache.ace.client.repository.RepositoryObject;
-import org.apache.ace.client.repository.object.LicenseObject;
-import org.apache.ace.webui.NamedObject;
-
-public class NamedDistributionObject implements NamedObject {
-    private final LicenseObject m_target;
-
-    public NamedDistributionObject(LicenseObject target) {
-        m_target = target;
-    }
-
-    public String getName() {
-        return m_target.getName();
-    }
-
-    public String getDescription() {
-        return m_target.getDescription();
-    }
-
-    public void setDescription(String description) {
-        m_target.setDescription(description);
-    }
-    
-    public RepositoryObject getObject() {
-        return m_target;
-    }
-    
-    public String getDefinition() {
-        return m_target.getDefinition();
-    }
-}
\ No newline at end of file

Modified: incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/NamedFeatureObject.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/NamedFeatureObject.java?rev=1200655&r1=1200654&r2=1200655&view=diff
==============================================================================
--- incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/NamedFeatureObject.java (original)
+++ incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/NamedFeatureObject.java Fri Nov 11 00:14:44 2011
@@ -1,33 +0,0 @@
-package org.apache.ace.webui.vaadin;
-
-import org.apache.ace.client.repository.RepositoryObject;
-import org.apache.ace.client.repository.object.GroupObject;
-import org.apache.ace.webui.NamedObject;
-
-public class NamedFeatureObject implements NamedObject {
-    private final GroupObject m_target;
-
-    public NamedFeatureObject(GroupObject target) {
-        m_target = target;
-    }
-
-    public String getName() {
-        return m_target.getName();
-    }
-
-    public String getDescription() {
-        return m_target.getDescription();
-    }
-
-    public void setDescription(String description) {
-        m_target.setDescription(description);
-    }
-    
-    public RepositoryObject getObject() {
-        return m_target;
-    }
-    
-    public String getDefinition() {
-        return m_target.getDefinition();
-    }
-}
\ No newline at end of file

Modified: incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/NamedTargetObject.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/NamedTargetObject.java?rev=1200655&r1=1200654&r2=1200655&view=diff
==============================================================================
--- incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/NamedTargetObject.java (original)
+++ incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/NamedTargetObject.java Fri Nov 11 00:14:44 2011
@@ -1,44 +0,0 @@
-package org.apache.ace.webui.vaadin;
-
-import org.apache.ace.client.repository.RepositoryObject;
-import org.apache.ace.client.repository.object.GatewayObject;
-import org.apache.ace.client.repository.stateful.StatefulGatewayObject;
-import org.apache.ace.webui.NamedObject;
-
-class NamedTargetObject implements NamedObject {
-    private final RepositoryObject m_target;
-
-    public NamedTargetObject(StatefulGatewayObject target) {
-        m_target = target;
-    }
-    
-    public NamedTargetObject(GatewayObject target) {
-        m_target = target;
-    }
-
-    public String getName() {
-    	if (m_target instanceof StatefulGatewayObject) {
-    		return ((StatefulGatewayObject) m_target).getID();
-    	}
-    	else if (m_target instanceof GatewayObject) {
-    		return ((GatewayObject) m_target).getID();
-    	}
-    	return null;
-    }
-
-    public String getDescription() {
-        return "";
-    }
-
-    public void setDescription(String description) {
-        throw new IllegalArgumentException();
-    }
-
-    public RepositoryObject getObject() {
-        return m_target;
-    }
-    
-    public String getDefinition() {
-        return m_target.getDefinition();
-    }
-}
\ No newline at end of file

Modified: incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/OBREntry.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/OBREntry.java?rev=1200655&r1=1200654&r2=1200655&view=diff
==============================================================================
--- incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/OBREntry.java (original)
+++ incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/OBREntry.java Fri Nov 11 00:14:44 2011
@@ -1,35 +0,0 @@
-package org.apache.ace.webui.vaadin;
-
-public class OBREntry {
-    private final String m_symbolicName;
-    private final String m_version;
-    private final String m_uri;
-    
-    public OBREntry(String symbolicName, String version, String uri) {
-        m_symbolicName = symbolicName;
-        m_version = version;
-        m_uri = uri;
-    }
-    
-    public String getVersion() {
-        return m_version;
-    }
-    
-    public String getSymbolicName() {
-        return m_symbolicName;
-    }
-    
-    public String getUri() {
-        return m_uri;
-    }
-
-    @Override
-    public int hashCode() {
-        return m_uri.hashCode();
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        return m_uri.equals(((OBREntry) obj).m_uri);
-    }
-}
\ No newline at end of file



Mime
View raw message