portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r470544 [3/4] - in /portals/jetspeed-2/trunk/components/serializer: ./ src/java/org/apache/jetspeed/serializer/ src/java/org/apache/jetspeed/serializer/objects/ test/assembly/ test/assembly/boot/
Date Thu, 02 Nov 2006 22:07:24 GMT
Added: portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSMimeTypes.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSMimeTypes.java?view=auto&rev=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSMimeTypes.java (added)
+++ portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSMimeTypes.java Thu Nov  2 14:07:22 2006
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.jetspeed.serializer.objects;
+
+import java.util.ArrayList;
+
+
+/**
+* Jetspeed Serializer - Simple mime types Wrapper
+* <p>
+* Wrapper to process XML representation of a set of mime types - used only for binding
+* 
+* @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
+* @version $Id: $
+*/
+public class JSMimeTypes extends ArrayList
+{
+}

Added: portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSNameValuePairs.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSNameValuePairs.java?view=auto&rev=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSNameValuePairs.java (added)
+++ portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSNameValuePairs.java Thu Nov  2 14:07:22 2006
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.jetspeed.serializer.objects;
+
+/**
+ * Serialized Name Value Pairs <info> <name>user.first.name</name> <value>Paul</value>
+ * </info>
+ * 
+ * @author <a href="mailto:hajo@bluesunrsie.com">Hajo Birthelmer</a>
+ * @version $Id: $
+ */
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.prefs.Preferences;
+
+import javolution.xml.XMLFormat;
+import javolution.xml.stream.XMLStreamException;
+import javolution.xml.sax.Attributes;
+
+public class JSNameValuePairs
+{
+
+    private HashMap myMap = null;
+
+    public JSNameValuePairs()
+    {
+    }
+    
+ 
+    /**
+     * @param arg0
+     */
+    public JSNameValuePairs(Preferences preferences)
+    {
+        myMap = new HashMap();
+        try
+        {
+            String[] strings = preferences.keys();
+            if ((strings != null) && (strings.length > 0))
+            {
+                int i = strings.length;
+                for (int j = 0; j < i; j++)
+                    myMap.put(strings[j], preferences.get(strings[j], "?????"));
+            }
+
+        } catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    /***************************************************************************
+     * SERIALIZER
+     */
+    private static final XMLFormat XML = new XMLFormat(JSNameValuePairs.class)
+    {
+
+        public void write(Object o, OutputElement xml)
+                throws XMLStreamException
+        {
+            try
+            {
+                JSNameValuePairs g = (JSNameValuePairs) o;
+                Iterator _it = g.myMap.keySet().iterator();
+                while (_it.hasNext())
+                {
+                    String _key = (String) _it.next();
+                    // xml.add((String) g.get(_key), _key, String.class);
+                    xml.setAttribute(_key, (String) g.myMap.get(_key));
+                }
+            } catch (Exception e)
+            {
+                e.printStackTrace();
+            }
+        }
+
+        public void read(InputElement xml, Object o)
+        {
+
+            try
+            {
+                JSNameValuePairs g = (JSNameValuePairs) o;
+                Attributes attribs = xml.getAttributes();
+                int len = attribs.getLength();
+
+                for (int i = 0; i < len; i++)
+                {
+                    try
+                    {
+                        String _key = attribs.getLocalName(i).toString();
+                        String _value = attribs.getValue(i).toString();
+                        g.myMap.put(_key, _value);
+                    } catch (Exception e)
+                    {
+                        /**
+                         * while annoying invalid entries in the file should be
+                         * just disregarded
+                         */
+                        e.printStackTrace();
+                    }
+                }
+            } catch (Exception e)
+            {
+                e.printStackTrace();
+            }
+        }
+    };
+
+}

Modified: portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSPermission.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSPermission.java?view=diff&rev=470544&r1=470543&r2=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSPermission.java (original)
+++ portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSPermission.java Thu Nov  2 14:07:22 2006
@@ -1,114 +1,353 @@
 /*
  * Copyright 2000-2004 The Apache Software Foundation.
  * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
  * 
- *      http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  * 
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
  */
 package org.apache.jetspeed.serializer.objects;
 
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javolution.xml.XMLFormat;
+import javolution.xml.stream.XMLStreamException;
+
 /**
- * Serialized Permission
- *      <permission type='folder' resource='/' actions='view, edit'>
- *           <roles>admin, user</roles>
- *           <groups>dev</groups>
- *           <users>joe</users>
- *       </permission>
- *
+ * Serialized Permission <permission type='folder' resource='/' actions='view,
+ * edit'> <roles>admin, user</roles> <groups>dev</groups> <users>joe</users>
+ * </permission>
+ * 
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  * @version $Id: $
  */
 public class JSPermission
 {
-    private String type;
-    private String resource;
-    private String actions;
-    private String roles;
-    private String groups;
-    private String users;
-    
-    public JSPermission()
-    {        
-    }
-
-    
-    public String getActions()
-    {
-        return actions;
-    }
-
-    
-    public void setActions(String actions)
-    {
-        this.actions = actions;
-    }
-
-    
-    public String getGroups()
-    {
-        return groups;
-    }
-
-    
-    public void setGroups(String groups)
-    {
-        this.groups = groups;
-    }
-
-    
-    public String getResource()
-    {
-        return resource;
-    }
-
-    
-    public void setResource(String resource)
-    {
-        this.resource = resource;
-    }
-
-    
-    public String getRoles()
-    {
-        return roles;
-    }
-
-    
-    public void setRoles(String roles)
-    {
-        this.roles = roles;
-    }
-
-    
-    public String getType()
-    {
-        return type;
-    }
-
-    
-    public void setType(String type)
-    {
-        this.type = type;
-    }
-
-    
-    public String getUsers()
-    {
-        return users;
-    }
-
-    
-    public void setUsers(String users)
-    {
-        this.users = users;
-    }
-    
+
+	private String type;
+
+	private String resource;
+
+	private String actions;
+
+	private long id;
+
+	private ArrayList roles = null;
+
+	private ArrayList groups = null;
+
+	private ArrayList users = null;
+
+	private JSUserRoles roleString;
+
+	private JSUserGroups groupString;
+
+	private JSUserUsers userString;
+
+	public static String TYPE_FOLDER = "folder".intern();
+
+	public static String TYPE_FRAGMENT = "fragment".intern();
+
+	public static String TYPE_PAGE = "page".intern();
+
+	public static String TYPE_PORTALRESOURCE = "portalResource".intern();
+
+	public static String TYPE_PORTALRESOURCECOLLECTION = "portalResource"
+			.intern();
+
+	public static String TYPE_PORTAL = "portal".intern();
+
+	public static String TYPE_UNKNOWN = "unknown".intern();
+
+	public String getClassForType(String type)
+	{
+		if ((type == null) || (type.length() == 0) || (type == TYPE_UNKNOWN))
+			return "";
+		if (type == TYPE_FOLDER)
+			return "org.apache.jetspeed.security.FolderPermission";
+		if (type == TYPE_FRAGMENT)
+			return "org.apache.jetspeed.security.FragmentPermission";
+		if (type == TYPE_PAGE)
+			return "org.apache.jetspeed.security.PagePermission";
+		if (type == TYPE_PORTALRESOURCE)
+			return "org.apache.jetspeed.security.PortalResourcePermission";
+		if (type == TYPE_PORTALRESOURCECOLLECTION)
+			return "org.apache.jetspeed.security.PortalResourcePermissionCollection";
+		if (type == TYPE_PORTAL)
+			return "org.apache.jetspeed.security.PortletPermission";
+		return "";
+	}
+
+	public String getTypeForClass(String className)
+	{
+		if ((className == null) || (className.length() == 0))
+			return TYPE_UNKNOWN;
+		if (className.equals("org.apache.jetspeed.security.FolderPermission"))
+			return TYPE_FOLDER;
+
+		if (className.equals("org.apache.jetspeed.security.FragmentPermission"))
+			return TYPE_FRAGMENT;
+		if (className.equals("org.apache.jetspeed.security.PagePermission"))
+			return TYPE_PAGE;
+		if (className
+				.equals("org.apache.jetspeed.security.PortalResourcePermission"))
+			return TYPE_PORTALRESOURCE;
+		if (className
+				.equals("org.apache.jetspeed.security.PortalResourcePermissionCollection"))
+			return TYPE_PORTALRESOURCECOLLECTION;
+		if (className.equals("org.apache.jetspeed.security.PortletPermission"))
+			return TYPE_PORTAL;
+		return TYPE_UNKNOWN;
+
+	}
+
+	public JSPermission()
+	{
+	}
+
+	private String append(JSRole rule)
+	{
+		return rule.getName();
+	}
+
+	private String append(JSGroup group)
+	{
+		return group.getName();
+	}
+
+	private String append(JSUser user)
+	{
+		return user.getName();
+	}
+
+	private String append(Object s)
+	{
+		if (s instanceof JSRole)
+			return append((JSRole) s);
+		if (s instanceof JSGroup)
+			return append((JSGroup) s);
+		if (s instanceof JSUser)
+			return append((JSUser) s);
+
+		return s.toString();
+	}
+
+	private String putTokens(ArrayList _list)
+	{
+		if ((_list == null) || (_list.size() == 0))
+			return "";
+		boolean _start = true;
+		Iterator _it = _list.iterator();
+		StringBuffer _sb = new StringBuffer();
+		while (_it.hasNext())
+		{
+			if (!_start)
+				_sb.append(',');
+			else
+				_start = false;
+
+			_sb.append(append(_it.next()));
+		}
+		return _sb.toString();
+	}
+
+	/**
+	 * @return Returns the actions.
+	 */
+	public String getActions()
+	{
+		return actions;
+	}
+
+	/**
+	 * @param actions
+	 *            The actions to set.
+	 */
+	public void setActions(String actions)
+	{
+		this.actions = actions;
+	}
+
+	/**
+	 * @return Returns the groups.
+	 */
+	public ArrayList getGroups()
+	{
+		return groups;
+	}
+
+	/**
+	 * @param groups
+	 *            The groups to set.
+	 */
+	public void setGroups(ArrayList groups)
+	{
+		this.groups = groups;
+	}
+
+	/**
+	 * @return Returns the resource.
+	 */
+	public String getResource()
+	{
+		return resource;
+	}
+
+	/**
+	 * @param resource
+	 *            The resource to set.
+	 */
+	public void setResource(String resource)
+	{
+		this.resource = resource;
+	}
+
+	/**
+	 * @return Returns the roles.
+	 */
+	public ArrayList getRoles()
+	{
+		return roles;
+	}
+
+	/**
+	 * @param roles
+	 *            The roles to set.
+	 */
+	public void setRoles(ArrayList roles)
+	{
+		this.roles = roles;
+	}
+
+	/**
+	 * @return Returns the type.
+	 */
+	public String getType()
+	{
+		return type;
+	}
+
+	/**
+	 * @param type
+	 *            The type to set.
+	 */
+	public void setType(String type)
+	{
+		this.type = type;
+	}
+
+	/**
+	 * @return Returns the users.
+	 */
+	public ArrayList getUsers()
+	{
+		return users;
+	}
+
+	/**
+	 * @param users
+	 *            The users to set.
+	 */
+	public void setUsers(ArrayList users)
+	{
+		this.users = users;
+	}
+
+
+	/**
+	 * @return Returns the id.
+	 */
+	public long getId()
+	{
+		return id;
+	}
+
+	/**
+	 * @param id
+	 *            The id to set.
+	 */
+	public void setId(long id)
+	{
+		this.id = id;
+	}
+
+	
+
+	public void addGroup(JSGroup group)
+	{
+		if (groups == null)
+			groups = new ArrayList();
+		groups.add(group);
+	}
+
+	public void addRole(JSRole role)
+	{
+		if (roles == null)
+			roles = new ArrayList();
+		roles.add(role);
+	}
+
+
+	public void addUser(JSUser user)
+	{
+		if (users == null)
+			users = new ArrayList();
+		users.add(user);
+	}
+
+
+	/***************************************************************************
+	 * SERIALIZER
+	 */
+	private static final XMLFormat XML = new XMLFormat(JSPermission.class)
+	{
+		public void write(Object o, OutputElement xml)
+				throws XMLStreamException
+		{
+			try
+			{
+				JSPermission g = (JSPermission) o;
+				xml.setAttribute("type", g.getType());
+				xml.setAttribute("resource",g.getResource());
+				xml.setAttribute("actions",g.getActions());
+				g.groupString = new JSUserGroups(g.putTokens(g.getGroups()));
+				g.roleString = new JSUserRoles(g.putTokens(g.getRoles())); 
+				g.userString = new JSUserUsers(g.putTokens(g.getUsers())); 
+				xml.add(g.roleString);
+				xml.add(g.groupString);
+				xml.add(g.userString);
+
+			} catch (Exception e)
+			{
+				e.printStackTrace();
+			}
+		}
+
+		public void read(InputElement xml, Object o)
+		{
+			try
+			{
+				JSPermission g = (JSPermission) o;
+				g.resource = xml.getAttribute("resource", "unknown");
+//				g.roles = g.getTokens((String) xml.get("roles"));
+//				g.groups = g.getTokens((String) xml.get("groups"));
+
+			} catch (Exception e)
+			{
+				e.printStackTrace();
+			}
+		}
+
+	};
+
+
+	
 }

Added: portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSPermissions.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSPermissions.java?view=auto&rev=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSPermissions.java (added)
+++ portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSPermissions.java Thu Nov  2 14:07:22 2006
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.jetspeed.serializer.objects;
+
+import java.util.ArrayList;
+
+
+/**
+* Jetspeed Serializer - Simple Permissions Wrapper
+* <p>
+* Wrapper to process XML representation of a set of permissions - used only for binding
+* 
+* @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
+* @version $Id: $
+*/
+public class JSPermissions extends ArrayList
+{
+}

Added: portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSPrincipalRule.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSPrincipalRule.java?view=auto&rev=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSPrincipalRule.java (added)
+++ portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSPrincipalRule.java Thu Nov  2 14:07:22 2006
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.jetspeed.serializer.objects;
+import javolution.xml.XMLFormat;
+import javolution.xml.stream.XMLStreamException;
+
+import org.apache.jetspeed.security.BasePrincipal;
+
+public class JSPrincipalRule
+{
+// int refID;
+
+	private String locator;
+
+	private String rule;
+
+    public JSPrincipalRule()
+    {
+    }
+	public JSPrincipalRule(String locator, String rule)
+	{
+//		refID = id;
+		this.locator = locator;
+		this.rule = rule;
+	}
+
+	/***************************************************************************
+	 * SERIALIZER
+	 */
+	private static final XMLFormat XML = new XMLFormat(JSPrincipalRule.class)
+	{
+		public void write(Object o, OutputElement xml)
+				throws XMLStreamException
+		{
+			try
+			{
+				JSPrincipalRule g = (JSPrincipalRule) o;
+				xml.setAttribute("locator", g.locator);
+				xml.setAttribute("rule", g.rule);
+			} catch (Exception e)
+			{
+				e.printStackTrace();
+			}
+		}
+
+		public void read(InputElement xml, Object o)
+		{
+			try
+			{
+				JSPrincipalRule g = (JSPrincipalRule) o;
+				g.setLocator(xml.getAttribute("locator","unknown"));
+				g.setRule(xml.getAttribute("rule","unknown"));
+				
+				
+			} catch (Exception e)
+			{
+				e.printStackTrace();
+			}
+		}
+
+	};
+
+
+
+
+	/**
+	 * @return Returns the locator.
+	 */
+	public String getLocator()
+	{
+		return locator;
+	}
+
+	/**
+	 * @param locator The locator to set.
+	 */
+	public void setLocator(String locator)
+	{
+		this.locator = locator;
+	}
+
+	/**
+	 * @return Returns the rule.
+	 */
+	public String getRule()
+	{
+		return rule;
+	}
+
+	/**
+	 * @param rule The rule to set.
+	 */
+	public void setRule(String rule)
+	{
+		this.rule = rule;
+	}
+}

Added: portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSPrincipalRules.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSPrincipalRules.java?view=auto&rev=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSPrincipalRules.java (added)
+++ portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSPrincipalRules.java Thu Nov  2 14:07:22 2006
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.jetspeed.serializer.objects;
+
+import java.util.ArrayList;
+
+
+/**
+* Jetspeed Serializer - Simple Prinicpal Rules Wrapper
+* <p>
+* Wrapper to process XML representation of a set of principal rules - used only for binding
+* 
+* @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
+* @version $Id: $
+*/
+public class JSPrincipalRules extends ArrayList
+{
+}

Modified: portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSProfilingRule.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSProfilingRule.java?view=diff&rev=470544&r1=470543&r2=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSProfilingRule.java (original)
+++ portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSProfilingRule.java Thu Nov  2 14:07:22 2006
@@ -18,13 +18,15 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import javolution.xml.XMLFormat;
+import javolution.xml.stream.XMLStreamException;
+
 /**
  * Import ProfilingRule
  * 
- *   <profilingRule>
- *       <name>j2</name>
- *       <className>org.apache.jetspeed.profile.RuleImpl</className>
+ *   <profilingRule name = j2>
  *       <description>whatever</description>
+ *       <className>org.apache.jetspeed.profile.RuleImpl</className>
  *       <criteria>
  *          ...
  *       </criteria>
@@ -35,10 +37,11 @@
  */
 public class JSProfilingRule
 {
-    private List criteria = new ArrayList();
-    private String name;
+    private String id;
     private String className;
     private String description;
+    JSRuleCriterions criterions = new JSRuleCriterions();
+    
     
     public JSProfilingRule()
     {        
@@ -69,23 +72,72 @@
     }
 
     
-    public String getName()
-    {
-        return name;
-    }
-
-    
-    public void setName(String name)
+    public String getId()
     {
-        this.name = name;
+        return id;
     }
 
     
-    public List getCriteria()
+    public void setId(String id)
     {
-        return criteria;
-    }
+        this.id = id;
+    }
+
+    
+ 
+	/***************************************************************************
+	 * SERIALIZER
+	 */
+	private static final XMLFormat XML = new XMLFormat(JSProfilingRule.class)
+	{
+		public void write(Object o, OutputElement xml)
+				throws XMLStreamException
+		{
+
+			try
+			{
+				JSProfilingRule g = (JSProfilingRule) o;
+				xml.setAttribute("id", g.id);
+				xml.add( g.description, "description",String.class);
+				xml.add(g.className ,"classname", String.class);
+				xml.add(g.criterions);
+
+			} catch (Exception e)
+			{
+				e.printStackTrace();
+			}
+		}
+
+		public void read(InputElement xml, Object o)
+		{
+			try
+			{
+				JSProfilingRule g = (JSProfilingRule) o;
+				g.setId(xml.getText().toString());
+			} catch (Exception e)
+			{
+				e.printStackTrace();
+			}
+		}
+	};
+
+
+	/**
+	 * @return Returns the criterions.
+	 */
+	public JSRuleCriterions getCriterions()
+	{
+		return criterions;
+	}
+
+
+	/**
+	 * @param criterions The criterions to set.
+	 */
+	public void setCriterions(JSRuleCriterions criterions)
+	{
+		this.criterions = criterions;
+	}
 
-    
     
 }

