ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1802388 - in /ace/trunk: org.apache.ace.log.server.ui/src/org/apache/ace/log/server/ui/ org.apache.ace.tageditor/src/org/apache/ace/tageditor/ org.apache.ace.target.mgmt.ui/src/org/apache/ace/target/management/ui/ org.apache.ace.useradmin....
Date Wed, 19 Jul 2017 13:09:11 GMT
Author: jawi
Date: Wed Jul 19 13:09:11 2017
New Revision: 1802388

URL: http://svn.apache.org/viewvc?rev=1802388&view=rev
Log:
ACE-625 updated to adhere to minor API changes.


Modified:
    ace/trunk/org.apache.ace.log.server.ui/src/org/apache/ace/log/server/ui/LogViewerExtension.java
    ace/trunk/org.apache.ace.tageditor/src/org/apache/ace/tageditor/ACETagEditorExtension.java
    ace/trunk/org.apache.ace.target.mgmt.ui/src/org/apache/ace/target/management/ui/TargetManagementExtension.java
    ace/trunk/org.apache.ace.useradmin.ui/src/org/apache/ace/useradmin/ui/osgi/Activator.java
    ace/trunk/org.apache.ace.verifier/src/org/apache/ace/deployment/verifier/ui/ACEVerifierExtension.java

Modified: ace/trunk/org.apache.ace.log.server.ui/src/org/apache/ace/log/server/ui/LogViewerExtension.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.log.server.ui/src/org/apache/ace/log/server/ui/LogViewerExtension.java?rev=1802388&r1=1802387&r2=1802388&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.log.server.ui/src/org/apache/ace/log/server/ui/LogViewerExtension.java
(original)
+++ ace/trunk/org.apache.ace.log.server.ui/src/org/apache/ace/log/server/ui/LogViewerExtension.java
Wed Jul 19 13:09:11 2017
@@ -138,7 +138,7 @@ public class LogViewerExtension implemen
 
     /**
      * Returns a string representation of the given event's type.
-     * 
+     *
      * @param event
      *            the event to get the type for, cannot be <code>null</code>.
      * @return a string representation of the event's type, never <code>null</code>.
@@ -171,7 +171,7 @@ public class LogViewerExtension implemen
 
     /**
      * Creates a {@link TextArea} with a dump of the given event's properties.
-     * 
+     *
      * @param event
      *            the event to create a textarea for, cannot be <code>null</code>.
      * @return a {@link TextArea} instance, never <code>null</code>.
@@ -194,7 +194,7 @@ public class LogViewerExtension implemen
 
     /**
      * Dumps the given dictionary to a string by placing all key,value-pairs on a separate
line.
-     * 
+     *
      * @param props
      *            the dictionary to dump, may be <code>null</code>.
      * @return a string dump of all properties in the given dictionary, never <code>null</code>.
@@ -216,7 +216,7 @@ public class LogViewerExtension implemen
 
     /**
      * Fills the table with all log entries for the given repository object.
-     * 
+     *
      * @param object
      *            the repository object to get the log for, cannot be <code>null</code>;
      * @param table
@@ -237,11 +237,7 @@ public class LogViewerExtension implemen
     }
 
     private StatefulTargetObject getRepositoryObjectFromContext(Map<String, Object>
context) {
-        Object contextObject = context.get("statefulTarget");
-        if (contextObject == null) {
-            throw new IllegalStateException("No context object found");
-        }
-        return (StatefulTargetObject) contextObject;
+        return (StatefulTargetObject) context.get("object");
     }
 
     private TextField makeTextField(final String colType) {

Modified: ace/trunk/org.apache.ace.tageditor/src/org/apache/ace/tageditor/ACETagEditorExtension.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.tageditor/src/org/apache/ace/tageditor/ACETagEditorExtension.java?rev=1802388&r1=1802387&r2=1802388&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.tageditor/src/org/apache/ace/tageditor/ACETagEditorExtension.java
(original)
+++ ace/trunk/org.apache.ace.tageditor/src/org/apache/ace/tageditor/ACETagEditorExtension.java
Wed Jul 19 13:09:11 2017
@@ -24,7 +24,6 @@ import java.util.Map;
 
 import org.apache.ace.client.repository.RepositoryObject;
 import org.apache.ace.client.repository.stateful.StatefulTargetObject;
-import org.apache.ace.webui.NamedObject;
 import org.apache.ace.webui.UIExtensionFactory;
 
 import com.vaadin.event.Action;
@@ -73,7 +72,7 @@ public class ACETagEditorExtension imple
 
     /**
      * Creates a tag editor component for the given repository object.
-     * 
+     *
      * @param object
      *            the repository object to create the tag editor for, cannot be <code>null</code>.
      * @return a tag editor component, never <code>null</code>.
@@ -133,14 +132,6 @@ public class ACETagEditorExtension imple
     }
 
     private RepositoryObject getRepositoryObjectFromContext(Map<String, Object> context)
{
-        Object contextObject = context.get("statefulTarget");
-        if (contextObject == null) {
-            contextObject = context.get("object");
-            if (contextObject == null) {
-                throw new IllegalStateException("No context object found");
-            }
-        }
-
-        return (contextObject instanceof NamedObject ? ((NamedObject) contextObject).getObject()
: (RepositoryObject) contextObject);
+        return (RepositoryObject) context.get("object");
     }
 }

Modified: ace/trunk/org.apache.ace.target.mgmt.ui/src/org/apache/ace/target/management/ui/TargetManagementExtension.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.target.mgmt.ui/src/org/apache/ace/target/management/ui/TargetManagementExtension.java?rev=1802388&r1=1802387&r2=1802388&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.target.mgmt.ui/src/org/apache/ace/target/management/ui/TargetManagementExtension.java
(original)
+++ ace/trunk/org.apache.ace.target.mgmt.ui/src/org/apache/ace/target/management/ui/TargetManagementExtension.java
Wed Jul 19 13:09:11 2017
@@ -67,11 +67,11 @@ public class TargetManagementExtension i
         approveButton.setEnabled(getApproveButtonEnabledState(target));
 
         result.addComponent(approveButton);
-        
+
         // Add a spacer that fill the remainder of the available space...
         result.addComponent(new Label(" "));
         result.setRowExpandRatio(3, 1.0f);
-        
+
         // Add all listeners...
         registerCB.addListener(new Button.ClickListener() {
             public void buttonClick(ClickEvent event) {
@@ -97,17 +97,12 @@ public class TargetManagementExtension i
 
         return result;
     }
-    
+
     private boolean getApproveButtonEnabledState(StatefulTargetObject target) {
         return ApprovalState.Unapproved.equals(target.getApprovalState()) && target.needsApprove();
     }
 
     private StatefulTargetObject getRepositoryObjectFromContext(Map<String, Object>
context) {
-        Object contextObject = context.get("statefulTarget");
-        if (contextObject == null) {
-            throw new IllegalStateException("No context object found");
-        }
-
-        return (StatefulTargetObject) contextObject;
+        return (StatefulTargetObject) context.get("object");
     }
 }

Modified: ace/trunk/org.apache.ace.useradmin.ui/src/org/apache/ace/useradmin/ui/osgi/Activator.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.useradmin.ui/src/org/apache/ace/useradmin/ui/osgi/Activator.java?rev=1802388&r1=1802387&r2=1802388&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.useradmin.ui/src/org/apache/ace/useradmin/ui/osgi/Activator.java
(original)
+++ ace/trunk/org.apache.ace.useradmin.ui/src/org/apache/ace/useradmin/ui/osgi/Activator.java
Wed Jul 19 13:09:11 2017
@@ -18,6 +18,10 @@
  */
 package org.apache.ace.useradmin.ui.osgi;
 
