Refactor DocBook attributes.
[gpl/argeo-suite.git] / org.argeo.suite.ui / src / org / argeo / suite / ui / SuiteEvent.java
index 99e49880e1b6e7925cd184b8bd9a1d5dc6efab9a..563cd219055748f0fa127a1a8a8798a72a872b66 100644 (file)
@@ -7,13 +7,16 @@ import javax.jcr.Node;
 
 import org.argeo.cms.ui.util.CmsEvent;
 import org.argeo.jcr.Jcr;
+import org.osgi.service.useradmin.User;
 
 /** Events specific to Argeo Suite. */
 public enum SuiteEvent implements CmsEvent {
        openNewPart, refreshPart, switchLayer;
 
        public final static String LAYER = "layer";
-       public final static String NODE_ID = "nodeId";
+//     public final static String NODE_ID = "nodeId";
+       public final static String NODE_PATH = "path";
+       public final static String USERNAME = "username";
        public final static String WORKSPACE = "workspace";
 
        public String getTopicBase() {
@@ -22,8 +25,14 @@ public enum SuiteEvent implements CmsEvent {
 
        public static Map<String, Object> eventProperties(Node node) {
                Map<String, Object> properties = new HashMap<>();
-               properties.put(NODE_ID, Jcr.getIdentifier(node));
+               properties.put(NODE_PATH, Jcr.getPath(node));
                properties.put(WORKSPACE, Jcr.getWorkspaceName(node));
                return properties;
        }
+
+       public static Map<String, Object> eventProperties(User user) {
+               Map<String, Object> properties = new HashMap<>();
+               properties.put(USERNAME, user.getName());
+               return properties;
+       }
 }