Added: portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSProfilingRules.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSProfilingRules.java?view=auto&rev=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSProfilingRules.java (added)
+++ portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSProfilingRules.java Thu Nov  2 14:07:22 2006
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.jetspeed.serializer.objects;
+
+import java.util.ArrayList;
+
+
+/**
+* Jetspeed Serializer - Simple Profiling Rules Wrapper
+* <p>
+* Wrapper to process XML representation of a set of profiling rules - used only for binding
+* 
+* @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
+* @version $Id: $
+*/
+public class JSProfilingRules extends ArrayList
+{
+}

Added: portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSRole.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSRole.java?view=auto&rev=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSRole.java (added)
+++ portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSRole.java Thu Nov  2 14:07:22 2006
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.jetspeed.serializer.objects;
+
+import javolution.xml.XMLFormat;
+import javolution.xml.stream.XMLStreamException;
+
+import java.util.prefs.Preferences;
+import java.util.*;
+
+import org.apache.jetspeed.security.Role;
+
+public class JSRole
+{
+	// private int refID;
+
+	String name;
+
+	private JSNameValuePairs preferences;
+
+	public JSRole()
+	{
+		// refID = id;
+	}
+
+	/***************************************************************************
+	 * SERIALIZER
+	 */
+	private static final XMLFormat XML = new XMLFormat(JSRole.class)
+	{
+		public void write(Object o, OutputElement xml)
+				throws XMLStreamException
+		{
+			try
+			{
+				JSRole g = (JSRole) o;
+				xml.addText(g.getName());
+			} catch (Exception e)
+			{
+				e.printStackTrace();
+			}
+		}
+
+		public void read(InputElement xml, Object o)
+		{
+			try
+			{
+				JSRole g = (JSRole) o;
+				g.setName(xml.getText().toString());
+			} catch (Exception e)
+			{
+				e.printStackTrace();
+			}
+		}
+
+	};
+
+	/**
+	 * @return Returns the name.
+	 */
+	public String getName()
+	{
+		return name;
+	}
+
+	/**
+	 * @param name
+	 *            The name to set.
+	 */
+	public void setName(String name)
+	{
+		this.name = name;
+	}
+
+}

