portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r725977 [26/48] - in /portals/jetspeed-2/portal/trunk: ./ app-servers/security/jboss/src/java/META-INF/jboss-secsvc/ app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/ applications/jetspeed/src/main/javascrip...
Date Fri, 12 Dec 2008 12:07:04 GMT
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/JetspeedDDLUtil.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/JetspeedDDLUtil.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/JetspeedDDLUtil.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/JetspeedDDLUtil.java Fri Dec 12 04:06:29 2008
@@ -1,598 +1,598 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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;
-
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.sql.DataSource;
-
-import org.apache.commons.beanutils.BeanUtils;
-import org.apache.commons.beanutils.DynaBean;
-import org.apache.commons.beanutils.DynaProperty;
-import org.apache.commons.dbcp.BasicDataSource;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.ddlutils.DatabaseOperationException;
-import org.apache.ddlutils.Platform;
-import org.apache.ddlutils.PlatformFactory;
-import org.apache.ddlutils.PlatformUtils;
-import org.apache.ddlutils.io.DataReader;
-import org.apache.ddlutils.io.DataToDatabaseSink;
-import org.apache.ddlutils.io.DatabaseIO;
-import org.apache.ddlutils.model.Column;
-import org.apache.ddlutils.model.Database;
-import org.apache.ddlutils.model.JdbcTypeCategoryEnum;
-import org.apache.ddlutils.model.Table;
-
-/**
- * Jetspeed DDLUtil
- * <p>
- * The Jetspeed DDL Utility is capabale of extracting existing schema
- * information as well as recreating databases.
- * 
- * @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
- * @version $Id: $
- */
-public class JetspeedDDLUtil
-{
-	public static final String DATASOURCE_DATABASENAME = "DATABASENAME".intern();
-	public static final String DATASOURCE_CLASS = "DATASOURCE_CLASS".intern();
-	public static final String DATASOURCE_DRIVER = "driverClassName".intern();
-	public static final String DATASOURCE_URL = "url".intern();
-	public static final String DATASOURCE_USERNAME = "username".intern();
-	public static final String DATASOURCE_PASSWORD = "password".intern();
-
-	
-    /** Logger */
-    private static final Log log = LogFactory.getLog(JetspeedDDLUtil.class);
-
-	JdbcTypeCategoryEnum temEnum = null;
-	
-	Map parameters;
-
-	PlatformUtils utils;
-
-	StringWriter writer;
-
-	private Platform platform;
-
-	/** The data source to test against. */
-	private DataSource dataSource;
-	/** The database name. */
-	private String _databaseName;
-	/** The database model. */
-	private Database model;
-
-	private boolean connected = false;
-
-	public JetspeedDDLUtil()
-	{
-
-	}
-
-	public void startUp()
-	{
-
-	}
-
-	public void tearDown()
-	{
-		if (connected)
-		{
-			platform = null;
-			// todo: closeup
-		}
-	}
-
-	/**
-	 * Tries to determine whether a the jdbc driver and connection url re
-	 * supported.
-	 * 
-	 * @param driverName
-	 *            The fully qualified name of the JDBC driver
-	 * @param jdbcConnectionUrl
-	 *            The connection url
-	 * @return True if this driver/url is supported
-	 */
-	public boolean isDatabaseSupported(String driverName,
-			String jdbcConnectionUrl)
-	{
-		if (utils.determineDatabaseType(driverName, jdbcConnectionUrl) != null)
-			return true;
-		else
-			return false;
-
-	}
-
-	
-
-	/**
-	 * Parses the database defined in the given XML file and creates a database
-	 * schema (model) object
-	 * 
-	 * @param fileName 
-	 */
-	public void writeDatabaseSchematoFile(String fileName)
-	{
-		new DatabaseIO().write(model, fileName);
-	}
-
-	
-	/**
-	 * Parses the database defined in the given XML file and creates a database
-	 * schema (model) object
-	 * 
-	 * @param dbDef
-	 *            The database XML definition
-	 * @return The database model
-	 */
-	protected Database createDatabaseSchemaFromXML(String fileName)
-	{
-		DatabaseIO io = new DatabaseIO();
-		io.setValidateXml(false);
-		return io.read(fileName);
-	}
-
-	/**
-	 * Parses the database defined in the given XML definition String and
-	 * creates a database schema (model) object
-	 * 
-	 * @param dbDef
-	 *            The database XML definition
-	 * @return The database model
-	 */
-	protected Database createDatabaseSchemaFromString(String dbDef)
-	{
-		DatabaseIO dbIO = new DatabaseIO();
-
-		dbIO.setUseInternalDtd(true);
-		dbIO.setValidateXml(false);
-		return dbIO.read(new StringReader(dbDef));
-	}
-
-	/**
-	 * <p>
-	 * Create a database connection (platform instance) from a data source
-	 * </p>
-	 * 
-	 * @param dataSource
-	 */
-	protected Platform connectToDatabase(DataSource dataSource)
-	{
-		return PlatformFactory.createNewPlatformInstance(dataSource);
-	}
-
-	/**
-	 * <p>
-	 * Create a database connection (platform instance) from a (case
-	 * insensitive) database type (like MySQL)
-	 * </p>
-	 * 
-	 * @param dataSource
-	 */
-	protected Platform connectToDatabase(String databaseType)
-	{
-		return PlatformFactory.createNewPlatformInstance(databaseType);
-	}
-	/**
-	 * <p>
-	 * Update a given database schema to match the schema of targetModel If
-	 * alterDB is true, the routine attempts to modify the existing database
-	 * shcema while preserving the data (as much as possible). If not, the
-	 * existing tables are dropped prior to recreate
-	 * 
-	 * @param targetModel
-	 *            The new database model
-	 * @param alterDb
-	 *            if true, try to use alter database and preserve data
-	 */
-	protected void updateDatabaseSchema(Database targetModel, boolean alterDb)
-			throws SerializerException
-	{
-		try
-		{
-			platform.setSqlCommentsOn(false);
-			try
-			{
-				targetModel.resetDynaClassCache();
-			} catch (Exception internalEx)
-			{
-				internalEx.printStackTrace();
-			}
-			if (alterDb)
-			{
-				model.mergeWith(targetModel);
-				try
-				{
-					platform.alterTables(model, true);
-				}
-				catch (Exception aEX)
-				{
-					System.out.println("Error in ALTER DATABASE");
-					aEX.printStackTrace();
-					log.error(aEX);
-				}
-			} else
-			{
-				try
-				{
-				
-//					if (log.isDebugEnabled())
-//					{
-//						String s = platform.getDropTablesSql(model, true);
-//						log.debug(s);
-//					}
-                    if (model == null)
-                    {
-                        model = targetModel;
-                    }
-                    platform.dropTables(model, true);				
-				}
-				catch (Exception aEX)
-				{
-					log.error(aEX);
-				}
-				try
-				{
-				    platform.createTables(model, false, true);
-                    if (this._databaseName.startsWith("oracle"))
-                    {
-                        model = this.readModelFromDatabase(null);
-                        modifyVarBinaryColumn(model, "PA_METADATA_FIELDS", "COLUMN_VALUE");
-                        modifyVarBinaryColumn(model, "PD_METADATA_FIELDS", "COLUMN_VALUE");
-                        modifyVarBinaryColumn(model, "LANGUAGE", "KEYWORDS");
-                        modifyVarBinaryColumn(model, "PORTLET_CONTENT_TYPE", "MODES");
-                        modifyVarBinaryColumn(model, "PARAMETER", "PARAMETER_VALUE");
-                        modifyVarBinaryColumn(model, "LOCALIZED_DESCRIPTION", "DESCRIPTION");
-                        modifyVarBinaryColumn(model, "LOCALIZED_DISPLAY_NAME", "DISPLAY_NAME");
-                        modifyVarBinaryColumn(model, "CUSTOM_PORTLET_MODE", "DESCRIPTION");
-                        modifyVarBinaryColumn(model, "CUSTOM_WINDOW_STATE", "DESCRIPTION");
-                        modifyVarBinaryColumn(model, "MEDIA_TYPE", "DESCRIPTION");
-                        platform.alterTables(model, true);                        
-                    }
-				}
-				catch (Exception aEX)
-				{
-                    aEX.printStackTrace();
-					log.error(aEX);
-				}
-			}
-			// TODO: DST: REMOVE, AINT WORKING IN ORACLE model = this.readModelFromDatabase(null);
-		} catch (Exception ex)
-		{
-			ex.printStackTrace();
-			throw new SerializerException(
-			// TODO: HJB create exception
-					SerializerException.CREATE_OBJECT_FAILED.create(ex.getLocalizedMessage()));
-		}
-	}
-
-    private void modifyVarBinaryColumn(Database targetModel, String tableName, String columnName)
-    {
-        Table table = targetModel.findTable(tableName);
-        Column c = table.findColumn(columnName);
-        c.setType("VARCHAR");        
-        c.setSize("2000");
-        System.out.println("updating column " + c.getName() + " for table " + table.getName());
-    }
-	/**
-	 * Alter an existing database from the given model. Data is preserved as
-	 * much as possible
-	 * 
-	 * @param model
-	 *            The new database model
-	 */
-	public void alterDatabase(Database model) throws SerializerException
-	{
-		updateDatabaseSchema(model, true);
-	}
-
-	/**
-	 * Creates a new database from the given model. Note that all data is LOST
-	 * 
-	 * @param model
-	 *            The new database model
-	 */
-	public void createDatabase(Database model) throws SerializerException
-	{
-		updateDatabaseSchema(model, false);
-	}
-
-	/**
-	 * <p>
-	 * Inserts data into the database. Data is expected to be in the format
-	 * </p>
-	 * <p>
-	 * <?xml version='1.0' encoding='ISO-8859-1'?> <data> <TABLENAME
-	 * FIELD1='TEXTVALUE' FIELD2=INTVALUE .... /> <TABLENAME FIELD1='TEXTVALUE'
-	 * FIELD2=INTVALUE .... /> </data>
-	 * </p>
-	 * 
-	 * @param model
-	 *            The database model
-	 * @param dataXml
-	 *            The data xml
-	 * @return The database
-	 */
-	protected Database insertData(Database model, String dataXml)
-			throws DatabaseOperationException
-	{
-		try
-		{
-			DataReader dataReader = new DataReader();
-
-			dataReader.setModel(model);
-			dataReader.setSink(new DataToDatabaseSink(platform, model));
-			dataReader.parse(new StringReader(dataXml));
-			return model;
-		} catch (Exception ex)
-		{
-			throw new DatabaseOperationException(ex);
-		}
-	}
-
-	/**
-	 * Drops the tables defined in the database model on this connection.
-	 * 
-	 * @param model
-	 *            The database model
-	 * 
-	 */
-	protected void dropDatabaseTables(Database model)
-			throws DatabaseOperationException
-	{
-		platform.dropTables(model, true);
-	}
-
-	/**
-	 * Reads the database model from a live database.
-	 * 
-	 * @param platform
-	 *            The physical database connection
-	 * @param databaseName
-	 *            The name of the resulting database
-	 * @return The model
-	 */
-	public Database readModelFromDatabase(String databaseName)
-	{
-		return platform.readModelFromDatabase(databaseName);
-	}
-
-	/**
-	 * datasource.class=org.apache.commons.dbcp.BasicDataSource
-	 * datasource.driverClassName=com.mysql.jdbc.Driver
-	 * datasource.url=jdbc:mysql://localhost/ddlutils datasource.username=root
-	 * datasource.password=root123
-	 * 
-	 */
-
-	/**
-	 * Initializes the datasource and the connection (platform)
-	 */
-	public void init(Map parameters)
-	{
-		if (connected)
-			tearDown();
-
-		try
-		{
-			String dataSourceClass = (String) parameters.get(DATASOURCE_CLASS);
-			if (dataSourceClass == null)
-				dataSourceClass = BasicDataSource.class.getName();
-
-			dataSource = (DataSource) Class.forName(dataSourceClass)
-					.newInstance();
-
-			for (Iterator it = parameters.entrySet().iterator(); it.hasNext();)
-			{
-				Map.Entry entry = (Map.Entry) it.next();
-				String propName = (String) entry.getKey();
-
-				if (!(propName.equals(DATASOURCE_CLASS)))
-				{
-					BeanUtils.setProperty(dataSource, propName, entry
-							.getValue());
-				}
-			}
-		} catch (Exception ex)
-		{
-			throw new DatabaseOperationException(ex);
-		}
-		String databaseName = null;
-		_databaseName = null;        
-		try
-		{
-			databaseName = (String) parameters.get(DATASOURCE_DATABASENAME);
-			if (databaseName != null)
-			{
-				platform = PlatformFactory.createNewPlatformInstance(databaseName);
-				if (platform != null)
-					_databaseName = databaseName;
-			}
-		} catch (Exception ex)
-		{
-			log.warn("Exception in trying to establish connection to " + databaseName + " : " + ex.getLocalizedMessage());
-			log.warn(ex);
-		}
-		if (_databaseName == null)
-		{
-			_databaseName = new PlatformUtils().determineDatabaseType(dataSource);
-			if (_databaseName == null)
-			{
-				throw new DatabaseOperationException(
-					"Could not determine platform from datasource, please specify it in the jdbc.properties via the ddlutils.platform property");
-			}
-			else
-			{
-				try
-				{
-					platform = PlatformFactory.createNewPlatformInstance(_databaseName);
-				} catch (Exception ex)
-				{
-					throw new DatabaseOperationException(
-					"Could not establish connection to " + _databaseName + " : " + ex.getLocalizedMessage(),ex);
-				}
-			}
-		}
-//		com.mysql.jdbc.Driver
-		
-		writer = new StringWriter();
-		platform.getSqlBuilder().setWriter(writer);
-//		if (platform.getPlatformInfo().isDelimitedIdentifiersSupported())
-//		{
-//			platform.setDelimitedIdentifierModeOn(true);
-//		}
-
-	
-		platform.setDataSource(dataSource);
-        System.out.println("reading model...");
-		model = this.readModelFromDatabase(null);
-        System.out.println("done reading model...");
-/**		
-		JdbcModelReader reader = platform.getModelReader();		
-		try
-		{
-		model = reader.getDatabase(platform.borrowConnection(), null);
-		} catch (Exception ex)
-		{
-			throw new DatabaseOperationException(ex);
-		}
-*/
-		
-		connected = true;
-	}
-
-	/**
-	 * Returns the database model.
-	 * 
-	 * @return The model
-	 */
-	protected Database getModel()
-	{
-		return model;
-	}
-
-	/**
-	 * Inserts data into the database.
-	 * 
-	 * @param dataXml
-	 *            The data xml
-	 * @return The database
-	 */
-	protected Database insertData(String dataXml)
-			throws DatabaseOperationException
-	{
-		try
-		{
-			DataReader dataReader = new DataReader();
-
-			dataReader.setModel(model);
-			dataReader.setSink(new DataToDatabaseSink(platform, model));
-			dataReader.parse(new StringReader(dataXml));
-			return model;
-		} catch (Exception ex)
-		{
-			throw new DatabaseOperationException(ex);
-		}
-	}
-
-	/**
-	 * Drops the tables defined in the database model.
-	 */
-	protected void dropDatabase() throws DatabaseOperationException
-	{
-		platform.dropTables(model, true);
-	}
-
-	/**
-	 * Determines the value of the bean's property that has the given name.
-	 * Depending on the case-setting of the current builder, the case of teh
-	 * name is considered or not.
-	 * 
-	 * @param bean
-	 *            The bean
-	 * @param propName
-	 *            The name of the property
-	 * @return The value
-	 */
-	protected Object getPropertyValue(DynaBean bean, String propName)
-	{
-		if (platform.isDelimitedIdentifierModeOn())
-		{
-			return bean.get(propName);
-		} else
-		{
-			DynaProperty[] props = bean.getDynaClass().getDynaProperties();
-
-			for (int idx = 0; idx < props.length; idx++)
-			{
-				if (propName.equalsIgnoreCase(props[idx].getName()))
-				{
-					return bean.get(props[idx].getName());
-				}
-			}
-			throw new IllegalArgumentException(
-					"The bean has no property with the name " + propName);
-		}
-	}
-
-	public DataSource getDataSource()
-	{
-		return dataSource;
-	}
-
-	public Platform getPlatform()
-	{
-		return platform;
-	}
-	
-		 
-	
-    public  List getRows(String tableName)
-    {
-        Table table = getModel().findTable(tableName, getPlatform().isDelimitedIdentifierModeOn());
-        
-        return getPlatform().fetch(getModel(), getSelectQueryForAllString( table), new Table[] { table });
-    }
-
-    
-    public  String getSelectQueryForAllString( Table table)
-    {
-    
-	    StringBuffer query = new StringBuffer();
-	
-	    query.append("SELECT * FROM ");
-	    if (getPlatform().isDelimitedIdentifierModeOn())
-	    {
-	        query.append(getPlatform().getPlatformInfo().getDelimiterToken());
-	    }
-	    query.append(table.getName());
-	    if (getPlatform().isDelimitedIdentifierModeOn())
-	    {
-	        query.append(getPlatform().getPlatformInfo().getDelimiterToken());
-	    }
-	    return query.toString();
-    }
-	
-    
-  
-    
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.sql.DataSource;
+
+import org.apache.commons.beanutils.BeanUtils;
+import org.apache.commons.beanutils.DynaBean;
+import org.apache.commons.beanutils.DynaProperty;
+import org.apache.commons.dbcp.BasicDataSource;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ddlutils.DatabaseOperationException;
+import org.apache.ddlutils.Platform;
+import org.apache.ddlutils.PlatformFactory;
+import org.apache.ddlutils.PlatformUtils;
+import org.apache.ddlutils.io.DataReader;
+import org.apache.ddlutils.io.DataToDatabaseSink;
+import org.apache.ddlutils.io.DatabaseIO;
+import org.apache.ddlutils.model.Column;
+import org.apache.ddlutils.model.Database;
+import org.apache.ddlutils.model.JdbcTypeCategoryEnum;
+import org.apache.ddlutils.model.Table;
+
+/**
+ * Jetspeed DDLUtil
+ * <p>
+ * The Jetspeed DDL Utility is capabale of extracting existing schema
+ * information as well as recreating databases.
+ * 
+ * @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
+ * @version $Id: $
+ */
+public class JetspeedDDLUtil
+{
+	public static final String DATASOURCE_DATABASENAME = "DATABASENAME".intern();
+	public static final String DATASOURCE_CLASS = "DATASOURCE_CLASS".intern();
+	public static final String DATASOURCE_DRIVER = "driverClassName".intern();
+	public static final String DATASOURCE_URL = "url".intern();
+	public static final String DATASOURCE_USERNAME = "username".intern();
+	public static final String DATASOURCE_PASSWORD = "password".intern();
+
+	
+    /** Logger */
+    private static final Log log = LogFactory.getLog(JetspeedDDLUtil.class);
+
+	JdbcTypeCategoryEnum temEnum = null;
+	
+	Map parameters;
+
+	PlatformUtils utils;
+
+	StringWriter writer;
+
+	private Platform platform;
+
+	/** The data source to test against. */
+	private DataSource dataSource;
+	/** The database name. */
+	private String _databaseName;
+	/** The database model. */
+	private Database model;
+
+	private boolean connected = false;
+
+	public JetspeedDDLUtil()
+	{
+
+	}
+
+	public void startUp()
+	{
+
+	}
+
+	public void tearDown()
+	{
+		if (connected)
+		{
+			platform = null;
+			// todo: closeup
+		}
+	}
+
+	/**
+	 * Tries to determine whether a the jdbc driver and connection url re
+	 * supported.
+	 * 
+	 * @param driverName
+	 *            The fully qualified name of the JDBC driver
+	 * @param jdbcConnectionUrl
+	 *            The connection url
+	 * @return True if this driver/url is supported
+	 */
+	public boolean isDatabaseSupported(String driverName,
+			String jdbcConnectionUrl)
+	{
+		if (utils.determineDatabaseType(driverName, jdbcConnectionUrl) != null)
+			return true;
+		else
+			return false;
+
+	}
+
+	
+
+	/**
+	 * Parses the database defined in the given XML file and creates a database
+	 * schema (model) object
+	 * 
+	 * @param fileName 
+	 */
+	public void writeDatabaseSchematoFile(String fileName)
+	{
+		new DatabaseIO().write(model, fileName);
+	}
+
+	
+	/**
+	 * Parses the database defined in the given XML file and creates a database
+	 * schema (model) object
+	 * 
+	 * @param dbDef
+	 *            The database XML definition
+	 * @return The database model
+	 */
+	protected Database createDatabaseSchemaFromXML(String fileName)
+	{
+		DatabaseIO io = new DatabaseIO();
+		io.setValidateXml(false);
+		return io.read(fileName);
+	}
+
+	/**
+	 * Parses the database defined in the given XML definition String and
+	 * creates a database schema (model) object
+	 * 
+	 * @param dbDef
+	 *            The database XML definition
+	 * @return The database model
+	 */
+	protected Database createDatabaseSchemaFromString(String dbDef)
+	{
+		DatabaseIO dbIO = new DatabaseIO();
+
+		dbIO.setUseInternalDtd(true);
+		dbIO.setValidateXml(false);
+		return dbIO.read(new StringReader(dbDef));
+	}
+
+	/**
+	 * <p>
+	 * Create a database connection (platform instance) from a data source
+	 * </p>
+	 * 
+	 * @param dataSource
+	 */
+	protected Platform connectToDatabase(DataSource dataSource)
+	{
+		return PlatformFactory.createNewPlatformInstance(dataSource);
+	}
+
+	/**
+	 * <p>
+	 * Create a database connection (platform instance) from a (case
+	 * insensitive) database type (like MySQL)
+	 * </p>
+	 * 
+	 * @param dataSource
+	 */
+	protected Platform connectToDatabase(String databaseType)
+	{
+		return PlatformFactory.createNewPlatformInstance(databaseType);
+	}
+	/**
+	 * <p>
+	 * Update a given database schema to match the schema of targetModel If
+	 * alterDB is true, the routine attempts to modify the existing database
+	 * shcema while preserving the data (as much as possible). If not, the
+	 * existing tables are dropped prior to recreate
+	 * 
+	 * @param targetModel
+	 *            The new database model
+	 * @param alterDb
+	 *            if true, try to use alter database and preserve data
+	 */
+	protected void updateDatabaseSchema(Database targetModel, boolean alterDb)
+			throws SerializerException
+	{
+		try
+		{
+			platform.setSqlCommentsOn(false);
+			try
+			{
+				targetModel.resetDynaClassCache();
+			} catch (Exception internalEx)
+			{
+				internalEx.printStackTrace();
+			}
+			if (alterDb)
+			{
+				model.mergeWith(targetModel);
+				try
+				{
+					platform.alterTables(model, true);
+				}
+				catch (Exception aEX)
+				{
+					System.out.println("Error in ALTER DATABASE");
+					aEX.printStackTrace();
+					log.error(aEX);
+				}
+			} else
+			{
+				try
+				{
+				
+//					if (log.isDebugEnabled())
+//					{
+//						String s = platform.getDropTablesSql(model, true);
+//						log.debug(s);
+//					}
+                    if (model == null)
+                    {
+                        model = targetModel;
+                    }
+                    platform.dropTables(model, true);				
+				}
+				catch (Exception aEX)
+				{
+					log.error(aEX);
+				}
+				try
+				{
+				    platform.createTables(model, false, true);
+                    if (this._databaseName.startsWith("oracle"))
+                    {
+                        model = this.readModelFromDatabase(null);
+                        modifyVarBinaryColumn(model, "PA_METADATA_FIELDS", "COLUMN_VALUE");
+                        modifyVarBinaryColumn(model, "PD_METADATA_FIELDS", "COLUMN_VALUE");
+                        modifyVarBinaryColumn(model, "LANGUAGE", "KEYWORDS");
+                        modifyVarBinaryColumn(model, "PORTLET_CONTENT_TYPE", "MODES");
+                        modifyVarBinaryColumn(model, "PARAMETER", "PARAMETER_VALUE");
+                        modifyVarBinaryColumn(model, "LOCALIZED_DESCRIPTION", "DESCRIPTION");
+                        modifyVarBinaryColumn(model, "LOCALIZED_DISPLAY_NAME", "DISPLAY_NAME");
+                        modifyVarBinaryColumn(model, "CUSTOM_PORTLET_MODE", "DESCRIPTION");
+                        modifyVarBinaryColumn(model, "CUSTOM_WINDOW_STATE", "DESCRIPTION");
+                        modifyVarBinaryColumn(model, "MEDIA_TYPE", "DESCRIPTION");
+                        platform.alterTables(model, true);                        
+                    }
+				}
+				catch (Exception aEX)
+				{
+                    aEX.printStackTrace();
+					log.error(aEX);
+				}
+			}
+			// TODO: DST: REMOVE, AINT WORKING IN ORACLE model = this.readModelFromDatabase(null);
+		} catch (Exception ex)
+		{
+			ex.printStackTrace();
+			throw new SerializerException(
+			// TODO: HJB create exception
+					SerializerException.CREATE_OBJECT_FAILED.create(ex.getLocalizedMessage()));
+		}
+	}
+
+    private void modifyVarBinaryColumn(Database targetModel, String tableName, String columnName)
+    {
+        Table table = targetModel.findTable(tableName);
+        Column c = table.findColumn(columnName);
+        c.setType("VARCHAR");        
+        c.setSize("2000");
+        System.out.println("updating column " + c.getName() + " for table " + table.getName());
+    }
+	/**
+	 * Alter an existing database from the given model. Data is preserved as
+	 * much as possible
+	 * 
+	 * @param model
+	 *            The new database model
+	 */
+	public void alterDatabase(Database model) throws SerializerException
+	{
+		updateDatabaseSchema(model, true);
+	}
+
+	/**
+	 * Creates a new database from the given model. Note that all data is LOST
+	 * 
+	 * @param model
+	 *            The new database model
+	 */
+	public void createDatabase(Database model) throws SerializerException
+	{
+		updateDatabaseSchema(model, false);
+	}
+
+	/**
+	 * <p>
+	 * Inserts data into the database. Data is expected to be in the format
+	 * </p>
+	 * <p>
+	 * <?xml version='1.0' encoding='ISO-8859-1'?> <data> <TABLENAME
+	 * FIELD1='TEXTVALUE' FIELD2=INTVALUE .... /> <TABLENAME FIELD1='TEXTVALUE'
+	 * FIELD2=INTVALUE .... /> </data>
+	 * </p>
+	 * 
+	 * @param model
+	 *            The database model
+	 * @param dataXml
+	 *            The data xml
+	 * @return The database
+	 */
+	protected Database insertData(Database model, String dataXml)
+			throws DatabaseOperationException
+	{
+		try
+		{
+			DataReader dataReader = new DataReader();
+
+			dataReader.setModel(model);
+			dataReader.setSink(new DataToDatabaseSink(platform, model));
+			dataReader.parse(new StringReader(dataXml));
+			return model;
+		} catch (Exception ex)
+		{
+			throw new DatabaseOperationException(ex);
+		}
+	}
+
+	/**
+	 * Drops the tables defined in the database model on this connection.
+	 * 
+	 * @param model
+	 *            The database model
+	 * 
+	 */
+	protected void dropDatabaseTables(Database model)
+			throws DatabaseOperationException
+	{
+		platform.dropTables(model, true);
+	}
+
+	/**
+	 * Reads the database model from a live database.
+	 * 
+	 * @param platform
+	 *            The physical database connection
+	 * @param databaseName
+	 *            The name of the resulting database
+	 * @return The model
+	 */
+	public Database readModelFromDatabase(String databaseName)
+	{
+		return platform.readModelFromDatabase(databaseName);
+	}
+
+	/**
+	 * datasource.class=org.apache.commons.dbcp.BasicDataSource
+	 * datasource.driverClassName=com.mysql.jdbc.Driver
+	 * datasource.url=jdbc:mysql://localhost/ddlutils datasource.username=root
+	 * datasource.password=root123
+	 * 
+	 */
+
+	/**
+	 * Initializes the datasource and the connection (platform)
+	 */
+	public void init(Map parameters)
+	{
+		if (connected)
+			tearDown();
+
+		try
+		{
+			String dataSourceClass = (String) parameters.get(DATASOURCE_CLASS);
+			if (dataSourceClass == null)
+				dataSourceClass = BasicDataSource.class.getName();
+
+			dataSource = (DataSource) Class.forName(dataSourceClass)
+					.newInstance();
+
+			for (Iterator it = parameters.entrySet().iterator(); it.hasNext();)
+			{
+				Map.Entry entry = (Map.Entry) it.next();
+				String propName = (String) entry.getKey();
+
+				if (!(propName.equals(DATASOURCE_CLASS)))
+				{
+					BeanUtils.setProperty(dataSource, propName, entry
+							.getValue());
+				}
+			}
+		} catch (Exception ex)
+		{
+			throw new DatabaseOperationException(ex);
+		}
+		String databaseName = null;
+		_databaseName = null;        
+		try
+		{
+			databaseName = (String) parameters.get(DATASOURCE_DATABASENAME);
+			if (databaseName != null)
+			{
+				platform = PlatformFactory.createNewPlatformInstance(databaseName);
+				if (platform != null)
+					_databaseName = databaseName;
+			}
+		} catch (Exception ex)
+		{
+			log.warn("Exception in trying to establish connection to " + databaseName + " : " + ex.getLocalizedMessage());
+			log.warn(ex);
+		}
+		if (_databaseName == null)
+		{
+			_databaseName = new PlatformUtils().determineDatabaseType(dataSource);
+			if (_databaseName == null)
+			{
+				throw new DatabaseOperationException(
+					"Could not determine platform from datasource, please specify it in the jdbc.properties via the ddlutils.platform property");
+			}
+			else
+			{
+				try
+				{
+					platform = PlatformFactory.createNewPlatformInstance(_databaseName);
+				} catch (Exception ex)
+				{
+					throw new DatabaseOperationException(
+					"Could not establish connection to " + _databaseName + " : " + ex.getLocalizedMessage(),ex);
+				}
+			}
+		}
+//		com.mysql.jdbc.Driver
+		
+		writer = new StringWriter();
+		platform.getSqlBuilder().setWriter(writer);
+//		if (platform.getPlatformInfo().isDelimitedIdentifiersSupported())
+//		{
+//			platform.setDelimitedIdentifierModeOn(true);
+//		}
+
+	
+		platform.setDataSource(dataSource);
+        System.out.println("reading model...");
+		model = this.readModelFromDatabase(null);
+        System.out.println("done reading model...");
+/**		
+		JdbcModelReader reader = platform.getModelReader();		
+		try
+		{
+		model = reader.getDatabase(platform.borrowConnection(), null);
+		} catch (Exception ex)
+		{
+			throw new DatabaseOperationException(ex);
+		}
+*/
+		
+		connected = true;
+	}
+
+	/**
+	 * Returns the database model.
+	 * 
+	 * @return The model
+	 */
+	protected Database getModel()
+	{
+		return model;
+	}
+
+	/**
+	 * Inserts data into the database.
+	 * 
+	 * @param dataXml
+	 *            The data xml
+	 * @return The database
+	 */
+	protected Database insertData(String dataXml)
+			throws DatabaseOperationException
+	{
+		try
+		{
+			DataReader dataReader = new DataReader();
+
+			dataReader.setModel(model);
+			dataReader.setSink(new DataToDatabaseSink(platform, model));
+			dataReader.parse(new StringReader(dataXml));
+			return model;
+		} catch (Exception ex)
+		{
+			throw new DatabaseOperationException(ex);
+		}
+	}
+
+	/**
+	 * Drops the tables defined in the database model.
+	 */
+	protected void dropDatabase() throws DatabaseOperationException
+	{
+		platform.dropTables(model, true);
+	}
+
+	/**
+	 * Determines the value of the bean's property that has the given name.
+	 * Depending on the case-setting of the current builder, the case of teh
+	 * name is considered or not.
+	 * 
+	 * @param bean
+	 *            The bean
+	 * @param propName
+	 *            The name of the property
+	 * @return The value
+	 */
+	protected Object getPropertyValue(DynaBean bean, String propName)
+	{
+		if (platform.isDelimitedIdentifierModeOn())
+		{
+			return bean.get(propName);
+		} else
+		{
+			DynaProperty[] props = bean.getDynaClass().getDynaProperties();
+
+			for (int idx = 0; idx < props.length; idx++)
+			{
+				if (propName.equalsIgnoreCase(props[idx].getName()))
+				{
+					return bean.get(props[idx].getName());
+				}
+			}
+			throw new IllegalArgumentException(
+					"The bean has no property with the name " + propName);
+		}
+	}
+
+	public DataSource getDataSource()
+	{
+		return dataSource;
+	}
+
+	public Platform getPlatform()
+	{
+		return platform;
+	}
+	
+		 
+	
+    public  List getRows(String tableName)
+    {
+        Table table = getModel().findTable(tableName, getPlatform().isDelimitedIdentifierModeOn());
+        
+        return getPlatform().fetch(getModel(), getSelectQueryForAllString( table), new Table[] { table });
+    }
+
+    
+    public  String getSelectQueryForAllString( Table table)
+    {
+    
+	    StringBuffer query = new StringBuffer();
+	
+	    query.append("SELECT * FROM ");
+	    if (getPlatform().isDelimitedIdentifierModeOn())
+	    {
+	        query.append(getPlatform().getPlatformInfo().getDelimiterToken());
+	    }
+	    query.append(table.getName());
+	    if (getPlatform().isDelimitedIdentifierModeOn())
+	    {
+	        query.append(getPlatform().getPlatformInfo().getDelimiterToken());
+	    }
+	    return query.toString();
+    }
+	
+    
+  
+    
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/JetspeedDDLUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializerImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSApplication.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSApplications.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSCapabilities.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSCapabilities.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSCapabilities.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSCapabilities.java Fri Dec 12 04:06:29 2008
@@ -1,33 +1,33 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 Cpabailities Wrapper
- * <p>
- * Wrapper to process XML representation of a set of capabilities - used only for binding
- * 
- * @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
- * @version $Id: $
- */
-public class JSCapabilities extends ArrayList<JSCapability>
-{
-    private static final long serialVersionUID = 4342279175193989562L;
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 Cpabailities Wrapper
+ * <p>
+ * Wrapper to process XML representation of a set of capabilities - used only for binding
+ * 
+ * @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
+ * @version $Id: $
+ */
+public class JSCapabilities extends ArrayList<JSCapability>
+{
+    private static final long serialVersionUID = 4342279175193989562L;
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSCapabilities.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSCapability.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSCapability.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSCapability.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSCapability.java Fri Dec 12 04:06:29 2008
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 - Capability Wrapper
- * <p>
- * Wrapper to process XML representation of a capability
- * 
- * @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
- * @version $Id: $
- */
-public class JSCapability extends JSGroup
-{
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 - Capability Wrapper
+ * <p>
+ * Wrapper to process XML representation of a capability
+ * 
+ * @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
+ * @version $Id: $
+ */
+public class JSCapability extends JSGroup
+{
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSCapability.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSClient.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSClient.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSClient.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSClient.java Fri Dec 12 04:06:29 2008
@@ -1,376 +1,376 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 java.util.Iterator;
-import java.util.List;
-
-import javolution.xml.XMLBinding;
-import javolution.xml.XMLFormat;
-import javolution.xml.stream.XMLStreamException;
-
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.jetspeed.capabilities.Client;
-/**
- * Jetspeed Serializer - Client Wrapper
- * <p>
- * Wrapper to process XML representation of a client
- * 
- * @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
- * @version $Id: $
- */
-public class JSClient
-{
-	// private int refID;
-
-	private String name;
-
-	private int id;
-
-	private int evalOrder;
-
-	private String manufacturer;
-
-	private String model;
-
-	private String preferredMimeTypeID;
-
-	private String userAgentPattern;
-
-	private String version;
-
-	private ArrayList capabilities;
-
-	private ArrayList mimeTypes;
-
-	private JSClientCapabilities capabilitiesString;
-
-	private JSClientMimeTypes mimeTypesString;
-
-	public JSClient()
-	{
-		// refID = id;
-	}
-
-	public JSClient(Client c)
-	{
-		this.id = c.getClientId();
-		this.name = c.getName();
-
-		this.userAgentPattern = c.getUserAgentPattern();
-		this.version = c.getVersion();
-		this.model = c.getModel();
-
-		this.evalOrder = c.getEvalOrder();
-		this.manufacturer = c.getManufacturer();
-
-		capabilities = new ArrayList();
-		mimeTypes = new ArrayList();
-	}
-
-	public static final String XML_TAG = "Client".intern();
-    
-	/**
-     * All local attributes and list-type classes are bound here,
-     * referenced classes should return their own binding.
-     * @param binding
-     */
-	
-	public static void setupAliases(XMLBinding binding)
-{
-        binding.setAlias(JSClient.class, JSClient.XML_TAG);
-    }
-  
-	
-	
-	/***************************************************************************
-	 * SERIALIZER
-	 */
-	private static final XMLFormat XML = new XMLFormat(JSClient.class)
-	{
-		public void write(Object o, OutputElement xml)
-				throws XMLStreamException
-		{
-
-			try
-			{
-				JSClient g = (JSClient) o;
-				xml.setAttribute("name", g.name);
-				xml.setAttribute("evalOrder", g.evalOrder);
-				xml.setAttribute("preferredMimeTypeID", g.preferredMimeTypeID);
-				xml.add( g.userAgentPattern, "userAgentPattern",String.class);
-				xml.add(g.version,"version", String.class);
-				xml.add(g.model, "model", String.class);
-				xml.add(g.manufacturer, "manufacturer", String.class);
-
-				g.capabilitiesString = new JSClientCapabilities(g.putTokens(g.capabilities));
-				g.mimeTypesString = new JSClientMimeTypes(g.putTokens(g.mimeTypes));
-				xml.add(g.capabilitiesString);
-				xml.add(g.mimeTypesString);
-				// xml.add(g.groupString);
-
-			} catch (Exception e)
-			{
-				e.printStackTrace();
-			}
-		}
-
-		public void read(InputElement xml, Object o)
-		{
-			try
-			{
-				JSClient g = (JSClient) o;
-                g.name = StringEscapeUtils.unescapeHtml(xml.getAttribute("name",""));
-                g.evalOrder = xml.getAttribute("evalOrder",0);
-                g.preferredMimeTypeID = StringEscapeUtils.unescapeHtml(xml.getAttribute("preferredMimeTypeID","0"));
-                
-                g.userAgentPattern = StringEscapeUtils.unescapeHtml((String)xml.get("userAgentPattern",String.class));
-                g.version = StringEscapeUtils.unescapeHtml((String)xml.get("version",String.class));
-                g.model = StringEscapeUtils.unescapeHtml((String)xml.get("model",String.class));
-                g.manufacturer = StringEscapeUtils.unescapeHtml((String)xml.get("manufacturer",String.class));
-                g.capabilitiesString = (JSClientCapabilities) xml.getNext();
-                g.mimeTypesString = (JSClientMimeTypes) xml.getNext();
-			} catch (Exception e)
-			{
-				e.printStackTrace();
-			}
-		}
-	};
-
-	/**
-	 * @return Returns the capabilities.
-	 */
-	public List getCapabilities()
-	{
-		return capabilities;
-	}
-
-	/**
-	 * @param capabilities
-	 *            The capabilities to set.
-	 */
-	public void setCapabilities(ArrayList capabilities)
-	{
-		this.capabilities = capabilities;
-	}
-
-	/**
-	 * @return Returns the evalOrder.
-	 */
-	public int getEvalOrder()
-	{
-		return evalOrder;
-	}
-
-	/**
-	 * @param evalOrder
-	 *            The evalOrder to set.
-	 */
-	public void setEvalOrder(int evalOrder)
-	{
-		this.evalOrder = evalOrder;
-	}
-
-	/**
-	 * @return Returns the id.
-	 */
-	public int getId()
-	{
-		return id;
-	}
-
-	/**
-	 * @param id
-	 *            The id to set.
-	 */
-	public void setId(int id)
-	{
-		this.id = id;
-	}
-
-	/**
-	 * @return Returns the manufacturer.
-	 */
-	public String getManufacturer()
-	{
-		return manufacturer;
-	}
-
-	/**
-	 * @param manufacturer
-	 *            The manufacturer to set.
-	 */
-	public void setManufacturer(String manufacturer)
-	{
-		this.manufacturer = manufacturer;
-	}
-
-	/**
-	 * @return Returns the mimeTypes.
-	 */
-	public List getMimeTypes()
-	{
-		return mimeTypes;
-	}
-
-	/**
-	 * @param mimeTypes
-	 *            The mimeTypes to set.
-	 */
-	public void setMimeTypes(ArrayList mimeTypes)
-	{
-		this.mimeTypes = mimeTypes;
-	}
-
-	/**
-	 * @return Returns the model.
-	 */
-	public String getModel()
-	{
-		return model;
-	}
-
-	/**
-	 * @param model
-	 *            The model to set.
-	 */
-	public void setModel(String model)
-	{
-		this.model = model;
-	}
-
-	/**
-	 * @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 preferredMimeTypeID.
-	 */
-	public String getPreferredMimeTypeID()
-	{
-		return preferredMimeTypeID;
-	}
-
-	/**
-	 * @param preferredMimeTypeID
-	 *            The preferredMimeTypeID to set.
-	 */
-	public void setPreferredMimeTypeID(String preferredMimeTypeID)
-	{
-		this.preferredMimeTypeID = preferredMimeTypeID;
-	}
-
-	/**
-	 * @return Returns the userAgentPattern.
-	 */
-	public String getUserAgentPattern()
-	{
-		return userAgentPattern;
-	}
-
-	/**
-	 * @param userAgentPattern
-	 *            The userAgentPattern to set.
-	 */
-	public void setUserAgentPattern(String userAgentPattern)
-	{
-		this.userAgentPattern = userAgentPattern;
-	}
-
-	/**
-	 * @return Returns the version.
-	 */
-	public String getVersion()
-	{
-		return version;
-	}
-
-	/**
-	 * @param version
-	 *            The version to set.
-	 */
-	public void setVersion(String version)
-	{
-		this.version = version;
-	}
-
-	private String append(JSCapability capability)
-	{
-		return capability.getName();
-	}
-
-	private String append(JSMimeType mime)
-	{
-		return mime.getName();
-	}
-
-	private String append(Object s)
-	{
-		if (s instanceof JSCapability)
-			return append((JSCapability) s);
-		if (s instanceof JSMimeType)
-			return append((JSMimeType) 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 JSClientCapabilities getCapabilitiesString()
-	{
-		return capabilitiesString;
-	}
-
-	public JSClientMimeTypes getMimeTypesString()
-	{
-		return mimeTypesString;
-	}
-
-
-	
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 java.util.Iterator;
+import java.util.List;
+
+import javolution.xml.XMLBinding;
+import javolution.xml.XMLFormat;
+import javolution.xml.stream.XMLStreamException;
+
+import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.jetspeed.capabilities.Client;
+/**
+ * Jetspeed Serializer - Client Wrapper
+ * <p>
+ * Wrapper to process XML representation of a client
+ * 
+ * @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
+ * @version $Id: $
+ */
+public class JSClient
+{
+	// private int refID;
+
+	private String name;
+
+	private int id;
+
+	private int evalOrder;
+
+	private String manufacturer;
+
+	private String model;
+
+	private String preferredMimeTypeID;
+
+	private String userAgentPattern;
+
+	private String version;
+
+	private ArrayList capabilities;
+
+	private ArrayList mimeTypes;
+
+	private JSClientCapabilities capabilitiesString;
+
+	private JSClientMimeTypes mimeTypesString;
+
+	public JSClient()
+	{
+		// refID = id;
+	}
+
+	public JSClient(Client c)
+	{
+		this.id = c.getClientId();
+		this.name = c.getName();
+
+		this.userAgentPattern = c.getUserAgentPattern();
+		this.version = c.getVersion();
+		this.model = c.getModel();
+
+		this.evalOrder = c.getEvalOrder();
+		this.manufacturer = c.getManufacturer();
+
+		capabilities = new ArrayList();
+		mimeTypes = new ArrayList();
+	}
+
+	public static final String XML_TAG = "Client".intern();
+    
+	/**
+     * All local attributes and list-type classes are bound here,
+     * referenced classes should return their own binding.
+     * @param binding
+     */
+	
+	public static void setupAliases(XMLBinding binding)
+{
+        binding.setAlias(JSClient.class, JSClient.XML_TAG);
+    }
+  
+	
+	
+	/***************************************************************************
+	 * SERIALIZER
+	 */
+	private static final XMLFormat XML = new XMLFormat(JSClient.class)
+	{
+		public void write(Object o, OutputElement xml)
+				throws XMLStreamException
+		{
+
+			try
+			{
+				JSClient g = (JSClient) o;
+				xml.setAttribute("name", g.name);
+				xml.setAttribute("evalOrder", g.evalOrder);
+				xml.setAttribute("preferredMimeTypeID", g.preferredMimeTypeID);
+				xml.add( g.userAgentPattern, "userAgentPattern",String.class);
+				xml.add(g.version,"version", String.class);
+				xml.add(g.model, "model", String.class);
+				xml.add(g.manufacturer, "manufacturer", String.class);
+
+				g.capabilitiesString = new JSClientCapabilities(g.putTokens(g.capabilities));
+				g.mimeTypesString = new JSClientMimeTypes(g.putTokens(g.mimeTypes));
+				xml.add(g.capabilitiesString);
+				xml.add(g.mimeTypesString);
+				// xml.add(g.groupString);
+
+			} catch (Exception e)
+			{
+				e.printStackTrace();
+			}
+		}
+
+		public void read(InputElement xml, Object o)
+		{
+			try
+			{
+				JSClient g = (JSClient) o;
+                g.name = StringEscapeUtils.unescapeHtml(xml.getAttribute("name",""));
+                g.evalOrder = xml.getAttribute("evalOrder",0);
+                g.preferredMimeTypeID = StringEscapeUtils.unescapeHtml(xml.getAttribute("preferredMimeTypeID","0"));
+                
+                g.userAgentPattern = StringEscapeUtils.unescapeHtml((String)xml.get("userAgentPattern",String.class));
+                g.version = StringEscapeUtils.unescapeHtml((String)xml.get("version",String.class));
+                g.model = StringEscapeUtils.unescapeHtml((String)xml.get("model",String.class));
+                g.manufacturer = StringEscapeUtils.unescapeHtml((String)xml.get("manufacturer",String.class));
+                g.capabilitiesString = (JSClientCapabilities) xml.getNext();
+                g.mimeTypesString = (JSClientMimeTypes) xml.getNext();
+			} catch (Exception e)
+			{
+				e.printStackTrace();
+			}
+		}
+	};
+
+	/**
+	 * @return Returns the capabilities.
+	 */
+	public List getCapabilities()
+	{
+		return capabilities;
+	}
+
+	/**
+	 * @param capabilities
+	 *            The capabilities to set.
+	 */
+	public void setCapabilities(ArrayList capabilities)
+	{
+		this.capabilities = capabilities;
+	}
+
+	/**
+	 * @return Returns the evalOrder.
+	 */
+	public int getEvalOrder()
+	{
+		return evalOrder;
+	}
+
+	/**
+	 * @param evalOrder
+	 *            The evalOrder to set.
+	 */
+	public void setEvalOrder(int evalOrder)
+	{
+		this.evalOrder = evalOrder;
+	}
+
+	/**
+	 * @return Returns the id.
+	 */
+	public int getId()
+	{
+		return id;
+	}
+
+	/**
+	 * @param id
+	 *            The id to set.
+	 */
+	public void setId(int id)
+	{
+		this.id = id;
+	}
+
+	/**
+	 * @return Returns the manufacturer.
+	 */
+	public String getManufacturer()
+	{
+		return manufacturer;
+	}
+
+	/**
+	 * @param manufacturer
+	 *            The manufacturer to set.
+	 */
+	public void setManufacturer(String manufacturer)
+	{
+		this.manufacturer = manufacturer;
+	}
+
+	/**
+	 * @return Returns the mimeTypes.
+	 */
+	public List getMimeTypes()
+	{
+		return mimeTypes;
+	}
+
+	/**
+	 * @param mimeTypes
+	 *            The mimeTypes to set.
+	 */
+	public void setMimeTypes(ArrayList mimeTypes)
+	{
+		this.mimeTypes = mimeTypes;
+	}
+
+	/**
+	 * @return Returns the model.
+	 */
+	public String getModel()
+	{
+		return model;
+	}
+
+	/**
+	 * @param model
+	 *            The model to set.
+	 */
+	public void setModel(String model)
+	{
+		this.model = model;
+	}
+
+	/**
+	 * @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 preferredMimeTypeID.
+	 */
+	public String getPreferredMimeTypeID()
+	{
+		return preferredMimeTypeID;
+	}
+
+	/**
+	 * @param preferredMimeTypeID
+	 *            The preferredMimeTypeID to set.
+	 */
+	public void setPreferredMimeTypeID(String preferredMimeTypeID)
+	{
+		this.preferredMimeTypeID = preferredMimeTypeID;
+	}
+
+	/**
+	 * @return Returns the userAgentPattern.
+	 */
+	public String getUserAgentPattern()
+	{
+		return userAgentPattern;
+	}
+
+	/**
+	 * @param userAgentPattern
+	 *            The userAgentPattern to set.
+	 */
+	public void setUserAgentPattern(String userAgentPattern)
+	{
+		this.userAgentPattern = userAgentPattern;
+	}
+
+	/**
+	 * @return Returns the version.
+	 */
+	public String getVersion()
+	{
+		return version;
+	}
+
+	/**
+	 * @param version
+	 *            The version to set.
+	 */
+	public void setVersion(String version)
+	{
+		this.version = version;
+	}
+
+	private String append(JSCapability capability)
+	{
+		return capability.getName();
+	}
+
+	private String append(JSMimeType mime)
+	{
+		return mime.getName();
+	}
+
+	private String append(Object s)
+	{
+		if (s instanceof JSCapability)
+			return append((JSCapability) s);
+		if (s instanceof JSMimeType)
+			return append((JSMimeType) 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 JSClientCapabilities getCapabilitiesString()
+	{
+		return capabilitiesString;
+	}
+
+	public JSClientMimeTypes getMimeTypesString()
+	{
+		return mimeTypesString;
+	}
+
+
+	
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSClient.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSClientCapabilities.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSClientCapabilities.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSClientCapabilities.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSClientCapabilities.java Fri Dec 12 04:06:29 2008
@@ -1,46 +1,46 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 Client-Capabilities Wrapper
- * <p>
- * Wrapper to process XML representation of a set of client capabilities - used only for binding
- * 
- * @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
- * @version $Id: $
- */
-
-public class JSClientCapabilities extends JSUserRoles
-{
-
-	/**
-	 * 
-	 */
-	public JSClientCapabilities(String s)
-	{
-		super(s);
-	}
-
-    public JSClientCapabilities()
-    {
-        super();
-    }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 Client-Capabilities Wrapper
+ * <p>
+ * Wrapper to process XML representation of a set of client capabilities - used only for binding
+ * 
+ * @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
+ * @version $Id: $
+ */
+
+public class JSClientCapabilities extends JSUserRoles
+{
+
+	/**
+	 * 
+	 */
+	public JSClientCapabilities(String s)
+	{
+		super(s);
+	}
+
+    public JSClientCapabilities()
+    {
+        super();
+    }
+
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSClientCapabilities.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSClientMimeTypes.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSClientMimeTypes.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSClientMimeTypes.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSClientMimeTypes.java Fri Dec 12 04:06:29 2008
@@ -1,44 +1,44 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 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 JSClientMimeTypes extends JSUserRoles
-{
-
-	/**
-	 * 
-	 */
-	public JSClientMimeTypes(String s)
-	{
-		super(s);
-	}
-    public JSClientMimeTypes()
-    {
-        super();
-    }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 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 JSClientMimeTypes extends JSUserRoles
+{
+
+	/**
+	 * 
+	 */
+	public JSClientMimeTypes(String s)
+	{
+		super(s);
+	}
+    public JSClientMimeTypes()
+    {
+        super();
+    }
+
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSClientMimeTypes.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSClients.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSClients.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSClients.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSClients.java Fri Dec 12 04:06:29 2008
@@ -1,34 +1,34 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 clients Wrapper
-* <p>
-* Wrapper to process XML representation of a set of clients  - used only for binding
-* 
-* @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
-* @version $Id: $
-*/
-
-public class JSClients extends ArrayList<JSClient>
-{
-    private static final long serialVersionUID = -4112833259762462264L;
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 clients Wrapper
+* <p>
+* Wrapper to process XML representation of a set of clients  - used only for binding
+* 
+* @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
+* @version $Id: $
+*/
+
+public class JSClients extends ArrayList<JSClient>
+{
+    private static final long serialVersionUID = -4112833259762462264L;
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSClients.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSEntities.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSEntityPreference.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSEntityPreferences.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSGroup.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSGroup.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSGroup.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSGroup.java Fri Dec 12 04:06:29 2008
@@ -1,82 +1,82 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.*;
-import javolution.xml.stream.XMLStreamException;
-
-import org.apache.commons.lang.StringEscapeUtils;
-
-public class JSGroup 
-{
-	// private int refID;
-
-	String name;
-
-	public JSGroup()
-	{
-		// refID = id;
-	}
-
-	/***************************************************************************
-	 * SERIALIZER
-	 */
-	private static final XMLFormat XML = new XMLFormat(JSGroup.class)
-	{
-	public void write(Object o, OutputElement xml) throws XMLStreamException
-	{
-
-		try
-		{
-			JSGroup g = (JSGroup) o;
-			xml.addText(g.getName());
-		} catch (Exception e)
-		{
-			e.printStackTrace();
-		}
-	}
-
-	public void read(InputElement xml, Object o)
-	{
-		try
-		{
-			JSGroup g = (JSGroup) o;
-			g.setName(StringEscapeUtils.unescapeHtml(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;
-	}
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.*;
+import javolution.xml.stream.XMLStreamException;
+
+import org.apache.commons.lang.StringEscapeUtils;
+
+public class JSGroup 
+{
+	// private int refID;
+
+	String name;
+
+	public JSGroup()
+	{
+		// refID = id;
+	}
+
+	/***************************************************************************
+	 * SERIALIZER
+	 */
+	private static final XMLFormat XML = new XMLFormat(JSGroup.class)
+	{
+	public void write(Object o, OutputElement xml) throws XMLStreamException
+	{
+
+		try
+		{
+			JSGroup g = (JSGroup) o;
+			xml.addText(g.getName());
+		} catch (Exception e)
+		{
+			e.printStackTrace();
+		}
+	}
+
+	public void read(InputElement xml, Object o)
+	{
+		try
+		{
+			JSGroup g = (JSGroup) o;
+			g.setName(StringEscapeUtils.unescapeHtml(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;
+	}
+
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSGroup.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSGroups.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSGroups.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSGroups.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSGroups.java Fri Dec 12 04:06:29 2008
@@ -1,34 +1,34 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 Groups Wrapper
-* <p>
-* Wrapper to process XML representation of a set of groups - used only for binding
-* 
-* @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
-* @version $Id: $
-*/
-
-public class JSGroups extends ArrayList<JSGroup>
-{
-    private static final long serialVersionUID = -6568194951545408326L;
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 Groups Wrapper
+* <p>
+* Wrapper to process XML representation of a set of groups - used only for binding
+* 
+* @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
+* @version $Id: $
+*/
+
+public class JSGroups extends ArrayList<JSGroup>
+{
+    private static final long serialVersionUID = -6568194951545408326L;
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSGroups.java
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
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