+import static org.apache.ace.webui.UIExtensionFactory.EXTENSION_POINT_KEY;
+import static org.apache.ace.webui.UIExtensionFactory.EXTENSION_POINT_VALUE_MENU;
+import static org.osgi.framework.Constants.SERVICE_RANKING;
+
 import java.util.Map;
 import java.util.Properties;
 
@@ -29,7 +33,6 @@ import org.apache.ace.webui.UIExtensionF
 import org.apache.felix.dm.DependencyActivatorBase;
 import org.apache.felix.dm.DependencyManager;
 import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
 import org.osgi.service.log.LogService;
 import org.osgi.service.useradmin.UserAdmin;
 
@@ -43,61 +46,53 @@ public class Activator extends Dependenc
             .setImplementation(UserEditorImpl.class)
             .add(createServiceDependency()
                 .setService(UserAdmin.class)
-                .setRequired(true)
-            )
-        );
+                .setRequired(true)));
 
         Properties properties = new Properties();
-        properties.put(UIExtensionFactory.EXTENSION_POINT_KEY, UIExtensionFactory.EXTENSION_POINT_VALUE_MENU);
-        properties.put(Constants.SERVICE_RANKING, 102);
+        properties.put(EXTENSION_POINT_KEY, EXTENSION_POINT_VALUE_MENU);
+        properties.put(SERVICE_RANKING, 102);
 
         manager.add(createComponent()
             .setInterface(UIExtensionFactory.class.getName(), properties)
             .setImplementation(new UIExtensionFactory() {
-                    @Override
-                    public Component create(Map<String, Object> context) {
-                        EditUserInfoButton b = new EditUserInfoButton();
-                        manager.add(createComponent()
-                            .setImplementation(b)
-                            .setComposition("getComposition")
-                            .add(createServiceDependency()
-                                .setService(UserEditor.class)
-                                .setRequired(true))
-                            .add(createServiceDependency()
-                                .setService(LogService.class)
-                                .setRequired(false)
-                            )
-                        );
-                        return b;
-                    }
+                @Override
+                public Component create(Map<String, Object> context) {
+                    EditUserInfoButton b = new EditUserInfoButton();
+                    manager.add(createComponent()
+                        .setImplementation(b)
+                        .setComposition("getComposition")
+                        .add(createServiceDependency()
+                            .setService(UserEditor.class)
+                            .setRequired(true))
+                        .add(createServiceDependency()
+                            .setService(LogService.class)
+                            .setRequired(false)));
+                    return b;
                 }
-            )
-        );
+            }));
 