Added: portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSRoles.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSRoles.java?view=auto&rev=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSRoles.java (added)
+++ portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSRoles.java Thu Nov  2 14:07:22 2006
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.jetspeed.serializer.objects;
+
+import java.util.ArrayList;
+
+
+/**
+* Jetspeed Serializer - Simple Rules Wrapper
+* <p>
+* Wrapper to process XML representation of a set of rules - used only for binding
+* 
+* @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
+* @version $Id: $
+*/
+public class JSRoles extends ArrayList
+{
+}

Added: portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSRuleCriterion.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSRuleCriterion.java?view=auto&rev=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSRuleCriterion.java (added)
+++ portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSRuleCriterion.java Thu Nov  2 14:07:22 2006
@@ -0,0 +1,192 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.jetspeed.serializer.objects;
+
+import javolution.xml.XMLFormat;
+import javolution.xml.stream.XMLStreamException;
+
+import org.apache.jetspeed.profiler.rules.RuleCriterion;
+
+public class JSRuleCriterion
+{
+	// private int refID;
+
+	private String name;
+
+	private String id;
+
+	private String type;
+
+	private String value;
+
+	private int fallBackOrder;
+
+	private int fallBackType;
+
+	public JSRuleCriterion()
+	{
+		// refID = id;
+	}
+
+	public JSRuleCriterion(RuleCriterion c)
+	{
+		this.id = c.getRuleId();
+		this.name = c.getName();
+
+		this.type = c.getType();
+		this.value = c.getValue();
+		this.fallBackOrder = c.getFallbackOrder();
+		this.fallBackType = c.getFallbackType();
+	}
+
+	/***************************************************************************
+	 * SERIALIZER
+	 */
+	private static final XMLFormat XML = new XMLFormat(JSRuleCriterion.class)
+	{
+		public void write(Object o, OutputElement xml)
+				throws XMLStreamException
+		{
+
+			try
+			{
+				JSRuleCriterion g = (JSRuleCriterion) o;
+				xml.setAttribute("id", g.id);
+				xml.setAttribute("name", g.name);
+				xml.add( g.type, "type",String.class);
+				xml.add(g.value,"value", String.class);
+				xml.add(Integer.valueOf(g.fallBackOrder), "fallBackOrder", Integer.class);
+				xml.add(Integer.valueOf(g.fallBackType), "fallBackType", Integer.class);
+
+				// xml.add(g.groupString);
+
+			} catch (Exception e)
+			{
+				e.printStackTrace();
+			}
+		}
+
+		public void read(InputElement xml, Object o)
+		{
+			try
+			{
+				JSRuleCriterion g = (JSRuleCriterion) o;
+				g.setName(xml.getText().toString());
+			} catch (Exception e)
+			{
+				e.printStackTrace();
+			}
+		}
+	};
+
+
+	/**
+	 * @return Returns the type.
+	 */
+	public String getType()
+	{
+		return type;
+	}
+
+	/**
+	 * @param type The type to set.
+	 */
+	public void setType(String type)
+	{
+		this.type = type;
+	}
+
+	/**
+	 * @return Returns the fallBackOrder.
+	 */
+	public int getFallBackOrder()
+	{
+		return fallBackOrder;
+	}
+
+	/**
+	 * @param fallBackOrder The fallBackOrder to set.
+	 */
+	public void setFallBackOrder(int fallBackOrder)
+	{
+		this.fallBackOrder = fallBackOrder;
+	}
+	/**
+	 * @return Returns the fallBackType.
+	 */
+	public int getFallBackType()
+	{
+		return fallBackType;
+	}
+
+	/**
+	 * @param fallBackTye The fallBackType to set.
+	 */
+	public void setFallBackType(int fallBackType)
+	{
+		this.fallBackType = fallBackType;
+	}
+
+	/**
+	 * @return Returns the id.
+	 */
+	public String getId()
+	{
+		return id;
+	}
+
+	/**
+	 * @param id The id to set.
+	 */
+	public void setId(String id)
+	{
+		this.id = id;
+	}
+
+	/**
+	 * @return Returns the name.
+	 */
+	public String getName()
+	{
+		return name;
+	}
+
+	/**
+	 * @param name The name to set.
+	 */
+	public void setName(String name)
+	{
+		this.name = name;
+	}
+
+	/**
+	 * @return Returns the value.
+	 */
+	public String getValue()
+	{
+		return value;
+	}
+
+	/**
+	 * @param value The value to set.
+	 */
+	public void setValue(String value)
+	{
+		this.value = value;
+	}
+
+
+}

