wise SVN: r468 - in webgui/branches/cdi-jsf/src/main/webapp: images and 1 other directory.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-01-28 18:50:17 -0500 (Mon, 28 Jan 2013)
New Revision: 468
Added:
webgui/branches/cdi-jsf/src/main/webapp/images/
webgui/branches/cdi-jsf/src/main/webapp/images/wise-banner-640px.png
Modified:
webgui/branches/cdi-jsf/src/main/webapp/index.xhtml
Log:
Adding header image
Added: webgui/branches/cdi-jsf/src/main/webapp/images/wise-banner-640px.png
===================================================================
(Binary files differ)
Property changes on: webgui/branches/cdi-jsf/src/main/webapp/images/wise-banner-640px.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: webgui/branches/cdi-jsf/src/main/webapp/index.xhtml
===================================================================
--- webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-01-28 23:25:09 UTC (rev 467)
+++ webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-01-28 23:50:17 UTC (rev 468)
@@ -14,8 +14,11 @@
<ui:define name="title">JBoss Wise GUI</ui:define>
<ui:define name="body">
- <fieldset style="width:600px">
- <legend>Wise GUI</legend>
+ <fieldset style="width:640px">
+ <div>
+ <img src="images/wise-banner-640px.png" border="0" />
+ <br />
+ </div>
<rich:panel header="WSDL selection">
<h:form id="wsdlSelection">
<h:outputLabel value="URL:" for="wsdlUrlInput"/>
11 years, 10 months
wise SVN: r467 - in webgui/branches/cdi-jsf/src/main: webapp and 1 other directory.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-01-28 18:25:09 -0500 (Mon, 28 Jan 2013)
New Revision: 467
Modified:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java
webgui/branches/cdi-jsf/src/main/webapp/index.xhtml
Log:
Prevent double click / submission of wsdl url
Modified: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java 2013-01-28 22:43:00 UTC (rev 466)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java 2013-01-28 23:25:09 UTC (rev 467)
@@ -93,6 +93,7 @@
}
public void parseOperationParameters() {
+ if (currentOperation == null) return;
StringTokenizer st = new StringTokenizer(currentOperation, ";");
String serviceName = st.nextToken();
String portName = st.nextToken();
Modified: webgui/branches/cdi-jsf/src/main/webapp/index.xhtml
===================================================================
--- webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-01-28 22:43:00 UTC (rev 466)
+++ webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-01-28 23:25:09 UTC (rev 467)
@@ -19,8 +19,8 @@
<rich:panel header="WSDL selection">
<h:form id="wsdlSelection">
<h:outputLabel value="URL:" for="wsdlUrlInput"/>
- <h:inputText id="wsdlUrlInput" value="#{clientConversationBean.wsdlUrl}" />
- <a4j:commandButton value="OK" render="epSelection" action="#{clientConversationBean.readWsdl}" />
+ <h:inputText id="wsdlUrlInput" value="#{clientConversationBean.wsdlUrl}" onclick="document.getElementById('wsdlSelection:okButton').disabled=false" />
+ <a4j:commandButton id="okButton" value="OK" render="epSelection" action="#{clientConversationBean.readWsdl}" onclick="this.disabled=true" />
</h:form>
</rich:panel>
<br />
11 years, 10 months
wise SVN: r466 - in webgui/branches/cdi-jsf/src/main: webapp and 1 other directory.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-01-28 17:43:00 -0500 (Mon, 28 Jan 2013)
New Revision: 466
Modified:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java
webgui/branches/cdi-jsf/src/main/webapp/index.xhtml
Log:
Fixing automatic notNil configuration when focussing on inputTexts
Modified: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java 2013-01-28 17:44:33 UTC (rev 465)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java 2013-01-28 22:43:00 UTC (rev 466)
@@ -124,19 +124,11 @@
}
public void addChild(GroupWiseTreeElement el) {
- try {
- el.incrementChildren();
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
+ el.incrementChildren();
}
public void removeChild(WiseTreeElement el) {
- try {
- ((GroupWiseTreeElement)el.getParent()).removeChild(el.getId());
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
+ ((GroupWiseTreeElement)el.getParent()).removeChild(el.getId());
}
public void lazyLoadChild(LazyLoadWiseTreeElement el) {
@@ -147,6 +139,10 @@
}
}
+ public void onInputTextFocus(WiseTreeElement el) {
+ el.setNotNil(true);
+ }
+
private static TreeNodeImpl convertOperationParametersToGui(WSMethod wsMethod, WSDynamicClient client) {
WiseTreeElementBuilder builder = new WiseTreeElementBuilder(client);
TreeNodeImpl rootElement = new TreeNodeImpl();
Modified: webgui/branches/cdi-jsf/src/main/webapp/index.xhtml
===================================================================
--- webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-01-28 17:44:33 UTC (rev 465)
+++ webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-01-28 22:43:00 UTC (rev 466)
@@ -54,8 +54,12 @@
switchType="ajax" binding="#{clientConversationBean.inTree}">
<rich:treeNode type="simple">
<h:outputText value="#{node.type} : #{node.name} " />
- <h:selectBooleanCheckbox id="foo-chk" value="#{node.notNil}" disabled="#{node.notNillable}" />
- <h:inputText value="#{node.value}" id="foo" label="" rendered="#{node.type!='boolean' and node.type!='Boolean'}" columns="10" onfocus="document.getElementById(this.id + '-chk').checked=true" />
+ <h:selectBooleanCheckbox id="foo-chk" value="#{node.notNil}" disabled="#{node.notNillable}" >
+ <f:ajax />
+ </h:selectBooleanCheckbox>
+ <h:inputText value="#{node.value}" id="foo" label="" rendered="#{node.type!='boolean' and node.type!='Boolean'}" columns="10" >
+ <f:ajax event="valueChange" render="foo-chk" listener="#{clientConversationBean.onInputTextFocus(node)}" />
+ </h:inputText>
<h:selectOneMenu value="#{node.value}" rendered="#{node.type=='boolean' or node.type=='Boolean'}">
<f:selectItem itemValue="true" itemLabel="true" />
<f:selectItem itemValue="false" itemLabel="false" />
@@ -86,9 +90,10 @@
</rich:treeNode>
<rich:treeNode type="complex">
<h:outputText value="#{node.type} : #{node.name} " />
- <h:selectBooleanCheckbox value="#{node.notNil}" disabled="#{node.notNillable}" />
- <h:outputText value=" " />
- <h:outputText value=" " />
+ <h:selectBooleanCheckbox value="#{node.notNil}" disabled="#{node.notNillable}" >
+ <f:ajax />
+ </h:selectBooleanCheckbox>
+ <h:outputText value=" " />
<a4j:commandLink action="#{clientConversationBean.removeChild(node)}" rerender="richTree" rendered="#{node.removable}">
Remove
</a4j:commandLink>
@@ -99,7 +104,9 @@
</rich:treeNode>
<rich:treeNode type="XMLGregorianCalendar">
<h:outputText value="#{node.type} : #{node.name} " styleClass="tipoCampo" />
- <h:selectBooleanCheckbox id="foo2-chk" value="#{node.notNil}" disabled="#{node.notNillable}" />
+ <h:selectBooleanCheckbox id="foo2-chk" value="#{node.notNil}" disabled="#{node.notNillable}" >
+ <f:ajax />
+ </h:selectBooleanCheckbox>
<rich:calendar id="foo2" value="#{node.valueDate}" oncollapse="document.getElementById(this.id + '-chk').checked=true;return true;"
popup="true"
showInput="true" enableManualInput="false" />
@@ -109,7 +116,9 @@
</rich:treeNode>
<rich:treeNode type="Duration">
<h:outputText value="#{node.type} : #{node.name} " styleClass="tipoCampo" />
- <h:selectBooleanCheckbox id="foo3-chk" value="#{node.notNil}" disabled="#{node.notNillable}" />
+ <h:selectBooleanCheckbox id="foo3-chk" value="#{node.notNil}" disabled="#{node.notNillable}" >
+ <f:ajax />
+ </h:selectBooleanCheckbox>
<h:inputText id="foo3" value="#{node.value}" onfocus="document.getElementById(this.id + '-chk').checked=true"/>
<h:outputText value="(MilliSeconds)" target="_blank" />
<h:outputText value=" " />
@@ -119,7 +128,9 @@
</rich:treeNode>
<rich:treeNode type="qname">
<h:outputText value="#{node.type} : #{node.name} " styleClass="tipoCampo" />
- <h:selectBooleanCheckbox id="foo4-chk" value="#{node.notNil}" disabled="#{node.notNillable}" />
+ <h:selectBooleanCheckbox id="foo4-chk" value="#{node.notNil}" disabled="#{node.notNillable}" >
+ <f:ajax />
+ </h:selectBooleanCheckbox>
<h:outputText value="nameSpace: " />
<h:inputText id="foo4" value="#{node.nameSpace}" onfocus="document.getElementById(this.id + '-chk').checked=true"/>
<h:outputText value=" localPart: " />
@@ -131,7 +142,9 @@
</rich:treeNode>
<rich:treeNode type="Enumeration">
<h:outputText value="#{node.type} : #{node.name} " styleClass="tipoCampo" />
- <h:selectBooleanCheckbox id="foo5-chk" value="#{node.notNil}" disabled="#{node.notNillable}" />
+ <h:selectBooleanCheckbox id="foo5-chk" value="#{node.notNil}" disabled="#{node.notNillable}" >
+ <f:ajax />
+ </h:selectBooleanCheckbox>
<h:selectOneMenu id="foo5" value="#{node.value}" onfocus="document.getElementById(this.id + '-chk').checked=true">
<f:selectItems value="#{node.validValue}" />
</h:selectOneMenu>
11 years, 10 months
wise SVN: r465 - in webgui/branches/cdi-jsf: src/main/webapp and 1 other directory.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-01-28 12:44:33 -0500 (Mon, 28 Jan 2013)
New Revision: 465
Modified:
webgui/branches/cdi-jsf/pom.xml
webgui/branches/cdi-jsf/src/main/webapp/index.xhtml
Log:
Fixing issue with ajax submission of multiple forms, related to RF-12442
Modified: webgui/branches/cdi-jsf/pom.xml
===================================================================
--- webgui/branches/cdi-jsf/pom.xml 2013-01-27 00:22:48 UTC (rev 464)
+++ webgui/branches/cdi-jsf/pom.xml 2013-01-28 17:44:33 UTC (rev 465)
@@ -39,7 +39,7 @@
<version.org.jboss.as.plugins.maven.plugin>7.3.Final</version.org.jboss.as.plugins.maven.plugin>
<version.org.jboss.spec.jboss.javaee.6.0>3.0.0.Final</version.org.jboss.spec.jboss.javaee.6.0>
- <version.org.richfaces>4.2.0.Final</version.org.richfaces>
+ <version.org.richfaces>4.3.0.CR2</version.org.richfaces> <!-- 4.3.0 required due to https://issues.jboss.org/browse/RF-12442 -->
<version.wise.core>2.0.0-SNAPSHOT</version.wise.core>
<!-- other plugin versions -->
Modified: webgui/branches/cdi-jsf/src/main/webapp/index.xhtml
===================================================================
--- webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-01-27 00:22:48 UTC (rev 464)
+++ webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-01-28 17:44:33 UTC (rev 465)
@@ -20,7 +20,7 @@
<h:form id="wsdlSelection">
<h:outputLabel value="URL:" for="wsdlUrlInput"/>
<h:inputText id="wsdlUrlInput" value="#{clientConversationBean.wsdlUrl}" />
- <a4j:commandButton value="OK" render="opSelectionPanel" action="#{clientConversationBean.readWsdl}" />
+ <a4j:commandButton value="OK" render="epSelection" action="#{clientConversationBean.readWsdl}" />
</h:form>
</rich:panel>
<br />
@@ -36,7 +36,7 @@
<rich:panelMenuGroup label="#{port.name}" expanded="true">
<c:forEach var="operation" items="#{port.operations}" >
<rich:panelMenuItem label="#{operation.fullName}" name="#{service.name};#{port.name};#{operation.name}"
- action="#{clientConversationBean.parseOperationParameters}"/>
+ action="#{clientConversationBean.parseOperationParameters}" render="parInputPanel parInput"/>
</c:forEach>
</rich:panelMenuGroup>
</c:forEach>
11 years, 10 months
wise SVN: r464 - in webgui/branches/cdi-jsf/src/main: java/org/jboss/wise/gui/treeElement and 1 other directories.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-01-26 19:22:48 -0500 (Sat, 26 Jan 2013)
New Revision: 464
Modified:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/LazyLoadWiseTreeElement.java
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/SimpleWiseTreeElement.java
webgui/branches/cdi-jsf/src/main/webapp/index.xhtml
Log:
Adding lazy load functionality in gui tree
Modified: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java 2013-01-26 23:58:27 UTC (rev 463)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java 2013-01-27 00:22:48 UTC (rev 464)
@@ -43,6 +43,7 @@
import org.jboss.wise.core.client.builder.WSDynamicClientBuilder;
import org.jboss.wise.core.client.factories.WSDynamicClientFactory;
import org.jboss.wise.gui.treeElement.GroupWiseTreeElement;
+import org.jboss.wise.gui.treeElement.LazyLoadWiseTreeElement;
import org.jboss.wise.gui.treeElement.WiseTreeElement;
import org.jboss.wise.gui.treeElement.WiseTreeElementBuilder;
import org.richfaces.component.UITree;
@@ -138,6 +139,14 @@
}
}
+ public void lazyLoadChild(LazyLoadWiseTreeElement el) {
+ try {
+ el.resolveReference();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
private static TreeNodeImpl convertOperationParametersToGui(WSMethod wsMethod, WSDynamicClient client) {
WiseTreeElementBuilder builder = new WiseTreeElementBuilder(client);
TreeNodeImpl rootElement = new TreeNodeImpl();
Modified: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/LazyLoadWiseTreeElement.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/LazyLoadWiseTreeElement.java 2013-01-26 23:58:27 UTC (rev 463)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/LazyLoadWiseTreeElement.java 2013-01-27 00:22:48 UTC (rev 464)
@@ -67,6 +67,7 @@
if (!isResolved()) {
WiseTreeElement ref = treeTypesMap.get(this.classType);
WiseTreeElement component = (WiseTreeElement) ref.clone();
+ component.setName(this.getName());
addChild(component.getId(), component);
setResolved(true);
}
Modified: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/SimpleWiseTreeElement.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/SimpleWiseTreeElement.java 2013-01-26 23:58:27 UTC (rev 463)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/SimpleWiseTreeElement.java 2013-01-27 00:22:48 UTC (rev 464)
@@ -110,7 +110,6 @@
element.setName(this.name);
element.setNil(this.nil);
element.setClassType(this.classType);
- element.setValue(this.value);
element.setRemovable(this.isRemovable());
element.setNillable(this.isNillable());
return element;
Modified: webgui/branches/cdi-jsf/src/main/webapp/index.xhtml
===================================================================
--- webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-01-26 23:58:27 UTC (rev 463)
+++ webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-01-27 00:22:48 UTC (rev 464)
@@ -77,6 +77,13 @@
<!-- <h:graphicImage styleClass="minus" value="images/small/Minus.png" rendered="#{node.removable}" /> -->
</a4j:commandLink>
</rich:treeNode>
+ <rich:treeNode type="lazy">
+ <h:outputText value="#{node.type} ..." />
+ <h:outputText value=" " />
+ <a4j:commandLink name="Load" action="#{clientConversationBean.lazyLoadChild(node)}" reRender="richTree" rendered="#{not node.resolved}">
+ load
+ </a4j:commandLink>
+ </rich:treeNode>
<rich:treeNode type="complex">
<h:outputText value="#{node.type} : #{node.name} " />
<h:selectBooleanCheckbox value="#{node.notNil}" disabled="#{node.notNillable}" />
11 years, 11 months
wise SVN: r463 - in webgui/branches/cdi-jsf/src/main: java/org/jboss/wise/gui/treeElement and 1 other directories.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-01-26 18:58:27 -0500 (Sat, 26 Jan 2013)
New Revision: 463
Modified:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElement.java
webgui/branches/cdi-jsf/src/main/webapp/index.xhtml
Log:
Adding "Add" and "Remove" functionalities in the tree gui for group elements + fixing few minor ui issues
Modified: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java 2013-01-25 23:23:53 UTC (rev 462)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java 2013-01-26 23:58:27 UTC (rev 463)
@@ -42,6 +42,7 @@
import org.jboss.wise.core.client.WebParameter;
import org.jboss.wise.core.client.builder.WSDynamicClientBuilder;
import org.jboss.wise.core.client.factories.WSDynamicClientFactory;
+import org.jboss.wise.gui.treeElement.GroupWiseTreeElement;
import org.jboss.wise.gui.treeElement.WiseTreeElement;
import org.jboss.wise.gui.treeElement.WiseTreeElementBuilder;
import org.richfaces.component.UITree;
@@ -100,6 +101,7 @@
} catch (Exception e) {
throw new RuntimeException(e);
}
+ outputTree = null;
}
public void performInvocation() {
@@ -118,9 +120,24 @@
} catch (Exception e) {
throw new RuntimeException(e);
}
-
}
+ public void addChild(GroupWiseTreeElement el) {
+ try {
+ el.incrementChildren();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void removeChild(WiseTreeElement el) {
+ try {
+ ((GroupWiseTreeElement)el.getParent()).removeChild(el.getId());
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
private static TreeNodeImpl convertOperationParametersToGui(WSMethod wsMethod, WSDynamicClient client) {
WiseTreeElementBuilder builder = new WiseTreeElementBuilder(client);
TreeNodeImpl rootElement = new TreeNodeImpl();
Modified: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElement.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElement.java 2013-01-25 23:23:53 UTC (rev 462)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElement.java 2013-01-26 23:58:27 UTC (rev 463)
@@ -52,6 +52,8 @@
protected boolean nillable = true; //for primitives and explicitly not nillable elements
private boolean removable = false; // to be used on array elements
+ private WiseTreeElement parent;
+
protected Type classType;
protected WiseTreeElement() {
@@ -136,11 +138,40 @@
} else {
return ((Class<?>) this.classType).getSimpleName();
}
+ }
+ public WiseTreeElement getParent() {
+ return parent;
}
+ public void setParent(WiseTreeElement parent) {
+ this.parent = parent;
+ }
+
/** ** Abstract method *** */
+ public void addChild(Object key, TreeNode child) {
+ super.addChild(key, child);
+ if (child instanceof WiseTreeElement) {
+ ((WiseTreeElement)child).setParent(this);
+ }
+ }
+
+ public void insertChild(int idx, Object key, TreeNode child) {
+ super.insertChild(idx, key, child);
+ if (child instanceof WiseTreeElement) {
+ ((WiseTreeElement)child).setParent(this);
+ }
+ }
+
+ public void removeChild(Object key) {
+ TreeNode child = getChild(key);
+ if (child instanceof WiseTreeElement) {
+ ((WiseTreeElement)child).setParent(null);
+ }
+ super.removeChild(key);
+ }
+
/**
* Every WiseTreeElement must be cloneable; this is required to handle
* element's add and removal into/from arrays and collections.
Modified: webgui/branches/cdi-jsf/src/main/webapp/index.xhtml
===================================================================
--- webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-01-25 23:23:53 UTC (rev 462)
+++ webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-01-26 23:58:27 UTC (rev 463)
@@ -60,33 +60,31 @@
<f:selectItem itemValue="true" itemLabel="true" />
<f:selectItem itemValue="false" itemLabel="false" />
</h:selectOneMenu>
- <h:outputText value=" " />
-<!-- <a4j:commandLink action="#{WSDLManager.removeChild(node)}" rerender="richTree"
- rendered="#{node.removable}">
- <h:graphicImage styleClass="minus" value="images/small/Minus.png" rendered="#{node.removable}" />
- </a4j:commandLink> -->
+ <a4j:commandLink action="#{clientConversationBean.removeChild(node)}" rerender="richTree" rendered="#{node.removable}">
+ Remove
+ </a4j:commandLink>
</rich:treeNode>
<rich:treeNode type="group">
<h:outputText value="[#{node.prototype.type}]" styleClass="tipoCampo" />
<h:selectBooleanCheckbox value="#{node.notNil}" disabled="true" />
<h:outputText value=" " />
-<!-- <a4j:commandLink name="Add" action="#{WSDLManager.addChild(node)}" reRender="richTree">
- <h:graphicImage styleClass="plus" value="images/small/Plus.png" />
+ <a4j:commandLink name="Add" action="#{clientConversationBean.addChild(node)}" reRender="richTree">
+ Add
+<!-- <h:graphicImage styleClass="plus" value="images/small/Plus.png" /> -->
</a4j:commandLink>
- <a4j:commandLink action="#{WSDLManager.removeChild(node)}" rerender="richTree"
- rendered="#{node.removable}">
- <h:graphicImage styleClass="minus" value="images/small/Minus.png" rendered="#{node.removable}" />
- </a4j:commandLink> -->
+ <a4j:commandLink action="#{clientConversationBean.removeChild(node)}" rerender="richTree" rendered="#{node.removable}">
+ Remove
+<!-- <h:graphicImage styleClass="minus" value="images/small/Minus.png" rendered="#{node.removable}" /> -->
+ </a4j:commandLink>
</rich:treeNode>
<rich:treeNode type="complex">
<h:outputText value="#{node.type} : #{node.name} " />
<h:selectBooleanCheckbox value="#{node.notNil}" disabled="#{node.notNillable}" />
<h:outputText value=" " />
<h:outputText value=" " />
-<!-- <a4j:commandLink action="#{WSDLManager.removeChild(node)}" reRender="richTree"
- rendered="#{node.removable}">
- <h:graphicImage styleClass="minus" value="images/small/Minus.png" rendered="#{node.removable}" />
- </a4j:commandLink> -->
+ <a4j:commandLink action="#{clientConversationBean.removeChild(node)}" rerender="richTree" rendered="#{node.removable}">
+ Remove
+ </a4j:commandLink>
</rich:treeNode>
<rich:treeNode type="Parameterized">
<h:outputText value="{#{node.namespace}} " />
@@ -98,10 +96,9 @@
<rich:calendar id="foo2" value="#{node.valueDate}" oncollapse="document.getElementById(this.id + '-chk').checked=true;return true;"
popup="true"
showInput="true" enableManualInput="false" />
-<!-- <a4j:commandLink action="#{WSDLManager.removeChild(node)}" rerender="richTree"
- rendered="#{node.removable}">
- <h:graphicImage styleClass="minus" value="images/small/Minus.png" rendered="#{node.removable}" />
- </a4j:commandLink> -->
+ <a4j:commandLink action="#{clientConversationBean.removeChild(node)}" rerender="richTree" rendered="#{node.removable}">
+ Remove
+ </a4j:commandLink>
</rich:treeNode>
<rich:treeNode type="Duration">
<h:outputText value="#{node.type} : #{node.name} " styleClass="tipoCampo" />
@@ -109,10 +106,9 @@
<h:inputText id="foo3" value="#{node.value}" onfocus="document.getElementById(this.id + '-chk').checked=true"/>
<h:outputText value="(MilliSeconds)" target="_blank" />
<h:outputText value=" " />
-<!-- <a4j:commandLink action="#{WSDLManager.removeChild(node)}" rerender="richTree"
- rendered="#{node.removable}">
- <h:graphicImage styleClass="minus" value="images/small/Minus.png" rendered="#{node.removable}" />
- </a4j:commandLink> -->
+ <a4j:commandLink action="#{clientConversationBean.removeChild(node)}" rerender="richTree" rendered="#{node.removable}">
+ Remove
+ </a4j:commandLink>
</rich:treeNode>
<rich:treeNode type="qname">
<h:outputText value="#{node.type} : #{node.name} " styleClass="tipoCampo" />
@@ -122,10 +118,9 @@
<h:outputText value=" localPart: " />
<h:inputText value="#{node.localPart}" />
<h:outputText value=" " />
-<!-- <a4j:commandLink action="#{WSDLManager.removeChild(node)}" rerender="richTree"
- rendered="#{node.removable}">
- <h:graphicImage styleClass="minus" value="images/small/Minus.png" rendered="#{node.removable}" />
- </a4j:commandLink> -->
+ <a4j:commandLink action="#{clientConversationBean.removeChild(node)}" rerender="richTree" rendered="#{node.removable}">
+ Remove
+ </a4j:commandLink>
</rich:treeNode>
<rich:treeNode type="Enumeration">
<h:outputText value="#{node.type} : #{node.name} " styleClass="tipoCampo" />
@@ -134,13 +129,12 @@
<f:selectItems value="#{node.validValue}" />
</h:selectOneMenu>
<h:outputText value=" " />
-<!-- <a4j:commandLink action="#{WSDLManager.removeChild(node)}" rerender="richTree"
- rendered="#{node.removable}">
- <h:graphicImage styleClass="minus" value="images/small/Minus.png" rendered="#{node.removable}" />
- </a4j:commandLink> -->
+ <a4j:commandLink action="#{clientConversationBean.removeChild(node)}" rerender="richTree" rendered="#{node.removable}">
+ Remove
+ </a4j:commandLink>
</rich:treeNode>
</rich:tree>
- <a4j:commandButton value="Perform invocation" render="opSelectionPanel" action="#{clientConversationBean.performInvocation}" />
+ <a4j:commandButton value="Perform invocation" render="opSelectionPanel" rerender="opSelectionPanel" action="#{clientConversationBean.performInvocation}" />
</h:form>
</rich:panel>
11 years, 11 months
wise SVN: r462 - in webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui: treeElement and 1 other directory.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-01-25 18:23:53 -0500 (Fri, 25 Jan 2013)
New Revision: 462
Added:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/LazyLoadWiseTreeElement.java
Modified:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElement.java
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElementBuilder.java
Log:
WIP on lazy load elements (to deal with parameter type models including cycles)
Modified: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java 2013-01-20 23:27:29 UTC (rev 461)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java 2013-01-25 23:23:53 UTC (rev 462)
@@ -122,22 +122,22 @@
}
private static TreeNodeImpl convertOperationParametersToGui(WSMethod wsMethod, WSDynamicClient client) {
- WiseTreeElementBuilder builder = new WiseTreeElementBuilder();
+ WiseTreeElementBuilder builder = new WiseTreeElementBuilder(client);
TreeNodeImpl rootElement = new TreeNodeImpl();
Collection<? extends WebParameter> parameters = wsMethod.getWebParams().values();
for (WebParameter parameter : parameters) {
- WiseTreeElement wte = builder.buildTreeFromType(parameter.getType(), parameter.getName(), client);
+ WiseTreeElement wte = builder.buildTreeFromType(parameter.getType(), parameter.getName());
rootElement.addChild(wte.getId(), wte);
}
return rootElement;
}
private static TreeNodeImpl convertOperationResultToGui(InvocationResult result, WSDynamicClient client) {
- WiseTreeElementBuilder builder = new WiseTreeElementBuilder();
+ WiseTreeElementBuilder builder = new WiseTreeElementBuilder(client);
TreeNodeImpl rootElement = new TreeNodeImpl();
for (Entry<String, Object> res : result.getResult().entrySet()) {
Object resObj = res.getValue();
- WiseTreeElement wte = builder.buildTreeFromType(resObj.getClass(), res.getKey(), client, resObj);
+ WiseTreeElement wte = builder.buildTreeFromType(resObj.getClass(), res.getKey(), resObj);
rootElement.addChild(wte.getId(), wte);
}
return rootElement;
Added: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/LazyLoadWiseTreeElement.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/LazyLoadWiseTreeElement.java (rev 0)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/LazyLoadWiseTreeElement.java 2013-01-25 23:23:53 UTC (rev 462)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2013, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.wise.gui.treeElement;
+
+import java.lang.reflect.Type;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.wise.core.utils.IDGenerator;
+
+/**
+ * This tree element is for storing lazy load references to other elements;
+ * required because in some uncommon scenario, the parameter trees might
+ * actually be graphs... (the actually passed data won't be a graph, but
+ * the type model can have cycles in it)
+ *
+ * @author Alessio Soldano, alessio.soldano(a)jboss.com
+ */
+public class LazyLoadWiseTreeElement extends WiseTreeElement {
+
+ private static final long serialVersionUID = 1L;
+
+ private boolean resolved = false;
+ protected Map<Type, WiseTreeElement> treeTypesMap;
+
+ private LazyLoadWiseTreeElement() {
+ this.kind = LAZY;
+ this.id = IDGenerator.nextVal();
+ }
+
+ public LazyLoadWiseTreeElement(Type classType, String name, Map<Type, WiseTreeElement> treeTypesMap) {
+ this.kind = LAZY;
+ this.id = IDGenerator.nextVal();
+ this.classType = classType;
+ this.nil = false;
+ this.name = name;
+ this.treeTypesMap = treeTypesMap;
+ }
+
+ public WiseTreeElement clone() {
+ LazyLoadWiseTreeElement element = new LazyLoadWiseTreeElement();
+ element.setName(this.name);
+ element.setNil(this.nil);
+ element.setClassType(this.classType);
+ element.setRemovable(this.isRemovable());
+ element.setNillable(this.isNillable());
+ element.setResolved(false); //copy into an unresolved element and do not copy child
+ element.setTreeTypesMap(this.treeTypesMap);
+ return element;
+ }
+
+ public void resolveReference() {
+ if (!isResolved()) {
+ WiseTreeElement ref = treeTypesMap.get(this.classType);
+ WiseTreeElement component = (WiseTreeElement) ref.clone();
+ addChild(component.getId(), component);
+ setResolved(true);
+ }
+ }
+
+ public Object toObject() {
+ Iterator<Object> keyIt = this.getChildrenKeysIterator();
+ return keyIt.hasNext() ? ((WiseTreeElement)this.getChild(keyIt.next())).toObject() : null;
+ }
+
+ public boolean isResolved() {
+ return resolved;
+ }
+
+ public void setResolved(boolean resolved) {
+ this.resolved = resolved;
+ }
+
+ public Map<Type, WiseTreeElement> getTreeTypesMap() {
+ return treeTypesMap;
+ }
+
+ public void setTreeTypesMap(Map<Type, WiseTreeElement> treeTypesMap) {
+ this.treeTypesMap = treeTypesMap;
+ }
+}
Modified: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElement.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElement.java 2013-01-20 23:27:29 UTC (rev 461)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElement.java 2013-01-25 23:23:53 UTC (rev 462)
@@ -38,6 +38,7 @@
public static final String DURATION = "Duration";
public static final String ENUMERATION = "Enumeration";
public static final String GROUP = "group";
+ public static final String LAZY = "lazy";
public static final String PARAMETERIZED = "Parameterized";
public static final String QNAME = "qname";
public static final String ROOT = "root";
@@ -50,7 +51,7 @@
protected boolean nil; //whether this elements has the attribute xsi:nil set to "true"
protected boolean nillable = true; //for primitives and explicitly not nillable elements
private boolean removable = false; // to be used on array elements
-
+
protected Type classType;
protected WiseTreeElement() {
Modified: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElementBuilder.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElementBuilder.java 2013-01-20 23:27:29 UTC (rev 461)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElementBuilder.java 2013-01-25 23:23:53 UTC (rev 462)
@@ -21,6 +21,10 @@
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElement;
@@ -40,36 +44,56 @@
* @author alessio.soldano(a)jboss.com
*/
public class WiseTreeElementBuilder {
-
- public WiseTreeElement buildTreeFromType(Type type, String name, WSDynamicClient client) {
- return buildTreeFromType(type, name, client, null, null, null);
+
+ private WSDynamicClient client;
+
+ public WiseTreeElementBuilder(WSDynamicClient client) {
+ this.client = client;
}
- public WiseTreeElement buildTreeFromType(Type type, String name, WSDynamicClient client, Object obj) {
- return buildTreeFromType(type, name, client, obj, null, null);
+ public WiseTreeElement buildTreeFromType(Type type, String name) {
+ return buildTreeFromType(type, name, null, null, null, new HashMap<Type, WiseTreeElement>(), new HashSet<Type>());
}
+
+ public WiseTreeElement buildTreeFromType(Type type, String name, Object obj) {
+ return buildTreeFromType(type, name, obj, null, null, new HashMap<Type, WiseTreeElement>(), new HashSet<Type>());
+ }
- private WiseTreeElement buildTreeFromType(Type type, String name, WSDynamicClient client, Object obj, Class<?> scope, String namespace) {
+ private WiseTreeElement buildTreeFromType(Type type,
+ String name,
+ Object obj,
+ Class<?> scope,
+ String namespace,
+ Map<Type, WiseTreeElement> typeMap,
+ Set<Type> stack) {
Logger.getLogger(this.getClass()).debug("=> Converting parameter '" + name + "', type '" + type + "'");
if (type instanceof ParameterizedType) {
Logger.getLogger(this.getClass()).debug("Parameterized type...");
ParameterizedType pt = (ParameterizedType) type;
- return this.buildParameterizedType(pt, name, obj, client, scope, namespace);
+ return this.buildParameterizedType(pt, name, obj, scope, namespace, typeMap, stack);
} else {
Logger.getLogger(this.getClass()).debug("Not a parameterized type... casting to Class");
- return this.buildFromClass((Class<?>) type, name, obj, client);
+
+ return this.buildFromClass((Class<?>) type, name, obj, typeMap, stack);
}
}
@SuppressWarnings("rawtypes")
- private WiseTreeElement buildParameterizedType(ParameterizedType pt, String name, Object obj, WSDynamicClient client, Class<?> scope, String namespace) {
+ private WiseTreeElement buildParameterizedType(ParameterizedType pt,
+ String name,
+ Object obj,
+ Class<?> scope,
+ String namespace,
+ Map<Type, WiseTreeElement> typeMap,
+ Set<Type> stack) {
+ Type firstTypeArg = pt.getActualTypeArguments()[0];
if (Collection.class.isAssignableFrom((Class<?>) pt.getRawType())) {
- WiseTreeElement prototype = this.buildTreeFromType(pt.getActualTypeArguments()[0], name, client, null);
+ WiseTreeElement prototype = this.buildTreeFromType(firstTypeArg, name, null, null, null, typeMap, stack);
GroupWiseTreeElement group = new GroupWiseTreeElement(pt, name, prototype);
if (obj != null) {
for (Object o : (Collection) obj) {
- group.addChild(IDGenerator.nextVal(), this.buildTreeFromType(pt.getActualTypeArguments()[0], name, client, o));
+ group.addChild(IDGenerator.nextVal(), this.buildTreeFromType(firstTypeArg, name, o, null, null, typeMap, stack));
}
}
return group;
@@ -78,13 +102,17 @@
if (obj != null && obj instanceof JAXBElement) {
obj = ((JAXBElement)obj).getValue();
}
- WiseTreeElement element = this.buildTreeFromType(pt.getActualTypeArguments()[0], name, client, obj);
+ WiseTreeElement element = this.buildTreeFromType(firstTypeArg, name, obj, null, null, typeMap, stack);
parameterized.addChild(element.getId(), element);
return parameterized;
}
}
- private WiseTreeElement buildFromClass(Class<?> cl, String name, Object obj, WSDynamicClient client) {
+ private WiseTreeElement buildFromClass(Class<?> cl,
+ String name,
+ Object obj,
+ Map<Type, WiseTreeElement> typeMap,
+ Set<Type> stack) {
if (cl.isArray()) {
Logger.getLogger(this.getClass()).debug("* array");
@@ -92,15 +120,21 @@
throw new WiseRuntimeException("Converter doesn't support this Object[] yet.");
}
- if (cl.isEnum() || cl.isPrimitive() || client.getClassLoader() != cl.getClassLoader()) {
+ if (isSimpleType(cl, client)) {
Logger.getLogger(this.getClass()).debug("* simple");
SimpleWiseTreeElement element = SimpleWiseTreeElementFactory.create(cl, name);
element.parseObject(obj);
return element;
} else { // complex
+ if (stack.contains(cl)) {
+ Logger.getLogger(this.getClass()).debug("* lazy");
+ return new LazyLoadWiseTreeElement(cl, name, typeMap);
+ }
+
Logger.getLogger(this.getClass()).debug("* complex");
+
ComplexWiseTreeElement complex = new ComplexWiseTreeElement(cl, name);
-
+ stack.add(cl);
for (Field field : ReflectionUtils.getAllFields(cl)) {
XmlElement elemAnnotation = field.getAnnotation(XmlElement.class);
XmlElementRef refAnnotation = field.getAnnotation(XmlElementRef.class);
@@ -126,10 +160,16 @@
throw new WiseRuntimeException("Error calling getter method for field " + field, e);
}
}
- WiseTreeElement element = this.buildTreeFromType(field.getGenericType(), fieldName, client, fieldValue, cl, namespace);
+ WiseTreeElement element = this.buildTreeFromType(field.getGenericType(), fieldName, fieldValue, cl, namespace, typeMap, stack);
complex.addChild(element.getId(), element);
}
+ stack.remove(cl);
+ typeMap.put(cl, complex);
return complex;
}
}
+
+ private static boolean isSimpleType(Class<?> cl, WSDynamicClient client) {
+ return cl.isEnum() || cl.isPrimitive() || client.getClassLoader() != cl.getClassLoader();
+ }
}
11 years, 11 months
wise SVN: r461 - webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-01-20 18:27:29 -0500 (Sun, 20 Jan 2013)
New Revision: 461
Modified:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/ParameterizedWiseTreeElement.java
Log:
Fix tree to Object conversion of parameterized elements
Modified: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/ParameterizedWiseTreeElement.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/ParameterizedWiseTreeElement.java 2013-01-20 23:26:38 UTC (rev 460)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/ParameterizedWiseTreeElement.java 2013-01-20 23:27:29 UTC (rev 461)
@@ -16,9 +16,14 @@
*/
package org.jboss.wise.gui.treeElement;
+import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.util.Iterator;
+import java.util.List;
+import javax.xml.bind.annotation.XmlElementDecl;
+
+import org.jboss.logging.Logger;
import org.jboss.wise.core.client.WSDynamicClient;
import org.jboss.wise.core.exception.WiseRuntimeException;
import org.jboss.wise.core.utils.IDGenerator;
@@ -75,12 +80,43 @@
@Override
public Object toObject() throws WiseRuntimeException {
- return null;
-// if (client == null) {
-// throw new WiseRuntimeException("null client: impossible conversion of ParameterizedWiseTreeElemnt to object");
-// }
-// return isLeaf() ? null : client.instanceXmlElementDecl(this.name, this.scope, this.namespace, this.getChildrenAsList().get(0).toObject());
+ return isLeaf() ? null : instanceXmlElementDecl(this.name, this.scope, this.namespace, ((WiseTreeElement) this.getChild(this.getChildrenKeysIterator().next())).toObject());
}
+
+ private Object instanceXmlElementDecl(String name, Class<?> scope, String namespace, Object value) {
+ try {
+ Class<?> objectFactoryClass = null;
+ Method methodToUse = null;
+ boolean done = false;
+ List<Class<?>> objectFactories = client.getObjectFactories();
+ if (objectFactories != null) {
+ for (Iterator<Class<?>> it = objectFactories.iterator(); it.hasNext() && !done; ) {
+ objectFactoryClass = it.next();
+ Method[] methods = objectFactoryClass.getMethods();
+ for (int i = 0; i < methods.length; i++) {
+ XmlElementDecl annotation = methods[i].getAnnotation(XmlElementDecl.class);
+ if (annotation != null && name.equals(annotation.name()) && (annotation.namespace() == null || annotation.namespace().equals(namespace)) && (annotation
+ .scope() == null || annotation.scope().equals(scope))) {
+ methodToUse = methods[i];
+ break;
+ }
+ }
+ if (methodToUse != null) {
+ done = true;
+ }
+ }
+ }
+ if (methodToUse != null) {
+ Object obj = objectFactoryClass.newInstance();
+ Logger.getLogger(this.getClass()).debug(methodToUse + " with value=" + value);
+ return methodToUse.invoke(obj, new Object[] { value });
+ } else {
+ return null;
+ }
+ } catch (Exception e) {
+ throw new WiseRuntimeException(e);
+ }
+ }
public void setClient(WSDynamicClient client) {
this.client = client;
11 years, 11 months
wise SVN: r460 - core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-01-20 18:26:38 -0500 (Sun, 20 Jan 2013)
New Revision: 460
Modified:
core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSDynamicClientImpl.java
Log:
Help garbage collection of generated classes
Modified: core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSDynamicClientImpl.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSDynamicClientImpl.java 2013-01-20 23:25:56 UTC (rev 459)
+++ core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSDynamicClientImpl.java 2013-01-20 23:26:38 UTC (rev 460)
@@ -268,6 +268,7 @@
}
}
}
+ this.classLoader = null;
}
/**
11 years, 11 months
wise SVN: r459 - in core/trunk/core/src/main/java/org/jboss/wise/core/client: impl/reflection and 1 other directory.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-01-20 18:25:56 -0500 (Sun, 20 Jan 2013)
New Revision: 459
Modified:
core/trunk/core/src/main/java/org/jboss/wise/core/client/WSDynamicClient.java
core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSDynamicClientImpl.java
Log:
Adding method for retrieving ObjectFactory classes
Modified: core/trunk/core/src/main/java/org/jboss/wise/core/client/WSDynamicClient.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/core/client/WSDynamicClient.java 2013-01-20 22:41:17 UTC (rev 458)
+++ core/trunk/core/src/main/java/org/jboss/wise/core/client/WSDynamicClient.java 2013-01-20 23:25:56 UTC (rev 459)
@@ -23,6 +23,7 @@
package org.jboss.wise.core.client;
import java.net.URLClassLoader;
+import java.util.List;
import java.util.Map;
import org.jboss.wise.core.exception.ResourceNotAvailableException;
@@ -55,6 +56,11 @@
* @return The classLoader used to load generated class.
*/
public URLClassLoader getClassLoader();
+
+ /**
+ * @return The ObjectFactory classes for the generated sources
+ */
+ public List<Class<?>> getObjectFactories();
/**
* It return directly the method to invoke the specified action on specified
Modified: core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSDynamicClientImpl.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSDynamicClientImpl.java 2013-01-20 22:41:17 UTC (rev 458)
+++ core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSDynamicClientImpl.java 2013-01-20 23:25:56 UTC (rev 459)
@@ -30,6 +30,8 @@
import java.net.URLClassLoader;
import java.util.Collections;
import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -216,6 +218,23 @@
public synchronized final void setClassLoader(URLClassLoader classLoader) {
this.classLoader = classLoader;
}
+
+ public synchronized List<Class<?>> getObjectFactories() {
+ List<Class<?>> list = new LinkedList<Class<?>>();
+ for (String className : classNames) {
+ if (className.endsWith("ObjectFactory")) {
+ try {
+ Class<?> clazz = JavaUtils.loadJavaType(className, this.getClassLoader());
+ //TODO!! Add check on @XmlRegistry
+ list.add(clazz);
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new IllegalStateException("Error during loading/instanciating class:" + className + " with exception message: " + e.getMessage());
+ }
+ }
+ }
+ return list;
+ }
/**
* {@inheritDoc}
11 years, 11 months