ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1503725 - in /ace/trunk/org.apache.ace.client.rest/src/org/apache/ace/client/rest: Activator.java Workspace.java
Date Tue, 16 Jul 2013 14:12:40 GMT
Author: bramk
Date: Tue Jul 16 14:12:39 2013
New Revision: 1503725

URL: http://svn.apache.org/r1503725
Log:
ACE-366 Extra commands: list associations with filter options, delete an artifact and list
resource processors


Modified:
    ace/trunk/org.apache.ace.client.rest/src/org/apache/ace/client/rest/Activator.java
    ace/trunk/org.apache.ace.client.rest/src/org/apache/ace/client/rest/Workspace.java

Modified: ace/trunk/org.apache.ace.client.rest/src/org/apache/ace/client/rest/Activator.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.rest/src/org/apache/ace/client/rest/Activator.java?rev=1503725&r1=1503724&r2=1503725&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.client.rest/src/org/apache/ace/client/rest/Activator.java (original)
+++ ace/trunk/org.apache.ace.client.rest/src/org/apache/ace/client/rest/Activator.java Tue
Jul 16 14:12:39 2013
@@ -54,6 +54,7 @@ public class Activator extends Dependenc
             )
         );
         Properties listProps = new Properties();
+        
         listProps.put(CommandProcessor.COMMAND_SCOPE, "coll");
         listProps.put(CommandProcessor.COMMAND_FUNCTION, new String[] { "first", "rest" });
         manager.add(createComponent()

Modified: ace/trunk/org.apache.ace.client.rest/src/org/apache/ace/client/rest/Workspace.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.rest/src/org/apache/ace/client/rest/Workspace.java?rev=1503725&r1=1503724&r2=1503725&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.client.rest/src/org/apache/ace/client/rest/Workspace.java (original)
+++ ace/trunk/org.apache.ace.client.rest/src/org/apache/ace/client/rest/Workspace.java Tue
Jul 16 14:12:39 2013
@@ -24,6 +24,7 @@ import java.net.URL;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -50,6 +51,7 @@ import org.apache.ace.client.repository.
 import org.apache.felix.dm.Component;
 import org.apache.felix.dm.DependencyManager;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.Filter;
 import org.osgi.service.log.LogService;
 import org.osgi.service.useradmin.User;
 
@@ -438,6 +440,24 @@ public class Workspace {
      * Associations: [a2f], [f2d], [d2t]
      */
     
+    /*** resource processors ***/
+    
+    public List<ArtifactObject> lrp() {
+        return m_artifactRepository.getResourceProcessors();
+    }
+    
+    public List<ArtifactObject> lrp(String filter) throws Exception {
+        Filter f = m_context.createFilter(filter);
+        List<ArtifactObject> rps = m_artifactRepository.getResourceProcessors();
+        List<ArtifactObject> res = new LinkedList<ArtifactObject>();
+        for(ArtifactObject rp : rps) {
+            if (f.match(rp.getDictionary())) {
+                res.add(rp);
+            }
+        }
+        return res;
+    }
+    
     /*** artifact ***/
     
     public List<RepositoryObject> la() {
@@ -466,6 +486,9 @@ public class Workspace {
     	addRepositoryObject(ARTIFACT, attrs, tags);
     }
 
+    public void da(RepositoryObject repositoryObject) {
+        deleteRepositoryObject(ARTIFACT, repositoryObject.getDefinition());
+    }
     
     /*** artifact to feature association ***/
     
@@ -473,6 +496,10 @@ public class Workspace {
     	return getRepositoryObjects(ARTIFACT2FEATURE);
     }
     
+    public List<RepositoryObject> la2f(String filter) throws Exception {
+        return getObjectRepository(ARTIFACT2FEATURE).get(m_context.createFilter(filter));
+    }
+    
     public void ca2f(String left, String right) {
     	ca2f(left, right, "1", "1");
     }
@@ -517,6 +544,10 @@ public class Workspace {
     	return getRepositoryObjects(FEATURE2DISTRIBUTION);
     }
     
+    public List<RepositoryObject> lf2d(String filter) throws Exception {
+        return getObjectRepository(FEATURE2DISTRIBUTION).get(m_context.createFilter(filter));
+    }
+    
     public void cf2d(String left, String right) {
     	cf2d(left, right, "1", "1");
     }
@@ -557,6 +588,10 @@ public class Workspace {
     	return getRepositoryObjects(DISTRIBUTION2TARGET);
     }
     
+    public List<RepositoryObject> ld2t(String filter) throws Exception {
+        return getObjectRepository(DISTRIBUTION2TARGET).get(m_context.createFilter(filter));
+    }
+    
     public void cd2t(String left, String right) {
     	cd2t(left, right, "1", "1");
     }



Mime
View raw message