Added: portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSRuleCriterions.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSRuleCriterions.java?view=auto&rev=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSRuleCriterions.java (added)
+++ portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSRuleCriterions.java Thu Nov  2 14:07:22 2006
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.jetspeed.serializer.objects;
+
+import java.util.ArrayList;
+
+
+/**
+* Jetspeed Serializer - Simple Rule Criterion Wrapper
+* <p>
+* Wrapper to process XML representation of a set of criteria - used only for binding
+* 
+* @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
+* @version $Id: $
+*/
+public class JSRuleCriterions extends ArrayList
+{
+}

Added: portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSSimpleIDName.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSSimpleIDName.java?view=auto&rev=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSSimpleIDName.java (added)
+++ portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSSimpleIDName.java Thu Nov  2 14:07:22 2006
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.jetspeed.serializer.objects;
+
+import javolution.xml.XMLFormat;
+import javolution.xml.stream.XMLStreamException;
+
+import org.apache.jetspeed.capabilities.MimeType;
+
+public class JSSimpleIDName 
+{
+	// private int refID;
+
+	private String name;
+
+	private int id;
+	
+	public JSSimpleIDName()
+	{
+		// refID = id;
+	}
+	
+	public JSSimpleIDName(int id, String name)
+	{
+		this.id = id;
+		this.name = name;
+		// refID = id;
+	}
+
+	/***************************************************************************
+	 * SERIALIZER
+	 */
+	private static final XMLFormat XML = new XMLFormat(JSSimpleIDName.class)
+	{
+	public void write(Object o, OutputElement xml) throws XMLStreamException
+	{
+
+		try
+		{
+			JSSimpleIDName g = (JSSimpleIDName) o;
+			xml.setAttribute("name",g.name );
+			xml.setAttribute("id",g.id);
+			
+		} catch (Exception e)
+		{
+			e.printStackTrace();
+		}
+	}
+
+	public void read(InputElement xml, Object o)
+	{
+		try
+		{
+			JSSimpleIDName g = (JSSimpleIDName) o;
+			g.setName(xml.getAttribute("name","Unknown"));
+			g.setId(xml.getAttribute("id",0));
+			
+		} catch (Exception e)
+		{
+			e.printStackTrace();
+		}
+	}
+	};
+	/**
+	 * @return Returns the name.
+	 */
+	public String getName()
+	{
+		return name;
+	}
+
+	/**
+	 * @param name
+	 *            The name to set.
+	 */
+	public void setName(String name)
+	{
+		this.name = name;
+	}
+
+	/**
+	 * @return Returns the id.
+	 */
+	public int getId()
+	{
+		return id;
+	}
+
+	/**
+	 * @param id The id to set.
+	 */
+	public void setId(int id)
+	{
+		this.id = id;
+	}
+
+	
+}

