gatein SVN: r1112 - in portal/branches/wsrp-integration/portlet/exoadmin/src/main: webapp/groovy/wsrp/webui/component and 1 other directories.
by do-not-reply@jboss.org
Author: wesleyhales
Date: 2009-12-21 17:20:03 -0500 (Mon, 21 Dec 2009)
New Revision: 1112
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/UIWsrpConsumerEditor.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/UIWsrpConsole.gtmpl
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/UIWsrpConsumerOverview.gtmpl
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPortlet.gtmpl
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css
Log:
cleaning up the 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 19:58:20 UTC (rev 1111)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsole.java 2009-12-21 22:20:03 UTC (rev 1112)
@@ -45,7 +45,7 @@
@ComponentConfig(
id = "UIWsrpConsoleTab",
type = UITabPane.class,
- //template = "system:/groovy/webui/core/UITabPane_New.gtmpl",
+ //template = "system:/groovy/webui/core/UITabPane.gtmpl",
template = "app:/groovy/wsrp/webui/component/UIWsrpConsoleContent.gtmpl",
events = {@EventConfig(listeners = UIWsrpConsole.SelectTabActionListener.class)})})
public class UIWsrpConsole extends UIContainer
@@ -53,86 +53,87 @@
public UIWsrpConsole() throws Exception
{
UITabPane uiTabPane = addChild(UITabPane.class, "UIWsrpConsoleTab", null);
- uiTabPane.addChild(UIWsrpConsumerOverview.class, null, null).setRendered(true);
- uiTabPane.addChild(UIWsrpProducerOverview.class, null, null);
+ uiTabPane.addChild(UIWsrpConsumerOverview.class, null, "Manage Consumers").setRendered(true);
+ uiTabPane.addChild(UIWsrpProducerOverview.class, null, "Producer Configuration");
uiTabPane.setSelectedTab(1);
+
}
public void processRender(WebuiRequestContext context) throws Exception
{
- UIPortalApplication uiPortalApp = Util.getUIPortalApplication();
- int portalMode = uiPortalApp.getModeState();
- if (portalMode != UIPortalApplication.NORMAL_MODE)
- {
- UITabPane uiTabPane = this.getChild(UITabPane.class);
- UIComponent uiComponent = uiTabPane.getChildById(uiTabPane.getSelectedTabId());
- if (uiComponent instanceof UIWsrpConsumerOverview)
- {
- if (portalMode == UIPortalApplication.APP_VIEW_EDIT_MODE)
- {
- Util.showComponentEditInViewMode(org.exoplatform.portal.webui.container.UIContainer.class);
- }
- else
- {
- uiPortalApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
- Util.showComponentLayoutMode(org.exoplatform.portal.webui.container.UIContainer.class);
- }
- }
- else if (uiComponent instanceof UIWsrpProducerOverview)
- {
- if (portalMode == UIPortalApplication.CONTAINER_VIEW_EDIT_MODE)
- {
- Util.showComponentEditInViewMode(org.exoplatform.portal.webui.container.UIContainer.class);
- }
- else
- {
- uiPortalApp.setModeState(UIPortalApplication.CONTAINER_BLOCK_EDIT_MODE);
- Util.showComponentLayoutMode(org.exoplatform.portal.webui.container.UIContainer.class);
- }
- }
- }
- super.processRender(context);
+// UIPortalApplication uiPortalApp = Util.getUIPortalApplication();
+// int portalMode = uiPortalApp.getModeState();
+// if (portalMode != UIPortalApplication.NORMAL_MODE)
+// {
+// UITabPane uiTabPane = this.getChild(UITabPane.class);
+// UIComponent uiComponent = uiTabPane.getChildById(uiTabPane.getSelectedTabId());
+// if (uiComponent instanceof UIWsrpConsumerOverview)
+// {
+// if (portalMode == UIPortalApplication.APP_VIEW_EDIT_MODE)
+// {
+// Util.showComponentEditInViewMode(org.exoplatform.portal.webui.container.UIContainer.class);
+// }
+// else
+// {
+// uiPortalApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
+// Util.showComponentLayoutMode(org.exoplatform.portal.webui.container.UIContainer.class);
+// }
+// }
+// else if (uiComponent instanceof UIWsrpProducerOverview)
+// {
+// if (portalMode == UIPortalApplication.CONTAINER_VIEW_EDIT_MODE)
+// {
+// Util.showComponentEditInViewMode(org.exoplatform.portal.webui.container.UIContainer.class);
+// }
+// else
+// {
+// uiPortalApp.setModeState(UIPortalApplication.CONTAINER_BLOCK_EDIT_MODE);
+// Util.showComponentLayoutMode(org.exoplatform.portal.webui.container.UIContainer.class);
+// }
+// }
+// }
+ super.processRender(context);
}
static public class SelectTabActionListener extends UITabPane.SelectTabActionListener
{
public void execute(Event<UITabPane> event) throws Exception
{
- super.execute(event);
- UITabPane uiTabPane = event.getSource();
- UIComponent uiComponent = uiTabPane.getChildById(uiTabPane.getSelectedTabId());
- UIPortalApplication uiPortalApp = Util.getUIPortalApplication();
- int portalMode = uiPortalApp.getModeState();
-
- if (uiComponent instanceof UIWsrpConsumerOverview)
- { // Swicth to Porlets Tab
- if (portalMode % 2 == 0)
- {
- uiPortalApp.setModeState(UIPortalApplication.APP_VIEW_EDIT_MODE);
- Util.showComponentEditInViewMode(org.exoplatform.portal.webui.container.UIContainer.class);
- }
- else
- {
- uiPortalApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
- Util.showComponentLayoutMode(org.exoplatform.portal.webui.container.UIContainer.class);
- }
- }
- else if (uiComponent instanceof UIWsrpProducerOverview)
- { // Swicth to
- // Containers Tab
- if (portalMode % 2 == 0)
- {
- uiPortalApp.setModeState(UIPortalApplication.CONTAINER_VIEW_EDIT_MODE);
- Util.showComponentEditInViewMode(org.exoplatform.portal.webui.container.UIContainer.class);
- }
- else
- {
- uiPortalApp.setModeState(UIPortalApplication.CONTAINER_BLOCK_EDIT_MODE);
- Util.showComponentLayoutMode(org.exoplatform.portal.webui.container.UIContainer.class);
- }
- }
- event.getRequestContext().addUIComponentToUpdateByAjax(
- Util.getUIPortalApplication().getChildById(UIPortalApplication.UI_WORKING_WS_ID));
+// super.execute(event);
+// UITabPane uiTabPane = event.getSource();
+// UIComponent uiComponent = uiTabPane.getChildById(uiTabPane.getSelectedTabId());
+// UIPortalApplication uiPortalApp = Util.getUIPortalApplication();
+// int portalMode = uiPortalApp.getModeState();
+//
+// if (uiComponent instanceof UIWsrpConsumerOverview)
+// { // Swicth to Porlets Tab
+// if (portalMode % 2 == 0)
+// {
+// uiPortalApp.setModeState(UIPortalApplication.APP_VIEW_EDIT_MODE);
+// Util.showComponentEditInViewMode(org.exoplatform.portal.webui.container.UIContainer.class);
+// }
+// else
+// {
+// uiPortalApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
+// Util.showComponentLayoutMode(org.exoplatform.portal.webui.container.UIContainer.class);
+// }
+// }
+// else if (uiComponent instanceof UIWsrpProducerOverview)
+// { // Swicth to
+// // Containers Tab
+// if (portalMode % 2 == 0)
+// {
+// uiPortalApp.setModeState(UIPortalApplication.CONTAINER_VIEW_EDIT_MODE);
+// Util.showComponentEditInViewMode(org.exoplatform.portal.webui.container.UIContainer.class);
+// }
+// else
+// {
+// uiPortalApp.setModeState(UIPortalApplication.CONTAINER_BLOCK_EDIT_MODE);
+// Util.showComponentLayoutMode(org.exoplatform.portal.webui.container.UIContainer.class);
+// }
+// }
+// event.getRequestContext().addUIComponentToUpdateByAjax(
+// Util.getUIPortalApplication().getChildById(UIPortalApplication.UI_WORKING_WS_ID));
}
}
Modified: portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java 2009-12-21 19:58:20 UTC (rev 1111)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java 2009-12-21 22:20:03 UTC (rev 1112)
@@ -45,8 +45,7 @@
/** @author Wesley Hales */
@ComponentConfig(template = "app:/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl", lifecycle = UIFormLifecycle.class, events = {
- @EventConfig(listeners = UIWsrpConsumerEditor.SaveActionListener.class),
- @EventConfig(listeners = UIWsrpConsumerEditor.EditActionListener.class)})
+ @EventConfig(listeners = UIWsrpConsumerEditor.SaveActionListener.class)})
public class UIWsrpConsumerEditor extends UIForm
{
protected static final String CONSUMER_NAME = "id";
@@ -56,7 +55,7 @@
public UIWsrpConsumerEditor() throws Exception
{
- addUIFormInput(new UIFormStringInput(CONSUMER_NAME, CONSUMER_NAME, null).addValidator(MandatoryValidator.class));
+ addUIFormInput(new UIFormStringInput(CONSUMER_NAME, CONSUMER_NAME, "123").addValidator(MandatoryValidator.class));
addUIFormInput(new UIFormStringInput(CACHE_EXPIRATION, CACHE_EXPIRATION, null));
addUIFormInput(new UIFormStringInput(WSDL_URL, WSDL_URL, null));
//addChild(UIWsrpEndpointConfigForm.class,null,null);
@@ -83,12 +82,25 @@
return getUIStringInput(WSDL_URL).getValue();
}
+ private Boolean newConsumer;
+
+ public Boolean isNewConsumer()
+ {
+ return newConsumer;
+ }
+
+ public void setNewConsumer(Boolean newConsumer)
+ {
+ this.newConsumer = newConsumer;
+ }
+
public void setConsumer(WSRPConsumer consumer) throws Exception
{
//UIWsrpEndpointConfigForm uiWsrpEndpointConfigForm = getChild(UIWsrpEndpointConfigForm.class);
if (consumer == null)
{
getUIStringInput(CONSUMER_NAME).setEditable(UIFormStringInput.ENABLE);
+ setNewConsumer(true);
return;
}
getUIStringInput(CONSUMER_NAME).setEditable(UIFormStringInput.ENABLE);
@@ -96,6 +108,7 @@
getUIStringInput(CONSUMER_NAME).setValue(consumer.getProducerId());
getUIStringInput(CACHE_EXPIRATION).setValue(consumer.getProducerInfo().getExpirationCacheSeconds().toString());
getUIStringInput(WSDL_URL).setValue(consumer.getProducerInfo().getEndpointConfigurationInfo().getWsdlDefinitionURL());
+ setNewConsumer(false);
//invokeGetBindingBean(consumer.getProducerInfo());
//uiWsrpEndpointConfigForm.setProducerInfo(consumer.getProducerInfo());
@@ -123,7 +136,12 @@
UIWsrpConsumerOverview consumerOverview = consumerEditor.getAncestorOfType(UIWsrpConsumerOverview.class);
WebuiRequestContext ctx = event.getRequestContext();
- consumerEditor.save(ctx);
+ if(consumerEditor.isNewConsumer()){
+ consumerEditor.save(ctx);
+ }else{
+ consumerEditor.edit(ctx);
+ }
+
consumerEditor.reset();
//loose the popup
@@ -148,32 +166,6 @@
}
}
- static public class EditActionListener extends EventListener<UIWsrpConsumerEditor>
- {
- public void execute(Event<UIWsrpConsumerEditor> event) throws Exception
- {
- UIWsrpConsumerEditor consumerEditor = event.getSource();
-
- UIWsrpConsumerOverview consumerOverview = consumerEditor.getAncestorOfType(UIWsrpConsumerOverview.class);
-
- WebuiRequestContext ctx = event.getRequestContext();
- consumerEditor.edit(ctx);
- consumerEditor.reset();
-
- UIPopupWindow popup = consumerEditor.getParent();
- popup.setRendered(false);
- popup.setShow(false);
-
- LazyPageList pageList = consumerOverview.createPageList(consumerOverview.getConfiguredConsumers());
- UIGrid uiGrid = consumerOverview.getChild(UIGrid.class);
- uiGrid.getUIPageIterator().setPageList(pageList);
-
- ctx.addUIComponentToUpdateByAjax(consumerOverview);
- }
-
- }
-
-
public boolean save(WebuiRequestContext context) throws Exception
{
ExoContainer manager = ExoContainerContext.getCurrentContainer();
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 19:58:20 UTC (rev 1111)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java 2009-12-21 22:20:03 UTC (rev 1112)
@@ -123,7 +123,7 @@
public UIWsrpConsumerOverview() throws Exception
{
UIPopupWindow popup = addChild(UIPopupWindow.class, null, null);
- popup.setWindowSize(400, 300);
+ popup.setWindowSize(400, 0);
UIWsrpConsumerEditor consumerForm = createUIComponent(UIWsrpConsumerEditor.class, null, null);
popup.setUIComponent(consumerForm);
popup.setRendered(false);
Modified: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsole.gtmpl
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsole.gtmpl 2009-12-21 19:58:20 UTC (rev 1111)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsole.gtmpl 2009-12-21 22:20:03 UTC (rev 1112)
@@ -1,4 +1,3 @@
-<% uicomponent.renderChildren(); %>
-<div>
-</div>
\ No newline at end of file
+
+<% uicomponent.renderChildren(); %>
Modified: 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/UIWsrpConsumerEditor.gtmpl 2009-12-21 19:58:20 UTC (rev 1111)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl 2009-12-21 22:20:03 UTC (rev 1112)
@@ -7,9 +7,7 @@
<%
UIFormStringInput name = uicomponent.getChild(UIFormStringInput.class);
%>
- <div class="SignIn">Add new Consumer</div>
- <div class="FloatRight">
- <div class="FloatLeft">
+
<div class="UserName">
<div>
<label>Consumer Name</label>
@@ -61,26 +59,6 @@
</table>
</div>
- <div class="UIAction">
- <table class="ActionContainer">
- <tr>
- <td>
- <div onclick="<%=uicomponent.event("Edit")%>" class="ActionButton LightBlueStyle">
- <div class="ButtonLeft">
- <div class="ButtonRight">
- <div class="ButtonMiddle">
- <a href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getId() + ".action.Edit")%></a>
- </div>
- </div>
- </div>
- </div>
- </td>
- </tr>
- </table>
- </div>
- <div class="ClearLeft"><span></span></div>
- </div>
- <div class="ClearRight"><span></span></div>
<% uiform.end() %>
-</div>
+
</div>
\ No newline at end of file
Modified: 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/UIWsrpConsumerOverview.gtmpl 2009-12-21 19:58:20 UTC (rev 1111)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerOverview.gtmpl 2009-12-21 22:20:03 UTC (rev 1112)
@@ -9,8 +9,24 @@
<div class="<%=uicomponent.getId()%>" id="<%=uicomponent.getId()%>">
- <a href="<%=uicomponent.event("OpenPopup", "")%>">Add Consumer</a> |
- <a href="<%=uicomponent.event("RefreshGrid", "")%>">Refresh List</a>
+ <div class="UIAction">
+ <table class="ActionContainer">
+ <tr>
+ <td>
+ <div onclick="<%=uicomponent.event("OpenPopup", "")%>" class="ActionButton LightBlueStyle">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a href="javascript:void(0);">Add New Consumer</a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+
<% uicomponent.renderChildren(); %>
</div>
\ No newline at end of file
Modified: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPortlet.gtmpl
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPortlet.gtmpl 2009-12-21 19:58:20 UTC (rev 1111)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPortlet.gtmpl 2009-12-21 22:20:03 UTC (rev 1112)
@@ -1,4 +1,4 @@
-<% uicomponent.renderChildren(); %>
+
<div class="<%=uicomponent.getId()%>">
-
+ <% uicomponent.renderChildren(); %>
</div>
\ No newline at end of file
Modified: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css 2009-12-21 19:58:20 UTC (rev 1111)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css 2009-12-21 22:20:03 UTC (rev 1112)
@@ -18,7 +18,7 @@
*/
.UIWsrpPortlet {
-
+ padding:10px;
}
img.RefreshIcon {
@@ -39,4 +39,18 @@
img.ActivateIcon {
width: 16px; height: 16px;
background: url('/eXoResources/skin/DefaultSkin/skinIcons/16x16/icons/SelectIcon.gif') no-repeat;
+}
+
+.UIWsrpPortlet .UITabPane {
+ margin: 10px
+}
+
+.UIWsrpPortlet .UIHorizontalTabs .TabsContainer {
+ border-bottom:1px solid #DDDDDD;
+ height:24px;
+}
+
+.UIWsrpPortlet .UIAction .ActionContainer {
+ margin:0;
+ width:auto;
}
\ No newline at end of file
16 years, 4 months
gatein SVN: r1111 - in portal/branches/wsrp-integration/portlet/exoadmin/src/main: webapp/groovy/wsrp/webui/component and 1 other directory.
by do-not-reply@jboss.org
Author: wesleyhales
Date: 2009-12-21 14:58:20 -0500 (Mon, 21 Dec 2009)
New Revision: 1111
Added:
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerPropertyEditor.java
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerPropertyEditor.gtmpl
Modified:
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
Log:
Producer UI base functionality
Modified: 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 2009-12-21 19:47:05 UTC (rev 1110)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java 2009-12-21 19:58:20 UTC (rev 1111)
@@ -40,11 +40,13 @@
import org.exoplatform.webui.form.UIFormStringInput;
import org.exoplatform.webui.form.validator.MandatoryValidator;
import org.gatein.registration.RegistrationPersistenceManager;
+import org.gatein.registration.policies.DefaultRegistrationPolicy;
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;
+import org.gatein.wsrp.producer.config.ProducerRegistrationRequirements;
/** @author Wesley Hales */
@ComponentConfig(template = "app:/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl", lifecycle = UIFormLifecycle.class, events = {
@@ -55,12 +57,16 @@
protected static final String REG_REQUIRED_FOR_DESCRIPTION = "registrationrequiredforfulldescription";
protected static final String STRICT_MODE = "strictmode";
protected static final String REQUIRES_REGISTRATION = "requiresregistration";
+ protected static final String POLICY_CLASS = "policyClassName";
+ protected static final String VALIDATOR_CLASS = "validatorClassName";
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));
+ addUIFormInput(new UIFormStringInput(POLICY_CLASS, POLICY_CLASS, null).addValidator(MandatoryValidator.class));
+ addUIFormInput(new UIFormStringInput(VALIDATOR_CLASS, VALIDATOR_CLASS, null).addValidator(MandatoryValidator.class));
}
public void setProducerConfig(ProducerConfiguration producerConfiguration) throws Exception {
@@ -68,6 +74,14 @@
getUIFormCheckBoxInput(REG_REQUIRED_FOR_DESCRIPTION).setValue(producerConfiguration.getRegistrationRequirements().isRegistrationRequiredForFullDescription());
getUIFormCheckBoxInput(STRICT_MODE).setValue(producerConfiguration.isUsingStrictMode());
getUIFormCheckBoxInput(REQUIRES_REGISTRATION).setValue(producerConfiguration.getRegistrationRequirements().isRegistrationRequired());
+
+ getUIStringInput(POLICY_CLASS).setValue(producerConfiguration.getRegistrationRequirements().getPolicy().getClass().getName());
+
+ if (ProducerRegistrationRequirements.DEFAULT_POLICY_CLASS_NAME.equals(producerConfiguration.getRegistrationRequirements().getPolicy().getClass().getName())){
+ getUIStringInput(VALIDATOR_CLASS).setValue(((DefaultRegistrationPolicy)producerConfiguration.getRegistrationRequirements().getPolicy()).getClass().getName());
+ }
+
+
//producerInfo.setRegistrationInfo();
}
@@ -91,23 +105,27 @@
{
//ConsumerRegistry consumerRegistry = getConsumerRegistry();
//ProducerInfo producerInfo = consumerRegistry.getProducerInfoByKey("").getRegistrationInfo().
+ UIApplication uiApp = context.getUIApplication();
+
ProducerConfigurationService pconfService = getProducerConfigurationService();
ProducerConfiguration producerConfiguration = pconfService.getConfiguration();
+ try{
+ producerConfiguration.getRegistrationRequirements().setRegistrationRequiredForFullDescription(Boolean.parseBoolean(getUIFormCheckBoxInput(REG_REQUIRED_FOR_DESCRIPTION).getValue().toString()));
+ producerConfiguration.setUsingStrictMode(Boolean.parseBoolean(getUIFormCheckBoxInput(STRICT_MODE).getValue().toString()));
- 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()));
+ producerConfiguration.getRegistrationRequirements().setRegistrationRequired(Boolean.parseBoolean(getUIFormCheckBoxInput(REQUIRES_REGISTRATION).getValue().toString()));
+ System.out.println("------------" + getUIStringInput(POLICY_CLASS).getValue());
+ System.out.println("------------" + getUIStringInput(VALIDATOR_CLASS).getValue());
+ System.out.println("------------" + getUIStringInput(POLICY_CLASS).getValue().toString());
+ producerConfiguration.getRegistrationRequirements().reloadPolicyFrom(getUIStringInput(POLICY_CLASS).getValue().toString(), getUIStringInput(VALIDATOR_CLASS).getValue().toString());
- UIApplication uiApp = context.getUIApplication();
+ pconfService.saveConfiguration();
+ uiApp.addMessage(new ApplicationMessage("Producer Successfully Changed", null));
+ }catch(Exception e){
+ uiApp.addMessage(new ApplicationMessage("Producer Modification Error", null, ApplicationMessage.ERROR));
- try{
- pconfService.saveConfiguration();
- uiApp.addMessage(new ApplicationMessage("Producer Successfully Changed", null));
- }catch(Exception e){
- uiApp.addMessage(new ApplicationMessage("Producer Modification Error", null));
+ }
- }
-
return true;
}
Modified: 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 2009-12-21 19:47:05 UTC (rev 1110)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerOverview.java 2009-12-21 19:58:20 UTC (rev 1111)
@@ -22,50 +22,200 @@
******************************************************************************/
package org.exoplatform.wsrp.webui.component;
+import org.exoplatform.commons.utils.LazyPageList;
+import org.exoplatform.commons.utils.ListAccess;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.web.application.ApplicationMessage;
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.UIApplication;
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.core.model.SelectItem;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
+import org.gatein.wsrp.WSRPConsumer;
+import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
import org.gatein.wsrp.producer.config.ProducerConfiguration;
import org.gatein.wsrp.producer.config.ProducerConfigurationService;
+import org.gatein.wsrp.registration.RegistrationPropertyDescription;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+
/** @author Wesley Hales */
@ComponentConfigs({
- @ComponentConfig(id = "RegPropertyGrid", type = UIGrid.class, template = "system:/groovy/webui/core/UIGrid.gtmpl"),
+ @ComponentConfig(id = "RegistrationPropertySelector", 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)
+ @EventConfig(listeners = UIWsrpProducerOverview.AddPropertyActionListener.class),
+ @EventConfig(listeners = UIWsrpProducerOverview.EditPropertyActionListener.class),
+ @EventConfig(listeners = UIWsrpProducerOverview.DeletePropertyActionListener.class)
}
)})
public class UIWsrpProducerOverview extends UIContainer
{
+
+ public static String[] FIELDS = {"name","description", "label", "hint"};
+
+ public static String[] SELECT_ACTIONS = {"EditProperty", "DeleteProperty"};
+
public UIWsrpProducerOverview() throws Exception
{
ProducerConfiguration producerConfiguration = getProducerConfigurationService().getConfiguration();
UIWsrpProducerEditor producerForm = createUIComponent(UIWsrpProducerEditor.class, null, null);
producerForm.setProducerConfig(producerConfiguration);
addChild(producerForm);
+
+ UIGrid uiGrid = addChild(UIGrid.class, "RegistrationPropertySelector", null);
+ //configure the edit and delete buttons based on an id from the data list - this will also be passed as param to listener
+ uiGrid.configure("name", FIELDS, SELECT_ACTIONS);
+
+ //add the propery grid
+ uiGrid.getUIPageIterator().setId("ProducerPropPageIterator");
+ addChild(uiGrid.getUIPageIterator());
+ uiGrid.getUIPageIterator().setRendered(false);
+ LazyPageList propertyList = createPageList(getPropertyList());
+ uiGrid.getUIPageIterator().setPageList(propertyList);
+
+ //add the popup for property edit and adding new properties
+ UIPopupWindow popup = addChild(UIPopupWindow.class, null, null);
+ popup.setWindowSize(400, 300);
+ UIWsrpProducerPropertyEditor propertyForm = createUIComponent(UIWsrpProducerPropertyEditor.class, null, null);
+ popup.setUIComponent(propertyForm);
+ popup.setRendered(false);
}
- static public class OpenPopupActionListener extends EventListener<UIWsrpProducerOverview>
+ public List<RegistrationPropertyDescription> getPropertyList() throws Exception
{
+ ProducerConfiguration producerConfiguration = getProducerConfigurationService().getConfiguration();
+ Map descriptions = producerConfiguration.getRegistrationRequirements().getRegistrationProperties();
+ Comparator<RegistrationPropertyDescription> descComparator = new Comparator<RegistrationPropertyDescription>(){
+ public int compare(RegistrationPropertyDescription o1, RegistrationPropertyDescription o2)
+ {
+ return o1.getName().toString().compareTo(o2.getName().toString());
+ }
+ };
+
+ List<RegistrationPropertyDescription> result = new ArrayList<RegistrationPropertyDescription>(descriptions.values());
+ Collections.sort(result, descComparator);
+ return result;
+ }
+
+ public List<String> getSupportedPropertyTypes()
+ {
+ return Collections.singletonList(("xsd:string"));
+ }
+
+ public LazyPageList createPageList(final List pageList)
+ {
+ return new LazyPageList<WSRPConsumer>(new ListAccess<WSRPConsumer>()
+ {
+
+ public int getSize() throws Exception
+ {
+ return pageList.size();
+ }
+
+ public WSRPConsumer[] load(int index, int length) throws Exception, IllegalArgumentException
+ {
+ WSRPConsumer[] pcs = new WSRPConsumer[pageList.size()];
+
+ if (index < 0)
+ {
+ throw new IllegalArgumentException("Illegal index: index must be a positive number");
+ }
+
+ if (length < 0)
+ {
+ throw new IllegalArgumentException("Illegal length: length must be a positive number");
+ }
+
+ if (index + length > pageList.size())
+ {
+ throw new IllegalArgumentException(
+ "Illegal index or length: sum of the index and the length cannot be greater than the list size");
+ }
+
+ for (int i = 0; i < length; i++)
+ {
+ pcs[i] = (WSRPConsumer)pageList.get(i + index);
+ }
+
+ return pcs;
+ }
+
+ }, 10);
+ }
+
+ static public class EditPropertyActionListener extends EventListener<UIWsrpProducerOverview>
+ {
public void execute(Event<UIWsrpProducerOverview> event) throws Exception
{
+ UIWsrpProducerOverview producerOverview = event.getSource();
+ UIApplication uiApp = event.getRequestContext().getUIApplication();
+ UIPopupWindow popup = producerOverview.getChild(UIPopupWindow.class);
+ UIWsrpProducerPropertyEditor editor = (UIWsrpProducerPropertyEditor)popup.getUIComponent();
+ String id = event.getRequestContext().getRequestParameter(OBJECTID);
+ System.out.println("--------edit name " + id);
+ try
+ {
+ editor.setRegistrationPropertyDescription(producerOverview.getProducerConfigurationService().getConfiguration().getRegistrationRequirements().getRegistrationPropertyWith(id));
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ popup.setUIComponent(editor);
+ popup.setRendered(true);
+ popup.setShow(true);
+
+ }
+ }
+
+ static public class DeletePropertyActionListener extends EventListener<UIWsrpProducerOverview>
+ {
+ public void execute(Event<UIWsrpProducerOverview> event)
+ {
+ UIWsrpProducerOverview producerOverview = event.getSource();
+ UIApplication uiApp = event.getRequestContext().getUIApplication();
+ UIPopupWindow popup = producerOverview.getChild(UIPopupWindow.class);
+ UIWsrpProducerPropertyEditor editor = (UIWsrpProducerPropertyEditor)popup.getUIComponent();
+ String id = event.getRequestContext().getRequestParameter(OBJECTID);
+ System.out.println("--------delete name " + id);
+ try
+ {
+ producerOverview.getProducerConfigurationService().getConfiguration().getRegistrationRequirements().removeRegistrationProperty(id);
+ producerOverview.getProducerConfigurationService().saveConfiguration();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ uiApp.addMessage(new ApplicationMessage("Failed to delete Producer Property. Cause: " + e.getCause(), null, ApplicationMessage.ERROR));
+ }
+
+ }
+ }
+
+ static public class AddPropertyActionListener 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();
+ UIWsrpProducerPropertyEditor editor = (UIWsrpProducerPropertyEditor)popup.getUIComponent();
//reset the form
- //editor.setConsumer(null);
+ editor.setRegistrationPropertyDescription(null);
popup.setRendered(true);
popup.setShow(true);
popup.setShowCloseButton(true);
Added: portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerPropertyEditor.java
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerPropertyEditor.java (rev 0)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerPropertyEditor.java 2009-12-21 19:58:20 UTC (rev 1111)
@@ -0,0 +1,141 @@
+/******************************************************************************
+ * 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.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.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.UIFormStringInput;
+import org.exoplatform.webui.form.validator.MandatoryValidator;
+import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
+import org.gatein.wsrp.producer.config.ProducerConfiguration;
+import org.gatein.wsrp.producer.config.ProducerConfigurationService;
+import org.gatein.wsrp.registration.LocalizedString;
+import org.gatein.wsrp.registration.RegistrationPropertyDescription;
+
+
+/** @author Wesley Hales */
+@ComponentConfig(template = "app:/groovy/wsrp/webui/component/UIWsrpProducerPropertyEditor.gtmpl", lifecycle = UIFormLifecycle.class, events = {
+ @EventConfig(listeners = UIWsrpProducerPropertyEditor.SaveActionListener.class)})
+public class UIWsrpProducerPropertyEditor extends UIForm
+{
+ protected static final String DESCRIPTION = "description";
+ protected static final String LABEL = "label";
+ protected static final String HINT = "hint";
+ private RegistrationPropertyDescription registrationPropertyDescription_;
+
+ public UIWsrpProducerPropertyEditor() throws Exception
+ {
+ addUIFormInput(new UIFormStringInput(DESCRIPTION, DESCRIPTION, null).addValidator(MandatoryValidator.class));
+ addUIFormInput(new UIFormStringInput(LABEL, LABEL, null).addValidator(MandatoryValidator.class));
+ addUIFormInput(new UIFormStringInput(HINT, HINT, null).addValidator(MandatoryValidator.class));
+ }
+
+ public void setRegistrationPropertyDescription(RegistrationPropertyDescription registrationPropertyDescription) throws Exception {
+
+ this.registrationPropertyDescription_ = registrationPropertyDescription;
+
+ if (registrationPropertyDescription_ == null)
+ {
+ getUIStringInput(DESCRIPTION).setEditable(UIFormStringInput.ENABLE);
+ reset();
+ return;
+ }
+ getUIStringInput(DESCRIPTION).setEditable(UIFormStringInput.ENABLE);
+
+ invokeGetBindingBean(registrationPropertyDescription_);
+
+ }
+
+ public RegistrationPropertyDescription getRegistrationPropertyDescription()
+ {
+ return registrationPropertyDescription_;
+ }
+
+ 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
+ {
+
+ ProducerConfigurationService pconfService = getProducerConfigurationService();
+ ProducerConfiguration producerConfiguration = pconfService.getConfiguration();
+
+
+
+ RegistrationPropertyDescription regPropDesc = getRegistrationPropertyDescription();
+ if(regPropDesc != null){
+ System.out.println("---------old1: " + regPropDesc.getDescription());
+ RegistrationPropertyDescription oldRegPropDesc = producerConfiguration.getRegistrationRequirements().getRegistrationProperties().get(regPropDesc);
+ invokeSetBindingBean(oldRegPropDesc);
+ System.out.println("---------new1: " + oldRegPropDesc.getNameAsString());
+ //return;
+ }else{
+
+ RegistrationPropertyDescription newRegProcDesc = new RegistrationPropertyDescription();
+ newRegProcDesc.setDescription(new LocalizedString(getUIStringInput(DESCRIPTION).getValue()));
+ newRegProcDesc.setDescription(new LocalizedString(getUIStringInput(LABEL).getValue()));
+ newRegProcDesc.setDescription(new LocalizedString(getUIStringInput(HINT).getValue()));
+ System.out.println("---------new2: " + newRegProcDesc);
+ producerConfiguration.getRegistrationRequirements().addRegistrationProperty(newRegProcDesc);
+ }
+
+ 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 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/UIWsrpProducerEditor.gtmpl
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl 2009-12-21 19:47:05 UTC (rev 1110)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl 2009-12-21 19:58:20 UTC (rev 1111)
@@ -10,6 +10,9 @@
<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="SignIn">Registration policy class name: <% uiform.renderChild(3); %></div>
+ <div class="SignIn">Registration property validator class name: <% uiform.renderChild(4); %></div>
<div class="FloatRight">
@@ -17,6 +20,9 @@
<table class="ActionContainer">
<tr>
<td>
+
+ </td>
+ <td>
<div onclick="<%=uicomponent.event("Save")%>" class="ActionButton LightBlueStyle">
<div class="ButtonLeft">
<div class="ButtonRight">
Modified: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl 2009-12-21 19:47:05 UTC (rev 1110)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl 2009-12-21 19:58:20 UTC (rev 1111)
@@ -9,8 +9,6 @@
<div class="<%=uicomponent.getId()%>" id="<%=uicomponent.getId()%>">
- <a href="<%=uicomponent.event("OpenPopup", "")%>">Edit Producer</a> |
-
<% uicomponent.renderChildren(); %>
-
+ <a href="<%=uicomponent.event("AddProperty", "")%>">Add Producer Registration Property</a>
</div>
\ No newline at end of file
Added: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerPropertyEditor.gtmpl
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerPropertyEditor.gtmpl (rev 0)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerPropertyEditor.gtmpl 2009-12-21 19:58:20 UTC (rev 1111)
@@ -0,0 +1,65 @@
+<div class="UILoginForm" id="ChildTest">
+ <% uiform.begin() %>
+ <%
+
+ %>
+ <div class="SignIn">Add New Registration Property</div>
+ <div class="FloatRight">
+ <div class="FloatLeft">
+ <div class="UserName">
+ <div>
+ <!--label>Consumer Name</label-->
+ <% //uiform.renderChild(0); %>
+ <%
+ for (field in uiform.getChildren())
+ {
+ if (field.isRendered())
+ {
+ %>
+ <div>
+ <% fieldName = uicomponent.getLabel(field.getName()); %>
+ <% if (!fieldName.equals(uicomponent.getId()))
+ { %>
+ <div class="FieldLabel">
+ <% if (fieldName != null && fieldName.length() > 0)
+ { %>
+ <%=uicomponent.getLabel(field.getName())%>
+ <% } %>
+ </div>
+ <div class="FieldComponent"><% uiform.renderField(field) %></div>
+ <% }
+ else
+ { %>
+ <div class="FieldComponent"><% uiform.renderField(field) %></div>
+ <% } %>
+ </div>
+ <%
+ }
+ } %>
+ </div>
+
+ </div>
+ <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="ClearLeft"><span></span></div>
+ </div>
+ <div class="ClearRight"><span></span></div>
+ <% uiform.end() %>
+</div>
+</div>
\ No newline at end of file
16 years, 4 months
gatein SVN: r1110 - portal/branches/wsrp-integration/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-12-21 14:47:05 -0500 (Mon, 21 Dec 2009)
New Revision: 1110
Modified:
portal/branches/wsrp-integration/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java
Log:
- Adapated for changes in ConsumerRegistry.
Modified: portal/branches/wsrp-integration/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java 2009-12-21 19:35:01 UTC (rev 1109)
+++ portal/branches/wsrp-integration/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java 2009-12-21 19:47:05 UTC (rev 1110)
@@ -1,24 +1,25 @@
/*
-* JBoss, a division of Red Hat
-* Copyright 2009, 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.
-*/
+ * JBoss, a division of Red Hat
+ * Copyright 2009, 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.portal.wsrp.state.consumer;
@@ -60,7 +61,7 @@
public void testCreateAndGet()
{
String id = "test";
- WSRPConsumer consumer = registry.createConsumer(id, null);
+ WSRPConsumer consumer = registry.createConsumer(id, null, null);
assertNotNull(consumer);
assertEquals(id, consumer.getProducerId());
ProducerInfo info = consumer.getProducerInfo();
@@ -97,7 +98,7 @@
public void testGetProducerInfoByKey()
{
- WSRPConsumer consumer = registry.createConsumer("id", null);
+ WSRPConsumer consumer = registry.createConsumer("id", null, null);
ProducerInfo info = consumer.getProducerInfo();
String key = info.getKey();
@@ -110,11 +111,11 @@
{
String id = "foo";
- registry.createConsumer(id, null);
+ registry.createConsumer(id, null, null);
try
{
- registry.createConsumer(id, null);
+ registry.createConsumer(id, null, null);
fail("Shouldn't be possible to create a consumer with an existing id");
}
catch (ConsumerException expected)
@@ -126,7 +127,7 @@
{
String id = "id";
- WSRPConsumer consumer = registry.createConsumer(id, null);
+ WSRPConsumer consumer = registry.createConsumer(id, null, null);
assertEquals(consumer, registry.getConsumer(id));
String key = consumer.getProducerInfo().getKey();
@@ -141,7 +142,7 @@
{
// create a foo consumer
String id = "foo";
- WSRPConsumer consumer = registry.createConsumer(id, null);
+ WSRPConsumer consumer = registry.createConsumer(id, null, null);
ProducerInfo info = consumer.getProducerInfo();
String key = info.getKey();
16 years, 4 months
gatein SVN: r1109 - components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-12-21 14:35:01 -0500 (Mon, 21 Dec 2009)
New Revision: 1109
Modified:
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerManagerBean.java
Log:
- Adapted for changes in ConsumerRegistry.
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 2009-12-21 18:17:29 UTC (rev 1108)
+++ components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerManagerBean.java 2009-12-21 19:35:01 UTC (rev 1109)
@@ -177,7 +177,7 @@
{
try
{
- registry.createConsumer(selectedId, null);
+ registry.createConsumer(selectedId, null, null);
setConsumerIdInSession(false);
return CONFIGURE_CONSUMER;
}
16 years, 4 months
gatein SVN: r1108 - in portal/branches/wsrp-integration/portlet/exoadmin/src/main: webapp/skin/wsrp/webui/component and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-12-21 13:17:29 -0500 (Mon, 21 Dec 2009)
New Revision: 1108
Modified:
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.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/skin/wsrp/webui/component/DefaultStylesheet.css
Log:
- Added activate action.
- Removed start and stop actions.
- Now activate or deactivate consumer based on refresh result.
- Renamed UIWsrpConsumerOverview.getTempArray to getConfiguredConsumers to be more explicit.
Modified: portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java 2009-12-21 18:03:49 UTC (rev 1107)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java 2009-12-21 18:17:29 UTC (rev 1108)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * 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. *
- ******************************************************************************/
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, 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;
@@ -137,7 +137,7 @@
//create a new form, clears out the old, probably a better way
//popup.setUIComponent(consumerOverview.createUIComponent(UIWsrpConsumerEditor.class, null, null));
- LazyPageList pageList = consumerOverview.createPageList(consumerOverview.getTempArrayList());
+ LazyPageList pageList = consumerOverview.createPageList(consumerOverview.getConfiguredConsumers());
UIGrid uiGrid = consumerOverview.getChild(UIGrid.class);
uiGrid.getUIPageIterator().setPageList(pageList);
@@ -164,7 +164,7 @@
popup.setRendered(false);
popup.setShow(false);
- LazyPageList pageList = consumerOverview.createPageList(consumerOverview.getTempArrayList());
+ LazyPageList pageList = consumerOverview.createPageList(consumerOverview.getConfiguredConsumers());
UIGrid uiGrid = consumerOverview.getChild(UIGrid.class);
uiGrid.getUIPageIterator().setPageList(pageList);
@@ -184,10 +184,7 @@
try
{
- WSRPConsumer consumer = consumerRegistry.createConsumer(getConsumerName(), getCacheExpiration());
- ProducerInfo producerInfo = consumer.getProducerInfo();
- producerInfo.getEndpointConfigurationInfo().setWsdlDefinitionURL(getWSDLURL());
- consumerRegistry.updateProducerInfo(producerInfo);
+ consumerRegistry.createConsumer(getConsumerName(), getCacheExpiration(), getWSDLURL());
uiApp.addMessage(new ApplicationMessage("Consumer Successfully Added", null));
}
catch (ConsumerException ce)
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 18:03:49 UTC (rev 1107)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java 2009-12-21 18:17:29 UTC (rev 1108)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * 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. *
- ******************************************************************************/
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, 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;
@@ -39,6 +39,7 @@
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
import org.gatein.wsrp.WSRPConsumer;
+import org.gatein.wsrp.consumer.RefreshResult;
import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
import java.util.List;
@@ -55,10 +56,9 @@
@EventConfig(listeners = UIWsrpConsumerOverview.OpenPopupActionListener.class),
@EventConfig(listeners = UIWsrpConsumerOverview.EditActionListener.class),
@EventConfig(listeners = UIWsrpConsumerOverview.DeleteActionListener.class),
- @EventConfig(listeners = UIWsrpConsumerOverview.StartActionListener.class),
- @EventConfig(listeners = UIWsrpConsumerOverview.StopActionListener.class),
@EventConfig(listeners = UIWsrpConsumerOverview.RefreshActionListener.class),
@EventConfig(listeners = UIWsrpConsumerOverview.DeactivateActionListener.class),
+ @EventConfig(listeners = UIWsrpConsumerOverview.ActivateActionListener.class),
@EventConfig(listeners = UIWsrpConsumerOverview.RefreshGridActionListener.class)
})
})
@@ -71,11 +71,9 @@
//edit
//delete
//
- public static String[] SELECT_ACTIONS = {"Edit", "Delete", "Refresh", "Deactivate", "Start", "Stop"};
+ public static String[] SELECT_ACTIONS = {"Edit", "Delete", "Refresh", "Activate", "Deactivate"};
- private List tempArrayList;
-
- public List getTempArrayList() throws Exception
+ public List getConfiguredConsumers() throws Exception
{
ConsumerRegistry consumerRegistry = getConsumerRegistry();
return consumerRegistry.getConfiguredConsumers();
@@ -137,9 +135,8 @@
uiGrid.getUIPageIterator().setId("ChangeConsumerPageIterator");
addChild(uiGrid.getUIPageIterator());
uiGrid.getUIPageIterator().setRendered(false);
- tempArrayList = getTempArrayList();
- LazyPageList pageList = createPageList(getTempArrayList());
+ LazyPageList pageList = createPageList(getConfiguredConsumers());
uiGrid.getUIPageIterator().setPageList(pageList);
}
@@ -159,7 +156,7 @@
UIGrid uiGrid = consumerOverview.getChild(UIGrid.class);
//refresh the list
- LazyPageList pageList = consumerOverview.createPageList(consumerOverview.getTempArrayList());
+ LazyPageList pageList = consumerOverview.createPageList(consumerOverview.getConfiguredConsumers());
uiGrid.getUIPageIterator().setPageList(pageList);
ctx.addUIComponentToUpdateByAjax(consumerOverview);
@@ -238,7 +235,7 @@
}
}
- static public class StartActionListener extends EventListener<UIWsrpConsumerOverview>
+ static public class DeactivateActionListener extends EventListener<UIWsrpConsumerOverview>
{
public void execute(Event<UIWsrpConsumerOverview> event) throws Exception
{
@@ -246,17 +243,17 @@
WSRPConsumer consumer = consumerOverview.getConsumerFromEvent(event);
UIApplication uiApp = event.getRequestContext().getUIApplication();
- if (consumer != null)
+ if (consumer != null && consumer.isActive())
{
- consumer.start();
- uiApp.addMessage(new ApplicationMessage("Consumer Started Successfully", null));
+ ConsumerRegistry registry = consumerOverview.getConsumerRegistry();
+ registry.deactivateConsumerWith(consumer.getProducerId());
+ uiApp.addMessage(new ApplicationMessage("Consumer successfully deactivated", null));
consumerOverview.refreshGrid(event);
}
-
}
}
- static public class StopActionListener extends EventListener<UIWsrpConsumerOverview>
+ static public class ActivateActionListener extends EventListener<UIWsrpConsumerOverview>
{
public void execute(Event<UIWsrpConsumerOverview> event) throws Exception
{
@@ -264,32 +261,16 @@
WSRPConsumer consumer = consumerOverview.getConsumerFromEvent(event);
UIApplication uiApp = event.getRequestContext().getUIApplication();
- if (consumer != null)
+ if (consumer != null && !consumer.isActive())
{
- consumer.stop();
- uiApp.addMessage(new ApplicationMessage("Consumer Stopped Successfully", null));
+ ConsumerRegistry registry = consumerOverview.getConsumerRegistry();
+ registry.activateConsumerWith(consumer.getProducerId());
+ uiApp.addMessage(new ApplicationMessage("Consumer successfully activated", null));
consumerOverview.refreshGrid(event);
}
}
}
- static public class DeactivateActionListener extends EventListener<UIWsrpConsumerOverview>
- {
- public void execute(Event<UIWsrpConsumerOverview> event) throws Exception
- {
- UIWsrpConsumerOverview consumerOverview = event.getSource();
- WSRPConsumer consumer = consumerOverview.getConsumerFromEvent(event);
- UIApplication uiApp = event.getRequestContext().getUIApplication();
-
- if (consumer != null)
- {
- consumer.deactivate();
- uiApp.addMessage(new ApplicationMessage("Consumer Deactivated Successfully", null));
- consumerOverview.refreshGrid(event);
- }
- }
- }
-
static public class RefreshActionListener extends EventListener<UIWsrpConsumerOverview>
{
public void execute(Event<UIWsrpConsumerOverview> event)
@@ -302,14 +283,40 @@
if (consumer != null)
{
- consumer.refresh(true);
+ ConsumerRegistry registry = consumerOverview.getConsumerRegistry();
+ RefreshResult result = consumer.refresh(true);
+
+ if (result.hasIssues())
+ {
+ // create the expected registration info and make it available
+ /*RegistrationInfo expected = new RegistrationInfo(consumer.getProducerInfo().getRegistrationInfo());
+ expected.refresh(result.getServiceDescription(), consumer.getProducerId(), true, true, true);
+ setExpectedRegistrationInfo(expected);*/
+
+ // refresh had issues, we should deactivate this consumer
+ registry.deactivateConsumerWith(consumer.getProducerId());
+ }
+ else
+ {
+ // activate the consumer if it's supposed to be active
+ if (consumer.isActive())
+ {
+ registry.activateConsumerWith(consumer.getProducerId());
+ }
+ else
+ {
+ registry.deactivateConsumerWith(consumer.getProducerId());
+ }
+
+ }
uiApp.addMessage(new ApplicationMessage("Consumer Refreshed Successfully", null));
consumerOverview.refreshGrid(event);
}
}
catch (Exception e)
{
- uiApp.addMessage(new ApplicationMessage("Failed to refresh Consumer. Cause: " + e.getCause(), null, ApplicationMessage.ERROR));
+ uiApp.addMessage(new ApplicationMessage("Failed to refresh Consumer", null, ApplicationMessage.ERROR));
+ e.printStackTrace();
}
}
}
@@ -324,12 +331,8 @@
public ConsumerRegistry getConsumerRegistry() throws Exception
{
+ // todo: this lookup shouldn't be done on each invocation, store it if possible
ExoContainer manager = ExoContainerContext.getCurrentContainer();
return (ConsumerRegistry)manager.getComponentInstanceOfType(ConsumerRegistry.class);
}
-
-// public void processRender(WebuiRequestContext context) throws Exception
-// {
-// super.processRender(context);
-// }
}
Modified: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css 2009-12-21 18:03:49 UTC (rev 1107)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css 2009-12-21 18:17:29 UTC (rev 1108)
@@ -36,7 +36,7 @@
background: url('/eXoResources/skin/DefaultSkin/skinIcons/16x16/icons/DustBinClickButton.gif') no-repeat;
}
-img.StartIcon {
+img.ActivateIcon {
width: 16px; height: 16px;
background: url('/eXoResources/skin/DefaultSkin/skinIcons/16x16/icons/SelectIcon.gif') no-repeat;
}
\ No newline at end of file
16 years, 4 months
gatein SVN: r1107 - portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-12-21 13:03:49 -0500 (Mon, 21 Dec 2009)
New Revision: 1107
Modified:
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyMapping.java
Log:
- Fixed RegistrationPropertyMapping by adding @Create method and setter for description.
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyMapping.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyMapping.java 2009-12-21 17:25:32 UTC (rev 1106)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyMapping.java 2009-12-21 18:03:49 UTC (rev 1107)
@@ -23,6 +23,7 @@
package org.gatein.portal.wsrp.state.consumer.mapping;
+import org.chromattic.api.annotations.Create;
import org.chromattic.api.annotations.MappedBy;
import org.chromattic.api.annotations.NodeMapping;
import org.chromattic.api.annotations.OneToOne;
@@ -54,6 +55,11 @@
@MappedBy("description")
public abstract RegistrationPropertyDescriptionMapping getDescription();
+ public abstract void setDescription(RegistrationPropertyDescriptionMapping rpdm);
+
+ @Create
+ public abstract RegistrationPropertyDescriptionMapping createDescription();
+
// todo: this should really be an enum�
@Property(name = "status")
@@ -72,7 +78,8 @@
RegistrationPropertyDescription desc = property.getDescription();
if (desc != null)
{
- RegistrationPropertyDescriptionMapping rpdm = getDescription();
+ RegistrationPropertyDescriptionMapping rpdm = createDescription();
+ setDescription(rpdm);
rpdm.initFrom(desc);
}
}
16 years, 4 months
gatein SVN: r1106 - in components/wsrp/trunk/consumer/src: main/java/org/gatein/wsrp/consumer/registry/xml and 2 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-12-21 12:25:32 -0500 (Mon, 21 Dec 2009)
New Revision: 1106
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/AbstractConsumerRegistry.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/ConsumerRegistry.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/xml/XMLWSRPConsumerFactory.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/registry/ConsumerRegistryTestCase.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockConsumerRegistry.java
Log:
- ConsumerRegistry.createConsumer now takes the WSDL URL in parameter.
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/AbstractConsumerRegistry.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/AbstractConsumerRegistry.java 2009-12-21 17:23:34 UTC (rev 1105)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/AbstractConsumerRegistry.java 2009-12-21 17:25:32 UTC (rev 1106)
@@ -81,7 +81,7 @@
this.sessionEventBroadcaster = sessionEventBroadcaster;
}
- public WSRPConsumer createConsumer(String id, Integer expirationCacheSeconds)
+ public WSRPConsumer createConsumer(String id, Integer expirationCacheSeconds, String wsdlURL)
{
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "Consumer identifier", "Creating a Consumer");
@@ -95,6 +95,7 @@
info.setId(id);
info.setRegistry(this);
info.setExpirationCacheSeconds(expirationCacheSeconds);
+ info.getEndpointConfigurationInfo().setWsdlDefinitionURL(wsdlURL);
save(info, "Couldn't create Consumer '" + id + "'");
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/ConsumerRegistry.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/ConsumerRegistry.java 2009-12-21 17:23:34 UTC (rev 1105)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/ConsumerRegistry.java 2009-12-21 17:25:32 UTC (rev 1106)
@@ -44,7 +44,7 @@
FederatingPortletInvoker getFederatingPortletInvoker();
- WSRPConsumer createConsumer(String id, Integer expirationCacheSeconds) throws ConsumerException;
+ WSRPConsumer createConsumer(String id, Integer expirationCacheSeconds, String wsdlURL) throws ConsumerException;
void persistConsumer(WSRPConsumer consumer) throws ConsumerException;
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/xml/XMLWSRPConsumerFactory.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/xml/XMLWSRPConsumerFactory.java 2009-12-21 17:23:34 UTC (rev 1105)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/xml/XMLWSRPConsumerFactory.java 2009-12-21 17:25:32 UTC (rev 1106)
@@ -173,7 +173,7 @@
}
// consumer didn't exist in the database, so create one and configure it
- consumer = consumerRegistry.createConsumer(id, expirationCacheSeconds);
+ consumer = consumerRegistry.createConsumer(id, expirationCacheSeconds, null);
return consumer;
}
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/registry/ConsumerRegistryTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/registry/ConsumerRegistryTestCase.java 2009-12-21 17:23:34 UTC (rev 1105)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/registry/ConsumerRegistryTestCase.java 2009-12-21 17:25:32 UTC (rev 1106)
@@ -52,7 +52,7 @@
public void testCreateAndGet()
{
String id = "test";
- WSRPConsumer consumer = registry.createConsumer(id, null);
+ WSRPConsumer consumer = registry.createConsumer(id, null, null);
assertNotNull(consumer);
assertEquals(id, consumer.getProducerId());
ProducerInfo info = consumer.getProducerInfo();
@@ -89,7 +89,7 @@
public void testGetProducerInfoByKey()
{
- WSRPConsumer consumer = registry.createConsumer("id", null);
+ WSRPConsumer consumer = registry.createConsumer("id", null, null);
ProducerInfo info = consumer.getProducerInfo();
String key = info.getKey();
@@ -102,11 +102,11 @@
{
String id = "foo";
- registry.createConsumer(id, null);
+ registry.createConsumer(id, null, null);
try
{
- registry.createConsumer(id, null);
+ registry.createConsumer(id, null, null);
fail("Shouldn't be possible to create a consumer with an existing id");
}
catch (ConsumerException expected)
@@ -118,7 +118,7 @@
{
String id = "id";
- WSRPConsumer consumer = registry.createConsumer(id, null);
+ WSRPConsumer consumer = registry.createConsumer(id, null, null);
assertEquals(consumer, registry.getConsumer(id));
String key = consumer.getProducerInfo().getKey();
@@ -133,7 +133,7 @@
{
// create a foo consumer
String id = "foo";
- WSRPConsumer consumer = registry.createConsumer(id, null);
+ WSRPConsumer consumer = registry.createConsumer(id, null, null);
ProducerInfo info = consumer.getProducerInfo();
String key = info.getKey();
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockConsumerRegistry.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockConsumerRegistry.java 2009-12-21 17:23:34 UTC (rev 1105)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockConsumerRegistry.java 2009-12-21 17:25:32 UTC (rev 1106)
@@ -75,10 +75,12 @@
return null;
}
- public WSRPConsumer createConsumer(String id, Integer expirationCacheSeconds)
+ public WSRPConsumer createConsumer(String id, Integer expirationCacheSeconds, String wsdlURL)
{
MockWSRPConsumer consumer = new MockWSRPConsumer(id);
- consumer.getProducerInfo().setExpirationCacheSeconds(expirationCacheSeconds);
+ ProducerInfo producerInfo = consumer.getProducerInfo();
+ producerInfo.setExpirationCacheSeconds(expirationCacheSeconds);
+ producerInfo.getEndpointConfigurationInfo().setWsdlDefinitionURL(wsdlURL);
consumers.put(id, consumer);
return consumer;
}
16 years, 4 months
gatein SVN: r1105 - components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-12-21 12:23:34 -0500 (Mon, 21 Dec 2009)
New Revision: 1105
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java
Log:
- More generification.
- Proper logging of activation.
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 2009-12-21 14:57:36 UTC (rev 1104)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java 2009-12-21 17:23:34 UTC (rev 1105)
@@ -137,12 +137,12 @@
// PortletInvoker implementation ************************************************************************************
- public Set getPortlets() throws InvokerUnavailableException
+ public Set<Portlet> getPortlets() throws InvokerUnavailableException
{
try
{
Map portletMap = producerInfo.getPortletMap();
- return new LinkedHashSet(portletMap.values());
+ return new LinkedHashSet<Portlet>(portletMap.values());
}
catch (Exception e)
{
@@ -217,14 +217,14 @@
}
}
- public List destroyClones(List portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ public List<DestroyCloneFailure> destroyClones(List<PortletContext> portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
{
ParameterValidation.throwIllegalArgExceptionIfNull(portletContexts, "Portlet identifiers");
int numberOfClones = portletContexts.size();
if (numberOfClones == 0)
{
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
List<String> handles = new ArrayList<String>(numberOfClones);
@@ -480,6 +480,7 @@
{
internalStart();
producerInfo.setActiveAndSave(true);
+ log.info("Consumer with id '" + getProducerId() + "' activated");
}
private void internalStart() throws Exception
@@ -496,8 +497,6 @@
producerInfo.setActiveAndSave(false);
throw e;
}
-
- log.info("Consumer with id '" + getProducerId() + "' activated");
}
}
16 years, 4 months
gatein SVN: r1104 - in portal/trunk: component/web/src/main/java/org/exoplatform/web and 1 other directories.
by do-not-reply@jboss.org
Author: mstruk
Date: 2009-12-21 09:57:36 -0500 (Mon, 21 Dec 2009)
New Revision: 1104
Modified:
portal/trunk/component/web/pom.xml
portal/trunk/component/web/src/main/java/org/exoplatform/web/GenericHttpListener.java
portal/trunk/packaging/pkg/pom.xml
Log:
GTNPORTAL-409 Added mc-integration interception
Modified: portal/trunk/component/web/pom.xml
===================================================================
--- portal/trunk/component/web/pom.xml 2009-12-21 14:39:23 UTC (rev 1103)
+++ portal/trunk/component/web/pom.xml 2009-12-21 14:57:36 UTC (rev 1104)
@@ -37,6 +37,12 @@
<dependencies>
<dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.container</artifactId>
+ <version>${org.exoplatform.kernel.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.exoplatform.core</groupId>
<artifactId>exo.core.component.organization.api</artifactId>
</dependency>
Modified: portal/trunk/component/web/src/main/java/org/exoplatform/web/GenericHttpListener.java
===================================================================
--- portal/trunk/component/web/src/main/java/org/exoplatform/web/GenericHttpListener.java 2009-12-21 14:39:23 UTC (rev 1103)
+++ portal/trunk/component/web/src/main/java/org/exoplatform/web/GenericHttpListener.java 2009-12-21 14:57:36 UTC (rev 1104)
@@ -24,6 +24,7 @@
import org.exoplatform.container.PortalContainer;
import org.exoplatform.container.RootContainer;
import org.exoplatform.container.RootContainer.PortalContainerPostInitTask;
+import org.exoplatform.container.util.EnvSpecific;
import org.exoplatform.container.web.AbstractHttpSessionListener;
import org.exoplatform.services.listener.ListenerService;
import org.exoplatform.services.log.ExoLogger;
@@ -180,7 +181,17 @@
}
}
};
- RootContainer.getInstance().addInitTask(event.getServletContext(), task);
+ ServletContext ctx = event.getServletContext();
+ try
+ {
+ EnvSpecific.initThreadEnv(ctx);
+ RootContainer.getInstance().addInitTask(event.getServletContext(), task);
+ }
+ finally
+ {
+ EnvSpecific.cleanupThreadEnv(ctx);
+ }
+
}
/**
Modified: portal/trunk/packaging/pkg/pom.xml
===================================================================
--- portal/trunk/packaging/pkg/pom.xml 2009-12-21 14:39:23 UTC (rev 1103)
+++ portal/trunk/packaging/pkg/pom.xml 2009-12-21 14:57:36 UTC (rev 1104)
@@ -37,7 +37,7 @@
<groupId>org.gatein.tools</groupId>
<artifactId>packager</artifactId>
<type>zip</type>
- <version>1.0.0-Beta04</version>
+ <version>1.0.0-Beta05</version>
</dependency>
<dependency>
@@ -335,5 +335,208 @@
</plugins>
</build>
</profile>
+ <profile>
+ <id>pkg-tomcat-tests</id>
+ <build>
+ <finalName>GateIn-${project.version}</finalName>
+ <plugins>
+ <!-- Ensure your environment is correctly setup -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>tomcat-check-environment-ready</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireProperty>
+ <property>exo.projects.directory.dependencies</property>
+ <message>"You must define the property exo.projects.directory.dependencies to give the path to the directory where you store your applications servers"</message>
+ </requireProperty>
+ <requireProperty>
+ <property>exo.projects.app.tomcat.version</property>
+ <message>"You must define the property exo.projects.app.tomcat.version to give the name of the directory where is stored tomcat"</message>
+ </requireProperty>
+ <requireFilesExist>
+ <files>
+ <file>${exo.projects.directory.dependencies}/${exo.projects.app.tomcat.version}/</file>
+ </files>
+ <message>"The following Tomcat directory doesn't exist : ${exo.projects.directory.dependencies}/${exo.projects.app.tomcat.version}"</message>
+ </requireFilesExist>
+ </rules>
+ <fail>true</fail>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- run exo build -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>tomcat-packaging</id>
+ <phase>package</phase>
+ <configuration>
+ <executable>java</executable>
+ <workingDirectory>${basedir}</workingDirectory>
+ <arguments>
+ <argument>-Dexo.package.home=${basedir}/target/packager</argument>
+ <argument>-Dexo.current.dir=${basedir}</argument>
+ <argument>-Dexo.base.dir=${exo.projects.directory.base}</argument>
+ <argument>-Dexo.conf.dir=${basedir}/target/packager-conf</argument>
+ <argument>-Dexo.working.dir=${gatein.working.dir}/</argument>
+ <!--argument>-Dexo.src.dir=NONE</argument-->
+ <argument>-Dexo.dep.dir=${exo.projects.directory.dependencies}</argument><!-- to get the server ref install -->
+ <argument>-Dexo.m2.repos=file:${settings.localRepository}</argument>
+ <argument>-Dclean.server=${exo.projects.app.tomcat.version}</argument>
+ <argument>-Dexo.m2.home=${maven.home}</argument>
+ <argument>-Xshare:auto</argument>
+ <argument>-Xms128m</argument>
+ <argument>-Xmx512m</argument>
+ <argument>-classpath</argument>
+ <argument>${basedir}/target/packager/lib/js.jar</argument>
+ <argument>org.mozilla.javascript.tools.shell.Main</argument>
+ <argument>${basedir}/target/packager/javascript/eXo/eXo.js</argument>
+ <argument>exobuild</argument>
+ <argument>--product=portal</argument>
+ <argument>--deploy=tomcat</argument>
+ <argument>--integration-test</argument>
+ </arguments>
+ </configuration>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+<!--
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>tomcat-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/tomcat-zip.xml</descriptor>
+ </descriptors>
+ <attach>false</attach>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+-->
+ </plugins>
+ </build>
+
+ </profile>
+ <profile>
+ <id>pkg-jbossas-tests</id>
+ <build>
+ <finalName>GateIn-${project.version}</finalName>
+ <plugins>
+ <!-- Ensure your environment is correctly setup -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>jbossas-check-environment-ready</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireProperty>
+ <property>exo.projects.directory.dependencies</property>
+ <message>"You must define the property exo.projects.directory.dependencies to give the path to the directory where you store your applications servers"</message>
+ </requireProperty>
+ <requireProperty>
+ <property>exo.projects.app.jboss.version</property>
+ <message>"You must define the property exo.projects.app.jboss.version to give the name of the directory where is stored JBossAS"</message>
+ </requireProperty>
+ <requireFilesExist>
+ <files>
+ <file>${exo.projects.directory.dependencies}/${exo.projects.app.jboss.version}/</file>
+ </files>
+ <message>"The following JBossAS directory doesn't exist : ${exo.projects.directory.dependencies}/${exo.projects.app.tomcat.version}"</message>
+ </requireFilesExist>
+ </rules>
+ <fail>true</fail>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- run exo buils -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>jbossas-packaging</id>
+ <phase>package</phase>
+ <configuration>
+ <executable>java</executable>
+ <workingDirectory>${basedir}</workingDirectory>
+ <arguments>
+ <argument>-Dexo.package.home=${basedir}/target/packager</argument>
+ <argument>-Dexo.current.dir=${basedir}</argument>
+ <argument>-Dexo.base.dir=${exo.projects.directory.base}</argument>
+ <argument>-Dexo.conf.dir=${basedir}/target/packager-conf</argument>
+ <argument>-Dexo.working.dir=${gatein.working.dir}</argument>
+ <!--argument>-Dexo.src.dir=NONE</argument-->
+ <argument>-Dexo.dep.dir=${exo.projects.directory.dependencies}</argument><!-- to get the server ref install -->
+ <argument>-Dexo.m2.repos=file:${settings.localRepository},http://maven2.exoplatform.org/rest/maven2,http://repository.jboss.org/maven2</argument>
+ <argument>-Dclean.server=${exo.projects.app.jboss.version}</argument>
+ <argument>-Dexo.m2.home=${maven.home}</argument>
+ <argument>-Xshare:auto</argument>
+ <argument>-Xms128m</argument>
+ <argument>-Xmx512m</argument>
+ <argument>-classpath</argument>
+ <argument>${basedir}/target/packager/lib/js.jar</argument>
+ <argument>org.mozilla.javascript.tools.shell.Main</argument>
+ <argument>${basedir}/target/packager/javascript/eXo/eXo.js</argument>
+ <argument>exobuild</argument>
+ <argument>--product=portal</argument>
+ <argument>--deploy=jbossear</argument>
+ <argument>--integration-test</argument>
+ </arguments>
+ </configuration>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+<!--
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>jbossas-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/jbossear-zip.xml</descriptor>
+ </descriptors>
+ <attach>false</attach>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+-->
+ </plugins>
+ </build>
+ </profile>
</profiles>
</project>
16 years, 4 months
gatein SVN: r1103 - portal/trunk/docs/reference-guide/en/modules.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-12-21 09:39:23 -0500 (Mon, 21 Dec 2009)
New Revision: 1103
Modified:
portal/trunk/docs/reference-guide/en/modules/Introduction.xml
Log:
- GateIn is a merge of projects (not the product)
Modified: portal/trunk/docs/reference-guide/en/modules/Introduction.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/Introduction.xml 2009-12-21 14:33:23 UTC (rev 1102)
+++ portal/trunk/docs/reference-guide/en/modules/Introduction.xml 2009-12-21 14:39:23 UTC (rev 1103)
@@ -28,7 +28,7 @@
</imageobject>
</mediaobject>
<para>
- Enterprise Portal Platform 5.0 comes from a merge of two mature projects; the JBoss Portal and the eXo Portal. It takes the best of both into a single new project. The aim is to provide both an intuitive portal to use as-is and a portal framework to build upon depending on your needs.
+ GateIn comes from a merge of two mature projects; the JBoss Portal and the eXo Portal. It takes the best of both into a single new project. The aim is to provide both an intuitive portal to use as-is and a portal framework to build upon depending on your needs.
</para>
<section id="sect-Reference_Guide-Introduction-Links">
<title>Links</title>
16 years, 4 months