wise SVN: r478 - 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-31 12:08:55 -0500 (Thu, 31 Jan 2013)
New Revision: 478
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/ParameterizedWiseTreeElement.java
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElementBuilder.java
Log:
Support for INOUT / OUT parameters (jaxws Holder)
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-31 17:08:04 UTC (rev 477)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java 2013-01-31 17:08:55 UTC (rev 478)
@@ -195,15 +195,25 @@
private static TreeNodeImpl convertOperationResultToGui(InvocationResult result, WSDynamicClient client) {
WiseTreeElementBuilder builder = new WiseTreeElementBuilder(client);
TreeNodeImpl rootElement = new TreeNodeImpl();
+ Map<String, Type> resTypes = new HashMap<String, Type>();
for (Entry<String, Object> res : result.getResult().entrySet()) {
+ String key = res.getKey();
+ if (key.startsWith(WSMethod.TYPE_PREFIX)) {
+ resTypes.put(key, (Type)res.getValue());
+ }
+ }
+ for (Entry<String, Object> res : result.getResult().entrySet()) {
Object resObj = res.getValue();
- WiseTreeElement wte;
- if (resObj != null) {
- wte = builder.buildTreeFromType(resObj.getClass(), res.getKey(), resObj, true);
- } else {
- wte = new EmptyWiseTreeElement("result");
+ final String key = res.getKey();
+ if (!key.startsWith(WSMethod.TYPE_PREFIX)) {
+ WiseTreeElement wte;
+ if (resObj != null) {
+ wte = builder.buildTreeFromType(resTypes.get(WSMethod.TYPE_PREFIX + key), key, resObj, true);
+ } else {
+ wte = new EmptyWiseTreeElement("result"); // TODO!! remove this and treat other elements now that return types are available
+ }
+ rootElement.addChild(wte.getId(), wte);
}
- rootElement.addChild(wte.getId(), wte);
}
return rootElement;
}
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-31 17:08:04 UTC (rev 477)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/ParameterizedWiseTreeElement.java 2013-01-31 17:08:55 UTC (rev 478)
@@ -21,7 +21,9 @@
import java.util.Iterator;
import java.util.List;
+import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.ws.Holder;
import org.jboss.logging.Logger;
import org.jboss.wise.core.client.WSDynamicClient;
@@ -42,13 +44,15 @@
private Class<?> scope;
private String namespace;
+
+ private Class<?> parameterizedClass;
public ParameterizedWiseTreeElement() {
this.kind = PARAMETERIZED;
this.id = IDGenerator.nextVal();
}
- public ParameterizedWiseTreeElement(ParameterizedType classType, String name, WSDynamicClient client, Class<?> scope, String namespace) {
+ public ParameterizedWiseTreeElement(ParameterizedType classType, Class<?> parameterizedClass, String name, WSDynamicClient client, Class<?> scope, String namespace) {
this.kind = PARAMETERIZED;
this.id = IDGenerator.nextVal();
this.classType = classType;
@@ -57,6 +61,7 @@
this.client = client;
this.scope = scope;
this.namespace = namespace;
+ this.parameterizedClass = parameterizedClass;
}
@Override
@@ -70,6 +75,7 @@
element.setClient(this.client);
element.setScope(this.scope);
element.setNamespace(this.namespace);
+ element.setParameterizedClass(this.parameterizedClass);
Iterator<Object> keyIt = this.getChildrenKeysIterator();
while (keyIt.hasNext()) { // actually 1 child only
WiseTreeElement child = (WiseTreeElement)this.getChild(keyIt.next());
@@ -80,9 +86,24 @@
@Override
public Object toObject() throws WiseRuntimeException {
- return isLeaf() ? null : instanceXmlElementDecl(this.name, this.scope, this.namespace, ((WiseTreeElement) this.getChild(this.getChildrenKeysIterator().next())).toObject());
+ if (isLeaf()) {
+ return null;
+ }
+ Object child = ((WiseTreeElement) this.getChild(this.getChildrenKeysIterator().next())).toObject();
+ if (parameterizedClass.isAssignableFrom(JAXBElement.class)) {
+ return instanceXmlElementDecl(this.name, this.scope, this.namespace, child);
+ } else if (parameterizedClass.isAssignableFrom(Holder.class)) {
+ return instanceHolder(child);
+ } else {
+ throw new WiseRuntimeException("Unsupported parameterized class: " + parameterizedClass);
+ }
}
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ private Object instanceHolder(Object obj) {
+ return new Holder(obj);
+ }
+
private Object instanceXmlElementDecl(String name, Class<?> scope, String namespace, Object value) {
try {
Class<?> objectFactoryClass = null;
@@ -133,4 +154,12 @@
public String getNamespace() {
return namespace;
}
+
+ public Class<?> getParameterizedClass() {
+ return parameterizedClass;
+ }
+
+ public void setParameterizedClass(Class<?> parameterizedClass) {
+ this.parameterizedClass = parameterizedClass;
+ }
}
\ No newline at end of file
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-31 17:08:04 UTC (rev 477)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElementBuilder.java 2013-01-31 17:08:55 UTC (rev 478)
@@ -29,6 +29,7 @@
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementRef;
+import javax.xml.ws.Holder;
import org.jboss.logging.Logger;
import org.jboss.wise.core.client.WSDynamicClient;
@@ -99,11 +100,13 @@
}
return group;
} else {
- ParameterizedWiseTreeElement parameterized = new ParameterizedWiseTreeElement(pt, name, client, scope, namespace);
if (obj != null && obj instanceof JAXBElement) {
obj = ((JAXBElement)obj).getValue();
+ } else if (obj != null && obj instanceof Holder) {
+ obj = ((Holder)obj).value;
}
WiseTreeElement element = this.buildTreeFromType(firstTypeArg, name, obj, true, null, null, typeMap, stack);
+ ParameterizedWiseTreeElement parameterized = new ParameterizedWiseTreeElement(pt, (Class<?>)pt.getRawType(), name, client, scope, namespace);
parameterized.addChild(element.getId(), element);
return parameterized;
}
11 years, 10 months
wise SVN: r477 - in core/trunk: core/src/main/java/org/jboss/wise/core/client/impl/reflection and 3 other directories.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-01-31 12:08:04 -0500 (Thu, 31 Jan 2013)
New Revision: 477
Modified:
core/trunk/core-cxf/src/main/java/org/jboss/wise/core/client/jaxrs/impl/RSDynamicClientImpl.java
core/trunk/core/src/main/java/org/jboss/wise/core/client/WSMethod.java
core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/InvocationResultImpl.java
core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSMethodImpl.java
core/trunk/core/src/main/java/org/jboss/wise/core/exception/WiseRuntimeException.java
core/trunk/core/src/test/java/org/jboss/wise/core/client/impl/reflection/InvocationResultImplTest.java
core/trunk/core/src/test/java/org/jboss/wise/core/client/impl/reflection/WSMethodImplTest.java
Log:
[WISE-182] Adding result type in result map
Modified: core/trunk/core/src/main/java/org/jboss/wise/core/client/WSMethod.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/core/client/WSMethod.java 2013-01-30 17:33:57 UTC (rev 476)
+++ core/trunk/core/src/main/java/org/jboss/wise/core/client/WSMethod.java 2013-01-31 17:08:04 UTC (rev 477)
@@ -38,6 +38,9 @@
@ThreadSafe
public interface WSMethod {
+ public static final String RESULT = "result";
+ public static final String TYPE_PREFIX = "type.";
+
/**
* Invokes this method with the provided arguments applying provided mapper
*
Modified: core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/InvocationResultImpl.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/InvocationResultImpl.java 2013-01-30 17:33:57 UTC (rev 476)
+++ core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/InvocationResultImpl.java 2013-01-31 17:08:04 UTC (rev 477)
@@ -22,12 +22,14 @@
package org.jboss.wise.core.client.impl.reflection;
+import java.lang.reflect.Type;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import net.jcip.annotations.Immutable;
import net.jcip.annotations.ThreadSafe;
import org.jboss.wise.core.client.InvocationResult;
+import org.jboss.wise.core.client.WSMethod;
import org.jboss.wise.core.exception.MappingException;
import org.jboss.wise.core.mapper.WiseMapper;
@@ -49,7 +51,7 @@
* @param value
* @param results
*/
- public InvocationResultImpl(String name, Object value, Map<String, Object> results) {
+ public InvocationResultImpl(String name, Type resultType, Object value, Map<String, Object> results) {
this.originalObjects = new HashMap<String, Object>();
if (results == null) {
@@ -58,6 +60,9 @@
this.originalObjects.putAll(results);
if (name != null && name.trim().length() != 0) {
this.originalObjects.put(name, value);
+ if (resultType != null) {
+ this.originalObjects.put(WSMethod.TYPE_PREFIX + WSMethod.RESULT, resultType);
+ }
}
}
Modified: core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSMethodImpl.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSMethodImpl.java 2013-01-30 17:33:57 UTC (rev 476)
+++ core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSMethodImpl.java 2013-01-31 17:08:04 UTC (rev 477)
@@ -50,7 +50,7 @@
@ThreadSafe
@Immutable
public class WSMethodImpl implements WSMethod {
-
+
private final Method method;
private final WSEndpoint endpoint;
@@ -83,19 +83,19 @@
Future<Object> invocation = ((WSEndpointImpl) this.getEndpoint()).getService().submit(caller);
if (isOneWay()) {
invocation.get();
- result = new InvocationResultImpl(null, null, emptyHolder);
+ result = new InvocationResultImpl(null, null, null, emptyHolder);
} else {
+ result = new InvocationResultImpl(RESULT, method.getGenericReturnType(), invocation.get(), getHoldersResult(args));
- result = new InvocationResultImpl("result", invocation.get(), getHoldersResult(args));
-
}
} catch (Exception ite) {
System.out.print("error invoking:" + this.getMethod());
System.out.print("error invoking:" + args.values().toArray());
if (methodPointer != null && methodPointer.getExceptionTypes() != null) {
for (int i = 0; i < methodPointer.getExceptionTypes().length; i++) {
- if (ite.getCause().getClass().isAssignableFrom(methodPointer.getExceptionTypes()[i])) {
- result = new InvocationResultImpl("exception", ite.getCause(), emptyHolder);
+ Class<?> excType = methodPointer.getExceptionTypes()[i];
+ if (ite.getCause().getClass().isAssignableFrom(excType)) {
+ result = new InvocationResultImpl("exception", excType, ite.getCause(), emptyHolder);
return result;
}
}
@@ -201,6 +201,7 @@
WebParameterImpl wisePara = webParams.get(key);
if (wisePara != null && (wisePara.getMode() == WebParam.Mode.INOUT || wisePara.getMode() == WebParam.Mode.OUT)) {
holders.put(key, paras.get(key));
+ holders.put(TYPE_PREFIX + key, wisePara.getType());
}
}
return holders;
Modified: core/trunk/core/src/main/java/org/jboss/wise/core/exception/WiseRuntimeException.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/core/exception/WiseRuntimeException.java 2013-01-30 17:33:57 UTC (rev 476)
+++ core/trunk/core/src/main/java/org/jboss/wise/core/exception/WiseRuntimeException.java 2013-01-31 17:08:04 UTC (rev 477)
@@ -23,7 +23,7 @@
package org.jboss.wise.core.exception;
/**
- * This exception is for connection/authentication failure issues.
+ * Common Wise runtime exception
*
* @author alessio.soldano(a)javalinux.it
*/
Modified: core/trunk/core/src/test/java/org/jboss/wise/core/client/impl/reflection/InvocationResultImplTest.java
===================================================================
--- core/trunk/core/src/test/java/org/jboss/wise/core/client/impl/reflection/InvocationResultImplTest.java 2013-01-30 17:33:57 UTC (rev 476)
+++ core/trunk/core/src/test/java/org/jboss/wise/core/client/impl/reflection/InvocationResultImplTest.java 2013-01-31 17:08:04 UTC (rev 477)
@@ -42,21 +42,21 @@
@Test
public void shoudReturnAnOriginaObjectsEmptyMapIfNameIsNull() throws Exception {
- results = new InvocationResultImpl(null, new Long(1), null);
+ results = new InvocationResultImpl(null, Long.class, new Long(1), null);
Map<String, Object> mappedResult = results.getMapRequestAndResult(null, null);
assertThat(((Map<?,?>)mappedResult.get("results")).isEmpty(), is(true));
}
@Test
public void shoudReturnAnOriginaObjectsEmptyMapIfNameIsEmptyString() throws Exception {
- results = new InvocationResultImpl(" ", new Long(1), null);
+ results = new InvocationResultImpl(" ", Long.class, new Long(1), null);
Map<String, Object> mappedResult = results.getMapRequestAndResult(null, null);
assertThat(((Map<?,?>)mappedResult.get("results")).isEmpty(), is(true));
}
@Test
public void shouldReturnOriginalObjectIfMapperIsNull() throws Exception {
- results = new InvocationResultImpl("result", new Long(1), null);
+ results = new InvocationResultImpl("result", Long.class, new Long(1), null);
Map<String, Object> mappedResult = results.getMapRequestAndResult(null, null);
assertThat((Long)((Map<?,?>)mappedResult.get("results")).get("result"), equalTo(new Long(1)));
@@ -64,7 +64,7 @@
@Test
public void shouldApplyMapping() throws Exception {
- results = new InvocationResultImpl("result", new Long(1), null);
+ results = new InvocationResultImpl("result", Long.class, new Long(1), null);
WiseMapper mapper = mock(WiseMapper.class);
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("result", new Long(2));
@@ -76,7 +76,7 @@
@Test
public void shouldReturnInputObjectAndOriginalObjectIfMapperIsNull() throws Exception {
- results = new InvocationResultImpl("result", new Long(1), null);
+ results = new InvocationResultImpl("result", Long.class, new Long(1), null);
Map<String, Object> inputMap = new HashMap<String, Object>();
inputMap.put("origKey", "origValue");
Map<String, Object> mappedResult = results.getMapRequestAndResult(null, inputMap);
@@ -87,7 +87,7 @@
@Test
public void shouldApplyMappingAndReturnIputMap() throws Exception {
- results = new InvocationResultImpl("result", new Long(1), null);
+ results = new InvocationResultImpl("result", Long.class, new Long(1), null);
WiseMapper mapper = mock(WiseMapper.class);
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("result", new Long(2));
Modified: core/trunk/core/src/test/java/org/jboss/wise/core/client/impl/reflection/WSMethodImplTest.java
===================================================================
--- core/trunk/core/src/test/java/org/jboss/wise/core/client/impl/reflection/WSMethodImplTest.java 2013-01-30 17:33:57 UTC (rev 476)
+++ core/trunk/core/src/test/java/org/jboss/wise/core/client/impl/reflection/WSMethodImplTest.java 2013-01-31 17:08:04 UTC (rev 477)
@@ -173,6 +173,8 @@
Map<String, Object> results = wsMethod.getHoldersResult(inputMap);
assertThat(results, hasEntry("annotation2", (Object) "foo2"));
assertThat(results, hasEntry("annotation3", (Object) "foo3"));
+ assertThat(results, hasEntry("type.annotation2", (Object) String.class));
+ assertThat(results, hasEntry("type.annotation3", (Object) String.class));
}
@Test
@@ -187,9 +189,11 @@
WSMethodImpl wsMethod = new WSMethodImpl(method, endPointMock);
Map<String, Object> results = wsMethod.getHoldersResult(inputMap);
- assertThat(results.size(), is(2));
+ assertThat(results.size(), is(4));
assertThat(results, hasEntry("annotation2", (Object) "foo2"));
assertThat(results, hasEntry("annotation3", (Object) "foo3"));
+ assertThat(results, hasEntry("type.annotation2", (Object) String.class));
+ assertThat(results, hasEntry("type.annotation3", (Object) String.class));
}
@Test
@@ -204,9 +208,11 @@
WSMethodImpl wsMethod = new WSMethodImpl(method, endPointMock);
Map<String, Object> results = wsMethod.getHoldersResult(inputMap);
- assertThat(results.size(), is(2));
+ assertThat(results.size(), is(4));
assertThat(results, hasEntry("annotation2", (Object) "foo2"));
assertThat(results, hasEntry("annotation3", (Object) "foo3"));
+ assertThat(results, hasEntry("type.annotation2", (Object) String.class));
+ assertThat(results, hasEntry("type.annotation3", (Object) String.class));
}
@Test
@@ -239,11 +245,13 @@
InvocationResult invocationResults = wsMethod.invoke(inputMap);
assertThat(this.methodWorked, is(true));
Map<String, Object> results = (Map) invocationResults.getMapRequestAndResult(null, null).get("results");
- assertThat(results.size(), is(3));
+ assertThat(results.size(), is(6));
assertThat(results, hasEntry("result", (Object) "great"));
assertThat(results, hasEntry("annotation2", (Object) "foo2"));
assertThat(results, hasEntry("annotation3", (Object) "foo3"));
-
+ assertThat(results, hasEntry("type.result", (Object) String.class));
+ assertThat(results, hasEntry("type.annotation2", (Object) String.class));
+ assertThat(results, hasEntry("type.annotation3", (Object) String.class));
}
@Test
@@ -263,10 +271,14 @@
InvocationResult invocationResults = wsMethod.invoke(inputMap, mapper);
assertThat(this.methodWorked, is(true));
Map<String, Object> results = (Map) invocationResults.getMapRequestAndResult(null, null).get("results");
- assertThat(results.size(), is(3));
+ assertThat(results.size(), is(6));
assertThat(results, hasEntry("result", (Object) "great"));
assertThat(results, hasEntry("annotation2", (Object) "foo2"));
assertThat(results, hasEntry("annotation3", (Object) "foo3"));
+ assertThat(results, hasEntry("type.result", (Object) String.class));
+ assertThat(results, hasEntry("type.annotation2", (Object) String.class));
+ assertThat(results, hasEntry("type.annotation3", (Object) String.class));
+
}
}
Modified: core/trunk/core-cxf/src/main/java/org/jboss/wise/core/client/jaxrs/impl/RSDynamicClientImpl.java
===================================================================
--- core/trunk/core-cxf/src/main/java/org/jboss/wise/core/client/jaxrs/impl/RSDynamicClientImpl.java 2013-01-30 17:33:57 UTC (rev 476)
+++ core/trunk/core-cxf/src/main/java/org/jboss/wise/core/client/jaxrs/impl/RSDynamicClientImpl.java 2013-01-31 17:08:04 UTC (rev 477)
@@ -180,7 +180,7 @@
String response = get.getResponseBodyAsString();
responseHolder.put(InvocationResult.STATUS, Integer.valueOf(statusCode));
- result = new InvocationResultImpl(InvocationResult.RESPONSE, response, responseHolder);
+ result = new InvocationResultImpl(InvocationResult.RESPONSE, null, response, responseHolder);
// System.out.print(response);
} catch (IOException e) {
@@ -199,7 +199,7 @@
String response = post.getResponseBodyAsString();
responseHolder.put(InvocationResult.STATUS, Integer.valueOf(statusCode));
- result = new InvocationResultImpl(InvocationResult.RESPONSE, response, responseHolder);
+ result = new InvocationResultImpl(InvocationResult.RESPONSE, null, response, responseHolder);
// System.out.print(response);
} catch (IOException e) {
@@ -218,7 +218,7 @@
String response = put.getResponseBodyAsString();
responseHolder.put(InvocationResult.STATUS, Integer.valueOf(statusCode));
- result = new InvocationResultImpl(InvocationResult.RESPONSE, response, responseHolder);
+ result = new InvocationResultImpl(InvocationResult.RESPONSE, null, response, responseHolder);
// System.out.print(response);
} catch (IOException e) {
@@ -235,7 +235,7 @@
String response = delete.getResponseBodyAsString();
responseHolder.put(InvocationResult.STATUS, Integer.valueOf(statusCode));
- result = new InvocationResultImpl(InvocationResult.RESPONSE, response, responseHolder);
+ result = new InvocationResultImpl(InvocationResult.RESPONSE, null, response, responseHolder);
// System.out.print(response);
} catch (IOException e) {
11 years, 10 months
wise SVN: r476 - 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-30 12:33:57 -0500 (Wed, 30 Jan 2013)
New Revision: 476
Added:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/ByteArrayWiseTreeElement.java
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/WiseTreeElementBuilder.java
webgui/branches/cdi-jsf/src/main/webapp/index.xhtml
Log:
Adding byte array element for xsd base64binary
Added: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/ByteArrayWiseTreeElement.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/ByteArrayWiseTreeElement.java (rev 0)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/ByteArrayWiseTreeElement.java 2013-01-30 17:33:57 UTC (rev 476)
@@ -0,0 +1,74 @@
+/*
+ * 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 javax.xml.bind.DatatypeConverter;
+
+/**
+ * A simple tree element to handle byte[]
+ *
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public class ByteArrayWiseTreeElement extends SimpleWiseTreeElement {
+
+ private static final long serialVersionUID = 1L;
+
+ public ByteArrayWiseTreeElement() {
+ this.kind = BYTE_ARRAY;
+ }
+
+ public ByteArrayWiseTreeElement(Class<?> classType, String name, String value) {
+ this.kind = BYTE_ARRAY;
+ this.classType = classType;
+ this.nil = value == null;
+ this.name = name;
+ this.value = value;
+ }
+
+ @Override
+ public WiseTreeElement clone() {
+ ByteArrayWiseTreeElement element = new ByteArrayWiseTreeElement();
+ 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;
+ }
+
+ @Override
+ public void parseObject(Object obj) {
+ if (obj != null) {
+ this.setValue(DatatypeConverter.printBase64Binary((byte[])obj));
+ } else {
+ this.setValue(null);
+ }
+ this.nil = (obj == null && nillable);
+ }
+
+ @Override
+ public Object toObject() {
+ if (isNil()) return null;
+ byte[] result = null;
+ if (value != null) {
+ return DatatypeConverter.parseBase64Binary(value);
+ }
+ return result;
+ }
+}
\ No newline at end of file
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-30 16:31:33 UTC (rev 475)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElement.java 2013-01-30 17:33:57 UTC (rev 476)
@@ -34,6 +34,7 @@
private static final long serialVersionUID = 5298756163814063425L;
public static final String SIMPLE = "simple";
+ public static final String BYTE_ARRAY = "byteArray";
public static final String COMPLEX = "complex";
public static final String DURATION = "Duration";
public static final String EMPTY = "empty";
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-30 16:31:33 UTC (rev 475)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElementBuilder.java 2013-01-30 17:33:57 UTC (rev 476)
@@ -117,6 +117,13 @@
Set<Type> stack) {
if (cl.isArray()) {
+ if (byte.class.equals(cl.getComponentType())) {
+ ByteArrayWiseTreeElement element = new ByteArrayWiseTreeElement(cl, name, null);
+ if (obj != null) {
+ element.parseObject(obj);
+ }
+ return element;
+ }
Logger.getLogger(this.getClass()).debug("* array");
Logger.getLogger(this.getClass()).debug("Component type: " + cl.getComponentType());
throw new WiseRuntimeException("Converter doesn't support this Object[] yet.");
Modified: webgui/branches/cdi-jsf/src/main/webapp/index.xhtml
===================================================================
--- webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-01-30 16:31:33 UTC (rev 475)
+++ webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-01-30 17:33:57 UTC (rev 476)
@@ -157,6 +157,18 @@
Remove
</a4j:commandLink>
</rich:treeNode>
+ <rich:treeNode type="byteArray">
+ <h:outputText value="#{node.type} : #{node.name} " />
+ <h:selectBooleanCheckbox id="foo6-chk" value="#{node.notNil}" disabled="#{node.notNillable}" >
+ <f:ajax />
+ </h:selectBooleanCheckbox>
+ <h:inputText value="#{node.value}" id="foo6" >
+ <f:ajax event="valueChange" render="foo6-chk" listener="#{clientConversationBean.onInputFocus(node)}" />
+ </h:inputText>
+ <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" rerender="opSelectionPanel"
action="#{clientConversationBean.performInvocation}" status="perfInvStatus" />
@@ -213,6 +225,11 @@
<rich:treeNode type="complex">
<h:outputText value="#{node.type} : #{node.name}" />
</rich:treeNode>
+ <rich:treeNode type="byteArray">
+ <h:outputText value="#{node.type} : #{node.name} = #{node.value}"
+ rendered="#{node.notNil}" />
+ <h:outputText value="#{node.type} : #{node.name} = ***NIL***" rendered="#{node.nil}" />
+ </rich:treeNode>
<rich:treeNode type="empty">
<h:outputText value="#{node.name} = ***NIL***" />
</rich:treeNode>
11 years, 10 months
wise SVN: r475 - 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-30 11:31:33 -0500 (Wed, 30 Jan 2013)
New Revision: 475
Added:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/EmptyWiseTreeElement.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/DurationWiseTreeElement.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:
Few fixes on duration, xml gregorian calendar elements and handling of null results from core
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-29 17:26:12 UTC (rev 474)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java 2013-01-30 16:31:33 UTC (rev 475)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source
- * Copyright 2012, Red Hat, Inc. and/or its affiliates, and individual
+ * 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.
*
@@ -18,7 +18,6 @@
import java.io.Serializable;
import java.lang.reflect.Type;
-import java.net.ConnectException;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
@@ -45,6 +44,7 @@
import org.jboss.wise.core.client.factories.WSDynamicClientFactory;
import org.jboss.wise.core.exception.InvocationException;
import org.jboss.wise.core.exception.WiseRuntimeException;
+import org.jboss.wise.gui.treeElement.EmptyWiseTreeElement;
import org.jboss.wise.gui.treeElement.GroupWiseTreeElement;
import org.jboss.wise.gui.treeElement.LazyLoadWiseTreeElement;
import org.jboss.wise.gui.treeElement.WiseTreeElement;
@@ -171,7 +171,7 @@
}
}
- public void onInputTextFocus(WiseTreeElement el) {
+ public void onInputFocus(WiseTreeElement el) {
el.setNotNil(true);
}
@@ -197,7 +197,12 @@
TreeNodeImpl rootElement = new TreeNodeImpl();
for (Entry<String, Object> res : result.getResult().entrySet()) {
Object resObj = res.getValue();
- WiseTreeElement wte = builder.buildTreeFromType(resObj.getClass(), res.getKey(), resObj, true);
+ WiseTreeElement wte;
+ if (resObj != null) {
+ wte = builder.buildTreeFromType(resObj.getClass(), res.getKey(), resObj, true);
+ } else {
+ wte = new EmptyWiseTreeElement("result");
+ }
rootElement.addChild(wte.getId(), wte);
}
return rootElement;
Modified: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/DurationWiseTreeElement.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/DurationWiseTreeElement.java 2013-01-29 17:26:12 UTC (rev 474)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/DurationWiseTreeElement.java 2013-01-30 16:31:33 UTC (rev 475)
@@ -58,11 +58,8 @@
@Override
public void parseObject(Object obj) {
- if (obj != null) {
- this.setValue(((Duration) obj).toString());
- } else {
- this.setValue(null);
- }
+ this.setValue(obj != null ? ((Duration) obj).toString() : null);
+ this.nil = (obj == null && nillable);
}
@Override
Added: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/EmptyWiseTreeElement.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/EmptyWiseTreeElement.java (rev 0)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/EmptyWiseTreeElement.java 2013-01-30 16:31:33 UTC (rev 475)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2012, 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 org.jboss.wise.core.utils.IDGenerator;
+
+/**
+ * @author Alessio Soldano, alessio.soldano(a)jboss.com
+ *
+ */
+public class EmptyWiseTreeElement extends WiseTreeElement {
+
+ private static final long serialVersionUID = 1L;
+
+ public EmptyWiseTreeElement() {
+ super(true);
+ this.kind = EMPTY;
+ this.id = IDGenerator.nextVal();
+ }
+
+ public EmptyWiseTreeElement(String name) {
+ super(true);
+ this.kind = EMPTY;
+ this.id = IDGenerator.nextVal();
+ this.name = name;
+ }
+
+ /**
+ * Returns the String value of the instance corresponding to this element.
+ *
+ * @return The value
+ */
+ public String getValue() {
+ return null;
+ }
+
+ public WiseTreeElement clone() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Gets the value for this element parsing a given object instance. This is
+ * to be used to set the element value after the service invocation.
+ *
+ * @param obj
+ */
+ public void parseObject(Object obj) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object toObject() {
+ return null;
+ }
+}
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-29 17:26:12 UTC (rev 474)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElement.java 2013-01-30 16:31:33 UTC (rev 475)
@@ -36,6 +36,7 @@
public static final String SIMPLE = "simple";
public static final String COMPLEX = "complex";
public static final String DURATION = "Duration";
+ public static final String EMPTY = "empty";
public static final String ENUMERATION = "Enumeration";
public static final String GROUP = "group";
public static final String LAZY = "lazy";
Modified: webgui/branches/cdi-jsf/src/main/webapp/index.xhtml
===================================================================
--- webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-01-29 17:26:12 UTC (rev 474)
+++ webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-01-30 16:31:33 UTC (rev 475)
@@ -61,7 +61,7 @@
<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)}" />
+ <f:ajax event="valueChange" render="foo-chk" listener="#{clientConversationBean.onInputFocus(node)}" />
</h:inputText>
<h:selectOneMenu value="#{node.value}" rendered="#{node.type=='boolean' or node.type=='Boolean'}">
<f:selectItem itemValue="true" itemLabel="true" />
@@ -77,11 +77,9 @@
<h:outputText value=" " />
<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="#{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="lazy">
@@ -110,9 +108,9 @@
<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" />
+ <rich:calendar id="foo2" value="#{node.valueDate}" popup="true" showInput="true" enableManualInput="false" >
+ <f:ajax event="change" render="foo2-chk" listener="#{clientConversationBean.onInputFocus(node)}" />
+ </rich:calendar>
<a4j:commandLink action="#{clientConversationBean.removeChild(node)}" rerender="richTree" rendered="#{node.removable}">
Remove
</a4j:commandLink>
@@ -122,7 +120,9 @@
<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:inputText id="foo3" value="#{node.value}">
+ <f:ajax event="valueChange" render="foo3-chk" listener="#{clientConversationBean.onInputFocus(node)}" />
+ </h:inputText>
<h:outputText value="(MilliSeconds)" target="_blank" />
<h:outputText value=" " />
<a4j:commandLink action="#{clientConversationBean.removeChild(node)}" rerender="richTree" rendered="#{node.removable}">
@@ -134,9 +134,10 @@
<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: " />
+ <h:inputText id="foo4" value="#{node.nameSpace}">
+ <f:ajax event="valueChange" render="foo4-chk" listener="#{clientConversationBean.onInputFocus(node)}" />
+ </h:inputText>
+ <h:outputText value=" : " />
<h:inputText value="#{node.localPart}" />
<h:outputText value=" " />
<a4j:commandLink action="#{clientConversationBean.removeChild(node)}" rerender="richTree" rendered="#{node.removable}">
@@ -212,6 +213,9 @@
<rich:treeNode type="complex">
<h:outputText value="#{node.type} : #{node.name}" />
</rich:treeNode>
+ <rich:treeNode type="empty">
+ <h:outputText value="#{node.name} = ***NIL***" />
+ </rich:treeNode>
</rich:tree>
</h:form>
</rich:panel>
11 years, 10 months
wise SVN: r474 - 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-29 12:26:12 -0500 (Tue, 29 Jan 2013)
New Revision: 474
Modified:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java
webgui/branches/cdi-jsf/src/main/webapp/index.xhtml
Log:
Initial error message handling
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-29 16:04:52 UTC (rev 473)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java 2013-01-29 17:26:12 UTC (rev 474)
@@ -43,6 +43,8 @@
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.core.exception.InvocationException;
+import org.jboss.wise.core.exception.WiseRuntimeException;
import org.jboss.wise.gui.treeElement.GroupWiseTreeElement;
import org.jboss.wise.gui.treeElement.LazyLoadWiseTreeElement;
import org.jboss.wise.gui.treeElement.WiseTreeElement;
@@ -68,6 +70,7 @@
private String currentOperation;
private TreeNodeImpl inputTree;
private TreeNodeImpl outputTree;
+ private String error;
private UITree inTree;
@PostConstruct
@@ -77,24 +80,37 @@
conversation.setTimeout(CONVERSATION_TIMEOUT);
}
- public void readWsdl() throws ConnectException {
+ public void readWsdl() {
cleanup();
//restart conversation
conversation.end();
conversation.begin();
- client = getClientBuilder().verbose(true).keepSource(true).wsdlURL(getWsdlUrl()).maxThreadPoolSize(1).build();
- cleanupTask.addRef(client, System.currentTimeMillis() + CONVERSATION_TIMEOUT, new CleanupTask.CleanupCallback<WSDynamicClient>() {
- @Override
- public void cleanup(WSDynamicClient data) {
- data.close();
+ try {
+ client = getClientBuilder().verbose(true).keepSource(true).wsdlURL(getWsdlUrl()).maxThreadPoolSize(1).build();
+ cleanupTask.addRef(client, System.currentTimeMillis() + CONVERSATION_TIMEOUT, new CleanupTask.CleanupCallback<WSDynamicClient>() {
+ @Override
+ public void cleanup(WSDynamicClient data) {
+ data.close();
+ }
+ });
+ } catch (Exception e) {
+ error = "Could not read WSDL from specified URL. Please check logs for further information.";
+ logException(e);
+ }
+ if (client != null) {
+ try {
+ services = convertServicesToGui(client.processServices());
+ } catch (Exception e) {
+ error = "Could not parse WSDL from specified URL. Please check logs for further information.";
+ logException(e);
}
- });
-
- services = convertServicesToGui(client.processServices());
+ }
}
public void parseOperationParameters() {
if (currentOperation == null) return;
+ outputTree = null;
+ error = null;
StringTokenizer st = new StringTokenizer(currentOperation, ";");
String serviceName = st.nextToken();
String portName = st.nextToken();
@@ -102,12 +118,14 @@
try {
inputTree = convertOperationParametersToGui(client.getWSMethod(serviceName, portName, operationName), client);
} catch (Exception e) {
- throw new RuntimeException(e);
+ error = toErrorMessage(e);
+ logException(e);
}
- outputTree = null;
}
public void performInvocation() {
+ outputTree = null;
+ error = null;
StringTokenizer st = new StringTokenizer(currentOperation, ";");
String serviceName = st.nextToken();
String portName = st.nextToken();
@@ -119,9 +137,20 @@
WiseTreeElement wte = (WiseTreeElement)inputTree.getChild(it.next());
params.put(wte.getName(), wte.isNil() ? null : wte.toObject());
}
- outputTree = convertOperationResultToGui(wsMethod.invoke(params), client);
+ InvocationResult result = null;
+ try {
+ result = wsMethod.invoke(params);
+ } catch (InvocationException e) {
+ logException(e);
+ error = "Unexpected fault / error received from target endpoint";
+ }
+ if (result != null) {
+ outputTree = convertOperationResultToGui(result, client);
+ error = null;
+ }
} catch (Exception e) {
- throw new RuntimeException(e);
+ error = toErrorMessage(e);
+ logException(e);
}
}
@@ -137,7 +166,8 @@
try {
el.resolveReference();
} catch (Exception e) {
- throw new RuntimeException(e);
+ error = toErrorMessage(e);
+ logException(e);
}
}
@@ -231,6 +261,7 @@
inTree.clearInitialState();
}
inputTree = null;
+ error = null;
}
public String getWsdlUrl() {
@@ -280,11 +311,38 @@
public void setOutputTree(TreeNodeImpl outputTree) {
this.outputTree = outputTree;
}
+
+ public String getError() {
+ return error;
+ }
+ public void setError(String error) {
+ this.error = error;
+ }
+
private static synchronized WSDynamicClientBuilder getClientBuilder() {
if (clientBuilder == null) {
clientBuilder = WSDynamicClientFactory.getJAXWSClientBuilder();
}
return clientBuilder;
}
+
+ private static String toErrorMessage(Exception e) {
+ StringBuilder sb = new StringBuilder();
+ if (e instanceof WiseRuntimeException) {
+ sb.append(e.getMessage());
+ } else {
+ sb.append(e.toString());
+ }
+ if (e.getCause() != null) {
+ sb.append(", caused by ");
+ sb.append(e.getCause());
+ }
+ sb.append(". Please check logs for further information.");
+ return sb.toString();
+ }
+
+ private static void logException(Exception e) {
+ e.printStackTrace(); //TODO!!
+ }
}
Modified: webgui/branches/cdi-jsf/src/main/webapp/index.xhtml
===================================================================
--- webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-01-29 16:04:52 UTC (rev 473)
+++ webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-01-29 17:26:12 UTC (rev 474)
@@ -215,6 +215,9 @@
</rich:tree>
</h:form>
</rich:panel>
+ <rich:panel header="Error" rendered="#{not empty clientConversationBean.error}">
+ <h:outputText value="#{clientConversationBean.error}" />
+ </rich:panel>
</a4j:outputPanel>
</a4j:outputPanel>
11 years, 10 months
wise SVN: r473 - webgui/branches/cdi-jsf/src/main/webapp.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-01-29 11:04:52 -0500 (Tue, 29 Jan 2013)
New Revision: 473
Modified:
webgui/branches/cdi-jsf/src/main/webapp/index.xhtml
Log:
Adding modal panels for wait messages
Modified: webgui/branches/cdi-jsf/src/main/webapp/index.xhtml
===================================================================
--- webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-01-29 07:52:36 UTC (rev 472)
+++ webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-01-29 16:04:52 UTC (rev 473)
@@ -23,7 +23,7 @@
<h:form id="wsdlSelection">
<h:outputLabel value="URL:" for="wsdlUrlInput"/>
<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" />
+ <a4j:commandButton id="okButton" value="OK" render="epSelection" action="#{clientConversationBean.readWsdl}" onclick="this.disabled=true" status="wsdlParseStatus" />
</h:form>
</rich:panel>
<br />
@@ -157,7 +157,8 @@
</a4j:commandLink>
</rich:treeNode>
</rich:tree>
- <a4j:commandButton value="Perform invocation" render="opSelectionPanel" rerender="opSelectionPanel" action="#{clientConversationBean.performInvocation}" />
+ <a4j:commandButton value="Perform invocation" render="opSelectionPanel" rerender="opSelectionPanel"
+ action="#{clientConversationBean.performInvocation}" status="perfInvStatus" />
</h:form>
</rich:panel>
@@ -222,6 +223,14 @@
+ <rich:popupPanel id="mpPerfInv" style="text-align:center" autosized="true" modal="true">
+ <h:outputText value="Invoking target endpoint and parsing results, please wait..." />
+ </rich:popupPanel>
+ <rich:popupPanel id="mpParseWsdl" style="text-align:center" autosized="true" modal="true">
+ <h:outputText value="Fetching and parsing wsdl, please wait..." />
+ </rich:popupPanel>
+ <a4j:status name="perfInvStatus" onstart="#{rich:component('mpPerfInv')}.show()" onstop="#{rich:component('mpPerfInv')}.hide()" />
+ <a4j:status name="wsdlParseStatus" onstart="#{rich:component('mpParseWsdl')}.show()" onstop="#{rich:component('mpParseWsdl')}.hide()" />
</fieldset>
11 years, 10 months
wise SVN: r472 - 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-29 02:52:36 -0500 (Tue, 29 Jan 2013)
New Revision: 472
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/DurationWiseTreeElement.java
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/EnumerationWiseTreeElement.java
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/QNameWiseTreeElement.java
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/SimpleWiseTreeElementFactory.java
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/XMLGregorianWiseTreeElement.java
Log:
More on nill / notNillable + make sure RPC/Lit main parameters are not nillable
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-29 06:15:22 UTC (rev 471)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java 2013-01-29 07:52:36 UTC (rev 472)
@@ -33,6 +33,7 @@
import javax.enterprise.context.ConversationScoped;
import javax.inject.Inject;
import javax.inject.Named;
+import javax.jws.soap.SOAPBinding;
import org.jboss.wise.core.client.InvocationResult;
import org.jboss.wise.core.client.WSDynamicClient;
@@ -148,8 +149,14 @@
WiseTreeElementBuilder builder = new WiseTreeElementBuilder(client);
TreeNodeImpl rootElement = new TreeNodeImpl();
Collection<? extends WebParameter> parameters = wsMethod.getWebParams().values();
+ SOAPBinding soapBindingAnn = wsMethod.getEndpoint().getUnderlyingObjectClass().getAnnotation(SOAPBinding.class);
+ boolean rpcLit = false;
+ if (soapBindingAnn != null) {
+ SOAPBinding.Style style = soapBindingAnn.style();
+ rpcLit = style != null && SOAPBinding.Style.RPC.equals(style);
+ }
for (WebParameter parameter : parameters) {
- WiseTreeElement wte = builder.buildTreeFromType(parameter.getType(), parameter.getName());
+ WiseTreeElement wte = builder.buildTreeFromType(parameter.getType(), parameter.getName(), !rpcLit);
rootElement.addChild(wte.getId(), wte);
}
return rootElement;
@@ -160,7 +167,7 @@
TreeNodeImpl rootElement = new TreeNodeImpl();
for (Entry<String, Object> res : result.getResult().entrySet()) {
Object resObj = res.getValue();
- WiseTreeElement wte = builder.buildTreeFromType(resObj.getClass(), res.getKey(), resObj);
+ WiseTreeElement wte = builder.buildTreeFromType(resObj.getClass(), res.getKey(), resObj, true);
rootElement.addChild(wte.getId(), wte);
}
return rootElement;
Modified: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/DurationWiseTreeElement.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/DurationWiseTreeElement.java 2013-01-29 06:15:22 UTC (rev 471)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/DurationWiseTreeElement.java 2013-01-29 07:52:36 UTC (rev 472)
@@ -64,6 +64,13 @@
this.setValue(null);
}
}
+
+ @Override
+ public void enforceNotNillable() {
+ this.nillable = false;
+ this.nil = false;
+ this.value = "0";
+ }
@Override
public Object toObject() {
Modified: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/EnumerationWiseTreeElement.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/EnumerationWiseTreeElement.java 2013-01-29 06:15:22 UTC (rev 471)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/EnumerationWiseTreeElement.java 2013-01-29 07:52:36 UTC (rev 472)
@@ -54,6 +54,13 @@
element.setNillable(this.isNillable());
return element;
}
+
+ @Override
+ public void enforceNotNillable() {
+ this.nillable = false;
+ this.nil = false;
+ this.value = getValidValue().keySet().iterator().next();
+ }
@Override
public void parseObject(Object obj) {
Modified: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/QNameWiseTreeElement.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/QNameWiseTreeElement.java 2013-01-29 06:15:22 UTC (rev 471)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/QNameWiseTreeElement.java 2013-01-29 07:52:36 UTC (rev 472)
@@ -76,6 +76,13 @@
public void setLocalPart(String localPart) {
this.localPart = localPart;
}
+
+ @Override
+ public void enforceNotNillable() {
+ this.nillable = false;
+ this.nil = false;
+ this.value = "";
+ }
@Override
public void parseObject(Object obj) {
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-29 06:15:22 UTC (rev 471)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/SimpleWiseTreeElement.java 2013-01-29 07:52:36 UTC (rev 472)
@@ -53,9 +53,7 @@
this.id = IDGenerator.nextVal();
this.classType = classType;
this.name = name;
- this.value = value;
- this.nillable = !classType.isPrimitive(); // primitive are not nillable
- this.nil = (value == null && nillable); // thus they can't be nil
+ init(classType, value);
}
/**
@@ -112,6 +110,7 @@
element.setClassType(this.classType);
element.setRemovable(this.isRemovable());
element.setNillable(this.isNillable());
+ element.init((Class<?>)this.classType, null);
return element;
}
@@ -125,6 +124,56 @@
this.setValue(obj == null ? null : obj.toString());
this.nil = (obj == null && nillable);
}
+
+ /**
+ * Make sure this element can't be nill and set the default value
+ * (this is to be used e.g. for main RPC/Lit parameters)
+ */
+ public void enforceNotNillable() {
+ this.nillable = false;
+ this.nil = false;
+ this.value = getDefaultValue((Class<?>) classType);
+ }
+
+ private void init(Class<?> classType, String value) {
+ // primitive are not nillable, thus they can't be nil or have a null value
+ this.value = (value == null && classType.isPrimitive()) ? getDefaultValue(classType) : value;
+ this.nillable = !classType.isPrimitive();
+ this.nil = (value == null && nillable);
+ }
+
+ private static String getDefaultValue(Class<?> cl) {
+ if (cl.isPrimitive()) {
+ cl = JavaUtils.getWrapperType(cl);
+ }
+ if ("java.lang.String".equalsIgnoreCase(cl.getName())) {
+ return "";
+ } else if ("java.lang.Boolean".equalsIgnoreCase(cl.getName())) {
+ return "false";
+ } else if ("java.lang.Byte".equalsIgnoreCase(cl.getName())) {
+ return "0";
+ } else if ("java.lang.Character".equalsIgnoreCase(cl.getName())) {
+ return "";
+ } else if ("java.lang.Double".equalsIgnoreCase(cl.getName())) {
+ return "0.0";
+ } else if ("java.lang.Float".equalsIgnoreCase(cl.getName())) {
+ return "0.0";
+ } else if ("java.lang.Integer".equalsIgnoreCase(cl.getName())) {
+ return "0";
+ } else if ("java.lang.Long".equalsIgnoreCase(cl.getName())) {
+ return "0";
+ } else if ("java.lang.Short".equalsIgnoreCase(cl.getName())) {
+ return "0";
+ } else if ("java.math.BigDecimal".equalsIgnoreCase(cl.getName())) {
+ return "0.0";
+ } else if ("java.math.BigInteger".equalsIgnoreCase(cl.getName())) {
+ return "0";
+ } else if ("java.lang.Object".equalsIgnoreCase(cl.getName())) {
+ return "";
+ } else {
+ throw new WiseRuntimeException("Class type not supported: " + cl);
+ }
+ }
public Object toObject() {
if (value == null) {
Modified: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/SimpleWiseTreeElementFactory.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/SimpleWiseTreeElementFactory.java 2013-01-29 06:15:22 UTC (rev 471)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/SimpleWiseTreeElementFactory.java 2013-01-29 07:52:36 UTC (rev 472)
@@ -25,19 +25,22 @@
*/
public class SimpleWiseTreeElementFactory {
- public static SimpleWiseTreeElement create(Class<?> classType, String name) {
+ public static SimpleWiseTreeElement create(Class<?> classType, String name, Object obj) {
+ SimpleWiseTreeElement element;
if (classType.isEnum()) {
- return new EnumerationWiseTreeElement(classType, name, null);
+ element = new EnumerationWiseTreeElement(classType, name, null);
} else if (QName.class.isAssignableFrom(classType)) {
- return new QNameWiseTreeElement(classType, name, null, null);
+ element = new QNameWiseTreeElement(classType, name, null, null);
} else if (XMLGregorianCalendar.class.isAssignableFrom(classType)) {
- return new XMLGregorianWiseTreeElement(classType, name, null);
+ element = new XMLGregorianWiseTreeElement(classType, name, null);
} else if (Duration.class.isAssignableFrom(classType)) {
- return new DurationWiseTreeElement(classType, name, null);
+ element = new DurationWiseTreeElement(classType, name, null);
} else {
- return new SimpleWiseTreeElement(classType, name, null);
+ element = new SimpleWiseTreeElement(classType, name, null);
}
-
+ if (obj != null) {
+ element.parseObject(obj);
+ }
+ return element;
}
-
}
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-29 06:15:22 UTC (rev 471)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElementBuilder.java 2013-01-29 07:52:36 UTC (rev 472)
@@ -51,17 +51,18 @@
this.client = client;
}
- 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, boolean nillable) {
+ return buildTreeFromType(type, name, null, nillable, 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>());
+ public WiseTreeElement buildTreeFromType(Type type, String name, Object obj, boolean nillable) {
+ return buildTreeFromType(type, name, obj, nillable, null, null, new HashMap<Type, WiseTreeElement>(), new HashSet<Type>());
}
private WiseTreeElement buildTreeFromType(Type type,
String name,
Object obj,
+ boolean nillable,
Class<?> scope,
String namespace,
Map<Type, WiseTreeElement> typeMap,
@@ -74,7 +75,7 @@
} else {
Logger.getLogger(this.getClass()).debug("Not a parameterized type... casting to Class");
- return this.buildFromClass((Class<?>) type, name, obj, typeMap, stack);
+ return this.buildFromClass((Class<?>) type, name, obj, nillable, typeMap, stack);
}
}
@@ -89,11 +90,11 @@
Set<Type> stack) {
Type firstTypeArg = pt.getActualTypeArguments()[0];
if (Collection.class.isAssignableFrom((Class<?>) pt.getRawType())) {
- WiseTreeElement prototype = this.buildTreeFromType(firstTypeArg, name, null, null, null, typeMap, stack);
+ WiseTreeElement prototype = this.buildTreeFromType(firstTypeArg, name, null, true, 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(firstTypeArg, name, o, null, null, typeMap, stack));
+ group.addChild(IDGenerator.nextVal(), this.buildTreeFromType(firstTypeArg, name, o, true, null, null, typeMap, stack));
}
}
return group;
@@ -102,7 +103,7 @@
if (obj != null && obj instanceof JAXBElement) {
obj = ((JAXBElement)obj).getValue();
}
- WiseTreeElement element = this.buildTreeFromType(firstTypeArg, name, obj, null, null, typeMap, stack);
+ WiseTreeElement element = this.buildTreeFromType(firstTypeArg, name, obj, true, null, null, typeMap, stack);
parameterized.addChild(element.getId(), element);
return parameterized;
}
@@ -111,6 +112,7 @@
private WiseTreeElement buildFromClass(Class<?> cl,
String name,
Object obj,
+ boolean nillable,
Map<Type, WiseTreeElement> typeMap,
Set<Type> stack) {
@@ -122,8 +124,10 @@
if (isSimpleType(cl, client)) {
Logger.getLogger(this.getClass()).debug("* simple");
- SimpleWiseTreeElement element = SimpleWiseTreeElementFactory.create(cl, name);
- element.parseObject(obj);
+ SimpleWiseTreeElement element = SimpleWiseTreeElementFactory.create(cl, name, obj);
+ if (!nillable) {
+ element.enforceNotNillable();
+ }
return element;
} else { // complex
if (stack.contains(cl)) {
@@ -160,11 +164,14 @@
throw new WiseRuntimeException("Error calling getter method for field " + field, e);
}
}
- WiseTreeElement element = this.buildTreeFromType(field.getGenericType(), fieldName, fieldValue, cl, namespace, typeMap, stack);
+ WiseTreeElement element = this.buildTreeFromType(field.getGenericType(), fieldName, fieldValue, true, cl, namespace, typeMap, stack);
complex.addChild(element.getId(), element);
}
stack.remove(cl);
typeMap.put(cl, complex.clone());
+ if (!nillable) {
+ complex.setNillable(false);
+ }
return complex;
}
}
Modified: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/XMLGregorianWiseTreeElement.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/XMLGregorianWiseTreeElement.java 2013-01-29 06:15:22 UTC (rev 471)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/XMLGregorianWiseTreeElement.java 2013-01-29 07:52:36 UTC (rev 472)
@@ -72,6 +72,13 @@
}
this.nil = obj == null;
}
+
+ @Override
+ public void enforceNotNillable() {
+ this.nillable = false;
+ this.nil = false;
+ this.value = new Date().toString();
+ }
@Override
public Object toObject() {
11 years, 10 months
wise SVN: r471 - 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-29 01:15:22 -0500 (Tue, 29 Jan 2013)
New Revision: 471
Modified:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/ComplexWiseTreeElement.java
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/DurationWiseTreeElement.java
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/GroupWiseTreeElement.java
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/QNameWiseTreeElement.java
Log:
Better handling of nulls
Modified: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/ComplexWiseTreeElement.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/ComplexWiseTreeElement.java 2013-01-29 05:49:56 UTC (rev 470)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/ComplexWiseTreeElement.java 2013-01-29 06:15:22 UTC (rev 471)
@@ -72,6 +72,7 @@
@SuppressWarnings("unchecked")
public Object toObject() {
+ if (isNil()) return null;
Object obj = null;
try {
Class<?> cl = (Class<?>) classType;
Modified: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/DurationWiseTreeElement.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/DurationWiseTreeElement.java 2013-01-29 05:49:56 UTC (rev 470)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/DurationWiseTreeElement.java 2013-01-29 06:15:22 UTC (rev 471)
@@ -67,6 +67,7 @@
@Override
public Object toObject() {
+ if (isNil()) return null;
Object result = null;
try {
result = DatatypeFactory.newInstance().newDuration(Long.parseLong(value));
Modified: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/GroupWiseTreeElement.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/GroupWiseTreeElement.java 2013-01-29 05:49:56 UTC (rev 470)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/GroupWiseTreeElement.java 2013-01-29 06:15:22 UTC (rev 471)
@@ -86,6 +86,7 @@
}
public Object toObject() {
+ if (isNil()) return null;
LinkedList<Object> returnList = new LinkedList<Object>();
Iterator<Object> keyIt = this.getChildrenKeysIterator();
while (keyIt.hasNext()) {
Modified: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/QNameWiseTreeElement.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/QNameWiseTreeElement.java 2013-01-29 05:49:56 UTC (rev 470)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/QNameWiseTreeElement.java 2013-01-29 06:15:22 UTC (rev 471)
@@ -90,6 +90,6 @@
@Override
public Object toObject() {
- return new QName(nameSpace, localPart);
+ return isNil() ? null : new QName(nameSpace, localPart);
}
}
11 years, 10 months
wise SVN: r470 - webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-01-29 00:49:56 -0500 (Tue, 29 Jan 2013)
New Revision: 470
Modified:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java
Log:
Allow sending "null" parameters
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-29 05:49:14 UTC (rev 469)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java 2013-01-29 05:49:56 UTC (rev 470)
@@ -116,7 +116,7 @@
Map<String, Object> params = new HashMap<String, Object>();
for (Iterator<Object> it = inputTree.getChildrenKeysIterator(); it.hasNext(); ) {
WiseTreeElement wte = (WiseTreeElement)inputTree.getChild(it.next());
- params.put(wte.getName(), wte.toObject());
+ params.put(wte.getName(), wte.isNil() ? null : wte.toObject());
}
outputTree = convertOperationResultToGui(wsMethod.invoke(params), client);
} catch (Exception e) {
11 years, 10 months
wise SVN: r469 - 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-29 00:49:14 -0500 (Tue, 29 Jan 2013)
New Revision: 469
Modified:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElementBuilder.java
Log:
Clone reference elements for lazy loading before storing them into the map to avoid them being modified before lazy load element resolution
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-28 23:50:17 UTC (rev 468)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElementBuilder.java 2013-01-29 05:49:14 UTC (rev 469)
@@ -164,7 +164,7 @@
complex.addChild(element.getId(), element);
}
stack.remove(cl);
- typeMap.put(cl, complex);
+ typeMap.put(cl, complex.clone());
return complex;
}
}
11 years, 10 months