You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ta...@apache.org on 2002/03/25 22:42:03 UTC
cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/psml PsmlPortlets.java PsmlSecurity.java PsmlConstraint.java PsmlParametrable.java
taylor 02/03/25 13:42:03
Modified: src/java/org/apache/jetspeed/om/profile ConfigElement.java
IdentityElement.java Portlets.java Security.java
src/java/org/apache/jetspeed/om/profile/psml
PsmlPortlets.java PsmlSecurity.java
Removed: src/java/org/apache/jetspeed/om/profile Constraint.java
Document.java EntrySet.java LayoutElement.java
Parametrable.java
src/java/org/apache/jetspeed/om/profile/psml
PsmlConstraint.java PsmlParametrable.java
Log:
- added security as base element to <portlets> element
- cleaned up interfaces, seperating impl from interface on vectors
Revision Changes Path
1.3 +1 -8 jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/ConfigElement.java
Index: ConfigElement.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/ConfigElement.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ConfigElement.java 22 Mar 2002 18:38:35 -0000 1.2
+++ ConfigElement.java 25 Mar 2002 21:42:03 -0000 1.3
@@ -54,7 +54,6 @@
package org.apache.jetspeed.om.profile;
-import java.util.Vector;
import java.util.Iterator;
/**
@@ -63,7 +62,7 @@
*
* @author <a href="mailto:raphael@apache.org">Rapha�l Luta</a>
* @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
- * @version $Id: ConfigElement.java,v 1.2 2002/03/22 18:38:35 taylor Exp $
+ * @version $Id: ConfigElement.java,v 1.3 2002/03/25 21:42:03 taylor Exp $
*/
public interface ConfigElement
{
@@ -80,12 +79,6 @@
*/
public void setName(String name);
- /** @return all the params */
- public Vector getParameters();
-
- /** @param the parameters */
- public void setParameters(Vector params);
-
public String getParameterValue(String name);
public Parameter getParameter(String name);
1.2 +1 -2 jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/IdentityElement.java
Index: IdentityElement.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/IdentityElement.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- IdentityElement.java 22 Mar 2002 18:38:35 -0000 1.1
+++ IdentityElement.java 25 Mar 2002 21:42:03 -0000 1.2
@@ -54,7 +54,6 @@
package org.apache.jetspeed.om.profile;
-import java.util.Vector;
import java.util.Iterator;
/**
@@ -63,7 +62,7 @@
*
* @author <a href="mailto:raphael@apache.org">Rapha�l Luta</a>
* @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
- * @version $Id: IdentityElement.java,v 1.1 2002/03/22 18:38:35 taylor Exp $
+ * @version $Id: IdentityElement.java,v 1.2 2002/03/25 21:42:03 taylor Exp $
*/
public interface IdentityElement extends MetaInfo, ConfigElement
{
1.2 +5 -10 jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/Portlets.java
Index: Portlets.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/Portlets.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Portlets.java 22 Mar 2002 18:38:35 -0000 1.1
+++ Portlets.java 25 Mar 2002 21:42:03 -0000 1.2
@@ -54,7 +54,6 @@
package org.apache.jetspeed.om.profile;
-import java.util.Vector;
import java.util.Iterator;
/**
@@ -62,22 +61,18 @@
* within a configuration Document.
*
* @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
- * @version $Id: Portlets.java,v 1.1 2002/03/22 18:38:35 taylor Exp $
+ * @version $Id: Portlets.java,v 1.2 2002/03/25 21:42:03 taylor Exp $
*/
public interface Portlets extends IdentityElement
{
public Controller getController();
public void setController(Controller controller);
-
- public Vector getPortlets();
-
- public void setPortlets(Vector portlets);
-
- public Vector getEntries();
-
- public void setEntries(Vector entries);
+ public void setSecurity(Security security);
+
+ public Security getSecurity();
+
public int getEntryCount();
public int getPortletsCount();
1.2 +12 -9 jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/Security.java
Index: Security.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/Security.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Security.java 22 Mar 2002 18:38:35 -0000 1.1
+++ Security.java 25 Mar 2002 21:42:03 -0000 1.2
@@ -54,21 +54,24 @@
package org.apache.jetspeed.om.profile;
-import java.util.Map;
-import java.util.Vector;
+import java.util.Iterator;
/**
* Interface describing security for an entry.
*
* @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
- * @version $Id: Security.java,v 1.1 2002/03/22 18:38:35 taylor Exp $
+ * @version $Id: Security.java,v 1.2 2002/03/25 21:42:03 taylor Exp $
*/
public interface Security
-{
-
- /** @return all the roles */
- public Vector getRoles();
+{
+ public boolean hasRole(String name);
- /** @param the roles */
- public void setRoles(Vector roles);
+ public Iterator getRolesIterator();
+ public int getRolesCount();
+
+ public void removeAllRoles();
+
+ public Role removeRole(String role);
+
+ public void addRole(Role role);
}
1.2 +13 -1 jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/psml/PsmlPortlets.java
Index: PsmlPortlets.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/psml/PsmlPortlets.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- PsmlPortlets.java 22 Mar 2002 18:38:36 -0000 1.1
+++ PsmlPortlets.java 25 Mar 2002 21:42:03 -0000 1.2
@@ -64,12 +64,14 @@
* suitable for Castor XML serialization.
*
* @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
- * @version $Id: PsmlPortlets.java,v 1.1 2002/03/22 18:38:36 taylor Exp $
+ * @version $Id: PsmlPortlets.java,v 1.2 2002/03/25 21:42:03 taylor Exp $
*/
public class PsmlPortlets extends PsmlIdentityElement implements Portlets, java.io.Serializable
{
private Controller controller = null;
+ private Security security = null;
+
private Vector portlets = new Vector();
private Vector entries = new Vector();
@@ -85,6 +87,16 @@
public void setController(Controller controller)
{
this.controller = controller;
+ }
+
+ public void setSecurity(Security security)
+ {
+ this.security = security;
+ }
+
+ public Security getSecurity()
+ {
+ return this.security;
}
public Vector getEntries()
1.2 +61 -2 jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/psml/PsmlSecurity.java
Index: PsmlSecurity.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/psml/PsmlSecurity.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- PsmlSecurity.java 22 Mar 2002 18:38:36 -0000 1.1
+++ PsmlSecurity.java 25 Mar 2002 21:42:03 -0000 1.2
@@ -55,8 +55,10 @@
package org.apache.jetspeed.om.profile.psml;
import java.util.Vector;
+import java.util.Iterator;
import org.apache.jetspeed.om.profile.Security;
+import org.apache.jetspeed.om.profile.Role;
/**
* Bean like implementation of the Security interface suitable for
@@ -64,7 +66,7 @@
*
* @see org.apache.jetspeed.om.registry.Security
* @author <a href="mailto:raphael@apache.org">Rapha�l Luta</a>
- * @version $Id: PsmlSecurity.java,v 1.1 2002/03/22 18:38:36 taylor Exp $
+ * @version $Id: PsmlSecurity.java,v 1.2 2002/03/25 21:42:03 taylor Exp $
*/
public class PsmlSecurity implements Security, java.io.Serializable
{
@@ -73,7 +75,64 @@
public PsmlSecurity()
{}
-
+
+ public boolean hasRole(String name)
+ {
+ if (roles == null)
+ return false;
+
+ for (int ix=0; ix < roles.size(); ix++)
+ {
+ Role role = (Role)roles.elementAt(ix);
+ if (role.getName().equals(name))
+ return true;
+ }
+ return false;
+ }
+
+ public Iterator getRolesIterator()
+ {
+ return roles.iterator();
+ }
+
+ public int getRolesCount()
+ {
+ return roles.size();
+ }
+
+ public void removeAllRoles()
+ {
+ roles.removeAllElements();
+ }
+
+ public Role removeRole(String name)
+ {
+ if (roles == null)
+ return null;
+
+ for (int ix=0; ix < roles.size(); ix++)
+ {
+ Role role = (Role)roles.elementAt(ix);
+ if (role.getName().equals(name))
+ {
+ roles.removeElementAt(ix);
+ return role;
+ }
+ }
+ return null;
+ }
+
+ public void addRole(Role role)
+ {
+ roles.addElement(role);
+ }
+
+
+ /*
+ * CASTOR mapping functions
+ *
+ */
+
/** @return the role name that is required for accessing this entry */
public Vector getRoles()
{
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>