-        properties.put(Constants.SERVICE_RANKING, 101);
+        properties = new Properties();
+        properties.put(EXTENSION_POINT_KEY, EXTENSION_POINT_VALUE_MENU);
+        properties.put(SERVICE_RANKING, 101);
 
         manager.add(createComponent()
             .setInterface(UIExtensionFactory.class.getName(), properties)
             .setImplementation(new UIExtensionFactory() {
-                    @Override
-                    public Component create(Map<String, Object> context) {
-                        UserAdminButton b = new UserAdminButton();
-                        manager.add(createComponent()
-                            .setImplementation(b)
-                            .setComposition("getComposition")
-                            .add(createServiceDependency()
-                                .setService(UserEditor.class)
-                                .setRequired(true))
-                            .add(createServiceDependency()
-                                .setService(LogService.class)
-                                .setRequired(false)
-                            )
-                        );
-                        return b;
-                    }
+                @Override
+                public Component create(Map<String, Object> context) {
+                    UserAdminButton b = new UserAdminButton();
+                    manager.add(createComponent()
+                        .setImplementation(b)
+                        .setComposition("getComposition")
+                        .add(createServiceDependency()
+                            .setService(UserEditor.class)
+                            .setRequired(true))
+                        .add(createServiceDependency()
+                            .setService(LogService.class)
+                            .setRequired(false)));
+                    return b;
                 }
-            )
-        );
+            }));
     }
 
     @Override