Added: portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSSnapshot.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSSnapshot.java?view=auto&rev=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSSnapshot.java (added)
+++ portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSSnapshot.java Thu Nov  2 14:07:22 2006
@@ -0,0 +1,477 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.jetspeed.serializer.objects;
+
+import java.util.ArrayList;
+
+import javolution.xml.XMLFormat;
+import javolution.xml.stream.XMLStreamException;
+
+public class JSSnapshot
+{
+
+    public static final int softwareVersion = 1;
+
+    public static final int softwareSubVersion = 0;
+
+    private String name;
+
+    private int savedVersion;
+
+    private int savedSubversion;
+
+    private String dateCreated;
+
+    private String dataSource;
+
+    private String encryption;
+
+    private JSMimeTypes mimeTypes;
+
+    private JSMediaTypes mediaTypes;
+
+    private JSClients clients;
+
+    private JSCapabilities capabilities;
+
+    private JSRoles roles;
+
+    private JSGroups groups;
+
+    private JSUsers users;
+
+    private JSPermissions permissions;
+
+    private JSProfilingRules rules;
+
+    private String defaultRule;
+
+    /**
+     * check the software version and subvversion against the saved
+     * version...and verify whether it is compatible...
+     * 
+     * @return the current software can process this file
+     */
+    public boolean checkVersion()
+    {
+        return true;
+    }
+
+    public JSSnapshot()
+    {
+        System.out.println("JSSnapshot Class created");
+    }
+
+    public JSSnapshot(String name)
+    {
+        this.name = name;
+        mimeTypes = new JSMimeTypes();
+        mediaTypes = new JSMediaTypes();
+        clients = new JSClients();
+        capabilities = new JSCapabilities();
+        roles = new JSRoles();
+        groups = new JSGroups();
+        users = new JSUsers();
+        permissions = new JSPermissions();
+        rules = new JSProfilingRules();
+    }
+
+    /***************************************************************************
+     * SERIALIZER
+     */
+    private static final XMLFormat XML = new XMLFormat(JSSnapshot.class)
+    {
+
+        public void write(Object o, OutputElement xml)
+                throws XMLStreamException
+        {
+            try
+            {
+                JSSnapshot g = (JSSnapshot) o;
+
+                /** attributes here */
+
+                xml.setAttribute("name", g.getName());
+
+                /** named fields HERE */
+
+                xml.add(String.valueOf(g.getSoftwareVersion()),
+                        "softwareVersion");
+                xml.add(String.valueOf(g.getSoftwareVersion()),
+                        "softwareSubVersion");
+                xml.add(g.getDefaultRule(), "default_rule", String.class);
+
+                xml.add(g.encryption,"Encryption",String.class);
+                
+                /** implicitly named (through binding) fields here */
+
+                xml.add(g.getMimeTypes());
+                xml.add(g.getMediaTypes());
+                xml.add(g.getCapabilities());
+                xml.add(g.getClients());
+                
+                xml.add(g.getRoles()); 
+                xml.add(g.getGroups());
+                xml.add(g.getUsers()); 
+                
+                /**
+                 * xml.add(g.getPermissions());
+                 * 
+                 * xml.add(g.getRules());
+                 */
+            } catch (Exception e)
+            {
+                e.printStackTrace();
+            }
+        }
+
+        public void read(InputElement xml, Object o)
+        {
+            try
+            {
+                JSSnapshot g = (JSSnapshot) o;
+                g.name = xml.getAttribute("name", "unknown");
+                Object o1 = xml.get("softwareVersion");
+                if (o1 instanceof String)
+                    g.savedVersion = Integer.parseInt(((String) o1));
+                o1 = xml.get("softwareSubVersion");
+                if (o1 instanceof String)
+                    g.savedSubversion = Integer.parseInt(((String) o1));
+                o1 = xml.get("default_rule");
+                if (o1 instanceof String) g.defaultRule = (String) o1;
+                o1 = xml.get("Encryption");
+                if (o1 instanceof String) g.encryption = (String) o1;
+
+                while (xml.hasNext())
+                {
+                    o1 = xml.getNext(); // mime
+
+                    if (o1 instanceof JSMimeTypes)
+                        g.mimeTypes = (JSMimeTypes) o1;
+                    else if (o1 instanceof JSMediaTypes)
+                        g.mediaTypes = (JSMediaTypes) o1;
+                    else if (o1 instanceof JSClients)
+                        g.clients = (JSClients) o1;
+                    else if (o1 instanceof JSCapabilities)
+                        g.capabilities = (JSCapabilities) o1;
+                    else if (o1 instanceof JSRoles)
+                        g.roles = (JSRoles) o1;
+                    else if (o1 instanceof JSGroups)
+                        g.groups = (JSGroups) o1;
+                    else if (o1 instanceof JSUsers)
+                        g.users = (JSUsers) o1;
+                    else if (o1 instanceof JSPermissions)
+                        g.permissions = (JSPermissions) o1;
+                    else if (o1 instanceof JSProfilingRules)
+                        g.rules = (JSProfilingRules) o1;
+                }
+            } catch (Exception e)
+            {
+                e.printStackTrace();
+            }
+        }
+    };
+
+    /**
+     * @return Returns the name.
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+    /**
+     * @return Returns the groups.
+     */
+    public JSGroups getGroups()
+    {
+        return groups;
+    }
+
+    /**
+     * @param groups
+     *            The groups to set.
+     */
+    public void setGroups(JSGroups groups)
+    {
+        this.groups = groups;
+    }
+
+    /**
+     * @return Returns the roles.
+     */
+    public JSRoles getRoles()
+    {
+        return roles;
+    }
+
+    /**
+     * @param roles
+     *            The roles to set.
+     */
+    public void setRoles(JSRoles roles)
+    {
+        this.roles = roles;
+    }
+
+    /**
+     * @return Returns the roles.
+     */
+    public JSUsers getUsers()
+    {
+        return users;
+    }
+
+    /**
+     * @return Returns the encryption.
+     */
+    public String getEncryption()
+    {
+        return encryption;
+    }
+
+    /**
+     * @param encryption
+     *            The encryption to set.
+     */
+    public void setEncryption(String encryption)
+    {
+        this.encryption = encryption;
+    }
+
+    /**
+     * @return Returns the softwareSubVersion.
+     */
+    public static int getSoftwareSubVersion()
+    {
+        return softwareSubVersion;
+    }
+
+    /**
+     * @return Returns the softwareVersion.
+     */
+    public static int getSoftwareVersion()
+    {
+        return softwareVersion;
+    }
+
+    /**
+     * @return Returns the capabilities.
+     */
+    public JSCapabilities getCapabilities()
+    {
+        return capabilities;
+    }
+
+    /**
+     * @param capabilities
+     *            The capabilities to set.
+     */
+    public void setCapabilities(JSCapabilities capabilities)
+    {
+        this.capabilities = capabilities;
+    }
+
+    /**
+     * @return Returns the clients.
+     */
+    public JSClients getClients()
+    {
+        return clients;
+    }
+
+    /**
+     * @param clients
+     *            The clients to set.
+     */
+    public void setClients(JSClients clients)
+    {
+        this.clients = clients;
+    }
+
+    /**
+     * @return Returns the dataSource.
+     */
+    public String getDataSource()
+    {
+        return dataSource;
+    }
+
+    /**
+     * @param dataSource
+     *            The dataSource to set.
+     */
+    public void setDataSource(String dataSource)
+    {
+        this.dataSource = dataSource;
+    }
+
+    /**
+     * @return Returns the dateCreated.
+     */
+    public String getDateCreated()
+    {
+        return dateCreated;
+    }
+
+    /**
+     * @param dateCreated
+     *            The dateCreated to set.
+     */
+    public void setDateCreated(String dateCreated)
+    {
+        this.dateCreated = dateCreated;
+    }
+
+    /**
+     * @return Returns the mediaTypes.
+     */
+    public JSMediaTypes getMediaTypes()
+    {
+        return mediaTypes;
+    }
+
+    /**
+     * @param mediaTypes
+     *            The mediaTypes to set.
+     */
+    public void setMediaTypes(JSMediaTypes mediaTypes)
+    {
+        this.mediaTypes = mediaTypes;
+    }
+
+    /**
+     * @return Returns the mimeTypes.
+     */
+    public JSMimeTypes getMimeTypes()
+    {
+        return mimeTypes;
+    }
+
+    /**
+     * @param mimeTypes
+     *            The mimeTypes to set.
+     */
+    public void setMimeTypes(JSMimeTypes mimeTypes)
+    {
+        this.mimeTypes = mimeTypes;
+    }
+
+    /**
+     * @return Returns the savedSubversion.
+     */
+    public int getSavedSubversion()
+    {
+        return savedSubversion;
+    }
+
+    /**
+     * @param savedSubversion
+     *            The savedSubversion to set.
+     */
+    public void setSavedSubversion(int savedSubversion)
+    {
+        this.savedSubversion = savedSubversion;
+    }
+
+    /**
+     * @return Returns the savedVersion.
+     */
+    public int getSavedVersion()
+    {
+        return savedVersion;
+    }
+
+    /**
+     * @param savedVersion
+     *            The savedVersion to set.
+     */
+    public void setSavedVersion(int savedVersion)
+    {
+        this.savedVersion = savedVersion;
+    }
+
+    /**
+     * @param name
+     *            The name to set.
+     */
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    /**
+     * @param users
+     *            The users to set.
+     */
+    public void setUsers(JSUsers users)
+    {
+        this.users = users;
+    }
+
+    /**
+     * @return Returns the permissions.
+     */
+    public JSPermissions getPermissions()
+    {
+        return permissions;
+    }
+
+    /**
+     * @param permissions
+     *            The permissions to set.
+     */
+    public void setPermissions(JSPermissions permissions)
+    {
+        this.permissions = permissions;
+    }
+
+    /**
+     * @return Returns the rules.
+     */
+    public JSProfilingRules getRules()
+    {
+        return rules;
+    }
+
+    /**
+     * @param rules
+     *            The rules to set.
+     */
+    public void setRules(JSProfilingRules rules)
+    {
+        this.rules = rules;
+    }
+
+    /**
+     * @return Returns the defaultRule.
+     */
+    public String getDefaultRule()
+    {
+        return defaultRule;
+    }
+
+    /**
+     * @param defaultRule
+     *            The defaultRule to set.
+     */
+    public void setDefaultRule(String defaultRule)
+    {
+        this.defaultRule = defaultRule;
+    }
+
+}

Modified: portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUser.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUser.java?view=diff&rev=470544&r1=470543&r2=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUser.java (original)
+++ portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUser.java Thu Nov  2 14:07:22 2006
@@ -1,131 +1,385 @@
 /*
  * Copyright 2000-2004 The Apache Software Foundation.
  * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
  * 
- *      http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  * 
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
  */
 package org.apache.jetspeed.serializer.objects;
 
+import java.security.Principal;
 import java.util.ArrayList;
