Author: wesleyhales
Date: 2010-01-13 23:20:29 -0500 (Wed, 13 Jan 2010)
New Revision: 1275
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
Log:
Wsrp resource messages for consumer
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java 2010-01-14
04:13:18 UTC (rev 1274)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java 2010-01-14
04:20:29 UTC (rev 1275)
@@ -25,6 +25,8 @@
import org.exoplatform.commons.utils.LazyPageList;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.portal.application.PortalRequestContext;
+import org.exoplatform.portal.webui.portal.UIPortal;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
@@ -35,6 +37,7 @@
import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
+import org.exoplatform.webui.event.MonitorEvent;
import org.exoplatform.webui.form.UIForm;
import org.exoplatform.webui.form.UIFormInputBase;
import org.exoplatform.webui.form.UIFormStringInput;
@@ -162,26 +165,22 @@
}
consumerEditor.reset();
- //loose the popup
- //update the consumer grid/list using ajax
-
//event.getRequestContext().addUIComponentToUpdateByAjax(consumerEditor.getParent().getParent().findComponentById("ConsumerSelector"));
-
- //getChild(UIAccountInputSet.class).reset();
UIPopupWindow popup = consumerEditor.getParent();
popup.setRendered(false);
popup.setShow(false);
- //create a new form, clears out the old, probably a better way
-
//popup.setUIComponent(consumerOverview.createUIComponent(UIWsrpConsumerEditor.class,
null, null));
+ //temp way to refresh list, should call broadcast event (below)
LazyPageList pageList =
consumerOverview.createPageList(consumerOverview.getConfiguredConsumers());
UIGrid uiGrid = consumerOverview.getChild(UIGrid.class);
uiGrid.getUIPageIterator().setPageList(pageList);
+ //uiGrid.configure()
+ //try to broadcast an event back to consumerOverview to refresh grid... works
but shows error
+ //PortalRequestContext portalContext =
org.exoplatform.portal.webui.util.Util.getPortalRequestContext();
+ //Event<UIWsrpConsumerOverview> pnevent = new
Event<UIWsrpConsumerOverview>(consumerOverview, "RefreshGrid",
portalContext);
+ //consumerOverview.broadcast(pnevent, Event.Phase.PROCESS);
ctx.addUIComponentToUpdateByAjax(consumerOverview);
-
-
//consumerOverview.renderUIComponent(consumerEditor.getParent().getParent().findComponentById("ConsumerSelector"));
- //ctx.sendRedirect(consumerOverview.url("wsrp"));
}
}
@@ -189,19 +188,18 @@
{
ExoContainer manager = ExoContainerContext.getCurrentContainer();
ConsumerRegistry consumerRegistry =
(ConsumerRegistry)manager.getComponentInstanceOfType(ConsumerRegistry.class);
- //WSRPConsumer consumer;
UIApplication uiApp = context.getUIApplication();
try
{
consumerRegistry.createConsumer(getConsumerName(), getCacheExpiration(),
getWSDLURL());
- uiApp.addMessage(new ApplicationMessage("Consumer Successfully Added",
null));
+ uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.action.add.success", null));
}
catch (ConsumerException ce)
{
//todo - add to resource bundle
- uiApp.addMessage(new ApplicationMessage("Consumer already exists!",
null));
+ uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.action.add.exists", null,
ApplicationMessage.ERROR));
}
return true;
}
@@ -222,12 +220,11 @@
try
{
consumerRegistry.updateProducerInfo(producerInfo);
- uiApp.addMessage(new ApplicationMessage("Edit Consumer Successful!",
null));
+ uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.action.edit.success", null));
}
catch (ConsumerException ce)
{
- //todo - add to resource bundle
- uiApp.addMessage(new ApplicationMessage("Edit Consumer Problem!",
null));
+ uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.action.edit.fail", null,
ApplicationMessage.ERROR));
}
return true;
}
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java 2010-01-14
04:13:18 UTC (rev 1274)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java 2010-01-14
04:20:29 UTC (rev 1275)
@@ -26,6 +26,9 @@
import org.exoplatform.commons.utils.ListAccess;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.portal.application.PortalRequestContext;
+import org.exoplatform.portal.webui.util.Util;
+import org.exoplatform.portal.webui.workspace.UIPortalApplication;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
@@ -233,13 +236,13 @@
if (consumer != null)
{
consumerRegistry.destroyConsumer(id);
- uiApp.addMessage(new ApplicationMessage("Consumer has been
deleted.", null));
+ uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.grid.action.delete.success", null,
ApplicationMessage.INFO));
consumerOverview.refreshGrid(event);
}
}
catch (Exception e)
{
- uiApp.addMessage(new ApplicationMessage("Failed to delete Consumer.
Cause: " + e.getCause(), null, ApplicationMessage.ERROR));
+ uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.grid.action.delete.fail", new
String[]{e.getCause().toString()}, ApplicationMessage.ERROR));
}
}
@@ -259,12 +262,12 @@
{
ConsumerRegistry registry = consumerOverview.getConsumerRegistry();
registry.deactivateConsumerWith(consumer.getProducerId());
- uiApp.addMessage(new ApplicationMessage("Consumer successfully
deactivated", null));
+ uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.grid.action.deactivate.success", null));
consumerOverview.refreshGrid(event);
}
else
{
- uiApp.addMessage(new ApplicationMessage("Consumer Must be Active to
Deactivate", null));
+ uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.grid.action.deactivate.fail", null));
}
}
}
@@ -284,12 +287,12 @@
{
ConsumerRegistry registry = consumerOverview.getConsumerRegistry();
registry.activateConsumerWith(consumer.getProducerId());
- uiApp.addMessage(new ApplicationMessage("Consumer successfully
activated", null));
+ uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.grid.action.activate.success", null));
consumerOverview.refreshGrid(event);
}
catch (Exception e)
{
- uiApp.addMessage(new ApplicationMessage("Problem Activating Consumer:
" + e.getCause(), null, ApplicationMessage.ERROR));
+ uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.grid.action.activate.fail" , new
String[]{e.getCause().toString()}, ApplicationMessage.ERROR));
e.printStackTrace();
}
}
@@ -321,7 +324,7 @@
// refresh had issues, we should deactivate this consumer
registry.deactivateConsumerWith(consumer.getProducerId());
- uiApp.addMessage(new ApplicationMessage("Consumer refresh resulted
in errors that need to be fixed: " + result.getStatus().toString(), null,
ApplicationMessage.ERROR));
+ uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.grid.action.refresh.fail", null,
ApplicationMessage.ERROR));
}
else
{
@@ -334,14 +337,14 @@
{
registry.deactivateConsumerWith(consumer.getProducerId());
}
- uiApp.addMessage(new ApplicationMessage("Consumer Refreshed
Successfully", null, ApplicationMessage.INFO));
+ uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.grid.action.refresh.success", null,
ApplicationMessage.INFO));
}
consumerOverview.refreshGrid(event);
}
}
catch (Exception e)
{
- uiApp.addMessage(new ApplicationMessage("Failed to refresh Consumer:
" + e.getCause(), null, ApplicationMessage.ERROR));
+ uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.grid.action.refresh.fail" + e.getCause(),
null, ApplicationMessage.ERROR));
e.printStackTrace();
}
}
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2010-01-14
04:13:18 UTC (rev 1274)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2010-01-14
04:20:29 UTC (rev 1275)
@@ -1389,4 +1389,22 @@
UIGadget.tooltip.Maximize=Maximize
UIGadget.tooltip.Unmaximize=Restore Down
UIGadget.tooltip.editGadget=Edit Gadget
-UIGadget.tooltip.deleteGadget=Delete Gadget
\ No newline at end of file
+UIGadget.tooltip.deleteGadget=Delete Gadget
+
+ ############################################################################
+ # org.exoplatform.wsrp.webui.component.UIWsrp #
+ ############################################################################
+
+UIWsrp.consumer.action.add.success=Consumer Successfully Added
+UIWsrp.consumer.action.add.exists=Consumer already exists!
+UIWsrp.consumer.action.edit.success=Edit Consumer Successful!
+UIWsrp.consumer.action.edit.fail=Edit Consumer Problem!
+UIWsrp.consumer.grid.action.delete.success=Consumer has been deleted.
+UIWsrp.consumer.grid.action.delete.fail=Failed to delete Consumer. Cause: {0}
+UIWsrp.consumer.grid.action.refresh.success=Consumer Refreshed Successfully.
+UIWsrp.consumer.grid.action.refresh.needfix=Consumer refresh resulted in errors that need
to be fixed.
+UIWsrp.consumer.grid.action.refresh.fail=Failed to refresh Consumer.
+UIWsrp.consumer.grid.action.activate.success=Consumer successfully activated.
+UIWsrp.consumer.grid.action.activate.fail=Problem Activating Consumer: {0}
+UIWsrp.consumer.grid.action.deactivate.success=Consumer successfully deactivated.
+UIWsrp.consumer.grid.action.deactivate.fail=Consumer Must be Active to Deactivate.
\ No newline at end of file