Suite user administration.
[gpl/argeo-suite.git] / org.argeo.suite.ui / src / org / argeo / suite / ui / SuiteEvent.java
index 99e49880e1b6e7925cd184b8bd9a1d5dc6efab9a..a77dc7a87629c0b9294e1dee4ae00c3ea2c48f71 100644 (file)
@@ -7,6 +7,7 @@ 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 {
@@ -14,6 +15,7 @@ public enum SuiteEvent implements CmsEvent {
 
        public final static String LAYER = "layer";
        public final static String NODE_ID = "nodeId";
+       public final static String USERNAME = "username";
        public final static String WORKSPACE = "workspace";
 
        public String getTopicBase() {
@@ -26,4 +28,10 @@ public enum SuiteEvent implements CmsEvent {
                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;
+       }
 }