Author: wesleyhales
Date: 2009-12-20 20:53:29 -0500 (Sun, 20 Dec 2009)
New Revision: 1083
Added:
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerOverview.java
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl
Modified:
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsole.java
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsoleContent.gtmpl
Log:
groundwork for producer ui done, still need to add a few more inputs and cleanup ui
Modified:
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsole.java
===================================================================
---
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsole.java 2009-12-21
01:27:20 UTC (rev 1082)
+++
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsole.java 2009-12-21
01:53:29 UTC (rev 1083)
@@ -54,7 +54,7 @@
{
UITabPane uiTabPane = addChild(UITabPane.class, "UIWsrpConsoleTab",
null);
uiTabPane.addChild(UIWsrpConsumerOverview.class, null, null).setRendered(true);
- uiTabPane.addChild(UIContainerList.class, null, null);
+ uiTabPane.addChild(UIWsrpProducerOverview.class, null, null);
uiTabPane.setSelectedTab(1);
}
@@ -70,15 +70,15 @@
{
if (portalMode == UIPortalApplication.APP_VIEW_EDIT_MODE)
{
- Util.showComponentEditInViewMode(UIPortlet.class);
+
Util.showComponentEditInViewMode(org.exoplatform.portal.webui.container.UIContainer.class);
}
else
{
uiPortalApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
- Util.showComponentLayoutMode(UIPortlet.class);
+
Util.showComponentLayoutMode(org.exoplatform.portal.webui.container.UIContainer.class);
}
}
- else if (uiComponent instanceof UIContainerList)
+ else if (uiComponent instanceof UIWsrpProducerOverview)
{
if (portalMode == UIPortalApplication.CONTAINER_VIEW_EDIT_MODE)
{
@@ -109,15 +109,15 @@
if (portalMode % 2 == 0)
{
uiPortalApp.setModeState(UIPortalApplication.APP_VIEW_EDIT_MODE);
- Util.showComponentEditInViewMode(UIPortlet.class);
+
Util.showComponentEditInViewMode(org.exoplatform.portal.webui.container.UIContainer.class);
}
else
{
uiPortalApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
- Util.showComponentLayoutMode(UIPortlet.class);
+
Util.showComponentLayoutMode(org.exoplatform.portal.webui.container.UIContainer.class);
}
}
- else if (uiComponent instanceof UIContainerList)
+ else if (uiComponent instanceof UIWsrpProducerOverview)
{ // Swicth to
// Containers Tab
if (portalMode % 2 == 0)
Modified:
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java
===================================================================
---
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java 2009-12-21
01:27:20 UTC (rev 1082)
+++
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java 2009-12-21
01:53:29 UTC (rev 1083)
@@ -83,10 +83,9 @@
private List tempArrayList;
- public List getTempArrayList()
+ public List getTempArrayList() throws Exception
{
- ExoContainer manager = ExoContainerContext.getCurrentContainer();
- ConsumerRegistry consumerRegistry =
(ConsumerRegistry)manager.getComponentInstanceOfType(ConsumerRegistry.class);
+ ConsumerRegistry consumerRegistry = getConsumerRegistry();
return consumerRegistry.getConfiguredConsumers();
}
@@ -161,7 +160,7 @@
}
}
- public void refreshGrid(Event<UIWsrpConsumerOverview> event){
+ public void refreshGrid(Event<UIWsrpConsumerOverview> event) throws Exception {
UIWsrpConsumerOverview consumerOverview = event.getSource();
WebuiRequestContext ctx = event.getRequestContext();
Added:
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java
===================================================================
---
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java
(rev 0)
+++
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java 2009-12-21
01:53:29 UTC (rev 1083)
@@ -0,0 +1,126 @@
+/******************************************************************************
+ * 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.exoplatform.wsrp.webui.component;
+
+import org.exoplatform.commons.utils.LazyPageList;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.web.application.ApplicationMessage;
+import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.core.UIApplication;
+import org.exoplatform.webui.core.UIGrid;
+import org.exoplatform.webui.core.UIPopupWindow;
+import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
+import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
+import org.exoplatform.webui.form.UIForm;
+import org.exoplatform.webui.form.UIFormCheckBoxInput;
+import org.exoplatform.webui.form.UIFormStringInput;
+import org.exoplatform.webui.form.validator.MandatoryValidator;
+import org.gatein.registration.RegistrationPersistenceManager;
+import org.gatein.wsrp.consumer.ConsumerException;
+import org.gatein.wsrp.consumer.ProducerInfo;
+import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
+import org.gatein.wsrp.producer.config.ProducerConfiguration;
+import org.gatein.wsrp.producer.config.ProducerConfigurationService;
+
+/** @author Wesley Hales */
+@ComponentConfig(template =
"app:/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl", lifecycle =
UIFormLifecycle.class, events = {
+ @EventConfig(listeners = UIWsrpProducerEditor.SaveActionListener.class)})
+public class UIWsrpProducerEditor extends UIForm
+{
+
+ protected static final String REG_REQUIRED_FOR_DESCRIPTION =
"registrationrequiredforfulldescription";
+ protected static final String STRICT_MODE = "strictmode";
+ protected static final String REQUIRES_REGISTRATION =
"requiresregistration";
+
+ public UIWsrpProducerEditor() throws Exception
+ {
+ addUIFormInput(new UIFormCheckBoxInput(REG_REQUIRED_FOR_DESCRIPTION,
REG_REQUIRED_FOR_DESCRIPTION, null));
+ addUIFormInput(new UIFormCheckBoxInput(STRICT_MODE, STRICT_MODE, null));
+ addUIFormInput(new UIFormCheckBoxInput(REQUIRES_REGISTRATION,
REQUIRES_REGISTRATION, null));
+ }
+
+ public void setProducerConfig(ProducerConfiguration producerConfiguration) throws
Exception {
+
+
getUIFormCheckBoxInput(REG_REQUIRED_FOR_DESCRIPTION).setValue(producerConfiguration.getRegistrationRequirements().isRegistrationRequiredForFullDescription());
+
getUIFormCheckBoxInput(STRICT_MODE).setValue(producerConfiguration.isUsingStrictMode());
+
getUIFormCheckBoxInput(REQUIRES_REGISTRATION).setValue(producerConfiguration.getRegistrationRequirements().isRegistrationRequired());
+ //producerInfo.setRegistrationInfo();
+ }
+
+
+ static public class SaveActionListener extends
EventListener<UIWsrpProducerEditor>
+ {
+ public void execute(Event<UIWsrpProducerEditor> event) throws Exception
+ {
+ UIWsrpProducerEditor producerEditor = event.getSource();
+
+ UIWsrpProducerEditor producerOverview =
producerEditor.getAncestorOfType(UIWsrpProducerEditor.class);
+
+ WebuiRequestContext ctx = event.getRequestContext();
+ producerEditor.save(ctx);
+ //producerEditor.reset();
+
+ }
+ }
+
+ public boolean save(WebuiRequestContext context) throws Exception
+ {
+ //ConsumerRegistry consumerRegistry = getConsumerRegistry();
+ //ProducerInfo producerInfo =
consumerRegistry.getProducerInfoByKey("").getRegistrationInfo().
+ ProducerConfigurationService pconfService = getProducerConfigurationService();
+ ProducerConfiguration producerConfiguration = pconfService.getConfiguration();
+
+
producerConfiguration.getRegistrationRequirements().setRegistrationRequiredForFullDescription(Boolean.parseBoolean(getUIFormCheckBoxInput(REG_REQUIRED_FOR_DESCRIPTION).getValue().toString()));
+
producerConfiguration.setUsingStrictMode(Boolean.parseBoolean(getUIFormCheckBoxInput(STRICT_MODE).getValue().toString()));
+
producerConfiguration.getRegistrationRequirements().setRegistrationRequired(Boolean.parseBoolean(getUIFormCheckBoxInput(REQUIRES_REGISTRATION).getValue().toString()));
+
+ UIApplication uiApp = context.getUIApplication();
+
+ try{
+ pconfService.saveConfiguration();
+ uiApp.addMessage(new ApplicationMessage("Producer Successfully
Changed", null));
+ }catch(Exception e){
+ uiApp.addMessage(new ApplicationMessage("Producer Modification Error",
null));
+
+ }
+
+ return true;
+ }
+
+
+ public ConsumerRegistry getConsumerRegistry() throws Exception
+ {
+ ExoContainer manager = ExoContainerContext.getCurrentContainer();
+ return
(ConsumerRegistry)manager.getComponentInstanceOfType(ConsumerRegistry.class);
+ }
+
+ public ProducerConfigurationService getProducerConfigurationService() throws
Exception
+ {
+ ExoContainer manager = ExoContainerContext.getCurrentContainer();
+ return
(ProducerConfigurationService)manager.getComponentInstanceOfType(ProducerConfigurationService.class);
+ }
+}
Added:
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerOverview.java
===================================================================
---
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerOverview.java
(rev 0)
+++
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerOverview.java 2009-12-21
01:53:29 UTC (rev 1083)
@@ -0,0 +1,82 @@
+/******************************************************************************
+ * 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.exoplatform.wsrp.webui.component;
+
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.config.annotation.ComponentConfigs;
+import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.core.UIContainer;
+import org.exoplatform.webui.core.UIGrid;
+import org.exoplatform.webui.core.UIPopupWindow;
+import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
+import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
+import org.gatein.wsrp.producer.config.ProducerConfiguration;
+import org.gatein.wsrp.producer.config.ProducerConfigurationService;
+
+/** @author Wesley Hales */
+@ComponentConfigs({
+ @ComponentConfig(id = "RegPropertyGrid", type = UIGrid.class, template =
"system:/groovy/webui/core/UIGrid.gtmpl"),
+ @ComponentConfig(
+ lifecycle = UIApplicationLifecycle.class,
+ template =
"app:/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl",
+ events = {
+ @EventConfig(listeners = UIWsrpProducerOverview.OpenPopupActionListener.class)
+ }
+)})
+public class UIWsrpProducerOverview extends UIContainer
+{
+ public UIWsrpProducerOverview() throws Exception
+ {
+ ProducerConfiguration producerConfiguration =
getProducerConfigurationService().getConfiguration();
+ UIWsrpProducerEditor producerForm = createUIComponent(UIWsrpProducerEditor.class,
null, null);
+ producerForm.setProducerConfig(producerConfiguration);
+ addChild(producerForm);
+ }
+
+ static public class OpenPopupActionListener extends
EventListener<UIWsrpProducerOverview>
+ {
+ public void execute(Event<UIWsrpProducerOverview> event) throws Exception
+ {
+ UIWsrpProducerOverview wsrpProducerOverview = event.getSource();
+ UIPopupWindow popup = wsrpProducerOverview.getChild(UIPopupWindow.class);
+ //UIWsrpProducerEditor editor = (UIWsrpProducerEditor)popup.getUIComponent();
+
+ //reset the form
+ //editor.setConsumer(null);
+ popup.setRendered(true);
+ popup.setShow(true);
+ popup.setShowCloseButton(true);
+ //popup.setShowMask(true);
+
+ }
+ }
+
+ public ProducerConfigurationService getProducerConfigurationService() throws
Exception
+ {
+ ExoContainer manager = ExoContainerContext.getCurrentContainer();
+ return
(ProducerConfigurationService)manager.getComponentInstanceOfType(ProducerConfigurationService.class);
+ }
+}
Modified:
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsoleContent.gtmpl
===================================================================
---
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsoleContent.gtmpl 2009-12-21
01:27:20 UTC (rev 1082)
+++
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsoleContent.gtmpl 2009-12-21
01:53:29 UTC (rev 1083)
@@ -1,5 +1,6 @@
<%
import org.exoplatform.wsrp.webui.component.UIWsrpConsumerOverview;
+ import org.exoplatform.wsrp.webui.component.UIWsrpProducerOverview;
def rcontext = _ctx.getRequestContext();
@@ -14,13 +15,14 @@
String selTabId = uicomponent.getSelectedTabId();
UIWsrpConsumerOverview consumerOverview =
uicomponent.getChild(UIWsrpConsumerOverview.class);
+ UIWsrpProducerOverview producerOverview =
uicomponent.getChild(UIWsrpProducerOverview.class);
%>
<div class="UITab GrayTabStyle">
<div class="<%= consumerOverview.getId().equals(selTabId) ?
"SelectedTab" : "NormalTab" %>">
<div class="LeftTab">
<div class="RightTab">
- <% String appLink = "ajaxAsyncGetRequest('" +
uicomponent.url("SelectTab",consumerOverview.getId()) + "', true)"
%>
- <div class="MiddleTab"
onclick="eXo.webui.UIHorizontalTabs.changeTabForUITabPane(this,
'${consumerOverview.getId()}', '$url');$appLink;if(eXo.portal.portalMode)
eXo.portal.portalMode -= 2;">
+ <% String consumerLink = "ajaxAsyncGetRequest('" +
uicomponent.url("SelectTab",consumerOverview.getId()) + "', true)"
%>
+ <div class="MiddleTab"
onclick="eXo.webui.UIHorizontalTabs.changeTabForUITabPane(this,
'${consumerOverview.getId()}',
'$url');$consumerLink;if(eXo.portal.portalMode) eXo.portal.portalMode -=
2;">
<%=_ctx.appRes("UITabPane.title." +
consumerOverview.getId());%>
</div>
</div>
@@ -28,12 +30,12 @@
</div>
</div>
<div class="UITab GrayTabStyle">
- <div class="NormalTab">
+ <div class="<%= producerOverview.getId().equals(selTabId) ?
"SelectedTab" : "NormalTab" %>">
<div class="LeftTab">
<div class="RightTab">
-
- <div class="MiddleTab" onclick="">
- Manage Producers
+ <% String producerLink = "ajaxAsyncGetRequest('" +
uicomponent.url("SelectTab",producerOverview.getId()) + "', true)"
%>
+ <div class="MiddleTab"
onclick="eXo.webui.UIHorizontalTabs.changeTabForUITabPane(this,
'${producerOverview.getId()}',
'$url');$producerLink;if(eXo.portal.portalMode) eXo.portal.portalMode -=
2;">
+ <%=_ctx.appRes("UITabPane.title." +
producerOverview.getId());%>
</div>
</div>
</div>
@@ -43,6 +45,6 @@
</div>
<div class="UITabContentContainer GrayTabContainer">
<div class="UITabContent" style="display:
<%=consumerOverview.getId().equals(selTabId) ? "block":
"none"%>;overflow:auto;clear:both"><%
uicomponent.renderUIComponent(consumerOverview); %></div>
- <div class="UITabContent"
style="display:none;overflow:auto;clear:both">Producer content</div>
+ <div class="UITabContent" style="display:
<%=producerOverview.getId().equals(selTabId) ? "block":
"none"%>;overflow:auto;clear:both"><%
uicomponent.renderUIComponent(producerOverview); %></div>
</div>
</div>
Copied:
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl
(from rev 1079,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl)
===================================================================
---
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl
(rev 0)
+++
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl 2009-12-21
01:53:29 UTC (rev 1083)
@@ -0,0 +1,39 @@
+<%
+ import org.exoplatform.webui.form.UIFormStringInput;
+%>
+
+<div class="UILoginForm" id="ChildTest">
+ <% uiform.begin() %>
+ <%
+ UIFormStringInput name = uicomponent.getChild(UIFormStringInput.class);
+ %>
+ <div class="SignIn">Access to full service description requires
consumers to be registered. <% uiform.renderChild(0); %></div>
+ <div class="SignIn">Use strict WSRP compliance. <%
uiform.renderChild(1); %></div>
+ <div class="SignIn">Requires registration. Modifying this information
will trigger invalidation of consumer registrations. <% uiform.renderChild(2);
%></div>
+ <div class="FloatRight">
+
+
+ <div class="UIAction">
+ <table class="ActionContainer">
+ <tr>
+ <td>
+ <div onclick="<%=uicomponent.event("Save")%>"
class="ActionButton LightBlueStyle">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a
href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getId() +
".action.Save")%></a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
+
+ <div class="ClearRight"><span></span></div>
+ <% uiform.end() %>
+</div>
+</div>
\ No newline at end of file
Copied:
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl
(from rev 1079,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerOverview.gtmpl)
===================================================================
---
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl
(rev 0)
+++
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl 2009-12-21
01:53:29 UTC (rev 1083)
@@ -0,0 +1,16 @@
+
+<%
+ import org.exoplatform.webui.core.UIComponent ;
+ import org.exoplatform.webui.form.UIFormPageIterator ;
+ import org.exoplatform.webui.form.UIFormCheckBoxInput ;
+
+%>
+
+
+<div class="<%=uicomponent.getId()%>"
id="<%=uicomponent.getId()%>">
+
+ <a href="<%=uicomponent.event("OpenPopup",
"")%>">Edit Producer</a> |
+
+ <% uicomponent.renderChildren(); %>
+
+</div>
\ No newline at end of file