JBoss Portal SVN: r8896 - branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-sar/conf/bundles.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-11-13 06:04:28 -0500 (Tue, 13 Nov 2007)
New Revision: 8896
Added:
branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_fr.properties
Log:
JBPORTAL-1796: French translation of the identity portlets
Added: branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_fr.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_fr.properties (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_fr.properties 2007-11-13 11:04:28 UTC (rev 8896)
@@ -0,0 +1,177 @@
+################################################################################
+# 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. #
+################################################################################
+
+IDENTITY_APPLICATION_NOT_AVAILABLE=Porlet not available. Please check your configuration and the error log for further information.
+
+IDENTITY_WELCOME=Bienvenue
+IDENTITY_REGISTER=S'enregistrer
+IDENTITY_LOST_PASSWORD=Mot de passe perdu
+IDENTITY_NOT_LOGGED_IN=Vous n'\ufffdtes pas connect\ufffd.
+IDENTITY_CREATE_ACCOUNT=Vous pouvez cr\ufffder un compte.
+IDENTITY_BUTTON_SUBMIT=Soumettre
+IDENTITY_BUTTON_EDIT=Modifier
+IDENTITY_BUTTON_CANCEL=Annuler
+
+IDENTITY_REGISTER_TITLE=Informations g\ufffdn\ufffdrales
+IDENTITY_REGISTER_TITLE_CONFIRM=Confirmation
+IDENTITY_REGISTER_PASSWORD_CONFIRM=Confirmation de mot de passe
+IDENTITY_REGISTER_STATUS_TITLE=Statut d'enregistrement
+IDENTITY_REGISTER_SUCCESS_TITLE=Votre compte a \ufffdt\ufffd cr\ufffd\ufffd avec succ\ufffds. Vous pouvez vous connecter.
+IDENTITY_REGISTER_PENDING_TITLE=Un courriel a \ufffdt\ufffd envoy\ufffd \ufffd l'adresse indiqu\ufffde afin de confirmer votre enregistrement.
+IDENTITY_REGISTER_REQUIRED_INFORMATION=indique un champ obligatoire
+
+IDENTITY_LOST_PASSWORD_TITLE=Informations sur mon compte perdues ?
+IDENTITY_LOST_PASSWORD_DESCRIPTION=Veuillez entrer votre nom d'usager afin de r\ufffdinitialiser votre mot de passe.
+IDENTITY_LOST_PASSWORD_ERROR=\ufffdchec de r\ufffdinitialisation de votre mot de passe.
+IDENTITY_LOST_PASSWORD_STATUS_SUCCESSFUL=Vous receverez sous peu via courriel votre nouveau mot de passe.
+IDENTITY_LOST_PASSWORD_STATUS_404=Aucun compte trouv\ufffd.
+IDENTITY_LOST_PASSWORD_STATUS_TITLE=Mot de passe perdu
+
+IDENTITY_EDIT_PROFILE_ERROR=Erreur lors de la mise \ufffd jour de votre profil.
+IDENTITY_EDIT_PASSWORD_TITLE=Changer mon mot de passe
+IDENTITY_EDIT_PASSWORD_CURRENT=Mot de passe courant
+IDENTITY_EDIT_CHANGE_PASSWORD=Changer mon mot de passe
+IDENTITY_EDIT_CHANGE_PASSWORD_ERROR=Impossible de changer votre mot de passe.
+IDENTITY_EDIT_CHANGE_PASSWOR_STATUS=Votre mot de passe a \ufffdt\ufffd modifi\ufffd.
+
+IDENTITY_EDIT_EMAIL_TITLE=Changer mon adresse de courriel
+IDENTITY_EDIT_EMAIL_NEW=Nouvelle adresse courriel
+IDENTITY_EDIT_CHANGE_EMAIL=Changer mon adresse
+IDENTITY_EDIT_CHANGE_EMAIL_ERROR=Impossible de changer mon adresse de courriel.
+IDENTITY_EDIT_CHANGE_EMAIL_STATUS_PENDING=Un courriel a \ufffdt\ufffd envoy\ufffd \ufffd l'adresse indiqu\ufffde afin de confirmer votre mise \ufffd jour.
+IDENTITY_EDIT_CHANGE_EMAIL_STATUS_CHANGED=Votre adresse de courriel a \ufffdt\ufffd mise \ufffd jour.
+
+IDENTITY_EDIT_PROFILE_TITLE=Modifier mon profil
+IDENTITY_VIEW_PROFILE_TITLE=Voir mon profil
+
+IDENTITY_USERNAME=Nom d'utilisateur
+IDENTITY_PASSWORD=Mot de passe
+IDENTITY_EMAIL=Courriel
+IDENTITY_GIVENNAME=Pr\ufffdnom
+IDENTITY_FAMILYNAME=Nom
+IDENTITY_SKYPE=Num\ufffdro Skype
+IDENTITY_LOCATION=Lieu de r\ufffdsidence
+IDENTITY_OCCUPATION=Occupation
+IDENTITY_EXTRA=Extra
+IDENTITY_SIGNATURE=Signature
+IDENTITY_INTERESTS=Int\ufffdr\ufffdts
+IDENTITY_LOCALE=Langue
+IDENTITY_ICQ=Icq
+IDENTITY_AIM=Aim
+IDENTITY_MSNM=MSN messenger
+IDENTITY_YIM=Yahoo
+IDENTITY_XMMP=Xmmp
+IDENTITY_HOMEPAGE=Page web
+IDENTITY_TIMEZONE=Fuseau horaire
+IDENTITY_THEME=Th\ufffdme
+IDENTITY_SECURITY_QUESTION=Question de s\ufffdcurit\ufffd
+IDENTITY_SECURITY_ANSWER=R\ufffdponse \ufffd votre question de s\ufffdcurit\ufffd
+IDENTITY_LAST_LOGIN=Derni\ufffdre visite
+IDENTITY_REIGSTRATION_DATE=Enregistr\ufffd le
+IDENTITY_ENABLED=Actif
+
+IDENTITY_CATEGORY_GENERAL=Pr\ufffdf\ufffdrences g\ufffdn\ufffdrales
+IDENTITY_CATEGORY_PERSONAL=Informations personnelles
+IDENTITY_CATEGORY_INSTANT=Comptes de messagerie instantan\ufffde
+IDENTITY_CATEGORY_ADDITIONAL=Information suppl\ufffdmentaire
+
+IDENTITY_CATEGORY_ADDITIONAL_SIGNATURE=(Signature de 255 caract\ufffdres max)
+IDENTITY_CATEGORY_ADDITIONAL_EXTRA=(255 caract\ufffdres max.)
+
+IDENTITY_MANAGEMENT_ACTION=Actions
+IDENTITY_MANAGEMENT_ACTION_EDIT_PROFILE=Modifier
+IDENTITY_MANAGEMENT_ACTION_ROLES=R\ufffdles
+IDENTITY_MANAGEMENT_ACTION_DELETE=Supprimer
+IDENTITY_MANAGEMENT_USER_MANAGEMENT=Gestion des utilisateurs
+IDENTITY_MANAGEMENT_ROLE_MANAGEMENT=Gestion des r\ufffdles
+IDENTITY_MANAGEMENT_SEARCH_USER=Rechercher
+IDENTITY_MANAGEMENT_CREATE_USER=Cr\ufffder un nouveau compte utilisateur
+IDENTITY_MANAGEMENT_CREATE_USER_CREATED=Compte cr\ufffd\ufffd
+IDENTITY_MANAGEMENT_USER_DELETED=Compte supprim\ufffd
+IDENTITY_MANAGEMENT_ROLE=R\ufffdle
+IDENTITY_MANAGEMENT_ROLE_DISPLAY=Nom courant
+IDENTITY_MANAGEMENT_ROLE_MEMBERS=Membres
+IDENTITY_MANAGEMENT_ROLE_ASSIGNED=R\ufffdles assign\ufffds
+IDENTITY_MANAGEMENT_CREATE_ROLE=Cr\ufffder un nouveau r\ufffdle
+IDENTITY_MANAGEMENT_EDIT_ROLE=Modifier le r\ufffdle
+IDENTITY_MANAGEMENT_DISABLE=D\ufffdsactiver
+IDENTITY_MANAGEMENT_ENABLE=Activer
+IDENTITY_MANAGEMENT_RESET_PASSWORD=R\ufffdinitialiser le mot de passe
+IDENTITY_MANAGEMENT_RESET_PASSWORD_FOR_USER=R\ufffdinitialiser le mot de passe pour l'usager
+IDENTITY_MANAGEMENT_RESET_PASSWORD_DESCRIPTION=L'utilisateur recevera un nouveau mot de passe al\ufffdatoire envoy\ufffd via courriel.
+IDENTITY_MANAGEMENT_ASSIGN_ROLES=Assigner un r\ufffdle
+IDENTITY_MANAGEMENT_COUNT_PENDING_USERS=Comptes en attente d'approbation
+IDENTITY_MANAGEMENT_COUNT_REGISTERED_USERS=Utilisateurs enregistr\ufffds
+IDENTITY_MANAGEMENT_APPROVE_ALL=Approuver la s\ufffdlection
+IDENTITY_MANAGEMENT_REJECT_ALL=Rejeter la s\ufffdlection
+IDENTITY_MANAGEMENT_SELECT_ALL=out s\ufffdlectionner
+IDENTITY_MANAGEMENT_UNSELECT_ALL=Tout d\ufffds\ufffdlectionner
+IDENTITY_MANAGEMENT_MATRIX=Matrice
+IDENTITY_MANAGEMENT_SUBSCRIPTION_MODES=Modes d'abonnement
+
+IDENTITY_MANAGEMENT_PENDING_REGISTRATIONS=Enregistrements en attente d'approbation
+IDENTITY_MANAGEMENT_PENDING_BPM_ID=Id
+IDENTITY_MANAGEMENT_PENDING_APPROVE=approuver
+IDENTITY_MANAGEMENT_PENDING_REJECT=rejeter
+
+IDENTITY_MANAGEMENT_SUBSCRIPTION_MODE=Mode d'abonnement
+IDENTITY_MANAGEMENT_SUBSCRIPTION_ADMIN_MODE=Administrer les modes d'abonnement
+IDENTITY_MANAGEMENT_DESCRIPTION_SUBSCRIPTION_CUSTOM=Mode d'abonnement personnalis\ufffd
+IDENTITY_MANAGEMENT_DESCRIPTION_SUBSCRIPTION_AUTOMATIC=Automatique - pas de validation courriel & pas d'approbation
+IDENTITY_MANAGEMENT_DESCRIPTION_SUBSCRIPTION_EMAIL=Validation courriel & pas d'approbation
+IDENTITY_MANAGEMENT_DESCRIPTION_SUBSCRIPTION_EMAIL_ADMIN=Validation courriel & approbation par un administrateur
+
+IDENTITY_REGISTER_VERIFY_CAPTCHA=V\ufffdrification visuelle
+IDENTITY_REGISTER_TITLE_CONFIRM_DELETE=Confirmation : supprimer
+IDENTITY_WARNING_CONFIRM_DELETE_USER=Attention ! Vous allez supprimer le compte
+IDENTITY_WARNING_CONFIRM_DELETE_ROLE=Attention ! Vous allez supprimer le r\ufffdle
+IDENTITY_REGISTER_CONFIRMATIONEMAIL=Confirmer votre abonnement
+
+IDENTITY_MAIL_SUBJECT_LOST_PASSWORD=R\ufffdinitialiser mon mot de passe
+IDENTITY_MAIL_SUBJECT_REGISTER=Confirmer mon enregistrement
+IDENTITY_MAIL_SUBJECT_CHANGE_EMAIL=Confirmer mon courriel
+
+IDENTITY_MANAGEMENT_ERROR_ACTION_ROLE=Impossible d'effectuer l'op\ufffdration demand\ufffde sur ce r\ufffdle. Consultez le log syst\ufffdme pour plus de d\ufffdtails.
+IDENTITY_MANAGEMENT_ERROR_ACTION_USER=Impossible d'effectuer l'op\ufffdration demand\ufffde sur ce compte. Consultez le log syst\ufffdme pour plus de d\ufffdtails.
+
+IDENTITY_VERIFICATION_RETURN=Retourner au portail
+IDENTITY_VERIFICATION_LOGIN=Connexion
+IDENTITY_VERIFICATION_STATUS_EROOR=Une erreur est survenue lors de la validation du courriel.
+IDENTITY_VERIFICATION_STATUS_FAILED=Impossible de valider cette adresse de courriel.
+IDENTITY_VERIFICATION_STATUS_VALIDATED=Adresse de courriel valid\ufffde.
+IDENTITY_VERIFICATION_STATUS_REGISTER_SUCCESS=Votre compte a \ufffdt\ufffd activ\ufffd. Vous pouvez vous connecter.
+IDENTITY_VERIFICATION_STATUS_REGISTER_APPROVAL=Votre adresse de courriel a \ufffdt\ufffd v\ufffdrifi\ufffde, mais votre compte doit \ufffdtre approuv\ufffd par un administrateur.
+IDENTITY_VERIFICATION_STATUS_REGISTER_CUSTOM=Votre compte a \ufffdt\ufffd activ\ufffd. Vous pouvez vous connecter.
+
+IDENTITY_VALIDATION_ERROR_REGISTRATION=Erreur lors de l'enregistrement du compte.
+IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN=Ce nom d'utilisateur est d\ufffdj\ufffd utilis\ufffd.
+IDENTITY_VALIDATION_ERROR_USERNAME_ERROR=Erreur lors de la validation du nom d'utilisateur.
+IDENTITY_VALIDATION_ERROR_PASSWORD_DOESNT_MATCH=Vos mots de passe ne correspondent pas.
+IDENTITY_VALIDATION_ERROR_PASSWORD_ERROR=Erreur lors de la validation de l'adresse de courriel.
+IDENTITY_VALIDATION_ERROR_INVALID_EMAIL=Adresse de courriel invalide.
+IDENTITY_VALIDATION_ERROR_INVALID_PASSWORD=Mot de passe erron\ufffd.
+IDENTITY_VALIDATION_ERROR_CAPTCHA_INCORRECT=Validation visuelle incorrecte.
+
+# Example usage for dynamic values
+IDENTITY_DYNAMIC_VALUE_TEST=test label
+IDENTITY_DYNAMIC_VALUE_TEST2=test label2
16 years, 11 months
JBoss Portal SVN: r8895 - in branches/JBoss_Portal_Branch_2_6/core/src: resources/portal-core-sar/META-INF and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-11-13 03:57:24 -0500 (Tue, 13 Nov 2007)
New Revision: 8895
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/controller/ajax/AjaxInterceptor.java
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
Log:
JBPORTAL-1729: AjaxInterceptor with a different context root
Contribution from Luca Stancapiano
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/controller/ajax/AjaxInterceptor.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/controller/ajax/AjaxInterceptor.java 2007-11-13 08:55:07 UTC (rev 8894)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/controller/ajax/AjaxInterceptor.java 2007-11-13 08:57:24 UTC (rev 8895)
@@ -39,11 +39,18 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author Luca Stancapiano
* @version $Revision$
*/
public class AjaxInterceptor extends ControllerInterceptor
{
-
+ /**
+ * Luca Stancapiano - 29 - 09 -2007
+ * targetContextPath is used to assign a context path when
+ * default portal-ajax path cannot to be used or if it is changed through context-root property into jboss-web.xml
+ * */
+ private String targetContextPath = "/portal-ajax";
+
public ControllerResponse invoke(ControllerCommand cmd) throws Exception, InvocationException
{
ControllerResponse response = (ControllerResponse)cmd.invokeNext();
@@ -70,7 +77,7 @@
String url = serverContext.renderURL(baseServerURL, serverContext.getURLContext(), URLFormat.newInstance(true, true));
//
- pageProps.put(DynaConstants.RESOURCE_BASE_URL, "/portal-ajax/dyna");
+ pageProps.put(DynaConstants.RESOURCE_BASE_URL, targetContextPath + "/dyna");
pageProps.put(DynaConstants.SERVER_BASE_URL, url);
pageProps.put(DynaConstants.VIEW_STATE, viewId);
@@ -88,4 +95,14 @@
//
return response;
}
+
+ public String getTargetContextPath()
+ {
+ return targetContextPath;
+ }
+
+ public void setTargetContextPath(String context)
+ {
+ targetContextPath = context;
+ }
}
Modified: branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-11-13 08:55:07 UTC (rev 8894)
+++ branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-11-13 08:57:24 UTC (rev 8895)
@@ -188,6 +188,11 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
+ <!--
+ this tag has to be set when context root of portal-ajax is
+ different by /portal-ajax path.
+ Uncomment and change it if you want to change context root for portal-ajax application
+ <attribute name="TargetContextPath">/portal-ajax</attribute> -->
</mbean>
<mbean
code="org.jboss.portal.core.aspects.controller.NavigationalStateInterceptor"
16 years, 11 months
JBoss Portal SVN: r8894 - branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/model/instance.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-11-13 03:55:07 -0500 (Tue, 13 Nov 2007)
New Revision: 8894
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/model/instance/persistent-jboss-beans.xml
Log:
Oups
Modified: branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/model/instance/persistent-jboss-beans.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/model/instance/persistent-jboss-beans.xml 2007-11-13 06:48:05 UTC (rev 8893)
+++ branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/model/instance/persistent-jboss-beans.xml 2007-11-13 08:55:07 UTC (rev 8894)
@@ -74,16 +74,6 @@
<property name="jNDIName">java:/InstanceSessionFactory</property>
</bean>
- <bean name="Instance260HibernateSupport" class="org.jboss.portal.test.framework.embedded.HibernateSupport">
- <property name="config"><inject bean="HibernateConfig"/></property>
- <property name="mappings">
- <list elementClass="java.lang.String">
- <value>conf/test/hibernate/2.6.0/instance/domain.hbm.xml</value>
- </list>
- </property>
- <property name="jNDIName">java:/Instance260SessionFactory</property>
- </bean>
-
<bean name="PortletHibernateSupport" class="org.jboss.portal.test.framework.embedded.HibernateSupport">
<property name="config"><inject bean="HibernateConfig"/></property>
<property name="mappings">
@@ -127,29 +117,14 @@
<property name="performSecurityChecks">false</property>
</bean>
- <bean name="Container260Context"
- class="org.jboss.portal.core.impl.model.instance.persistent.PersistentInstanceContainerContext">
- <property name="sessionFactoryJNDIName">java:/Instance260SessionFactory</property>
- <property name="cacheNaturalId"><inject bean="TestCaseConfig" property="cacheNaturalId"/></property>
- </bean>
- <bean name="Instance260Container" class="org.jboss.portal.core.impl.model.instance.InstanceContainerImpl">
- <property name="cloneOnCreate"><inject bean="TestCaseConfig" property="cloneOnCreate"/></property>
- <property name="portletInvoker"><inject bean="Producer"/></property>
- <property name="containerContext"><inject bean="Container260Context"/></property>
- <property name="stackFactory"><inject bean="StackFactory"/></property>
- <property name="performSecurityChecks">false</property>
- </bean>
-
<bean name="TestBean" class="org.jboss.portal.test.core.model.instance.InstanceContainerTestCase">
<constructor factoryMethod="getBean">
<factory bean="BeanFactory"/>
<parameter>TestBean</parameter>
</constructor>
<property name="instanceHibernateSupport"><inject bean="InstanceHibernateSupport"/></property>
- <property name="instance260HibernateSupport"><inject bean="Instance260HibernateSupport"/></property>
<property name="portletHibernateSupport"><inject bean="PortletHibernateSupport"/></property>
<property name="instanceContainer"><inject bean="InstanceContainer"/></property>
- <property name="instance260Container"><inject bean="Instance260Container"/></property>
<property name="persistenceManager"><inject bean="PersistenceManager"/></property>
<property name="producer"><inject bean="Producer"/></property>
<property name="portletContainer"><inject bean="PortletContainer"/></property>
16 years, 11 months
JBoss Portal SVN: r8893 - in branches/JBoss_Portal_Branch_2_6: wsrp/src/main/org/jboss/portal/test/wsrp/consumer and 1 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-11-13 01:48:05 -0500 (Tue, 13 Nov 2007)
New Revision: 8893
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/EndpointConfigurationInfoTestCase.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
Log:
- JBPORTAL-1566: use WSDL by default. Still needs more testing.
- Updated and added tests to check behavior wrt WSDL.
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2007-11-13 05:45:17 UTC (rev 8892)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2007-11-13 06:48:05 UTC (rev 8893)
@@ -55,6 +55,11 @@
private String registration;
private String wsdl;
+ public ConsumerBean()
+ {
+ useWSDL = Boolean.TRUE; // use WSDL by default
+ }
+
public void setRegistry(ConsumerRegistry registry)
{
this.registry = registry;
@@ -112,6 +117,7 @@
portletManagement = endpoint.getPortletManagementURL();
registration = endpoint.getRegistrationURL();
wsdl = endpoint.getWsdlDefinitionURL();
+ useWSDL = endpoint.usesWSDL();
}
}
@@ -205,15 +211,23 @@
public boolean isRegistrationCheckNeeded()
{
- RegistrationInfo regInfo = getProducerInfo().getRegistrationInfo();
- if (regInfo == null)
+ ProducerInfo info = getProducerInfo();
+ if (info.isRefreshNeeded(true))
{
- return true;
+ RegistrationInfo regInfo = info.getRegistrationInfo();
+ if (regInfo == null)
+ {
+ return true;
+ }
+ else
+ {
+ Boolean consistent = regInfo.isConsistentWithProducerExpectations();
+ return consistent == null || !consistent.booleanValue();
+ }
}
else
{
- Boolean consistent = regInfo.isConsistentWithProducerExpectations();
- return consistent == null || !consistent.booleanValue();
+ return false;
}
}
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/EndpointConfigurationInfoTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/EndpointConfigurationInfoTestCase.java 2007-11-13 05:45:17 UTC (rev 8892)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/EndpointConfigurationInfoTestCase.java 2007-11-13 06:48:05 UTC (rev 8893)
@@ -47,8 +47,15 @@
public void testSetURLs() throws InvokerUnavailableException
{
+ // default state is to use WSDL
+ assertTrue(info.usesWSDL());
+
+
info.setServiceDescriptionURL(url);
assertEquals(url, info.getServiceDescriptionURL());
+
+ // changing the URLs should switch to not using WSDL anymore...
+ assertFalse(info.usesWSDL());
try
{
info.getServiceFactory();
@@ -59,6 +66,7 @@
}
info.setMarkupURL(url);
+ assertFalse(info.usesWSDL());
assertNotNull(info.getServiceFactory());
assertEquals(url, info.getServiceFactory().getServiceDescriptionURL());
assertEquals(url, info.getServiceFactory().getMarkupURL());
@@ -67,6 +75,8 @@
public void testSetWSDLURL() throws InvokerUnavailableException
{
+ assertTrue(info.usesWSDL());
+
info.setServiceDescriptionURL(url);
info.setMarkupURL(url);
assertTrue(info.getServiceFactory() instanceof PerEndpointSOAPInvokerServiceFactory);
@@ -82,7 +92,14 @@
info.setMarkupURL(url);
assertEquals(url, info.getMarkupURL());
assertEquals(url, info.getServiceFactory().getMarkupURL());
+ assertFalse(info.usesWSDL());
+ }
+
+ public void testSetInvalidWSDLURL()
+ {
+ info.setWsdlDefinitionURL(url);
assertTrue(info.usesWSDL());
+ assertEquals(url, info.getWsdlDefinitionURL());
}
public void testSetNullWSDLURL()
@@ -92,6 +109,8 @@
// it should be possible to set the WSDL to null for Hibernate
info.setWsdlDefinitionURL(null);
+
+ assertFalse(info.usesWSDL());
}
public void testRefreshWSDL() throws Exception
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-11-13 05:45:17 UTC (rev 8892)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-11-13 06:48:05 UTC (rev 8893)
@@ -52,7 +52,7 @@
private String persistentMarkupURL = UNSET;
private String persistentRegistrationURL;
private String persistentPortletManagementURL;
- private String persistentWsdlDefinitionURL;
+ private String persistentWsdlDefinitionURL = UNSET;
// transient variables
/** Access to the WS */
@@ -73,6 +73,9 @@
private final static int PM = 2;
private final static int R = 3;
+ /** Whether we're using information from a WSDL or not. */
+ private boolean usingWSDL = true;
+
// todo: public for tests
public EndpointConfigurationInfo()
{
@@ -103,7 +106,7 @@
public boolean usesWSDL()
{
- return serviceFactory instanceof RemoteSOAPInvokerServiceFactory || persistentWsdlDefinitionURL != null;
+ return usingWSDL;
}
public String getWsdlDefinitionURL()
@@ -196,8 +199,10 @@
// WSDL url is optional so can be null (and in particular, it is when loaded from Hibernate most of the time)
// do not attempt to set the URL if the service factory hasn't been created yet to avoid issues when
// ConsumerRegistry starts (in particular, raising an exception if the WSDL is not available)
- if (wsdlDefinitionURL != null && serviceFactory != null)
+ if (wsdlDefinitionURL != null && !UNSET.equals(wsdlDefinitionURL) && serviceFactory != null)
{
+ usingWSDL = true;
+
if (!(serviceFactory instanceof RemoteSOAPInvokerServiceFactory))
{
serviceFactory = new RemoteSOAPInvokerServiceFactory();
@@ -212,6 +217,7 @@
{
oldValue = newValue;
clean.clear(whichURL);
+ usingWSDL = false;
}
return oldValue;
@@ -221,7 +227,7 @@
{
if (serviceFactory == null)
{
- if (usesWSDL())
+ if (usesWSDL() && !UNSET.equals(persistentWsdlDefinitionURL))
{
serviceFactory = new RemoteSOAPInvokerServiceFactory();
internalSetWsdlURL();
@@ -274,6 +280,13 @@
try
{
((RemoteSOAPInvokerServiceFactory)serviceFactory).setWsdlDefinitionURL(persistentWsdlDefinitionURL);
+
+ // update the URLs based on WSDL information
+ persistentMarkupURL = serviceFactory.getMarkupURL();
+ persistentPortletManagementURL = serviceFactory.getPortletManagementURL();
+ persistentRegistrationURL = serviceFactory.getRegistrationURL();
+ persistentServiceDescriptionURL = serviceFactory.getServiceDescriptionURL();
+
clean.set(0, 4); // if setting the WSDL URL worked, consider everything clean
}
catch (Exception e)
16 years, 11 months
JBoss Portal SVN: r8892 - branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/support.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-11-13 00:45:17 -0500 (Tue, 13 Nov 2007)
New Revision: 8892
Modified:
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/support/AbstractSynchronizedServer.java
Log:
- Use JBoss logging instead of Log4J.
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/support/AbstractSynchronizedServer.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/support/AbstractSynchronizedServer.java 2007-11-12 22:40:53 UTC (rev 8891)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/support/AbstractSynchronizedServer.java 2007-11-13 05:45:17 UTC (rev 8892)
@@ -22,20 +22,20 @@
******************************************************************************/
package org.jboss.portal.test.widget.support;
-import org.apache.log4j.Logger;
+import org.jboss.logging.Logger;
import org.jboss.portal.common.io.IOTools;
import org.jboss.portal.common.junit.ExtendedAssert;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.util.concurrent.atomic.AtomicInteger;
import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.InputStreamReader;
import java.io.LineNumberReader;
-import java.io.InputStreamReader;
-import java.io.BufferedOutputStream;
import java.io.OutputStreamWriter;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.util.concurrent.atomic.AtomicInteger;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -161,7 +161,7 @@
Socket s = server.accept();
BufferedInputStream in = new BufferedInputStream(s.getInputStream());
LineNumberReader reader = new LineNumberReader(new InputStreamReader(in, "ISO-8859-1"));
- for (String line = reader.readLine();line.length() > 0;line = reader.readLine())
+ for (String line = reader.readLine(); line.length() > 0; line = reader.readLine())
{
log.debug("server received = " + line);
}
@@ -179,26 +179,26 @@
out.close();
}
}
-
+
public static abstract class AbstractReturnFileServer extends AbstractSynchronizedServer
{
-
+
/** . */
private final String file;
-
+
protected AbstractReturnFileServer(int port, String file)
{
super(port);
this.file = file;
}
-
+
protected void doServer(ServerSocket server) throws Exception
{
//
Socket s = server.accept();
BufferedInputStream in = new BufferedInputStream(s.getInputStream());
LineNumberReader reader = new LineNumberReader(new InputStreamReader(in, "ISO-8859-1"));
- for (String line = reader.readLine();line.length() > 0;line = reader.readLine())
+ for (String line = reader.readLine(); line.length() > 0; line = reader.readLine())
{
log.debug("server received = " + line);
}
@@ -208,7 +208,7 @@
// get file content
byte[] bytes = getFileContent();
-
+
//
BufferedOutputStream out = new BufferedOutputStream(s.getOutputStream());
OutputStreamWriter writer = new OutputStreamWriter(out, "UTF-8");
@@ -218,7 +218,7 @@
out.write(bytes);
out.close();
}
-
+
private byte[] getFileContent() throws IllegalArgumentException, IOException
{
InputStream io = Thread.currentThread().getContextClassLoader().getResourceAsStream(this.file);
@@ -226,9 +226,9 @@
io.close();
return bytes;
}
-
+
}
-
+
public static abstract class Abstract404Server extends AbstractSynchronizedServer
{
@@ -243,7 +243,7 @@
Socket s = server.accept();
BufferedInputStream in = new BufferedInputStream(s.getInputStream());
LineNumberReader reader = new LineNumberReader(new InputStreamReader(in, "ISO-8859-1"));
- for (String line = reader.readLine();line.length() > 0;line = reader.readLine())
+ for (String line = reader.readLine(); line.length() > 0; line = reader.readLine())
{
log.debug("server received = " + line);
}
16 years, 11 months
JBoss Portal SVN: r8891 - in branches/UIServer: core/src/resources/portal-core-sar/META-INF and 2 other directories.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2007-11-12 17:40:53 -0500 (Mon, 12 Nov 2007)
New Revision: 8891
Added:
branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java
Removed:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/PresentationServerImpl.java
Modified:
branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
branches/UIServer/uiserver/src/resources/portal-uiserver.sar/META-INF/jboss-service.xml
Log:
refactoring
Added: branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java
===================================================================
--- branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java (rev 0)
+++ branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java 2007-11-12 22:40:53 UTC (rev 8891)
@@ -0,0 +1,98 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.presentation.server.Processor;
+import org.jboss.portal.presentation.server.PortalObjectReader;
+import org.jboss.portal.presentation.server.PresentationServer;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class PresentationServerImpl implements PresentationServer
+{
+ private Processor processor = null;
+ private PortalObjectReader portalObjectReader = null;
+
+ /**
+ *
+ *
+ */
+ public PresentationServerImpl()
+ {
+
+ }
+
+ /**
+ *
+ *
+ */
+ public void start()
+ {
+
+ }
+
+ /**
+ *
+ *
+ */
+ public void stop()
+ {
+
+ }
+
+ /**
+ *
+ */
+ public PortalObjectReader getPortalObjectReader()
+ {
+ return this.portalObjectReader;
+ }
+
+ /**
+ *
+ * @param portalObjectReader
+ */
+ public void setPortalObjectReader(PortalObjectReader portalObjectReader)
+ {
+ this.portalObjectReader = portalObjectReader;
+ }
+
+ /**
+ *
+ */
+ public Processor getProcessor()
+ {
+ return this.processor;
+ }
+
+ /**
+ *
+ * @param processor
+ */
+ public void setProcessor(Processor processor)
+ {
+ this.processor = processor;
+ }
+}
Modified: branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-11-12 22:33:29 UTC (rev 8890)
+++ branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-11-12 22:40:53 UTC (rev 8891)
@@ -1092,6 +1092,25 @@
proxy-type="attribute">portal:service=ControlPolicy,type=Page</depends>
</mbean>
<mbean
+ code="org.jboss.portal.core.presentation.server.PresentationServerImpl"
+ name="portal:service=PresentationServer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="PortalObjectReader" proxy-type="attribute">portal:container=PortalObjectReader</depends>
+ <depends optional-attribute-name="Processor" proxy-type="attribute">portal:service=Processor</depends>
+ <depends>portal:service=PageService</depends>
+ <depends>portal:commandFactory=DefaultPortal</depends>
+ <depends>portal:urlFactory=Delegating</depends>
+ <depends>portal:service=InterceptorStackFactory,type=Command</depends>
+ <depends>portal:container=Instance</depends>
+ <depends>portal:service=PortalAuthorizationManagerFactory</depends>
+ <depends>portal:service=CustomizationManager</depends>
+ <depends>portal:service=ContentProviderRegistry</depends>
+ <depends>portal:service=ResponseHandler,type=Selector</depends>
+ <depends>portal:service=ControlPolicy,type=Page</depends>
+ </mbean>
+ <mbean
code="org.jboss.portal.core.presentation.server.MainProcessor"
name="portal:service=Processor"
xmbean-dd=""
Deleted: branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/PresentationServerImpl.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/PresentationServerImpl.java 2007-11-12 22:33:29 UTC (rev 8890)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/PresentationServerImpl.java 2007-11-12 22:40:53 UTC (rev 8891)
@@ -1,94 +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.presentation.server;
-
-/**
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-public class PresentationServerImpl implements PresentationServer
-{
- private Processor processor = null;
- private PortalObjectReader portalObjectReader = null;
-
- /**
- *
- *
- */
- public PresentationServerImpl()
- {
-
- }
-
- /**
- *
- *
- */
- public void start()
- {
-
- }
-
- /**
- *
- *
- */
- public void stop()
- {
-
- }
-
- /**
- *
- */
- public PortalObjectReader getPortalObjectReader()
- {
- return this.portalObjectReader;
- }
-
- /**
- *
- * @param portalObjectReader
- */
- public void setPortalObjectReader(PortalObjectReader portalObjectReader)
- {
- this.portalObjectReader = portalObjectReader;
- }
-
- /**
- *
- */
- public Processor getProcessor()
- {
- return this.processor;
- }
-
- /**
- *
- * @param processor
- */
- public void setProcessor(Processor processor)
- {
- this.processor = processor;
- }
-}
Modified: branches/UIServer/uiserver/src/resources/portal-uiserver.sar/META-INF/jboss-service.xml
===================================================================
--- branches/UIServer/uiserver/src/resources/portal-uiserver.sar/META-INF/jboss-service.xml 2007-11-12 22:33:29 UTC (rev 8890)
+++ branches/UIServer/uiserver/src/resources/portal-uiserver.sar/META-INF/jboss-service.xml 2007-11-12 22:40:53 UTC (rev 8891)
@@ -32,25 +32,6 @@
<depends optional-attribute-name="PresentationServer" proxy-type="attribute">portal:service=PresentationServer</depends>
</mbean>
<mbean
- code="org.jboss.portal.presentation.server.PresentationServerImpl"
- name="portal:service=PresentationServer"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="PortalObjectReader" proxy-type="attribute">portal:container=PortalObjectReader</depends>
- <depends optional-attribute-name="Processor" proxy-type="attribute">portal:service=Processor</depends>
- <depends>portal:service=PageService</depends>
- <depends>portal:commandFactory=DefaultPortal</depends>
- <depends>portal:urlFactory=Delegating</depends>
- <depends>portal:service=InterceptorStackFactory,type=Command</depends>
- <depends>portal:container=Instance</depends>
- <depends>portal:service=PortalAuthorizationManagerFactory</depends>
- <depends>portal:service=CustomizationManager</depends>
- <depends>portal:service=ContentProviderRegistry</depends>
- <depends>portal:service=ResponseHandler,type=Selector</depends>
- <depends>portal:service=ControlPolicy,type=Page</depends>
- </mbean>
- <mbean
code="org.jboss.portal.uiserver.service.EntryPointImpl"
name="portal:service=EntryPoint"
xmbean-dd=""
16 years, 11 months
JBoss Portal SVN: r8890 - in branches/UIServer: core/src/main/org/jboss/portal/core/presentation and 9 other directories.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2007-11-12 17:33:29 -0500 (Mon, 12 Nov 2007)
New Revision: 8890
Added:
branches/UIServer/core/src/main/org/jboss/portal/core/presentation/
branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/
branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/MainProcessor.java
branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/PortalObjectReaderImpl.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/PortalObjectReader.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/PresentationServer.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/PresentationServerImpl.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/Processor.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/ProcessorRequest.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/ProcessorResponse.java
Removed:
branches/UIServer/core/src/main/org/jboss/portal/core/processor/
branches/UIServer/core/src/main/org/jboss/portal/core/spi/
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/spi/
Modified:
branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/PortalEntryPoint.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/UIServer.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/ajax/PortalEntryPoint.java
branches/UIServer/uiserver/src/resources/portal-uiserver.sar/META-INF/jboss-service.xml
Log:
refactoring
Added: branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/MainProcessor.java
===================================================================
--- branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/MainProcessor.java (rev 0)
+++ branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/MainProcessor.java 2007-11-12 22:33:29 UTC (rev 8890)
@@ -0,0 +1,224 @@
+/******************************************************************************
+ * 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;
+
+import java.io.InputStream;
+import java.util.Map;
+import java.util.List;
+import java.util.Iterator;
+import java.util.ArrayList;
+
+import org.apache.log4j.Logger;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletOutputStream;
+
+import org.jboss.portal.common.util.MarkupInfo;
+import org.jboss.portal.common.io.IOTools;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.web.ServletContextDispatcher;
+import org.jboss.portal.server.RequestControllerDispatcher;
+import org.jboss.portal.server.ServerException;
+import org.jboss.portal.server.RequestController;
+import org.jboss.portal.server.ServerInvocation;
+import org.jboss.portal.theme.page.PageResult;
+import org.jboss.portal.theme.page.WindowContext;
+import org.jboss.portal.theme.page.WindowResult;
+
+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.uiserver.protocol.Page;
+import org.jboss.portal.uiserver.protocol.Window;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class MainProcessor extends AbstractJBossService implements Processor
+{
+ /**
+ *
+ */
+ private static Logger log = Logger.getLogger(MainProcessor.class);
+
+ /**
+ *
+ */
+ private RequestController requestController = null;
+
+ /**
+ *
+ * @return
+ */
+ public RequestController getRequestController()
+ {
+ return requestController;
+ }
+
+ /**
+ *
+ * @param requestController
+ */
+ public void setRequestController(RequestController requestController)
+ {
+ this.requestController = requestController;
+ }
+
+ /**
+ *
+ */
+ public ProcessorResponse process(ProcessorRequest request) throws ServerException
+ {
+ try
+ {
+ /*
+ This should process the request sent in from the UIServer using whatever framework the core Portal implements
+ Basically based on the information sent in by the ProcessorRequest this component should have all the information
+ it needs to perform necessary action inside the Portal
+ the Processor should use the values sent in the ProcessorRequest object to perform
+ the appropriate action and then send its Response back to the UIServer which should process
+ the Response and sent a Response back to the client
+ */
+ ProcessorResponse response = null;
+
+ //For now, just for prototype sake just use the existing Controller to produce the outcome
+ request.getServerInvocation().setHandler(new RequestControllerDispatcher(this.requestController));
+ request.getServerInvocation().invokeNext();
+
+ //Get access to the core Portal objects to be used after the execution of the incoming Portal request
+ //by the Portal Controller
+ ServerInvocation invocation = request.getServerInvocation();
+ ServletContextDispatcher dispatcher = new ServletContextDispatcher(invocation.getServerContext().getClientRequest(),
+ invocation.getServerContext().getClientResponse(), invocation.getRequest().getServer().getServletContainerContext());
+ String task = (String)invocation.getServerContext().getClientRequest().getAttribute("pfTask");
+ if(task.equals("aggregate"))
+ {
+ //Handle page aggregation and sending result back to the client
+ MarkupInfo markupInfo = (MarkupInfo)invocation.getResponse().getContentInfo();
+ PageResult pageResult = (PageResult)invocation.getServerContext().getClientRequest().getAttribute("pageResult");
+
+ //Now generate a ProcessorResponse by mapping the data produced during the execution of
+ //the Portal Request
+ String contentType = markupInfo.getContentType() + "; charset=" + markupInfo.getCharset();
+ Page pageToBeDisplayed = new Page();
+ pageToBeDisplayed.setCurrentlyDisplayed(true);
+
+ //Setup information inside the page object
+ pageToBeDisplayed.setName(pageResult.getPageName());
+ List windows = this.getWindows(pageResult.getWindowContextMap());
+ if(windows != null)
+ {
+ pageToBeDisplayed.getChildren().addAll(windows);
+ }
+
+ //
+ List updatedPages = new ArrayList();
+ updatedPages.add(pageToBeDisplayed);
+
+ //Generate the response to be sent back for processing by the Presentation Framework
+ response = new ProcessorResponse(dispatcher, contentType, markupInfo.getCharset(), updatedPages);
+ }
+ else if(task.equals("stream"))
+ {
+ //Handle sending back binary content back to the client
+ String contentType = (String)invocation.getServerContext().getClientRequest().getAttribute("contentType");
+ InputStream in = (InputStream)invocation.getServerContext().getClientRequest().getAttribute("inputStream");
+
+ //Process and see if binary content needs to be sent back...
+ //In this case write the response to the OutputStream directly
+ //There is no need for any Presentation Framework processing
+ if(contentType != null && in != null)
+ {
+ HttpServletResponse resp = invocation.getServerContext().getClientResponse();
+ resp.setContentType(contentType);
+ ServletOutputStream sout = null;
+ try
+ {
+ sout = resp.getOutputStream();
+ byte[] buf = new byte[2048];
+ int len;
+ while ((len = in.read(buf)) > 0)
+ {
+ sout.write(buf, 0, len);
+ }
+ sout.flush();
+ }
+ finally
+ {
+ IOTools.safeClose(in);
+ IOTools.safeClose(sout);
+ }
+ }
+ }
+ else if(task.equals("redirect"))
+ {
+ //Handle sendRedirect back to the client
+ String url = (String)invocation.getServerContext().getClientRequest().getAttribute("url");
+ invocation.getServerContext().getClientResponse().sendRedirect(url);
+ }
+ else if(task.equals("error"))
+ {
+ //Handle sendingErrror back to the client
+ Integer errorCode = (Integer)invocation.getServerContext().getClientRequest().getAttribute("errorCode");
+ invocation.getServerContext().getClientResponse().sendError(errorCode.intValue());
+ }
+
+
+ return response;
+ }
+ catch(Exception e)
+ {
+ throw new ServerException(e);
+ }
+ }
+
+ /**
+ *
+ * @param windowContexts
+ * @return
+ */
+ private List getWindows(Map windowContexts)
+ {
+ List windows = null;
+
+ if(windowContexts != null)
+ {
+ windows = new ArrayList();
+ for(Iterator itr=windowContexts.keySet().iterator(); itr.hasNext();)
+ {
+ String windowId = (String)itr.next();
+ WindowContext windowContext = (WindowContext)windowContexts.get(windowId);
+ WindowResult windowResult = windowContext.getResult();
+
+ Window window = new Window(windowId, windowResult.getTitle(),
+ windowResult.getContent(), windowResult.getHeaderContent(),
+ windowResult.getWindowState(), windowResult.getMode());
+
+ windows.add(window);
+ }
+ }
+
+ return windows;
+ }
+}
Added: branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/PortalObjectReaderImpl.java
===================================================================
--- branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/PortalObjectReaderImpl.java (rev 0)
+++ branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/PortalObjectReaderImpl.java 2007-11-12 22:33:29 UTC (rev 8890)
@@ -0,0 +1,203 @@
+/******************************************************************************
+ * 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;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.ArrayList;
+import java.util.StringTokenizer;
+
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.core.model.portal.PortalObjectContainer;
+import org.jboss.portal.core.model.portal.PortalContainer;
+
+import org.jboss.portal.uiserver.protocol.Portal;
+import org.jboss.portal.uiserver.protocol.PortalObject;
+import org.jboss.portal.uiserver.protocol.Page;
+import org.jboss.portal.uiserver.protocol.Window;
+import org.jboss.portal.presentation.server.PortalObjectReader;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class PortalObjectReaderImpl extends AbstractJBossService implements PortalObjectReader
+{
+ private PortalObjectContainer portalObjectContainer = null;
+
+ /**
+ *
+ * @return
+ */
+ public PortalObjectContainer getPortalObjectContainer()
+ {
+ return portalObjectContainer;
+ }
+
+ /**
+ *
+ * @param portalObjectContainer
+ */
+ public void setPortalObjectContainer(
+ PortalObjectContainer portalObjectContainer)
+ {
+ this.portalObjectContainer = portalObjectContainer;
+ }
+
+ /**
+ *
+ */
+ public Portal findPortal(String id)
+ {
+ Portal portal = null;
+ PortalContainer portalContainer = this.portalObjectContainer.getContext();
+
+ org.jboss.portal.core.model.portal.Portal cour = portalContainer
+ .getPortal(id);
+ if (cour != null)
+ {
+ portal = new Portal();
+ portal.setId(cour.getId().toString());
+ portal.setName(cour.getName());
+
+ // Setup top level children for this node
+ Collection children = cour.getChildren();
+ Collection portalChildren = new ArrayList();
+ for (Iterator itr = children.iterator(); itr.hasNext();)
+ {
+ org.jboss.portal.core.model.portal.PortalObject child = (org.jboss.portal.core.model.portal.PortalObject) itr
+ .next();
+
+ PortalObject portalChild = null;
+
+ if (child instanceof org.jboss.portal.core.model.portal.Page)
+ {
+ portalChild = new Page();
+ portalChild.setId(child.getId().toString());
+ portalChild.setName(child.getName());
+ portalChild.setParent(portal);
+ portalChildren.add(portalChild);
+ }
+ else if (child instanceof org.jboss.portal.core.model.portal.Window)
+ {
+ portalChild = new Window();
+ portalChild.setId(child.getId().toString());
+ portalChild.setName(child.getName());
+ portalChild.setParent(portal);
+ portalChildren.add(portalChild);
+ }
+ }
+
+ portal.setChildren(portalChildren);
+ }
+
+ return portal;
+ }
+
+ /**
+ *
+ */
+ public PortalObject findPortalObject(PortalObject parent, String id)
+ {
+ PortalObject portalObject = null;
+ PortalContainer portalContainer = this.portalObjectContainer.getContext();
+
+ //Find the Portal to introspect
+ int startIndex = 1;
+ int endIndex = id.indexOf('/', startIndex);
+ String portalName = id.substring(startIndex, endIndex);
+ org.jboss.portal.core.model.portal.Portal portal = portalContainer.getPortal(portalName);
+ if(portal == null)
+ {
+ return null;
+ }
+
+ //Find the Portal Object inside this Portal represented by the id
+ org.jboss.portal.core.model.portal.PortalObject cour = null;
+ StringTokenizer st = new StringTokenizer(id, "/");
+ while(st.hasMoreTokens())
+ {
+ String token = st.nextToken();
+
+ if(cour == null)
+ {
+ cour = portal.getChild(token);
+ }
+ else
+ {
+ cour = cour.getChild(token);
+ }
+ }
+
+ //Map the Portal Object to the protocol Portal Object
+ if (cour != null)
+ {
+ if (cour instanceof org.jboss.portal.core.model.portal.Page)
+ {
+ portalObject = new Page();
+ }
+ else if (cour instanceof org.jboss.portal.core.model.portal.Window)
+ {
+ portalObject = new Window();
+ }
+
+ if (portalObject != null)
+ {
+ portalObject.setId(cour.getId().toString());
+ portalObject.setName(cour.getName());
+ portalObject.setParent(parent);
+
+ // Setup top level children for this node
+ Collection children = cour.getChildren();
+ Collection portalChildren = new ArrayList();
+ for (Iterator itr = children.iterator(); itr.hasNext();)
+ {
+ org.jboss.portal.core.model.portal.PortalObject child = (org.jboss.portal.core.model.portal.PortalObject) itr
+ .next();
+
+ PortalObject portalChild = null;
+
+ if (child instanceof org.jboss.portal.core.model.portal.Page)
+ {
+ portalChild = new Page();
+ portalChild.setId(child.getId().toString());
+ portalChild.setName(child.getName());
+ portalChild.setParent(portalObject);
+ portalChildren.add(portalChild);
+ }
+ else if (child instanceof org.jboss.portal.core.model.portal.Window)
+ {
+ portalChild = new Window();
+ portalChild.setId(child.getId().toString());
+ portalChild.setName(child.getName());
+ portalChild.setParent(portalObject);
+ portalChildren.add(portalChild);
+ }
+ }
+ portalObject.setChildren(portalChildren);
+ }
+ }
+
+ return portalObject;
+ }
+}
Modified: branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-11-12 21:46:19 UTC (rev 8889)
+++ branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-11-12 22:33:29 UTC (rev 8890)
@@ -1092,7 +1092,7 @@
proxy-type="attribute">portal:service=ControlPolicy,type=Page</depends>
</mbean>
<mbean
- code="org.jboss.portal.core.processor.MainProcessor"
+ code="org.jboss.portal.core.presentation.server.MainProcessor"
name="portal:service=Processor"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
@@ -1111,7 +1111,7 @@
<depends>portal:service=ControlPolicy,type=Page</depends>
</mbean>
<mbean
- code="org.jboss.portal.core.spi.PortalObjectReaderImpl"
+ code="org.jboss.portal.core.presentation.server.PortalObjectReaderImpl"
name="portal:container=PortalObjectReader"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
Added: branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/PortalObjectReader.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/PortalObjectReader.java (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/PortalObjectReader.java 2007-11-12 22:33:29 UTC (rev 8890)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.presentation.server;
+
+import org.jboss.portal.uiserver.protocol.Portal;
+import org.jboss.portal.uiserver.protocol.PortalObject;
+
+/**
+ * The PortalObjectReader service is used to provide information about different Portal Objects stored in the system
+ *
+ * It provides an implementation independent way to query this information without any coupling to low level Portal container
+ * implementation details
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public interface PortalObjectReader
+{
+ /**
+ * Finds a Portal registered with the specified id in the system
+ *
+ * @param id
+ * @return
+ */
+ public Portal findPortal(String id);
+
+ /**
+ * Finds a PortalObject registered as a child of the specified parent
+ *
+ * @param portal
+ * @param id
+ * @return
+ */
+ public PortalObject findPortalObject(PortalObject parent, String id);
+}
Added: branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/PresentationServer.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/PresentationServer.java (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/PresentationServer.java 2007-11-12 22:33:29 UTC (rev 8890)
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * 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.presentation.server;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public interface PresentationServer
+{
+ /**
+ *
+ * @return
+ */
+ public Processor getProcessor();
+
+ /**
+ *
+ * @return
+ */
+ public PortalObjectReader getPortalObjectReader();
+}
Added: branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/PresentationServerImpl.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/PresentationServerImpl.java (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/PresentationServerImpl.java 2007-11-12 22:33:29 UTC (rev 8890)
@@ -0,0 +1,94 @@
+/******************************************************************************
+ * 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.presentation.server;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class PresentationServerImpl implements PresentationServer
+{
+ private Processor processor = null;
+ private PortalObjectReader portalObjectReader = null;
+
+ /**
+ *
+ *
+ */
+ public PresentationServerImpl()
+ {
+
+ }
+
+ /**
+ *
+ *
+ */
+ public void start()
+ {
+
+ }
+
+ /**
+ *
+ *
+ */
+ public void stop()
+ {
+
+ }
+
+ /**
+ *
+ */
+ public PortalObjectReader getPortalObjectReader()
+ {
+ return this.portalObjectReader;
+ }
+
+ /**
+ *
+ * @param portalObjectReader
+ */
+ public void setPortalObjectReader(PortalObjectReader portalObjectReader)
+ {
+ this.portalObjectReader = portalObjectReader;
+ }
+
+ /**
+ *
+ */
+ public Processor getProcessor()
+ {
+ return this.processor;
+ }
+
+ /**
+ *
+ * @param processor
+ */
+ public void setProcessor(Processor processor)
+ {
+ this.processor = processor;
+ }
+}
Added: branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/Processor.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/Processor.java (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/Processor.java 2007-11-12 22:33:29 UTC (rev 8890)
@@ -0,0 +1,43 @@
+/******************************************************************************
+ * 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.presentation.server;
+
+import org.jboss.portal.server.ServerException;
+
+/**
+ * UIServer calls the Processor to hand it
+ * processing of an incoming Portal Request using the protocol between the two components encapsulated by the
+ * ProcessorRequest object
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public interface Processor
+{
+ /**
+ *
+ * @param request
+ * @throws ServerException
+ */
+ public ProcessorResponse process(ProcessorRequest request) throws ServerException;
+}
Added: branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/ProcessorRequest.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/ProcessorRequest.java (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/ProcessorRequest.java 2007-11-12 22:33:29 UTC (rev 8890)
@@ -0,0 +1,153 @@
+/******************************************************************************
+ * 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.presentation.server;
+
+import java.io.Serializable;
+
+import org.jboss.portal.uiserver.protocol.Portal;
+import org.jboss.portal.uiserver.protocol.PortalObject;
+import org.jboss.portal.server.ServerInvocation;
+
+
+/**
+ * ProcessorRequest is used to communicate information from the UIServer to the core Portal for it to process the incoming Portal request.
+ *
+ * This object is part of the protocol between the UIServer and the core
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class ProcessorRequest implements Serializable
+{
+ /**
+ * Target object where action needs to be performed
+ */
+ private PortalObject target = null;
+
+ /**
+ * The Portal that the target object belongs to
+ */
+ private Portal portal = null;
+
+ /**
+ * The Portal action to be performed. For now, action and render
+ */
+ private String actionType = null;
+
+
+ private ServerInvocation serverInvocation = null;
+
+ /**
+ *
+ *
+ */
+ public ProcessorRequest(String actionType, ServerInvocation serverInvocation, Portal portal, PortalObject target)
+ {
+ this.actionType = actionType;
+ this.serverInvocation = serverInvocation;
+ this.portal = portal;
+ this.target = target;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getActionType()
+ {
+ return actionType;
+ }
+
+ /**
+ *
+ * @param actionType
+ */
+ public void setActionType(String actionType)
+ {
+ this.actionType = actionType;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public Portal getPortal()
+ {
+ return portal;
+ }
+
+ /**
+ *
+ * @param portal
+ */
+ public void setPortal(Portal portal)
+ {
+ this.portal = portal;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public PortalObject getTarget()
+ {
+ return target;
+ }
+
+ /**
+ *
+ * @param target
+ */
+ public void setTarget(PortalObject target)
+ {
+ this.target = target;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public ServerInvocation getServerInvocation()
+ {
+ return serverInvocation;
+ }
+
+ /**
+ *
+ * @param serverInvocation
+ */
+ public void setServerInvocation(ServerInvocation serverInvocation)
+ {
+ this.serverInvocation = serverInvocation;
+ }
+
+ /**
+ *
+ */
+ public String toString()
+ {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("[actionType="+this.actionType+", portal="+this.portal+", target="+this.target+"]");
+ return buffer.toString();
+ }
+}
Added: branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/ProcessorResponse.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/ProcessorResponse.java (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/ProcessorResponse.java 2007-11-12 22:33:29 UTC (rev 8890)
@@ -0,0 +1,171 @@
+/******************************************************************************
+ * 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.presentation.server;
+
+import java.io.Serializable;
+import java.util.List;
+
+import org.jboss.portal.web.ServletContextDispatcher;
+
+import org.jboss.portal.uiserver.protocol.Page;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class ProcessorResponse implements Serializable
+{
+ /**
+ *
+ */
+ private ServletContextDispatcher dispatcher = null;
+
+ /**
+ * Contains a list of pages that need to be updated on the client. These pages may not necessarily
+ * be the currently displayed page, but nevertheless, these are pages whose window content changed
+ * as a result of this particular Portal request processing.
+ *
+ * For most usecases this probably only consist of the Page that is currently being displayed on the client
+ */
+ private List updatedPages = null;
+
+ /**
+ * Content Type of the response being sent back to the client
+ */
+ private String contentType = null;
+
+ /**
+ * Character Set of the response being sent back to the client
+ */
+ private String charSet = null;
+
+
+ /**
+ *
+ * @param dispatcher
+ * @param updatedPages
+ */
+ public ProcessorResponse(ServletContextDispatcher dispatcher, String contentType, String charSet, List updatedPages)
+ {
+ this.dispatcher = dispatcher;
+ this.contentType = contentType;
+ this.charSet = charSet;
+ this.updatedPages = updatedPages;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public ServletContextDispatcher getDispatcher()
+ {
+ return dispatcher;
+ }
+
+ /**
+ *
+ * @param dispatcher
+ */
+ public void setDispatcher(ServletContextDispatcher dispatcher)
+ {
+ this.dispatcher = dispatcher;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public List getUpdatedPages()
+ {
+ return updatedPages;
+ }
+
+ /**
+ *
+ * @param updatedPages
+ */
+ public void setUpdatedPages(List updatedPages)
+ {
+ this.updatedPages = updatedPages;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getCharSet()
+ {
+ return charSet;
+ }
+
+ /**
+ *
+ * @param charSet
+ */
+ public void setCharSet(String charSet)
+ {
+ this.charSet = charSet;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getContentType()
+ {
+ return contentType;
+ }
+
+ /**
+ *
+ * @param contentType
+ */
+ public void setContentType(String contentType)
+ {
+ this.contentType = contentType;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public Page findDisplayedPage()
+ {
+ Page displayedPage = null;
+
+ if(this.updatedPages != null)
+ {
+ for(int i=0; i<this.updatedPages.size(); i++)
+ {
+ Page cour = (Page)this.updatedPages.get(i);
+ if(cour.isCurrentlyDisplayed())
+ {
+ displayedPage = cour;
+ break;
+ }
+ }
+ }
+
+ return displayedPage;
+ }
+}
Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/PortalEntryPoint.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/PortalEntryPoint.java 2007-11-12 21:46:19 UTC (rev 8889)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/PortalEntryPoint.java 2007-11-12 22:33:29 UTC (rev 8890)
@@ -69,7 +69,7 @@
import org.jboss.portal.uiserver.protocol.Container;
import org.jboss.portal.uiserver.protocol.Page;
import org.jboss.portal.uiserver.protocol.Window;
-import org.jboss.portal.uiserver.processor.ProcessorResponse;
+import org.jboss.portal.presentation.server.ProcessorResponse;
/**
* The Portal Server Entry Point for classic html mode
Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/UIServer.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/UIServer.java 2007-11-12 21:46:19 UTC (rev 8889)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/UIServer.java 2007-11-12 22:33:29 UTC (rev 8890)
@@ -27,12 +27,12 @@
import org.jboss.portal.uiserver.protocol.PortalObject;
import org.jboss.portal.uiserver.protocol.Portal;
-import org.jboss.portal.uiserver.processor.Processor;
-import org.jboss.portal.uiserver.processor.ProcessorRequest;
-import org.jboss.portal.uiserver.processor.ProcessorResponse;
-import org.jboss.portal.uiserver.spi.PortalObjectReader;
+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.server.PortalObjectReader;
+import org.jboss.portal.presentation.server.PresentationServer;
-import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.server.RequestController;
import org.jboss.portal.server.ServerException;
import org.jboss.portal.server.ServerInvocation;
@@ -48,20 +48,16 @@
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
*
*/
-public class UIServer extends AbstractJBossService implements RequestController
+public class UIServer implements RequestController
{
/**
*
*/
- private PortalObjectReader portalObjectReader = null;
+ private PresentationServer presentationServer = null;
+
/**
*
- */
- private Processor processor = null;
-
- /**
- *
*
*/
public UIServer()
@@ -92,7 +88,7 @@
String token = st.nextToken();
if(portal == null)
{
- portal = this.portalObjectReader.findPortal(token);
+ portal = this.presentationServer.getPortalObjectReader().findPortal(token);
if(portal != null)
{
buffer.append(token);
@@ -116,7 +112,7 @@
target = portal.findChild(id);
if(target == null)
{
- target = this.portalObjectReader.findPortalObject(portal, id);
+ target = this.presentationServer.getPortalObjectReader().findPortalObject(portal, id);
}
}
else
@@ -124,7 +120,7 @@
PortalObject cour = target.findChild(id);
if(cour == null)
{
- target = this.portalObjectReader.findPortalObject(target, id);
+ target = this.presentationServer.getPortalObjectReader().findPortalObject(target, id);
}
else
{
@@ -141,7 +137,7 @@
}
ProcessorRequest processorRequest = new ProcessorRequest(actionType, invocation, portal, target);
- ProcessorResponse processorResponse = this.processor.process(processorRequest);
+ ProcessorResponse processorResponse = this.presentationServer.getProcessor().process(processorRequest);
//Go ahead and render to the client based on ProcessorResponse received from the core Portal
if(processorResponse != null)
@@ -153,40 +149,40 @@
{
throw new ServerException(e);
}
- }
- //-----------------------------------------------------------------------------------------------------------------------------------------------------------
+ }
+
/**
*
+ *
*/
- public PortalObjectReader getPortalObjectReader()
+ public void start()
{
- return portalObjectReader;
+
}
-
+
/**
*
- * @param portalObjectReader
+ *
*/
- public void setPortalObjectReader(PortalObjectReader portalObjectReader)
+ public void stop()
{
- this.portalObjectReader = portalObjectReader;
+
}
-
+ //-----------------------------------------------------------------------------------------------------------------------------------------------------------
/**
*
- * @return
*/
- public Processor getProcessor()
+ public PresentationServer getPresentationServer()
{
- return processor;
+ return presentationServer;
}
/**
*
- * @param processor
+ * @param presentationServer
*/
- public void setProcessor(Processor processor)
+ public void setPresentationServer(PresentationServer presentationServer)
{
- this.processor = processor;
+ this.presentationServer = presentationServer;
}
}
Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/ajax/PortalEntryPoint.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/ajax/PortalEntryPoint.java 2007-11-12 21:46:19 UTC (rev 8889)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/ajax/PortalEntryPoint.java 2007-11-12 22:33:29 UTC (rev 8890)
@@ -32,7 +32,7 @@
import org.jboss.portal.uiserver.ajax.client.service.PortalRPC;
import org.jboss.portal.uiserver.ajax.client.protocol.Page;
import org.jboss.portal.uiserver.ajax.client.protocol.Window;
-import org.jboss.portal.uiserver.processor.ProcessorResponse;
+import org.jboss.portal.presentation.server.ProcessorResponse;
import org.jboss.portal.uiserver.service.EntryPoint;
import com.google.gwt.user.client.rpc.SerializationException;
Modified: branches/UIServer/uiserver/src/resources/portal-uiserver.sar/META-INF/jboss-service.xml
===================================================================
--- branches/UIServer/uiserver/src/resources/portal-uiserver.sar/META-INF/jboss-service.xml 2007-11-12 21:46:19 UTC (rev 8889)
+++ branches/UIServer/uiserver/src/resources/portal-uiserver.sar/META-INF/jboss-service.xml 2007-11-12 22:33:29 UTC (rev 8890)
@@ -29,6 +29,14 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
+ <depends optional-attribute-name="PresentationServer" proxy-type="attribute">portal:service=PresentationServer</depends>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.presentation.server.PresentationServerImpl"
+ name="portal:service=PresentationServer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
<depends optional-attribute-name="PortalObjectReader" proxy-type="attribute">portal:container=PortalObjectReader</depends>
<depends optional-attribute-name="Processor" proxy-type="attribute">portal:service=Processor</depends>
<depends>portal:service=PageService</depends>
16 years, 11 months
JBoss Portal SVN: r8889 - in branches/UIServer: build and 6 other directories.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2007-11-12 16:46:19 -0500 (Mon, 12 Nov 2007)
New Revision: 8889
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/Processor.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/ProcessorRequest.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/ProcessorResponse.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Component.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Container.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Page.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Portal.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/PortalObject.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Window.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/spi/
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/spi/PortalObjectReader.java
Removed:
branches/UIServer/core-uiserver/
Modified:
branches/UIServer/build/build.xml
branches/UIServer/core/build.xml
branches/UIServer/uiserver/build.xml
Log:
removing core-uiserver module and moving to uiserver
Modified: branches/UIServer/build/build.xml
===================================================================
--- branches/UIServer/build/build.xml 2007-11-12 21:14:44 UTC (rev 8888)
+++ branches/UIServer/build/build.xml 2007-11-12 21:46:19 UTC (rev 8889)
@@ -139,14 +139,13 @@
<module name="workflow"/>
<module name="widget"/>
<module name="uiserver"/>
- <module name="core-uiserver"/>
<!--<module name="core-admin"/>-->
<!-- Module groups -->
<group name="portal">
<include
- modules="common, test, api, web, jems, server, security, identity, search, format, portlet, portlet-server, bridge, faces, portlet-federation, theme, workflow, cms, registration, core-uiserver, uiserver, core, wsrp, core-admin, core-cms, core-management, core-samples, widget"/>
+ modules="common, test, api, web, jems, server, security, identity, search, format, portlet, portlet-server, bridge, faces, portlet-federation, theme, workflow, cms, registration, uiserver, core, wsrp, core-admin, core-cms, core-management, core-samples, widget"/>
</group>
<group name="cms">
Modified: branches/UIServer/core/build.xml
===================================================================
--- branches/UIServer/core/build.xml 2007-11-12 21:14:44 UTC (rev 8888)
+++ branches/UIServer/core/build.xml 2007-11-12 21:46:19 UTC (rev 8889)
@@ -133,7 +133,7 @@
<path refid="jboss.portlet-api.classpath"/>
<path refid="jboss.portal-theme.classpath"/>
<path refid="jboss.portal-security.classpath"/>
- <path refid="jboss.portal-core-uiserver.classpath"/>
+ <path refid="jboss.portal-uiserver.classpath"/>
<path refid="jboss.portal-test.classpath"/>
</path>
@@ -380,13 +380,7 @@
</target>
<!-- Build the jboss-portal.sar -->
- <target name="pre-output">
- <copy todir="${build.resources}/jboss-portal/lib">
- <fileset dir="${jboss.portal-core-uiserver.root}/lib" includes="portal-core-uiserver-lib.jar"/>
- </copy>
- <copy todir="${build.resources}/jboss-portal.sar/lib">
- <fileset dir="${jboss.portal-core-uiserver.root}/lib" includes="portal-core-uiserver-lib.jar"/>
- </copy>
+ <target name="pre-output">
<copy todir="${build.resources}/jboss-portal/portal-uiserver.sar">
<fileset dir="${jboss.portal-uiserver.root}/resources/portal-uiserver.sar"/>
</copy>
Modified: branches/UIServer/uiserver/build.xml
===================================================================
--- branches/UIServer/uiserver/build.xml 2007-11-12 21:14:44 UTC (rev 8888)
+++ branches/UIServer/uiserver/build.xml 2007-11-12 21:46:19 UTC (rev 8889)
@@ -98,10 +98,12 @@
<!-- Configure modules -->
<call target="configure-modules"/>
- <path id="dependentmodule.classpath">
+ <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 refid="jboss.portal-core-uiserver.classpath"/>
</path>
Added: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/Processor.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/Processor.java (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/Processor.java 2007-11-12 21:46:19 UTC (rev 8889)
@@ -0,0 +1,43 @@
+/******************************************************************************
+ * 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.uiserver.processor;
+
+import org.jboss.portal.server.ServerException;
+
+/**
+ * UIServer calls the Processor to hand it
+ * processing of an incoming Portal Request using the protocol between the two components encapsulated by the
+ * ProcessorRequest object
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public interface Processor
+{
+ /**
+ *
+ * @param request
+ * @throws ServerException
+ */
+ public ProcessorResponse process(ProcessorRequest request) throws ServerException;
+}
Added: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/ProcessorRequest.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/ProcessorRequest.java (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/ProcessorRequest.java 2007-11-12 21:46:19 UTC (rev 8889)
@@ -0,0 +1,153 @@
+/******************************************************************************
+ * 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.uiserver.processor;
+
+import java.io.Serializable;
+
+import org.jboss.portal.uiserver.protocol.Portal;
+import org.jboss.portal.uiserver.protocol.PortalObject;
+import org.jboss.portal.server.ServerInvocation;
+
+
+/**
+ * ProcessorRequest is used to communicate information from the UIServer to the core Portal for it to process the incoming Portal request.
+ *
+ * This object is part of the protocol between the UIServer and the core
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class ProcessorRequest implements Serializable
+{
+ /**
+ * Target object where action needs to be performed
+ */
+ private PortalObject target = null;
+
+ /**
+ * The Portal that the target object belongs to
+ */
+ private Portal portal = null;
+
+ /**
+ * The Portal action to be performed. For now, action and render
+ */
+ private String actionType = null;
+
+
+ private ServerInvocation serverInvocation = null;
+
+ /**
+ *
+ *
+ */
+ public ProcessorRequest(String actionType, ServerInvocation serverInvocation, Portal portal, PortalObject target)
+ {
+ this.actionType = actionType;
+ this.serverInvocation = serverInvocation;
+ this.portal = portal;
+ this.target = target;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getActionType()
+ {
+ return actionType;
+ }
+
+ /**
+ *
+ * @param actionType
+ */
+ public void setActionType(String actionType)
+ {
+ this.actionType = actionType;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public Portal getPortal()
+ {
+ return portal;
+ }
+
+ /**
+ *
+ * @param portal
+ */
+ public void setPortal(Portal portal)
+ {
+ this.portal = portal;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public PortalObject getTarget()
+ {
+ return target;
+ }
+
+ /**
+ *
+ * @param target
+ */
+ public void setTarget(PortalObject target)
+ {
+ this.target = target;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public ServerInvocation getServerInvocation()
+ {
+ return serverInvocation;
+ }
+
+ /**
+ *
+ * @param serverInvocation
+ */
+ public void setServerInvocation(ServerInvocation serverInvocation)
+ {
+ this.serverInvocation = serverInvocation;
+ }
+
+ /**
+ *
+ */
+ public String toString()
+ {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("[actionType="+this.actionType+", portal="+this.portal+", target="+this.target+"]");
+ return buffer.toString();
+ }
+}
Added: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/ProcessorResponse.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/ProcessorResponse.java (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/ProcessorResponse.java 2007-11-12 21:46:19 UTC (rev 8889)
@@ -0,0 +1,171 @@
+/******************************************************************************
+ * 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.uiserver.processor;
+
+import java.io.Serializable;
+import java.util.List;
+
+import org.jboss.portal.web.ServletContextDispatcher;
+
+import org.jboss.portal.uiserver.protocol.Page;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class ProcessorResponse implements Serializable
+{
+ /**
+ *
+ */
+ private ServletContextDispatcher dispatcher = null;
+
+ /**
+ * Contains a list of pages that need to be updated on the client. These pages may not necessarily
+ * be the currently displayed page, but nevertheless, these are pages whose window content changed
+ * as a result of this particular Portal request processing.
+ *
+ * For most usecases this probably only consist of the Page that is currently being displayed on the client
+ */
+ private List updatedPages = null;
+
+ /**
+ * Content Type of the response being sent back to the client
+ */
+ private String contentType = null;
+
+ /**
+ * Character Set of the response being sent back to the client
+ */
+ private String charSet = null;
+
+
+ /**
+ *
+ * @param dispatcher
+ * @param updatedPages
+ */
+ public ProcessorResponse(ServletContextDispatcher dispatcher, String contentType, String charSet, List updatedPages)
+ {
+ this.dispatcher = dispatcher;
+ this.contentType = contentType;
+ this.charSet = charSet;
+ this.updatedPages = updatedPages;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public ServletContextDispatcher getDispatcher()
+ {
+ return dispatcher;
+ }
+
+ /**
+ *
+ * @param dispatcher
+ */
+ public void setDispatcher(ServletContextDispatcher dispatcher)
+ {
+ this.dispatcher = dispatcher;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public List getUpdatedPages()
+ {
+ return updatedPages;
+ }
+
+ /**
+ *
+ * @param updatedPages
+ */
+ public void setUpdatedPages(List updatedPages)
+ {
+ this.updatedPages = updatedPages;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getCharSet()
+ {
+ return charSet;
+ }
+
+ /**
+ *
+ * @param charSet
+ */
+ public void setCharSet(String charSet)
+ {
+ this.charSet = charSet;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getContentType()
+ {
+ return contentType;
+ }
+
+ /**
+ *
+ * @param contentType
+ */
+ public void setContentType(String contentType)
+ {
+ this.contentType = contentType;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public Page findDisplayedPage()
+ {
+ Page displayedPage = null;
+
+ if(this.updatedPages != null)
+ {
+ for(int i=0; i<this.updatedPages.size(); i++)
+ {
+ Page cour = (Page)this.updatedPages.get(i);
+ if(cour.isCurrentlyDisplayed())
+ {
+ displayedPage = cour;
+ break;
+ }
+ }
+ }
+
+ return displayedPage;
+ }
+}
Added: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Component.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Component.java (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Component.java 2007-11-12 21:46:19 UTC (rev 8889)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * 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.uiserver.protocol;
+
+import java.io.Serializable;
+
+/**
+ * Component represents a UI entity that will be rendered eventually on the client
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public interface Component extends Serializable
+{
+ /**
+ *
+ * @return
+ */
+ public String getId();
+
+ /**
+ *
+ * @param id
+ */
+ public void setId(String id);
+
+
+ /**
+ *
+ * @return
+ */
+ public String getMarkup();
+}
Added: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Container.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Container.java (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Container.java 2007-11-12 21:46:19 UTC (rev 8889)
@@ -0,0 +1,134 @@
+/******************************************************************************
+ * 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.uiserver.protocol;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * Container is an organizational entity which aggregates the Components that will be rendered on the client
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class Container implements Serializable
+{
+ /**
+ * required unique id of the container. uniqueness in relation to
+ * other containers added to the same instance of the page
+ */
+ protected String id = null;
+
+
+ /**
+ *
+ */
+ private List components = null;
+
+ /**
+ *
+ *
+ */
+ public Container(String id)
+ {
+ this.id = id;
+ this.components = new ArrayList();
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getId()
+ {
+ return id;
+ }
+
+ /**
+ *
+ * @param id
+ */
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+
+ /**
+ *
+ * @return
+ */
+ public List getComponents()
+ {
+ return components;
+ }
+
+ /**
+ *
+ * @param components
+ */
+ public void setComponents(List components)
+ {
+ this.components = components;
+ }
+
+ /**
+ *
+ * @param componentId
+ * @return
+ */
+ public Component getComponent(String componentId)
+ {
+ Component component = null;
+
+ if(this.components != null)
+ {
+ for(int i=0;i<this.components.size();i++)
+ {
+ Component cour = (Component)this.components.get(i);
+ if(cour.getId().equals(componentId))
+ {
+ component = cour;
+ break;
+ }
+ }
+ }
+
+ return component;
+ }
+
+ /**
+ *
+ * @param component
+ */
+ public void addComponent(Component component)
+ {
+ if(this.components == null)
+ {
+ this.components = new ArrayList();
+ }
+
+ this.components.add(component);
+ }
+}
Added: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Page.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Page.java (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Page.java 2007-11-12 21:46:19 UTC (rev 8889)
@@ -0,0 +1,132 @@
+/******************************************************************************
+ * 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.uiserver.protocol;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class Page extends PortalObject
+{
+ /**
+ * A page consists of multiple containers that are to be displayed/aggregated along with their corresponding
+ * UI components
+ */
+ private List containers = null;
+
+ /**
+ * Signifies if this page is currently being displayed on the client
+ */
+ private boolean currentlyDisplayed = false;
+
+ /**
+ *
+ *
+ */
+ public Page()
+ {
+ super();
+ this.containers = new ArrayList();
+ }
+
+ /**
+ *
+ */
+ public String toString()
+ {
+ return "Page: "+super.toString();
+ }
+
+ /**
+ *
+ * @return
+ */
+ public List getWindows()
+ {
+ List windows = new ArrayList();
+
+ if(this.children != null)
+ {
+ for(Iterator itr=this.children.iterator(); itr.hasNext();)
+ {
+ Object child = itr.next();
+
+ if(child instanceof Window)
+ {
+ windows.add(child);
+ }
+ }
+ }
+
+ return windows;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public List getContainers()
+ {
+ return containers;
+ }
+
+ /**
+ *
+ * @param containers
+ */
+ public void setContainers(List containers)
+ {
+ this.containers = containers;
+ }
+
+ /**
+ *
+ * @param container
+ */
+ public void addContainer(Container container)
+ {
+ this.getContainers().add(container);
+ }
+
+ /**
+ *
+ * @return
+ */
+ public boolean isCurrentlyDisplayed()
+ {
+ return currentlyDisplayed;
+ }
+
+ /**
+ *
+ * @param currentlyDisplayed
+ */
+ public void setCurrentlyDisplayed(boolean currentlyDisplayed)
+ {
+ this.currentlyDisplayed = currentlyDisplayed;
+ }
+}
Added: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Portal.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Portal.java (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Portal.java 2007-11-12 21:46:19 UTC (rev 8889)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * 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.uiserver.protocol;
+
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class Portal extends PortalObject
+{
+ /**
+ *
+ */
+ public String toString()
+ {
+ return "Portal: "+super.toString();
+ }
+}
Added: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/PortalObject.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/PortalObject.java (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/PortalObject.java 2007-11-12 21:46:19 UTC (rev 8889)
@@ -0,0 +1,212 @@
+/******************************************************************************
+ * 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.uiserver.protocol;
+
+import java.io.Serializable;
+import java.util.Map;
+import java.util.Collection;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public abstract class PortalObject implements Serializable
+{
+ protected String id = null;
+ protected String name = null;
+ protected PortalObject parent = null;
+ protected Collection children = null;
+ protected Map properties = null;
+
+ /**
+ *
+ *
+ */
+ public PortalObject()
+ {
+ this.children = new ArrayList();
+ this.properties = new HashMap(5);
+ }
+
+ /**
+ *
+ * @param id
+ * @param name
+ * @param parent
+ * @param children
+ */
+ public PortalObject(String id, String name, PortalObject parent, Collection children)
+ {
+ this.id = id;
+ this.name = name;
+ this.parent = parent;
+ this.children = children;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getId()
+ {
+ return id;
+ }
+
+ /**
+ *
+ * @param id
+ */
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ *
+ * @param name
+ */
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public PortalObject getParent()
+ {
+ return parent;
+ }
+
+ /**
+ *
+ * @param parent
+ */
+ public void setParent(PortalObject parent)
+ {
+ this.parent = parent;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public Collection getChildren()
+ {
+ if(this.children == null)
+ {
+ this.children = new ArrayList();
+ }
+ return children;
+ }
+
+ /**
+ *
+ * @param children
+ */
+ public void setChildren(Collection children)
+ {
+ this.children = children;
+ }
+
+ /**
+ * Recursively traverses the Portal Object's children tree to find a child registered with the
+ * specified id
+ *
+ * @param id
+ * @return
+ */
+ public PortalObject findChild(String id)
+ {
+ PortalObject child = null;
+
+ for(Iterator itr=this.children.iterator(); itr.hasNext();)
+ {
+ PortalObject cour = (PortalObject)itr.next();
+ if(cour.id.equals(id))
+ {
+ child = cour;
+ }
+ else
+ {
+ child = cour.findChild(id);
+ }
+
+ if(child != null)
+ {
+ return child;
+ }
+ }
+
+ return child;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public Map getProperties()
+ {
+ return properties;
+ }
+
+ /**
+ *
+ * @param properties
+ */
+ public void setProperties(Map properties)
+ {
+ this.properties = properties;
+ }
+
+ /**
+ *
+ */
+ public String toString()
+ {
+ String rep = null;
+
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("[");
+ buffer.append("id="+this.id+",");
+ buffer.append("name="+this.name);
+ buffer.append("]");
+
+ rep = buffer.toString();
+
+ return rep;
+ }
+}
Added: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Window.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Window.java (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Window.java 2007-11-12 21:46:19 UTC (rev 8889)
@@ -0,0 +1,240 @@
+/******************************************************************************
+ * 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.uiserver.protocol;
+
+import java.util.Map;
+import java.util.HashMap;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class Window extends PortalObject implements Component
+{
+ /**
+ * Title for this Window
+ */
+ private String title = null;
+
+ /**
+ * Content/Markup to be displayed inside this Window
+ */
+ private String content = null;
+
+ /**
+ * Content/Markup related to the header of this Window
+ */
+ private final String headerContent;
+
+ /**
+ * The State of this Window such as Normal, Maximized, Minimized etc
+ */
+ private final WindowState windowState;
+
+ /**
+ * The Mode of this Window such as View, Edit, Help etc
+ */
+ private final Mode mode;
+
+ /**
+ * Runtime View related meta data associated with this particular window.
+ *
+ * The meta data is provided in the form of Name/Value pairs with Name being the key of the and Value being the Value
+ * of a Map entry
+ */
+ private Map viewMetaData = null;
+
+
+ /**
+ *
+ *
+ */
+ public Window()
+ {
+ super();
+ this.viewMetaData = new HashMap(5);
+ this.headerContent = null;
+ this.windowState = null;
+ this.mode = null;
+ }
+
+ /**
+ *
+ *
+ */
+ public Window(String id,String title, String content, String headerContent, WindowState windowState, Mode mode)
+ {
+ super();
+ this.viewMetaData = new HashMap(5);
+ this.id = id;
+ this.title = title;
+ this.content = content;
+ this.headerContent = headerContent;
+ this.windowState = windowState;
+ this.mode = mode;
+ }
+
+ /**
+ *
+ * @param id
+ * @param content
+ */
+ public Window(String id, String content)
+ {
+ super();
+ this.viewMetaData = new HashMap(5);
+ this.id = id;
+ this.content = content;
+ this.headerContent = null;
+ this.windowState = null;
+ this.mode = null;
+ }
+
+ /**
+ *
+ * @param id
+ * @param content
+ */
+ public Window(String id)
+ {
+ super();
+ this.viewMetaData = new HashMap(5);
+ this.id = id;
+ this.headerContent = null;
+ this.windowState = null;
+ this.mode = null;
+ }
+
+
+ /**
+ *
+ * @return
+ */
+ public String getContent()
+ {
+ return content;
+ }
+
+
+ /**
+ *
+ * @param content
+ */
+ public void setContent(String content)
+ {
+ this.content = content;
+ }
+
+
+ /**
+ *
+ * @return
+ */
+ public String getHeaderContent()
+ {
+ return headerContent;
+ }
+
+
+ /**
+ *
+ * @return
+ */
+ public Mode getMode()
+ {
+ return mode;
+ }
+
+
+ /**
+ *
+ * @return
+ */
+ public String getTitle()
+ {
+ return title;
+ }
+
+
+ /**
+ *
+ * @param title
+ */
+ public void setTitle(String title)
+ {
+ this.title = title;
+ }
+
+
+ /**
+ *
+ * @return
+ */
+ public WindowState getWindowState()
+ {
+ return windowState;
+ }
+
+
+ /**
+ *
+ */
+ public String toString()
+ {
+ return "Window: "+super.toString();
+ }
+
+ /**
+ *
+ */
+ public String getMarkup()
+ {
+ String markup = "";
+
+ markup = this.content;
+
+ return markup;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public Map getViewMetaData()
+ {
+ return viewMetaData;
+ }
+
+ /**
+ *
+ * @param viewMetaData
+ */
+ public void setViewMetaData(Map viewMetaData)
+ {
+ this.viewMetaData = viewMetaData;
+ }
+}
Added: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/spi/PortalObjectReader.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/spi/PortalObjectReader.java (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/spi/PortalObjectReader.java 2007-11-12 21:46:19 UTC (rev 8889)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.uiserver.spi;
+
+import org.jboss.portal.uiserver.protocol.Portal;
+import org.jboss.portal.uiserver.protocol.PortalObject;
+
+/**
+ * The PortalObjectReader service is used to provide information about different Portal Objects stored in the system
+ *
+ * It provides an implementation independent way to query this information without any coupling to low level Portal container
+ * implementation details
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public interface PortalObjectReader
+{
+ /**
+ * Finds a Portal registered with the specified id in the system
+ *
+ * @param id
+ * @return
+ */
+ public Portal findPortal(String id);
+
+ /**
+ * Finds a PortalObject registered as a child of the specified parent
+ *
+ * @param portal
+ * @param id
+ * @return
+ */
+ public PortalObject findPortalObject(PortalObject parent, String id);
+}
16 years, 11 months
JBoss Portal SVN: r8888 - modules/common/trunk/common/src/main/java/org/jboss/portal/common/i18n.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-11-12 16:14:44 -0500 (Mon, 12 Nov 2007)
New Revision: 8888
Modified:
modules/common/trunk/common/src/main/java/org/jboss/portal/common/i18n/LocaleFormat.java
Log:
- Make *_NO_CACHE instances not cached and other instances cached.
Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common/i18n/LocaleFormat.java
===================================================================
--- modules/common/trunk/common/src/main/java/org/jboss/portal/common/i18n/LocaleFormat.java 2007-11-12 20:57:56 UTC (rev 8887)
+++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/i18n/LocaleFormat.java 2007-11-12 21:14:44 UTC (rev 8888)
@@ -36,16 +36,16 @@
{
/** . */
- final LocaleFormat RFC3066_LANGUAGE_TAG = new RFC3066LanguageTagLocaleFormat();
+ final LocaleFormat RFC3066_LANGUAGE_TAG_NO_CACHE = new RFC3066LanguageTagLocaleFormat();
/** . */
- final LocaleFormat DEFAULT = new DefaultLocaleFormat();
+ final LocaleFormat DEFAULT_NO_CACHE = new DefaultLocaleFormat();
/** . */
- final LocaleFormat RFC3066_LANGUAGE_TAG_NO_CACHE = new CachingLocaleFormat(new RFC3066LanguageTagLocaleFormat());
+ final LocaleFormat RFC3066_LANGUAGE_TAG = new CachingLocaleFormat(new RFC3066LanguageTagLocaleFormat());
/** . */
- final LocaleFormat DEFAULT_NO_CACHE = new CachingLocaleFormat(new DefaultLocaleFormat());
+ final LocaleFormat DEFAULT = new CachingLocaleFormat(new DefaultLocaleFormat());
Locale getLocale(String value) throws ConversionException;
16 years, 11 months
JBoss Portal SVN: r8887 - in branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal: wsrp/consumer/portlet/info and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-11-12 15:57:56 -0500 (Mon, 12 Nov 2007)
New Revision: 8887
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java
Log:
- Test that getPortlet correctly works if there is no PortletManagement support on the producer
- Optimize WSRPPortletInfo a little by avoiding to create unnecessary (and costly) objects. In particular, changed behavior: if info is not present in WSRP, do not create empty data in MetaInfo.
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java 2007-11-12 18:28:53 UTC (rev 8886)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java 2007-11-12 20:57:56 UTC (rev 8887)
@@ -365,4 +365,4 @@
+ " is not a valid value for " + PROP_NAME, null);
}
}
-}
+}
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java 2007-11-12 18:28:53 UTC (rev 8886)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java 2007-11-12 20:57:56 UTC (rev 8887)
@@ -59,7 +59,7 @@
public class WSRPPortletInfo implements org.jboss.portal.portlet.info.PortletInfo
{
- private CapabilitiesInfo capabilities;
+ private WSRPCapabilitiesInfo capabilities;
private MetaInfo metaInfo;
private boolean usesMethodGet;
private boolean defaultMarkupSecure;
@@ -144,8 +144,8 @@
{
PropertyDescription desc = descs[i];
String key = desc.getName();
- prefInfos.put(key, new WSRPPreferenceInfo(key, createPortalLocalizedStringFrom(desc.getLabel()),
- createPortalLocalizedStringFrom(desc.getHint())));
+ prefInfos.put(key, new WSRPPreferenceInfo(key, getPortalLocalizedStringOrNullFrom(desc.getLabel()),
+ getPortalLocalizedStringOrNullFrom(desc.getHint())));
}
}
else
@@ -252,31 +252,28 @@
{
final MarkupType[] markupTypes = portletDescription.getMarkupTypes();
final Map mimeTypes = new HashMap(markupTypes.length);
- final Set modes = new HashSet();
- final Set windowStates = new HashSet();
- final Set locales = new HashSet();
+ capabilities = new WSRPCapabilitiesInfo();
- for (int i = 0; i < markupTypes.length; i++)
+ for (MarkupType markupType : markupTypes)
{
- MarkupType markupType = markupTypes[i];
String mimeType = markupType.getMimeType();
MIMETypeInfo mimeTypeInfo = new MIMETypeInfo(markupType);
mimeTypes.put(mimeType, mimeTypeInfo);
- modes.addAll(mimeTypeInfo.modes);
- windowStates.addAll(mimeTypeInfo.windowStates);
- locales.addAll(mimeTypeInfo.locales);
+ capabilities.addModes(mimeTypeInfo.modes);
+ capabilities.addWindowStates(mimeTypeInfo.windowStates);
+ capabilities.addLocales(mimeTypeInfo.locales);
}
- capabilities = new WSRPCapabilitiesInfo(mimeTypes, modes, windowStates, locales);
+ capabilities.setMimeTypes(mimeTypes);
}
private void createMetaInfo(PortletDescription portletDescription)
{
final Map metaInfos = new HashMap();
- metaInfos.put(MetaInfo.DESCRIPTION, createPortalLocalizedStringFrom(portletDescription.getDescription()));
- metaInfos.put(MetaInfo.DISPLAY_NAME, createPortalLocalizedStringFrom(portletDescription.getDisplayName()));
- metaInfos.put(MetaInfo.SHORT_TITLE, createPortalLocalizedStringFrom(portletDescription.getShortTitle()));
- metaInfos.put(MetaInfo.TITLE, createPortalLocalizedStringFrom(portletDescription.getTitle()));
+ metaInfos.put(MetaInfo.DESCRIPTION, getPortalLocalizedStringOrNullFrom(portletDescription.getDescription()));
+ metaInfos.put(MetaInfo.DISPLAY_NAME, getPortalLocalizedStringOrNullFrom(portletDescription.getDisplayName()));
+ metaInfos.put(MetaInfo.SHORT_TITLE, getPortalLocalizedStringOrNullFrom(portletDescription.getShortTitle()));
+ metaInfos.put(MetaInfo.TITLE, getPortalLocalizedStringOrNullFrom(portletDescription.getTitle()));
// keywords need to be concatenated
LocalizedString[] keywords = portletDescription.getKeywords();
@@ -308,15 +305,15 @@
metaInfo = new WSRPMetaInfo(metaInfos);
}
- private org.jboss.portal.common.i18n.LocalizedString createPortalLocalizedStringFrom(LocalizedString wsrpLocalizedString)
+ private org.jboss.portal.common.i18n.LocalizedString getPortalLocalizedStringOrNullFrom(LocalizedString wsrpLocalizedString)
{
- if (wsrpLocalizedString == null)
+ if (wsrpLocalizedString != null)
{
- return new org.jboss.portal.common.i18n.LocalizedString(Locale.ENGLISH);
+ return new org.jboss.portal.common.i18n.LocalizedString(wsrpLocalizedString.getValue(),
+ WSRPUtils.getLocale(wsrpLocalizedString.getLang()));
}
- return new org.jboss.portal.common.i18n.LocalizedString(wsrpLocalizedString.getValue(),
- WSRPUtils.getLocale(wsrpLocalizedString.getLang()));
+ return null;
}
class MIMETypeInfo
@@ -414,11 +411,20 @@
private class WSRPCapabilitiesInfo implements CapabilitiesInfo
{
- private final Map mimeTypes;
- private final Set modes;
- private final Set windowStates;
- private final Set locales;
+ private Map mimeTypes;
+ private Set modes;
+ private Set windowStates;
+ private Set locales;
+ private WSRPCapabilitiesInfo()
+ {
+ }
+
+ private void setMimeTypes(Map mimeTypes)
+ {
+ this.mimeTypes = mimeTypes;
+ }
+
public WSRPCapabilitiesInfo(Map mimeTypes, Set modes, Set windowStates, Set locales)
{
this.mimeTypes = mimeTypes;
@@ -479,6 +485,57 @@
return Collections.unmodifiableSet(mimeTypeInfo.locales);
}
+
+ private void addModes(Set modes)
+ {
+ if (modes != null)
+ {
+ int size = modes.size();
+ if (size != 0)
+ {
+ if (this.modes == null)
+ {
+ this.modes = new HashSet(size);
+ }
+
+ this.modes.addAll(modes);
+ }
+ }
+ }
+
+ private void addWindowStates(Set windowStates)
+ {
+ if (windowStates != null)
+ {
+ int size = windowStates.size();
+ if (size != 0)
+ {
+ if (this.windowStates == null)
+ {
+ this.windowStates = new HashSet(size);
+ }
+
+ this.windowStates.addAll(windowStates);
+ }
+ }
+ }
+
+ private void addLocales(Set locales)
+ {
+ if (locales != null)
+ {
+ int size = locales.size();
+ if (size != 0)
+ {
+ if (this.locales == null)
+ {
+ this.locales = new HashSet(size);
+ }
+
+ this.locales.addAll(locales);
+ }
+ }
+ }
}
private static class WSRPMetaInfo implements MetaInfo
16 years, 11 months