JBoss Portal SVN: r9048 - in modules/common/trunk/common/src: test/java/org/jboss/portal/test/common and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-11-20 15:45:50 -0500 (Tue, 20 Nov 2007)
New Revision: 9048
Added:
modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/P3PConstantsTestCase.java
Modified:
modules/common/trunk/common/src/main/java/org/jboss/portal/common/p3p/P3PConstants.java
Log:
- Revert constants so that only public ones are exposed but added methods to retrieve keys instead.
Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common/p3p/P3PConstants.java
===================================================================
--- modules/common/trunk/common/src/main/java/org/jboss/portal/common/p3p/P3PConstants.java 2007-11-20 18:25:24 UTC (rev 9047)
+++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/p3p/P3PConstants.java 2007-11-20 20:45:50 UTC (rev 9048)
@@ -29,34 +29,116 @@
*/
public final class P3PConstants
{
+ public enum TelecomType
+ {
+ TELEPHONE(TELECOM_TELEPHONE),
+ FAX(TELECOM_FAX),
+ MOBILE(TELECOM_MOBILE),
+ PAGER(TELECOM_PAGER);
+ private final String prefix;
+
+ TelecomType(String prefix)
+ {
+ this.prefix = prefix;
+ }
+
+ public String getPrefix()
+ {
+ return prefix;
+ }
+ }
+
+ public enum TelecomInfo
+ {
+ INTCODE(TELECOM_INTCODE),
+ LOCCODE(TELECOM_LOCCODE),
+ NUMBER(TELECOM_NUMBER),
+ EXT(TELECOM_EXT),
+ COMMENT(TELECOM_COMMENT);
+
+ private final String name;
+
+ TelecomInfo(String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+ }
+
+ public enum PostalInfo
+ {
+ NAME(POSTAL_NAME),
+ STREET(POSTAL_STREET),
+ CITY(POSTAL_CITY),
+ STATEPROV(POSTAL_STATEPROV),
+ POSTALCODE(POSTAL_POSTALCODE),
+ COUNTRY(POSTAL_COUNTRY),
+ ORGANIZATION(POSTAL_ORGANIZATION);
+
+ private final String name;
+
+ PostalInfo(String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+ }
+
+ public enum OnlineInfo
+ {
+ EMAIL(ONLINE_EMAIL),
+ URI(ONLINE_URI);
+
+ private final String name;
+
+ OnlineInfo(String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+ }
+
+
// Postal
- public static final String POSTAL_NAME = "postal.name";
- public static final String POSTAL_STREET = "postal.street";
- public static final String POSTAL_CITY = "postal.city";
- public static final String POSTAL_STATEPROV = "postal.stateprov";
- public static final String POSTAL_POSTALCODE = "postal.postalcode";
- public static final String POSTAL_COUNTRY = "postal.country";
- public static final String POSTAL_ORGANIZATION = "postal.organization";
+ private static final String POSTAL_NAME = "postal.name";
+ private static final String POSTAL_STREET = "postal.street";
+ private static final String POSTAL_CITY = "postal.city";
+ private static final String POSTAL_STATEPROV = "postal.stateprov";
+ private static final String POSTAL_POSTALCODE = "postal.postalcode";
+ private static final String POSTAL_COUNTRY = "postal.country";
+ private static final String POSTAL_ORGANIZATION = "postal.organization";
// Telecom
- public static final String TELECOM_TELEPHONE = "telecom.telephone.";
- public static final String TELECOM_FAX = "telecom.fax.";
- public static final String TELECOM_MOBILE = "telecom.mobile.";
- public static final String TELECOM_PAGER = "telecom.pager.";
- public static final String INTCODE = "intcode";
- public static final String LOCCODE = "loccode";
- public static final String NUMBER = "number";
- public static final String EXT = "ext";
- public static final String COMMENT = "comment";
+ private static final String TELECOM_TELEPHONE = "telecom.telephone.";
+ private static final String TELECOM_FAX = "telecom.fax.";
+ private static final String TELECOM_MOBILE = "telecom.mobile.";
+ private static final String TELECOM_PAGER = "telecom.pager.";
+ private static final String TELECOM_INTCODE = "intcode";
+ private static final String TELECOM_LOCCODE = "loccode";
+ private static final String TELECOM_NUMBER = "number";
+ private static final String TELECOM_EXT = "ext";
+ private static final String TELECOM_COMMENT = "comment";
// Online
- public static final String ONLINE_URI = "online.uri";
- public static final String ONLINE_EMAIL = "online.email";
+ private static final String ONLINE_URI = "online.uri";
+ private static final String ONLINE_EMAIL = "online.email";
/*
- * User information attribute names (PLT.D in the portlet spec) that are defined in P3P spec.
- */
+ * User information attribute names (PLT.D in the portlet spec) that are defined in P3P spec.
+ */
//
public static final String INFO_USER_BDATE = "user.bdate";
@@ -72,7 +154,7 @@
public static final String INFO_USER_NAME_NICKNAME = "user.name.nickName";
// User home
- public static final String INFO_USER_HOME_PREFIX = "user.home-info.";
+ private static final String INFO_USER_HOME_PREFIX = "user.home-info.";
public static final String INFO_USER_HOME_INFO_POSTAL_NAME = INFO_USER_HOME_PREFIX + POSTAL_NAME;
public static final String INFO_USER_HOME_INFO_POSTAL_STREET = INFO_USER_HOME_PREFIX + POSTAL_STREET;
public static final String INFO_USER_HOME_INFO_POSTAL_CITY = INFO_USER_HOME_PREFIX + POSTAL_CITY;
@@ -80,31 +162,31 @@
public static final String INFO_USER_HOME_INFO_POSTAL_POSTALCODE = INFO_USER_HOME_PREFIX + POSTAL_POSTALCODE;
public static final String INFO_USER_HOME_INFO_POSTAL_COUNTRY = INFO_USER_HOME_PREFIX + POSTAL_COUNTRY;
public static final String INFO_USER_HOME_INFO_POSTAL_ORGANIZATION = INFO_USER_HOME_PREFIX + POSTAL_ORGANIZATION;
- public static final String INFO_USER_HOME_INFO_TELECOM_TELEPHONE_INTCODE = INFO_USER_HOME_PREFIX + TELECOM_TELEPHONE + INTCODE;
- public static final String INFO_USER_HOME_INFO_TELECOM_TELEPHONE_LOCCODE = INFO_USER_HOME_PREFIX + TELECOM_TELEPHONE + LOCCODE;
- public static final String INFO_USER_HOME_INFO_TELECOM_TELEPHONE_NUMBER = INFO_USER_HOME_PREFIX + TELECOM_TELEPHONE + NUMBER;
- public static final String INFO_USER_HOME_INFO_TELECOM_TELEPHONE_EXT = INFO_USER_HOME_PREFIX + TELECOM_TELEPHONE + EXT;
- public static final String INFO_USER_HOME_INFO_TELECOM_TELEPHONE_COMMENT = INFO_USER_HOME_PREFIX + TELECOM_TELEPHONE + COMMENT;
- public static final String INFO_USER_HOME_INFO_TELECOM_FAX_INTCODE = INFO_USER_HOME_PREFIX + TELECOM_FAX + INTCODE;
- public static final String INFO_USER_HOME_INFO_TELECOM_FAX_LOCCODE = INFO_USER_HOME_PREFIX + TELECOM_FAX + LOCCODE;
- public static final String INFO_USER_HOME_INFO_TELECOM_FAX_NUMBER = INFO_USER_HOME_PREFIX + TELECOM_FAX + NUMBER;
- public static final String INFO_USER_HOME_INFO_TELECOM_FAX_EXT = INFO_USER_HOME_PREFIX + TELECOM_FAX + EXT;
- public static final String INFO_USER_HOME_INFO_TELECOM_FAX_COMMENT = INFO_USER_HOME_PREFIX + TELECOM_FAX + COMMENT;
- public static final String INFO_USER_HOME_INFO_TELECOM_MOBILE_INTCODE = INFO_USER_HOME_PREFIX + TELECOM_MOBILE + INTCODE;
- public static final String INFO_USER_HOME_INFO_TELECOM_MOBILE_LOCCODE = INFO_USER_HOME_PREFIX + TELECOM_MOBILE + LOCCODE;
- public static final String INFO_USER_HOME_INFO_TELECOM_MOBILE_NUMBER = INFO_USER_HOME_PREFIX + TELECOM_MOBILE + NUMBER;
- public static final String INFO_USER_HOME_INFO_TELECOM_MOBILE_EXT = INFO_USER_HOME_PREFIX + TELECOM_MOBILE + EXT;
- public static final String INFO_USER_HOME_INFO_TELECOM_MOBILE_COMMENT = INFO_USER_HOME_PREFIX + TELECOM_MOBILE + COMMENT;
- public static final String INFO_USER_HOME_INFO_TELECOM_PAGER_INTCODE = INFO_USER_HOME_PREFIX + TELECOM_PAGER + INTCODE;
- public static final String INFO_USER_HOME_INFO_TELECOM_PAGER_LOCCODE = INFO_USER_HOME_PREFIX + TELECOM_PAGER + LOCCODE;
- public static final String INFO_USER_HOME_INFO_TELECOM_PAGER_NUMBER = INFO_USER_HOME_PREFIX + TELECOM_PAGER + NUMBER;
- public static final String INFO_USER_HOME_INFO_TELECOM_PAGER_EXT = INFO_USER_HOME_PREFIX + TELECOM_PAGER + EXT;
- public static final String INFO_USER_HOME_INFO_TELECOM_PAGER_COMMENT = INFO_USER_HOME_PREFIX + TELECOM_PAGER + COMMENT;
+ public static final String INFO_USER_HOME_INFO_TELECOM_TELEPHONE_INTCODE = INFO_USER_HOME_PREFIX + TELECOM_TELEPHONE + TELECOM_INTCODE;
+ public static final String INFO_USER_HOME_INFO_TELECOM_TELEPHONE_LOCCODE = INFO_USER_HOME_PREFIX + TELECOM_TELEPHONE + TELECOM_LOCCODE;
+ public static final String INFO_USER_HOME_INFO_TELECOM_TELEPHONE_NUMBER = INFO_USER_HOME_PREFIX + TELECOM_TELEPHONE + TELECOM_NUMBER;
+ public static final String INFO_USER_HOME_INFO_TELECOM_TELEPHONE_EXT = INFO_USER_HOME_PREFIX + TELECOM_TELEPHONE + TELECOM_EXT;
+ public static final String INFO_USER_HOME_INFO_TELECOM_TELEPHONE_COMMENT = INFO_USER_HOME_PREFIX + TELECOM_TELEPHONE + TELECOM_COMMENT;
+ public static final String INFO_USER_HOME_INFO_TELECOM_FAX_INTCODE = INFO_USER_HOME_PREFIX + TELECOM_FAX + TELECOM_INTCODE;
+ public static final String INFO_USER_HOME_INFO_TELECOM_FAX_LOCCODE = INFO_USER_HOME_PREFIX + TELECOM_FAX + TELECOM_LOCCODE;
+ public static final String INFO_USER_HOME_INFO_TELECOM_FAX_NUMBER = INFO_USER_HOME_PREFIX + TELECOM_FAX + TELECOM_NUMBER;
+ public static final String INFO_USER_HOME_INFO_TELECOM_FAX_EXT = INFO_USER_HOME_PREFIX + TELECOM_FAX + TELECOM_EXT;
+ public static final String INFO_USER_HOME_INFO_TELECOM_FAX_COMMENT = INFO_USER_HOME_PREFIX + TELECOM_FAX + TELECOM_COMMENT;
+ public static final String INFO_USER_HOME_INFO_TELECOM_MOBILE_INTCODE = INFO_USER_HOME_PREFIX + TELECOM_MOBILE + TELECOM_INTCODE;
+ public static final String INFO_USER_HOME_INFO_TELECOM_MOBILE_LOCCODE = INFO_USER_HOME_PREFIX + TELECOM_MOBILE + TELECOM_LOCCODE;
+ public static final String INFO_USER_HOME_INFO_TELECOM_MOBILE_NUMBER = INFO_USER_HOME_PREFIX + TELECOM_MOBILE + TELECOM_NUMBER;
+ public static final String INFO_USER_HOME_INFO_TELECOM_MOBILE_EXT = INFO_USER_HOME_PREFIX + TELECOM_MOBILE + TELECOM_EXT;
+ public static final String INFO_USER_HOME_INFO_TELECOM_MOBILE_COMMENT = INFO_USER_HOME_PREFIX + TELECOM_MOBILE + TELECOM_COMMENT;
+ public static final String INFO_USER_HOME_INFO_TELECOM_PAGER_INTCODE = INFO_USER_HOME_PREFIX + TELECOM_PAGER + TELECOM_INTCODE;
+ public static final String INFO_USER_HOME_INFO_TELECOM_PAGER_LOCCODE = INFO_USER_HOME_PREFIX + TELECOM_PAGER + TELECOM_LOCCODE;
+ public static final String INFO_USER_HOME_INFO_TELECOM_PAGER_NUMBER = INFO_USER_HOME_PREFIX + TELECOM_PAGER + TELECOM_NUMBER;
+ public static final String INFO_USER_HOME_INFO_TELECOM_PAGER_EXT = INFO_USER_HOME_PREFIX + TELECOM_PAGER + TELECOM_EXT;
+ public static final String INFO_USER_HOME_INFO_TELECOM_PAGER_COMMENT = INFO_USER_HOME_PREFIX + TELECOM_PAGER + TELECOM_COMMENT;
public static final String INFO_USER_HOME_INFO_ONLINE_EMAIL = INFO_USER_HOME_PREFIX + ONLINE_EMAIL;
public static final String INFO_USER_HOME_INFO_ONLINE_URI = INFO_USER_HOME_PREFIX + ONLINE_URI;
// User Business
- public static final String INFO_USER_BUSINESS_PREFIX = "user.business-info.";
+ private static final String INFO_USER_BUSINESS_PREFIX = "user.business-info.";
public static final String INFO_USER_BUSINESS_INFO_POSTAL_NAME = INFO_USER_BUSINESS_PREFIX + POSTAL_NAME;
public static final String INFO_USER_BUSINESS_INFO_POSTAL_STREET = INFO_USER_BUSINESS_PREFIX + POSTAL_STREET;
public static final String INFO_USER_BUSINESS_INFO_POSTAL_CITY = INFO_USER_BUSINESS_PREFIX + POSTAL_CITY;
@@ -112,30 +194,50 @@
public static final String INFO_USER_BUSINESS_INFO_POSTAL_POSTALCODE = INFO_USER_BUSINESS_PREFIX + POSTAL_POSTALCODE;
public static final String INFO_USER_BUSINESS_INFO_POSTAL_COUNTRY = INFO_USER_BUSINESS_PREFIX + POSTAL_COUNTRY;
public static final String INFO_USER_BUSINESS_INFO_POSTAL_ORGANIZATION = INFO_USER_BUSINESS_PREFIX + POSTAL_ORGANIZATION;
- public static final String INFO_USER_BUSINESS_INFO_TELECOM_TELEPHONE_INTCODE = INFO_USER_BUSINESS_PREFIX + TELECOM_TELEPHONE + INTCODE;
- public static final String INFO_USER_BUSINESS_INFO_TELECOM_TELEPHONE_LOCCODE = INFO_USER_BUSINESS_PREFIX + TELECOM_TELEPHONE + LOCCODE;
- public static final String INFO_USER_BUSINESS_INFO_TELECOM_TELEPHONE_NUMBER = INFO_USER_BUSINESS_PREFIX + TELECOM_TELEPHONE + NUMBER;
- public static final String INFO_USER_BUSINESS_INFO_TELECOM_TELEPHONE_EXT = INFO_USER_BUSINESS_PREFIX + TELECOM_TELEPHONE + EXT;
- public static final String INFO_USER_BUSINESS_INFO_TELECOM_TELEPHONE_COMMENT = INFO_USER_BUSINESS_PREFIX + TELECOM_TELEPHONE + COMMENT;
- public static final String INFO_USER_BUSINESS_INFO_TELECOM_FAX_INTCODE = INFO_USER_BUSINESS_PREFIX + TELECOM_FAX + INTCODE;
- public static final String INFO_USER_BUSINESS_INFO_TELECOM_FAX_LOCCODE = INFO_USER_BUSINESS_PREFIX + TELECOM_FAX + LOCCODE;
- public static final String INFO_USER_BUSINESS_INFO_TELECOM_FAX_NUMBER = INFO_USER_BUSINESS_PREFIX + TELECOM_FAX + NUMBER;
- public static final String INFO_USER_BUSINESS_INFO_TELECOM_FAX_EXT = INFO_USER_BUSINESS_PREFIX + TELECOM_FAX + EXT;
- public static final String INFO_USER_BUSINESS_INFO_TELECOM_FAX_COMMENT = INFO_USER_BUSINESS_PREFIX + TELECOM_FAX + COMMENT;
- public static final String INFO_USER_BUSINESS_INFO_TELECOM_MOBILE_INTCODE = INFO_USER_BUSINESS_PREFIX + TELECOM_MOBILE + INTCODE;
- public static final String INFO_USER_BUSINESS_INFO_TELECOM_MOBILE_LOCCODE = INFO_USER_BUSINESS_PREFIX + TELECOM_MOBILE + LOCCODE;
- public static final String INFO_USER_BUSINESS_INFO_TELECOM_MOBILE_NUMBER = INFO_USER_BUSINESS_PREFIX + TELECOM_MOBILE + NUMBER;
- public static final String INFO_USER_BUSINESS_INFO_TELECOM_MOBILE_EXT = INFO_USER_BUSINESS_PREFIX + TELECOM_MOBILE + EXT;
- public static final String INFO_USER_BUSINESS_INFO_TELECOM_MOBILE_COMMENT = INFO_USER_BUSINESS_PREFIX + TELECOM_MOBILE + COMMENT;
- public static final String INFO_USER_BUSINESS_INFO_TELECOM_PAGER_INTCODE = INFO_USER_BUSINESS_PREFIX + TELECOM_PAGER + INTCODE;
- public static final String INFO_USER_BUSINESS_INFO_TELECOM_PAGER_LOCCODE = INFO_USER_BUSINESS_PREFIX + TELECOM_PAGER + LOCCODE;
- public static final String INFO_USER_BUSINESS_INFO_TELECOM_PAGER_NUMBER = INFO_USER_BUSINESS_PREFIX + TELECOM_PAGER + NUMBER;
- public static final String INFO_USER_BUSINESS_INFO_TELECOM_PAGER_EXT = INFO_USER_BUSINESS_PREFIX + TELECOM_PAGER + EXT;
- public static final String INFO_USER_BUSINESS_INFO_TELECOM_PAGER_COMMENT = INFO_USER_BUSINESS_PREFIX + TELECOM_PAGER + COMMENT;
+ public static final String INFO_USER_BUSINESS_INFO_TELECOM_TELEPHONE_INTCODE = INFO_USER_BUSINESS_PREFIX + TELECOM_TELEPHONE + TELECOM_INTCODE;
+ public static final String INFO_USER_BUSINESS_INFO_TELECOM_TELEPHONE_LOCCODE = INFO_USER_BUSINESS_PREFIX + TELECOM_TELEPHONE + TELECOM_LOCCODE;
+ public static final String INFO_USER_BUSINESS_INFO_TELECOM_TELEPHONE_NUMBER = INFO_USER_BUSINESS_PREFIX + TELECOM_TELEPHONE + TELECOM_NUMBER;
+ public static final String INFO_USER_BUSINESS_INFO_TELECOM_TELEPHONE_EXT = INFO_USER_BUSINESS_PREFIX + TELECOM_TELEPHONE + TELECOM_EXT;
+ public static final String INFO_USER_BUSINESS_INFO_TELECOM_TELEPHONE_COMMENT = INFO_USER_BUSINESS_PREFIX + TELECOM_TELEPHONE + TELECOM_COMMENT;
+ public static final String INFO_USER_BUSINESS_INFO_TELECOM_FAX_INTCODE = INFO_USER_BUSINESS_PREFIX + TELECOM_FAX + TELECOM_INTCODE;
+ public static final String INFO_USER_BUSINESS_INFO_TELECOM_FAX_LOCCODE = INFO_USER_BUSINESS_PREFIX + TELECOM_FAX + TELECOM_LOCCODE;
+ public static final String INFO_USER_BUSINESS_INFO_TELECOM_FAX_NUMBER = INFO_USER_BUSINESS_PREFIX + TELECOM_FAX + TELECOM_NUMBER;
+ public static final String INFO_USER_BUSINESS_INFO_TELECOM_FAX_EXT = INFO_USER_BUSINESS_PREFIX + TELECOM_FAX + TELECOM_EXT;
+ public static final String INFO_USER_BUSINESS_INFO_TELECOM_FAX_COMMENT = INFO_USER_BUSINESS_PREFIX + TELECOM_FAX + TELECOM_COMMENT;
+ public static final String INFO_USER_BUSINESS_INFO_TELECOM_MOBILE_INTCODE = INFO_USER_BUSINESS_PREFIX + TELECOM_MOBILE + TELECOM_INTCODE;
+ public static final String INFO_USER_BUSINESS_INFO_TELECOM_MOBILE_LOCCODE = INFO_USER_BUSINESS_PREFIX + TELECOM_MOBILE + TELECOM_LOCCODE;
+ public static final String INFO_USER_BUSINESS_INFO_TELECOM_MOBILE_NUMBER = INFO_USER_BUSINESS_PREFIX + TELECOM_MOBILE + TELECOM_NUMBER;
+ public static final String INFO_USER_BUSINESS_INFO_TELECOM_MOBILE_EXT = INFO_USER_BUSINESS_PREFIX + TELECOM_MOBILE + TELECOM_EXT;
+ public static final String INFO_USER_BUSINESS_INFO_TELECOM_MOBILE_COMMENT = INFO_USER_BUSINESS_PREFIX + TELECOM_MOBILE + TELECOM_COMMENT;
+ public static final String INFO_USER_BUSINESS_INFO_TELECOM_PAGER_INTCODE = INFO_USER_BUSINESS_PREFIX + TELECOM_PAGER + TELECOM_INTCODE;
+ public static final String INFO_USER_BUSINESS_INFO_TELECOM_PAGER_LOCCODE = INFO_USER_BUSINESS_PREFIX + TELECOM_PAGER + TELECOM_LOCCODE;
+ public static final String INFO_USER_BUSINESS_INFO_TELECOM_PAGER_NUMBER = INFO_USER_BUSINESS_PREFIX + TELECOM_PAGER + TELECOM_NUMBER;
+ public static final String INFO_USER_BUSINESS_INFO_TELECOM_PAGER_EXT = INFO_USER_BUSINESS_PREFIX + TELECOM_PAGER + TELECOM_EXT;
+ public static final String INFO_USER_BUSINESS_INFO_TELECOM_PAGER_COMMENT = INFO_USER_BUSINESS_PREFIX + TELECOM_PAGER + TELECOM_COMMENT;
public static final String INFO_USER_BUSINESS_INFO_ONLINE_EMAIL = INFO_USER_BUSINESS_PREFIX + ONLINE_EMAIL;
public static final String INFO_USER_BUSINESS_INFO_ONLINE_URI = INFO_USER_BUSINESS_PREFIX + ONLINE_URI;
private P3PConstants()
{
}
-}
+
+ public static String getHomeOrBusinessPrefix(boolean isBusiness)
+ {
+ return isBusiness ? P3PConstants.INFO_USER_BUSINESS_PREFIX : P3PConstants.INFO_USER_HOME_PREFIX;
+ }
+
+ public static String getPostalUserInfoKey(PostalInfo info, boolean isBusiness)
+ {
+ return getHomeOrBusinessPrefix(isBusiness) + info.getName();
+ }
+
+ public static String getTelecomInfoKey(TelecomType type, TelecomInfo info, boolean isBusiness)
+ {
+ return getHomeOrBusinessPrefix(isBusiness) + type.getPrefix() + info.getName();
+ }
+
+ public static String getOnlineUserInfoKey(OnlineInfo info, boolean isBusiness)
+ {
+ return getHomeOrBusinessPrefix(isBusiness) + info.getName();
+ }
+}
\ No newline at end of file
Added: modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/P3PConstantsTestCase.java
===================================================================
--- modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/P3PConstantsTestCase.java (rev 0)
+++ modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/P3PConstantsTestCase.java 2007-11-20 20:45:50 UTC (rev 9048)
@@ -0,0 +1,121 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.portal.test.common;
+
+import junit.framework.TestCase;
+import static org.jboss.portal.common.p3p.P3PConstants.*;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class P3PConstantsTestCase extends TestCase
+{
+ public void testGetPostalUserInfoKey()
+ {
+ assertEquals(INFO_USER_BUSINESS_INFO_POSTAL_CITY, getPostalUserInfoKey(PostalInfo.CITY, true));
+ assertEquals(INFO_USER_BUSINESS_INFO_POSTAL_COUNTRY, getPostalUserInfoKey(PostalInfo.COUNTRY, true));
+ assertEquals(INFO_USER_BUSINESS_INFO_POSTAL_NAME, getPostalUserInfoKey(PostalInfo.NAME, true));
+ assertEquals(INFO_USER_BUSINESS_INFO_POSTAL_ORGANIZATION, getPostalUserInfoKey(PostalInfo.ORGANIZATION, true));
+ assertEquals(INFO_USER_BUSINESS_INFO_POSTAL_POSTALCODE, getPostalUserInfoKey(PostalInfo.POSTALCODE, true));
+ assertEquals(INFO_USER_BUSINESS_INFO_POSTAL_STATEPROV, getPostalUserInfoKey(PostalInfo.STATEPROV, true));
+ assertEquals(INFO_USER_BUSINESS_INFO_POSTAL_STREET, getPostalUserInfoKey(PostalInfo.STREET, true));
+
+ assertEquals(INFO_USER_HOME_INFO_POSTAL_CITY, getPostalUserInfoKey(PostalInfo.CITY, false));
+ assertEquals(INFO_USER_HOME_INFO_POSTAL_COUNTRY, getPostalUserInfoKey(PostalInfo.COUNTRY, false));
+ assertEquals(INFO_USER_HOME_INFO_POSTAL_NAME, getPostalUserInfoKey(PostalInfo.NAME, false));
+ assertEquals(INFO_USER_HOME_INFO_POSTAL_ORGANIZATION, getPostalUserInfoKey(PostalInfo.ORGANIZATION, false));
+ assertEquals(INFO_USER_HOME_INFO_POSTAL_POSTALCODE, getPostalUserInfoKey(PostalInfo.POSTALCODE, false));
+ assertEquals(INFO_USER_HOME_INFO_POSTAL_STATEPROV, getPostalUserInfoKey(PostalInfo.STATEPROV, false));
+ assertEquals(INFO_USER_HOME_INFO_POSTAL_STREET, getPostalUserInfoKey(PostalInfo.STREET, false));
+ }
+
+ public void testGetOnlineInfoKey()
+ {
+ assertEquals(INFO_USER_BUSINESS_INFO_ONLINE_EMAIL, getOnlineUserInfoKey(OnlineInfo.EMAIL, true));
+ assertEquals(INFO_USER_BUSINESS_INFO_ONLINE_URI, getOnlineUserInfoKey(OnlineInfo.URI, true));
+
+ assertEquals(INFO_USER_HOME_INFO_ONLINE_EMAIL, getOnlineUserInfoKey(OnlineInfo.EMAIL, false));
+ assertEquals(INFO_USER_HOME_INFO_ONLINE_URI, getOnlineUserInfoKey(OnlineInfo.URI, false));
+ }
+
+
+ public void testGetTelecomInfoKey()
+ {
+ // business fax
+ assertEquals(INFO_USER_BUSINESS_INFO_TELECOM_FAX_COMMENT, getTelecomInfoKey(TelecomType.FAX, TelecomInfo.COMMENT, true));
+ assertEquals(INFO_USER_BUSINESS_INFO_TELECOM_FAX_EXT, getTelecomInfoKey(TelecomType.FAX, TelecomInfo.EXT, true));
+ assertEquals(INFO_USER_BUSINESS_INFO_TELECOM_FAX_INTCODE, getTelecomInfoKey(TelecomType.FAX, TelecomInfo.INTCODE, true));
+ assertEquals(INFO_USER_BUSINESS_INFO_TELECOM_FAX_LOCCODE, getTelecomInfoKey(TelecomType.FAX, TelecomInfo.LOCCODE, true));
+ assertEquals(INFO_USER_BUSINESS_INFO_TELECOM_FAX_NUMBER, getTelecomInfoKey(TelecomType.FAX, TelecomInfo.NUMBER, true));
+
+ // home fax
+ assertEquals(INFO_USER_HOME_INFO_TELECOM_FAX_COMMENT, getTelecomInfoKey(TelecomType.FAX, TelecomInfo.COMMENT, false));
+ assertEquals(INFO_USER_HOME_INFO_TELECOM_FAX_EXT, getTelecomInfoKey(TelecomType.FAX, TelecomInfo.EXT, false));
+ assertEquals(INFO_USER_HOME_INFO_TELECOM_FAX_INTCODE, getTelecomInfoKey(TelecomType.FAX, TelecomInfo.INTCODE, false));
+ assertEquals(INFO_USER_HOME_INFO_TELECOM_FAX_LOCCODE, getTelecomInfoKey(TelecomType.FAX, TelecomInfo.LOCCODE, false));
+ assertEquals(INFO_USER_HOME_INFO_TELECOM_FAX_NUMBER, getTelecomInfoKey(TelecomType.FAX, TelecomInfo.NUMBER, false));
+
+ // business mobile
+ assertEquals(INFO_USER_BUSINESS_INFO_TELECOM_MOBILE_COMMENT, getTelecomInfoKey(TelecomType.MOBILE, TelecomInfo.COMMENT, true));
+ assertEquals(INFO_USER_BUSINESS_INFO_TELECOM_MOBILE_EXT, getTelecomInfoKey(TelecomType.MOBILE, TelecomInfo.EXT, true));
+ assertEquals(INFO_USER_BUSINESS_INFO_TELECOM_MOBILE_INTCODE, getTelecomInfoKey(TelecomType.MOBILE, TelecomInfo.INTCODE, true));
+ assertEquals(INFO_USER_BUSINESS_INFO_TELECOM_MOBILE_LOCCODE, getTelecomInfoKey(TelecomType.MOBILE, TelecomInfo.LOCCODE, true));
+ assertEquals(INFO_USER_BUSINESS_INFO_TELECOM_MOBILE_NUMBER, getTelecomInfoKey(TelecomType.MOBILE, TelecomInfo.NUMBER, true));
+
+ // home mobile
+ assertEquals(INFO_USER_HOME_INFO_TELECOM_MOBILE_COMMENT, getTelecomInfoKey(TelecomType.MOBILE, TelecomInfo.COMMENT, false));
+ assertEquals(INFO_USER_HOME_INFO_TELECOM_MOBILE_EXT, getTelecomInfoKey(TelecomType.MOBILE, TelecomInfo.EXT, false));
+ assertEquals(INFO_USER_HOME_INFO_TELECOM_MOBILE_INTCODE, getTelecomInfoKey(TelecomType.MOBILE, TelecomInfo.INTCODE, false));
+ assertEquals(INFO_USER_HOME_INFO_TELECOM_MOBILE_LOCCODE, getTelecomInfoKey(TelecomType.MOBILE, TelecomInfo.LOCCODE, false));
+ assertEquals(INFO_USER_HOME_INFO_TELECOM_MOBILE_NUMBER, getTelecomInfoKey(TelecomType.MOBILE, TelecomInfo.NUMBER, false));
+
+ // business pager
+ assertEquals(INFO_USER_BUSINESS_INFO_TELECOM_PAGER_COMMENT, getTelecomInfoKey(TelecomType.PAGER, TelecomInfo.COMMENT, true));
+ assertEquals(INFO_USER_BUSINESS_INFO_TELECOM_PAGER_EXT, getTelecomInfoKey(TelecomType.PAGER, TelecomInfo.EXT, true));
+ assertEquals(INFO_USER_BUSINESS_INFO_TELECOM_PAGER_INTCODE, getTelecomInfoKey(TelecomType.PAGER, TelecomInfo.INTCODE, true));
+ assertEquals(INFO_USER_BUSINESS_INFO_TELECOM_PAGER_LOCCODE, getTelecomInfoKey(TelecomType.PAGER, TelecomInfo.LOCCODE, true));
+ assertEquals(INFO_USER_BUSINESS_INFO_TELECOM_PAGER_NUMBER, getTelecomInfoKey(TelecomType.PAGER, TelecomInfo.NUMBER, true));
+
+ // home pager
+ assertEquals(INFO_USER_HOME_INFO_TELECOM_PAGER_COMMENT, getTelecomInfoKey(TelecomType.PAGER, TelecomInfo.COMMENT, false));
+ assertEquals(INFO_USER_HOME_INFO_TELECOM_PAGER_EXT, getTelecomInfoKey(TelecomType.PAGER, TelecomInfo.EXT, false));
+ assertEquals(INFO_USER_HOME_INFO_TELECOM_PAGER_INTCODE, getTelecomInfoKey(TelecomType.PAGER, TelecomInfo.INTCODE, false));
+ assertEquals(INFO_USER_HOME_INFO_TELECOM_PAGER_LOCCODE, getTelecomInfoKey(TelecomType.PAGER, TelecomInfo.LOCCODE, false));
+ assertEquals(INFO_USER_HOME_INFO_TELECOM_PAGER_NUMBER, getTelecomInfoKey(TelecomType.PAGER, TelecomInfo.NUMBER, false));
+
+ // business telephone
+ assertEquals(INFO_USER_BUSINESS_INFO_TELECOM_TELEPHONE_COMMENT, getTelecomInfoKey(TelecomType.TELEPHONE, TelecomInfo.COMMENT, true));
+ assertEquals(INFO_USER_BUSINESS_INFO_TELECOM_TELEPHONE_EXT, getTelecomInfoKey(TelecomType.TELEPHONE, TelecomInfo.EXT, true));
+ assertEquals(INFO_USER_BUSINESS_INFO_TELECOM_TELEPHONE_INTCODE, getTelecomInfoKey(TelecomType.TELEPHONE, TelecomInfo.INTCODE, true));
+ assertEquals(INFO_USER_BUSINESS_INFO_TELECOM_TELEPHONE_LOCCODE, getTelecomInfoKey(TelecomType.TELEPHONE, TelecomInfo.LOCCODE, true));
+ assertEquals(INFO_USER_BUSINESS_INFO_TELECOM_TELEPHONE_NUMBER, getTelecomInfoKey(TelecomType.TELEPHONE, TelecomInfo.NUMBER, true));
+
+ // home telephone
+ assertEquals(INFO_USER_HOME_INFO_TELECOM_TELEPHONE_COMMENT, getTelecomInfoKey(TelecomType.TELEPHONE, TelecomInfo.COMMENT, false));
+ assertEquals(INFO_USER_HOME_INFO_TELECOM_TELEPHONE_EXT, getTelecomInfoKey(TelecomType.TELEPHONE, TelecomInfo.EXT, false));
+ assertEquals(INFO_USER_HOME_INFO_TELECOM_TELEPHONE_INTCODE, getTelecomInfoKey(TelecomType.TELEPHONE, TelecomInfo.INTCODE, false));
+ assertEquals(INFO_USER_HOME_INFO_TELECOM_TELEPHONE_LOCCODE, getTelecomInfoKey(TelecomType.TELEPHONE, TelecomInfo.LOCCODE, false));
+ assertEquals(INFO_USER_HOME_INFO_TELECOM_TELEPHONE_NUMBER, getTelecomInfoKey(TelecomType.TELEPHONE, TelecomInfo.NUMBER, false));
+ }
+}
Property changes on: modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/P3PConstantsTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
16 years, 7 months
JBoss Portal SVN: r9047 - in branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core: model/portal/metadata and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-11-20 13:25:24 -0500 (Tue, 20 Nov 2007)
New Revision: 9047
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java
Log:
NPE are bad
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2007-11-20 18:11:57 UTC (rev 9046)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2007-11-20 18:25:24 UTC (rev 9047)
@@ -154,6 +154,10 @@
public void setDisplayName(LocalizedString displayName)
{
+ if (displayName == null)
+ {
+ throw new IllegalArgumentException("No null display name accepted");
+ }
displayNames = new HashMap();
Map map = displayName.getValues();
Iterator it = map.values().iterator();
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java 2007-11-20 18:11:57 UTC (rev 9046)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java 2007-11-20 18:25:24 UTC (rev 9047)
@@ -179,7 +179,10 @@
object.setListener(listener);
// Configure display name
- object.setDisplayName(displayName);
+ if (displayName != null)
+ {
+ object.setDisplayName(displayName);
+ }
// Configure security
SecurityConstraintsMetaData securityConstraints = getSecurityConstraints();
16 years, 7 months
JBoss Portal SVN: r9046 - in branches/presentation/core-presentation: src/main/org/jboss/portal/core/presentation/server and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-11-20 13:11:57 -0500 (Tue, 20 Nov 2007)
New Revision: 9046
Removed:
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationPortalContext.java
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationUserContext.java
Modified:
branches/presentation/core-presentation/build.xml
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/MainProcessor.java
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/content/PresentationContentRendererContext.java
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationRequestContext.java
Log:
make core-presentation compile too
Modified: branches/presentation/core-presentation/build.xml
===================================================================
--- branches/presentation/core-presentation/build.xml 2007-11-20 17:53:53 UTC (rev 9045)
+++ branches/presentation/core-presentation/build.xml 2007-11-20 18:11:57 UTC (rev 9046)
@@ -85,11 +85,20 @@
<property name="jboss-junit-configuration" value=""/>
<property name="junit.formatter.usefile" value="true"/>
+ <property name="jboss.portal-presentation.lib" value="../presentation/output/lib"/>
+ <path id="jboss.portal-presentation.classpath">
+ <fileset dir="{jboss.portal-presentation.lib}" includes="portal-presentation-lib.jar"/>
+ </path>
+
<!-- Configure thirdparty libraries -->
&libraries;
<echo message="${xdoclet.xdoclet.lib}"/>
<echo message="${sun.servlet.lib}"/>
<path id="library.classpath">
+ <path refid="jboss.portal/modules/common.classpath"/>
+ <path refid="jboss.portal/modules/web.classpath"/>
+ <path refid="jboss.portal/modules/portlet.classpath"/>
+ <path refid="jboss.portal/modules/identity.classpath"/>
<path refid="apache.log4j.classpath"/>
<path refid="junit.junit.classpath"/>
<path refid="sun.servlet.classpath"/>
@@ -98,15 +107,9 @@
<!-- Configure modules -->
<call target="configure-modules"/>
<path id="dependentmodule.classpath">
- <path refid="jboss.portal-common.classpath"/>
- <path refid="jboss.portlet-api.classpath"/>
- <path refid="jboss.portal-portlet.classpath"/>
- <path refid="jboss.portal-web.classpath"/>
- <path refid="jboss.portal-identity.classpath"/>
<path refid="jboss.portal-jems.classpath"/>
- <path refid="jboss.portal-test.classpath"/>
<path refid="jboss.portal-server.classpath"/>
- <path refid="jboss.portal-uiserver.classpath"/>
+ <path refid="jboss.portal-presentation.classpath"/>
<path refid="jboss.portal-core.classpath"/>
</path>
@@ -164,9 +167,9 @@
<copy file="${gwt.gwt.root}/lib/gwt-user.jar" todir="${build.resources}/presentation-sar/lib" overwrite="true"/>
<copy file="${build.lib}/portal-core-presentation-lib.jar" todir="${build.resources}/presentation-sar/lib" overwrite="true"/>
- <copy file="${jboss.portal-uiserver.lib}/portal-presentation-lib.jar" todir="${build.resources}/presentation-sar/lib" overwrite="true"/>
+ <copy file="${jboss.portal-presentation.lib}/portal-presentation-lib.jar" todir="${build.resources}/presentation-sar/lib" overwrite="true"/>
<copy todir="${build.resources}/presentation-sar">
- <fileset dir="${jboss.portal-uiserver.lib}" includes="presentation.war"/>
+ <fileset dir="${jboss.portal-presentation.lib}" includes="presentation.war"/>
</copy>
<jar jarfile="${build.lib}/presentation.sar">
<fileset dir="${build.resources}/presentation-sar"/>
Modified: branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/MainProcessor.java
===================================================================
--- branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/MainProcessor.java 2007-11-20 17:53:53 UTC (rev 9045)
+++ branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/MainProcessor.java 2007-11-20 18:11:57 UTC (rev 9046)
@@ -23,46 +23,39 @@
package org.jboss.portal.core.presentation.server;
import org.apache.log4j.Logger;
-
-import org.jboss.portal.server.ServerException;
-
-
-import org.jboss.portal.presentation.client.PresentationContext;
-import org.jboss.portal.presentation.protocol.ViewUIObjectAction;
-import org.jboss.portal.presentation.protocol.ShowUIObjectResponse;
-import org.jboss.portal.presentation.protocol.ServerAction;
-import org.jboss.portal.presentation.protocol.GetActivation;
-import org.jboss.portal.presentation.protocol.LinkActivation;
-import org.jboss.portal.presentation.protocol.ErrorResponse;
-import org.jboss.portal.presentation.protocol.ServerResponse;
-import org.jboss.portal.presentation.server.Processor;
-import org.jboss.portal.presentation.server.ProcessorRequest;
-import org.jboss.portal.presentation.server.ProcessorResponse;
-import org.jboss.portal.presentation.model.UIWindow;
-import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.core.model.CustomizationManager;
+import org.jboss.portal.core.model.instance.Instance;
import org.jboss.portal.core.model.portal.PortalObjectContainer;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.PortalObjectPath;
import org.jboss.portal.core.model.portal.Window;
-import org.jboss.portal.core.model.portal.portlet.WindowContextImpl;
import org.jboss.portal.core.model.portal.navstate.WindowNavigationalState;
-import org.jboss.portal.core.model.instance.Instance;
-import org.jboss.portal.core.model.CustomizationManager;
+import org.jboss.portal.core.model.portal.portlet.WindowContextImpl;
import org.jboss.portal.core.presentation.server.content.portlet.PresentationActionContext;
-import org.jboss.portal.core.presentation.server.content.portlet.PresentationRenderContext;
import org.jboss.portal.core.presentation.server.content.portlet.PresentationRequestContext;
-import org.jboss.portal.core.presentation.server.content.portlet.PresentationPortalContext;
-import org.jboss.portal.core.presentation.server.content.portlet.PresentationUserContext;
import org.jboss.portal.core.presentation.server.content.portlet.PresentationSecurityContext;
-import org.jboss.portal.portlet.impl.PortletRequestDecoder;
+import org.jboss.portal.identity.User;
import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.impl.PortletRequestDecoder;
+import org.jboss.portal.portlet.impl.spi.AbstractPortalContext;
+import org.jboss.portal.portlet.impl.spi.AbstractUserContext;
import org.jboss.portal.portlet.invocation.ActionInvocation;
-import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.invocation.response.RenderResponse;
-import org.jboss.portal.WindowState;
-import org.jboss.portal.Mode;
-import org.jboss.portal.identity.User;
+import org.jboss.portal.presentation.client.PresentationContext;
+import org.jboss.portal.presentation.model.UIWindow;
+import org.jboss.portal.presentation.protocol.ErrorResponse;
+import org.jboss.portal.presentation.protocol.LinkActivation;
+import org.jboss.portal.presentation.protocol.ServerAction;
+import org.jboss.portal.presentation.protocol.ServerResponse;
+import org.jboss.portal.presentation.protocol.ShowUIObjectResponse;
+import org.jboss.portal.presentation.protocol.ViewUIObjectAction;
+import org.jboss.portal.presentation.server.Processor;
+import org.jboss.portal.presentation.server.ProcessorRequest;
+import org.jboss.portal.presentation.server.ProcessorResponse;
+import org.jboss.portal.server.ServerException;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
@@ -201,8 +194,8 @@
ActionInvocation action = new ActionInvocation(actionContext);
action.setRequestContext(new PresentationRequestContext(presentationContext));
action.setWindowContext(new WindowContextImpl(window));
- action.setPortalContext(new PresentationPortalContext());
- action.setUserContext(new PresentationUserContext());
+ action.setPortalContext(new AbstractPortalContext());
+ action.setUserContext(new AbstractUserContext());
action.setSecurityContext(new PresentationSecurityContext());
// We need the user id
Modified: branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/content/PresentationContentRendererContext.java
===================================================================
--- branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/content/PresentationContentRendererContext.java 2007-11-20 17:53:53 UTC (rev 9045)
+++ branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/content/PresentationContentRendererContext.java 2007-11-20 18:11:57 UTC (rev 9046)
@@ -22,22 +22,22 @@
******************************************************************************/
package org.jboss.portal.core.presentation.server.content;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.core.model.portal.content.ContentRendererContext;
-import org.jboss.portal.core.model.portal.Window;
+import org.jboss.portal.core.model.portal.navstate.WindowNavigationalState;
import org.jboss.portal.core.model.portal.portlet.WindowContextImpl;
-import org.jboss.portal.core.model.portal.navstate.WindowNavigationalState;
import org.jboss.portal.core.presentation.server.content.portlet.PresentationRenderContext;
import org.jboss.portal.core.presentation.server.content.portlet.PresentationRequestContext;
-import org.jboss.portal.core.presentation.server.content.portlet.PresentationPortalContext;
-import org.jboss.portal.core.presentation.server.content.portlet.PresentationUserContext;
import org.jboss.portal.core.presentation.server.content.portlet.PresentationSecurityContext;
+import org.jboss.portal.identity.User;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.impl.spi.AbstractPortalContext;
+import org.jboss.portal.portlet.impl.spi.AbstractUserContext;
+import org.jboss.portal.portlet.invocation.RenderInvocation;
+import org.jboss.portal.presentation.client.PresentationContext;
import org.jboss.portal.presentation.model.UIWindow;
-import org.jboss.portal.presentation.client.PresentationContext;
-import org.jboss.portal.Mode;
-import org.jboss.portal.WindowState;
-import org.jboss.portal.portlet.invocation.RenderInvocation;
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.identity.User;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -105,8 +105,8 @@
RenderInvocation invocation = new RenderInvocation(new PresentationRenderContext(uiwindow, navigationalState, presentationContext));
invocation.setRequestContext(new PresentationRequestContext(presentationContext));
invocation.setWindowContext(new WindowContextImpl(window));
- invocation.setPortalContext(new PresentationPortalContext());
- invocation.setUserContext(new PresentationUserContext());
+ invocation.setPortalContext(new AbstractPortalContext());
+ invocation.setUserContext(new AbstractUserContext());
invocation.setSecurityContext(new PresentationSecurityContext());
return invocation;
}
Deleted: branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationPortalContext.java
===================================================================
--- branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationPortalContext.java 2007-11-20 17:53:53 UTC (rev 9045)
+++ branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationPortalContext.java 2007-11-20 18:11:57 UTC (rev 9046)
@@ -1,76 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.core.presentation.server.content.portlet;
-
-import org.jboss.portal.portlet.spi.PortalContext;
-import org.jboss.portal.common.util.CollectionBuilder;
-import org.jboss.portal.WindowState;
-import org.jboss.portal.Mode;
-
-import java.util.Set;
-import java.util.Map;
-import java.util.Collections;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class PresentationPortalContext implements PortalContext
-{
-
- /** . */
- private final Set windowStates;
-
- /** . */
- private final Set modes;
-
- /** . */
- private final Map props;
-
- public PresentationPortalContext()
- {
- windowStates = Collections.unmodifiableSet(new CollectionBuilder().add(WindowState.MAXIMIZED).add(WindowState.MINIMIZED).add(WindowState.NORMAL).toHashSet());
- modes = Collections.unmodifiableSet(new CollectionBuilder().add(Mode.EDIT).add(Mode.HELP).add(Mode.VIEW).toHashSet());
- props = Collections.EMPTY_MAP;
- }
-
- public String getInfo()
- {
- return "JBossPortal/1.0";
- }
-
- public Set getWindowStates()
- {
- return windowStates;
- }
-
- public Set getModes()
- {
- return modes;
- }
-
- public Map getProperties()
- {
- return props;
- }
-}
Modified: branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationRequestContext.java
===================================================================
--- branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationRequestContext.java 2007-11-20 17:53:53 UTC (rev 9045)
+++ branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationRequestContext.java 2007-11-20 18:11:57 UTC (rev 9046)
@@ -23,8 +23,8 @@
package org.jboss.portal.core.presentation.server.content.portlet;
import org.jboss.portal.portlet.spi.RequestContext;
-import org.jboss.portal.web.spi.ServletContainerContext;
import org.jboss.portal.web.RequestDispatchCallback;
+import org.jboss.portal.web.ServletContainer;
import javax.servlet.ServletContext;
@@ -58,8 +58,8 @@
return 8080;
}
- public Object dispatch(ServletContainerContext servletContainerContext, ServletContext targetServletContext, RequestDispatchCallback callback, Object handback) throws Exception
+ public Object dispatch(ServletContainer servletContainer, ServletContext servletContext, RequestDispatchCallback requestDispatchCallback, Object o) throws Exception
{
- return context.getDispatcher().include(targetServletContext, callback, handback);
+ return context.getDispatcher().include(servletContext, requestDispatchCallback, o);
}
}
Deleted: branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationUserContext.java
===================================================================
--- branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationUserContext.java 2007-11-20 17:53:53 UTC (rev 9045)
+++ branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationUserContext.java 2007-11-20 18:11:57 UTC (rev 9046)
@@ -1,58 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.core.presentation.server.content.portlet;
-
-import org.jboss.portal.portlet.spi.UserContext;
-
-import java.util.Map;
-import java.util.Locale;
-import java.util.List;
-import java.util.Collections;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class PresentationUserContext implements UserContext
-{
-
- public String getId()
- {
- return null;
- }
-
- public Map getInformations()
- {
- return null;
- }
-
- public Locale getLocale()
- {
- return Locale.ENGLISH;
- }
-
- public List getLocales()
- {
- return Collections.singletonList(Locale.ENGLISH);
- }
-}
16 years, 7 months
JBoss Portal SVN: r9045 - in branches/presentation/presentation: src/main/org/jboss/portal/presentation/impl and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-11-20 12:53:53 -0500 (Tue, 20 Nov 2007)
New Revision: 9045
Modified:
branches/presentation/presentation/build.xml
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/PresentationContextImpl.java
Log:
make presentation module compile with latest 2.6
Modified: branches/presentation/presentation/build.xml
===================================================================
--- branches/presentation/presentation/build.xml 2007-11-20 17:51:42 UTC (rev 9044)
+++ branches/presentation/presentation/build.xml 2007-11-20 17:53:53 UTC (rev 9045)
@@ -87,23 +87,22 @@
&libraries;
<path id="library.classpath">
+ <path refid="jboss.portal/modules/common.classpath"/>
+ <path refid="jboss.portal/modules/web.classpath"/>
+ <path refid="jboss.portal/modules/portlet.classpath"/>
<path refid="jbossas/core.libs.classpath"/>
<path refid="sun.servlet.classpath"/>
<path refid="apache.log4j.classpath"/>
- <path refid="junit.junit.classpath"/>
- <path refid="gwt.gwt.classpath"/>
- <path refid="mygwt.mygwt.classpath"/>
- <path refid="httpunit.httpunit.classpath"/>
+ <path refid="junit.junit.classpath"/>
+ <path refid="gwt.gwt.classpath"/>
+ <path refid="mygwt.mygwt.classpath"/>
+ <path refid="httpunit.httpunit.classpath"/>
</path>
<!-- Configure modules -->
<call target="configure-modules"/>
<path id="dependentmodule.classpath">
- <path refid="jboss.portlet-api.classpath"/>
- <path refid="jboss.portal-jems.classpath"/>
- <path refid="jboss.portal-common.classpath"/>
<path refid="jboss.portal-server.classpath"/>
- <path refid="jboss.portal-web.classpath"/>
</path>
<!--+=======================================+-->
Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/PresentationContextImpl.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/PresentationContextImpl.java 2007-11-20 17:51:42 UTC (rev 9044)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/PresentationContextImpl.java 2007-11-20 17:53:53 UTC (rev 9045)
@@ -22,23 +22,25 @@
******************************************************************************/
package org.jboss.portal.presentation.impl;
-import javax.servlet.http.HttpSession;
-
import org.jboss.portal.presentation.client.PresentationContext;
+import org.jboss.portal.presentation.impl.model.UIContextImpl;
+import org.jboss.portal.presentation.model.UIContext;
+import org.jboss.portal.presentation.model.UIObject;
+import org.jboss.portal.presentation.protocol.LinkActivation;
import org.jboss.portal.presentation.protocol.ServerAction;
-import org.jboss.portal.presentation.protocol.LinkActivation;
import org.jboss.portal.presentation.protocol.UIObjectAction;
-import org.jboss.portal.presentation.model.UIContext;
-import org.jboss.portal.presentation.model.UIObject;
import org.jboss.portal.presentation.server.PresentationServer;
-import org.jboss.portal.presentation.impl.model.UIContextImpl;
+import org.jboss.portal.server.AbstractServerURL;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerURL;
-import org.jboss.portal.server.AbstractServerURL;
import org.jboss.portal.server.request.URLContext;
import org.jboss.portal.server.request.URLFormat;
+import org.jboss.portal.web.ServletContainer;
import org.jboss.portal.web.ServletContextDispatcher;
+import org.jboss.portal.web.impl.DefaultServletContainerFactory;
+import javax.servlet.http.HttpSession;
+
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
*
@@ -88,8 +90,12 @@
*/
public ServletContextDispatcher getDispatcher()
{
- return new ServletContextDispatcher(this.invocation.getServerContext().getClientRequest(),
- this.invocation.getServerContext().getClientResponse(), this.invocation.getRequest().getServer().getServletContainerContext());
+ DefaultServletContainerFactory factory = new DefaultServletContainerFactory();
+ ServletContainer container = factory.getServletContainer();
+ return new ServletContextDispatcher(
+ invocation.getServerContext().getClientRequest(),
+ invocation.getServerContext().getClientResponse(),
+ container);
}
/**
16 years, 7 months
JBoss Portal SVN: r9044 - branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/server/impl.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-11-20 12:51:42 -0500 (Tue, 20 Nov 2007)
New Revision: 9044
Modified:
branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/server/impl/ServerInvocationContextImpl.java
Log:
allow for retrieval of WebRequest on ServerInvocationContextImpl
Modified: branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/server/impl/ServerInvocationContextImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/server/impl/ServerInvocationContextImpl.java 2007-11-20 17:12:35 UTC (rev 9043)
+++ branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/server/impl/ServerInvocationContextImpl.java 2007-11-20 17:51:42 UTC (rev 9044)
@@ -137,6 +137,11 @@
addResolver(ServerInvocation.PRINCIPAL_SCOPE, new PrincipalAttributeResolver(req));
}
+ public WebRequest getWebRequest()
+ {
+ return webReq;
+ }
+
public HttpServletRequest getClientRequest()
{
return req;
16 years, 7 months
JBoss Portal SVN: r9043 - branches/JBoss_Portal_Branch_2_6/build.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-11-20 12:12:35 -0500 (Tue, 20 Nov 2007)
New Revision: 9043
Modified:
branches/JBoss_Portal_Branch_2_6/build/build-thirdparty.xml
Log:
add gwt stuff to 2.6 thirdparty although it is only used in presentation branch, if there are other libs, I'll consider a better approach than overloading 2.6
Modified: branches/JBoss_Portal_Branch_2_6/build/build-thirdparty.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/build/build-thirdparty.xml 2007-11-20 16:18:02 UTC (rev 9042)
+++ branches/JBoss_Portal_Branch_2_6/build/build-thirdparty.xml 2007-11-20 17:12:35 UTC (rev 9043)
@@ -119,8 +119,13 @@
<componentref name="freemarker" version="2.3.9"/>
<componentref name="wutka-dtdparser" version="1.2.1"/>
<componentref name="portals-bridges" version="1.0.3"/>
- </build>
+ <!-- For the presentation branch only, not the mainstream branch -->
+ <componentref name="gwt" version="1.4.60"/>
+ <componentref name="mygwt" version="0.3.0"/>
+
+ </build>
+
<synchronizeinfo/>
<target name="generate-lib-file"
16 years, 7 months
JBoss Portal SVN: r9042 - in branches/presentation: presentation and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-11-20 11:18:02 -0500 (Tue, 20 Nov 2007)
New Revision: 9042
Added:
branches/presentation/core-presentation/
Removed:
branches/presentation/presentation/core-presentation/
Log:
moved core-presentation to wrong path, correcting it
Copied: branches/presentation/core-presentation (from rev 9041, branches/presentation/presentation/core-presentation)
16 years, 7 months
JBoss Portal SVN: r9041 - in branches: presentation/presentation and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-11-20 11:13:25 -0500 (Tue, 20 Nov 2007)
New Revision: 9041
Added:
branches/presentation/presentation/core-presentation/
Removed:
branches/UIServer/core-uiserver/
Log:
move core-uiserver to presentation/core-presentation
Copied: branches/presentation/presentation/core-presentation (from rev 9040, branches/UIServer/core-uiserver)
16 years, 7 months
JBoss Portal SVN: r9040 - in branches: presentation and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-11-20 11:12:29 -0500 (Tue, 20 Nov 2007)
New Revision: 9040
Added:
branches/presentation/presentation/
Removed:
branches/UIServer/uiserver/
Log:
move the uiserver to presentation/presentation
Copied: branches/presentation/presentation (from rev 9039, branches/UIServer/uiserver)
16 years, 7 months