You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by sg...@apache.org on 2005/08/29 14:09:12 UTC
svn commit: r264121 [2/6] - in
/portals/jetspeed-2/branches/SummersOfCode-2005:
app-servers/security/jboss/ app-servers/security/jboss/src/java/META-INF/
app-servers/security/jboss/src/java/META-INF/jboss-secsvc/
app-servers/security/jboss/src/java/org...
Modified: portals/jetspeed-2/branches/SummersOfCode-2005/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JdbcMetadataUtils.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/branches/SummersOfCode-2005/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JdbcMetadataUtils.java?rev=264121&r1=264120&r2=264121&view=diff
==============================================================================
--- portals/jetspeed-2/branches/SummersOfCode-2005/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JdbcMetadataUtils.java (original)
+++ portals/jetspeed-2/branches/SummersOfCode-2005/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JdbcMetadataUtils.java Mon Aug 29 05:04:38 2005
@@ -1,482 +1,482 @@
-/* Copyright 2002-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.
- */
-
-/*
- * TODO: Copied here because db-ojb 1.0.1 used by Jetspeed2 does not provide
- * this. May be replaved when Jetspeed2 updates OJB.
- */
-
-package org.apache.jetspeed.appservers.security.jboss;
-
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.SQLException;
-import java.util.HashMap;
-
-import javax.sql.DataSource;
-import org.apache.commons.beanutils.PropertyUtils;
-import org.apache.ojb.broker.metadata.JdbcConnectionDescriptor;
-import org.apache.ojb.broker.metadata.MetadataException;
-
-/**
- * This class provides some utility functions to OJB for working with JDBC metadata.
- *
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
- */
-public class JdbcMetadataUtils
-{
- /**
- * The name of the property returned by the {@link #splitConnectionUrl(String)} method that contains the protocol
- */
- public static final String PROPERTY_PROTOCOL = "protocol";
-
- /**
- * The name of the property returned by the {@link #splitConnectionUrl(String)} method that contains the sub
- * protocol
- */
- public static final String PROPERTY_SUBPROTOCOL = "subprotocol";
-
- /**
- * The name of the property returned by the {@link #splitConnectionUrl(String)} method that contains the database
- * alias (the actual database url)
- */
- public static final String PROPERTY_DBALIAS = "dbAlias";
-
- /** Identifier for the DB2 platform */
- public static final String PLATFORM_DB2 = "Db2";
-
- /** Identifier for the Firebird platform */
- public static final String PLATFORM_FIREBIRD = "Firebird";
-
- /** Identifier for the Hsqldb platform */
- public static final String PLATFORM_HSQLDB = "Hsqldb";
-
- /** Identifier for the Informix platform */
- public static final String PLATFORM_INFORMIX = "Informix";
-
- /** Identifier for the MaxDB platform */
- public static final String PLATFORM_MAXDB = "MaxDB";
-
- /** Identifier for the McKoi platform */
- public static final String PLATFORM_MCKOI = "McKoi";
-
- /** Identifier for the MsAccess platform */
- public static final String PLATFORM_MSACCESS = "MsAccess";
-
- /** Identifier for the Microsoft SQL Server platform */
- public static final String PLATFORM_MSSQLSERVER = "MsSQLServer";
-
- /** Identifier for the MySQL platform */
- public static final String PLATFORM_MYSQL = "MySQL";
-
- /** Identifier for the generic Oracle platform */
- public static final String PLATFORM_ORACLE = "Oracle";
-
- /** Identifier for the Oracle9i platform */
- public static final String PLATFORM_ORACLE9I = "Oracle9i";
-
- /** Identifier for the PostgresSQL platform */
- public static final String PLATFORM_POSTGRESQL = "PostgreSQL";
-
- /** Identifier for the generic Sybase platform */
- public static final String PLATFORM_SYBASE = "Sybase";
-
- /** Identifier for the Sybase ASA platform */
- public static final String PLATFORM_SYBASEASA = "SybaseASA";
-
- /** Identifier for the Sybase ASE platform */
- public static final String PLATFORM_SYBASEASE = "SybaseASE";
-
- /** Identifier for the Oracle9i for WebLogic platform */
- public static final String PLATFORM_WLORACLE9I = "WLOracle9i";
-
- /** The standard DB2 jdbc driver */
- public static final String DRIVER_DB2 = "COM.ibm.db2.jdbc.app.DB2Driver";
-
- /** The i-net DB2 jdbc driver */
- public static final String DRIVER_DB2_INET = "com.inet.drda.DRDADriver";
-
- /** The standard Firebird jdbc driver */
- public static final String DRIVER_FIREBIRD = "org.firebirdsql.jdbc.FBDriver";
-
- /** The standard Hsqldb jdbc driver */
- public static final String DRIVER_HSQLDB = "org.hsqldb.jdbcDriver";
-
- /** The i-net pooled jdbc driver for SQLServer and Sybase */
- public static final String DRIVER_INET_POOLED = "com.inet.pool.PoolDriver";
-
- /** The standard Informix jdbc driver */
- public static final String DRIVER_INFORMIX = "com.informix.jdbc.IfxDriver";
-
- /** The jTDS jdbc driver for SQLServer and Sybase */
- public static final String DRIVER_JTDS = "net.sourceforge.jtds.jdbc.Driver";
-
- /** The standard MaxDB jdbc driver */
- public static final String DRIVER_MAXDB = "com.sap.dbtech.jdbc.DriverSapDB";
-
- /** The standard McKoi jdbc driver */
- public static final String DRIVER_MCKOI = "com.mckoi.JDBCDriver";
-
- /** The standard SQLServer jdbc driver */
- public static final String DRIVER_MSSQLSERVER = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
-
- /** The i-net SQLServer jdbc driver */
- public static final String DRIVER_MSSQLSERVER_INET = "com.inet.tds.TdsDriver";
-
- /** The JNetDirect SQLServer jdbc driver */
- public static final String DRIVER_MSSQLSERVER_JSQLCONNECT = "com.jnetdirect.jsql.JSQLDriver";
-
- /** The standard MySQL jdbc driver */
- public static final String DRIVER_MYSQL = "com.mysql.jdbc.Driver";
-
- /** The old MySQL jdbc driver */
- public static final String DRIVER_MYSQL_OLD = "org.gjt.mm.mysql.Driver";
-
- /** The standard Oracle jdbc driver */
- public static final String DRIVER_ORACLE = "oracle.jdbc.driver.OracleDriver";
-
- /** The i-net Oracle jdbc driver */
- public static final String DRIVER_ORACLE_INET = "com.inet.ora.OraDriver";
-
- /** The standard PostgreSQL jdbc driver */
- public static final String DRIVER_POSTGRESQL = "org.postgresql.Driver";
-
- /** The standard Sapdb jdbc driver */
- public static final String DRIVER_SAPDB = DRIVER_MAXDB;
-
- /** The standard Sybase jdbc driver */
- public static final String DRIVER_SYBASE = "com.sybase.jdbc2.jdbc.SybDriver";
-
- /** The old Sybase jdbc driver */
- public static final String DRIVER_SYBASE_OLD = "com.sybase.jdbc.SybDriver";
-
- /** The i-net Sybase jdbc driver */
- public static final String DRIVER_SYBASE_INET = "com.inet.syb.SybDriver";
-
- /** The subprotocol used by the standard DB2 driver */
- public static final String SUBPROTOCOL_DB2 = "db2";
-
- /** The subprotocol used by the i-net DB2 driver */
- public static final String SUBPROTOCOL_DB2_INET = "inetdb2";
-
- /** The subprotocol used by the standard Firebird driver */
- public static final String SUBPROTOCOL_FIREBIRD = "firebirdsql";
-
- /** The subprotocol used by the standard Hsqldb driver */
- public static final String SUBPROTOCOL_HSQLDB = "hsqldb";
-
- /** The subprotocol used by the standard Informix driver */
- public static final String SUBPROTOCOL_INFORMIX = "informix-sqli";
-
- /** The subprotocol used by the standard MaxDB driver */
- public static final String SUBPROTOCOL_MAXDB = "sapdb";
-
- /** The subprotocol used by the standard McKoi driver */
- public static final String SUBPROTOCOL_MCKOI = "mckoi";
-
- /** The subprotocol used by the standard SQLServer driver */
- public static final String SUBPROTOCOL_MSSQLSERVER = "microsoft:sqlserver";
-
- /** A subprotocol used by the i-net SQLServer driver */
- public static final String SUBPROTOCOL_MSSQLSERVER_INET = "inetdae";
-
- /** A subprotocol used by the i-net SQLServer driver */
- public static final String SUBPROTOCOL_MSSQLSERVER6_INET = "inetdae6";
-
- /** A subprotocol used by the i-net SQLServer driver */
- public static final String SUBPROTOCOL_MSSQLSERVER7_INET = "inetdae7";
-
- /** A subprotocol used by the i-net SQLServer driver */
- public static final String SUBPROTOCOL_MSSQLSERVER7A_INET = "inetdae7a";
-
- /** A subprotocol used by the pooled i-net SQLServer driver */
- public static final String SUBPROTOCOL_MSSQLSERVER_INET_POOLED = "inetpool:inetdae";
-
- /** A subprotocol used by the pooled i-net SQLServer driver */
- public static final String SUBPROTOCOL_MSSQLSERVER6_INET_POOLED = "inetpool:inetdae6";
-
- /** A subprotocol used by the pooled i-net SQLServer driver */
- public static final String SUBPROTOCOL_MSSQLSERVER7_INET_POOLED = "inetpool:inetdae7";
-
- /** A subprotocol used by the pooled i-net SQLServer driver */
- public static final String SUBPROTOCOL_MSSQLSERVER7A_INET_POOLED = "inetpool:inetdae7a";
-
- /** The subprotocol used by the JNetDirect SQLServer driver */
- public static final String SUBPROTOCOL_MSSQLSERVER_JSQLCONNECT = "JSQLConnect";
-
- /** The subprotocol used by the jTDS SQLServer driver */
- public static final String SUBPROTOCOL_MSSQLSERVER_JTDS = "jtds:sqlserver";
-
- /** The subprotocol used by the standard MySQL driver */
- public static final String SUBPROTOCOL_MYSQL = "mysql";
-
- /** The subprotocol used by the standard Oracle driver */
- public static final String SUBPROTOCOL_ORACLE = "oracle";
-
- /** The subprotocol used by the i-net Oracle driver */
- public static final String SUBPROTOCOL_ORACLE_INET = "inetora";
-
- /** The subprotocol used by the standard PostgreSQL driver */
- public static final String SUBPROTOCOL_POSTGRESQL = "postgresql";
-
- /** The subprotocol used by the standard Sapdb driver */
- public static final String SUBPROTOCOL_SAPDB = SUBPROTOCOL_MAXDB;
-
- /** The subprotocol used by the standard Sybase driver */
- public static final String SUBPROTOCOL_SYBASE = "sybase:Tds";
-
- /** The subprotocol used by the i-net Sybase driver */
- public static final String SUBPROTOCOL_SYBASE_INET = "inetsyb";
-
- /** The subprotocol used by the pooled i-net Sybase driver */
- public static final String SUBPROTOCOL_SYBASE_INET_POOLED = "inetpool:inetsyb";
-
- /** The subprotocol used by the jTDS Sybase driver */
- public static final String SUBPROTOCOL_SYBASE_JTDS = "jtds:sybase";
-
- /** Maps the sub-protocl part of a jdbc connection url to a OJB platform name */
- private HashMap jdbcSubProtocolToPlatform = new HashMap();
-
- /** Maps the jdbc driver name to a OJB platform name */
- private HashMap jdbcDriverToPlatform = new HashMap();
-
- /**
- * Creates a new <code>JdbcMetadataUtils</code> object.
- */
- public JdbcMetadataUtils()
- {
- // Note that currently Sapdb and MaxDB have equal subprotocols and
- // drivers so we have no means to distinguish them
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_DB2, PLATFORM_DB2);
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_DB2_INET, PLATFORM_DB2);
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_FIREBIRD, PLATFORM_FIREBIRD);
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_HSQLDB, PLATFORM_HSQLDB);
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_INFORMIX, PLATFORM_INFORMIX);
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MAXDB, PLATFORM_MAXDB);
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER, PLATFORM_MSSQLSERVER);
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER_INET, PLATFORM_MSSQLSERVER);
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER6_INET, PLATFORM_MSSQLSERVER);
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER7_INET, PLATFORM_MSSQLSERVER);
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER7A_INET, PLATFORM_MSSQLSERVER);
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER_INET_POOLED, PLATFORM_MSSQLSERVER);
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER6_INET_POOLED, PLATFORM_MSSQLSERVER);
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER7_INET_POOLED, PLATFORM_MSSQLSERVER);
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER7A_INET_POOLED, PLATFORM_MSSQLSERVER);
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER_JTDS, PLATFORM_MSSQLSERVER);
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MYSQL, PLATFORM_MYSQL);
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_ORACLE, PLATFORM_ORACLE);
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_ORACLE_INET, PLATFORM_ORACLE);
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_POSTGRESQL, PLATFORM_POSTGRESQL);
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_SYBASE, PLATFORM_SYBASE);
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_SYBASE_INET, PLATFORM_SYBASE);
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_SYBASE_INET_POOLED, PLATFORM_SYBASE);
- jdbcSubProtocolToPlatform.put(SUBPROTOCOL_SYBASE_JTDS, PLATFORM_SYBASE);
-
- jdbcDriverToPlatform.put(DRIVER_DB2, PLATFORM_DB2);
- jdbcDriverToPlatform.put(DRIVER_DB2_INET, PLATFORM_DB2);
- jdbcDriverToPlatform.put(DRIVER_FIREBIRD, PLATFORM_FIREBIRD);
- jdbcDriverToPlatform.put(DRIVER_HSQLDB, PLATFORM_HSQLDB);
- jdbcDriverToPlatform.put(DRIVER_INFORMIX, PLATFORM_INFORMIX);
- jdbcDriverToPlatform.put(DRIVER_MAXDB, PLATFORM_MAXDB);
- jdbcDriverToPlatform.put(DRIVER_MCKOI, PLATFORM_MCKOI);
- jdbcDriverToPlatform.put(DRIVER_MSSQLSERVER, PLATFORM_MSSQLSERVER);
- jdbcDriverToPlatform.put(DRIVER_MSSQLSERVER_INET, PLATFORM_MSSQLSERVER);
- jdbcDriverToPlatform.put(DRIVER_MSSQLSERVER_JSQLCONNECT, PLATFORM_MSSQLSERVER);
- jdbcDriverToPlatform.put(DRIVER_MYSQL, PLATFORM_MYSQL);
- jdbcDriverToPlatform.put(DRIVER_MYSQL_OLD, PLATFORM_MYSQL);
- jdbcDriverToPlatform.put(DRIVER_ORACLE, PLATFORM_ORACLE);
- jdbcDriverToPlatform.put(DRIVER_ORACLE_INET, PLATFORM_ORACLE);
- jdbcDriverToPlatform.put(DRIVER_POSTGRESQL, PLATFORM_POSTGRESQL);
- jdbcDriverToPlatform.put(DRIVER_SYBASE, PLATFORM_SYBASE);
- jdbcDriverToPlatform.put(DRIVER_SYBASE_OLD, PLATFORM_SYBASE);
- jdbcDriverToPlatform.put(DRIVER_SYBASE_INET, PLATFORM_SYBASE);
- }
-
- /**
- * Fills parameters of the given {@link JdbcConnectionDescriptor} with metadata extracted from the given datasource.
- *
- * @param jcd
- * The jdbc connection descriptor to fill
- * @param dataSource
- * The data source
- * @param username
- * The username required to establish a connection via the data source Can be empty if the data source
- * does not require it or if one is specified in the jdbc connection descriptor
- * @param password
- * The username required to establish a connection via the data source Can be empty if the data source or
- * username does not require it or if one is specified in the jdbc connection descriptor
- */
- public void fillJCDFromDataSource(JdbcConnectionDescriptor jcd, DataSource dataSource, String username,
- String password) throws MetadataException
- {
- String realUsername = (jcd.getUserName() != null ? jcd.getUserName() : username);
- String realPassword = (jcd.getPassWord() != null ? jcd.getPassWord() : password);
- Connection connection = null;
- DatabaseMetaData metadata = null;
-
- try
- {
- // we have to open a connection to be able to retrieve metadata
- if (realUsername != null)
- {
- connection = dataSource.getConnection(realUsername, realPassword);
- }
- else
- {
- connection = dataSource.getConnection();
- }
-
- metadata = connection.getMetaData();
- }
- catch (Throwable t)
- {
- if (connection != null)
- {
- try
- {
- connection.close();
- }
- catch (SQLException ex)
- {
- }
- }
- throw new MetadataException("Could not get the metadata from the given datasource", t);
- }
-
- try
- {
- HashMap urlComponents = parseConnectionUrl(metadata.getURL());
-
- if (urlComponents.containsKey(PROPERTY_DBALIAS))
- {
- jcd.setProtocol((String) urlComponents.get(PROPERTY_PROTOCOL));
- jcd.setSubProtocol((String) urlComponents.get(PROPERTY_SUBPROTOCOL));
- jcd.setDbAlias((String) urlComponents.get(PROPERTY_DBALIAS));
- if (jdbcSubProtocolToPlatform.containsKey(jcd.getSubProtocol()))
- {
- // TODO: We might be able to use this: metadata.getDatabaseProductName();
- jcd.setDbms((String) jdbcSubProtocolToPlatform.get(jcd.getSubProtocol()));
- }
- }
- }
- catch (Throwable t)
- {
- try
- {
- connection.close();
- }
- catch (SQLException ex)
- {
- }
- throw new MetadataException("Could not get the metadata from the given datasource", t);
- }
- try
- {
- // this will only work with JDK >= 1.4 and only with some jdbc drivers
- Integer majorVersion = (Integer) PropertyUtils.getProperty(metadata, "JDBCMajorVersion");
- Integer minorVersion = (Integer) PropertyUtils.getProperty(metadata, "JDBCMinorVersion");
-
- jcd.setJdbcLevel(Double.parseDouble(majorVersion.toString() + "." + minorVersion.toString()));
- }
- catch (Throwable t)
- {
- // otherwise we're assuming JDBC 2.0 compliance
- jcd.setJdbcLevel(2.0);
- }
- try
- {
- connection.close();
- }
- catch (SQLException ex)
- {
- }
- }
-
- /**
- * Splits the given jdbc connection url into its components and puts them into a hash map using the
- * <code>PROPERTY_</code> constants.
- *
- * @param jdbcConnectionUrl
- * The connection url
- * @return The properties
- */
- public HashMap parseConnectionUrl(String jdbcConnectionUrl)
- {
- HashMap result = new HashMap();
-
- if (jdbcConnectionUrl == null)
- {
- return result;
- }
-
- int pos = jdbcConnectionUrl.indexOf(':');
- int lastPos;
-
- result.put(PROPERTY_PROTOCOL, jdbcConnectionUrl.substring(0, pos));
-
- lastPos = pos;
- pos = jdbcConnectionUrl.indexOf(':', lastPos + 1);
-
- String subProtocol = jdbcConnectionUrl.substring(lastPos + 1, pos);
-
- // there are a few jdbc drivers that have a subprotocol containing one or more ':'
- if ("inetpool".equals(subProtocol))
- {
- // Possible forms are:
- // inetpool:<subprotocol>
- // inetpool:jdbc:<subprotocol> (where we'll remove the 'jdbc' part)
-
- int tmpPos = jdbcConnectionUrl.indexOf(':', pos + 1);
-
- if ("inetpool:jdbc".equals(jdbcConnectionUrl.substring(lastPos + 1, tmpPos)))
- {
- pos = tmpPos;
- tmpPos = jdbcConnectionUrl.indexOf(':', pos + 1);
- }
- subProtocol += ":" + jdbcConnectionUrl.substring(pos + 1, tmpPos);
- }
- else if ("jtds".equals(subProtocol) || "microsoft".equals(subProtocol) || "sybase".equals(subProtocol))
- {
- pos = jdbcConnectionUrl.indexOf(':', pos + 1);
- subProtocol = ":" + jdbcConnectionUrl.substring(lastPos + 1, pos);
- }
-
- result.put(PROPERTY_SUBPROTOCOL, subProtocol);
- result.put(PROPERTY_DBALIAS, jdbcConnectionUrl.substring(pos + 1));
-
- return result;
- }
-
- /**
- * Derives the OJB platform to use for a database that is connected via a url using the specified subprotocol, and
- * where the specified jdbc driver is used.
- *
- * @param jdbcSubProtocol
- * The JDBC subprotocol used to connect to the database
- * @param jdbcDriver
- * The JDBC driver used to connect to the database
- * @return The platform identifier or <code>null</code> if no platform could be found
- */
- public String findPlatformFor(String jdbcSubProtocol, String jdbcDriver)
- {
- String platform = (String) jdbcSubProtocolToPlatform.get(jdbcSubProtocol);
-
- if (platform == null)
- {
- platform = (String) jdbcDriverToPlatform.get(jdbcDriver);
- }
- return platform;
- }
-}
+/* Copyright 2002-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.
+ */
+
+/*
+ * TODO: Copied here because db-ojb 1.0.1 used by Jetspeed2 does not provide
+ * this. May be replaved when Jetspeed2 updates OJB.
+ */
+
+package org.apache.jetspeed.appservers.security.jboss;
+
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.SQLException;
+import java.util.HashMap;
+
+import javax.sql.DataSource;
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.ojb.broker.metadata.JdbcConnectionDescriptor;
+import org.apache.ojb.broker.metadata.MetadataException;
+
+/**
+ * This class provides some utility functions to OJB for working with JDBC metadata.
+ *
+ * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ */
+public class JdbcMetadataUtils
+{
+ /**
+ * The name of the property returned by the {@link #splitConnectionUrl(String)} method that contains the protocol
+ */
+ public static final String PROPERTY_PROTOCOL = "protocol";
+
+ /**
+ * The name of the property returned by the {@link #splitConnectionUrl(String)} method that contains the sub
+ * protocol
+ */
+ public static final String PROPERTY_SUBPROTOCOL = "subprotocol";
+
+ /**
+ * The name of the property returned by the {@link #splitConnectionUrl(String)} method that contains the database
+ * alias (the actual database url)
+ */
+ public static final String PROPERTY_DBALIAS = "dbAlias";
+
+ /** Identifier for the DB2 platform */
+ public static final String PLATFORM_DB2 = "Db2";
+
+ /** Identifier for the Firebird platform */
+ public static final String PLATFORM_FIREBIRD = "Firebird";
+
+ /** Identifier for the Hsqldb platform */
+ public static final String PLATFORM_HSQLDB = "Hsqldb";
+
+ /** Identifier for the Informix platform */
+ public static final String PLATFORM_INFORMIX = "Informix";
+
+ /** Identifier for the MaxDB platform */
+ public static final String PLATFORM_MAXDB = "MaxDB";
+
+ /** Identifier for the McKoi platform */
+ public static final String PLATFORM_MCKOI = "McKoi";
+
+ /** Identifier for the MsAccess platform */
+ public static final String PLATFORM_MSACCESS = "MsAccess";
+
+ /** Identifier for the Microsoft SQL Server platform */
+ public static final String PLATFORM_MSSQLSERVER = "MsSQLServer";
+
+ /** Identifier for the MySQL platform */
+ public static final String PLATFORM_MYSQL = "MySQL";
+
+ /** Identifier for the generic Oracle platform */
+ public static final String PLATFORM_ORACLE = "Oracle";
+
+ /** Identifier for the Oracle9i platform */
+ public static final String PLATFORM_ORACLE9I = "Oracle9i";
+
+ /** Identifier for the PostgresSQL platform */
+ public static final String PLATFORM_POSTGRESQL = "PostgreSQL";
+
+ /** Identifier for the generic Sybase platform */
+ public static final String PLATFORM_SYBASE = "Sybase";
+
+ /** Identifier for the Sybase ASA platform */
+ public static final String PLATFORM_SYBASEASA = "SybaseASA";
+
+ /** Identifier for the Sybase ASE platform */
+ public static final String PLATFORM_SYBASEASE = "SybaseASE";
+
+ /** Identifier for the Oracle9i for WebLogic platform */
+ public static final String PLATFORM_WLORACLE9I = "WLOracle9i";
+
+ /** The standard DB2 jdbc driver */
+ public static final String DRIVER_DB2 = "COM.ibm.db2.jdbc.app.DB2Driver";
+
+ /** The i-net DB2 jdbc driver */
+ public static final String DRIVER_DB2_INET = "com.inet.drda.DRDADriver";
+
+ /** The standard Firebird jdbc driver */
+ public static final String DRIVER_FIREBIRD = "org.firebirdsql.jdbc.FBDriver";
+
+ /** The standard Hsqldb jdbc driver */
+ public static final String DRIVER_HSQLDB = "org.hsqldb.jdbcDriver";
+
+ /** The i-net pooled jdbc driver for SQLServer and Sybase */
+ public static final String DRIVER_INET_POOLED = "com.inet.pool.PoolDriver";
+
+ /** The standard Informix jdbc driver */
+ public static final String DRIVER_INFORMIX = "com.informix.jdbc.IfxDriver";
+
+ /** The jTDS jdbc driver for SQLServer and Sybase */
+ public static final String DRIVER_JTDS = "net.sourceforge.jtds.jdbc.Driver";
+
+ /** The standard MaxDB jdbc driver */
+ public static final String DRIVER_MAXDB = "com.sap.dbtech.jdbc.DriverSapDB";
+
+ /** The standard McKoi jdbc driver */
+ public static final String DRIVER_MCKOI = "com.mckoi.JDBCDriver";
+
+ /** The standard SQLServer jdbc driver */
+ public static final String DRIVER_MSSQLSERVER = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
+
+ /** The i-net SQLServer jdbc driver */
+ public static final String DRIVER_MSSQLSERVER_INET = "com.inet.tds.TdsDriver";
+
+ /** The JNetDirect SQLServer jdbc driver */
+ public static final String DRIVER_MSSQLSERVER_JSQLCONNECT = "com.jnetdirect.jsql.JSQLDriver";
+
+ /** The standard MySQL jdbc driver */
+ public static final String DRIVER_MYSQL = "com.mysql.jdbc.Driver";
+
+ /** The old MySQL jdbc driver */
+ public static final String DRIVER_MYSQL_OLD = "org.gjt.mm.mysql.Driver";
+
+ /** The standard Oracle jdbc driver */
+ public static final String DRIVER_ORACLE = "oracle.jdbc.driver.OracleDriver";
+
+ /** The i-net Oracle jdbc driver */
+ public static final String DRIVER_ORACLE_INET = "com.inet.ora.OraDriver";
+
+ /** The standard PostgreSQL jdbc driver */
+ public static final String DRIVER_POSTGRESQL = "org.postgresql.Driver";
+
+ /** The standard Sapdb jdbc driver */
+ public static final String DRIVER_SAPDB = DRIVER_MAXDB;
+
+ /** The standard Sybase jdbc driver */
+ public static final String DRIVER_SYBASE = "com.sybase.jdbc2.jdbc.SybDriver";
+
+ /** The old Sybase jdbc driver */
+ public static final String DRIVER_SYBASE_OLD = "com.sybase.jdbc.SybDriver";
+
+ /** The i-net Sybase jdbc driver */
+ public static final String DRIVER_SYBASE_INET = "com.inet.syb.SybDriver";
+
+ /** The subprotocol used by the standard DB2 driver */
+ public static final String SUBPROTOCOL_DB2 = "db2";
+
+ /** The subprotocol used by the i-net DB2 driver */
+ public static final String SUBPROTOCOL_DB2_INET = "inetdb2";
+
+ /** The subprotocol used by the standard Firebird driver */
+ public static final String SUBPROTOCOL_FIREBIRD = "firebirdsql";
+
+ /** The subprotocol used by the standard Hsqldb driver */
+ public static final String SUBPROTOCOL_HSQLDB = "hsqldb";
+
+ /** The subprotocol used by the standard Informix driver */
+ public static final String SUBPROTOCOL_INFORMIX = "informix-sqli";
+
+ /** The subprotocol used by the standard MaxDB driver */
+ public static final String SUBPROTOCOL_MAXDB = "sapdb";
+
+ /** The subprotocol used by the standard McKoi driver */
+ public static final String SUBPROTOCOL_MCKOI = "mckoi";
+
+ /** The subprotocol used by the standard SQLServer driver */
+ public static final String SUBPROTOCOL_MSSQLSERVER = "microsoft:sqlserver";
+
+ /** A subprotocol used by the i-net SQLServer driver */
+ public static final String SUBPROTOCOL_MSSQLSERVER_INET = "inetdae";
+
+ /** A subprotocol used by the i-net SQLServer driver */
+ public static final String SUBPROTOCOL_MSSQLSERVER6_INET = "inetdae6";
+
+ /** A subprotocol used by the i-net SQLServer driver */
+ public static final String SUBPROTOCOL_MSSQLSERVER7_INET = "inetdae7";
+
+ /** A subprotocol used by the i-net SQLServer driver */
+ public static final String SUBPROTOCOL_MSSQLSERVER7A_INET = "inetdae7a";
+
+ /** A subprotocol used by the pooled i-net SQLServer driver */
+ public static final String SUBPROTOCOL_MSSQLSERVER_INET_POOLED = "inetpool:inetdae";
+
+ /** A subprotocol used by the pooled i-net SQLServer driver */
+ public static final String SUBPROTOCOL_MSSQLSERVER6_INET_POOLED = "inetpool:inetdae6";
+
+ /** A subprotocol used by the pooled i-net SQLServer driver */
+ public static final String SUBPROTOCOL_MSSQLSERVER7_INET_POOLED = "inetpool:inetdae7";
+
+ /** A subprotocol used by the pooled i-net SQLServer driver */
+ public static final String SUBPROTOCOL_MSSQLSERVER7A_INET_POOLED = "inetpool:inetdae7a";
+
+ /** The subprotocol used by the JNetDirect SQLServer driver */
+ public static final String SUBPROTOCOL_MSSQLSERVER_JSQLCONNECT = "JSQLConnect";
+
+ /** The subprotocol used by the jTDS SQLServer driver */
+ public static final String SUBPROTOCOL_MSSQLSERVER_JTDS = "jtds:sqlserver";
+
+ /** The subprotocol used by the standard MySQL driver */
+ public static final String SUBPROTOCOL_MYSQL = "mysql";
+
+ /** The subprotocol used by the standard Oracle driver */
+ public static final String SUBPROTOCOL_ORACLE = "oracle";
+
+ /** The subprotocol used by the i-net Oracle driver */
+ public static final String SUBPROTOCOL_ORACLE_INET = "inetora";
+
+ /** The subprotocol used by the standard PostgreSQL driver */
+ public static final String SUBPROTOCOL_POSTGRESQL = "postgresql";
+
+ /** The subprotocol used by the standard Sapdb driver */
+ public static final String SUBPROTOCOL_SAPDB = SUBPROTOCOL_MAXDB;
+
+ /** The subprotocol used by the standard Sybase driver */
+ public static final String SUBPROTOCOL_SYBASE = "sybase:Tds";
+
+ /** The subprotocol used by the i-net Sybase driver */
+ public static final String SUBPROTOCOL_SYBASE_INET = "inetsyb";
+
+ /** The subprotocol used by the pooled i-net Sybase driver */
+ public static final String SUBPROTOCOL_SYBASE_INET_POOLED = "inetpool:inetsyb";
+
+ /** The subprotocol used by the jTDS Sybase driver */
+ public static final String SUBPROTOCOL_SYBASE_JTDS = "jtds:sybase";
+
+ /** Maps the sub-protocl part of a jdbc connection url to a OJB platform name */
+ private HashMap jdbcSubProtocolToPlatform = new HashMap();
+
+ /** Maps the jdbc driver name to a OJB platform name */
+ private HashMap jdbcDriverToPlatform = new HashMap();
+
+ /**
+ * Creates a new <code>JdbcMetadataUtils</code> object.
+ */
+ public JdbcMetadataUtils()
+ {
+ // Note that currently Sapdb and MaxDB have equal subprotocols and
+ // drivers so we have no means to distinguish them
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_DB2, PLATFORM_DB2);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_DB2_INET, PLATFORM_DB2);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_FIREBIRD, PLATFORM_FIREBIRD);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_HSQLDB, PLATFORM_HSQLDB);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_INFORMIX, PLATFORM_INFORMIX);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MAXDB, PLATFORM_MAXDB);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER, PLATFORM_MSSQLSERVER);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER_INET, PLATFORM_MSSQLSERVER);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER6_INET, PLATFORM_MSSQLSERVER);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER7_INET, PLATFORM_MSSQLSERVER);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER7A_INET, PLATFORM_MSSQLSERVER);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER_INET_POOLED, PLATFORM_MSSQLSERVER);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER6_INET_POOLED, PLATFORM_MSSQLSERVER);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER7_INET_POOLED, PLATFORM_MSSQLSERVER);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER7A_INET_POOLED, PLATFORM_MSSQLSERVER);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER_JTDS, PLATFORM_MSSQLSERVER);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MYSQL, PLATFORM_MYSQL);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_ORACLE, PLATFORM_ORACLE);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_ORACLE_INET, PLATFORM_ORACLE);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_POSTGRESQL, PLATFORM_POSTGRESQL);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_SYBASE, PLATFORM_SYBASE);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_SYBASE_INET, PLATFORM_SYBASE);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_SYBASE_INET_POOLED, PLATFORM_SYBASE);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_SYBASE_JTDS, PLATFORM_SYBASE);
+
+ jdbcDriverToPlatform.put(DRIVER_DB2, PLATFORM_DB2);
+ jdbcDriverToPlatform.put(DRIVER_DB2_INET, PLATFORM_DB2);
+ jdbcDriverToPlatform.put(DRIVER_FIREBIRD, PLATFORM_FIREBIRD);
+ jdbcDriverToPlatform.put(DRIVER_HSQLDB, PLATFORM_HSQLDB);
+ jdbcDriverToPlatform.put(DRIVER_INFORMIX, PLATFORM_INFORMIX);
+ jdbcDriverToPlatform.put(DRIVER_MAXDB, PLATFORM_MAXDB);
+ jdbcDriverToPlatform.put(DRIVER_MCKOI, PLATFORM_MCKOI);
+ jdbcDriverToPlatform.put(DRIVER_MSSQLSERVER, PLATFORM_MSSQLSERVER);
+ jdbcDriverToPlatform.put(DRIVER_MSSQLSERVER_INET, PLATFORM_MSSQLSERVER);
+ jdbcDriverToPlatform.put(DRIVER_MSSQLSERVER_JSQLCONNECT, PLATFORM_MSSQLSERVER);
+ jdbcDriverToPlatform.put(DRIVER_MYSQL, PLATFORM_MYSQL);
+ jdbcDriverToPlatform.put(DRIVER_MYSQL_OLD, PLATFORM_MYSQL);
+ jdbcDriverToPlatform.put(DRIVER_ORACLE, PLATFORM_ORACLE);
+ jdbcDriverToPlatform.put(DRIVER_ORACLE_INET, PLATFORM_ORACLE);
+ jdbcDriverToPlatform.put(DRIVER_POSTGRESQL, PLATFORM_POSTGRESQL);
+ jdbcDriverToPlatform.put(DRIVER_SYBASE, PLATFORM_SYBASE);
+ jdbcDriverToPlatform.put(DRIVER_SYBASE_OLD, PLATFORM_SYBASE);
+ jdbcDriverToPlatform.put(DRIVER_SYBASE_INET, PLATFORM_SYBASE);
+ }
+
+ /**
+ * Fills parameters of the given {@link JdbcConnectionDescriptor} with metadata extracted from the given datasource.
+ *
+ * @param jcd
+ * The jdbc connection descriptor to fill
+ * @param dataSource
+ * The data source
+ * @param username
+ * The username required to establish a connection via the data source Can be empty if the data source
+ * does not require it or if one is specified in the jdbc connection descriptor
+ * @param password
+ * The username required to establish a connection via the data source Can be empty if the data source or
+ * username does not require it or if one is specified in the jdbc connection descriptor
+ */
+ public void fillJCDFromDataSource(JdbcConnectionDescriptor jcd, DataSource dataSource, String username,
+ String password) throws MetadataException
+ {
+ String realUsername = (jcd.getUserName() != null ? jcd.getUserName() : username);
+ String realPassword = (jcd.getPassWord() != null ? jcd.getPassWord() : password);
+ Connection connection = null;
+ DatabaseMetaData metadata = null;
+
+ try
+ {
+ // we have to open a connection to be able to retrieve metadata
+ if (realUsername != null)
+ {
+ connection = dataSource.getConnection(realUsername, realPassword);
+ }
+ else
+ {
+ connection = dataSource.getConnection();
+ }
+
+ metadata = connection.getMetaData();
+ }
+ catch (Throwable t)
+ {
+ if (connection != null)
+ {
+ try
+ {
+ connection.close();
+ }
+ catch (SQLException ex)
+ {
+ }
+ }
+ throw new MetadataException("Could not get the metadata from the given datasource", t);
+ }
+
+ try
+ {
+ HashMap urlComponents = parseConnectionUrl(metadata.getURL());
+
+ if (urlComponents.containsKey(PROPERTY_DBALIAS))
+ {
+ jcd.setProtocol((String) urlComponents.get(PROPERTY_PROTOCOL));
+ jcd.setSubProtocol((String) urlComponents.get(PROPERTY_SUBPROTOCOL));
+ jcd.setDbAlias((String) urlComponents.get(PROPERTY_DBALIAS));
+ if (jdbcSubProtocolToPlatform.containsKey(jcd.getSubProtocol()))
+ {
+ // TODO: We might be able to use this: metadata.getDatabaseProductName();
+ jcd.setDbms((String) jdbcSubProtocolToPlatform.get(jcd.getSubProtocol()));
+ }
+ }
+ }
+ catch (Throwable t)
+ {
+ try
+ {
+ connection.close();
+ }
+ catch (SQLException ex)
+ {
+ }
+ throw new MetadataException("Could not get the metadata from the given datasource", t);
+ }
+ try
+ {
+ // this will only work with JDK >= 1.4 and only with some jdbc drivers
+ Integer majorVersion = (Integer) PropertyUtils.getProperty(metadata, "JDBCMajorVersion");
+ Integer minorVersion = (Integer) PropertyUtils.getProperty(metadata, "JDBCMinorVersion");
+
+ jcd.setJdbcLevel(Double.parseDouble(majorVersion.toString() + "." + minorVersion.toString()));
+ }
+ catch (Throwable t)
+ {
+ // otherwise we're assuming JDBC 2.0 compliance
+ jcd.setJdbcLevel(2.0);
+ }
+ try
+ {
+ connection.close();
+ }
+ catch (SQLException ex)
+ {
+ }
+ }
+
+ /**
+ * Splits the given jdbc connection url into its components and puts them into a hash map using the
+ * <code>PROPERTY_</code> constants.
+ *
+ * @param jdbcConnectionUrl
+ * The connection url
+ * @return The properties
+ */
+ public HashMap parseConnectionUrl(String jdbcConnectionUrl)
+ {
+ HashMap result = new HashMap();
+
+ if (jdbcConnectionUrl == null)
+ {
+ return result;
+ }
+
+ int pos = jdbcConnectionUrl.indexOf(':');
+ int lastPos;
+
+ result.put(PROPERTY_PROTOCOL, jdbcConnectionUrl.substring(0, pos));
+
+ lastPos = pos;
+ pos = jdbcConnectionUrl.indexOf(':', lastPos + 1);
+
+ String subProtocol = jdbcConnectionUrl.substring(lastPos + 1, pos);
+
+ // there are a few jdbc drivers that have a subprotocol containing one or more ':'
+ if ("inetpool".equals(subProtocol))
+ {
+ // Possible forms are:
+ // inetpool:<subprotocol>
+ // inetpool:jdbc:<subprotocol> (where we'll remove the 'jdbc' part)
+
+ int tmpPos = jdbcConnectionUrl.indexOf(':', pos + 1);
+
+ if ("inetpool:jdbc".equals(jdbcConnectionUrl.substring(lastPos + 1, tmpPos)))
+ {
+ pos = tmpPos;
+ tmpPos = jdbcConnectionUrl.indexOf(':', pos + 1);
+ }
+ subProtocol += ":" + jdbcConnectionUrl.substring(pos + 1, tmpPos);
+ }
+ else if ("jtds".equals(subProtocol) || "microsoft".equals(subProtocol) || "sybase".equals(subProtocol))
+ {
+ pos = jdbcConnectionUrl.indexOf(':', pos + 1);
+ subProtocol = ":" + jdbcConnectionUrl.substring(lastPos + 1, pos);
+ }
+
+ result.put(PROPERTY_SUBPROTOCOL, subProtocol);
+ result.put(PROPERTY_DBALIAS, jdbcConnectionUrl.substring(pos + 1));
+
+ return result;
+ }
+
+ /**
+ * Derives the OJB platform to use for a database that is connected via a url using the specified subprotocol, and
+ * where the specified jdbc driver is used.
+ *
+ * @param jdbcSubProtocol
+ * The JDBC subprotocol used to connect to the database
+ * @param jdbcDriver
+ * The JDBC driver used to connect to the database
+ * @return The platform identifier or <code>null</code> if no platform could be found
+ */
+ public String findPlatformFor(String jdbcSubProtocol, String jdbcDriver)
+ {
+ String platform = (String) jdbcSubProtocolToPlatform.get(jdbcSubProtocol);
+
+ if (platform == null)
+ {
+ platform = (String) jdbcDriverToPlatform.get(jdbcDriver);
+ }
+ return platform;
+ }
+}
Modified: portals/jetspeed-2/branches/SummersOfCode-2005/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/LoginModule.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/branches/SummersOfCode-2005/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/LoginModule.java?rev=264121&r1=264120&r2=264121&view=diff
==============================================================================
--- portals/jetspeed-2/branches/SummersOfCode-2005/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/LoginModule.java (original)
+++ portals/jetspeed-2/branches/SummersOfCode-2005/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/LoginModule.java Mon Aug 29 05:04:38 2005
@@ -1,154 +1,154 @@
-/* Copyright 2004 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.appservers.security.jboss;
-
-import java.util.Map;
-
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanException;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import javax.management.ReflectionException;
-import javax.security.auth.Subject;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.login.LoginException;
-
-import org.apache.jetspeed.security.UserManager;
-import org.apache.jetspeed.security.impl.ext.JBossLoginModule;
-
-/**
- * A login module that uses the JetspeedSecurityService MBean for authentication and role assignment.
- */
-public class LoginModule implements javax.security.auth.spi.LoginModule
-{
-
- private String securityService = null;
-
- private JBossLoginModule delegee = null;
-
- /**
- * Helper for delaying the creation of the JBossLoginModule. We cannot access the security service MBean before
- * <code>initialize</code> has been called, but need the user manager in the constructor of JBossLoginModule. The
- * constructor that takes the user manager as argument is protected (and right so), so we need this helper.
- */
- private class LoginModuleDelegee extends JBossLoginModule
- {
- public LoginModuleDelegee(UserManager userManager)
- {
- super(userManager);
- }
- }
-
- /**
- * Create a new login module. The module looks up the JetspeedSecurityService MBean and uses it to actually perform
- * authentication and role lookup.
- * <P>
- * Note that the MBean must be available when this login module is instantiated. Therefore, if the MBean (the SAR)
- * is deployed after JBoss has been started, this login module must be created lazily by using the JBoss login
- * module proxy in login-config.xml.
- *
- * <pre>
- * <application-policy name = "sample">
- * <authentication>
- * <login-module code = "org.jboss.security.auth.spi.ProxyLoginModule"
- * flag = "required">
- * <module-option name = "moduleName">
- * org.apache.jetspeed.appservers.security.jboss.LoginModule
- * </module-option>
- * <!-- The name of the security service MBean. Must match
- * the name in jboss-service.xml -->
- * <module-option name = "securityService">
- * org.apache.jetspeed:service=JetspeedSecurityService
- * </module-option>
- * </login-module>
- * </authentication>
- * </application-policy>
- * </pre>
- */
- public LoginModule()
- {
- }
-
- private UserManager getUserManager()
- {
- try
- {
- MBeanServer server = (MBeanServer) MBeanServerFactory.findMBeanServer(null).get(0);
- ObjectName serviceName = new ObjectName(securityService);
- return (UserManager) server.invoke(serviceName, "getUserManager", null, null);
- }
- catch (MalformedObjectNameException e)
- {
- throw (IllegalStateException) ((new IllegalStateException(e.getMessage())).initCause(e));
- }
- catch (InstanceNotFoundException e)
- {
- throw (IllegalStateException) ((new IllegalStateException(e.getMessage())).initCause(e));
- }
- catch (ReflectionException e)
- {
- throw (IllegalStateException) ((new IllegalStateException(e.getMessage())).initCause(e));
- }
- catch (MBeanException e)
- {
- throw (IllegalStateException) ((new IllegalStateException(e.getMessage())).initCause(e));
- }
- }
-
- /**
- * @see javax.security.auth.spi.LoginModule#initialize()
- */
- public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options)
- {
- securityService = (String) options.get("securityService");
- delegee = new LoginModuleDelegee(getUserManager());
- delegee.initialize(subject, callbackHandler, sharedState, options);
-
- }
-
- /**
- * @see javax.security.auth.spi.LoginModule#abort()
- */
- public boolean abort() throws LoginException
- {
- return delegee.abort();
- }
-
- /**
- * @see javax.security.auth.spi.LoginModule#commit()
- */
- public boolean commit() throws LoginException
- {
- return delegee.commit();
- }
-
- /**
- * @see javax.security.auth.spi.LoginModule#login()
- */
- public boolean login() throws LoginException
- {
- return delegee.login();
- }
-
- /**
- * @see javax.security.auth.spi.LoginModule#logout()
- */
- public boolean logout() throws LoginException
- {
- return delegee.logout();
- }
-}
+/* Copyright 2004 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.appservers.security.jboss;
+
+import java.util.Map;
+
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanException;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.management.ReflectionException;
+import javax.security.auth.Subject;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.login.LoginException;
+
+import org.apache.jetspeed.security.UserManager;
+import org.apache.jetspeed.security.impl.ext.JBossLoginModule;
+
+/**
+ * A login module that uses the JetspeedSecurityService MBean for authentication and role assignment.
+ */
+public class LoginModule implements javax.security.auth.spi.LoginModule
+{
+
+ private String securityService = null;
+
+ private JBossLoginModule delegee = null;
+
+ /**
+ * Helper for delaying the creation of the JBossLoginModule. We cannot access the security service MBean before
+ * <code>initialize</code> has been called, but need the user manager in the constructor of JBossLoginModule. The
+ * constructor that takes the user manager as argument is protected (and right so), so we need this helper.
+ */
+ private class LoginModuleDelegee extends JBossLoginModule
+ {
+ public LoginModuleDelegee(UserManager userManager)
+ {
+ super(userManager);
+ }
+ }
+
+ /**
+ * Create a new login module. The module looks up the JetspeedSecurityService MBean and uses it to actually perform
+ * authentication and role lookup.
+ * <P>
+ * Note that the MBean must be available when this login module is instantiated. Therefore, if the MBean (the SAR)
+ * is deployed after JBoss has been started, this login module must be created lazily by using the JBoss login
+ * module proxy in login-config.xml.
+ *
+ * <pre>
+ * <application-policy name = "sample">
+ * <authentication>
+ * <login-module code = "org.jboss.security.auth.spi.ProxyLoginModule"
+ * flag = "required">
+ * <module-option name = "moduleName">
+ * org.apache.jetspeed.appservers.security.jboss.LoginModule
+ * </module-option>
+ * <!-- The name of the security service MBean. Must match
+ * the name in jboss-service.xml -->
+ * <module-option name = "securityService">
+ * org.apache.jetspeed:service=JetspeedSecurityService
+ * </module-option>
+ * </login-module>
+ * </authentication>
+ * </application-policy>
+ * </pre>
+ */
+ public LoginModule()
+ {
+ }
+
+ private UserManager getUserManager()
+ {
+ try
+ {
+ MBeanServer server = (MBeanServer) MBeanServerFactory.findMBeanServer(null).get(0);
+ ObjectName serviceName = new ObjectName(securityService);
+ return (UserManager) server.invoke(serviceName, "getUserManager", null, null);
+ }
+ catch (MalformedObjectNameException e)
+ {
+ throw (IllegalStateException) ((new IllegalStateException(e.getMessage())).initCause(e));
+ }
+ catch (InstanceNotFoundException e)
+ {
+ throw (IllegalStateException) ((new IllegalStateException(e.getMessage())).initCause(e));
+ }
+ catch (ReflectionException e)
+ {
+ throw (IllegalStateException) ((new IllegalStateException(e.getMessage())).initCause(e));
+ }
+ catch (MBeanException e)
+ {
+ throw (IllegalStateException) ((new IllegalStateException(e.getMessage())).initCause(e));
+ }
+ }
+
+ /**
+ * @see javax.security.auth.spi.LoginModule#initialize()
+ */
+ public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options)
+ {
+ securityService = (String) options.get("securityService");
+ delegee = new LoginModuleDelegee(getUserManager());
+ delegee.initialize(subject, callbackHandler, sharedState, options);
+
+ }
+
+ /**
+ * @see javax.security.auth.spi.LoginModule#abort()
+ */
+ public boolean abort() throws LoginException
+ {
+ return delegee.abort();
+ }
+
+ /**
+ * @see javax.security.auth.spi.LoginModule#commit()
+ */
+ public boolean commit() throws LoginException
+ {
+ return delegee.commit();
+ }
+
+ /**
+ * @see javax.security.auth.spi.LoginModule#login()
+ */
+ public boolean login() throws LoginException
+ {
+ return delegee.login();
+ }
+
+ /**
+ * @see javax.security.auth.spi.LoginModule#logout()
+ */
+ public boolean logout() throws LoginException
+ {
+ return delegee.logout();
+ }
+}
Propchange: portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/java/org/apache/jetspeed/demo/customerInfo/resources/CustomerDetailResources_es.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/java/org/apache/jetspeed/demo/customerInfo/resources/CustomerInfoResources_es.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/java/org/apache/jetspeed/demo/customerInfo/resources/CustomerListResources_es.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/java/org/apache/jetspeed/demo/preferences/resources/PreferenceResources_es.properties
------------------------------------------------------------------------------
svn:eol-style = native
Modified: portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/java/org/apache/jetspeed/demo/security/resources/RoleResources_es.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/java/org/apache/jetspeed/demo/security/resources/RoleResources_es.properties?rev=264121&r1=264120&r2=264121&view=diff
==============================================================================
--- portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/java/org/apache/jetspeed/demo/security/resources/RoleResources_es.properties (original)
+++ portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/java/org/apache/jetspeed/demo/security/resources/RoleResources_es.properties Mon Aug 29 05:04:38 2005
@@ -17,7 +17,7 @@
# Jetspeed Development Team
# portlet info
-javax.portlet.title=Prueba de Securidad usando Roles
+javax.portlet.title=Prueba de Seguridad usando Roles
javax.portlet.short-title=Seguridad de Roles
# roles.jsp
Propchange: portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/java/org/apache/jetspeed/demo/security/resources/RoleResources_es.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/java/org/apache/jetspeed/demo/simple/resources/AttributeScopeResources_es.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/java/org/apache/jetspeed/demo/simple/resources/DisplayRequestResources_es.properties
------------------------------------------------------------------------------
svn:eol-style = native
Modified: portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/java/org/apache/jetspeed/demo/simple/resources/PickANumberResources_es.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/java/org/apache/jetspeed/demo/simple/resources/PickANumberResources_es.properties?rev=264121&r1=264120&r2=264121&view=diff
==============================================================================
--- portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/java/org/apache/jetspeed/demo/simple/resources/PickANumberResources_es.properties (original)
+++ portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/java/org/apache/jetspeed/demo/simple/resources/PickANumberResources_es.properties Mon Aug 29 05:04:38 2005
@@ -16,6 +16,9 @@
# LOCALIZATION MAINTAINER:
# Jetspeed Development Team
+# portlet info
+javax.portlet.title=Acierte un n\u00famero
+
# PickANumber.jsp
pickanumber.label.pickanumberguess=Juego de 'Acertar un n\u00famero'
pickanumber.label.guessthusfar=Ha hecho {0} intentos hasta ahora.
Propchange: portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/java/org/apache/jetspeed/demo/simple/resources/PickANumberResources_es.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/java/org/apache/jetspeed/demo/userinfo/resources/UserInfoResources_es.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/java/org/apache/portals/applications/desktop/resources/Bookmark_es.properties
------------------------------------------------------------------------------
svn:eol-style = native
Modified: portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/webapp/WEB-INF/demo/css/css.jsp
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/webapp/WEB-INF/demo/css/css.jsp?rev=264121&r1=264120&r2=264121&view=diff
==============================================================================
--- portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/webapp/WEB-INF/demo/css/css.jsp (original)
+++ portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/webapp/WEB-INF/demo/css/css.jsp Mon Aug 29 05:04:38 2005
@@ -119,24 +119,24 @@
<th class="portlet-section-header"><fmt:message key="css.label.Description"/></th>
</tr>
<tr>
- <td class="portlet-section-body"><input type="checkbox"/></th>
- <td class="portlet-section-body"><fmt:message key="css.label.portlet-msg-status"/></th>
- <td class="portlet-section-body"><fmt:message key="css.label.StatusOfTheCurrentOperation"/></th>
+ <th class="portlet-section-body"><input type="checkbox"/></th>
+ <th class="portlet-section-body"><fmt:message key="css.label.portlet-msg-status"/></th>
+ <th class="portlet-section-body"><fmt:message key="css.label.StatusOfTheCurrentOperation"/></th>
</tr>
<tr>
- <td class="portlet-section-alternate"><input type="checkbox"/></th>
- <td class="portlet-section-alternate"><fmt:message key="css.label.portlet-msg-info"/></th>
- <td class="portlet-section-alternate"><fmt:message key="css.label.HelpMessagesGeneralAdditionalInformationEtc"/></th>
+ <th class="portlet-section-alternate"><input type="checkbox"/></th>
+ <th class="portlet-section-alternate"><fmt:message key="css.label.portlet-msg-info"/></th>
+ <th class="portlet-section-alternate"><fmt:message key="css.label.HelpMessagesGeneralAdditionalInformationEtc"/></th>
</tr>
<tr>
- <td class="portlet-section-body"><input type="checkbox"/></th>
- <td class="portlet-section-body"><fmt:message key="css.label.portlet-msg-error"/></th>
- <td class="portlet-section-body"><fmt:message key="css.label.ErrorMessages"/></th>
+ <th class="portlet-section-body"><input type="checkbox"/></th>
+ <th class="portlet-section-body"><fmt:message key="css.label.portlet-msg-error"/></th>
+ <th class="portlet-section-body"><fmt:message key="css.label.ErrorMessages"/></th>
</tr>
<tr>
- <td class="portlet-section-alternate"><input type="checkbox"/></th>
- <td class="portlet-section-alternate"><fmt:message key="css.label.portlet-msg-alert"/></th>
- <td class="portlet-section-alternate"><fmt:message key="css.label.WarningMessages"/></th>
+ <th class="portlet-section-alternate"><input type="checkbox"/></th>
+ <th class="portlet-section-alternate"><fmt:message key="css.label.portlet-msg-alert"/></th>
+ <th class="portlet-section-alternate"><fmt:message key="css.label.WarningMessages"/></th>
</tr>
</table>
<div class="portlet-section-footer">
Modified: portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/webapp/WEB-INF/demo/security/roles.jsp
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/webapp/WEB-INF/demo/security/roles.jsp?rev=264121&r1=264120&r2=264121&view=diff
==============================================================================
Binary files - no diff available.
Modified: portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/webapp/WEB-INF/demo/userinfo/userinfo.jsp
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/webapp/WEB-INF/demo/userinfo/userinfo.jsp?rev=264121&r1=264120&r2=264121&view=diff
==============================================================================
--- portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/webapp/WEB-INF/demo/userinfo/userinfo.jsp (original)
+++ portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/webapp/WEB-INF/demo/userinfo/userinfo.jsp Mon Aug 29 05:04:38 2005
@@ -31,8 +31,8 @@
</c:when>
<c:otherwise>
- <b><fmt:message key="userinfo.label.UserAttributeForUser"/></b> <c:out value='${renderRequest.userPrincipal.name}'/><br>
- <br>
+ <b><fmt:message key="userinfo.label.UserAttributeForUser"/></b> <c:out value='${renderRequest.userPrincipal.name}'/><br />
+ <br />
<table border="1">
<tr>
@@ -52,7 +52,7 @@
</table>
- <br>
+ <br />
<table border="1">
<tr>
@@ -75,5 +75,5 @@
</c:otherwise>
</c:choose>
-<br>
+<br />
<fmt:message key="userinfo.label.ForHelpOnUserAttributesConfigurationSelectTheHelpIcon"/>
Modified: portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/webapp/WEB-INF/portlet.xml?rev=264121&r1=264120&r2=264121&view=diff
==============================================================================
--- portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/webapp/WEB-INF/portlet.xml (original)
+++ portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/webapp/WEB-INF/portlet.xml Mon Aug 29 05:04:38 2005
@@ -69,6 +69,7 @@
</supports>
<supported-locale>en</supported-locale>
<supported-locale>de</supported-locale>
+ <supported-locale>ja</supported-locale>
<resource-bundle>org.apache.portals.applications.desktop.resources.Bookmark</resource-bundle>
<portlet-preferences>
<preference>
@@ -86,6 +87,50 @@
</portlet-preferences>
</portlet>
+ <portlet>
+ <description>Bookmark Portlet for XHTML Basic</description>
+ <portlet-name>BookmarkPortletForXHTMLBasic</portlet-name>
+ <display-name>Bookmark Portlet for XHTML Basic</display-name>
+ <portlet-class>org.apache.portals.applications.desktop.BookmarkPortlet</portlet-class>
+ <init-param>
+ <name>ViewPage</name>
+ <value>/WEB-INF/view/bookmark-view-xhtmlbasic.jsp</value>
+ </init-param>
+ <init-param>
+ <name>EditPage</name>
+ <value>/WEB-INF/view/bookmark-edit-xhtmlbasic.jsp</value>
+ </init-param>
+ <init-param>
+ <name>HelpPage</name>
+ <value>/WEB-INF/view/bookmark-help-xhtmlbasic.jsp</value>
+ </init-param>
+ <expiration-cache>0</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>EDIT</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <supported-locale>de</supported-locale>
+ <supported-locale>ja</supported-locale>
+ <resource-bundle>org.apache.portals.applications.desktop.resources.Bookmark</resource-bundle>
+ <portlet-preferences>
+ <preference>
+ <name>Jetspeed-2 Site</name>
+ <value>http://portals.apache.org/jetspeed-2/</value>
+ </preference>
+ <preference>
+ <name>Bluesunrise Site</name>
+ <value>http://www.bluesunrise.com/</value>
+ </preference>
+ <preference>
+ <name>Apache Home</name>
+ <value>http://www.apache.org/</value>
+ </preference>
+ </portlet-preferences>
+ </portlet>
+
<portlet id="PreferencePortlet">
<portlet-name>PreferencePortlet</portlet-name>
<display-name>PreferencePortlet</display-name>
@@ -372,24 +417,27 @@
<name>HelpPage</name>
<value>/WEB-INF/view/iframe-help.html</value>
</init-param>
-
- <portlet-class>org.apache.jetspeed.portlet.IFrameGenericPortlet</portlet-class>
- <expiration-cache>-1</expiration-cache>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>EDIT</portlet-mode>
- <portlet-mode>VIEW</portlet-mode>
- <portlet-mode>HELP</portlet-mode>
- </supports>
- <portlet-preferences>
- <preference>
- <name>SRC</name>
+ <portlet-class>org.apache.jetspeed.portlet.IFrameGenericPortlet</portlet-class>
+ <expiration-cache>-1</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>EDIT</portlet-mode>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ </supports>
+ <portlet-preferences>
+ <preference>
+ <name>SRC</name>
<value>http://portals.apache.org</value>
- </preference>
- <preference>
+ </preference>
+<!-- Don't specify a HEIGHT if you want a normal filled out layout
+ because percentage values result in the content not to be displayed on IE6.
+ Specific values are ok though.
+ <preference>
<name>HEIGHT</name>
- <value>100%</value>
+ <value>300</value>
</preference>
+-->
<preference>
<name>WIDTH</name>
<value>100%</value>
@@ -400,7 +448,11 @@
</preference>
<preference>
<name>MAX-WIDTH</name>
- <value>100%</value>
+ <value>100%</value>
+ </preference>
+ <preference>
+ <name>SCROLLING</name>
+ <value>AUTO</value>
</preference>
</portlet-preferences>
<supported-locale>en</supported-locale>
Modified: portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/webapp/WEB-INF/view/bookmark-view.jsp
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/webapp/WEB-INF/view/bookmark-view.jsp?rev=264121&r1=264120&r2=264121&view=diff
==============================================================================
--- portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/webapp/WEB-INF/view/bookmark-view.jsp (original)
+++ portals/jetspeed-2/branches/SummersOfCode-2005/applications/demo/src/webapp/WEB-INF/view/bookmark-view.jsp Mon Aug 29 05:04:38 2005
@@ -8,14 +8,14 @@
<%
ResourceBundle myText = portletConfig.getResourceBundle(renderRequest.getLocale());
%>
-<br><B><%=myText.getString("available_bookmarks")%></B><br><br>
+<br /><b><%=myText.getString("available_bookmarks")%></b><br /><br />
<%
PortletPreferences prefs = renderRequest.getPreferences();
Enumeration e = prefs.getNames();
if (!e.hasMoreElements()) // no bookmarks
{
%>
- <%=myText.getString("no_bookmarks")%><BR>
+ <%=myText.getString("no_bookmarks")%><br />
<%
}
while (e.hasMoreElements())
@@ -25,8 +25,8 @@
(name,"<"+
myText.getString("undefined")+">");
%>
- <A target="_blank" HREF=<%=value%>><%=name%></A><BR>
+ <a target="_blank" href="<%=value%>"><%=name%></a><br />
<%
}
%>
-<br>
\ No newline at end of file
+<br />
\ No newline at end of file
Modified: portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources.properties?rev=264121&r1=264120&r2=264121&view=diff
==============================================================================
--- portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources.properties (original)
+++ portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources.properties Mon Aug 29 05:04:38 2005
@@ -17,13 +17,14 @@
# Base Locales
# DO NOT TRANSLATE & DO NOT INCLUDE IN L10N PROPERTIES FILE
-localeselector.locales=de,en,es,fr,it,ja,ko,nl,sv,zh,zh_TW,pt
+localeselector.locales=de,en,es,fr,hu,it,ja,ko,nl,pl,pt,ru,sv,zh,zh_TW
# Label
localeselector.label.language=Language:
localeselector.label.change=Change
# Locale Name
+localeselector.locale.hu=Hungarian
localeselector.locale.de=German
localeselector.locale.en=English
localeselector.locale.es=Spanish
@@ -32,8 +33,9 @@
localeselector.locale.ja=Japanese
localeselector.locale.ko=Korean
localeselector.locale.nl=Dutch
+localeselector.locale.pl=Polish
+localeselector.locale.pt=Portuguese
+localeselector.locale.ru=Russian
localeselector.locale.sv=Swedish
localeselector.locale.zh=Simplified Chinese
localeselector.locale.zh_TW=Traditional Chinese
-localeselector.locale.ru=Russian
-localeselector.locale.pt=Portuguese
Modified: portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_fr.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_fr.properties?rev=264121&r1=264120&r2=264121&view=diff
==============================================================================
--- portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_fr.properties (original)
+++ portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_fr.properties Mon Aug 29 05:04:38 2005
@@ -20,6 +20,7 @@
localeselector.label.change=Change
# Locale Name
+localeselector.locale.hu=Hungarian
localeselector.locale.de=Allemand
localeselector.locale.en=Anglais
localeselector.locale.es=Espanol
Modified: portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_it.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_it.properties?rev=264121&r1=264120&r2=264121&view=diff
==============================================================================
--- portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_it.properties (original)
+++ portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_it.properties Mon Aug 29 05:04:38 2005
@@ -25,6 +25,7 @@
localeselector.label.change=cambia
# Locale Name
+localeselector.locale.hu=Hungarian
localeselector.locale.de=Tedesco
localeselector.locale.en=Inglese
localeselector.locale.es=Spagnolo
Modified: portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_ja.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_ja.properties?rev=264121&r1=264120&r2=264121&view=diff
==============================================================================
--- portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_ja.properties (original)
+++ portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_ja.properties Mon Aug 29 05:04:38 2005
@@ -27,6 +27,7 @@
localeselector.label.change=\u5909\u66F4
# Locale Name
+localeselector.locale.hu=Hungarian
localeselector.locale.de=\u30C9\u30A4\u30C4\u8A9E
localeselector.locale.en=\u82F1\u8A9E
localeselector.locale.es=\u30B9\u30DA\u30A4\u30F3\u8A9E
Modified: portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_ko.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_ko.properties?rev=264121&r1=264120&r2=264121&view=diff
==============================================================================
--- portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_ko.properties (original)
+++ portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_ko.properties Mon Aug 29 05:04:38 2005
@@ -1,44 +1,46 @@
-# 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.
-#
-# $Id: LocaleSelectorResources_en.properties,v 1.2 2005/01/10 16:22:37 weaver Exp $
-#
-# LOCALIZATION MAINTAINER:
-# Jetspeed Development Team
-
-# portlet info
-javax.portlet.title=Locale Selector
-javax.portlet.short-title=This is a portlet to select your preferred locale
-javax.portlet.keywords=Locale,Language
-
-# Label
-localeselector.label.language=Language:
-localeselector.label.change=Change
-
-# Locale Name
-localeselector.locale.de=German
-localeselector.locale.en=English
-localeselector.locale.es=Spanish
-localeselector.locale.fr=French
-localeselector.locale.it=Italian
-localeselector.locale.ja=Japanese
-localeselector.locale.ko=Korean
-localeselector.locale.nl=Dutch
-localeselector.locale.sv=Swedish
-localeselector.locale.zh=Simplified Chinese
-localeselector.locale.zh_TW=Traditional Chinese
-localeselector.locale.ru=Russian
-localeselector.locale.pt=Portuguese
-
-
+# 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.
+#
+# $Id: LocaleSelectorResources_en.properties,v 1.2 2005/01/10 16:22:37 weaver Exp $
+#
+# LOCALIZATION MAINTAINER:
+# Jetspeed Development Team
+
+# portlet info
+javax.portlet.title=Locale Selector
+javax.portlet.short-title=This is a portlet to select your preferred locale
+javax.portlet.keywords=Locale,Language
+
+# Label
+localeselector.label.language=Language:
+localeselector.label.change=Change
+
+# Locale Name
+
+localeselector.locale.de=German
+localeselector.locale.en=English
+localeselector.locale.es=Spanish
+localeselector.locale.fr=French
+localeselector.locale.hu=Hungarian
+localeselector.locale.it=Italian
+localeselector.locale.ja=Japanese
+localeselector.locale.ko=Korean
+localeselector.locale.nl=Dutch
+localeselector.locale.pt=Portuguese
+localeselector.locale.ru=Russian
+localeselector.locale.sv=Swedish
+localeselector.locale.zh=Simplified Chinese
+localeselector.locale.zh_TW=Traditional Chinese
+
+
Propchange: portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_ko.properties
------------------------------------------------------------------------------
svn:eol-style = native
Modified: portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_nl.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_nl.properties?rev=264121&r1=264120&r2=264121&view=diff
==============================================================================
--- portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_nl.properties (original)
+++ portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_nl.properties Mon Aug 29 05:04:38 2005
@@ -20,6 +20,7 @@
localeselector.label.change=Wijzigen
# Locale Name
+localeselector.locale.hu=Hungarian
localeselector.locale.de=Duits
localeselector.locale.en=Engels
localeselector.locale.es=Spaans
Modified: portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_pt.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_pt.properties?rev=264121&r1=264120&r2=264121&view=diff
==============================================================================
--- portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_pt.properties (original)
+++ portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_pt.properties Mon Aug 29 05:04:38 2005
@@ -19,25 +19,26 @@
# portlet info
javax.portlet.title=Seletor De Locale
-javax.portlet.short-title=Este é um portlet para selecionar seu locale preferido
-javax.portlet.keywords=Locale, Língua
+javax.portlet.short-title=Este \u00e9 um portlet para selecionar seu locale preferido
+javax.portlet.keywords=Locale, L\u00edngua
# Label
-localeselector.label.language=Língua:
-localeselector.label.change=Mudança
+localeselector.label.language=L\u00edngua:
+localeselector.label.change=Mudan\u00e7a
# Locale Name
-localeselector.locale.de=Alemão
-localeselector.locale.en=Inglês
+localeselector.locale.hu=Hungarian
+localeselector.locale.de=Alem\u00e3o
+localeselector.locale.en=Ingl\u00eas
localeselector.locale.es=Espanhol
-localeselector.locale.fr=Francês
+localeselector.locale.fr=Franc\u00eas
localeselector.locale.it=Italiano
-localeselector.locale.ja=Japonês
+localeselector.locale.ja=Japon\u00eas
localeselector.locale.ko=Korean
-localeselector.locale.nl=Holandês
+localeselector.locale.nl=Holand\u00eas
localeselector.locale.sv=Sueco
-localeselector.locale.zh=Chinês Simplificado
-localeselector.locale.zh_TW=Chinês Tradicional
+localeselector.locale.zh=Chin\u00eas Simplificado
+localeselector.locale.zh_TW=Chin\u00eas Tradicional
localeselector.locale.ru=Russian
localeselector.locale.pt=Portuguese
Modified: portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_zh.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_zh.properties?rev=264121&r1=264120&r2=264121&view=diff
==============================================================================
--- portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_zh.properties (original)
+++ portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_zh.properties Mon Aug 29 05:04:38 2005
@@ -27,6 +27,7 @@
localeselector.label.change=\u66f4\u6539
# Locale Name
+localeselector.locale.hu=Hungarian
localeselector.locale.de=\u5fb7\u8bed
localeselector.locale.en=\u82f1\u8bed
localeselector.locale.es=\u897f\u73ed\u7259\u8bed
Modified: portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_zh_TW.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_zh_TW.properties?rev=264121&r1=264120&r2=264121&view=diff
==============================================================================
--- portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_zh_TW.properties (original)
+++ portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_zh_TW.properties Mon Aug 29 05:04:38 2005
@@ -1,44 +1,45 @@
-# 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.
-#
-# $Id: LocaleSelectorResources_en.properties,v 1.2 2005/01/10 16:22:37 weaver Exp $
-#
-# LOCALIZATION MAINTAINER:
-# Jetspeed Development Team
-
-# portlet info
-javax.portlet.title=??????
-javax.portlet.short-title=This is a portlet to select your preferred locale
-javax.portlet.keywords=Locale,Language
-
-# Label
-localeselector.label.language=Language:
-localeselector.label.change=Change
-
-# Locale Name
-localeselector.locale.de=German
-localeselector.locale.en=English
-localeselector.locale.es=Spanish
-localeselector.locale.fr=French
-localeselector.locale.it=Italian
-localeselector.locale.ja=Japanese
-localeselector.locale.ko=Korean
-localeselector.locale.nl=Dutch
-localeselector.locale.sv=Swedish
-localeselector.locale.zh=Simplified Chinese
-localeselector.locale.zh_TW=Traditional Chinese
-localeselector.locale.ru=Russian
-localeselector.locale.pt=Portuguese
-
-
+# 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.
+#
+# $Id: LocaleSelectorResources_en.properties,v 1.2 2005/01/10 16:22:37 weaver Exp $
+#
+# LOCALIZATION MAINTAINER:
+# Jetspeed Development Team
+
+# portlet info
+javax.portlet.title=??????
+javax.portlet.short-title=This is a portlet to select your preferred locale
+javax.portlet.keywords=Locale,Language
+
+# Label
+localeselector.label.language=Language:
+localeselector.label.change=Change
+
+# Locale Name
+localeselector.locale.de=German
+localeselector.locale.en=English
+localeselector.locale.es=Spanish
+localeselector.locale.fr=French
+localeselector.locale.hu=Hungarian
+localeselector.locale.it=Italian
+localeselector.locale.ja=Japanese
+localeselector.locale.ko=Korean
+localeselector.locale.nl=Dutch
+localeselector.locale.pt=Portuguese
+localeselector.locale.ru=Russian
+localeselector.locale.sv=Swedish
+localeselector.locale.zh=Simplified Chinese
+localeselector.locale.zh_TW=Traditional Chinese
+
+
Propchange: portals/jetspeed-2/branches/SummersOfCode-2005/applications/pam/src/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources_zh_TW.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/jetspeed-2/branches/SummersOfCode-2005/applications/rss/src/java/org/apache/portals/applications/rss/resources/RssResources_es.properties
------------------------------------------------------------------------------
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