clerezza-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject svn commit: r905963 - in /incubator/clerezza/trunk/org.apache.clerezza.parent: org.apache.clerezza.platform.config/src/main/resources/META-INF/ org.apache.clerezza.platform.mail/src/main/java/org/apache/clerezza/platform/mail/ org.apache.clerezza.platf...
Date Wed, 03 Feb 2010 09:57:36 GMT
Author: ito
Date: Wed Feb  3 09:57:28 2010
New Revision: 905963

URL: http://svn.apache.org/viewvc?rev=905963&view=rev
Log:
CLEREZZA-100: usermanager java doc improved, foaf.name to platform.userName changed, add getUserGraphNode
added

Added:
    incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserManager.java
      - copied, changed from r905574, incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserManagementProvider.java
    incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserManagerImpl.java
      - copied, changed from r905574, incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserManager.java
Removed:
    incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserManagementProvider.java
Modified:
    incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.config/src/main/resources/META-INF/config.rdf
    incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.mail/src/main/java/org/apache/clerezza/platform/mail/MailManImpl.java
    incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserComparator.java
    incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/AccountControlPanel.java
    incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/control-panel.ssp
    incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.security/src/main/java/org/apache/clerezza/platform/security/UserAwarePolicy.java
    incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.security/src/main/java/org/apache/clerezza/platform/security/auth/AuthenticationChecker.java
    incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/java/org/apache/clerezza/platform/usermanager/webinterface/PasswordReset.java
    incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/java/org/apache/clerezza/platform/usermanager/webinterface/UserManagerWeb.java
    incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/reset_mail.txt
    incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/update-user-template.xhtml
    incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/user-overview-template.xhtml
    incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/user-permission-template.xhtml

Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.config/src/main/resources/META-INF/config.rdf
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.config/src/main/resources/META-INF/config.rdf?rev=905963&r1=905962&r2=905963&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.config/src/main/resources/META-INF/config.rdf
(original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.config/src/main/resources/META-INF/config.rdf
Wed Feb  3 09:57:28 2010
@@ -3,7 +3,8 @@
     xmlns:j.0="http://clerezza.org/2008/10/permission#"
     xmlns:j.1="http://xmlns.com/foaf/0.1/"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
-    xmlns:j.2="http://rdfs.org/sioc/ns#">
+    xmlns:j.2="http://rdfs.org/sioc/ns#"
+	xmlns:j.3="http://clerezza.org/2009/08/platform#">
   <j.0:Role>
     <dc:title>CommunityUser</dc:title>
     <j.0:hasPermission rdf:parseType="Resource">
@@ -14,7 +15,7 @@
   	</j.0:hasPermission>
   </j.0:Role>
   <j.1:Agent>
-    <j.1:name>anonymous</j.1:name>
+    <j.3:userName>anonymous</j.3:userName>
     <j.2:has_function>
       <j.0:Role>
         <dc:title>DefaultRole</dc:title>
@@ -49,7 +50,7 @@
     <j.0:hasPermission rdf:parseType="Resource">
       <j.0:javaPermissionEntry>(java.security.AllPermission "" "")</j.0:javaPermissionEntry>
     </j.0:hasPermission>
-    <j.1:name>admin</j.1:name>
+    <j.3:userName>admin</j.3:userName>
     <j.1:mbox rdf:resource="mailto:noreply@clerezza.org"/>
     <j.0:passwordSha1>d033e22ae348aeb5660fc2140aec35850c4da997</j.0:passwordSha1>
   </j.1:Agent>

Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.mail/src/main/java/org/apache/clerezza/platform/mail/MailManImpl.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.mail/src/main/java/org/apache/clerezza/platform/mail/MailManImpl.java?rev=905963&r1=905962&r2=905963&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.mail/src/main/java/org/apache/clerezza/platform/mail/MailManImpl.java
(original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.mail/src/main/java/org/apache/clerezza/platform/mail/MailManImpl.java
Wed Feb  3 09:57:28 2010
@@ -48,6 +48,7 @@
 import org.apache.clerezza.rdf.core.sparql.ResultSet;
 import org.apache.clerezza.rdf.core.sparql.query.SelectQuery;
 import org.apache.clerezza.rdf.ontologies.FOAF;
+import org.apache.clerezza.rdf.ontologies.PLATFORM;
 import org.apache.clerezza.rdf.utils.GraphNode;
 
 /**
@@ -322,7 +323,7 @@
 
 		final String queryString = "SELECT ?email WHERE { " +
 				"?x " + FOAF.mbox + " ?email . " +
-				"?x " + FOAF.name + " \"" + user + "\" . " +
+				"?x " + PLATFORM.userName + " \"" + user + "\" . " +
 				"}";
 		try {
 			SelectQuery selectQuery = (SelectQuery) QueryParser.getInstance().parse(queryString);

Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserComparator.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserComparator.java?rev=905963&r1=905962&r2=905963&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserComparator.java
(original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserComparator.java
Wed Feb  3 09:57:28 2010
@@ -23,14 +23,14 @@
 import java.util.Iterator;
 
 import org.apache.clerezza.rdf.core.Literal;
-import org.apache.clerezza.rdf.ontologies.FOAF;
+import org.apache.clerezza.rdf.ontologies.PLATFORM;
 
 public class UserComparator implements Comparator<GraphNode> {
 
 	@Override
 	public int compare(GraphNode user1, GraphNode user2) {
-		Iterator<Literal> names1 = user1.getLiterals(FOAF.name);
-		Iterator<Literal> names2 = user2.getLiterals(FOAF.name);
+		Iterator<Literal> names1 = user1.getLiterals(PLATFORM.userName);
+		Iterator<Literal> names2 = user2.getLiterals(PLATFORM.userName);
 		if (names1.hasNext() && names2.hasNext()) {
 			return names1.next().getLexicalForm()
 					.compareTo(names2.next().getLexicalForm());

Copied: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserManager.java
(from r905574, incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserManagementProvider.java)
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserManager.java?p2=incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserManager.java&p1=incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserManagementProvider.java&r1=905574&r2=905963&rev=905963&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserManagementProvider.java
(original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserManager.java
Wed Feb  3 09:57:28 2010
@@ -22,6 +22,7 @@
 import java.util.List;
 
 import org.apache.clerezza.rdf.core.NonLiteral;
+import org.apache.clerezza.rdf.utils.GraphNode;
 
 /**
  * An implementation of this interface provides methods to manage data about 
@@ -32,28 +33,45 @@
  * A user is uniquely identified by a user name.
  * Each user has an email address and an email address can only belong to a user.
  * 
- * @author hasan
+ * @author hasan, tio
  */
-public interface UserManagementProvider {
+public interface UserManager {
 
 	/**
-	 * 
+	 *
 	 * @param title
 	 *		the title of the role, may not be null
 	 */
 	public void storeRole(String title);
 
+	/**
+	 * Checks if a role with this title exists
+	 *
+	 * @param title specifies the title of the role
+	 *
+	 * @return true if the role exists otherwise false
+	 */
 	public boolean roleExists(String title);
 
+	/**
+	 * 
+	 * @param title
+	 * @return NonLiteral which is either a BNode or a UriRef
+	 */
 	public NonLiteral getRoleByTitle(String title);
-	
+
+	/**
+	 * 
+	 * @return Iterator defining all roles
+	 */
 	public Iterator<NonLiteral> getRoles();
 	
 	/**
 	 * 
-	 * @param user	
+	 * @param user 
+	 *			the user is either a BNode or a UriRef
 	 *		
-	 * @return Iterator 	defining all the Roles the specified user owns
+	 * @return Iterator defining all the Roles the specified user owns
 	 */
 	public Iterator<NonLiteral> getRolesOfUser(NonLiteral user);
 
@@ -64,20 +82,43 @@
 	 */
 	public void deleteRole(String title);
 
+	/**
+	 * Assigns a permission to a role
+	 *
+	 * @param title specifies the title of the role, may not be null
+	 * @param permissionEntries specifies a list of permissions
+	 */
 	public void assignPermissionsToRole(String title,
 			List<String> permissionEntries);
 
+	/**
+	 *
+	 * @param role
+	 *			the role is either a BNode or an UriRef
+	 *
+	 * @return Iterator defining all permissions of a role
+	 */
 	public Iterator<NonLiteral> getPermissionsOfRole(NonLiteral role);
 
+	/**
+	 *  Deletes the defined permissions of the role
+	 *
+	 * @param title specifies the title of the role, may not be null
+	 * @param permissionEntries
+	 */
 	public void deletePermissionsOfRole(String title,
 			List<String> permissionEntries);
-
+	/**
+	 * Deletes all permission of a role
+	 *
+	 * @param title specifies the title of the role, may not be null
+	 */
 	public void deleteAllPermissionsOfRole(String title);
 
 	/**
 	 *
 	 * @param name
-	 *		the name of the user, may not be null
+	 *		the username of the user, may not be null
 	 * @param email
 	 * @param password
 	 * @param assignedRoles
@@ -88,11 +129,31 @@
 	public void storeUser(String name, String email, String password,
 			List<String> assignedRoles, String pathPrefix);
 
+	/**
+	 *
+	 * @param name, may not be null
+	 * @param email
+	 * @param password
+	 * @param assignedRoles
+	 * @param pathPrefix
+	 */
 	public void updateUser(String name, String email, String password,
 			List<String> assignedRoles, String pathPrefix);
 
+	/**
+	 *	Checks if the username exists
+	 *
+	 * @param name specifies the username, may not be null
+	 * @return true if exists otherwise false
+	 */
 	public boolean nameExists(String name);
 
+	/**
+	 * Checks if the email exists
+	 *
+	 * @param email
+	 * @return true if exists otherwise false
+	 */
 	public boolean emailExists(String email);
 
 	/**
@@ -105,19 +166,62 @@
 	 */
 	public String getNameByEmail(String email) throws UserHasNoNameException;
 
+	/**
+	 *
+	 * @param name specifies the username of the user
+	 * @return NonLiteral which is either a BNode or a UriRef
+	 */
 	public NonLiteral getUserByName(String name);
 
+	/**
+	 * Returns all users.
+	 *
+	 * @return Iterator defining all users.
+	 */
 	public Iterator<NonLiteral> getUsers();
 
+	/**
+	 *
+	 * @param name specifies the username of the user, may not be null
+	 */
 	public void deleteUser(String name);
 
+	/**
+	 *
+	 * @param name specifies the username of the user, may not be null
+	 * @param permissionEntries
+	 */
 	public void assignPermissionsToUser(String name,
 			List<String> permissionEntries);
-
+	/**
+	 *
+	 * @param user
+	 *			the user is either a BNode or a UriRef
+	 * @return  Iterator defining all permissions of the specified user
+	 */
 	public Iterator<NonLiteral> getPermissionsOfUser(NonLiteral user);
 
+	/**
+	 *
+	 * @param name specifies the username of the user, may not be null
+	 * @param permissionEntries
+	 */
 	public void deletePermissionsOfUser(String name,
 			List<String> permissionEntries);
 
+	/**
+	 * Deletes all permission of a user
+	 *
+	 * @param name specifies the username of the user, may not be null
+	 */
 	public void deleteAllPermissionsOfUser(String name);
+
+	/**
+	 * Retrieves all information associated with a user as GraphNode. The GraphNode
+	 * consists of a UnionMGraph between a new SimpleMGraph and the system graph.
+	 *
+	 * @param name specifies the username of the user, may not be null
+	 * @return GraphNode
+	 */
+	public GraphNode getUserGraphNode(String name);
 }

Copied: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserManagerImpl.java
(from r905574, incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserManager.java)
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserManagerImpl.java?p2=incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserManagerImpl.java&p1=incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserManager.java&r1=905574&r2=905963&rev=905963&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserManager.java
(original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.usermanager/src/main/java/org/apache/clerezza/platform/usermanager/UserManagerImpl.java
Wed Feb  3 09:57:28 2010
@@ -19,9 +19,11 @@
 package org.apache.clerezza.platform.usermanager;
 
 import java.io.UnsupportedEncodingException;
+import java.security.AccessController;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 import java.security.Policy;
+import java.security.PrivilegedAction;
 import java.util.Iterator;
 import java.util.List;
 import org.apache.felix.scr.annotations.Component;
@@ -38,21 +40,24 @@
 import org.apache.clerezza.rdf.core.Triple;
 import org.apache.clerezza.rdf.core.UriRef;
 import org.apache.clerezza.rdf.core.impl.PlainLiteralImpl;
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
 import org.apache.clerezza.rdf.core.impl.TripleImpl;
 import org.apache.clerezza.rdf.ontologies.DC;
 import org.apache.clerezza.rdf.ontologies.FOAF;
 import org.apache.clerezza.rdf.ontologies.OSGI;
 import org.apache.clerezza.rdf.ontologies.PERMISSION;
+import org.apache.clerezza.rdf.ontologies.PLATFORM;
 import org.apache.clerezza.rdf.ontologies.RDF;
 import org.apache.clerezza.rdf.ontologies.SIOC;
 import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.clerezza.rdf.utils.UnionMGraph;
 
 /**
- * @author hasan
+ * @author hasan, tio
  */
 @Component
 @Service(value=UserManager.class)
-public class UserManager implements UserManagementProvider {
+public class UserManagerImpl implements UserManager {
 
 	@Reference(target=SystemConfig.SYSTEM_GRAPH_FILTER)
 	private MGraph systemGraph;
@@ -311,7 +316,7 @@
 		}
 		BNode user = new BNode();
 		systemGraph.add(new TripleImpl(user, RDF.type, FOAF.Agent));
-		systemGraph.add(new TripleImpl(user, FOAF.name,
+		systemGraph.add(new TripleImpl(user, PLATFORM.userName,
 				new PlainLiteralImpl(name)));
 		if (email != null) {
 			systemGraph.add(new TripleImpl(user, FOAF.mbox,
@@ -368,7 +373,7 @@
 			return null;
 		}
 		NonLiteral user = triples.next().getSubject();
-		triples = systemGraph.filter(user, FOAF.name, null);
+		triples = systemGraph.filter(user, PLATFORM.userName, null);
 		if (!triples.hasNext()) {
 			throw new UserHasNoNameException("User with email address" + email +
 					" does not have a name");
@@ -434,7 +439,7 @@
 	@Override
 	public boolean nameExists(String name) {
 
-		return systemGraph.filter(null, FOAF.name,
+		return systemGraph.filter(null, PLATFORM.userName,
 				new PlainLiteralImpl(name)).hasNext();
 	}
 
@@ -447,7 +452,7 @@
 
 	@Override
 	public NonLiteral getUserByName( String name) {
-		Iterator<Triple> triples = systemGraph.filter(null, FOAF.name,
+		Iterator<Triple> triples = systemGraph.filter(null, PLATFORM.userName,
 				new PlainLiteralImpl(name));
 		if (triples.hasNext()) {
 			return triples.next().getSubject();
@@ -529,4 +534,25 @@
 		}
 		return new String(result);
 	}
+
+	@Override
+	public GraphNode getUserGraphNode(final String name) {
+		return AccessController.doPrivileged(new PrivilegedAction<GraphNode>() {
+
+			@Override
+			public GraphNode run() {
+				NonLiteral user = getUserByName(name);
+				if(user != null) {
+					GraphNode node = new GraphNode(user, new UnionMGraph(
+							new SimpleMGraph(), new GraphNode(user, systemGraph)
+							.getNodeContext()));
+
+					return node;
+				} else {
+					throw new RuntimeException("No user with username " + name + " exists");
+				}
+			}
+		});
+	}
+
 }

Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/AccountControlPanel.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/AccountControlPanel.java?rev=905963&r1=905962&r2=905963&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/AccountControlPanel.java
(original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/AccountControlPanel.java
Wed Feb  3 09:57:28 2010
@@ -255,7 +255,7 @@
 
 		logger.debug("Get agent with id {}", id);
 
-		Iterator<Triple> agents = systemGraph.filter(null, FOAF.name,
+		Iterator<Triple> agents = systemGraph.filter(null, PLATFORM.userName,
 				new PlainLiteralImpl(id));
 
 		if (agents.hasNext()) {

Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/control-panel.ssp
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/control-panel.ssp?rev=905963&r1=905962&r2=905963&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/control-panel.ssp
(original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/control-panel.ssp
Wed Feb  3 09:57:28 2010
@@ -2,7 +2,7 @@
 import scala.collection.mutable.ListBuffer
 def cp(s: Any) = new UriRef("http://clerezza.org/2009/03/controlpanel#"+s)
 def osgi(s: Any) = new UriRef("http://clerezza.org/2008/11/osgi#"+s)
-def foaf(s: Any) = new UriRef("http://xmlns.com/foaf/0.1/"+s)
+def platform(s: Any) = new UriRef("http://clerezza.org/2009/08/platform#" + s)
 val nodeBuff = new ListBuffer[NodeBuffer]
 resultDocModifier.setTitle("Account Control Panel");
 resultDocModifier.addNodes2Elem("tx-module", <h1>Account Control Panel</h1>);

Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.security/src/main/java/org/apache/clerezza/platform/security/UserAwarePolicy.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.security/src/main/java/org/apache/clerezza/platform/security/UserAwarePolicy.java?rev=905963&r1=905962&r2=905963&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.security/src/main/java/org/apache/clerezza/platform/security/UserAwarePolicy.java
(original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.security/src/main/java/org/apache/clerezza/platform/security/UserAwarePolicy.java
Wed Feb  3 09:57:28 2010
@@ -45,8 +45,8 @@
 import org.apache.clerezza.rdf.core.NonLiteral;
 import org.apache.clerezza.rdf.core.Triple;
 import org.apache.clerezza.rdf.core.impl.PlainLiteralImpl;
-import org.apache.clerezza.rdf.ontologies.FOAF;
 import org.apache.clerezza.rdf.ontologies.PERMISSION;
+import org.apache.clerezza.rdf.ontologies.PLATFORM;
 import org.apache.clerezza.rdf.ontologies.SIOC;
 
 /**
@@ -199,7 +199,7 @@
 
 	private NonLiteral getUserByName(String userName)
 			throws UserUnregisteredException {
-		Iterator<Triple> triples = systemGraph.filter(null, FOAF.name,
+		Iterator<Triple> triples = systemGraph.filter(null, PLATFORM.userName,
 				new PlainLiteralImpl(userName));
 
 		if (triples.hasNext()) {

Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.security/src/main/java/org/apache/clerezza/platform/security/auth/AuthenticationChecker.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.security/src/main/java/org/apache/clerezza/platform/security/auth/AuthenticationChecker.java?rev=905963&r1=905962&r2=905963&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.security/src/main/java/org/apache/clerezza/platform/security/auth/AuthenticationChecker.java
(original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.security/src/main/java/org/apache/clerezza/platform/security/auth/AuthenticationChecker.java
Wed Feb  3 09:57:28 2010
@@ -27,7 +27,6 @@
 import org.apache.clerezza.rdf.core.NonLiteral;
 import org.apache.clerezza.rdf.core.Triple;
 import org.apache.clerezza.rdf.core.impl.PlainLiteralImpl;
-import org.apache.clerezza.rdf.ontologies.FOAF;
 import org.apache.clerezza.rdf.ontologies.PERMISSION;
 import org.wymiwyg.wrhapi.HandlerException;
 
@@ -36,6 +35,7 @@
 import org.apache.clerezza.platform.config.SystemConfig;
 import org.apache.clerezza.platform.security.PasswordUtil;
 import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.ontologies.PLATFORM;
 
 /**
  * A service that checks if a provided username and password matches a
@@ -77,7 +77,7 @@
 
 	private NonLiteral getAgentFromGraph(String userName) throws NoSuchAgent {
 		NonLiteral agent;
-		Iterator<Triple> agents = systemGraph.filter(null, FOAF.name, new PlainLiteralImpl(userName));
+		Iterator<Triple> agents = systemGraph.filter(null, PLATFORM.userName, new PlainLiteralImpl(userName));
 		if (agents.hasNext()) {
 			agent = agents.next().getSubject();
 		} else {

Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/java/org/apache/clerezza/platform/usermanager/webinterface/PasswordReset.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/java/org/apache/clerezza/platform/usermanager/webinterface/PasswordReset.java?rev=905963&r1=905962&r2=905963&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/java/org/apache/clerezza/platform/usermanager/webinterface/PasswordReset.java
(original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/java/org/apache/clerezza/platform/usermanager/webinterface/PasswordReset.java
Wed Feb  3 09:57:28 2010
@@ -58,8 +58,8 @@
 import org.apache.clerezza.rdf.core.impl.PlainLiteralImpl;
 import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
 import org.apache.clerezza.rdf.core.impl.TripleImpl;
-import org.apache.clerezza.rdf.ontologies.FOAF;
 import org.apache.clerezza.rdf.ontologies.PERMISSION;
+import org.apache.clerezza.rdf.ontologies.PLATFORM;
 import org.apache.clerezza.rdf.ontologies.RDF;
 import org.apache.clerezza.rdf.utils.GraphNode;
 import org.apache.clerezza.rdf.utils.UnionMGraph;
@@ -147,7 +147,7 @@
 							"User name and email address don't match");
 				}
 				try {
-					Iterator<Triple> agents = systemGraph.filter(null, FOAF.name,
+					Iterator<Triple> agents = systemGraph.filter(null, PLATFORM.userName,
 							new PlainLiteralImpl(userName));
 					NonLiteral agent = agents.next().getSubject();
 					MGraph temporary = new SimpleMGraph();

Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/java/org/apache/clerezza/platform/usermanager/webinterface/UserManagerWeb.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/java/org/apache/clerezza/platform/usermanager/webinterface/UserManagerWeb.java?rev=905963&r1=905962&r2=905963&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/java/org/apache/clerezza/platform/usermanager/webinterface/UserManagerWeb.java
(original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/java/org/apache/clerezza/platform/usermanager/webinterface/UserManagerWeb.java
Wed Feb  3 09:57:28 2010
@@ -333,7 +333,7 @@
 		MGraph contentGraph = cgProvider.getContentGraph();
 		NonLiteral user = new BNode();
 		contentGraph.add(new TripleImpl(user, RDF.type, FOAF.Agent));
-		contentGraph.add(new TripleImpl(user, FOAF.name, new PlainLiteralImpl(
+		contentGraph.add(new TripleImpl(user, PLATFORM.userName, new PlainLiteralImpl(
 				userName)));
 
 		saveCustomUserInformation(contentGraph, userName, userRoles, form);
@@ -371,7 +371,7 @@
 	}
 
 	private NonLiteral getCustomUser(MGraph contentGraph, String userName) {
-		Iterator<Triple> users = contentGraph.filter(null, FOAF.name,
+		Iterator<Triple> users = contentGraph.filter(null, PLATFORM.userName,
 				new PlainLiteralImpl(userName.trim()));
 		if (users.hasNext()) {
 			return users.next().getSubject();

Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/reset_mail.txt
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/reset_mail.txt?rev=905963&r1=905962&r2=905963&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/reset_mail.txt
(original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/reset_mail.txt
Wed Feb  3 09:57:28 2010
@@ -1,7 +1,8 @@
 ${ns:user=http://clerezza.org/2009/05/usermanager#}
-${ns:foaf=http://xmlns.com/foaf/0.1/}
+${ns:platform=http://clerezza.org/2009/08/platform#}
 ${ns:permission=http://clerezza.org/2008/10/permission#}
-Hi ${user:recipient/foaf:name},
+
+Hi ${user:recipient/platform:userName},
 
 Your password has been reset. The newly generated password is:
 

Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/update-user-template.xhtml
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/update-user-template.xhtml?rev=905963&r1=905962&r2=905963&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/update-user-template.xhtml
(original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/update-user-template.xhtml
Wed Feb  3 09:57:28 2010
@@ -4,6 +4,7 @@
 def sioc(s: Any) = new UriRef("http://rdfs.org/sioc/ns#" + s)
 def dc(s: Any) = new UriRef("http://purl.org/dc/elements/1.1/" + s)
 def umr(s: Any) = new UriRef("http://clerezza.org/2009/05/usermanager#" + s)
+def platform(s: Any) = new UriRef("http://clerezza.org/2009/08/platform#" + s)
 
 resultDocModifier.addScriptReference("js/usermanager.js");
 
@@ -30,11 +31,11 @@
 				$(document).ready(function() {{
 					$('#userRoles').val(userRoles);
 					
-					refreshCustomInformation({"'" + (res/umr("user")/foaf("name")*) + "'"});
+					refreshCustomInformation({"'" + (res/umr("user")/platform("userName")*) + "'"});
 
 					 $("#userRoles option").each(function() {{
 						$(this).bind("click", function() {{
-							refreshCustomInformation({"'" + (res/umr("user")/foaf("name")*)  + "'"});
+							refreshCustomInformation({"'" + (res/umr("user")/platform("userName")*)  + "'"});
 						}});
 					 }});
 				}});
@@ -47,7 +48,7 @@
                 <div style="float:left; width:300px;">
                     <fieldset border="1px">	
                         <legend>Basic User Information</legend>
-                        <label>Username: <input name="userName" type="text" value={res/umr("user")/foaf("name")*}/></label><br
/>
+                        <label>Username: <input name="userName" type="text" value={res/umr("user")/platform("userName")*}/></label><br
/>
                         <label>Email: <input name="email" type="text" value={res/umr("user")/foaf("mbox")*}/></label><br
/>
                         <label>Path Prefix: <input name="pathPrefix" type="text"
value={res/umr("user")/osgi("agent_path_prefix")*} /></label><br />
                         <label>User Roles: 

Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/user-overview-template.xhtml
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/user-overview-template.xhtml?rev=905963&r1=905962&r2=905963&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/user-overview-template.xhtml
(original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/user-overview-template.xhtml
Wed Feb  3 09:57:28 2010
@@ -4,6 +4,7 @@
 def list(s: Any) = new UriRef("http://clerezza.org/2009/04/list#" + s)
 def sioc(s: Any) = new UriRef("http://rdfs.org/sioc/ns#" + s)
 def dc(s: Any) = new UriRef("http://purl.org/dc/elements/1.1/" + s)
+def platform(s: Any) = new UriRef("http://clerezza.org/2009/08/platform#" + s)
 
 resultDocModifier.addStyleSheet("js/fancybox/jquery.fancybox.css");
 resultDocModifier.addScriptReference("js/fancybox/jquery.fancybox-1.2.1.pack.js");
@@ -44,16 +45,16 @@
 				</thead>
 				<tbody>
                     {for (user <- (res!!)) yield {
-					<tr id={user/foaf("name")*}>
+					<tr id={user/platform("userName")*}>
                         <td>
-                            <input type="checkbox" value={user/foaf("name")*} />
+                            <input type="checkbox" value={user/platform("userName")*}
/>
                         </td>
-                        <td><a href={"update-user?userName=" + (user/foaf("name")*)}>{user/foaf("name")*}</a></td>
+                        <td><a href={"update-user?userName=" + (user/platform("userName")*)}>{user/platform("userName")*}</a></td>
                         <td>{user/foaf("mbox")*}</td>
                         <td>{user/osgi("agent_path_prefix")*}</td>
                         <td>{user/permission("passwordSha1")*}</td>
                         <td>{for (title <- (user/sioc("has_function"))) yield {
 title/dc("title")* }}</td>
-                        <td><a href={"manage-user-permissions?userName=" + (user/foaf("name")*)}>show
permissions</a></td>
+                        <td><a href={"manage-user-permissions?userName=" + (user/platform("userName")*)}>show
permissions</a></td>
                     </tr>
                     }}
 				</tbody>

Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/user-permission-template.xhtml
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/user-permission-template.xhtml?rev=905963&r1=905962&r2=905963&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/user-permission-template.xhtml
(original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.webapp.parent/org.apache.clerezza.platform.usermanager.webinterface/src/main/resources/org/apache/clerezza/platform/usermanager/webinterface/user-permission-template.xhtml
Wed Feb  3 09:57:28 2010
@@ -1,6 +1,6 @@
-def foaf(s: Any) = new UriRef("http://xmlns.com/foaf/0.1/" + s)
 def permission(s: Any) = new UriRef("http://clerezza.org/2008/10/permission#" + s)
 def umr(s: Any) = new UriRef("http://clerezza.org/2009/05/usermanager#" + s)
+def platform(s: Any) = new UriRef("http://clerezza.org/2009/08/platform#" + s)
 
 resultDocModifier.setTitle("User Manager");
 resultDocModifier.addNodes2Elem("tx-module", <h1>User Manager</h1>);
@@ -18,21 +18,21 @@
         <div class="tx-list">
 			<script type="text/javascript">
 				function removePermission(form) {{
-					form.name.value = {"'" + (res/umr("user")/foaf("name")*) + "'"};
+					form.name.value = {"'" + (res/umr("user")/platform("userName")*) + "'"};
 					form.submit();
 				}}
 			</script>
-			<h2>Add new Permission to {res/umr("user")/foaf("name")*}</h2>
+			<h2>Add new Permission to {res/umr("user")/platform("userName")*}</h2>
 			<form method="post" action="add-user-permissions">
 				<div>
-					<input type="hidden" name="name" value={res/umr("user")/foaf("name")*} />
+					<input type="hidden" name="name" value={res/umr("user")/platform("userName")*} />
 					<label>Permission Entry:
 						<input type="text" name="permEntries" />
 					</label>
 					<input type="submit" value="Add new permission" />
 				</div>
 			</form>
-			<h2>List of Permissions for {res/umr("user")/foaf("name")*}</h2>
+			<h2>List of Permissions for {res/umr("user")/platform("userName")*}</h2>
 			<br/>
 			<table>
 				<thead>



Mime
View raw message