airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1173344 - in /incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component: gui/ registry/ registry/jackrabbit/ registry/jackrabbit/user/
Date Tue, 20 Sep 2011 20:35:32 GMT
Author: lahiru
Date: Tue Sep 20 20:35:31 2011
New Revision: 1173344

URL: http://svn.apache.org/viewvc?rev=1173344&view=rev
Log:
applying 	AIRAVATA-104-UM-API-JackRabbit-Impl.patch provided by saminda.

Added:
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/AbstractJackRabbitUMComponent.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitAuthorizable.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitAuthorizableWrap.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitGroup.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitGroupWrap.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitUserManagerWrap.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitUserWrap.java
Modified:
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/gui/JCRRegistryWindow.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/JCRComponentRegistry.java

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/gui/JCRRegistryWindow.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/gui/JCRRegistryWindow.java?rev=1173344&r1=1173343&r2=1173344&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/gui/JCRRegistryWindow.java
(original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/gui/JCRRegistryWindow.java
Tue Sep 20 20:35:31 2011
@@ -25,16 +25,20 @@ import java.awt.event.ActionEvent;
 import java.net.URI;
 import java.net.URISyntaxException;
 
-import javax.swing.*;
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JPasswordField;
 
 import org.apache.airavata.xbaya.XBayaEngine;
 import org.apache.airavata.xbaya.component.registry.ComponentRegistryLoader;
 import org.apache.airavata.xbaya.component.registry.JCRComponentRegistry;
-import org.apache.airavata.xbaya.component.registry.URLComponentRegistry;
 import org.apache.airavata.xbaya.gui.ErrorMessages;
 import org.apache.airavata.xbaya.gui.GridPanel;
 import org.apache.airavata.xbaya.gui.XBayaDialog;
 import org.apache.airavata.xbaya.gui.XBayaLabel;
+import org.apache.airavata.xbaya.gui.XBayaLinkButton;
 import org.apache.airavata.xbaya.gui.XBayaTextField;
 
 public class JCRRegistryWindow {
@@ -51,6 +55,8 @@ public class JCRRegistryWindow {
     
     private JPasswordField passwordTextField;
 
+	private XBayaLinkButton newUserButton;
+
     /**
      * @param engine
      */
@@ -95,6 +101,10 @@ public class JCRRegistryWindow {
         this.loader.load(registry);
     }
 
+    private void createNewUser(){
+    	
+    }
+    
     /**
      * Initializes the GUI.
      */
@@ -106,16 +116,34 @@ public class JCRRegistryWindow {
         XBayaLabel nameLabel = new XBayaLabel("Username", this.usernameTextField);
         XBayaLabel passLabel = new XBayaLabel("Password", this.usernameTextField);
         
-
+        this.newUserButton = new XBayaLinkButton("Create new user...");
+        newUserButton.setHorizontalAlignment(XBayaLinkButton.RIGHT);
+        JLabel emptyLabel = new JLabel("");
+        
+        newUserButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+            	createNewUser();
+            }
+        });
+        
         GridPanel infoPanel = new GridPanel();
         infoPanel.add(urlLabel);
         infoPanel.add(this.urlTextField);
+//		GridBagConstraints c = new GridBagConstraints();
+//		c.fill = GridBagConstraints.HORIZONTAL;
+//		c.gridwidth = 2;
+//		c.gridx = 0;
+//		c.gridy = 1;
+//		infoPanel.getContentPanel().add(new JSeparator(SwingConstants.HORIZONTAL),c);
+//		infoPanel.add(new JSeparator(SwingConstants.HORIZONTAL));
         infoPanel.add(nameLabel);
         infoPanel.add(this.usernameTextField);
         infoPanel.add(passLabel);
         infoPanel.add(this.passwordTextField);
-        infoPanel.layout(3, 2, GridPanel.WEIGHT_NONE, 1);
-
+        infoPanel.add(emptyLabel);
+        infoPanel.add(this.newUserButton);
+        infoPanel.layout(4, 2, GridPanel.WEIGHT_NONE, 1);
+        
         JButton okButton = new JButton("OK");
         okButton.addActionListener(new AbstractAction() {
             public void actionPerformed(ActionEvent e) {

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/JCRComponentRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/JCRComponentRegistry.java?rev=1173344&r1=1173343&r2=1173344&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/JCRComponentRegistry.java
(original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/JCRComponentRegistry.java
Tue Sep 20 20:35:31 2011
@@ -38,10 +38,22 @@ public class JCRComponentRegistry extend
     public JCRComponentRegistry(URI url, String username, String password) {
         HashMap<String, String> map = new HashMap<String, String>();
         map.put("org.apache.jackrabbit.repository.uri", url.toString());
+        registerUserManagers();
         this.registry = new JCRRegistry("org.apache.jackrabbit.rmi.repository.RmiRepositoryFactory",
username,
                 password, map);        
     }
 
+	/**
+	 * to manually trigger user manager registrations
+	 */
+    private void registerUserManagers() {
+		try {
+			Class.forName("org.apache.airavata.xbaya.component.registry.jackrabbit.user.JackRabbitUserManagerWrap");
+		} catch (ClassNotFoundException e) {
+			//error in registering user managers
+		}
+	}
+
     /**
      * @see org.apache.airavata.xbaya.component.registry.ComponentRegistry#getComponentTree()
      */

Added: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/AbstractJackRabbitUMComponent.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/AbstractJackRabbitUMComponent.java?rev=1173344&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/AbstractJackRabbitUMComponent.java
(added)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/AbstractJackRabbitUMComponent.java
Tue Sep 20 20:35:31 2011
@@ -0,0 +1,47 @@
+package org.apache.airavata.xbaya.component.registry.jackrabbit.user;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.jackrabbit.api.security.user.Authorizable;
+import org.apache.jackrabbit.api.security.user.Group;
+
+public class AbstractJackRabbitUMComponent {
+
+	protected List<Group> getJRGroupList(
+			Iterator<org.apache.airavata.registry.api.user.Group> airavataUMGroupList) {
+		List<Group> groupList=new ArrayList<Group>();
+		while(airavataUMGroupList.hasNext()){
+			groupList.add(new JackRabbitGroup(airavataUMGroupList.next()));
+		}
+		return groupList;
+	}
+	
+	protected List<org.apache.airavata.registry.api.user.Group> getGroupList(
+			Iterator<Group> airavataUMGroupList) {
+		List<org.apache.airavata.registry.api.user.Group> groupList=new ArrayList<org.apache.airavata.registry.api.user.Group>();
+		while(airavataUMGroupList.hasNext()){
+			groupList.add(new JackRabbitGroupWrap(airavataUMGroupList.next()));
+		}
+		return groupList;
+	}
+	
+	protected List<Authorizable> getJRAuthorizableList(
+			Iterator<org.apache.airavata.registry.api.user.Authorizable> jackRabbitAuthorizableList)
{
+		List<Authorizable> authorizableList = new ArrayList<Authorizable>();
+		while(jackRabbitAuthorizableList.hasNext()) {
+			authorizableList.add(new JackRabbitAuthorizable(jackRabbitAuthorizableList.next()));
+		}
+		return authorizableList;
+	}
+	
+	protected List<org.apache.airavata.registry.api.user.Authorizable> getAuthorizableList(
+			Iterator<Authorizable> jackRabbitAuthorizableList) {
+		List<org.apache.airavata.registry.api.user.Authorizable> authorizableList = new ArrayList<org.apache.airavata.registry.api.user.Authorizable>();
+		while(jackRabbitAuthorizableList.hasNext()) {
+			authorizableList.add(new JackRabbitAuthorizableWrap(jackRabbitAuthorizableList.next()));
+		}
+		return authorizableList;
+	}
+}

Added: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitAuthorizable.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitAuthorizable.java?rev=1173344&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitAuthorizable.java
(added)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitAuthorizable.java
Tue Sep 20 20:35:31 2011
@@ -0,0 +1,91 @@
+package org.apache.airavata.xbaya.component.registry.jackrabbit.user;
+
+import java.security.Principal;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+
+import org.apache.jackrabbit.api.security.user.Authorizable;
+import org.apache.jackrabbit.api.security.user.Group;
+
+public class JackRabbitAuthorizable extends AbstractJackRabbitUMComponent implements Authorizable
{
+	private org.apache.airavata.registry.api.user.Authorizable authorizable;
+	
+	public JackRabbitAuthorizable(org.apache.airavata.registry.api.user.Authorizable authorizable)
{
+		this.authorizable=authorizable;
+	}
+	
+	@Override
+	public Iterator<Group> declaredMemberOf() throws RepositoryException {
+		Iterator<org.apache.airavata.registry.api.user.Group> declaredMemberOfGroupList =
authorizable.declaredMemberOf();
+		List<Group> groupList = getJRGroupList(declaredMemberOfGroupList);
+		return groupList.iterator();
+	}
+
+	@Override
+	public String getID() throws RepositoryException {
+		return authorizable.getID();
+	}
+
+	@Override
+	public Principal getPrincipal() throws RepositoryException {
+		return authorizable.getPrincipal();
+	}
+
+	@Override
+	public Value[] getProperty(String name) throws RepositoryException {
+		return authorizable.getProperty(name);
+	}
+
+	@Override
+	public Iterator<String> getPropertyNames() throws RepositoryException {
+		return authorizable.getPropertyNames();
+	}
+
+	@Override
+	public Iterator<String> getPropertyNames(String name)
+			throws RepositoryException {
+		return authorizable.getPropertyNames(name);
+	}
+
+	@Override
+	public boolean hasProperty(String name) throws RepositoryException {
+		return authorizable.hasProperty(name);
+	}
+
+	@Override
+	public boolean isGroup() {
+		return authorizable.isGroup();
+	}
+
+	@Override
+	public Iterator<Group> memberOf() throws RepositoryException {
+		Iterator<org.apache.airavata.registry.api.user.Group> declaredMemberOfGroupList =
authorizable.memberOf();
+		List<Group> groupList = getJRGroupList(declaredMemberOfGroupList);
+		return groupList.iterator();
+	}
+
+	@Override
+	public void remove() throws RepositoryException {
+		authorizable.remove();
+	}
+
+	@Override
+	public boolean removeProperty(String name) throws RepositoryException {
+		return authorizable.removeProperty(name);
+	}
+
+	@Override
+	public void setProperty(String name, Value value) throws RepositoryException {
+		authorizable.setProperty(name, value);
+	}
+
+	@Override
+	public void setProperty(String name, Value[] value)
+			throws RepositoryException {
+		authorizable.setProperty(name, value);
+	}
+
+}

Added: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitAuthorizableWrap.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitAuthorizableWrap.java?rev=1173344&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitAuthorizableWrap.java
(added)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitAuthorizableWrap.java
Tue Sep 20 20:35:31 2011
@@ -0,0 +1,89 @@
+package org.apache.airavata.xbaya.component.registry.jackrabbit.user;
+
+import java.security.Principal;
+import java.util.Iterator;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+
+import org.apache.airavata.registry.api.user.Authorizable;
+import org.apache.airavata.registry.api.user.Group;
+
+public class JackRabbitAuthorizableWrap extends AbstractJackRabbitUMComponent implements
Authorizable {
+	private org.apache.jackrabbit.api.security.user.Authorizable authorizable;
+	
+	public JackRabbitAuthorizableWrap(org.apache.jackrabbit.api.security.user.Authorizable authorizable)
{
+		this.authorizable=authorizable;
+	}
+	
+	@Override
+	public String getID() throws RepositoryException {
+		return authorizable.getID();
+	}
+
+	@Override
+	public boolean isGroup() {
+		return authorizable.isGroup();
+	}
+
+	@Override
+	public Principal getPrincipal() throws RepositoryException {
+		return authorizable.getPrincipal();
+	}
+
+	@Override
+	public void remove() throws RepositoryException {
+		authorizable.remove();
+	}
+
+	@Override
+	public Iterator<String> getPropertyNames() throws RepositoryException {
+		return authorizable.getPropertyNames();
+	}
+
+	@Override
+	public boolean hasProperty(String name) throws RepositoryException {
+		return authorizable.hasProperty(name);
+	}
+
+	@Override
+	public void setProperty(String name, Value value)
+			throws RepositoryException {
+		authorizable.setProperty(name, value);
+	}
+
+	@Override
+	public void setProperty(String name, Value[] value)
+			throws RepositoryException {
+		authorizable.setProperty(name, value);
+	}
+
+	@Override
+	public Value[] getProperty(String name) throws RepositoryException {
+		return authorizable.getProperty(name);
+	}
+
+	@Override
+	public boolean removeProperty(String name) throws RepositoryException {
+		return authorizable.removeProperty(name);
+	}
+
+	@Override
+	public Iterator<Group> declaredMemberOf() throws RepositoryException {
+		Iterator<org.apache.jackrabbit.api.security.user.Group> declaredMemberOf = authorizable.declaredMemberOf();
+		return getGroupList(declaredMemberOf).iterator();
+	}
+
+	@Override
+	public Iterator<Group> memberOf() throws RepositoryException {
+		Iterator<org.apache.jackrabbit.api.security.user.Group> declaredMemberOf = authorizable.memberOf();
+		return getGroupList(declaredMemberOf).iterator();
+	}
+
+	@Override
+	public Iterator<String> getPropertyNames(String name)
+			throws RepositoryException {
+		return authorizable.getPropertyNames(name);
+	}
+
+}

Added: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitGroup.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitGroup.java?rev=1173344&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitGroup.java
(added)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitGroup.java
Tue Sep 20 20:35:31 2011
@@ -0,0 +1,124 @@
+package org.apache.airavata.xbaya.component.registry.jackrabbit.user;
+
+import java.security.Principal;
+import java.util.Iterator;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+
+import org.apache.jackrabbit.api.security.user.Authorizable;
+import org.apache.jackrabbit.api.security.user.Group;
+
+
+public class JackRabbitGroup extends AbstractJackRabbitUMComponent implements Group {
+	private org.apache.airavata.registry.api.user.Group group;
+
+	public JackRabbitGroup(org.apache.airavata.registry.api.user.Group group) {
+		this.group=group;
+	}
+	
+	@Override
+	public String getID() throws RepositoryException {
+		return group.getID();
+	}
+
+	@Override
+	public boolean isGroup() {
+		return group.isGroup();
+	}
+
+	@Override
+	public Principal getPrincipal() throws RepositoryException {
+		return group.getPrincipal();
+	}
+
+	@Override
+	public void remove() throws RepositoryException {
+		group.remove();
+	}
+
+	@Override
+	public Iterator<String> getPropertyNames() throws RepositoryException {
+		return group.getPropertyNames();
+	}
+
+	@Override
+	public boolean hasProperty(String name) throws RepositoryException {
+		return group.hasProperty(name);
+	}
+
+	@Override
+	public void setProperty(String name, Value value)
+			throws RepositoryException {
+		group.setProperty(name, value);
+	}
+
+	@Override
+	public void setProperty(String name, Value[] value)
+			throws RepositoryException {
+		group.setProperty(name, value);
+	}
+
+	@Override
+	public Value[] getProperty(String name) throws RepositoryException {
+		return group.getProperty(name);
+	}
+
+	@Override
+	public boolean removeProperty(String name) throws RepositoryException {
+		return group.removeProperty(name);
+	}
+
+	@Override
+	public Iterator<Authorizable> getDeclaredMembers()
+			throws RepositoryException {
+		Iterator<org.apache.airavata.registry.api.user.Authorizable> declaredMembers = group.getDeclaredMembers();
+		return getJRAuthorizableList(declaredMembers).iterator();
+	}
+
+	@Override
+	public Iterator<Authorizable> getMembers() throws RepositoryException {
+		return getJRAuthorizableList(group.getMembers()).iterator();
+	}
+
+	@Override
+	public boolean isMember(Authorizable authorizable)
+			throws RepositoryException {
+		return group.isMember(new JackRabbitAuthorizableWrap(authorizable));
+	}
+
+	@Override
+	public boolean addMember(Authorizable authorizable)
+			throws RepositoryException {
+		return group.addMember(new JackRabbitAuthorizableWrap(authorizable));
+	}
+
+	@Override
+	public boolean removeMember(Authorizable authorizable)
+			throws RepositoryException {
+		return group.removeMember(new JackRabbitAuthorizableWrap(authorizable));
+	}
+
+	@Override
+	public Iterator<Group> declaredMemberOf() throws RepositoryException {
+		return getJRGroupList(group.declaredMemberOf()).iterator();
+	}
+
+	@Override
+	public Iterator<Group> memberOf() throws RepositoryException {
+		return getJRGroupList(group.memberOf()).iterator();
+	}
+
+	@Override
+	public Iterator<String> getPropertyNames(String name)
+			throws RepositoryException {
+		return group.getPropertyNames(name);
+	}
+
+	@Override
+	public boolean isDeclaredMember(Authorizable authorizable)
+			throws RepositoryException {
+		return group.isDeclaredMember(new JackRabbitAuthorizableWrap(authorizable));
+	}
+
+}

Added: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitGroupWrap.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitGroupWrap.java?rev=1173344&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitGroupWrap.java
(added)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitGroupWrap.java
Tue Sep 20 20:35:31 2011
@@ -0,0 +1,123 @@
+package org.apache.airavata.xbaya.component.registry.jackrabbit.user;
+
+import java.security.Principal;
+import java.util.Iterator;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+
+import org.apache.airavata.registry.api.user.Authorizable;
+import org.apache.airavata.registry.api.user.Group;
+
+public class JackRabbitGroupWrap extends AbstractJackRabbitUMComponent implements Group{
+	private org.apache.jackrabbit.api.security.user.Group group;
+	
+	public JackRabbitGroupWrap(org.apache.jackrabbit.api.security.user.Group group) {
+		this.group=group;
+	}
+	
+	@Override
+	public String getID() throws RepositoryException {
+		return group.getID();
+	}
+
+	@Override
+	public boolean isGroup() {
+		return group.isGroup();
+	}
+
+	@Override
+	public Principal getPrincipal() throws RepositoryException {
+		return group.getPrincipal();
+	}
+
+	@Override
+	public void remove() throws RepositoryException {
+		group.remove();
+	}
+
+	@Override
+	public Iterator<String> getPropertyNames() throws RepositoryException {
+		return group.getPropertyNames();
+	}
+
+	@Override
+	public boolean hasProperty(String name) throws RepositoryException {
+		return group.hasProperty(name);
+	}
+
+	@Override
+	public void setProperty(String name, Value value)
+			throws RepositoryException {
+		group.setProperty(name, value);
+	}
+
+	@Override
+	public void setProperty(String name, Value[] value)
+			throws RepositoryException {
+		group.setProperty(name, value);
+	}
+
+	@Override
+	public Value[] getProperty(String name) throws RepositoryException {
+		return group.getProperty(name);
+	}
+
+	@Override
+	public boolean removeProperty(String name) throws RepositoryException {
+		return group.removeProperty(name);
+	}
+
+	@Override
+	public Iterator<Authorizable> getDeclaredMembers()
+			throws RepositoryException {
+		Iterator<org.apache.jackrabbit.api.security.user.Authorizable> declaredMembers =
group.getDeclaredMembers();
+		return getAuthorizableList(declaredMembers).iterator();
+	}
+
+	@Override
+	public Iterator<Authorizable> getMembers() throws RepositoryException {
+		return getAuthorizableList(group.getMembers()).iterator();
+	}
+
+	@Override
+	public boolean isMember(Authorizable authorizable)
+			throws RepositoryException {
+		return group.isMember(new JackRabbitAuthorizable(authorizable));
+	}
+
+	@Override
+	public boolean addMember(Authorizable authorizable)
+			throws RepositoryException {
+		return group.addMember(new JackRabbitAuthorizable(authorizable));
+	}
+
+	@Override
+	public boolean removeMember(Authorizable authorizable)
+			throws RepositoryException {
+		return group.removeMember(new JackRabbitAuthorizable(authorizable));
+	}
+
+	@Override
+	public Iterator<Group> declaredMemberOf() throws RepositoryException {
+		return getGroupList(group.declaredMemberOf()).iterator();
+	}
+
+	@Override
+	public Iterator<Group> memberOf() throws RepositoryException {
+		return getGroupList(group.memberOf()).iterator();
+	}
+
+	@Override
+	public Iterator<String> getPropertyNames(String name)
+			throws RepositoryException {
+		return group.getPropertyNames(name);
+	}
+
+	@Override
+	public boolean isDeclaredMember(Authorizable authorizable)
+			throws RepositoryException {
+		return group.isDeclaredMember(new JackRabbitAuthorizable(authorizable));
+	}
+
+}

Added: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitUserManagerWrap.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitUserManagerWrap.java?rev=1173344&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitUserManagerWrap.java
(added)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitUserManagerWrap.java
Tue Sep 20 20:35:31 2011
@@ -0,0 +1,95 @@
+package org.apache.airavata.xbaya.component.registry.jackrabbit.user;
+
+import java.security.Principal;
+import java.util.Iterator;
+
+import javax.jcr.AccessDeniedException;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.UnsupportedRepositoryOperationException;
+
+import org.apache.airavata.registry.api.user.Authorizable;
+import org.apache.airavata.registry.api.user.AuthorizableExistsException;
+import org.apache.airavata.registry.api.user.Group;
+import org.apache.airavata.registry.api.user.User;
+import org.apache.airavata.registry.api.user.UserManager;
+import org.apache.airavata.registry.api.user.UserManagerFactory;
+import org.apache.jackrabbit.api.JackrabbitSession;
+
+public class JackRabbitUserManagerWrap extends AbstractJackRabbitUMComponent implements UserManager
{
+
+	static{
+		UserManagerFactory.registerUserManager("org.apache.jackrabbit.rmi.repository.RmiRepositoryFactory",
JackRabbitUserManagerWrap.class);
+	}
+	
+	@Override
+	public User createUser(Session session, String userID, String password)
+			throws AuthorizableExistsException, RepositoryException {
+		org.apache.jackrabbit.api.security.user.User user = getJackRabbitUserManager(session).createUser(userID,
password);
+		return new JackRabbitUserWrap(user);
+	}
+
+	@Override
+	public User createUser(Session session, String userID, String password,
+			Principal principal, String intermediatePath)
+			throws AuthorizableExistsException, RepositoryException {
+		org.apache.jackrabbit.api.security.user.User user = getJackRabbitUserManager(session).createUser(userID,
password,principal,intermediatePath);
+		return new JackRabbitUserWrap(user);
+	}
+
+	@Override
+	public Group createGroup(Session session, Principal principal)
+			throws AuthorizableExistsException, RepositoryException {
+		org.apache.jackrabbit.api.security.user.Group group = getJackRabbitUserManager(session).createGroup(principal);
+		return new JackRabbitGroupWrap(group);
+	}
+
+	@Override
+	public Group createGroup(Session session, Principal principal,
+			String intermediatePath) throws AuthorizableExistsException,
+			RepositoryException {
+		return new JackRabbitGroupWrap(getJackRabbitUserManager(session).createGroup(principal,
intermediatePath));
+	}
+
+	private org.apache.jackrabbit.api.security.user.UserManager getJackRabbitUserManager(Session
session) throws AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException{
+		return ((JackrabbitSession) session).getUserManager(); 
+	}
+
+	@Override
+	public Authorizable getAuthorizable(Session session, String id)
+			throws RepositoryException {
+		return new JackRabbitAuthorizableWrap(getJackRabbitUserManager(session).getAuthorizable(id));
+	}
+
+	@Override
+	public Authorizable getAuthorizable(Session session, Principal principal)
+			throws RepositoryException {
+		return new JackRabbitAuthorizableWrap(getJackRabbitUserManager(session).getAuthorizable(principal));
+	}
+
+	@Override
+	public Iterator<Authorizable> findAuthorizables(Session session,
+			String propertyName, String value) throws RepositoryException {
+		Iterator<org.apache.jackrabbit.api.security.user.Authorizable> authorizables = getJackRabbitUserManager(session).findAuthorizables(propertyName,
value);
+		return getAuthorizableList(authorizables).iterator();
+	}
+
+	@Override
+	public Iterator<Authorizable> findAuthorizables(Session session,
+			String propertyName, String value, int searchType)
+			throws RepositoryException {
+		Iterator<org.apache.jackrabbit.api.security.user.Authorizable> authorizables = getJackRabbitUserManager(session).findAuthorizables(propertyName,
value,searchType);
+		return getAuthorizableList(authorizables).iterator();
+	}
+
+	@Override
+	public boolean isAutoSave(Session session) throws RepositoryException{
+		return getJackRabbitUserManager(session).isAutoSave();
+	}
+
+	@Override
+	public void autoSave(Session session, boolean enable)
+			throws UnsupportedRepositoryOperationException, RepositoryException {
+		getJackRabbitUserManager(session).autoSave(enable);
+	}
+}

Added: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitUserWrap.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitUserWrap.java?rev=1173344&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitUserWrap.java
(added)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitUserWrap.java
Tue Sep 20 20:35:31 2011
@@ -0,0 +1,105 @@
+package org.apache.airavata.xbaya.component.registry.jackrabbit.user;
+
+import java.security.Principal;
+import java.util.Iterator;
+
+import javax.jcr.Credentials;
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+
+import org.apache.airavata.registry.api.user.Group;
+import org.apache.airavata.registry.api.user.User;
+
+public class JackRabbitUserWrap extends AbstractJackRabbitUMComponent implements User{
+	private org.apache.jackrabbit.api.security.user.User user;
+	public JackRabbitUserWrap(org.apache.jackrabbit.api.security.user.User user) {
+		this.user=user;
+	}
+	
+	@Override
+	public String getID() throws RepositoryException {
+		return user.getID();
+	}
+
+	@Override
+	public boolean isGroup() {
+		return user.isGroup();
+	}
+
+	@Override
+	public Principal getPrincipal() throws RepositoryException {
+		return user.getPrincipal();
+	}
+
+	@Override
+	public void remove() throws RepositoryException {
+		user.remove();
+		
+	}
+
+	@Override
+	public Iterator<String> getPropertyNames() throws RepositoryException {
+		return user.getPropertyNames();
+	}
+
+	@Override
+	public boolean hasProperty(String name) throws RepositoryException {
+		return user.hasProperty(name);
+	}
+
+	@Override
+	public void setProperty(String name, Value value)
+			throws RepositoryException {
+		user.setProperty(name, value);
+	}
+
+	@Override
+	public void setProperty(String name, Value[] value)
+			throws RepositoryException {
+		user.setProperty(name, value);
+	}
+
+	@Override
+	public Value[] getProperty(String name) throws RepositoryException {
+		return user.getProperty(name);
+	}
+
+	@Override
+	public boolean removeProperty(String name) throws RepositoryException {
+		return user.removeProperty(name);
+	}
+
+	@Override
+	public boolean isAdmin() {
+		return user.isAdmin();
+	}
+
+	@Override
+	public Credentials getCredentials() throws RepositoryException {
+		return user.getCredentials();
+	}
+
+	@Override
+	public void changePassword(String password) throws RepositoryException {
+		user.changePassword(password);
+	}
+
+	@Override
+	public Iterator<Group> declaredMemberOf() throws RepositoryException {
+		Iterator<org.apache.jackrabbit.api.security.user.Group> declaredMemberOf = user.declaredMemberOf();
+		return getGroupList(declaredMemberOf).iterator();
+	}
+
+	@Override
+	public Iterator<Group> memberOf() throws RepositoryException {
+		Iterator<org.apache.jackrabbit.api.security.user.Group> declaredMemberOf = user.memberOf();
+		return getGroupList(declaredMemberOf).iterator();
+	}
+
+	@Override
+	public Iterator<String> getPropertyNames(String name)
+			throws RepositoryException {
+		return user.getPropertyNames(name);
+	}
+
+}



Mime
View raw message