gatein SVN: r4059 - portal/branches/branch-r4047/component/portal/src/main/java/org/exoplatform/portal/config.
by do-not-reply@jboss.org
Author: ndkhoiits
Date: 2010-09-06 23:27:39 -0400 (Mon, 06 Sep 2010)
New Revision: 4059
Modified:
portal/branches/branch-r4047/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java
Log:
GTNPORTAL-1359 Remove group navigations of selected group and descendant
Modified: portal/branches/branch-r4047/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java
===================================================================
--- portal/branches/branch-r4047/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java 2010-09-06 21:13:10 UTC (rev 4058)
+++ portal/branches/branch-r4047/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java 2010-09-07 03:27:39 UTC (rev 4059)
@@ -154,8 +154,11 @@
{
GroupHandler groupHandler = orgService.getGroupHandler();
Collection<String> descendantGroups = getDescendantGroups(group, groupHandler);
+ Collection<String> deletedNavigationGroups = new ArrayList<String>();
+ deletedNavigationGroups.addAll(descendantGroups);
+ deletedNavigationGroups.add(group.getId());
PageNavigation navigation = null;
- for (String childGroup : descendantGroups)
+ for (String childGroup : deletedNavigationGroups)
{
navigation = dataService.getPageNavigation(PortalConfig.GROUP_TYPE, childGroup);
if (navigation != null)
14 years, 4 months
gatein SVN: r4058 - in components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer: v1 and 1 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-09-06 17:13:10 -0400 (Mon, 06 Sep 2010)
New Revision: 4058
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducer.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/WSRP1Producer.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v2/WSRP2Producer.java
Log:
- Moved ExportManager accessors to WSRPProducer as the integration in GateIn doesn't distinguish between both versions and the WSRP 1 producer actually delegates to the WSRP 2 version so it needs to be properly configured.
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducer.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducer.java 2010-09-06 21:10:09 UTC (rev 4057)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducer.java 2010-09-06 21:13:10 UTC (rev 4058)
@@ -23,6 +23,7 @@
package org.gatein.wsrp.producer;
+import org.gatein.exports.ExportManager;
import org.gatein.pc.api.PortletInvoker;
import org.gatein.registration.RegistrationManager;
import org.gatein.wsrp.producer.config.ProducerConfigurationChangeListener;
@@ -83,4 +84,18 @@
/** Removes this WSRPProducer from active use. */
void stop();
+
+ /**
+ * Retrieves the ExportManager used by this WSRPProducer.
+ *
+ * @return The ExportManager used by this WSRPProducer to manage exports
+ */
+ ExportManager getExportManager();
+
+ /**
+ * Sets the ExportManager used by this WSRPProducer
+ *
+ * @param exportManager the ExportManager to be used by this WSRPProducer
+ */
+ void setExportManager(ExportManager exportManager);
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/WSRP1Producer.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/WSRP1Producer.java 2010-09-06 21:10:09 UTC (rev 4057)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/WSRP1Producer.java 2010-09-06 21:13:10 UTC (rev 4058)
@@ -23,6 +23,7 @@
package org.gatein.wsrp.producer.v1;
+import org.gatein.exports.ExportManager;
import org.gatein.pc.api.PortletInvoker;
import org.gatein.registration.RegistrationManager;
import org.gatein.wsrp.producer.ProducerHolder;
@@ -169,6 +170,16 @@
producer.usingStrictModeChangedTo(strictMode);
}
+ public ExportManager getExportManager()
+ {
+ return producer.getExportManager();
+ }
+
+ public void setExportManager(ExportManager exportManager)
+ {
+ producer.setExportManager(exportManager);
+ }
+
public V1ServiceDescription getServiceDescription(V1GetServiceDescription gs) throws V1InvalidRegistration, V1OperationFailed
{
try
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v2/WSRP2Producer.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v2/WSRP2Producer.java 2010-09-06 21:10:09 UTC (rev 4057)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v2/WSRP2Producer.java 2010-09-06 21:13:10 UTC (rev 4058)
@@ -23,7 +23,6 @@
package org.gatein.wsrp.producer.v2;
-import org.gatein.exports.ExportManager;
import org.gatein.wsrp.producer.MarkupInterface;
import org.gatein.wsrp.producer.PortletManagementInterface;
import org.gatein.wsrp.producer.RegistrationInterface;
@@ -37,17 +36,4 @@
public interface WSRP2Producer extends WSRPProducer, MarkupInterface, PortletManagementInterface,
RegistrationInterface, ServiceDescriptionInterface
{
- /**
- * Retrieves the ExportManager used by this WSRPProducer.
- *
- * @return The ExportManager used by this WSRPProducer to manage exports
- */
- ExportManager getExportManager();
-
- /**
- * Sets the ExportManager used by this WSRPProducer
- *
- * @param exportManager the ExportManager to be used by this WSRPProducer
- */
- void setExportManager(ExportManager exportManager);
}
14 years, 4 months
gatein SVN: r4057 - components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-09-06 17:10:09 -0400 (Mon, 06 Sep 2010)
New Revision: 4057
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/PortletManagementHandler.java
Log:
- Fixed exception handling.
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/PortletManagementHandler.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/PortletManagementHandler.java 2010-09-06 21:05:04 UTC (rev 4056)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/PortletManagementHandler.java 2010-09-06 21:10:09 UTC (rev 4057)
@@ -85,7 +85,6 @@
import org.oasis.wsrp.v2.MissingParameters;
import org.oasis.wsrp.v2.ModifyRegistrationRequired;
import org.oasis.wsrp.v2.OperationFailed;
-import org.oasis.wsrp.v2.OperationFailedFault;
import org.oasis.wsrp.v2.OperationNotSupported;
import org.oasis.wsrp.v2.PortletContext;
import org.oasis.wsrp.v2.PortletDescription;
@@ -98,7 +97,6 @@
import org.oasis.wsrp.v2.ResetProperty;
import org.oasis.wsrp.v2.ResourceList;
import org.oasis.wsrp.v2.ResourceSuspended;
-import org.oasis.wsrp.v2.ReturnAny;
import org.oasis.wsrp.v2.SetExportLifetime;
import org.oasis.wsrp.v2.SetPortletProperties;
import org.oasis.wsrp.v2.SetPortletsLifetime;
@@ -622,7 +620,7 @@
}
catch (Exception e)
{
- throw new OperationFailed("Operation Failed while trying to ExportPortlets.", WSRPTypeFactory.createOperationFailedFault());
+ throw WSRP2ExceptionFactory.throwWSException(OperationFailed.class, "Operation Failed while trying to ExportPortlets.", e);
}
finally
{
14 years, 4 months
gatein SVN: r4056 - in components/wsrp/trunk: admin-gui/src/main/webapp/WEB-INF and 9 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-09-06 17:05:04 -0400 (Mon, 06 Sep 2010)
New Revision: 4056
Added:
components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/exports/
components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/exports/export.xhtml
components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/exports/exportDetail.xhtml
components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/exports/exports.xhtml
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/ExportInfo.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/MigrationService.java
Modified:
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerManagerBean.java
components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource.properties
components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource_fr.properties
components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/faces-config.xml
components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/consumers.xhtml
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/WSRPConsumer.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v2/PortletManagementTestCase.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/behaviors/BasicPortletManagementBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java
Log:
- GTNWSRP-61: Added primitive export capability to admin GUI. Still needs work, obviously! :)
- Added MigrationService and ExportInfo to manage exported data over time.
Modified: components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java 2010-09-06 20:59:23 UTC (rev 4055)
+++ components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java 2010-09-06 21:05:04 UTC (rev 4056)
@@ -23,15 +23,23 @@
package org.gatein.wsrp.admin.ui;
+import org.gatein.common.util.ParameterValidation;
+import org.gatein.pc.api.Portlet;
+import org.gatein.pc.api.PortletInvokerException;
import org.gatein.wsrp.WSRPConsumer;
import org.gatein.wsrp.consumer.EndpointConfigurationInfo;
import org.gatein.wsrp.consumer.ProducerInfo;
import org.gatein.wsrp.consumer.RegistrationInfo;
import org.gatein.wsrp.consumer.RegistrationProperty;
+import org.gatein.wsrp.consumer.migration.ExportInfo;
import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
+import javax.faces.model.DataModel;
+import javax.faces.model.ListDataModel;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
@@ -58,8 +66,13 @@
private static final String CANNOT_ERASE_REG = "bean_consumer_cannot_erase_reg";
private static final String MALFORMED_URL = "bean_consumer_malformed_url";
private static final String UPDATE_SUCCESS = "bean_consumer_update_success";
+ private static final String CANNOT_EXPORT = "bean_consumer_cannot_export";
private static final String CONSUMER_TYPE = "CONSUMER_TYPE";
+ private DataModel portletHandles;
+ private DataModel existingExports;
+ private ExportInfo currentExport;
+
public void setRegistry(ConsumerRegistry registry)
{
this.registry = registry;
@@ -479,4 +492,103 @@
{
return registry;
}
+
+ public DataModel getPortlets()
+ {
+ try
+ {
+ if (portletHandles == null)
+ {
+ Collection<Portlet> portlets = consumer.getProducerInfo().getPortletMap().values();
+ List<SelectablePortletHandle> selectableHandles = Collections.emptyList();
+ if (ParameterValidation.existsAndIsNotEmpty(portlets))
+ {
+ selectableHandles = new ArrayList<SelectablePortletHandle>(portlets.size());
+ for (Portlet portlet : portlets)
+ {
+ selectableHandles.add(new SelectablePortletHandle(portlet.getContext().getId()));
+ }
+ }
+ portletHandles = new ListDataModel(selectableHandles);
+ }
+
+ return portletHandles;
+ }
+ catch (PortletInvokerException e)
+ {
+ beanContext.createErrorMessageFrom(e);
+ return null;
+ }
+ }
+
+ public String export()
+ {
+ if (consumer != null)
+ {
+ List<SelectablePortletHandle> handles = (List<SelectablePortletHandle>)portletHandles.getWrappedData();
+ List<String> selectedHandles = new ArrayList<String>(handles.size());
+ for (SelectablePortletHandle selectablePortletHandle : handles)
+ {
+ if (selectablePortletHandle.isSelected())
+ {
+ selectedHandles.add(selectablePortletHandle.getHandle());
+ }
+ }
+
+ try
+ {
+ currentExport = consumer.exportPortlets(selectedHandles);
+ }
+ catch (Exception e)
+ {
+ beanContext.createErrorMessageFrom(e);
+ return null;
+ }
+ return ConsumerManagerBean.EXPORT_DETAIL;
+ }
+
+ beanContext.createErrorMessage(CANNOT_EXPORT);
+ return null;
+ }
+
+ public ExportInfo getCurrentExport()
+ {
+ return currentExport;
+ }
+
+ public DataModel getExistingExports()
+ {
+ if (existingExports == null)
+ {
+ existingExports = new ListDataModel(consumer.getMigrationService().getAvailableExportInfos());
+ }
+
+ return existingExports;
+ }
+
+ public static class SelectablePortletHandle
+ {
+ private String handle;
+ private boolean selected;
+
+ public SelectablePortletHandle(String handle)
+ {
+ this.handle = handle;
+ }
+
+ public String getHandle()
+ {
+ return handle;
+ }
+
+ public boolean isSelected()
+ {
+ return selected;
+ }
+
+ public void setSelected(boolean selected)
+ {
+ this.selected = selected;
+ }
+ }
}
Modified: components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerManagerBean.java
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerManagerBean.java 2010-09-06 20:59:23 UTC (rev 4055)
+++ components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerManagerBean.java 2010-09-06 21:05:04 UTC (rev 4056)
@@ -52,6 +52,8 @@
private static final String REFRESH_FAILURE = "bean_consumermanager_refresh_failure";
private static final String REFRESH_EXCEPTION = "bean_consumermanager_refresh_exception";
static final String CONFIGURE_CONSUMER = "configureConsumer";
+ static final String EXPORT = "export";
+ static final String EXPORT_DETAIL = "exportDetail";
static final String CONSUMERS = "consumers";
static final String EXPECTED_REG_INFO_KEY = "expectedRegistrationInfo";
@@ -177,7 +179,7 @@
{
try
{
- getRegistry().createConsumer(selectedId, null, null);
+ WSRPConsumer consumer = getRegistry().createConsumer(selectedId, null, null);
setConsumerIdInSession(false);
return CONFIGURE_CONSUMER;
}
@@ -242,6 +244,36 @@
}
}
+ public String importPortlets()
+ {
+ if (refreshConsumerId() != null)
+ {
+ WSRPConsumer consumer = getSelectedConsumer();
+
+
+ return configureConsumer();
+ }
+ else
+ {
+ noSelectedConsumerError();
+ return null;
+ }
+ }
+
+ public String exportPortlets()
+ {
+ if (refreshConsumerId() != null)
+ {
+ setConsumerIdInSession(false);
+ return EXPORT;
+ }
+ else
+ {
+ noSelectedConsumerError();
+ return null;
+ }
+ }
+
private RefreshResult internalRefresh(WSRPConsumer consumer)
{
try
Modified: components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource.properties
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource.properties 2010-09-06 20:59:23 UTC (rev 4055)
+++ components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource.properties 2010-09-06 21:05:04 UTC (rev 4056)
@@ -75,7 +75,24 @@
consumers_table_action_deregister = Deregister
consumers_table_action_delete = Delete
consumers_table_reload = Reload consumers
+consumers_table_action_export = Export
+consumers_table_action_import = Import
+# Export
+portlets_table_column_include = Include in export?
+portlets_table_column_portlet_name = Portlet
+portlets_table_export = Export
+export_detail_export_time = Export time:
+export_detail_expiration_time = Expiration time:
+export_detail_portlets = Exported portlets:
+export_detail_failed = Failed portlets:
+export_detail_exported_portlet_name = Exported portlet handle
+export_detail_failed_portlet_error = Error code
+export_detail_failed_portlet_portlets = Failed portlets
+export_detail_failed_portlet_none = No failed portlets.
+export_detail_exports = Back to exports list
+export_detail_consumers = Back to consumers list
+
# Consumer editing screen
edit_consumer_producer = Producer id:
edit_consumer_cache = Cache expiration:
Modified: components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource_fr.properties
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource_fr.properties 2010-09-06 20:59:23 UTC (rev 4055)
+++ components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource_fr.properties 2010-09-06 21:05:04 UTC (rev 4056)
@@ -145,4 +145,19 @@
DUPLICATE_ERROR=Un {1} nomm\u00e9 ''{0}'' existe d\u00e9j\u00e0!
INVALID_NAME_ERROR=''{0}'' est un nom invalide pour un {1} : Ne peut pas \u00eatre null, vide ou contenir '/', '.', '\\', '<', '>', '(', ')', '=' ou '%5c'
edit_consumer_timeout=Timeout des op�rations WS:
-edit_consumer_timeout_milliseconds=(millisecondes avant timeout)
\ No newline at end of file
+edit_consumer_timeout_milliseconds=(millisecondes avant timeout)
+consumers_table_action_import=Importer
+consumers_table_action_export=Exporter
+portlets_table_column_include=Inclure dans l'export?
+portlets_table_column_portlet_name=Portlet
+portlets_table_export=Exporter
+export_detail_consumers=Retour � la liste des consommateurs
+export_detail_expiration_time=Date d'expiration:
+export_detail_export_time=Date d'export:
+export_detail_exported_portlet_name=Identifiant de la portlet export�e
+export_detail_exports=Retour � la liste des exports
+export_detail_failed=Portlets en erreur:
+export_detail_failed_portlet_error=Code d'erreur
+export_detail_failed_portlet_none=Aucune portlet en erreur.
+export_detail_failed_portlet_portlets=Portlets en erreur
+export_detail_portlets=Portlets export�es:
\ No newline at end of file
Modified: components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/faces-config.xml 2010-09-06 20:59:23 UTC (rev 4055)
+++ components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/faces-config.xml 2010-09-06 21:05:04 UTC (rev 4056)
@@ -152,8 +152,20 @@
<to-view-id>/jsf/consumers/confirmDeleteConsumer.xhtml</to-view-id>
</navigation-case>
<navigation-case>
- <from-outcome>management</from-outcome>
- <to-view-id>/jsf/management/management.xhtml</to-view-id>
+ <from-outcome>export</from-outcome>
+ <to-view-id>/jsf/consumers/exports/export.xhtml</to-view-id>
</navigation-case>
+ <navigation-case>
+ <from-outcome>export</from-outcome>
+ <to-view-id>/jsf/consumers/exports/export.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>exports</from-outcome>
+ <to-view-id>/jsf/consumers/exports/exports.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>exportDetail</from-outcome>
+ <to-view-id>/jsf/consumers/exports/exportDetail.xhtml</to-view-id>
+ </navigation-case>
</navigation-rule>
</faces-config>
Modified: components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/consumers.xhtml
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/consumers.xhtml 2010-09-06 20:59:23 UTC (rev 4055)
+++ components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/consumers.xhtml 2010-09-06 21:05:04 UTC (rev 4056)
@@ -24,9 +24,7 @@
<ui:decorate template="consumerTemplate.xhtml" xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:c="http://java.sun.com/jstl/core"
- xmlns:webui="http://jboss.org/gatein">
+ xmlns:h="http://java.sun.com/jsf/html">
<ui:param name="showAddConsumer" value="true"/>
<ui:define name="content">
@@ -91,6 +89,16 @@
<f:param name="id" value="#{cons.producerId}"/>
#{i18n.consumers_table_action_delete}
</h:commandLink>
+ |
+ <h:commandLink action="#{consumersMgr.importPortlets}" styleClass="actionImport" id="import">
+ <f:param name="id" value="#{cons.producerId}"/>
+ #{i18n.consumers_table_action_import}
+ </h:commandLink>
+ |
+ <h:commandLink action="#{consumersMgr.exportPortlets}" styleClass="actionExport" id="export">
+ <f:param name="id" value="#{cons.producerId}"/>
+ #{i18n.consumers_table_action_export}
+ </h:commandLink>
</h:column>
</h:dataTable>
</h:form>
Added: components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/exports/export.xhtml
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/exports/export.xhtml (rev 0)
+++ components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/exports/export.xhtml 2010-09-06 21:05:04 UTC (rev 4056)
@@ -0,0 +1,66 @@
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2010, 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.
+ -->
+
+<ui:decorate template="../consumerTemplate.xhtml" xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html">
+
+ <ui:define name="content">
+
+ <h:form id="portlets-form">
+ <h:dataTable id="portletsList" value="#{consumer.portlets}" var="portlet"
+ rendered="#{! empty consumer.portlets}"
+ rowClasses="EvenRow,OddRow"
+ styleClass="UIGrid" width="100%">
+ <h:column>
+ <f:facet name="header">#{i18n.portlets_ta
+ bl
+ e_column_include}</f:facet>
+
+ <h:selectBooleanCheckbox value="#{portlet.selected}"/>
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">#{i18n.portlets_table_column_portlet_name}</f:facet>
+ #{p
+ ortlet.handle}
+ </h:column>
+ </h:dataTable>
+ <table class="ActionContainer">
+ <tr>
+ <td>
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <h:commandButton id="exportButton" action="#{consumer.export}"
+ value="#{i18n.portlets_table_export}"/>
+ </div>
+ </div>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </h:form>
+ </ui:define>
+</ui:decorate>
\ No newline at end of file
Added: components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/exports/exportDetail.xhtml
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/exports/exportDetail.xhtml (rev 0)
+++ components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/exports/exportDetail.xhtml 2010-09-06 21:05:04 UTC (rev 4056)
@@ -0,0 +1,100 @@
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2010, 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.
+ -->
+
+<ui:decorate template="../consumerTemplate.xhtml" xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html">
+
+ <ui:define name="content">
+
+ <table width="100%" class="portlet-table-body">
+ <tr>
+ <th>#{i18n.export_detail_export_time}</th>
+ <td>#{consumer.currentExport.exportTime}</td>
+ </tr>
+ <tr>
+ <th>#{i18n.export_detail_expiration_time}</th>
+ <td>#{consumer.currentExport.expirationTime}</td>
+ </tr>
+ <tr>
+ <th>#{i18n.export_detail_portlets}</th>
+ <td>
+ <h:dataTable id="exported-portlets" value="#{consumer.currentExport.exportedPortletHandles}" var="handle"
+ rowClasses="EvenRow,OddRow"
+ styleClass="UIGrid" width="100%">
+ <h:column>
+ <f:facet name="header">#{i18n.export_detail_exported_portlet_name}</f:facet>
+ #{handle}
+ </h:column>
+ </h:dataTable>
+ </td>
+ </tr>
+ <tr>
+ <th>#{i18n.export_detail_failed}</th>
+ <td>
+ <h:dataTable id="failed-portlets"
+ value="#{consumer.currentExport.errorCodesToFailedPortletHandlesMapping.entries}"
+ rendered="#{! empty consumer.currentExport.errorCodesToFailedPortletHandlesMapping.entries}"
+ var="entry" rowClasses="EvenRow,OddRow" styleClass="UIGrid" width="100%">
+ <h:column>
+ <f:facet name="header">#{i18n.export_detail_failed_portlet_error}</f:facet>
+ #{entry.key}
+ </h:column>
+ <h:column>
+ <f:facet name="header">#{i18n.export_detail_failed_portlet_portlets}</f:facet>
+ #{entry.value}
+ </h:column>
+ </h:dataTable>
+ <h:outputText rendered="#{empty consumer.currentExport.errorCodesToFailedPortletHandlesMapping.entries}"
+ value="#{i18n.export_detail_failed_portlet_none}"/>
+ </td>
+ </tr>
+ </table>
+
+ <h:form id="exportDetail-form">
+ <table class="ActionContainer">
+ <tr>
+ <td>
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <h:commandButton id="exports" action="exports" value="#{i18n.export_detail_exports}"/>
+ </div>
+ </div>
+ </div>
+ </td>
+ <td>
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <h:commandButton id="consumers" action="consumers" value="#{i18n.export_detail_consumers}"/>
+ </div>
+ </div>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </h:form>
+ </ui:define>
+</ui:decorate>
\ No newline at end of file
Added: components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/exports/exports.xhtml
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/exports/exports.xhtml (rev 0)
+++ components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/exports/exports.xhtml 2010-09-06 21:05:04 UTC (rev 4056)
@@ -0,0 +1,60 @@
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2010, 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.
+ -->
+
+<ui:decorate template="../consumerTemplate.xhtml" xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html">
+
+ <ui:define name="content">
+
+ <h:form id="exports-form">
+ <h:dataTable id="exportsList" value="#{consumer.existingExports}" var="export" rowClasses="EvenRow,OddRow"
+ styleClass="UIGrid" width="100%">
+ <h:column>
+ <f:facet name="header">#{i18n.export_table_column_time}</f:facet>
+ #{export.exportTime}
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">#{i18n.export_table_column_portlet_name}</f:facet>
+ #{portlet.handle}
+ </h:column>
+ </h:dataTable>
+ <table class="ActionContainer">
+ <tr>
+ <td>
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <h:commandButton id="exportButton" action="#{consumer.export}"
+ value="#{i18n.export_table_export}"/>
+ </div>
+ </div>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </h:form>
+ </ui:define>
+</ui:decorate>
\ No newline at end of file
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/WSRPConsumer.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/WSRPConsumer.java 2010-09-06 20:59:23 UTC (rev 4055)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/WSRPConsumer.java 2010-09-06 21:05:04 UTC (rev 4056)
@@ -30,8 +30,11 @@
import org.gatein.wsrp.consumer.ProducerInfo;
import org.gatein.wsrp.consumer.RefreshResult;
import org.gatein.wsrp.consumer.handlers.ProducerSessionInformation;
+import org.gatein.wsrp.consumer.migration.ExportInfo;
+import org.gatein.wsrp.consumer.migration.MigrationService;
import javax.servlet.http.HttpSession;
+import java.util.List;
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
@@ -123,4 +126,8 @@
void start() throws Exception;
void stop() throws Exception;
+
+ ExportInfo exportPortlets(List<String> portletHandles) throws PortletInvokerException;
+
+ MigrationService getMigrationService();
}
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java 2010-09-06 20:59:23 UTC (rev 4055)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java 2010-09-06 21:05:04 UTC (rev 4056)
@@ -49,6 +49,8 @@
import org.gatein.wsrp.consumer.handlers.InvocationDispatcher;
import org.gatein.wsrp.consumer.handlers.ProducerSessionInformation;
import org.gatein.wsrp.consumer.handlers.SessionHandler;
+import org.gatein.wsrp.consumer.migration.ExportInfo;
+import org.gatein.wsrp.consumer.migration.MigrationService;
import org.gatein.wsrp.consumer.portlet.WSRPPortlet;
import org.gatein.wsrp.consumer.portlet.info.WSRPPortletInfo;
import org.gatein.wsrp.services.MarkupService;
@@ -56,6 +58,7 @@
import org.gatein.wsrp.services.RegistrationService;
import org.gatein.wsrp.services.ServiceDescriptionService;
import org.gatein.wsrp.servlet.UserAccess;
+import org.oasis.wsrp.v2.ExportedPortlet;
import org.oasis.wsrp.v2.Extension;
import org.oasis.wsrp.v2.FailedPortlets;
import org.oasis.wsrp.v2.InconsistentParameters;
@@ -67,6 +70,7 @@
import org.oasis.wsrp.v2.RegistrationContext;
import org.oasis.wsrp.v2.RegistrationData;
import org.oasis.wsrp.v2.ResetProperty;
+import org.oasis.wsrp.v2.ResourceList;
import org.oasis.wsrp.v2.RuntimeContext;
import org.oasis.wsrp.v2.SessionParams;
import org.slf4j.Logger;
@@ -74,6 +78,9 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
+import javax.xml.datatype.Duration;
+import javax.xml.datatype.XMLGregorianCalendar;
+import javax.xml.namespace.QName;
import javax.xml.ws.Holder;
import java.util.ArrayList;
import java.util.Collections;
@@ -83,6 +90,8 @@
import java.util.Locale;
import java.util.Map;
import java.util.Set;
+import java.util.SortedMap;
+import java.util.TreeMap;
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
@@ -121,6 +130,7 @@
/** The set of supported user scopes */
private Set supportedUserScopes = WSRP_DEFAULT_USER_SCOPE; // todo: make it possible to support different user scopes
private transient boolean started;
+ private MigrationService migrationService;
public WSRPConsumerImpl()
{
@@ -134,6 +144,8 @@
producerInfo = info;
sessionHandler = new SessionHandler(this);
dispatcher = new InvocationDispatcher(this);
+
+ migrationService = new MigrationService(); // todo: inject this
}
public ProducerInfo getProducerInfo()
@@ -744,4 +756,122 @@
{
return producerInfo.hashCode();
}
+
+ public ExportInfo exportPortlets(List<String> portletHandles) throws PortletInvokerException
+ {
+ if (ParameterValidation.existsAndIsNotEmpty(portletHandles))
+ {
+
+ List<org.oasis.wsrp.v2.PortletContext> portletContexts = new ArrayList<org.oasis.wsrp.v2.PortletContext>(portletHandles.size());
+ for (String handle : portletHandles)
+ {
+ portletContexts.add(WSRPTypeFactory.createPortletContext(handle));
+ }
+
+ try
+ {
+ Holder<byte[]> exportContextHolder = new Holder<byte[]>();
+ Holder<List<ExportedPortlet>> exportedPortletsHolder = new Holder<List<ExportedPortlet>>();
+ Holder<List<FailedPortlets>> failedPortletsHolder = new Holder<List<FailedPortlets>>();
+ Holder<Lifetime> lifetimeHolder = new Holder<Lifetime>();
+ getPortletManagementService().exportPortlets(getRegistrationContext(), portletContexts, UserAccess.getUserContext(),
+ lifetimeHolder, true, exportContextHolder, exportedPortletsHolder, failedPortletsHolder,
+ new Holder<ResourceList>(), new Holder<List<Extension>>());
+
+ SortedMap<String, byte[]> handleToState = null;
+ List<ExportedPortlet> exportedPortlets = exportedPortletsHolder.value;
+ if (ParameterValidation.existsAndIsNotEmpty(exportedPortlets))
+ {
+ handleToState = new TreeMap<String, byte[]>();
+ for (ExportedPortlet exportedPortlet : exportedPortlets)
+ {
+ handleToState.put(exportedPortlet.getPortletHandle(), exportedPortlet.getExportData());
+ }
+ }
+
+ SortedMap<QName, List<String>> errorCodeToHandle = null;
+ List<FailedPortlets> failedPortlets = failedPortletsHolder.value;
+ if (ParameterValidation.existsAndIsNotEmpty(failedPortlets))
+ {
+ errorCodeToHandle = new TreeMap<QName, List<String>>();
+ for (FailedPortlets failedPortletsForReason : failedPortlets)
+ {
+ errorCodeToHandle.put(failedPortletsForReason.getErrorCode(), failedPortletsForReason.getPortletHandles());
+ }
+ }
+
+ // todo: deal with expiration time
+ Lifetime lifetime = lifetimeHolder.value;
+ if (lifetime != null)
+ {
+ XMLGregorianCalendar currentTime = lifetime.getCurrentTime();
+ Duration refreshDuration = lifetime.getRefreshDuration();
+ XMLGregorianCalendar terminationTime = lifetime.getTerminationTime();
+ }
+
+ ExportInfo exportInfo = new ExportInfo(System.currentTimeMillis(), handleToState, errorCodeToHandle);
+ migrationService.add(exportInfo);
+ return exportInfo;
+ }
+ catch (OperationNotSupported operationNotSupported)
+ {
+ throw new UnsupportedOperationException(operationNotSupported);
+ }
+ catch (InconsistentParameters inconsistentParameters)
+ {
+ throw new IllegalArgumentException(inconsistentParameters);
+ }
+ /*
+ // GTNWSRP-62
+ catch (AccessDenied accessDenied)
+ {
+ accessDenied.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ catch (ExportByValueNotSupported exportByValueNotSupported)
+ {
+ exportByValueNotSupported.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ catch (InvalidHandle invalidHandle)
+ {
+ invalidHandle.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ catch (InvalidRegistration invalidRegistration)
+ {
+ invalidRegistration.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ catch (InvalidUserCategory invalidUserCategory)
+ {
+ invalidUserCategory.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ catch (MissingParameters missingParameters)
+ {
+ missingParameters.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ catch (ModifyRegistrationRequired modifyRegistrationRequired)
+ {
+ modifyRegistrationRequired.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ catch (OperationFailed operationFailed)
+ {
+ operationFailed.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ catch (ResourceSuspended resourceSuspended)
+ {
+ resourceSuspended.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }*/
+ catch (Exception e)
+ {
+ throw new PortletInvokerException(e);
+ }
+ }
+ else
+ {
+ throw new IllegalArgumentException("Must provide a non-null, non-empty list of portlet handles.");
+ }
+ }
+
+ public MigrationService getMigrationService()
+ {
+ return migrationService;
+ }
}
Added: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/ExportInfo.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/ExportInfo.java (rev 0)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/ExportInfo.java 2010-09-06 21:05:04 UTC (rev 4056)
@@ -0,0 +1,122 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, 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.gatein.wsrp.consumer.migration;
+
+import org.gatein.common.util.ParameterValidation;
+
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class ExportInfo
+{
+ private final long exportTime;
+ private long expirationTime;
+ private final SortedMap<String, byte[]> handleToExportedState;
+ private final SortedMap<QName, List<String>> errorCodeToHandles;
+ private final static SortedMap<String, byte[]> EMPTY_EXPORTED = new TreeMap<String, byte[]>();
+ private final static SortedMap<QName, List<String>> EMPTY_FAILED = new TreeMap<QName, List<String>>();
+
+ public ExportInfo(long exportTime, SortedMap<String, byte[]> handleToState, SortedMap<QName, List<String>> errorCodeToHandles)
+ {
+ this.exportTime = exportTime;
+ if (ParameterValidation.existsAndIsNotEmpty(handleToState))
+ {
+ this.handleToExportedState = handleToState;
+ }
+ else
+ {
+ handleToExportedState = EMPTY_EXPORTED;
+ }
+
+ if (ParameterValidation.existsAndIsNotEmpty(errorCodeToHandles))
+ {
+ this.errorCodeToHandles = errorCodeToHandles;
+ }
+ else
+ {
+ this.errorCodeToHandles = EMPTY_FAILED;
+ }
+ }
+
+ public long getExportTime()
+ {
+ return exportTime;
+ }
+
+ public long getExpirationTime()
+ {
+ return expirationTime;
+ }
+
+ public List<String> getExportedPortletHandles()
+ {
+ return new ArrayList<String>(handleToExportedState.keySet());
+ }
+
+ public byte[] getPortletStateFor(String portletHandle)
+ {
+ return handleToExportedState.get(portletHandle);
+ }
+
+ public SortedMap<QName, List<String>> getErrorCodesToFailedPortletHandlesMapping()
+ {
+ return Collections.unmodifiableSortedMap(errorCodeToHandles);
+ }
+
+ @Override
+ public boolean equals(Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+
+ ExportInfo that = (ExportInfo)o;
+
+ if (exportTime != that.exportTime)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return (int)(exportTime ^ (exportTime >>> 32));
+ }
+}
Added: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/MigrationService.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/MigrationService.java (rev 0)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/MigrationService.java 2010-09-06 21:05:04 UTC (rev 4056)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, 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.gatein.wsrp.consumer.migration;
+
+import org.gatein.common.util.ParameterValidation;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class MigrationService
+{
+ private SortedMap<Long, ExportInfo> exportInfos;
+
+ public List<ExportInfo> getAvailableExportInfos()
+ {
+ return new ArrayList<ExportInfo>(getExportInfos().values());
+ }
+
+ public ExportInfo getExportInfo(long exportTime)
+ {
+ return exportInfos.get(exportTime);
+ }
+
+ public void add(ExportInfo info)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(info, "ExportInfo");
+
+ getExportInfos().put(info.getExportTime(), info);
+ }
+
+ public ExportInfo remove(ExportInfo info)
+ {
+ return info == null ? null : getExportInfos().remove(info.getExportTime());
+ }
+
+ private SortedMap<Long, ExportInfo> getExportInfos()
+ {
+ if (exportInfos == null)
+ {
+ exportInfos = new TreeMap<Long, ExportInfo>();
+ }
+ return exportInfos;
+ }
+}
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v2/PortletManagementTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v2/PortletManagementTestCase.java 2010-09-06 20:59:23 UTC (rev 4055)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v2/PortletManagementTestCase.java 2010-09-06 21:05:04 UTC (rev 4056)
@@ -31,6 +31,7 @@
import org.gatein.pc.api.state.DestroyCloneFailure;
import org.gatein.pc.api.state.PropertyChange;
import org.gatein.pc.api.state.PropertyMap;
+import org.gatein.wsrp.consumer.migration.ExportInfo;
import org.gatein.wsrp.test.ExtendedAssert;
import org.gatein.wsrp.test.protocol.v2.BehaviorRegistry;
import org.gatein.wsrp.test.protocol.v2.behaviors.BasicMarkupBehavior;
@@ -38,6 +39,7 @@
import org.gatein.wsrp.test.protocol.v2.behaviors.DestroyClonesPortletManagementBehavior;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
/**
@@ -180,4 +182,56 @@
//expected
}
}
+
+ public void testNullExportPortlets() throws PortletInvokerException
+ {
+ try
+ {
+ consumer.exportPortlets(null);
+ fail("Cannot export without a list of portlet handles!");
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected
+ }
+ }
+
+ public void testEmptyExportPortlets() throws PortletInvokerException
+ {
+ try
+ {
+ consumer.exportPortlets(Collections.<String>emptyList());
+ fail("Cannot export without a list of portlet handles!");
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected
+ }
+ }
+
+ public void testExportPortlets() throws PortletInvokerException
+ {
+ long now = System.currentTimeMillis();
+ ArrayList<String> portletContexts = new ArrayList<String>();
+ portletContexts.add(BasicMarkupBehavior.PORTLET_HANDLE);
+ ExportInfo ei = consumer.exportPortlets(portletContexts);
+ assertNotNull(ei);
+
+ long tenSeconds = 10 * 1000;
+ assertTrue((ei.getExportTime() - now) < tenSeconds);
+
+ assertEquals(0, ei.getExpirationTime());
+
+ List<String> exportedPortlets = ei.getExportedPortletHandles();
+ assertNotNull(exportedPortlets);
+ assertEquals(1, exportedPortlets.size());
+ assertTrue(exportedPortlets.contains(BasicMarkupBehavior.PORTLET_HANDLE));
+ assertNotNull(ei.getPortletStateFor(BasicMarkupBehavior.PORTLET_HANDLE));
+
+ assertTrue(ei.getErrorCodesToFailedPortletHandlesMapping().isEmpty());
+
+ List<ExportInfo> availableExportInfos = consumer.getMigrationService().getAvailableExportInfos();
+ assertEquals(1, availableExportInfos.size());
+ assertEquals(ei, availableExportInfos.get(0));
+ }
}
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/behaviors/BasicPortletManagementBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/behaviors/BasicPortletManagementBehavior.java 2010-09-06 20:59:23 UTC (rev 4055)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/behaviors/BasicPortletManagementBehavior.java 2010-09-06 21:05:04 UTC (rev 4056)
@@ -186,7 +186,26 @@
@Override
public void exportPortlets(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types") List<PortletContext> portletContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types") UserContext userContext, @WebParam(name = "lifetime", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types", mode = WebParam.Mode.INOUT) Holder<Lifetime> lifetime, @WebParam(name = "exportByValueRequired", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types") Boolean exportByValueRequired, @WebParam(name = "exportContext", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types", mode = WebParam.Mode.OUT) Holder<byte[]> exportContext, @WebParam(name = "exportedPortlet", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types", mode = WebParam.Mode.OUT) Holder<List<ExportedPortlet>> exportedPortlet, @WebParam(name!
= "failedPortlets", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types", mode = WebParam.Mode.OUT) Holder<List<FailedPortlets>> failedPortlets, @WebParam(name = "resourceList", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types", mode = WebParam.Mode.OUT) Holder<ResourceList> resourceList, @WebParam(name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types", mode = WebParam.Mode.OUT) Holder<List<Extension>> extensions) throws AccessDenied, ExportByValueNotSupported, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended
{
- throw new NotYetImplemented();
+ List<String> failedPortletHandles = new ArrayList<String>();
+ for (PortletContext context : portletContext)
+ {
+ String portletHandle = context.getPortletHandle();
+ if (BasicMarkupBehavior.PORTLET_HANDLE.equals(portletHandle))
+ {
+ exportedPortlet.value = new ArrayList<ExportedPortlet>();
+ exportedPortlet.value.add(WSRPTypeFactory.createExportedPortlet(BasicMarkupBehavior.PORTLET_HANDLE, new byte[]{1, 2, 3, 4}));
+ }
+ else
+ {
+ failedPortletHandles.add(portletHandle);
+ }
+ }
+
+ if (!failedPortletHandles.isEmpty())
+ {
+ failedPortlets.value = new ArrayList<FailedPortlets>();
+ failedPortlets.value.add(WSRPTypeFactory.createFailedPortlets(failedPortletHandles, ErrorCodes.Codes.INVALIDHANDLE, "Unknown handles"));
+ }
}
@Override
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java 2010-09-06 20:59:23 UTC (rev 4055)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java 2010-09-06 21:05:04 UTC (rev 4056)
@@ -37,6 +37,8 @@
import org.gatein.wsrp.consumer.ProducerInfo;
import org.gatein.wsrp.consumer.RefreshResult;
import org.gatein.wsrp.consumer.handlers.ProducerSessionInformation;
+import org.gatein.wsrp.consumer.migration.ExportInfo;
+import org.gatein.wsrp.consumer.migration.MigrationService;
import javax.servlet.http.HttpSession;
import java.util.List;
@@ -161,6 +163,16 @@
{
}
+ public ExportInfo exportPortlets(List<String> portletHandles) throws PortletInvokerException
+ {
+ throw new NotYetImplemented();
+ }
+
+ public MigrationService getMigrationService()
+ {
+ throw new NotYetImplemented();
+ }
+
public void destroy()
{
}
14 years, 4 months
gatein SVN: r4055 - components/wsrp/trunk.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-09-06 16:59:23 -0400 (Mon, 06 Sep 2010)
New Revision: 4055
Modified:
components/wsrp/trunk/UpdateWSRPForGateIn.sh
Log:
- Added new option to be able to only deploy the admin gui portlet to AS deploy directory. Requires removing wsrp-admin-gui.war from gatein.ear and application.xml.
Modified: components/wsrp/trunk/UpdateWSRPForGateIn.sh
===================================================================
--- components/wsrp/trunk/UpdateWSRPForGateIn.sh 2010-09-06 18:28:40 UTC (rev 4054)
+++ components/wsrp/trunk/UpdateWSRPForGateIn.sh 2010-09-06 20:59:23 UTC (rev 4055)
@@ -53,20 +53,35 @@
# If we have no argument, build and test.
# If we have one argument (irrelevant value), build but skip tests
-# If we have more than one argument (irrelevant values), only deploy the files without build
+# If we have two arguments (irrelevant values), only build and deploy the admin GUI in the AS deploy directory (dev mode)
+# If we have more than two arguments (irrelevant values), only deploy the files without build
if [ $# -eq 0 ]
then
mvn clean install
else
+ echo \| ===============
+ echo \| Skipping tests!
+ echo \| ===============
if [ $# -eq 1 ]
then
- echo \| ===============
- echo \| Skipping tests!
- echo \| ===============
- echo --------------------------------------------------------------------------
mvn clean install '-Dmaven.test.skip=true'
+ else
+ if [ $# -eq 2 ]
+ then
+ echo \| === Only building and deploying Admin GUI!
+ echo \| === GUI will be deployed directly to $GATEIN_EAR_HOME/.. and you will need to remove GUI war
+ echo \| === from $GATEIN_EAR_HOME and edit $GATEIN_EAR_HOME/META-INF/application.xml to remove the GUI module
+ cd admin-gui
+ mvn clean install -Dmaven.test.skip=true
+ war=wsrp-admin-gui
+ echo Copying $war-$CURRENT_WSRP.war to $GATEIN_EAR_HOME/../$war.war
+ cp $HOME/.m2/repository/org/gatein/wsrp/$war/$CURRENT_WSRP/$war-$CURRENT_WSRP.war $GATEIN_EAR_HOME/../$war.war
+ cd -
+ exit
+ fi
fi
fi
+echo --------------------------------------------------------------------------
# get the list of jar files we need to replace in lib
current=`ls $GATEIN_EAR_HOME/lib/wsrp* | sed -n 's/.*\/\(.*\)-'$DEPLOYED_WSRP'.jar/\1/p'`
14 years, 4 months
gatein SVN: r4054 - components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-09-06 14:28:40 -0400 (Mon, 06 Sep 2010)
New Revision: 4054
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/SOAPServiceFactory.java
Log:
- GTNWSRP-68: Only check for NS inconsistency if the NS is either WSRP 1 or WSRP 2. Ignore ports with unknown namespaces.
- Fixed typo.
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/SOAPServiceFactory.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/SOAPServiceFactory.java 2010-09-06 15:22:37 UTC (rev 4053)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/SOAPServiceFactory.java 2010-09-06 18:28:40 UTC (rev 4054)
@@ -394,12 +394,20 @@
String bindingNSURI = null;
for (Port port : ports.values())
{
- String newBindingNS = port.getBinding().getQName().getNamespaceURI();
- if (bindingNSURI != null && !bindingNSURI.equals(newBindingNS))
+ QName bindingName = port.getBinding().getQName();
+ String newBindingNS = bindingName.getNamespaceURI();
+ if (WSRP_V1_BINDING.equals(newBindingNS) || WSRP_V2_BINDING.equals(newBindingNS))
{
- throw new WSDLException(WSDLException.OTHER_ERROR, "Inconsistend NS in port bindings. Aborting.");
+ if (bindingNSURI != null && !bindingNSURI.equals(newBindingNS))
+ {
+ throw new WSDLException(WSDLException.OTHER_ERROR, "Inconsistent NS in port bindings. Aborting.");
+ }
+ bindingNSURI = newBindingNS;
}
- bindingNSURI = newBindingNS;
+ else
+ {
+ log.debug("Unknown binding namespace: " + newBindingNS + ". Ignoring binding: " + bindingName);
+ }
}
if (WSRP_V1_BINDING.equals(bindingNSURI))
{
14 years, 4 months
gatein SVN: r4052 - in portal/branches/navcontroller: webui/portal/src/main/java/org/exoplatform/portal/application and 1 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-09-06 06:06:34 -0400 (Mon, 06 Sep 2010)
New Revision: 4052
Modified:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/ResourceURL.java
portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURL.java
Log:
add ajax on ResourceURL
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/ResourceURL.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/ResourceURL.java 2010-09-06 07:17:48 UTC (rev 4051)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/ResourceURL.java 2010-09-06 10:06:34 UTC (rev 4052)
@@ -31,13 +31,17 @@
/** . */
protected final L locator;
+ /** . */
+ protected Boolean ajax;
+
/**
- * Create a new instance.
+ * Create a resource URL instance.
*
* @param locator the resource locator that can't be null
+ * @param ajax the ajax mode
* @throws NullPointerException if the resource locator is null
*/
- public ResourceURL(L locator) throws NullPointerException
+ public ResourceURL(L locator, Boolean ajax) throws NullPointerException
{
if (locator == null)
{
@@ -46,6 +50,7 @@
//
this.locator = locator;
+ this.ajax = ajax;
}
/**
@@ -59,6 +64,28 @@
}
/**
+ * Returns the ajax mode.
+ *
+ * @return the ajax mode
+ */
+ public final Boolean getAjax()
+ {
+ return ajax;
+ }
+
+ /**
+ * Update the ajax mode.
+ *
+ * @param ajax the new ajax mode
+ * @return this object
+ */
+ public final ResourceURL setAjax(Boolean ajax)
+ {
+ this.ajax = ajax;
+ return this;
+ }
+
+ /**
* Returns the current resource associated with this URL.
*
* @return the resource
Modified: portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
===================================================================
--- portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2010-09-06 07:17:48 UTC (rev 4051)
+++ portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2010-09-06 10:06:34 UTC (rev 4052)
@@ -231,7 +231,7 @@
@Override
public <R, L extends ResourceLocator<R>> ResourceURL<R, L> newURL(ResourceType<R, L> resourceType, L locator)
{
- return new PortalURL<R,L>(this, locator);
+ return new PortalURL<R,L>(this, locator, false);
}
public void refreshResourceBundle() throws Exception
Modified: portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURL.java
===================================================================
--- portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURL.java 2010-09-06 07:17:48 UTC (rev 4051)
+++ portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURL.java 2010-09-06 10:06:34 UTC (rev 4052)
@@ -35,9 +35,9 @@
/** . */
private final PortalRequestContext requestContext;
- public PortalURL(PortalRequestContext requestContext, L locator)
+ public PortalURL(PortalRequestContext requestContext, L locator, Boolean ajax)
{
- super(locator);
+ super(locator, ajax);
//
if (requestContext == null)
14 years, 4 months
gatein SVN: r4051 - epp/portal/branches/EPP_5_1_Branch.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-09-06 03:17:48 -0400 (Mon, 06 Sep 2010)
New Revision: 4051
Modified:
epp/portal/branches/EPP_5_1_Branch/pom.xml
Log:
JBEPP-453: EPP 5.1 productization
Modified: epp/portal/branches/EPP_5_1_Branch/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/pom.xml 2010-09-06 06:54:50 UTC (rev 4050)
+++ epp/portal/branches/EPP_5_1_Branch/pom.xml 2010-09-06 07:17:48 UTC (rev 4051)
@@ -37,16 +37,16 @@
<name>GateIn - Portal</name>
<properties>
- <org.exoplatform.kernel.version>2.2.2-GA</org.exoplatform.kernel.version>
- <org.exoplatform.core.version>2.3.2-GA</org.exoplatform.core.version>
- <org.exoplatform.ws.version>2.1.2-GA</org.exoplatform.ws.version>
- <org.exoplatform.jcr.version>1.12.2-GA</org.exoplatform.jcr.version>
+ <org.exoplatform.kernel.version>2.2.3-GA</org.exoplatform.kernel.version>
+ <org.exoplatform.core.version>2.3.3-GA</org.exoplatform.core.version>
+ <org.exoplatform.ws.version>2.1.3-GA</org.exoplatform.ws.version>
+ <org.exoplatform.jcr.version>1.12.3-GA</org.exoplatform.jcr.version>
<org.jibx.version>1.2.1</org.jibx.version>
- <org.shindig.version>1.0-r790473-Patch02</org.shindig.version>
+ <org.shindig.version>1.0-r790473-Patch03</org.shindig.version>
<nl.captcha.simplecaptcha.version>1.1.1-GA-Patch01</nl.captcha.simplecaptcha.version>
<org.gatein.common.version>2.0.3-GA</org.gatein.common.version>
<org.gatein.wci.version>2.0.1-GA</org.gatein.wci.version>
- <org.gatein.pc.version>2.1.1-GA</org.gatein.pc.version>
+ <org.gatein.pc.version>2.2.0-Beta01</org.gatein.pc.version>
<org.picketlink.idm>1.1.5.GA</org.picketlink.idm>
<org.gatein.wsrp.version>2.0.0-Alpha01</org.gatein.wsrp.version>
<org.gatein.mop.version>1.0.3-GA</org.gatein.mop.version>
14 years, 4 months
gatein SVN: r4050 - epp/docs/branches/EPP_5_0_Branch/5.0.1_Release_Notes/en-US.
by do-not-reply@jboss.org
Author: smumford
Date: 2010-09-06 02:54:50 -0400 (Mon, 06 Sep 2010)
New Revision: 4050
Modified:
epp/docs/branches/EPP_5_0_Branch/5.0.1_Release_Notes/en-US/Book_Info.xml
epp/docs/branches/EPP_5_0_Branch/5.0.1_Release_Notes/en-US/Revision_History.xml
Log:
JBEPP-377: Updated Book_Info and Rev_History
Modified: epp/docs/branches/EPP_5_0_Branch/5.0.1_Release_Notes/en-US/Book_Info.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/5.0.1_Release_Notes/en-US/Book_Info.xml 2010-09-06 06:52:45 UTC (rev 4049)
+++ epp/docs/branches/EPP_5_0_Branch/5.0.1_Release_Notes/en-US/Book_Info.xml 2010-09-06 06:54:50 UTC (rev 4050)
@@ -5,7 +5,7 @@
<title>5.0.1 Release Notes</title>
<subtitle>For use with JBoss Enterprise Portal Platform 5.0.1</subtitle>
<edition>1.0</edition>
- <pubsnumber>1</pubsnumber>
+ <pubsnumber>1.1</pubsnumber>
<productname>JBoss Enterprise Portal Platform</productname>
<productnumber>5.0</productnumber>
<abstract>
Modified: epp/docs/branches/EPP_5_0_Branch/5.0.1_Release_Notes/en-US/Revision_History.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/5.0.1_Release_Notes/en-US/Revision_History.xml 2010-09-06 06:52:45 UTC (rev 4049)
+++ epp/docs/branches/EPP_5_0_Branch/5.0.1_Release_Notes/en-US/Revision_History.xml 2010-09-06 06:54:50 UTC (rev 4050)
@@ -5,6 +5,20 @@
<title>Revision History</title>
<simpara>
<revhistory>
+ <revision>
+ <revnumber>1.1</revnumber>
+ <date>Mon Sep 06 2010</date>
+ <author>
+ <firstname>Scott</firstname>
+ <surname>Mumford</surname>
+ <email>smumford(a)redhat.com</email>
+ </author>
+ <revdescription>
+ <simplelist>
+ <member>Updated help URLs and fixed incorrect JIRA link.</member>
+ </simplelist>
+ </revdescription>
+ </revision>
<revision>
<revnumber>1.0</revnumber>
<date>Fri Sep 03 2010</date>
14 years, 4 months