-import java.util.List;
+import java.util.Iterator;
+import java.util.StringTokenizer;
+import java.util.prefs.Preferences;
+
+import javolution.xml.XMLFormat;
+import javolution.xml.stream.XMLStreamException;
 
 /**
  * Jetspeed Serialized (JS) User
- *
+ * 
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  * @version $Id: $
  */
 public class JSUser
 {
+
     private String name;
-    private String password;
-    private String template;
-    private String roles;
-    private String groups;
-    private List userInfo = new ArrayList();
-    private List profileRules = new ArrayList();
-    
+
+    private char[] password;
+
+    private ArrayList roles = null;
+
+    private ArrayList groups = null;
+
+    private JSUserAttributes userInfo = null;
+
+    private JSNameValuePairs preferences = null;
+
+    private ArrayList publicCredentials = null;
+
+    private ArrayList privateCredentials = null;
+
+    private JSUserRoles roleString;
+
+    private JSUserGroups groupString;
+
+    private JSPrincipalRules rules = new JSPrincipalRules();
+
+    private transient Principal principal;
+
     public JSUser()
-    {        
+    {
     }
 
-    
-    public String getGroups()
+    public void addPublicCredential(Object o)
+    {
+        if (publicCredentials == null) publicCredentials = new ArrayList();
+        publicCredentials.add(o);
+    }
+
+    public void addPrivateCredential(Object o)
+    {
+        if (privateCredentials == null) privateCredentials = new ArrayList();
+        privateCredentials.add(o);
+    }
+
+    public void addGroup(JSGroup group)
+    {
+        if (groups == null) groups = new ArrayList();
+        groups.add(group);
+    }
+
+    public void addRole(JSRole role)
+    {
+        if (roles == null) roles = new ArrayList();
+        roles.add(role);
+    }
+
+    public ArrayList getGroups()
     {
         return groups;
     }
 
-    
-    public void setGroups(String groups)
+    public void setGroups(ArrayList groups)
     {
         this.groups = groups;
     }
 
-    
-    public String getPassword()
+    public char[] getPassword()
     {
         return password;
     }
 
-    
-    public void setPassword(String password)
+    public void setUserCredential(String name, char[] password)
+    {
+        setName(name);
+        setPassword(password);
+
+    }
+
+    public void setPassword(char[] password)
     {
         this.password = password;
     }
 
-    
-    public String getRoles()
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    public ArrayList getRoles()
     {
         return roles;
     }
 
-    
-    public void setRoles(String roles)
+    public void setRoles(ArrayList roles)
     {
         this.roles = roles;
     }
 
-    
-    public String getTemplate()
+    public String getName()
     {
-        return template;
+        return name;
     }
 
-    
-    public void setTemplate(String template)
+    /*
+     * private void initUser() throws Exception { User user = null; try {
+     * ums.addUser("test", "password01"); user = ums.getUser("test"); } catch
+     * (SecurityException sex) { assertTrue("user exists. should not have thrown
+     * an exception.", false); }
+     * 
+     * Preferences userInfoPrefs = user.getPreferences().node("userinfo");
+     * userInfoPrefs.put("user.name.given", "Test Dude");
+     * userInfoPrefs.put("user.name.family", "Dudley"); }
+     * 
+     */
+
+    /**
+     * @return Returns the preferences.
+     */
+    public JSNameValuePairs getPreferences()
     {
-        this.template = template;
+        return preferences;
     }
 
-    
-    public String getName()
+    /**
+     * @param preferences
+     *            The preferences to set.
+     */
+    public void setPreferences(Preferences preferences)
     {
-        return name;
+        this.preferences = new JSNameValuePairs(preferences);
     }
 
-    
-    public void setName(String name)
+    /**
+     * @return Returns the privateCredentials.
+     */
+    public ArrayList getPrivateCredentials()
     {
-        this.name = name;
+        return privateCredentials;
     }
 
-    
-    public List getUserInfo()
+    /**
+     * @param privateCredentials
+     *            The privateCredentials to set.
+     */
+    public void setPrivateCredentials(ArrayList privateCredentials)
+    {
+        this.privateCredentials = privateCredentials;
+    }
+
+    /**
+     * @return Returns the publicCredentials.
+     */
+    public ArrayList getPublicCredentials()
+    {
+        return publicCredentials;
+    }
+
+    /**
+     * @param publicCredentials
+     *            The publicCredentials to set.
+     */
+    public void setPublicCredentials(ArrayList publicCredentials)
+    {
+        this.publicCredentials = publicCredentials;
+    }
+
+    /**
+     * @param userInfo
+     *            The userInfo to set.
+     */
+    public void setUserInfo(Preferences userInfo)
+    {
+        this.userInfo = new JSUserAttributes(userInfo);
+    }
+
+    /**
+     * @return Returns the userInfo.
+     */
+    public JSUserAttributes getUserInfo()
     {
         return userInfo;
     }
 
-    
-    public void setUserInfo(List userInfo)
+    /***************************************************************************
+     * SERIALIZER
+     */
+    private static final XMLFormat XML = new XMLFormat(JSUser.class)
+    {
+
+        public void write(Object o, OutputElement xml)
+                throws XMLStreamException
+        {
+            try
+            {
+                JSUser g = (JSUser) o;
+                String s = g.getName();
+                if ((s == null) || (s.length() == 0)) s = "guest";
+                xml.setAttribute("name", s);
+                xml.setAttribute("password", g.getPasswordString());
+ 
+
+                /** named fields HERE */
+ 
+                /** implicitly named (through binding) fields here */
+                g.groupString = new JSUserGroups(g.putTokens(g.getGroups()));
+                g.roleString = new JSUserRoles(g.putTokens(g.getRoles()));
+
+                xml.add(g.roleString);
+                xml.add(g.groupString);
+                xml.add(g.preferences);
+                xml.add(g.userInfo);
+                xml.add(g.rules);
+
+            } catch (Exception e)
+            {
+                e.printStackTrace();
+            }
+        }
+
+        public void read(InputElement xml, Object o)
+        {
+            try
+            {
+                JSUser g = (JSUser) o;
+                g.name = xml.getAttribute("name", "unknown");
+                g.password = xml.getAttribute("password","").toCharArray();
+                
+                Object o1 = null;
+ 
+
+                while (xml.hasNext())
+                {
+                     o1 = xml.getNext(); // mime
+
+                    if (o1 instanceof JSUserRoles)
+                        g.roleString = (JSUserRoles) o1;
+                    else
+                    if (o1 instanceof JSUserGroups)
+                        g.groupString = (JSUserGroups) o1;
+                    else
+                        if (o1 instanceof JSNameValuePairs)
+                        g.preferences  = (JSNameValuePairs) o1;
+                        else
+                            if (o1 instanceof JSUserAttributes)
+                            g.userInfo  = (JSUserAttributes) o1;
+                            else
+                                if (o1 instanceof JSPrincipalRules)
+                                g.rules  = (JSPrincipalRules) o1;
+                }
+                
+                g.roles = g.getTokens((String) xml.get("roles"));
+                g.groups = g.getTokens((String) xml.get("groups"));
+
+            } catch (Exception e)
+            {
+                e.printStackTrace();
+            }
+        }
+
+    };
+
+    // todo - needs work....outcome should be the right collection for lookup
+    // etc....
+    private ArrayList getTokens(String _line)
+    {
+        if ((_line == null) || (_line.length() == 0)) return null;
+
+        StringTokenizer st = new StringTokenizer(_line, ",");
+        ArrayList list = new ArrayList();
+
+        while (st.hasMoreTokens())
+            list.add(st.nextToken());
+        return list;
+    }
+
+    private String append(JSRole rule)
+    {
+        return rule.getName();
+    }
+
+    private String append(JSGroup group)
+    {
+        return group.getName();
+    }
+
+    private String append(Object s)
     {
-        this.userInfo = userInfo;
+        if (s instanceof JSRole) return append((JSRole) s);
+        if (s instanceof JSGroup) return append((JSGroup) s);
+
+        return s.toString();
     }
 
+    private String putTokens(ArrayList _list)
+    {
+        if ((_list == null) || (_list.size() == 0)) return "";
+        boolean _start = true;
+        Iterator _it = _list.iterator();
+        StringBuffer _sb = new StringBuffer();
+        while (_it.hasNext())
+        {
+            if (!_start)
+                _sb.append(',');
+            else
+                _start = false;
+
+            _sb.append(append(_it.next()));
+        }
+        return _sb.toString();
+    }
 
-    
-    public List getProfileRules()
+    private String getPasswordString()
     {
-        return profileRules;
+        if ((this.getPassword() == null) || (this.getPassword().length == 0))
+            return "";
+        else
+            return new String(this.getPassword());
     }
 
+    /**
+     * @return Returns the rules.
+     */
+    public JSPrincipalRules getRules()
+    {
+        return rules;
+    }
 
-    
-    public void setProfileRules(List profileRules)
+    /**
+     * @param rules
+     *            The rules to set.
+     */
+    public void setRules(JSPrincipalRules rules)
     {
-        this.profileRules = profileRules;
+        this.rules = rules;
     }
 
+    /**
+     * @return Returns the principal.
+     */
+    public Principal getPrincipal()
+    {
+        return principal;
+    }
+
+    /**
+     * @param principal
+     *            The principal to set.
+     */
+    public void setPrincipal(Principal principal)
+    {
+        this.principal = principal;
+    }
 
-    
-    
-    
 }

Added: portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUserAttributes.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUserAttributes.java?view=auto&rev=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUserAttributes.java (added)
+++ portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUserAttributes.java Thu Nov  2 14:07:22 2006
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jetspeed.serializer.objects;
+
+/**
+ * Serialized Name Value Pairs
+ * <info>
+ *   <name>user.first.name</name>
+ *   <value>Paul</value>
+ * </info>
+ * 
+ * @author <a href="mailto:hajo@bluesunrsie.com">Hajo Birthelmer</a>
+ * @version $Id: $
+ */
+import java.util.HashMap;
+import java.util.Map;
+import java.util.prefs.*;
+
+public class JSUserAttributes extends JSNameValuePairs
+{
+
+
+	/**
+	 * @param preferences
+	 */
+	public JSUserAttributes(Preferences preferences)
+	{
+		super(preferences);
+	}
+    public JSUserAttributes()
+    {
+        super();
+    }
+}

Added: portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUserGroups.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUserGroups.java?view=auto&rev=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUserGroups.java (added)
+++ portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUserGroups.java Thu Nov  2 14:07:22 2006
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.jetspeed.serializer.objects;
+
+
+
+/**
+* Jetspeed Serializer - Simple User Groups Wrapper
+* <p>
+* Wrapper to process XML representation of a set of user groups - used only for binding
+* 
+* @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
+* @version $Id: $
+*/public class JSUserGroups extends JSUserRoles
+{
+
+    public JSUserGroups()
+    {
+        super();
+    }
+	/**
+	 * 
+	 */
+	public JSUserGroups(String s)
+	{
+		super(s);
+	}
+
+}

Added: portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUserRoles.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUserRoles.java?view=auto&rev=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUserRoles.java (added)
+++ portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUserRoles.java Thu Nov  2 14:07:22 2006
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.jetspeed.serializer.objects;
+
+import javolution.xml.XMLFormat;
+import javolution.xml.stream.XMLStreamException;
+
+
+/**
+* Jetspeed Serializer - Simple User Roles Wrapper
+* <p>
+* Wrapper to process XML representation of a set of user roles - used only for binding
+* 
+* @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
+* @version $Id: $
+*/
+public class JSUserRoles
+{
+	String roles;
+    public JSUserRoles()
+    {
+    }
+    public JSUserRoles(String s)
+	{
+		roles = s;
+	}
+	private static final XMLFormat XML = new XMLFormat(JSUserRoles.class)
+	{
+		public void write(Object oo, OutputElement xml)
+		throws XMLStreamException
+		{
+	        xml.addText(((JSUserRoles)oo).roles); 
+	    }
+		public void read(InputElement xml, Object oo)
+		throws XMLStreamException
+		{
+	        ((JSUserRoles)oo).roles = xml.getText().toString();
+	    }
+	};
+}

Added: portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUserUsers.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUserUsers.java?view=auto&rev=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUserUsers.java (added)
+++ portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUserUsers.java Thu Nov  2 14:07:22 2006
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.jetspeed.serializer.objects;
+
+
+
+/**
+* Jetspeed Serializer - Simple User Wrapper to allow cross reference of users in a list
+* <p>
+* Wrapper to process XML representation of a set of users - used only for binding
+* 
+* @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
+* @version $Id: $
+*/
+public class JSUserUsers extends JSUserRoles
+{
+
+	/**
+	 * 
+	 */
+	public JSUserUsers(String s)
+	{
+		super(s);
+	}
+
+}

Added: portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUsers.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUsers.java?view=auto&rev=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUsers.java (added)
+++ portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUsers.java Thu Nov  2 14:07:22 2006
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.jetspeed.serializer.objects;
+
+import java.util.ArrayList;
+
+
+/**
+ * Simple wrapper class for XML serialization
+ * @author hajo
+ *
+ */
+public class JSUsers extends ArrayList
+{
+}

Modified: portals/jetspeed-2/trunk/components/serializer/test/assembly/boot/datasource.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/test/assembly/boot/datasource.xml?view=diff&rev=470544&r1=470543&r2=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/test/assembly/boot/datasource.xml (original)
+++ portals/jetspeed-2/trunk/components/serializer/test/assembly/boot/datasource.xml Thu Nov  2 14:07:22 2006
@@ -71,14 +71,20 @@
        ConnectionManagerClass=org.apache.jetspeed.components.rdbms.ojb.ConnectionManagerImpl
        This property is located in /etc/db-ojb/OJB.properties in the source tree.
     -->    
-    
+    <!--
+                   <property name="driverClassName"><value>com.ibm.db2.jcc.DB2Driver</value></property>
+                <property name="url"><value>jdbc:db2://75.32.148.172:50000/j2</value></property>
+                <property name="username"><value>db2admin</value></property>
+                <property name="password"><value>db2</value></property>
+  
+    -->
     <bean id="JetspeedDS" class="org.apache.commons.dbcp.BasicDataSource" 
         destroy-method="close"
         >
                 <property name="driverClassName"><value>com.mysql.jdbc.Driver</value></property>
                 <property name="url"><value>jdbc:mysql://localhost/j2</value></property>
-                <property name="username"><value>j2</value></property>
-                <property name="password"><value>digital</value></property>
+                <property name="username"><value>root</value></property>
+                <property name="password"><value>ojah@0910</value></property>
         </bean>    
 
 </beans>

Added: portals/jetspeed-2/trunk/components/serializer/test/assembly/profiler.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/test/assembly/profiler.xml?view=auto&rev=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/test/assembly/profiler.xml (added)
+++ portals/jetspeed-2/trunk/components/serializer/test/assembly/profiler.xml Thu Nov  2 14:07:22 2006
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+<!--
+	Copyright 2004 The Apache Software Foundation
+	
+	Licensed under the Apache License, Version 2.0 (the "License");
+	you may not use this file except in compliance with the License.
+	You may obtain a copy of the License at
+	
+	http://www.apache.org/licenses/LICENSE-2.0
+	
+	Unless required by applicable law or agreed to in writing, software
+	distributed under the License is distributed on an "AS IS" BASIS,
+	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	See the License for the specific language governing permissions and
+	limitations under the License.
+-->
+<beans>
+	<!-- Profiler -->
+	<bean id="profilerImpl" class="org.apache.jetspeed.profiler.impl.JetspeedProfilerImpl" name="profilerImpl" init-method="init">
+		<constructor-arg index="0">
+			<value>JETSPEED-INF/ojb/profiler_repository.xml</value>
+		</constructor-arg>
+		<constructor-arg index="1">
+			<value>j2</value>
+		</constructor-arg>
+		<constructor-arg index="2">
+			<ref bean="ProfileResolvers" />
+		</constructor-arg>
+		<!--  pass reference to profiling rule implementations -->
+		<constructor-arg index="3">
+			<map>
+				<entry key="locator">
+					<value>ProfileLocator</value>
+				</entry>
+				<entry key="principal">
+					<value>PrincipalRule</value>
+				</entry>
+	
+				<entry key="standard">
+					<value>StandardProfilingRule</value>
+				</entry>
+				<entry key="fallback">
+					<value>RoleFallbackProfilingRule</value>
+				</entry>
+			</map>
+		</constructor-arg>
+		<!--  pass reference to rule criterion -->
+		<constructor-arg index="4">
+			<value>RuleCriterion</value>
+		</constructor-arg>
+
+	</bean>
+
+	<bean id="org.apache.jetspeed.profiler.Profiler" name="profiler" parent="baseTransactionProxy">
+		<property name="proxyInterfaces">
+			<value>org.apache.jetspeed.profiler.Profiler</value>
+		</property>
+		<property name="target">
+			<ref bean="profilerImpl" />
+		</property>
+		<property name="transactionAttributes">
+			<props>
+				<prop key="setRuleForPrincipal">PROPAGATION_REQUIRED,-org.apache.jetspeed.components.profiler.ProfilerException</prop>
+				<prop key="store*">PROPAGATION_REQUIRED,-org.apache.jetspeed.components.profiler.ProfilerException</prop>
+				<prop key="delete*">PROPAGATION_REQUIRED,-org.apache.jetspeed.components.profiler.ProfilerException</prop>
+				<prop key="*">PROPAGATION_SUPPORTS</prop>
+			</props>
+		</property>
+	</bean>
+
+	<bean id="ProfileResolvers" class="org.apache.jetspeed.profiler.rules.impl.ProfileResolversImpl">
+		<constructor-arg index="0">
+			<map>
+				<entry key="request">
+					<ref bean="StandardResolver" />
+				</entry>
+				<entry key="session">
+					<ref bean="SessionResolver" />
+				</entry>
+				<entry key="request.session">
+					<ref bean="RequestSessionResolver" />
+				</entry>
+				<entry key="path">
+					<ref bean="PathResolver" />
+				</entry>
+				<entry key="path.session">
+					<ref bean="PathSessionResolver" />
+				</entry>
+				<entry key="hard.coded">
+					<ref bean="HardCodedResolver" />
+				</entry>
+				<entry key="user">
+					<ref bean="UserCriterionResolver" />
+				</entry>
+				<entry key="role">
+					<ref bean="RoleCriterionResolver" />
+				</entry>
+				<entry key="rolecombo">
+					<ref bean="RoleComboCriterionResolver" />
+				</entry>
+				<entry key="group">
+					<ref bean="GroupCriterionResolver" />
+				</entry>
+				<entry key="mediatype">
+					<ref bean="MediatypeCriterionResolver" />
+				</entry>
+				<entry key="language">
+					<ref bean="LanguageCriterionResolver" />
+				</entry>
+				<entry key="country">
+					<ref bean="CountryCriterionResolver" />
+				</entry>
+				<entry key="group.role.user">
+					<ref bean="GroupRoleUserCriterionResolver" />
+				</entry>
+				<entry key="user.attribute">
+					<ref bean="UserAttributeResolver" />
+				</entry>
+				<entry key="navigation">
+					<ref bean="NavigationCriterionResolver" />
+				</entry>
+				<entry key="user.agent">
+					<ref bean="UserAgentCriterionResolver" />
+				</entry>
+				<entry key="ip">
+					<ref bean="IPCriterionResolver" />
+				</entry>
+			</map>
+		</constructor-arg>
+	</bean>
+
+	<bean id='StandardResolver' class='org.apache.jetspeed.profiler.rules.impl.StandardResolver'></bean>
+	<bean id='SessionResolver' class='org.apache.jetspeed.profiler.rules.impl.SessionResolver'></bean>
+	<bean id='RequestSessionResolver' class='org.apache.jetspeed.profiler.rules.impl.RequestSessionResolver'></bean>
+	<bean id='PathResolver' class='org.apache.jetspeed.profiler.rules.impl.PathResolver'></bean>
+	<bean id='PathSessionResolver' class='org.apache.jetspeed.profiler.rules.impl.PathSessionResolver'></bean>
+	<bean id='HardCodedResolver' class='org.apache.jetspeed.profiler.rules.impl.HardCodedResolver'></bean>
+	<bean id='UserCriterionResolver' class='org.apache.jetspeed.profiler.rules.impl.UserCriterionResolver'></bean>
+	<bean id='RoleCriterionResolver' class='org.apache.jetspeed.profiler.rules.impl.RoleCriterionResolver'></bean>
+	<bean id='RoleComboCriterionResolver' class='org.apache.jetspeed.profiler.rules.impl.RoleComboCriterionResolver'></bean>
+	<bean id='GroupCriterionResolver' class='org.apache.jetspeed.profiler.rules.impl.GroupCriterionResolver'></bean>
+	<bean id='MediatypeCriterionResolver' class='org.apache.jetspeed.profiler.rules.impl.MediatypeCriterionResolver'></bean>
+	<bean id='LanguageCriterionResolver' class='org.apache.jetspeed.profiler.rules.impl.LanguageCriterionResolver'></bean>
+	<bean id='CountryCriterionResolver' class='org.apache.jetspeed.profiler.rules.impl.CountryCriterionResolver'></bean>
+	<bean id='GroupRoleUserCriterionResolver' class='org.apache.jetspeed.profiler.rules.impl.GroupRoleUserCriterionResolver'></bean>
+	<bean id='UserAttributeResolver' class='org.apache.jetspeed.profiler.rules.impl.UserAttributeResolver'></bean>
+	<bean id='NavigationCriterionResolver' class='org.apache.jetspeed.profiler.rules.impl.NavigationCriterionResolver'></bean>
+	<bean id='UserAgentCriterionResolver' class='org.apache.jetspeed.profiler.rules.impl.UserAgentCriterionResolver'></bean>
+	<bean id='IPCriterionResolver' class='org.apache.jetspeed.profiler.rules.impl.IPCriterionResolver'></bean>
+
+	<!-- Profiling Rules -->
+
+	<!-- Standard Profiler -->
+	<bean id="StandardProfilingRule" class="org.apache.jetspeed.profiler.rules.impl.StandardProfilingRule" singleton="false"></bean>
+
+	<!-- Fallback Profiler -->
+	<bean id="RoleFallbackProfilingRule" class="org.apache.jetspeed.profiler.rules.impl.RoleFallbackProfilingRule" singleton="false"></bean>
+
+	<!-- Locator -->
+	<bean id="ProfileLocator" class="org.apache.jetspeed.profiler.impl.JetspeedProfileLocator" singleton="false"></bean>
+
+	<!-- Principal Rule -->
+	<bean id="PrincipalRule" class="org.apache.jetspeed.profiler.rules.impl.PrincipalRuleImpl" singleton="false"></bean>
+
+
+	<!-- Rule Criterion -->
+	<bean id="RuleCriterion" class="org.apache.jetspeed.profiler.rules.impl.RuleCriterionImpl" singleton="false"></bean>
+
+</beans>

Added: portals/jetspeed-2/trunk/components/serializer/test/assembly/security-atn.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/test/assembly/security-atn.xml?view=auto&rev=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/test/assembly/security-atn.xml (added)
+++ portals/jetspeed-2/trunk/components/serializer/test/assembly/security-atn.xml Thu Nov  2 14:07:22 2006
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+<!--
+Copyright 2004 The Apache Software Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<beans>
+  
+  <!-- ************** Login Module ************** -->
+  <!-- Security: Login Module Proxy -->
+  <bean id="org.apache.jetspeed.security.LoginModuleProxy" 
+  	   class="org.apache.jetspeed.security.impl.LoginModuleProxyImpl"
+  >
+       <!-- User Manager to construct JAAS subject/principals returned to container -->
+  	   <constructor-arg index="0"><ref bean="org.apache.jetspeed.security.UserManager"/></constructor-arg>  	   
+       <!-- Portal user role name used to identify authenticated users in web.xml security constraints -->
+  	   <constructor-arg index="1"><value>portal-user</value></constructor-arg>  	   
+  </bean>
+
+</beans>

Added: portals/jetspeed-2/trunk/components/serializer/test/assembly/security-atz.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/test/assembly/security-atz.xml?view=auto&rev=470544
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/test/assembly/security-atz.xml (added)
+++ portals/jetspeed-2/trunk/components/serializer/test/assembly/security-atz.xml Thu Nov  2 14:07:22 2006
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+<!--
+Copyright 2004 The Apache Software Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<beans>
+
+  <!-- Security: RDBMS Policy implementation for JAAS -->
+  <bean id="org.apache.jetspeed.security.impl.RdbmsPolicy" 
+  	   class="org.apache.jetspeed.security.impl.RdbmsPolicy"
+  >  	   
+  	   <constructor-arg ><ref bean="org.apache.jetspeed.security.PermissionManager"/></constructor-arg>  	   
+  </bean>
+
+</beans>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message