Modified: ace/trunk/org.apache.ace.verifier/src/org/apache/ace/deployment/verifier/ui/ACEVerifierExtension.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.verifier/src/org/apache/ace/deployment/verifier/ui/ACEVerifierExtension.java?rev=1802388&r1=1802387&r2=1802388&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.verifier/src/org/apache/ace/deployment/verifier/ui/ACEVerifierExtension.java
(original)
+++ ace/trunk/org.apache.ace.verifier/src/org/apache/ace/deployment/verifier/ui/ACEVerifierExtension.java
Wed Jul 19 13:09:11 2017
@@ -210,7 +210,7 @@ public class ACEVerifierExtension implem
 
     /**
      * Quietly closes a given {@link Closeable}.
-     * 
+     *
      * @param closeable
      *            the closeable to close, can be <code>null</code>.
      */
@@ -227,7 +227,7 @@ public class ACEVerifierExtension implem
 
     /**
      * Factory method to create a suitable {@link VerifyEnvironment} instance.
-     * 
+     *
      * @param manifest
      *            the manifest to use;
      * @param verifyResult
@@ -267,17 +267,17 @@ public class ACEVerifierExtension implem
 
     /**
      * Returns a "static"/hardcoded manifest.
-     * 
+     *
      * @return a manifest, never <code>null</code>.
      */
     private String defineStaticManifest() {
         // @formatter:off
-        return Constants.BUNDLE_MANIFESTVERSION + ": 2\n" + 
-               Constants.BUNDLE_SYMBOLICNAME + ": org.apache.felix.framework\n" + 
-               Constants.EXPORT_PACKAGE + ": " + VerifierService.SYSTEM_PACKAGES + "," +
VerifierService.JRE_1_6_PACKAGES + "," + 
+        return Constants.BUNDLE_MANIFESTVERSION + ": 2\n" +
+               Constants.BUNDLE_SYMBOLICNAME + ": org.apache.felix.framework\n" +
+               Constants.EXPORT_PACKAGE + ": " + VerifierService.SYSTEM_PACKAGES + "," +
VerifierService.JRE_1_6_PACKAGES + "," +
                "org.osgi.service.cm; version=1.2," +
-               "org.osgi.service.metatype; version=1.1.1," + 
-               "org.osgi.service.cm; version=1.3.0," + 
+               "org.osgi.service.metatype; version=1.1.1," +
+               "org.osgi.service.cm; version=1.3.0," +
                "org.osgi.service.deploymentadmin.spi; version=1.0.1," +
                "org.osgi.service.deploymentadmin; version=1.1.0\n";
         // @formatter:on
@@ -288,7 +288,7 @@ public class ACEVerifierExtension implem
      * <p>
      * In case the given repository object does not provide a manifest, this method will
return a hard-coded manifest.
      * </p>
-     * 
+     *
      * @param object
      *            the repository object to get the manifest for, cannot be <code>null</code>.
      * @return a manifest, never <code>null</code>.
@@ -303,7 +303,7 @@ public class ACEVerifierExtension implem
 
     /**
      * Converts a given {@link Attributes} into a map.
-     * 
+     *
      * @param attributes
      *            the attributes to convert, cannot be <code>null</code>.
      * @return a manifest map, never <code>null</code>.
@@ -332,22 +332,13 @@ public class ACEVerifierExtension implem
         return manMap;
     }
 
-    /**
-     * @param context
-     * @return
-     */
     private StatefulTargetObject getRepositoryObjectFromContext(Map<String, Object>
context) {
-        Object contextObject = context.get("statefulTarget");
-        if (contextObject == null) {
-            throw new IllegalStateException("No context object found");
-        }
-
-        return (StatefulTargetObject) contextObject;
+        return (StatefulTargetObject) context.get("object");
     }
 
     /**
      * Processes all artifacts.
-     * 
+     *
      * @param artifacts
      *            the artifacts to process.
      * @param env
@@ -369,7 +360,7 @@ public class ACEVerifierExtension implem
 
     /**
      * Processes a single bundle.
-     * 
+     *
      * @param bundle
      *            the bundle to process;
      * @param env



Mime
View raw message