[overlord-commits] Overlord SVN: r697 - in bpm-console/trunk: common and 189 other directories.
overlord-commits at lists.jboss.org
overlord-commits at lists.jboss.org
Thu Jul 30 05:20:37 EDT 2009
Author: heiko.braun at jboss.com
Date: 2009-07-30 05:20:27 -0400 (Thu, 30 Jul 2009)
New Revision: 697
Added:
bpm-console/trunk/License.html
bpm-console/trunk/README.txt
bpm-console/trunk/common/
bpm-console/trunk/common/common.iml
bpm-console/trunk/common/pom.xml
bpm-console/trunk/common/src/
bpm-console/trunk/common/src/main/
bpm-console/trunk/common/src/main/java/
bpm-console/trunk/common/src/main/java/org/
bpm-console/trunk/common/src/main/java/org/jboss/
bpm-console/trunk/common/src/main/java/org/jboss/bpm/
bpm-console/trunk/common/src/main/java/org/jboss/bpm/console/
bpm-console/trunk/common/src/main/java/org/jboss/bpm/console/server/
bpm-console/trunk/common/src/main/java/org/jboss/bpm/console/server/gson/
bpm-console/trunk/common/src/main/java/org/jboss/bpm/console/server/gson/GsonFactory.java
bpm-console/trunk/common/src/main/java/org/jboss/bpm/console/server/gson/SQLDateTypeAdapter.java
bpm-console/trunk/common/src/main/java/org/jboss/bpm/console/server/util/
bpm-console/trunk/common/src/main/java/org/jboss/bpm/console/server/util/RsComment.java
bpm-console/trunk/common/src/main/java/org/jboss/bpm/console/server/util/RsDocBuilder.java
bpm-console/trunk/doc/
bpm-console/trunk/doc/Reference.odt
bpm-console/trunk/doc/Reference.pdf
bpm-console/trunk/gui/
bpm-console/trunk/gui/pom.xml
bpm-console/trunk/gui/profiles/
bpm-console/trunk/gui/profiles/drools/
bpm-console/trunk/gui/profiles/drools/pom.xml
bpm-console/trunk/gui/profiles/drools/src/
bpm-console/trunk/gui/profiles/drools/src/main/
bpm-console/trunk/gui/profiles/drools/src/main/java/
bpm-console/trunk/gui/profiles/drools/src/main/resources/
bpm-console/trunk/gui/profiles/drools/src/main/resources/org/
bpm-console/trunk/gui/profiles/drools/src/main/resources/org/jboss/
bpm-console/trunk/gui/profiles/drools/src/main/resources/org/jboss/bpm/
bpm-console/trunk/gui/profiles/drools/src/main/resources/org/jboss/bpm/console/
bpm-console/trunk/gui/profiles/drools/src/main/resources/org/jboss/bpm/console/public/
bpm-console/trunk/gui/profiles/drools/src/main/resources/org/jboss/bpm/console/public/console.config.js
bpm-console/trunk/gui/profiles/drools/src/main/resources/org/jboss/bpm/console/public/drools_logo.png
bpm-console/trunk/gui/profiles/drools/src/main/resources/org/jboss/bpm/console/workspace.cfg
bpm-console/trunk/gui/profiles/jbpm/
bpm-console/trunk/gui/profiles/jbpm/pom.xml
bpm-console/trunk/gui/profiles/jbpm/src/
bpm-console/trunk/gui/profiles/jbpm/src/main/
bpm-console/trunk/gui/profiles/jbpm/src/main/java/
bpm-console/trunk/gui/profiles/jbpm/src/main/resources/
bpm-console/trunk/gui/profiles/jbpm/src/main/resources/org/
bpm-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/
bpm-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/
bpm-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/
bpm-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/public/
bpm-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/public/console.config.js
bpm-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/public/images/
bpm-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/public/jbpm_logo.png
bpm-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/workspace.cfg
bpm-console/trunk/gui/profiles/pom.xml
bpm-console/trunk/gui/profiles/profiles.iml
bpm-console/trunk/gui/war/
bpm-console/trunk/gui/war/.classpath
bpm-console/trunk/gui/war/.project
bpm-console/trunk/gui/war/GWT_TEST_README.txt
bpm-console/trunk/gui/war/README.txt
bpm-console/trunk/gui/war/XML_HTTP_PROXY.txt
bpm-console/trunk/gui/war/deploy.sh
bpm-console/trunk/gui/war/gui-war.iml
bpm-console/trunk/gui/war/pom.xml
bpm-console/trunk/gui/war/src/
bpm-console/trunk/gui/war/src/main/
bpm-console/trunk/gui/war/src/main/java/
bpm-console/trunk/gui/war/src/main/java/com/
bpm-console/trunk/gui/war/src/main/java/com/google/
bpm-console/trunk/gui/war/src/main/java/com/google/gson/
bpm-console/trunk/gui/war/src/main/java/com/google/gson/CamelCaseSeparatorNamingPolicy.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/CompositionFieldNamingPolicy.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/DefaultTypeAdapters.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/DelegatingJsonElementVisitor.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/DisjunctionExclusionStrategy.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/Escaper.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/ExclusionStrategy.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/ExposeAnnotationBasedExclusionStrategy.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/FieldNamingPolicy.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/FieldNamingStrategy.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/GenericArrayTypeImpl.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/Gson.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/GsonBuilder.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/InnerClassExclusionStrategy.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/InstanceCreator.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JavaFieldNamingPolicy.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonArray.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonArrayDeserializationVisitor.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonCompactFormatter.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonDeserializationContext.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonDeserializationContextDefault.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonDeserializationVisitor.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonDeserializer.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonDeserializerExceptionWrapper.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonElement.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonElementVisitor.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonEscapingVisitor.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonFieldNameValidator.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonFormatter.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonNull.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonObject.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonObjectDeserializationVisitor.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonParseException.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonParser.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonParserConstants.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonParserTokenManager.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonPrimitive.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonPrimitiveDeserializationVisitor.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonPrintFormatter.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonSerializationContext.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonSerializationContextDefault.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonSerializationVisitor.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonSerializer.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonSerializerExceptionWrapper.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonTreeNavigator.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/LowerCamelCaseSeparatorNamingPolicy.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/LowerCaseNamingPolicy.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/MappedObjectConstructor.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/MemoryRefStack.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/ModifierBasedExclusionStrategy.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/ModifyFirstLetterNamingPolicy.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/NullExclusionStrategy.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/ObjectConstructor.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/ObjectNavigator.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/ObjectNavigatorFactory.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/ParameterizedTypeHandlerMap.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/ParameterizedTypeImpl.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/ParseException.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/Preconditions.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/PrimitiveTypeAdapter.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/Primitives.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/RecursiveFieldNamingPolicy.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/SerializedNameAnnotationInterceptingNamingPolicy.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/SimpleCharStream.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/StringUnmarshaller.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/Token.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/TokenMgrError.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeAdapter.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeAdapterNotRequired.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeInfo.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeInfoArray.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeInfoFactory.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeInfoMap.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeUtils.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/UpperCaseNamingPolicy.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/VersionConstants.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/VersionExclusionStrategy.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/annotations/
bpm-console/trunk/gui/war/src/main/java/com/google/gson/annotations/Expose.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/annotations/SerializedName.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/annotations/Since.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/annotations/package-info.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/package-info.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/reflect/
bpm-console/trunk/gui/war/src/main/java/com/google/gson/reflect/TypeToken.java
bpm-console/trunk/gui/war/src/main/java/com/google/gson/reflect/package-info.java
bpm-console/trunk/gui/war/src/main/java/javax/
bpm-console/trunk/gui/war/src/main/java/javax/xml/
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Binder.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ContextFinder.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/DatatypeConverter.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/DatatypeConverterInterface.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Element.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/JAXBContext.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/JAXBElement.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/JAXBException.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/JAXBIntrospector.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/MarshalException.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Marshaller.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Messages.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/NotIdentifiableEvent.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ParseConversionEvent.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/PrintConversionEvent.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/PropertyException.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/SchemaOutputResolver.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/TypeConstraintException.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/UnmarshalException.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Unmarshaller.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/UnmarshallerHandler.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ValidationEvent.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ValidationEventHandler.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ValidationEventLocator.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ValidationException.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Validator.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/DomHandler.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/W3CDomHandler.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAccessOrder.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAccessType.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAccessorOrder.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAttribute.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElement.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElementRef.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElementRefs.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElementWrapper.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElements.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlEnum.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlID.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlIDREF.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlInlineBinaryData.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlList.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlMimeType.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlMixed.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlNs.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlNsForm.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlRegistry.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlRootElement.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlSchema.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlTransient.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlType.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlValue.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/package.html
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/package.html
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/attachment/
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/attachment/AttachmentMarshaller.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/attachment/AttachmentUnmarshaller.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/attachment/package.html
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/AbstractMarshallerImpl.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/DefaultValidationEventHandler.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/Messages.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/NotIdentifiableEventImpl.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/ParseConversionEventImpl.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/PrintConversionEventImpl.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/ValidationEventImpl.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/ValidationEventLocatorImpl.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/package.html
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/package.html
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/util/
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/util/JAXBResult.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/util/JAXBSource.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/util/Messages.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/util/ValidationEventCollector.java
bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/util/package.html
bpm-console/trunk/gui/war/src/main/java/jmaki/
bpm-console/trunk/gui/war/src/main/java/jmaki/xhp/
bpm-console/trunk/gui/war/src/main/java/jmaki/xhp/HttpClient.java
bpm-console/trunk/gui/war/src/main/java/jmaki/xhp/XmlHttpProxy.java
bpm-console/trunk/gui/war/src/main/java/jmaki/xhp/XmlHttpProxyServlet.java
bpm-console/trunk/gui/war/src/main/java/org/
bpm-console/trunk/gui/war/src/main/java/org/jboss/
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Application.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/BootstrapAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Header.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoadingStatusAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerPlugins.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerStatusView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditorNavigation.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/WorkspaceLauncher.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/PropertyGrid.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeleteDeploymentAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentDetailView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorNavigation.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ExecuteJobAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResourcePanel.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResumeDeploymentAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/SuspendDeploymentAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentDetailAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateJobsAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/events/
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/events/BootstrapEvent.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/05_1.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/13.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/27.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/49.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/ConsoleIconBundle.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/add.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/add_small.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/catForms.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/collapseDown.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/collapseLeft.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/confirmIcon.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/confirm_small.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/denyIcon.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/deny_small.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/deployment.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/dialog-error.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/dialog-information.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/dialog-password.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/dialog-question.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/dialog-warning.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/docIcon.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/errorIcon.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/examine.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/jobs.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/large.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/large_small.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/loading.gif
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/lockIcon.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/lock_small.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/pause.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/pause_small.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/play.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/play_small.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/processIcon.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/reload.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/reload_small.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/remove.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/remove_small.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/report.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/runtime.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/stop.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/stop_small.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/taskIcon.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/tool-button-collapse-down.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/tool-button-collapse-left.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/tool-button-collapse-right.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/tool-button-collapse-up.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/tool-button-minus.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/tool-button-plus.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/tool-button-refresh.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/toolsIcon.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/unlock.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/userIcon.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/window-button-close.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/window-button-maximize.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/window-button-minimize.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/window-button-restore.png
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ActivityDiagramView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeleteDefinitionAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeleteInstanceAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeploymentPanel.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDataView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/LoadActivityDiagramAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDetailView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditorNavigation.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/StartNewInstanceAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/StateChangeAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateDefinitionsAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstanceDataAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstanceDetailAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstancesAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateProcessDetailAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/events/
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/events/ActivityDiagramResultEvent.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/events/InstanceEvent.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/RenderDispatchEvent.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/RenderReportAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditorNavigation.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchDefinitionView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchDelegate.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchWindow.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/UpdateSearchDefinitionsAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AbstractTaskList.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignTaskAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ClaimTaskAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksParticipationAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ParticipantPanel.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReleaseTaskAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReloadAllTaskListsAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskDetailView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/UpdateDetailsAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/events/
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/events/AssignEvent.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/events/DetailViewEvent.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/events/TaskIdentityEvent.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/WindowUtil.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/rebind/
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java
bpm-console/trunk/gui/war/src/main/java/org/json/
bpm-console/trunk/gui/war/src/main/java/org/json/CDL.java
bpm-console/trunk/gui/war/src/main/java/org/json/Cookie.java
bpm-console/trunk/gui/war/src/main/java/org/json/CookieList.java
bpm-console/trunk/gui/war/src/main/java/org/json/HTTP.java
bpm-console/trunk/gui/war/src/main/java/org/json/HTTPTokener.java
bpm-console/trunk/gui/war/src/main/java/org/json/JSONArray.java
bpm-console/trunk/gui/war/src/main/java/org/json/JSONException.java
bpm-console/trunk/gui/war/src/main/java/org/json/JSONML.java
bpm-console/trunk/gui/war/src/main/java/org/json/JSONObject.java
bpm-console/trunk/gui/war/src/main/java/org/json/JSONString.java
bpm-console/trunk/gui/war/src/main/java/org/json/JSONStringer.java
bpm-console/trunk/gui/war/src/main/java/org/json/JSONTokener.java
bpm-console/trunk/gui/war/src/main/java/org/json/JSONWriter.java
bpm-console/trunk/gui/war/src/main/java/org/json/Test.java
bpm-console/trunk/gui/war/src/main/java/org/json/XML.java
bpm-console/trunk/gui/war/src/main/java/org/json/XMLTokener.java
bpm-console/trunk/gui/war/src/main/resources/
bpm-console/trunk/gui/war/src/main/resources/jmaki/
bpm-console/trunk/gui/war/src/main/resources/jmaki/xhp/
bpm-console/trunk/gui/war/src/main/resources/jmaki/xhp/xhp.json
bpm-console/trunk/gui/war/src/main/resources/mvc4g-conf.xml
bpm-console/trunk/gui/war/src/main/resources/org/
bpm-console/trunk/gui/war/src/main/resources/org/jboss/
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/Application.gwt.xml
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/Application.html
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/console.css
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/Jbpm_logo.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/Jbpm_logo_small.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/bg_gradient.gif
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/bg_headergradient.gif
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/bg_listgradient.gif
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/bg_suggestgradient.gif
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/blank_loading.gif
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/blank_splash.gif
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/gwt-logo.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/05.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/05_1.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/13.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/14.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/27.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/29.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/31.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/36.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/41.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/49.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/add.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/add_small.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/confirm.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/confirm_small.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/deny.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/deny_small.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/error.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/examine.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/large.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/large_small.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/loading.gif
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/lock.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/lock_small.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/pause.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/pause_small.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/play.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/play_red_big.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/play_small.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/remove.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/remove_small.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/stop.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/stop_small.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/unlock.png
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/loading-circle.gif
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/loading.gif
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/loading_lite.gif
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/processSample.jpg
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/tab.gif
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/js/
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/js/ox.ajast.js
bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg
bpm-console/trunk/gui/war/src/main/templates/
bpm-console/trunk/gui/war/src/main/templates/WEB-INF/
bpm-console/trunk/gui/war/src/main/templates/WEB-INF/jboss-web.xml
bpm-console/trunk/gui/war/src/main/webapp/
bpm-console/trunk/gui/war/src/main/webapp/WEB-INF/
bpm-console/trunk/gui/war/src/main/webapp/WEB-INF/web.xml
bpm-console/trunk/gui/war/src/main/webapp/index.html
bpm-console/trunk/gui/war/src/test/
bpm-console/trunk/gui/war/src/test/examples/
bpm-console/trunk/gui/war/src/test/examples/ForkJoinExample.par
bpm-console/trunk/gui/war/src/test/examples/TaskAssignmentExample.par
bpm-console/trunk/gui/war/src/test/java/
bpm-console/trunk/gui/war/src/test/java/HTTP.java
bpm-console/trunk/gui/war/src/test/java/PreparationTest.java
bpm-console/trunk/gui/war/src/test/java/org/
bpm-console/trunk/gui/war/src/test/java/org/jboss/
bpm-console/trunk/gui/war/src/test/java/org/jboss/bpm/
bpm-console/trunk/gui/war/src/test/java/org/jboss/bpm/console/
bpm-console/trunk/gui/war/src/test/java/org/jboss/bpm/console/client/
bpm-console/trunk/gui/war/src/test/resources/
bpm-console/trunk/gui/war/src/test/resources/ForkJoinExample3.par
bpm-console/trunk/gui/war/src/test/resources/SampleProcess.par
bpm-console/trunk/gui/workspace-api/
bpm-console/trunk/gui/workspace-api/pom.xml
bpm-console/trunk/gui/workspace-api/scripts/
bpm-console/trunk/gui/workspace-api/scripts/antrun-version.xml
bpm-console/trunk/gui/workspace-api/src/
bpm-console/trunk/gui/workspace-api/src/main/
bpm-console/trunk/gui/workspace-api/src/main/java/
bpm-console/trunk/gui/workspace-api/src/main/java/org/
bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/
bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/
bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/
bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/
bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java
bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Authentication.java
bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/ConsoleConfig.java
bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java
bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/LazyPanel.java
bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Menu.java
bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/MenuSection.java
bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/UIConstants.java
bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java
bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java
bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/
bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/util/
bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/util/ConsoleLog.java
bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/util/JSONWalk.java
bpm-console/trunk/gui/workspace-api/src/main/resources/
bpm-console/trunk/gui/workspace-api/workspace-api.iml
bpm-console/trunk/gwt-console.iml
bpm-console/trunk/gwt-parent.iml
bpm-console/trunk/pom.xml
bpm-console/trunk/rpc/
bpm-console/trunk/rpc/.classpath
bpm-console/trunk/rpc/.project
bpm-console/trunk/rpc/gwt-rpc.iml
bpm-console/trunk/rpc/pom.xml
bpm-console/trunk/rpc/src/
bpm-console/trunk/rpc/src/main/
bpm-console/trunk/rpc/src/main/java/
bpm-console/trunk/rpc/src/main/java/org/
bpm-console/trunk/rpc/src/main/java/org/jboss/
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ActiveNodeInfo.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRef.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRefWrapper.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DiagramInfo.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DiagramNodeInfo.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRef.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRefWrapper.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ParticipantRef.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/PluginInfo.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRefWrapper.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstancePerformance.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceRef.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceRefWrapper.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/RoleAssignmentRef.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/RoleAssignmentRefWrapper.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ServerStatus.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskRef.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskRefWrapper.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TokenReference.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/DateLocale.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/MapEntry.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/SimpleDateFormat.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/SimpleDateParser.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/regex/
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/regex/Pattern.java
bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/server/
bpm-console/trunk/rpc/src/main/resources/
bpm-console/trunk/sam/
bpm-console/trunk/sam/gui/
bpm-console/trunk/sam/gui/pom.xml
bpm-console/trunk/sam/gui/sam-gui.iml
bpm-console/trunk/sam/gui/src/
bpm-console/trunk/sam/gui/src/main/
bpm-console/trunk/sam/gui/src/main/java/
bpm-console/trunk/sam/gui/src/main/java/org/
bpm-console/trunk/sam/gui/src/main/java/org/jboss/
bpm-console/trunk/sam/gui/src/main/java/org/jboss/bpm/
bpm-console/trunk/sam/gui/src/main/java/org/jboss/bpm/console/
bpm-console/trunk/sam/gui/src/main/java/org/jboss/bpm/console/client/
bpm-console/trunk/sam/gui/src/main/java/org/jboss/bpm/console/client/SAMEditor.java
bpm-console/trunk/sam/gui/src/main/java/org/jboss/bpm/console/client/SAMEditorNavigation.java
bpm-console/trunk/sam/gui/src/main/resources/
bpm-console/trunk/sam/pom.xml
bpm-console/trunk/sam/profile/
bpm-console/trunk/sam/profile/pom.xml
bpm-console/trunk/sam/profile/sam-gui-profile.iml
bpm-console/trunk/sam/profile/sam-profile.iml
bpm-console/trunk/sam/profile/src/
bpm-console/trunk/sam/profile/src/main/
bpm-console/trunk/sam/profile/src/main/java/
bpm-console/trunk/sam/profile/src/main/resources/
bpm-console/trunk/sam/profile/src/main/resources/jmaki/
bpm-console/trunk/sam/profile/src/main/resources/jmaki/xhp/
bpm-console/trunk/sam/profile/src/main/resources/jmaki/xhp/xhp.json
bpm-console/trunk/sam/profile/src/main/resources/org/
bpm-console/trunk/sam/profile/src/main/resources/org/jboss/
bpm-console/trunk/sam/profile/src/main/resources/org/jboss/bpm/
bpm-console/trunk/sam/profile/src/main/resources/org/jboss/bpm/console/
bpm-console/trunk/sam/profile/src/main/resources/org/jboss/bpm/console/public/
bpm-console/trunk/sam/profile/src/main/resources/org/jboss/bpm/console/public/console.config.js
bpm-console/trunk/sam/profile/src/main/resources/org/jboss/bpm/console/public/images/
bpm-console/trunk/sam/profile/src/main/resources/org/jboss/bpm/console/public/sam-logo.png
bpm-console/trunk/sam/profile/src/main/resources/org/jboss/bpm/console/workspace.cfg
bpm-console/trunk/sam/sam-toplevel.iml
bpm-console/trunk/sam/server/
bpm-console/trunk/sam/server/pom.xml
bpm-console/trunk/sam/server/sam-server.iml
bpm-console/trunk/sam/server/src/
bpm-console/trunk/sam/server/src/main/
bpm-console/trunk/sam/server/src/main/java/
bpm-console/trunk/sam/server/src/main/java/org/
bpm-console/trunk/sam/server/src/main/java/org/jboss/
bpm-console/trunk/sam/server/src/main/java/org/jboss/sam/
bpm-console/trunk/sam/server/src/main/java/org/jboss/sam/console/
bpm-console/trunk/sam/server/src/main/java/org/jboss/sam/console/server/
bpm-console/trunk/sam/server/src/main/java/org/jboss/sam/console/server/ConsoleServerApplication.java
bpm-console/trunk/sam/server/src/main/java/org/jboss/sam/console/server/InfoFacade.java
bpm-console/trunk/sam/server/src/main/java/org/jboss/sam/console/server/UserMgmtFacade.java
bpm-console/trunk/sam/server/src/main/resources/
bpm-console/trunk/sam/server/src/main/webapp/
bpm-console/trunk/sam/server/src/main/webapp/WEB-INF/
bpm-console/trunk/sam/server/src/main/webapp/WEB-INF/jboss-web.xml
bpm-console/trunk/sam/server/src/main/webapp/WEB-INF/web.xml
bpm-console/trunk/sam/server/src/main/webapp/index.html
bpm-console/trunk/server/
bpm-console/trunk/server/pom.xml
bpm-console/trunk/server/server-core/
bpm-console/trunk/server/server-core/.classpath
bpm-console/trunk/server/server-core/.project
bpm-console/trunk/server/server-core/SQL.txt
bpm-console/trunk/server/server-core/default-identities.mysql.sql
bpm-console/trunk/server/server-core/deploy.sh
bpm-console/trunk/server/server-core/pom.xml
bpm-console/trunk/server/server-core/scripts/
bpm-console/trunk/server/server-core/scripts/assembly-config.xml
bpm-console/trunk/server/server-core/server-core.iml
bpm-console/trunk/server/server-core/src/
bpm-console/trunk/server/server-core/src/main/
bpm-console/trunk/server/server-core/src/main/java/
bpm-console/trunk/server/server-core/src/main/java/org/
bpm-console/trunk/server/server-core/src/main/java/org/jboss/
bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/
bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/
bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/
bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java
bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/EngineFacade.java
bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/FormProcessingFacade.java
bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/InfoFacade.java
bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java
bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskListFacade.java
bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java
bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/UserMgmtFacade.java
bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/gson/
bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/
bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/BufferedResponseWrapper.java
bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/DOMUtils.java
bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/FilterServletOutputStream.java
bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/GWTJsonFilter.java
bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/Payload2XML.java
bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/PayloadCollection.java
bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/PayloadEntry.java
bpm-console/trunk/server/server-core/src/main/resources/
bpm-console/trunk/server/server-core/src/main/resources/definition_report.rptconfig
bpm-console/trunk/server/server-core/src/main/resources/definition_report.rptdesign
bpm-console/trunk/server/server-core/src/main/resources/instance_report.rptconfig
bpm-console/trunk/server/server-core/src/main/resources/instance_report.rptdesign
bpm-console/trunk/server/server-core/src/main/resources/org/
bpm-console/trunk/server/server-core/src/main/resources/org/jboss/
bpm-console/trunk/server/server-core/src/main/resources/org/jboss/bpm/
bpm-console/trunk/server/server-core/src/main/resources/org/jboss/bpm/console/
bpm-console/trunk/server/server-core/src/main/resources/org/jboss/bpm/console/server/
bpm-console/trunk/server/server-core/src/main/resources/org/jboss/bpm/console/server/jbpm3/
bpm-console/trunk/server/server-core/src/main/resources/org/jboss/bpm/console/server/jbpm3/dao/
bpm-console/trunk/server/server-core/src/main/resources/org/jboss/bpm/console/server/jbpm3/dao/internal/
bpm-console/trunk/server/server-core/src/main/resources/org/jboss/bpm/console/server/jbpm3/dao/internal/1.jpg
bpm-console/trunk/server/server-core/src/main/resources/org/jboss/bpm/console/server/jbpm3/dao/internal/gpd.xml
bpm-console/trunk/server/server-core/src/main/resources/process.jpdl.xml
bpm-console/trunk/server/server-core/src/main/resources/process_activity.rptdesign
bpm-console/trunk/server/server-core/src/main/resources/task_report.rptdesign
bpm-console/trunk/server/server-core/src/main/webapp/
bpm-console/trunk/server/server-core/src/main/webapp/WEB-INF/
bpm-console/trunk/server/server-core/src/main/webapp/WEB-INF/jboss-web.xml
bpm-console/trunk/server/server-core/src/main/webapp/WEB-INF/web.xml
bpm-console/trunk/server/server-core/src/main/webapp/index.html
bpm-console/trunk/server/server-core/src/main/webapp/login.html
bpm-console/trunk/server/server-core/src/main/webapp/login_failed.html
bpm-console/trunk/server/server-core/src/test/
bpm-console/trunk/server/server-core/src/test/java/
bpm-console/trunk/server/server-core/src/test/java/org/
bpm-console/trunk/server/server-core/src/test/java/org/jboss/
bpm-console/trunk/server/server-core/src/test/java/org/jboss/bpm/
bpm-console/trunk/server/server-core/src/test/java/org/jboss/bpm/test/
bpm-console/trunk/server/server-core/src/test/java/org/jboss/bpm/test/typeconversion/
bpm-console/trunk/server/server-core/src/test/java/org/jboss/bpm/test/typeconversion/AnnotatedComplexType.java
bpm-console/trunk/server/server-core/src/test/java/org/jboss/bpm/test/typeconversion/ComplexType.java
bpm-console/trunk/server/server-core/src/test/java/org/jboss/bpm/test/typeconversion/IllegalType.java
bpm-console/trunk/server/server-core/src/test/java/org/jboss/bpm/test/typeconversion/TypeConversionTestCase.java
bpm-console/trunk/server/server-integration/
bpm-console/trunk/server/server-integration/pom.xml
bpm-console/trunk/server/server-integration/server-integration.iml
bpm-console/trunk/server/server-integration/src/
bpm-console/trunk/server/server-integration/src/main/
bpm-console/trunk/server/server-integration/src/main/java/
bpm-console/trunk/server/server-integration/src/main/java/org/
bpm-console/trunk/server/server-integration/src/main/java/org/jboss/
bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/
bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/
bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/
bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/
bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ManagementFactory.java
bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ProcessManagement.java
bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/TaskManagement.java
bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/UserManagement.java
bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/
bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/FormAuthorityRef.java
bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/FormDispatcherPlugin.java
bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/GraphViewerPlugin.java
bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/PluginMgr.java
bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/ProcessEnginePlugin.java
bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/util/
bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/util/InvocationProxy.java
bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/util/ServiceLoader.java
Log:
Created from https://svn.jboss.org/repos/jbpm/projects/gwt-console/trunk -5383
Added: bpm-console/trunk/License.html
===================================================================
--- bpm-console/trunk/License.html (rev 0)
+++ bpm-console/trunk/License.html 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,110 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+
+ <title>BPM Console License Information</title>
+
+ <style type="text/css">
+
+ p.heading {
+ font-weight: bold;
+ }
+
+ .licenses {
+ border-collapse: separate;
+ }
+
+ .licenses th {
+ text-align: left;
+ background-color: #ccccff;
+ padding: 3px;
+ }
+
+ .licenses td {
+ background-color: #f4f4f4;
+ padding: 3px;
+ text-align: left;
+ vertical-align: top;
+ }
+
+ .licenses tr.even td {
+ background-color: #eeeeee;
+ }
+
+ </style></head>
+
+<body>
+
+<div id="body">
+
+
+
+ <h1>BPM Console License Information</h1>
+
+ <p>
+ <pre>
+ JBoss, Home of Professional Open Source.
+ Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ as indicated by the @author tags. See the copyright.txt file in the
+ distribution for a full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ </pre>
+ </p>
+
+ <a name="licenses"></a>
+ <h2>LICENSE INFORMATION REGARDING RELATED THIRD-PARTY SOFTWARE</h2>
+
+ <p>The jBPM GWT-Console relies on the following third party software.
+ Below is the location and license information :
+ </p>
+
+ <table class="licenses">
+ <tbody><tr>
+ <th>Package</th>
+ <th>License</th>
+ <th>Details</th>
+ </tr>
+
+ <tr>
+ <td class="package"><a href="http://code.google.com/webtoolkit/">Google Web Toolkit</a></td>
+ <td class="license"><a href="http://code.google.com/webtoolkit/terms.html">Apache License v.
+ 2.0</a></td>
+ <td class="location"><a
+ href="http://code.google.com/webtoolkit/">http://code.google.com/webtoolkit/</a></td>
+ </tr>
+ <tr>
+ <td class="package"><a href="http://code.google.com/p/gwt-mosaic/">GWT Mosaic</a></td>
+ <td class="license"><a href="http://code.google.com/webtoolkit/terms.html">Apache License v.
+ 2.0</a></td>
+ <td class="location"><a
+ href="http://code.google.com/p/gwt-mosaic/">http://code.google.com/webtoolkit/</a></td>
+ </tr>
+ <tr>
+ <td class="package"><a href="https://ajax.dev.java.net/">jMaki</a></td>
+ <td class="license"><a href="http://developers.sun.com/berkeley_license.html">Berkeley</a>.</td>
+
+ <td class="location"><a href="https://ajax.dev.java.net/">https://ajax.dev.java.net/</a></td>
+ </tr>
+
+ </tbody></table>
+
+</div>
+
+</body></html>
+
Added: bpm-console/trunk/README.txt
===================================================================
--- bpm-console/trunk/README.txt (rev 0)
+++ bpm-console/trunk/README.txt 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,35 @@
+
+Prerequisites
+-------------
+
+The server module needs to be deployed on a running jboss instance, along with jbpm.
+The easiest way is using the installer as described here: http://www.jboss.org/community/docs/DOC-12863
+
+Build and test the console
+--------------------------
+General information can be found here:
+https://www.jboss.org/community/docs/DOC-12879
+
+But the basics steps to get going are as follows:
+
+1) Build the top level module
+
+ mvn clean install
+
+2) Make sure both process engine and the server module are installed on JBoss AS instance
+
+ See http://www.jboss.org/community/docs/DOC-12863
+
+3) Boot the AS and start the gwt console in hosted mode
+
+ See gui/war/README.txt for further information
+
+
+Troubleshooting
+---------------
+
+Please post any questions to the gwt-console developer forum.
+(http://www.jboss.org/index.html?module=bb&op=viewforum&f=295)
+
+Have fun.
+
Added: bpm-console/trunk/common/common.iml
===================================================================
--- bpm-console/trunk/common/common.iml (rev 0)
+++ bpm-console/trunk/common/common.iml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.slf4j:slf4j-simple:jar:1.5.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/slf4j/slf4j-simple/1.5.2/slf4j-simple-1.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.resteasy:resteasy-jaxrs:jar:1.0.2.GA:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/resteasy/resteasy-jaxrs/1.0.2.GA/resteasy-jaxrs-1.0.2.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.annotation:jsr250-api:jar:1.0:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.slf4j:slf4j-api:jar:1.5.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/slf4j/slf4j-api/1.5.2/slf4j-api-1.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.resteasy:jaxrs-api:jar:1.0.2.GA:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/resteasy/jaxrs-api/1.0.2.GA/jaxrs-api-1.0.2.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.scannotation:scannotation:jar:1.0.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/scannotation/scannotation/1.0.2/scannotation-1.0.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javassist:javassist:jar:3.6.0.GA:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javassist/javassist/3.6.0.GA/javassist-3.6.0.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+</module>
+
Added: bpm-console/trunk/common/pom.xml
===================================================================
--- bpm-console/trunk/common/pom.xml (rev 0)
+++ bpm-console/trunk/common/pom.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,63 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <name>JBoss BPM - GWT Console (Common)</name>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-common</artifactId>
+ <packaging>jar</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxrs</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>tjws</groupId>
+ <artifactId>webserver</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ </dependency>
+ </dependencies>
+</project>
Added: bpm-console/trunk/common/src/main/java/org/jboss/bpm/console/server/gson/GsonFactory.java
===================================================================
--- bpm-console/trunk/common/src/main/java/org/jboss/bpm/console/server/gson/GsonFactory.java (rev 0)
+++ bpm-console/trunk/common/src/main/java/org/jboss/bpm/console/server/gson/GsonFactory.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.gson;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class GsonFactory
+{
+ public static Gson createInstance()
+ {
+ Gson gson = new GsonBuilder()
+ .setDateFormat("yyyy-MM-dd HH:mm:ss")
+ .registerTypeAdapter(java.sql.Timestamp.class, new SQLDateTypeAdapter())
+ .create();
+ return gson;
+ }
+}
Added: bpm-console/trunk/common/src/main/java/org/jboss/bpm/console/server/gson/SQLDateTypeAdapter.java
===================================================================
--- bpm-console/trunk/common/src/main/java/org/jboss/bpm/console/server/gson/SQLDateTypeAdapter.java (rev 0)
+++ bpm-console/trunk/common/src/main/java/org/jboss/bpm/console/server/gson/SQLDateTypeAdapter.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.gson;
+
+import com.google.gson.*;
+
+import java.util.Date;
+import java.text.*;
+import java.lang.reflect.Type;
+
+
+/**
+ * A default type adapter for a {@link java.util.Date} object.<br>
+ * Create a GSON instance that can serialize/deserialize "java.util.Date" objects:
+ * <pre>
+ * Gson gson = new GsonBuilder()
+ * .registerTypeAdapter(new DateTypeAdapter())
+ * .create();
+ * </pre>
+ *
+ * @author Joel Leitch
+ */
+public class SQLDateTypeAdapter implements JsonSerializer<java.sql.Timestamp>, JsonDeserializer<Date>
+{
+ private final DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+ public JsonElement serialize(java.sql.Timestamp src, Type typeOfSrc, JsonSerializationContext context)
+ {
+ String dateFormatAsString = format.format(src);
+ return new JsonPrimitive(dateFormatAsString);
+ }
+
+ public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
+ throws JsonParseException
+ {
+ if (!(json instanceof JsonPrimitive)) {
+ throw new JsonParseException("The date should be a string value");
+ }
+
+ try
+ {
+ return format.parse(json.getAsString());
+ }
+ catch (ParseException e)
+ {
+ throw new JsonParseException(e);
+ }
+
+ }
+}
Added: bpm-console/trunk/common/src/main/java/org/jboss/bpm/console/server/util/RsComment.java
===================================================================
--- bpm-console/trunk/common/src/main/java/org/jboss/bpm/console/server/util/RsComment.java (rev 0)
+++ bpm-console/trunk/common/src/main/java/org/jboss/bpm/console/server/util/RsComment.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.util;
+
+ at java.lang.annotation.Target(value = {java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.METHOD}) @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
+public @interface RsComment {
+
+ java.lang.String title();
+ java.lang.String description();
+}
\ No newline at end of file
Added: bpm-console/trunk/common/src/main/java/org/jboss/bpm/console/server/util/RsDocBuilder.java
===================================================================
--- bpm-console/trunk/common/src/main/java/org/jboss/bpm/console/server/util/RsDocBuilder.java (rev 0)
+++ bpm-console/trunk/common/src/main/java/org/jboss/bpm/console/server/util/RsDocBuilder.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,166 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.util;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Produces;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Date;
+
+/**
+ * Creates HTML documention for JAX-RS resource classes.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class RsDocBuilder
+{
+ private String webContext;
+ private Class[] rootResources;
+
+ public RsDocBuilder(String webContext, Class[] rootResources)
+ {
+ this.rootResources = rootResources;
+ this.webContext = webContext.startsWith("/") ? webContext : "/"+webContext;
+ }
+
+ public String getWebContext()
+ {
+ return webContext;
+ }
+
+ public Class[] getRootResources()
+ {
+ return rootResources;
+ }
+
+ private StringBuffer build(Class root)
+ {
+ Path rootPath = (Path)root.getAnnotation(Path.class);
+ RsComment rootComment = (RsComment)root.getAnnotation(RsComment.class);
+
+ List<Representation> representations = new ArrayList<Representation>();
+
+ for(Method m : root.getDeclaredMethods())
+ {
+ Path resPath = m.getAnnotation(Path.class);
+ if(resPath!=null)
+ {
+ Representation r = new Representation();
+
+ r.path = resPath.value();
+ r.httpMethod = m.getAnnotation(GET.class)!=null ? "GET" : "POST"; // currently limited to those
+ r.consume = (m.getAnnotation(Consumes.class)!=null) ?
+ arrayToString(m.getAnnotation(Consumes.class).value()) : "*/*";
+ r.produce = (m.getAnnotation(Produces.class)!=null) ?
+ arrayToString(m.getAnnotation(Produces.class).value()) : "*/*";
+ representations.add(r);
+ }
+ }
+
+ StringBuffer sb = new StringBuffer();
+
+ if(rootComment!=null)
+ {
+ sb.append("<tr>");
+ sb.append("<td colspan=5 style='border-bottom:1px solid black;'>");
+ sb.append("<b>").append(rootComment.title()).append("</b>").append("<br>");
+ sb.append("<i>").append(rootComment.description()).append("</i>");
+ sb.append("</td>");
+ sb.append("</tr>");
+ }
+
+ for(Representation r : representations)
+ {
+ sb.append("<tr>");
+ sb.append("<td>").append(r.httpMethod.toUpperCase()).append("</td>");
+ sb.append("<td>").append(buildPath(rootPath.value(),r.path)).append("</td>");
+ sb.append("<td>").append("").append("</td>"); // description
+ sb.append("<td>").append(r.consume).append("</td>");
+ sb.append("<td>").append(r.produce).append("</td>");
+ sb.append("</tr>");
+ }
+
+ sb.append("<tr><td colspan=5> </td></tr>");
+
+ return sb;
+ }
+
+ private String arrayToString(String[] arr)
+ {
+ StringBuffer sb = new StringBuffer();
+ for(int i=0; i<arr.length; i++)
+ {
+ sb.append(arr[i]);
+ if(i<arr.length-1)
+ sb.append(",");
+ }
+ return sb.toString();
+ }
+
+ private String buildPath(String root, String resourcePath)
+ {
+ StringBuffer sb = new StringBuffer();
+ sb.append(webContext);
+ sb.append("/").append(root).append("/");
+ sb.append(resourcePath);
+ return sb.toString();
+ }
+
+ public StringBuffer build()
+ {
+ StringBuffer sb = new StringBuffer();
+ sb.append("<html>").append("<body style='font-family: sans-serif; font-size:10pt;'>");
+ sb.append("<!--").append(" generated by RsDoc at ").append( new Date() ).append(" -->");
+ sb.append("<table style='margin-top:10px;' width='100%'>");
+
+ sb.append("<tr>");
+ sb.append("<th>").append("Method").append("</th>");
+ sb.append("<th>").append("Path").append("</th>");
+ sb.append("<th>").append("Description").append("</th>"); // description
+ sb.append("<th>").append("Consumes").append("</th>");
+ sb.append("<th>").append("Produces").append("</th>");
+ sb.append("</tr>");
+
+ for(Class c : rootResources)
+ {
+ sb.append(
+ build(c).toString()
+ );
+ }
+ sb.append("</table>");
+ sb.append("</body>").append("<html>");
+ return sb;
+
+ }
+
+ private class Representation
+ {
+ String description,title = "";
+ String consume,produce = "";
+ String path;
+ String httpMethod;
+ }
+}
Added: bpm-console/trunk/doc/Reference.odt
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/doc/Reference.odt
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/doc/Reference.pdf
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/doc/Reference.pdf
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/pom.xml
===================================================================
--- bpm-console/trunk/gui/pom.xml (rev 0)
+++ bpm-console/trunk/gui/pom.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,24 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <name>JBoss BPM - GWT Console (GUI)</name>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-guimodule</artifactId>
+ <packaging>pom</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <modules>
+ <module>profiles</module>
+ <module>war</module>
+ <module>workspace-api</module>
+ </modules>
+</project>
Added: bpm-console/trunk/gui/profiles/drools/pom.xml
===================================================================
--- bpm-console/trunk/gui/profiles/drools/pom.xml (rev 0)
+++ bpm-console/trunk/gui/profiles/drools/pom.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,19 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <name>JBoss BPM - GWT Console (GUI Profile Drools)</name>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-profile-drools</artifactId>
+ <packaging>jar</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-profiles</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+</project>
Added: bpm-console/trunk/gui/profiles/drools/src/main/resources/org/jboss/bpm/console/public/console.config.js
===================================================================
--- bpm-console/trunk/gui/profiles/drools/src/main/resources/org/jboss/bpm/console/public/console.config.js (rev 0)
+++ bpm-console/trunk/gui/profiles/drools/src/main/resources/org/jboss/bpm/console/public/console.config.js 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,8 @@
+var consoleConfig = {
+ profileName: "DroolsFlow Console",
+ logo: "drools_logo.png",
+ serverWebContext: "/gwt-console-server",
+ overallReportFile: "overall_activity.rptdesign",
+ processSummaryReportFile: "process_summary.rptdesign",
+ instanceSummaryReportFile: "instance_summary.rptdesign"
+};
\ No newline at end of file
Added: bpm-console/trunk/gui/profiles/drools/src/main/resources/org/jboss/bpm/console/public/drools_logo.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/profiles/drools/src/main/resources/org/jboss/bpm/console/public/drools_logo.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/profiles/drools/src/main/resources/org/jboss/bpm/console/workspace.cfg
===================================================================
--- bpm-console/trunk/gui/profiles/drools/src/main/resources/org/jboss/bpm/console/workspace.cfg (rev 0)
+++ bpm-console/trunk/gui/profiles/drools/src/main/resources/org/jboss/bpm/console/workspace.cfg 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,4 @@
+org.jboss.bpm.console.client.task.TaskEditor
+org.jboss.bpm.console.client.process.ProcessEditor
+org.jboss.bpm.console.client.report.ReportEditor
+org.jboss.bpm.console.client.SettingsEditor
\ No newline at end of file
Added: bpm-console/trunk/gui/profiles/jbpm/pom.xml
===================================================================
--- bpm-console/trunk/gui/profiles/jbpm/pom.xml (rev 0)
+++ bpm-console/trunk/gui/profiles/jbpm/pom.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,19 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <name>JBoss BPM - GWT Console (GUI Profile jBPM)</name>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-profile-jbpm</artifactId>
+ <packaging>jar</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-profiles</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+</project>
Added: bpm-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/public/console.config.js
===================================================================
--- bpm-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/public/console.config.js (rev 0)
+++ bpm-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/public/console.config.js 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,8 @@
+var consoleConfig = {
+ profileName: "jBPM Console",
+ logo: "jbpm_logo.png",
+ serverWebContext: "/gwt-console-server",
+ overallReportFile: "overall_activity.rptdesign",
+ processSummaryReportFile: "process_summary.rptdesign",
+ instanceSummaryReportFile: "instance_summary.rptdesign"
+};
\ No newline at end of file
Added: bpm-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/public/jbpm_logo.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/public/jbpm_logo.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/workspace.cfg
===================================================================
--- bpm-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/workspace.cfg (rev 0)
+++ bpm-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/workspace.cfg 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,5 @@
+org.jboss.bpm.console.client.task.TaskEditor
+org.jboss.bpm.console.client.process.ProcessEditor
+org.jboss.bpm.console.client.report.ReportEditor
+org.jboss.bpm.console.client.engine.EngineEditor
+org.jboss.bpm.console.client.SettingsEditor
\ No newline at end of file
Added: bpm-console/trunk/gui/profiles/pom.xml
===================================================================
--- bpm-console/trunk/gui/profiles/pom.xml (rev 0)
+++ bpm-console/trunk/gui/profiles/pom.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,25 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <name>JBoss BPM - GWT Console (GUI Profiles)</name>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-profiles</artifactId>
+ <packaging>pom</packaging>
+
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-guimodule</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+
+ <modules>
+ <module>jbpm</module>
+ <module>drools</module>
+ </modules>
+</project>
Added: bpm-console/trunk/gui/profiles/profiles.iml
===================================================================
--- bpm-console/trunk/gui/profiles/profiles.iml (rev 0)
+++ bpm-console/trunk/gui/profiles/profiles.iml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/drools/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/drools/src/main/resources" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/jbpm/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/jbpm/src/main/resources" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntryProperties />
+ </component>
+</module>
+
Added: bpm-console/trunk/gui/war/.classpath
===================================================================
--- bpm-console/trunk/gui/war/.classpath (rev 0)
+++ bpm-console/trunk/gui/war/.classpath 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: bpm-console/trunk/gui/war/.project
===================================================================
--- bpm-console/trunk/gui/war/.project (rev 0)
+++ bpm-console/trunk/gui/war/.project 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>bpm-sample-airticket-war</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added: bpm-console/trunk/gui/war/GWT_TEST_README.txt
===================================================================
--- bpm-console/trunk/gui/war/GWT_TEST_README.txt (rev 0)
+++ bpm-console/trunk/gui/war/GWT_TEST_README.txt 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,12 @@
+Special node for executing GWT tests under linux:
+The GWT-maven plugin executes any test prefixed "GwtTest"
+(See http://gwt-maven.googlecode.com/svn/docs/maven-googlewebtoolkit2-plugin/testing.html)
+It reads stderr in order to figure wether or not the test has been successful.
+On fedora (or any other linux) it happens that that mozilla components issue the following
+INFO message to stderr, which causes the test to fail:
+
+> Gtk-WARNING **: Unable to locate theme engine in module_path: "nodoka"
+
+This is caused by missing nodoka (theme) package; please install it as follow:
+yum install gtk-nodoka-engine (on fedora)
+
Added: bpm-console/trunk/gui/war/README.txt
===================================================================
--- bpm-console/trunk/gui/war/README.txt (rev 0)
+++ bpm-console/trunk/gui/war/README.txt 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,34 @@
+Running in hosted mode:
+----------------------
+
+Start the GWT shell with
+
+ mvn gwt-maven:gwt
+
+When the hosted browser is started, it's enough to hit the 'refresh' button to recompile
+and verfiy changes.
+
+NOTE: Really quick turnaround through
+
+ mvn -Dhosted gwt-maven:gwt
+
+(Will run "mvn -o -Dgoogle.webtoolkit.compileSkip=true gwt-maven:gwt")
+
+
+Running in web mode:
+-------------------
+
+mvn package
+
+Produces a war file in target/gwt-console.war,
+which can be deployed to a running jboss instance.
+
+Problems?
+---------
+Please post any questions to the gwt-console developer forum.
+(http://www.jboss.org/index.html?module=bb&op=viewforum&f=295)
+
+Have fun.
+
+
+
Added: bpm-console/trunk/gui/war/XML_HTTP_PROXY.txt
===================================================================
--- bpm-console/trunk/gui/war/XML_HTTP_PROXY.txt (rev 0)
+++ bpm-console/trunk/gui/war/XML_HTTP_PROXY.txt 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,3 @@
+See https://ajax.dev.java.net/xmlhttpproxy.html for further details.
+
+
Added: bpm-console/trunk/gui/war/deploy.sh
===================================================================
--- bpm-console/trunk/gui/war/deploy.sh (rev 0)
+++ bpm-console/trunk/gui/war/deploy.sh 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,10 @@
+#! /bin/bash
+
+mvn -o -DskipTests install
+
+SRC=target/gwt-console.war
+DEST=$JBOSS422/server/default/deploy/jbpm
+
+echo
+echo "cp $SRC $DEST"
+cp $SRC $DEST
Property changes on: bpm-console/trunk/gui/war/deploy.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: bpm-console/trunk/gui/war/gui-war.iml
===================================================================
--- bpm-console/trunk/gui/war/gui-war.iml (rev 0)
+++ bpm-console/trunk/gui/war/gui-war.iml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,215 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="gwt-rpc" exported="" />
+ <orderEntry type="module" module-name="profiles" />
+ <orderEntry type="module" module-name="gwt-parent" />
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: junit:junit:jar:3.8.1:test">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.activation:activation:jar:1.1:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.code.gwt-log:gwt-log:jar:2.5.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/code/gwt-log/gwt-log/2.5.2/gwt-log-2.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.gwt:gwt-dev:jar:mac:1.5.3:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/gwt/gwt-dev/1.5.3/gwt-dev-1.5.3-mac.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.3:runtime">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.3/gwt-servlet-1.5.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.3:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.3/gwt-user-1.5.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-collections:commons-collections:jar:3.2.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-logging:commons-logging:jar:1.1.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-lang:commons-lang:jar:2.4:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-digester:commons-digester:jar:1.8:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-digester/commons-digester/1.8/commons-digester-1.8.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.mvc4g:mvc4g:jar:1.0.0-jboss:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/mvc4g/mvc4g/1.0.0-jboss/mvc4g-1.0.0-jboss.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-beanutils:commons-beanutils:jar:1.7.0:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-configuration:commons-configuration:jar:1.6:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-configuration/commons-configuration/1.6/commons-configuration-1.6.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-beanutils:commons-beanutils-core:jar:1.8.0:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-beanutils/commons-beanutils-core/1.8.0/commons-beanutils-core-1.8.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic/0.1.10/gwt-mosaic-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-dnd:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-dnd/0.1.10/gwt-mosaic-dnd-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-gwtx:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-gwtx/0.1.10/gwt-mosaic-gwtx-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-incubator:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-incubator/0.1.10/gwt-mosaic-incubator-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+</module>
+
Added: bpm-console/trunk/gui/war/pom.xml
===================================================================
--- bpm-console/trunk/gui/war/pom.xml (rev 0)
+++ bpm-console/trunk/gui/war/pom.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,451 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <name>JBoss BPM - GWT Console (GUI Main)</name>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console</artifactId>
+ <packaging>war</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-guimodule</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <properties>
+ <gwt-maven.version>2.0-RC1</gwt-maven.version>
+ </properties>
+
+ <!-- Dependencies -->
+ <dependencies>
+
+ <!-- JBPM -->
+ <dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-rpc</artifactId>
+ <version>${version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-workspace-api</artifactId>
+ <version>${version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-workspace-api</artifactId>
+ <classifier>sources</classifier>
+ <version>${version}</version>
+ </dependency>
+
+ <!-- GWT -->
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-servlet</artifactId>
+ <version>${gwt.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
+ <version>${gwt.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-dev</artifactId>
+ <version>${gwt.version}</version>
+ <classifier>${platform}-libs</classifier>
+ <type>zip</type>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-dev</artifactId>
+ <version>${gwt.version}</version>
+ <classifier>${platform}</classifier>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- GWT extensions -->
+ <dependency>
+ <groupId>com.google.code.gwt-log</groupId>
+ <artifactId>gwt-log</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic-dnd</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic-incubator</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic-gwtx</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.googlecode.mvc4g</groupId>
+ <artifactId>mvc4g</artifactId>
+
+ </dependency>
+
+ <!-- 3rd party -->
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-configuration</groupId>
+ <artifactId>commons-configuration</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <!-- Plugins -->
+ <build>
+ <finalName>gwt-console</finalName>
+
+ <plugins>
+ <plugin>
+ <groupId>com.totsp.gwt</groupId>
+ <artifactId>maven-googlewebtoolkit2-plugin</artifactId>
+ <version>${gwt-maven.version}</version>
+ <configuration>
+ <logLevel>INFO</logLevel>
+ <compileTargets>
+ <value>org.jboss.bpm.console.Application</value>
+ </compileTargets>
+ <runTarget>org.jboss.bpm.console.Application/Application.html</runTarget>
+ <style>DETAILED</style>
+ <noServer>false</noServer>
+ <extraJvmArgs>-Xmx256M -Xms256M</extraJvmArgs>
+ <!-- this parameter is VERY important with automatic mode -
+ has to match the version in your declared deps
+ if this is set incorrect, or left out and default does not match
+ (default is 1.5.2 for 2.0-beta23) you will have mysterious errors
+ -->
+ <gwtVersion>${gwt.version}</gwtVersion>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>mergewebxml</goal>
+ <goal>compile</goal>
+ <goal>gwt</goal>
+
+ <!--
+ GWT tests are executed through "-Palltests"
+ -->
+ <!--goal>test</goal-->
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- Use the dependency plugin to unpack gwt-dev-PLATFORM-libs.zip -->
+ <!--
+ (this is a replacement for the old "automatic" mode - useful if you
+ don't have GWT installed already, or you just want a maven way to
+ handle gwt deps)
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack-gwt</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-dev</artifactId>
+ <version>${gwtVersion}</version>
+ <classifier>${platform}-libs</classifier>
+ <type>zip</type>
+ <overWrite>false</overWrite>
+ <outputDirectory>${settings.localRepository}/com/google/gwt/gwt-dev/${gwtVersion}</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+
+ </executions>
+ </plugin>
+ <!--
+ If you want to use the target/web.xml file mergewebxml produces,
+ tell the war plugin to use it
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <webXml>target/web.xml</webXml>
+ <warSourceExcludes>.gwt-tmp/**</warSourceExcludes>
+ <webResources>
+ <resource>
+ <!-- this is relative to the pom.xml directory -->
+ <directory>src/main/templates</directory>
+ <filtering>true</filtering>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <!-- profiles (with activation per platform) -->
+ <profiles>
+
+ <profile>
+ <id>quick-hosted-mode</id>
+ <activation>
+ <property>
+ <name>hosted</name>
+ </property>
+ </activation>
+ <properties>
+ <google.webtoolkit.compileSkip>true</google.webtoolkit.compileSkip>
+ <o>true</o> <!-- offline -->
+ </properties>
+ </profile>
+
+ <profile>
+ <id>jbpm-console.profile</id>
+ <activation>
+ <property>
+ <name>!console.profile</name>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-profile-jbpm</artifactId>
+ <version>${version}</version>
+ </dependency>
+ </dependencies>
+ <properties>
+ <console.app.webcontext>jbpm-console</console.app.webcontext>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack-profile-jbpm</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-profile-jbpm</artifactId>
+ <version>${version}</version>
+ <type>jar</type>
+ <overWrite>true</overWrite>
+ <outputDirectory>target/classes</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+
+ </executions>
+ </plugin>
+
+ </plugins>
+
+ </build>
+ </profile>
+
+ <profile>
+ <id>drools-console.profile</id>
+ <activation>
+ <property>
+ <name>console.profile</name>
+ <value>drools</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-profile-drools</artifactId>
+ <version>${version}</version>
+ </dependency>
+ </dependencies>
+ <properties>
+ <console.app.webcontext>gwt-console</console.app.webcontext>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+
+ <execution>
+ <id>unpack-profile-drools</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-profile-drools</artifactId>
+ <version>${version}</version>
+ <type>jar</type>
+ <overWrite>true</overWrite>
+ <outputDirectory>target/classes</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>sam-console.profile</id>
+ <activation>
+ <property>
+ <name>console.profile</name>
+ <value>sam</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.sam</groupId>
+ <artifactId>gwt-console-profile-sam</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.sam</groupId>
+ <artifactId>sam-gui</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.sam</groupId>
+ <artifactId>sam-gui</artifactId>
+ <classifier>sources</classifier>
+ <version>${version}</version>
+ </dependency>
+ </dependencies>
+ <properties>
+ <console.app.webcontext>sam-console</console.app.webcontext>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+
+ <execution>
+ <id>unpack-profile-drools</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.sam</groupId>
+ <artifactId>gwt-console-profile-sam</artifactId>
+ <version>${version}</version>
+ <type>jar</type>
+ <overWrite>true</overWrite>
+ <outputDirectory>target/classes</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>gwt-dev-windows</id>
+ <properties>
+ <platform>windows</platform>
+ </properties>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ <os>
+ <family>windows</family>
+ </os>
+ </activation>
+ </profile>
+ <profile>
+ <id>gwt-dev-mac</id>
+ <properties>
+ <platform>mac</platform>
+ </properties>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ <os>
+ <family>mac</family>
+ </os>
+ </activation>
+ </profile>
+ <profile>
+ <id>gwt-dev-linux</id>
+ <properties>
+ <platform>linux</platform>
+ </properties>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ <os>
+ <name>linux</name>
+ </os>
+ </activation>
+ </profile>
+ </profiles>
+</project>
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/CamelCaseSeparatorNamingPolicy.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/CamelCaseSeparatorNamingPolicy.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/CamelCaseSeparatorNamingPolicy.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+/**
+ * Converts the field name that uses camel-case define word separation into separate words that
+ * are separated by the provided {@code separatorString}.
+ *
+ * <p>The following is an example:</p>
+ * <pre>
+ * class IntWrapper {
+ * public int integerField = 0;
+ * }
+ *
+ * CamelCaseSeparatorNamingPolicy policy = new CamelCaseSeparatorNamingPolicy("_");
+ * String translatedFieldName =
+ * policy.translateName(IntWrapper.class.getField("integerField"));
+ *
+ * assert("integer_Field".equals(translatedFieldName));
+ * </pre>
+ *
+ * @author Joel Leitch
+ */
+final class CamelCaseSeparatorNamingPolicy extends RecursiveFieldNamingPolicy {
+ private final String separatorString;
+
+ /**
+ * Constructs a new CamelCaseSeparatorNamingPolicy object that will add the
+ * {@code separatorString} between each of the words separated by camel case.
+ *
+ * @param separatorString the string value to place between words
+ * @throws IllegalArgumentException thrown if the {@code separatorString} parameter
+ * is null or purely whitespace.
+ */
+ public CamelCaseSeparatorNamingPolicy(String separatorString) {
+ Preconditions.checkNotNull(separatorString);
+ Preconditions.checkArgument(!"".equals(separatorString.trim()));
+ this.separatorString = separatorString;
+ }
+
+ @Override
+ protected String translateName(String target, Type fieldType, Annotation[] annnotations) {
+ StringBuilder translation = new StringBuilder();
+ for (int i = 0; i < target.length(); i++) {
+ char character = target.charAt(i);
+ if (Character.isUpperCase(character) && translation.length() != 0) {
+ translation.append(separatorString);
+ }
+ translation.append(character);
+ }
+
+ return translation.toString();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/CompositionFieldNamingPolicy.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/CompositionFieldNamingPolicy.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/CompositionFieldNamingPolicy.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+/**
+ * Performs numerous field naming translations wrapped up as one object.
+ *
+ * @author Joel Leitch
+ */
+abstract class CompositionFieldNamingPolicy extends RecursiveFieldNamingPolicy {
+
+ private final RecursiveFieldNamingPolicy[] fieldPolicies;
+
+ public CompositionFieldNamingPolicy(RecursiveFieldNamingPolicy... fieldNamingPolicies) {
+ if (fieldNamingPolicies == null) {
+ throw new NullPointerException("naming policies can not be null.");
+ }
+ this.fieldPolicies = fieldNamingPolicies;
+ }
+
+ @Override
+ protected String translateName(String target, Type fieldType, Annotation[] annotations) {
+ for (RecursiveFieldNamingPolicy policy : fieldPolicies) {
+ target = policy.translateName(target, fieldType, annotations);
+ }
+ return target;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/DefaultTypeAdapters.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/DefaultTypeAdapters.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/DefaultTypeAdapters.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,499 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Queue;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.StringTokenizer;
+import java.util.TreeSet;
+
+/**
+ * List of all the default type adapters ({@link JsonSerializer}s, {@link JsonDeserializer}s,
+ * and {@link InstanceCreator}s.
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ */
+final class DefaultTypeAdapters {
+
+ private static final DefaultDateTypeAdapter DATE_TYPE_ADAPTER =
+ new DefaultDateTypeAdapter(DateFormat.getDateTimeInstance());
+ @SuppressWarnings("unchecked")
+ private static final EnumTypeAdapter ENUM_TYPE_ADAPTER = new EnumTypeAdapter();
+ private static final UrlTypeAdapter URL_TYPE_ADAPTER = new UrlTypeAdapter();
+ private static final UriTypeAdapter URI_TYPE_ADAPTER = new UriTypeAdapter();
+ private static final LocaleTypeAdapter LOCALE_TYPE_ADAPTER = new LocaleTypeAdapter();
+ private static final MapTypeAdapter MAP_TYPE_ADAPTER = new MapTypeAdapter();
+ private static final BigDecimalTypeAdapter BIG_DECIMAL_TYPE_ADAPTER = new BigDecimalTypeAdapter();
+ private static final BigIntegerTypeAdapter BIG_INTEGER_TYPE_ADAPTER = new BigIntegerTypeAdapter();
+
+ private static final BooleanCreator BOOLEAN_CREATOR = new BooleanCreator();
+ private static final ByteCreator BYTE_CREATOR = new ByteCreator();
+ private static final CharacterCreator CHARACTER_CREATOR = new CharacterCreator();
+ private static final DoubleCreator DOUBLE_CREATOR = new DoubleCreator();
+ private static final FloatCreator FLOAT_CREATOR = new FloatCreator();
+ private static final IntegerCreator INTEGER_CREATOR = new IntegerCreator();
+ private static final LongCreator LONG_CREATOR = new LongCreator();
+ private static final ShortCreator SHORT_CREATOR = new ShortCreator();
+ private static final LinkedListCreator LINKED_LIST_CREATOR = new LinkedListCreator();
+ private static final TreeSetCreator TREE_SET_CREATOR = new TreeSetCreator();
+
+ // The constants DEFAULT_SERIALIZERS, DEFAULT_DESERIALIZERS, and DEFAULT_INSTANCE_CREATORS
+ // must be defined after the constants for the type adapters. Otherwise, the type adapter
+ // constants will appear as nulls.
+ static final ParameterizedTypeHandlerMap<JsonSerializer<?>> DEFAULT_SERIALIZERS =
+ getDefaultSerializers();
+ static final ParameterizedTypeHandlerMap<JsonDeserializer<?>> DEFAULT_DESERIALIZERS =
+ getDefaultDeserializers();
+ static final ParameterizedTypeHandlerMap<InstanceCreator<?>> DEFAULT_INSTANCE_CREATORS =
+ getDefaultInstanceCreators();
+
+ private static ParameterizedTypeHandlerMap<JsonSerializer<?>> getDefaultSerializers() {
+ ParameterizedTypeHandlerMap<JsonSerializer<?>> map =
+ new ParameterizedTypeHandlerMap<JsonSerializer<?>>();
+
+ map.register(Enum.class, wrapSerializer(ENUM_TYPE_ADAPTER));
+ map.register(URL.class, wrapSerializer(URL_TYPE_ADAPTER));
+ map.register(URI.class, wrapSerializer(URI_TYPE_ADAPTER));
+ map.register(Locale.class, wrapSerializer(LOCALE_TYPE_ADAPTER));
+ map.register(Map.class, wrapSerializer(MAP_TYPE_ADAPTER));
+ map.register(Date.class, wrapSerializer(DATE_TYPE_ADAPTER));
+ map.register(BigDecimal.class, wrapSerializer(BIG_DECIMAL_TYPE_ADAPTER));
+ map.register(BigInteger.class, wrapSerializer(BIG_INTEGER_TYPE_ADAPTER));
+ map.makeUnmodifiable();
+ return map;
+ }
+
+ private static ParameterizedTypeHandlerMap<JsonDeserializer<?>> getDefaultDeserializers() {
+ ParameterizedTypeHandlerMap<JsonDeserializer<?>> map =
+ new ParameterizedTypeHandlerMap<JsonDeserializer<?>>();
+ map.register(Enum.class, wrapDeserializer(ENUM_TYPE_ADAPTER));
+ map.register(URL.class, wrapDeserializer(URL_TYPE_ADAPTER));
+ map.register(URI.class, wrapDeserializer(URI_TYPE_ADAPTER));
+ map.register(Locale.class, wrapDeserializer(LOCALE_TYPE_ADAPTER));
+ map.register(Map.class, wrapDeserializer(MAP_TYPE_ADAPTER));
+ map.register(Date.class, wrapDeserializer(DATE_TYPE_ADAPTER));
+ map.register(BigDecimal.class, wrapDeserializer(BIG_DECIMAL_TYPE_ADAPTER));
+ map.register(BigInteger.class, wrapDeserializer(BIG_INTEGER_TYPE_ADAPTER));
+ map.makeUnmodifiable();
+ return map;
+ }
+
+ private static ParameterizedTypeHandlerMap<InstanceCreator<?>> getDefaultInstanceCreators() {
+ ParameterizedTypeHandlerMap<InstanceCreator<?>> map =
+ new ParameterizedTypeHandlerMap<InstanceCreator<?>>();
+ map.register(Enum.class, ENUM_TYPE_ADAPTER);
+ map.register(URL.class, URL_TYPE_ADAPTER);
+ map.register(Locale.class, LOCALE_TYPE_ADAPTER);
+ map.register(Map.class, MAP_TYPE_ADAPTER);
+ map.register(BigDecimal.class, BIG_DECIMAL_TYPE_ADAPTER);
+ map.register(BigInteger.class, BIG_INTEGER_TYPE_ADAPTER);
+
+ // Add primitive instance creators
+ map.register(Boolean.class, BOOLEAN_CREATOR);
+ map.register(boolean.class, BOOLEAN_CREATOR);
+ map.register(Byte.class, BYTE_CREATOR);
+ map.register(byte.class, BYTE_CREATOR);
+ map.register(Character.class, CHARACTER_CREATOR);
+ map.register(char.class, CHARACTER_CREATOR);
+ map.register(Double.class, DOUBLE_CREATOR);
+ map.register(double.class, DOUBLE_CREATOR);
+ map.register(Float.class, FLOAT_CREATOR);
+ map.register(float.class, FLOAT_CREATOR);
+ map.register(Integer.class, INTEGER_CREATOR);
+ map.register(int.class, INTEGER_CREATOR);
+ map.register(Long.class, LONG_CREATOR);
+ map.register(long.class, LONG_CREATOR);
+ map.register(Short.class, SHORT_CREATOR);
+ map.register(short.class, SHORT_CREATOR);
+
+ map.register(Collection.class, LINKED_LIST_CREATOR);
+ map.register(List.class, LINKED_LIST_CREATOR);
+ map.register(Queue.class, LINKED_LIST_CREATOR);
+
+ map.register(Set.class, TREE_SET_CREATOR);
+ map.register(SortedSet.class, TREE_SET_CREATOR);
+ map.makeUnmodifiable();
+ return map;
+ }
+
+ @SuppressWarnings("unchecked")
+ private static JsonSerializer<?> wrapSerializer(JsonSerializer<?> serializer) {
+ return new JsonSerializerExceptionWrapper(serializer);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static JsonDeserializer<?> wrapDeserializer(JsonDeserializer<?> deserializer) {
+ return new JsonDeserializerExceptionWrapper(deserializer);
+ }
+
+ static class DefaultDateTypeAdapter implements JsonSerializer<Date>, JsonDeserializer<Date> {
+
+ private final DateFormat format;
+
+ public DefaultDateTypeAdapter(String datePattern) {
+ this.format = new SimpleDateFormat(datePattern);
+ }
+
+ DefaultDateTypeAdapter(DateFormat format) {
+ this.format = format;
+ }
+
+ public DefaultDateTypeAdapter(int style) {
+ this.format = DateFormat.getDateInstance(style);
+ }
+
+ public DefaultDateTypeAdapter(int dateStyle, int timeStyle) {
+ this.format = DateFormat.getDateTimeInstance(dateStyle, timeStyle);
+ }
+
+ public JsonElement serialize(Date src, Type typeOfSrc, JsonSerializationContext context) {
+ String dateFormatAsString = format.format(src);
+ return new JsonPrimitive(dateFormatAsString);
+ }
+
+ public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
+ throws JsonParseException {
+ if (!(json instanceof JsonPrimitive)) {
+ throw new JsonParseException("The date should be a string value");
+ }
+
+ try {
+ return format.parse(json.getAsString());
+ } catch (ParseException e) {
+ throw new JsonParseException(e);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(DefaultDateTypeAdapter.class.getSimpleName());
+ sb.append('(').append(format.getClass().getSimpleName()).append(')');
+ return sb.toString();
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private static class EnumTypeAdapter<T extends Enum<T>> implements JsonSerializer<T>,
+ JsonDeserializer<T>, InstanceCreator<Enum<?>> {
+ public JsonElement serialize(T src, Type typeOfSrc, JsonSerializationContext context) {
+ return new JsonPrimitive(src.name());
+ }
+ @SuppressWarnings("cast")
+ public T deserialize(JsonElement json, Type classOfT, JsonDeserializationContext context)
+ throws JsonParseException {
+ return (T) Enum.valueOf((Class<T>)classOfT, json.getAsString());
+ }
+ public Enum<?> createInstance(Type type) {
+ Class<Enum<?>> enumClass = (Class<Enum<?>>) type;
+ try {
+ Method valuesMethod = enumClass.getMethod("values");
+ Enum<?>[] enums = (Enum<?>[]) valuesMethod.invoke(null);
+ return enums[0];
+ } catch (NoSuchMethodException e) {
+ throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ } catch (InvocationTargetException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ @Override
+ public String toString() {
+ return EnumTypeAdapter.class.getSimpleName();
+ }
+ }
+
+ private static class UrlTypeAdapter implements JsonSerializer<URL>, JsonDeserializer<URL>,
+ InstanceCreator<URL> {
+ public JsonElement serialize(URL src, Type typeOfSrc, JsonSerializationContext context) {
+ return new JsonPrimitive(src.toExternalForm());
+ }
+ public URL deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
+ throws JsonParseException {
+ try {
+ return new URL(json.getAsString());
+ } catch (MalformedURLException e) {
+ throw new JsonParseException(e);
+ }
+ }
+ public URL createInstance(Type type) {
+ try {
+ return new URL("http://google.com/");
+ } catch (MalformedURLException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ @Override
+ public String toString() {
+ return UrlTypeAdapter.class.getSimpleName();
+ }
+ }
+
+ private static class UriTypeAdapter implements JsonSerializer<URI>, JsonDeserializer<URI> {
+ public JsonElement serialize(URI src, Type typeOfSrc, JsonSerializationContext context) {
+ return new JsonPrimitive(src.toASCIIString());
+ }
+ public URI deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
+ throws JsonParseException {
+ try {
+ return new URI(json.getAsString());
+ } catch (URISyntaxException e) {
+ throw new JsonParseException(e);
+ }
+ }
+ @Override
+ public String toString() {
+ return UriTypeAdapter.class.getSimpleName();
+ }
+ }
+
+ private static class LocaleTypeAdapter implements JsonSerializer<Locale>,
+ JsonDeserializer<Locale>, InstanceCreator<Locale> {
+ public JsonElement serialize(Locale src, Type typeOfSrc, JsonSerializationContext context) {
+ return new JsonPrimitive(src.toString());
+ }
+ public Locale deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
+ throws JsonParseException {
+ String locale = json.getAsString();
+ StringTokenizer tokenizer = new StringTokenizer(locale, "_");
+ String language = null;
+ String country = null;
+ String variant = null;
+ if (tokenizer.hasMoreElements()) {
+ language = tokenizer.nextToken();
+ }
+ if (tokenizer.hasMoreElements()) {
+ country = tokenizer.nextToken();
+ }
+ if (tokenizer.hasMoreElements()) {
+ variant = tokenizer.nextToken();
+ }
+ if (country == null && variant == null) {
+ return new Locale(language);
+ } else if (variant == null) {
+ return new Locale(language, country);
+ } else {
+ return new Locale(language, country, variant);
+ }
+ }
+ public Locale createInstance(Type type) {
+ return new Locale("en_US");
+ }
+ @Override
+ public String toString() {
+ return LocaleTypeAdapter.class.getSimpleName();
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ static class MapTypeAdapter implements JsonSerializer<Map>, JsonDeserializer<Map>,
+ InstanceCreator<Map> {
+ public JsonElement serialize(Map src, Type typeOfSrc, JsonSerializationContext context) {
+ JsonObject map = new JsonObject();
+ Type childType = new TypeInfoMap(typeOfSrc).getValueType();
+ for (Iterator iterator = src.entrySet().iterator(); iterator.hasNext(); ) {
+ Map.Entry entry = (Map.Entry) iterator.next();
+ JsonElement valueElement = context.serialize(entry.getValue(), childType);
+ map.add(entry.getKey().toString(), valueElement);
+ }
+ return map;
+ }
+ public Map deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
+ throws JsonParseException {
+ // Using linked hash map to preserve order in which elements are entered
+ Map<String, Object> map = new LinkedHashMap<String, Object>();
+ Type childType = new TypeInfoMap(typeOfT).getValueType();
+ for (Map.Entry<String, JsonElement> entry : json.getAsJsonObject().entrySet()) {
+ Object value = context.deserialize(entry.getValue(), childType);
+ map.put(entry.getKey(), value);
+ }
+ return map;
+ }
+ public Map createInstance(Type type) {
+ return new LinkedHashMap();
+ }
+ @Override
+ public String toString() {
+ return MapTypeAdapter.class.getSimpleName();
+ }
+ }
+
+ private static class BigDecimalTypeAdapter implements JsonSerializer<BigDecimal>,
+ JsonDeserializer<BigDecimal>, InstanceCreator<BigDecimal> {
+
+ public JsonElement serialize(BigDecimal src, Type typeOfSrc, JsonSerializationContext context) {
+ return new JsonPrimitive(src);
+ }
+
+ public BigDecimal deserialize(JsonElement json, Type typeOfT,
+ JsonDeserializationContext context) throws JsonParseException {
+ return json.getAsBigDecimal();
+ }
+
+ public BigDecimal createInstance(Type type) {
+ return new BigDecimal(0);
+ }
+ @Override
+ public String toString() {
+ return BigDecimalTypeAdapter.class.getSimpleName();
+ }
+ }
+
+ private static class BigIntegerTypeAdapter implements JsonSerializer<BigInteger>,
+ JsonDeserializer<BigInteger>, InstanceCreator<BigInteger> {
+
+ public JsonElement serialize(BigInteger src, Type typeOfSrc, JsonSerializationContext context) {
+ return new JsonPrimitive(src);
+ }
+
+ public BigInteger deserialize(JsonElement json, Type typeOfT,
+ JsonDeserializationContext context) throws JsonParseException {
+ return json.getAsBigInteger();
+ }
+
+ public BigInteger createInstance(Type type) {
+ return new BigInteger("0");
+ }
+ @Override
+ public String toString() {
+ return BigIntegerTypeAdapter.class.getSimpleName();
+ }
+ }
+
+ private static class LongCreator implements InstanceCreator<Long> {
+ public Long createInstance(Type type) {
+ return new Long(0L);
+ }
+ @Override
+ public String toString() {
+ return LongCreator.class.getSimpleName();
+ }
+ }
+
+ private static class IntegerCreator implements InstanceCreator<Integer> {
+ public Integer createInstance(Type type) {
+ return new Integer(0);
+ }
+ @Override
+ public String toString() {
+ return IntegerCreator.class.getSimpleName();
+ }
+ }
+
+ private static class ShortCreator implements InstanceCreator<Short> {
+ public Short createInstance(Type type) {
+ return new Short((short) 0);
+ }
+ @Override
+ public String toString() {
+ return ShortCreator.class.getSimpleName();
+ }
+ }
+
+ private static class ByteCreator implements InstanceCreator<Byte> {
+ public Byte createInstance(Type type) {
+ return new Byte((byte) 0);
+ }
+ @Override
+ public String toString() {
+ return ByteCreator.class.getSimpleName();
+ }
+ }
+
+ private static class FloatCreator implements InstanceCreator<Float> {
+ public Float createInstance(Type type) {
+ return new Float(0F);
+ }
+ @Override
+ public String toString() {
+ return FloatCreator.class.getSimpleName();
+ }
+ }
+
+ private static class DoubleCreator implements InstanceCreator<Double> {
+ public Double createInstance(Type type) {
+ return new Double(0D);
+ }
+ @Override
+ public String toString() {
+ return DoubleCreator.class.getSimpleName();
+ }
+ }
+
+ private static class CharacterCreator implements InstanceCreator<Character> {
+ public Character createInstance(Type type) {
+ return new Character((char) 0);
+ }
+ @Override
+ public String toString() {
+ return CharacterCreator.class.getSimpleName();
+ }
+ }
+
+ private static class BooleanCreator implements InstanceCreator<Boolean> {
+ public Boolean createInstance(Type type) {
+ return new Boolean(false);
+ }
+ @Override
+ public String toString() {
+ return BooleanCreator.class.getSimpleName();
+ }
+ }
+
+ private static class LinkedListCreator implements InstanceCreator<LinkedList<?>> {
+ public LinkedList<?> createInstance(Type type) {
+ return new LinkedList<Object>();
+ }
+ @Override
+ public String toString() {
+ return LinkedListCreator.class.getSimpleName();
+ }
+ }
+
+ private static class TreeSetCreator implements InstanceCreator<TreeSet<?>> {
+ public TreeSet<?> createInstance(Type type) {
+ return new TreeSet<Object>();
+ }
+ @Override
+ public String toString() {
+ return TreeSetCreator.class.getSimpleName();
+ }
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/DelegatingJsonElementVisitor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/DelegatingJsonElementVisitor.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/DelegatingJsonElementVisitor.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+/**
+ * A simple implementation of the {@link JsonElementVisitor} that simply delegates the method
+ * invocation onto a {@code delegate} instance of the {@link JsonElementVisitor}. This object
+ * can be used to build a chain of visitors such that each Visitor instance can perform some
+ * operation on the {@link JsonElement} and then pass on the input to the delegate. This kind
+ * of pattern is sometimes referred as a "Chain of Responsibility".
+ *
+ * <p>The following is an example use case:
+ *
+ * <pre>
+ * class JsonEscapingVisitor extends DelegatingJsonElementVisitor {
+ * public JsonEscapingVisitor(JsonElementVisitor) {
+ * super(visitor);
+ * }
+ *
+ * public void visitPrimitive(JsonPrimitive primitive) {
+ * JsonPrimitive escapedPrimitive = escapePrimitiveObject(primitive);
+ * super.visitPrimitive(escapedPrimitive);
+ * }
+ * }
+ *
+ * JsonElementVisitor visitor = new JsonEscapingVisitor(new FormattingVisitor());
+ * </pre></p>
+ *
+ * @author Joel Leitch
+ */
+class DelegatingJsonElementVisitor implements JsonElementVisitor {
+ private final JsonElementVisitor delegate;
+
+ protected DelegatingJsonElementVisitor(JsonElementVisitor delegate) {
+ Preconditions.checkNotNull(delegate);
+ this.delegate = delegate;
+ }
+
+ public void endArray(JsonArray array) {
+ delegate.endArray(array);
+ }
+
+ public void endObject(JsonObject object) {
+ delegate.endObject(object);
+ }
+
+ public void startArray(JsonArray array) {
+ delegate.startArray(array);
+ }
+
+ public void startObject(JsonObject object) {
+ delegate.startObject(object);
+ }
+
+ public void visitArrayMember(JsonArray parent, JsonPrimitive member, boolean isFirst) {
+ delegate.visitArrayMember(parent, member, isFirst);
+ }
+
+ public void visitArrayMember(JsonArray parent, JsonArray member, boolean isFirst) {
+ delegate.visitArrayMember(parent, member, isFirst);
+ }
+
+ public void visitArrayMember(JsonArray parent, JsonObject member, boolean isFirst) {
+ delegate.visitArrayMember(parent, member, isFirst);
+ }
+
+ public void visitObjectMember(
+ JsonObject parent, String memberName, JsonPrimitive member, boolean isFirst) {
+ delegate.visitObjectMember(parent, memberName, member, isFirst);
+ }
+
+ public void visitObjectMember(
+ JsonObject parent, String memberName, JsonArray member, boolean isFirst) {
+ delegate.visitObjectMember(parent, memberName, member, isFirst);
+ }
+
+ public void visitObjectMember(
+ JsonObject parent, String memberName, JsonObject member, boolean isFirst) {
+ delegate.visitObjectMember(parent, memberName, member, isFirst);
+ }
+
+ public void visitNullObjectMember(JsonObject parent, String memberName, boolean isFirst) {
+ delegate.visitNullObjectMember(parent, memberName, isFirst);
+ }
+
+ public void visitPrimitive(JsonPrimitive primitive) {
+ delegate.visitPrimitive(primitive);
+ }
+
+ public void visitNull() {
+ delegate.visitNull();
+ }
+
+ public void visitNullArrayMember(JsonArray parent, boolean isFirst) {
+ delegate.visitNullArrayMember(parent, isFirst);
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/DisjunctionExclusionStrategy.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/DisjunctionExclusionStrategy.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/DisjunctionExclusionStrategy.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Field;
+import java.util.Collection;
+import java.util.LinkedList;
+
+/**
+ * A wrapper class used to collect numerous {@link ExclusionStrategy} objects
+ * and perform a short-circuited OR operation.
+ *
+ * @author Joel Leitch
+ */
+final class DisjunctionExclusionStrategy implements ExclusionStrategy {
+ private final Collection<ExclusionStrategy> strategies;
+
+ public DisjunctionExclusionStrategy(ExclusionStrategy... strategies) {
+ Preconditions.checkNotNull(strategies);
+ Preconditions.checkArgument(strategies.length > 0);
+
+ this.strategies = new LinkedList<ExclusionStrategy>();
+ for (ExclusionStrategy strategy : strategies) {
+ this.strategies.add(strategy);
+ }
+ }
+
+ public DisjunctionExclusionStrategy(Collection<ExclusionStrategy> strategies) {
+ Preconditions.checkNotNull(strategies);
+ Preconditions.checkArgument(!strategies.isEmpty());
+
+ this.strategies = new LinkedList<ExclusionStrategy>();
+ this.strategies.addAll(strategies);
+ }
+
+ public boolean shouldSkipField(Field f) {
+ for (ExclusionStrategy strategy : strategies) {
+ if (strategy.shouldSkipField(f)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean shouldSkipClass(Class<?> clazz) {
+ for (ExclusionStrategy strategy : strategies) {
+ if (strategy.shouldSkipClass(clazz)) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/Escaper.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/Escaper.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/Escaper.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,146 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * A utility class that is used to perform JSON escaping so that ", <, >, etc. characters are
+ * properly encoded in the JSON string representation before returning to the client code.
+ *
+ * <p>This class contains a single method to escape a passed in string value:
+ * <pre>
+ * String jsonStringValue = "beforeQuote\"afterQuote";
+ * String escapedValue = Escaper.escapeJsonString(jsonStringValue);
+ * </pre></p>
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ */
+class Escaper {
+
+ static final char[] HEX_CHARS = {
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
+ };
+
+ private static final Set<Character> JS_ESCAPE_CHARS;
+
+ static {
+ Set<Character> tmpSet = new HashSet<Character>();
+ tmpSet.add('\u0000');
+ tmpSet.add('\r');
+ tmpSet.add('\n');
+ tmpSet.add('\u2028');
+ tmpSet.add('\u2029');
+ tmpSet.add('\u0085');
+ tmpSet.add('\'');
+ tmpSet.add('"');
+ tmpSet.add('<');
+ tmpSet.add('>');
+ tmpSet.add('&');
+ tmpSet.add('=');
+ tmpSet.add('\\');
+ JS_ESCAPE_CHARS = Collections.unmodifiableSet(tmpSet);
+ }
+
+ public static String escapeJsonString(CharSequence plainText) {
+ StringBuffer escapedString = new StringBuffer(plainText.length() + 20);
+ try {
+ escapeJsonString(plainText, escapedString);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ return escapedString.toString();
+ }
+
+ private static void escapeJsonString(CharSequence plainText, StringBuffer out) throws IOException {
+ int pos = 0; // Index just past the last char in plainText written to out.
+ int len = plainText.length();
+ for (int charCount, i = 0; i < len; i += charCount) {
+ int codePoint = Character.codePointAt(plainText, i);
+ charCount = Character.charCount(codePoint);
+
+ if (!((codePoint < 0x20 || codePoint >= 0x7f)
+ || mustEscapeCharInJsString(codePoint))) {
+ continue;
+ }
+
+ out.append(plainText, pos, i);
+ pos = i + charCount;
+ switch (codePoint) {
+ case '\b':
+ out.append("\\b");
+ break;
+ case '\t':
+ out.append("\\t");
+ break;
+ case '\n':
+ out.append("\\n");
+ break;
+ case '\f':
+ out.append("\\f");
+ break;
+ case '\r':
+ out.append("\\r");
+ break;
+ case '\\':
+ out.append("\\\\");
+ break;
+ case '"':
+ out.append('\\').append((char) codePoint);
+ break;
+ case '\'':
+ out.append((char) codePoint);
+ break;
+ default:
+ appendHexJavaScriptRepresentation(codePoint, out);
+ break;
+ }
+ }
+ out.append(plainText, pos, len);
+ }
+
+ private static void appendHexJavaScriptRepresentation(int codePoint, Appendable out)
+ throws IOException {
+ if (Character.isSupplementaryCodePoint(codePoint)) {
+ // Handle supplementary unicode values which are not representable in
+ // javascript. We deal with these by escaping them as two 4B sequences
+ // so that they will round-trip properly when sent from java to javascript
+ // and back.
+ char[] surrogates = Character.toChars(codePoint);
+ appendHexJavaScriptRepresentation(surrogates[0], out);
+ appendHexJavaScriptRepresentation(surrogates[1], out);
+ return;
+ }
+ out.append("\\u")
+ .append(HEX_CHARS[(codePoint >>> 12) & 0xf])
+ .append(HEX_CHARS[(codePoint >>> 8) & 0xf])
+ .append(HEX_CHARS[(codePoint >>> 4) & 0xf])
+ .append(HEX_CHARS[codePoint & 0xf]);
+ }
+
+ private static boolean mustEscapeCharInJsString(int codepoint) {
+ if (!Character.isSupplementaryCodePoint(codepoint)) {
+ return JS_ESCAPE_CHARS.contains((char)codepoint);
+ } else {
+ return false;
+ }
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/ExclusionStrategy.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/ExclusionStrategy.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/ExclusionStrategy.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Field;
+
+/**
+ * A strategy definition that is used by the {@link ObjectNavigator} to
+ * determine whether or not the field of the object should be ignored during
+ * navigation.
+ *
+ * As well, for now this class is also responsible for excluding entire
+ * classes. This is somewhat a mixing of concerns for this object, but
+ * it will suffice for now. We can always break it down into two
+ * different strategies later.
+ *
+ * @author Joel Leitch
+ */
+interface ExclusionStrategy {
+
+ /**
+ * @param f the field object that is under test
+ * @return true if the field should be ignored otherwise false
+ */
+ public boolean shouldSkipField(Field f);
+
+ /**
+ * @param clazz the class object that is under test
+ * @return true if the class should be ignored otherwise false
+ */
+ public boolean shouldSkipClass(Class<?> clazz);
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/ExposeAnnotationBasedExclusionStrategy.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/ExposeAnnotationBasedExclusionStrategy.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/ExposeAnnotationBasedExclusionStrategy.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import com.google.gson.annotations.Expose;
+
+import java.lang.reflect.Field;
+
+/**
+ * Excludes fields that do not have the {@link Expose} annotation
+ *
+ * @author Inderjeet Singh
+ */
+class ExposeAnnotationBasedExclusionStrategy implements ExclusionStrategy {
+
+ public boolean shouldSkipClass(Class<?> clazz) {
+ return false;
+ }
+
+ public boolean shouldSkipField(Field f) {
+ return f.getAnnotation(Expose.class) == null;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/FieldNamingPolicy.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/FieldNamingPolicy.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/FieldNamingPolicy.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+/**
+ * An enumeration that defines a few standard naming conventions for JSON field names.
+ * This enumeration should be used in conjunction with {@link com.google.gson.GsonBuilder}
+ * to configure a {@link com.google.gson.Gson} instance to properly translate Java field
+ * names into the desired JSON field names.
+ *
+ * @author Joel Leitch
+ */
+public enum FieldNamingPolicy {
+ /**
+ * Using this naming policy with Gson will ensure that the first "letter" of the Java
+ * field name is capitalized when serialized to its JSON form.
+ *
+ * <p>Here's a few examples of the form "Java Field Name" ---> "JSON Field Name":</p>
+ * <ul>
+ * <li>someFieldName ---> SomeFieldName</li>
+ * <li>_someFieldName ---> _SomeFieldName</li>
+ * </ul>
+ */
+ UPPER_CAMEL_CASE(new ModifyFirstLetterNamingPolicy(
+ ModifyFirstLetterNamingPolicy.LetterModifier.UPPER)),
+
+ /**
+ * Using this naming policy with Gson will modify the Java Field name from its camel cased
+ * form to a lower case field name where each word is separated by an underscore (_).
+ *
+ * <p>Here's a few examples of the form "Java Field Name" ---> "JSON Field Name":</p>
+ * <ul>
+ * <li>someFieldName ---> some_field_name</li>
+ * <li>_someFieldName ---> _some_field_name</li>
+ * <li>aStringField ---> a_string_field</li>
+ * <li>aURL ---> a_u_r_l</li>
+ * </ul>
+ */
+ LOWER_CASE_WITH_UNDERSCORES(new LowerCamelCaseSeparatorNamingPolicy("_"));
+
+ private final FieldNamingStrategy namingPolicy;
+
+ private FieldNamingPolicy(FieldNamingStrategy namingPolicy) {
+ this.namingPolicy = namingPolicy;
+ }
+
+ FieldNamingStrategy getFieldNamingPolicy() {
+ return namingPolicy;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/FieldNamingStrategy.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/FieldNamingStrategy.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/FieldNamingStrategy.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Field;
+
+/**
+ * A mechanism for providing custom field naming in Gson. This allows the client code to translate
+ * field names into a particular convention that is not supported as a normal Java field
+ * declaration rules. For example, Java does not support "-" characters in a field name.
+ *
+ * @author Joel Leitch
+ */
+interface FieldNamingStrategy {
+
+ /**
+ * Translates the field name into its JSON field name representation.
+ *
+ * @param f the field object that we are translating
+ * @return the translated field name.
+ */
+ public String translateName(Field f);
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/GenericArrayTypeImpl.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/GenericArrayTypeImpl.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/GenericArrayTypeImpl.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.GenericArrayType;
+import java.lang.reflect.Type;
+
+/**
+ * An simple pojo-like immutable instance of the {@link GenericArrayType}. This object provides
+ * us the ability to create reflective types on demand. This object is required for support
+ * object similar to the one defined below:
+ * <pre>
+ * class Foo<T> {
+ * private final List<T>[] arrayOfListT;
+ *
+ * Foo(List<T>[] arrayList) {
+ * this.arrayOfListT = arrayList;
+ * }
+ * }
+ * </pre>
+ *
+ * <p>During parsing or serialization, we know the real variable type parameter {@code T},
+ * so we can build a new {@code GenericTypeArray} with the "real" type parameters and
+ * pass that object along instead.
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ */
+final class GenericArrayTypeImpl implements GenericArrayType {
+
+ private final Type genericComponentType;
+
+ public GenericArrayTypeImpl(Type genericComponentType) {
+ this.genericComponentType = genericComponentType;
+ }
+
+ public Type getGenericComponentType() {
+ return genericComponentType;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (!(o instanceof GenericArrayType)) {
+ return false;
+ } else {
+ GenericArrayType that = (GenericArrayType) o;
+ Type thatComponentType = that.getGenericComponentType();
+ return genericComponentType == null ?
+ thatComponentType == null : genericComponentType.equals(thatComponentType);
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ return (genericComponentType == null) ? 0 : genericComponentType.hashCode();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/Gson.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/Gson.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/Gson.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,419 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.lang.reflect.Modifier;
+import java.lang.reflect.Type;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Logger;
+
+/**
+ * This is the main class for using Gson. Gson is typically used by first constructing a
+ * Gson instance and then invoking {@link #toJson(Object)} or {@link #fromJson(String, Class)}
+ * methods on it.
+ *
+ * <p>You can create a Gson instance by invoking {@code new Gson()} if the default configuration
+ * is all you need. You can also use {@link GsonBuilder} to build a Gson instance with various
+ * configuration options such as versioning support, pretty printing, custom
+ * {@link JsonSerializer}s, {@link JsonDeserializer}s, and {@link InstanceCreator}s.</p>
+ *
+ * <p>Here is an example of how Gson is used for a simple Class:
+ *
+ * <pre>
+ * Gson gson = new Gson(); // Or use new GsonBuilder().create();
+ * MyType target = new MyType();
+ * String json = gson.toJson(target); // serializes target to Json
+ * MyType target2 = gson.fromJson(json, MyType.class); // deserializes json into target2
+ * </pre></p>
+ *
+ * <p>If the object that your are serializing/deserializing is a {@code ParameterizedType}
+ * (i.e. contains at least one type parameter and may be an array) then you must use the
+ * {@link #toJson(Object, Type)} or {@link #fromJson(String, Type)} method. Here is an
+ * example for serializing and deserialing a {@code ParameterizedType}:
+ *
+ * <pre>
+ * Type listType = new TypeToken<List<String>>() {}.getType();
+ * List<String> target = new LinkedList<String>();
+ * target.add("blah");
+ *
+ * Gson gson = new Gson();
+ * String json = gson.toJson(target, listType);
+ * List<String> target2 = gson.fromJson(json, listType);
+ * </pre></p>
+ *
+ * <p>See the <a href="https://sites.google.com/site/gson/gson-user-guide">Gson User Guide</a>
+ * for a more complete set of examples.</p>
+ *
+ * @see com.google.gson.reflect.TypeToken
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ */
+public final class Gson {
+
+ //TODO(inder): get rid of all the registerXXX methods and take all such parameters in the
+ // constructor instead. At the minimum, mark those methods private.
+
+ private static final String NULL_STRING = "null";
+ // Default instances of plug-ins
+ static final TypeAdapter DEFAULT_TYPE_ADAPTER =
+ new TypeAdapterNotRequired(new PrimitiveTypeAdapter());
+ static final ModifierBasedExclusionStrategy DEFAULT_MODIFIER_BASED_EXCLUSION_STRATEGY =
+ new ModifierBasedExclusionStrategy(true, new int[] { Modifier.TRANSIENT, Modifier.STATIC });
+ static final JsonFormatter DEFAULT_JSON_FORMATTER = new JsonCompactFormatter();
+ static final FieldNamingStrategy DEFAULT_NAMING_POLICY =
+ new SerializedNameAnnotationInterceptingNamingPolicy(new JavaFieldNamingPolicy());
+
+ static final Logger logger = Logger.getLogger(Gson.class.getName());
+
+ private final ObjectNavigatorFactory navigatorFactory;
+ private final MappedObjectConstructor objectConstructor;
+ private final TypeAdapter typeAdapter;
+
+ /** Map containing Type or Class objects as keys */
+ private final ParameterizedTypeHandlerMap<JsonSerializer<?>> serializers;
+
+ /** Map containing Type or Class objects as keys */
+ private final ParameterizedTypeHandlerMap<JsonDeserializer<?>> deserializers;
+
+ private final JsonFormatter formatter;
+ private final boolean serializeNulls;
+
+ /**
+ * Constructs a Gson object with default configuration. The default configuration has the
+ * following settings:
+ * <ul>
+ * <li>The JSON generated by <code>toJson</code> methods is in compact representation. This
+ * means that all the unneeded white-space is removed. You can change this behavior with
+ * {@link GsonBuilder#setPrettyPrinting()}. </li>
+ * <li>The generated JSON omits all the fields that are null. Note that nulls in arrays are
+ * kept as is since an array is an ordered list. Moreover, if a field is not null, but its
+ * generated JSON is empty, the field is kept. You can configure Gson to serialize null values
+ * by setting {@link GsonBuilder#serializeNulls()}.</li>
+ * <li>Gson provides default serialization and deserialization for Enums, {@link Map},
+ * {@link java.net.URL}, {@link java.net.URI}, {@link java.util.Locale}, {@link java.util.Date},
+ * {@link java.math.BigDecimal}, and {@link java.math.BigInteger} classes. If you would prefer
+ * to change the default representation, you can do so by registering a type adapter through
+ * {@link GsonBuilder#registerTypeAdapter(Type, Object)}. </li>
+ * <li>The default Date format is same as {@link java.text.DateFormat#DEFAULT}. This format
+ * ignores the millisecond portion of the date during serialization. You can change
+ * this by invoking {@link GsonBuilder#setDateFormat(int)} or
+ * {@link GsonBuilder#setDateFormat(String)}. </li>
+ * <li>By default, Gson ignores the {@link com.google.gson.annotations.Expose} annotation.
+ * You can enable Gson to serialize/deserialize only those fields marked with this annotation
+ * through {@link GsonBuilder#excludeFieldsWithoutExposeAnnotation()}. </li>
+ * <li>By default, Gson ignores the {@link com.google.gson.annotations.Since} annotation. You
+ * can enable Gson to use this annotation through {@link GsonBuilder#setVersion(double)}.</li>
+ * <li>The default field naming policy for the output Json is same as in Java. So, a Java class
+ * field <code>versionNumber</code> will be output as <code>"versionNumber at quot;</code> in
+ * Json. The same rules are applied for mapping incoming Json to the Java classes. You can
+ * change this policy through {@link GsonBuilder#setFieldNamingPolicy(FieldNamingPolicy)}.</li>
+ * <li>By default, Gson excludes <code>transient</code> or <code>static</code> fields from
+ * consideration for serialization and deserialization. You can change this behavior through
+ * {@link GsonBuilder#excludeFieldsWithModifiers(int...)}.</li>
+ * </ul>
+ */
+ public Gson() {
+ this(createDefaultObjectNavigatorFactory());
+ }
+
+ /**
+ * Constructs a Gson object with the specified version and the mode of operation while
+ * encountering inner class references.
+ *
+ * @param factory the object navigator factory to use when creating a new {@link ObjectNavigator}
+ * instance
+ */
+ Gson(ObjectNavigatorFactory factory) {
+ this(factory, createObjectConstructor(DefaultTypeAdapters.DEFAULT_INSTANCE_CREATORS),
+ DEFAULT_TYPE_ADAPTER, DEFAULT_JSON_FORMATTER, false,
+ DefaultTypeAdapters.DEFAULT_SERIALIZERS, DefaultTypeAdapters.DEFAULT_DESERIALIZERS);
+ }
+
+ Gson(ObjectNavigatorFactory factory, MappedObjectConstructor objectConstructor,
+ TypeAdapter typeAdapter, JsonFormatter formatter, boolean serializeNulls,
+ ParameterizedTypeHandlerMap<JsonSerializer<?>> serializers,
+ ParameterizedTypeHandlerMap<JsonDeserializer<?>> deserializers) {
+ this.navigatorFactory = factory;
+ this.objectConstructor = objectConstructor;
+ this.typeAdapter = typeAdapter;
+ this.formatter = formatter;
+ this.serializeNulls = serializeNulls;
+ this.serializers = serializers;
+ this.deserializers = deserializers;
+ }
+
+ static MappedObjectConstructor createObjectConstructor(
+ ParameterizedTypeHandlerMap<InstanceCreator<?>> instanceCreators) {
+ MappedObjectConstructor objectConstructor = new MappedObjectConstructor();
+ for (Map.Entry<Type, InstanceCreator<?>> entry : instanceCreators.entrySet()) {
+ objectConstructor.register(entry.getKey(), entry.getValue());
+ }
+ return objectConstructor;
+ }
+
+ private static ObjectNavigatorFactory createDefaultObjectNavigatorFactory() {
+ return new ObjectNavigatorFactory(
+ createExclusionStrategy(VersionConstants.IGNORE_VERSIONS), DEFAULT_NAMING_POLICY);
+ }
+
+ private static ExclusionStrategy createExclusionStrategy(double version) {
+ List<ExclusionStrategy> strategies = new LinkedList<ExclusionStrategy>();
+ strategies.add(new InnerClassExclusionStrategy());
+ strategies.add(DEFAULT_MODIFIER_BASED_EXCLUSION_STRATEGY);
+ if (version != VersionConstants.IGNORE_VERSIONS) {
+ strategies.add(new VersionExclusionStrategy(version));
+ }
+ return new DisjunctionExclusionStrategy(strategies);
+ }
+
+ /**
+ * This method serializes the specified object into its equivalent Json representation.
+ * This method should be used when the specified object is not a generic type. This method uses
+ * {@link Class#getClass()} to get the type for the specified object, but the
+ * {@code getClass()} loses the generic type information because of the Type Erasure feature
+ * of Java. Note that this method works fine if the any of the object fields are of generic type,
+ * just the object itself should not be of a generic type. If the object is of generic type, use
+ * {@link #toJson(Object, Type)} instead. If you want to write out the object to a
+ * {@link Writer}, use {@link #toJson(Object, Writer)} instead.
+ *
+ * @param src the object for which Json representation is to be created setting for Gson
+ * @return Json representation of {@code src}.
+ */
+ public String toJson(Object src) {
+ if (src == null) {
+ return serializeNulls ? NULL_STRING : "";
+ }
+ return toJson(src, src.getClass());
+ }
+
+ /**
+ * This method serializes the specified object, including those of generic types, into its
+ * equivalent Json representation. This method must be used if the specified object is a generic
+ * type. For non-generic objects, use {@link #toJson(Object)} instead. If you want to write out
+ * the object to a {@link Writer}, use {@link #toJson(Object, Type, Writer)} instead.
+ *
+ * @param src the object for which JSON representation is to be created
+ * @param typeOfSrc The specific genericized type of src. You can obtain
+ * this type by using the {@link com.google.gson.reflect.TypeToken} class. For example,
+ * to get the type for {@code Collection<Foo>}, you should use:
+ * <pre>
+ * Type typeOfSrc = new TypeToken<Collection<Foo>>(){}.getType();
+ * </pre>
+ * @return Json representation of {@code src}
+ */
+ public String toJson(Object src, Type typeOfSrc) {
+ StringWriter writer = new StringWriter();
+ toJson(src, typeOfSrc, writer);
+ return writer.toString();
+ }
+
+ /**
+ * This method serializes the specified object into its equivalent Json representation.
+ * This method should be used when the specified object is not a generic type. This method uses
+ * {@link Class#getClass()} to get the type for the specified object, but the
+ * {@code getClass()} loses the generic type information because of the Type Erasure feature
+ * of Java. Note that this method works fine if the any of the object fields are of generic type,
+ * just the object itself should not be of a generic type. If the object is of generic type, use
+ * {@link #toJson(Object, Type, Writer)} instead.
+ *
+ * @param src the object for which Json representation is to be created setting for Gson
+ * @param writer Writer to which the Json representation needs to be written
+ * @since 1.2
+ */
+ public void toJson(Object src, Writer writer) {
+ if (src != null) {
+ toJson(src, src.getClass(), writer);
+ } else if (serializeNulls) {
+ writeOutNullString(writer);
+ }
+ }
+
+ /**
+ * This method serializes the specified object, including those of generic types, into its
+ * equivalent Json representation. This method must be used if the specified object is a generic
+ * type. For non-generic objects, use {@link #toJson(Object, Writer)} instead.
+ *
+ * @param src the object for which JSON representation is to be created
+ * @param typeOfSrc The specific genericized type of src. You can obtain
+ * this type by using the {@link com.google.gson.reflect.TypeToken} class. For example,
+ * to get the type for {@code Collection<Foo>}, you should use:
+ * <pre>
+ * Type typeOfSrc = new TypeToken<Collection<Foo>>(){}.getType();
+ * </pre>
+ * @param writer Writer to which the Json representation of src needs to be written.
+ * @since 1.2
+ */
+ public void toJson(Object src, Type typeOfSrc, Writer writer) {
+ if (src != null) {
+ JsonSerializationContext context =
+ new JsonSerializationContextDefault(navigatorFactory, serializeNulls, serializers);
+ JsonElement jsonElement = context.serialize(src, typeOfSrc);
+
+ //TODO(Joel): instead of navigating the "JsonElement" inside the formatter, do it here.
+ formatter.format(jsonElement, new PrintWriter(writer), serializeNulls);
+ } else {
+ if (serializeNulls) {
+ writeOutNullString(writer);
+ }
+ }
+ }
+
+ /**
+ * This method deserializes the specified Json into an object of the specified class. It is not
+ * suitable to use if the specified class is a generic type since it will not have the generic
+ * type information because of the Type Erasure feature of Java. Therefore, this method should not
+ * be used if the desired type is a generic type. Note that this method works fine if the any of
+ * the fields of the specified object are generics, just the object itself should not be a
+ * generic type. For the cases when the object is of generic type, invoke
+ * {@link #fromJson(String, Type)}. If you have the Json in a {@link Reader} instead of
+ * a String, use {@link #fromJson(Reader, Class)} instead.
+ *
+ * @param <T> the type of the desired object
+ * @param json the string from which the object is to be deserialized
+ * @param classOfT the class of T
+ * @return an object of type T from the string
+ * @throws JsonParseException if json is not a valid representation for an object of type
+ * classOfT
+ */
+ @SuppressWarnings("unchecked")
+ public <T> T fromJson(String json, Class<T> classOfT) throws JsonParseException {
+ T target = (T) fromJson(json, (Type) classOfT);
+ return target;
+ }
+
+ /**
+ * This method deserializes the specified Json into an object of the specified type. This method
+ * is useful if the specified object is a generic type. For non-generic objects, use
+ * {@link #fromJson(String, Class)} instead. If you have the Json in a {@link Reader} instead of
+ * a String, use {@link #fromJson(Reader, Type)} instead.
+ *
+ * @param <T> the type of the desired object
+ * @param json the string from which the object is to be deserialized
+ * @param typeOfT The specific genericized type of src. You can obtain this type by using the
+ * {@link com.google.gson.reflect.TypeToken} class. For example, to get the type for
+ * {@code Collection<Foo>}, you should use:
+ * <pre>
+ * Type typeOfT = new TypeToken<Collection<Foo>>(){}.getType();
+ * </pre>
+ * @return an object of type T from the string
+ * @throws JsonParseException if json is not a valid representation for an object of type typeOfT
+ */
+ @SuppressWarnings("unchecked")
+ public <T> T fromJson(String json, Type typeOfT) throws JsonParseException {
+ StringReader reader = new StringReader(json);
+ T target = (T) fromJson(reader, typeOfT);
+ return target;
+ }
+
+ /**
+ * This method deserializes the Json read from the specified reader into an object of the
+ * specified class. It is not suitable to use if the specified class is a generic type since it
+ * will not have the generic type information because of the Type Erasure feature of Java.
+ * Therefore, this method should not be used if the desired type is a generic type. Note that
+ * this method works fine if the any of the fields of the specified object are generics, just the
+ * object itself should not be a generic type. For the cases when the object is of generic type,
+ * invoke {@link #fromJson(Reader, Type)}. If you have the Json in a String form instead of a
+ * {@link Reader}, use {@link #fromJson(String, Class)} instead.
+ *
+ * @param <T> the type of the desired object
+ * @param json the reader producing the Json from which the object is to be deserialized.
+ * @param classOfT the class of T
+ * @return an object of type T from the string
+ * @throws JsonParseException if json is not a valid representation for an object of type
+ * classOfT
+ * @since 1.2
+ */
+ public <T> T fromJson(Reader json, Class<T> classOfT) throws JsonParseException {
+ T target = classOfT.cast(fromJson(json, (Type) classOfT));
+ return target;
+ }
+
+ /**
+ * This method deserializes the Json read from the specified reader into an object of the
+ * specified type. This method is useful if the specified object is a generic type. For
+ * non-generic objects, use {@link #fromJson(Reader, Class)} instead. If you have the Json in a
+ * String form instead of a {@link Reader}, use {@link #fromJson(String, Type)} instead.
+ *
+ * @param <T> the type of the desired object
+ * @param json the reader producing Json from which the object is to be deserialized
+ * @param typeOfT The specific genericized type of src. You can obtain this type by using the
+ * {@link com.google.gson.reflect.TypeToken} class. For example, to get the type for
+ * {@code Collection<Foo>}, you should use:
+ * <pre>
+ * Type typeOfT = new TypeToken<Collection<Foo>>(){}.getType();
+ * </pre>
+ * @return an object of type T from the json
+ * @throws JsonParseException if json is not a valid representation for an object of type typeOfT
+ * @since 1.2
+ */
+ @SuppressWarnings("unchecked")
+ public <T> T fromJson(Reader json, Type typeOfT) throws JsonParseException {
+ try {
+ JsonParser parser = new JsonParser(json);
+ JsonElement root = parser.parse();
+ JsonDeserializationContext context = new JsonDeserializationContextDefault(navigatorFactory,
+ deserializers, objectConstructor, typeAdapter);
+ T target = (T) context.deserialize(root, typeOfT);
+ return target;
+ } catch (TokenMgrError e) {
+ throw new JsonParseException("Failed parsing JSON source: " + json + " to Json", e);
+ } catch (ParseException e) {
+ throw new JsonParseException("Failed parsing JSON source: " + json + " to Json", e);
+ } catch (StackOverflowError e) {
+ throw new JsonParseException("Failed parsing JSON source: " + json + " to Json", e);
+ } catch (OutOfMemoryError e) {
+ throw new JsonParseException("Failed parsing JSON source: " + json + " to Json", e);
+ }
+ }
+
+ /**
+ * Appends the {@link #NULL_STRING} to the {@code writer} object.
+ *
+ * @param writer the object to append the null value to
+ */
+ private void writeOutNullString(Writer writer) {
+ try {
+ writer.append(NULL_STRING);
+ } catch (IOException e) {
+ // Should this be a different exception???
+ throw new JsonParseException(e);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("{");
+ sb.append("serializeNulls:").append(serializeNulls);
+ sb.append(",serializers:").append(serializers);
+ sb.append(",deserializers:").append(deserializers);
+ // using the name instanceCreator instead of ObjectConstructor since the users of Gson are
+ // more familiar with the concept of Instance Creators. Moreover, the objectConstructor is
+ // just a utility class around instance creators, and its toString() only displays them.
+ sb.append(",instanceCreators:").append(objectConstructor);
+ sb.append("}");
+ return sb.toString();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/GsonBuilder.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/GsonBuilder.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/GsonBuilder.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,382 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import com.google.gson.DefaultTypeAdapters.DefaultDateTypeAdapter;
+
+import java.lang.reflect.Type;
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * <p>Use this builder to construct a {@link Gson} instance when you need to set configuration
+ * options other than the default. For {@link Gson} with default configuration, it is simpler to
+ * use {@code new Gson()}. {@code GsonBuilder} is best used by creating it, and then invoking its
+ * various configuration methods, and finally calling create.</p>
+ *
+ * <p>The following is an example shows how to use the {@code GsonBuilder} to construct a Gson
+ * instance:
+ *
+ * <pre>
+ * Gson gson = new GsonBuilder()
+ * .registerTypeAdapter(Id.class, new IdTypeAdapter())
+ * .serializeNulls()
+ * .setDateFormat(DateFormat.LONG)
+ * .setFieldNamingPolicy(FieldNamingPolicy.UPPER_CAMEL_CASE)
+ * .setPrettyPrinting()
+ * .setVersion(1.0)
+ * .create();
+ * </pre></p>
+ *
+ * <p>NOTE: the order of invocation of configuration methods does not matter.</p>
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ */
+public final class GsonBuilder {
+
+ private double ignoreVersionsAfter;
+ private ModifierBasedExclusionStrategy modifierBasedExclusionStrategy;
+ private final InnerClassExclusionStrategy innerClassExclusionStrategy;
+ private boolean excludeFieldsWithoutExposeAnnotation;
+ private final TypeAdapter typeAdapter;
+ private JsonFormatter formatter;
+ private FieldNamingStrategy fieldNamingPolicy;
+ private final ParameterizedTypeHandlerMap<InstanceCreator<?>> instanceCreators;
+ private final ParameterizedTypeHandlerMap<JsonSerializer<?>> serializers;
+ private final ParameterizedTypeHandlerMap<JsonDeserializer<?>> deserializers;
+ private boolean serializeNulls;
+ private String datePattern;
+ private int dateStyle;
+ private int timeStyle;
+
+ /**
+ * Creates a GsonBuilder instance that can be used to build Gson with various configuration
+ * settings. GsonBuilder follows the builder pattern, and it is typically used by first
+ * invoking various configuration methods to set desired options, and finally calling
+ * {@link #create()}.
+ */
+ public GsonBuilder() {
+ // setup default values
+ ignoreVersionsAfter = VersionConstants.IGNORE_VERSIONS;
+ innerClassExclusionStrategy = new InnerClassExclusionStrategy();
+ modifierBasedExclusionStrategy = Gson.DEFAULT_MODIFIER_BASED_EXCLUSION_STRATEGY;
+ excludeFieldsWithoutExposeAnnotation = false;
+ typeAdapter = Gson.DEFAULT_TYPE_ADAPTER;
+ formatter = Gson.DEFAULT_JSON_FORMATTER;
+ fieldNamingPolicy = Gson.DEFAULT_NAMING_POLICY;
+ instanceCreators = new ParameterizedTypeHandlerMap<InstanceCreator<?>>();
+ serializers = new ParameterizedTypeHandlerMap<JsonSerializer<?>>();
+ deserializers = new ParameterizedTypeHandlerMap<JsonDeserializer<?>>();
+ serializeNulls = false;
+ dateStyle = DateFormat.DEFAULT;
+ timeStyle = DateFormat.DEFAULT;
+ }
+
+ /**
+ * Configures Gson to enable versioning support.
+ *
+ * @param ignoreVersionsAfter any field or type marked with a version higher than this value
+ * are ignored during serialization or deserialization.
+ * @return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern
+ */
+ public GsonBuilder setVersion(double ignoreVersionsAfter) {
+ this.ignoreVersionsAfter = ignoreVersionsAfter;
+ return this;
+ }
+
+ /**
+ * Configures Gson to excludes all class fields that have the specified modifiers. By default,
+ * Gson will exclude all fields marked transient or static. This method will override that
+ * behavior.
+ *
+ * @param modifiers the field modifiers. You must use the modifiers specified in the
+ * {@link java.lang.reflect.Modifier} class. For example,
+ * {@link java.lang.reflect.Modifier#TRANSIENT},
+ * {@link java.lang.reflect.Modifier#STATIC}.
+ * @return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern
+ */
+ public GsonBuilder excludeFieldsWithModifiers(int... modifiers) {
+ boolean skipSynthetics = true;
+ modifierBasedExclusionStrategy = new ModifierBasedExclusionStrategy(skipSynthetics, modifiers);
+ return this;
+ }
+
+ /**
+ * Configures Gson to exclude all fields from consideration for serialization or deserialization
+ * that do not have the {@link com.google.gson.annotations.Expose} annotation.
+ *
+ * @return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern
+ */
+ public GsonBuilder excludeFieldsWithoutExposeAnnotation() {
+ excludeFieldsWithoutExposeAnnotation = true;
+ return this;
+ }
+
+ /**
+ * Configure Gson to serialize null fields. By default, Gson omits all fields that are null
+ * during serialization.
+ *
+ * @return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern
+ * @since 1.2
+ */
+ public GsonBuilder serializeNulls() {
+ this.serializeNulls = true;
+ return this;
+ }
+ /**
+ * Configures Gson to apply a specific naming policy to an object's field during serialization
+ * and deserialization.
+ *
+ * @param namingConvention the JSON field naming convention to use for serialization and
+ * deserialization.
+ * @return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern
+ */
+ public GsonBuilder setFieldNamingPolicy(FieldNamingPolicy namingConvention) {
+ return setFieldNamingStrategy(namingConvention.getFieldNamingPolicy());
+ }
+
+ /**
+ * Configures Gson to apply a specific naming policy strategy to an object's field during
+ * serialization and deserialization.
+ *
+ * @param fieldNamingPolicy the actual naming strategy to apply to the fields
+ * @return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern
+ */
+ private GsonBuilder setFieldNamingStrategy(FieldNamingStrategy fieldNamingPolicy) {
+ this.fieldNamingPolicy = new SerializedNameAnnotationInterceptingNamingPolicy(fieldNamingPolicy);
+ return this;
+ }
+
+ /**
+ * Configures Gson to output Json that fits in a page for pretty printing. This option only
+ * affects Json serialization.
+ *
+ * @return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern
+ */
+ public GsonBuilder setPrettyPrinting() {
+ setFormatter(new JsonPrintFormatter());
+ return this;
+ }
+
+ /**
+ * Configures Gson with a new formatting strategy other than the default strategy. The default
+ * strategy is to provide a compact representation that eliminates all unneeded white-space.
+ *
+ * @param formatter the new formatter to use.
+ * @return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern
+ * @see JsonPrintFormatter
+ */
+ GsonBuilder setFormatter(JsonFormatter formatter) {
+ this.formatter = formatter;
+ return this;
+ }
+
+ /**
+ * Configures Gson to serialize {@code Date} objects according to the pattern provided. You can
+ * call this method or {@link #setDateFormat(int)} multiple times, but only the last invocation
+ * will be used to decide the serialization format.
+ *
+ * <p>Note that this pattern must abide by the convention provided by {@code SimpleDateFormat}
+ * class. See the documentation in {@link java.text.SimpleDateFormat} for more information on
+ * valid date and time patterns.</p>
+ *
+ * @param pattern the pattern that dates will be serialized/deserialized to/from
+ * @return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern
+ * @since 1.2
+ */
+ public GsonBuilder setDateFormat(String pattern) {
+ // TODO(Joel): Make this fail fast if it is an invalid date format
+ this.datePattern = pattern;
+ return this;
+ }
+
+ /**
+ * Configures Gson to to serialize {@code Date} objects according to the style value provided.
+ * You can call this method or {@link #setDateFormat(String)} multiple times, but only the last
+ * invocation will be used to decide the serialization format.
+ *
+ * <p>Note that this style value should be one of the predefined constants in the
+ * {@code DateFormat} class. See the documentation in {@link java.text.DateFormat} for more
+ * information on the valid style constants.</p>
+ *
+ * @param style the predefined date style that date objects will be serialized/deserialized
+ * to/from
+ * @return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern
+ * @since 1.2
+ */
+ public GsonBuilder setDateFormat(int style) {
+ this.dateStyle = style;
+ this.datePattern = null;
+ return this;
+ }
+
+ /**
+ * Configures Gson to to serialize {@code Date} objects according to the style value provided.
+ * You can call this method or {@link #setDateFormat(String)} multiple times, but only the last
+ * invocation will be used to decide the serialization format.
+ *
+ * <p>Note that this style value should be one of the predefined constants in the
+ * {@code DateFormat} class. See the documentation in {@link java.text.DateFormat} for more
+ * information on the valid style constants.</p>
+ *
+ * @param dateStyle the predefined date style that date objects will be serialized/deserialized
+ * to/from
+ * @param timeStyle the predefined style for the time portion of the date objects
+ * @return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern
+ * @since 1.2
+ */
+ public GsonBuilder setDateFormat(int dateStyle, int timeStyle) {
+ this.dateStyle = dateStyle;
+ this.timeStyle = timeStyle;
+ this.datePattern = null;
+ return this;
+ }
+
+ /**
+ * Configures Gson for custom serialization or deserialization. This method combines the
+ * registration of an {@link InstanceCreator}, {@link JsonSerializer}, and a
+ * {@link JsonDeserializer}. It is best used when a single object {@code typeAdapter} implements
+ * all the required interfaces for custom serialization with Gson. If an instance creator,
+ * serializer or deserializer was previously registered for the specified {@code type}, it is
+ * overwritten.
+ *
+ * @param type the type definition for the type adapter being registered
+ * @param typeAdapter This object must implement at least one of the {@link InstanceCreator},
+ * {@link JsonSerializer}, and a {@link JsonDeserializer} interfaces.
+ * @return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern
+ */
+ public GsonBuilder registerTypeAdapter(Type type, Object typeAdapter) {
+ Preconditions.checkArgument(typeAdapter instanceof JsonSerializer
+ || typeAdapter instanceof JsonDeserializer || typeAdapter instanceof InstanceCreator);
+ if (typeAdapter instanceof InstanceCreator) {
+ registerInstanceCreator(type, (InstanceCreator<?>) typeAdapter);
+ }
+ if (typeAdapter instanceof JsonSerializer) {
+ registerSerializer(type, (JsonSerializer<?>) typeAdapter);
+ }
+ if (typeAdapter instanceof JsonDeserializer) {
+ registerDeserializer(type, (JsonDeserializer<?>) typeAdapter);
+ }
+ return this;
+ }
+
+ /**
+ * Configures Gson to use a custom {@link InstanceCreator} for the specified type. If an instance
+ * creator was previously registered for the specified class, it is overwritten. Since this method
+ * takes a type instead of a Class object, it can be used to register a specific handler for a
+ * generic type corresponding to a raw type.
+ *
+ * @param <T> the type for which instance creator is being registered
+ * @param typeOfT The Type definition for T
+ * @param instanceCreator the instance creator for T
+ * @return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern
+ */
+ private <T> GsonBuilder registerInstanceCreator(Type typeOfT,
+ InstanceCreator<? extends T> instanceCreator) {
+ instanceCreators.register(typeOfT, instanceCreator);
+ return this;
+ }
+
+ /**
+ * Configures Gson to use a custom JSON serializer for the specified type. You should use this
+ * method if you want to register different serializers for different generic types corresponding
+ * to a raw type.
+ *
+ * @param <T> the type for which the serializer is being registered
+ * @param typeOfT The type definition for T
+ * @param serializer the custom serializer
+ * @return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern
+ */
+ private <T> GsonBuilder registerSerializer(Type typeOfT, final JsonSerializer<T> serializer) {
+ serializers.register(typeOfT, new JsonSerializerExceptionWrapper<T>(serializer));
+ return this;
+ }
+
+ /**
+ * Configures Gson to use a custom JSON deserializer for the specified type. You should use this
+ * method if you want to register different deserializers for different generic types
+ * corresponding to a raw type.
+ *
+ * @param <T> the type for which the deserializer is being registered
+ * @param typeOfT The type definition for T
+ * @param deserializer the custom deserializer
+ * @return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern
+ */
+ private <T> GsonBuilder registerDeserializer(Type typeOfT, JsonDeserializer<T> deserializer) {
+ deserializers.register(typeOfT, new JsonDeserializerExceptionWrapper<T>(deserializer));
+ return this;
+ }
+
+ /**
+ * Creates a {@link Gson} instance based on the current configuration. This method is free of
+ * side-effects to this {@code GsonBuilder} instance and hence can be called multiple times.
+ *
+ * @return an instance of Gson configured with the options currently set in this builder
+ */
+ public Gson create() {
+ List<ExclusionStrategy> strategies = new LinkedList<ExclusionStrategy>();
+ strategies.add(innerClassExclusionStrategy);
+ strategies.add(modifierBasedExclusionStrategy);
+ if (ignoreVersionsAfter != VersionConstants.IGNORE_VERSIONS) {
+ strategies.add(new VersionExclusionStrategy(ignoreVersionsAfter));
+ }
+ if (excludeFieldsWithoutExposeAnnotation) {
+ strategies.add(new ExposeAnnotationBasedExclusionStrategy());
+ }
+ ExclusionStrategy exclusionStrategy = new DisjunctionExclusionStrategy(strategies);
+ ObjectNavigatorFactory objectNavigatorFactory =
+ new ObjectNavigatorFactory(exclusionStrategy, fieldNamingPolicy);
+
+ ParameterizedTypeHandlerMap<JsonSerializer<?>> customSerializers = serializers.copyOf();
+ ParameterizedTypeHandlerMap<JsonDeserializer<?>> customDeserializers = deserializers.copyOf();
+
+ addTypeAdaptersForDate(datePattern, dateStyle, timeStyle, customSerializers,
+ customDeserializers);
+ customSerializers.registerIfAbsent(DefaultTypeAdapters.DEFAULT_SERIALIZERS);
+ customDeserializers.registerIfAbsent(DefaultTypeAdapters.DEFAULT_DESERIALIZERS);
+
+ ParameterizedTypeHandlerMap<InstanceCreator<?>> customInstanceCreators =
+ instanceCreators.copyOf();
+ customInstanceCreators.registerIfAbsent(DefaultTypeAdapters.DEFAULT_INSTANCE_CREATORS);
+ MappedObjectConstructor objConstructor = Gson.createObjectConstructor(customInstanceCreators);
+
+ Gson gson = new Gson(objectNavigatorFactory, objConstructor, typeAdapter, formatter,
+ serializeNulls, customSerializers, customDeserializers);
+ return gson;
+ }
+
+ private static void addTypeAdaptersForDate(String datePattern, int dateStyle, int timeStyle,
+ ParameterizedTypeHandlerMap<JsonSerializer<?>> serializers,
+ ParameterizedTypeHandlerMap<JsonDeserializer<?>> deserializers) {
+ // NOTE: if a date pattern exists, then that style takes priority
+ DefaultDateTypeAdapter dateTypeAdapter = null;
+ if (datePattern != null && !"".equals(datePattern.trim())) {
+ dateTypeAdapter = new DefaultDateTypeAdapter(datePattern);
+ } else if (dateStyle != DateFormat.DEFAULT && timeStyle != DateFormat.DEFAULT) {
+ dateTypeAdapter = new DefaultDateTypeAdapter(dateStyle, timeStyle);
+ }
+ if (dateTypeAdapter != null
+ && !serializers.hasAnyHandlerFor(Date.class)
+ && !deserializers.hasAnyHandlerFor(Date.class)) {
+ serializers.register(Date.class, dateTypeAdapter);
+ deserializers.register(Date.class, dateTypeAdapter);
+ }
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/InnerClassExclusionStrategy.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/InnerClassExclusionStrategy.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/InnerClassExclusionStrategy.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Field;
+
+/**
+ * Strategy for excluding inner classes.
+ *
+ * @author Joel Leitch
+ */
+final class InnerClassExclusionStrategy implements ExclusionStrategy {
+
+ public boolean shouldSkipField(Field f) {
+ return isAnonymousOrLocal(f.getType());
+ }
+
+ public boolean shouldSkipClass(Class<?> clazz) {
+ return isAnonymousOrLocal(clazz);
+ }
+
+ private boolean isAnonymousOrLocal(Class<?> clazz) {
+ return clazz.isAnonymousClass() || clazz.isLocalClass();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/InstanceCreator.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/InstanceCreator.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/InstanceCreator.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Type;
+
+/**
+ * This interface is implemented to create instances of a class that does not define a no-args
+ * constructor. If you can modify the class, you should instead add a private, or public
+ * no-args constructor. However, that is not possible for library classes, such as JDK classes, or
+ * a third-party library that you do not have source-code of. In such cases, you should define an
+ * instance creator for the class. Implementations of this interface should be registered with
+ * {@link GsonBuilder#registerTypeAdapter(Type, Object)} method before Gson will be able to use
+ * them.
+ * <p>Let us look at an example where defining an InstanceCreator might be useful. The
+ * {@code Id} class defined below does not have a default no-args constructor.</p>
+ *
+ * <pre>
+ * public class Id<T> {
+ * private final Class<T> clazz;
+ * private final long value;
+ * public Id(Class<T> clazz, long value) {
+ * this.clazz = clazz;
+ * this.value = value;
+ * }
+ * }
+ * </pre>
+ *
+ * <p>If Gson encounters an object of type {@code Id} during deserialization, it will throw an
+ * exception. The easiest way to solve this problem will be to add a (public or private) no-args
+ * constructor as follows:</p>
+ *
+ * <pre>
+ * private Id() {
+ * this(Object.class, 0L);
+ * }
+ * </pre>
+ *
+ * <p>However, let us assume that the developer does not have access to the source-code of the
+ * {@code Id} class, or does not want to define a no-args constructor for it. The developer
+ * can solve this problem by defining an {@code InstanceCreator} for {@code Id}:</p>
+ *
+ * <pre>
+ * class IdInstanceCreator implements InstanceCreator<Id> {
+ * public Id createInstance(Type type) {
+ * return new Id(Object.class, 0L);
+ * }
+ * }
+ * </pre>
+ *
+ * <p>Note that it does not matter what the fields of the created instance contain since Gson will
+ * overwrite them with the deserialized values specified in Json. You should also ensure that a
+ * <i>new</i> object is returned, not a common object since its fields will be overwritten.
+ * The developer will need to register {@code IdInstanceCreator} with Gson as follows:</p>
+ *
+ * <pre>
+ * Gson gson = new GsonBuilder().registerTypeAdapter(Id.class, new IdInstanceCreator()).create();
+ * </pre>
+ *
+ * @param <T> the type of object that will be created by this implementation.
+ *
+ * @author Joel Leitch
+ */
+public interface InstanceCreator<T> {
+
+ /**
+ * Gson invokes this call-back method during deserialization to create an instance of the
+ * specified type. The fields of the returned instance are overwritten with the data present
+ * in the Json. Since the prior contents of the object are destroyed and overwritten, do not
+ * return an instance that is useful elsewhere. In particular, do not return a common instance,
+ * always use {@code new} to create a new instance.
+ *
+ * @param type the parameterized T represented as a {@link Type}.
+ * @return a default object instance of type T.
+ */
+ public T createInstance(Type type);
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JavaFieldNamingPolicy.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JavaFieldNamingPolicy.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JavaFieldNamingPolicy.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+/**
+ * A simple implementation of the {@link FieldNamingStrategy} interface such that it does not
+ * perform any string translation of the incoming field name.
+ *
+ * <p>The following is an example:</p>
+ *
+ * <pre>
+ * class IntWrapper {
+ * public int integerField = 0;
+ * }
+ *
+ * JavaFieldNamingPolicy policy = new JavaFieldNamingPolicy();
+ * String translatedFieldName =
+ * policy.translateName(IntWrapper.class.getField("integerField"));
+ *
+ * assert("integerField".equals(translatedFieldName));
+ * </pre>
+ *
+ * <p>This is the default {@link FieldNamingStrategy} used by Gson.</p>
+ *
+ * @author Joel Leitch
+ */
+class JavaFieldNamingPolicy extends RecursiveFieldNamingPolicy {
+
+ @Override
+ protected String translateName(String target, Type fieldType, Annotation[] annotations) {
+ return target;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonArray.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonArray.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonArray.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,291 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * A class representing an array type in Json. An array is a list of {@link JsonElement}s each of
+ * which can be of a different type. This is an ordered list, meaning that the order in which
+ * elements are added is preserved.
+ *
+ * @author Inderjeet Singh
+ */
+public final class JsonArray extends JsonElement implements Iterable<JsonElement> {
+ private final List<JsonElement> elements;
+
+ /**
+ * Creates an empty JsonArray.
+ */
+ public JsonArray() {
+ elements = new LinkedList<JsonElement>();
+ }
+
+ /**
+ * Adds the specified element to self.
+ *
+ * @param element the element that needs to be added to the array.
+ */
+ public void add(JsonElement element) {
+ elements.add(element);
+ }
+
+ /**
+ * Adds all the elements of the specified array to self.
+ *
+ * @param array the array whose elements need to be added to the array.
+ */
+ public void addAll(JsonArray array) {
+ elements.addAll(array.elements);
+ }
+
+ /**
+ * Reverses the elements of the array.
+ */
+ void reverse() {
+ Collections.reverse(elements);
+ }
+
+ /**
+ * Returns the number of elements in the array.
+ *
+ * @return the number of elements in the array.
+ */
+ public int size() {
+ return elements.size();
+ }
+
+ /**
+ * Returns an iterator to navigate the elemetns of the array. Since the array is an ordered list,
+ * the iterator navigates the elements in the order they were inserted.
+ *
+ * @return an iterator to navigate the elements of the array.
+ */
+ public Iterator<JsonElement> iterator() {
+ return elements.iterator();
+ }
+
+ /**
+ * Returns the ith element of the array.
+ *
+ * @param i the index of the element that is being sought.
+ * @return the element present at the ith index.
+ * @throws IndexOutOfBoundsException if i is negative or greater than or equal to the
+ * {@link #size()} of the array.
+ */
+ public JsonElement get(int i) {
+ return elements.get(i);
+ }
+
+ /**
+ * convenience method to get this array as a {@link Number} if it contains a single element.
+ *
+ * @return get this element as a number if it is single element array.
+ * @throws ClassCastException if the element in the array is of not a {@link JsonPrimitive} and
+ * is not a valid Number.
+ * @throws IllegalStateException if the array has more than one element.
+ */
+ @Override
+ public Number getAsNumber() {
+ if (elements.size() == 1) {
+ return elements.get(0).getAsNumber();
+ }
+ throw new IllegalStateException();
+ }
+
+ /**
+ * convenience method to get this array as a {@link String} if it contains a single element.
+ *
+ * @return get this element as a String if it is single element array.
+ * @throws ClassCastException if the element in the array is of not a {@link JsonPrimitive} and
+ * is not a valid String.
+ * @throws IllegalStateException if the array has more than one element.
+ */
+ @Override
+ public String getAsString() {
+ if (elements.size() == 1) {
+ return elements.get(0).getAsString();
+ }
+ throw new IllegalStateException();
+ }
+
+ /**
+ * convenience method to get this array as a double if it contains a single element.
+ *
+ * @return get this element as a double if it is single element array.
+ * @throws ClassCastException if the element in the array is of not a {@link JsonPrimitive} and
+ * is not a valid double.
+ * @throws IllegalStateException if the array has more than one element.
+ */
+ @Override
+ public double getAsDouble() {
+ if (elements.size() == 1) {
+ return elements.get(0).getAsDouble();
+ }
+ throw new IllegalStateException();
+ }
+
+ /**
+ * convenience method to get this array as a {@link BigDecimal} if it contains a single element.
+ *
+ * @return get this element as a {@link BigDecimal} if it is single element array.
+ * @throws ClassCastException if the element in the array is of not a {@link JsonPrimitive}.
+ * @throws NumberFormatException if the element at index 0 is not a valid {@link BigDecimal}.
+ * @throws IllegalStateException if the array has more than one element.
+ * @since 1.2
+ */
+ @Override
+ public BigDecimal getAsBigDecimal() {
+ if (elements.size() == 1) {
+ return elements.get(0).getAsBigDecimal();
+ }
+ throw new IllegalStateException();
+ }
+
+ /**
+ * convenience method to get this array as a {@link BigInteger} if it contains a single element.
+ *
+ * @return get this element as a {@link BigInteger} if it is single element array.
+ * @throws ClassCastException if the element in the array is of not a {@link JsonPrimitive}.
+ * @throws NumberFormatException if the element at index 0 is not a valid {@link BigInteger}.
+ * @throws IllegalStateException if the array has more than one element.
+ * @since 1.2
+ */
+ @Override
+ public BigInteger getAsBigInteger() {
+ if (elements.size() == 1) {
+ return elements.get(0).getAsBigInteger();
+ }
+ throw new IllegalStateException();
+ }
+
+ /**
+ * convenience method to get this array as a float if it contains a single element.
+ *
+ * @return get this element as a float if it is single element array.
+ * @throws ClassCastException if the element in the array is of not a {@link JsonPrimitive} and
+ * is not a valid float.
+ * @throws IllegalStateException if the array has more than one element.
+ */
+ @Override
+ public float getAsFloat() {
+ if (elements.size() == 1) {
+ return elements.get(0).getAsFloat();
+ }
+ throw new IllegalStateException();
+ }
+
+ /**
+ * convenience method to get this array as a long if it contains a single element.
+ *
+ * @return get this element as a long if it is single element array.
+ * @throws ClassCastException if the element in the array is of not a {@link JsonPrimitive} and
+ * is not a valid long.
+ * @throws IllegalStateException if the array has more than one element.
+ */
+ @Override
+ public long getAsLong() {
+ if (elements.size() == 1) {
+ return elements.get(0).getAsLong();
+ }
+ throw new IllegalStateException();
+ }
+
+ /**
+ * convenience method to get this array as an integer if it contains a single element.
+ *
+ * @return get this element as an integer if it is single element array.
+ * @throws ClassCastException if the element in the array is of not a {@link JsonPrimitive} and
+ * is not a valid integer.
+ * @throws IllegalStateException if the array has more than one element.
+ */
+ @Override
+ public int getAsInt() {
+ if (elements.size() == 1) {
+ return elements.get(0).getAsInt();
+ }
+ throw new IllegalStateException();
+ }
+
+ /**
+ * convenience method to get this array as a primitive short if it contains a single element.
+ *
+ * @return get this element as a primitive short if it is single element array.
+ * @throws ClassCastException if the element in the array is of not a {@link JsonPrimitive} and
+ * is not a valid short.
+ * @throws IllegalStateException if the array has more than one element.
+ */
+ @Override
+ public short getAsShort() {
+ if (elements.size() == 1) {
+ return elements.get(0).getAsShort();
+ }
+ throw new IllegalStateException();
+ }
+
+ /**
+ * convenience method to get this array as a boolean if it contains a single element.
+ *
+ * @return get this element as a boolean if it is single element array.
+ * @throws ClassCastException if the element in the array is of not a {@link JsonPrimitive} and
+ * is not a valid boolean.
+ * @throws IllegalStateException if the array has more than one element.
+ */
+ @Override
+ public boolean getAsBoolean() {
+ if (elements.size() == 1) {
+ return elements.get(0).getAsBoolean();
+ }
+ throw new IllegalStateException();
+ }
+
+ /**
+ * convenience method to get this array as an Object if it contains a single element.
+ *
+ * @return get this element as an Object if it is single element array.
+ * @throws ClassCastException if the element in the array is of not a {@link JsonPrimitive} and
+ * is not a valid Object.
+ * @throws IllegalStateException if the array has more than one element.
+ */
+ @Override
+ Object getAsObject() {
+ if (elements.size() == 1) {
+ return elements.get(0).getAsObject();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ protected void toString(StringBuilder sb) {
+ sb.append('[');
+ boolean first = true;
+ for (JsonElement element : elements) {
+ if (first) {
+ first = false;
+ } else {
+ sb.append(',');
+ }
+ element.toString(sb);
+ }
+ sb.append(']');
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonArrayDeserializationVisitor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonArrayDeserializationVisitor.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonArrayDeserializationVisitor.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Array;
+import java.lang.reflect.Field;
+import java.lang.reflect.Type;
+import java.util.Collection;
+
+/**
+ * A visitor that populates fields of an object with data from its equivalent
+ * JSON representation
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ */
+final class JsonArrayDeserializationVisitor<T> extends JsonDeserializationVisitor<T> {
+ private final Class<?> componentType;
+
+ JsonArrayDeserializationVisitor(JsonArray jsonArray, Type arrayType,
+ ObjectNavigatorFactory factory, ObjectConstructor objectConstructor,
+ TypeAdapter typeAdapter, ParameterizedTypeHandlerMap<JsonDeserializer<?>> deserializers,
+ JsonDeserializationContext context) {
+ super(jsonArray, arrayType, factory, objectConstructor, typeAdapter, deserializers, context);
+ this.componentType = TypeUtils.toRawClass(arrayType);
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ protected T constructTarget() {
+
+ TypeInfo typeInfo = new TypeInfo(targetType);
+
+ JsonArray jsonArray = json.getAsJsonArray();
+ if (typeInfo.isPrimitiveOrStringAndNotAnArray()) {
+ if (jsonArray.size() != 1) {
+ throw new IllegalArgumentException(
+ "Primitives should be an array of length 1, but was: " + jsonArray);
+ }
+ return (T) objectConstructor.construct(typeInfo.getWrappedClass());
+ } else if (typeInfo.isArray()) {
+ TypeInfoArray arrayTypeInfo = TypeInfoFactory.getTypeInfoForArray(targetType);
+ // We know that we are getting back an array of the required type, so
+ // this typecasting is safe.
+ return (T) objectConstructor.constructArray(arrayTypeInfo.getSecondLevelType(),
+ jsonArray.size());
+ } else { // is a collection
+ return (T) objectConstructor.construct(typeInfo.getRawClass());
+ }
+ }
+
+ public void visitArray(Object array, Type arrayType) {
+ JsonArray jsonArray = json.getAsJsonArray();
+ TypeInfoArray arrayTypeInfo = TypeInfoFactory.getTypeInfoForArray(arrayType);
+ for (int i = 0; i < jsonArray.size(); i++) {
+ JsonElement jsonChild = jsonArray.get(i);
+ Object child;
+
+ if (jsonChild == null) {
+ child = null;
+ } else if (jsonChild instanceof JsonObject) {
+ child = visitChildAsObject(arrayTypeInfo.getComponentRawType(), jsonChild);
+ } else if (jsonChild instanceof JsonArray) {
+ child = visitChildAsArray(arrayTypeInfo.getSecondLevelType(), jsonChild.getAsJsonArray());
+ } else if (jsonChild instanceof JsonPrimitive) {
+ child = visitChildAsPrimitive(arrayTypeInfo.getComponentRawType(),
+ jsonChild.getAsJsonPrimitive());
+ } else {
+ throw new IllegalStateException();
+ }
+ Array.set(array, i, child);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public void visitCollection(Collection collection, Type collectionType) {
+ Type childType = TypeUtils.getActualTypeForFirstTypeVariable(collectionType);
+ for (JsonElement jsonChild : json.getAsJsonArray()) {
+ if (childType == Object.class) {
+ throw new JsonParseException(collection +
+ " must not be a raw collection. Try making it genericized instead.");
+ }
+ Object child = visitChild(childType, jsonChild);
+ collection.add(child);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public void visitPrimitiveValue(Object obj) {
+ target = (T) typeAdapter.adaptType(json.getAsJsonArray().get(0).getAsObject(), componentType);
+ }
+
+ // We should not implement any other method from Visitor interface since
+ // all other methods should be invoked on JsonObjectDeserializationVisitor
+ // instead.
+
+ public void endVisitingObject(Object node) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void startVisitingObject(Object node) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void visitArrayField(Field f, Type typeOfF, Object obj) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void visitCollectionField(Field f, Type typeOfF, Object obj) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void visitObjectField(Field f, Type typeOfF, Object obj) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void visitPrimitiveField(Field f, Type typeOfF, Object obj) {
+ throw new UnsupportedOperationException();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonCompactFormatter.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonCompactFormatter.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonCompactFormatter.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.io.PrintWriter;
+
+/**
+ * Formats Json in a compact way eliminating all unnecessary whitespace.
+ *
+ * @author Inderjeet Singh
+ */
+final class JsonCompactFormatter implements JsonFormatter {
+
+ private static class FormattingVisitor implements JsonElementVisitor {
+ private final PrintWriter writer;
+ private final boolean serializeNulls;
+
+ FormattingVisitor(PrintWriter writer, boolean serializeNulls) {
+ this.writer = writer;
+ this.serializeNulls = serializeNulls;
+ }
+
+ public void visitPrimitive(JsonPrimitive primitive) {
+ writer.append(primitive.toString());
+ }
+
+ public void visitNull() {
+ writer.append("null");
+ }
+
+ public void startArray(JsonArray array) {
+ writer.append('[');
+ }
+
+ public void visitArrayMember(JsonArray parent, JsonPrimitive member, boolean isFirst) {
+ if (!isFirst) {
+ writer.append(',');
+ }
+ writer.append(member.toString());
+ }
+
+ public void visitArrayMember(JsonArray parent, JsonArray member, boolean isFirst) {
+ if (!isFirst) {
+ writer.append(',');
+ }
+ }
+
+ public void visitArrayMember(JsonArray parent, JsonObject member, boolean isFirst) {
+ if (!isFirst) {
+ writer.append(',');
+ }
+ }
+
+ public void visitNullArrayMember(JsonArray parent, boolean isFirst) {
+ if (!isFirst) {
+ writer.append(',');
+ }
+ }
+
+ public void endArray(JsonArray array) {
+ writer.append(']');
+ }
+
+ public void startObject(JsonObject object) {
+ writer.append('{');
+ }
+
+ public void visitObjectMember(JsonObject parent, String memberName, JsonPrimitive member,
+ boolean isFirst) {
+ if (!isFirst) {
+ writer.append(',');
+ }
+ writer.append('"');
+ writer.append(memberName);
+ writer.append("\":");
+ writer.append(member.toString());
+ }
+
+ public void visitObjectMember(JsonObject parent, String memberName, JsonArray member,
+ boolean isFirst) {
+ if (!isFirst) {
+ writer.append(',');
+ }
+ writer.append('"');
+ writer.append(memberName);
+ writer.append("\":");
+ }
+
+ public void visitObjectMember(JsonObject parent, String memberName, JsonObject member,
+ boolean isFirst) {
+ if (!isFirst) {
+ writer.append(',');
+ }
+ writer.append('"');
+ writer.append(memberName);
+ writer.append("\":");
+ }
+
+ public void visitNullObjectMember(JsonObject parent, String memberName, boolean isFirst) {
+ if (serializeNulls) {
+ visitObjectMember(parent, memberName, (JsonObject) null, isFirst);
+ }
+ }
+
+ public void endObject(JsonObject object) {
+ writer.append('}');
+ }
+ }
+
+ public void format(JsonElement root, PrintWriter writer, boolean serializeNulls) {
+ if (root == null) {
+ return;
+ }
+ JsonElementVisitor visitor =
+ new JsonEscapingVisitor(new FormattingVisitor(writer, serializeNulls));
+ JsonTreeNavigator navigator = new JsonTreeNavigator(visitor, serializeNulls);
+ navigator.navigate(root);
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonDeserializationContext.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonDeserializationContext.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonDeserializationContext.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Type;
+
+/**
+ * Context for deserialization that is passed to a custom deserializer during invocation of its
+ * {@link JsonDeserializer#deserialize(JsonElement, Type, JsonDeserializationContext)}
+ * method.
+ *
+ * @author Inderjeet Singh
+ */
+public interface JsonDeserializationContext {
+
+ /**
+ * Invokes default deserialization on the specified object. It should never be invoked on
+ * the element received as a parameter of the
+ * {@link JsonDeserializer#deserialize(JsonElement, Type, JsonDeserializationContext)} method. Doing
+ * so will result in an infinite loop since Gson will in-turn call the custom deserializer again.
+
+ * @param json the parse tree.
+ * @param typeOfT type of the expected return value.
+ * @param <T> The type of the deserialized object.
+ * @return An object of type typeOfT.
+ * @throws JsonParseException if the parse tree does not contain expected data.
+ */
+ public <T> T deserialize(JsonElement json, Type typeOfT) throws JsonParseException;
+}
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonDeserializationContextDefault.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonDeserializationContextDefault.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonDeserializationContextDefault.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Type;
+
+/**
+ * implementation of a deserialization context for Gson
+ *
+ * @author Inderjeet Singh
+ */
+final class JsonDeserializationContextDefault implements JsonDeserializationContext {
+
+ private final ObjectNavigatorFactory navigatorFactory;
+ private final ParameterizedTypeHandlerMap<JsonDeserializer<?>> deserializers;
+ private final MappedObjectConstructor objectConstructor;
+ private final TypeAdapter typeAdapter;
+
+ JsonDeserializationContextDefault(ObjectNavigatorFactory navigatorFactory,
+ ParameterizedTypeHandlerMap<JsonDeserializer<?>> deserializers,
+ MappedObjectConstructor objectConstructor, TypeAdapter typeAdapter) {
+ this.navigatorFactory = navigatorFactory;
+ this.deserializers = deserializers;
+ this.objectConstructor = objectConstructor;
+ this.typeAdapter = typeAdapter;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T deserialize(JsonElement json, Type typeOfT) throws JsonParseException {
+ if (json.isJsonArray()) {
+ return (T) fromJsonArray(typeOfT, json.getAsJsonArray(), this);
+ } else if (json.isJsonObject()) {
+ return (T) fromJsonObject(typeOfT, json.getAsJsonObject(), this);
+ } else if (json.isJsonPrimitive()) {
+ return (T) fromJsonPrimitive(typeOfT, json.getAsJsonPrimitive(), this);
+ } else if (json.isJsonNull()) {
+ return null;
+ } else {
+ throw new JsonParseException("Failed parsing JSON source: " + json + " to Json");
+ }
+ }
+
+ private <T> T fromJsonArray(Type arrayType, JsonArray jsonArray,
+ JsonDeserializationContext context) throws JsonParseException {
+ JsonArrayDeserializationVisitor<T> visitor = new JsonArrayDeserializationVisitor<T>(
+ jsonArray, arrayType, navigatorFactory, objectConstructor, typeAdapter, deserializers,
+ context);
+ Object target = visitor.getTarget();
+ ObjectNavigator on = navigatorFactory.create(target, arrayType);
+ on.accept(visitor);
+ return visitor.getTarget();
+ }
+
+ private <T> T fromJsonObject(Type typeOfT, JsonObject jsonObject,
+ JsonDeserializationContext context) throws JsonParseException {
+ JsonObjectDeserializationVisitor<T> visitor = new JsonObjectDeserializationVisitor<T>(
+ jsonObject, typeOfT, navigatorFactory, objectConstructor, typeAdapter, deserializers,
+ context);
+ Object target = visitor.getTarget();
+ ObjectNavigator on = navigatorFactory.create(target, typeOfT);
+ on.accept(visitor);
+ return visitor.getTarget();
+ }
+
+ @SuppressWarnings("unchecked")
+ private <T> T fromJsonPrimitive(Type typeOfT, JsonPrimitive json,
+ JsonDeserializationContext context) throws JsonParseException {
+ JsonPrimitiveDeserializationVisitor<T> visitor = new JsonPrimitiveDeserializationVisitor<T>(
+ json, typeOfT, navigatorFactory, objectConstructor, typeAdapter, deserializers, context);
+ Object target = visitor.getTarget();
+ ObjectNavigator on = navigatorFactory.create(target, typeOfT);
+ on.accept(visitor);
+ target = visitor.getTarget();
+ if (typeOfT instanceof Class) {
+ target = typeAdapter.adaptType(target, (Class) typeOfT);
+ }
+ return (T) target;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonDeserializationVisitor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonDeserializationVisitor.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonDeserializationVisitor.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Type;
+import java.util.logging.Logger;
+
+/**
+ * Abstract data value container for the {@link ObjectNavigator.Visitor}
+ * implementations. This class exposes the {@link #getTarget()} method
+ * which returns the class that was visited by this object.
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ */
+abstract class JsonDeserializationVisitor<T> implements ObjectNavigator.Visitor {
+
+ protected static Logger logger = Logger.getLogger(JsonDeserializationVisitor.class.getName());
+
+ protected final ObjectNavigatorFactory factory;
+ protected final ObjectConstructor objectConstructor;
+ protected final TypeAdapter typeAdapter;
+ protected final ParameterizedTypeHandlerMap<JsonDeserializer<?>> deserializers;
+ protected T target;
+ protected final JsonElement json;
+ protected final Type targetType;
+ private final JsonDeserializationContext context;
+
+ public JsonDeserializationVisitor(JsonElement json, Type targetType,
+ ObjectNavigatorFactory factory, ObjectConstructor objectConstructor, TypeAdapter typeAdapter,
+ ParameterizedTypeHandlerMap<JsonDeserializer<?>> deserializers,
+ JsonDeserializationContext context) {
+ Preconditions.checkNotNull(json);
+ this.targetType = targetType;
+ this.factory = factory;
+ this.objectConstructor = objectConstructor;
+ this.typeAdapter = typeAdapter;
+ this.deserializers = deserializers;
+ this.json = json;
+ this.context = context;
+ }
+
+ T getTarget() {
+ if (target == null) {
+ target = constructTarget();
+ }
+ return target;
+ }
+
+ protected abstract T constructTarget();
+
+ @SuppressWarnings("unchecked")
+ public final void visitEnum(Object obj, Type objType) {
+ JsonDeserializer<T> deserializer = (JsonDeserializer<T>) deserializers.getHandlerFor(objType);
+ if (deserializer == null) {
+ deserializer = (JsonDeserializer<T>) deserializers.getHandlerFor(Enum.class);
+ }
+ if (deserializer == null) {
+ throw new RuntimeException("Register a JsonDeserializer for Enum or "
+ + obj.getClass().getName());
+ }
+ target = deserializer.deserialize(json, objType, context);
+ }
+
+ @SuppressWarnings("unchecked")
+ public final boolean visitUsingCustomHandler(Object obj, Type objType) {
+ JsonDeserializer<T> deserializer = (JsonDeserializer<T>) deserializers.getHandlerFor(objType);
+ if (deserializer != null) {
+ target = deserializer.deserialize(json, objType, context);
+ return true;
+ }
+ return false;
+ }
+
+ final Object visitChildAsObject(Type childType, JsonElement jsonChild) {
+ JsonDeserializationVisitor<?> childVisitor =
+ new JsonObjectDeserializationVisitor<Object>(jsonChild, childType,
+ factory, objectConstructor, typeAdapter, deserializers, context);
+ return visitChild(childType, childVisitor);
+ }
+
+ final Object visitChildAsArray(Type childType, JsonArray jsonChild) {
+ JsonDeserializationVisitor<?> childVisitor =
+ new JsonArrayDeserializationVisitor<Object>(jsonChild.getAsJsonArray(), childType,
+ factory, objectConstructor, typeAdapter, deserializers, context);
+ return visitChild(childType, childVisitor);
+ }
+
+ final Object visitChildAsPrimitive(Type childType, JsonPrimitive jsonChild) {
+ Preconditions.checkNotNull(jsonChild);
+ Class<?> childClass;
+ if (childType instanceof Class) {
+ childClass = (Class<?>) childType;
+ } else {
+ childClass = TypeUtils.toRawClass(childType);
+ }
+ return typeAdapter.adaptType(jsonChild.getAsObject(), childClass);
+ }
+
+ final Object visitChild(Type childType, JsonElement jsonChild) {
+ if (jsonChild == null) {
+ return null;
+ } else if (jsonChild instanceof JsonArray) {
+ return visitChildAsArray(childType, jsonChild.getAsJsonArray());
+ } else if (jsonChild instanceof JsonObject) {
+ return visitChildAsObject(childType, jsonChild);
+ } else if (jsonChild instanceof JsonPrimitive) {
+ return visitChildAsPrimitive(childType, jsonChild.getAsJsonPrimitive());
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ private Object visitChild(Type type, JsonDeserializationVisitor<?> childVisitor) {
+ Object child = childVisitor.getTarget();
+ ObjectNavigator on = factory.create(child, type);
+ on.accept(childVisitor);
+ // the underlying object may have changed during the construction phase
+ // This happens primarily because of custom deserializers
+ return childVisitor.getTarget();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonDeserializer.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonDeserializer.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonDeserializer.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Type;
+
+/**
+ * <p>Interface representing a custom deserializer for Json. You should write a custom
+ * deserializer, if you are not happy with the default deserialization done by Gson. You will
+ * also need to register this deserializer through
+ * {@link GsonBuilder#registerTypeAdapter(Type, Object)}.</p>
+ *
+ * <p>Let us look at example where defining a deserializer will be useful. The {@code Id} class
+ * defined below has two fields: {@code clazz} and {@code value}.</p>
+ *
+ * <pre>
+ * public class Id<T> {
+ * private final Class<T> clazz;
+ * private final long value;
+ * public Id(Class<T> clazz, long value) {
+ * this.clazz = clazz;
+ * this.value = value;
+ * }
+ * public long getValue() {
+ * return value;
+ * }
+ * }
+ * </pre>
+ *
+ * <p>The default deserialization of {@code Id(com.foo.MyObject.class, 20L)} will require the
+ * Json string to be <code>{"clazz":com.foo.MyObject,"value":20}</code>. Suppose, you already know
+ * the type of the field that the {@code Id} will be deserialized into, and hence just want to
+ * deserialize it from a Json string {@code 20}. You can achieve that by writing a custom
+ * deserializer:</p>
+ *
+ * <pre>
+ * class IdDeserializer implements JsonDeserializer<Id>() {
+ * public Id fromJson(JsonElement json, Type typeOfT, JsonDeserializationContext context)
+ * throws JsonParseException {
+ * return (Id) new Id((Class)typeOfT, id.getValue());
+ * }
+ * </pre>
+ *
+ * <p>You will also need to register {@code IdDeserializer} with Gson as follows:</p>
+ *
+ * <pre>
+ * Gson gson = new GsonBuilder().registerTypeAdapter(Id.class, new IdDeserializer()).create();
+ * </pre>
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ *
+ * @param <T> type for which the deserializer is being registered. It is possible that a
+ * deserializer may be asked to deserialize a specific generic type of the T.
+ */
+public interface JsonDeserializer<T> {
+
+ /**
+ * Gson invokes this call-back method during deserialization when it encounters a field of the
+ * specified type.
+ * <p>In the implementation of this call-back method, you should consider invoking
+ * {@link JsonDeserializationContext#deserialize(JsonElement, Type)} method to create objects
+ * for any non-trivial field of the returned object. However, you should never invoke it on the
+ * the same type passing {@code json} since that will cause an infinite loop (Gson will call your
+ * call-back method again).
+ *
+ * @param json The Json data being deserialized
+ * @param typeOfT The type of the Object to deserialize to
+ * @return a deserialized object of the specified type typeOfT which is a subclass of {@code T}
+ * @throws JsonParseException if json is not in the expected format of {@code typeofT}
+ */
+ public T deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
+ throws JsonParseException;
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonDeserializerExceptionWrapper.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonDeserializerExceptionWrapper.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonDeserializerExceptionWrapper.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Type;
+
+/**
+ * Decorators a {@code JsonDeserializer} instance with exception handling. This wrapper class
+ * ensures that a {@code JsonDeserializer} will not propagate any exception other than a
+ * {@link JsonParseException}.
+ *
+ * @param <T> type of the deserializer being wrapped.
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ */
+class JsonDeserializerExceptionWrapper<T> implements JsonDeserializer<T> {
+
+ private final JsonDeserializer<T> delegate;
+
+ /**
+ * Returns a wrapped {@link JsonDeserializer} object that has been decorated with
+ * {@link JsonParseException} handling.
+ *
+ * @param delegate the {@code JsonDeserializer} instance to be wrapped.
+ * @throws IllegalArgumentException if {@code delegate} is {@code null}.
+ */
+ JsonDeserializerExceptionWrapper(JsonDeserializer<T> delegate) {
+ Preconditions.checkNotNull(delegate);
+ this.delegate = delegate;
+ }
+
+ public T deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
+ throws JsonParseException {
+ try {
+ return delegate.deserialize(json, typeOfT, context);
+ } catch (JsonParseException e) {
+ // just rethrow the exception
+ throw e;
+ } catch (Exception e) {
+ // rethrow as a JsonParseException
+ StringBuilder errorMsg = new StringBuilder()
+ .append("The JsonDeserializer ")
+ .append(delegate)
+ .append(" failed to deserialized json object ")
+ .append(json)
+ .append(" given the type ")
+ .append(typeOfT);
+ throw new JsonParseException(errorMsg.toString(), e);
+ }
+ }
+
+ @Override
+ public String toString() {
+ return delegate.toString();
+ }
+}
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonElement.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonElement.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonElement.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,292 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+/**
+ * A class representing an element of Json. It could either be a {@link JsonObject}, a
+ * {@link JsonArray}, a {@link JsonPrimitive} or a {@link JsonNull}.
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ */
+public abstract class JsonElement {
+
+ /**
+ * provides check for verifying if this element is an array or not.
+ *
+ * @return true if this element is of type {@link JsonArray}, false otherwise.
+ */
+ public boolean isJsonArray() {
+ return this instanceof JsonArray;
+ }
+
+ /**
+ * provides check for verifying if this element is a Json object or not.
+ *
+ * @return true if this element is of type {@link JsonObject}, false otherwise.
+ */
+ public boolean isJsonObject() {
+ return this instanceof JsonObject;
+ }
+
+ /**
+ * provides check for verifying if this element is a primitive or not.
+ *
+ * @return true if this element is of type {@link JsonPrimitive}, false otherwise.
+ */
+ public boolean isJsonPrimitive() {
+ return this instanceof JsonPrimitive;
+ }
+
+ /**
+ * provides check for verifying if this element represents a null value or not.
+ *
+ * @return true if this element is of type {@link JsonNull}, false otherwise.
+ * @since 1.2
+ */
+ public boolean isJsonNull() {
+ return this instanceof JsonNull;
+ }
+
+ /**
+ * convenience method to get this element as a {@link JsonObject}. If the element is of some
+ * other type, a {@link ClassCastException} will result. Hence it is best to use this method
+ * after ensuring that this element is of the desired type by calling {@link #isJsonObject()}
+ * first.
+ *
+ * @return get this element as a {@link JsonObject}.
+ * @throws ClassCastException if the element is of another type.
+ */
+ public JsonObject getAsJsonObject() {
+ return (JsonObject) this;
+ }
+
+ /**
+ * convenience method to get this element as a {@link JsonArray}. If the element is of some
+ * other type, a {@link ClassCastException} will result. Hence it is best to use this method
+ * after ensuring that this element is of the desired type by calling {@link #isJsonArray()}
+ * first.
+ *
+ * @return get this element as a {@link JsonArray}.
+ * @throws ClassCastException if the element is of another type.
+ */
+ public JsonArray getAsJsonArray() {
+ return (JsonArray) this;
+ }
+
+ /**
+ * convenience method to get this element as a {@link JsonPrimitive}. If the element is of some
+ * other type, a {@link ClassCastException} will result. Hence it is best to use this method
+ * after ensuring that this element is of the desired type by calling {@link #isJsonPrimitive()}
+ * first.
+ *
+ * @return get this element as a {@link JsonPrimitive}.
+ * @throws ClassCastException if the element is of another type.
+ */
+ public JsonPrimitive getAsJsonPrimitive() {
+ return (JsonPrimitive) this;
+ }
+
+ /**
+ * convenience method to get this element as a {@link JsonNull}. If the element is of some
+ * other type, a {@link ClassCastException} will result. Hence it is best to use this method
+ * after ensuring that this element is of the desired type by calling {@link #isJsonNull()}
+ * first.
+ *
+ * @return get this element as a {@link JsonNull}.
+ * @throws ClassCastException if the element is of another type.
+ * @since 1.2
+ */
+ public JsonNull getAsJsonNull() {
+ return (JsonNull) this;
+ }
+
+ /**
+ * convenience method to get this element as a boolean value.
+ *
+ * @return get this element as a primitive boolean value.
+ * @throws ClassCastException if the element is of not a {@link JsonPrimitive} and is not a valid
+ * boolean value.
+ * @throws IllegalStateException if the element is of the type {@link JsonArray} but contains
+ * more than a single element.
+ */
+ public boolean getAsBoolean() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * convenience method to get this element as a {@link Boolean} value.
+ *
+ * @return get this element as a {@link Boolean} value.
+ * @throws ClassCastException if the element is of not a {@link JsonPrimitive} and is not a valid
+ * boolean value.
+ * @throws IllegalStateException if the element is of the type {@link JsonArray} but contains
+ * more than a single element.
+ */
+ Boolean getAsBooleanWrapper() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * convenience method to get this element as a {@link Number}.
+ *
+ * @return get this element as a {@link Number}.
+ * @throws ClassCastException if the element is of not a {@link JsonPrimitive} and is not a valid
+ * number.
+ * @throws IllegalStateException if the element is of the type {@link JsonArray} but contains
+ * more than a single element.
+ */
+ public Number getAsNumber() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * convenience method to get this element as a string value.
+ *
+ * @return get this element as a string value.
+ * @throws ClassCastException if the element is of not a {@link JsonPrimitive} and is not a valid
+ * string value.
+ * @throws IllegalStateException if the element is of the type {@link JsonArray} but contains
+ * more than a single element.
+ */
+ public String getAsString() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * convenience method to get this element as a primitive double value.
+ *
+ * @return get this element as a primitive double value.
+ * @throws ClassCastException if the element is of not a {@link JsonPrimitive} and is not a valid
+ * double value.
+ * @throws IllegalStateException if the element is of the type {@link JsonArray} but contains
+ * more than a single element.
+ */
+ public double getAsDouble() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * convenience method to get this element as a primitive float value.
+ *
+ * @return get this element as a primitive float value.
+ * @throws ClassCastException if the element is of not a {@link JsonPrimitive} and is not a valid
+ * float value.
+ * @throws IllegalStateException if the element is of the type {@link JsonArray} but contains
+ * more than a single element.
+ */
+ public float getAsFloat() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * convenience method to get this element as a primitive long value.
+ *
+ * @return get this element as a primitive long value.
+ * @throws ClassCastException if the element is of not a {@link JsonPrimitive} and is not a valid
+ * long value.
+ * @throws IllegalStateException if the element is of the type {@link JsonArray} but contains
+ * more than a single element.
+ */
+ public long getAsLong() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * convenience method to get this element as a primitive integer value.
+ *
+ * @return get this element as a primitive integer value.
+ * @throws ClassCastException if the element is of not a {@link JsonPrimitive} and is not a valid
+ * integer value.
+ * @throws IllegalStateException if the element is of the type {@link JsonArray} but contains
+ * more than a single element.
+ */
+ public int getAsInt() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * convenience method to get this element as a {@link BigDecimal}.
+ *
+ * @return get this element as a {@link BigDecimal}.
+ * @throws ClassCastException if the element is of not a {@link JsonPrimitive}.
+ * * @throws NumberFormatException if the element is not a valid {@link BigDecimal}.
+ * @throws IllegalStateException if the element is of the type {@link JsonArray} but contains
+ * more than a single element.
+ * @since 1.2
+ */
+ public BigDecimal getAsBigDecimal() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * convenience method to get this element as a {@link BigInteger}.
+ *
+ * @return get this element as a {@link BigInteger}.
+ * @throws ClassCastException if the element is of not a {@link JsonPrimitive}.
+ * @throws NumberFormatException if the element is not a valid {@link BigInteger}.
+ * @throws IllegalStateException if the element is of the type {@link JsonArray} but contains
+ * more than a single element.
+ * @since 1.2
+ */
+ public BigInteger getAsBigInteger() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * convenience method to get this element as a primitive short value.
+ *
+ * @return get this element as a primitive short value.
+ * @throws ClassCastException if the element is of not a {@link JsonPrimitive} and is not a valid
+ * short value.
+ * @throws IllegalStateException if the element is of the type {@link JsonArray} but contains
+ * more than a single element.
+ */
+ public short getAsShort() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * convenience method to get this element as an {@link Object} value.
+ *
+ * @return get this element as an Object value.
+ * @throws ClassCastException if the element is of not a {@link JsonPrimitive} and is not a valid
+ * Object value.
+ * @throws IllegalStateException if the element is of the type {@link JsonArray} but contains
+ * more than a single element.
+ */
+ Object getAsObject() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Returns a String representation of this element.
+ *
+ * @return String the string representation of this element. The output is valid Json.
+ */
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ toString(sb);
+ return sb.toString();
+ }
+
+ protected abstract void toString(StringBuilder sb);
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonElementVisitor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonElementVisitor.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonElementVisitor.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+/**
+ * Definition of a visitor for a JsonElement tree.
+ *
+ * @author Inderjeet Singh
+ */
+interface JsonElementVisitor {
+ void visitPrimitive(JsonPrimitive primitive);
+ void visitNull();
+
+ void startArray(JsonArray array);
+ void visitArrayMember(JsonArray parent, JsonPrimitive member, boolean isFirst);
+ void visitArrayMember(JsonArray parent, JsonArray member, boolean isFirst);
+ void visitArrayMember(JsonArray parent, JsonObject member, boolean isFirst);
+ void visitNullArrayMember(JsonArray parent, boolean isFirst);
+ void endArray(JsonArray array);
+
+ void startObject(JsonObject object);
+ void visitObjectMember(JsonObject parent, String memberName, JsonPrimitive member,
+ boolean isFirst);
+ void visitObjectMember(JsonObject parent, String memberName, JsonArray member, boolean isFirst);
+ void visitObjectMember(JsonObject parent, String memberName, JsonObject member, boolean isFirst);
+ void visitNullObjectMember(JsonObject parent, String memberName, boolean isFirst);
+ void endObject(JsonObject object);
+}
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonEscapingVisitor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonEscapingVisitor.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonEscapingVisitor.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+/**
+ * Performs JSON escaping and passes on the new escaped value to the delegate
+ * {@link JsonElementVisitor}.
+ *
+ * @author Joel Leitch
+ */
+class JsonEscapingVisitor extends DelegatingJsonElementVisitor {
+
+ /**
+ * Constructs a Visitor that will properly escape any JSON primitive values.
+ *
+ * @param delegate the JsonElementVisitor that this instance will use for delegation
+ */
+ protected JsonEscapingVisitor(JsonElementVisitor delegate) {
+ super(delegate);
+ }
+
+ @Override
+ public void visitArrayMember(JsonArray parent, JsonPrimitive member, boolean isFirst) {
+ super.visitArrayMember(parent, escapeJsonPrimitive(member), isFirst);
+ }
+
+ @Override
+ public void visitObjectMember(
+ JsonObject parent, String memberName, JsonPrimitive member, boolean isFirst) {
+ super.visitObjectMember(parent, memberName, escapeJsonPrimitive(member), isFirst);
+ }
+
+ @Override
+ public void visitPrimitive(JsonPrimitive primitive) {
+ super.visitPrimitive(escapeJsonPrimitive(primitive));
+ }
+
+ private JsonPrimitive escapeJsonPrimitive(JsonPrimitive member) {
+ if (member.isString()) {
+ String memberValue = member.getAsString();
+ String escapedValue = Escaper.escapeJsonString(memberValue);
+ if (!escapedValue.equals(memberValue)) {
+ member.setValue(escapedValue);
+ }
+ }
+ return member;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonFieldNameValidator.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonFieldNameValidator.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonFieldNameValidator.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * This class can be used to check the validity of a JSON field name.
+ *
+ * <p>The primary use of this object is to ensure that any Java fields that use the
+ * {@link com.google.gson.annotations.SerializedName} annotation is providing valid JSON
+ * field names. This will make the code fail-fast rather than letting the invalid
+ * field name propagate to the client and it fails to parse.</p>
+ *
+ * @author Joel Leitch
+ */
+class JsonFieldNameValidator {
+ private static final String[] JS_KEYWORDS = {
+ "break", "case", "catch", "class", "comment", "const", "continue", "debugger", "default", "delete", "do",
+ "else", "enum", "export", "extends", "finally", "for", "function", "if", "import", "in", "label", "new",
+ "return", "super", "switch", "this", "throw", "try", "typeof", "var", "void", "while", "with"
+ };
+
+ private static final Pattern JSON_FIELD_NAME_PATTERN =
+ Pattern.compile("(^[a-zA-Z][a-zA-Z0-9\\$_]*$)|(^[\\$_][a-zA-Z][a-zA-Z0-9\\$_]*$)");
+
+ private static final Set<String> KEYWORDS = Collections.unmodifiableSet(
+ new HashSet<String>(Arrays.asList(JS_KEYWORDS)));
+
+ /**
+ * Performs validation on the JSON field name to ensure it is a valid field name.
+ *
+ * @param fieldName the name of the field to validate
+ * @return {@code fieldName} if it is a valid JSON field name
+ * @throws IllegalArgumentException if the field name is an invalid JSON field name
+ */
+ public String validate(String fieldName) {
+ Preconditions.checkNotNull(fieldName);
+ Preconditions.checkArgument(!"".equals(fieldName.trim()));
+ Preconditions.checkArgument(!KEYWORDS.contains(fieldName));
+
+ Matcher matcher = JSON_FIELD_NAME_PATTERN.matcher(fieldName);
+ if (!matcher.matches()) {
+ throw new IllegalArgumentException(fieldName + " is not a valid JSON field name.");
+ } else {
+ return fieldName;
+ }
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonFormatter.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonFormatter.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonFormatter.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.io.PrintWriter;
+
+/**
+ * Common interface for a formatter for Json.
+ *
+ * @author Inderjeet Singh
+ */
+interface JsonFormatter {
+
+ /**
+ * Writes a formatted version of the Json corresponding to
+ * the specified Json.
+ *
+ * @param root the root of the Json tree.
+ * @param writer the writer to output the formatter JSON to.
+ * @param serializeNulls serialize null values in the output.
+ */
+ public void format(JsonElement root, PrintWriter writer, boolean serializeNulls);
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonNull.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonNull.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonNull.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+/**
+ * A class representing a Json null value.
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ * @since 1.2
+ */
+public final class JsonNull extends JsonElement {
+
+ @Override
+ protected void toString(StringBuilder sb) {
+ sb.append("null");
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonObject.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonObject.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonObject.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+/**
+ * A class representing an object type in Json. An object consists of name-value pairs where names
+ * are strings, and values are any other type of {@link JsonElement}. This allows for a creating a
+ * tree of JsonElements. The member elements of this object are maintained in order they were added.
+ *
+ * @author Inderjeet Singh
+ */
+public final class JsonObject extends JsonElement {
+ // We are using a linked hash map because it is important to preserve
+ // the order in which elements are inserted. This is needed to ensure
+ // that the fields of an object are inserted in the order they were
+ // defined in the class.
+ private final Map<String, JsonElement> members;
+
+ /**
+ * Creates an empty JsonObject.
+ */
+ public JsonObject() {
+ members = new LinkedHashMap<String, JsonElement>();
+ }
+
+ /**
+ * Adds a member, which is a name-value pair, to self. The name must be a String, but the value
+ * can be an arbitrary JsonElement, thereby allowing you to build a full tree of JsonElements
+ * rooted at this node.
+ *
+ * @param property name of the member.
+ * @param value the member object.
+ */
+ public void add(String property, JsonElement value) {
+ members.put(property, value);
+ }
+
+ /**
+ * Convenience method to add a primitive member. The specified value is converted to a
+ * JsonPrimitive of String.
+ *
+ * @param property name of the member.
+ * @param value the string value associated with the member.
+ */
+ public void addProperty(String property, String value) {
+ members.put(property, new JsonPrimitive(value));
+ }
+
+ /**
+ * Convenience method to add a primitive member. The specified value is converted to a
+ * JsonPrimitive of Number.
+ *
+ * @param property name of the member.
+ * @param value the number value associated with the member.
+ */
+ public void addProperty(String property, Number value) {
+ members.put(property, new JsonPrimitive(value));
+ }
+
+ /**
+ * Returns a set of members of this object. The set is ordered, and the order is in which the
+ * elements were added.
+ *
+ * @return a set of members of this object.
+ */
+ public Set<Entry<String, JsonElement>> entrySet() {
+ return members.entrySet();
+ }
+
+ /**
+ * Convenience method to check if a member with the specified name is present in this object.
+ *
+ * @param memberName name of the member that is being checked for presence.
+ * @return true if there is a member with the specified name, false otherwise.
+ */
+ public boolean has(String memberName) {
+ return members.containsKey(memberName);
+ }
+
+ /**
+ * Returns the member with the specified name.
+ *
+ * @param memberName name of the member that is being requested.
+ * @return the member matching the name. Null if no such member exists.
+ */
+ public JsonElement get(String memberName) {
+ return members.get(memberName);
+ }
+
+ /**
+ * Convenience method to get the specified member as a JsonPrimitive element.
+ *
+ * @param memberName name of the member being requested.
+ * @return the JsonPrimitive corresponding to the specified member.
+ */
+ public JsonPrimitive getAsJsonPrimitive(String memberName) {
+ return (JsonPrimitive) members.get(memberName);
+ }
+
+ /**
+ * Convenience method to get the specified member as a JsonArray.
+ *
+ * @param memberName name of the member being requested.
+ * @return the JsonArray corresponding to the specified member.
+ */
+ public JsonArray getAsJsonArray(String memberName) {
+ return (JsonArray) members.get(memberName);
+ }
+
+ /**
+ * Convenience method to get the specified member as a JsonObject.
+ *
+ * @param memberName name of the member being requested.
+ * @return the JsonObject corresponding to the specified member.
+ */
+ public JsonObject getAsJsonObject(String memberName) {
+ return (JsonObject) members.get(memberName);
+ }
+
+ @Override
+ protected void toString(StringBuilder sb) {
+ sb.append('{');
+ boolean first = true;
+ for (Map.Entry<String, JsonElement> entry : members.entrySet()) {
+ if (first) {
+ first = false;
+ } else {
+ sb.append(',');
+ }
+ sb.append('\"');
+ sb.append(entry.getKey());
+ sb.append("\":");
+ entry.getValue().toString(sb);
+ }
+ sb.append('}');
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonObjectDeserializationVisitor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonObjectDeserializationVisitor.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonObjectDeserializationVisitor.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,150 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Type;
+import java.util.Collection;
+
+/**
+ * A visitor that populates fields of an object with data from its equivalent
+ * JSON representation
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ */
+final class JsonObjectDeserializationVisitor<T> extends JsonDeserializationVisitor<T> {
+
+ JsonObjectDeserializationVisitor(JsonElement json, Type type,
+ ObjectNavigatorFactory factory, ObjectConstructor objectConstructor,
+ TypeAdapter typeAdapter, ParameterizedTypeHandlerMap<JsonDeserializer<?>> deserializers,
+ JsonDeserializationContext context) {
+ super(json, type, factory, objectConstructor, typeAdapter, deserializers, context);
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ protected T constructTarget() {
+ return (T) objectConstructor.construct(targetType);
+ }
+
+ public void startVisitingObject(Object node) {
+ // do nothing
+ }
+
+ public void endVisitingObject(Object node) {
+ // do nothing
+ }
+
+ public void visitCollection(@SuppressWarnings("unchecked")Collection collection,
+ Type componentType) {
+ // should not be called since this case should invoke JsonArrayDeserializationVisitor
+ throw new IllegalStateException();
+ }
+
+ public void visitArray(Object array, Type componentType) {
+ // should not be called since this case should invoke JsonArrayDeserializationVisitor
+ throw new IllegalStateException();
+ }
+
+ public void visitPrimitiveValue(Object obj) {
+ // should not be called since this case should invoke JsonPrimitiveDeserializationVisitor
+ throw new IllegalStateException();
+ }
+
+ public void visitObjectField(Field f, Type typeOfF, Object obj) {
+ try {
+ JsonObject jsonObject = json.getAsJsonObject();
+ String fName = getFieldName(f);
+ JsonElement jsonChild = jsonObject.get(fName);
+ if (jsonChild != null) {
+ Object child = visitChildAsObject(typeOfF, jsonChild);
+ f.set(obj, child);
+ } else {
+ f.set(obj, null);
+ }
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public void visitCollectionField(Field f, Type typeOfF, Object obj) {
+ try {
+ JsonObject jsonObject = json.getAsJsonObject();
+ String fName = getFieldName(f);
+ JsonArray jsonArray = (JsonArray) jsonObject.get(fName);
+ if (jsonArray != null) {
+ Collection collection = (Collection) objectConstructor.construct(typeOfF);
+ f.set(obj, collection);
+ Type childType = TypeUtils.getActualTypeForFirstTypeVariable(typeOfF);
+ for (JsonElement jsonChild : jsonArray) {
+ Object child = visitChild(childType, jsonChild);
+ if (childType == Object.class) {
+ throw new JsonParseException(fName +
+ " can not be a raw collection. Try making it a genericized collection instead");
+ }
+ collection.add(child);
+ }
+ } else {
+ f.set(obj, null);
+ }
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void visitArrayField(Field f, Type typeOfF, Object obj) {
+ try {
+ JsonObject jsonObject = json.getAsJsonObject();
+ String fName = getFieldName(f);
+ JsonArray jsonChild = (JsonArray) jsonObject.get(fName);
+ if (jsonChild != null) {
+ Object array = visitChildAsArray(typeOfF, jsonChild);
+ f.set(obj, array);
+ } else {
+ f.set(obj, null);
+ }
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void visitPrimitiveField(Field f, Type typeOfF, Object obj) {
+ try {
+ JsonObject jsonObject = json.getAsJsonObject();
+ String fName = getFieldName(f);
+ JsonPrimitive value = jsonObject.getAsJsonPrimitive(fName);
+ if (value != null) {
+ f.set(obj, typeAdapter.adaptType(value.getAsObject(), TypeUtils.toRawClass(typeOfF)));
+ } else {
+ // For Strings, we need to set the field to null
+ // For other primitive types, any value created during default construction is fine
+ if (f.getType() == String.class) {
+ f.set(obj, null);
+ }
+ }
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private String getFieldName(Field f) {
+ FieldNamingStrategy namingPolicy = factory.getFieldNamingPolicy();
+ return namingPolicy.translateName(f);
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonParseException.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonParseException.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonParseException.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+/**
+ * This exception is raised if there is a serious issue that occurs during parsing of a Json
+ * string. One of the main usages for this class is for the Gson infrastructure. If the incoming
+ * Json is bad/malicious, an instance of this exception is raised.
+ *
+ * <p>This exception is a {@link RuntimeException} because it is exposed to the client. Using a
+ * {@link RuntimeException} avoids bad coding practices on the client side where they catch the
+ * exception and do nothing. It is often the case that you want to blow up if there is a parsing
+ * error (i.e. often clients do not know how to recover from a {@link JsonParseException}.</p>
+ *
+ * @author Joel Leitch
+ */
+public final class JsonParseException extends RuntimeException {
+ static final long serialVersionUID = -4086729973971783390L;
+
+ /**
+ * Creates exception with the specified message. If you are wrapping another exception, consider
+ * using {@link #JsonParseException(String, Throwable)} instead.
+ *
+ * @param msg error message describing a possible cause of this exception.
+ */
+ public JsonParseException(String msg) {
+ super(msg);
+ }
+
+ /**
+ * Creates exception with the specified message and cause.
+ *
+ * @param msg error message describing what happened.
+ * @param cause root exception that caused this exception to be thrown.
+ */
+ public JsonParseException(String msg, Throwable cause) {
+ super(msg, cause);
+ }
+
+ /**
+ * Creates exception with the specified cause. Consider using
+ * {@link #JsonParseException(String, Throwable)} instead if you can describe what happened.
+ *
+ * @param cause root exception that caused this exception to be thrown.
+ */
+ public JsonParseException(Throwable cause) {
+ super(cause);
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonParser.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonParser.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonParser.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,444 @@
+/* Generated By:JavaCC: Do not edit this line. JsonParser.java */
+package com.google.gson;
+
+ at SuppressWarnings("all")
+final class JsonParser implements JsonParserConstants {
+
+ final public JsonElement parse() throws ParseException {
+ JsonElement json = null;
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case 20:
+ json = JsonObject();
+ break;
+ case 25:
+ json = JsonArray();
+ break;
+ case DIGITS:
+ case SINGLE_QUOTE_LITERAL:
+ case DOUBLE_QUOTE_LITERAL:
+ case 27:
+ case 28:
+ case 29:
+ json = JsonPrimitive();
+ break;
+ case 22:
+ json = JsonNull();
+ break;
+ default:
+ jj_la1[0] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ {if (true) return json;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final private JsonObject JsonObject() throws ParseException {
+ JsonObject o = new JsonObject();
+ jj_consume_token(20);
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case SINGLE_QUOTE_LITERAL:
+ case DOUBLE_QUOTE_LITERAL:
+ Members(o);
+ break;
+ default:
+ jj_la1[1] = jj_gen;
+ ;
+ }
+ jj_consume_token(21);
+ {if (true) return o;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final private JsonNull JsonNull() throws ParseException {
+ JsonNull json = new JsonNull();
+ jj_consume_token(22);
+ {if (true) return json;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final private void Members(JsonObject o) throws ParseException {
+ Pair(o);
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case 23:
+ jj_consume_token(23);
+ Members(o);
+ break;
+ default:
+ jj_la1[2] = jj_gen;
+ ;
+ }
+ }
+
+ final private void Pair(JsonObject o) throws ParseException {
+ JsonPrimitive property;
+ JsonElement value;
+ property = JsonString();
+ jj_consume_token(24);
+ value = JsonValue();
+ o.add(property.getAsString(), value);
+ }
+
+ final private JsonArray JsonArray() throws ParseException {
+ JsonArray array = new JsonArray();
+ jj_consume_token(25);
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case DIGITS:
+ case SINGLE_QUOTE_LITERAL:
+ case DOUBLE_QUOTE_LITERAL:
+ case 20:
+ case 22:
+ case 25:
+ case 27:
+ case 28:
+ case 29:
+ Elements(array);
+ break;
+ default:
+ jj_la1[3] = jj_gen;
+ ;
+ }
+ jj_consume_token(26);
+ array.reverse();
+ {if (true) return array;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final private void Elements(JsonArray array) throws ParseException {
+ JsonElement element;
+ element = JsonValue();
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case 23:
+ jj_consume_token(23);
+ Elements(array);
+ break;
+ default:
+ jj_la1[4] = jj_gen;
+ ;
+ }
+ array.add(element);
+ }
+
+ final private JsonElement JsonValue() throws ParseException {
+ JsonElement o = null;
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case SINGLE_QUOTE_LITERAL:
+ case DOUBLE_QUOTE_LITERAL:
+ o = JsonString();
+ break;
+ case DIGITS:
+ case 29:
+ o = JsonNumber();
+ break;
+ case 20:
+ o = JsonObject();
+ break;
+ case 25:
+ o = JsonArray();
+ break;
+ case 27:
+ jj_consume_token(27);
+ o = new JsonPrimitive(true);
+ break;
+ case 28:
+ jj_consume_token(28);
+ o = new JsonPrimitive(false);
+ break;
+ case 22:
+ jj_consume_token(22);
+ break;
+ default:
+ jj_la1[5] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ {if (true) return o;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final private JsonPrimitive JsonPrimitive() throws ParseException {
+ JsonPrimitive value;
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case SINGLE_QUOTE_LITERAL:
+ case DOUBLE_QUOTE_LITERAL:
+ value = JsonString();
+ {if (true) return value;}
+ break;
+ case DIGITS:
+ case 29:
+ value = JsonNumber();
+ {if (true) return value;}
+ break;
+ case 27:
+ jj_consume_token(27);
+ {if (true) return new JsonPrimitive(true);}
+ break;
+ case 28:
+ jj_consume_token(28);
+ {if (true) return new JsonPrimitive(false);}
+ break;
+ default:
+ jj_la1[6] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final private JsonPrimitive JsonNumber() throws ParseException {
+ String intpart = null,
+ fracpart = null,
+ exppart = null;
+ intpart = JsonInt();
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case 30:
+ fracpart = JsonFrac();
+ break;
+ default:
+ jj_la1[7] = jj_gen;
+ ;
+ }
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case E:
+ exppart = JsonExp();
+ break;
+ default:
+ jj_la1[8] = jj_gen;
+ ;
+ }
+ Number n;
+ if (exppart != null) {
+ n = new java.math.BigDecimal(intpart + fracpart + exppart);
+ } else if (fracpart != null) {
+ n = new Double(intpart + fracpart);
+ } else {
+ // See if the number fits in an integer, or long
+ // Use BigInteger only if it is big enough.
+ if (intpart.length() < 10) {
+ n = new Integer(intpart);
+ } else if (intpart.length() < 19) {
+ n = new Long(intpart);
+ } else {
+ n = new java.math.BigInteger(intpart);
+ }
+ }
+ {if (true) return new JsonPrimitive(n);}
+ throw new Error("Missing return statement in function");
+ }
+
+ final private String JsonInt() throws ParseException {
+ String digits;
+ boolean negative = false;
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case 29:
+ jj_consume_token(29);
+ negative = true;
+ break;
+ default:
+ jj_la1[9] = jj_gen;
+ ;
+ }
+ digits = Digits();
+ if(negative)
+ {if (true) return "-" + digits;}
+ {if (true) return digits;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final private String JsonFrac() throws ParseException {
+ String digits;
+ jj_consume_token(30);
+ digits = Digits();
+ {if (true) return "." + digits;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final private String JsonExp() throws ParseException {
+ Token t;
+ String digits;
+ t = jj_consume_token(E);
+ digits = Digits();
+ {if (true) return t.image + digits;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final private String Digits() throws ParseException {
+ Token t;
+ t = jj_consume_token(DIGITS);
+ {if (true) return t.image;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final private JsonPrimitive JsonString() throws ParseException {
+ Token t;
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case SINGLE_QUOTE_LITERAL:
+ t = jj_consume_token(SINGLE_QUOTE_LITERAL);
+ break;
+ case DOUBLE_QUOTE_LITERAL:
+ t = jj_consume_token(DOUBLE_QUOTE_LITERAL);
+ break;
+ default:
+ jj_la1[10] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ String value = StringUnmarshaller.unmarshall(t.image);
+ {if (true) return new JsonPrimitive(value);}
+ throw new Error("Missing return statement in function");
+ }
+
+ public JsonParserTokenManager token_source;
+ SimpleCharStream jj_input_stream;
+ public Token token, jj_nt;
+ private int jj_ntk;
+ private int jj_gen;
+ final private int[] jj_la1 = new int[11];
+ static private int[] jj_la1_0;
+ static {
+ jj_la1_0();
+ }
+ private static void jj_la1_0() {
+ jj_la1_0 = new int[] {0x3a500c40,0xc00,0x800000,0x3a500c40,0x800000,0x3a500c40,0x38000c40,0x40000000,0x20,0x20000000,0xc00,};
+ }
+
+ public JsonParser(java.io.InputStream stream) {
+ this(stream, null);
+ }
+ public JsonParser(java.io.InputStream stream, String encoding) {
+ try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
+ token_source = new JsonParserTokenManager(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 11; i++) jj_la1[i] = -1;
+ }
+
+ public void ReInit(java.io.InputStream stream) {
+ ReInit(stream, null);
+ }
+ public void ReInit(java.io.InputStream stream, String encoding) {
+ try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
+ token_source.ReInit(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 11; i++) jj_la1[i] = -1;
+ }
+
+ public JsonParser(java.io.Reader stream) {
+ jj_input_stream = new SimpleCharStream(stream, 1, 1);
+ token_source = new JsonParserTokenManager(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 11; i++) jj_la1[i] = -1;
+ }
+
+ public void ReInit(java.io.Reader stream) {
+ jj_input_stream.ReInit(stream, 1, 1);
+ token_source.ReInit(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 11; i++) jj_la1[i] = -1;
+ }
+
+ public JsonParser(JsonParserTokenManager tm) {
+ token_source = tm;
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 11; i++) jj_la1[i] = -1;
+ }
+
+ public void ReInit(JsonParserTokenManager tm) {
+ token_source = tm;
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 11; i++) jj_la1[i] = -1;
+ }
+
+ final private Token jj_consume_token(int kind) throws ParseException {
+ Token oldToken;
+ if ((oldToken = token).next != null) token = token.next;
+ else token = token.next = token_source.getNextToken();
+ jj_ntk = -1;
+ if (token.kind == kind) {
+ jj_gen++;
+ return token;
+ }
+ token = oldToken;
+ jj_kind = kind;
+ throw generateParseException();
+ }
+
+ final public Token getNextToken() {
+ if (token.next != null) token = token.next;
+ else token = token.next = token_source.getNextToken();
+ jj_ntk = -1;
+ jj_gen++;
+ return token;
+ }
+
+ final public Token getToken(int index) {
+ Token t = token;
+ for (int i = 0; i < index; i++) {
+ if (t.next != null) t = t.next;
+ else t = t.next = token_source.getNextToken();
+ }
+ return t;
+ }
+
+ final private int jj_ntk() {
+ if ((jj_nt=token.next) == null)
+ return (jj_ntk = (token.next=token_source.getNextToken()).kind);
+ else
+ return (jj_ntk = jj_nt.kind);
+ }
+
+ private java.util.Vector jj_expentries = new java.util.Vector();
+ private int[] jj_expentry;
+ private int jj_kind = -1;
+
+ public ParseException generateParseException() {
+ jj_expentries.removeAllElements();
+ boolean[] la1tokens = new boolean[31];
+ for (int i = 0; i < 31; i++) {
+ la1tokens[i] = false;
+ }
+ if (jj_kind >= 0) {
+ la1tokens[jj_kind] = true;
+ jj_kind = -1;
+ }
+ for (int i = 0; i < 11; i++) {
+ if (jj_la1[i] == jj_gen) {
+ for (int j = 0; j < 32; j++) {
+ if ((jj_la1_0[i] & (1<<j)) != 0) {
+ la1tokens[j] = true;
+ }
+ }
+ }
+ }
+ for (int i = 0; i < 31; i++) {
+ if (la1tokens[i]) {
+ jj_expentry = new int[1];
+ jj_expentry[0] = i;
+ jj_expentries.addElement(jj_expentry);
+ }
+ }
+ int[][] exptokseq = new int[jj_expentries.size()][];
+ for (int i = 0; i < jj_expentries.size(); i++) {
+ exptokseq[i] = (int[])jj_expentries.elementAt(i);
+ }
+ return new ParseException(token, exptokseq, tokenImage);
+ }
+
+ final public void enable_tracing() {
+ }
+
+ final public void disable_tracing() {
+ }
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonParserConstants.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonParserConstants.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonParserConstants.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,60 @@
+/* Generated By:JavaCC: Do not edit this line. JsonParserConstants.java */
+package com.google.gson;
+
+interface JsonParserConstants {
+
+ int EOF = 0;
+ int E = 5;
+ int DIGITS = 6;
+ int HEX_CHAR = 7;
+ int UNICODE_CHAR = 8;
+ int ESCAPE_CHAR = 9;
+ int SINGLE_QUOTE_LITERAL = 10;
+ int DOUBLE_QUOTE_LITERAL = 11;
+ int QUOTE = 12;
+ int ENDQUOTE = 14;
+ int CHAR = 15;
+ int CNTRL_ESC = 16;
+ int HEX = 18;
+ int HEX_ESC = 19;
+
+ int DEFAULT = 0;
+ int STRING_STATE = 1;
+ int ESC_STATE = 2;
+ int HEX_STATE = 3;
+
+ String[] tokenImage = {
+ "<EOF>",
+ "\" \"",
+ "\"\\t\"",
+ "\"\\n\"",
+ "\"\\r\"",
+ "<E>",
+ "<DIGITS>",
+ "<HEX_CHAR>",
+ "<UNICODE_CHAR>",
+ "<ESCAPE_CHAR>",
+ "<SINGLE_QUOTE_LITERAL>",
+ "<DOUBLE_QUOTE_LITERAL>",
+ "\"\\\"\"",
+ "\"\\\\\"",
+ "<ENDQUOTE>",
+ "<CHAR>",
+ "<CNTRL_ESC>",
+ "\"u\"",
+ "<HEX>",
+ "<HEX_ESC>",
+ "\"{\"",
+ "\"}\"",
+ "\"null\"",
+ "\",\"",
+ "\":\"",
+ "\"[\"",
+ "\"]\"",
+ "\"true\"",
+ "\"false\"",
+ "\"-\"",
+ "\".\"",
+ };
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonParserTokenManager.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonParserTokenManager.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonParserTokenManager.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,1004 @@
+/* Generated By:JavaCC: Do not edit this line. JsonParserTokenManager.java */
+package com.google.gson;
+
+ at SuppressWarnings("all")
+final class JsonParserTokenManager implements JsonParserConstants
+{
+ public java.io.PrintStream debugStream = System.out;
+ public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
+private final int jjMoveStringLiteralDfa0_3()
+{
+ return jjMoveNfa_3(0, 0);
+}
+private final void jjCheckNAdd(int state)
+{
+ if (jjrounds[state] != jjround)
+ {
+ jjstateSet[jjnewStateCnt++] = state;
+ jjrounds[state] = jjround;
+ }
+}
+private final void jjAddStates(int start, int end)
+{
+ do {
+ jjstateSet[jjnewStateCnt++] = jjnextStates[start];
+ } while (start++ != end);
+}
+private final void jjCheckNAddTwoStates(int state1, int state2)
+{
+ jjCheckNAdd(state1);
+ jjCheckNAdd(state2);
+}
+private final void jjCheckNAddStates(int start, int end)
+{
+ do {
+ jjCheckNAdd(jjnextStates[start]);
+ } while (start++ != end);
+}
+private final void jjCheckNAddStates(int start)
+{
+ jjCheckNAdd(jjnextStates[start]);
+ jjCheckNAdd(jjnextStates[start + 1]);
+}
+private final int jjMoveNfa_3(int startState, int curPos)
+{
+ int[] nextStates;
+ int startsAt = 0;
+ jjnewStateCnt = 4;
+ int i = 1;
+ jjstateSet[0] = startState;
+ int j, kind = 0x7fffffff;
+ for (;;)
+ {
+ if (++jjround == 0x7fffffff)
+ ReInitRounds();
+ if (curChar < 64)
+ {
+ long l = 1L << curChar;
+ MatchLoop: do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 0:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 1;
+ break;
+ case 1:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 2;
+ break;
+ case 2:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 3;
+ break;
+ case 3:
+ if ((0x3ff000000000000L & l) != 0L && kind > 19)
+ kind = 19;
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ else if (curChar < 128)
+ {
+ long l = 1L << (curChar & 077);
+ MatchLoop: do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 0:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 1;
+ break;
+ case 1:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 2;
+ break;
+ case 2:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 3;
+ break;
+ case 3:
+ if ((0x7e0000007eL & l) != 0L && kind > 19)
+ kind = 19;
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ else
+ {
+ int hiByte = (int)(curChar >> 8);
+ int i1 = hiByte >> 6;
+ long l1 = 1L << (hiByte & 077);
+ int i2 = (curChar & 0xff) >> 6;
+ long l2 = 1L << (curChar & 077);
+ MatchLoop: do
+ {
+ switch(jjstateSet[--i])
+ {
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ if (kind != 0x7fffffff)
+ {
+ jjmatchedKind = kind;
+ jjmatchedPos = curPos;
+ kind = 0x7fffffff;
+ }
+ ++curPos;
+ if ((i = jjnewStateCnt) == (startsAt = 4 - (jjnewStateCnt = startsAt)))
+ return curPos;
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) { return curPos; }
+ }
+}
+private final int jjStopStringLiteralDfa_0(int pos, long active0)
+{
+ switch (pos)
+ {
+ case 0:
+ if ((active0 & 0x1000L) != 0L)
+ return 31;
+ return -1;
+ default :
+ return -1;
+ }
+}
+private final int jjStartNfa_0(int pos, long active0)
+{
+ return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
+}
+private final int jjStopAtPos(int pos, int kind)
+{
+ jjmatchedKind = kind;
+ jjmatchedPos = pos;
+ return pos + 1;
+}
+private final int jjStartNfaWithStates_0(int pos, int kind, int state)
+{
+ jjmatchedKind = kind;
+ jjmatchedPos = pos;
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) { return pos + 1; }
+ return jjMoveNfa_0(state, pos + 1);
+}
+private final int jjMoveStringLiteralDfa0_0()
+{
+ switch(curChar)
+ {
+ case 34:
+ return jjStartNfaWithStates_0(0, 12, 31);
+ case 44:
+ return jjStopAtPos(0, 23);
+ case 45:
+ return jjStopAtPos(0, 29);
+ case 46:
+ return jjStopAtPos(0, 30);
+ case 58:
+ return jjStopAtPos(0, 24);
+ case 91:
+ return jjStopAtPos(0, 25);
+ case 93:
+ return jjStopAtPos(0, 26);
+ case 102:
+ return jjMoveStringLiteralDfa1_0(0x10000000L);
+ case 110:
+ return jjMoveStringLiteralDfa1_0(0x400000L);
+ case 116:
+ return jjMoveStringLiteralDfa1_0(0x8000000L);
+ case 123:
+ return jjStopAtPos(0, 20);
+ case 125:
+ return jjStopAtPos(0, 21);
+ default :
+ return jjMoveNfa_0(0, 0);
+ }
+}
+private final int jjMoveStringLiteralDfa1_0(long active0)
+{
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(0, active0);
+ return 1;
+ }
+ switch(curChar)
+ {
+ case 97:
+ return jjMoveStringLiteralDfa2_0(active0, 0x10000000L);
+ case 114:
+ return jjMoveStringLiteralDfa2_0(active0, 0x8000000L);
+ case 117:
+ return jjMoveStringLiteralDfa2_0(active0, 0x400000L);
+ default :
+ break;
+ }
+ return jjStartNfa_0(0, active0);
+}
+private final int jjMoveStringLiteralDfa2_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(0, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(1, active0);
+ return 2;
+ }
+ switch(curChar)
+ {
+ case 108:
+ return jjMoveStringLiteralDfa3_0(active0, 0x10400000L);
+ case 117:
+ return jjMoveStringLiteralDfa3_0(active0, 0x8000000L);
+ default :
+ break;
+ }
+ return jjStartNfa_0(1, active0);
+}
+private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(1, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(2, active0);
+ return 3;
+ }
+ switch(curChar)
+ {
+ case 101:
+ if ((active0 & 0x8000000L) != 0L)
+ return jjStopAtPos(3, 27);
+ break;
+ case 108:
+ if ((active0 & 0x400000L) != 0L)
+ return jjStopAtPos(3, 22);
+ break;
+ case 115:
+ return jjMoveStringLiteralDfa4_0(active0, 0x10000000L);
+ default :
+ break;
+ }
+ return jjStartNfa_0(2, active0);
+}
+private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(2, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(3, active0);
+ return 4;
+ }
+ switch(curChar)
+ {
+ case 101:
+ if ((active0 & 0x10000000L) != 0L)
+ return jjStopAtPos(4, 28);
+ break;
+ default :
+ break;
+ }
+ return jjStartNfa_0(3, active0);
+}
+static final long[] jjbitVec0 = {
+ 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+static final long[] jjbitVec2 = {
+ 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+private final int jjMoveNfa_0(int startState, int curPos)
+{
+ int[] nextStates;
+ int startsAt = 0;
+ jjnewStateCnt = 31;
+ int i = 1;
+ jjstateSet[0] = startState;
+ int j, kind = 0x7fffffff;
+ for (;;)
+ {
+ if (++jjround == 0x7fffffff)
+ ReInitRounds();
+ if (curChar < 64)
+ {
+ long l = 1L << curChar;
+ MatchLoop: do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 31:
+ if ((0xfffffffbffffdbffL & l) != 0L)
+ jjCheckNAddStates(0, 3);
+ else if (curChar == 34)
+ {
+ if (kind > 11)
+ kind = 11;
+ }
+ break;
+ case 0:
+ if ((0x3ff000000000000L & l) != 0L)
+ {
+ if (kind > 6)
+ kind = 6;
+ jjCheckNAdd(2);
+ }
+ else if (curChar == 34)
+ jjCheckNAddStates(0, 3);
+ else if (curChar == 39)
+ jjCheckNAddStates(4, 7);
+ break;
+ case 1:
+ if ((0x280000000000L & l) != 0L && kind > 5)
+ kind = 5;
+ break;
+ case 2:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 6)
+ kind = 6;
+ jjCheckNAdd(2);
+ break;
+ case 4:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 5;
+ break;
+ case 5:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 6;
+ break;
+ case 6:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 7;
+ break;
+ case 7:
+ if ((0x3ff000000000000L & l) != 0L && kind > 8)
+ kind = 8;
+ break;
+ case 9:
+ if (curChar == 39)
+ jjCheckNAddStates(4, 7);
+ break;
+ case 10:
+ if ((0xffffff7fffffdbffL & l) != 0L)
+ jjCheckNAddStates(4, 7);
+ break;
+ case 12:
+ if ((0x8400000000L & l) != 0L)
+ jjCheckNAddStates(4, 7);
+ break;
+ case 14:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 15;
+ break;
+ case 15:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 16;
+ break;
+ case 16:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 17;
+ break;
+ case 17:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddStates(4, 7);
+ break;
+ case 19:
+ if (curChar == 39 && kind > 10)
+ kind = 10;
+ break;
+ case 20:
+ if (curChar == 34)
+ jjCheckNAddStates(0, 3);
+ break;
+ case 21:
+ if ((0xfffffffbffffdbffL & l) != 0L)
+ jjCheckNAddStates(0, 3);
+ break;
+ case 23:
+ if ((0x8400000000L & l) != 0L)
+ jjCheckNAddStates(0, 3);
+ break;
+ case 25:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 26;
+ break;
+ case 26:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 27;
+ break;
+ case 27:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 28;
+ break;
+ case 28:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddStates(0, 3);
+ break;
+ case 30:
+ if (curChar == 34 && kind > 11)
+ kind = 11;
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ else if (curChar < 128)
+ {
+ long l = 1L << (curChar & 077);
+ MatchLoop: do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 31:
+ if ((0xffffffffefffffffL & l) != 0L)
+ jjCheckNAddStates(0, 3);
+ else if (curChar == 92)
+ jjstateSet[jjnewStateCnt++] = 24;
+ if (curChar == 92)
+ jjstateSet[jjnewStateCnt++] = 23;
+ break;
+ case 0:
+ if ((0x2000000020L & l) != 0L)
+ {
+ if (kind > 5)
+ kind = 5;
+ jjstateSet[jjnewStateCnt++] = 1;
+ }
+ else if (curChar == 92)
+ jjstateSet[jjnewStateCnt++] = 3;
+ break;
+ case 3:
+ if (curChar == 117)
+ jjstateSet[jjnewStateCnt++] = 4;
+ break;
+ case 4:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 5;
+ break;
+ case 5:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 6;
+ break;
+ case 6:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 7;
+ break;
+ case 7:
+ if ((0x7e0000007eL & l) != 0L && kind > 8)
+ kind = 8;
+ break;
+ case 8:
+ if (curChar == 92)
+ jjstateSet[jjnewStateCnt++] = 3;
+ break;
+ case 10:
+ if ((0xffffffffefffffffL & l) != 0L)
+ jjCheckNAddStates(4, 7);
+ break;
+ case 11:
+ if (curChar == 92)
+ jjstateSet[jjnewStateCnt++] = 12;
+ break;
+ case 12:
+ if ((0x14404410000000L & l) != 0L)
+ jjCheckNAddStates(4, 7);
+ break;
+ case 13:
+ if (curChar == 117)
+ jjstateSet[jjnewStateCnt++] = 14;
+ break;
+ case 14:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 15;
+ break;
+ case 15:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 16;
+ break;
+ case 16:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 17;
+ break;
+ case 17:
+ if ((0x7e0000007eL & l) != 0L)
+ jjCheckNAddStates(4, 7);
+ break;
+ case 18:
+ if (curChar == 92)
+ jjstateSet[jjnewStateCnt++] = 13;
+ break;
+ case 21:
+ if ((0xffffffffefffffffL & l) != 0L)
+ jjCheckNAddStates(0, 3);
+ break;
+ case 22:
+ if (curChar == 92)
+ jjstateSet[jjnewStateCnt++] = 23;
+ break;
+ case 23:
+ if ((0x14404410000000L & l) != 0L)
+ jjCheckNAddStates(0, 3);
+ break;
+ case 24:
+ if (curChar == 117)
+ jjstateSet[jjnewStateCnt++] = 25;
+ break;
+ case 25:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 26;
+ break;
+ case 26:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 27;
+ break;
+ case 27:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 28;
+ break;
+ case 28:
+ if ((0x7e0000007eL & l) != 0L)
+ jjCheckNAddStates(0, 3);
+ break;
+ case 29:
+ if (curChar == 92)
+ jjstateSet[jjnewStateCnt++] = 24;
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ else
+ {
+ int hiByte = (int)(curChar >> 8);
+ int i1 = hiByte >> 6;
+ long l1 = 1L << (hiByte & 077);
+ int i2 = (curChar & 0xff) >> 6;
+ long l2 = 1L << (curChar & 077);
+ MatchLoop: do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 31:
+ case 21:
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+ jjCheckNAddStates(0, 3);
+ break;
+ case 10:
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+ jjAddStates(4, 7);
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ if (kind != 0x7fffffff)
+ {
+ jjmatchedKind = kind;
+ jjmatchedPos = curPos;
+ kind = 0x7fffffff;
+ }
+ ++curPos;
+ if ((i = jjnewStateCnt) == (startsAt = 31 - (jjnewStateCnt = startsAt)))
+ return curPos;
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) { return curPos; }
+ }
+}
+private final int jjStopStringLiteralDfa_2(int pos, long active0)
+{
+ switch (pos)
+ {
+ default :
+ return -1;
+ }
+}
+private final int jjStartNfa_2(int pos, long active0)
+{
+ return jjMoveNfa_2(jjStopStringLiteralDfa_2(pos, active0), pos + 1);
+}
+private final int jjStartNfaWithStates_2(int pos, int kind, int state)
+{
+ jjmatchedKind = kind;
+ jjmatchedPos = pos;
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) { return pos + 1; }
+ return jjMoveNfa_2(state, pos + 1);
+}
+private final int jjMoveStringLiteralDfa0_2()
+{
+ switch(curChar)
+ {
+ case 117:
+ return jjStopAtPos(0, 17);
+ default :
+ return jjMoveNfa_2(0, 0);
+ }
+}
+private final int jjMoveNfa_2(int startState, int curPos)
+{
+ int[] nextStates;
+ int startsAt = 0;
+ jjnewStateCnt = 1;
+ int i = 1;
+ jjstateSet[0] = startState;
+ int j, kind = 0x7fffffff;
+ for (;;)
+ {
+ if (++jjround == 0x7fffffff)
+ ReInitRounds();
+ if (curChar < 64)
+ {
+ long l = 1L << curChar;
+ MatchLoop: do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 0:
+ if ((0x800400000000L & l) != 0L)
+ kind = 16;
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ else if (curChar < 128)
+ {
+ long l = 1L << (curChar & 077);
+ MatchLoop: do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 0:
+ if ((0x14404410000000L & l) != 0L)
+ kind = 16;
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ else
+ {
+ int hiByte = (int)(curChar >> 8);
+ int i1 = hiByte >> 6;
+ long l1 = 1L << (hiByte & 077);
+ int i2 = (curChar & 0xff) >> 6;
+ long l2 = 1L << (curChar & 077);
+ MatchLoop: do
+ {
+ switch(jjstateSet[--i])
+ {
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ if (kind != 0x7fffffff)
+ {
+ jjmatchedKind = kind;
+ jjmatchedPos = curPos;
+ kind = 0x7fffffff;
+ }
+ ++curPos;
+ if ((i = jjnewStateCnt) == (startsAt = 1 - (jjnewStateCnt = startsAt)))
+ return curPos;
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) { return curPos; }
+ }
+}
+private final int jjStopStringLiteralDfa_1(int pos, long active0)
+{
+ switch (pos)
+ {
+ default :
+ return -1;
+ }
+}
+private final int jjStartNfa_1(int pos, long active0)
+{
+ return jjMoveNfa_1(jjStopStringLiteralDfa_1(pos, active0), pos + 1);
+}
+private final int jjStartNfaWithStates_1(int pos, int kind, int state)
+{
+ jjmatchedKind = kind;
+ jjmatchedPos = pos;
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) { return pos + 1; }
+ return jjMoveNfa_1(state, pos + 1);
+}
+private final int jjMoveStringLiteralDfa0_1()
+{
+ switch(curChar)
+ {
+ case 92:
+ return jjStopAtPos(0, 13);
+ default :
+ return jjMoveNfa_1(0, 0);
+ }
+}
+private final int jjMoveNfa_1(int startState, int curPos)
+{
+ int[] nextStates;
+ int startsAt = 0;
+ jjnewStateCnt = 2;
+ int i = 1;
+ jjstateSet[0] = startState;
+ int j, kind = 0x7fffffff;
+ for (;;)
+ {
+ if (++jjround == 0x7fffffff)
+ ReInitRounds();
+ if (curChar < 64)
+ {
+ long l = 1L << curChar;
+ MatchLoop: do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 0:
+ if ((0xfffffffbffffffffL & l) != 0L)
+ {
+ if (kind > 15)
+ kind = 15;
+ }
+ else if (curChar == 34)
+ {
+ if (kind > 14)
+ kind = 14;
+ }
+ break;
+ case 1:
+ if ((0xfffffffbffffffffL & l) != 0L)
+ kind = 15;
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ else if (curChar < 128)
+ {
+ long l = 1L << (curChar & 077);
+ MatchLoop: do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 0:
+ if ((0xffffffffefffffffL & l) != 0L)
+ kind = 15;
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ else
+ {
+ int hiByte = (int)(curChar >> 8);
+ int i1 = hiByte >> 6;
+ long l1 = 1L << (hiByte & 077);
+ int i2 = (curChar & 0xff) >> 6;
+ long l2 = 1L << (curChar & 077);
+ MatchLoop: do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 0:
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 15)
+ kind = 15;
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ if (kind != 0x7fffffff)
+ {
+ jjmatchedKind = kind;
+ jjmatchedPos = curPos;
+ kind = 0x7fffffff;
+ }
+ ++curPos;
+ if ((i = jjnewStateCnt) == (startsAt = 2 - (jjnewStateCnt = startsAt)))
+ return curPos;
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) { return curPos; }
+ }
+}
+static final int[] jjnextStates = {
+ 21, 22, 29, 30, 10, 11, 18, 19,
+};
+private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
+{
+ switch(hiByte)
+ {
+ case 0:
+ return ((jjbitVec2[i2] & l2) != 0L);
+ default :
+ if ((jjbitVec0[i1] & l1) != 0L)
+ return true;
+ return false;
+ }
+}
+public static final String[] jjstrLiteralImages = {
+"", null, null, null, null, null, null, null, null, null, null, null, "\42",
+null, null, null, null, null, null, null, "\173", "\175", "\156\165\154\154", "\54",
+"\72", "\133", "\135", "\164\162\165\145", "\146\141\154\163\145", "\55", "\56", };
+public static final String[] lexStateNames = {
+ "DEFAULT",
+ "STRING_STATE",
+ "ESC_STATE",
+ "HEX_STATE",
+};
+public static final int[] jjnewLexState = {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 0, -1, 1, 3, -1, 1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+};
+static final long[] jjtoToken = {
+ 0x7ff9dd61L,
+};
+static final long[] jjtoSkip = {
+ 0x1eL,
+};
+static final long[] jjtoMore = {
+ 0x22000L,
+};
+protected SimpleCharStream input_stream;
+private final int[] jjrounds = new int[31];
+private final int[] jjstateSet = new int[62];
+protected char curChar;
+public JsonParserTokenManager(SimpleCharStream stream){
+ if (SimpleCharStream.staticFlag)
+ throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
+ input_stream = stream;
+}
+public JsonParserTokenManager(SimpleCharStream stream, int lexState){
+ this(stream);
+ SwitchTo(lexState);
+}
+public void ReInit(SimpleCharStream stream)
+{
+ jjmatchedPos = jjnewStateCnt = 0;
+ curLexState = defaultLexState;
+ input_stream = stream;
+ ReInitRounds();
+}
+private final void ReInitRounds()
+{
+ int i;
+ jjround = 0x80000001;
+ for (i = 31; i-- > 0;)
+ jjrounds[i] = 0x80000000;
+}
+public void ReInit(SimpleCharStream stream, int lexState)
+{
+ ReInit(stream);
+ SwitchTo(lexState);
+}
+public void SwitchTo(int lexState)
+{
+ if (lexState >= 4 || lexState < 0)
+ throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
+ else
+ curLexState = lexState;
+}
+
+protected Token jjFillToken()
+{
+ Token t = Token.newToken(jjmatchedKind);
+ t.kind = jjmatchedKind;
+ String im = jjstrLiteralImages[jjmatchedKind];
+ t.image = (im == null) ? input_stream.GetImage() : im;
+ t.beginLine = input_stream.getBeginLine();
+ t.beginColumn = input_stream.getBeginColumn();
+ t.endLine = input_stream.getEndLine();
+ t.endColumn = input_stream.getEndColumn();
+ return t;
+}
+
+int curLexState = 0;
+int defaultLexState = 0;
+int jjnewStateCnt;
+int jjround;
+int jjmatchedPos;
+int jjmatchedKind;
+
+public Token getNextToken()
+{
+ int kind;
+ Token specialToken = null;
+ Token matchedToken;
+ int curPos = 0;
+
+ EOFLoop :
+ for (;;)
+ {
+ try
+ {
+ curChar = input_stream.BeginToken();
+ }
+ catch(java.io.IOException e)
+ {
+ jjmatchedKind = 0;
+ matchedToken = jjFillToken();
+ return matchedToken;
+ }
+
+ for (;;)
+ {
+ switch(curLexState)
+ {
+ case 0:
+ try { input_stream.backup(0);
+ while (curChar <= 32 && (0x100002600L & (1L << curChar)) != 0L)
+ curChar = input_stream.BeginToken();
+ }
+ catch (java.io.IOException e1) { continue EOFLoop; }
+ jjmatchedKind = 0x7fffffff;
+ jjmatchedPos = 0;
+ curPos = jjMoveStringLiteralDfa0_0();
+ break;
+ case 1:
+ jjmatchedKind = 0x7fffffff;
+ jjmatchedPos = 0;
+ curPos = jjMoveStringLiteralDfa0_1();
+ break;
+ case 2:
+ jjmatchedKind = 0x7fffffff;
+ jjmatchedPos = 0;
+ curPos = jjMoveStringLiteralDfa0_2();
+ break;
+ case 3:
+ jjmatchedKind = 0x7fffffff;
+ jjmatchedPos = 0;
+ curPos = jjMoveStringLiteralDfa0_3();
+ break;
+ }
+ if (jjmatchedKind != 0x7fffffff)
+ {
+ if (jjmatchedPos + 1 < curPos)
+ input_stream.backup(curPos - jjmatchedPos - 1);
+ if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
+ {
+ matchedToken = jjFillToken();
+ if (jjnewLexState[jjmatchedKind] != -1)
+ curLexState = jjnewLexState[jjmatchedKind];
+ return matchedToken;
+ }
+ else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
+ {
+ if (jjnewLexState[jjmatchedKind] != -1)
+ curLexState = jjnewLexState[jjmatchedKind];
+ continue EOFLoop;
+ }
+ if (jjnewLexState[jjmatchedKind] != -1)
+ curLexState = jjnewLexState[jjmatchedKind];
+ curPos = 0;
+ jjmatchedKind = 0x7fffffff;
+ try {
+ curChar = input_stream.readChar();
+ continue;
+ }
+ catch (java.io.IOException e1) { }
+ }
+ int error_line = input_stream.getEndLine();
+ int error_column = input_stream.getEndColumn();
+ String error_after = null;
+ boolean EOFSeen = false;
+ try { input_stream.readChar(); input_stream.backup(1); }
+ catch (java.io.IOException e1) {
+ EOFSeen = true;
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();
+ if (curChar == '\n' || curChar == '\r') {
+ error_line++;
+ error_column = 0;
+ }
+ else
+ error_column++;
+ }
+ if (!EOFSeen) {
+ input_stream.backup(1);
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();
+ }
+ throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
+ }
+ }
+}
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonPrimitive.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonPrimitive.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonPrimitive.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,282 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+/**
+ * A class representing a Json primitive value. A primitive value
+ * is either a String, a Java primitive, or a Java primitive
+ * wrapper type.
+ *
+ * @author Inderjeet Singh
+ */
+public final class JsonPrimitive extends JsonElement {
+
+ private Object value;
+
+ /**
+ * Create a primitive containing a boolean value.
+ *
+ * @param bool the value to create the primitive with.
+ */
+ public JsonPrimitive(Boolean bool) {
+ this.value = bool;
+ }
+
+ /**
+ * Create a primitive containing a {@link Number}.
+ *
+ * @param number the value to create the primitive with.
+ */
+ public JsonPrimitive(Number number) {
+ this.value = number;
+ }
+
+ /**
+ * Create a primitive containing a String value.
+ *
+ * @param string the value to create the primitive with.
+ */
+ public JsonPrimitive(String string) {
+ this.value = string;
+ }
+
+ /**
+ * Create a primitive containing a character. The character is turned into a one character String
+ * since Json only supports String.
+ *
+ * @param c the value to create the primitive with.
+ */
+ public JsonPrimitive(Character c) {
+ this.value = String.valueOf(c);
+ }
+
+ /**
+ * Create a primitive containing a character. The character is turned into a one character String
+ * since Json only supports String.
+ *
+ * @param c the value to create the primitive with.
+ */
+ public JsonPrimitive(char c) {
+ this.value = String.valueOf(c);
+ }
+
+ /**
+ * Create a primitive using the specified Object. It must be an instance of {@link Number}, a
+ * Java primitive type, or a String.
+ *
+ * @param primitive the value to create the primitive with.
+ */
+ JsonPrimitive(Object primitive) {
+ setValue(primitive);
+ }
+
+ void setValue(Object primitive) {
+ if (primitive instanceof Character) {
+ // convert characters to strings since in JSON, characters are represented as a single
+ // character string
+ char c = ((Character)primitive).charValue();
+ this.value = String.valueOf(c);
+ } else {
+ Preconditions.checkArgument(primitive instanceof Number
+ || ObjectNavigator.isPrimitiveOrString(primitive));
+ this.value = primitive;
+ }
+ }
+
+ /**
+ * Check whether this primitive contains a boolean value.
+ *
+ * @return true if this primitive contains a boolean value, false otherwise.
+ */
+ public boolean isBoolean() {
+ return value instanceof Boolean;
+ }
+
+ /**
+ * convenience method to get this element as a {@link Boolean}.
+ *
+ * @return get this element as a {@link Boolean}.
+ * @throws ClassCastException if the value contained is not a valid boolean value.
+ */
+ @Override
+ Boolean getAsBooleanWrapper() {
+ return (Boolean) value;
+ }
+
+ /**
+ * convenience method to get this element as a boolean value.
+ *
+ * @return get this element as a primitive boolean value.
+ * @throws ClassCastException if the value contained is not a valid boolean value.
+ */
+ @Override
+ public boolean getAsBoolean() {
+ return ((Boolean) value).booleanValue();
+ }
+
+ /**
+ * Check whether this primitive contains a Number.
+ *
+ * @return true if this primitive contains a Number, false otherwise.
+ */
+ public boolean isNumber() {
+ return value instanceof Number;
+ }
+
+ /**
+ * convenience method to get this element as a Number.
+ *
+ * @return get this element as a Number.
+ * @throws ClassCastException if the value contained is not a valid Number.
+ */
+ @Override
+ public Number getAsNumber() {
+ return (Number) value;
+ }
+
+ /**
+ * Check whether this primitive contains a String value.
+ *
+ * @return true if this primitive contains a String value, false otherwise.
+ */
+ public boolean isString() {
+ return value instanceof String;
+ }
+
+ /**
+ * convenience method to get this element as a String.
+ *
+ * @return get this element as a String.
+ * @throws ClassCastException if the value contained is not a valid String.
+ */
+ @Override
+ public String getAsString() {
+ return (String) value;
+ }
+
+ /**
+ * convenience method to get this element as a primitive double.
+ *
+ * @return get this element as a primitive double.
+ * @throws ClassCastException if the value contained is not a valid double.
+ */
+ @Override
+ public double getAsDouble() {
+ return ((Number) value).doubleValue();
+ }
+
+ /**
+ * convenience method to get this element as a {@link BigDecimal}.
+ *
+ * @return get this element as a {@link BigDecimal}.
+ * @throws NumberFormatException if the value contained is not a valid {@link BigDecimal}.
+ */
+ @Override
+ public BigDecimal getAsBigDecimal() {
+ if (value instanceof BigDecimal) {
+ return (BigDecimal) value;
+ } else {
+ return new BigDecimal(value.toString());
+ }
+ }
+
+ /**
+ * convenience method to get this element as a {@link BigInteger}.
+ *
+ * @return get this element as a {@link BigInteger}.
+ * @throws NumberFormatException if the value contained is not a valid {@link BigInteger}.
+ */
+ @Override
+ public BigInteger getAsBigInteger() {
+ if (value instanceof BigInteger) {
+ return (BigInteger) value;
+ } else {
+ return new BigInteger(value.toString());
+ }
+ }
+
+ /**
+ * convenience method to get this element as a float.
+ *
+ * @return get this element as a float.
+ * @throws ClassCastException if the value contained is not a valid float.
+ */
+ @Override
+ public float getAsFloat() {
+ return ((Number) value).floatValue();
+ }
+
+ /**
+ * convenience method to get this element as a primitive long.
+ *
+ * @return get this element as a primitive long.
+ * @throws ClassCastException if the value contained is not a valid long.
+ */
+ @Override
+ public long getAsLong() {
+ return ((Number) value).longValue();
+ }
+
+ /**
+ * convenience method to get this element as a primitive short.
+ *
+ * @return get this element as a primitive short.
+ * @throws ClassCastException if the value contained is not a valid short value.
+ */
+ @Override
+ public short getAsShort() {
+ return ((Number) value).shortValue();
+ }
+
+ /**
+ * convenience method to get this element as a primitive integer.
+ *
+ * @return get this element as a primitive integer.
+ * @throws ClassCastException if the value contained is not a valid integer.
+ */
+ @Override
+ public int getAsInt() {
+ return ((Number) value).intValue();
+ }
+
+ /**
+ * convenience method to get this element as an Object.
+ *
+ * @return get this element as an Object that can be converted to a suitable value.
+ */
+ @Override
+ Object getAsObject() {
+ return value;
+ }
+
+ @Override
+ protected void toString(StringBuilder sb) {
+ if (value != null) {
+ if (value instanceof String) {
+ sb.append('"');
+ sb.append(value);
+ sb.append('"');
+
+ } else {
+ sb.append(value);
+ }
+ }
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonPrimitiveDeserializationVisitor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonPrimitiveDeserializationVisitor.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonPrimitiveDeserializationVisitor.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Type;
+import java.util.Collection;
+
+/**
+ * A visitor that populates a primitive value from its JSON representation
+ *
+ * @author Inderjeet Singh
+ */
+final class JsonPrimitiveDeserializationVisitor<T> extends JsonDeserializationVisitor<T> {
+
+ JsonPrimitiveDeserializationVisitor(JsonPrimitive json, Type type,
+ ObjectNavigatorFactory factory, ObjectConstructor objectConstructor,
+ TypeAdapter typeAdapter, ParameterizedTypeHandlerMap<JsonDeserializer<?>> deserializers,
+ JsonDeserializationContext context) {
+ super(json, type, factory, objectConstructor, typeAdapter, deserializers, context);
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ protected T constructTarget() {
+ return (T) objectConstructor.construct(targetType);
+ }
+
+ public void startVisitingObject(Object node) {
+ // do nothing
+ }
+
+ public void endVisitingObject(Object node) {
+ // do nothing
+ }
+
+ public void visitCollection(@SuppressWarnings("unchecked")Collection collection,
+ Type componentType) {
+ // should not be called since this case should invoke JsonArrayDeserializationVisitor
+ throw new IllegalStateException();
+ }
+
+ public void visitArray(Object array, Type componentType) {
+ // should not be called since this case should invoke JsonArrayDeserializationVisitor
+ throw new IllegalStateException();
+ }
+
+ @SuppressWarnings("unchecked")
+ public void visitPrimitiveValue(Object obj) {
+ JsonPrimitive jsonPrimitive = json.getAsJsonPrimitive();
+ if (jsonPrimitive.isBoolean()) {
+ target = (T) jsonPrimitive.getAsBooleanWrapper();
+ } else if (jsonPrimitive.isNumber()) {
+ target = (T) jsonPrimitive.getAsNumber();
+ } else if (jsonPrimitive.isString()) {
+ target = (T) jsonPrimitive.getAsString();
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public void visitObjectField(Field f, Type typeOfF, Object obj) {
+ // should not be called since this case should invoke JsonArrayDeserializationVisitor
+ throw new IllegalStateException();
+ }
+
+ public void visitCollectionField(Field f, Type typeOfF, Object obj) {
+ // should not be called since this case should invoke JsonArrayDeserializationVisitor
+ throw new IllegalStateException();
+ }
+
+ public void visitArrayField(Field f, Type typeOfF, Object obj) {
+ // should not be called since this case should invoke JsonArrayDeserializationVisitor
+ throw new IllegalStateException();
+ }
+
+ public void visitPrimitiveField(Field f, Type fType, Object obj) {
+ // should not be called since this case should invoke JsonArrayDeserializationVisitor
+ throw new IllegalStateException();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonPrintFormatter.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonPrintFormatter.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonPrintFormatter.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,238 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.io.PrintWriter;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Formats Json in a nicely indented way with a specified print margin.
+ * This printer tries to keep elements on the same line as much as possible
+ * while respecting right margin.
+ *
+ * @author Inderjeet Singh
+ */
+final class JsonPrintFormatter implements JsonFormatter {
+
+ private final int printMargin;
+ private final int indentationSize;
+ private final int rightMargin;
+
+ public static final int DEFAULT_PRINT_MARGIN = 80;
+ public static final int DEFAULT_INDENTATION_SIZE = 2;
+ public static final int DEFAULT_RIGHT_MARGIN = 4;
+
+ public JsonPrintFormatter() {
+ this(DEFAULT_PRINT_MARGIN, DEFAULT_INDENTATION_SIZE, DEFAULT_RIGHT_MARGIN);
+ }
+
+ public JsonPrintFormatter(int printMargin, int indentationSize, int rightMargin) {
+ this.printMargin = printMargin;
+ this.indentationSize = indentationSize;
+ this.rightMargin = rightMargin;
+ }
+
+ private class JsonWriter {
+ private final PrintWriter writer;
+ private StringBuilder line;
+ private int level;
+ JsonWriter(PrintWriter writer) {
+ this.writer = writer;
+ level = 0;
+ line = new StringBuilder();
+ }
+
+ void key(String key) {
+ getLine().append('"');
+ getLine().append(key);
+ getLine().append('"');
+ }
+
+ void value(String value) {
+ getLine().append(value);
+ }
+
+ void fieldSeparator() {
+ getLine().append(':');
+ breakLineIfNeeded();
+ }
+
+ void elementSeparator() {
+ getLine().append(',');
+ breakLineIfNeeded();
+ }
+
+ void beginObject() {
+ ++level;
+ breakLineIfNeeded();
+ getLine().append('{');
+ }
+
+ void endObject() {
+ getLine().append('}');
+ --level;
+ }
+
+ void beginArray() {
+ ++level;
+ breakLineIfNeeded();
+ getLine().append('[');
+ }
+
+ void endArray() {
+ getLine().append(']');
+ --level;
+ }
+
+ private void breakLineIfNeeded() {
+ if (getLine().length() > printMargin - rightMargin) {
+ finishLine();
+ }
+ }
+
+ private void finishLine() {
+ if (line != null) {
+ writer.append(line).append("\n");
+ }
+ line = null;
+ }
+
+ private StringBuilder getLine() {
+ if (line == null) {
+ createNewLine();
+ }
+ return line;
+ }
+
+ private void createNewLine() {
+ line = new StringBuilder();
+ for (int i = 0; i < level; ++i) {
+ for (int j = 0; j < indentationSize; ++j) {
+ line.append(' ');
+ }
+ }
+ }
+ }
+
+ private class PrintFormattingVisitor implements JsonElementVisitor {
+ private final Map<Integer, Boolean> firstArrayElement;
+ private final Map<Integer, Boolean> firstObjectMember;
+ private final JsonWriter writer;
+ private final boolean serializeNulls;
+ private int level = 0;
+
+ PrintFormattingVisitor(JsonWriter writer, boolean serializeNulls) {
+ this.writer = writer;
+ this.serializeNulls = serializeNulls;
+ this.firstArrayElement = new HashMap<Integer, Boolean>();
+ this.firstObjectMember = new HashMap<Integer, Boolean>();
+ }
+
+ private void addCommaCheckingFirst(Map<Integer, Boolean> first) {
+ if (first.get(level) != Boolean.FALSE) {
+ first.put(level, false);
+ } else {
+ writer.elementSeparator();
+ }
+ }
+
+ public void startArray(JsonArray array) {
+ firstArrayElement.put(++level, true);
+ writer.beginArray();
+ }
+
+ public void visitArrayMember(JsonArray parent, JsonPrimitive member, boolean isFirst) {
+ addCommaCheckingFirst(firstArrayElement);
+ writer.value(member.toString());
+ }
+
+ public void visitArrayMember(JsonArray parent, JsonArray member, boolean first) {
+ addCommaCheckingFirst(firstArrayElement);
+ }
+
+ public void visitArrayMember(JsonArray parent, JsonObject member, boolean first) {
+ addCommaCheckingFirst(firstArrayElement);
+ }
+
+ public void visitNullArrayMember(JsonArray parent, boolean isFirst) {
+ addCommaCheckingFirst(firstArrayElement);
+ }
+
+ public void endArray(JsonArray array) {
+ level--;
+ writer.endArray();
+ }
+
+ public void startObject(JsonObject object) {
+ firstObjectMember.put(level, true);
+ writer.beginObject();
+ }
+
+ public void visitObjectMember(JsonObject parent, String memberName, JsonPrimitive member,
+ boolean isFirst) {
+ addCommaCheckingFirst(firstObjectMember);
+ writer.key(memberName);
+ writer.fieldSeparator();
+ writer.value(member.toString());
+ }
+
+ public void visitObjectMember(JsonObject parent, String memberName, JsonArray member,
+ boolean isFirst) {
+ addCommaCheckingFirst(firstObjectMember);
+ writer.key(memberName);
+ writer.fieldSeparator();
+ }
+
+ public void visitObjectMember(JsonObject parent, String memberName, JsonObject member,
+ boolean isFirst) {
+ addCommaCheckingFirst(firstObjectMember);
+ writer.key(memberName);
+ writer.fieldSeparator();
+ }
+
+ public void visitNullObjectMember(JsonObject parent, String memberName, boolean isFirst) {
+ if (serializeNulls) {
+ visitObjectMember(parent, memberName, (JsonObject) null, isFirst);
+ }
+ }
+
+ public void endObject(JsonObject object) {
+ writer.endObject();
+ }
+
+ public void visitPrimitive(JsonPrimitive primitive) {
+ writer.value(primitive.toString());
+ }
+
+ public void visitNull() {
+ writer.value("null");
+ }
+ }
+
+ public void format(JsonElement root, PrintWriter writer, boolean serializeNulls) {
+ if (root == null) {
+ return;
+ }
+ JsonWriter jsonWriter = new JsonWriter(writer);
+ JsonElementVisitor visitor =
+ new JsonEscapingVisitor(new PrintFormattingVisitor(jsonWriter, serializeNulls));
+ JsonTreeNavigator navigator = new JsonTreeNavigator(visitor, serializeNulls);
+ navigator.navigate(root);
+ jsonWriter.finishLine();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonSerializationContext.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonSerializationContext.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonSerializationContext.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Type;
+
+/**
+ * Context for serialization that is passed to a custom serializer during invocation of its
+ * {@link JsonSerializer#serialize(Object, Type, JsonSerializationContext)} method.
+ *
+ * @author Inderjeet Singh
+ */
+public interface JsonSerializationContext {
+
+ /**
+ * Invokes default serialization on the specified object.
+ *
+ * @param src the object that needs to be serialized.
+ * @return a tree of {@link JsonElement}s corresponding to the serialized form of {@code src}.
+ */
+ public JsonElement serialize(Object src);
+
+ /**
+ * Invokes default serialization on the specified object passing the specific type information.
+ * It should never be invoked on the element received as a parameter of the
+ * {@link JsonSerializer#serialize(Object, Type, JsonSerializationContext)} method. Doing
+ * so will result in an infinite loop since Gson will in-turn call the custom serializer again.
+ *
+ * @param src the object that needs to be serialized.
+ * @param typeOfSrc the actual genericized type of src object.
+ * @return a tree of {@link JsonElement}s corresponding to the serialized form of {@code src}.
+ */
+ public JsonElement serialize(Object src, Type typeOfSrc);
+}
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonSerializationContextDefault.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonSerializationContextDefault.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonSerializationContextDefault.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Type;
+
+/**
+ * An implementation of serialization context for Gson.
+ *
+ * @author Inderjeet Singh
+ */
+final class JsonSerializationContextDefault implements JsonSerializationContext {
+
+ private final ObjectNavigatorFactory factory;
+ private final ParameterizedTypeHandlerMap<JsonSerializer<?>> serializers;
+ private final boolean serializeNulls;
+
+ JsonSerializationContextDefault(ObjectNavigatorFactory factory, boolean serializeNulls,
+ ParameterizedTypeHandlerMap<JsonSerializer<?>> serializers) {
+ this.factory = factory;
+ this.serializeNulls = serializeNulls;
+ this.serializers = serializers;
+ }
+
+ public JsonElement serialize(Object src) {
+ return serialize(src, src.getClass());
+ }
+
+ public JsonElement serialize(Object src, Type typeOfSrc) {
+ ObjectNavigator on = factory.create(src, typeOfSrc);
+ JsonSerializationVisitor visitor =
+ new JsonSerializationVisitor(factory, serializeNulls, serializers, this);
+ on.accept(visitor);
+ return visitor.getJsonElement();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonSerializationVisitor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonSerializationVisitor.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonSerializationVisitor.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,220 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Array;
+import java.lang.reflect.Field;
+import java.lang.reflect.Type;
+import java.util.Collection;
+import java.util.Map;
+
+/**
+ * A visitor that adds JSON elements corresponding to each field of an object
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ */
+final class JsonSerializationVisitor implements ObjectNavigator.Visitor {
+
+ private final ObjectNavigatorFactory factory;
+ private final ParameterizedTypeHandlerMap<JsonSerializer<?>> serializers;
+ private final boolean serializeNulls;
+
+ private final JsonSerializationContext context;
+
+ private JsonElement root;
+
+ JsonSerializationVisitor(ObjectNavigatorFactory factory, boolean serializeNulls,
+ ParameterizedTypeHandlerMap<JsonSerializer<?>> serializers,
+ JsonSerializationContext context) {
+ this.factory = factory;
+ this.serializeNulls = serializeNulls;
+ this.serializers = serializers;
+ this.context = context;
+ }
+
+ public void endVisitingObject(Object node) {
+ // nothing to be done here
+ }
+
+ public void startVisitingObject(Object node) {
+ assignToRoot(new JsonObject());
+ }
+
+ public void visitArray(Object array, Type arrayType) {
+ assignToRoot(new JsonArray());
+ int length = Array.getLength(array);
+ TypeInfoArray fieldTypeInfo = TypeInfoFactory.getTypeInfoForArray(arrayType);
+ Type componentType = fieldTypeInfo.getSecondLevelType();
+ for (int i = 0; i < length; ++i) {
+ Object child = Array.get(array, i);
+ addAsArrayElement(componentType, child);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public void visitCollection(Collection collection, Type collectionType) {
+ assignToRoot(new JsonArray());
+ for (Object child : collection) {
+ Type childType = TypeUtils.getActualTypeForFirstTypeVariable(collectionType);
+ if (childType == Object.class && child != null) {
+ // Try our luck some other way
+ childType = child.getClass();
+ }
+ addAsArrayElement(childType, child);
+ }
+ }
+
+ public void visitArrayField(Field f, Type typeOfF, Object obj) {
+ if (isFieldNull(f, obj)) {
+ if (serializeNulls) {
+ addChildAsElement(f, new JsonNull());
+ }
+ } else {
+ Object array = getFieldValue(f, obj);
+ addAsChildOfObject(f, typeOfF, array);
+ }
+ }
+
+ public void visitCollectionField(Field f, Type typeOfF, Object obj) {
+ if (isFieldNull(f, obj)) {
+ if (serializeNulls) {
+ addChildAsElement(f, new JsonNull());
+ }
+ } else {
+ if (typeOfF == null) {
+ throw new RuntimeException("Can not handle non-generic collections");
+ }
+ Object collection = getFieldValue(f, obj);
+ addAsChildOfObject(f, typeOfF, collection);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public void visitEnum(Object obj, Type objType) {
+ JsonSerializer serializer = serializers.getHandlerFor(objType);
+ if (serializer == null) {
+ serializer = serializers.getHandlerFor(Enum.class);
+ }
+ if (serializer == null) {
+ throw new RuntimeException("Register a JsonSerializer for Enum or "
+ + obj.getClass().getName());
+ }
+ assignToRoot(serializer.serialize(obj, objType, context));
+ }
+
+ public void visitObjectField(Field f, Type typeOfF, Object obj) {
+ if (isFieldNull(f, obj)) {
+ if (serializeNulls) {
+ addChildAsElement(f, new JsonNull());
+ }
+ } else {
+ Object fieldValue = getFieldValue(f, obj);
+ // This takes care of situations where the field was declared as an Object, but the
+ // actual value contains something more specific. See Issue 54.
+ if (fieldValue != null && typeOfF == Object.class) {
+ typeOfF = fieldValue.getClass();
+ }
+ addAsChildOfObject(f, typeOfF, fieldValue);
+ }
+ }
+
+ private void addAsChildOfObject(Field f, Type fieldType, Object fieldValue) {
+ JsonElement childElement = getJsonElementForChild(fieldType, fieldValue);
+ addChildAsElement(f, childElement);
+ }
+
+ private void addChildAsElement(Field f, JsonElement childElement) {
+ FieldNamingStrategy namingPolicy = factory.getFieldNamingPolicy();
+ root.getAsJsonObject().add(namingPolicy.translateName(f), childElement);
+ }
+
+ private void addAsArrayElement(Type elementType, Object elementValue) {
+ if (elementValue == null) {
+ addNullAsArrayElement();
+ } else {
+ JsonElement childElement = getJsonElementForChild(elementType, elementValue);
+ root.getAsJsonArray().add(childElement);
+ }
+ }
+
+ private void addNullAsArrayElement() {
+ root.getAsJsonArray().add(null);
+ }
+
+ private JsonElement getJsonElementForChild(Type fieldType, Object fieldValue) {
+ ObjectNavigator on = factory.create(fieldValue, fieldType);
+ JsonSerializationVisitor childVisitor =
+ new JsonSerializationVisitor(factory, serializeNulls, serializers, context);
+ on.accept(childVisitor);
+ return childVisitor.getJsonElement();
+ }
+
+ public void visitPrimitiveField(Field f, Type typeOfF, Object obj) {
+ if (isFieldNull(f, obj)) {
+ if (serializeNulls) {
+ addChildAsElement(f, new JsonNull());
+ }
+ } else {
+ TypeInfo typeInfo = new TypeInfo(typeOfF);
+ if (typeInfo.isPrimitiveOrStringAndNotAnArray()) {
+ Object fieldValue = getFieldValue(f, obj);
+ addAsChildOfObject(f, typeOfF, fieldValue);
+ } else {
+ throw new IllegalArgumentException("Not a primitive type");
+ }
+ }
+ }
+
+ public void visitPrimitiveValue(Object obj) {
+ assignToRoot(new JsonPrimitive(obj));
+ }
+
+ @SuppressWarnings("unchecked")
+ public boolean visitUsingCustomHandler(Object obj, Type objType) {
+ JsonSerializer serializer = serializers.getHandlerFor(objType);
+ if (serializer == null && obj instanceof Map) {
+ serializer = serializers.getHandlerFor(Map.class);
+ }
+ if (serializer != null) {
+ assignToRoot(serializer.serialize(obj, objType, context));
+ return true;
+ }
+ return false;
+ }
+
+ private void assignToRoot(JsonElement newRoot) {
+ Preconditions.checkArgument(root == null);
+ root = newRoot;
+ }
+
+ private boolean isFieldNull(Field f, Object obj) {
+ return getFieldValue(f, obj) == null;
+ }
+
+ private Object getFieldValue(Field f, Object obj) {
+ try {
+ return f.get(obj);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public JsonElement getJsonElement() {
+ return root;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonSerializer.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonSerializer.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonSerializer.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Type;
+
+/**
+ * Interface representing a custom serializer for Json. You should write a custom serializer, if
+ * you are not happy with the default serialization done by Gson. You will also need to register
+ * this serializer through {@link com.google.gson.GsonBuilder#registerTypeAdapter(Type, Object)}.
+ *
+ * <p>Let us look at example where defining a serializer will be useful. The {@code Id} class
+ * defined below has two fields: {@code clazz} and {@code value}.</p>
+ *
+ * <p><pre>
+ * public class Id<T> {
+ * private final Class<T> clazz;
+ * private final long value;
+ *
+ * public Id(Class<T> clazz, long value) {
+ * this.clazz = clazz;
+ * this.value = value;
+ * }
+ *
+ * public long getValue() {
+ * return value;
+ * }
+ * }
+ * </pre></p>
+ *
+ * <p>The default serialization of {@code Id(com.foo.MyObject.class, 20L)} will be
+ * <code>{"clazz":com.foo.MyObject,"value":20}</code>. Suppose, you just want the output to be
+ * the value instead, which is {@code 20} in this case. You can achieve that by writing a custom
+ * serializer:</p>
+ *
+ * <p><pre>
+ * class IdSerializer implements JsonSerializer<Id>() {
+ * public JsonElement toJson(Id id, Type typeOfId, JsonSerializationContext context) {
+ * return new JsonPrimitive(id.getValue());
+ * }
+ * }
+ * </pre></p>
+ *
+ * <p>You will also need to register {@code IdSerializer} with Gson as follows:</p>
+ * <pre>
+ * Gson gson = new GsonBuilder().registerTypeAdapter(Id.class, new IdSerializer()).create();
+ * </pre>
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ *
+ * @param <T> type for which the serializer is being registered. It is possible that a serializer
+ * may be asked to serialize a specific generic type of the T.
+ */
+public interface JsonSerializer<T> {
+
+ /**
+ * Gson invokes this call-back method during serialization when it encounters a field of the
+ * specified type.
+ *
+ * <p>In the implementation of this call-back method, you should consider invoking
+ * {@link JsonSerializationContext#serialize(Object, Type)} method to create JsonElements for any
+ * non-trivial field of the {@code src} object. However, you should never invoke it on the
+ * {@code src} object itself since that will cause an infinite loop (Gson will call your
+ * call-back method again).</p>
+ *
+ * @param src the object that needs to be converted to Json.
+ * @param typeOfSrc the actual type (fully genericized version) of the source object.
+ * @return a JsonElement corresponding to the specified object.
+ */
+ public JsonElement serialize(T src, Type typeOfSrc, JsonSerializationContext context);
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonSerializerExceptionWrapper.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonSerializerExceptionWrapper.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonSerializerExceptionWrapper.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Type;
+
+/**
+ * Decorators a {@code JsonSerializer} instance with exception handling. This wrapper class
+ * ensures that a {@code JsonSerializer} will not propagate any exception other than a
+ * {@link JsonParseException}.
+ *
+ * @param <T> type of the serializer being wrapped.
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ */
+class JsonSerializerExceptionWrapper<T> implements JsonSerializer<T> {
+ private final JsonSerializer<T> delegate;
+
+ /**
+ * Returns a wrapped {@link JsonSerializer} object that has been decorated with
+ * {@link JsonParseException} handling.
+ *
+ * @param delegate the {@code JsonSerializer} instance to be wrapped
+ * @throws IllegalArgumentException if {@code delegate} is {@code null}.
+ */
+ JsonSerializerExceptionWrapper(JsonSerializer<T> delegate) {
+ Preconditions.checkNotNull(delegate);
+ this.delegate = delegate;
+ }
+
+ public JsonElement serialize(T src, Type typeOfSrc, JsonSerializationContext context) {
+ try {
+ return delegate.serialize(src, typeOfSrc, context);
+ } catch (JsonParseException e) {
+ // just rethrow the exception
+ throw e;
+ } catch (Exception e) {
+ // throw as a JsonParseException
+ StringBuilder errorMsg = new StringBuilder()
+ .append("The JsonSerializer ")
+ .append(delegate)
+ .append(" failed to serialized object ")
+ .append(src)
+ .append(" given the type ")
+ .append(typeOfSrc);
+ throw new JsonParseException(errorMsg.toString(), e);
+ }
+ }
+
+ @Override
+ public String toString() {
+ return delegate.toString();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonTreeNavigator.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonTreeNavigator.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/JsonTreeNavigator.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.util.Map;
+
+/**
+ * A navigator to navigate a tree of JsonElement nodes in Depth-first order
+ *
+ * @author Inderjeet Singh
+ */
+final class JsonTreeNavigator {
+ private final JsonElementVisitor visitor;
+ private final boolean visitNulls;
+
+ JsonTreeNavigator(JsonElementVisitor visitor, boolean visitNulls) {
+ this.visitor = visitor;
+ this.visitNulls = visitNulls;
+ }
+
+ public void navigate(JsonElement element) {
+ if (element == null || element.isJsonNull()) {
+ visitor.visitNull();
+ } else if (element.isJsonArray()) {
+ JsonArray array = element.getAsJsonArray();
+ visitor.startArray(array);
+ boolean isFirst = true;
+ for (JsonElement child : array) {
+ visitChild(array, child, isFirst);
+ if (isFirst) {
+ isFirst = false;
+ }
+ }
+ visitor.endArray(array);
+ } else if (element.isJsonObject()){
+ JsonObject object = element.getAsJsonObject();
+ visitor.startObject(object);
+ boolean isFirst = true;
+ for (Map.Entry<String, JsonElement> member : object.entrySet()) {
+ visitChild(object, member.getKey(), member.getValue(), isFirst);
+ if (isFirst) {
+ isFirst = false;
+ }
+ }
+ visitor.endObject(object);
+ } else { // must be JsonPrimitive
+ visitor.visitPrimitive(element.getAsJsonPrimitive());
+ }
+ }
+
+ private void visitChild(JsonObject parent, String childName, JsonElement child, boolean isFirst) {
+ if (child != null) {
+ if (child.isJsonNull()) {
+ if (visitNulls) {
+ visitor.visitNullObjectMember(parent, childName, isFirst);
+ navigate(child.getAsJsonNull());
+ }
+ } else if (child.isJsonArray()) {
+ JsonArray childAsArray = child.getAsJsonArray();
+ visitor.visitObjectMember(parent, childName, childAsArray, isFirst);
+ navigate(childAsArray);
+ } else if (child.isJsonObject()) {
+ JsonObject childAsObject = child.getAsJsonObject();
+ visitor.visitObjectMember(parent, childName, childAsObject, isFirst);
+ navigate(childAsObject);
+ } else { // is a JsonPrimitive
+ visitor.visitObjectMember(parent, childName, child.getAsJsonPrimitive(), isFirst);
+ }
+ }
+ }
+
+ private void visitChild(JsonArray parent, JsonElement child, boolean isFirst) {
+ if (child == null || child.isJsonNull()) {
+ visitor.visitNullArrayMember(parent, isFirst);
+ navigate(null);
+ } else if (child.isJsonArray()) {
+ JsonArray childAsArray = child.getAsJsonArray();
+ visitor.visitArrayMember(parent, childAsArray, isFirst);
+ navigate(childAsArray);
+ } else if (child.isJsonObject()) {
+ JsonObject childAsObject = child.getAsJsonObject();
+ visitor.visitArrayMember(parent, childAsObject, isFirst);
+ navigate(childAsObject);
+ } else { // is a JsonPrimitive
+ visitor.visitArrayMember(parent, child.getAsJsonPrimitive(), isFirst);
+ }
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/LowerCamelCaseSeparatorNamingPolicy.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/LowerCamelCaseSeparatorNamingPolicy.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/LowerCamelCaseSeparatorNamingPolicy.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+/**
+ * A {@link FieldNamingStrategy} that ensures the JSON field names consist of only
+ * lower case letters and are separated by a particular {@code separatorString}.
+ *
+ *<p>The following is an example:</p>
+ * <pre>
+ * class StringWrapper {
+ * public String AStringField = "abcd";
+ * }
+ *
+ * LowerCamelCaseSeparatorNamingPolicy policy = new LowerCamelCaseSeparatorNamingPolicy("_");
+ * String translatedFieldName =
+ * policy.translateName(StringWrapper.class.getField("AStringField"));
+ *
+ * assert("a_string_field".equals(translatedFieldName));
+ * </pre>
+ *
+ * @author Joel Leitch
+ */
+class LowerCamelCaseSeparatorNamingPolicy extends CompositionFieldNamingPolicy {
+
+ public LowerCamelCaseSeparatorNamingPolicy(String separatorString) {
+ super(new CamelCaseSeparatorNamingPolicy(separatorString), new LowerCaseNamingPolicy());
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/LowerCaseNamingPolicy.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/LowerCaseNamingPolicy.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/LowerCaseNamingPolicy.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+/**
+ * A {@link FieldNamingStrategy} that ensures the JSON field names consist of only
+ * lower case letters.
+ *
+ *<p>The following is an example:</p>
+ * <pre>
+ * class IntWrapper {
+ * public int integerField = 0;
+ * }
+ *
+ * LowerCaseNamingPolicy policy = new LowerCaseNamingPolicy();
+ * String translatedFieldName =
+ * policy.translateName(IntWrapper.class.getField("integerField"));
+ *
+ * assert("integerfield".equals(translatedFieldName));
+ * </pre>
+ *
+ * @author Joel Leitch
+ */
+class LowerCaseNamingPolicy extends RecursiveFieldNamingPolicy {
+
+ @Override
+ protected String translateName(String target, Type fieldType, Annotation[] annotations) {
+ return target.toLowerCase();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/MappedObjectConstructor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/MappedObjectConstructor.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/MappedObjectConstructor.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.AccessibleObject;
+import java.lang.reflect.Array;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Type;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * This class contains a mapping of all the application specific
+ * {@link InstanceCreator} instances. Registering an {@link InstanceCreator}
+ * with this class will override the default object creation that is defined
+ * by the ObjectConstructor that this class is wrapping. Using this class
+ * with the JSON framework provides the application with "pluggable" modules
+ * to customize framework to suit the application's needs.
+ *
+ * @author Joel Leitch
+ */
+final class MappedObjectConstructor implements ObjectConstructor {
+ private final Logger log = Logger.getLogger(getClass().getName());
+
+ private final ParameterizedTypeHandlerMap<InstanceCreator<?>> instanceCreatorMap =
+ new ParameterizedTypeHandlerMap<InstanceCreator<?>>();
+
+ @SuppressWarnings("unchecked")
+ public <T> T construct(Type typeOfT) {
+ if (instanceCreatorMap.hasAnyHandlerFor(typeOfT)) {
+ InstanceCreator<T> creator = (InstanceCreator<T>) instanceCreatorMap.getHandlerFor(typeOfT);
+ return creator.createInstance(typeOfT);
+ }
+ TypeInfo typeInfo = new TypeInfo(typeOfT);
+ if (typeInfo.isEnum()) {
+ InstanceCreator<T> creator =
+ (InstanceCreator<T>) instanceCreatorMap.getHandlerFor(Enum.class);
+ return creator.createInstance(typeOfT);
+ }
+ return (T) constructWithNoArgConstructor(typeOfT);
+ }
+
+ public Object constructArray(Type type, int length) {
+ return Array.newInstance(TypeUtils.toRawClass(type), length);
+ }
+
+ private <T> T constructWithNoArgConstructor(Type typeOfT) {
+ try {
+ Constructor<T> constructor = getNoArgsConstructor(typeOfT);
+ if (constructor == null) {
+ throw new RuntimeException(("No-args constructor for " + typeOfT + " does not exist. "
+ + "Register an InstanceCreator with Gson for this type to fix this problem."));
+ }
+ return constructor.newInstance();
+ } catch (InstantiationException e) {
+ throw new RuntimeException(("Unable to invoke no-args constructor for " + typeOfT + ". "
+ + "Register an InstanceCreator with Gson for this type may fix this problem."), e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(("Unable to invoke no-args constructor for " + typeOfT + ". "
+ + "Register an InstanceCreator with Gson for this type may fix this problem."), e);
+ } catch (InvocationTargetException e) {
+ throw new RuntimeException(("Unable to invoke no-args constructor for " + typeOfT + ". "
+ + "Register an InstanceCreator with Gson for this type may fix this problem."), e);
+ }
+ }
+
+ @SuppressWarnings({"unchecked", "cast"})
+ private <T> Constructor<T> getNoArgsConstructor(Type typeOfT) {
+ TypeInfo typeInfo = new TypeInfo(typeOfT);
+ Class<T> clazz = (Class<T>) typeInfo.getRawClass();
+ Constructor<T>[] declaredConstructors = (Constructor<T>[]) clazz.getDeclaredConstructors();
+ AccessibleObject.setAccessible(declaredConstructors, true);
+ for (Constructor<T> constructor : declaredConstructors) {
+ if (constructor.getParameterTypes().length == 0) {
+ return constructor;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Use this methods to register an {@link InstanceCreator} for a new type.
+ *
+ * @param <T> the type of class to be mapped with its "creator"
+ * @param typeOfT the instance type that will be created
+ * @param creator the {@link InstanceCreator} instance to register
+ */
+ <T> void register(Type typeOfT, InstanceCreator<? extends T> creator) {
+ if (instanceCreatorMap.hasSpecificHandlerFor(typeOfT)) {
+ log.log(Level.WARNING, "Overriding the existing InstanceCreator for " + typeOfT);
+ }
+ instanceCreatorMap.register(typeOfT, creator);
+ }
+
+ @Override
+ public String toString() {
+ return instanceCreatorMap.toString();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/MemoryRefStack.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/MemoryRefStack.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/MemoryRefStack.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.util.Stack;
+
+/**
+ * A stack data structure that only does a memory reference comparison
+ * when looking for a particular item in the stack. This stack does
+ * not allow {@code null} values to be added.
+ *
+ * @author Joel Leitch
+ */
+final class MemoryRefStack<T> {
+ private final Stack<T> stack = new Stack<T>();
+
+ /**
+ * Adds a new element to the top of the stack.
+ *
+ * @param obj the object to add to the stack
+ * @return the object that was added
+ */
+ public T push(T obj) {
+ Preconditions.checkNotNull(obj);
+
+ return stack.push(obj);
+ }
+
+ /**
+ * Removes the top element from the stack.
+ *
+ * @return the element being removed from the stack
+ * @throws java.util.EmptyStackException thrown if the stack is empty
+ */
+ public T pop() {
+ return stack.pop();
+ }
+
+ /**
+ * Retrieves the item from the top of the stack, but does not remove it.
+ *
+ * @return the item from the top of the stack
+ * @throws java.util.EmptyStackException thrown if the stack is empty
+ */
+ public T peek() {
+ return stack.peek();
+ }
+
+ /**
+ * Performs a memory reference check to see it the {@code obj} exists in
+ * the stack.
+ *
+ * @param obj the object to search for in the stack
+ * @return true if this object is already in the stack otherwise false
+ */
+ public boolean contains(T obj) {
+ if (obj == null) {
+ return false;
+ }
+
+ for (T stackObject : stack) {
+ if (obj == stackObject) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/ModifierBasedExclusionStrategy.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/ModifierBasedExclusionStrategy.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/ModifierBasedExclusionStrategy.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Field;
+import java.util.Collection;
+import java.util.HashSet;
+
+/**
+ * Exclude fields based on particular field modifiers. For a list of possible
+ * modifiers, see {@link java.lang.reflect.Modifier}.
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ */
+final class ModifierBasedExclusionStrategy implements ExclusionStrategy {
+ private final boolean skipSyntheticField;
+ private final Collection<Integer> modifiers;
+
+ public ModifierBasedExclusionStrategy(boolean skipSyntheticFields, int... modifiers) {
+ this.skipSyntheticField = skipSyntheticFields;
+ this.modifiers = new HashSet<Integer>();
+ if (modifiers != null) {
+ for (int modifier : modifiers) {
+ this.modifiers.add(modifier);
+ }
+ }
+ }
+
+ public boolean shouldSkipField(Field f) {
+ if (skipSyntheticField && f.isSynthetic()) {
+ return true;
+ }
+ int objectModifiers = f.getModifiers();
+ for (int modifier : modifiers) {
+ if ((objectModifiers & modifier) != 0) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean shouldSkipClass(Class<?> clazz) {
+ return false;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/ModifyFirstLetterNamingPolicy.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/ModifyFirstLetterNamingPolicy.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/ModifyFirstLetterNamingPolicy.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+/**
+ * A {@link FieldNamingStrategy} that ensures the JSON field names begins with
+ * an upper case letter.
+ *
+ *<p>The following is an example:</p>
+ * <pre>
+ * class StringWrapper {
+ * public String stringField = "abcd";
+ * public String _stringField = "efg";
+ * }
+ *
+ * ModifyFirstLetterNamingPolicy policy =
+ * new ModifyFirstLetterNamingPolicy(LetterModifier.UPPER);
+ * String translatedFieldName =
+ * policy.translateName(StringWrapper.class.getField("stringField"));
+ *
+ * assert("StringField".equals(translatedFieldName));
+ *
+ * String translatedFieldName =
+ * policy.translateName(StringWrapper.class.getField("_stringField"));
+ *
+ * assert("_StringField".equals(translatedFieldName));
+ * </pre>
+ *
+ * @author Joel Leitch
+ */
+class ModifyFirstLetterNamingPolicy extends RecursiveFieldNamingPolicy {
+
+ public enum LetterModifier {
+ UPPER,
+ LOWER;
+ }
+
+ private final LetterModifier letterModifier;
+
+ /**
+ * Creates a new ModifyFirstLetterNamingPolicy that will either modify the first letter of the
+ * target name to either UPPER case or LOWER case depending on the {@code modifier} parameter.
+ *
+ * @param modifier the type of modification that should be performed
+ * @throws IllegalArgumentException if {@code modifier} is null
+ */
+ public ModifyFirstLetterNamingPolicy(LetterModifier modifier) {
+ Preconditions.checkNotNull(modifier);
+ this.letterModifier = modifier;
+ }
+
+ @Override
+ protected String translateName(String target, Type fieldType, Annotation[] annotations) {
+ StringBuilder fieldNameBuilder = new StringBuilder();
+ int index = 0;
+ char firstCharacter = target.charAt(index);
+
+ while (index < target.length() - 1) {
+ if (Character.isLetter(firstCharacter)) {
+ break;
+ }
+
+ fieldNameBuilder.append(firstCharacter);
+ firstCharacter = target.charAt(++index);
+ }
+
+ if (index == target.length()) {
+ return fieldNameBuilder.toString();
+ }
+
+ boolean capitalizeFirstLetter = (letterModifier == LetterModifier.UPPER);
+ if (capitalizeFirstLetter && !Character.isUpperCase(firstCharacter)) {
+ String modifiedTarget = modifyString(Character.toUpperCase(firstCharacter), target, ++index);
+ return fieldNameBuilder.append(modifiedTarget).toString();
+ } else if (!capitalizeFirstLetter && Character.isUpperCase(firstCharacter)) {
+ String modifiedTarget = modifyString(Character.toLowerCase(firstCharacter), target, ++index);
+ return fieldNameBuilder.append(modifiedTarget).toString();
+ } else {
+ return target;
+ }
+ }
+
+ private String modifyString(char firstCharacter, String srcString, int indexOfSubstring) {
+ if (indexOfSubstring < srcString.length()) {
+ return firstCharacter + srcString.substring(indexOfSubstring);
+ } else {
+ return String.valueOf(firstCharacter);
+ }
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/NullExclusionStrategy.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/NullExclusionStrategy.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/NullExclusionStrategy.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Field;
+
+/**
+ * This acts as a "Null Object" pattern for the {@link ExclusionStrategy}.
+ * Passing an instance of this class into the {@link ObjectNavigator} will
+ * make the {@link ObjectNavigator} parse/visit every field of the object
+ * being navigated.
+ *
+ * @author Joel Leitch
+ */
+final class NullExclusionStrategy implements ExclusionStrategy {
+
+ public boolean shouldSkipField(Field f) {
+ return false;
+ }
+
+ public boolean shouldSkipClass(Class<?> clazz) {
+ return false;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/ObjectConstructor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/ObjectConstructor.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/ObjectConstructor.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Type;
+
+/**
+ * Defines a generic object construction factory. The purpose of this class
+ * is to construct a default instance of a class that can be used for object
+ * navigation while deserialization from its JSON representation.
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ */
+interface ObjectConstructor {
+
+ /**
+ * Creates a new instance of the given type.
+ *
+ * @param typeOfT the class type that should be instantiated
+ * @return a default instance of the provided class.
+ */
+ public <T> T construct(Type typeOfT);
+
+ /**
+ * Constructs an array type of the provided length.
+ *
+ * @param typeOfArrayElements type of objects in the array
+ * @param length size of the array
+ * @return new array of size length
+ */
+ public Object constructArray(Type typeOfArrayElements, int length);
+}
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/ObjectNavigator.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/ObjectNavigator.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/ObjectNavigator.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,202 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.AccessibleObject;
+import java.lang.reflect.Field;
+import java.lang.reflect.Type;
+import java.util.Collection;
+
+/**
+ * Provides ability to apply a visitor to an object and all of its fields recursively.
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ */
+final class ObjectNavigator {
+
+ public interface Visitor {
+ /**
+ * This is called before the object navigator starts visiting the current object
+ */
+ void startVisitingObject(Object node);
+
+ /**
+ * This is called after the object navigator finishes visiting the current object
+ */
+ void endVisitingObject(Object node);
+
+ /**
+ * This is called to visit the current object if it is an iterable
+ *
+ * @param componentType the type of each element of the component
+ */
+ void visitCollection(@SuppressWarnings("unchecked") Collection collection, Type componentType);
+
+ /**
+ * This is called to visit the current object if it is an array
+ */
+ void visitArray(Object array, Type componentType);
+
+ /**
+ * This is called to visit the current object if it is a primitive
+ */
+ void visitPrimitiveValue(Object obj);
+
+ /**
+ * This is called to visit an object field of the current object
+ */
+ void visitObjectField(Field f, Type typeOfF, Object obj);
+
+ /**
+ * This is called to visit a field of type Collection of the current object
+ */
+ void visitCollectionField(Field f, Type typeOfF, Object obj);
+
+ /**
+ * This is called to visit an array field of the current object
+ */
+ void visitArrayField(Field f, Type typeOfF, Object obj);
+
+ /**
+ * This is called to visit a primitive field of the current object
+ */
+ void visitPrimitiveField(Field f, Type typeOfF, Object obj);
+
+ /**
+ * This is called to visit an enum object
+ */
+ public void visitEnum(Object obj, Type objType);
+
+ /**
+ * This is called to visit an object using a custom handler
+ * @return true if a custom handler exists, false otherwise
+ */
+ public boolean visitUsingCustomHandler(Object obj, Type objType);
+ }
+
+ private final ExclusionStrategy exclusionStrategy;
+ private final MemoryRefStack<Object> ancestors;
+ private final Object obj;
+ private final Type objType;
+
+ /**
+ * @param obj The object being navigated
+ * @param objType The (fully genericized) type of the object being navigated
+ * @param exclusionStrategy the concrete strategy object to be used to
+ * filter out fields of an object.
+ */
+ ObjectNavigator(Object obj, Type objType, ExclusionStrategy exclusionStrategy,
+ MemoryRefStack<Object> ancestors) {
+ Preconditions.checkNotNull(exclusionStrategy);
+ Preconditions.checkNotNull(ancestors);
+
+ this.obj = obj;
+ this.objType = objType;
+ this.exclusionStrategy = exclusionStrategy;
+ this.ancestors = ancestors;
+ }
+
+ /**
+ * Navigate all the fields of the specified object.
+ * If a field is null, it does not get visited.
+ */
+ public void accept(Visitor visitor) {
+ if (obj == null) {
+ return;
+ }
+ TypeInfo objTypeInfo = new TypeInfo(objType);
+ if (exclusionStrategy.shouldSkipClass(objTypeInfo.getRawClass())) {
+ return;
+ }
+
+ if (ancestors.contains(obj)) {
+ throw new IllegalStateException("Circular reference found: " + obj);
+ }
+ ancestors.push(obj);
+
+ try {
+ if (objTypeInfo.isCollectionOrArray()) {
+ if (objTypeInfo.isArray()) {
+ visitor.visitArray(obj, objType);
+ } else { // must be a collection
+ visitor.visitCollection((Collection<?>) obj, objType);
+ }
+ } else if (objTypeInfo.isEnum()) {
+ visitor.visitEnum(obj, objType);
+ } else if (objTypeInfo.isPrimitiveOrStringAndNotAnArray()) {
+ visitor.visitPrimitiveValue(obj);
+ } else {
+ if (!visitor.visitUsingCustomHandler(obj, objType)) {
+ visitor.startVisitingObject(obj);
+ // For all classes in the inheritance hierarchy (including the current class),
+ // visit all fields
+ for (Class<?> curr = objTypeInfo.getRawClass();
+ curr != null && !curr.equals(Object.class); curr = curr.getSuperclass()) {
+ if (!curr.isSynthetic()) {
+ navigateClassFields(obj, curr, visitor);
+ }
+ }
+ visitor.endVisitingObject(obj);
+ }
+ }
+ } finally {
+ ancestors.pop();
+ }
+ }
+
+ private void navigateClassFields(Object obj, Class<?> clazz, Visitor visitor) {
+ Field[] fields = clazz.getDeclaredFields();
+ AccessibleObject.setAccessible(fields, true);
+ for (Field f : fields) {
+ TypeInfo fieldTypeInfo = TypeInfoFactory.getTypeInfoForField(f, objType);
+ Type actualTypeOfField = fieldTypeInfo.getActualType();
+ if (exclusionStrategy.shouldSkipField(f)) {
+ continue; // skip
+ } else if (fieldTypeInfo.isCollectionOrArray()) {
+ if (fieldTypeInfo.isArray()) {
+ visitor.visitArrayField(f, actualTypeOfField, obj);
+ } else { // must be Collection
+ visitor.visitCollectionField(f, actualTypeOfField, obj);
+ }
+ } else if (fieldTypeInfo.isPrimitiveOrStringAndNotAnArray()) {
+ visitor.visitPrimitiveField(f, actualTypeOfField, obj);
+ } else {
+ visitor.visitObjectField(f, actualTypeOfField, obj);
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private static final Class[] PRIMITIVE_TYPES = { int.class, long.class, short.class, float.class,
+ double.class, byte.class, boolean.class, Integer.class, Long.class, Short.class, Float.class,
+ Double.class, Byte.class, Boolean.class };
+
+ @SuppressWarnings("unchecked")
+ static boolean isPrimitiveOrString(Object target) {
+ if (target instanceof String) {
+ return true;
+ }
+ Class<?> classOfPrimitive = target.getClass();
+ for (Class standardPrimitive : PRIMITIVE_TYPES) {
+ if (standardPrimitive.isAssignableFrom(classOfPrimitive)) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/ObjectNavigatorFactory.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/ObjectNavigatorFactory.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/ObjectNavigatorFactory.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Type;
+
+/**
+ * A factory class used to simplify {@link ObjectNavigator} creation.
+ * This object holds on to a reference of the {@link ExclusionStrategy}
+ * that you'd like to use with the {@link ObjectNavigator}.
+ *
+ * @author Joel Leitch
+ */
+final class ObjectNavigatorFactory {
+ private final ExclusionStrategy strategy;
+ private final FieldNamingStrategy fieldNamingPolicy;
+ private final MemoryRefStack<Object> stack;
+
+ /**
+ * Creates a factory object that will be able to create new
+ * {@link ObjectNavigator}s with the provided {@code strategy}
+ *
+ * @param strategy the exclusion strategy to use with every instance that
+ * is created by this factory instance.
+ * @param fieldNamingPolicy the naming policy that should be applied to field
+ * names
+ */
+ public ObjectNavigatorFactory(ExclusionStrategy strategy, FieldNamingStrategy fieldNamingPolicy) {
+ Preconditions.checkNotNull(fieldNamingPolicy);
+ this.strategy = (strategy == null ? new NullExclusionStrategy() : strategy);
+ this.fieldNamingPolicy = fieldNamingPolicy;
+ this.stack = new MemoryRefStack<Object>();
+ }
+
+ /**
+ * Creates a new {@link ObjectNavigator} for this {@code srcObject}.
+ *
+ * @see #create(Object, Type)
+ * @param srcObject object to navigate
+ * @return a new instance of a {@link ObjectNavigator} ready to navigate the
+ * {@code srcObject}.
+ */
+ public ObjectNavigator create(Object srcObject) {
+ return create(srcObject, srcObject.getClass());
+ }
+
+ /**
+ * Creates a new {@link ObjectNavigator} for this {@code srcObject},
+ * {@code type} pair.
+ *
+ * @param srcObject object to navigate
+ * @param type the "actual" type of this {@code srcObject}. NOTE: this can
+ * be a {@link java.lang.reflect.ParameterizedType} rather than a {@link Class}.
+ * @return a new instance of a {@link ObjectNavigator} ready to navigate the
+ * {@code srcObject} while taking into consideration the
+ * {@code type}.
+ */
+ public ObjectNavigator create(Object srcObject, Type type) {
+ return new ObjectNavigator(srcObject, type, strategy, stack);
+ }
+
+ FieldNamingStrategy getFieldNamingPolicy() {
+ return fieldNamingPolicy;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/ParameterizedTypeHandlerMap.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/ParameterizedTypeHandlerMap.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/ParameterizedTypeHandlerMap.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Level;
+
+/**
+ * A map that provides ability to associate handlers for a specific type or all of its sub-types
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ *
+ * @param <T> The handler that will be looked up by type
+ */
+final class ParameterizedTypeHandlerMap<T> {
+
+ private final Map<Type, T> map = new HashMap<Type, T>();
+ private boolean modifiable = true;
+
+ public synchronized void register(Type typeOfT, T value) {
+ if (!modifiable) {
+ throw new IllegalStateException("Attempted to modify an unmodifiable map.");
+ }
+ if (hasSpecificHandlerFor(typeOfT)) {
+ Gson.logger.log(Level.WARNING, "Overriding the existing type handler for " + typeOfT);
+ }
+ map.put(typeOfT, value);
+ }
+
+ public synchronized void registerIfAbsent(ParameterizedTypeHandlerMap<T> other) {
+ if (!modifiable) {
+ throw new IllegalStateException("Attempted to modify an unmodifiable map.");
+ }
+ for (Map.Entry<Type, T> entry : other.entrySet()) {
+ if (!map.containsKey(entry.getKey())) {
+ register(entry.getKey(), entry.getValue());
+ }
+ }
+ }
+
+ public synchronized void makeUnmodifiable() {
+ modifiable = false;
+ }
+
+ public synchronized T getHandlerFor(Type type) {
+ T handler = map.get(type);
+ if (handler == null && type instanceof ParameterizedType) {
+ // a handler for a non-generic version is registered, so use that
+ Type rawType = ((ParameterizedType)type).getRawType();
+ handler = map.get(rawType);
+ }
+ return handler;
+ }
+
+ public synchronized boolean hasAnyHandlerFor(Type type) {
+ return getHandlerFor(type) != null;
+ }
+
+ public synchronized boolean hasSpecificHandlerFor(Type type) {
+ return map.containsKey(type);
+ }
+
+ public synchronized ParameterizedTypeHandlerMap<T> copyOf() {
+ ParameterizedTypeHandlerMap<T> copy = new ParameterizedTypeHandlerMap<T>();
+ for (Map.Entry<Type, T> entry : map.entrySet()) {
+ copy.register(entry.getKey(), entry.getValue());
+ }
+ return copy;
+ }
+
+ public synchronized Set<Map.Entry<Type, T>> entrySet() {
+ return map.entrySet();
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("{");
+ boolean first = true;
+ for (Map.Entry<Type, T> entry : map.entrySet()) {
+ if (first) {
+ first = false;
+ } else {
+ sb.append(',');
+ }
+ sb.append(typeToString(entry.getKey())).append(':');
+ sb.append(entry.getValue());
+ }
+ return sb.toString();
+ }
+
+ private String typeToString(Type type) {
+ return TypeUtils.toRawClass(type).getSimpleName();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/ParameterizedTypeImpl.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/ParameterizedTypeImpl.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/ParameterizedTypeImpl.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.Arrays;
+
+/**
+ * An immutable implementation of the {@link ParameterizedType} interface. This object allows
+ * us to build a reflective {@link Type} objects on demand. This object is used to support
+ * serialization and deserialization of classes with an {@code ParameterizedType} field where
+ * as least one of the actual type parameters is a {@code TypeVariable}.
+ *
+ * <p>Here's an example class:
+ * <pre>
+ * class Foo<T> {
+ * private List<T> someList;
+ *
+ * Foo(List<T> list) {
+ * this.someList = list;
+ * }
+ * }
+ * </pre>
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ */
+final class ParameterizedTypeImpl implements ParameterizedType {
+
+ private final Type rawType;
+ private final Type[] actualTypeArguments;
+ private final Type owner;
+
+ public ParameterizedTypeImpl(Type rawType, Type[] actualTypeArguments, Type owner) {
+ this.rawType = rawType;
+ this.actualTypeArguments = actualTypeArguments;
+ this.owner = owner;
+ }
+
+ public Type getRawType() {
+ return rawType;
+ }
+
+ public Type[] getActualTypeArguments() {
+ return actualTypeArguments;
+ }
+
+ public Type getOwnerType() {
+ return owner;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (!(o instanceof ParameterizedType)) {
+ return false;
+ } else {
+ // Check that information is equivalent
+ ParameterizedType that = (ParameterizedType) o;
+ if (this == that)
+ return true;
+
+ Type thatOwner = that.getOwnerType();
+ Type thatRawType = that.getRawType();
+
+ return (owner == null ? thatOwner == null : owner.equals(thatOwner))
+ && (rawType == null ? thatRawType == null : rawType.equals(thatRawType))
+ && Arrays.equals(actualTypeArguments, that.getActualTypeArguments());
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ return Arrays.hashCode(actualTypeArguments)
+ ^ (owner == null ? 0 : owner.hashCode())
+ ^ (rawType == null ? 0 : rawType.hashCode());
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/ParseException.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/ParseException.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/ParseException.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,193 @@
+/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
+package com.google.gson;
+
+/**
+ * This exception is thrown when parse errors are encountered.
+ * You can explicitly create objects of this exception type by
+ * calling the method generateParseException in the generated
+ * parser.
+ *
+ * You can modify this class to customize your error reporting
+ * mechanisms so long as you retain the public fields.
+ */
+ at SuppressWarnings("all")
+final class ParseException extends Exception {
+
+ /**
+ * This constructor is used by the method "generateParseException"
+ * in the generated parser. Calling this constructor generates
+ * a new object of this type with the fields "currentToken",
+ * "expectedTokenSequences", and "tokenImage" set. The boolean
+ * flag "specialConstructor" is also set to true to indicate that
+ * this constructor was used to create this object.
+ * This constructor calls its super class with the empty string
+ * to force the "toString" method of parent class "Throwable" to
+ * print the error message in the form:
+ * ParseException: <result of getMessage>
+ */
+ public ParseException(Token currentTokenVal,
+ int[][] expectedTokenSequencesVal,
+ String[] tokenImageVal
+ )
+ {
+ super("");
+ specialConstructor = true;
+ currentToken = currentTokenVal;
+ expectedTokenSequences = expectedTokenSequencesVal;
+ tokenImage = tokenImageVal;
+ }
+
+ /**
+ * The following constructors are for use by you for whatever
+ * purpose you can think of. Constructing the exception in this
+ * manner makes the exception behave in the normal way - i.e., as
+ * documented in the class "Throwable". The fields "errorToken",
+ * "expectedTokenSequences", and "tokenImage" do not contain
+ * relevant information. The JavaCC generated code does not use
+ * these constructors.
+ */
+
+ public ParseException() {
+ super();
+ specialConstructor = false;
+ }
+
+ public ParseException(String message) {
+ super(message);
+ specialConstructor = false;
+ }
+
+ /**
+ * This variable determines which constructor was used to create
+ * this object and thereby affects the semantics of the
+ * "getMessage" method (see below).
+ */
+ protected boolean specialConstructor;
+
+ /**
+ * This is the last token that has been consumed successfully. If
+ * this object has been created due to a parse error, the token
+ * followng this token will (therefore) be the first error token.
+ */
+ public Token currentToken;
+
+ /**
+ * Each entry in this array is an array of integers. Each array
+ * of integers represents a sequence of tokens (by their ordinal
+ * values) that is expected at this point of the parse.
+ */
+ public int[][] expectedTokenSequences;
+
+ /**
+ * This is a reference to the "tokenImage" array of the generated
+ * parser within which the parse error occurred. This array is
+ * defined in the generated ...Constants interface.
+ */
+ public String[] tokenImage;
+
+ /**
+ * This method has the standard behavior when this object has been
+ * created using the standard constructors. Otherwise, it uses
+ * "currentToken" and "expectedTokenSequences" to generate a parse
+ * error message and returns it. If this object has been created
+ * due to a parse error, and you do not catch it (it gets thrown
+ * from the parser), then this method is called during the printing
+ * of the final stack trace, and hence the correct error message
+ * gets displayed.
+ */
+ public String getMessage() {
+ if (!specialConstructor) {
+ return super.getMessage();
+ }
+ StringBuffer expected = new StringBuffer();
+ int maxSize = 0;
+ for (int i = 0; i < expectedTokenSequences.length; i++) {
+ if (maxSize < expectedTokenSequences[i].length) {
+ maxSize = expectedTokenSequences[i].length;
+ }
+ for (int j = 0; j < expectedTokenSequences[i].length; j++) {
+ expected.append(tokenImage[expectedTokenSequences[i][j]]).append(" ");
+ }
+ if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
+ expected.append("...");
+ }
+ expected.append(eol).append(" ");
+ }
+ String retval = "Encountered \"";
+ Token tok = currentToken.next;
+ for (int i = 0; i < maxSize; i++) {
+ if (i != 0) retval += " ";
+ if (tok.kind == 0) {
+ retval += tokenImage[0];
+ break;
+ }
+ retval += add_escapes(tok.image);
+ tok = tok.next;
+ }
+ retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
+ retval += "." + eol;
+ if (expectedTokenSequences.length == 1) {
+ retval += "Was expecting:" + eol + " ";
+ } else {
+ retval += "Was expecting one of:" + eol + " ";
+ }
+ retval += expected.toString();
+ return retval;
+ }
+
+ /**
+ * The end of line string for this machine.
+ */
+ protected String eol = System.getProperty("line.separator", "\n");
+
+ /**
+ * Used to convert raw characters to their escaped version
+ * when these raw version cannot be used as part of an ASCII
+ * string literal.
+ */
+ protected String add_escapes(String str) {
+ StringBuffer retval = new StringBuffer();
+ char ch;
+ for (int i = 0; i < str.length(); i++) {
+ switch (str.charAt(i))
+ {
+ case 0 :
+ continue;
+ case '\b':
+ retval.append("\\b");
+ continue;
+ case '\t':
+ retval.append("\\t");
+ continue;
+ case '\n':
+ retval.append("\\n");
+ continue;
+ case '\f':
+ retval.append("\\f");
+ continue;
+ case '\r':
+ retval.append("\\r");
+ continue;
+ case '\"':
+ retval.append("\\\"");
+ continue;
+ case '\'':
+ retval.append("\\\'");
+ continue;
+ case '\\':
+ retval.append("\\\\");
+ continue;
+ default:
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
+ String s = "0000" + Integer.toString(ch, 16);
+ retval.append("\\u" + s.substring(s.length() - 4, s.length()));
+ } else {
+ retval.append(ch);
+ }
+ continue;
+ }
+ }
+ return retval.toString();
+ }
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/Preconditions.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/Preconditions.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/Preconditions.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+/**
+ * A simple utility class used to check method Preconditions.
+ *
+ * <pre>
+ * public long divideBy(long value) {
+ * Preconditions.checkArgument(value != 0);
+ * return this.value / value;
+ * }
+ * </pre>
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ */
+final class Preconditions {
+ public static void checkNotNull(Object obj) {
+ checkArgument(obj != null);
+ }
+
+ public static void checkArgument(boolean condition) {
+ if (!condition) {
+ throw new IllegalArgumentException("condition failed: " + condition);
+ }
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/PrimitiveTypeAdapter.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/PrimitiveTypeAdapter.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/PrimitiveTypeAdapter.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+/**
+ * Handles type conversion from some object to some primitive (or primitive
+ * wrapper instance).
+ *
+ * @author Joel Leitch
+ */
+final class PrimitiveTypeAdapter implements TypeAdapter {
+
+ @SuppressWarnings({"unchecked"})
+ public <T> T adaptType(Object from, Class<T> to) {
+ Class<?> aClass = Primitives.wrap(to);
+ if (Primitives.isWrapperType(aClass)) {
+ if (aClass == Character.class) {
+ String value = from.toString();
+ if (value.length() == 1) {
+ return (T) (Character) from.toString().charAt(0);
+ } else {
+ throw new JsonParseException("The value: " + value + " contains more than a character.");
+ }
+ }
+
+ try {
+ Constructor<?> constructor = aClass.getConstructor(String.class);
+ return (T) constructor.newInstance(from.toString());
+ } catch (NoSuchMethodException e) {
+ throw new JsonParseException(e);
+ } catch (IllegalAccessException e) {
+ throw new JsonParseException(e);
+ } catch (InvocationTargetException e) {
+ throw new JsonParseException(e);
+ } catch (InstantiationException e) {
+ throw new JsonParseException(e);
+ }
+ } else if (Enum.class.isAssignableFrom(to)) {
+ // Case where the type being adapted to is an Enum
+ // We will try to convert from.toString() to the enum
+ try {
+ Method valuesMethod = to.getMethod("valueOf", String.class);
+ return (T) valuesMethod.invoke(null, from.toString());
+ } catch (NoSuchMethodException e) {
+ throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ } catch (InvocationTargetException e) {
+ throw new RuntimeException(e);
+ }
+ } else {
+ throw new JsonParseException(
+ "Can not adapt type " + from.getClass() + " to " + to);
+ }
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/Primitives.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/Primitives.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/Primitives.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Contains static utility methods pertaining to primitive types and their
+ * corresponding wrapper types.
+ *
+ * @author Kevin Bourrillion
+ */
+final class Primitives {
+ private Primitives() {}
+
+ /** A map from primitive types to their corresponding wrapper types. */
+ public static final Map<Class<?>, Class<?>> PRIMITIVE_TO_WRAPPER_TYPE;
+
+ /** A map from wrapper types to their corresponding primitive types. */
+ public static final Map<Class<?>, Class<?>> WRAPPER_TO_PRIMITIVE_TYPE;
+
+ // Sad that we can't use a BiMap. :(
+
+ static {
+ Map<Class<?>, Class<?>> primToWrap = new HashMap<Class<?>, Class<?>>(16);
+ Map<Class<?>, Class<?>> wrapToPrim = new HashMap<Class<?>, Class<?>>(16);
+
+ add(primToWrap, wrapToPrim, boolean.class, Boolean.class);
+ add(primToWrap, wrapToPrim, byte.class, Byte.class);
+ add(primToWrap, wrapToPrim, char.class, Character.class);
+ add(primToWrap, wrapToPrim, double.class, Double.class);
+ add(primToWrap, wrapToPrim, float.class, Float.class);
+ add(primToWrap, wrapToPrim, int.class, Integer.class);
+ add(primToWrap, wrapToPrim, long.class, Long.class);
+ add(primToWrap, wrapToPrim, short.class, Short.class);
+ add(primToWrap, wrapToPrim, void.class, Void.class);
+
+ PRIMITIVE_TO_WRAPPER_TYPE = Collections.unmodifiableMap(primToWrap);
+ WRAPPER_TO_PRIMITIVE_TYPE = Collections.unmodifiableMap(wrapToPrim);
+ }
+
+ private static void add(Map<Class<?>, Class<?>> forward,
+ Map<Class<?>, Class<?>> backward, Class<?> key, Class<?> value) {
+ forward.put(key, value);
+ backward.put(value, key);
+ }
+
+ /**
+ * Returns {@code true} if {@code type} is one of the nine
+ * primitive-wrapper types, such as {@link Integer}.
+ *
+ * @see Class#isPrimitive
+ */
+ public static boolean isWrapperType(Class<?> type) {
+ return WRAPPER_TO_PRIMITIVE_TYPE.containsKey(checkNotNull(type));
+ }
+
+ private static Class<?> checkNotNull(Class<?> type) {
+ Preconditions.checkNotNull(type);
+ return type;
+ }
+
+ /**
+ * Returns the corresponding wrapper type of {@code type} if it is a primitive
+ * type; otherwise returns {@code type} itself. Idempotent.
+ * <pre>
+ * wrap(int.class) == Integer.class
+ * wrap(Integer.class) == Integer.class
+ * wrap(String.class) == String.class
+ * </pre>
+ */
+ public static <T> Class<T> wrap(Class<T> type) {
+ checkNotNull(type);
+
+ // cast is safe: long.class and Long.class are both of type Class<Long>
+ @SuppressWarnings("unchecked")
+ Class<T> wrapped = (Class<T>) PRIMITIVE_TO_WRAPPER_TYPE.get(type);
+ return (wrapped == null) ? type : wrapped;
+ }
+
+ /**
+ * Returns the corresponding primitive type of {@code type} if it is a
+ * wrapper type; otherwise returns {@code type} itself. Idempotent.
+ * <pre>
+ * unwrap(Integer.class) == int.class
+ * unwrap(int.class) == int.class
+ * unwrap(String.class) == String.class
+ * </pre>
+ */
+ public static <T> Class<T> unwrap(Class<T> type) {
+ checkNotNull(type);
+
+ // cast is safe: long.class and Long.class are both of type Class<Long>
+ @SuppressWarnings("unchecked")
+ Class<T> unwrapped = (Class<T>) WRAPPER_TO_PRIMITIVE_TYPE.get(type);
+ return (unwrapped == null) ? type : unwrapped;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/RecursiveFieldNamingPolicy.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/RecursiveFieldNamingPolicy.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/RecursiveFieldNamingPolicy.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.lang.reflect.Type;
+
+/**
+ * A mechanism for providing custom field naming in Gson. This allows the client code to translate
+ * field names into a particular convention that is not supported as a normal Java field
+ * declaration rules. For example, Java does not support "-" characters in a field name.
+ *
+ * @author Joel Leitch
+ */
+abstract class RecursiveFieldNamingPolicy implements FieldNamingStrategy {
+
+ public final String translateName(Field f) {
+ Preconditions.checkNotNull(f);
+ return translateName(f.getName(), f.getGenericType(), f.getAnnotations());
+ }
+
+ /**
+ * Performs the specific string translation.
+ *
+ * @param target the string object that will be manipulation/translated
+ * @param fieldType the actual type value of the field
+ * @param annotations the annotations set on the field
+ * @return the translated field name
+ */
+ protected abstract String translateName(String target, Type fieldType, Annotation[] annotations);
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/SerializedNameAnnotationInterceptingNamingPolicy.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/SerializedNameAnnotationInterceptingNamingPolicy.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/SerializedNameAnnotationInterceptingNamingPolicy.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.lang.reflect.Field;
+
+/**
+ * A {@link FieldNamingStrategy} that acts as a chain of responsibility. If the
+ * {@link com.google.gson.annotations.SerializedName} annotation is applied to a field then this
+ * strategy will translate the name to the {@code serializedName.value()}; otherwise it delegates
+ * to the wrapped {@link FieldNamingStrategy}.
+ *
+ * <p>NOTE: this class performs JSON field name validation for any of the fields marked with
+ * an {@code @SerializedName} annotation.</p>
+ *
+ * @see SerializedName
+ *
+ * @author Joel Leitch
+ */
+class SerializedNameAnnotationInterceptingNamingPolicy implements FieldNamingStrategy {
+ private static final JsonFieldNameValidator fieldNameValidator = new JsonFieldNameValidator();
+ private final FieldNamingStrategy delegate;
+
+ public SerializedNameAnnotationInterceptingNamingPolicy(FieldNamingStrategy delegate) {
+ this.delegate = delegate;
+ }
+
+ public String translateName(Field f) {
+ Preconditions.checkNotNull(f);
+ SerializedName serializedName = f.getAnnotation(SerializedName.class);
+ if (serializedName != null) {
+ return fieldNameValidator.validate(serializedName.value());
+ } else {
+ return delegate.translateName(f);
+ }
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/SimpleCharStream.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/SimpleCharStream.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/SimpleCharStream.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,440 @@
+/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 4.0 */
+package com.google.gson;
+
+/**
+ * An implementation of interface CharStream, where the stream is assumed to
+ * contain only ASCII characters (without unicode processing).
+ */
+
+ at SuppressWarnings("all")
+final class SimpleCharStream
+{
+ public static final boolean staticFlag = false;
+ int bufsize;
+ int available;
+ int tokenBegin;
+ public int bufpos = -1;
+ protected int bufline[];
+ protected int bufcolumn[];
+
+ protected int column = 0;
+ protected int line = 1;
+
+ protected boolean prevCharIsCR = false;
+ protected boolean prevCharIsLF = false;
+
+ protected java.io.Reader inputStream;
+
+ protected char[] buffer;
+ protected int maxNextCharInd = 0;
+ protected int inBuf = 0;
+ protected int tabSize = 8;
+
+ protected void setTabSize(int i) { tabSize = i; }
+ protected int getTabSize(int i) { return tabSize; }
+
+
+ protected void ExpandBuff(boolean wrapAround)
+ {
+ char[] newbuffer = new char[bufsize + 2048];
+ int newbufline[] = new int[bufsize + 2048];
+ int newbufcolumn[] = new int[bufsize + 2048];
+
+ try
+ {
+ if (wrapAround)
+ {
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+ System.arraycopy(buffer, 0, newbuffer,
+ bufsize - tokenBegin, bufpos);
+ buffer = newbuffer;
+
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+ System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
+ bufline = newbufline;
+
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+ System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
+ bufcolumn = newbufcolumn;
+
+ maxNextCharInd = (bufpos += (bufsize - tokenBegin));
+ }
+ else
+ {
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+ buffer = newbuffer;
+
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+ bufline = newbufline;
+
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+ bufcolumn = newbufcolumn;
+
+ maxNextCharInd = (bufpos -= tokenBegin);
+ }
+ }
+ catch (Throwable t)
+ {
+ throw new Error(t.getMessage());
+ }
+
+
+ bufsize += 2048;
+ available = bufsize;
+ tokenBegin = 0;
+ }
+
+ protected void FillBuff() throws java.io.IOException
+ {
+ if (maxNextCharInd == available)
+ {
+ if (available == bufsize)
+ {
+ if (tokenBegin > 2048)
+ {
+ bufpos = maxNextCharInd = 0;
+ available = tokenBegin;
+ }
+ else if (tokenBegin < 0)
+ bufpos = maxNextCharInd = 0;
+ else
+ ExpandBuff(false);
+ }
+ else if (available > tokenBegin)
+ available = bufsize;
+ else if ((tokenBegin - available) < 2048)
+ ExpandBuff(true);
+ else
+ available = tokenBegin;
+ }
+
+ int i;
+ try {
+ if ((i = inputStream.read(buffer, maxNextCharInd,
+ available - maxNextCharInd)) == -1)
+ {
+ inputStream.close();
+ throw new java.io.IOException();
+ }
+ else
+ maxNextCharInd += i;
+ return;
+ }
+ catch(java.io.IOException e) {
+ --bufpos;
+ backup(0);
+ if (tokenBegin == -1)
+ tokenBegin = bufpos;
+ throw e;
+ }
+ }
+
+ public char BeginToken() throws java.io.IOException
+ {
+ tokenBegin = -1;
+ char c = readChar();
+ tokenBegin = bufpos;
+
+ return c;
+ }
+
+ protected void UpdateLineColumn(char c)
+ {
+ column++;
+
+ if (prevCharIsLF)
+ {
+ prevCharIsLF = false;
+ line += (column = 1);
+ }
+ else if (prevCharIsCR)
+ {
+ prevCharIsCR = false;
+ if (c == '\n')
+ {
+ prevCharIsLF = true;
+ }
+ else
+ line += (column = 1);
+ }
+
+ switch (c)
+ {
+ case '\r' :
+ prevCharIsCR = true;
+ break;
+ case '\n' :
+ prevCharIsLF = true;
+ break;
+ case '\t' :
+ column--;
+ column += (tabSize - (column % tabSize));
+ break;
+ default :
+ break;
+ }
+
+ bufline[bufpos] = line;
+ bufcolumn[bufpos] = column;
+ }
+
+ public char readChar() throws java.io.IOException
+ {
+ if (inBuf > 0)
+ {
+ --inBuf;
+
+ if (++bufpos == bufsize)
+ bufpos = 0;
+
+ return buffer[bufpos];
+ }
+
+ if (++bufpos >= maxNextCharInd)
+ FillBuff();
+
+ char c = buffer[bufpos];
+
+ UpdateLineColumn(c);
+ return (c);
+ }
+
+ /**
+ * @deprecated
+ * @see #getEndColumn
+ */
+
+ public int getColumn() {
+ return bufcolumn[bufpos];
+ }
+
+ /**
+ * @deprecated
+ * @see #getEndLine
+ */
+
+ public int getLine() {
+ return bufline[bufpos];
+ }
+
+ public int getEndColumn() {
+ return bufcolumn[bufpos];
+ }
+
+ public int getEndLine() {
+ return bufline[bufpos];
+ }
+
+ public int getBeginColumn() {
+ return bufcolumn[tokenBegin];
+ }
+
+ public int getBeginLine() {
+ return bufline[tokenBegin];
+ }
+
+ public void backup(int amount) {
+
+ inBuf += amount;
+ if ((bufpos -= amount) < 0)
+ bufpos += bufsize;
+ }
+
+ public SimpleCharStream(java.io.Reader dstream, int startline,
+ int startcolumn, int buffersize)
+ {
+ inputStream = dstream;
+ line = startline;
+ column = startcolumn - 1;
+
+ available = bufsize = buffersize;
+ buffer = new char[buffersize];
+ bufline = new int[buffersize];
+ bufcolumn = new int[buffersize];
+ }
+
+ public SimpleCharStream(java.io.Reader dstream, int startline,
+ int startcolumn)
+ {
+ this(dstream, startline, startcolumn, 4096);
+ }
+
+ public SimpleCharStream(java.io.Reader dstream)
+ {
+ this(dstream, 1, 1, 4096);
+ }
+ public void ReInit(java.io.Reader dstream, int startline,
+ int startcolumn, int buffersize)
+ {
+ inputStream = dstream;
+ line = startline;
+ column = startcolumn - 1;
+
+ if (buffer == null || buffersize != buffer.length)
+ {
+ available = bufsize = buffersize;
+ buffer = new char[buffersize];
+ bufline = new int[buffersize];
+ bufcolumn = new int[buffersize];
+ }
+ prevCharIsLF = prevCharIsCR = false;
+ tokenBegin = inBuf = maxNextCharInd = 0;
+ bufpos = -1;
+ }
+
+ public void ReInit(java.io.Reader dstream, int startline,
+ int startcolumn)
+ {
+ ReInit(dstream, startline, startcolumn, 4096);
+ }
+
+ public void ReInit(java.io.Reader dstream)
+ {
+ ReInit(dstream, 1, 1, 4096);
+ }
+ public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
+ {
+ this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
+ }
+
+ public SimpleCharStream(java.io.InputStream dstream, int startline,
+ int startcolumn, int buffersize)
+ {
+ this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
+ }
+
+ public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn) throws java.io.UnsupportedEncodingException
+ {
+ this(dstream, encoding, startline, startcolumn, 4096);
+ }
+
+ public SimpleCharStream(java.io.InputStream dstream, int startline,
+ int startcolumn)
+ {
+ this(dstream, startline, startcolumn, 4096);
+ }
+
+ public SimpleCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
+ {
+ this(dstream, encoding, 1, 1, 4096);
+ }
+
+ public SimpleCharStream(java.io.InputStream dstream)
+ {
+ this(dstream, 1, 1, 4096);
+ }
+
+ public void ReInit(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
+ {
+ ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
+ }
+
+ public void ReInit(java.io.InputStream dstream, int startline,
+ int startcolumn, int buffersize)
+ {
+ ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
+ }
+
+ public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
+ {
+ ReInit(dstream, encoding, 1, 1, 4096);
+ }
+
+ public void ReInit(java.io.InputStream dstream)
+ {
+ ReInit(dstream, 1, 1, 4096);
+ }
+ public void ReInit(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn) throws java.io.UnsupportedEncodingException
+ {
+ ReInit(dstream, encoding, startline, startcolumn, 4096);
+ }
+ public void ReInit(java.io.InputStream dstream, int startline,
+ int startcolumn)
+ {
+ ReInit(dstream, startline, startcolumn, 4096);
+ }
+ public String GetImage()
+ {
+ if (bufpos >= tokenBegin)
+ return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
+ else
+ return new String(buffer, tokenBegin, bufsize - tokenBegin) +
+ new String(buffer, 0, bufpos + 1);
+ }
+
+ public char[] GetSuffix(int len)
+ {
+ char[] ret = new char[len];
+
+ if ((bufpos + 1) >= len)
+ System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
+ else
+ {
+ System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
+ len - bufpos - 1);
+ System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
+ }
+
+ return ret;
+ }
+
+ public void Done()
+ {
+ buffer = null;
+ bufline = null;
+ bufcolumn = null;
+ }
+
+ /**
+ * Method to adjust line and column numbers for the start of a token.
+ */
+ public void adjustBeginLineColumn(int newLine, int newCol)
+ {
+ int start = tokenBegin;
+ int len;
+
+ if (bufpos >= tokenBegin)
+ {
+ len = bufpos - tokenBegin + inBuf + 1;
+ }
+ else
+ {
+ len = bufsize - tokenBegin + bufpos + 1 + inBuf;
+ }
+
+ int i = 0, j = 0, k = 0;
+ int nextColDiff = 0, columnDiff = 0;
+
+ while (i < len &&
+ bufline[j = start % bufsize] == bufline[k = ++start % bufsize])
+ {
+ bufline[j] = newLine;
+ nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
+ bufcolumn[j] = newCol + columnDiff;
+ columnDiff = nextColDiff;
+ i++;
+ }
+
+ if (i < len)
+ {
+ bufline[j] = newLine++;
+ bufcolumn[j] = newCol + columnDiff;
+
+ while (i++ < len)
+ {
+ if (bufline[j = start % bufsize] != bufline[++start % bufsize])
+ bufline[j] = newLine++;
+ else
+ bufline[j] = newLine;
+ }
+ }
+
+ line = bufline[j];
+ column = bufcolumn[j];
+ }
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/StringUnmarshaller.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/StringUnmarshaller.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/StringUnmarshaller.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,71 @@
+package com.google.gson;
+
+final class StringUnmarshaller {
+ static String unmarshall(String str) {
+ str = str.substring(1, str.length()-1);
+
+ int len = str.length();
+ StringBuilder sb = new StringBuilder(len);
+ int i = 0;
+ while (i < len) {
+ char c = str.charAt(i);
+ ++i;
+ if (c == '\\') {
+ char c1 = str.charAt(i);
+ ++i;
+ if (c1 == 'u') { // This is a unicode escape
+ // TODO(inder): Handle the case where code points are of size bigger than 4
+ int codePoint = getCodePoint(str, i);
+ sb.appendCodePoint(codePoint);
+ i += 4;
+ } else {
+ char escapedChar = getEscapedChar(str, c1);
+ sb.append(escapedChar);
+ }
+ } else {
+ sb.append(c);
+ }
+ }
+ return sb.toString();
+ }
+
+ private static int getCodePoint(String str, int i) {
+// int codePoint = Character.codePointAt(str, i);
+ String s = str.substring(i, i+4);
+ int codePoint = Integer.parseInt(s, 16);
+ return codePoint;
+ }
+
+ private static char getEscapedChar(String str, char c) {
+ char ch;
+ switch (c) {
+ case 'n':
+ ch = '\n';
+ break;
+ case 'b':
+ ch = '\b';
+ break;
+ case 'f':
+ ch = '\f';
+ break;
+ case 't':
+ ch = '\t';
+ break;
+ case 'r':
+ ch = '\r';
+ break;
+ case '\"':
+ ch = '\"';
+ break;
+ case '\'':
+ ch = '\'';
+ break;
+ case '\\':
+ ch = '\\';
+ break;
+ default:
+ throw new IllegalStateException("Unexpected character: " + c + " in " + str);
+ }
+ return ch;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/Token.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/Token.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/Token.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,82 @@
+/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
+package com.google.gson;
+
+/**
+ * Describes the input token stream.
+ */
+
+ at SuppressWarnings("all")
+final class Token {
+
+ /**
+ * An integer that describes the kind of this token. This numbering
+ * system is determined by JavaCCParser, and a table of these numbers is
+ * stored in the file ...Constants.java.
+ */
+ public int kind;
+
+ /**
+ * beginLine and beginColumn describe the position of the first character
+ * of this token; endLine and endColumn describe the position of the
+ * last character of this token.
+ */
+ public int beginLine, beginColumn, endLine, endColumn;
+
+ /**
+ * The string image of the token.
+ */
+ public String image;
+
+ /**
+ * A reference to the next regular (non-special) token from the input
+ * stream. If this is the last token from the input stream, or if the
+ * token manager has not read tokens beyond this one, this field is
+ * set to null. This is true only if this token is also a regular
+ * token. Otherwise, see below for a description of the contents of
+ * this field.
+ */
+ public Token next;
+
+ /**
+ * This field is used to access special tokens that occur prior to this
+ * token, but after the immediately preceding regular (non-special) token.
+ * If there are no such special tokens, this field is set to null.
+ * When there are more than one such special token, this field refers
+ * to the last of these special tokens, which in turn refers to the next
+ * previous special token through its specialToken field, and so on
+ * until the first special token (whose specialToken field is null).
+ * The next fields of special tokens refer to other special tokens that
+ * immediately follow it (without an intervening regular token). If there
+ * is no such token, this field is null.
+ */
+ public Token specialToken;
+
+ /**
+ * Returns the image.
+ */
+ public String toString()
+ {
+ return image;
+ }
+
+ /**
+ * Returns a new Token object, by default. However, if you want, you
+ * can create and return subclass objects based on the value of ofKind.
+ * Simply add the cases to the switch for all those special cases.
+ * For example, if you have a subclass of Token called IDToken that
+ * you want to create if ofKind is ID, simlpy add something like :
+ *
+ * case MyParserConstants.ID : return new IDToken();
+ *
+ * to the following switch statement. Then you can cast matchedToken
+ * variable to the appropriate type and use it in your lexical actions.
+ */
+ public static final Token newToken(int ofKind)
+ {
+ switch(ofKind)
+ {
+ default : return new Token();
+ }
+ }
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/TokenMgrError.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/TokenMgrError.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/TokenMgrError.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,134 @@
+/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */
+package com.google.gson;
+
+ at SuppressWarnings("all")
+final class TokenMgrError extends Error
+{
+ /*
+ * Ordinals for various reasons why an Error of this type can be thrown.
+ */
+
+ /**
+ * Lexical error occured.
+ */
+ static final int LEXICAL_ERROR = 0;
+
+ /**
+ * An attempt wass made to create a second instance of a static token manager.
+ */
+ static final int STATIC_LEXER_ERROR = 1;
+
+ /**
+ * Tried to change to an invalid lexical state.
+ */
+ static final int INVALID_LEXICAL_STATE = 2;
+
+ /**
+ * Detected (and bailed out of) an infinite loop in the token manager.
+ */
+ static final int LOOP_DETECTED = 3;
+
+ /**
+ * Indicates the reason why the exception is thrown. It will have
+ * one of the above 4 values.
+ */
+ int errorCode;
+
+ /**
+ * Replaces unprintable characters by their espaced (or unicode escaped)
+ * equivalents in the given string
+ */
+ protected static final String addEscapes(String str) {
+ StringBuffer retval = new StringBuffer();
+ char ch;
+ for (int i = 0; i < str.length(); i++) {
+ switch (str.charAt(i))
+ {
+ case 0 :
+ continue;
+ case '\b':
+ retval.append("\\b");
+ continue;
+ case '\t':
+ retval.append("\\t");
+ continue;
+ case '\n':
+ retval.append("\\n");
+ continue;
+ case '\f':
+ retval.append("\\f");
+ continue;
+ case '\r':
+ retval.append("\\r");
+ continue;
+ case '\"':
+ retval.append("\\\"");
+ continue;
+ case '\'':
+ retval.append("\\\'");
+ continue;
+ case '\\':
+ retval.append("\\\\");
+ continue;
+ default:
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
+ String s = "0000" + Integer.toString(ch, 16);
+ retval.append("\\u" + s.substring(s.length() - 4, s.length()));
+ } else {
+ retval.append(ch);
+ }
+ continue;
+ }
+ }
+ return retval.toString();
+ }
+
+ /**
+ * Returns a detailed message for the Error when it is thrown by the
+ * token manager to indicate a lexical error.
+ * Parameters :
+ * EOFSeen : indicates if EOF caused the lexicl error
+ * curLexState : lexical state in which this error occured
+ * errorLine : line number when the error occured
+ * errorColumn : column number when the error occured
+ * errorAfter : prefix that was seen before this error occured
+ * curchar : the offending character
+ * Note: You can customize the lexical error message by modifying this method.
+ */
+ protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
+ return("Lexical error at line " +
+ errorLine + ", column " +
+ errorColumn + ". Encountered: " +
+ (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
+ "after : \"" + addEscapes(errorAfter) + "\"");
+ }
+
+ /**
+ * You can also modify the body of this method to customize your error messages.
+ * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
+ * of end-users concern, so you can return something like :
+ *
+ * "Internal Error : Please file a bug report .... "
+ *
+ * from this method for such cases in the release version of your parser.
+ */
+ public String getMessage() {
+ return super.getMessage();
+ }
+
+ /*
+ * Constructors of various flavors follow.
+ */
+
+ public TokenMgrError() {
+ }
+
+ public TokenMgrError(String message, int reason) {
+ super(message);
+ errorCode = reason;
+ }
+
+ public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
+ this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeAdapter.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeAdapter.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeAdapter.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+/**
+ * This class is responsible for adapting/converting an particular "from"
+ * instance to an instance of type "to".
+ *
+ * @author Joel Leitch
+ */
+interface TypeAdapter {
+
+ /**
+ * Adapts an object instance "from" to and instance of type "to".
+ *
+ * @param from the object to adapt
+ * @param to the Type/Class which this will convert to
+ * @return the converted "from" instance to type "to"
+ */
+ public <T> T adaptType(Object from, Class<T> to);
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeAdapterNotRequired.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeAdapterNotRequired.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeAdapterNotRequired.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+/**
+ * This class implements the {@link TypeAdapter} interface; however, if the
+ * from instance type is the same as the to type then this object will
+ * terminate the chain early and return the "from" object to the calling
+ * class.
+ *
+ * If the incoming object does need some kind of conversion then this object
+ * will delegate to the {@link TypeAdapter} that it is wrapping.
+ *
+ * @author Joel Leitch
+ */
+final class TypeAdapterNotRequired implements TypeAdapter {
+
+ private final TypeAdapter delegate;
+
+ /**
+ * Constructs a TypeAdapterNotRequired that will wrap the delegate instance
+ * that is passed in.
+ *
+ * @param delegate the TypeConverter to delegate to if this instance can
+ * not handle the type adapting (can not be null)
+ */
+ TypeAdapterNotRequired(TypeAdapter delegate) {
+ Preconditions.checkNotNull(delegate);
+ this.delegate = delegate;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T adaptType(Object from, Class<T> to) {
+ if (to.isAssignableFrom(from.getClass())) {
+ return (T) from;
+ }
+ return delegate.adaptType(from, to);
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeInfo.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeInfo.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeInfo.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Type;
+import java.util.Collection;
+
+/**
+ * Class that provides information relevant to different parts of a type.
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ */
+class TypeInfo {
+ protected final Type actualType;
+ protected final Class<?> rawClass;
+
+ TypeInfo(Type actualType) {
+ this.actualType = actualType;
+ rawClass = TypeUtils.toRawClass(actualType);
+ }
+
+ public final Type getActualType() {
+ return actualType;
+ }
+
+ /**
+ * Returns the corresponding wrapper type of {@code type} if it is a primitive
+ * type; otherwise returns {@code type} itself. Idempotent.
+ * <pre>
+ * wrap(int.class) == Integer.class
+ * wrap(Integer.class) == Integer.class
+ * wrap(String.class) == String.class
+ * </pre>
+ */
+ public final Class<?> getWrappedClass() {
+ return Primitives.wrap(rawClass);
+ }
+
+ /**
+ * @return the raw class associated with this type
+ */
+ public final Class<?> getRawClass() {
+ return rawClass;
+ }
+
+ public final boolean isCollectionOrArray() {
+ return Collection.class.isAssignableFrom(rawClass) || isArray();
+ }
+
+ public final boolean isArray() {
+ return TypeUtils.isArray(rawClass);
+ }
+
+ public final boolean isEnum() {
+ return rawClass.isEnum();
+ }
+
+ public final boolean isPrimitive() {
+ return Primitives.isWrapperType(Primitives.wrap(rawClass));
+ }
+
+ public final boolean isString() {
+ return rawClass == String.class;
+ }
+
+ public final boolean isPrimitiveOrStringAndNotAnArray() {
+ return (isPrimitive() || isString()) && !isArray();
+ }
+}
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeInfoArray.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeInfoArray.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeInfoArray.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.GenericArrayType;
+import java.lang.reflect.Type;
+
+/**
+ * Class to extract information about types used to define a generic array.
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ */
+final class TypeInfoArray extends TypeInfo {
+ private final Class<?> componentRawType;
+ private final Type secondLevel;
+
+ TypeInfoArray(Type type) {
+ super(type);
+ Class<?> rootComponentType = rawClass;
+ while (rootComponentType.isArray()) {
+ rootComponentType = rootComponentType.getComponentType();
+ }
+ this.componentRawType = rootComponentType;
+ this.secondLevel = extractSecondLevelType(actualType, rawClass);
+ }
+
+ private static Type extractSecondLevelType(Type actualType, Class<?> rawClass) {
+ if (actualType instanceof GenericArrayType) {
+ GenericArrayType castedType = (GenericArrayType) actualType;
+ return castedType.getGenericComponentType();
+ } else {
+ return rawClass.getComponentType();
+ }
+ }
+
+ /**
+ * @return the raw type unwrapped of the second level of array.
+ * If the object is (single-dimensional or multi-dimensional) array, it is the class of the
+ * elements of the array. For example, this method returns Foo.class for Foo[].
+ * It will return Foo[].class for Foo[][]. For Foo<String>[][] types, it will return the
+ * type representing Foo<String>[]
+ * (i.e. <code>new TypeToken<Foo<String>[]>() {}.getType()</code>).
+ */
+ public Type getSecondLevelType() {
+ return secondLevel;
+ }
+
+ /**
+ * @return the raw type of the root component.
+ * If the object is a single-dimensional array then the component type is the class of an
+ * element of the array.
+ * If the object is a multi-dimensional array then the component type is the class of the
+ * inner-most array element. For example, the This method will return Foo.class for Foo[][][].
+ */
+ public Class<?> getComponentRawType() {
+ return componentRawType;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeInfoFactory.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeInfoFactory.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeInfoFactory.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.GenericArrayType;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.lang.reflect.TypeVariable;
+import java.lang.reflect.WildcardType;
+
+/**
+ * A static factory class used to construct the "TypeInfo" objects.
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ */
+final class TypeInfoFactory {
+
+ private TypeInfoFactory() {
+ // Not instantiable since it provides factory methods only.
+ }
+
+ public static TypeInfoArray getTypeInfoForArray(Type type) {
+ Preconditions.checkArgument(TypeUtils.isArray(type));
+ return new TypeInfoArray(type);
+ }
+
+ /**
+ * Evaluates the "actual" type for the field. If the field is a "TypeVariable" or has a
+ * "TypeVariable" in a parameterized type then it evaluates the real type.
+ *
+ * @param f the actual field object to retrieve the type from
+ * @param typeDefiningF the type that contains the field {@code f}
+ * @return the type information for the field
+ */
+ public static TypeInfo getTypeInfoForField(Field f, Type typeDefiningF) {
+ Class<?> classDefiningF = TypeUtils.toRawClass(typeDefiningF);
+ Type type = f.getGenericType();
+ Type actualType = getActualType(type, typeDefiningF, classDefiningF);
+ return new TypeInfo(actualType);
+ }
+
+ private static Type getActualType(
+ Type typeToEvaluate, Type parentType, Class<?> rawParentClass) {
+ if (typeToEvaluate instanceof Class) {
+ return typeToEvaluate;
+ } else if (typeToEvaluate instanceof ParameterizedType) {
+ ParameterizedType castedType = (ParameterizedType) typeToEvaluate;
+ Type owner = castedType.getOwnerType();
+ Type[] actualTypeParameters =
+ extractRealTypes(castedType.getActualTypeArguments(), parentType, rawParentClass);
+ Type rawType = castedType.getRawType();
+ return new ParameterizedTypeImpl(rawType, actualTypeParameters, owner);
+ } else if (typeToEvaluate instanceof GenericArrayType) {
+ GenericArrayType castedType = (GenericArrayType) typeToEvaluate;
+ Type componentType = castedType.getGenericComponentType();
+ Type actualType = getActualType(componentType, parentType, rawParentClass);
+ if (componentType.equals(actualType)) {
+ return castedType;
+ } else {
+ if (actualType instanceof Class) {
+ return TypeUtils.wrapWithArray(TypeUtils.toRawClass(actualType));
+ } else {
+ return new GenericArrayTypeImpl(actualType);
+ }
+ }
+ } else if (typeToEvaluate instanceof TypeVariable) {
+ // The class definition has the actual types used for the type variables.
+ // Find the matching actual type for the Type Variable used for the field.
+ // For example, class Foo<A> { A a; }
+ // new Foo<Integer>(); defines the actual type of A to be Integer.
+ // So, to find the type of the field a, we will have to look at the class'
+ // actual type arguments.
+ TypeVariable<?> fieldTypeVariable = (TypeVariable<?>) typeToEvaluate;
+ TypeVariable<?>[] classTypeVariables = rawParentClass.getTypeParameters();
+ ParameterizedType objParameterizedType = (ParameterizedType) parentType;
+ int indexOfActualTypeArgument = getIndex(classTypeVariables, fieldTypeVariable);
+ Type[] actualTypeArguments = objParameterizedType.getActualTypeArguments();
+ return actualTypeArguments[indexOfActualTypeArgument];
+ } else if (typeToEvaluate instanceof WildcardType) {
+ WildcardType castedType = (WildcardType) typeToEvaluate;
+ return getActualType(castedType.getUpperBounds()[0], parentType, rawParentClass);
+ } else {
+ throw new IllegalArgumentException("Type \'" + typeToEvaluate + "\' is not a Class, "
+ + "ParameterizedType, GenericArrayType or TypeVariable. Can't extract type.");
+ }
+ }
+
+ private static Type[] extractRealTypes(
+ Type[] actualTypeArguments, Type parentType, Class<?> rawParentClass) {
+ Preconditions.checkNotNull(actualTypeArguments);
+
+ Type[] retTypes = new Type[actualTypeArguments.length];
+ for (int i = 0; i < actualTypeArguments.length; ++i) {
+ retTypes[i] = getActualType(actualTypeArguments[i], parentType, rawParentClass);
+ }
+ return retTypes;
+ }
+
+ private static int getIndex(TypeVariable<?>[] types, TypeVariable<?> type) {
+ for (int i = 0; i < types.length; ++i) {
+ if (type.equals(types[i])) {
+ return i;
+ }
+ }
+ throw new IllegalStateException(
+ "How can the type variable not be present in the class declaration!");
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeInfoMap.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeInfoMap.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeInfoMap.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.Map;
+
+/**
+ * A convenience object for retrieving the map type information.
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ */
+final class TypeInfoMap {
+ private final ParameterizedType mapType;
+
+ public TypeInfoMap(Type mapType) {
+ if (!(mapType instanceof ParameterizedType)) {
+ throw new IllegalArgumentException(
+ "Map objects need to be parameterized unless you use a custom serializer. "
+ + "Use the com.google.gson.reflect.TypeToken to extract the ParameterizedType.");
+ }
+ TypeInfo rawType = new TypeInfo(mapType);
+ Preconditions.checkArgument(Map.class.isAssignableFrom(rawType.getRawClass()));
+ this.mapType = (ParameterizedType) mapType;
+ }
+
+ public Type getKeyType() {
+ return mapType.getActualTypeArguments()[0];
+ }
+
+ public Type getValueType() {
+ return mapType.getActualTypeArguments()[1];
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeUtils.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeUtils.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/TypeUtils.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.reflect.Array;
+import java.lang.reflect.GenericArrayType;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+
+/**
+ * Utility class containing some methods for obtaining information on types.
+ *
+ * @author Inderjeet Singh
+ * @author Joel Leitch
+ */
+final class TypeUtils {
+
+ /**
+ * Returns the actual type matching up with the first type variable.
+ * So, for a {@code typeInfo} instance defined as:
+ * <pre>
+ * class Foo<A, B> {
+ * }
+ * Type fooType = new TypeToken<Foo<Integer, String>>() {}.getType();
+ * </pre>
+ * <code>TypeUtils.getActualTypeForFirstTypeVariable(fooType)</code> will return Integer.class.
+ */
+ static Type getActualTypeForFirstTypeVariable(Type type) {
+ if (type instanceof Class) {
+ return Object.class;
+ } else if (type instanceof ParameterizedType) {
+ return ((ParameterizedType)type).getActualTypeArguments()[0];
+ } else if (type instanceof GenericArrayType) {
+ return getActualTypeForFirstTypeVariable(((GenericArrayType)type).getGenericComponentType());
+ } else {
+ throw new IllegalArgumentException("Type \'" + type + "\' is not a Class, "
+ + "ParameterizedType, or GenericArrayType. Can't extract class.");
+ }
+ }
+
+ static boolean isArray(Type type) {
+ if (type instanceof Class) {
+ return ((Class<?>)type).isArray();
+ } else if (type instanceof GenericArrayType) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * This method returns the actual raw class associated with the specified type.
+ */
+ static Class<?> toRawClass(Type type) {
+ if (type instanceof Class) {
+ return (Class<?>) type;
+ } else if (type instanceof ParameterizedType) {
+ ParameterizedType actualType = (ParameterizedType)type;
+ return toRawClass(actualType.getRawType());
+ } else if (type instanceof GenericArrayType) {
+ GenericArrayType actualType = (GenericArrayType) type;
+ Class<?> rawClass = toRawClass(actualType.getGenericComponentType());
+ return wrapWithArray(rawClass);
+ } else {
+ throw new IllegalArgumentException("Type \'" + type + "\' is not a Class, "
+ + "ParameterizedType, or GenericArrayType. Can't extract class.");
+ }
+ }
+
+ static Class<?> wrapWithArray(Class<?> rawClass) {
+ return Array.newInstance(rawClass, 0).getClass();
+ }
+
+ private TypeUtils() {
+ // Class with just some static utility methods, should not be instantiated
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/UpperCaseNamingPolicy.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/UpperCaseNamingPolicy.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/UpperCaseNamingPolicy.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+/**
+ * A {@link FieldNamingStrategy} that ensures the JSON field names consist of only
+ * upper case letters.
+ *
+ * <p>The following is an example:</p>
+ * <pre>
+ * class IntWrapper {
+ * public int integerField = 0;
+ * }
+ *
+ * UpperCaseNamingPolicy policy = new UpperCaseNamingPolicy();
+ * String translatedFieldName =
+ * policy.translateName(IntWrapper.class.getField("integerField"));
+ *
+ * assert("INTEGERFIELD".equals(translatedFieldName));
+ * </pre>
+ *
+ * @author Joel Leitch
+ */
+class UpperCaseNamingPolicy extends RecursiveFieldNamingPolicy {
+
+ @Override
+ protected String translateName(String target, Type fieldType, Annotation[] annotations) {
+ return target.toUpperCase();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/VersionConstants.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/VersionConstants.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/VersionConstants.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+/**
+ * Class contain all constants for versioning support.
+ *
+ * @author Joel Leitch
+ */
+final class VersionConstants {
+ // Prevent instantiation
+ private VersionConstants() { }
+
+ static final double IGNORE_VERSIONS = -1D;
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/VersionExclusionStrategy.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/VersionExclusionStrategy.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/VersionExclusionStrategy.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson;
+
+import com.google.gson.annotations.Since;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+
+/**
+ * This strategy will exclude any files and/or class that are passed the
+ * {@link #version} value.
+ *
+ * @author Joel Leitch
+ */
+final class VersionExclusionStrategy implements ExclusionStrategy {
+ private final double version;
+
+ public VersionExclusionStrategy(double version) {
+ Preconditions.checkArgument(version >= 0.0D);
+ this.version = version;
+ }
+
+ public boolean shouldSkipField(Field f) {
+ return !isValidVersion(f.getAnnotations());
+ }
+
+ public boolean shouldSkipClass(Class<?> clazz) {
+ return !isValidVersion(clazz.getAnnotations());
+ }
+
+ private boolean isValidVersion(Annotation[] annotations) {
+ for (Annotation annotation : annotations) {
+ if (annotation instanceof Since) {
+ double annotationVersion = ((Since) annotation).value();
+ if (annotationVersion > version) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/annotations/Expose.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/annotations/Expose.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/annotations/Expose.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * An annotation that indicates this member should be exposed for JSON
+ * serialization or deserialization.
+ *
+ * <p>This annotation has no effect unless you build {@link com.google.gson.Gson}
+ * with a {@link com.google.gson.GsonBuilder} and invoke
+ * {@link com.google.gson.GsonBuilder#excludeFieldsWithoutExposeAnnotation()}
+ * method.</p>
+ *
+ * <p>Here is an example of how this annotation is meant to be used:
+ * <p><pre>
+ * public class User {
+ * @Expose private String firstName;
+ * @Expose private String lastName;
+ * @Expose private String emailAddress;
+ * private String password;
+ * }
+ * </pre></p>
+ * If you created Gson with {@code new Gson()}, the {@code toJson()} and {@code fromJson()}
+ * methods will use the {@code password} field along-with {@code firstName}, {@code lastName},
+ * and {@code emailAddress} for serialization and deserialization. However, if you created Gson
+ * with {@code Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create()}
+ * then the {@code toJson()} and {@code fromJson()} methods of Gson will exclude the
+ * {@code password} field. This is because the {@code password} field is not marked with the
+ * {@code @Expose} annotation.
+ *
+ * <p>Note that another way to achieve the same effect would have been to just mark the
+ * {@code password} field as {@code transient}, and Gson would have excluded it even with default
+ * settings. The {@code @Expose} annotation is useful in a style of programming where you want to
+ * explicitly specify all fields that should get considered for serialization or deserialization.
+ *
+ * @author Inderjeet Singh
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.FIELD)
+public @interface Expose {
+ // This is a marker annotation with no additional properties
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/annotations/SerializedName.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/annotations/SerializedName.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/annotations/SerializedName.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * An annotation that indicates this member should be serialized to JSON with
+ * the provided name value as its field name.
+ *
+ * <p>This annotation will override any {@link com.google.gson.FieldNamingPolicy}, including
+ * the default field naming policy, that may have been set on the {@link com.google.gson.Gson}
+ * instance. A different naming policy can set using the {@code GsonBuilder} class. See
+ * {@link com.google.gson.GsonBuilder#setFieldNamingPolicy(com.google.gson.FieldNamingPolicy)}
+ * for more information.</p>
+ *
+ * <p>Here is an example of how this annotation is meant to be used:</p>
+ * <pre>
+ * public class SomeClassWithFields {
+ * @SerializedName("name") private final String someField;
+ * private final String someOtherField;
+ *
+ * public SomeClassWithFields(String a, String b) {
+ * this.someField = a;
+ * this.someOtherField = b;
+ * }
+ * }
+ * </pre>
+ *
+ * <p>The following shows the output that is generated when serializing an instance of the
+ * above example class:</p>
+ * <pre>
+ * SomeClassWithFields objectToSerialize = new SomeClassWithFields("a", "b");
+ * Gson gson = new Gson();
+ * String jsonRepresentation = gson.toJson(objectToSerialize);
+ * System.out.println(jsonRepresentation);
+ *
+ * ===== OUTPUT =====
+ * {"name":"a","someOtherField":"b"}
+ * </pre>
+ *
+ * <p>NOTE: The value you specify in this annotation must be a valid JSON field name.</p>
+ *
+ * @see com.google.gson.FieldNamingPolicy
+ *
+ * @author Joel Leitch
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.FIELD)
+public @interface SerializedName {
+
+ /**
+ * @return the desired name of the field when it is serialized
+ */
+ String value();
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/annotations/Since.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/annotations/Since.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/annotations/Since.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * An annotation that indicates the version number since a member or a type has been present.
+ * This annotation is useful to manage versioning of your Json classes for a web-service.
+ *
+ * <p>
+ * This annotation has no effect unless you build {@link com.google.gson.Gson} with a
+ * {@link com.google.gson.GsonBuilder} and invoke
+ * {@link com.google.gson.GsonBuilder#setVersion(double)} method.
+ *
+ * <p>Here is an example of how this annotation is meant to be used:</p>
+ * <pre>
+ * public class User {
+ * private String firstName;
+ * private String lastName;
+ * @Since(1.0) private String emailAddress;
+ * @Since(1.0) private String password;
+ * @Since(1.1) private Address address;
+ * }
+ * </pre>
+ *
+ * <p>If you created Gson with {@code new Gson()}, the {@code toJson()} and {@code fromJson()}
+ * methods will use all the fields for serialization and deserialization. However, if you created
+ * Gson with {@code Gson gson = new GsonBuilder().setVersion(1.0).create()} the the
+ * {@code toJson()} and {@code fromJson()} methods of Gson will exclude the {@code address} field
+ * since it's version number is set to {@code 1.1}.</p>
+ *
+ * @author Inderjeet Singh
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ElementType.FIELD, ElementType.TYPE})
+public @interface Since {
+ /**
+ * the value indicating a version number since this member
+ * or type has been present.
+ */
+ double value();
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/annotations/package-info.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/annotations/package-info.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/annotations/package-info.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,6 @@
+/**
+ * This package provides annotations that can be used with {@link com.google.gson.Gson}.
+ *
+ * @author Inderjeet Singh, Joel Leitch
+ */
+package com.google.gson.annotations;
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/package-info.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/package-info.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/package-info.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,11 @@
+/**
+ * This package provides the {@link com.google.gson.Gson} class to convert Json to Java and
+ * vice-versa.
+ *
+ * <p>The primary class to use is {@link com.google.gson.Gson} which can be constructed with
+ * {@code new Gson()} (using default settings) or by using {@link com.google.gson.GsonBuilder}
+ * (to configure various options such as using versioning and so on).</p>
+ *
+ * @author Inderjeet Singh, Joel Leitch
+ */
+package com.google.gson;
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/reflect/TypeToken.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/reflect/TypeToken.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/reflect/TypeToken.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,375 @@
+/*
+ * Copyright (C) 2008 Google Inc.
+ *
+ * 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 com.google.gson.reflect;
+
+import java.lang.reflect.Array;
+import java.lang.reflect.GenericArrayType;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.lang.reflect.TypeVariable;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Represents a generic type {@code T}.
+ *
+ * You can use this class to get the generic type for a class. For example,
+ * to get the generic type for <code>Collection<Foo></code>, you can use:
+ * <p>
+ * <code>Type typeOfCollectionOfFoo = new TypeToken<Collection<Foo>>(){}.getType()
+ * </code>
+ *
+ * <p>Assumes {@code Type} implements {@code equals()} and {@code hashCode()}
+ * as a value (as opposed to identity) comparison.
+ *
+ * Also implements {@link #isAssignableFrom(Type)} to check type-safe
+ * assignability.
+ *
+ * @author Bob Lee
+ * @author Sven Mawson
+ */
+public abstract class TypeToken<T> {
+
+ final Class<? super T> rawType;
+ final Type type;
+
+ /**
+ * Constructs a new type token. Derives represented class from type
+ * parameter.
+ *
+ * <p>Clients create an empty anonymous subclass. Doing so embeds the type
+ * parameter in the anonymous class's type hierarchy so we can reconstitute
+ * it at runtime despite erasure.
+ *
+ * <p>For example:
+ * <code>
+ * {@literal TypeToken<List<String>> t = new TypeToken<List<String>>}(){}
+ * </code>
+ */
+ @SuppressWarnings("unchecked")
+ protected TypeToken() {
+ this.type = getSuperclassTypeParameter(getClass());
+ this.rawType = (Class<? super T>) getRawType(type);
+ }
+
+ /**
+ * Unsafe. Constructs a type token manually.
+ */
+ @SuppressWarnings({"unchecked"})
+ private TypeToken(Type type) {
+ this.rawType = (Class<? super T>) getRawType(nonNull(type, "type"));
+ this.type = type;
+ }
+
+ private static <T> T nonNull(T o, String message) {
+ if (o == null) {
+ throw new NullPointerException(message);
+ }
+ return o;
+ }
+
+ /**
+ * Gets type from super class's type parameter.
+ */
+ static Type getSuperclassTypeParameter(Class<?> subclass) {
+ Type superclass = subclass.getGenericSuperclass();
+ if (superclass instanceof Class) {
+ throw new RuntimeException("Missing type parameter.");
+ }
+ return ((ParameterizedType) superclass).getActualTypeArguments()[0];
+ }
+
+ /**
+ * Gets type token from super class's type parameter.
+ */
+ static TypeToken<?> fromSuperclassTypeParameter(Class<?> subclass) {
+ return new SimpleTypeToken<Object>(subclass);
+ }
+
+ private static Class<?> getRawType(Type type) {
+ if (type instanceof Class<?>) {
+ // type is a normal class.
+ return (Class<?>) type;
+ } else if (type instanceof ParameterizedType) {
+ ParameterizedType parameterizedType = (ParameterizedType) type;
+
+ // I'm not exactly sure why getRawType() returns Type instead of Class.
+ // Neal isn't either but suspects some pathological case related
+ // to nested classes exists.
+ Type rawType = parameterizedType.getRawType();
+ if (rawType instanceof Class<?>) {
+ return (Class<?>) rawType;
+ }
+ throw buildUnexpectedTypeError(rawType, Class.class);
+ } else if (type instanceof GenericArrayType) {
+ GenericArrayType genericArrayType = (GenericArrayType) type;
+
+ // TODO(jleitch): This is not the most efficient way to handle generic
+ // arrays, but is there another way to extract the array class in a
+ // non-hacky way (i.e. using String value class names- "[L...")?
+ Object rawArrayType = Array.newInstance(
+ getRawType(genericArrayType.getGenericComponentType()), 0);
+ return rawArrayType.getClass();
+ } else {
+ throw buildUnexpectedTypeError(
+ type, ParameterizedType.class, GenericArrayType.class);
+ }
+ }
+
+ /**
+ * Gets the raw type.
+ */
+ public Class<? super T> getRawType() {
+ return rawType;
+ }
+
+ /**
+ * Gets underlying {@code Type} instance.
+ */
+ public Type getType() {
+ return type;
+ }
+
+ /**
+ * Check if this type is assignable from the given class object.
+ */
+ public boolean isAssignableFrom(Class<?> cls) {
+ return isAssignableFrom((Type) cls);
+ }
+
+ /**
+ * Check if this type is assignable from the given Type.
+ */
+ public boolean isAssignableFrom(Type from) {
+ if (from == null) {
+ return false;
+ }
+
+ if (type.equals(from)) {
+ return true;
+ }
+
+ if (type instanceof Class) {
+ return rawType.isAssignableFrom(getRawType(from));
+ } else if (type instanceof ParameterizedType) {
+ return isAssignableFrom(from, (ParameterizedType) type,
+ new HashMap<String, Type>());
+ } else if (type instanceof GenericArrayType) {
+ return rawType.isAssignableFrom(getRawType(from))
+ && isAssignableFrom(from, (GenericArrayType) type);
+ } else {
+ throw buildUnexpectedTypeError(
+ type, Class.class, ParameterizedType.class, GenericArrayType.class);
+ }
+ }
+
+ /**
+ * Check if this type is assignable from the given type token.
+ */
+ public boolean isAssignableFrom(TypeToken<?> token) {
+ return isAssignableFrom(token.getType());
+ }
+
+ /**
+ * Private helper function that performs some assignability checks for
+ * the provided GenericArrayType.
+ */
+ private static boolean isAssignableFrom(Type from, GenericArrayType to) {
+ Type toGenericComponentType = to.getGenericComponentType();
+ if (toGenericComponentType instanceof ParameterizedType) {
+ Type t = from;
+ if (from instanceof GenericArrayType) {
+ t = ((GenericArrayType) from).getGenericComponentType();
+ } else if (from instanceof Class) {
+ Class<?> classType = (Class<?>) from;
+ while (classType.isArray()) {
+ classType = classType.getComponentType();
+ }
+ t = classType;
+ }
+ return isAssignableFrom(t, (ParameterizedType) toGenericComponentType,
+ new HashMap<String, Type>());
+ }
+ // No generic defined on "to"; therefore, return true and let other
+ // checks determine assignability
+ return true;
+ }
+
+ /**
+ * Private recursive helper function to actually do the type-safe checking
+ * of assignability.
+ */
+ private static boolean isAssignableFrom(Type from, ParameterizedType to,
+ Map<String, Type> typeVarMap) {
+
+ if (from == null) {
+ return false;
+ }
+
+ if (to.equals(from)) {
+ return true;
+ }
+
+ // First figure out the class and any type information.
+ Class<?> clazz = getRawType(from);
+ ParameterizedType ptype = null;
+ if (from instanceof ParameterizedType) {
+ ptype = (ParameterizedType) from;
+ }
+
+ // Load up parameterized variable info if it was parameterized.
+ if (ptype != null) {
+ Type[] tArgs = ptype.getActualTypeArguments();
+ TypeVariable<?>[] tParams = clazz.getTypeParameters();
+ for (int i = 0; i < tArgs.length; i++) {
+ Type arg = tArgs[i];
+ TypeVariable<?> var = tParams[i];
+ while (arg instanceof TypeVariable) {
+ TypeVariable<?> v = (TypeVariable<?>) arg;
+ arg = typeVarMap.get(v.getName());
+ }
+ typeVarMap.put(var.getName(), arg);
+ }
+
+ // check if they are equivalent under our current mapping.
+ if (typeEquals(ptype, to, typeVarMap)) {
+ return true;
+ }
+ }
+
+ for (Type itype : clazz.getGenericInterfaces()) {
+ if (isAssignableFrom(itype, to, new HashMap<String, Type>(typeVarMap))) {
+ return true;
+ }
+ }
+
+ // Interfaces didn't work, try the superclass.
+ Type sType = clazz.getGenericSuperclass();
+ if (isAssignableFrom(sType, to, new HashMap<String, Type>(typeVarMap))) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Checks if two parameterized types are exactly equal, under the variable
+ * replacement described in the typeVarMap.
+ */
+ private static boolean typeEquals(ParameterizedType from,
+ ParameterizedType to, Map<String, Type> typeVarMap) {
+ if (from.getRawType().equals(to.getRawType())) {
+ Type[] fromArgs = from.getActualTypeArguments();
+ Type[] toArgs = to.getActualTypeArguments();
+ for (int i = 0; i < fromArgs.length; i++) {
+ if (!matches(fromArgs[i], toArgs[i], typeVarMap)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Checks if two types are the same or are equivalent under a variable mapping
+ * given in the type map that was provided.
+ */
+ private static boolean matches(Type from, Type to,
+ Map<String, Type> typeMap) {
+ if (to.equals(from)) return true;
+
+ if (from instanceof TypeVariable) {
+ return to.equals(typeMap.get(((TypeVariable<?>)from).getName()));
+ }
+
+ return false;
+ }
+
+ /**
+ * Hashcode for this object.
+ * @return hashcode for this object.
+ */
+ @Override public int hashCode() {
+ return type.hashCode();
+ }
+
+ /**
+ * Method to test equality.
+ *
+ * @return true if this object is logically equal to the specified object, false otherwise.
+ */
+ @Override public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof TypeToken<?>)) {
+ return false;
+ }
+ TypeToken<?> t = (TypeToken<?>) o;
+ return type.equals(t.type);
+ }
+
+ /**
+ * Returns a string representation of this object.
+ * @return a string representation of this object.
+ */
+ @Override public String toString() {
+ return type instanceof Class<?>
+ ? ((Class<?>) type).getName()
+ : type.toString();
+ }
+
+ private static AssertionError buildUnexpectedTypeError(
+ Type token, Class<?>... expected) {
+
+ // Build exception message
+ StringBuilder exceptionMessage =
+ new StringBuilder("Unexpected type. Expected one of: ");
+ for (Class<?> clazz : expected) {
+ exceptionMessage.append(clazz.getName()).append(", ");
+ }
+ exceptionMessage.append("but got: ").append(token.getClass().getName())
+ .append(", for type token: ").append(token.toString()).append('.');
+
+ return new AssertionError(exceptionMessage.toString());
+ }
+
+ /**
+ * Gets type token for the given {@code Type} instance.
+ */
+ public static TypeToken<?> get(Type type) {
+ return new SimpleTypeToken<Object>(type);
+ }
+
+ /**
+ * Gets type token for the given {@code Class} instance.
+ */
+ public static <T> TypeToken<T> get(Class<T> type) {
+ return new SimpleTypeToken<T>(type);
+ }
+
+ /**
+ * Private static class to not create more anonymous classes than
+ * necessary.
+ */
+ private static class SimpleTypeToken<T> extends TypeToken<T> {
+ public SimpleTypeToken(Type type) {
+ super(type);
+ }
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/com/google/gson/reflect/package-info.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/com/google/gson/reflect/package-info.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/com/google/gson/reflect/package-info.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,6 @@
+/**
+ * This package provides utility classes for finding type information for generic types.
+ *
+ * @author Inderjeet Singh, Joel Leitch
+ */
+package com.google.gson.reflect;
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Binder.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Binder.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Binder.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,401 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+import org.w3c.dom.Node;
+
+import javax.xml.validation.Schema;
+
+/**
+ * Enable synchronization between XML infoset nodes and JAXB objects
+ * representing same XML document.
+ *
+ * <p>
+ * An instance of this class maintains the association between XML nodes of
+ * an infoset preserving view and a JAXB representation of an XML document.
+ * Navigation between the two views is provided by the methods
+ * {@link #getXMLNode(Object)} and {@link #getJAXBNode(Object)}.
+ *
+ * <p>
+ * Modifications can be made to either the infoset preserving view or the
+ * JAXB representation of the document while the other view remains
+ * unmodified. The binder is able to synchronize the changes made in the
+ * modified view back into the other view using the appropriate
+ * Binder update methods, {@link #updateXML(Object, Object)} or
+ * {@link #updateJAXB(Object)}.
+ *
+ * <p>
+ * A typical usage scenario is the following:
+ * <ul>
+ * <li>load XML document into an XML infoset representation</li>
+ * <li>{@link #unmarshal(Object)} XML infoset view to JAXB view.
+ * (Note to conserve resources, it is possible to only unmarshal a
+ * subtree of the XML infoset view to the JAXB view.)</li>
+ * <li>application access/updates JAXB view of XML document.</li>
+ * <li>{@link #updateXML(Object)} synchronizes modifications to JAXB view
+ * back into the XML infoset view. Update operation preserves as
+ * much of original XML infoset as possible (i.e. comments, PI, ...)</li>
+ * </ul>
+ *
+ * <p>
+ * A Binder instance is created using the factory method
+ * {@link JAXBContext#createBinder()} or {@link JAXBContext#createBinder(Class)}.
+ *
+ * <p>
+ * The template parameter, <code>XmlNode</code>, is the
+ * root interface/class for the XML infoset preserving representation.
+ * A Binder implementation is required to minimally support
+ * an <code>XmlNode</code> value of <code>org.w3c.dom.Node.class</code>.
+ * A Binder implementation can support alternative XML infoset
+ * preserving representations.
+ *
+ * @author
+ * Kohsuke Kawaguchi (kohsuke.kawaguchi at sun.com)
+ * Joseph Fialli
+ *
+ * @since JAXB 2.0
+ */
+public abstract class Binder<XmlNode> {
+ /**
+ * Unmarshal XML infoset view to a JAXB object tree.
+ *
+ * <p>
+ * This method is similar to {@link Unmarshaller#unmarshal(Node)}
+ * with the addition of maintaining the association between XML nodes
+ * and the produced JAXB objects, enabling future update operations,
+ * {@link #updateXML(Object, Object)} or {@link #updateJAXB(Object)}.
+ *
+ * <p>
+ * When {@link #getSchema()} is non-null, <code>xmlNode</code>
+ * and its descendants is validated during this operation.
+ *
+ * <p>
+ * This method throws {@link UnmarshalException} when the Binder's
+ * {@link JAXBContext} does not have a mapping for the XML element name
+ * or the type, specifiable via <tt>@xsi:type</tt>, of <tt>xmlNode</tt>
+ * to a JAXB mapped class. The method {@link #unmarshal(Object, Class)}
+ * enables an application to specify the JAXB mapped class that
+ * the <tt>xmlNode</tt> should be mapped to.
+ *
+ * @param xmlNode
+ * the document/element to unmarshal XML data from.
+ *
+ * @return
+ * the newly created root object of the JAXB object tree.
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Binder</tt> is unable to perform the XML to Java
+ * binding.
+ * @throws IllegalArgumentException
+ * If the node parameter is null
+ */
+ public abstract Object unmarshal( XmlNode xmlNode ) throws JAXBException;
+
+ /**
+ * Unmarshal XML root element by provided <tt>declaredType</tt>
+ * to a JAXB object tree.
+ *
+ * <p>
+ * Implements <a href="Unmarshaller.html#unmarshalByDeclaredType">Unmarshal by Declared Type</a>
+ *
+ * <p>
+ * This method is similar to {@link Unmarshaller#unmarshal(Node, Class)}
+ * with the addition of maintaining the association between XML nodes
+ * and the produced JAXB objects, enabling future update operations,
+ * {@link #updateXML(Object, Object)} or {@link #updateJAXB(Object)}.
+ *
+ * <p>
+ * When {@link #getSchema()} is non-null, <code>xmlNode</code>
+ * and its descendants is validated during this operation.
+ *
+ * @param xmlNode
+ * the document/element to unmarshal XML data from.
+ * @param declaredType
+ * appropriate JAXB mapped class to hold <tt>node</tt>'s XML data.
+ *
+ * @return
+ * <a href="#unmarshalDeclaredTypeReturn">JAXB Element</a> representation
+ * of <tt>node</tt>
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Binder</tt> is unable to perform the XML to Java
+ * binding.
+ * @throws IllegalArgumentException
+ * If any of the input parameters are null
+ * @since JAXB2.0
+ */
+ public abstract <T> JAXBElement<T>
+ unmarshal( XmlNode xmlNode, Class<T> declaredType )
+ throws JAXBException;
+
+ /**
+ * Marshal a JAXB object tree to a new XML document.
+ *
+ * <p>
+ * This method is similar to {@link Marshaller#marshal(Object, Node)}
+ * with the addition of maintaining the association between JAXB objects
+ * and the produced XML nodes,
+ * enabling future update operations such as
+ * {@link #updateXML(Object, Object)} or {@link #updateJAXB(Object)}.
+ *
+ * <p>
+ * When {@link #getSchema()} is non-null, the marshalled
+ * xml content is validated during this operation.
+ *
+ * @param jaxbObject
+ * The content tree to be marshalled.
+ * @param xmlNode
+ * The parameter must be a Node that accepts children.
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs during the marshalling.
+ * @throws MarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Binder</tt> is unable to marshal <tt>jaxbObject</tt> (or any
+ * object reachable from <tt>jaxbObject</tt>).
+ *
+ * @throws IllegalArgumentException
+ * If any of the method parameters are null
+ */
+ public abstract void marshal( Object jaxbObject, XmlNode xmlNode ) throws JAXBException;
+
+ /**
+ * Gets the XML element associated with the given JAXB object.
+ *
+ * <p>
+ * Once a JAXB object tree is associated with an XML fragment,
+ * this method enables navigation between the two trees.
+ *
+ * <p>
+ * An association between an XML element and a JAXB object is
+ * established by the bind methods and the update methods.
+ * Note that this association is partial; not all XML elements
+ * have associated JAXB objects, and not all JAXB objects have
+ * associated XML elements.
+ *
+ * @param jaxbObject An instance that is reachable from a prior
+ * call to a bind or update method that returned
+ * a JAXB object tree.
+ *
+ * @return
+ * null if the specified JAXB object is not known to this
+ * {@link Binder}, or if it is not associated with an
+ * XML element.
+ *
+ * @throws IllegalArgumentException
+ * If the jaxbObject parameter is null
+ */
+ public abstract XmlNode getXMLNode( Object jaxbObject );
+
+ /**
+ * Gets the JAXB object associated with the given XML element.
+ *
+ * <p>
+ * Once a JAXB object tree is associated with an XML fragment,
+ * this method enables navigation between the two trees.
+ *
+ * <p>
+ * An association between an XML element and a JAXB object is
+ * established by the unmarshal, marshal and update methods.
+ * Note that this association is partial; not all XML elements
+ * have associated JAXB objects, and not all JAXB objects have
+ * associated XML elements.
+ *
+ * @return
+ * null if the specified XML node is not known to this
+ * {@link Binder}, or if it is not associated with a
+ * JAXB object.
+ *
+ * @throws IllegalArgumentException
+ * If the node parameter is null
+ */
+ public abstract Object getJAXBNode( XmlNode xmlNode );
+
+ /**
+ * Takes an JAXB object and updates
+ * its associated XML node and its descendants.
+ *
+ * <p>
+ * This is a convenience method of:
+ * <pre>
+ * updateXML( jaxbObject, getXMLNode(jaxbObject));
+ * </pre>
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs updating corresponding XML content.
+ * @throws IllegalArgumentException
+ * If the jaxbObject parameter is null
+ */
+ public abstract XmlNode updateXML( Object jaxbObject ) throws JAXBException;
+
+ /**
+ * Changes in JAXB object tree are updated in its associated XML parse tree.
+ *
+ * <p>
+ * This operation can be thought of as an "in-place" marshalling.
+ * The difference is that instead of creating a whole new XML tree,
+ * this operation updates an existing tree while trying to preserve
+ * the XML as much as possible.
+ *
+ * <p>
+ * For example, unknown elements/attributes in XML that were not bound
+ * to JAXB will be left untouched (whereas a marshalling operation
+ * would create a new tree that doesn't contain any of those.)
+ *
+ * <p>
+ * As a side-effect, this operation updates the association between
+ * XML nodes and JAXB objects.
+ *
+ * @param jaxbObject root of potentially modified JAXB object tree
+ * @param xmlNode root of update target XML parse tree
+ *
+ * @return
+ * Returns the updated XML node. Typically, this is the same
+ * node you passed in as <i>xmlNode</i>, but it maybe
+ * a different object, for example when the tag name of the object
+ * has changed.
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs updating corresponding XML content.
+ * @throws IllegalArgumentException
+ * If any of the input parameters are null
+ */
+ public abstract XmlNode updateXML( Object jaxbObject, XmlNode xmlNode ) throws JAXBException;
+
+ /**
+ * Takes an XML node and updates its associated JAXB object and its descendants.
+ *
+ * <p>
+ * This operation can be thought of as an "in-place" unmarshalling.
+ * The difference is that instead of creating a whole new JAXB tree,
+ * this operation updates an existing tree, reusing as much JAXB objects
+ * as possible.
+ *
+ * <p>
+ * As a side-effect, this operation updates the association between
+ * XML nodes and JAXB objects.
+ *
+ * @return
+ * Returns the updated JAXB object. Typically, this is the same
+ * object that was returned from earlier
+ * {@link #marshal(Object,Object)} or
+ * {@link #updateJAXB(Object)} method invocation,
+ * but it maybe
+ * a different object, for example when the name of the XML
+ * element has changed.
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs updating corresponding JAXB mapped content.
+ * @throws IllegalArgumentException
+ * If node parameter is null
+ */
+ public abstract Object updateJAXB( XmlNode xmlNode ) throws JAXBException;
+
+
+ /**
+ * Specifies whether marshal, unmarshal and update methods
+ * performs validation on their XML content.
+ *
+ * @param schema set to null to disable validation.
+ *
+ * @see Unmarshaller#setSchema(Schema)
+ */
+ public abstract void setSchema( Schema schema );
+
+ /**
+ * Gets the last {@link Schema} object (including null) set by the
+ * {@link #setSchema(Schema)} method.
+ *
+ * @return the Schema object for validation or null if not present
+ */
+ public abstract Schema getSchema();
+
+ /**
+ * Allow an application to register a <tt>ValidationEventHandler</tt>.
+ * <p>
+ * The <tt>ValidationEventHandler</tt> will be called by the JAXB Provider
+ * if any validation errors are encountered during calls to any of the
+ * Binder unmarshal, marshal and update methods.
+ *
+ * <p>
+ * Calling this method with a null parameter will cause the Binder
+ * to revert back to the default default event handler.
+ *
+ * @param handler the validation event handler
+ * @throws JAXBException if an error was encountered while setting the
+ * event handler
+ */
+ public abstract void setEventHandler( ValidationEventHandler handler ) throws JAXBException;
+
+ /**
+ * Return the current event handler or the default event handler if one
+ * hasn't been set.
+ *
+ * @return the current ValidationEventHandler or the default event handler
+ * if it hasn't been set
+ * @throws JAXBException if an error was encountered while getting the
+ * current event handler
+ */
+ public abstract ValidationEventHandler getEventHandler() throws JAXBException;
+
+ /**
+ *
+ * Set the particular property in the underlying implementation of
+ * <tt>Binder</tt>. This method can only be used to set one of
+ * the standard JAXB defined unmarshal/marshal properties
+ * or a provider specific property for binder, unmarshal or marshal.
+ * Attempting to set an undefined property will result in
+ * a PropertyException being thrown. See
+ * <a href="Unmarshaller.html#supportedProps">Supported Unmarshal Properties</a>
+ * and
+ * <a href="Marshaller.html#supportedProps">Supported Marshal Properties</a>.
+ *
+ * @param name the name of the property to be set. This value can either
+ * be specified using one of the constant fields or a user
+ * supplied string.
+ * @param value the value of the property to be set
+ *
+ * @throws PropertyException when there is an error processing the given
+ * property or value
+ * @throws IllegalArgumentException
+ * If the name parameter is null
+ */
+ abstract public void setProperty( String name, Object value ) throws PropertyException;
+
+
+ /**
+ * Get the particular property in the underlying implementation of
+ * <tt>Binder</tt>. This method can only
+ * be used to get one of
+ * the standard JAXB defined unmarshal/marshal properties
+ * or a provider specific property for binder, unmarshal or marshal.
+ * Attempting to get an undefined property will result in
+ * a PropertyException being thrown. See
+ * <a href="Unmarshaller.html#supportedProps">Supported Unmarshal Properties</a>
+ * and
+ * <a href="Marshaller.html#supportedProps">Supported Marshal Properties</a>.
+ *
+ * @param name the name of the property to retrieve
+ * @return the value of the requested property
+ *
+ * @throws PropertyException
+ * when there is an error retrieving the given property or value
+ * property name
+ * @throws IllegalArgumentException
+ * If the name parameter is null
+ */
+ abstract public Object getProperty( String name ) throws PropertyException;
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ContextFinder.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ContextFinder.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ContextFinder.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,467 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.util.Map;
+import java.util.Properties;
+import java.util.StringTokenizer;
+import java.util.logging.ConsoleHandler;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import static javax.xml.bind.JAXBContext.JAXB_CONTEXT_FACTORY;
+
+//import java.lang.reflect.InvocationTargetException;
+
+/**
+ * This class is package private and therefore is not exposed as part of the
+ * JAXB API.
+ *
+ * This code is designed to implement the JAXB 1.0 spec pluggability feature
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $
+ * @see JAXBContext
+ */
+class ContextFinder {
+ private static final Logger logger;
+ static {
+ logger = Logger.getLogger("javax.xml.bind");
+ try {
+ if (System.getProperty("jaxb.debug", null) != null) {
+ // disconnect the logger from a bigger framework (if any)
+ // and take the matters into our own hands
+ logger.setUseParentHandlers(false);
+ logger.setLevel(Level.ALL);
+ ConsoleHandler handler = new ConsoleHandler();
+ handler.setLevel(Level.ALL);
+ logger.addHandler(handler);
+ } else {
+ // don't change the setting of this logger
+ // to honor what other frameworks
+ // have done on configurations.
+ }
+ } catch(Throwable t) {
+ // just to be extra safe. in particular System.getProperty may throw
+ // SecurityException.
+ }
+ }
+
+ /**
+ * If the {@link InvocationTargetException} wraps an exception that shouldn't be wrapped,
+ * throw the wrapped exception.
+ */
+ private static void handleInvocationTargetException(InvocationTargetException x) throws JAXBException {
+ Throwable t = x.getTargetException();
+ if( t != null ) {
+ if( t instanceof JAXBException )
+ // one of our exceptions, just re-throw
+ throw (JAXBException)t;
+ if( t instanceof RuntimeException )
+ // avoid wrapping exceptions unnecessarily
+ throw (RuntimeException)t;
+ if( t instanceof Error )
+ throw (Error)t;
+ }
+ }
+
+
+ /**
+ * Determine if two types (JAXBContext in this case) will generate a ClassCastException.
+ *
+ * For example, (targetType)originalType
+ *
+ * @param originalType
+ * The Class object of the type being cast
+ * @param targetType
+ * The Class object of the type that is being cast to
+ * @throws JAXBException
+ * If the cast would fail
+ */
+ private static void handleClassCastException(Class originalType, Class targetType) throws JAXBException {
+ final URL targetTypeURL = which(targetType);
+
+ throw new JAXBException(Messages.format(Messages.ILLEGAL_CAST,
+ // we don't care where the impl class is, we want to know where JAXBContext lives in the impl
+ // class' ClassLoader
+ originalType.getClass().getClassLoader().getResource("javax/xml/bind/JAXBContext.class").toString(),
+ targetTypeURL.toString()));
+ }
+
+ /**
+ * Create an instance of a class using the specified ClassLoader
+ */
+ static JAXBContext newInstance( String contextPath,
+ String className,
+ ClassLoader classLoader,
+ Map properties )
+ throws JAXBException
+ {
+ try {
+ Class spiClass;
+ if (classLoader == null) {
+ spiClass = Class.forName(className);
+ } else {
+ spiClass = classLoader.loadClass(className);
+ }
+
+ /*
+ * javax.xml.bind.context.factory points to a class which has a
+ * static method called 'createContext' that
+ * returns a javax.xml.JAXBContext.
+ */
+
+ Object context = null;
+
+ // first check the method that takes Map as the third parameter.
+ // this is added in 2.0.
+ try {
+ Method m = spiClass.getMethod("createContext",String.class,ClassLoader.class,Map.class);
+ // any failure in invoking this method would be considered fatal
+ context = m.invoke(null,contextPath,classLoader,properties);
+ } catch (NoSuchMethodException e) {
+ ; // it's not an error for the provider not to have this method.
+ }
+
+ if(context==null) {
+ // try the old method that doesn't take properties. compatible with 1.0.
+ // it is an error for an implementation not to have both forms of the createContext method.
+ Method m = spiClass.getMethod("createContext",String.class,ClassLoader.class);
+ // any failure in invoking this method would be considered fatal
+ context = m.invoke(null,contextPath,classLoader);
+ }
+
+ if(!(context instanceof JAXBContext)) {
+ // the cast would fail, so generate an exception with a nice message
+ handleClassCastException(context.getClass(), JAXBContext.class);
+ }
+ return (JAXBContext)context;
+ } catch (ClassNotFoundException x) {
+ throw new JAXBException(
+ Messages.format( Messages.PROVIDER_NOT_FOUND, className ),
+ x);
+ } catch (InvocationTargetException x) {
+ handleInvocationTargetException(x);
+ // for other exceptions, wrap the internal target exception
+ // with a JAXBException
+ Throwable e = x;
+ if(x.getTargetException()!=null)
+ e = x.getTargetException();
+
+ throw new JAXBException( Messages.format( Messages.COULD_NOT_INSTANTIATE, className, e ), e );
+ } catch (RuntimeException x) {
+ // avoid wrapping RuntimeException to JAXBException,
+ // because it indicates a bug in this code.
+ throw x;
+ } catch (Exception x) {
+ // can't catch JAXBException because the method is hidden behind
+ // reflection. Root element collisions detected in the call to
+ // createContext() are reported as JAXBExceptions - just re-throw it
+ // some other type of exception - just wrap it
+ throw new JAXBException(
+ Messages.format( Messages.COULD_NOT_INSTANTIATE, className, x ),
+ x);
+ }
+ }
+
+
+ /**
+ * Create an instance of a class using the specified ClassLoader
+ */
+ static JAXBContext newInstance(
+ Class[] classes,
+ Map properties,
+ String className) throws JAXBException {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ Class spi;
+ try {
+ logger.fine("Trying to load "+className);
+ if (cl != null)
+ spi = cl.loadClass(className);
+ else
+ spi = Class.forName(className);
+ } catch (ClassNotFoundException e) {
+ throw new JAXBException(e);
+ }
+
+ if(logger.isLoggable(Level.FINE)) {
+ // extra check to avoid costly which operation if not logged
+ logger.fine("loaded "+className+" from "+which(spi));
+ }
+
+ Method m;
+ try {
+ m = spi.getMethod("createContext", Class[].class, Map.class);
+ } catch (NoSuchMethodException e) {
+ throw new JAXBException(e);
+ }
+ try {
+ Object context = m.invoke(null, classes, properties);
+ if(!(context instanceof JAXBContext)) {
+ // the cast would fail, so generate an exception with a nice message
+ handleClassCastException(context.getClass(), JAXBContext.class);
+ }
+ return (JAXBContext)context;
+ } catch (IllegalAccessException e) {
+ throw new JAXBException(e);
+ } catch (InvocationTargetException e) {
+ handleInvocationTargetException(e);
+
+ Throwable x = e;
+ if (e.getTargetException() != null)
+ x = e.getTargetException();
+
+ throw new JAXBException(x);
+ }
+ }
+
+
+ static JAXBContext find(String factoryId, String contextPath, ClassLoader classLoader, Map properties ) throws JAXBException {
+
+ // TODO: do we want/need another layer of searching in $java.home/lib/jaxb.properties like JAXP?
+
+ final String jaxbContextFQCN = JAXBContext.class.getName();
+
+ // search context path for jaxb.properties first
+ StringBuilder propFileName;
+ StringTokenizer packages = new StringTokenizer( contextPath, ":" );
+ String factoryClassName;
+
+ if(!packages.hasMoreTokens())
+ // no context is specified
+ throw new JAXBException(Messages.format(Messages.NO_PACKAGE_IN_CONTEXTPATH));
+
+
+ logger.fine("Searching jaxb.properties");
+
+ while( packages.hasMoreTokens() ) {
+ String packageName = packages.nextToken(":").replace('.','/');
+ // com.acme.foo - > com/acme/foo/jaxb.properties
+ propFileName = new StringBuilder().append(packageName).append("/jaxb.properties");
+
+ Properties props = loadJAXBProperties( classLoader, propFileName.toString() );
+ if (props == null) {
+ continue;
+ } else {
+ if (props.containsKey(factoryId)) {
+ factoryClassName = props.getProperty(factoryId);
+ return newInstance( contextPath, factoryClassName, classLoader, properties );
+ } else {
+ throw new JAXBException(Messages.format(Messages.MISSING_PROPERTY, packageName, factoryId));
+ }
+ }
+ }
+
+ logger.fine("Searching the system property");
+
+ // search for a system property second (javax.xml.bind.JAXBContext)
+ factoryClassName = System.getProperty(jaxbContextFQCN, null);
+ if( factoryClassName != null ) {
+ return newInstance( contextPath, factoryClassName, classLoader, properties );
+ }
+
+ logger.fine("Searching META-INF/services");
+
+ // search META-INF services next
+ BufferedReader r;
+ try {
+ final StringBuilder resource = new StringBuilder().append("META-INF/services/").append(jaxbContextFQCN);
+ final InputStream resourceStream =
+ classLoader.getResourceAsStream(resource.toString());
+
+ if (resourceStream != null) {
+ r = new BufferedReader(new InputStreamReader(resourceStream, "UTF-8"));
+ factoryClassName = r.readLine().trim();
+ return newInstance(contextPath, factoryClassName, classLoader, properties);
+ } else {
+ logger.fine("Unable to load:" + resource.toString());
+ }
+ } catch (UnsupportedEncodingException e) {
+ // should never happen
+ throw new JAXBException(e);
+ } catch (IOException e) {
+ throw new JAXBException(e);
+ }
+
+ // else no provider found
+ logger.fine("Trying to create the platform default provider");
+ return newInstance(contextPath, PLATFORM_DEFAULT_FACTORY_CLASS, classLoader, properties);
+ }
+
+ // TODO: log each step in the look up process
+ static JAXBContext find( Class[] classes, Map properties ) throws JAXBException {
+
+ // TODO: do we want/need another layer of searching in $java.home/lib/jaxb.properties like JAXP?
+
+ final String jaxbContextFQCN = JAXBContext.class.getName();
+ String factoryClassName;
+
+ // search for jaxb.properties in the class loader of each class first
+ for (Class c : classes) {
+ ClassLoader classLoader = c.getClassLoader();
+ Package pkg = c.getPackage();
+ if(pkg==null)
+ continue; // this is possible for primitives, arrays, and classes that are loaded by poorly implemented ClassLoaders
+ String packageName = pkg.getName().replace('.', '/');
+
+ // TODO: do we want to optimize away searching the same package? org.Foo, org.Bar, com.Baz
+ // classes from the same package might come from different class loades, so it might be a bad idea
+
+ // TODO: it's easier to look things up from the class
+ // c.getResourceAsStream("jaxb.properties");
+
+ // build the resource name and use the property loader code
+ String resourceName = packageName+"/jaxb.properties";
+ logger.fine("Trying to locate "+resourceName);
+ Properties props = loadJAXBProperties(classLoader, resourceName);
+ if (props == null) {
+ logger.fine(" not found");
+ continue;
+ } else {
+ logger.fine(" found");
+ if (props.containsKey(JAXB_CONTEXT_FACTORY)) {
+ // trim() seems redundant, but adding to satisfy customer complaint
+ factoryClassName = props.getProperty(JAXB_CONTEXT_FACTORY).trim();
+ return newInstance(classes, properties, factoryClassName);
+ } else {
+ throw new JAXBException(Messages.format(Messages.MISSING_PROPERTY, packageName, JAXB_CONTEXT_FACTORY));
+ }
+ }
+ }
+
+ // search for a system property second (javax.xml.bind.JAXBContext)
+ logger.fine("Checking system property "+jaxbContextFQCN);
+ factoryClassName = System.getProperty(jaxbContextFQCN, null);
+ if( factoryClassName != null ) {
+ logger.fine(" found "+factoryClassName);
+ return newInstance( classes, properties, factoryClassName );
+ }
+ logger.fine(" not found");
+
+ // search META-INF services next
+ logger.fine("Checking META-INF/services");
+ BufferedReader r;
+ try {
+ final String resource = new StringBuilder("META-INF/services/").append(jaxbContextFQCN).toString();
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ URL resourceURL;
+ if(classLoader==null)
+ resourceURL = ClassLoader.getSystemResource(resource);
+ else
+ resourceURL = classLoader.getResource(resource);
+
+ if (resourceURL != null) {
+ logger.fine("Reading "+resourceURL);
+ r = new BufferedReader(new InputStreamReader(resourceURL.openStream(), "UTF-8"));
+ factoryClassName = r.readLine().trim();
+ return newInstance(classes, properties, factoryClassName);
+ } else {
+ logger.fine("Unable to find: " + resource);
+ }
+ } catch (UnsupportedEncodingException e) {
+ // should never happen
+ throw new JAXBException(e);
+ } catch (IOException e) {
+ throw new JAXBException(e);
+ }
+
+ // else no provider found
+ logger.fine("Trying to create the platform default provider");
+ return newInstance(classes, properties, PLATFORM_DEFAULT_FACTORY_CLASS);
+ }
+
+
+ private static Properties loadJAXBProperties( ClassLoader classLoader,
+ String propFileName )
+ throws JAXBException {
+
+ Properties props = null;
+
+ try {
+ URL url;
+ if(classLoader==null)
+ url = ClassLoader.getSystemResource(propFileName);
+ else
+ url = classLoader.getResource( propFileName );
+
+ if( url != null ) {
+ logger.fine("loading props from "+url);
+ props = new Properties();
+ InputStream is = url.openStream();
+ props.load( is );
+ is.close();
+ }
+ } catch( IOException ioe ) {
+ logger.log(Level.FINE,"Unable to load "+propFileName,ioe);
+ throw new JAXBException( ioe.toString(), ioe );
+ }
+
+ return props;
+ }
+
+
+ /**
+ * Search the given ClassLoader for an instance of the specified class and
+ * return a string representation of the URL that points to the resource.
+ *
+ * @param clazz
+ * The class to search for
+ * @param loader
+ * The ClassLoader to search. If this parameter is null, then the
+ * system class loader will be searched
+ * @return
+ * the URL for the class or null if it wasn't found
+ */
+ static URL which(Class clazz, ClassLoader loader) {
+
+ String classnameAsResource = clazz.getName().replace('.', '/') + ".class";
+
+ if(loader == null) {
+ loader = ClassLoader.getSystemClassLoader();
+ }
+
+ return loader.getResource(classnameAsResource);
+ }
+
+ /**
+ * Get the URL for the Class from it's ClassLoader.
+ *
+ * Convenience method for {@link #which(Class, ClassLoader)}.
+ *
+ * Equivalent to calling: which(clazz, clazz.getClassLoader())
+ *
+ * @param clazz
+ * The class to search for
+ * @return
+ * the URL for the class or null if it wasn't found
+ */
+ static URL which(Class clazz) {
+ return which(clazz, clazz.getClassLoader());
+ }
+
+ /**
+ * When JAXB is in J2SE, rt.jar has to have a JAXB implementation.
+ * However, rt.jar cannot have META-INF/services/javax.xml.bind.JAXBContext
+ * because if it has, it will take precedence over any file that applications have
+ * in their jar files.
+ *
+ * <p>
+ * When the user bundles his own JAXB implementation, we'd like to use it, and we
+ * want the platform default to be used only when there's no other JAXB provider.
+ *
+ * <p>
+ * For this reason, we have to hard-code the class name into the API.
+ */
+ private static final String PLATFORM_DEFAULT_FACTORY_CLASS = "com.sun.xml.bind.v2.ContextFactory";
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/DatatypeConverter.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/DatatypeConverter.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/DatatypeConverter.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,624 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+import javax.xml.namespace.NamespaceContext;
+
+/**
+ * <p>
+ * The javaType binding declaration can be used to customize the binding of
+ * an XML schema datatype to a Java datatype. Customizations can involve
+ * writing a parse and print method for parsing and printing lexical
+ * representations of a XML schema datatype respectively. However, writing
+ * parse and print methods requires knowledge of the lexical representations (
+ * <a href="http://www.w3.org/TR/xmlschema-2/"> XML Schema Part2: Datatypes
+ * specification </a>) and hence may be difficult to write.
+ * </p>
+ * <p>
+ * This class makes it easier to write parse and print methods. It defines
+ * static parse and print methods that provide access to a JAXB provider's
+ * implementation of parse and print methods. These methods are invoked by
+ * custom parse and print methods. For example, the binding of xsd:dateTime
+ * to a long can be customized using parse and print methods as follows:
+ * <blockquote>
+ * <pre>
+ * // Customized parse method
+ * public long myParseCal( String dateTimeString ) {
+ * java.util.Calendar cal = DatatypeConverter.parseDateTime(dateTimeString);
+ * long longval = convert_calendar_to_long(cal); //application specific
+ * return longval;
+ * }
+ *
+ * // Customized print method
+ * public String myPrintCal( Long longval ) {
+ * java.util.Calendar cal = convert_long_to_calendar(longval) ; //application specific
+ * String dateTimeString = DatatypeConverter.printDateTime(cal);
+ * return dateTimeString;
+ * }
+ * </pre>
+ * </blockquote>
+ * <p>
+ * There is a static parse and print method corresponding to each parse and
+ * print method respectively in the {@link DatatypeConverterInterface
+ * DatatypeConverterInterface}.
+ * <p>
+ * The static methods defined in the class can also be used to specify
+ * a parse or a print method in a javaType binding declaration.
+ * </p>
+ * <p>
+ * JAXB Providers are required to call the
+ * {@link #setDatatypeConverter(DatatypeConverterInterface)
+ * setDatatypeConverter} api at some point before the first marshal or unmarshal
+ * operation (perhaps during the call to JAXBContext.newInstance). This step is
+ * necessary to configure the converter that should be used to perform the
+ * print and parse functionality.
+ * </p>
+ *
+ * <p>
+ * A print method for a XML schema datatype can output any lexical
+ * representation that is valid with respect to the XML schema datatype.
+ * If an error is encountered during conversion, then an IllegalArgumentException,
+ * or a subclass of IllegalArgumentException must be thrown by the method.
+ * </p>
+ *
+ * @author <ul><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Ryan Shoemaker,Sun Microsystems Inc.</li></ul>
+ * @version $Revision: 2467 $
+ * @see DatatypeConverterInterface
+ * @see ParseConversionEvent
+ * @see PrintConversionEvent
+ * @since JAXB1.0
+ */
+
+final public class DatatypeConverter {
+
+ // delegate to this instance of DatatypeConverter
+ private static DatatypeConverterInterface theConverter = null;
+
+ private DatatypeConverter() {
+ // private constructor
+ }
+
+ /**
+ * This method is for JAXB provider use only.
+ * <p>
+ * JAXB Providers are required to call this method at some point before
+ * allowing any of the JAXB client marshal or unmarshal operations to
+ * occur. This is necessary to configure the datatype converter that
+ * should be used to perform the print and parse conversions.
+ *
+ * <p>
+ * Calling this api repeatedly will have no effect - the
+ * DatatypeConverterInterface instance passed into the first invocation is
+ * the one that will be used from then on.
+ *
+ * @param converter an instance of a class that implements the
+ * DatatypeConverterInterface class - this parameter must not be null.
+ * @throws IllegalArgumentException if the parameter is null
+ */
+ public static void setDatatypeConverter( DatatypeConverterInterface converter ) {
+ if( converter == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.CONVERTER_MUST_NOT_BE_NULL ) );
+ } else if( theConverter == null ) {
+ theConverter = converter;
+ }
+ }
+
+ /**
+ * <p>
+ * Convert the lexical XSD string argument into a String value.
+ * @param lexicalXSDString
+ * A string containing a lexical representation of
+ * xsd:string.
+ * @return
+ * A String value represented by the string argument.
+ */
+ public static String parseString( String lexicalXSDString ) {
+ return theConverter.parseString( lexicalXSDString );
+ }
+
+ /**
+ * <p>
+ * Convert the string argument into a BigInteger value.
+ * @param lexicalXSDInteger
+ * A string containing a lexical representation of
+ * xsd:integer.
+ * @return
+ * A BigInteger value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDInteger</code> is not a valid string representation of a {@link java.math.BigInteger} value.
+ */
+ public static java.math.BigInteger parseInteger( String lexicalXSDInteger ) {
+ return theConverter.parseInteger( lexicalXSDInteger );
+ }
+
+ /**
+ * <p>
+ * Convert the string argument into an int value.
+ * @param lexicalXSDInt
+ * A string containing a lexical representation of
+ * xsd:int.
+ * @return
+ * A int value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDInt</code> is not a valid string representation of an <code>int</code> value.
+ */
+ public static int parseInt( String lexicalXSDInt ) {
+ return theConverter.parseInt( lexicalXSDInt );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into a long value.
+ * @param lexicalXSDLong
+ * A string containing lexical representation of
+ * xsd:long.
+ * @return
+ * A long value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDLong</code> is not a valid string representation of a <code>long</code> value.
+ */
+ public static long parseLong( String lexicalXSDLong ) {
+ return theConverter.parseLong( lexicalXSDLong );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into a short value.
+ * @param lexicalXSDShort
+ * A string containing lexical representation of
+ * xsd:short.
+ * @return
+ * A short value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDShort</code> is not a valid string representation of a <code>short</code> value.
+ */
+ public static short parseShort( String lexicalXSDShort ) {
+ return theConverter.parseShort( lexicalXSDShort );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into a BigDecimal value.
+ * @param lexicalXSDDecimal
+ * A string containing lexical representation of
+ * xsd:decimal.
+ * @return
+ * A BigDecimal value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDDecimal</code> is not a valid string representation of {@link java.math.BigDecimal}.
+ */
+ public static java.math.BigDecimal parseDecimal( String lexicalXSDDecimal ) {
+ return theConverter.parseDecimal( lexicalXSDDecimal );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into a float value.
+ * @param lexicalXSDFloat
+ * A string containing lexical representation of
+ * xsd:float.
+ * @return
+ * A float value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDFloat</code> is not a valid string representation of a <code>float</code> value.
+ */
+ public static float parseFloat( String lexicalXSDFloat ) {
+ return theConverter.parseFloat( lexicalXSDFloat );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into a double value.
+ * @param lexicalXSDDouble
+ * A string containing lexical representation of
+ * xsd:double.
+ * @return
+ * A double value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDDouble</code> is not a valid string representation of a <code>double</code> value.
+ */
+ public static double parseDouble( String lexicalXSDDouble ) {
+ return theConverter.parseDouble( lexicalXSDDouble );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into a boolean value.
+ * @param lexicalXSDBoolean
+ * A string containing lexical representation of
+ * xsd:boolean.
+ * @return
+ * A boolean value represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:boolean.
+ */
+ public static boolean parseBoolean( String lexicalXSDBoolean ) {
+ return theConverter.parseBoolean( lexicalXSDBoolean );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into a byte value.
+ * @param lexicalXSDByte
+ * A string containing lexical representation of
+ * xsd:byte.
+ * @return
+ * A byte value represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:byte.
+ */
+ public static byte parseByte( String lexicalXSDByte ) {
+ return theConverter.parseByte( lexicalXSDByte );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into a byte value.
+ *
+ * <p>
+ * String parameter <tt>lexicalXSDQname</tt> must conform to lexical value space specifed at
+ * <a href="http://www.w3.org/TR/xmlschema-2/#QName">XML Schema Part 2:Datatypes specification:QNames</a>
+ *
+ * @param lexicalXSDQName
+ * A string containing lexical representation of xsd:QName.
+ * @param nsc
+ * A namespace context for interpreting a prefix within a QName.
+ * @return
+ * A QName value represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to XML Schema Part 2 specification or
+ * if namespace prefix of <tt>lexicalXSDQname</tt> is not bound to a URI in NamespaceContext <tt>nsc</tt>.
+ */
+ public static javax.xml.namespace.QName parseQName( String lexicalXSDQName,
+ NamespaceContext nsc) {
+ return theConverter.parseQName( lexicalXSDQName, nsc );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into a Calendar value.
+ * @param lexicalXSDDateTime
+ * A string containing lexical representation of
+ * xsd:datetime.
+ * @return
+ * A Calendar object represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:dateTime.
+ */
+ public static java.util.Calendar parseDateTime( String lexicalXSDDateTime ) {
+ return theConverter.parseDateTime( lexicalXSDDateTime );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into an array of bytes.
+ * @param lexicalXSDBase64Binary
+ * A string containing lexical representation
+ * of xsd:base64Binary.
+ * @return
+ * An array of bytes represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:base64Binary
+ */
+ public static byte[] parseBase64Binary( String lexicalXSDBase64Binary ) {
+ return theConverter.parseBase64Binary( lexicalXSDBase64Binary );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into an array of bytes.
+ * @param lexicalXSDHexBinary
+ * A string containing lexical representation of
+ * xsd:hexBinary.
+ * @return
+ * An array of bytes represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:hexBinary.
+ */
+ public static byte[] parseHexBinary( String lexicalXSDHexBinary ) {
+ return theConverter.parseHexBinary( lexicalXSDHexBinary );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into a long value.
+ * @param lexicalXSDUnsignedInt
+ * A string containing lexical representation
+ * of xsd:unsignedInt.
+ * @return
+ * A long value represented by the string argument.
+ * @throws NumberFormatException if string parameter can not be parsed into a <tt>long</tt> value.
+ */
+ public static long parseUnsignedInt( String lexicalXSDUnsignedInt ) {
+ return theConverter.parseUnsignedInt( lexicalXSDUnsignedInt );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into an int value.
+ * @param lexicalXSDUnsignedShort
+ * A string containing lexical
+ * representation of xsd:unsignedShort.
+ * @return
+ * An int value represented by the string argument.
+ * @throws NumberFormatException if string parameter can not be parsed into an <tt>int</tt> value.
+ */
+ public static int parseUnsignedShort( String lexicalXSDUnsignedShort ) {
+ return theConverter.parseUnsignedShort( lexicalXSDUnsignedShort );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into a Calendar value.
+ * @param lexicalXSDTime
+ * A string containing lexical representation of
+ * xsd:time.
+ * @return
+ * A Calendar value represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Time.
+ */
+ public static java.util.Calendar parseTime( String lexicalXSDTime ) {
+ return theConverter.parseTime( lexicalXSDTime );
+ }
+ /**
+ * <p>
+ * Converts the string argument into a Calendar value.
+ * @param lexicalXSDDate
+ * A string containing lexical representation of
+ * xsd:Date.
+ * @return
+ * A Calendar value represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Date.
+ */
+ public static java.util.Calendar parseDate( String lexicalXSDDate ) {
+ return theConverter.parseDate( lexicalXSDDate );
+ }
+
+ /**
+ * <p>
+ * Return a string containing the lexical representation of the
+ * simple type.
+ * @param lexicalXSDAnySimpleType
+ * A string containing lexical
+ * representation of the simple type.
+ * @return
+ * A string containing the lexical representation of the
+ * simple type.
+ */
+ public static String parseAnySimpleType( String lexicalXSDAnySimpleType ) {
+ return theConverter.parseAnySimpleType( lexicalXSDAnySimpleType );
+ }
+ /**
+ * <p>
+ * Converts the string argument into a string.
+ * @param val
+ * A string value.
+ * @return
+ * A string containing a lexical representation of xsd:string.
+ */
+ // also indicate the print methods produce a lexical
+ // representation for given Java datatypes.
+
+ public static String printString( String val ) {
+ return theConverter.printString( val );
+ }
+
+ /**
+ * <p>
+ * Converts a BigInteger value into a string.
+ * @param val
+ * A BigInteger value
+ * @return
+ * A string containing a lexical representation of xsd:integer
+ * @throws IllegalArgumentException <tt>val</tt> is null.
+ */
+ public static String printInteger( java.math.BigInteger val ) {
+ return theConverter.printInteger( val );
+ }
+
+ /**
+ * <p>
+ * Converts an int value into a string.
+ * @param val
+ * An int value
+ * @return
+ * A string containing a lexical representation of xsd:int
+ */
+ public static String printInt( int val ) {
+ return theConverter.printInt( val );
+ }
+
+ /**
+ * <p>
+ * Converts A long value into a string.
+ * @param val
+ * A long value
+ * @return
+ * A string containing a lexical representation of xsd:long
+ */
+ public static String printLong( long val ) {
+ return theConverter.printLong( val );
+ }
+
+ /**
+ * <p>
+ * Converts a short value into a string.
+ * @param val
+ * A short value
+ * @return
+ * A string containing a lexical representation of xsd:short
+ */
+ public static String printShort( short val ) {
+ return theConverter.printShort( val );
+ }
+
+ /**
+ * <p>
+ * Converts a BigDecimal value into a string.
+ * @param val
+ * A BigDecimal value
+ * @return
+ * A string containing a lexical representation of xsd:decimal
+ * @throws IllegalArgumentException <tt>val</tt> is null.
+ */
+ public static String printDecimal( java.math.BigDecimal val ) {
+ return theConverter.printDecimal( val );
+ }
+
+ /**
+ * <p>
+ * Converts a float value into a string.
+ * @param val
+ * A float value
+ * @return
+ * A string containing a lexical representation of xsd:float
+ */
+ public static String printFloat( float val ) {
+ return theConverter.printFloat( val );
+ }
+
+ /**
+ * <p>
+ * Converts a double value into a string.
+ * @param val
+ * A double value
+ * @return
+ * A string containing a lexical representation of xsd:double
+ */
+ public static String printDouble( double val ) {
+ return theConverter.printDouble( val );
+ }
+
+ /**
+ * <p>
+ * Converts a boolean value into a string.
+ * @param val
+ * A boolean value
+ * @return
+ * A string containing a lexical representation of xsd:boolean
+ */
+ public static String printBoolean( boolean val ) {
+ return theConverter.printBoolean( val );
+ }
+
+ /**
+ * <p>
+ * Converts a byte value into a string.
+ * @param val
+ * A byte value
+ * @return
+ * A string containing a lexical representation of xsd:byte
+ */
+ public static String printByte( byte val ) {
+ return theConverter.printByte( val );
+ }
+
+ /**
+ * <p>
+ * Converts a QName instance into a string.
+ * @param val
+ * A QName value
+ * @param nsc
+ * A namespace context for interpreting a prefix within a QName.
+ * @return
+ * A string containing a lexical representation of QName
+ * @throws IllegalArgumentException if <tt>val</tt> is null or
+ * if <tt>nsc</tt> is non-null or <tt>nsc.getPrefix(nsprefixFromVal)</tt> is null.
+ */
+ public static String printQName( javax.xml.namespace.QName val,
+ NamespaceContext nsc ) {
+ return theConverter.printQName( val, nsc );
+ }
+
+ /**
+ * <p>
+ * Converts a Calendar value into a string.
+ * @param val
+ * A Calendar value
+ * @return
+ * A string containing a lexical representation of xsd:dateTime
+ * @throws IllegalArgumentException if <tt>val</tt> is null.
+ */
+ public static String printDateTime( java.util.Calendar val ) {
+ return theConverter.printDateTime( val );
+ }
+
+ /**
+ * <p>
+ * Converts an array of bytes into a string.
+ * @param val
+ * An array of bytes
+ * @return
+ * A string containing a lexical representation of xsd:base64Binary
+ * @throws IllegalArgumentException if <tt>val</tt> is null.
+ */
+ public static String printBase64Binary( byte[] val ) {
+ return theConverter.printBase64Binary( val );
+ }
+
+ /**
+ * <p>
+ * Converts an array of bytes into a string.
+ * @param val
+ * An array of bytes
+ * @return
+ * A string containing a lexical representation of xsd:hexBinary
+ * @throws IllegalArgumentException if <tt>val</tt> is null.
+ */
+ public static String printHexBinary( byte[] val ) {
+ return theConverter.printHexBinary( val );
+ }
+
+ /**
+ * <p>
+ * Converts a long value into a string.
+ * @param val
+ * A long value
+ * @return
+ * A string containing a lexical representation of xsd:unsignedInt
+ */
+ public static String printUnsignedInt( long val ) {
+ return theConverter.printUnsignedInt( val );
+ }
+
+ /**
+ * <p>
+ * Converts an int value into a string.
+ * @param val
+ * An int value
+ * @return
+ * A string containing a lexical representation of xsd:unsignedShort
+ */
+ public static String printUnsignedShort( int val ) {
+ return theConverter.printUnsignedShort( val );
+ }
+
+ /**
+ * <p>
+ * Converts a Calendar value into a string.
+ * @param val
+ * A Calendar value
+ * @return
+ * A string containing a lexical representation of xsd:time
+ * @throws IllegalArgumentException if <tt>val</tt> is null.
+ */
+ public static String printTime( java.util.Calendar val ) {
+ return theConverter.printTime( val );
+ }
+
+ /**
+ * <p>
+ * Converts a Calendar value into a string.
+ * @param val
+ * A Calendar value
+ * @return
+ * A string containing a lexical representation of xsd:date
+ * @throws IllegalArgumentException if <tt>val</tt> is null.
+ */
+ public static String printDate( java.util.Calendar val ) {
+ return theConverter.printDate( val );
+ }
+
+ /**
+ * <p>
+ * Converts a string value into a string.
+ * @param val
+ * A string value
+ * @return
+ * A string containing a lexical representation of xsd:AnySimpleType
+ */
+ public static String printAnySimpleType( String val ) {
+ return theConverter.printAnySimpleType( val );
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/DatatypeConverterInterface.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/DatatypeConverterInterface.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/DatatypeConverterInterface.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,504 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * <p>
+ * The DatatypeConverterInterface is for JAXB provider use only. A
+ * JAXB provider must supply a class that implements this interface.
+ * JAXB Providers are required to call the
+ * {@link DatatypeConverter#setDatatypeConverter(DatatypeConverterInterface)
+ * DatatypeConverter.setDatatypeConverter} api at
+ * some point before the first marshal or unmarshal operation (perhaps during
+ * the call to JAXBContext.newInstance). This step is necessary to configure
+ * the converter that should be used to perform the print and parse
+ * functionality. Calling this api repeatedly will have no effect - the
+ * DatatypeConverter instance passed into the first invocation is the one that
+ * will be used from then on.
+ * </p>
+ *
+ * <p>
+ * This interface defines the parse and print methods. There is one
+ * parse and print method for each XML schema datatype specified in the
+ * the default binding Table 5-1 in the JAXB specification.
+ * </p>
+ *
+ * <p>
+ * The parse and print methods defined here are invoked by the static parse
+ * and print methods defined in the {@link DatatypeConverter DatatypeConverter}
+ * class.
+ * </p>
+ *
+ * <p>
+ * A parse method for a XML schema datatype must be capable of converting any
+ * lexical representation of the XML schema datatype ( specified by the
+ * <a href="http://www.w3.org/TR/xmlschema-2/"> XML Schema Part2: Datatypes
+ * specification</a> into a value in the value space of the XML schema datatype.
+ * If an error is encountered during conversion, then an IllegalArgumentException
+ * or a subclass of IllegalArgumentException must be thrown by the method.
+ *
+ * </p>
+ *
+ * <p>
+ * A print method for a XML schema datatype can output any lexical
+ * representation that is valid with respect to the XML schema datatype.
+ * If an error is encountered during conversion, then an IllegalArgumentException,
+ * or a subclass of IllegalArgumentException must be thrown by the method.
+ * </p>
+ *
+ * The prefix xsd: is used to refer to XML schema datatypes
+ * <a href="http://www.w3.org/TR/xmlschema-2/"> XML Schema Part2: Datatypes
+ * specification.</a>
+ *
+ * <p>
+ * @author <ul><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Ryan Shoemaker,Sun Microsystems Inc.</li></ul>
+ * @version $Revision: 2467 $
+ * @see DatatypeConverter
+ * @see ParseConversionEvent
+ * @see PrintConversionEvent
+ * @since JAXB1.0
+ */
+
+public interface DatatypeConverterInterface {
+ /**
+ * <p>
+ * Convert the string argument into a string.
+ * @param lexicalXSDString
+ * A lexical representation of the XML Schema datatype xsd:string
+ * @return
+ * A string that is the same as the input string.
+ */
+ public String parseString( String lexicalXSDString );
+
+ /**
+ * <p>
+ * Convert the string argument into a BigInteger value.
+ * @param lexicalXSDInteger
+ * A string containing a lexical representation of
+ * xsd:integer.
+ * @return
+ * A BigInteger value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDInteger</code> is not a valid string representation of a {@link java.math.BigInteger} value.
+ */
+ public java.math.BigInteger parseInteger( String lexicalXSDInteger );
+
+ /**
+ * <p>
+ * Convert the string argument into an int value.
+ * @param lexicalXSDInt
+ * A string containing a lexical representation of
+ * xsd:int.
+ * @return
+ * An int value represented byte the string argument.
+ * @throws NumberFormatException <code>lexicalXSDInt</code> is not a valid string representation of an <code>int</code> value.
+ */
+ public int parseInt( String lexicalXSDInt );
+
+ /**
+ * <p>
+ * Converts the string argument into a long value.
+ * @param lexicalXSDLong
+ * A string containing lexical representation of
+ * xsd:long.
+ * @return
+ * A long value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDLong</code> is not a valid string representation of a <code>long</code> value.
+ */
+ public long parseLong( String lexicalXSDLong );
+
+ /**
+ * <p>
+ * Converts the string argument into a short value.
+ * @param lexicalXSDShort
+ * A string containing lexical representation of
+ * xsd:short.
+ * @return
+ * A short value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDShort</code> is not a valid string representation of a <code>short</code> value.
+ */
+ public short parseShort( String lexicalXSDShort );
+
+ /**
+ * <p>
+ * Converts the string argument into a BigDecimal value.
+ * @param lexicalXSDDecimal
+ * A string containing lexical representation of
+ * xsd:decimal.
+ * @return
+ * A BigDecimal value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDDecimal</code> is not a valid string representation of {@link java.math.BigDecimal}.
+ */
+ public java.math.BigDecimal parseDecimal( String lexicalXSDDecimal );
+
+ /**
+ * <p>
+ * Converts the string argument into a float value.
+ * @param lexicalXSDFloat
+ * A string containing lexical representation of
+ * xsd:float.
+ * @return
+ * A float value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDFloat</code> is not a valid string representation of a <code>float</code> value.
+ */
+ public float parseFloat( String lexicalXSDFloat );
+
+ /**
+ * <p>
+ * Converts the string argument into a double value.
+ * @param lexicalXSDDouble
+ * A string containing lexical representation of
+ * xsd:double.
+ * @return
+ * A double value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDDouble</code> is not a valid string representation of a <code>double</code> value.
+ */
+ public double parseDouble( String lexicalXSDDouble );
+
+ /**
+ * <p>
+ * Converts the string argument into a boolean value.
+ * @param lexicalXSDBoolean
+ * A string containing lexical representation of
+ * xsd:boolean.
+ * @return
+ * A boolean value represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:boolean.
+ */
+ public boolean parseBoolean( String lexicalXSDBoolean );
+
+ /**
+ * <p>
+ * Converts the string argument into a byte value.
+ * @param lexicalXSDByte
+ * A string containing lexical representation of
+ * xsd:byte.
+ * @return
+ * A byte value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDByte</code> does not contain a parseable byte.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:byte.
+ */
+ public byte parseByte( String lexicalXSDByte );
+
+ /**
+ * <p>
+ * Converts the string argument into a QName value.
+ *
+ * <p>
+ * String parameter <tt>lexicalXSDQname</tt> must conform to lexical value space specifed at
+ * <a href="http://www.w3.org/TR/xmlschema-2/#QName">XML Schema Part 2:Datatypes specification:QNames</a>
+ *
+ * @param lexicalXSDQName
+ * A string containing lexical representation of xsd:QName.
+ * @param nsc
+ * A namespace context for interpreting a prefix within a QName.
+ * @return
+ * A QName value represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to XML Schema Part 2 specification or
+ * if namespace prefix of <tt>lexicalXSDQname</tt> is not bound to a URI in NamespaceContext <tt>nsc</tt>.
+ */
+ public javax.xml.namespace.QName parseQName( String lexicalXSDQName,
+ javax.xml.namespace.NamespaceContext nsc);
+
+ /**
+ * <p>
+ * Converts the string argument into a Calendar value.
+ * @param lexicalXSDDateTime
+ * A string containing lexical representation of
+ * xsd:datetime.
+ * @return
+ * A Calendar object represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:dateTime.
+ */
+ public java.util.Calendar parseDateTime( String lexicalXSDDateTime );
+
+ /**
+ * <p>
+ * Converts the string argument into an array of bytes.
+ * @param lexicalXSDBase64Binary
+ * A string containing lexical representation
+ * of xsd:base64Binary.
+ * @return
+ * An array of bytes represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:base64Binary
+ */
+ public byte[] parseBase64Binary( String lexicalXSDBase64Binary );
+
+ /**
+ * <p>
+ * Converts the string argument into an array of bytes.
+ * @param lexicalXSDHexBinary
+ * A string containing lexical representation of
+ * xsd:hexBinary.
+ * @return
+ * An array of bytes represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:hexBinary.
+ */
+ public byte[] parseHexBinary( String lexicalXSDHexBinary );
+
+ /**
+ * <p>
+ * Converts the string argument into a long value.
+ * @param lexicalXSDUnsignedInt
+ * A string containing lexical representation
+ * of xsd:unsignedInt.
+ * @return
+ * A long value represented by the string argument.
+ * @throws NumberFormatException if string parameter can not be parsed into a <tt>long</tt> value.
+ */
+ public long parseUnsignedInt( String lexicalXSDUnsignedInt );
+
+ /**
+ * <p>
+ * Converts the string argument into an int value.
+ * @param lexicalXSDUnsignedShort
+ * A string containing lexical
+ * representation of xsd:unsignedShort.
+ * @return
+ * An int value represented by the string argument.
+ * @throws NumberFormatException if string parameter can not be parsed into an <tt>int</tt> value.
+ */
+ public int parseUnsignedShort( String lexicalXSDUnsignedShort );
+
+ /**
+ * <p>
+ * Converts the string argument into a Calendar value.
+ * @param lexicalXSDTime
+ * A string containing lexical representation of
+ * xsd:Time.
+ * @return
+ * A Calendar value represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Time.
+ */
+ public java.util.Calendar parseTime( String lexicalXSDTime );
+
+ /**
+ * <p>
+ * Converts the string argument into a Calendar value.
+ * @param lexicalXSDDate
+ * A string containing lexical representation of
+ * xsd:Date.
+ * @return
+ * A Calendar value represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Date.
+ */
+ public java.util.Calendar parseDate( String lexicalXSDDate );
+
+ /**
+ * <p>
+ * Return a string containing the lexical representation of the
+ * simple type.
+ * @param lexicalXSDAnySimpleType
+ * A string containing lexical
+ * representation of the simple type.
+ * @return
+ * A string containing the lexical representation of the
+ * simple type.
+ */
+ public String parseAnySimpleType( String lexicalXSDAnySimpleType );
+
+ /**
+ * <p>
+ * Converts the string argument into a string.
+ * @param val
+ * A string value.
+ * @return
+ * A string containing a lexical representation of xsd:string
+ */
+ public String printString( String val );
+
+ /**
+ * <p>
+ * Converts a BigInteger value into a string.
+ * @param val
+ * A BigInteger value
+ * @return
+ * A string containing a lexical representation of xsd:integer
+ * @throws IllegalArgumentException <tt>val</tt> is null.
+ */
+ public String printInteger( java.math.BigInteger val );
+
+ /**
+ * <p>
+ * Converts an int value into a string.
+ * @param val
+ * An int value
+ * @return
+ * A string containing a lexical representation of xsd:int
+ */
+ public String printInt( int val );
+
+
+ /**
+ * <p>
+ * Converts a long value into a string.
+ * @param val
+ * A long value
+ * @return
+ * A string containing a lexical representation of xsd:long
+ */
+ public String printLong( long val );
+
+ /**
+ * <p>
+ * Converts a short value into a string.
+ * @param val
+ * A short value
+ * @return
+ * A string containing a lexical representation of xsd:short
+ */
+ public String printShort( short val );
+
+ /**
+ * <p>
+ * Converts a BigDecimal value into a string.
+ * @param val
+ * A BigDecimal value
+ * @return
+ * A string containing a lexical representation of xsd:decimal
+ * @throws IllegalArgumentException <tt>val</tt> is null.
+ */
+ public String printDecimal( java.math.BigDecimal val );
+
+ /**
+ * <p>
+ * Converts a float value into a string.
+ * @param val
+ * A float value
+ * @return
+ * A string containing a lexical representation of xsd:float
+ */
+ public String printFloat( float val );
+
+ /**
+ * <p>
+ * Converts a double value into a string.
+ * @param val
+ * A double value
+ * @return
+ * A string containing a lexical representation of xsd:double
+ */
+ public String printDouble( double val );
+
+ /**
+ * <p>
+ * Converts a boolean value into a string.
+ * @param val
+ * A boolean value
+ * @return
+ * A string containing a lexical representation of xsd:boolean
+ */
+ public String printBoolean( boolean val );
+
+ /**
+ * <p>
+ * Converts a byte value into a string.
+ * @param val
+ * A byte value
+ * @return
+ * A string containing a lexical representation of xsd:byte
+ */
+ public String printByte( byte val );
+
+ /**
+ * <p>
+ * Converts a QName instance into a string.
+ * @param val
+ * A QName value
+ * @param nsc
+ * A namespace context for interpreting a prefix within a QName.
+ * @return
+ * A string containing a lexical representation of QName
+ * @throws IllegalArgumentException if <tt>val</tt> is null or
+ * if <tt>nsc</tt> is non-null or <tt>nsc.getPrefix(nsprefixFromVal)</tt> is null.
+ */
+ public String printQName( javax.xml.namespace.QName val,
+ javax.xml.namespace.NamespaceContext nsc );
+
+ /**
+ * <p>
+ * Converts a Calendar value into a string.
+ * @param val
+ * A Calendar value
+ * @return
+ * A string containing a lexical representation of xsd:dateTime
+ * @throws IllegalArgumentException if <tt>val</tt> is null.
+ */
+ public String printDateTime( java.util.Calendar val );
+
+ /**
+ * <p>
+ * Converts an array of bytes into a string.
+ * @param val
+ * an array of bytes
+ * @return
+ * A string containing a lexical representation of xsd:base64Binary
+ * @throws IllegalArgumentException if <tt>val</tt> is null.
+ */
+ public String printBase64Binary( byte[] val );
+
+ /**
+ * <p>
+ * Converts an array of bytes into a string.
+ * @param val
+ * an array of bytes
+ * @return
+ * A string containing a lexical representation of xsd:hexBinary
+ * @throws IllegalArgumentException if <tt>val</tt> is null.
+ */
+ public String printHexBinary( byte[] val );
+
+ /**
+ * <p>
+ * Converts a long value into a string.
+ * @param val
+ * A long value
+ * @return
+ * A string containing a lexical representation of xsd:unsignedInt
+ */
+ public String printUnsignedInt( long val );
+
+ /**
+ * <p>
+ * Converts an int value into a string.
+ * @param val
+ * An int value
+ * @return
+ * A string containing a lexical representation of xsd:unsignedShort
+ */
+ public String printUnsignedShort( int val );
+
+ /**
+ * <p>
+ * Converts a Calendar value into a string.
+ * @param val
+ * A Calendar value
+ * @return
+ * A string containing a lexical representation of xsd:time
+ * @throws IllegalArgumentException if <tt>val</tt> is null.
+ */
+ public String printTime( java.util.Calendar val );
+
+ /**
+ * <p>
+ * Converts a Calendar value into a string.
+ * @param val
+ * A Calendar value
+ * @return
+ * A string containing a lexical representation of xsd:date
+ * @throws IllegalArgumentException if <tt>val</tt> is null.
+ */
+ public String printDate( java.util.Calendar val );
+
+ /**
+ * <p>
+ * Converts a string value into a string.
+ * @param val
+ * A string value
+ * @return
+ * A string containing a lexical representation of xsd:AnySimpleType
+ */
+ public String printAnySimpleType( String val );
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Element.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Element.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Element.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * This is an element marker interface.
+ *
+ * Under certain circumstances, it is necessary for the binding compiler to
+ * generate derived java content classes that implement this interface. In
+ * those cases, client applications must supply element instances rather than
+ * types of elements. For more detail, see section 5.7 "Element Declaration"
+ * and 5.7.1 "Bind to Java Element Interface" of the specification.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $
+ * @since JAXB1.0
+ */
+
+public interface Element {
+}
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/JAXBContext.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/JAXBContext.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/JAXBContext.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,687 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+import org.w3c.dom.Node;
+
+import java.util.Collections;
+import java.util.Map;
+import java.io.IOException;
+
+/**
+ * <p>
+ * The <tt>JAXBContext</tt> class provides the client's entry point to the
+ * JAXB API. It provides an abstraction for managing the XML/Java binding
+ * information necessary to implement the JAXB binding framework operations:
+ * unmarshal, marshal and validate.
+ *
+ * <p>A client application normally obtains new instances of this class using
+ * one of these two styles for newInstance methods, although there are other
+ * specialized forms of the method has:
+ *
+ * <ul>
+ * <li>{@link #newInstance(String,ClassLoader) JAXBContext.newInstance( "com.acme.foo:com.acme.bar" )} <br/>
+ * The JAXBContext instance is initialized from a list of colon
+ * separated Java package names. Each java package contains
+ * JAXB mapped classes, schema-derived classes and/or user annotated
+ * classes. Additionally, the java package may contain JAXB package annotations
+ * that must be processed. (see JLS 3rd Edition, Section 7.4.1. Package Annotations).
+ * </li>
+ * <li>{@link #newInstance(Class...) JAXBContext.newInstance( com.acme.foo.Foo.class )} <br/>
+ * The JAXBContext instance is intialized with class(es)
+ * passed as parameter(s) and classes that are statically reachable from
+ * these class(es). See {@link #newInstance(Class...)} for details.
+ * </li>
+ * </ul>
+ *
+ * <p>
+ * <blockquote>
+ * <i><B>SPEC REQUIREMENT:</B> the provider must supply an implementation
+ * class containing the following method signatures:</i>
+ *
+ * <pre>
+ * public static JAXBContext createContext( String contextPath, ClassLoader classLoader, Map<String,Object> properties ) throws JAXBException
+ * public static JAXBContext createContext( Class[] classes, Map<String,Object> properties ) throws JAXBException
+ * </pre>
+ *
+ * <p><i>
+ * The following JAXB 1.0 requirement is only required for schema to
+ * java interface/implementation binding. It does not apply to JAXB annotated
+ * classes. JAXB Providers must generate a <tt>jaxb.properties</tt> file in
+ * each package containing schema derived classes. The property file must
+ * contain a property named <tt>javax.xml.bind.context.factory</tt> whose
+ * value is the name of the class that implements the <tt>createContext</tt>
+ * APIs.</i>
+ *
+ * <p><i>
+ * The class supplied by the provider does not have to be assignable to
+ * <tt>javax.xml.bind.JAXBContext</tt>, it simply has to provide a class that
+ * implements the <tt>createContext</tt> APIs.</i>
+ *
+ * <p><i>
+ * In addition, the provider must call the
+ * {@link DatatypeConverter#setDatatypeConverter(DatatypeConverterInterface)
+ * DatatypeConverter.setDatatypeConverter} api prior to any client
+ * invocations of the marshal and unmarshal methods. This is necessary to
+ * configure the datatype converter that will be used during these operations.</i>
+ * </blockquote>
+ *
+ * <p>
+ * <a name="Unmarshalling"></a>
+ * <b>Unmarshalling</b>
+ * <p>
+ * <blockquote>
+ * The {@link Unmarshaller} class provides the client application the ability
+ * to convert XML data into a tree of Java content objects.
+ * The unmarshal method allows for
+ * any global XML element declared in the schema to be unmarshalled as
+ * the root of an instance document.
+ * Additionally, the unmarshal method allows for an unrecognized root element that
+ * has an xsi:type attribute's value that references a type definition declared in
+ * the schema to be unmarshalled as the root of an instance document.
+ * The <tt>JAXBContext</tt> object
+ * allows the merging of global elements and type definitions across a set of schemas (listed
+ * in the <tt>contextPath</tt>). Since each schema in the schema set can belong
+ * to distinct namespaces, the unification of schemas to an unmarshalling
+ * context should be namespace independent. This means that a client
+ * application is able to unmarshal XML documents that are instances of
+ * any of the schemas listed in the <tt>contextPath</tt>. For example:
+ *
+ * <pre>
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo:com.acme.bar" );
+ * Unmarshaller u = jc.createUnmarshaller();
+ * FooObject fooObj = (FooObject)u.unmarshal( new File( "foo.xml" ) ); // ok
+ * BarObject barObj = (BarObject)u.unmarshal( new File( "bar.xml" ) ); // ok
+ * BazObject bazObj = (BazObject)u.unmarshal( new File( "baz.xml" ) ); // error, "com.acme.baz" not in contextPath
+ * </pre>
+ *
+ * <p>
+ * The client application may also generate Java content trees explicitly rather
+ * than unmarshalling existing XML data. For all JAXB-annotated value classes,
+ * an application can create content using constructors.
+ * For schema-derived interface/implementation classes and for the
+ * creation of elements that are not bound to a JAXB-annotated
+ * class, an application needs to have access and knowledge about each of
+ * the schema derived <tt> ObjectFactory</tt> classes that exist in each of
+ * java packages contained in the <tt>contextPath</tt>. For each schema
+ * derived java class, there is a static factory method that produces objects
+ * of that type. For example,
+ * assume that after compiling a schema, you have a package <tt>com.acme.foo</tt>
+ * that contains a schema derived interface named <tt>PurchaseOrder</tt>. In
+ * order to create objects of that type, the client application would use the
+ * factory method like this:
+ *
+ * <pre>
+ * com.acme.foo.PurchaseOrder po =
+ * com.acme.foo.ObjectFactory.createPurchaseOrder();
+ * </pre>
+ *
+ * <p>
+ * Once the client application has an instance of the the schema derived object,
+ * it can use the mutator methods to set content on it.
+ *
+ * <p>
+ * For more information on the generated <tt>ObjectFactory</tt> classes, see
+ * Section 4.2 <i>Java Package</i> of the specification.
+ *
+ * <p>
+ * <i><B>SPEC REQUIREMENT:</B> the provider must generate a class in each
+ * package that contains all of the necessary object factory methods for that
+ * package named ObjectFactory as well as the static
+ * <tt>newInstance( javaContentInterface )</tt> method</i>
+ * </blockquote>
+ *
+ * <p>
+ * <b>Marshalling</b>
+ * <p>
+ * <blockquote>
+ * The {@link Marshaller} class provides the client application the ability
+ * to convert a Java content tree back into XML data. There is no difference
+ * between marshalling a content tree that is created manually using the factory
+ * methods and marshalling a content tree that is the result an <tt>unmarshal
+ * </tt> operation. Clients can marshal a java content tree back to XML data
+ * to a <tt>java.io.OutputStream</tt> or a <tt>java.io.Writer</tt>. The
+ * marshalling process can alternatively produce SAX2 event streams to a
+ * registered <tt>ContentHandler</tt> or produce a DOM Node object.
+ * Client applications have control over the output encoding as well as
+ * whether or not to marshal the XML data as a complete document or
+ * as a fragment.
+ *
+ * <p>
+ * Here is a simple example that unmarshals an XML document and then marshals
+ * it back out:
+ *
+ * <pre>
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ *
+ * // unmarshal from foo.xml
+ * Unmarshaller u = jc.createUnmarshaller();
+ * FooObject fooObj = (FooObject)u.unmarshal( new File( "foo.xml" ) );
+ *
+ * // marshal to System.out
+ * Marshaller m = jc.createMarshaller();
+ * m.marshal( fooObj, System.out );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * <b>Validation</b>
+ * <p>
+ * <blockquote>
+ * Validation has been changed significantly since JAXB 1.0. The {@link Validator}
+ * class has been deprecated and made optional. This means that you are advised
+ * not to use this class and, in fact, it may not even be has depending on
+ * your JAXB provider. JAXB 1.0 client applications that rely on <tt>Validator</tt>
+ * will still work properly when deployed with the JAXB 1.0 runtime system.
+ *
+ * In JAXB 2.0, the {@link Unmarshaller} has included convenince methods that expose
+ * the JAXP 1.3 {@link javax.xml.validation} framework. Please refer to the
+ * {@link Unmarshaller#setSchema(javax.xml.validation.Schema)} API for more
+ * information.
+ * </blockquote>
+ *
+ * <p>
+ * <b>JAXB Runtime Binding Framework Compatibility</b><br>
+ * <blockquote>
+ * The following JAXB 1.0 restriction only applies to binding schema to
+ * interfaces/implementation classes.
+ * Since this binding does not require a common runtime system, a JAXB
+ * client application must not attempt to mix runtime objects (<tt>JAXBContext,
+ * Marshaller</tt>, etc. ) from different providers. This does not
+ * mean that the client application isn't portable, it simply means that a
+ * client has to use a runtime system provided by the same provider that was
+ * used to compile the schema.
+ * </blockquote>
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 4888 $ $Date: 2006/03/08 17:05:01 $
+ * @see Marshaller
+ * @see Unmarshaller
+ * @see <a href="http://java.sun.com/docs/books/jls">S 7.4.1.1 "Package Annotations" in Java Language Specification, 3rd Edition</a>
+ * @since JAXB1.0
+ */
+public abstract class JAXBContext {
+
+ /**
+ * The name of the property that contains the name of the class capable
+ * of creating new <tt>JAXBContext</tt> objects.
+ */
+ public static final String JAXB_CONTEXT_FACTORY =
+ "javax.xml.bind.context.factory";
+
+
+ protected JAXBContext() {
+ }
+
+
+ /**
+ * <p>
+ * Obtain a new instance of a <tt>JAXBContext</tt> class.
+ *
+ * <p>
+ * This is a convenience method for the
+ * {@link #newInstance(String,ClassLoader) newInstance} method. It uses
+ * the context class loader of the current thread. To specify the use of
+ * a different class loader, either set it via the
+ * <tt>Thread.setContextClassLoader()</tt> api or use the
+ * {@link #newInstance(String,ClassLoader) newInstance} method.
+ * @throws JAXBException if an error was encountered while creating the
+ * <tt>JAXBContext</tt> such as
+ * <ol>
+ * <li>failure to locate either ObjectFactory.class or jaxb.index in the packages</li>
+ * <li>an ambiguity among global elements contained in the contextPath</li>
+ * <li>failure to locate a value for the context factory provider property</li>
+ * <li>mixing schema derived packages from different providers on the same contextPath</li>
+ * </ol>
+ */
+ public static JAXBContext newInstance( String contextPath )
+ throws JAXBException {
+
+ //return newInstance( contextPath, JAXBContext.class.getClassLoader() );
+ return newInstance( contextPath, Thread.currentThread().getContextClassLoader() );
+ }
+
+ /**
+ * <p>
+ * Obtain a new instance of a <tt>JAXBContext</tt> class.
+ *
+ * <p>
+ * The client application must supply a context path which is a list of
+ * colon (':', \u005Cu003A) separated java package names that contain
+ * schema-derived classes and/or fully qualified JAXB-annotated classes.
+ * Schema-derived
+ * code is registered with the JAXBContext by the
+ * ObjectFactory.class generated per package.
+ * Alternatively than being listed in the context path, programmer
+ * annotated JAXB mapped classes can be listed in a
+ * <tt>jaxb.index</tt> resource file, format described below.
+ * Note that a java package can contain both schema-derived classes and
+ * user annotated JAXB classes. Additionally, the java package may
+ * contain JAXB package annotations that must be processed. (see JLS 3rd Edition,
+ * Section 7.4.1. "Package Annotations").
+ * </p>
+ *
+ * <p>
+ * Every package listed on the contextPath must meet <b>one or both</b> of the
+ * following conditions otherwise a <tt>JAXBException</tt> will be thrown:
+ * </p>
+ * <ol>
+ * <li>it must contain ObjectFactory.class</li>
+ * <li>it must contain jaxb.index</li>
+ * </ol>
+ *
+ * <p>
+ * <b>Format for jaxb.index</b>
+ * <p>
+ * The file contains a newline-separated list of class names.
+ * Space and tab characters, as well as blank
+ * lines, are ignored. The comment character
+ * is '#' (0x23); on each line all characters following the first comment
+ * character are ignored. The file must be encoded in UTF-8. Classes that
+ * are reachable, as defined in {@link #newInstance(Class...)}, from the
+ * listed classes are also registered with JAXBContext.
+ * <p>
+ * Constraints on class name occuring in a <tt>jaxb.index</tt> file are:
+ * <ul>
+ * <li>Must not end with ".class".</li>
+ * <li>Class names are resolved relative to package containing
+ * <tt>jaxb.index</tt> file. Only classes occuring directly in package
+ * containing <tt>jaxb.index</tt> file are allowed.</li>
+ * <li>Fully qualified class names are not allowed.
+ * A qualified class name,relative to current package,
+ * is only allowed to specify a nested or inner class.</li>
+ * </ul>
+ *
+ * <p>
+ * To maintain compatibility with JAXB 1.0 schema to java
+ * interface/implementation binding, enabled by schema customization
+ * <tt><jaxb:globalBindings valueClass="false"></tt>,
+ * the JAXB provider will ensure that each package on the context path
+ * has a <tt>jaxb.properties</tt> file which contains a value for the
+ * <tt>javax.xml.bind.context.factory</tt> property and that all values
+ * resolve to the same provider. This requirement does not apply to
+ * JAXB annotated classes.
+ *
+ * <p>
+ * If there are any global XML element name collisions across the various
+ * packages listed on the <tt>contextPath</tt>, a <tt>JAXBException</tt>
+ * will be thrown.
+ *
+ * <p>
+ * Mixing generated interface/impl bindings from multiple JAXB Providers
+ * in the same context path may result in a <tt>JAXBException</tt>
+ * being thrown.
+ *
+ * @param contextPath list of java package names that contain schema
+ * derived class and/or java to schema (JAXB-annotated)
+ * mapped classes
+ * @param classLoader
+ * This class loader will be used to locate the implementation
+ * classes.
+ *
+ * @return a new instance of a <tt>JAXBContext</tt>
+ * @throws JAXBException if an error was encountered while creating the
+ * <tt>JAXBContext</tt> such as
+ * <ol>
+ * <li>failure to locate either ObjectFactory.class or jaxb.index in the packages</li>
+ * <li>an ambiguity among global elements contained in the contextPath</li>
+ * <li>failure to locate a value for the context factory provider property</li>
+ * <li>mixing schema derived packages from different providers on the same contextPath</li>
+ * </ol>
+ */
+ public static JAXBContext newInstance( String contextPath, ClassLoader classLoader ) throws JAXBException {
+
+ return newInstance(contextPath,classLoader,Collections.<String,Object>emptyMap());
+ }
+
+ /**
+ * <p>
+ * Obtain a new instance of a <tt>JAXBContext</tt> class.
+ *
+ * <p>
+ * This is mostly the same as {@link JAXBContext#newInstance(String, ClassLoader)},
+ * but this version allows you to pass in provider-specific properties to configure
+ * the instanciation of {@link JAXBContext}.
+ *
+ * <p>
+ * The interpretation of properties is up to implementations.
+ *
+ * @param contextPath list of java package names that contain schema derived classes
+ * @param classLoader
+ * This class loader will be used to locate the implementation classes.
+ * @param properties
+ * provider-specific properties
+ *
+ * @return a new instance of a <tt>JAXBContext</tt>
+ * @throws JAXBException if an error was encountered while creating the
+ * <tt>JAXBContext</tt> such as
+ * <ol>
+ * <li>failure to locate either ObjectFactory.class or jaxb.index in the packages</li>
+ * <li>an ambiguity among global elements contained in the contextPath</li>
+ * <li>failure to locate a value for the context factory provider property</li>
+ * <li>mixing schema derived packages from different providers on the same contextPath</li>
+ * </ol>
+ * @since JAXB2.0
+ */
+ public static JAXBContext newInstance( String contextPath, ClassLoader classLoader, Map<String,?> properties )
+ throws JAXBException {
+
+ return ContextFinder.find(
+ /* The default property name according to the JAXB spec */
+ JAXB_CONTEXT_FACTORY,
+
+ /* the context path supplied by the client app */
+ contextPath,
+
+ /* class loader to be used */
+ classLoader,
+ properties );
+ }
+
+// TODO: resurrect this once we introduce external annotations
+// /**
+// * <p>
+// * Obtain a new instance of a <tt>JAXBContext</tt> class.
+// *
+// * <p>
+// * The client application must supply a list of classes that the new
+// * context object needs to recognize.
+// *
+// * Not only the new context will recognize all the classes specified,
+// * but it will also recognize any classes that are directly/indirectly
+// * referenced statically from the specified classes.
+// *
+// * For example, in the following Java code, if you do
+// * <tt>newInstance(Foo.class)</tt>, the newly created {@link JAXBContext}
+// * will recognize both <tt>Foo</tt> and <tt>Bar</tt>, but not <tt>Zot</tt>:
+// * <pre><xmp>
+// * class Foo {
+// * Bar b;
+// * }
+// * class Bar { int x; }
+// * class Zot extends Bar { int y; }
+// * </xmp></pre>
+// *
+// * Therefore, a typical client application only needs to specify the
+// * top-level classes, but it needs to be careful.
+// *
+// * TODO: if we are to define other mechanisms, refer to them.
+// *
+// * @param externalBindings
+// * list of external binding files. Can be null or empty if none is used.
+// * when specified, those files determine how the classes are bound.
+// *
+// * @param classesToBeBound
+// * list of java classes to be recognized by the new {@link JAXBContext}.
+// * Can be empty, in which case a {@link JAXBContext} that only knows about
+// * spec-defined classes will be returned.
+// *
+// * @return
+// * A new instance of a <tt>JAXBContext</tt>. Always non-null valid object.
+// *
+// * @throws JAXBException
+// * if an error was encountered while creating the
+// * <tt>JAXBContext</tt>, such as (but not limited to):
+// * <ol>
+// * <li>No JAXB implementation was discovered
+// * <li>Classes use JAXB annotations incorrectly
+// * <li>Classes have colliding annotations (i.e., two classes with the same type name)
+// * <li>Specified external bindings are incorrect
+// * <li>The JAXB implementation was unable to locate
+// * provider-specific out-of-band information (such as additional
+// * files generated at the development time.)
+// * </ol>
+// *
+// * @throws IllegalArgumentException
+// * if the parameter contains {@code null} (i.e., {@code newInstance(null);})
+// *
+// * @since JAXB2.0
+// */
+// public static JAXBContext newInstance( Source[] externalBindings, Class... classesToBeBound )
+// throws JAXBException {
+//
+// // empty class list is not an error, because the context will still include
+// // spec-specified classes like String and Integer.
+// // if(classesToBeBound.length==0)
+// // throw new IllegalArgumentException();
+//
+// // but it is an error to have nulls in it.
+// for( int i=classesToBeBound.length-1; i>=0; i-- )
+// if(classesToBeBound[i]==null)
+// throw new IllegalArgumentException();
+//
+// return ContextFinder.find(externalBindings,classesToBeBound);
+// }
+
+ /**
+ * <p>
+ * Obtain a new instance of a <tt>JAXBContext</tt> class.
+ *
+ * <p>
+ * The client application must supply a list of classes that the new
+ * context object needs to recognize.
+ *
+ * Not only the new context will recognize all the classes specified,
+ * but it will also recognize any classes that are directly/indirectly
+ * referenced statically from the specified classes. Subclasses of
+ * referenced classes nor <tt>@XmlTransient</tt> referenced classes
+ * are not registered with JAXBContext.
+ *
+ * For example, in the following Java code, if you do
+ * <tt>newInstance(Foo.class)</tt>, the newly created {@link JAXBContext}
+ * will recognize both <tt>Foo</tt> and <tt>Bar</tt>, but not <tt>Zot</tt> or <tt>FooBar</tt>:
+ * <pre>
+ * class Foo {
+ * @XmlTransient FooBar c;
+ * Bar b;
+ * }
+ * class Bar { int x; }
+ * class Zot extends Bar { int y; }
+ * class FooBar { }
+ * </pre>
+ *
+ * Therefore, a typical client application only needs to specify the
+ * top-level classes, but it needs to be careful.
+ *
+ * <p>
+ * Note that for each java package registered with JAXBContext,
+ * when the optional package annotations exist, they must be processed.
+ * (see JLS 3rd Edition, Section 7.4.1. "Package Annotations").
+ *
+ * @param classesToBeBound
+ * list of java classes to be recognized by the new {@link JAXBContext}.
+ * Can be empty, in which case a {@link JAXBContext} that only knows about
+ * spec-defined classes will be returned.
+ *
+ * @return
+ * A new instance of a <tt>JAXBContext</tt>. Always non-null valid object.
+ *
+ * @throws JAXBException
+ * if an error was encountered while creating the
+ * <tt>JAXBContext</tt>, such as (but not limited to):
+ * <ol>
+ * <li>No JAXB implementation was discovered
+ * <li>Classes use JAXB annotations incorrectly
+ * <li>Classes have colliding annotations (i.e., two classes with the same type name)
+ * <li>The JAXB implementation was unable to locate
+ * provider-specific out-of-band information (such as additional
+ * files generated at the development time.)
+ * </ol>
+ *
+ * @throws IllegalArgumentException
+ * if the parameter contains {@code null} (i.e., {@code newInstance(null);})
+ *
+ * @since JAXB2.0
+ */
+ public static JAXBContext newInstance( Class... classesToBeBound )
+ throws JAXBException {
+
+ return newInstance(classesToBeBound,Collections.<String,Object>emptyMap());
+ }
+
+ /**
+ * <p>
+ * Obtain a new instance of a <tt>JAXBContext</tt> class.
+ *
+ * <p>
+ * An overloading of {@link JAXBContext#newInstance(Class...)}
+ * to configure 'properties' for this instantiation of {@link JAXBContext}.
+ *
+ * <p>
+ * The interpretation of properties is implementation specific.
+ *
+ * @param classesToBeBound
+ * list of java classes to be recognized by the new {@link JAXBContext}.
+ * Can be empty, in which case a {@link JAXBContext} that only knows about
+ * spec-defined classes will be returned.
+ *
+ * @return
+ * A new instance of a <tt>JAXBContext</tt>. Always non-null valid object.
+ *
+ * @throws JAXBException
+ * if an error was encountered while creating the
+ * <tt>JAXBContext</tt>, such as (but not limited to):
+ * <ol>
+ * <li>No JAXB implementation was discovered
+ * <li>Classes use JAXB annotations incorrectly
+ * <li>Classes have colliding annotations (i.e., two classes with the same type name)
+ * <li>The JAXB implementation was unable to locate
+ * provider-specific out-of-band information (such as additional
+ * files generated at the development time.)
+ * </ol>
+ *
+ * @throws IllegalArgumentException
+ * if the parameter contains {@code null} (i.e., {@code newInstance(null);})
+ *
+ * @since JAXB2.0
+ */
+ public static JAXBContext newInstance( Class[] classesToBeBound, Map<String,?> properties )
+ throws JAXBException {
+
+ // empty class list is not an error, because the context will still include
+ // spec-specified classes like String and Integer.
+ // if(classesToBeBound.length==0)
+ // throw new IllegalArgumentException();
+
+ // but it is an error to have nulls in it.
+ for( int i=classesToBeBound.length-1; i>=0; i-- )
+ if(classesToBeBound[i]==null)
+ throw new IllegalArgumentException();
+
+ return ContextFinder.find(classesToBeBound,properties);
+ }
+
+ /**
+ * Create an <tt>Unmarshaller</tt> object that can be used to convert XML
+ * data into a java content tree.
+ *
+ * @return an <tt>Unmarshaller</tt> object
+ *
+ * @throws JAXBException if an error was encountered while creating the
+ * <tt>Unmarshaller</tt> object
+ */
+ public abstract Unmarshaller createUnmarshaller() throws JAXBException;
+
+
+ /**
+ * Create a <tt>Marshaller</tt> object that can be used to convert a
+ * java content tree into XML data.
+ *
+ * @return a <tt>Marshaller</tt> object
+ *
+ * @throws JAXBException if an error was encountered while creating the
+ * <tt>Marshaller</tt> object
+ */
+ public abstract Marshaller createMarshaller() throws JAXBException;
+
+
+ /**
+ * {@link Validator} has been made optional and deprecated in JAXB 2.0. Please
+ * refer to the javadoc for {@link Validator} for more detail.
+ * <p>
+ * Create a <tt>Validator</tt> object that can be used to validate a
+ * java content tree against its source schema.
+ *
+ * @return a <tt>Validator</tt> object
+ *
+ * @throws JAXBException if an error was encountered while creating the
+ * <tt>Validator</tt> object
+ * @deprecated since JAXB2.0
+ */
+ public abstract Validator createValidator() throws JAXBException;
+
+ /**
+ * Creates a <tt>Binder</tt> object that can be used for
+ * associative/in-place unmarshalling/marshalling.
+ *
+ * @param domType select the DOM API to use by passing in its DOM Node class.
+ *
+ * @return always a new valid <tt>Binder</tt> object.
+ *
+ * @throws UnsupportedOperationException
+ * if DOM API corresponding to <tt>domType</tt> is not supported by
+ * the implementation.
+ *
+ * @since JAXB2.0
+ */
+ public <T> Binder<T> createBinder(Class<T> domType) {
+ // to make JAXB 1.0 implementations work, this method must not be
+ // abstract
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Creates a <tt>Binder</tt> for W3C DOM.
+ *
+ * @return always a new valid <tt>Binder</tt> object.
+ *
+ * @since JAXB2.0
+ */
+ public Binder<Node> createBinder() {
+ return createBinder(Node.class);
+ }
+
+ /**
+ * Creates a <tt>JAXBIntrospector</tt> object that can be used to
+ * introspect JAXB objects.
+ *
+ * @return
+ * always return a non-null valid <tt>JAXBIntrospector</tt> object.
+ *
+ * @throws UnsupportedOperationException
+ * Calling this method on JAXB 1.0 implementations will throw
+ * an UnsupportedOperationException.
+ *
+ * @since JAXB2.0
+ */
+ public JAXBIntrospector createJAXBIntrospector() {
+ // to make JAXB 1.0 implementations work, this method must not be
+ // abstract
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Generates the schema documents for this context.
+ *
+ * @param outputResolver
+ * this object controls the output to which schemas
+ * will be sent.
+ *
+ * @throws IOException
+ * if {@link SchemaOutputResolver} throws an {@link IOException}.
+ *
+ * @throws UnsupportedOperationException
+ * Calling this method on JAXB 1.0 implementations will throw
+ * an UnsupportedOperationException.
+ *
+ * @since JAXB 2.0
+ */
+ public void generateSchema(SchemaOutputResolver outputResolver) throws IOException {
+ // to make JAXB 1.0 implementations work, this method must not be
+ // abstract
+ throw new UnsupportedOperationException();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/JAXBElement.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/JAXBElement.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/JAXBElement.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,198 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+import javax.xml.namespace.QName;
+import java.io.Serializable;
+
+/**
+ * <p>JAXB representation of an Xml Element.</p>
+ *
+ * <p>This class represents information about an Xml Element from both the element
+ * declaration within a schema and the element instance value within an xml document
+ * with the following properties
+ * <ul>
+ * <li>element's xml tag <b><tt>name</tt></b></li>
+ * <li><b><tt>value</tt></b> represents the element instance's atttribute(s) and content model</li>
+ * <li>element declaration's <b><tt>declaredType</tt></b> (<tt>xs:element @type</tt> attribute)</li>
+ * <li><b><tt>scope</tt></b> of element declaration</li>
+ * <li>boolean <b><tt>nil</tt></b> property. (element instance's <tt><b>xsi:nil</b></tt> attribute)</li>
+ * </ul>
+ *
+ * <p>The <tt>declaredType</tt> and <tt>scope</tt> property are the
+ * JAXB class binding for the xml type definition.
+ * </p>
+ *
+ * <p><b><tt>Scope</tt></b> is either {@link GlobalScope} or the Java class representing the
+ * complex type definition containing the schema element declaration.
+ * </p>
+ *
+ * <p>There is a property constraint that if <b><tt>value</tt></b> is <tt>null</tt>,
+ * then <tt>nil</tt> must be <tt>true</tt>. The converse is not true to enable
+ * representing a nil element with attribute(s). If <tt>nil</tt> is true, it is possible
+ * that <tt>value</tt> is non-null so it can hold the value of the attributes
+ * associated with a nil element.
+ * </p>
+ *
+ * @author Kohsuke Kawaguchi, Joe Fialli
+ * @since JAXB 2.0
+ */
+
+public class JAXBElement<T> implements Serializable {
+
+ /** xml element tag name */
+ final protected QName name;
+
+ /** Java datatype binding for xml element declaration's type. */
+ final protected Class<T> declaredType;
+
+ /** Scope of xml element declaration representing this xml element instance.
+ * Can be one of the following values:
+ * - {@link GlobalScope} for global xml element declaration.
+ * - local element declaration has a scope set to the Java class
+ * representation of complex type defintion containing
+ * xml element declaration.
+ */
+ final protected Class scope;
+
+ /** xml element value.
+ Represents content model and attributes of an xml element instance. */
+ protected T value;
+
+ /** true iff the xml element instance has xsi:nil="true". */
+ protected boolean nil = false;
+
+ /**
+ * Designates global scope for an xml element.
+ */
+ public static final class GlobalScope {}
+
+ /**
+ * <p>Construct an xml element instance.</p>
+ *
+ * @param name Java binding of xml element tag name
+ * @param declaredType Java binding of xml element declaration's type
+ * @param scope
+ * Java binding of scope of xml element declaration.
+ * Passing null is the same as passing <tt>GlobalScope.class</tt>
+ * @param value
+ * Java instance representing xml element's value.
+ * @see #getScope()
+ * @see #isTypeSubstituted()
+ */
+ public JAXBElement(QName name,
+ Class<T> declaredType,
+ Class scope,
+ T value) {
+ if(declaredType==null || name==null)
+ throw new IllegalArgumentException();
+ this.declaredType = declaredType;
+ if(scope==null) scope = GlobalScope.class;
+ this.scope = scope;
+ this.name = name;
+ setValue(value);
+ }
+
+ /**
+ * Construct an xml element instance.
+ *
+ * This is just a convenience method for <tt>new JAXBElement(name,declaredType,GlobalScope.class,value)</tt>
+ */
+ public JAXBElement(QName name, Class<T> declaredType, T value ) {
+ this(name,declaredType,GlobalScope.class,value);
+ }
+
+ /**
+ * Returns the Java binding of the xml element declaration's type attribute.
+ */
+ public Class<T> getDeclaredType() {
+ return declaredType;
+ }
+
+ /**
+ * Returns the xml element tag name.
+ */
+ public QName getName() {
+ return name;
+ }
+
+ /**
+ * <p>Set the content model and attributes of this xml element.</p>
+ *
+ * <p>When this property is set to <tt>null</tt>, <tt>isNil()</tt> must by <tt>true</tt>.
+ * Details of constraint are described at {@link #isNil()}.</pp>
+ *
+ * @see #isTypeSubstituted()
+ */
+ public void setValue(T t) {
+ this.value = t;
+ }
+
+ /**
+ * <p>Return the content model and attribute values for this element.</p>
+ *
+ * <p>See {@link #isNil()} for a description of a property constraint when
+ * this value is <tt>null</tt></p>
+ */
+ public T getValue() {
+ return value;
+ }
+
+ /**
+ * Returns scope of xml element declaration.
+ *
+ * @see #isGlobalScope()
+ * @return <tt>GlobalScope.class</tt> if this element is of global scope.
+ */
+ public Class getScope() {
+ return scope;
+ }
+
+ /**
+ * <p>Returns <tt>true</tt> iff this element instance content model
+ * is nil.</p>
+ *
+ * <p>This property always returns <tt>true</tt> when {@link #getValue()} is null.
+ * Note that the converse is not true, when this property is <tt>true</tt>,
+ * {@link #getValue()} can contain a non-null value for attribute(s). It is
+ * valid for a nil xml element to have attribute(s).</p>
+ */
+ public boolean isNil() {
+ return (value == null) || nil;
+ }
+
+ /**
+ * <p>Set whether this element has nil content.</p>
+ *
+ * @see #isNil()
+ */
+ public void setNil(boolean value) {
+ this.nil = value;
+ }
+
+ /* Convenience methods
+ * (Not necessary but they do unambiguously conceptualize
+ * the rationale behind this class' fields.)
+ */
+
+ /**
+ * Returns true iff this xml element declaration is global.
+ */
+ public boolean isGlobalScope() {
+ return this.scope == GlobalScope.class;
+ }
+
+ /**
+ * Returns true iff this xml element instance's value has a different
+ * type than xml element declaration's declared type.
+ */
+ public boolean isTypeSubstituted() {
+ if(value==null) return false;
+ return value.getClass() != declaredType;
+ }
+
+ private static final long serialVersionUID = 1L;
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/JAXBException.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/JAXBException.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/JAXBException.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,165 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+import java.io.PrintWriter;
+
+/**
+ * This is the root exception class for all JAXB exceptions.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $ $Date: 2004/12/14 21:50:39 $
+ * @see JAXBContext
+ * @see Marshaller
+ * @see Unmarshaller
+ * @since JAXB1.0
+ */
+public class JAXBException extends Exception {
+
+ /**
+ * Vendor specific error code
+ *
+ */
+ private String errorCode;
+
+ /**
+ * Exception reference
+ *
+ */
+ private Throwable linkedException;
+
+ static final long serialVersionUID = -5621384651494307979L;
+
+ /**
+ * Construct a JAXBException with the specified detail message. The
+ * errorCode and linkedException will default to null.
+ *
+ * @param message a description of the exception
+ */
+ public JAXBException(String message) {
+ this( message, null, null );
+ }
+
+ /**
+ * Construct a JAXBException with the specified detail message and vendor
+ * specific errorCode. The linkedException will default to null.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ */
+ public JAXBException(String message, String errorCode) {
+ this( message, errorCode, null );
+ }
+
+ /**
+ * Construct a JAXBException with a linkedException. The detail message and
+ * vendor specific errorCode will default to null.
+ *
+ * @param exception the linked exception
+ */
+ public JAXBException(Throwable exception) {
+ this( null, null, exception );
+ }
+
+ /**
+ * Construct a JAXBException with the specified detail message and
+ * linkedException. The errorCode will default to null.
+ *
+ * @param message a description of the exception
+ * @param exception the linked exception
+ */
+ public JAXBException(String message, Throwable exception) {
+ this( message, null, exception );
+ }
+
+ /**
+ * Construct a JAXBException with the specified detail message, vendor
+ * specific errorCode, and linkedException.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ * @param exception the linked exception
+ */
+ public JAXBException(String message, String errorCode, Throwable exception) {
+ super( message );
+ this.errorCode = errorCode;
+ this.linkedException = exception;
+ }
+
+ /**
+ * Get the vendor specific error code
+ *
+ * @return a string specifying the vendor specific error code
+ */
+ public String getErrorCode() {
+ return this.errorCode;
+ }
+
+ /**
+ * Get the linked exception
+ *
+ * @return the linked Exception, null if none exists
+ */
+ public Throwable getLinkedException() {
+ return linkedException;
+ }
+
+ /**
+ * Add a linked Exception.
+ *
+ * @param exception the linked Exception (A null value is permitted and
+ * indicates that the linked exception does not exist or
+ * is unknown).
+ */
+ public synchronized void setLinkedException( Throwable exception ) {
+ this.linkedException = exception;
+ }
+
+ /**
+ * Returns a short description of this JAXBException.
+ *
+ */
+ public String toString() {
+ return linkedException == null ?
+ super.toString() :
+ super.toString() + "\n - with linked exception:\n[" +
+ linkedException.toString()+ "]";
+ }
+
+ /**
+ * Prints this JAXBException and its stack trace (including the stack trace
+ * of the linkedException if it is non-null) to the PrintStream.
+ *
+ * @param s PrintStream to use for output
+ */
+ public void printStackTrace( java.io.PrintStream s ) {
+ super.printStackTrace(s);
+ }
+
+ /**
+ * Prints this JAXBException and its stack trace (including the stack trace
+ * of the linkedException if it is non-null) to <tt>System.err</tt>.
+ *
+ */
+ public void printStackTrace() {
+ super.printStackTrace();
+ }
+
+ /**
+ * Prints this JAXBException and its stack trace (including the stack trace
+ * of the linkedException if it is non-null) to the PrintWriter.
+ *
+ * @param s PrintWriter to use for output
+ */
+ public void printStackTrace(PrintWriter s) {
+ super.printStackTrace(s);
+ }
+
+ @Override
+ public Throwable getCause() {
+ return linkedException;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/JAXBIntrospector.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/JAXBIntrospector.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/JAXBIntrospector.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+import javax.xml.namespace.QName;
+
+/**
+ * Provide access to JAXB xml binding data for a JAXB object.
+ *
+ * <p>
+ * Intially, the intent of this class is to just conceptualize how
+ * a JAXB application developer can access xml binding information,
+ * independent if binding model is java to schema or schema to java.
+ * Since accessing the XML element name related to a JAXB element is
+ * a highly requested feature, demonstrate access to this
+ * binding information.
+ *
+ * The factory method to get a <code>JAXBIntrospector</code> instance is
+ * {@link JAXBContext#createJAXBIntrospector()}.
+ *
+ * @see JAXBContext#createJAXBIntrospector()
+ * @since JAXB2.0
+ */
+public abstract class JAXBIntrospector {
+
+ /**
+ * <p>Return true iff <code>object</code> represents a JAXB element.</p>
+ * <p>Parameter <code>object</code> is a JAXB element for following cases:
+ * <ol>
+ * <li>It is an instance of <code>javax.xml.bind.JAXBElement</code>.</li>
+ * <li>The class of <code>object</code> is annotated with
+ * <code>@XmlRootElement</code>.
+ * </li>
+ * </ol>
+ *
+ * @see #getElementName(Object)
+ */
+ public abstract boolean isElement(Object object);
+
+ /**
+ * <p>Get xml element qname for <code>jaxbElement</code>.</p>
+ *
+ * @param jaxbElement is an object that {@link #isElement(Object)} returned true.
+ *
+ * @return xml element qname associated with jaxbElement;
+ * null if <code>jaxbElement</code> is not a JAXB Element.
+ */
+ public abstract QName getElementName(Object jaxbElement);
+
+ /**
+ * <p>Get the element value of a JAXB element.</p>
+ *
+ * <p>Convenience method to abstract whether working with either
+ * a javax.xml.bind.JAXBElement instance or an instance of
+ * <tt>@XmlRootElement</tt> annotated Java class.</p>
+ *
+ * @param jaxbElement object that #isElement(Object) returns true.
+ *
+ * @return The element value of the <code>jaxbElement</code>.
+ */
+ public static Object getValue(Object jaxbElement) {
+ if (jaxbElement instanceof JAXBElement) {
+ return ((JAXBElement)jaxbElement).getValue();
+ } else {
+ // assume that class of this instance is
+ // annotated with @XmlRootElement.
+ return jaxbElement;
+ }
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/MarshalException.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/MarshalException.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/MarshalException.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * This exception indicates that an error has occurred while performing
+ * a marshal operation that the provider is unable to recover from.
+ *
+ * <p>
+ * The <tt>ValidationEventHandler</tt> can cause this exception to be thrown
+ * during the marshal operations. See
+ * {@link ValidationEventHandler#handleEvent(ValidationEvent)
+ * ValidationEventHandler.handleEvent(ValidationEvent)}.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $
+ * @see JAXBException
+ * @see Marshaller
+ * @since JAXB1.0
+ */
+public class MarshalException extends JAXBException {
+
+ /**
+ * Construct a MarshalException with the specified detail message. The
+ * errorCode and linkedException will default to null.
+ *
+ * @param message a description of the exception
+ */
+ public MarshalException( String message ) {
+ this( message, null, null );
+ }
+
+ /**
+ * Construct a MarshalException with the specified detail message and vendor
+ * specific errorCode. The linkedException will default to null.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ */
+ public MarshalException( String message, String errorCode ) {
+ this( message, errorCode, null );
+ }
+
+ /**
+ * Construct a MarshalException with a linkedException. The detail message and
+ * vendor specific errorCode will default to null.
+ *
+ * @param exception the linked exception
+ */
+ public MarshalException( Throwable exception ) {
+ this( null, null, exception );
+ }
+
+ /**
+ * Construct a MarshalException with the specified detail message and
+ * linkedException. The errorCode will default to null.
+ *
+ * @param message a description of the exception
+ * @param exception the linked exception
+ */
+ public MarshalException( String message, Throwable exception ) {
+ this( message, null, exception );
+ }
+
+ /**
+ * Construct a MarshalException with the specified detail message, vendor
+ * specific errorCode, and linkedException.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ * @param exception the linked exception
+ */
+ public MarshalException( String message, String errorCode, Throwable exception ) {
+ super( message, errorCode, exception );
+ }
+
+}
+
+
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Marshaller.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Marshaller.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Marshaller.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,784 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+import javax.xml.bind.attachment.AttachmentMarshaller;
+import javax.xml.validation.Schema;
+
+/**
+ * <p>
+ * The <tt>Marshaller</tt> class is responsible for governing the process
+ * of serializing Java content trees back into XML data. It provides the basic
+ * marshalling methods:
+ *
+ * <p>
+ * <i>Assume the following setup code for all following code fragments:</i>
+ * <blockquote>
+ * <pre>
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ * Unmarshaller u = jc.createUnmarshaller();
+ * Object element = u.unmarshal( new File( "foo.xml" ) );
+ * Marshaller m = jc.createMarshaller();
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a File:
+ * <blockquote>
+ * <pre>
+ * OutputStream os = new FileOutputStream( "nosferatu.xml" );
+ * m.marshal( element, os );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a SAX ContentHandler:
+ * <blockquote>
+ * <pre>
+ * // assume MyContentHandler instanceof ContentHandler
+ * m.marshal( element, new MyContentHandler() );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a DOM Node:
+ * <blockquote>
+ * <pre>
+ * DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ * dbf.setNamespaceAware(true);
+ * DocumentBuilder db = dbf.newDocumentBuilder();
+ * Document doc = db.newDocument();
+ *
+ * m.marshal( element, doc );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a java.io.OutputStream:
+ * <blockquote>
+ * <pre>
+ * m.marshal( element, System.out );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a java.io.Writer:
+ * <blockquote>
+ * <pre>
+ * m.marshal( element, new PrintWriter( System.out ) );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a javax.xml.transform.SAXResult:
+ * <blockquote>
+ * <pre>
+ * // assume MyContentHandler instanceof ContentHandler
+ * SAXResult result = new SAXResult( new MyContentHandler() );
+ *
+ * m.marshal( element, result );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a javax.xml.transform.DOMResult:
+ * <blockquote>
+ * <pre>
+ * DOMResult result = new DOMResult();
+ *
+ * m.marshal( element, result );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a javax.xml.transform.StreamResult:
+ * <blockquote>
+ * <pre>
+ * StreamResult result = new StreamResult( System.out );
+ *
+ * m.marshal( element, result );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a javax.xml.stream.XMLStreamWriter:
+ * <blockquote>
+ * <pre>
+ * XMLStreamWriter xmlStreamWriter =
+ * XMLOutputFactory.newInstance().createXMLStreamWriter( ... );
+ *
+ * m.marshal( element, xmlStreamWriter );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a javax.xml.stream.XMLEventWriter:
+ * <blockquote>
+ * <pre>
+ * XMLEventWriter xmlEventWriter =
+ * XMLOutputFactory.newInstance().createXMLEventWriter( ... );
+ *
+ * m.marshal( element, xmlEventWriter );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * <a name="elementMarshalling"></a>
+ * <b>Marshalling content tree rooted by a JAXB element</b><br>
+ * <blockquote>
+ * The first parameter of the overloaded
+ * <tt>Marshaller.marshal(java.lang.Object, ...)</tt> methods must be a
+ * JAXB element as computed by
+ * {@link JAXBIntrospector#isElement(java.lang.Object)};
+ * otherwise, a <tt>Marshaller.marshal</tt> method must throw a
+ * {@link MarshalException}. There exist two mechanisms
+ * to enable marshalling an instance that is not a JAXB element.
+ * One method is to wrap the instance as a value of a {@link JAXBElement},
+ * and pass the wrapper element as the first parameter to
+ * a <tt>Marshaller.marshal</tt> method. For java to schema binding, it
+ * is also possible to simply annotate the instance's class with
+ * @{@link XmlRootElement}.
+ * </blockquote>
+ *
+ * <p>
+ * <b>Encoding</b><br>
+ * <blockquote>
+ * By default, the Marshaller will use UTF-8 encoding when generating XML data
+ * to a <tt>java.io.OutputStream</tt>, or a <tt>java.io.Writer</tt>. Use the
+ * {@link #setProperty(String,Object) setProperty} API to change the output
+ * encoding used during these marshal operations. Client applications are
+ * expected to supply a valid character encoding name as defined in the
+ * <a href="http://www.w3.org/TR/2000/REC-xml-20001006#charencoding">W3C XML 1.0
+ * Recommendation</a> and supported by your
+ * <a href="http://java.sun.com/j2se/1.3/docs/api/java/lang/package-summary.html#charenc">
+ * Java Platform</a>.
+ * </blockquote>
+ *
+ * <p>
+ * <b>Validation and Well-Formedness</b><br>
+ * <blockquote>
+ * <p>
+ * Client applications are not required to validate the Java content tree prior
+ * to calling any of the marshal API's. Furthermore, there is no requirement
+ * that the Java content tree be valid with respect to its original schema in
+ * order to marshal it back into XML data. Different JAXB Providers will
+ * support marshalling invalid Java content trees at varying levels, however
+ * all JAXB Providers must be able to marshal a valid content tree back to
+ * XML data. A JAXB Provider must throw a <tt>MarshalException</tt> when it
+ * is unable to complete the marshal operation due to invalid content. Some
+ * JAXB Providers will fully allow marshalling invalid content, others will fail
+ * on the first validation error.
+ * <p>
+ * Even when schema validation is not explictly enabled for the marshal operation,
+ * it is possible that certain types of validation events will be detected
+ * during the operation. Validation events will be reported to the registered
+ * event handler. If the client application has not registered an event handler
+ * prior to invoking one of the marshal API's, then events will be delivered to
+ * a default event handler which will terminate the marshal operation after
+ * encountering the first error or fatal error. Note that for JAXB 2.0 and
+ * later versions, {@link javax.xml.bind.helpers.DefaultValidationEventHandler} is
+ * no longer used.
+ *
+ * </blockquote>
+ *
+ * <p>
+ * <a name="supportedProps"></a>
+ * <b>Supported Properties</b><br>
+ * <blockquote>
+ * <p>
+ * All JAXB Providers are required to support the following set of properties.
+ * Some providers may support additional properties.
+ * <dl>
+ * <dt><tt>jaxb.encoding</tt> - value must be a java.lang.String</dd>
+ * <dd>The output encoding to use when marshalling the XML data. The
+ * Marshaller will use "UTF-8" by default if this property is not
+ * specified.</dd>
+ * <dt><tt>jaxb.formatted.output</tt> - value must be a java.lang.Boolean</dd>
+ * <dd>This property controls whether or not the Marshaller will format
+ * the resulting XML data with line breaks and indentation. A
+ * true value for this property indicates human readable indented
+ * xml data, while a false value indicates unformatted xml data.
+ * The Marshaller will default to false (unformatted) if this
+ * property is not specified.</dd>
+ * <dt><tt>jaxb.schemaLocation</tt> - value must be a java.lang.String</dd>
+ * <dd>This property allows the client application to specify an
+ * xsi:schemaLocation attribute in the generated XML data. The format of
+ * the schemaLocation attribute value is discussed in an easy to
+ * understand, non-normative form in
+ * <a href="http://www.w3.org/TR/xmlschema-0/#schemaLocation">Section 5.6
+ * of the W3C XML Schema Part 0: Primer</a> and specified in
+ * <a href="http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions">
+ * Section 2.6 of the W3C XML Schema Part 1: Structures</a>.</dd>
+ * <dt><tt>jaxb.noNamespaceSchemaLocation</tt> - value must be a java.lang.String</dd>
+ * <dd>This property allows the client application to specify an
+ * xsi:noNamespaceSchemaLocation attribute in the generated XML
+ * data. The format of the schemaLocation attribute value is discussed in
+ * an easy to understand, non-normative form in
+ * <a href="http://www.w3.org/TR/xmlschema-0/#schemaLocation">Section 5.6
+ * of the W3C XML Schema Part 0: Primer</a> and specified in
+ * <a href="http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions">
+ * Section 2.6 of the W3C XML Schema Part 1: Structures</a>.</dd>
+ * <dt><tt>jaxb.fragment</tt> - value must be a java.lang.Boolean</dd>
+ * <dd>This property determines whether or not document level events will be
+ * generated by the Marshaller. If the property is not specified, the
+ * default is <tt>false</tt>. This property has different implications depending
+ * on which marshal api you are using - when this property is set to true:<br>
+ * <ul>
+ * <li>{@link #marshal(Object,org.xml.sax.ContentHandler) marshal(Object,ContentHandler)} - the Marshaller won't
+ * invoke {@link org.xml.sax.ContentHandler#startDocument()} and
+ * {@link org.xml.sax.ContentHandler#endDocument()}.</li>
+ * <li>{@link #marshal(Object,org.w3c.dom.Node) marshal(Object,Node)} - the property has no effect on this
+ * API.</li>
+ * <li>{@link #marshal(Object,java.io.OutputStream) marshal(Object,OutputStream)} - the Marshaller won't
+ * generate an xml declaration.</li>
+ * <li>{@link #marshal(Object,java.io.Writer) marshal(Object,Writer)} - the Marshaller won't
+ * generate an xml declaration.</li>
+ * <li>{@link #marshal(Object,javax.xml.transform.Result) marshal(Object,Result)} - depends on the kind of
+ * Result object, see semantics for Node, ContentHandler, and Stream APIs</li>
+ * <li>{@link #marshal(Object,javax.xml.stream.XMLEventWriter) marshal(Object,XMLEventWriter)} - the
+ * Marshaller will not generate {@link javax.xml.stream.events.XMLEvent#START_DOCUMENT} and
+ * {@link javax.xml.stream.events.XMLEvent#END_DOCUMENT} events.</li>
+ * <li>{@link #marshal(Object,javax.xml.stream.XMLStreamWriter) marshal(Object,XMLStreamWriter)} - the
+ * Marshaller will not generate {@link javax.xml.stream.events.XMLEvent#START_DOCUMENT} and
+ * {@link javax.xml.stream.events.XMLEvent#END_DOCUMENT} events.</li>
+ * </ul>
+ * </dd>
+ * </dl>
+ * </blockquote>
+ *
+ * <p>
+ * <a name="marshalEventCallback"></a>
+ * <b>Marshal Event Callbacks</b><br>
+ * <blockquote>
+ * "The {@link Marshaller} provides two styles of callback mechanisms
+ * that allow application specific processing during key points in the
+ * unmarshalling process. In 'class defined' event callbacks, application
+ * specific code placed in JAXB mapped classes is triggered during
+ * marshalling. 'External listeners' allow for centralized processing
+ * of marshal events in one callback method rather than by type event callbacks.
+ *
+ * <p>
+ * Class defined event callback methods allow any JAXB mapped class to specify
+ * its own specific callback methods by defining methods with the following method signatures:
+ * <blockquote>
+ * <pre>
+ * // Invoked by Marshaller after it has created an instance of this object.
+ * boolean beforeMarshal(Marshaller, Object parent);
+ *
+ * // Invoked by Marshaller after it has marshalled all properties of this object.
+ * void afterMmarshal(Marshaller, Object parent);
+ * </pre>
+ * </blockquote>
+ * The class defined event callback methods should be used when the callback method requires
+ * access to non-public methods and/or fields of the class.
+ * <p>
+ * The external listener callback mechanism enables the registration of a {@link Listener}
+ * instance with a {@link Marshaller#setListener(Listener)}. The external listener receives all callback events,
+ * allowing for more centralized processing than per class defined callback methods.
+ * <p>
+ * The 'class defined' and external listener event callback methods are independent of each other,
+ * both can be called for one event. The invocation ordering when both listener callback methods exist is
+ * defined in {@link Listener#beforeMarshal(Object)} and {@link Listener#afterMarshal(Object)}.
+ * <p>
+ * An event callback method throwing an exception terminates the current marshal process.
+ * </blockquote>
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $ $Date: 2006/03/08 16:54:42 $
+ * @see JAXBContext
+ * @see Validator
+ * @see Unmarshaller
+ * @since JAXB1.0
+ */
+public interface Marshaller {
+
+ /**
+ * The name of the property used to specify the output encoding in
+ * the marshalled XML data.
+ */
+ public static final String JAXB_ENCODING =
+ "jaxb.encoding";
+
+ /**
+ * The name of the property used to specify whether or not the marshalled
+ * XML data is formatted with linefeeds and indentation.
+ */
+ public static final String JAXB_FORMATTED_OUTPUT =
+ "jaxb.formatted.output";
+
+ /**
+ * The name of the property used to specify the xsi:schemaLocation
+ * attribute value to place in the marshalled XML output.
+ */
+ public static final String JAXB_SCHEMA_LOCATION =
+ "jaxb.schemaLocation";
+
+ /**
+ * The name of the property used to specify the
+ * xsi:noNamespaceSchemaLocation attribute value to place in the marshalled
+ * XML output.
+ */
+ public static final String JAXB_NO_NAMESPACE_SCHEMA_LOCATION =
+ "jaxb.noNamespaceSchemaLocation";
+
+ /**
+ * The name of the property used to specify whether or not the marshaller
+ * will generate document level events (ie calling startDocument or endDocument).
+ */
+ public static final String JAXB_FRAGMENT =
+ "jaxb.fragment";
+
+ /**
+ * Marshal the content tree rooted at <tt>jaxbElement</tt> into the specified
+ * <tt>javax.xml.transform.Result</tt>.
+ *
+ * <p>
+ * All JAXB Providers must at least support
+ * {@link javax.xml.transform.dom.DOMResult},
+ * {@link javax.xml.transform.sax.SAXResult}, and
+ * {@link javax.xml.transform.stream.StreamResult}. It can
+ * support other derived classes of <tt>Result</tt> as well.
+ *
+ * @param jaxbElement
+ * The root of content tree to be marshalled.
+ * @param result
+ * XML will be sent to this Result
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs during the marshalling.
+ * @throws MarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any
+ * object reachable from <tt>obj</tt>). See <a href="#elementMarshalling">
+ * Marshalling a JAXB element</a>.
+ * @throws IllegalArgumentException
+ * If any of the method parameters are null
+ */
+ public void marshal( Object jaxbElement, javax.xml.transform.Result result )
+ throws JAXBException;
+
+ /**
+ * Marshal the content tree rooted at <tt>jaxbElement</tt> into an output stream.
+ *
+ * @param jaxbElement
+ * The root of content tree to be marshalled.
+ * @param os
+ * XML will be added to this stream.
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs during the marshalling.
+ * @throws MarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any
+ * object reachable from <tt>obj</tt>). See <a href="#elementMarshalling">
+ * Marshalling a JAXB element</a>.
+ * @throws IllegalArgumentException
+ * If any of the method parameters are null
+ */
+ public void marshal( Object jaxbElement, java.io.OutputStream os )
+ throws JAXBException;
+
+ /**
+ * Marshal the content tree rooted at <tt>jaxbElement</tt> into a Writer.
+ *
+ * @param jaxbElement
+ * The root of content tree to be marshalled.
+ * @param writer
+ * XML will be sent to this writer.
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs during the marshalling.
+ * @throws MarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any
+ * object reachable from <tt>obj</tt>). See <a href="#elementMarshalling">
+ * Marshalling a JAXB element</a>.
+ * @throws IllegalArgumentException
+ * If any of the method parameters are null
+ */
+ public void marshal( Object jaxbElement, java.io.Writer writer )
+ throws JAXBException;
+
+ /**
+ * Marshal the content tree rooted at <tt>jaxbElement</tt> into SAX2 events.
+ *
+ * @param jaxbElement
+ * The root of content tree to be marshalled.
+ * @param handler
+ * XML will be sent to this handler as SAX2 events.
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs during the marshalling.
+ * @throws MarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any
+ * object reachable from <tt>obj</tt>). See <a href="#elementMarshalling">
+ * Marshalling a JAXB element</a>.
+ * @throws IllegalArgumentException
+ * If any of the method parameters are null
+ */
+ public void marshal( Object jaxbElement, org.xml.sax.ContentHandler handler )
+ throws JAXBException;
+
+ /**
+ * Marshal the content tree rooted at <tt>jaxbElement</tt> into a DOM tree.
+ *
+ * @param jaxbElement
+ * The content tree to be marshalled.
+ * @param node
+ * DOM nodes will be added as children of this node.
+ * This parameter must be a Node that accepts children
+ * ({@link org.w3c.dom.Document},
+ * {@link org.w3c.dom.DocumentFragment}, or
+ * {@link org.w3c.dom.Element})
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs during the marshalling.
+ * @throws MarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Marshaller</tt> is unable to marshal <tt>jaxbElement</tt> (or any
+ * object reachable from <tt>jaxbElement</tt>). See <a href="#elementMarshalling">
+ * Marshalling a JAXB element</a>.
+ * @throws IllegalArgumentException
+ * If any of the method parameters are null
+ */
+ public void marshal( Object jaxbElement, org.w3c.dom.Node node )
+ throws JAXBException;
+
+ /**
+ * Marshal the content tree rooted at <tt>jaxbElement</tt> into a
+ * {@link javax.xml.stream.XMLStreamWriter}.
+ *
+ * @param jaxbElement
+ * The content tree to be marshalled.
+ * @param writer
+ * XML will be sent to this writer.
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs during the marshalling.
+ * @throws MarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any
+ * object reachable from <tt>obj</tt>). See <a href="#elementMarshalling">
+ * Marshalling a JAXB element</a>.
+ * @throws IllegalArgumentException
+ * If any of the method parameters are null
+ * @since JAXB 2.0
+ */
+ public void marshal( Object jaxbElement, javax.xml.stream.XMLStreamWriter writer )
+ throws JAXBException;
+
+ /**
+ * Marshal the content tree rooted at <tt>jaxbElement</tt> into a
+ * {@link javax.xml.stream.XMLEventWriter}.
+ *
+ * @param jaxbElement
+ * The content tree rooted at jaxbElement to be marshalled.
+ * @param writer
+ * XML will be sent to this writer.
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs during the marshalling.
+ * @throws MarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any
+ * object reachable from <tt>obj</tt>). See <a href="#elementMarshalling">
+ * Marshalling a JAXB element</a>.
+ * @throws IllegalArgumentException
+ * If any of the method parameters are null
+ * @since JAXB 2.0
+ */
+ public void marshal( Object jaxbElement, javax.xml.stream.XMLEventWriter writer )
+ throws JAXBException;
+
+ /**
+ * Get a DOM tree view of the content tree(Optional).
+ *
+ * If the returned DOM tree is updated, these changes are also
+ * visible in the content tree.
+ * Use {@link #marshal(Object, org.w3c.dom.Node)} to force
+ * a deep copy of the content tree to a DOM representation.
+ *
+ * @param contentTree - JAXB Java representation of XML content
+ *
+ * @return the DOM tree view of the contentTree
+ *
+ * @throws UnsupportedOperationException
+ * If the JAXB provider implementation does not support a
+ * DOM view of the content tree
+ *
+ * @throws IllegalArgumentException
+ * If any of the method parameters are null
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs
+ *
+ */
+ public org.w3c.dom.Node getNode( java.lang.Object contentTree )
+ throws JAXBException;
+
+ /**
+ * Set the particular property in the underlying implementation of
+ * <tt>Marshaller</tt>. This method can only be used to set one of
+ * the standard JAXB defined properties above or a provider specific
+ * property. Attempting to set an undefined property will result in
+ * a PropertyException being thrown. See <a href="#supportedProps">
+ * Supported Properties</a>.
+ *
+ * @param name the name of the property to be set. This value can either
+ * be specified using one of the constant fields or a user
+ * supplied string.
+ * @param value the value of the property to be set
+ *
+ * @throws PropertyException when there is an error processing the given
+ * property or value
+ * @throws IllegalArgumentException
+ * If the name parameter is null
+ */
+ public void setProperty( String name, Object value )
+ throws PropertyException;
+
+ /**
+ * Get the particular property in the underlying implementation of
+ * <tt>Marshaller</tt>. This method can only be used to get one of
+ * the standard JAXB defined properties above or a provider specific
+ * property. Attempting to get an undefined property will result in
+ * a PropertyException being thrown. See <a href="#supportedProps">
+ * Supported Properties</a>.
+ *
+ * @param name the name of the property to retrieve
+ * @return the value of the requested property
+ *
+ * @throws PropertyException
+ * when there is an error retrieving the given property or value
+ * property name
+ * @throws IllegalArgumentException
+ * If the name parameter is null
+ */
+ public Object getProperty( String name ) throws PropertyException;
+
+ /**
+ * Allow an application to register a validation event handler.
+ * <p>
+ * The validation event handler will be called by the JAXB Provider if any
+ * validation errors are encountered during calls to any of the marshal
+ * API's. If the client application does not register a validation event
+ * handler before invoking one of the marshal methods, then validation
+ * events will be handled by the default event handler which will terminate
+ * the marshal operation after the first error or fatal error is encountered.
+ * <p>
+ * Calling this method with a null parameter will cause the Marshaller
+ * to revert back to the default default event handler.
+ *
+ * @param handler the validation event handler
+ * @throws JAXBException if an error was encountered while setting the
+ * event handler
+ */
+ public void setEventHandler( ValidationEventHandler handler )
+ throws JAXBException;
+
+ /**
+ * Return the current event handler or the default event handler if one
+ * hasn't been set.
+ *
+ * @return the current ValidationEventHandler or the default event handler
+ * if it hasn't been set
+ * @throws JAXBException if an error was encountered while getting the
+ * current event handler
+ */
+ public ValidationEventHandler getEventHandler()
+ throws JAXBException;
+
+
+
+ /**
+ * Associates a configured instance of {@link XmlAdapter} with this marshaller.
+ *
+ * <p>
+ * This is a convenience method that invokes <code>setAdapter(adapter.getClass(),adapter);</code>.
+ *
+ * @see #setAdapter(Class,XmlAdapter)
+ * @throws IllegalArgumentException
+ * if the adapter parameter is null.
+ * @throws UnsupportedOperationException
+ * if invoked agains a JAXB 1.0 implementation.
+ * @since JAXB 2.0
+ */
+ public void setAdapter( XmlAdapter adapter );
+
+ /**
+ * Associates a configured instance of {@link XmlAdapter} with this marshaller.
+ *
+ * <p>
+ * Every marshaller internally maintains a
+ * {@link java.util.Map}<{@link Class},{@link XmlAdapter}>,
+ * which it uses for marshalling classes whose fields/methods are annotated
+ * with {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter}.
+ *
+ * <p>
+ * This method allows applications to use a configured instance of {@link XmlAdapter}.
+ * When an instance of an adapter is not given, a marshaller will create
+ * one by invoking its default constructor.
+ *
+ * @param type
+ * The type of the adapter. The specified instance will be used when
+ * {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter#value()}
+ * refers to this type.
+ * @param adapter
+ * The instance of the adapter to be used. If null, it will un-register
+ * the current adapter set for this type.
+ * @throws IllegalArgumentException
+ * if the type parameter is null.
+ * @throws UnsupportedOperationException
+ * if invoked agains a JAXB 1.0 implementation.
+ * @since JAXB 2.0
+ */
+ public <A extends XmlAdapter> void setAdapter( Class<A> type, A adapter );
+
+ /**
+ * Gets the adapter associated with the specified type.
+ *
+ * This is the reverse operation of the {@link #setAdapter} method.
+ *
+ * @throws IllegalArgumentException
+ * if the type parameter is null.
+ * @throws UnsupportedOperationException
+ * if invoked agains a JAXB 1.0 implementation.
+ * @since JAXB 2.0
+ */
+ public <A extends XmlAdapter> A getAdapter( Class<A> type );
+
+
+ /**
+ * <p>Associate a context that enables binary data within an XML document
+ * to be transmitted as XML-binary optimized attachment.
+ * The attachment is referenced from the XML document content model
+ * by content-id URIs(cid) references stored within the xml document.
+ *
+ * @throws IllegalStateException if attempt to concurrently call this
+ * method during a marshal operation.
+ */
+ void setAttachmentMarshaller(AttachmentMarshaller am);
+
+ AttachmentMarshaller getAttachmentMarshaller();
+
+ /**
+ * Specify the JAXP 1.3 {@link javax.xml.validation.Schema Schema}
+ * object that should be used to validate subsequent marshal operations
+ * against. Passing null into this method will disable validation.
+ *
+ * <p>
+ * This method allows the caller to validate the marshalled XML as it's marshalled.
+ *
+ * <p>
+ * Initially this property is set to <tt>null</tt>.
+ *
+ * @param schema Schema object to validate marshal operations against or null to disable validation
+ * @throws UnsupportedOperationException could be thrown if this method is
+ * invoked on an Marshaller created from a JAXBContext referencing
+ * JAXB 1.0 mapped classes
+ * @since JAXB2.0
+ */
+ public void setSchema( Schema schema );
+
+ /**
+ * Get the JAXP 1.3 {@link javax.xml.validation.Schema Schema} object
+ * being used to perform marshal-time validation. If there is no
+ * Schema set on the marshaller, then this method will return null
+ * indicating that marshal-time validation will not be performed.
+ *
+ * @return the Schema object being used to perform marshal-time
+ * validation or null if not present.
+ * @throws UnsupportedOperationException could be thrown if this method is
+ * invoked on an Marshaller created from a JAXBContext referencing
+ * JAXB 1.0 mapped classes
+ * @since JAXB2.0
+ */
+ public Schema getSchema();
+
+ /**
+ * <p/>
+ * Register an instance of an implementation of this class with a {@link Marshaller} to externally listen
+ * for marshal events.
+ * <p/>
+ * <p/>
+ * This class enables pre and post processing of each marshalled object.
+ * The event callbacks are called when marshalling from an instance that maps to an xml element or
+ * complex type definition. The event callbacks are not called when marshalling from an instance of a
+ * Java datatype that represents a simple type definition.
+ * <p/>
+ * <p/>
+ * External listener is one of two different mechanisms for defining marshal event callbacks.
+ * See <a href="Marshaller.html#marshalEventCallback">Marshal Event Callbacks</a> for an overview.
+ *
+ * @see Marshaller#setListener(Listener)
+ * @see Marshaller#getListener()
+ * @since JAXB2.0
+ */
+ public static abstract class Listener {
+ /**
+ * <p/>
+ * Callback method invoked before marshalling from <tt>source</tt> to XML.
+ * <p/>
+ * <p/>
+ * This method is invoked just before marshalling process starts to marshal <tt>source</tt>.
+ * Note that if the class of <tt>source</tt> defines its own <tt>beforeMarshal</tt> method,
+ * the class specific callback method is invoked just before this method is invoked.
+ *
+ * @param source instance of JAXB mapped class prior to marshalling from it.
+ */
+ public void beforeMarshal(Object source) {
+ }
+
+ /**
+ * <p/>
+ * Callback method invoked after marshalling <tt>source</tt> to XML.
+ * <p/>
+ * <p/>
+ * This method is invoked after <tt>source</tt> and all its descendants have been marshalled.
+ * Note that if the class of <tt>source</tt> defines its own <tt>afterMarshal</tt> method,
+ * the class specific callback method is invoked just before this method is invoked.
+ *
+ * @param source instance of JAXB mapped class after marshalling it.
+ */
+ public void afterMarshal(Object source) {
+ }
+ }
+
+ /**
+ * <p>
+ * Register marshal event callback {@link Listener} with this {@link Marshaller}.
+ *
+ * <p>
+ * There is only one Listener per Marshaller. Setting a Listener replaces the previous set Listener.
+ * One can unregister current Listener by setting listener to <tt>null</tt>.
+ *
+ * @param listener an instance of a class that implements {@link Listener}
+ * @since JAXB2.0
+ */
+ public void setListener(Listener listener);
+
+ /**
+ * <p>Return {@link Listener} registered with this {@link Marshaller}.
+ *
+ * @return registered {@link Listener} or <code>null</code> if no Listener is registered with this Marshaller.
+ * @since JAXB2.0
+ */
+ public Listener getListener();
+}
+
+
+
+
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Messages.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Messages.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Messages.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+
+/**
+ * Formats error messages.
+ */
+class Messages
+{
+ static String format( String property ) {
+ return format( property, null );
+ }
+
+ static String format( String property, Object arg1 ) {
+ return format( property, new Object[]{arg1} );
+ }
+
+ static String format( String property, Object arg1, Object arg2 ) {
+ return format( property, new Object[]{arg1,arg2} );
+ }
+
+ static String format( String property, Object arg1, Object arg2, Object arg3 ) {
+ return format( property, new Object[]{arg1,arg2,arg3} );
+ }
+
+ // add more if necessary.
+
+ /** Loads a string resource and formats it with specified arguments. */
+ static String format( String property, Object[] args ) {
+ String text = ResourceBundle.getBundle(Messages.class.getName()).getString(property);
+ return MessageFormat.format(text,args);
+ }
+
+//
+//
+// Message resources
+//
+//
+ static final String PROVIDER_NOT_FOUND = // 1 arg
+ "ContextFinder.ProviderNotFound";
+
+ static final String COULD_NOT_INSTANTIATE = // 2 args
+ "ContextFinder.CouldNotInstantiate";
+
+ static final String CANT_FIND_PROPERTIES_FILE = // 1 arg
+ "ContextFinder.CantFindPropertiesFile";
+
+ static final String CANT_MIX_PROVIDERS = // 0 args
+ "ContextFinder.CantMixProviders";
+
+ static final String MISSING_PROPERTY = // 2 args
+ "ContextFinder.MissingProperty";
+
+ static final String NO_PACKAGE_IN_CONTEXTPATH = // 0 args
+ "ContextFinder.NoPackageInContextPath";
+
+ static final String NAME_VALUE = // 2 args
+ "PropertyException.NameValue";
+
+ static final String CONVERTER_MUST_NOT_BE_NULL = // 0 args
+ "DatatypeConverter.ConverterMustNotBeNull";
+
+ static final String ILLEGAL_CAST = // 2 args
+ "JAXBContext.IllegalCast";
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/NotIdentifiableEvent.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/NotIdentifiableEvent.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/NotIdentifiableEvent.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * This event indicates that a problem was encountered resolving an ID/IDREF.
+ *
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $
+ * @see Validator
+ * @see ValidationEventHandler
+ * @since JAXB1.0
+ */
+public interface NotIdentifiableEvent extends ValidationEvent {
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ParseConversionEvent.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ParseConversionEvent.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ParseConversionEvent.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * This event indicates that a problem was encountered while converting a
+ * string from the XML data into a value of the target Java data type.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $
+ * @see ValidationEvent
+ * @see ValidationEventHandler
+ * @see Unmarshaller
+ * @since JAXB1.0
+ */
+public interface ParseConversionEvent extends ValidationEvent {
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/PrintConversionEvent.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/PrintConversionEvent.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/PrintConversionEvent.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * This event indicates that a problem was encountered while converting data
+ * from the Java content tree into its lexical representation.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $
+ * @see ValidationEvent
+ * @see ValidationEventHandler
+ * @see Marshaller
+ * @since JAXB1.0
+ */
+public interface PrintConversionEvent extends ValidationEvent {
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/PropertyException.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/PropertyException.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/PropertyException.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+
+
+/**
+ * This exception indicates that an error was encountered while getting or
+ * setting a property.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $ $Date: 2004/12/14 21:50:40 $
+ * @see JAXBContext
+ * @see Validator
+ * @see Unmarshaller
+ * @since JAXB1.0
+ */
+public class PropertyException extends JAXBException {
+
+ /**
+ * Construct a PropertyException with the specified detail message. The
+ * errorCode and linkedException will default to null.
+ *
+ * @param message a description of the exception
+ */
+ public PropertyException(String message) {
+ super(message);
+ }
+
+ /**
+ * Construct a PropertyException with the specified detail message and
+ * vendor specific errorCode. The linkedException will default to null.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ */
+ public PropertyException(String message, String errorCode) {
+ super(message, errorCode);
+ }
+
+ /**
+ * Construct a PropertyException with a linkedException. The detail
+ * message and vendor specific errorCode will default to null.
+ *
+ * @param exception the linked exception
+ */
+ public PropertyException(Throwable exception) {
+ super(exception);
+ }
+
+ /**
+ * Construct a PropertyException with the specified detail message and
+ * linkedException. The errorCode will default to null.
+ *
+ * @param message a description of the exception
+ * @param exception the linked exception
+ */
+ public PropertyException(String message, Throwable exception) {
+ super(message, exception);
+ }
+
+ /**
+ * Construct a PropertyException with the specified detail message, vendor
+ * specific errorCode, and linkedException.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ * @param exception the linked exception
+ */
+ public PropertyException(
+ String message,
+ String errorCode,
+ Throwable exception) {
+ super(message, errorCode, exception);
+ }
+
+ /**
+ * Construct a PropertyException whose message field is set based on the
+ * name of the property and value.toString().
+ *
+ * @param name the name of the property related to this exception
+ * @param value the value of the property related to this exception
+ */
+ public PropertyException(String name, Object value) {
+ super( Messages.format( Messages.NAME_VALUE,
+ name,
+ value.toString() ) );
+ }
+
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/SchemaOutputResolver.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/SchemaOutputResolver.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/SchemaOutputResolver.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,57 @@
+package javax.xml.bind;
+
+import javax.xml.transform.Result;
+import java.io.IOException;
+
+/**
+ * Controls where a JAXB implementation puts the generates
+ * schema files.
+ *
+ * <p>
+ * An implementation of this abstract class has to be provided by the calling
+ * application to generate schemas.
+ *
+ * <p>
+ * This is a class, not an interface so as to allow future versions to evolve
+ * without breaking the compatibility.
+ *
+ * @author
+ * Kohsuke Kawaguchi (kohsuke.kawaguchi at sun.com)
+ */
+public abstract class SchemaOutputResolver {
+ /**
+ * Decides where the schema file (of the given namespace URI)
+ * will be written, and return it as a {@link Result} object.
+ *
+ * <p>
+ * This method is called only once for any given namespace.
+ * IOW, all the components in one namespace is always written
+ * into the same schema document.
+ *
+ * @param namespaceUri
+ * The namespace URI that the schema declares.
+ * Can be the empty string, but never be null.
+ * @param suggestedFileName
+ * A JAXB implementation generates an unique file name (like "schema1.xsd")
+ * for the convenience of the callee. This name can be
+ * used for the file name of the schema, or the callee can just
+ * ignore this name and come up with its own name.
+ * This is just a hint.
+ *
+ * @return
+ * a {@link Result} object that encapsulates the actual destination
+ * of the schema.
+ *
+ * If the {@link Result} object has a system ID, it must be an
+ * absolute system ID. Those system IDs are relativized by the caller and used
+ * for <xs:import> statements.
+ *
+ * If the {@link Result} object does not have a system ID, a schema
+ * for the namespace URI is generated but it won't be explicitly
+ * <xs:import>ed from other schemas.
+ *
+ * If {@code null} is returned, the schema generation for this
+ * namespace URI will be skipped.
+ */
+ public abstract Result createOutput( String namespaceUri, String suggestedFileName ) throws IOException;
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/TypeConstraintException.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/TypeConstraintException.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/TypeConstraintException.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,164 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * This exception indicates that a violation of a dynamically checked type
+ * constraint was detected.
+ *
+ * <p>
+ * This exception can be thrown by the generated setter methods of the schema
+ * derived Java content classes. However, since fail-fast validation is
+ * an optional feature for JAXB Providers to support, not all setter methods
+ * will throw this exception when a type constraint is violated.
+ *
+ * <p>
+ * If this exception is throw while invoking a fail-fast setter, the value of
+ * the property is guaranteed to remain unchanged, as if the setter were never
+ * called.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $
+ * @see ValidationEvent
+ * @since JAXB1.0
+ */
+
+public class TypeConstraintException extends java.lang.RuntimeException {
+
+ /**
+ * Vendor specific error code
+ *
+ */
+ private String errorCode;
+
+ /**
+ * Exception reference
+ *
+ */
+ private Throwable linkedException;
+
+
+ /**
+ * Construct a TypeConstraintException with the specified detail message. The
+ * errorCode and linkedException will default to null.
+ *
+ * @param message a description of the exception
+ */
+ public TypeConstraintException(String message) {
+ this( message, null, null );
+ }
+
+ /**
+ * Construct a TypeConstraintException with the specified detail message and vendor
+ * specific errorCode. The linkedException will default to null.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ */
+ public TypeConstraintException(String message, String errorCode) {
+ this( message, errorCode, null );
+ }
+
+ /**
+ * Construct a TypeConstraintException with a linkedException. The detail message and
+ * vendor specific errorCode will default to null.
+ *
+ * @param exception the linked exception
+ */
+ public TypeConstraintException(Throwable exception) {
+ this( null, null, exception );
+ }
+
+ /**
+ * Construct a TypeConstraintException with the specified detail message and
+ * linkedException. The errorCode will default to null.
+ *
+ * @param message a description of the exception
+ * @param exception the linked exception
+ */
+ public TypeConstraintException(String message, Throwable exception) {
+ this( message, null, exception );
+ }
+
+ /**
+ * Construct a TypeConstraintException with the specified detail message,
+ * vendor specific errorCode, and linkedException.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ * @param exception the linked exception
+ */
+ public TypeConstraintException(String message, String errorCode, Throwable exception) {
+ super( message );
+ this.errorCode = errorCode;
+ this.linkedException = exception;
+ }
+
+ /**
+ * Get the vendor specific error code
+ *
+ * @return a string specifying the vendor specific error code
+ */
+ public String getErrorCode() {
+ return this.errorCode;
+ }
+
+ /**
+ * Get the linked exception
+ *
+ * @return the linked Exception, null if none exists
+ */
+ public Throwable getLinkedException() {
+ return linkedException;
+ }
+
+ /**
+ * Add a linked Exception.
+ *
+ * @param exception the linked Exception (A null value is permitted and
+ * indicates that the linked exception does not exist or
+ * is unknown).
+ */
+ public synchronized void setLinkedException( Throwable exception ) {
+ this.linkedException = exception;
+ }
+
+ /**
+ * Returns a short description of this TypeConstraintException.
+ *
+ */
+ public String toString() {
+ return linkedException == null ?
+ super.toString() :
+ super.toString() + "\n - with linked exception:\n[" +
+ linkedException.toString()+ "]";
+ }
+
+ /**
+ * Prints this TypeConstraintException and its stack trace (including the stack trace
+ * of the linkedException if it is non-null) to the PrintStream.
+ *
+ * @param s PrintStream to use for output
+ */
+ public void printStackTrace( java.io.PrintStream s ) {
+ if( linkedException != null ) {
+ linkedException.printStackTrace(s);
+ s.println("--------------- linked to ------------------");
+ }
+
+ super.printStackTrace(s);
+ }
+
+ /**
+ * Prints this TypeConstraintException and its stack trace (including the stack trace
+ * of the linkedException if it is non-null) to <tt>System.err</tt>.
+ *
+ */
+ public void printStackTrace() {
+ printStackTrace(System.err);
+ }
+
+}
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/UnmarshalException.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/UnmarshalException.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/UnmarshalException.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * This exception indicates that an error has occurred while performing
+ * an unmarshal operation that prevents the JAXB Provider from completing
+ * the operation.
+ *
+ * <p>
+ * The <tt>ValidationEventHandler</tt> can cause this exception to be thrown
+ * during the unmarshal operations. See
+ * {@link ValidationEventHandler#handleEvent(ValidationEvent)
+ * ValidationEventHandler.handleEvent(ValidationEvent)}.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $
+ * @see JAXBException
+ * @see Unmarshaller
+ * @see ValidationEventHandler
+ * @since JAXB1.0
+ */
+public class UnmarshalException extends JAXBException {
+
+ /**
+ * Construct an UnmarshalException with the specified detail message. The
+ * errorCode and linkedException will default to null.
+ *
+ * @param message a description of the exception
+ */
+ public UnmarshalException( String message ) {
+ this( message, null, null );
+ }
+
+ /**
+ * Construct an UnmarshalException with the specified detail message and vendor
+ * specific errorCode. The linkedException will default to null.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ */
+ public UnmarshalException( String message, String errorCode ) {
+ this( message, errorCode, null );
+ }
+
+ /**
+ * Construct an UnmarshalException with a linkedException. The detail message and
+ * vendor specific errorCode will default to null.
+ *
+ * @param exception the linked exception
+ */
+ public UnmarshalException( Throwable exception ) {
+ this( null, null, exception );
+ }
+
+ /**
+ * Construct an UnmarshalException with the specified detail message and
+ * linkedException. The errorCode will default to null.
+ *
+ * @param message a description of the exception
+ * @param exception the linked exception
+ */
+ public UnmarshalException( String message, Throwable exception ) {
+ this( message, null, exception );
+ }
+
+ /**
+ * Construct an UnmarshalException with the specified detail message, vendor
+ * specific errorCode, and linkedException.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ * @param exception the linked exception
+ */
+ public UnmarshalException( String message, String errorCode, Throwable exception ) {
+ super( message, errorCode, exception );
+ }
+
+}
+
+
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Unmarshaller.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Unmarshaller.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Unmarshaller.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,1124 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+import javax.xml.bind.attachment.AttachmentUnmarshaller;
+import javax.xml.validation.Schema;
+import java.io.Reader;
+
+/**
+ * The <tt>Unmarshaller</tt> class governs the process of deserializing XML
+ * data into newly created Java content trees, optionally validating the XML
+ * data as it is unmarshalled. It provides an overloading of unmarshal methods
+ * for many different input kinds.
+ *
+ * <p>
+ * Unmarshalling from a File:
+ * <blockquote>
+ * <pre>
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ * Unmarshaller u = jc.createUnmarshaller();
+ * Object o = u.unmarshal( new File( "nosferatu.xml" ) );
+ * </pre>
+ * </blockquote>
+ *
+ *
+ * <p>
+ * Unmarshalling from an InputStream:
+ * <blockquote>
+ * <pre>
+ * InputStream is = new FileInputStream( "nosferatu.xml" );
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ * Unmarshaller u = jc.createUnmarshaller();
+ * Object o = u.unmarshal( is );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Unmarshalling from a URL:
+ * <blockquote>
+ * <pre>
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ * Unmarshaller u = jc.createUnmarshaller();
+ * URL url = new URL( "http://beaker.east/nosferatu.xml" );
+ * Object o = u.unmarshal( url );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Unmarshalling from a StringBuffer using a
+ * <tt>javax.xml.transform.stream.StreamSource</tt>:
+ * <blockquote>
+ * <pre>
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ * Unmarshaller u = jc.createUnmarshaller();
+ * StringBuffer xmlStr = new StringBuffer( "<?xml version="1.0"?>..." );
+ * Object o = u.unmarshal( new StreamSource( new StringReader( xmlStr.toString() ) ) );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Unmarshalling from a <tt>org.w3c.dom.Node</tt>:
+ * <blockquote>
+ * <pre>
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ * Unmarshaller u = jc.createUnmarshaller();
+ *
+ * DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ * dbf.setNamespaceAware(true);
+ * DocumentBuilder db = dbf.newDocumentBuilder();
+ * Document doc = db.parse(new File( "nosferatu.xml"));
+
+ * Object o = u.unmarshal( doc );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Unmarshalling from a <tt>javax.xml.transform.sax.SAXSource</tt> using a
+ * client specified validating SAX2.0 parser:
+ * <blockquote>
+ * <pre>
+ * // configure a validating SAX2.0 parser (Xerces2)
+ * static final String JAXP_SCHEMA_LANGUAGE =
+ * "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ * static final String JAXP_SCHEMA_LOCATION =
+ * "http://java.sun.com/xml/jaxp/properties/schemaSource";
+ * static final String W3C_XML_SCHEMA =
+ * "http://www.w3.org/2001/XMLSchema";
+ *
+ * System.setProperty( "javax.xml.parsers.SAXParserFactory",
+ * "org.apache.xerces.jaxp.SAXParserFactoryImpl" );
+ *
+ * SAXParserFactory spf = SAXParserFactory.newInstance();
+ * spf.setNamespaceAware(true);
+ * spf.setValidating(true);
+ * SAXParser saxParser = spf.newSAXParser();
+ *
+ * try {
+ * saxParser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
+ * saxParser.setProperty(JAXP_SCHEMA_LOCATION, "http://....");
+ * } catch (SAXNotRecognizedException x) {
+ * // exception handling omitted
+ * }
+ *
+ * XMLReader xmlReader = saxParser.getXMLReader();
+ * SAXSource source =
+ * new SAXSource( xmlReader, new InputSource( "http://..." ) );
+ *
+ * // Setup JAXB to unmarshal
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ * Unmarshaller u = jc.createUnmarshaller();
+ * ValidationEventCollector vec = new ValidationEventCollector();
+ * u.setEventHandler( vec );
+ *
+ * // turn off the JAXB provider's default validation mechanism to
+ * // avoid duplicate validation
+ * u.setValidating( false )
+ *
+ * // unmarshal
+ * Object o = u.unmarshal( source );
+ *
+ * // check for events
+ * if( vec.hasEvents() ) {
+ * // iterate over events
+ * }
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Unmarshalling from a StAX XMLStreamReader:
+ * <blockquote>
+ * <pre>
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ * Unmarshaller u = jc.createUnmarshaller();
+ *
+ * javax.xml.stream.XMLStreamReader xmlStreamReader =
+ * javax.xml.stream.XMLInputFactory().newInstance().createXMLStreamReader( ... );
+ *
+ * Object o = u.unmarshal( xmlStreamReader );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Unmarshalling from a StAX XMLEventReader:
+ * <blockquote>
+ * <pre>
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ * Unmarshaller u = jc.createUnmarshaller();
+ *
+ * javax.xml.stream.XMLEventReader xmlEventReader =
+ * javax.xml.stream.XMLInputFactory().newInstance().createXMLEventReader( ... );
+ *
+ * Object o = u.unmarshal( xmlEventReader );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * <a name="unmarshalEx"></a>
+ * <b>Unmarshalling XML Data</b><br>
+ * <blockquote>
+ * Unmarshalling can deserialize XML data that represents either an entire XML document
+ * or a subtree of an XML document. Typically, it is sufficient to use the
+ * unmarshalling methods described by
+ * <a href="#unmarshalGlobal">Unmarshal root element that is declared globally</a>.
+ * These unmarshal methods utilize {@link JAXBContext}'s mapping of global XML element
+ * declarations and type definitions to JAXB mapped classes to initiate the
+ * unmarshalling of the root element of XML data. When the {@link JAXBContext}'s
+ * mappings are not sufficient to unmarshal the root element of XML data,
+ * the application can assist the unmarshalling process by using the
+ * <a href="#unmarshalByDeclaredType">unmarshal by declaredType methods</a>.
+ * These methods are useful for unmarshalling XML data where
+ * the root element corresponds to a local element declaration in the schema.
+ * </blockquote>
+ *
+ * <blockquote>
+ * An unmarshal method never returns null. If the unmarshal process is unable to unmarshal
+ * the root of XML content to a JAXB mapped object, a fatal error is reported that
+ * terminates processing by throwing JAXBException.
+ * </blockquote>
+ *
+ * <p>
+ * <a name="unmarshalGlobal"></a>
+ * <b>Unmarshal a root element that is globally declared</b><br>
+ * <blockquote>
+ * The unmarshal methods that do not have an <tt>declaredType</tt> parameter use
+ * {@link JAXBContext} to unmarshal the root element of an XML data. The {@link JAXBContext}
+ * instance is the one that was used to create this <tt>Unmarshaller</tt>. The {@link JAXBContext}
+ * instance maintains a mapping of globally declared XML element and type definition names to
+ * JAXB mapped classes. The unmarshal method checks if {@link JAXBContext} has a mapping
+ * from the root element's XML name and/or <tt>@xsi:type</tt> to a JAXB mapped class. If it does, it umarshalls the
+ * XML data using the appropriate JAXB mapped class. Note that when the root element name is unknown and the root
+ * element has an <tt>@xsi:type</tt>, the XML data is unmarshalled
+ * using that JAXB mapped class as the value of a {@link JAXBElement}.
+ * When the {@link JAXBContext} object does not have a mapping for the root element's name
+ * nor its <tt>@xsi:type</tt>, if it exists,
+ * then the unmarshal operation will abort immediately by throwing a {@link UnmarshalException
+ * UnmarshalException}. This exception scenario can be worked around by using the unmarshal by
+ * declaredType methods described in the next subsection.
+ * </blockquote>
+ *
+ * <p>
+ * <a name="unmarshalByDeclaredType"></a>
+ * <b>Unmarshal by Declared Type</b><br>
+ * <blockquote>
+ * The unmarshal methods with a <code>declaredType</code> parameter enable an
+ * application to deserialize a root element of XML data, even when
+ * there is no mapping in {@link JAXBContext} of the root element's XML name.
+ * The unmarshaller unmarshals the root element using the application provided
+ * mapping specified as the <tt>declaredType</tt> parameter.
+ * Note that even when the root element's element name is mapped by {@link JAXBContext},
+ * the <code>declaredType</code> parameter overrides that mapping for
+ * deserializing the root element when using these unmarshal methods.
+ * Additionally, when the root element of XML data has an <tt>xsi:type</tt> attribute and
+ * that attribute's value references a type definition that is mapped
+ * to a JAXB mapped class by {@link JAXBContext}, that the root
+ * element's <tt>xsi:type</tt> attribute takes
+ * precedence over the unmarshal methods <tt>declaredType</tt> parameter.
+ * These methods always return a <tt>JAXBElement<declaredType></tt>
+ * instance. The table below shows how the properties of the returned JAXBElement
+ * instance are set.
+ *
+ * <a name="unmarshalDeclaredTypeReturn"></a>
+ * <p>
+ * <table border="2" rules="all" cellpadding="4">
+ * <thead>
+ * <tr>
+ * <th align="center" colspan="2">
+ * Unmarshal By Declared Type returned JAXBElement
+ * </tr>
+ * <tr>
+ * <th>JAXBElement Property</th>
+ * <th>Value</th>
+ * </tr>
+ * </tr>
+ * <tr>
+ * <td>name</td>
+ * <td><code>xml element name</code></td>
+ * </tr>
+ * </thead>
+ * <tbody>
+ * <tr>
+ * <td>value</td>
+ * <td><code>instanceof declaredType</code></td>
+ * </tr>
+ * <tr>
+ * <td>declaredType</td>
+ * <td>unmarshal method <code>declaredType</code> parameter</td>
+ * </tr>
+ * <tr>
+ * <td>scope</td>
+ * <td><code>null</code> <i>(actual scope is unknown)</td>
+ * </tr>
+ * </tbody>
+ * </table>
+ * </blockquote>
+ *
+ * <p>
+ * The following is an example of
+ * <a href="#unmarshalByDeclaredType">unmarshal by declaredType method</a>.
+ * <p>
+ * Unmarshal by declaredType from a <tt>org.w3c.dom.Node</tt>:
+ * <blockquote>
+ * <pre>
+ * Schema fragment for example
+ * <xs:schema>
+ * <xs:complexType name="FooType">...<\xs:complexType>
+ * <!-- global element declaration "PurchaseOrder" -->
+ * <xs:element name="PurchaseOrder">
+ * <xs:complexType>
+ * <xs:sequence>
+ * <!-- local element declaration "foo" -->
+ * <xs:element name="foo" type="FooType"/>
+ * ...
+ * </xs:sequence>
+ * </xs:complexType>
+ * </xs:element>
+ * </xs:schema>
+ *
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ * Unmarshaller u = jc.createUnmarshaller();
+ *
+ * DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ * dbf.setNamespaceAware(true);
+ * DocumentBuilder db = dbf.newDocumentBuilder();
+ * Document doc = db.parse(new File( "nosferatu.xml"));
+ * Element fooSubtree = ...; // traverse DOM till reach xml element foo, constrained by a
+ * // local element declaration in schema.
+ *
+ * // FooType is the JAXB mapping of the type of local element declaration foo.
+ * JAXBElement<FooType> foo = u.unmarshal( fooSubtree, FooType.class);
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * <b>Support for SAX2.0 Compliant Parsers</b><br>
+ * <blockquote>
+ * A client application has the ability to select the SAX2.0 compliant parser
+ * of their choice. If a SAX parser is not selected, then the JAXB Provider's
+ * default parser will be used. Even though the JAXB Provider's default parser
+ * is not required to be SAX2.0 compliant, all providers are required to allow
+ * a client application to specify their own SAX2.0 parser. Some providers may
+ * require the client application to specify the SAX2.0 parser at schema compile
+ * time. See {@link #unmarshal(javax.xml.transform.Source) unmarshal(Source)}
+ * for more detail.
+ * </blockquote>
+ *
+ * <p>
+ * <b>Validation and Well-Formedness</b><br>
+ * <blockquote>
+ * <p>
+ * A client application can enable or disable JAXP 1.3 validation
+ * mechanism via the <tt>setSchema(javax.xml.validation.Schema)</tt> API.
+ * Sophisticated clients can specify their own validating SAX 2.0 compliant
+ * parser and bypass the JAXP 1.3 validation mechanism using the
+ * {@link #unmarshal(javax.xml.transform.Source) unmarshal(Source)} API.
+ *
+ * <p>
+ * Since unmarshalling invalid XML content is defined in JAXB 2.0,
+ * the Unmarshaller default validation event handler was made more lenient
+ * than in JAXB 1.0. When schema-derived code generated
+ * by JAXB 1.0 binding compiler is registered with {@link JAXBContext},
+ * the default unmarshal validation handler is
+ * {@link javax.xml.bind.helpers.DefaultValidationEventHandler} and it
+ * terminates the marshal operation after encountering either a fatal error or an error.
+ * For a JAXB 2.0 client application, there is no explicitly defined default
+ * validation handler and the default event handling only
+ * terminates the marshal operation after encountering a fatal error.
+ *
+ * </blockquote>
+ *
+ * <p>
+ * <a name="supportedProps"></a>
+ * <b>Supported Properties</b><br>
+ * <blockquote>
+ * <p>
+ * There currently are not any properties required to be supported by all
+ * JAXB Providers on Unmarshaller. However, some providers may support
+ * their own set of provider specific properties.
+ * </blockquote>
+ *
+ * <p>
+ * <a name="unmarshalEventCallback"></a>
+ * <b>Unmarshal Event Callbacks</b><br>
+ * <blockquote>
+ * The {@link Unmarshaller} provides two styles of callback mechanisms
+ * that allow application specific processing during key points in the
+ * unmarshalling process. In 'class defined' event callbacks, application
+ * specific code placed in JAXB mapped classes is triggered during
+ * unmarshalling. 'External listeners' allow for centralized processing
+ * of unmarshal events in one callback method rather than by type event callbacks.
+ * <p>
+ * 'Class defined' event callback methods allow any JAXB mapped class to specify
+ * its own specific callback methods by defining methods with the following method signature:
+ * <blockquote>
+ * <pre>
+ * // This method is called immediately after the object is created and before the unmarshalling of this
+ * // object begins. The callback provides an opportunity to initialize JavaBean properties prior to unmarshalling.
+ * void beforeUnmarshal(Unmarshaller, Object parent);
+ *
+ * //This method is called after all the properties (except IDREF) are unmarshalled for this object,
+ * //but before this object is set to the parent object.
+ * void afterUnmarshal(Unmarshaller, Object parent);
+ * </pre>
+ * </blockquote>
+ * The class defined callback methods should be used when the callback method requires
+ * access to non-public methods and/or fields of the class.
+ * <p>
+ * The external listener callback mechanism enables the registration of a {@link Listener}
+ * instance with an {@link Unmarshaller#setListener(Listener)}. The external listener receives all callback events,
+ * allowing for more centralized processing than per class defined callback methods. The external listener
+ * receives events when unmarshalling proces is marshalling to a JAXB element or to JAXB mapped class.
+ * <p>
+ * The 'class defined' and external listener event callback methods are independent of each other,
+ * both can be called for one event. The invocation ordering when both listener callback methods exist is
+ * defined in {@link Listener#beforeUnmarshal(Object, Object)} and {@link Listener#afterUnmarshal(Object, Object)}.
+* <p>
+ * An event callback method throwing an exception terminates the current unmarshal process.
+ *
+ * </blockquote>
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $ $Date: 2005/08/18 15:18:26 $
+ * @see JAXBContext
+ * @see Marshaller
+ * @see Validator
+ * @since JAXB1.0
+ */
+public interface Unmarshaller {
+
+ /**
+ * Unmarshal XML data from the specified file and return the resulting
+ * content tree.
+ *
+ * <p>
+ * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.
+ *
+ * @param f the file to unmarshal XML data from
+ * @return the newly created root object of the java content tree
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If the file parameter is null
+ */
+ public Object unmarshal( java.io.File f ) throws JAXBException;
+
+ /**
+ * Unmarshal XML data from the specified InputStream and return the
+ * resulting content tree. Validation event location information may
+ * be incomplete when using this form of the unmarshal API.
+ *
+ * <p>
+ * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.
+ *
+ * @param is the InputStream to unmarshal XML data from
+ * @return the newly created root object of the java content tree
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If the InputStream parameter is null
+ */
+ public Object unmarshal( java.io.InputStream is ) throws JAXBException;
+
+ /**
+ * Unmarshal XML data from the specified Reader and return the
+ * resulting content tree. Validation event location information may
+ * be incomplete when using this form of the unmarshal API,
+ * because a Reader does not provide the system ID.
+ *
+ * <p>
+ * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.
+ *
+ * @param reader the Reader to unmarshal XML data from
+ * @return the newly created root object of the java content tree
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If the InputStream parameter is null
+ * @since JAXB2.0
+ */
+ public Object unmarshal( Reader reader ) throws JAXBException;
+
+ /**
+ * Unmarshal XML data from the specified URL and return the resulting
+ * content tree.
+ *
+ * <p>
+ * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.
+ *
+ * @param url the url to unmarshal XML data from
+ * @return the newly created root object of the java content tree
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If the URL parameter is null
+ */
+ public Object unmarshal( java.net.URL url ) throws JAXBException;
+
+ /**
+ * Unmarshal XML data from the specified SAX InputSource and return the
+ * resulting content tree.
+ *
+ * <p>
+ * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.
+ *
+ * @param source the input source to unmarshal XML data from
+ * @return the newly created root object of the java content tree
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If the InputSource parameter is null
+ */
+ public Object unmarshal( org.xml.sax.InputSource source ) throws JAXBException;
+
+ /**
+ * Unmarshal global XML data from the specified DOM tree and return the resulting
+ * content tree.
+ *
+ * <p>
+ * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.
+ *
+ * @param node
+ * the document/element to unmarshal XML data from.
+ * The caller must support at least Document and Element.
+ * @return the newly created root object of the java content tree
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If the Node parameter is null
+ * @see #unmarshal(org.w3c.dom.Node, Class)
+ */
+ public Object unmarshal( org.w3c.dom.Node node ) throws JAXBException;
+
+ /**
+ * Unmarshal XML data by JAXB mapped <tt>declaredType</tt>
+ * and return the resulting content tree.
+ *
+ * <p>
+ * Implements <a href="#unmarshalByDeclaredType">Unmarshal by Declared Type</a>
+ *
+ * @param node
+ * the document/element to unmarshal XML data from.
+ * The caller must support at least Document and Element.
+ * @param declaredType
+ * appropriate JAXB mapped class to hold <tt>node</tt>'s XML data.
+ *
+ * @return <a href="#unmarshalDeclaredTypeReturn">JAXB Element</a> representation of <tt>node</tt>
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If any parameter is null
+ * @since JAXB2.0
+ */
+ public <T> JAXBElement<T> unmarshal( org.w3c.dom.Node node, Class<T> declaredType ) throws JAXBException;
+
+ /**
+ * Unmarshal XML data from the specified XML Source and return the
+ * resulting content tree.
+ *
+ * <p>
+ * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.
+ *
+ * <p>
+ * <a name="saxParserPlugable"></a>
+ * <b>SAX 2.0 Parser Pluggability</b>
+ * <p>
+ * A client application can choose not to use the default parser mechanism
+ * supplied with their JAXB provider. Any SAX 2.0 compliant parser can be
+ * substituted for the JAXB provider's default mechanism. To do so, the
+ * client application must properly configure a <tt>SAXSource</tt> containing
+ * an <tt>XMLReader</tt> implemented by the SAX 2.0 parser provider. If the
+ * <tt>XMLReader</tt> has an <tt>org.xml.sax.ErrorHandler</tt> registered
+ * on it, it will be replaced by the JAXB Provider so that validation errors
+ * can be reported via the <tt>ValidationEventHandler</tt> mechanism of
+ * JAXB. If the <tt>SAXSource</tt> does not contain an <tt>XMLReader</tt>,
+ * then the JAXB provider's default parser mechanism will be used.
+ * <p>
+ * This parser replacement mechanism can also be used to replace the JAXB
+ * provider's unmarshal-time validation engine. The client application
+ * must properly configure their SAX 2.0 compliant parser to perform
+ * validation (as shown in the example above). Any <tt>SAXParserExceptions
+ * </tt> encountered by the parser during the unmarshal operation will be
+ * processed by the JAXB provider and converted into JAXB
+ * <tt>ValidationEvent</tt> objects which will be reported back to the
+ * client via the <tt>ValidationEventHandler</tt> registered with the
+ * <tt>Unmarshaller</tt>. <i>Note:</i> specifying a substitute validating
+ * SAX 2.0 parser for unmarshalling does not necessarily replace the
+ * validation engine used by the JAXB provider for performing on-demand
+ * validation.
+ * <p>
+ * The only way for a client application to specify an alternate parser
+ * mechanism to be used during unmarshal is via the
+ * <tt>unmarshal(SAXSource)</tt> API. All other forms of the unmarshal
+ * method (File, URL, Node, etc) will use the JAXB provider's default
+ * parser and validator mechanisms.
+ *
+ * @param source the XML Source to unmarshal XML data from (providers are
+ * only required to support SAXSource, DOMSource, and StreamSource)
+ * @return the newly created root object of the java content tree
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If the Source parameter is null
+ * @see #unmarshal(javax.xml.transform.Source, Class)
+ */
+ public Object unmarshal( javax.xml.transform.Source source )
+ throws JAXBException;
+
+
+ /**
+ * Unmarshal XML data from the specified XML Source by <tt>declaredType</tt> and return the
+ * resulting content tree.
+ *
+ * <p>
+ * Implements <a href="#unmarshalByDeclaredType">Unmarshal by Declared Type</a>
+ *
+ * <p>
+ * See <a href="#saxParserPlugable">SAX 2.0 Parser Pluggability</a>
+ *
+ * @param source the XML Source to unmarshal XML data from (providers are
+ * only required to support SAXSource, DOMSource, and StreamSource)
+ * @param declaredType
+ * appropriate JAXB mapped class to hold <tt>source</tt>'s xml root element
+ * @return Java content rooted by <a href="#unmarshalDeclaredTypeReturn">JAXB Element</a>
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If any parameter is null
+ * @since JAXB2.0
+ */
+ public <T> JAXBElement<T> unmarshal( javax.xml.transform.Source source, Class<T> declaredType )
+ throws JAXBException;
+
+ /**
+ * Unmarshal XML data from the specified pull parser and return the
+ * resulting content tree.
+ *
+ * <p>
+ * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.
+ *
+ * <p>
+ * This method assumes that the parser is on a START_DOCUMENT or
+ * START_ELEMENT event. Unmarshalling will be done from this
+ * start event to the corresponding end event. If this method
+ * returns successfully, the <tt>reader</tt> will be pointing at
+ * the token right after the end event.
+ *
+ * @param reader
+ * The parser to be read.
+ * @return
+ * the newly created root object of the java content tree.
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If the <tt>reader</tt> parameter is null
+ * @throws IllegalStateException
+ * If <tt>reader</tt> is not pointing to a START_DOCUMENT or
+ * START_ELEMENT event.
+ * @since JAXB2.0
+ * @see #unmarshal(javax.xml.stream.XMLStreamReader, Class)
+ */
+ public Object unmarshal( javax.xml.stream.XMLStreamReader reader )
+ throws JAXBException;
+
+ /**
+ * Unmarshal root element to JAXB mapped <tt>declaredType</tt>
+ * and return the resulting content tree.
+ *
+ * <p>
+ * This method implements <a href="unmarshalByDeclaredType">unmarshal by declaredType</a>.
+ * <p>
+ * This method assumes that the parser is on a START_DOCUMENT or
+ * START_ELEMENT event. Unmarshalling will be done from this
+ * start event to the corresponding end event. If this method
+ * returns successfully, the <tt>reader</tt> will be pointing at
+ * the token right after the end event.
+ *
+ * @param reader
+ * The parser to be read.
+ * @param declaredType
+ * appropriate JAXB mapped class to hold <tt>reader</tt>'s START_ELEMENT XML data.
+ *
+ * @return content tree rooted by <a href="#unmarshalDeclaredTypeReturn">JAXB Element representation</a>
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If any parameter is null
+ * @since JAXB2.0
+ */
+ public <T> JAXBElement<T> unmarshal( javax.xml.stream.XMLStreamReader reader, Class<T> declaredType ) throws JAXBException;
+
+ /**
+ * Unmarshal XML data from the specified pull parser and return the
+ * resulting content tree.
+ *
+ * <p>
+ * This method is an <a href="#unmarshalGlobal">Unmarshal Global Root method</a>.
+ *
+ * <p>
+ * This method assumes that the parser is on a START_DOCUMENT or
+ * START_ELEMENT event. Unmarshalling will be done from this
+ * start event to the corresponding end event. If this method
+ * returns successfully, the <tt>reader</tt> will be pointing at
+ * the token right after the end event.
+ *
+ * @param reader
+ * The parser to be read.
+ * @return
+ * the newly created root object of the java content tree.
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If the <tt>reader</tt> parameter is null
+ * @throws IllegalStateException
+ * If <tt>reader</tt> is not pointing to a START_DOCUMENT or
+ * START_ELEMENT event.
+ * @since JAXB2.0
+ * @see #unmarshal(javax.xml.stream.XMLEventReader, Class)
+ */
+ public Object unmarshal( javax.xml.stream.XMLEventReader reader )
+ throws JAXBException;
+
+ /**
+ * Unmarshal root element to JAXB mapped <tt>declaredType</tt>
+ * and return the resulting content tree.
+ *
+ * <p>
+ * This method implements <a href="unmarshalByDeclaredType">unmarshal by declaredType</a>.
+ *
+ * <p>
+ * This method assumes that the parser is on a START_DOCUMENT or
+ * START_ELEMENT event. Unmarshalling will be done from this
+ * start event to the corresponding end event. If this method
+ * returns successfully, the <tt>reader</tt> will be pointing at
+ * the token right after the end event.
+ *
+ * @param reader
+ * The parser to be read.
+ * @param declaredType
+ * appropriate JAXB mapped class to hold <tt>reader</tt>'s START_ELEMENT XML data.
+ *
+ * @return content tree rooted by <a href="#unmarshalDeclaredTypeReturn">JAXB Element representation</a>
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If any parameter is null
+ * @since JAXB2.0
+ */
+ public <T> JAXBElement<T> unmarshal( javax.xml.stream.XMLEventReader reader, Class<T> declaredType ) throws JAXBException;
+
+ /**
+ * Get an unmarshaller handler object that can be used as a component in
+ * an XML pipeline.
+ *
+ * <p>
+ * The JAXB Provider can return the same handler object for multiple
+ * invocations of this method. In other words, this method does not
+ * necessarily create a new instance of <tt>UnmarshallerHandler</tt>. If the
+ * application needs to use more than one <tt>UnmarshallerHandler</tt>, it
+ * should create more than one <tt>Unmarshaller</tt>.
+ *
+ * @return the unmarshaller handler object
+ * @see UnmarshallerHandler
+ */
+ public UnmarshallerHandler getUnmarshallerHandler();
+
+ /**
+ * Specifies whether or not the default validation mechanism of the
+ * <tt>Unmarshaller</tt> should validate during unmarshal operations.
+ * By default, the <tt>Unmarshaller</tt> does not validate.
+ * <p>
+ * This method may only be invoked before or after calling one of the
+ * unmarshal methods.
+ * <p>
+ * This method only controls the JAXB Provider's default unmarshal-time
+ * validation mechanism - it has no impact on clients that specify their
+ * own validating SAX 2.0 compliant parser. Clients that specify their
+ * own unmarshal-time validation mechanism may wish to turn off the JAXB
+ * Provider's default validation mechanism via this API to avoid "double
+ * validation".
+ * <p>
+ * This method is deprecated as of JAXB 2.0 - please use the new
+ * {@link #setSchema(javax.xml.validation.Schema)} API.
+ *
+ * @param validating true if the Unmarshaller should validate during
+ * unmarshal, false otherwise
+ * @throws JAXBException if an error occurred while enabling or disabling
+ * validation at unmarshal time
+ * @throws UnsupportedOperationException could be thrown if this method is
+ * invoked on an Unmarshaller created from a JAXBContext referencing
+ * JAXB 2.0 mapped classes
+ * @deprecated since JAXB2.0, please see {@link #setSchema(javax.xml.validation.Schema)}
+ */
+ public void setValidating( boolean validating )
+ throws JAXBException;
+
+ /**
+ * Indicates whether or not the <tt>Unmarshaller</tt> is configured to
+ * validate during unmarshal operations.
+ * <p>
+ * This API returns the state of the JAXB Provider's default unmarshal-time
+ * validation mechanism.
+ * <p>
+ * This method is deprecated as of JAXB 2.0 - please use the new
+ * {@link #getSchema()} API.
+ *
+ * @return true if the Unmarshaller is configured to validate during
+ * unmarshal operations, false otherwise
+ * @throws JAXBException if an error occurs while retrieving the validating
+ * flag
+ * @throws UnsupportedOperationException could be thrown if this method is
+ * invoked on an Unmarshaller created from a JAXBContext referencing
+ * JAXB 2.0 mapped classes
+ * @deprecated since JAXB2.0, please see {@link #getSchema()}
+ */
+ public boolean isValidating()
+ throws JAXBException;
+
+ /**
+ * Allow an application to register a <tt>ValidationEventHandler</tt>.
+ * <p>
+ * The <tt>ValidationEventHandler</tt> will be called by the JAXB Provider
+ * if any validation errors are encountered during calls to any of the
+ * unmarshal methods. If the client application does not register a
+ * <tt>ValidationEventHandler</tt> before invoking the unmarshal methods,
+ * then <tt>ValidationEvents</tt> will be handled by the default event
+ * handler which will terminate the unmarshal operation after the first
+ * error or fatal error is encountered.
+ * <p>
+ * Calling this method with a null parameter will cause the Unmarshaller
+ * to revert back to the default event handler.
+ *
+ * @param handler the validation event handler
+ * @throws JAXBException if an error was encountered while setting the
+ * event handler
+ */
+ public void setEventHandler( ValidationEventHandler handler )
+ throws JAXBException;
+
+ /**
+ * Return the current event handler or the default event handler if one
+ * hasn't been set.
+ *
+ * @return the current ValidationEventHandler or the default event handler
+ * if it hasn't been set
+ * @throws JAXBException if an error was encountered while getting the
+ * current event handler
+ */
+ public ValidationEventHandler getEventHandler()
+ throws JAXBException;
+
+ /**
+ * Set the particular property in the underlying implementation of
+ * <tt>Unmarshaller</tt>. This method can only be used to set one of
+ * the standard JAXB defined properties above or a provider specific
+ * property. Attempting to set an undefined property will result in
+ * a PropertyException being thrown. See <a href="#supportedProps">
+ * Supported Properties</a>.
+ *
+ * @param name the name of the property to be set. This value can either
+ * be specified using one of the constant fields or a user
+ * supplied string.
+ * @param value the value of the property to be set
+ *
+ * @throws PropertyException when there is an error processing the given
+ * property or value
+ * @throws IllegalArgumentException
+ * If the name parameter is null
+ */
+ public void setProperty( String name, Object value )
+ throws PropertyException;
+
+ /**
+ * Get the particular property in the underlying implementation of
+ * <tt>Unmarshaller</tt>. This method can only be used to get one of
+ * the standard JAXB defined properties above or a provider specific
+ * property. Attempting to get an undefined property will result in
+ * a PropertyException being thrown. See <a href="#supportedProps">
+ * Supported Properties</a>.
+ *
+ * @param name the name of the property to retrieve
+ * @return the value of the requested property
+ *
+ * @throws PropertyException
+ * when there is an error retrieving the given property or value
+ * property name
+ * @throws IllegalArgumentException
+ * If the name parameter is null
+ */
+ public Object getProperty( String name ) throws PropertyException;
+
+ /**
+ * Specify the JAXP 1.3 {@link javax.xml.validation.Schema Schema}
+ * object that should be used to validate subsequent unmarshal operations
+ * against. Passing null into this method will disable validation.
+ * <p>
+ * This method replaces the deprecated {@link #setValidating(boolean) setValidating(boolean)}
+ * API.
+ *
+ * <p>
+ * Initially this property is set to <tt>null</tt>.
+ *
+ * @param schema Schema object to validate unmarshal operations against or null to disable validation
+ * @throws UnsupportedOperationException could be thrown if this method is
+ * invoked on an Unmarshaller created from a JAXBContext referencing
+ * JAXB 1.0 mapped classes
+ * @since JAXB2.0
+ */
+ public void setSchema( javax.xml.validation.Schema schema );
+
+ /**
+ * Get the JAXP 1.3 {@link javax.xml.validation.Schema Schema} object
+ * being used to perform unmarshal-time validation. If there is no
+ * Schema set on the unmarshaller, then this method will return null
+ * indicating that unmarshal-time validation will not be performed.
+ * <p>
+ * This method provides replacement functionality for the deprecated
+ * {@link #isValidating()} API as well as access to the Schema object.
+ * To determine if the Unmarshaller has validation enabled, simply
+ * test the return type for null:
+ * <p>
+ * <code>
+ * boolean isValidating = u.getSchema()!=null;
+ * </code>
+ *
+ * @return the Schema object being used to perform unmarshal-time
+ * validation or null if not present
+ * @throws UnsupportedOperationException could be thrown if this method is
+ * invoked on an Unmarshaller created from a JAXBContext referencing
+ * JAXB 1.0 mapped classes
+ * @since JAXB2.0
+ */
+ public javax.xml.validation.Schema getSchema();
+
+ /**
+ * Associates a configured instance of {@link XmlAdapter} with this unmarshaller.
+ *
+ * <p>
+ * This is a convenience method that invokes <code>setAdapter(adapter.getClass(),adapter);</code>.
+ *
+ * @see #setAdapter(Class,XmlAdapter)
+ * @throws IllegalArgumentException
+ * if the adapter parameter is null.
+ * @throws UnsupportedOperationException
+ * if invoked agains a JAXB 1.0 implementation.
+ * @since JAXB2.0
+ */
+ public void setAdapter( XmlAdapter adapter );
+
+ /**
+ * Associates a configured instance of {@link XmlAdapter} with this unmarshaller.
+ *
+ * <p>
+ * Every unmarshaller internally maintains a
+ * {@link java.util.Map}<{@link Class},{@link XmlAdapter}>,
+ * which it uses for unmarshalling classes whose fields/methods are annotated
+ * with {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter}.
+ *
+ * <p>
+ * This method allows applications to use a configured instance of {@link XmlAdapter}.
+ * When an instance of an adapter is not given, an unmarshaller will create
+ * one by invoking its default constructor.
+ *
+ * @param type
+ * The type of the adapter. The specified instance will be used when
+ * {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter#value()}
+ * refers to this type.
+ * @param adapter
+ * The instance of the adapter to be used. If null, it will un-register
+ * the current adapter set for this type.
+ * @throws IllegalArgumentException
+ * if the type parameter is null.
+ * @throws UnsupportedOperationException
+ * if invoked agains a JAXB 1.0 implementation.
+ * @since JAXB2.0
+ */
+ public <A extends XmlAdapter> void setAdapter( Class<A> type, A adapter );
+
+ /**
+ * Gets the adapter associated with the specified type.
+ *
+ * This is the reverse operation of the {@link #setAdapter} method.
+ *
+ * @throws IllegalArgumentException
+ * if the type parameter is null.
+ * @throws UnsupportedOperationException
+ * if invoked agains a JAXB 1.0 implementation.
+ * @since JAXB2.0
+ */
+ public <A extends XmlAdapter> A getAdapter( Class<A> type );
+
+ /**
+ * <p>Associate a context that resolves cid's, content-id URIs, to
+ * binary data passed as attachments.</p>
+ * <p/>
+ * <p>Unmarshal time validation, enabled via {@link #setSchema(Schema)},
+ * must be supported even when unmarshaller is performing XOP processing.
+ * </p>
+ *
+ * @throws IllegalStateException if attempt to concurrently call this
+ * method during a unmarshal operation.
+ */
+ void setAttachmentUnmarshaller(AttachmentUnmarshaller au);
+
+ AttachmentUnmarshaller getAttachmentUnmarshaller();
+
+ /**
+ * <p/>
+ * Register an instance of an implementation of this class with {@link Unmarshaller} to externally listen
+ * for unmarshal events.
+ * <p/>
+ * <p/>
+ * This class enables pre and post processing of an instance of a JAXB mapped class
+ * as XML data is unmarshalled into it. The event callbacks are called when unmarshalling
+ * XML content into a JAXBElement instance or a JAXB mapped class that represents a complex type definition.
+ * The event callbacks are not called when unmarshalling to an instance of a
+ * Java datatype that represents a simple type definition.
+ * <p/>
+ * <p/>
+ * External listener is one of two different mechanisms for defining unmarshal event callbacks.
+ * See <a href="Unmarshaller.html#unmarshalEventCallback">Unmarshal Event Callbacks</a> for an overview.
+ * <p/>
+ * (@link #setListener(Listener)}
+ * (@link #getListener()}
+ *
+ * @since JAXB2.0
+ */
+ public static abstract class Listener {
+ /**
+ * <p/>
+ * Callback method invoked before unmarshalling into <tt>target</tt>.
+ * <p/>
+ * <p/>
+ * This method is invoked immediately after <tt>target</tt> was created and
+ * before the unmarshalling of this object begins. Note that
+ * if the class of <tt>target</tt> defines its own <tt>beforeUnmarshal</tt> method,
+ * the class specific callback method is invoked before this method is invoked.
+ *
+ * @param target non-null instance of JAXB mapped class prior to unmarshalling into it.
+ * @param parent instance of JAXB mapped class that will eventually reference <tt>target</tt>.
+ * <tt>null</tt> when <tt>target</tt> is root element.
+ */
+ public void beforeUnmarshal(Object target, Object parent) {
+ }
+
+ /**
+ * <p/>
+ * Callback method invoked after unmarshalling XML data into <tt>target</tt>.
+ * <p/>
+ * <p/>
+ * This method is invoked after all the properties (except IDREF) are unmarshalled into <tt>target</tt>,
+ * but before <tt>target</tt> is set into its <tt>parent</tt> object.
+ * Note that if the class of <tt>target</tt> defines its own <tt>afterUnmarshal</tt> method,
+ * the class specific callback method is invoked before this method is invoked.
+ *
+ * @param target non-null instance of JAXB mapped class prior to unmarshalling into it.
+ * @param parent instance of JAXB mapped class that will reference <tt>target</tt>.
+ * <tt>null</tt> when <tt>target</tt> is root element.
+ */
+ public void afterUnmarshal(Object target, Object parent) {
+ }
+ }
+
+ /**
+ * <p>
+ * Register unmarshal event callback {@link Listener} with this {@link Unmarshaller}.
+ *
+ * <p>
+ * There is only one Listener per Unmarshaller. Setting a Listener replaces the previous set Listener.
+ * One can unregister current Listener by setting listener to <tt>null</tt>.
+ *
+ * @param listener provides unmarshal event callbacks for this {@link Unmarshaller}
+ * @since JAXB2.0
+ */
+ public void setListener(Listener listener);
+
+ /**
+ * <p>Return {@link Listener} registered with this {@link Unmarshaller}.
+ *
+ * @return registered {@link Listener} or <code>null</code> if no Listener is registered with this Unmarshaller.
+ * @since JAXB2.0
+ */
+ public Listener getListener();
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/UnmarshallerHandler.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/UnmarshallerHandler.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/UnmarshallerHandler.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+package javax.xml.bind;
+
+import org.xml.sax.ContentHandler;
+
+/**
+ * Unmarshaller implemented as SAX ContentHandler.
+ *
+ * <p>
+ * Applications can use this interface to use their JAXB provider as a component
+ * in an XML pipeline. For example:
+ *
+ * <pre>
+ * JAXBContext context = JAXBContext.newInstance( "org.acme.foo" );
+ *
+ * Unmarshaller unmarshaller = context.createUnmarshaller();
+ *
+ * UnmarshallerHandler unmarshallerHandler = unmarshaller.getUnmarshallerHandler();
+ *
+ * SAXParserFactory spf = SAXParserFactory.newInstance();
+ * spf.setNamespaceAware( true );
+ *
+ * XMLReader xmlReader = spf.newSAXParser().getXMLReader();
+ * xmlReader.setContentHandler( unmarshallerHandler );
+ * xmlReader.parse(new InputSource( new FileInputStream( XML_FILE ) ) );
+ *
+ * MyObject myObject= (MyObject)unmarshallerHandler.getResult();
+ * </pre>
+ *
+ * <p>
+ * This interface is reusable: even if the user fails to unmarshal
+ * an object, s/he can still start a new round of unmarshalling.
+ *
+ * @author <ul><li>Kohsuke KAWAGUCHI, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $ $Date: 2006/03/08 16:55:17 $
+ * @see Unmarshaller#getUnmarshallerHandler()
+ * @since JAXB1.0
+ */
+public interface UnmarshallerHandler extends ContentHandler
+{
+ /**
+ * Obtains the unmarshalled result.
+ *
+ * This method can be called only after this handler
+ * receives the endDocument SAX event.
+ *
+ * @exception IllegalStateException
+ * if this method is called before this handler
+ * receives the endDocument event.
+ *
+ * @exception JAXBException
+ * if there is any unmarshalling error.
+ * Note that the implementation is allowed to throw SAXException
+ * during the parsing when it finds an error.
+ *
+ * @return
+ * always return a non-null valid object which was unmarshalled.
+ */
+ Object getResult() throws JAXBException, IllegalStateException;
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ValidationEvent.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ValidationEvent.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ValidationEvent.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * This event indicates that a problem was encountered while validating the
+ * incoming XML data during an unmarshal operation, while performing
+ * on-demand validation of the Java content tree, or while marshalling the
+ * Java content tree back to XML data.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $
+ * @see Validator
+ * @see ValidationEventHandler
+ * @since JAXB1.0
+ */
+public interface ValidationEvent {
+
+ /**
+ * Conditions that are not errors or fatal errors as defined by the
+ * XML 1.0 recommendation
+ */
+ public static final int WARNING = 0;
+
+ /**
+ * Conditions that correspond to the definition of "error" in section
+ * 1.2 of the W3C XML 1.0 Recommendation
+ */
+ public static final int ERROR = 1;
+
+ /**
+ * Conditions that correspond to the definition of "fatal error" in section
+ * 1.2 of the W3C XML 1.0 Recommendation
+ */
+ public static final int FATAL_ERROR = 2;
+
+ /**
+ * Retrieve the severity code for this warning/error.
+ *
+ * <p>
+ * Must be one of <tt>ValidationError.WARNING</tt>,
+ * <tt>ValidationError.ERROR</tt>, or <tt>ValidationError.FATAL_ERROR</tt>.
+ *
+ * @return the severity code for this warning/error
+ */
+ public int getSeverity();
+
+ /**
+ * Retrieve the text message for this warning/error.
+ *
+ * @return the text message for this warning/error or null if one wasn't set
+ */
+ public String getMessage();
+
+ /**
+ * Retrieve the linked exception for this warning/error.
+ *
+ * @return the linked exception for this warning/error or null if one
+ * wasn't set
+ */
+ public Throwable getLinkedException();
+
+ /**
+ * Retrieve the locator for this warning/error.
+ *
+ * @return the locator that indicates where the warning/error occurred
+ */
+ public ValidationEventLocator getLocator();
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ValidationEventHandler.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ValidationEventHandler.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ValidationEventHandler.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * A basic event handler interface for validation errors.
+ *
+ * <p>
+ * If an application needs to implement customized event handling, it must
+ * implement this interface and then register it with either the
+ * {@link Unmarshaller#setEventHandler(ValidationEventHandler) Unmarshaller},
+ * the {@link Validator#setEventHandler(ValidationEventHandler) Validator}, or
+ * the {@link Marshaller#setEventHandler(ValidationEventHandler) Marshaller}.
+ * The JAXB Provider will then report validation errors and warnings encountered
+ * during the unmarshal, marshal, and validate operations to these event
+ * handlers.
+ *
+ * <p>
+ * If the <tt>handleEvent</tt> method throws an unchecked runtime exception,
+ * the JAXB Provider must treat that as if the method returned false, effectively
+ * terminating whatever operation was in progress at the time (unmarshal,
+ * validate, or marshal).
+ *
+ * <p>
+ * Modifying the Java content tree within your event handler is undefined
+ * by the specification and may result in unexpected behaviour.
+ *
+ * <p>
+ * Failing to return false from the <tt>handleEvent</tt> method after
+ * encountering a fatal error is undefined by the specification and may result
+ * in unexpected behavior.
+ *
+ * <p>
+ * <b>Default Event Handler</b>
+ * <blockquote>
+ * See: <a href="Validator.html#defaulthandler">Validator javadocs</a>
+ * </blockquote>
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $
+ * @see Unmarshaller
+ * @see Validator
+ * @see Marshaller
+ * @see ValidationEvent
+ * @see javax.xml.bind.util.ValidationEventCollector
+ * @since JAXB1.0
+ */
+public interface ValidationEventHandler {
+ /**
+ * Receive notification of a validation warning or error.
+ *
+ * The ValidationEvent will have a
+ * {@link ValidationEventLocator ValidationEventLocator} embedded in it that
+ * indicates where the error or warning occurred.
+ *
+ * <p>
+ * If an unchecked runtime exception is thrown from this method, the JAXB
+ * provider will treat it as if the method returned false and interrupt
+ * the current unmarshal, validate, or marshal operation.
+ *
+ * @param event the encapsulated validation event information. It is a
+ * provider error if this parameter is null.
+ * @return true if the JAXB Provider should attempt to continue the current
+ * unmarshal, validate, or marshal operation after handling this
+ * warning/error, false if the provider should terminate the current
+ * operation with the appropriate <tt>UnmarshalException</tt>,
+ * <tt>ValidationException</tt>, or <tt>MarshalException</tt>.
+ * @throws IllegalArgumentException if the event object is null.
+ */
+ public boolean handleEvent( ValidationEvent event );
+
+}
+
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ValidationEventLocator.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ValidationEventLocator.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ValidationEventLocator.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * Encapsulate the location of a ValidationEvent.
+ *
+ * <p>
+ * The <tt>ValidationEventLocator</tt> indicates where the <tt>ValidationEvent
+ * </tt> occurred. Different fields will be set depending on the type of
+ * validation that was being performed when the error or warning was detected.
+ * For example, on-demand validation would produce locators that contained
+ * references to objects in the Java content tree while unmarshal-time
+ * validation would produce locators containing information appropriate to the
+ * source of the XML data (file, url, Node, etc).
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 4888 $
+ * @see Validator
+ * @see ValidationEvent
+ * @since JAXB1.0
+ */
+public interface ValidationEventLocator {
+
+ /**
+ * Return the name of the XML source as a URL if has
+ *
+ * @return the name of the XML source as a URL or null if unavailable
+ */
+ public java.net.URL getURL();
+
+ /**
+ * Return the byte offset if has
+ *
+ * @return the byte offset into the input source or -1 if unavailable
+ */
+ public int getOffset();
+
+ /**
+ * Return the line number if has
+ *
+ * @return the line number or -1 if unavailable
+ */
+ public int getLineNumber();
+
+ /**
+ * Return the column number if has
+ *
+ * @return the column number or -1 if unavailable
+ */
+ public int getColumnNumber();
+
+ /**
+ * Return a reference to the object in the Java content tree if has
+ *
+ * @return a reference to the object in the Java content tree or null if
+ * unavailable
+ */
+ public java.lang.Object getObject();
+
+ /**
+ * Return a reference to the DOM Node if has
+ *
+ * @return a reference to the DOM Node or null if unavailable
+ */
+ public org.w3c.dom.Node getNode();
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ValidationException.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ValidationException.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/ValidationException.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * This exception indicates that an error has occurred while performing
+ * a validate operation.
+ *
+ * <p>
+ * The <tt>ValidationEventHandler</tt> can cause this exception to be thrown
+ * during the validate operations. See
+ * {@link ValidationEventHandler#handleEvent(ValidationEvent)
+ * ValidationEventHandler.handleEvent(ValidationEvent)}.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $
+ * @see JAXBException
+ * @see Validator
+ * @since JAXB1.0
+ */
+public class ValidationException extends JAXBException {
+
+ /**
+ * Construct an ValidationException with the specified detail message. The
+ * errorCode and linkedException will default to null.
+ *
+ * @param message a description of the exception
+ */
+ public ValidationException(String message) {
+ this( message, null, null );
+ }
+
+ /**
+ * Construct an ValidationException with the specified detail message and vendor
+ * specific errorCode. The linkedException will default to null.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ */
+ public ValidationException(String message, String errorCode) {
+ this( message, errorCode, null );
+ }
+
+ /**
+ * Construct an ValidationException with a linkedException. The detail message and
+ * vendor specific errorCode will default to null.
+ *
+ * @param exception the linked exception
+ */
+ public ValidationException(Throwable exception) {
+ this( null, null, exception );
+ }
+
+ /**
+ * Construct an ValidationException with the specified detail message and
+ * linkedException. The errorCode will default to null.
+ *
+ * @param message a description of the exception
+ * @param exception the linked exception
+ */
+ public ValidationException(String message, Throwable exception) {
+ this( message, null, exception );
+ }
+
+ /**
+ * Construct an ValidationException with the specified detail message, vendor
+ * specific errorCode, and linkedException.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ * @param exception the linked exception
+ */
+ public ValidationException(String message, String errorCode, Throwable exception) {
+ super( message, errorCode, exception );
+ }
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Validator.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Validator.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/Validator.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,266 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * As of JAXB 2.0, this class is deprecated and optional.
+ * <p>
+ * The <tt>Validator</tt> class is responsible for controlling the validation
+ * of content trees during runtime.
+ *
+ * <p>
+ * <a name="validationtypes"></a>
+ * <b>Three Forms of Validation</b><br>
+ * <blockquote>
+ * <dl>
+ * <dt><b>Unmarshal-Time Validation</b></dt>
+ * <dd>This form of validation enables a client application to receive
+ * information about validation errors and warnings detected while
+ * unmarshalling XML data into a Java content tree and is completely
+ * orthogonal to the other types of validation. To enable or disable
+ * it, see the javadoc for
+ * {@link Unmarshaller#setValidating(boolean) Unmarshaller.setValidating}.
+ * All JAXB 1.0 Providers are required to support this operation.
+ * </dd>
+ *
+ * <dt><b>On-Demand Validation</b></dt>
+ * <dd> This form of validation enables a client application to receive
+ * information about validation errors and warnings detected in the
+ * Java content tree. At any point, client applications can call
+ * the {@link Validator#validate(Object) Validator.validate} method
+ * on the Java content tree (or any sub-tree of it). All JAXB 1.0
+ * Providers are required to support this operation.
+ * </dd>
+ *
+ * <dt><b>Fail-Fast Validation</b></dt>
+ * <dd> This form of validation enables a client application to receive
+ * immediate feedback about modifications to the Java content tree
+ * that violate type constraints on Java Properties as defined in
+ * the specification. JAXB Providers are not required support
+ * this type of validation. Of the JAXB Providers that do support
+ * this type of validation, some may require you to decide at schema
+ * compile time whether or not a client application will be allowed
+ * to request fail-fast validation at runtime.
+ * </dd>
+ * </dl>
+ * </blockquote>
+ *
+ * <p>
+ * The <tt>Validator</tt> class is responsible for managing On-Demand Validation.
+ * The <tt>Unmarshaller</tt> class is responsible for managing Unmarshal-Time
+ * Validation during the unmarshal operations. Although there is no formal
+ * method of enabling validation during the marshal operations, the
+ * <tt>Marshaller</tt> may detect errors, which will be reported to the
+ * <tt>ValidationEventHandler</tt> registered on it.
+ *
+ * <p>
+ * <a name="defaulthandler"></a>
+ * <b>Using the Default EventHandler</b><br>
+ * <blockquote>
+ * If the client application does not set an event handler on their
+ * <tt>Validator</tt>, <tt>Unmarshaller</tt>, or <tt>Marshaller</tt> prior to
+ * calling the validate, unmarshal, or marshal methods, then a default event
+ * handler will receive notification of any errors or warnings encountered.
+ * The default event handler will cause the current operation to halt after
+ * encountering the first error or fatal error (but will attempt to continue
+ * after receiving warnings).
+ * </blockquote>
+ *
+ * <p>
+ * <a name="handlingevents"></a>
+ * <b>Handling Validation Events</b><br>
+ * <blockquote>
+ * There are three ways to handle events encountered during the unmarshal,
+ * validate, and marshal operations:
+ * <dl>
+ * <dt>Use the default event handler</dt>
+ * <dd>The default event handler will be used if you do not specify one
+ * via the <tt>setEventHandler</tt> API's on <tt>Validator</tt>,
+ * <tt>Unmarshaller</tt>, or <tt>Marshaller</tt>.
+ * </dd>
+ *
+ * <dt>Implement and register a custom event handler</dt>
+ * <dd>Client applications that require sophisticated event processing
+ * can implement the <tt>ValidationEventHandler</tt> interface and
+ * register it with the <tt>Unmarshaller</tt> and/or
+ * <tt>Validator</tt>.
+ * </dd>
+ *
+ * <dt>Use the {@link javax.xml.bind.util.ValidationEventCollector ValidationEventCollector}
+ * utility</dt>
+ * <dd>For convenience, a specialized event handler is provided that
+ * simply collects any <tt>ValidationEvent</tt> objects created
+ * during the unmarshal, validate, and marshal operations and
+ * returns them to the client application as a
+ * <tt>java.util.Collection</tt>.
+ * </dd>
+ * </dl>
+ * </blockquote>
+ *
+ * <p>
+ * <b>Validation and Well-Formedness</b><br>
+ * <blockquote>
+ * <p>
+ * Validation events are handled differently depending on how the client
+ * application is configured to process them as described in the previous
+ * section. However, there are certain cases where a JAXB Provider indicates
+ * that it is no longer able to reliably detect and report errors. In these
+ * cases, the JAXB Provider will set the severity of the ValidationEvent to
+ * FATAL_ERROR to indicate that the unmarshal, validate, or marshal operations
+ * should be terminated. The default event handler and
+ * <tt>ValidationEventCollector</tt> utility class must terminate processing
+ * after being notified of a fatal error. Client applications that supply their
+ * own <tt>ValidationEventHandler</tt> should also terminate processing after
+ * being notified of a fatal error. If not, unexpected behaviour may occur.
+ * </blockquote>
+ *
+ * <p>
+ * <a name="supportedProps"></a>
+ * <b>Supported Properties</b><br>
+ * <blockquote>
+ * <p>
+ * There currently are not any properties required to be supported by all
+ * JAXB Providers on Validator. However, some providers may support
+ * their own set of provider specific properties.
+ * </blockquote>
+ *
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $ $Date: 2005/07/29 20:56:02 $
+ * @see JAXBContext
+ * @see Unmarshaller
+ * @see ValidationEventHandler
+ * @see ValidationEvent
+ * @see javax.xml.bind.util.ValidationEventCollector
+ * @since JAXB1.0
+ * @deprecated since JAXB 2.0
+ */
+public interface Validator {
+
+ /**
+ * Allow an application to register a validation event handler.
+ * <p>
+ * The validation event handler will be called by the JAXB Provider if any
+ * validation errors are encountered during calls to
+ * {@link #validate(Object) validate}. If the client application does not
+ * register a validation event handler before invoking the validate method,
+ * then validation events will be handled by the default event handler which
+ * will terminate the validate operation after the first error or fatal error
+ * is encountered.
+ * <p>
+ * Calling this method with a null parameter will cause the Validator
+ * to revert back to the default default event handler.
+ *
+ * @param handler the validation event handler
+ * @throws JAXBException if an error was encountered while setting the
+ * event handler
+ * @deprecated since JAXB2.0
+ */
+ public void setEventHandler( ValidationEventHandler handler )
+ throws JAXBException;
+
+ /**
+ * Return the current event handler or the default event handler if one
+ * hasn't been set.
+ *
+ * @return the current ValidationEventHandler or the default event handler
+ * if it hasn't been set
+ * @throws JAXBException if an error was encountered while getting the
+ * current event handler
+ * @deprecated since JAXB2.0
+ */
+ public ValidationEventHandler getEventHandler()
+ throws JAXBException;
+
+ /**
+ * Validate the Java content tree starting at <tt>subrootObj</tt>.
+ * <p>
+ * Client applications can use this method to validate Java content trees
+ * on-demand at runtime. This method can be used to validate any arbitrary
+ * subtree of the Java content tree. Global constraint checking <b>will not
+ * </b> be performed as part of this operation (i.e. ID/IDREF constraints).
+ *
+ * @param subrootObj the obj to begin validation at
+ * @throws JAXBException if any unexpected problem occurs during validation
+ * @throws ValidationException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Validator</tt> is unable to validate the content tree rooted
+ * at <tt>subrootObj</tt>
+ * @throws IllegalArgumentException
+ * If the subrootObj parameter is null
+ * @return true if the subtree rooted at <tt>subrootObj</tt> is valid, false
+ * otherwise
+ * @deprecated since JAXB2.0
+ */
+ public boolean validate( Object subrootObj ) throws JAXBException;
+
+ /**
+ * Validate the Java content tree rooted at <tt>rootObj</tt>.
+ * <p>
+ * Client applications can use this method to validate Java content trees
+ * on-demand at runtime. This method is used to validate an entire Java
+ * content tree. Global constraint checking <b>will</b> be performed as
+ * part of this operation (i.e. ID/IDREF constraints).
+ *
+ * @param rootObj the root obj to begin validation at
+ * @throws JAXBException if any unexpected problem occurs during validation
+ * @throws ValidationException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Validator</tt> is unable to validate the content tree rooted
+ * at <tt>rootObj</tt>
+ * @throws IllegalArgumentException
+ * If the rootObj parameter is null
+ * @return true if the tree rooted at <tt>rootObj</tt> is valid, false
+ * otherwise
+ * @deprecated since JAXB2.0
+ */
+ public boolean validateRoot( Object rootObj ) throws JAXBException;
+
+ /**
+ * Set the particular property in the underlying implementation of
+ * <tt>Validator</tt>. This method can only be used to set one of
+ * the standard JAXB defined properties above or a provider specific
+ * property. Attempting to set an undefined property will result in
+ * a PropertyException being thrown. See <a href="#supportedProps">
+ * Supported Properties</a>.
+ *
+ * @param name the name of the property to be set. This value can either
+ * be specified using one of the constant fields or a user
+ * supplied string.
+ * @param value the value of the property to be set
+ *
+ * @throws PropertyException when there is an error processing the given
+ * property or value
+ * @throws IllegalArgumentException
+ * If the name parameter is null
+ * @deprecated since JAXB2.0
+ */
+ public void setProperty( String name, Object value )
+ throws PropertyException;
+
+ /**
+ * Get the particular property in the underlying implementation of
+ * <tt>Validator</tt>. This method can only be used to get one of
+ * the standard JAXB defined properties above or a provider specific
+ * property. Attempting to get an undefined property will result in
+ * a PropertyException being thrown. See <a href="#supportedProps">
+ * Supported Properties</a>.
+ *
+ * @param name the name of the property to retrieve
+ * @return the value of the requested property
+ *
+ * @throws PropertyException
+ * when there is an error retrieving the given property or value
+ * property name
+ * @throws IllegalArgumentException
+ * If the name parameter is null
+ * @deprecated since JAXB2.0
+ */
+ public Object getProperty( String name ) throws PropertyException;
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/DomHandler.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/DomHandler.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/DomHandler.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.ValidationEventHandler;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+
+/**
+ * Converts an element (and its descendants)
+ * from/to DOM (or similar) representation.
+ *
+ * <p>
+ * Implementations of this interface will be used in conjunction with
+ * {@link XmlAnyElement} annotation to map an element of XML into a representation
+ * of infoset such as W3C DOM.
+ *
+ * <p>
+ * Implementations hide how a portion of XML is converted into/from such
+ * DOM-like representation, allowing JAXB providers to work with arbitrary
+ * such library.
+ *
+ * <P>
+ * This interface is intended to be implemented by library writers
+ * and consumed by JAXB providers. None of those methods are intended to
+ * be called from applications.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since JAXB2.0
+ */
+public interface DomHandler<ElementT,ResultT extends Result> {
+ /**
+ * When a JAXB provider needs to unmarshal a part of a document into an
+ * infoset representation, it first calls this method to create a
+ * {@link Result} object.
+ *
+ * <p>
+ * A JAXB provider will then send a portion of the XML
+ * into the given result. Such a portion always form a subtree
+ * of the whole XML document rooted at an element.
+ *
+ * @param errorHandler
+ * if any error happens between the invocation of this method
+ * and the invocation of {@link #getElement(Result)}, they
+ * must be reported to this handler.
+ *
+ * The caller must provide a non-null error handler.
+ *
+ * The {@link Result} object created from this method
+ * may hold a reference to this error handler.
+ *
+ * @return
+ * null if the operation fails. The error must have been reported
+ * to the error handler.
+ */
+ ResultT createUnmarshaller( ValidationEventHandler errorHandler );
+
+ /**
+ * Once the portion is sent to the {@link Result}. This method is called
+ * by a JAXB provider to obtain the unmarshalled element representation.
+ *
+ * <p>
+ * Multiple invocations of this method may return different objects.
+ * This method can be invoked only when the whole sub-tree are fed
+ * to the {@link Result} object.
+ *
+ * @param rt
+ * The {@link Result} object created by {@link #createUnmarshaller(ValidationEventHandler)}.
+ *
+ * @return
+ * null if the operation fails. The error must have been reported
+ * to the error handler.
+ */
+ ElementT getElement(ResultT rt);
+
+ /**
+ * This method is called when a JAXB provider needs to marshal an element
+ * to XML.
+ *
+ * <p>
+ * If non-null, the returned {@link Source} must contain a whole document
+ * rooted at one element, which will then be weaved into a bigger document
+ * that the JAXB provider is marshalling.
+ *
+ * @param errorHandler
+ * Receives any errors happened during the process of converting
+ * an element into a {@link Source}.
+ *
+ * The caller must provide a non-null error handler.
+ *
+ * @return
+ * null if there was an error. The error should have been reported
+ * to the handler.
+ */
+ Source marshal( ElementT n, ValidationEventHandler errorHandler );
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/W3CDomHandler.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/W3CDomHandler.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/W3CDomHandler.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import javax.xml.bind.ValidationEventHandler;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
+
+/**
+ * {@link DomHandler} implementation for W3C DOM (<code>org.w3c.dom</code> package.)
+ *
+ * @author Kohsuke Kawaguchi
+ * @since JAXB2.0
+ */
+public class W3CDomHandler implements DomHandler<Element,DOMResult> {
+
+ private DocumentBuilder builder;
+
+ /**
+ * Default constructor.
+ *
+ * It is up to a JAXB provider to decide which DOM implementation
+ * to use or how that is configured.
+ */
+ public W3CDomHandler() {
+ this.builder = null;
+ }
+
+ /**
+ * Constructor that allows applications to specify which DOM implementation
+ * to be used.
+ *
+ * @param builder
+ * must not be null. JAXB uses this {@link DocumentBuilder} to create
+ * a new element.
+ */
+ public W3CDomHandler(DocumentBuilder builder) {
+ if(builder==null)
+ throw new IllegalArgumentException();
+ this.builder = builder;
+ }
+
+ public DocumentBuilder getBuilder() {
+ return builder;
+ }
+
+ public void setBuilder(DocumentBuilder builder) {
+ this.builder = builder;
+ }
+
+ public DOMResult createUnmarshaller(ValidationEventHandler errorHandler) {
+ if(builder==null)
+ return new DOMResult();
+ else
+ return new DOMResult(builder.newDocument());
+ }
+
+ public Element getElement(DOMResult r) {
+ // JAXP spec is ambiguous about what really happens in this case,
+ // so work defensively
+ Node n = r.getNode();
+ if( n instanceof Document ) {
+ return ((Document)n).getDocumentElement();
+ }
+ if( n instanceof Element )
+ return (Element)n;
+ if( n instanceof DocumentFragment )
+ return (Element)n.getChildNodes().item(0);
+
+ // if the result object contains something strange,
+ // it is not a user problem, but it is a JAXB provider's problem.
+ // That's why we throw a runtime exception.
+ throw new IllegalStateException(n.toString());
+ }
+
+ public Source marshal(Element element, ValidationEventHandler errorHandler) {
+ return new DOMSource(element);
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAccessOrder.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAccessOrder.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAccessOrder.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+/**
+ * Used by XmlAccessorOrder to control the ordering of properties and
+ * fields in a JAXB bound class.
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since JAXB2.0
+ * @version $Revision: 2467 $
+ * @see XmlAccessorOrder
+ */
+
+public enum XmlAccessOrder {
+ /**
+ * The ordering of fields and properties in a class is undefined.
+ */
+ UNDEFINED,
+ /**
+ * The ordering of fields and properties in a class is in
+ * alphabetical order as determined by the
+ * method java.lang.String.compareTo(String anotherString).
+ */
+ ALPHABETICAL
+}
+
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAccessType.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAccessType.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAccessType.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+
+
+/**
+ * Used by XmlAccessorType to control serialization of fields or
+ * properties.
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since JAXB2.0
+ * @version $Revision: 2467 $
+ * @see XmlAccessorType
+ */
+
+public enum XmlAccessType {
+ /**
+ * Every getter/setter pair in a JAXB-bound class will be automatically
+ * bound to XML, unless annotated by {@link XmlTransient}.
+ *
+ * Fields are bound to XML only when they are explicitly annotated
+ * by some of the JAXB annotations.
+ */
+ PROPERTY,
+ /**
+ * Every non static, non transient field in a JAXB-bound class will be automatically
+ * bound to XML, unless annotated by {@link XmlTransient}.
+ *
+ * Getter/setter pairs are bound to XML only when they are explicitly annotated
+ * by some of the JAXB annotations.
+ */
+ FIELD,
+ /**
+ * Every public getter/setter pair and every public field will be
+ * automatically bound to XML, unless annotated by {@link XmlTransient}.
+ *
+ * Fields or getter/setter pairs that are private, protected, or
+ * defaulted to package-only access are bound to XML only when they are
+ * explicitly annotated by the appropriate JAXB annotations.
+ */
+ PUBLIC_MEMBER,
+ /**
+ * None of the fields or properties is bound to XML unless they
+ * are specifically annotated with some of the JAXB annotations.
+ */
+ NONE
+}
+
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAccessorOrder.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAccessorOrder.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAccessorOrder.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Inherited;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * <p> Controls the ordering of fields and properties in a class. </p>
+ *
+ * <p> <b> Usage </b> </p>
+ *
+ * <p> <tt> @XmlAccessorOrder </tt> annotation can be used with the following
+ * program elements:</p>
+ *
+ * <ul>
+ * <li> package</li>
+ * <li> a top level class </li>
+ * </ul>
+ *
+ * <p> See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p>The annotation <tt> @XmlAccessorOrder </tt> on a package applies to
+ * all classes in a package. The following inheritance semantics apply:
+ *
+ * <ul>
+ * <li> If there is a <tt>@XmlAccessorOrder</tt> on a class, then
+ * it is used. </li>
+ * <li> Otherwise, if a <tt>@XmlAccessorOrder </tt> exists on one of
+ * its super classes, then it is inherited.
+ * <li> Otherwise, the <tt>@XmlAccessorOrder </tt> on a package is
+ * inherited.
+ * </ul>
+ * <p> <b> Defaulting Rules: </b> </p>
+ *
+ * <p>By default, if <tt>@XmlAccessorOrder </tt> on a package is absent,
+ * then the following package level annotation is assumed.</p>
+ *<pre>
+ * @XmlAccessorType(XmlAccessOrder.UNDEFINED)
+ *</pre>
+ * <p> By default, if <tt>@XmlAccessorOrder</tt> on a class is absent
+ * and none of super classes is annotated with <tt> XmlAccessorOrder
+ * </tt>, then the following default on the class is assumed: </p>
+ *<pre>
+ * @XmlAccessorType(XmlAccessOrder.UNDEFINED)
+ *</pre>
+ * <p>This annotation can be used with the following annotations:
+ * {@link XmlType}, {@link XmlRootElement}, {@link XmlAccessorType},
+ * {@link XmlSchema}, {@link XmlSchemaType}, {@link XmlSchemaTypes},
+ * , {@link XmlJavaTypeAdapter}. It can also be used with the
+ * following annotations at the package level: {@link XmlJavaTypeAdapter}.
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since JAXB2.0
+ * @version $Revision: 2467 $
+ * @see XmlAccessOrder
+ */
+
+ at Inherited @Retention(RUNTIME) @Target({PACKAGE, TYPE})
+public @interface XmlAccessorOrder {
+ XmlAccessOrder value() default XmlAccessOrder.UNDEFINED;
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Inherited;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * <p> Controls whether fields or Javabean properties are serialized by default. </p>
+ *
+ * <p> <b> Usage </b> </p>
+ *
+ * <p> <tt>@XmlAccessorType</tt> annotation can be used with the following program elements:</p>
+ *
+ * <ul>
+ * <li> package</li>
+ * <li> a top level class </li>
+ * </ul>
+ *
+ * <p> See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p>This annotation provides control over the default serialization
+ * of properties and fields in a class.
+ *
+ * <p>The annotation <tt> @XmlAccessorType </tt> on a package applies to
+ * all classes in the package. The following inheritance
+ * semantics apply:
+ *
+ * <ul>
+ * <li> If there is a <tt>@XmlAccessorType</tt> on a class, then it
+ * is used. </li>
+ * <li> Otherwise, if a <tt>@XmlAccessorType</tt> exists on one of
+ * its super classes, then it is inherited.
+ * <li> Otherwise, the <tt>@XmlAccessorType </tt> on a package is
+ * inherited.
+ * </ul>
+ * <p> <b> Defaulting Rules: </b> </p>
+ *
+ * <p>By default, if <tt>@XmlAccessorType </tt> on a package is absent,
+ * then the following package level annotation is assumed.</p>
+ * <pre>
+ * @XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
+ * </pre>
+ * <p> By default, if <tt>@XmlAccessorType</tt> on a class is absent,
+ * and none of its super classes is annotated with
+ * <tt>@XmlAccessorType</tt>, then the following default on the class
+ * is assumed: </p>
+ * <pre>
+ * @XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
+ * </pre>
+ * <p>This annotation can be used with the following annotations:
+ * {@link XmlType}, {@link XmlRootElement}, {@link XmlAccessorOrder},
+ * {@link XmlSchema}, {@link XmlSchemaType}, {@link XmlSchemaTypes},
+ * , {@link XmlJavaTypeAdapter}. It can also be used with the
+ * following annotations at the package level: {@link XmlJavaTypeAdapter}.
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since JAXB2.0
+ * @see XmlAccessType
+ * @version $Revision: 2467 $
+ */
+
+ at Inherited @Retention(RUNTIME) @Target({PACKAGE, TYPE})
+public @interface XmlAccessorType {
+
+ /**
+ * Specifies whether fields or properties are serialized.
+ *
+ * @see XmlAccessType
+ */
+ XmlAccessType value() default XmlAccessType.PUBLIC_MEMBER;
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.namespace.QName;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import java.util.Map;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+
+/**
+ * <p>
+ * Maps a JavaBean property to a map of wildcard attributes.
+ *
+ * <p> <b>Usage</b> </p>
+ * <p>
+ * The <tt>@XmlAnyAttribute</tt> annotation can be used with the
+ * following program elements:
+ * <ul>
+ * <li> JavaBean property </li>
+ * <li> non static, non transient field </li>
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * The usage is subject to the following constraints:
+ * <ul>
+ * <li> At most one field or property in a class can be annotated
+ * with <tt>@XmlAnyAttribute</tt>. </li>
+ * <li> The type of the property or the field must <tt>java.util.Map</tt> </li>
+ * </ul>
+ *
+ * <p>
+ * While processing attributes to be unmarshalled into a value class,
+ * each attribute that is not statically associated with another
+ * JavaBean property, via {@link XmlAttribute}, is entered into the
+ * wildcard attribute map represented by
+ * {@link Map}<{@link QName},{@link Object}>. The attribute QName is the
+ * map's key. The key's value is the String value of the attribute.
+ *
+ * @author Kohsuke Kawaguchi, Sun Microsystems, Inc.
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME)
+ at Target({FIELD,METHOD})
+public @interface XmlAnyAttribute {
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,270 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import org.w3c.dom.Element;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import javax.xml.bind.annotation.*;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import java.util.List;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Maps a JavaBean property to XML infoset representation and/or JAXB element.
+ *
+ * <p>
+ * This annotation serves as a "catch-all" property while unmarshalling
+ * xml content into a instance of a JAXB annotated class. It typically
+ * annotates a multi-valued JavaBean property, but it can occur on
+ * single value JavaBean property. During unmarshalling, each xml element
+ * that does not match a static @XmlElement or @XmlElementRef
+ * annotation for the other JavaBean properties on the class, is added to this
+ * "catch-all" property.
+ *
+ * <p>
+ * <h2>Usages:</h2>
+ * <pre>
+ * @XmlAnyElement
+ * public {@link Element}[] others;
+ *
+ * // Collection of {@link Element} or JAXB elements.
+ * @XmlAnyElement(lax="true")
+ * public {@link Object}[] others;
+ *
+ * @XmlAnyElement
+ * private List<{@link Element}> nodes;
+ *
+ * @XmlAnyElement
+ * private {@link Element} node;
+ * </pre>
+ *
+ * <h2>Restriction usage constraints</h2>
+ * <p>
+ * This annotation is mutually exclusive with
+ * {@link XmlElement}, {@link XmlAttribute}, {@link XmlValue},
+ * {@link XmlElements}, {@link XmlID}, and {@link XmlIDREF}.
+ *
+ * <p>
+ * There can be only one {@link XmlAnyElement} annotated JavaBean property
+ * in a class and its super classes.
+ *
+ * <h2>Relationship to other annotations</h2>
+ * <p>
+ * This annotation can be used with {@link XmlJavaTypeAdapter}, so that users
+ * can map their own data structure to DOM, which in turn can be composed
+ * into XML.
+ *
+ * <p>
+ * This annotation can be used with {@link XmlMixed} like this:
+ * <pre>
+ * // List of java.lang.String or DOM nodes.
+ * @XmlAnyElement @XmlMixed
+ * List<Object> others;
+ * </pre>
+ *
+ *
+ * <h2>Schema To Java example</h2>
+ *
+ * The following schema would produce the following Java class:
+ * <pre><xmp>
+ * <xs:complexType name="foo">
+ * <xs:sequence>
+ * <xs:element name="a" type="xs:int" />
+ * <xs:element name="b" type="xs:int" />
+ * <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ * </xs:sequence>
+ * </xs:complexType>
+ * </xmp></pre>
+ *
+ * <pre>
+ * class Foo {
+ * int a;
+ * int b;
+ * @{@link XmlAnyElement}
+ * List<Element> any;
+ * }
+ * </pre>
+ *
+ * It can unmarshal instances like
+ *
+ * <pre><xmp>
+ * <foo xmlns:e="extra">
+ * <a>1</a>
+ * <e:other /> // this will be bound to DOM, because unmarshalling is orderless
+ * <b>3</b>
+ * <e:other />
+ * <c>5</c> // this will be bound to DOM, because the annotation doesn't remember namespaces.
+ * </foo>
+ * </xmp></pre>
+ *
+ *
+ *
+ * The following schema would produce the following Java class:
+ * <pre><xmp>
+ * <xs:complexType name="bar">
+ * <xs:complexContent>
+ * <xs:extension base="foo">
+ * <xs:sequence>
+ * <xs:element name="c" type="xs:int" />
+ * <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ * </xs:sequence>
+ * </xs:extension>
+ * </xs:complexType>
+ * </xmp></pre>
+ *
+ * <pre><xmp>
+ * class Bar extends Foo {
+ * int c;
+ * // Foo.getAny() also represents wildcard content for type definition bar.
+ * }
+ * </xmp></pre>
+ *
+ *
+ * It can unmarshal instances like
+ *
+ * <pre><xmp>
+ * <bar xmlns:e="extra">
+ * <a>1</a>
+ * <e:other /> // this will be bound to DOM, because unmarshalling is orderless
+ * <b>3</b>
+ * <e:other />
+ * <c>5</c> // this now goes to Bar.c
+ * <e:other /> // this will go to Foo.any
+ * </bar>
+ * </xmp></pre>
+ *
+ *
+ *
+ *
+ * <h2>Using {@link XmlAnyElement} with {@link XmlElementRef}</h2>
+ * <p>
+ * The {@link XmlAnyElement} annotation can be used with {@link XmlElementRef}s to
+ * designate additional elements that can participate in the content tree.
+ *
+ * <p>
+ * The following schema would produce the following Java class:
+ * <pre><xmp>
+ * <xs:complexType name="foo">
+ * <xs:choice maxOccurs="unbounded" minOccurs="0">
+ * <xs:element name="a" type="xs:int" />
+ * <xs:element name="b" type="xs:int" />
+ * <xs:any namespace="##other" processContents="lax" />
+ * </xs:choice>
+ * </xs:complexType>
+ * </xmp></pre>
+ *
+ * <pre>
+ * class Foo {
+ * @{@link XmlAnyElement}(lax="true")
+ * @{@link XmlElementRefs}({
+ * @{@link XmlElementRef}(name="a", type="JAXBElement.class")
+ * @{@link XmlElementRef}(name="b", type="JAXBElement.class")
+ * })
+ * {@link List}<{@link Object}> others;
+ * }
+ *
+ * @XmlRegistry
+ * class ObjectFactory {
+ * ...
+ * @XmlElementDecl(name = "a", namespace = "", scope = Foo.class)
+ * {@link JAXBElement}<Integer> createFooA( Integer i ) { ... }
+ *
+ * @XmlElementDecl(name = "b", namespace = "", scope = Foo.class)
+ * {@link JAXBElement}<Integer> createFooB( Integer i ) { ... }
+ * </pre>
+ *
+ * It can unmarshal instances like
+ *
+ * <pre><xmp>
+ * <foo xmlns:e="extra">
+ * <a>1</a> // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
+ * <e:other /> // this will unmarshal to a DOM {@link Element}.
+ * <b>3</b> // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
+ * </foo>
+ * </xmp></pre>
+ *
+ *
+ *
+ *
+ * <h2>W3C XML Schema "lax" wildcard emulation</h2>
+ * The lax element of the annotation enables the emulation of the "lax" wildcard semantics.
+ * For example, when the Java source code is annotated like this:
+ * <pre>
+ * @{@link XmlRootElement}
+ * class Foo {
+ * @XmlAnyElement(lax=true)
+ * public {@link Object}[] others;
+ * }
+ * </pre>
+ * then the following document will unmarshal like this:
+ * <pre><xmp>
+ * <foo>
+ * <unknown />
+ * <foo />
+ * </foo>
+ *
+ * Foo foo = unmarshal();
+ * // 1 for 'unknown', another for 'foo'
+ * assert foo.others.length==2;
+ * // 'unknown' unmarshals to a DOM element
+ * assert foo.others[0] instanceof Element;
+ * // because of lax=true, the 'foo' element eagerly
+ * // unmarshals to a Foo object.
+ * assert foo.others[1] instanceof Foo;
+ * </xmp></pre>
+ *
+ *
+ * @author Kohsuke Kawaguchi
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME)
+ at Target({FIELD,METHOD})
+public @interface XmlAnyElement {
+
+ /**
+ * Controls the unmarshaller behavior when it sees elements
+ * known to the current {@link JAXBContext}.
+ *
+ * <h3>When false</h3>
+ * <p>
+ * If false, all the elements that match the property will be unmarshalled
+ * to DOM, and the property will only contain DOM elements.
+ *
+ * <h3>When true</h3>
+ * <p>
+ * If true, when an element matches a property marked with {@link XmlAnyElement}
+ * is known to {@link JAXBContext} (for example, there's a class with
+ * {@link XmlRootElement} that has the same tag name, or there's
+ * {@link XmlElementDecl} that has the same tag name),
+ * the unmarshaller will eagerly unmarshal this element to the JAXB object,
+ * instead of unmarshalling it to DOM. Additionally, if the element is
+ * unknown but it has a known xsi:type, the unmarshaller eagerly unmarshals
+ * the element to a {@link JAXBElement}, with the unknown element name and
+ * the JAXBElement value is set to an instance of the JAXB mapping of the
+ * known xsi:type.
+ *
+ * <p>
+ * As a result, after the unmarshalling, the property can become heterogeneous;
+ * it can have both DOM nodes and some JAXB objects at the same time.
+ *
+ * <p>
+ * This can be used to emulate the "lax" wildcard semantics of the W3C XML Schema.
+ */
+ boolean lax() default false;
+
+ /**
+ * Specifies the {@link DomHandler} which is responsible for actually
+ * converting XML from/to a DOM-like data structure.
+ */
+ Class<? extends DomHandler> value() default W3CDomHandler.class;
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+
+package javax.xml.bind.annotation;
+
+import javax.activation.DataHandler;
+import static java.lang.annotation.ElementType.*;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Marks a field/property that its XML form is a uri reference to mime content.
+ * The mime content is optimally stored out-of-line as an attachment.
+ *
+ * A field/property must always map to the {@link DataHandler} class.
+ *
+ * <h2>Usage</h2>
+ * <pre>
+ * @{@link XmlRootElement}
+ * class Foo {
+ * @{@link XmlAttachmentRef}
+ * @{@link XmlAttribute}
+ * {@link DataHandler} data;
+ *
+ * @{@link XmlAttachmentRef}
+ * @{@link XmlElement}
+ * {@link DataHandler} body;
+ * }
+ * </pre>
+ * The above code maps to the following XML:
+ * <pre><xmp>
+ * <xs:element name="foo" xmlns:ref="http://ws-i.org/profiles/basic/1.1/xsd">
+ * <xs:complexType>
+ * <xs:sequence>
+ * <xs:element name="body" type="ref:swaRef" minOccurs="0" />
+ * </xs:sequence>
+ * <xs:attribute name="data" type="ref:swaRef" use="optional" />
+ * </xs:complexType>
+ * </xs:element>
+ * </xmp></pre>
+ *
+ * <p>
+ * The above binding supports WS-I AP 1.0 <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html#Referencing_Attachments_from_the_SOAP_Envelope">WS-I Attachments Profile Version 1.0.</a>
+ *
+ * @author Kohsuke Kawaguchi
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME)
+ at Target({FIELD,METHOD,PARAMETER})
+public @interface XmlAttachmentRef {
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAttribute.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAttribute.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlAttribute.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,133 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * <p>
+ * Maps a JavaBean property to a XML attribute.
+ *
+ * <p> <b>Usage</b> </p>
+ * <p>
+ * The <tt>@XmlAttribute</tt> annotation can be used with the
+ * following program elements:
+ * <ul>
+ * <li> JavaBean property </li>
+ * <li> field </li>
+ * </ul>
+ *
+ * <p> A static final field is mapped to a XML fixed attribute.
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * The usage is subject to the following constraints:
+ * <ul>
+ * <li> If type of the field or the property is a collection
+ * type, then the collection item type must be mapped to schema
+ * simple type.
+ * <pre>
+ * // Examples
+ * @XmlAttribute List<Integer> items; //legal
+ * @XmlAttribute List<Bar> foo; // illegal if Bar does not map to a schema simple type
+ * </pre>
+ * </li>
+ * <li> If the type of the field or the property is a non
+ * collection type, then the type of the property or field
+ * must map to a simple schema type.
+ * <pre>
+ * // Examples
+ * @XmlAttribute int foo; // legal
+ * @XmlAttribute Foo foo; // illegal if Foo does not map to a schema simple type
+ * </pre>
+ * </li>
+ * <li> This annotation can be used with the following annotations:
+ * {@link XmlID},
+ * {@link XmlIDREF},
+ * {@link XmlList},
+ * {@link XmlSchemaType},
+ * {@link XmlValue},
+ * {@link XmlAttachmentRef},
+ * {@link XmlMimeType},
+ * {@link XmlInlineBinaryData},
+ * {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter}</li>.
+ * </ul>
+ * </p>
+ *
+ * <p> <b>Example 1: </b>Map a JavaBean property to an XML attribute.</p>
+ * <pre>
+ * //Example: Code fragment
+ * public class USPrice {
+ * @XmlAttribute
+ * public java.math.BigDecimal getPrice() {...} ;
+ * public void setPrice(java.math.BigDecimal ) {...};
+ * }
+ *
+ * <!-- Example: XML Schema fragment -->
+ * <xs:complexType name="USPrice">
+ * <xs:sequence>
+ * </xs:sequence>
+ * <xs:attribute name="price" type="xs:decimal"/>
+ * </xs:complexType>
+ * </pre>
+ *
+ * <p> <b>Example 2: </b>Map a JavaBean property to an XML attribute with anonymous type.</p>
+ * See Example 7 in @{@link XmlType}.
+ *
+ * <p> <b>Example 3: </b>Map a JavaBean collection property to an XML attribute.</p>
+ * <pre>
+ * // Example: Code fragment
+ * class Foo {
+ * ...
+ * @XmlAttribute List<Integer> items;
+ * }
+ *
+ * <!-- Example: XML Schema fragment -->
+ * <xs:complexType name="foo">
+ * ...
+ * <xs:attribute name="items">
+ * <xs:simpleType>
+ * <xs:list itemType="xs:int"/>
+ * </xs:simpleType>
+ * </xs:complexType>
+ *
+ * </pre>
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @version $Revision: 2467 $
+ * @see XmlType
+ * @since JAXB2.0
+ */
+
+ at Retention(RUNTIME) @Target({FIELD, METHOD})
+public @interface XmlAttribute {
+ /**
+ * Name of the XML Schema attribute. By default, the XML Schema
+ * attribute name is derived from the JavaBean property name.
+ *
+ */
+ String name() default "##default";
+
+ /**
+ * Specifies if the XML Schema attribute is optional or
+ * required. If true, then the JavaBean property is mapped to a
+ * XML Schema attribute that is required. Otherwise it is mapped
+ * to a XML Schema attribute that is optional.
+ *
+ */
+ boolean required() default false;
+
+ /**
+ * Specifies the XML target namespace of the XML Schema
+ * attribute.
+ *
+ */
+ String namespace() default "##default" ;
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElement.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElement.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElement.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,192 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * Maps a JavaBean property to a XML element derived from property name.
+ *
+ * <p> <b>Usage</b> </p>
+ * <p>
+ * </tt>@XmlElement</tt> annotation can be used with the following program
+ * elements:
+ * <ul>
+ * <li> a JavaBean property </li>
+ * <li> non static, non transient field </li>
+ * <li> within {@link XmlElements}
+ * <p>
+ *
+ * </ul>
+ *
+ * The usage is subject to the following constraints:
+ * <ul>
+ * <li> This annotation can be used with following annotations:
+ * {@link XmlID},
+ * {@link XmlIDREF},
+ * {@link XmlList},
+ * {@link XmlSchemaType},
+ * {@link XmlValue},
+ * {@link XmlAttachmentRef},
+ * {@link XmlMimeType},
+ * {@link XmlInlineBinaryData},
+ * {@link XmlElementWrapper},
+ * {@link XmlJavaTypeAdapter}</li>
+ * <li> if the type of JavaBean property is a collection type of
+ * array, an indexed property, or a parameterized list, and
+ * this annotation is used with {@link XmlElements} then,
+ * <tt>@XmlElement.type()</tt> must be DEFAULT.class since the
+ * collection item type is already known. </li>
+ * </ul>
+ *
+ * <p>
+ * A JavaBean property, when annotated with @XmlElement annotation
+ * is mapped to a local element in the XML Schema complex type to
+ * which the containing class is mapped.
+ *
+ * <p>
+ * <b>Example 1: </b> Map a public non static non final field to local
+ * element
+ * <pre>
+ * //Example: Code fragment
+ * public class USPrice {
+ * @XmlElement(name="itemprice")
+ * public java.math.BigDecimal price;
+ * }
+ *
+ * <!-- Example: Local XML Schema element -->
+ * <xs:complexType name="USPrice"/>
+ * <xs:sequence>
+ * <xs:element name="itemprice" type="xs:decimal" minOccurs="0"/>
+ * </sequence>
+ * </xs:complexType>
+ * </pre>
+ * <p>
+ *
+ * <b> Example 2: </b> Map a field to a nillable element.
+ * <pre>
+ *
+ * //Example: Code fragment
+ * public class USPrice {
+ * @XmlElement(nillable=true)
+ * public java.math.BigDecimal price;
+ * }
+ *
+ * <!-- Example: Local XML Schema element -->
+ * <xs:complexType name="USPrice">
+ * <xs:sequence>
+ * <xs:element name="price" type="xs:decimal" nillable="true" minOccurs="0"/>
+ * </sequence>
+ * </xs:complexType>
+ * </pre>
+ * <p>
+ * <b> Example 3: </b> Map a field to a nillable, required element.
+ * <pre>
+ *
+ * //Example: Code fragment
+ * public class USPrice {
+ * @XmlElement(nillable=true, required=true)
+ * public java.math.BigDecimal price;
+ * }
+ *
+ * <!-- Example: Local XML Schema element -->
+ * <xs:complexType name="USPrice">
+ * <xs:sequence>
+ * <xs:element name="price" type="xs:decimal" nillable="true" minOccurs="1"/>
+ * </sequence>
+ * </xs:complexType>
+ * </pre>
+ * <p>
+ *
+ * <p> <b>Example 4: </b>Map a JavaBean property to an XML element
+ * with anonymous type.</p>
+ * <p>
+ * See Example 6 in @{@link XmlType}.
+ *
+ * <p>
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since JAXB2.0
+ * @version $Revision: 2467 $
+ */
+
+ at Retention(RUNTIME) @Target({FIELD, METHOD})
+public @interface XmlElement {
+ /**
+ * Name of the XML Schema element.
+ * <p> If the value is "##default", then element name is derived from the
+ * JavaBean property name.
+ */
+ String name() default "##default";
+
+ /**
+ * Customize the element declaration to be nillable.
+ * <p>If nillable() is true, then the JavaBean property is
+ * mapped to a XML Schema nillable element declaration.
+ */
+ boolean nillable() default false;
+
+ /**
+ * Customize the element declaration to be required.
+ * <p>If required() is true, then Javabean property is mapped to
+ * an XML schema element declaration with minOccurs="1".
+ * maxOccurs is "1" for a single valued property and "unbounded"
+ * for a multivalued property.
+ * <p>If required() is false, then the Javabean property is mapped
+ * to XML Schema element declaration with minOccurs="0".
+ * maxOccurs is "1" for a single valued property and "unbounded"
+ * for a multivalued property.
+ */
+
+ boolean required() default false;
+
+ /**
+ * XML target namespace of the XML Schema element.
+ * <p>
+ * If the value is "##default", then the namespace is determined
+ * as follows:
+ * <ol>
+ * <li>
+ * If the enclosing package has {@link XmlSchema} annotation,
+ * and its {@link XmlSchema#elementFormDefault() elementFormDefault}
+ * is {@link XmlNsForm#QUALIFIED QUALIFIED}, then the namespace of
+ * the enclosing class.
+ *
+ * <li>
+ * Otherwise "" (which produces unqualified element in the default
+ * namespace.
+ * </ol>
+ */
+ String namespace() default "##default";
+
+ /**
+ * Default value of this element.
+ *
+ * <p>
+ * The '\u0000' value specified as a default of this annotation element
+ * is used as a poor-man's substitute for null to allow implementations
+ * to recognize the 'no default value' state.
+ */
+ String defaultValue() default "\u0000";
+
+ /**
+ * The Java class being referenced.
+ */
+ Class type() default DEFAULT.class;
+
+ /**
+ * Used in {@link XmlElement#type()} to
+ * signal that the type be inferred from the signature
+ * of the property.
+ */
+ static final class DEFAULT {}
+}
+
+
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,196 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.METHOD;
+
+/**
+ * Maps a factory method to a XML element.
+ *
+ * <p> <b>Usage</b> </p>
+ *
+ * The annotation creates a mapping between an XML schema element
+ * declaration and a <i> element factory method </i> that returns a
+ * JAXBElement instance representing the element
+ * declaration. Typically, the element factory method is generated
+ * (and annotated) from a schema into the ObjectFactory class in a
+ * Java package that represents the binding of the element
+ * declaration's target namespace. Thus, while the annotation syntax
+ * allows @XmlElementDecl to be used on any method, semantically
+ * its use is restricted to annotation of element factory method.
+ *
+ * The usage is subject to the following constraints:
+ *
+ * <ul>
+ * <li> The class containing the element factory method annotated
+ * with @XmlElementDecl must be marked with {@link
+ * XmlRegistry}. </li>
+ * <li> The element factory method must take one parameter
+ * assignable to {@link Object}.</li>
+ * </ul>
+ *
+ * <p><b>Example 1: </b>Annotation on a factory method
+ * <pre>
+ * // Example: code fragment
+ * @XmlRegistry
+ * class ObjectFactory {
+ * @XmlElementDecl(name="foo")
+ * JAXBElement<String> createFoo(String s) { ... }
+ * }
+ * </pre>
+ * <pre><xmp>
+ * <!-- XML input -->
+ * <foo>string</foo>
+ *
+ * // Example: code fragment corresponding to XML input
+ * JAXBElement<String> o =
+ * (JAXBElement<String>)unmarshaller.unmarshal(aboveDocument);
+ * // print JAXBElement instance to show values
+ * System.out.println(o.getName()); // prints "{}foo"
+ * System.out.println(o.getValue()); // prints "string"
+ * System.out.println(o.getValue().getClass()); // prints "java.lang.String"
+ *
+ * <!-- Example: XML schema definition -->
+ * <xs:element name="foo" type="xs:string"/>
+ * </xmp></pre>
+ *
+ * <p><b>Example 2: </b> Element declaration with non local scope
+ * <p>
+ * The following example illustrates the use of scope annotation
+ * parameter in binding of element declaration in schema derived
+ * code.
+ * <p>
+ * The following example may be replaced in a future revision of
+ * this javadoc.
+ *
+ * <pre><xmp>
+ * <!-- Example: XML schema definition -->
+ * <xs:schema>
+ * <xs:complexType name="pea">
+ * <xs:choice maxOccurs="unbounded">
+ * <xs:element name="foo" type="xs:string"/>
+ * <xs:element name="bar" type="xs:string"/>
+ * </xs:choice>
+ * </xs:complexType>
+ * <xs:element name="foo" type="xs:int"/>
+ * </xs:schema>
+ * </xmp></pre>
+ * <pre>
+ * // Example: expected default binding
+ * class Pea {
+ * @XmlElementRefs({
+ * @XmlElementRef(name="foo",type=JAXBElement.class)
+ * @XmlElementRef(name="bar",type=JAXBElement.class)
+ * })
+ * List<JAXBElement<String>> fooOrBar;
+ * }
+ *
+ * @XmlRegistry
+ * class ObjectFactory {
+ * @XmlElementDecl(scope=Pea.class,name="foo")
+ * JAXBElement<String> createPeaFoo(String s);
+ *
+ * @XmlElementDecl(scope=Pea.class,name="bar")
+ * JAXBElement<String> createPeaBar(String s);
+ *
+ * @XmlElementDecl(name="foo")
+ * JAXBElement<Integer> createFoo(Integer i);
+ * }
+ *
+ * </pre>
+ * Without scope createFoo and createPeaFoo would become ambiguous
+ * since both of them map to a XML schema element with the same local
+ * name "foo".
+ *
+ * @see XmlRegistry
+ * @since JAXB 2.0
+ */
+ at Retention(RUNTIME)
+ at Target({METHOD})
+public @interface XmlElementDecl {
+ /**
+ * scope of the mapping.
+ *
+ * <p>
+ * If this is not {@link XmlElementDecl.GLOBAL}, then this element
+ * declaration mapping is only active within the specified class.
+ */
+ Class scope() default GLOBAL.class;
+
+ /**
+ * namespace name of the XML element.
+ * <p>
+ * If the value is "##default", then the value is the namespace
+ * name for the package of the class containing this factory method.
+ *
+ * @see #name()
+ */
+ String namespace() default "##default";
+
+ /**
+ * local name of the XML element.
+ *
+ * <p>
+ * <b> Note to reviewers: </b> There is no default name; since
+ * the annotation is on a factory method, it is not clear that the
+ * method name can be derived from the factory method name.
+ * @see #namespace()
+ */
+ String name();
+
+ /**
+ * namespace name of a substitution group's head XML element.
+ * <p>
+ * This specifies the namespace name of the XML element whose local
+ * name is specified by <tt>substitutionHeadName()</tt>.
+ * <p>
+ * If <tt>susbtitutionHeadName()</tt> is "", then this
+ * value can only be "##default". But the value is ignored since
+ * since this element is not part of susbtitution group when the
+ * value of <tt>susbstitutionHeadName()</tt> is "".
+ * <p>
+ * If <tt>susbtitutionHeadName()</tt> is not "" and the value is
+ * "##default", then the namespace name is the namespace name to
+ * which the package of the containing class, marked with {@link
+ * XmlRegistry }, is mapped.
+ * <p>
+ * If <tt>susbtitutionHeadName()</tt> is not "" and the value is
+ * not "##default", then the value is the namespace name.
+ *
+ * @see #substitutionHeadName()
+ */
+ String substitutionHeadNamespace() default "##default";
+
+ /**
+ * XML local name of a substitution group's head element.
+ * <p>
+ * If the value is "", then this element is not part of any
+ * substitution group.
+ *
+ * @see #substitutionHeadNamespace()
+ */
+ String substitutionHeadName() default "";
+
+ /**
+ * Default value of this element.
+ *
+ * <p>
+ * The '\u0000' value specified as a default of this annotation element
+ * is used as a poor-man's substitute for null to allow implementations
+ * to recognize the 'no default value' state.
+ */
+ String defaultValue() default "\u0000";
+
+ /**
+ * Used in {@link XmlElementDecl#scope()} to
+ * signal that the declaration is in the global scope.
+ */
+ public final class GLOBAL {}
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElementRef.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElementRef.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElementRef.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,248 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+
+/**
+ * <p>
+ * Maps a JavaBean property to a XML element derived from property's type.
+ * <p>
+ * <b>Usage</b>
+ * <p>
+ * <tt>@XmlElementRef</tt> annotation can be used with a
+ * JavaBean property or from within {@link XmlElementRefs}
+ * <p>
+ * This annotation dynamically associates an XML element name with the JavaBean
+ * property. When a JavaBean property is annotated with {@link
+ * XmlElement}, the XML element name is statically derived from the
+ * JavaBean property name. However, when this annotation is used, the
+ * XML element name is derived from the instance of the type of the
+ * JavaBean property at runtime.
+ *
+ * <h3> XML Schema substitution group support </h3>
+ * XML Schema allows a XML document author to use XML element names
+ * that were not statically specified in the content model of a
+ * schema using substitution groups. Schema derived code provides
+ * support for substitution groups using an <i>element property</i>,
+ * (section 5.5.5, "Element Property" of JAXB 2.0 specification). An
+ * element property method signature is of the form:
+ * <pre><xmp>
+ * public void setTerm(JAXBElement<? extends Operator>);
+ * public JAXBElement<? extends Operator> getTerm();
+ * </xmp></pre>
+ * <p>
+ * An element factory method annotated with {@link XmlElementDecl} is
+ * used to create a <tt>JAXBElement</tt> instance, containing an XML
+ * element name. The presence of @XmlElementRef annotation on an
+ * element property indicates that the element name from <tt>JAXBElement</tt>
+ * instance be used instead of deriving an XML element name from the
+ * JavaBean property name.
+ *
+ * <p>
+ * The usage is subject to the following constraints:
+ * <ul>
+ * <li> If the collection item type (for collection property) or
+ * property type (for single valued property) is
+ * {@link javax.xml.bind.JAXBElement}, then
+ * <tt>@XmlElementRef}.name()</tt> and <tt>@XmlElementRef.namespace()</tt> must
+ * point an element factory method with an @XmlElementDecl
+ * annotation in a class annotated with @XmlRegistry (usually
+ * ObjectFactory class generated by the schema compiler) :
+ * <ul>
+ * <li> @XmlElementDecl.name() must equal @XmlElementRef.name() </li>
+ * <li> @XmlElementDecl.namespace() must equal @XmlElementRef.namespace(). </li>
+ * </ul>
+ * </li>
+ * <li> If the collection item type (for collection property) or
+ * property type (for single valued property) is not
+ * {@link javax.xml.bind.JAXBElement}, then the type referenced by the
+ * property or field must be annotated with {@link XmlRootElement}. </li>
+ * <li> This annotation can be used with the following annotations:
+ * {@link XmlElementWrapper}, {@link XmlJavaTypeAdapter}.
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p><b>Example 1: </b>Ant Task Example</b></p>
+ * The following Java class hierarchy models an Ant build
+ * script. An Ant task corresponds to a class in the class
+ * hierarchy. The XML element name of an Ant task is indicated by the
+ * @XmlRootElement annotation on its corresponding class.
+ * <pre>
+ * @XmlRootElement(name="target")
+ * class Target {
+ * // The presence of @XmlElementRef indicates that the XML
+ * // element name will be derived from the @XmlRootElement
+ * // annotation on the type (for e.g. "jar" for JarTask).
+ * @XmlElementRef
+ * List<Task> tasks;
+ * }
+ *
+ * abstract class Task {
+ * }
+ *
+ * @XmlRootElement(name="jar")
+ * class JarTask extends Task {
+ * ...
+ * }
+ *
+ * @XmlRootElement(name="javac")
+ * class JavacTask extends Task {
+ * ...
+ * }
+ *
+ * <!-- XML Schema fragment -->
+ * <xs:element name="target" type="Target">
+ * <xs:complexType name="Target">
+ * <xs:sequence>
+ * <xs:choice maxOccurs="unbounded">
+ * <xs:element ref="jar">
+ * <xs:element ref="javac">
+ * </xs:choice>
+ * </xs:sequence>
+ * </xs:complexType>
+ *
+ * </pre>
+ * <p>
+ * Thus the following code fragment:
+ * <pre>
+ * Target target = new Target();
+ * target.tasks.add(new JarTask());
+ * target.tasks.add(new JavacTask());
+ * marshal(target);
+ * </pre>
+ * will produce the following XML output:
+ * <pre><xmp>
+ * <target>
+ * <jar>
+ * ....
+ * </jar>
+ * <javac>
+ * ....
+ * </javac>
+ * </target>
+ * </xmp></pre>
+ * <p>
+ * It is not an error to have a class that extends <tt>Task</tt>
+ * that doesn't have {@link XmlRootElement}. But they can't show up in an
+ * XML instance (because they don't have XML element names).
+ *
+ * <p><b>Example 2: XML Schema Susbstitution group support</b>
+ * <p> The following example shows the annotations for XML Schema
+ * substitution groups. The annotations and the ObjectFactory are
+ * derived from the schema.
+ *
+ * <pre>
+ * @XmlElement
+ * class Math {
+ * // The value of {@link #type()}is
+ * // JAXBElement.class , which indicates the XML
+ * // element name ObjectFactory - in general a class marked
+ * // with @XmlRegistry. (See ObjectFactory below)
+ * //
+ * // The {@link #name()} is "operator", a pointer to a
+ * // factory method annotated with a
+ * // {@link XmlElementDecl} with the name "operator". Since
+ * // "operator" is the head of a substitution group that
+ * // contains elements "add" and "sub" elements, "operator"
+ * // element can be substituted in an instance document by
+ * // elements "add" or "sub". At runtime, JAXBElement
+ * // instance contains the element name that has been
+ * // substituted in the XML document.
+ * //
+ * @XmlElementRef(type=JAXBElement.class,name="operator")
+ * JAXBElement<? extends Operator> term;
+ * }
+ *
+ * @XmlRegistry
+ * class ObjectFactory {
+ * @XmlElementDecl(name="operator")
+ * JAXBElement<Operator> createOperator(Operator o) {...}
+ * @XmlElementDecl(name="add",substitutionHeadName="operator")
+ * JAXBElement<Operator> createAdd(Operator o) {...}
+ * @XmlElementDecl(name="sub",substitutionHeadName="operator")
+ * JAXBElement<Operator> createSub(Operator o) {...}
+ * }
+ *
+ * class Operator {
+ * ...
+ * }
+ * </pre>
+ * <p>
+ * Thus, the following code fragment
+ * <pre>
+ * Math m = new Math();
+ * m.term = new ObjectFactory().createAdd(new Operator());
+ * marshal(m);
+ * </pre>
+ * will produce the following XML output:
+ * <pre>
+ * <math>
+ * <add>...</add>
+ * </math>
+ * </pre>
+ *
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems,Inc. </li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ * @see XmlElementRefs
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME)
+ at Target({FIELD,METHOD})
+public @interface XmlElementRef {
+ /**
+ * The Java type being referenced.
+ * <p>
+ * If the value is DEFAULT.class, the type is inferred from the
+ * the type of the JavaBean property.
+ */
+ Class type() default DEFAULT.class;
+
+ /**
+ * This parameter and {@link #name()} are used to determine the
+ * XML element for the JavaBean property.
+ *
+ * <p> If <tt>type()</tt> is <tt>JAXBElement.class</tt> , then
+ * <tt>namespace()</tt> and <tt>name()</tt>
+ * point to a factory method with {@link XmlElementDecl}. The XML
+ * element name is the element name from the factory method's
+ * {@link XmlElementDecl} annotation or if an element from its
+ * substitution group (of which it is a head element) has been
+ * substituted in the XML document, then the element name is from the
+ * {@link XmlElementDecl} on the substituted element.
+ *
+ * <p> If {@link #type()} is not <tt>JAXBElement.class</tt>, then
+ * the XML element name is the XML element name statically
+ * associated with the type using the annotation {@link
+ * XmlRootElement} on the type. If the type is not annotated with
+ * an {@link XmlElementDecl}, then it is an error.
+ *
+ * <p> If <tt>type()</tt> is not <tt>JAXBElement.class</tt>, then
+ * this value must be "".
+ *
+ */
+ String namespace() default "";
+ /**
+ *
+ * @see #namespace()
+ */
+ String name() default "##default";
+
+ /**
+ * Used in {@link XmlElementRef#type()} to
+ * signal that the type be inferred from the signature
+ * of the property.
+ */
+ static final class DEFAULT {}
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElementRefs.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElementRefs.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElementRefs.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Marks a property that refers to classes with {@link XmlElement}
+ * or JAXBElement.
+ *
+ * <p>
+ * Compared to an element property (property with {@link XmlElement}
+ * annotation), a reference property has a different substitution semantics.
+ * When a sub-class is assigned to a property, an element property produces
+ * the same tag name with @xsi:type, whereas a reference property produces
+ * a different tag name (the tag name that's on the the sub-class.)
+ *
+ * <p> This annotation can be used with the following annotations:
+ * {@link XmlJavaTypeAdapter}, {@link XmlElementWrapper}.
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ *
+ * @see XmlElementWrapper
+ * @see XmlElementRef
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME)
+ at Target({FIELD,METHOD})
+public @interface XmlElementRefs {
+ XmlElementRef[] value();
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElementWrapper.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElementWrapper.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElementWrapper.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,102 @@
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Generates a wrapper element around XML representation.
+ *
+ * This is primarily intended to be used to produce a wrapper
+ * XML element around collections. The annotation therefore supports
+ * two forms of serialization shown below.
+ *
+ * <pre>
+ * //Example: code fragment
+ * int[] names;
+ *
+ * // XML Serialization Form 1 (Unwrapped collection)
+ * <names> ... </names>
+ * <names> ... </names>
+ *
+ * // XML Serialization Form 2 ( Wrapped collection )
+ * <wrapperElement>
+ * <names> value-of-item </names>
+ * <names> value-of-item </names>
+ * ....
+ * </wrapperElement>
+ * </pre>
+ *
+ * <p> The two serialized XML forms allow a null collection to be
+ * represented either by absence or presence of an element with a
+ * nillable attribute.
+ *
+ * <p> <b>Usage</b> </p>
+ * <p>
+ * The <tt>@XmlElementWrapper</tt> annotation can be used with the
+ * following program elements:
+ * <ul>
+ * <li> JavaBean property </li>
+ * <li> non static, non transient field </li>
+ * </ul>
+ *
+ * <p>The usage is subject to the following constraints:
+ * <ul>
+ * <li> The property must be a collection property </li>
+ * <li> This annotation can be used with the following annotations:
+ * {@link XmlElement},
+ * {@link XmlElements},
+ * {@link XmlElementRef},
+ * {@link XmlElementRefs},
+ * {@link XmlJavaTypeAdapter}</li>.
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ * @see XmlElement
+ * @see XmlElements
+ * @see XmlElementRef
+ * @see XmlElementRefs
+ * @since JAXB2.0
+ *
+ */
+
+ at Retention(RUNTIME) @Target({FIELD, METHOD})
+public @interface XmlElementWrapper {
+ /**
+ * Name of the XML wrapper element. By default, the XML wrapper
+ * element name is derived from the JavaBean property name.
+ */
+ String name() default "##default";
+
+ /**
+ * XML target namespace of the XML wrapper element.
+ * <p>
+ * If the value is "##default", then the namespace is determined
+ * as follows:
+ * <ol>
+ * <li>
+ * If the enclosing package has {@link XmlSchema} annotation,
+ * and its {@link XmlSchema#elementFormDefault() elementFormDefault}
+ * is {@link XmlNsForm#QUALIFIED QUALIFIED}, then the namespace of
+ * the enclosing class.
+ *
+ * <li>
+ * Otherwise "" (which produces unqualified element in the default
+ * namespace.
+ * </ol>
+ */
+ String namespace() default "##default";
+
+ /**
+ * If true, the absence of the collection is represented by
+ * using <tt>xsi:nil='true'</tt>. Otherwise, it is represented by
+ * the absence of the element.
+ */
+ boolean nillable() default false;
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElements.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElements.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlElements.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,157 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * <p>
+ * A container for multiple @{@link XmlElement} annotations.
+ *
+ * Multiple annotations of the same type are not allowed on a program
+ * element. This annotation therefore serves as a container annotation
+ * for multiple @XmlElements as follows:
+ *
+ * <pre>
+ * @XmlElements({ @XmlElement(...), at XmlElement(...) })
+ * </pre>
+ *
+ * <p>The <tt>@XmlElements</tt> annnotation can be used with the
+ * following program elements: </p>
+ * <ul>
+ * <li> a JavaBean property </li>
+ * <li> non static, non transient field </li>
+ * </ul>
+ *
+ * This annotation is intended for annotation a JavaBean collection
+ * property (e.g. List).
+ *
+ * <p><b>Usage</b></p>
+ *
+ * <p>The usage is subject to the following constraints:
+ * <ul>
+ * <li> This annotation can be used with the following
+ * annotations: @{@link XmlIDREF}, @{@link XmlElementWrapper}. </li>
+ * <li> If @XmlIDREF is also specified on the JavaBean property,
+ * then each @XmlElement.type() must contain a JavaBean
+ * property annotated with <tt>@XmlID</tt>.</li>
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <hr>
+ *
+ * <p><b>Example 1:</b> Map to a list of elements</p>
+ * <pre>
+ *
+ * // Mapped code fragment
+ * public class Foo {
+ * @XmlElements(
+ * @XmlElement(name="A", type=Integer.class),
+ * @XmlElement(name="B", type=Float.class)
+ * }
+ * public List items;
+ * }
+ *
+ * <!-- XML Representation for a List of {1,2.5}
+ * XML output is not wrapped using another element -->
+ * ...
+ * <A> 1 </A>
+ * <B> 2.5 </B>
+ * ...
+ *
+ * <!-- XML Schema fragment -->
+ * <xs:complexType name="Foo">
+ * <xs:sequence>
+ * <xs:choice minOccurs="0" maxOccurs="unbounded">
+ * <xs:element name="A" type="xs:int"/>
+ * <xs:element name="B" type="xs:float"/>
+ * <xs:choice>
+ * </xs:sequence>
+ * </xs:complexType>
+ *
+ * </pre>
+ *
+ * <p><b>Example 2:</b> Map to a list of elements wrapped with another element
+ * </p>
+ * <pre>
+ *
+ * // Mapped code fragment
+ * public class Foo {
+ * @XmlElementWrapper(name="bar")
+ * @XmlElements(
+ * @XmlElement(name="A", type=Integer.class),
+ * @XmlElement(name="B", type=Float.class)
+ * }
+ * public List items;
+ * }
+ *
+ * <!-- XML Schema fragment -->
+ * <xs:complexType name="Foo">
+ * <xs:sequence>
+ * <xs:element name="bar">
+ * <xs:complexType>
+ * <xs:choice minOccurs="0" maxOccurs="unbounded">
+ * <xs:element name="A" type="xs:int"/>
+ * <xs:element name="B" type="xs:float"/>
+ * </xs:choice>
+ * </xs:complexType>
+ * </xs:element>
+ * </xs:sequence>
+ * </xs:complexType>
+ * </pre>
+ *
+ * <p><b>Example 3:</b> Change element name based on type using an adapter.
+ * </p>
+ * <pre>
+ * class Foo {
+ * @XmlJavaTypeAdapter(QtoPAdapter.class)
+ * @XmlElements({
+ * @XmlElement(name="A",type=PX.class),
+ * @XmlElement(name="B",type=PY.class)
+ * })
+ * Q bar;
+ * }
+ *
+ * @XmlType abstract class P {...}
+ * @XmlType(name="PX") class PX extends P {...}
+ * @XmlType(name="PY") class PY extends P {...}
+ *
+ * <!-- XML Schema fragment -->
+ * <xs:complexType name="Foo">
+ * <xs:sequence>
+ * <xs:element name="bar">
+ * <xs:complexType>
+ * <xs:choice minOccurs="0" maxOccurs="unbounded">
+ * <xs:element name="A" type="PX"/>
+ * <xs:element name="B" type="PY"/>
+ * </xs:choice>
+ * </xs:complexType>
+ * </xs:element>
+ * </xs:sequence>
+ * </xs:complexType>
+ * </pre>
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ * @see XmlElement
+ * @see XmlElementRef
+ * @see XmlElementRefs
+ * @see XmlJavaTypeAdapter
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME) @Target({FIELD,METHOD})
+public @interface XmlElements {
+ /**
+ * Collection of @{@link XmlElement} annotations
+ */
+ XmlElement[] value();
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlEnum.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlEnum.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlEnum.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * <p>
+ * Maps an enum type {@link Enum} to XML representation.
+ *
+ * <p>This annotation, together with {@link XmlEnumValue} provides a
+ * mapping of enum type to XML representation.
+ *
+ * <p> <b>Usage</b> </p>
+ * <p>
+ * The <tt>@XmlEnum</tt> annotation can be used with the
+ * following program elements:
+ * <ul>
+ * <li>enum type</li>
+ * </ul>
+ *
+ * <p> The usage is subject to the following constraints:
+ * <ul>
+ * <li> This annotation can be used the following other annotations:
+ * {@link XmlType},
+ * {@link XmlRootElement} </li>
+ * </ul>
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information </p>
+ *
+ * <p>An enum type is mapped to a schema simple type with enumeration
+ * facets. The schema type is derived from the Java type to which
+ * <tt>@XmlEnum.value()</tt>. Each enum constant <tt>@XmlEnumValue</tt>
+ * must have a valid lexical representation for the type
+ * <tt>@XmlEnum.value()</tt> .
+ *
+ * <p><b>Examples:</b> See examples in {@link XmlEnumValue}
+ *
+ * @since JAXB2.0
+ */
+
+ at Retention(RUNTIME) @Target({TYPE})
+public @interface XmlEnum {
+ /**
+ * Java type that is mapped to a XML simple type.
+ *
+ */
+ Class<?> value() default String.class;
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+
+/**
+ * Maps an enum constant in {@link Enum} type to XML representation.
+ *
+ * <p> <b>Usage</b> </p>
+ *
+ * <p> The <tt>@XmlEnumValue</tt> annotation can be used with the
+ * following program elements:
+ * <ul>
+ * <li>enum constant</li>
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p>This annotation, together with {@link XmlEnum} provides a
+ * mapping of enum type to XML representation.
+ *
+ * <p>An enum type is mapped to a schema simple type with enumeration
+ * facets. The schema type is derived from the Java type specified in
+ * <tt>@XmlEnum.value()</tt>. Each enum constant <tt>@XmlEnumValue</tt>
+ * must have a valid lexical representation for the type
+ * <tt>@XmlEnum.value()</tt>
+ *
+ * <p> In the absence of this annotation, {@link Enum#name()} is used
+ * as the XML representation.
+ *
+ * <p> <b>Example 1: </b>Map enum constant name -> enumeration facet</p>
+ * <pre>
+ * //Example: Code fragment
+ * @XmlEnum(String.class)
+ * public enum Card { CLUBS, DIAMONDS, HEARTS, SPADES }
+ *
+ * <!-- Example: XML Schema fragment -->
+ * <xs:simpleType name="Card">
+ * <xs:restriction base="xs:string"/>
+ * <xs:enumeration value="CLUBS"/>
+ * <xs:enumeration value="DIAMONDS"/>
+ * <xs:enumeration value="HEARTS"/>
+ * <xs:enumeration value="SPADES"/>
+ * </xs:simpleType>
+ * </pre>
+ *
+ * <p><b>Example 2: </b>Map enum constant name(value) -> enumeration facet </p>
+ * <pre>
+ * //Example: code fragment
+ * @XmlType
+ * @XmlEnum(Integer.class)
+ * public enum Coin {
+ * @XmlEnumValue("1") PENNY(1),
+ * @XmlEnumValue("5") NICKEL(5),
+ * @XmlEnumValue("10") DIME(10),
+ * @XmlEnumValue("25") QUARTER(25) }
+ *
+ * <!-- Example: XML Schema fragment -->
+ * <xs:simpleType name="Coin">
+ * <xs:restriction base="xs:int">
+ * <xs:enumeration value="1"/>
+ * <xs:enumeration value="5"/>
+ * <xs:enumeration value="10"/>
+ * <xs:enumeration value="25"/>
+ * </xs:restriction>
+ * </xs:simpleType>
+ * </pre>
+ *
+ * <p><b>Example 3: </b>Map enum constant name -> enumeration facet </p>
+ *
+ * <pre>
+ * //Code fragment
+ * @XmlType
+ * @XmlEnum(Integer.class)
+ * public enum Code {
+ * @XmlEnumValue("1") ONE,
+ * @XmlEnumValue("2") TWO;
+ * }
+ *
+ * <!-- Example: XML Schema fragment -->
+ * <xs:simpleType name="Code">
+ * <xs:restriction base="xs:int">
+ * <xs:enumeration value="1"/>
+ * <xs:enumeration value="2"/>
+ * </xs:restriction>
+ * </xs:simpleType>
+ * </pre>
+ *
+ * @since JAXB 2.0
+ */
+ at Retention(RUNTIME)
+ at Target({FIELD})
+public @interface XmlEnumValue {
+ String value();
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlID.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlID.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlID.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * <p>
+ * Maps a JavaBean property to XML ID.
+ *
+ * <p>
+ * To preserve referential integrity of an object graph across XML
+ * serialization followed by a XML deserialization, requires an object
+ * reference to be marshalled by reference or containment
+ * appropriately. Annotations <tt>@XmlID</tt> and <tt>@XmlIDREF</tt>
+ * together allow a customized mapping of a JavaBean property's
+ * type by containment or reference.
+ *
+ * <p><b>Usage</b> </p>
+ * The <tt>@XmlID</tt> annotation can be used with the following
+ * program elements:
+ * <ul>
+ * <li> a JavaBean property </li>
+ * <li> non static, non transient field </li>
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * The usage is subject to the following constraints:
+ * <ul>
+ * <li> At most one field or property in a class can be annotated
+ * with <tt>@XmlID</tt>. </li>
+ * <li> The JavaBean property's type must be <tt>java.lang.String</tt>.</li>
+ * <li> The only other mapping annotations that can be used
+ * with <tt>@XmlID</tt>
+ * are:<tt>@XmlElement</tt> and <tt>@XmlAttribute</tt>.</li>
+ * </ul>
+ *
+ * <p><b>Example</b>: Map a JavaBean property's type to <tt>xs:ID</tt></p>
+ * <pre>
+ * // Example: code fragment
+ * public class Customer {
+ * @XmlAttribute
+ * @XmlID
+ * public String getCustomerID();
+ * public void setCustomerID(String id);
+ * .... other properties not shown
+ * }
+ *
+ * <!-- Example: XML Schema fragment -->
+ * <xs:complexType name="Customer">
+ * <xs:complexContent>
+ * <xs:sequence>
+ * ....
+ * </xs:sequence>
+ * <xs:attribute name="customerID" type="xs:ID"/>
+ * </xs:complexContent>
+ * </xs:complexType>
+ * </pre>
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @see XmlIDREF
+ * @since JAXB2.0
+ * @version $Revision: 2467 $
+ */
+
+ at Retention(RUNTIME) @Target({FIELD, METHOD})
+public @interface XmlID { }
+
+
+
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlIDREF.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlIDREF.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlIDREF.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,231 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * <p>
+ * Maps a JavaBean property to XML IDREF.
+ *
+ * <p>
+ * To preserve referential integrity of an object graph across XML
+ * serialization followed by a XML deserialization, requires an object
+ * reference to be marshalled by reference or containment
+ * appropriately. Annotations <tt>@XmlID</tt> and <tt>@XmlIDREF</tt>
+ * together allow a customized mapping of a JavaBean property's
+ * type by containment or reference.
+ *
+ * <p><b>Usage</b> </p>
+ * The <tt>@XmlIDREF</tt> annotation can be used with the following
+ * program elements:
+ * <ul>
+ * <li> a JavaBean property </li>
+ * <li> non static, non transient field </li>
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p> The usage is subject to the following constraints:
+ * <ul>
+ *
+ * <li> If the type of the field or property is a collection type,
+ * then the collection item type must contain a property or
+ * field annotated with <tt>@XmlID</tt>. </li>
+ * <li> If the field or property is single valued, then the type of
+ * the property or field must contain a property or field
+ * annotated with <tt>@XmlID</tt>.
+ * <p>Note: If the collection item type or the type of the
+ * property (for non collection type) is java.lang.Object, then
+ * the instance must contain a property/field annotated with
+ * <tt>@XmlID</tt> attribute.
+ * </li>
+ * <li> This annotation can be used with the following annotations:
+ * {@link XmlElement}, {@link XmlAttribute}, {@link XmlList},
+ * and {@link XmlElements}.</li>
+ *
+ * </ul>
+ * <p><b>Example:</b> Map a JavaBean property to <tt>xs:IDREF</tt>
+ * (i.e. by reference rather than by containment)</p>
+ * <pre>
+ *
+ * //EXAMPLE: Code fragment
+ * public class Shipping {
+ * @XmlIDREF public Customer getCustomer();
+ * public void setCustomer(Customer customer);
+ * ....
+ * }
+ *
+ * <!-- Example: XML Schema fragment -->
+ * <xs:complexType name="Shipping">
+ * <xs:complexContent>
+ * <xs:sequence>
+ * <xs:element name="customer" type="xs:IDREF"/>
+ * ....
+ * </xs:sequence>
+ * </xs:complexContent>
+ * </xs:complexType>
+ *
+ * </pre>
+ *
+ *
+ * <p><b>Example 2: </b> The following is a complete example of
+ * containment versus reference.
+ *
+ * <pre>
+ * // By default, Customer maps to complex type <tt>xs:Customer</tt>
+ * public class Customer {
+ *
+ * // map JavaBean property type to <tt>xs:ID</tt>
+ * @XmlID public String getCustomerID();
+ * public void setCustomerID(String id);
+ *
+ * // .... other properties not shown
+ * }
+ *
+ *
+ * // By default, Invoice maps to a complex type <tt>xs:Invoice</tt>
+ * public class Invoice {
+ *
+ * // map by reference
+ * @XmlIDREF public Customer getCustomer();
+ * public void setCustomer(Customer customer);
+ *
+ * // .... other properties not shown here
+ * }
+ *
+ * // By default, Shipping maps to complex type <tt>xs:Shipping</tt>
+ * public class Shipping {
+ *
+ * // map by reference
+ * @XmlIDREF public Customer getCustomer();
+ * public void setCustomer(Customer customer);
+ * }
+ *
+ * // at least one class must reference Customer by containment;
+ * // Customer instances won't be marshalled.
+ * @XmlElement(name="CustomerData")
+ * public class CustomerData {
+ * // map reference to Customer by containment by default.
+ * public Customer getCustomer();
+ *
+ * // maps reference to Shipping by containment by default.
+ * public Shipping getShipping();
+ *
+ * // maps reference to Invoice by containment by default.
+ * public Invoice getInvoice();
+ * }
+ *
+ * <!-- XML Schema mapping for above code frament -->
+ *
+ * <xs:complexType name="Invoice">
+ * <xs:complexContent>
+ * <xs:sequence>
+ * <xs:element name="customer" type="xs:IDREF"/>
+ * ....
+ * </xs:sequence>
+ * </xs:complexContent>
+ * </xs:complexType>
+ *
+ * <xs:complexType name="Shipping">
+ * <xs:complexContent>
+ * <xs:sequence>
+ * <xs:element name="customer" type="xs:IDREF"/>
+ * ....
+ * </xs:sequence>
+ * </xs:complexContent>
+ * </xs:complexType>
+ *
+ * <xs:complexType name="Customer">
+ * <xs:complexContent>
+ * <xs:sequence>
+ * ....
+ * </xs:sequence>
+ * <xs:attribute name="CustomerID" type="xs:ID"/>
+ * </xs:complexContent>
+ * </xs:complexType>
+ *
+ * <xs:complexType name="CustomerData">
+ * <xs:complexContent>
+ * <xs:sequence>
+ * <xs:element name="customer" type="xs:Customer"/>
+ * <xs:element name="shipping" type="xs:Shipping"/>
+ * <xs:element name="invoice" type="xs:Invoice"/>
+ * </xs:sequence>
+ * </xs:complexContent>
+ * </xs:complexType>
+ *
+ * <xs:element name"customerData" type="xs:CustomerData"/>
+ *
+ * <!-- Instance document conforming to the above XML Schema -->
+ * <customerData>
+ * <customer customerID="Alice">
+ * ....
+ * </customer>
+ *
+ * <shipping customer="Alice">
+ * ....
+ * </shipping>
+ *
+ * <invoice customer="Alice">
+ * ....
+ * </invoice>
+ * </customerData>
+ *
+ * </pre>
+ *
+ * <p><b>Example 3: </b> Mapping List to repeating element of type IDREF
+ * <pre>
+ * // Code fragment
+ * public class Shipping {
+ * @XmlIDREF
+ * @XmlElement(name="Alice")
+ * public List customers;
+ * }
+ *
+ * <!-- XML schema fragment -->
+ * <xs:complexType name="Shipping">
+ * <xs:sequence>
+ * <xs:choice minOccurs="0" maxOccurs="unbounded">
+ * <xs:element name="Alice" type="xs:IDREF"/>
+ * </xs:choice>
+ * </xs:sequence>
+ * </xs:complexType>
+ * </pre>
+ *
+ * <p><b>Example 4: </b> Mapping a List to a list of elements of type IDREF.
+ * <pre>
+ * //Code fragment
+ * public class Shipping {
+ * @XmlIDREF
+ * @XmlElements(
+ * @XmlElement(name="Alice", type="Customer.class")
+ * @XmlElement(name="John", type="InternationalCustomer.class")
+ * public List customers;
+ * }
+ *
+ * <!-- XML Schema fragment -->
+ * <xs:complexType name="Shipping">
+ * <xs:sequence>
+ * <xs:choice minOccurs="0" maxOccurs="unbounded">
+ * <xs:element name="Alice" type="xs:IDREF"/>
+ * <xs:element name="John" type="xs:IDREF"/>
+ * </xs:choice>
+ * </xs:sequence>
+ * </xs:complexType>
+ * </pre>
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @see XmlID
+ * @since JAXB2.0
+ * @version $Revision: 2467 $
+ */
+
+ at Retention(RUNTIME) @Target({FIELD, METHOD})
+public @interface XmlIDREF {}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlInlineBinaryData.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlInlineBinaryData.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlInlineBinaryData.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import java.awt.*;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+
+import javax.xml.transform.Source;
+import javax.xml.bind.attachment.AttachmentMarshaller;
+import javax.activation.DataHandler;
+
+/**
+ * Disable consideration of XOP encoding for datatypes that are bound to
+ * base64-encoded binary data in XML.
+ *
+ * <p>
+ * When XOP encoding is enabled as described in {@link AttachmentMarshaller#isXOPPackage()}, this annotation disables datatypes such as {@link Image} or {@link Source} or <tt>byte[]</tt> that are bound to base64-encoded binary from being considered for
+ * XOP encoding. If a JAXB property is annotated with this annotation or if
+ * the JAXB property's base type is annotated with this annotation,
+ * neither
+ * {@link AttachmentMarshaller#addMtomAttachment(DataHandler, String, String)}
+ * nor
+ * {@link AttachmentMarshaller#addMtomAttachment(byte[], int, int, String, String, String)} is
+ * ever called for the property. The binary data will always be inlined.
+ *
+ * @author Joseph Fialli
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME)
+ at Target({FIELD,METHOD,TYPE})
+public @interface XmlInlineBinaryData {
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlList.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlList.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlList.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,86 @@
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+
+/**
+ * Used to map a property to a list simple type.
+ *
+ * <p><b>Usage</b> </p>
+ * <p>
+ * The <tt>@XmlList</tt> annotation can be used with the
+ * following program elements:
+ * <ul>
+ * <li> JavaBean property </li>
+ * <li> field </li>
+ * </ul>
+ *
+ * <p>
+ * When a collection property is annotated just with @XmlElement,
+ * each item in the collection will be wrapped by an element.
+ * For example,
+ *
+ * <pre>
+ * @XmlRootElement
+ * class Foo {
+ * @XmlElement
+ * List<String> data;
+ * }
+ * </pre>
+ *
+ * would produce XML like this:
+ *
+ * <pre><xmp>
+ * <foo>
+ * <data>abc</data>
+ * <data>def</data>
+ * </foo>
+ * </xmp></pre>
+ *
+ * @XmlList annotation, on the other hand, allows multiple values to be
+ * represented as whitespace-separated tokens in a single element. For example,
+ *
+ * <pre>
+ * @XmlRootElement
+ * class Foo {
+ * @XmlElement
+ * @XmlList
+ * List<String> data;
+ * }
+ * </pre>
+ *
+ * the above code will produce XML like this:
+ *
+ * <pre><xmp>
+ * <foo>
+ * <data>abc def</data>
+ * </foo>
+ * </xmp></pre>
+ *
+ * <p>This annotation can be used with the following annotations:
+ * {@link XmlElement},
+ * {@link XmlAttribute},
+ * {@link XmlValue},
+ * {@link XmlIDREF}.
+ * <ul>
+ * <li> The use of <tt>@XmlList</tt> with {@link XmlValue} while
+ * allowed, is redundant since {@link XmlList} maps a
+ * collection type to a simple schema type that derives by
+ * list just as {@link XmlValue} would. </li>
+ *
+ * <li> The use of <tt>@XmlList</tt> with {@link XmlAttribute} while
+ * allowed, is redundant since {@link XmlList} maps a
+ * collection type to a simple schema type that derives by
+ * list just as {@link XmlAttribute} would. </li>
+ * </ul>
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME) @Target({FIELD,METHOD,PARAMETER})
+public @interface XmlList {
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlMimeType.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlMimeType.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlMimeType.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import java.awt.*;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+
+import javax.xml.transform.Source;
+
+/**
+ * Associates the MIME type that controls the XML representation of the property.
+ *
+ * <p>
+ * This annotation is used in conjunction with datatypes such as
+ * {@link Image} or {@link Source} that are bound to base64-encoded binary in XML.
+ *
+ * <p>
+ * If a property that has this annotation has a sibling property bound to
+ * the xmime:contentType attribute, and if in the instance the property has a value,
+ * the value of the attribute takes precedence and that will control the marshalling.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME)
+ at Target({FIELD,METHOD,PARAMETER})
+public @interface XmlMimeType {
+ /**
+ * The textual representation of the MIME type,
+ * such as "image/jpeg" "image/*", "text/xml; charset=iso-8859-1" and so on.
+ */
+ String value();
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlMixed.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlMixed.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlMixed.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+
+import org.w3c.dom.Element;
+import javax.xml.bind.JAXBElement;
+
+/**
+ * <p>
+ * Annotate a JavaBean multi-valued property to support mixed content.
+ *
+ * <p>
+ * The usage is subject to the following constraints:
+ * <ul>
+ * <li> can be used with @XmlElementRef, @XmlElementRefs or @XmlAnyElement</li>
+ * </ul>
+ * <p>
+ * The following can be inserted into @XmlMixed annotated multi-valued property
+ * <ul>
+ * <li>XML text information items are added as values of java.lang.String.</li>
+ * <li>Children element information items are added as instances of
+ * {@link JAXBElement} or instances with a class that is annotated with
+ * @XmlRootElement.</li>
+ * <li>Unknown content that is not be bound to a JAXB mapped class is inserted
+ * as {@link Element}. (Assumes property annotated with @XmlAnyElement)</li>
+ * </ul>
+ *
+ * Below is an example of binding and creation of mixed content.
+ * <pre><xmp>
+ * <!-- schema fragment having mixed content -->
+ * <xs:complexType name="letterBody" mixed="true">
+ * <xs:sequence>
+ * <xs:element name="name" type="xs:string"/>
+ * <xs:element name="quantity" type="xs:positiveInteger"/>
+ * <xs:element name="productName" type="xs:string"/>
+ * <!-- etc. -->
+ * </xs:sequence>
+ * </xs:complexType>
+ * <xs:element name="letterBody" type="letterBody"/>
+ *
+ * // Schema-derived Java code:
+ * // (Only annotations relevant to mixed content are shown below,
+ * // others are ommitted.)
+ * import java.math.BigInteger;
+ * public class ObjectFactory {
+ * // element instance factories
+ * JAXBElement<LetterBody> createLetterBody(LetterBody value);
+ * JAXBElement<String> createLetterBodyName(String value);
+ * JAXBElement<BigInteger> createLetterBodyQuantity(BigInteger value);
+ * JAXBElement<String> createLetterBodyProductName(String value);
+ * // type instance factory
+ * LetterBody> createLetterBody();
+ * }
+ * </xmp></pre>
+ * <pre>
+ * public class LetterBody {
+ * // Mixed content can contain instances of Element classes
+ * // Name, Quantity and ProductName. Text data is represented as
+ * // java.util.String for text.
+ * @XmlMixed
+ * @XmlElementRefs({
+ * @XmlElementRef(name="productName", type=JAXBElement.class),
+ * @XmlElementRef(name="quantity", type=JAXBElement.class),
+ * @XmlElementRef(name="name", type=JAXBElement.class)})
+ * List getContent(){...}
+ * }
+ * </pre>
+ * The following is an XML instance document with mixed content
+ * <pre><xmp>
+ * <letterBody>
+ * Dear Mr.<name>Robert Smith</name>
+ * Your order of <quantity>1</quantity> <productName>Baby
+ * Monitor</productName> shipped from our warehouse. ....
+ * </letterBody>
+ * </xmp></pre>
+ * that can be constructed using following JAXB API calls.
+ * <pre><xmp>
+ * LetterBody lb = ObjectFactory.createLetterBody();
+ * JAXBElement<LetterBody> lbe = ObjectFactory.createLetterBody(lb);
+ * List gcl = lb.getContent(); //add mixed content to general content property.
+ * gcl.add("Dear Mr."); // add text information item as a String.
+ *
+ * // add child element information item
+ * gcl.add(ObjectFactory.createLetterBodyName("Robert Smith"));
+ * gcl.add("Your order of "); // add text information item as a String
+ *
+ * // add children element information items
+ * gcl.add(ObjectFactory.
+ * createLetterBodyQuantity(new BigInteger("1")));
+ * gcl.add(ObjectFactory.createLetterBodyProductName("Baby Monitor"));
+ * gcl.add("shipped from our warehouse"); // add text information item
+ * </xmp></pre>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ * @author Kohsuke Kawaguchi
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME)
+ at Target({FIELD,METHOD})
+public @interface XmlMixed {
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlNs.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlNs.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlNs.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * <p>
+ * Associates a namespace prefix with a XML namespace URI.
+ *
+ * <p><b>Usage</b></p>
+ * <p><tt>@XmlNs</tt> annotation is intended for use from other
+ * program annotations.
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p><b>Example:</b>See <tt>XmlSchema</tt> annotation type for an example.
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since JAXB2.0
+ * @version $Revision: 2467 $
+ */
+
+ at Retention(RUNTIME) @Target({})
+public @interface XmlNs {
+ /**
+ * Namespace prefix
+ */
+ String prefix();
+
+ /**
+ * Namespace URI
+ */
+ String namespaceURI();
+}
+
+
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlNsForm.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlNsForm.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlNsForm.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+/**
+ * Enumeration of XML Schema namespace qualifications.
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p><b>Usage</b>
+ * <p>
+ * The namespace qualification values are used in the annotations
+ * defined in this packge. The enumeration values are mapped as follows:
+ *
+ * <p>
+ * <table border="1" cellpadding="4" cellspacing="3">
+ * <tbody>
+ * <tr>
+ * <td><b>Enum Value<b></td>
+ * <td><b>XML Schema Value<b></td>
+ * </tr>
+ *
+ * <tr valign="top">
+ * <td>UNQUALIFIED</td>
+ * <td>unqualified</td>
+ * </tr>
+ * <tr valign="top">
+ * <td>QUALIFIED</td>
+ * <td>qualified</td>
+ * </tr>
+ * <tr valign="top">
+ * <td>UNSET</td>
+ * <td>namespace qualification attribute is absent from the
+ * XML Schema fragment</td>
+ * </tr>
+ * </tbody>
+ * </table>
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since JAXB2.0
+ * @version $Revision: 2467 $
+ */
+public enum XmlNsForm {UNQUALIFIED, QUALIFIED, UNSET}
+
+
+
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlRegistry.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlRegistry.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlRegistry.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Marks a class that has {@link XmlElementDecl}s.
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ * @since JAXB 2.0
+ * @see XmlElementDecl
+ */
+ at Retention(RUNTIME)
+ at Target({TYPE})
+public @interface XmlRegistry {
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlRootElement.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlRootElement.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlRootElement.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,162 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.TYPE;
+
+/**
+ * Maps a class or an enum type to an XML element.
+ *
+ * <p> <b>Usage</b> </p>
+ * <p>
+ * The @XmlRootElement annotation can be used with the following program
+ * elements:
+ * <ul>
+ * <li> a top level class </li>
+ * <li> an enum type </li>
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p>
+ * When a top level class or an enum type is annotated with the
+ * @XmlRootElement annotation, then its value is represented
+ * as XML element in an XML document.
+ *
+ * <p> This annotation can be used with the following annotations:
+ * {@link XmlType}, {@link XmlEnum}, {@link XmlAccessorType},
+ * {@link XmlAccessorOrder}.
+ * <p>
+
+ * <p>
+ * <b>Example 1: </b> Associate an element with XML Schema type
+ * <pre>
+ * // Example: Code fragment
+ * @XmlRootElement
+ * class Point {
+ * int x;
+ * int y;
+ * Point(int _x,int _y) {x=_x;y=_y;}
+ * }
+ * </pre>
+ *
+ * <pre>
+ * //Example: Code fragment corresponding to XML output
+ * marshal( new Point(3,5), System.out);
+ * </pre>
+ *
+ * <pre><xmp>
+ * <!-- Example: XML output -->
+ * <point>
+ * <x> 3 </x>
+ * <y> 5 </y>
+ * </point>
+ * </xmp></pre>
+ *
+ * The annotation causes an global element declaration to be produced
+ * in the schema. The global element declaration is associated with
+ * the XML schema type to which the class is mapped.
+ *
+ * <pre><xmp>
+ * <!-- Example: XML schema definition -->
+ * <xs:element name="point" type="point"/>
+ * <xs:complexType name="point">
+ * <xs:sequence>
+ * <xs:element name="x" type="xs:int"/>
+ * <xs:element name="y" type="xs:int"/>
+ * </xs:sequence>
+ * </xs:complexType>
+ * </xmp></pre>
+ *
+ * <p>
+ *
+ * <b>Example 2: Orthogonality to type inheritance </b>
+ *
+ * <p>
+ * An element declaration annotated on a type is not inherited by its
+ * derived types. The following example shows this.
+ * <pre>
+ * // Example: Code fragment
+ * @XmlRootElement
+ * class Point3D extends Point {
+ * int z;
+ * Point3D(int _x,int _y,int _z) {super(_x,_y);z=_z;}
+ * }
+ *
+ * //Example: Code fragment corresponding to XML output *
+ * marshal( new Point3D(3,5,0), System.out );
+ *
+ * <!-- Example: XML output -->
+ * <!-- The element name is point3D not point -->
+ * <point3D>
+ * <x>3</x>
+ * <y>5</y>
+ * <z>0</z>
+ * </point3D>
+ *
+ * <!-- Example: XML schema definition -->
+ * <xs:element name="point3D" type="point3D"/>
+ * <xs:complexType name="point3D">
+ * <xs:complexContent>
+ * <xs:extension base="point">
+ * <xs:sequence>
+ * <xs:element name="z" type="xs:int"/>
+ * </xs:sequence>
+ * </xs:extension>
+ * </xs:complexContent>
+ * </xs:complexType>
+ * </pre>
+ *
+ * <b>Example 3: </b> Associate a global element with XML Schema type
+ * to which the class is mapped.
+ * <pre>
+ * //Example: Code fragment
+ * @XmlRootElement(name="PriceElement")
+ * public class USPrice {
+ * @XmlElement
+ * public java.math.BigDecimal price;
+ * }
+ *
+ * <!-- Example: XML schema definition -->
+ * <xs:element name="PriceElement" type="USPrice"/>
+ * <xs:complexType name="USPrice">
+ * <xs:sequence>
+ * <xs:element name="price" type="xs:decimal"/>
+ * </sequence>
+ * </xs:complexType>
+ * </pre>
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME)
+ at Target({TYPE})
+public @interface XmlRootElement {
+ /**
+ * namespace name of the XML element.
+ * <p>
+ * If the value is "##default", then the XML namespace name is derived
+ * from the package of the class ( {@link XmlSchema} ). If the
+ * package is unnamed, then the XML namespace is the default empty
+ * namespace.
+ */
+ String namespace() default "##default";
+
+ /**
+ * local name of the XML element.
+ * <p>
+ * If the value is "##default", then the name is derived from the
+ * class name.
+ *
+ */
+ String name() default "##default";
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlSchema.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlSchema.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlSchema.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * <p> Maps a package name to a XML namespace. </p>
+ *
+ * <p><b>Usage</b> </p>
+ * <p>
+ * The XmlSchema annotation can be used with the following program
+ * elements:
+ * <ul>
+ * <li>package</li>
+ * </ul>
+ *
+ * This is a package level annotation and follows the recommendations
+ * and restrictions contained in JSR 175, section III, "Annotations".
+ * Thus the usage is subject to the following constraints and
+ * recommendations.
+ * <ul>
+ * <li> There can only be one package declaration as noted in JSR
+ * 175, section III, "Annotations". </li>
+ * <li> JSR 175 recommends package-info.java for package level
+ * annotations. JAXB Providers that follow this recommendation
+ * will allow the package level annotations to be defined in
+ * package-info.java.
+ * </ul>
+ * <p>
+ *
+ * <p><b>Example 1:</b> Customize name of XML namespace to which
+ * package is mapped.</p>
+ *
+ * <pre>
+ * @javax.xml.bind.annotation.XmlSchema (
+ * namespace = "http://www.example.com/MYPO1"
+ * )
+ *
+ * <!-- XML Schema fragment -->
+ * <schema
+ * xmlns=...
+ * xmlns:po=....
+ * targetNamespace="http://www.example.com/MYPO1"
+ * >
+ * <!-- prefixes generated by default are implementation
+ * depedenent -->
+ * </pre>
+ *
+ * <p><b>Example 2:</b> Customize namespace prefix, namespace URI
+ * mapping</p>
+ *
+ * <pre>
+ * // Package level annotation
+ * @javax.xml.bind.annotation.XmlSchema (
+ * xmlns = {
+ * @javax.xml.bind.annotation.XmlNs(prefix = "po",
+ * namespaceURI="http://www.example.com/myPO1"),
+ *
+ * @javax.xml.bind.annotation.XmlNs(prefix="xs",
+ * namespaceURI="http://www.w3.org/2001/XMLSchema")
+ * )
+ * )
+ *
+ * <!-- XML Schema fragment -->
+ * <schema
+ * xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ * xmlns:po="http://www.example.com/PO1"
+ * targetNamespace="http://www.example.com/PO1">
+ *
+ * </pre>
+ *
+ * <p><b>Example 3:</b> Customize elementFormDefault</p>
+ * <pre>
+ * @javax.xml.bind.annotation.XmlSchema (
+ * elementFormDefault=XmlNsForm.UNQUALIFIED
+ * ...
+ * )
+ *
+ * <!-- XML Schema fragment -->
+ * <schema
+ * xmlns="http://www.w3.org/2001/XMLSchema"
+ * xmlns:po="http://www.example.com/PO1"
+ * elementFormDefault="unqualified">
+ *
+ * </pre>
+
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since JAXB2.0
+ * @version $Revision: 2467 $
+ */
+
+ at Retention(RUNTIME) @Target({PACKAGE})
+public @interface XmlSchema {
+
+ /**
+ * Customize the namespace URI, prefix associations. By default,
+ * the namespace prefixes for a XML namespace are generated by a
+ * JAXB Provider in an implementation dependent way.
+ */
+ XmlNs[] xmlns() default {};
+
+ /**
+ * Name of the XML namespace.
+ */
+ String namespace() default "";
+
+ /**
+ * Namespace qualification for elements. By default, element
+ * default attribute will be absent from the XML Schema fragment.
+ */
+ XmlNsForm elementFormDefault() default XmlNsForm.UNSET;
+
+ /**
+ * Namespace qualification for attributes. By default,
+ * attributesFormDefault will be absent from the XML Schema fragment.
+ */
+ XmlNsForm attributeFormDefault() default XmlNsForm.UNSET;
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PACKAGE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Maps a Java type to a simple schema built-in type.
+ *
+ * <p> <b>Usage</b> </p>
+ * <p>
+ * <tt>@XmlSchemaType</tt> annotation can be used with the following program
+ * elements:
+ * <ul>
+ * <li> a JavaBean property </li>
+ * <li> field </li>
+ * <li> package</li>
+ * </ul>
+ *
+ * <p> <tt>@XmlSchemaType</tt> annotation defined for Java type
+ * applies to all references to the Java type from a property/field.
+ * A <tt>@XmlSchemaType</tt> annotation specified on the
+ * property/field overrides the <tt>@XmlSchemaType</tt> annotation
+ * specified at the package level.
+ *
+ * <p> This annotation can be used with the following annotations:
+ * {@link XmlElement}, {@link XmlAttribute}.
+ * <p>
+ * <b>Example 1: </b> Customize mapping of XMLGregorianCalendar on the
+ * field.
+ *
+ * <pre>
+ * //Example: Code fragment
+ * public class USPrice {
+ * @XmlElement
+ * @XmlSchemaType(name="date")
+ * public XMLGregorianCalendar date;
+ * }
+ *
+ * <!-- Example: Local XML Schema element -->
+ * <xs:complexType name="USPrice"/>
+ * <xs:sequence>
+ * <xs:element name="date" type="xs:date"/>
+ * </sequence>
+ * </xs:complexType>
+ * </pre>
+ *
+ * <p> <b> Example 2: </b> Customize mapping of XMLGregorianCalendar at package
+ * level </p>
+ * <pre>
+ * package foo;
+ * @javax.xml.bind.annotation.XmlSchemaType(
+ * name="date", type=javax.xml.datatype.XMLGregorianCalendar.class)
+ * }
+ * </pre>
+ *
+ * @since JAXB2.0
+ */
+
+ at Retention(RUNTIME) @Target({FIELD,METHOD,PACKAGE})
+public @interface XmlSchemaType {
+ String name();
+ String namespace() default "http://www.w3.org/2001/XMLSchema";
+ /**
+ * If this annotation is used at the package level, then value of
+ * the type() must be specified.
+ */
+
+ Class type() default DEFAULT.class;
+
+ /**
+ * Used in {@link XmlSchemaType#type()} to
+ * signal that the type be inferred from the signature
+ * of the property.
+ */
+
+ static final class DEFAULT {}
+
+}
+
+
+
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.PACKAGE;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * <p>
+ * A container for multiple @{@link XmlSchemaType} annotations.
+ *
+ * <p> Multiple annotations of the same type are not allowed on a program
+ * element. This annotation therefore serves as a container annotation
+ * for multiple @XmlSchemaType annotations as follows:
+ *
+ * <pre>
+ * @XmlSchemaTypes({ @XmlSchemaType(...), @XmlSchemaType(...) })
+ * </pre>
+ * <p>The <tt>@XmlSchemaTypes</tt> annnotation can be used to
+ * define {@link XmlSchemaType} for different types at the
+ * package level.
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * @author <ul><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ * @see XmlSchemaType
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME) @Target({PACKAGE})
+public @interface XmlSchemaTypes {
+ /**
+ * Collection of @{@link XmlSchemaType} annotations
+ */
+ XmlSchemaType[] value();
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlTransient.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlTransient.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlTransient.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * <p>
+ * Prevents the mapping of a JavaBean property to XML representation.
+ * <p>
+ * The <tt>@XmlTransient</tt> annotation is useful for resolving name
+ * collisions between a JavaBean property name and a field name or
+ * preventing the mapping of a field/property. A name collision can
+ * occur when the decapitalized JavaBean property name and a field
+ * name are the same. If the JavaBean property refers to the field,
+ * then the name collision can be resolved by preventing the
+ * mapping of either the field or the JavaBean property using the
+ * <tt>@XmlTransient</tt> annotation.
+ * <p><b>Usage</b></p>
+ * <p> The <tt>@XmlTransient</tt> annotation can be used with the following
+ * program elements:
+ * <ul>
+ * <li> a JavaBean property </li>
+ * <li> field </li>
+ * </ul>
+ *
+ * <p><tt>@XmlTransient</tt>is mutually exclusive with all other
+ * JAXB defined annotations. </p>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p><b>Example:</b> Resolve name collision between JavaBean property and
+ * field name </p>
+ *
+ * <pre>
+ * // Example: Code fragment
+ * public class USAddress {
+ *
+ * // The field name "name" collides with the property name
+ * // obtained by bean decapitalization of getName() below
+ * @XmlTransient public String name;
+ *
+ * String getName() {..};
+ * String setName() {..};
+ * }
+ *
+ *
+ * <!-- Example: XML Schema fragment -->
+ * <xs:complexType name="USAddress">
+ * <xs:sequence>
+ * <xs:element name="name" type="xs:string"/>
+ * </xs:sequence>
+ * </xs:complexType>
+ * </pre>
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since JAXB2.0
+ * @version $Revision: 2467 $
+ */
+
+ at Retention(RUNTIME) @Target({FIELD, METHOD})
+public @interface XmlTransient {}
+
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlType.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlType.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlType.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,435 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * <p>
+ * Maps a class or an enum type to a XML Schema type.
+ *
+ * <p><b>Usage</b></p>
+ * <p> The <tt>@XmlType</tt> annnotation can be used with the following program
+ * elements:
+ * <ul>
+ * <li> a top level class </li>
+ * <li> an enum type </li>
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <h3> Mapping a Class </h3>
+ * <p>
+ * A class maps to a XML Schema type. A class is a data container for
+ * values represented by properties and fields. A schema type is a
+ * data container for values represented by schema components within a
+ * schema type's content model (e.g. model groups, attributes etc).
+ * <p> To be mapped, a class must either have a public no-arg
+ * constructor or a static no-arg factory method. The static factory
+ * method can be specified in <tt>factoryMethod()</tt> and
+ * <tt>factoryClass()</tt> annotation elements. The static factory
+ * method or the no-arg constructor is used during unmarshalling to
+ * create an instance of this class. If both are present, the static
+ * factory method overrides the no-arg constructor.
+ * <p>
+ * A class maps to either a XML Schema complex type or a XML Schema simple
+ * type. The XML Schema type is derived based on the
+ * mapping of JavaBean properties and fields contained within the
+ * class. The schema type to which the class is mapped can either be
+ * named or anonymous. A class can be mapped to an anonymous schema
+ * type by annotating the class with <tt>@XmlType(name="")</tt>.
+ * <p>
+ * Either a global element, local element or a local attribute can be
+ * associated with an anonymous type as follows:
+ * <ul>
+ * <li><b>global element: </b> A global element of an anonymous
+ * type can be derived by annotating the class with @{@link
+ * XmlRootElement}. See Example 3 below. </li>
+ *
+ * <li><b>local element: </b> A JavaBean property that references
+ * a class annotated with @XmlType(name="") and is mapped to the
+ * element associated with the anonymous type. See Example 4
+ * below.</li>
+ *
+ * <li><b>attribute: </b> A JavaBean property that references
+ * a class annotated with @XmlType(name="") and is mapped to the
+ * attribute associated with the anonymous type. See Example 5 below. </li>
+ * </ul>
+ * <b> Mapping to XML Schema Complex Type </b>
+ * <ul>
+ * <li>If class is annotated with <tt>@XmlType(name="") </tt>, it
+ * is mapped to an anonymous type otherwise, the class name maps
+ * to a complex type name. The <tt>XmlName()</tt> annotation element
+ * can be used to customize the name.</li>
+ *
+ * <li> Properties and fields that are mapped to elements are mapped to a
+ * content model within a complex type. The annotation element
+ * <tt>propOrder()</tt> can be used to customize the content model to be
+ * <tt>xs:all</tt> or <tt>xs:sequence</tt>. It is used for specifying
+ * the order of XML elements in <tt>xs:sequence</tt>. </li>
+ *
+ * <li> Properties and fields can be mapped to attributes within the
+ * complex type. </li>
+ *
+ * <li> The targetnamespace of the XML Schema type can be customized
+ * using the annotation element <tt>namespace()</tt>. </li>
+ * </ul>
+ *
+ * <p>
+ * <b> Mapping class to XML Schema simple type </b>
+ * <p>
+ * A class can be mapped to a XML Schema simple type using the
+ * <tt>@XmlValue</tt> annotation. For additional details and examples,
+ * see @{@link XmlValue} annotation type.
+ * <p>
+ * The following table shows the mapping of the class to a XML Schema
+ * complex type or simple type. The notational symbols used in the table are:
+ * <ul>
+ * <li> -> : represents a mapping </li>
+ * <li> [x]+ : one or more occurances of x </li>
+ * <li> [ <tt>@XmlValue</tt> property ]: JavaBean property annotated with
+ * <tt>@XmlValue</tt></li>
+ * <li> X : don't care
+ * </ul>
+ * <blockquote>
+ * <table border="1" cellpadding="4" cellspacing="3">
+ * <tbody>
+ * <tr>
+ * <td><b>Target</td>
+ * <td><b>propOrder</b></td>
+ * <td><b>ClassBody</b></td>
+ * <td><b>ComplexType</b></td>
+ * <td><b>SimpleType</b></td>
+ * </tr>
+ *
+ * <tr valign="top">
+ * <td>Class</td>
+ * <td>{}</td>
+ * <td>[property]+ -> elements</td>
+ * <td>complexcontent<br>xs:all</td>
+ * <td> </td>
+ * </tr>
+ *
+ * <tr valign="top">
+ * <td>Class</td>
+ * <td>non empty</td>
+ * <td>[property]+ -> elements</td>
+ * <td>complexcontent<br>xs:sequence</td>
+ * <td> </td>
+ * </tr>
+ *
+ * <tr valign="top">
+ * <td>Class</td>
+ * <td>X</td>
+ * <td>no property -> element</td>
+ * <td>complexcontent<br>empty sequence</td>
+ * <td> </td>
+ * </tr>
+ *
+ * <tr valign="top">
+ * <td>Class</td>
+ * <td>X</td>
+ * <td>1 [ <tt>@XmlValue</tt> property] && <br> [property]+
+ * ->attributes</td>
+ * <td>simplecontent</td>
+ * <td> </td>
+ * </tr>
+ *
+ * <tr valign="top">
+ * <td>Class</td>
+ * <td>X</td>
+ * <td>1 [ <tt>@XmlValue</tt> property ]&& <br> no properties
+ * -> attribute</td>
+ * <td> </td>
+ * <td>simpletype</td>
+ * <td> </td>
+ * </tr>
+ * </tbody>
+ * </table>
+ * </blockquote>
+ *
+ * <h3> Mapping an enum type </h3>
+ *
+ * An enum type maps to a XML schema simple type with enumeration
+ * facets. The following annotation elements are ignored since they
+ * are not meaningful: <tt>propOrder()</tt> , <tt>factoryMethod()</tt> ,
+ * <tt>factoryClass()</tt> .
+ *
+ * <h3> Usage with other annotations </h3>
+ * <p> This annotation can be used with the following annotations:
+ * {@link XmlRootElement}, {@link XmlAccessorOrder}, {@link XmlAccessorType},
+ * {@link XmlEnum}. However, {@link
+ * XmlAccessorOrder} and {@link XmlAccessorType} are ignored when this
+ * annotation is used on an enum type.
+ *
+ * <p> <b> Example 1: </b> Map a class to a complex type with
+ * xs:sequence with a customized ordering of JavaBean properties.
+ * </p>
+ *
+ * <pre>
+ * @XmlType(propOrder={"street", "city" , "state", "zip", "name" })
+ * public class USAddress {
+ * String getName() {..};
+ * void setName(String) {..};
+ *
+ * String getStreet() {..};
+ * void setStreet(String) {..};
+ *
+ * String getCity() {..};
+ * void setCity(String) {..};
+ *
+ * String getState() {..};
+ * void setState(String) {..};
+ *
+ * java.math.BigDecimal getZip() {..};
+ * void setZip(java.math.BigDecimal) {..};
+ * }
+ *
+ * <!-- XML Schema mapping for USAddress -->
+ * <xs:complexType name="USAddress">
+ * <xs:sequence>
+ * <xs:element name="street" type="xs:string"/>
+ * <xs:element name="city" type="xs:string"/>
+ * <xs:element name="state" type="xs:string"/>
+ * <xs:element name="zip" type="xs:decimal"/>
+ * <xs:element name="name" type="xs:string"/>
+ * </xs:all>
+ * </xs:complexType>
+ * </pre>
+ * <p> <b> Example 2: </b> Map a class to a complex type with
+ * xs:all </p>
+ * <pre>
+ * @XmlType(propOrder={})
+ * public class USAddress { ...}
+ *
+ * <!-- XML Schema mapping for USAddress -->
+ * <xs:complexType name="USAddress">
+ * <xs:all>
+ * <xs:element name="name" type="xs:string"/>
+ * <xs:element name="street" type="xs:string"/>
+ * <xs:element name="city" type="xs:string"/>
+ * <xs:element name="state" type="xs:string"/>
+ * <xs:element name="zip" type="xs:decimal"/>
+ * </xs:sequence>
+ * </xs:complexType>
+ *</pre>
+ * <p> <b> Example 3: </b> Map a class to a global element with an
+ * anonymous type.
+ * </p>
+ * <pre>
+ * @XmlRootElement
+ * @XmlType(name="")
+ * public class USAddress { ...}
+ *
+ * <!-- XML Schema mapping for USAddress -->
+ * <xs:element name="USAddress">
+ * <xs:complexType>
+ * <xs:sequence>
+ * <xs:element name="name" type="xs:string"/>
+ * <xs:element name="street" type="xs:string"/>
+ * <xs:element name="city" type="xs:string"/>
+ * <xs:element name="state" type="xs:string"/>
+ * <xs:element name="zip" type="xs:decimal"/>
+ * </xs:sequence>
+ * </xs:complexType>
+ * </xs:element>
+ * </pre>
+ *
+ * <p> <b> Example 4: </b> Map a property to a local element with
+ * anonmyous type.
+ * <pre>
+ * //Example: Code fragment
+ * public class Invoice {
+ * USAddress addr;
+ * ...
+ * }
+ *
+ * @XmlType(name="")
+ * public class USAddress { ... }
+ * }
+ *
+ * <!-- XML Schema mapping for USAddress -->
+ * <xs:complexType name="Invoice">
+ * <xs:sequence>
+ * <xs:element name="addr">
+ * <xs:complexType>
+ * <xs:element name="name", type="xs:string"/>
+ * <xs:element name="city", type="xs:string"/>
+ * <xs:element name="city" type="xs:string"/>
+ * <xs:element name="state" type="xs:string"/>
+ * <xs:element name="zip" type="xs:decimal"/>
+ * </xs:complexType>
+ * ...
+ * </xs:sequence>
+ * </xs:complexType>
+ * </pre>
+ *
+ * <p> <b> Example 5: </b> Map a property to an attribute with
+ * anonymous type.
+ *
+ * <pre>
+ *
+ * //Example: Code fragment
+ * public class Item {
+ * public String name;
+ * @XmlAttribute
+ * public USPrice price;
+ * }
+ *
+ * // map class to anonymous simple type.
+ * @XmlType(name="")
+ * public class USPrice {
+ * @XmlValue
+ * public java.math.BigDecimal price;
+ * }
+ *
+ * <!-- Example: XML Schema fragment -->
+ * <xs:complexType name="Item">
+ * <xs:sequence>
+ * <xs:element name="name" type="xs:string"/>
+ * <xs:attribute name="price">
+ * <xs:simpleType>
+ * <xs:restriction base="xs:decimal"/>
+ * </xs:simpleType>
+ * </xs:attribute>
+ * </xs:sequence>
+ * </xs:complexType>
+ * </pre>
+ *
+ * <p> <b> Example 6: </b> Define a factoryClass and factoryMethod
+ *
+ * <pre>
+ * @XmlType(name="USAddressType", factoryClass=USAddressFactory.class,
+ * factoryMethod="getUSAddress")
+ * public class USAddress {
+ *
+ * private String city;
+ * private String name;
+ * private String state;
+ * private String street;
+ * private int zip;
+ *
+ * public USAddress(String name, String street, String city,
+ * String state, int zip) {
+ * this.name = name;
+ * this.street = street;
+ * this.city = city;
+ * this.state = state;
+ * this.zip = zip;
+ * }
+ * }
+ *
+ * public class USAddressFactory {
+ * public static USAddress getUSAddress(){
+ * return new USAddress("Mark Baker", "23 Elm St",
+ * "Dayton", "OH", 90952);
+ * }
+ *
+ * </pre>
+ *
+ * <p> <b> Example 7: </b> Define factoryMethod and use the default factoryClass
+ *
+ * <pre>
+ * @XmlType(name="USAddressType", factoryMethod="getNewInstance")
+ * public class USAddress {
+ *
+ * private String city;
+ * private String name;
+ * private String state;
+ * private String street;
+ * private int zip;
+ *
+ * private USAddress() {}
+ *
+ * public static USAddress getNewInstance(){
+ * return new USAddress();
+ * }
+ * }
+ * </pre>
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @see XmlElement
+ * @see XmlAttribute
+ * @see XmlValue
+ * @see XmlSchema
+ * @since JAXB2.0
+ * @version $Revision: 2467 $
+ */
+
+ at Retention(RUNTIME) @Target({TYPE})
+public @interface XmlType {
+ /**
+ * Name of the XML Schema type which the class is mapped.
+ */
+ String name() default "##default" ;
+
+ /**
+ * Specifies the order for XML Schema elements when class is
+ * mapped to a XML Schema complex type.
+ *
+ * <p> Refer to the table for how the propOrder affects the
+ * mapping of class </p>
+ *
+ * <p> The propOrder is a list of names of JavaBean properties in
+ * the class. Each name in the list is the name of a Java
+ * identifier of the JavaBean property. The order in which
+ * JavaBean properties are listed is the order of XML Schema
+ * elements to which the JavaBean properties are mapped. </p>
+ * <p> All of the JavaBean properties being mapped to XML Schema elements
+ * must be listed.
+ * <p> A JavaBean property or field listed in propOrder must not
+ * be transient or annotated with <tt>@XmlTransient</tt>.
+ * <p> The default ordering of JavaBean properties is determined
+ * by @{@link XmlAccessorOrder}.
+ */
+ String[] propOrder() default {""};
+
+ /**
+ * Name of the target namespace of the XML Schema type. By
+ * default, this is the target namespace to which the package
+ * containing the class is mapped.
+ */
+ String namespace() default "##default" ;
+
+ /**
+ * Class containing a no-arg factory method for creating an
+ * instance of this class. The default is this class.
+ *
+ * <p>If <tt>factoryClass</tt> is DEFAULT.class and
+ * <tt>factoryMethod</tt> is "", then there is no static factory
+ * method.
+ *
+ * <p>If <tt>factoryClass</tt> is DEFAULT.class and
+ * <tt>factoryMethod</tt> is not "", then
+ * <tt>factoryMethod</tt> is the name of a static factory method
+ * in this class.
+ *
+ * <p>If <tt>factoryClass</tt> is not DEFAULT.class, then
+ * <tt>factoryMethod</tt> must not be "" and must be the name of
+ * a static factory method specified in <tt>factoryClass</tt>.
+ */
+ Class factoryClass() default DEFAULT.class;
+
+ /**
+ * Used in {@link XmlType#factoryClass()} to
+ * signal that either factory mehod is not used or
+ * that it's in the class with this {@link XmlType} itself.
+ */
+ static final class DEFAULT {}
+
+ /**
+ * Name of a no-arg factory method in the class specified in
+ * <tt>factoryClass</tt> factoryClass().
+ *
+ */
+ String factoryMethod() default "";
+}
+
+
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlValue.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlValue.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/XmlValue.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * <p>
+ * Enables mapping a class to a XML Schema complex type with a
+ * simpleContent or a XML Schema simple type.
+ * </p>
+ *
+ * <p>
+ * <b> Usage: </b>
+ * <p>
+ * The <tt>@XmlValue</tt> annotation can be used with the following program
+ * elements:
+ * <ul>
+ * <li> a JavaBean property.</li>
+ * <li> non static, non transient field.</li>
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * The usage is subject to the following usage constraints:
+ * <ul>
+ * <li>At most one field or property can be annotated with the
+ * <tt>@XmlValue</tt> annotation. </li>
+ *
+ * <li><tt>@XmlValue</tt> can be used with the following
+ * annotations: {@link XmlList}. However this is redundant since
+ * {@link XmlList} maps a type to a simple schema type that derives by
+ * list just as {@link XmlValue} would. </li>
+ *
+ * <li>If the type of the field or property is a collection type,
+ * then the collection item type must map to a simple schema
+ * type. </li>
+ *
+ * <li>If the type of the field or property is not a collection
+ * type, then the type must map to a XML Schema simple type. </li>
+ *
+ * </ul>
+ * </p>
+ * <p>
+ * If the annotated JavaBean property is the sole class member being
+ * mapped to XML Schema construct, then the class is mapped to a
+ * simple type.
+ *
+ * If there are additional JavaBean properties (other than the
+ * JavaBean property annotated with <tt>@XmlValue</tt> annotation)
+ * that are mapped to XML attributes, then the class is mapped to a
+ * complex type with simpleContent.
+ * </p>
+ *
+ * <p> <b> Example 1: </b> Map a class to XML Schema simpleType</p>
+ *
+ * <pre>
+ *
+ * // Example 1: Code fragment
+ * public class USPrice {
+ * @XmlValue
+ * public java.math.BigDecimal price;
+ * }
+ *
+ * <!-- Example 1: XML Schema fragment -->
+ * <xs:simpleType name="USPrice">
+ * <xs:restriction base="xs:decimal"/>
+ * </xs:simpleType>
+ *
+ * </pre>
+ *
+ * <p><b> Example 2: </b> Map a class to XML Schema complexType with
+ * with simpleContent.</p>
+ *
+ * <pre>
+ *
+ * // Example 2: Code fragment
+ * public class InternationalPrice {
+ * @XmlValue
+ * public java.math.BigDecimal price;
+ *
+ * @XmlAttribute
+ * public String currency;
+ * }
+ *
+ * <!-- Example 2: XML Schema fragment -->
+ * <xs:complexType name="InternationalPrice">
+ * <xs:simpleContent>
+ * <xs:extension base="xs:decimal">
+ * <xs:attribute name="currency" type="xs:string"/>
+ * </xs:extension>
+ * </xs:simpleContent>
+ * </xs:complexType>
+ *
+ * </pre>
+ * </p>
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @see XmlType
+ * @since JAXB2.0
+ * @version $Revision: 2467 $
+ */
+
+ at Retention(RUNTIME) @Target({FIELD, METHOD})
+public @interface XmlValue {}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation.adapters;
+
+
+
+/**
+ * Built-in {@link XmlAdapter} to handle <tt>xs:token</tt> and its derived types.
+ *
+ * <p>
+ * This adapter removes leading and trailing whitespaces, then truncate any
+ * sequnce of tab, CR, LF, and SP by a single whitespace character ' '.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since JAXB 2.0
+ */
+public class CollapsedStringAdapter extends XmlAdapter<String,String> {
+ /**
+ * Removes leading and trailing whitespaces of the string
+ * given as the parameter, then truncate any
+ * sequnce of tab, CR, LF, and SP by a single whitespace character ' '.
+ */
+ public String unmarshal(String text) {
+ if(text==null) return null; // be defensive
+
+ int len = text.length();
+
+ // most of the texts are already in the collapsed form.
+ // so look for the first whitespace in the hope that we will
+ // never see it.
+ int s=0;
+ while(s<len) {
+ if(isWhiteSpace(text.charAt(s)))
+ break;
+ s++;
+ }
+ if(s==len)
+ // the input happens to be already collapsed.
+ return text;
+
+ // we now know that the input contains spaces.
+ // let's sit down and do the collapsing normally.
+
+ StringBuffer result = new StringBuffer(len /*allocate enough size to avoid re-allocation*/ );
+
+ if(s!=0) {
+ for( int i=0; i<s; i++ )
+ result.append(text.charAt(i));
+ result.append(' ');
+ }
+
+ boolean inStripMode = true;
+ for (int i = s+1; i < len; i++) {
+ char ch = text.charAt(i);
+ boolean b = isWhiteSpace(ch);
+ if (inStripMode && b)
+ continue; // skip this character
+
+ inStripMode = b;
+ if (inStripMode)
+ result.append(' ');
+ else
+ result.append(ch);
+ }
+
+ // remove trailing whitespaces
+ len = result.length();
+ if (len > 0 && result.charAt(len - 1) == ' ')
+ result.setLength(len - 1);
+ // whitespaces are already collapsed,
+ // so all we have to do is to remove the last one character
+ // if it's a whitespace.
+
+ return result.toString();
+ }
+
+ /**
+ * No-op.
+ *
+ * Just return the same string given as the parameter.
+ */
+ public String marshal(String s) {
+ return s;
+ }
+
+
+ /** returns true if the specified char is a white space character. */
+ protected static boolean isWhiteSpace(char ch) {
+ // most of the characters are non-control characters.
+ // so check that first to quickly return false for most of the cases.
+ if( ch>0x20 ) return false;
+
+ // other than we have to do four comparisons.
+ return ch == 0x9 || ch == 0xA || ch == 0xD || ch == 0x20;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation.adapters;
+
+import javax.xml.bind.DatatypeConverter;
+
+/**
+ * {@link XmlAdapter} for <tt>xs:hexBinary</tt>.
+ *
+ * <p>
+ * This {@link XmlAdapter} binds <tt>byte[]</tt> to the hexBinary representation in XML.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since JAXB 2.0
+ */
+public final class HexBinaryAdapter extends XmlAdapter<String,byte[]> {
+ public byte[] unmarshal(String s) {
+ return DatatypeConverter.parseHexBinary(s);
+ }
+
+ public String marshal(byte[] bytes) {
+ return DatatypeConverter.printHexBinary(bytes);
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation.adapters;
+
+
+
+/**
+ * {@link XmlAdapter} to handle <tt>xs:normalizedString</tt>.
+ *
+ * <p>
+ * This adapter removes leading and trailing whitespaces, then replace
+ * any tab, CR, and LF by a whitespace character ' '.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since JAXB 2.0
+ */
+public final class NormalizedStringAdapter extends XmlAdapter<String,String> {
+ /**
+ * Removes leading and trailing whitespaces of the string
+ * given as the parameter, then replace
+ * any tab, CR, and LF by a whitespace character ' '.
+ */
+ public String unmarshal(String text) {
+ if(text==null) return null; // be defensive
+
+ int i=text.length()-1;
+
+ // look for the first whitespace char.
+ while( i>=0 && !isWhiteSpaceExceptSpace(text.charAt(i)) )
+ i--;
+
+ if( i<0 )
+ // no such whitespace. replace(text)==text.
+ return text;
+
+ // we now know that we need to modify the text.
+ // allocate a char array to do it.
+ char[] buf = text.toCharArray();
+
+ buf[i--] = ' ';
+ for( ; i>=0; i-- )
+ if( isWhiteSpaceExceptSpace(buf[i]))
+ buf[i] = ' ';
+
+ return new String(buf);
+ }
+
+ /**
+ * No-op.
+ *
+ * Just return the same string given as the parameter.
+ */
+ public String marshal(String s) {
+ return s;
+ }
+
+
+ /**
+ * Returns true if the specified char is a white space character
+ * but not 0x20.
+ */
+ protected static boolean isWhiteSpaceExceptSpace(char ch) {
+ // most of the characters are non-control characters.
+ // so check that first to quickly return false for most of the cases.
+ if( ch>=0x20 ) return false;
+
+ // other than we have to do four comparisons.
+ return ch == 0x9 || ch == 0xA || ch == 0xD;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,176 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation.adapters;
+
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.Marshaller;
+
+/**
+ * Adapts a Java type for custom marshaling.
+ *
+ * <p> <b> Usage: </b> </p>
+ *
+ * <p>
+ * Some Java types do not map naturally to a XML representation, for
+ * example <tt>HashMap</tt> or other non JavaBean classes. Conversely,
+ * a XML repsentation may map to a Java type but an application may
+ * choose to accesss the XML representation using another Java
+ * type. For example, the schema to Java binding rules bind
+ * xs:DateTime by default to XmlGregorianCalendar. But an application
+ * may desire to bind xs:DateTime to a custom type,
+ * MyXmlGregorianCalendar, for example. In both cases, there is a
+ * mismatch between <i> bound type </i>, used by an application to
+ * access XML content and the <i> value type</i>, that is mapped to an
+ * XML representation.
+ *
+ * <p>
+ * This abstract class defines methods for adapting a bound type to a value
+ * type or vice versa. The methods are invoked by the JAXB binding
+ * framework during marshaling and unmarshalling:
+ *
+ * <ul>
+ * <li> <b> XmlAdapter.marshal(...): </b> During marshalling, JAXB
+ * binding framework invokes XmlAdapter.marshal(..) to adapt a
+ * bound type to value type, which is then marshaled to XML
+ * representation. </li>
+ *
+ * <li> <b> XmlAdapter.unmarshal(...): </b> During unmarshalling,
+ * JAXB binding framework first unmarshals XML representation
+ * to a value type and then invokes XmlAdapter.unmarshal(..) to
+ * adapt the value type to a bound type. </li>
+ * </ul>
+ *
+ * Writing an adapter therefore involves the following steps:
+ *
+ * <ul>
+ * <li> Write an adapter that implements this abstract class. </li>
+ * <li> Install the adapter using the annotation {@link
+ * XmlJavaTypeAdapter} </li>
+ * </ul>
+ *
+ * <p><b>Example:</b> Customized mapping of </tt>HashMap</tt></p>
+ * <p> The following example illustrates the use of
+ * <tt>@XmlAdapter</tt> and <tt>@XmlJavaTypeAdapter</tt> to
+ * customize the mapping of a <tt>HashMap</tt>.
+ *
+ * <p> <b> Step 1: </b> Determine the desired XML representation for HashMap.
+ *
+ * <pre>
+ * <hashmap>
+ * <entry key="id123">this is a value</entry>
+ * <entry key="id312">this is another value</entry>
+ * ...
+ * </hashmap>
+ * </pre>
+ *
+ * <p> <b> Step 2: </b> Determine the schema definition that the
+ * desired XML representation shown above should follow.
+ *
+ * <pre>
+ *
+ * <xs:complexType name="myHashMapType">
+ * <xs:sequence>
+ * <xs:element name="entry" type="myHashMapEntryType"
+ * minOccurs = "0" maxOccurs="unbounded"/>
+ * </xs:sequence>
+ * </xs:complexType>
+ *
+ * <xs:complexType name="myHashMapEntryType">
+ * <xs:simpleContent>
+ * <xs:extension base="xs:string">
+ * <xs:attribute name="key" type="xs:int"/>
+ * </xs:extension>
+ * </xs:simpleContent>
+ * </xs:complexType>
+ *
+ * </pre>
+ *
+ * <p> <b> Step 3: </b> Write value types that can generate the above
+ * schema definition.
+ *
+ * <pre>
+ * public class MyHashMapType {
+ * List<MyHashMapEntryType> entry;
+ * }
+ *
+ * public class MyHashMapEntryType {
+ * @XmlAttribute
+ * public Integer key;
+ *
+ * @XmlValue
+ * public String value;
+ * }
+ * </pre>
+ *
+ * <p> <b> Step 4: </b> Write the adapter that adapts the value type,
+ * MyHashMapType to a bound type, HashMap, used by the application.
+ *
+ * <pre>
+ * public final class MyHashMapAdapter extends
+ * XmlAdapter<HashMap, MyHashMapType> { ... }
+ *
+ * </pre>
+ *
+ * <p> <b> Step 5: </b> Use the adapter.
+ *
+ * <pre>
+ * public class Foo {
+ * @XmlJavaTypeAdapter(MyHashMapAdapter.class)
+ * HashMap hashmap;
+ * ...
+ * }
+ * </pre>
+ *
+ * The above code fragment will map to the following schema:
+ *
+ * <pre>
+ * <xs:complexType name="Foo">
+ * <xs:sequence>
+ * <xs:element name="hashmap" type="myHashMapType"
+ * </xs:sequence>
+ * </xs:complexType>
+ * </pre>
+ *
+ * @param <BoundType>
+ * The type that JAXB doesn't know how to handle. An adapter is written
+ * to allow this type to be used as an in-memory representation through
+ * the <tt>ValueType</tt>.
+ * @param <ValueType>
+ * The type that JAXB knows how to handle out of the box.
+ *
+ * @author <ul><li>Sekhar Vajjhala, Sun Microsystems Inc.</li> <li> Kohsuke Kawaguchi, Sun Microsystems Inc.</li></ul>
+ * @see XmlJavaTypeAdapter
+ * @since JAXB 2.0
+ */
+public abstract class XmlAdapter<ValueType,BoundType> {
+
+ /**
+ * Do-nothing constructor for the derived classes.
+ */
+ protected XmlAdapter() {}
+
+ /**
+ * Convert a value type to a bound type.
+ *
+ * @param v
+ * The value to be converted. Can be null.
+ * @throws Exception
+ * if there's an error during the conversion. The caller is responsible for
+ * reporting the error to the user through {@link javax.xml.bind.ValidationEventHandler}.
+ */
+ public abstract BoundType unmarshal(ValueType v) throws Exception;
+
+ /**
+ * Convert a bound type to a value type.
+ *
+ * @param v
+ * The value to be convereted. Can be null.
+ * @throws Exception
+ * if there's an error during the conversion. The caller is responsible for
+ * reporting the error to the user through {@link javax.xml.bind.ValidationEventHandler}.
+ */
+ public abstract ValueType marshal(BoundType v) throws Exception;
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation.adapters;
+
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlElementRefs;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlElementRef;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSchema;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlSchemaTypes;
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.PACKAGE;
+
+
+/**
+ * Use an adapter that implements {@link XmlAdapter} for custom marshaling.
+ *
+ * <p> <b> Usage: </b> </p>
+ *
+ * <p> The <tt>@XmlJavaTypeAdapter</tt> annotation can be used with the
+ * following program elements:
+ * <ul>
+ * <li> a JavaBean property </li>
+ * <li> field </li>
+ * <li> parameter </li>
+ * <li> package </li>
+ * <li> from within {@link XmlJavaTypeAdapters} </li>
+ * </ul>
+ *
+ * <p> When <tt>@XmlJavaTypeAdapter</tt> annotation is defined on a
+ * class, it applies to all references to the class.
+ * <p> When <tt>@XmlJavaTypeAdapter</tt> annotation is defined at the
+ * package level it applies to all references from within the package
+ * to <tt>@XmlJavaTypeAdapter.type()</tt>.
+ * <p> When <tt>@XmlJavaTypeAdapter</tt> annotation is defined on the
+ * field, property or parameter, then the annotation applies to the
+ * field, property or the parameter only.
+ * <p> A <tt>@XmlJavaTypeAdapter</tt> annotation on a field, property
+ * or parameter overrides the <tt>@XmlJavaTypeAdapter</tt> annotation
+ * associated with the class being referenced by the field, property
+ * or parameter.
+ * <p> A <tt>@XmlJavaTypeAdapter</tt> annotation on a class overrides
+ * the <tt>@XmlJavaTypeAdapter</tt> annotation specified at the
+ * package level for that class.
+ *
+ * <p>This annotation can be used with the following other annotations:
+ * {@link XmlElement}, {@link XmlAttribute}, {@link XmlElementRef},
+ * {@link XmlElementRefs}, {@link XmlAnyElement}. This can also be
+ * used at the package level with the following annotations:
+ * {@link XmlAccessorType}, {@link XmlSchema}, {@link XmlSchemaType},
+ * {@link XmlSchemaTypes}.
+ *
+ * <p><b> Example: </b> See example in {@link XmlAdapter}
+ *
+ * @author <ul><li>Sekhar Vajjhala, Sun Microsystems Inc.</li> <li> Kohsuke Kawaguchi, Sun Microsystems Inc.</li></ul>
+ * @since JAXB2.0
+ * @see XmlAdapter
+ * @version $Revision: 2467 $
+ */
+
+ at Retention(RUNTIME) @Target({PACKAGE,FIELD,METHOD,TYPE,PARAMETER})
+public @interface XmlJavaTypeAdapter {
+ /**
+ * Points to the clsss that converts a value type to a bound type or vice versa.
+ * See {@link XmlAdapter} for more details.
+ */
+ Class<? extends XmlAdapter> value();
+
+ /**
+ * If this annotation is used at the package level, then value of
+ * the type() must be specified.
+ */
+
+ Class type() default DEFAULT.class;
+
+ /**
+ * Used in {@link XmlJavaTypeAdapter#type()} to
+ * signal that the type be inferred from the signature
+ * of the field, property, parameter or the class.
+ */
+
+ static final class DEFAULT {}
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation.adapters;
+
+import static java.lang.annotation.ElementType.PACKAGE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * <p>
+ * A container for multiple @{@link XmlJavaTypeAdapter} annotations.
+ *
+ * <p> Multiple annotations of the same type are not allowed on a program
+ * element. This annotation therefore serves as a container annotation
+ * for multiple @XmlJavaTypeAdapter as follows:
+ *
+ * <pre>
+ * @XmlJavaTypeAdapters ({ @XmlJavaTypeAdapter(...), at XmlJavaTypeAdapter(...) })
+ * </pre>
+ *
+ * <p>The <tt>@XmlJavaTypeAdapters</tt> annnotation is useful for
+ * defining {@link XmlJavaTypeAdapter} annotations for different types
+ * at the package level.
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * @author <ul><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ * @see XmlJavaTypeAdapter
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME) @Target({PACKAGE})
+public @interface XmlJavaTypeAdapters {
+ /**
+ * Collection of @{@link XmlJavaTypeAdapter} annotations
+ */
+ XmlJavaTypeAdapter[] value();
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/package.html
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/package.html (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/adapters/package.html 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,48 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+ <head>
+ <!--
+
+ @(#)package.html 1.60 98/01/27
+
+ Copyright 1998 Sun Microsystems, Inc. 901 San Antonio Road,
+ Palo Alto, California, 94303, U.S.A. All Rights Reserved.
+
+ This software is the confidential and proprietary information of Sun
+ Microsystems, Inc. ("Confidential Information"). You shall not
+ disclose such Confidential Information and shall use it only in
+ accordance with the terms of the license agreement you entered into
+ with Sun.
+
+ CopyrightVersion 1.2
+
+ -->
+ </head>
+
+ <body>
+ <p>
+ {@link javax.xml.bind.annotation.adapters.XmlAdapter} and its spec-defined
+ sub-classes to allow arbitrary Java classes to be used with JAXB.
+
+ <h2>Package Specification</h2>
+
+ <ul>
+ <li><a href="http://java.sun.com/xml/downloads/jaxb.html">JAXB
+ Specification</a>
+ </ul>
+
+ <h2>Related Documentation</h2>
+
+ For overviews, tutorials, examples, guides, and tool documentation,
+ please see:
+ <ul>
+ <li>The <a href="http://java.sun.com/xml/jaxb/index.html">JAXB
+ Website</a>
+ </ul>
+
+ <!-- Put @see and @since tags down here. -->
+
+ </body>
+</html>
+
+
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/package.html
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/package.html (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/annotation/package.html 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,275 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+ <head>
+ <!--
+
+ @(#)package.html 1.60 98/01/27
+
+ Copyright 1998 Sun Microsystems, Inc. 901 San Antonio Road,
+ Palo Alto, California, 94303, U.S.A. All Rights Reserved.
+
+ This software is the confidential and proprietary information of Sun
+ Microsystems, Inc. ("Confidential Information"). You shall not
+ disclose such Confidential Information and shall use it only in
+ accordance with the terms of the license agreement you entered into
+ with Sun.
+
+ CopyrightVersion 1.2
+
+ -->
+ </head>
+
+ <body bgcolor="white">
+
+ <p>
+ Defines annotations for customizing Java program elements to XML Schema mapping.
+
+ <h2>Package Specification</h2>
+ <p>The following table shows the JAXB mapping annotations
+ that can be associated with each program element. </p>
+
+ <table border="1" cellpadding="4" cellspacing="3">
+ <tbody>
+ <tr>
+ <td><b>Program Element</td>
+ <td><b>JAXB annotation</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b>Package</td>
+ <td>
+ <table>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlAccessorOrder.html">XmlAccessorOrder</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlAccessorType.html">XmlAccessorType</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlSchema.html">XmlSchema</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlSchemaType.html">XmlSchemaType</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlSchemaTypes.html">XmlSchemaTypes</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.html">XmlJavaTypeAdapter</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.html">XmlJavaTypeAdapters</b></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><b>Class</td>
+ <td>
+ <table>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlAccessorOrder.html">XmlAccessorOrder</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlAccessorType.html">XmlAccessorType</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlInlineBinaryData.html">XmlInlineBinaryData</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlRootElement.html">XmlRootElement</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlType.html">XmlType</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.html">XmlJavaTypeAdapter</b></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><b>Enum type</td>
+ <td>
+ <table>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlEnum.html">XmlEnum</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlEnumValue.html">XmlEnumValue (enum constant only)</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlRootElement.html">XmlRootElement</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlType.html">XmlType</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.html">XmlJavaTypeAdapter</b></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><b>JavaBean Property/field</td>
+ <td>
+ <table>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlElement.html">XmlElement</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlElements.html">XmlElements</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlElementRef.html">XmlElementRef</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlElementRefs.html">XmlElementRefs</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlElementWrapper.html">XmlElementWrapper</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlAnyElement.html">XmlAnyElement</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlAttribute.html">XmlAttribute</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlAnyAttribute.html">XmlAnyAttribute</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlTransient.html">XmlTransient</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlValue.html">XmlValue</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlID.html">XmlID</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlIDREF.html">XmlIDREF</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlList.html">XmlList</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlMixed.html">XmlMixed</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlMimeType.html">XmlMimeType</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlAttachmentRef.html">XmlAttachmentRef</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlInlineBinaryData.html">XmlInlineBinaryData</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlElementDecl.html">XmlElementDecl (only on method)</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.html">XmlJavaTypeAdapter</b></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><b>Parameter</td>
+ <td>
+ <table>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlList.html">XmlList</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlAttachmentRef.html">XmlAttachmentRef</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlMimeType.html">XmlMimeType</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.html">XmlJavaTypeAdapter</b></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ </tbody>
+ </table>
+ <h3>Terminology</h3>
+ <p>
+ <b>JavaBean property and field:</b> For the purposes of
+ mapping, there is no semantic difference between a field and
+ a JavaBean property. Thus, an annotation that can be applied
+ to a JavaBean property can always be applied to a
+ field. Hence in the Javadoc documentation, for brevity, the
+ term JavaBean property or property is used to mean either JavaBean
+ property or a field. Where required, both are explicitly
+ mentioned.
+ <p>
+ <b>top level class:</b> For the purpose of mapping, there is
+ no semantic difference between a top level class and a
+ static nested class. Thus, an annotation that can be applied
+ to a top level class, can always be applied to a nested
+ static class. Hence in the Javadoc documentation, for
+ brevity, the term "top level class" or just class is used to
+ mean either a top level class or a nested static
+ class.
+ <p>
+ <b>mapping annotation:</b>A JAXB 2.0 defined program
+ annotation based on the JSR 175 programming annotation
+ facility.
+ <h3>Common Usage Constraints</h3>
+ <p>The following usage constraints are defined here since
+ they apply to more than annotation:
+ <ul>
+ <li> For a property, a given annotation can be applied to
+ either read or write property but not both. </li>
+
+ <li> A property name must be different from any other
+ property name in any of the super classes of the
+ class being mapped. </li>
+
+ <li> A mapped field name or the decapitalized name of a
+ mapped property must be unique within a class. </li>
+ </ul>
+ <h3>Notations</h3>
+ <b>Namespace prefixes</b>
+ <p>The following namespace prefixes are used in the XML Schema
+ fragments in this package.<p>
+
+ <table border="1" cellpadding="4" cellspacing="3">
+ <tbody>
+ <tr>
+ <td><b>Prefix</td>
+ <td><b>Namespace</b></td>
+ <td><b>Notes</b></td>
+ </tr>
+
+ <tr valign="top">
+ <td>xs</td>
+ <td>http://www.w3.org/2001/XMLSchema</td>
+ <td>Namespace of XML Schema namespace</td>
+ </tr>
+ <tr valign="top">
+ <td>ref</td>
+ <td>http://ws-i.org/profiles/basic/1.1/xsd</td>
+ <td>Namespace for swaref schema component</td>
+ </tr>
+ <tr valign="top">
+ <td>xsi</td>
+ <td>http://www.w3.org/2001/XMLSchema-instance</td>
+ <td>XML Schema namespace for instances</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <!-- Put @see and @since tags down here. -->
+ @since JAXB 2.0
+ </body>
+</html>
+
+
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/attachment/AttachmentMarshaller.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/attachment/AttachmentMarshaller.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/attachment/AttachmentMarshaller.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,176 @@
+package javax.xml.bind.attachment;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.Marshaller;
+
+/**
+ * <p>Enable JAXB marshalling to optimize storage of binary data.</p>
+ *
+ * <p>This API enables an efficient cooperative creation of optimized
+ * binary data formats between a JAXB marshalling process and a MIME-based package
+ * processor. A JAXB implementation marshals the root body of a MIME-based package,
+ * delegating the creation of referenceable MIME parts to
+ * the MIME-based package processor that implements this abstraction.</p>
+ *
+ * <p>XOP processing is enabled when {@link #isXOPPackage()} is true.
+ * See {@link #addMtomAttachment(DataHandler, String, String)} for details.
+ * </p>
+ *
+ * <p>WS-I Attachment Profile 1.0 is supported by
+ * {@link #addSwaRefAttachment(DataHandler)} being called by the
+ * marshaller for each JAXB property related to
+ * {http://ws-i.org/profiles/basic/1.1/xsd}swaRef.</p>
+ *
+ *
+ * @author Marc Hadley
+ * @author Kohsuke Kawaguchi
+ * @author Joseph Fialli
+ * @since JAXB 2.0
+ *
+ * @see Marshaller#setAttachmentMarshaller(AttachmentMarshaller)
+ *
+ * @see <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/">XML-binary Optimized Packaging</a>
+ * @see <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html">WS-I Attachments Profile Version 1.0.</a>
+ */
+public abstract class AttachmentMarshaller {
+
+ /**
+ * <p>Consider MIME content <code>data</code> for optimized binary storage as an attachment.
+ *
+ * <p>
+ * This method is called by JAXB marshal process when {@link #isXOPPackage()} is
+ * <code>true</code>, for each element whose datatype is "base64Binary", as described in
+ * Step 3 in
+ * <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/#creating_xop_packages">Creating XOP Packages</a>.
+ *
+ * <p>
+ * The method implementor determines whether <code>data</code> shall be attached separately
+ * or inlined as base64Binary data. If the implementation chooses to optimize the storage
+ * of the binary data as a MIME part, it is responsible for attaching <code>data</code> to the
+ * MIME-based package, and then assigning an unique content-id, cid, that identifies
+ * the MIME part within the MIME message. This method returns the cid,
+ * which enables the JAXB marshaller to marshal a XOP element that refers to that cid in place
+ * of marshalling the binary data. When the method returns null, the JAXB marshaller
+ * inlines <code>data</code> as base64binary data.
+ *
+ * <p>
+ * The caller of this method is required to meet the following constraint.
+ * If the element infoset item containing <code>data</code> has the attribute
+ * <code>xmime:contentType</code> or if the JAXB property/field representing
+ * <code>data</code>is annotated with a known MIME type,
+ * <code>data.getContentType()</code> should be set to that MIME type.
+ *
+ * <p>
+ * The <code>elementNamespace</code> and <code>elementLocalName</code>
+ * parameters provide the
+ * context that contains the binary data. This information could
+ * be used by the MIME-based package processor to determine if the
+ * binary data should be inlined or optimized as an attachment.
+ *
+ * @param data
+ * represents the data to be attached. Must be non-null.
+ * @param elementNamespace
+ * the namespace URI of the element that encloses the base64Binary data.
+ * Can be empty but never null.
+ * @param elementLocalName
+ * The local name of the element. Always a non-null valid string.
+ *
+ * @return
+ * a valid content-id URI (see <a href="http://www.w3.org/TR/xop10/#RFC2387">RFC 2387</a>) that identifies the attachment containing <code>data</code>.
+ * Otherwise, null if the attachment was not added and should instead be inlined in the message.
+ *
+ * @see <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/">XML-binary Optimized Packaging</a>
+ * @see <a href="http://www.w3.org/TR/xml-media-types/">Describing Media Content of Binary Data in XML</a>
+ */
+ public abstract String addMtomAttachment(DataHandler data, String elementNamespace, String elementLocalName);
+
+ /**
+ * <p>Consider binary <code>data</code> for optimized binary storage as an attachment.
+ *
+ * <p>Since content type is not known, the attachment's MIME content type must be set to "application/octet-stream".</p>
+ *
+ * <p>
+ * The <code>elementNamespace</code> and <code>elementLocalName</code>
+ * parameters provide the
+ * context that contains the binary data. This information could
+ * be used by the MIME-based package processor to determine if the
+ * binary data should be inlined or optimized as an attachment.
+ *
+ * @param data
+ * represents the data to be attached. Must be non-null. The actual data region is
+ * specified by <tt>(data,offset,length)</tt> tuple.
+ *
+ * @param offset
+ * The offset within the array of the first byte to be read;
+ * must be non-negative and no larger than array.length
+ *
+ * @param length
+ * The number of bytes to be read from the given array;
+ * must be non-negative and no larger than array.length
+ *
+ * @param mimeType
+ * If the data has an associated MIME type known to JAXB, that is passed
+ * as this parameter. If none is known, "application/octet-stream".
+ * This parameter may never be null.
+ *
+ * @param elementNamespace
+ * the namespace URI of the element that encloses the base64Binary data.
+ * Can be empty but never null.
+ *
+ * @param elementLocalName
+ * The local name of the element. Always a non-null valid string.
+ *
+ * @return content-id URI, cid, to the attachment containing
+ * <code>data</code> or null if data should be inlined.
+ *
+ * @see #addMtomAttachment(DataHandler, String, String)
+ */
+ public abstract String addMtomAttachment(byte[] data, int offset, int length, String mimeType, String elementNamespace, String elementLocalName);
+
+ /**
+ * <p>Read-only property that returns true if JAXB marshaller should enable XOP creation.</p>
+ *
+ * <p>This value must not change during the marshalling process. When this
+ * value is true, the <code>addMtomAttachment(...)</code> method
+ * is invoked when the appropriate binary datatypes are encountered by
+ * the marshal process.</p>
+ *
+ * <p>Marshaller.marshal() must throw IllegalStateException if this value is <code>true</code>
+ * and the XML content to be marshalled violates Step 1 in
+ * <a ref="http://www.w3.org/TR/2005/REC-xop10-20050125/#creating_xop_packages">Creating XOP Pacakges</a>
+ * http://www.w3.org/TR/2005/REC-xop10-20050125/#creating_xop_packages.
+ * <i>"Ensure the Original XML Infoset contains no element information item with a
+ * [namespace name] of "http://www.w3.org/2004/08/xop/include" and a [local name] of Include"</i>
+ *
+ * <p>When this method returns true and during the marshal process
+ * at least one call to <code>addMtomAttachment(...)</code> returns
+ * a content-id, the MIME-based package processor must label the
+ * root part with the application/xop+xml media type as described in
+ * Step 5 of
+ * <a ref="http://www.w3.org/TR/2005/REC-xop10-20050125/#creating_xop_packages">Creating XOP Pacakges</a>.<p>
+ *
+ * @return true when MIME context is a XOP Package.
+ */
+ public boolean isXOPPackage() { return false; }
+
+ /**
+ * <p>Add MIME <code>data</code> as an attachment and return attachment's content-id, cid.</p>
+ *
+ * <p>
+ * This method is called by JAXB marshal process for each element/attribute typed as
+ * {http://ws-i.org/profiles/basic/1.1/xsd}swaRef. The MIME-based package processor
+ * implementing this method is responsible for attaching the specified data to a
+ * MIME attachment, and generating a content-id, cid, that uniquely identifies the attachment
+ * within the MIME-based package.
+ *
+ * <p>Caller inserts the returned content-id, cid, into the XML content being marshalled.</p>
+ *
+ * @param data
+ * represents the data to be attached. Must be non-null.
+ * @return
+ * must be a valid URI used as cid. Must satisfy Conformance Requirement R2928 from
+ * <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html#Referencing_Attachments_from_the_SOAP_Envelope">WS-I Attachments Profile Version 1.0.</a>
+ */
+ public abstract String addSwaRefAttachment(DataHandler data);
+}
+
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/attachment/AttachmentUnmarshaller.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/attachment/AttachmentUnmarshaller.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/attachment/AttachmentUnmarshaller.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,117 @@
+package javax.xml.bind.attachment;
+
+import javax.activation.DataHandler;
+
+/**
+ * <p>Enables JAXB unmarshalling of a root document containing optimized binary data formats.</p>
+ *
+ * <p>This API enables an efficient cooperative processing of optimized
+ * binary data formats between a JAXB 2.0 implementation and MIME-based package
+ * processor (MTOM/XOP and WS-I AP 1.0). JAXB unmarshals the body of a package, delegating the
+ * understanding of the packaging format being used to a MIME-based
+ * package processor that implements this abstract class.</p>
+ *
+ * <p>This abstract class identifies if a package requires XOP processing, {@link #isXOPPackage()} and provides retrieval of binary content stored as attachments by content-id.</p>
+ *
+ * <h2>Identifying the content-id, cid, to pass to <code>getAttachment*(String cid)</code></h2>
+ * <ul>
+ * <li>
+ * For XOP processing, the infoset representation of the cid is described
+ * in step 2a in
+ * <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/#interpreting_xop_packages">Section 3.2 Interpreting XOP Packages</a>
+ * </li>
+ * <li>
+ * For WS-I AP 1.0, the cid is identified as an element or attribute of
+ * type <code>ref:swaRef </code> specified in
+ * <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html#Referencing_Attachments_from_the_SOAP_Envelope">Section 4.4 Referencing Attachments from the SOAP Envelope</a>
+ * </li>
+ * </ul>
+ *
+ * @author Marc Hadley
+ * @author Kohsuke Kawaguchi
+ * @author Joseph Fialli
+ *
+ * @since JAXB 2.0
+ *
+ * @see javax.xml.bind.Unmarshaller#setAttachmentUnmarshaller(AttachmentUnmarshaller)
+ *
+ * @see <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/">XML-binary Optimized Packaging</a>
+ * @see <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html">WS-I Attachments Profile Version 1.0.</a>
+ * @see <a href="http://www.w3.org/TR/xml-media-types/">Describing Media Content of Binary Data in XML</a>
+ */
+public abstract class AttachmentUnmarshaller {
+ /**
+ * <p>Lookup MIME content by content-id, <code>cid</code>, and return as a {@link DataHandler}.</p>
+ *
+ * <p>The returned <code>DataHandler</code> instance must be configured
+ * to meet the following required mapping constaint.
+ * <table border="2" rules="all" cellpadding="4">
+ * <thead>
+ * <tr>
+ * <th align="center" colspan="2">
+ * Required Mappings between MIME and Java Types
+ * </tr>
+ * <tr>
+ * <th>MIME Type</th>
+ * <th>Java Type</th>
+ * </tr>
+ * </tr>
+ * <tr>
+ * <th><code>DataHandler.getContentType()</code></th>
+ * <th><code>instanceof DataHandler.getContent()</code></th>
+ * </tr>
+ * </thead>
+ * <tbody>
+ * <tr>
+ * <td>image/gif</td>
+ * <td>java.awt.Image</td>
+ * </tr>
+ * <tr>
+ * <td>image/jpeg</td>
+ * <td>java.awt.Image</td>
+ * </tr>
+ * <tr>
+ * <td>text/xml or application/xml</td>
+ * <td>javax.xml.transform.Source</td>
+ * </tr>
+ * </tbody>
+ * </table>
+ * Note that it is allowable to support additional mappings.</p>
+ *
+ * @param cid It is expected to be a valid lexical form of the XML Schema
+ * <code>xs:anyURI</code> datatype. If <code>{@link #isXOPPackage()}
+ * ==true</code>, it must be a valid URI per the <code>cid:</code> URI scheme (see <a href="http://www.ietf.org/rfc/rfc2387.txt">RFC 2387</a>)
+ *
+ * @return
+ * a {@link DataHandler} that represents the MIME attachment.
+ *
+ * @throws IllegalArgumentException if the attachment for the given cid is not found.
+ */
+ public abstract DataHandler getAttachmentAsDataHandler(String cid);
+
+ /**
+ * <p>Retrieve the attachment identified by content-id, <code>cid</code>, as a <tt>byte[]</tt></p>.
+ *
+ * @param cid It is expected to be a valid lexical form of the XML Schema
+ * <code>xs:anyURI</code> datatype. If <code>{@link #isXOPPackage()}
+ * ==true</code>, it must be a valid URI per the <code>cid:</code> URI scheme (see <a href="http://www.ietf.org/rfc/rfc2387.txt">RFC 2387</a>)
+ *
+ * @return byte[] representation of attachment identified by cid.
+ *
+ * @throws IllegalArgumentException if the attachment for the given cid is not found.
+ */
+ public abstract byte[] getAttachmentAsByteArray(String cid);
+
+ /**
+ * <p>Read-only property that returns true if JAXB unmarshaller needs to perform XOP processing.</p>
+ *
+ * <p>This method returns <code>true</code> when the constraints specified
+ * in <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/#identifying_xop_documents">Identifying XOP Documents</a> are met.
+ * This value must not change during the unmarshalling process.</p>
+ *
+ * @return true when MIME context is a XOP Document.
+ */
+ public boolean isXOPPackage() { return false; }
+}
+
+
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/attachment/package.html
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/attachment/package.html (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/attachment/package.html 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,57 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+ <head>
+ <!--
+
+ @(#)package.html 1.60 98/01/27
+
+ Copyright 1998 Sun Microsystems, Inc. 901 San Antonio Road,
+ Palo Alto, California, 94303, U.S.A. All Rights Reserved.
+
+ This software is the confidential and proprietary information of Sun
+ Microsystems, Inc. ("Confidential Information"). You shall not
+ disclose such Confidential Information and shall use it only in
+ accordance with the terms of the license agreement you entered into
+ with Sun.
+
+ CopyrightVersion 1.2
+
+ -->
+ </head>
+
+ <body bgcolor="white">
+
+ <p>
+ This package is implemented by a MIME-based package processor that
+ enables the interpretation and creation of optimized binary data
+ within an MIME-based package format.
+
+ <p>
+ Soap MTOM[1], XOP([2][3]) and WS-I AP[4] standardize approaches to
+ optimized transmission of binary datatypes as an attachment.
+ To optimally support these standards within a message passing
+ environment, this package enables an integrated solution between
+ a MIME-based package processor and JAXB unmarshall/marshal processes.
+
+ <h2>Package Specification</h2>
+
+ <ul>
+ <li><a href="http://java.sun.com/xml/downloads/jaxb.html">JAXB
+ Specification</a>
+ </ul>
+
+ <h2>Related Standards</h2>
+
+ <ul>
+ <li><a href="http://www.w3.org/TR/2004/WD-soap12-mtom-20040608/">[1]SOAP Message Transmission Optimization Mechanism</a> </li>
+ <li><a href="http://www.w3.org/TR/2005/REC-xop10-20050125/">[2]XML-binary Optimized Packaging</a></li>
+ <li><a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html">[3]WS-I Attachments Profile Version 1.0.</a></li>
+ <li><a href="http://www.w3.org/TR/xml-media-types/">[4]Describing Media Content of Binary Data in XML</a></li>
+ </ul>
+
+ <!-- Put @see and @since tags down here. -->
+ @since JAXB 2.0
+ </body>
+</html>
+
+
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/AbstractMarshallerImpl.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/AbstractMarshallerImpl.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/AbstractMarshallerImpl.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,461 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+package javax.xml.bind.helpers;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.PropertyException;
+import javax.xml.bind.ValidationEventHandler;
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+import javax.xml.bind.attachment.AttachmentMarshaller;
+import javax.xml.stream.XMLEventWriter;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.sax.SAXResult;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.validation.Schema;
+import java.io.UnsupportedEncodingException;
+// J2SE1.4 feature
+// import java.nio.charset.Charset;
+// import java.nio.charset.UnsupportedCharsetException;
+
+/**
+ * Partial default <tt>Marshaller</tt> implementation.
+ *
+ * <p>
+ * This class provides a partial default implementation for the
+ * {@link javax.xml.bind.Marshaller} interface.
+ *
+ * <p>
+ * The only methods that a JAXB Provider has to implement are
+ * {@link Marshaller#marshal(Object, javax.xml.transform.Result) marshal(Object, javax.xml.transform.Result)},
+ * {@link Marshaller#marshal(Object, javax.xml.transform.Result) marshal(Object, javax.xml.stream.XMLStreamWriter)}, and
+ * {@link Marshaller#marshal(Object, javax.xml.transform.Result) marshal(Object, javax.xml.stream.XMLEventWriter)}.
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $ $Date: 2006/03/08 17:00:39 $
+ * @see javax.xml.bind.Marshaller
+ * @since JAXB1.0
+ */
+public abstract class AbstractMarshallerImpl implements Marshaller
+{
+ /** handler that will be used to process errors and warnings during marshal */
+ private ValidationEventHandler eventHandler =
+ new DefaultValidationEventHandler();
+
+ //J2SE1.4 feature
+ //private Charset encoding = null;
+
+ /** store the value of the encoding property. */
+ private String encoding = "UTF-8";
+
+ /** store the value of the schemaLocation property. */
+ private String schemaLocation = null;
+
+ /** store the value of the noNamespaceSchemaLocation property. */
+ private String noNSSchemaLocation = null;
+
+ /** store the value of the formattedOutput property. */
+ private boolean formattedOutput = false;
+
+ /** store the value of the fragment property. */
+ private boolean fragment = false;
+
+ public final void marshal( Object obj, java.io.OutputStream os )
+ throws JAXBException {
+
+ checkNotNull( obj, "obj", os, "os" );
+ marshal( obj, new StreamResult(os) );
+ }
+
+ public final void marshal( Object obj, java.io.Writer w )
+ throws JAXBException {
+
+ checkNotNull( obj, "obj", w, "writer" );
+ marshal( obj, new StreamResult(w) );
+ }
+
+ public final void marshal( Object obj, org.xml.sax.ContentHandler handler )
+ throws JAXBException {
+
+ checkNotNull( obj, "obj", handler, "handler" );
+ marshal( obj, new SAXResult(handler) );
+ }
+
+ public final void marshal( Object obj, org.w3c.dom.Node node )
+ throws JAXBException {
+
+ checkNotNull( obj, "obj", node, "node" );
+ marshal( obj, new DOMResult(node) );
+ }
+
+ /**
+ * By default, the getNode method is unsupported and throw
+ * an {@link java.lang.UnsupportedOperationException}.
+ *
+ * Implementations that choose to support this method must
+ * override this method.
+ */
+ public org.w3c.dom.Node getNode( Object obj ) throws JAXBException {
+
+ checkNotNull( obj, "obj", Boolean.TRUE, "foo" );
+
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Convenience method for getting the current output encoding.
+ *
+ * @return the current encoding or "UTF-8" if it hasn't been set.
+ */
+ protected String getEncoding() {
+ return encoding;
+ }
+
+ /**
+ * Convenience method for setting the output encoding.
+ *
+ * @param encoding a valid encoding as specified in the Marshaller class
+ * documentation
+ */
+ protected void setEncoding( String encoding ) {
+ this.encoding = encoding;
+ }
+
+ /**
+ * Convenience method for getting the current schemaLocation.
+ *
+ * @return the current schemaLocation or null if it hasn't been set
+ */
+ protected String getSchemaLocation() {
+ return schemaLocation;
+ }
+
+ /**
+ * Convenience method for setting the schemaLocation.
+ *
+ * @param location the schemaLocation value
+ */
+ protected void setSchemaLocation( String location ) {
+ schemaLocation = location;
+ }
+
+ /**
+ * Convenience method for getting the current noNamespaceSchemaLocation.
+ *
+ * @return the current noNamespaceSchemaLocation or null if it hasn't
+ * been set
+ */
+ protected String getNoNSSchemaLocation() {
+ return noNSSchemaLocation;
+ }
+
+ /**
+ * Convenience method for setting the noNamespaceSchemaLocation.
+ *
+ * @param location the noNamespaceSchemaLocation value
+ */
+ protected void setNoNSSchemaLocation( String location ) {
+ noNSSchemaLocation = location;
+ }
+
+ /**
+ * Convenience method for getting the formatted output flag.
+ *
+ * @return the current value of the formatted output flag or false if
+ * it hasn't been set.
+ */
+ protected boolean isFormattedOutput() {
+ return formattedOutput;
+ }
+
+ /**
+ * Convenience method for setting the formatted output flag.
+ *
+ * @param v value of the formatted output flag.
+ */
+ protected void setFormattedOutput( boolean v ) {
+ formattedOutput = v;
+ }
+
+
+ /**
+ * Convenience method for getting the fragment flag.
+ *
+ * @return the current value of the fragment flag or false if
+ * it hasn't been set.
+ */
+ protected boolean isFragment() {
+ return fragment;
+ }
+
+ /**
+ * Convenience method for setting the fragment flag.
+ *
+ * @param v value of the fragment flag.
+ */
+ protected void setFragment( boolean v ) {
+ fragment = v;
+ }
+
+
+ static String[] aliases = {
+ "UTF-8", "UTF8",
+ "UTF-16", "Unicode",
+ "UTF-16BE", "UnicodeBigUnmarked",
+ "UTF-16LE", "UnicodeLittleUnmarked",
+ "US-ASCII", "ASCII",
+ "TIS-620", "TIS620",
+
+ // taken from the project-X parser
+ "ISO-10646-UCS-2", "Unicode",
+
+ "EBCDIC-CP-US", "cp037",
+ "EBCDIC-CP-CA", "cp037",
+ "EBCDIC-CP-NL", "cp037",
+ "EBCDIC-CP-WT", "cp037",
+
+ "EBCDIC-CP-DK", "cp277",
+ "EBCDIC-CP-NO", "cp277",
+ "EBCDIC-CP-FI", "cp278",
+ "EBCDIC-CP-SE", "cp278",
+
+ "EBCDIC-CP-IT", "cp280",
+ "EBCDIC-CP-ES", "cp284",
+ "EBCDIC-CP-GB", "cp285",
+ "EBCDIC-CP-FR", "cp297",
+
+ "EBCDIC-CP-AR1", "cp420",
+ "EBCDIC-CP-HE", "cp424",
+ "EBCDIC-CP-BE", "cp500",
+ "EBCDIC-CP-CH", "cp500",
+
+ "EBCDIC-CP-ROECE", "cp870",
+ "EBCDIC-CP-YU", "cp870",
+ "EBCDIC-CP-IS", "cp871",
+ "EBCDIC-CP-AR2", "cp918",
+
+ // IANA also defines two that JDK 1.2 doesn't handle:
+ // EBCDIC-CP-GR --> CP423
+ // EBCDIC-CP-TR --> CP905
+ };
+
+ /**
+ * Gets the corresponding Java encoding name from an IANA name.
+ *
+ * This method is a helper method for the derived class to convert
+ * encoding names.
+ *
+ * @exception UnsupportedEncodingException
+ * If this implementation couldn't find the Java encoding name.
+ */
+ protected String getJavaEncoding( String encoding ) throws UnsupportedEncodingException {
+ try {
+ "1".getBytes(encoding);
+ return encoding;
+ } catch( UnsupportedEncodingException e ) {
+ // try known alias
+ for( int i=0; i<aliases.length; i+=2 ) {
+ if(encoding.equals(aliases[i])) {
+ "1".getBytes(aliases[i+1]);
+ return aliases[i+1];
+ }
+ }
+
+ throw new UnsupportedEncodingException(encoding);
+ }
+ /* J2SE1.4 feature
+ try {
+ this.encoding = Charset.forName( _encoding );
+ } catch( UnsupportedCharsetException uce ) {
+ throw new JAXBException( uce );
+ }
+ */
+ }
+
+ /**
+ * Default implementation of the setProperty method handles
+ * the four defined properties in Marshaller. If a provider
+ * needs to handle additional properties, it should override
+ * this method in a derived class.
+ */
+ public void setProperty( String name, Object value )
+ throws PropertyException {
+
+ if( name == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "name" ) );
+ }
+
+ // recognize and handle four pre-defined properties.
+ if( JAXB_ENCODING.equals(name) ) {
+ checkString( name, value );
+ setEncoding( (String)value );
+ return;
+ }
+ if( JAXB_FORMATTED_OUTPUT.equals(name) ) {
+ checkBoolean( name, value );
+ setFormattedOutput((Boolean) value );
+ return;
+ }
+ if( JAXB_NO_NAMESPACE_SCHEMA_LOCATION.equals(name) ) {
+ checkString( name, value );
+ setNoNSSchemaLocation( (String)value );
+ return;
+ }
+ if( JAXB_SCHEMA_LOCATION.equals(name) ) {
+ checkString( name, value );
+ setSchemaLocation( (String)value );
+ return;
+ }
+ if( JAXB_FRAGMENT.equals(name) ) {
+ checkBoolean(name, value);
+ setFragment((Boolean) value );
+ return;
+ }
+
+ throw new PropertyException(name, value);
+ }
+
+ /**
+ * Default implementation of the getProperty method handles
+ * the four defined properties in Marshaller. If a provider
+ * needs to support additional provider specific properties,
+ * it should override this method in a derived class.
+ */
+ public Object getProperty( String name )
+ throws PropertyException {
+
+ if( name == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "name" ) );
+ }
+
+ // recognize and handle four pre-defined properties.
+ if( JAXB_ENCODING.equals(name) )
+ return getEncoding();
+ if( JAXB_FORMATTED_OUTPUT.equals(name) )
+ return isFormattedOutput()?Boolean.TRUE:Boolean.FALSE;
+ if( JAXB_NO_NAMESPACE_SCHEMA_LOCATION.equals(name) )
+ return getNoNSSchemaLocation();
+ if( JAXB_SCHEMA_LOCATION.equals(name) )
+ return getSchemaLocation();
+ if( JAXB_FRAGMENT.equals(name) )
+ return isFragment()?Boolean.TRUE:Boolean.FALSE;
+
+ throw new PropertyException(name);
+ }
+ /**
+ * @see javax.xml.bind.Marshaller#getEventHandler()
+ */
+ public ValidationEventHandler getEventHandler() throws JAXBException {
+ return eventHandler;
+ }
+
+ /**
+ * @see javax.xml.bind.Marshaller#setEventHandler(ValidationEventHandler)
+ */
+ public void setEventHandler(ValidationEventHandler handler)
+ throws JAXBException {
+
+ if( handler == null ) {
+ eventHandler = new DefaultValidationEventHandler();
+ } else {
+ eventHandler = handler;
+ }
+ }
+
+
+
+
+ /*
+ * assert that the given object is a Boolean
+ */
+ private void checkBoolean( String name, Object value ) throws PropertyException {
+ if(!(value instanceof Boolean))
+ throw new PropertyException(
+ Messages.format( Messages.MUST_BE_BOOLEAN, name ) );
+ }
+
+ /*
+ * assert that the given object is a String
+ */
+ private void checkString( String name, Object value ) throws PropertyException {
+ if(!(value instanceof String))
+ throw new PropertyException(
+ Messages.format( Messages.MUST_BE_STRING, name ) );
+ }
+
+ /*
+ * assert that the parameters are not null
+ */
+ private void checkNotNull( Object o1, String o1Name,
+ Object o2, String o2Name ) {
+
+ if( o1 == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, o1Name ) );
+ }
+ if( o2 == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, o2Name ) );
+ }
+ }
+ /* (non-Javadoc)
+ * @see javax.xml.bind.Marshaller#marshal(java.lang.Object, javax.xml.stream.XMLEventWriter)
+ */
+ public void marshal(Object obj, XMLEventWriter writer)
+ throws JAXBException {
+
+ throw new UnsupportedOperationException();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.xml.bind.Marshaller#marshal(java.lang.Object, javax.xml.stream.XMLStreamWriter)
+ */
+ public void marshal(Object obj, XMLStreamWriter writer)
+ throws JAXBException {
+
+ throw new UnsupportedOperationException();
+ }
+
+ public void setSchema(Schema schema) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Schema getSchema() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setAdapter(XmlAdapter adapter) {
+ if(adapter==null)
+ throw new IllegalArgumentException();
+ setAdapter((Class)adapter.getClass(),adapter);
+ }
+
+ public <A extends XmlAdapter> void setAdapter(Class<A> type, A adapter) {
+ throw new UnsupportedOperationException();
+ }
+
+ public <A extends XmlAdapter> A getAdapter(Class<A> type) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setAttachmentMarshaller(AttachmentMarshaller am) {
+ throw new UnsupportedOperationException();
+ }
+
+ public AttachmentMarshaller getAttachmentMarshaller() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setListener(Listener listener) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Listener getListener() {
+ throw new UnsupportedOperationException();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,415 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+package javax.xml.bind.helpers;
+
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.w3c.dom.Node;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.PropertyException;
+import javax.xml.bind.UnmarshalException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.ValidationEventHandler;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+import javax.xml.bind.attachment.AttachmentUnmarshaller;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import java.io.File;
+import java.io.Reader;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+/**
+ * Partial default <tt>Unmarshaller</tt> implementation.
+ *
+ * <p>
+ * This class provides a partial default implementation for the
+ * {@link javax.xml.bind.Unmarshaller}interface.
+ *
+ * <p>
+ * A JAXB Provider has to implement five methods (getUnmarshallerHandler,
+ * unmarshal(Node), unmarshal(XMLReader,InputSource),
+ * unmarshal(XMLStreamReader), and unmarshal(XMLEventReader).
+ *
+ * @author <ul>
+ * <li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li>
+ * </ul>
+ * @version $Revision: 2467 $ $Date: 2006/03/08 17:01:00 $
+ * @see javax.xml.bind.Unmarshaller
+ * @since JAXB1.0
+ */
+public abstract class AbstractUnmarshallerImpl implements Unmarshaller
+{
+ /** handler that will be used to process errors and warnings during unmarshal */
+ private ValidationEventHandler eventHandler =
+ new DefaultValidationEventHandler();
+
+ /** whether or not the unmarshaller will validate */
+ protected boolean validating = false;
+
+ /**
+ * XMLReader that will be used to parse a document.
+ */
+ private XMLReader reader = null;
+
+ /**
+ * Obtains a configured XMLReader.
+ *
+ * This method is used when the client-specified
+ * {@link SAXSource} object doesn't have XMLReader.
+ *
+ * {@link Unmarshaller} is not re-entrant, so we will
+ * only use one instance of XMLReader.
+ */
+ protected XMLReader getXMLReader() throws JAXBException {
+ if(reader==null) {
+ try {
+ SAXParserFactory parserFactory;
+ parserFactory = SAXParserFactory.newInstance();
+ parserFactory.setNamespaceAware(true);
+ // there is no point in asking a validation because
+ // there is no guarantee that the document will come with
+ // a proper schemaLocation.
+ parserFactory.setValidating(false);
+ reader = parserFactory.newSAXParser().getXMLReader();
+ } catch( ParserConfigurationException e ) {
+ throw new JAXBException(e);
+ } catch( SAXException e ) {
+ throw new JAXBException(e);
+ }
+ }
+ return reader;
+ }
+
+ public Object unmarshal( Source source ) throws JAXBException {
+ if( source == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "source" ) );
+ }
+
+ if(source instanceof SAXSource)
+ return unmarshal( (SAXSource)source );
+ if(source instanceof StreamSource)
+ return unmarshal( streamSourceToInputSource((StreamSource)source));
+ if(source instanceof DOMSource)
+ return unmarshal( ((DOMSource)source).getNode() );
+
+ // we don't handle other types of Source
+ throw new IllegalArgumentException();
+ }
+
+ // use the client specified XMLReader contained in the SAXSource.
+ private Object unmarshal( SAXSource source ) throws JAXBException {
+
+ XMLReader reader = source.getXMLReader();
+ if( reader == null )
+ reader = getXMLReader();
+
+ return unmarshal( reader, source.getInputSource() );
+ }
+
+ /**
+ * Unmarshals an object by using the specified XMLReader and the InputSource.
+ *
+ * The callee should call the setErrorHandler method of the XMLReader
+ * so that errors are passed to the client-specified ValidationEventHandler.
+ */
+ protected abstract Object unmarshal( XMLReader reader, InputSource source ) throws JAXBException;
+
+ public final Object unmarshal( InputSource source ) throws JAXBException {
+ if( source == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "source" ) );
+ }
+
+ return unmarshal( getXMLReader(), source );
+ }
+
+
+ private Object unmarshal( String url ) throws JAXBException {
+ return unmarshal( new InputSource(url) );
+ }
+
+ public final Object unmarshal( URL url ) throws JAXBException {
+ if( url == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "url" ) );
+ }
+
+ return unmarshal( url.toExternalForm() );
+ }
+
+ public final Object unmarshal( File f ) throws JAXBException {
+ if( f == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "file" ) );
+ }
+
+ try {
+ // copied from JAXP
+ String path = f.getAbsolutePath();
+ if (File.separatorChar != '/')
+ path = path.replace(File.separatorChar, '/');
+ if (!path.startsWith("/"))
+ path = "/" + path;
+ if (!path.endsWith("/") && f.isDirectory())
+ path = path + "/";
+ return unmarshal(new URL("file", "", path));
+ } catch( MalformedURLException e ) {
+ throw new IllegalArgumentException(e.getMessage());
+ }
+ }
+
+ public final Object unmarshal( java.io.InputStream is )
+ throws JAXBException {
+
+ if( is == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "is" ) );
+ }
+
+ InputSource isrc = new InputSource( is );
+ return unmarshal( isrc );
+ }
+
+ public final Object unmarshal( Reader reader ) throws JAXBException {
+ if( reader == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "reader" ) );
+ }
+
+ InputSource isrc = new InputSource( reader );
+ return unmarshal( isrc );
+ }
+
+
+ private static InputSource streamSourceToInputSource( StreamSource ss ) {
+ InputSource is = new InputSource();
+ is.setSystemId( ss.getSystemId() );
+ is.setByteStream( ss.getInputStream() );
+ is.setCharacterStream( ss.getReader() );
+
+ return is;
+ }
+
+
+ /**
+ * Indicates whether or not the Unmarshaller is configured to validate
+ * during unmarshal operations.
+ * <p>
+ * <i><b>Note:</b> I named this method isValidating() to stay in-line
+ * with JAXP, as opposed to naming it getValidating(). </i>
+ *
+ * @return true if the Unmarshaller is configured to validate during
+ * unmarshal operations, false otherwise
+ * @throws JAXBException if an error occurs while retrieving the validating
+ * flag
+ */
+ public boolean isValidating() throws JAXBException {
+ return validating;
+ }
+
+ /**
+ * Allow an application to register a validation event handler.
+ * <p>
+ * The validation event handler will be called by the JAXB Provider if any
+ * validation errors are encountered during calls to any of the
+ * <tt>unmarshal</tt> methods. If the client application does not register
+ * a validation event handler before invoking the unmarshal methods, then
+ * all validation events will be silently ignored and may result in
+ * unexpected behaviour.
+ *
+ * @param handler the validation event handler
+ * @throws JAXBException if an error was encountered while setting the
+ * event handler
+ */
+ public void setEventHandler(ValidationEventHandler handler)
+ throws JAXBException {
+
+ if( handler == null ) {
+ eventHandler = new DefaultValidationEventHandler();
+ } else {
+ eventHandler = handler;
+ }
+ }
+
+ /**
+ * Specifies whether or not the Unmarshaller should validate during
+ * unmarshal operations. By default, the <tt>Unmarshaller</tt> does
+ * not validate.
+ * <p>
+ * This method may only be invoked before or after calling one of the
+ * unmarshal methods.
+ *
+ * @param validating true if the Unmarshaller should validate during
+ * unmarshal, false otherwise
+ * @throws JAXBException if an error occurred while enabling or disabling
+ * validation at unmarshal time
+ */
+ public void setValidating(boolean validating) throws JAXBException {
+ this.validating = validating;
+ }
+
+ /**
+ * Return the current event handler or the default event handler if one
+ * hasn't been set.
+ *
+ * @return the current ValidationEventHandler or the default event handler
+ * if it hasn't been set
+ * @throws JAXBException if an error was encountered while getting the
+ * current event handler
+ */
+ public ValidationEventHandler getEventHandler() throws JAXBException {
+ return eventHandler;
+ }
+
+
+ /**
+ * Creates an UnmarshalException from a SAXException.
+ *
+ * This is an utility method provided for the derived classes.
+ *
+ * <p>
+ * When a provider-implemented ContentHandler wants to throw a
+ * JAXBException, it needs to wrap the exception by a SAXException.
+ * If the unmarshaller implementation blindly wrap SAXException
+ * by JAXBException, such an exception will be a JAXBException
+ * wrapped by a SAXException wrapped by another JAXBException.
+ * This is silly.
+ *
+ * <p>
+ * This method checks the nested exception of SAXException
+ * and reduce those excessive wrapping.
+ *
+ * @return the resulting UnmarshalException
+ */
+ protected UnmarshalException createUnmarshalException( SAXException e ) {
+ // check the nested exception to see if it's an UnmarshalException
+ Exception nested = e.getException();
+ if(nested instanceof UnmarshalException)
+ return (UnmarshalException)nested;
+
+ if(nested instanceof RuntimeException)
+ // typically this is an unexpected exception,
+ // just throw it rather than wrap it, so that the full stack
+ // trace can be displayed.
+ throw (RuntimeException)nested;
+
+
+ // otherwise simply wrap it
+ if(nested!=null)
+ return new UnmarshalException(nested);
+ else
+ return new UnmarshalException(e);
+ }
+
+ /**
+ * Default implementation of the setProperty method always
+ * throws PropertyException since there are no required
+ * properties. If a provider needs to handle additional
+ * properties, it should override this method in a derived class.
+ */
+ public void setProperty( String name, Object value )
+ throws PropertyException {
+
+ if( name == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "name" ) );
+ }
+
+ throw new PropertyException(name, value);
+ }
+
+ /**
+ * Default implementation of the getProperty method always
+ * throws PropertyException since there are no required
+ * properties. If a provider needs to handle additional
+ * properties, it should override this method in a derived class.
+ */
+ public Object getProperty( String name )
+ throws PropertyException {
+
+ if( name == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "name" ) );
+ }
+
+ throw new PropertyException(name);
+ }
+
+ public Object unmarshal(XMLEventReader reader) throws JAXBException {
+
+ throw new UnsupportedOperationException();
+ }
+
+ public Object unmarshal(XMLStreamReader reader) throws JAXBException {
+
+ throw new UnsupportedOperationException();
+ }
+
+ public <T> JAXBElement<T> unmarshal(Node node, Class<T> expectedType) throws JAXBException {
+ throw new UnsupportedOperationException();
+ }
+
+ public <T> JAXBElement<T> unmarshal(Source source, Class<T> expectedType) throws JAXBException {
+ throw new UnsupportedOperationException();
+ }
+
+ public <T> JAXBElement<T> unmarshal(XMLStreamReader reader, Class<T> expectedType) throws JAXBException {
+ throw new UnsupportedOperationException();
+ }
+
+ public <T> JAXBElement<T> unmarshal(XMLEventReader reader, Class<T> expectedType) throws JAXBException {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setSchema(Schema schema) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Schema getSchema() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setAdapter(XmlAdapter adapter) {
+ if(adapter==null)
+ throw new IllegalArgumentException();
+ setAdapter((Class)adapter.getClass(),adapter);
+ }
+
+ public <A extends XmlAdapter> void setAdapter(Class<A> type, A adapter) {
+ throw new UnsupportedOperationException();
+ }
+
+ public <A extends XmlAdapter> A getAdapter(Class<A> type) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setAttachmentUnmarshaller(AttachmentUnmarshaller au) {
+ throw new UnsupportedOperationException();
+ }
+
+ public AttachmentUnmarshaller getAttachmentUnmarshaller() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setListener(Listener listener) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Listener getListener() {
+ throw new UnsupportedOperationException();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/DefaultValidationEventHandler.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/DefaultValidationEventHandler.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/DefaultValidationEventHandler.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+package javax.xml.bind.helpers;
+
+import org.w3c.dom.Node;
+
+import javax.xml.bind.ValidationEvent;
+import javax.xml.bind.ValidationEventHandler;
+import javax.xml.bind.ValidationEventLocator;
+import java.net.URL;
+
+/**
+ * <p>
+ * JAXB 1.0 only default validation event handler. This is the default
+ * handler for all objects created from a JAXBContext that is managing
+ * schema-derived code generated by a JAXB 1.0 binding compiler.
+ *
+ * <p>
+ * This handler causes the unmarshal and validate operations to fail on the first
+ * error or fatal error.
+ *
+ * <p>
+ * This handler is not the default handler for JAXB mapped classes following
+ * JAXB 2.0 or later versions. Default validation event handling has changed
+ * and is specified in {@link javax.xml.bind.Unmarshaller} and
+ * {@link javax.xml.bind.Marshaller}.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $
+ * @see javax.xml.bind.Unmarshaller
+ * @see javax.xml.bind.Validator
+ * @see javax.xml.bind.ValidationEventHandler
+ * @since JAXB1.0
+ */
+public class DefaultValidationEventHandler implements ValidationEventHandler {
+
+ public boolean handleEvent( ValidationEvent event ) {
+
+ if( event == null ) {
+ throw new IllegalArgumentException();
+ }
+
+ // calculate the severity prefix and return value
+ String severity = null;
+ boolean retVal = false;
+ switch ( event.getSeverity() ) {
+ case ValidationEvent.WARNING:
+ severity = Messages.format( Messages.WARNING );
+ retVal = true; // continue after warnings
+ break;
+ case ValidationEvent.ERROR:
+ severity = Messages.format( Messages.ERROR );
+ retVal = false; // terminate after errors
+ break;
+ case ValidationEvent.FATAL_ERROR:
+ severity = Messages.format( Messages.FATAL_ERROR );
+ retVal = false; // terminate after fatal errors
+ break;
+ default:
+ assert false :
+ Messages.format( Messages.UNRECOGNIZED_SEVERITY,
+ event.getSeverity() );
+ }
+
+ // calculate the location message
+ String location = getLocation( event );
+
+ System.out.println(
+ Messages.format( Messages.SEVERITY_MESSAGE,
+ severity,
+ event.getMessage(),
+ location ) );
+
+ // fail on the first error or fatal error
+ return retVal;
+ }
+
+ /**
+ * Calculate a location message for the event
+ *
+ */
+ private String getLocation(ValidationEvent event) {
+ StringBuffer msg = new StringBuffer();
+
+ ValidationEventLocator locator = event.getLocator();
+
+ if( locator != null ) {
+
+ URL url = locator.getURL();
+ Object obj = locator.getObject();
+ Node node = locator.getNode();
+ int line = locator.getLineNumber();
+
+ if( url!=null || line!=-1 ) {
+ msg.append( "line " + line );
+ if( url!=null )
+ msg.append( " of " + url );
+ } else if( obj != null ) {
+ msg.append( " obj: " + obj.toString() );
+ } else if( node != null ) {
+ msg.append( " node: " + node.toString() );
+ }
+ } else {
+ msg.append( Messages.format( Messages.LOCATION_UNAVAILABLE ) );
+ }
+
+ return msg.toString();
+ }
+}
+
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/Messages.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/Messages.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/Messages.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.helpers;
+
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+
+/**
+ * Formats error messages.
+ */
+class Messages
+{
+ static String format( String property ) {
+ return format( property, null );
+ }
+
+ static String format( String property, Object arg1 ) {
+ return format( property, new Object[]{arg1} );
+ }
+
+ static String format( String property, Object arg1, Object arg2 ) {
+ return format( property, new Object[]{arg1,arg2} );
+ }
+
+ static String format( String property, Object arg1, Object arg2, Object arg3 ) {
+ return format( property, new Object[]{arg1,arg2,arg3} );
+ }
+
+ // add more if necessary.
+
+ /** Loads a string resource and formats it with specified arguments. */
+ static String format( String property, Object[] args ) {
+ String text = ResourceBundle.getBundle(Messages.class.getName()).getString(property);
+ return MessageFormat.format(text,args);
+ }
+
+//
+//
+// Message resources
+//
+//
+ static final String INPUTSTREAM_NOT_NULL = // 0 args
+ "AbstractUnmarshallerImpl.ISNotNull";
+
+ static final String MUST_BE_BOOLEAN = // 1 arg
+ "AbstractMarshallerImpl.MustBeBoolean";
+
+ static final String MUST_BE_STRING = // 1 arg
+ "AbstractMarshallerImpl.MustBeString";
+
+ static final String SEVERITY_MESSAGE = // 3 args
+ "DefaultValidationEventHandler.SeverityMessage";
+
+ static final String LOCATION_UNAVAILABLE = // 0 args
+ "DefaultValidationEventHandler.LocationUnavailable";
+
+ static final String UNRECOGNIZED_SEVERITY = // 1 arg
+ "DefaultValidationEventHandler.UnrecognizedSeverity";
+
+ static final String WARNING = // 0 args
+ "DefaultValidationEventHandler.Warning";
+
+ static final String ERROR = // 0 args
+ "DefaultValidationEventHandler.Error";
+
+ static final String FATAL_ERROR = // 0 args
+ "DefaultValidationEventHandler.FatalError";
+
+ static final String ILLEGAL_SEVERITY = // 0 args
+ "ValidationEventImpl.IllegalSeverity";
+
+ static final String MUST_NOT_BE_NULL = // 1 arg
+ "Shared.MustNotBeNull";
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/NotIdentifiableEventImpl.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/NotIdentifiableEventImpl.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/NotIdentifiableEventImpl.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.helpers;
+
+import javax.xml.bind.ValidationEventLocator;
+
+/**
+ * Default implementation of the NotIdentifiableEvent interface.
+ *
+ * <p>
+ * JAXB providers are allowed to use whatever class that implements
+ * the ValidationEvent interface. This class is just provided for a
+ * convenience.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $
+ * @see javax.xml.bind.NotIdentifiableEvent
+ * @see javax.xml.bind.Validator
+ * @see javax.xml.bind.ValidationEventHandler
+ * @see javax.xml.bind.ValidationEvent
+ * @see javax.xml.bind.ValidationEventLocator
+ * @since JAXB1.0
+ */
+public class NotIdentifiableEventImpl
+ extends ValidationEventImpl
+ implements javax.xml.bind.NotIdentifiableEvent {
+
+ /**
+ * Create a new NotIdentifiableEventImpl.
+ *
+ * @param _severity The severity value for this event. Must be one of
+ * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+ * ValidationEvent.FATAL_ERROR
+ * @param _message The text message for this event - may be null.
+ * @param _locator The locator object for this event - may be null.
+ * @throws IllegalArgumentException if an illegal severity field is supplied
+ */
+ public NotIdentifiableEventImpl( int _severity, String _message,
+ ValidationEventLocator _locator) {
+
+ super(_severity, _message, _locator);
+ }
+
+ /**
+ * Create a new NotIdentifiableEventImpl.
+ *
+ * @param _severity The severity value for this event. Must be one of
+ * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+ * ValidationEvent.FATAL_ERROR
+ * @param _message The text message for this event - may be null.
+ * @param _locator The locator object for this event - may be null.
+ * @param _linkedException An optional linked exception that may provide
+ * additional information about the event - may be null.
+ * @throws IllegalArgumentException if an illegal severity field is supplied
+ */
+ public NotIdentifiableEventImpl( int _severity, String _message,
+ ValidationEventLocator _locator,
+ Throwable _linkedException) {
+
+ super(_severity, _message, _locator, _linkedException);
+ }
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/ParseConversionEventImpl.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/ParseConversionEventImpl.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/ParseConversionEventImpl.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.helpers;
+
+import javax.xml.bind.ParseConversionEvent;
+import javax.xml.bind.ValidationEventLocator;
+
+/**
+ * Default implementation of the ParseConversionEvent interface.
+ *
+ * <p>
+ * JAXB providers are allowed to use whatever class that implements
+ * the ValidationEvent interface. This class is just provided for a
+ * convenience.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $
+ * @see javax.xml.bind.ParseConversionEvent
+ * @see javax.xml.bind.Validator
+ * @see javax.xml.bind.ValidationEventHandler
+ * @see javax.xml.bind.ValidationEvent
+ * @see javax.xml.bind.ValidationEventLocator
+ * @since JAXB1.0
+ */
+public class ParseConversionEventImpl
+ extends ValidationEventImpl
+ implements ParseConversionEvent {
+
+ /**
+ * Create a new ParseConversionEventImpl.
+ *
+ * @param _severity The severity value for this event. Must be one of
+ * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+ * ValidationEvent.FATAL_ERROR
+ * @param _message The text message for this event - may be null.
+ * @param _locator The locator object for this event - may be null.
+ * @throws IllegalArgumentException if an illegal severity field is supplied
+ */
+ public ParseConversionEventImpl( int _severity, String _message,
+ ValidationEventLocator _locator) {
+
+ super(_severity, _message, _locator);
+ }
+
+ /**
+ * Create a new ParseConversionEventImpl.
+ *
+ * @param _severity The severity value for this event. Must be one of
+ * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+ * ValidationEvent.FATAL_ERROR
+ * @param _message The text message for this event - may be null.
+ * @param _locator The locator object for this event - may be null.
+ * @param _linkedException An optional linked exception that may provide
+ * additional information about the event - may be null.
+ * @throws IllegalArgumentException if an illegal severity field is supplied
+ */
+ public ParseConversionEventImpl( int _severity, String _message,
+ ValidationEventLocator _locator,
+ Throwable _linkedException) {
+
+ super(_severity, _message, _locator, _linkedException);
+ }
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/PrintConversionEventImpl.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/PrintConversionEventImpl.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/PrintConversionEventImpl.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.helpers;
+
+import javax.xml.bind.PrintConversionEvent;
+import javax.xml.bind.ValidationEventLocator;
+
+/**
+ * Default implementation of the PrintConversionEvent interface.
+ *
+ * <p>
+ * JAXB providers are allowed to use whatever class that implements
+ * the ValidationEvent interface. This class is just provided for a
+ * convenience.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $
+ * @see javax.xml.bind.PrintConversionEvent
+ * @see javax.xml.bind.Validator
+ * @see javax.xml.bind.ValidationEventHandler
+ * @see javax.xml.bind.ValidationEvent
+ * @see javax.xml.bind.ValidationEventLocator
+ * @since JAXB1.0
+ */
+public class PrintConversionEventImpl
+ extends ValidationEventImpl
+ implements PrintConversionEvent {
+
+ /**
+ * Create a new PrintConversionEventImpl.
+ *
+ * @param _severity The severity value for this event. Must be one of
+ * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+ * ValidationEvent.FATAL_ERROR
+ * @param _message The text message for this event - may be null.
+ * @param _locator The locator object for this event - may be null.
+ * @throws IllegalArgumentException if an illegal severity field is supplied
+ */
+ public PrintConversionEventImpl( int _severity, String _message,
+ ValidationEventLocator _locator) {
+
+ super(_severity, _message, _locator);
+ }
+
+ /**
+ * Create a new PrintConversionEventImpl.
+ *
+ * @param _severity The severity value for this event. Must be one of
+ * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+ * ValidationEvent.FATAL_ERROR
+ * @param _message The text message for this event - may be null.
+ * @param _locator The locator object for this event - may be null.
+ * @param _linkedException An optional linked exception that may provide
+ * additional information about the event - may be null.
+ * @throws IllegalArgumentException if an illegal severity field is supplied
+ */
+ public PrintConversionEventImpl( int _severity, String _message,
+ ValidationEventLocator _locator,
+ Throwable _linkedException) {
+
+ super(_severity, _message, _locator, _linkedException);
+ }
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/ValidationEventImpl.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/ValidationEventImpl.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/ValidationEventImpl.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,155 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+package javax.xml.bind.helpers;
+
+import java.text.MessageFormat;
+
+import javax.xml.bind.ValidationEvent;
+import javax.xml.bind.ValidationEventLocator;
+
+/**
+ * Default implementation of the ValidationEvent interface.
+ *
+ * <p>
+ * JAXB providers are allowed to use whatever class that implements
+ * the ValidationEvent interface. This class is just provided for a
+ * convenience.
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $
+ * @see javax.xml.bind.Validator
+ * @see javax.xml.bind.ValidationEventHandler
+ * @see javax.xml.bind.ValidationEvent
+ * @see javax.xml.bind.ValidationEventLocator
+ * @since JAXB1.0
+ */
+public class ValidationEventImpl implements ValidationEvent
+{
+
+ /**
+ * Create a new ValidationEventImpl.
+ *
+ * @param _severity The severity value for this event. Must be one of
+ * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+ * ValidationEvent.FATAL_ERROR
+ * @param _message The text message for this event - may be null.
+ * @param _locator The locator object for this event - may be null.
+ * @throws IllegalArgumentException if an illegal severity field is supplied
+ */
+ public ValidationEventImpl( int _severity, String _message,
+ ValidationEventLocator _locator ) {
+
+ this(_severity,_message,_locator,null);
+ }
+
+ /**
+ * Create a new ValidationEventImpl.
+ *
+ * @param _severity The severity value for this event. Must be one of
+ * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+ * ValidationEvent.FATAL_ERROR
+ * @param _message The text message for this event - may be null.
+ * @param _locator The locator object for this event - may be null.
+ * @param _linkedException An optional linked exception that may provide
+ * additional information about the event - may be null.
+ * @throws IllegalArgumentException if an illegal severity field is supplied
+ */
+ public ValidationEventImpl( int _severity, String _message,
+ ValidationEventLocator _locator,
+ Throwable _linkedException ) {
+
+ setSeverity( _severity );
+ this.message = _message;
+ this.locator = _locator;
+ this.linkedException = _linkedException;
+ }
+
+ private int severity;
+ private String message;
+ private Throwable linkedException;
+ private ValidationEventLocator locator;
+
+ public int getSeverity() {
+ return severity;
+ }
+
+
+ /**
+ * Set the severity field of this event.
+ *
+ * @param _severity Must be one of ValidationEvent.WARNING,
+ * ValidationEvent.ERROR, or ValidationEvent.FATAL_ERROR.
+ * @throws IllegalArgumentException if an illegal severity field is supplied
+ */
+ public void setSeverity( int _severity ) {
+
+ if( _severity != ValidationEvent.WARNING &&
+ _severity != ValidationEvent.ERROR &&
+ _severity != ValidationEvent.FATAL_ERROR ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.ILLEGAL_SEVERITY ) );
+ }
+
+ this.severity = _severity;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+ /**
+ * Set the message field of this event.
+ *
+ * @param _message String message - may be null.
+ */
+ public void setMessage( String _message ) {
+ this.message = _message;
+ }
+
+ public Throwable getLinkedException() {
+ return linkedException;
+ }
+ /**
+ * Set the linked exception field of this event.
+ *
+ * @param _linkedException Optional linked exception - may be null.
+ */
+ public void setLinkedException( Throwable _linkedException ) {
+ this.linkedException = _linkedException;
+ }
+
+ public ValidationEventLocator getLocator() {
+ return locator;
+ }
+ /**
+ * Set the locator object for this event.
+ *
+ * @param _locator The locator - may be null.
+ */
+ public void setLocator( ValidationEventLocator _locator ) {
+ this.locator = _locator;
+ }
+
+ /**
+ * Returns a string representation of this object in a format
+ * helpful to debugging.
+ *
+ * @see Object#equals(Object)
+ */
+ public String toString() {
+ String s;
+ switch(getSeverity()) {
+ case WARNING: s="WARNING";break;
+ case ERROR: s="ERROR";break;
+ case FATAL_ERROR: s="FATAL_ERROR";break;
+ default: s=String.valueOf(getSeverity());break;
+ }
+ return MessageFormat.format("[severity={0},message={1},locator={2}]",
+ new Object[]{
+ s,
+ getMessage(),
+ getLocator()
+ });
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/ValidationEventLocatorImpl.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/ValidationEventLocatorImpl.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/ValidationEventLocatorImpl.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,253 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+package javax.xml.bind.helpers;
+
+import java.net.URL;
+import java.net.MalformedURLException;
+import java.text.MessageFormat;
+
+import javax.xml.bind.ValidationEventLocator;
+import org.w3c.dom.Node;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXParseException;
+
+/**
+ * Default implementation of the ValidationEventLocator interface.
+ *
+ * <p>
+ * JAXB providers are allowed to use whatever class that implements
+ * the ValidationEventLocator interface. This class is just provided for a
+ * convenience.
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 4888 $
+ * @see javax.xml.bind.Validator
+ * @see javax.xml.bind.ValidationEventHandler
+ * @see javax.xml.bind.ValidationEvent
+ * @see javax.xml.bind.ValidationEventLocator
+ * @since JAXB1.0
+ */
+public class ValidationEventLocatorImpl implements ValidationEventLocator
+{
+ /**
+ * Creates an object with all fields unavailable.
+ */
+ public ValidationEventLocatorImpl() {
+ }
+
+ /**
+ * Constructs an object from an org.xml.sax.Locator.
+ *
+ * The object's ColumnNumber, LineNumber, and URL become has from the
+ * values returned by the locator's getColumnNumber(), getLineNumber(), and
+ * getSystemId() methods respectively. Node, Object, and Offset are not
+ * has.
+ *
+ * @param loc the SAX Locator object that will be used to populate this
+ * event locator.
+ * @throws IllegalArgumentException if the Locator is null
+ */
+ public ValidationEventLocatorImpl( Locator loc ) {
+ if( loc == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "loc" ) );
+ }
+
+ this.url = toURL(loc.getSystemId());
+ this.columnNumber = loc.getColumnNumber();
+ this.lineNumber = loc.getLineNumber();
+ }
+
+ /**
+ * Constructs an object from the location information of a SAXParseException.
+ *
+ * The object's ColumnNumber, LineNumber, and URL become has from the
+ * values returned by the locator's getColumnNumber(), getLineNumber(), and
+ * getSystemId() methods respectively. Node, Object, and Offset are not
+ * has.
+ *
+ * @param e the SAXParseException object that will be used to populate this
+ * event locator.
+ * @throws IllegalArgumentException if the SAXParseException is null
+ */
+ public ValidationEventLocatorImpl( SAXParseException e ) {
+ if( e == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "e" ) );
+ }
+
+ this.url = toURL(e.getSystemId());
+ this.columnNumber = e.getColumnNumber();
+ this.lineNumber = e.getLineNumber();
+ }
+
+ /**
+ * Constructs an object that points to a DOM Node.
+ *
+ * The object's Node becomes has. ColumnNumber, LineNumber, Object,
+ * Offset, and URL are not has.
+ *
+ * @param _node the DOM Node object that will be used to populate this
+ * event locator.
+ * @throws IllegalArgumentException if the Node is null
+ */
+ public ValidationEventLocatorImpl(Node _node) {
+ if( _node == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "_node" ) );
+ }
+
+ this.node = _node;
+ }
+
+ /**
+ * Constructs an object that points to a JAXB content object.
+ *
+ * The object's Object becomes has. ColumnNumber, LineNumber, Node,
+ * Offset, and URL are not has.
+ *
+ * @param _object the Object that will be used to populate this
+ * event locator.
+ * @throws IllegalArgumentException if the Object is null
+ */
+ public ValidationEventLocatorImpl(Object _object) {
+ if( _object == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "_object" ) );
+ }
+
+ this.object = _object;
+ }
+
+ /** Converts a system ID to an URL object. */
+ private static URL toURL( String systemId ) {
+ try {
+ return new URL(systemId);
+ } catch( MalformedURLException e ) {
+ // TODO: how should we handle system id here?
+ return null; // for now
+ }
+ }
+
+ private URL url = null;
+ private int offset = -1;
+ private int lineNumber = -1;
+ private int columnNumber = -1;
+ private Object object = null;
+ private Node node = null;
+
+
+ /**
+ * @see javax.xml.bind.ValidationEventLocator#getURL()
+ */
+ public URL getURL() {
+ return url;
+ }
+
+ /**
+ * Set the URL field on this event locator. Null values are allowed.
+ *
+ * @param _url the url
+ */
+ public void setURL( URL _url ) {
+ this.url = _url;
+ }
+
+ /**
+ * @see javax.xml.bind.ValidationEventLocator#getOffset()
+ */
+ public int getOffset() {
+ return offset;
+ }
+
+ /**
+ * Set the offset field on this event locator.
+ *
+ * @param _offset the offset
+ */
+ public void setOffset( int _offset ) {
+ this.offset = _offset;
+ }
+
+ /**
+ * @see javax.xml.bind.ValidationEventLocator#getLineNumber()
+ */
+ public int getLineNumber() {
+ return lineNumber;
+ }
+
+ /**
+ * Set the lineNumber field on this event locator.
+ *
+ * @param _lineNumber the line number
+ */
+ public void setLineNumber( int _lineNumber ) {
+ this.lineNumber = _lineNumber;
+ }
+
+ /**
+ * @see javax.xml.bind.ValidationEventLocator#getColumnNumber()
+ */
+ public int getColumnNumber() {
+ return columnNumber;
+ }
+
+ /**
+ * Set the columnNumber field on this event locator.
+ *
+ * @param _columnNumber the column number
+ */
+ public void setColumnNumber( int _columnNumber ) {
+ this.columnNumber = _columnNumber;
+ }
+
+ /**
+ * @see javax.xml.bind.ValidationEventLocator#getObject()
+ */
+ public Object getObject() {
+ return object;
+ }
+
+ /**
+ * Set the Object field on this event locator. Null values are allowed.
+ *
+ * @param _object the java content object
+ */
+ public void setObject( Object _object ) {
+ this.object = _object;
+ }
+
+ /**
+ * @see javax.xml.bind.ValidationEventLocator#getNode()
+ */
+ public Node getNode() {
+ return node;
+ }
+
+ /**
+ * Set the Node field on this event locator. Null values are allowed.
+ *
+ * @param _node the Node
+ */
+ public void setNode( Node _node ) {
+ this.node = _node;
+ }
+
+ /**
+ * Returns a string representation of this object in a format
+ * helpful to debugging.
+ *
+ * @see Object#equals(Object)
+ */
+ public String toString() {
+ return MessageFormat.format("[node={0},object={1},url={2},line={3},col={4},offset={5}]",
+ getNode(),
+ getObject(),
+ getURL(),
+ String.valueOf(getLineNumber()),
+ String.valueOf(getColumnNumber()),
+ String.valueOf(getOffset()));
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/package.html
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/package.html (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/package.html 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,53 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+ <head>
+ <!--
+
+ @(#)package.html 1.60 98/01/27
+
+ Copyright 1998 Sun Microsystems, Inc. 901 San Antonio Road,
+ Palo Alto, California, 94303, U.S.A. All Rights Reserved.
+
+ This software is the confidential and proprietary information of Sun
+ Microsystems, Inc. ("Confidential Information"). You shall not
+ disclose such Confidential Information and shall use it only in
+ accordance with the terms of the license agreement you entered into
+ with Sun.
+
+ CopyrightVersion 1.2
+
+ -->
+ </head>
+
+ <body bgcolor="white">
+
+ <p>
+ <B>JAXB Provider Use Only:</b> Provides partial default implementations for
+ some of the <tt>javax.xml.bind</tt> interfaces.
+
+ <p>
+ JAXB Providers can extend these classes and implement the abstract
+ methods.
+
+ <h2>Package Specification</h2>
+
+ <ul>
+ <li><a href="http://java.sun.com/xml/downloads/jaxb.html">JAXB
+ Specification</a>
+ </ul>
+
+ <h2>Related Documentation</h2>
+
+ For overviews, tutorials, examples, guides, and tool documentation,
+ please see:
+ <ul>
+ <li>The <a href="http://java.sun.com/xml/jaxb/index.html">JAXB
+ Website</a>
+ </ul>
+
+ <!-- Put @see and @since tags down here. -->
+
+ </body>
+</html>
+
+
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/package.html
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/package.html (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/package.html 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+ <head>
+ <!--
+
+ @(#)package.html 1.60 98/01/27
+
+ Copyright 1998 Sun Microsystems, Inc. 901 San Antonio Road,
+ Palo Alto, California, 94303, U.S.A. All Rights Reserved.
+
+ This software is the confidential and proprietary information of Sun
+ Microsystems, Inc. ("Confidential Information"). You shall not
+ disclose such Confidential Information and shall use it only in
+ accordance with the terms of the license agreement you entered into
+ with Sun.
+
+ CopyrightVersion 1.2
+
+ -->
+ </head>
+
+ <body bgcolor="white">
+
+ <p>
+ Provides a runtime binding framework for client applications including
+ unmarshalling, marshalling, and validation capabilities.
+
+ <p>
+ <tt>JAXBContext</tt> is the client-entry point to the runtime binding
+ framework.
+
+
+ <h2>Package Specification</h2>
+
+ <ul>
+ <li><a href="http://java.sun.com/xml/downloads/jaxb.html">JAXB
+ Specification</a>
+ </ul>
+
+ <h2>Related Documentation</h2>
+
+ For overviews, tutorials, examples, guides, and tool documentation,
+ please see:
+ <ul>
+ <li>The <a href="http://java.sun.com/xml/jaxb/index.html">JAXB
+ Website</a>
+ </ul>
+
+ <!-- Put @see and @since tags down here. -->
+
+ </body>
+</html>
+
+
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/util/JAXBResult.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/util/JAXBResult.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/util/JAXBResult.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+package javax.xml.bind.util;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.UnmarshallerHandler;
+import javax.xml.transform.sax.SAXResult;
+
+/**
+ * JAXP {@link javax.xml.transform.Result} implementation
+ * that unmarshals a JAXB object.
+ *
+ * <p>
+ * This utility class is useful to combine JAXB with
+ * other Java/XML technologies.
+ *
+ * <p>
+ * The following example shows how to use JAXB to unmarshal a document
+ * resulting from an XSLT transformation.
+ *
+ * <blockquote>
+ * <pre>
+ * JAXBResult result = new JAXBResult(
+ * JAXBContext.newInstance("org.acme.foo") );
+ *
+ * // set up XSLT transformation
+ * TransformerFactory tf = TransformerFactory.newInstance();
+ * Transformer t = tf.newTransformer(new StreamSource("test.xsl"));
+ *
+ * // run transformation
+ * t.transform(new StreamSource("document.xml"),result);
+ *
+ * // obtain the unmarshalled content tree
+ * Object o = result.getResult();
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * The fact that JAXBResult derives from SAXResult is an implementation
+ * detail. Thus in general applications are strongly discouraged from
+ * accessing methods defined on SAXResult.
+ *
+ * <p>
+ * In particular it shall never attempt to call the setHandler,
+ * setLexicalHandler, and setSystemId methods.
+ *
+ * @author
+ * Kohsuke Kawaguchi (kohsuke.kawaguchi at sun.com)
+ */
+public class JAXBResult extends SAXResult {
+
+ /**
+ * Creates a new instance that uses the specified
+ * JAXBContext to unmarshal.
+ *
+ * @param context The JAXBContext that will be used to create the
+ * necessary Unmarshaller. This parameter must not be null.
+ * @exception JAXBException if an error is encountered while creating the
+ * JAXBResult or if the context parameter is null.
+ */
+ public JAXBResult( JAXBContext context ) throws JAXBException {
+ this( ( context == null ) ? assertionFailed() : context.createUnmarshaller() );
+ }
+
+ /**
+ * Creates a new instance that uses the specified
+ * Unmarshaller to unmarshal an object.
+ *
+ * <p>
+ * This JAXBResult object will use the specified Unmarshaller
+ * instance. It is the caller's responsibility not to use the
+ * same Unmarshaller for other purposes while it is being
+ * used by this object.
+ *
+ * <p>
+ * The primary purpose of this method is to allow the client
+ * to configure Unmarshaller. Unless you know what you are doing,
+ * it's easier and safer to pass a JAXBContext.
+ *
+ * @param _unmarshaller the unmarshaller. This parameter must not be null.
+ * @throws JAXBException if an error is encountered while creating the
+ * JAXBResult or the Unmarshaller parameter is null.
+ */
+ public JAXBResult( Unmarshaller _unmarshaller ) throws JAXBException {
+ if( _unmarshaller == null )
+ throw new JAXBException(
+ Messages.format( Messages.RESULT_NULL_UNMARSHALLER ) );
+
+ this.unmarshallerHandler = _unmarshaller.getUnmarshallerHandler();
+
+ super.setHandler(unmarshallerHandler);
+ }
+
+ /**
+ * Unmarshaller that will be used to unmarshal
+ * the input documents.
+ */
+ private final UnmarshallerHandler unmarshallerHandler;
+
+ /**
+ * Gets the unmarshalled object created by the transformation.
+ *
+ * @return
+ * Always return a non-null object.
+ *
+ * @exception IllegalStateException
+ * if this method is called before an object is unmarshalled.
+ *
+ * @exception JAXBException
+ * if there is any unmarshalling error.
+ * Note that the implementation is allowed to throw SAXException
+ * during the parsing when it finds an error.
+ */
+ public Object getResult() throws JAXBException {
+ return unmarshallerHandler.getResult();
+ }
+
+ /**
+ * Hook to throw exception from the middle of a contructor chained call
+ * to this
+ */
+ private static Unmarshaller assertionFailed() throws JAXBException {
+ throw new JAXBException( Messages.format( Messages.RESULT_NULL_CONTEXT ) );
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/util/JAXBSource.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/util/JAXBSource.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/util/JAXBSource.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,250 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+package javax.xml.bind.util;
+
+import org.xml.sax.ContentHandler;
+import org.xml.sax.DTDHandler;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.ext.LexicalHandler;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.transform.sax.SAXSource;
+
+/**
+ * JAXP {@link javax.xml.transform.Source} implementation
+ * that marshals a JAXB-generated object.
+ *
+ * <p>
+ * This utility class is useful to combine JAXB with
+ * other Java/XML technologies.
+ *
+ * <p>
+ * The following example shows how to use JAXB to marshal a document
+ * for transformation by XSLT.
+ *
+ * <blockquote>
+ * <pre>
+ * MyObject o = // get JAXB content tree
+ *
+ * // jaxbContext is a JAXBContext object from which 'o' is created.
+ * JAXBSource source = new JAXBSource( jaxbContext, o );
+ *
+ * // set up XSLT transformation
+ * TransformerFactory tf = TransformerFactory.newInstance();
+ * Transformer t = tf.newTransformer(new StreamSource("test.xsl"));
+ *
+ * // run transformation
+ * t.transform(source,new StreamResult(System.out));
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * The fact that JAXBSource derives from SAXSource is an implementation
+ * detail. Thus in general applications are strongly discouraged from
+ * accessing methods defined on SAXSource. In particular,
+ * the setXMLReader and setInputSource methods shall never be called.
+ * The XMLReader object obtained by the getXMLReader method shall
+ * be used only for parsing the InputSource object returned by
+ * the getInputSource method.
+ *
+ * <p>
+ * Similarly the InputSource object obtained by the getInputSource
+ * method shall be used only for being parsed by the XMLReader object
+ * returned by the getXMLReader.
+ *
+ * @author
+ * Kohsuke Kawaguchi (kohsuke.kawaguchi at sun.com)
+ */
+public class JAXBSource extends SAXSource {
+
+ /**
+ * Creates a new {@link javax.xml.transform.Source} for the given content object.
+ *
+ * @param context
+ * JAXBContext that was used to create
+ * <code>contentObject</code>. This context is used
+ * to create a new instance of marshaller and must not be null.
+ * @param contentObject
+ * An instance of a JAXB-generated class, which will be
+ * used as a {@link javax.xml.transform.Source} (by marshalling it into XML). It must
+ * not be null.
+ * @throws JAXBException if an error is encountered while creating the
+ * JAXBSource or if either of the parameters are null.
+ */
+ public JAXBSource( JAXBContext context, Object contentObject )
+ throws JAXBException {
+
+ this(
+ ( context == null ) ?
+ assertionFailed( Messages.format( Messages.SOURCE_NULL_CONTEXT ) ) :
+ context.createMarshaller(),
+
+ ( contentObject == null ) ?
+ assertionFailed( Messages.format( Messages.SOURCE_NULL_CONTENT ) ) :
+ contentObject);
+ }
+
+ /**
+ * Creates a new {@link javax.xml.transform.Source} for the given content object.
+ *
+ * @param marshaller
+ * A marshaller instance that will be used to marshal
+ * <code>contentObject</code> into XML. This must be
+ * created from a JAXBContext that was used to build
+ * <code>contentObject</code> and must not be null.
+ * @param contentObject
+ * An instance of a JAXB-generated class, which will be
+ * used as a {@link javax.xml.transform.Source} (by marshalling it into XML). It must
+ * not be null.
+ * @throws JAXBException if an error is encountered while creating the
+ * JAXBSource or if either of the parameters are null.
+ */
+ public JAXBSource( Marshaller marshaller, Object contentObject )
+ throws JAXBException {
+
+ if( marshaller == null )
+ throw new JAXBException(
+ Messages.format( Messages.SOURCE_NULL_MARSHALLER ) );
+
+ if( contentObject == null )
+ throw new JAXBException(
+ Messages.format( Messages.SOURCE_NULL_CONTENT ) );
+
+ this.marshaller = marshaller;
+ this.contentObject = contentObject;
+
+ super.setXMLReader(pseudoParser);
+ // pass a dummy InputSource. We don't care
+ super.setInputSource(new InputSource());
+ }
+
+ private final Marshaller marshaller;
+ private final Object contentObject;
+
+ // this object will pretend as an XMLReader.
+ // no matter what parameter is specified to the parse method,
+ // it just parse the contentObject.
+ private final XMLReader pseudoParser = new XMLReader() {
+ public boolean getFeature(String name) throws SAXNotRecognizedException {
+ if(name.equals("http://xml.org/sax/features/namespaces"))
+ return true;
+ if(name.equals("http://xml.org/sax/features/namespace-prefixes"))
+ return false;
+ throw new SAXNotRecognizedException(name);
+ }
+
+ public void setFeature(String name, boolean value) throws SAXNotRecognizedException {
+ if(name.equals("http://xml.org/sax/features/namespaces") && value)
+ return;
+ if(name.equals("http://xml.org/sax/features/namespace-prefixes") && !value)
+ return;
+ throw new SAXNotRecognizedException(name);
+ }
+
+ public Object getProperty(String name) throws SAXNotRecognizedException {
+ if( "http://xml.org/sax/properties/lexical-handler".equals(name) ) {
+ return lexicalHandler;
+ }
+ throw new SAXNotRecognizedException(name);
+ }
+
+ public void setProperty(String name, Object value) throws SAXNotRecognizedException {
+ if( "http://xml.org/sax/properties/lexical-handler".equals(name) ) {
+ this.lexicalHandler = (LexicalHandler)value;
+ return;
+ }
+ throw new SAXNotRecognizedException(name);
+ }
+
+ private LexicalHandler lexicalHandler;
+
+ // we will store this value but never use it by ourselves.
+ private EntityResolver entityResolver;
+ public void setEntityResolver(EntityResolver resolver) {
+ this.entityResolver = resolver;
+ }
+ public EntityResolver getEntityResolver() {
+ return entityResolver;
+ }
+
+ private DTDHandler dtdHandler;
+ public void setDTDHandler(DTDHandler handler) {
+ this.dtdHandler = handler;
+ }
+ public DTDHandler getDTDHandler() {
+ return dtdHandler;
+ }
+
+ // SAX allows ContentHandler to be changed during the parsing,
+ // but JAXB doesn't. So this repeater will sit between those
+ // two components.
+ private XMLFilterImpl repeater = new XMLFilterImpl();
+
+ public void setContentHandler(ContentHandler handler) {
+ repeater.setContentHandler(handler);
+ }
+ public ContentHandler getContentHandler() {
+ return repeater.getContentHandler();
+ }
+
+ private ErrorHandler errorHandler;
+ public void setErrorHandler(ErrorHandler handler) {
+ this.errorHandler = handler;
+ }
+ public ErrorHandler getErrorHandler() {
+ return errorHandler;
+ }
+
+ public void parse(InputSource input) throws SAXException {
+ parse();
+ }
+
+ public void parse(String systemId) throws SAXException {
+ parse();
+ }
+
+ public void parse() throws SAXException {
+ // parses a content object by using the given marshaller
+ // SAX events will be sent to the repeater, and the repeater
+ // will further forward it to an appropriate component.
+ try {
+ marshaller.marshal( contentObject, repeater );
+ } catch( JAXBException e ) {
+ // wrap it to a SAXException
+ SAXParseException se =
+ new SAXParseException( e.getMessage(),
+ null, null, -1, -1, e );
+
+ // if the consumer sets an error handler, it is our responsibility
+ // to notify it.
+ if(errorHandler!=null)
+ errorHandler.fatalError(se);
+
+ // this is a fatal error. Even if the error handler
+ // returns, we will abort anyway.
+ throw se;
+ }
+ }
+ };
+
+ /**
+ * Hook to throw exception from the middle of a contructor chained call
+ * to this
+ */
+ private static Marshaller assertionFailed( String message )
+ throws JAXBException {
+
+ throw new JAXBException( message );
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/util/Messages.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/util/Messages.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/util/Messages.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.util;
+
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+
+/**
+ * Formats error messages.
+ */
+class Messages
+{
+ static String format( String property ) {
+ return format( property, null );
+ }
+
+ static String format( String property, Object arg1 ) {
+ return format( property, new Object[]{arg1} );
+ }
+
+ static String format( String property, Object arg1, Object arg2 ) {
+ return format( property, new Object[]{arg1,arg2} );
+ }
+
+ static String format( String property, Object arg1, Object arg2, Object arg3 ) {
+ return format( property, new Object[]{arg1,arg2,arg3} );
+ }
+
+ // add more if necessary.
+
+ /** Loads a string resource and formats it with specified arguments. */
+ static String format( String property, Object[] args ) {
+ String text = ResourceBundle.getBundle(Messages.class.getName()).getString(property);
+ return MessageFormat.format(text,args);
+ }
+
+//
+//
+// Message resources
+//
+//
+ static final String UNRECOGNIZED_SEVERITY = // 1 arg
+ "ValidationEventCollector.UnrecognizedSeverity";
+
+ static final String RESULT_NULL_CONTEXT = // 0 args
+ "JAXBResult.NullContext";
+
+ static final String RESULT_NULL_UNMARSHALLER = // 0 arg
+ "JAXBResult.NullUnmarshaller";
+
+ static final String SOURCE_NULL_CONTEXT = // 0 args
+ "JAXBSource.NullContext";
+
+ static final String SOURCE_NULL_CONTENT = // 0 arg
+ "JAXBSource.NullContent";
+
+ static final String SOURCE_NULL_MARSHALLER = // 0 arg
+ "JAXBSource.NullMarshaller";
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/util/ValidationEventCollector.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/util/ValidationEventCollector.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/util/ValidationEventCollector.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+package javax.xml.bind.util;
+
+import java.util.Vector;
+import javax.xml.bind.ValidationEventHandler;
+import javax.xml.bind.ValidationEvent;
+
+/**
+ * {@link javax.xml.bind.ValidationEventHandler ValidationEventHandler}
+ * implementation that collects all events.
+ *
+ * <p>
+ * To use this class, create a new instance and pass it to the setEventHandler
+ * method of the Validator, Unmarshaller, Marshaller class. After the call to
+ * validate or unmarshal completes, call the getEvents method to retrieve all
+ * the reported errors and warnings.
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 2467 $
+ * @see javax.xml.bind.Validator
+ * @see javax.xml.bind.ValidationEventHandler
+ * @see javax.xml.bind.ValidationEvent
+ * @see javax.xml.bind.ValidationEventLocator
+ * @since JAXB1.0
+ */
+public class ValidationEventCollector implements ValidationEventHandler
+{
+ private final Vector<ValidationEvent> events = new Vector<ValidationEvent>();
+
+ /**
+ * Return an array of ValidationEvent objects containing a copy of each of
+ * the collected errors and warnings.
+ *
+ * @return
+ * a copy of all the collected errors and warnings or an empty array
+ * if there weren't any
+ */
+ public ValidationEvent[] getEvents() {
+ return events.toArray(new ValidationEvent[events.size()]);
+ }
+
+ /**
+ * Clear all collected errors and warnings.
+ */
+ public void reset() {
+ events.removeAllElements();
+ }
+
+ /**
+ * Returns true if this event collector contains at least one
+ * ValidationEvent.
+ *
+ * @return true if this event collector contains at least one
+ * ValidationEvent, false otherwise
+ */
+ public boolean hasEvents() {
+ return !events.isEmpty();
+ }
+
+ public boolean handleEvent( ValidationEvent event ) {
+ events.add(event);
+
+ boolean retVal = true;
+ switch( event.getSeverity() ) {
+ case ValidationEvent.WARNING:
+ retVal = true; // continue validation
+ break;
+ case ValidationEvent.ERROR:
+ retVal = true; // continue validation
+ break;
+ case ValidationEvent.FATAL_ERROR:
+ retVal = false; // halt validation
+ break;
+ default:
+ _assert( false,
+ Messages.format( Messages.UNRECOGNIZED_SEVERITY,
+ event.getSeverity() ) );
+ break;
+ }
+
+ return retVal;
+ }
+
+ private static void _assert( boolean b, String msg ) {
+ if( !b ) {
+ throw new InternalError( msg );
+ }
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/util/package.html
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/util/package.html (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/javax/xml/bind/util/package.html 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,48 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+ <head>
+ <!--
+
+ @(#)package.html 1.60 98/01/27
+
+ Copyright 1998 Sun Microsystems, Inc. 901 San Antonio Road,
+ Palo Alto, California, 94303, U.S.A. All Rights Reserved.
+
+ This software is the confidential and proprietary information of Sun
+ Microsystems, Inc. ("Confidential Information"). You shall not
+ disclose such Confidential Information and shall use it only in
+ accordance with the terms of the license agreement you entered into
+ with Sun.
+
+ CopyrightVersion 1.2
+
+ -->
+ </head>
+
+ <body bgcolor="white">
+
+ <p>
+ Useful client utility classes.
+
+ <h2>Package Specification</h2>
+
+ <ul>
+ <li><a href="http://java.sun.com/xml/downloads/jaxb.html">JAXB
+ Specification</a>
+ </ul>
+
+ <h2>Related Documentation</h2>
+
+ For overviews, tutorials, examples, guides, and tool documentation,
+ please see:
+ <ul>
+ <li>The <a href="http://java.sun.com/xml/jaxb/index.html">JAXB
+ Website</a>
+ </ul>
+
+ <!-- Put @see and @since tags down here. -->
+
+ </body>
+</html>
+
+
Added: bpm-console/trunk/gui/war/src/main/java/jmaki/xhp/HttpClient.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/jmaki/xhp/HttpClient.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/jmaki/xhp/HttpClient.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,264 @@
+/* Copyright 2006-2008 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at:
+ http://developer.sun.com/berkeley_license.html
+ $Id: HttpClient.java 2631 2008-10-27 17:25:05Z heiko.braun at jboss.com $
+*/package jmaki.xhp;
+
+import java.io.*;
+import java.util.Map;
+import java.util.Iterator;
+import java.net.*;
+import java.util.logging.*;
+import java.security.Security;
+
+/**
+ * @author Yutaka Yoshida, Greg Murray
+ *
+ * Minimum set of HTTPclient supporting both http and https.
+ * It's aslo capable of POST, but it doesn't provide doGet because
+ * the caller can just read the inputstream.
+ */
+public class HttpClient {
+
+ private static Logger logger;
+ private String proxyHost = null;
+ private int proxyPort = -1;
+ private boolean isHttps = false;
+ private boolean isProxy = false;
+ private HttpURLConnection urlConnection = null;
+ private Map headers;
+
+ /**
+ * @param phost PROXY host name
+ * @param pport PROXY port string
+ * @param url URL string
+ * @param headers Map
+ */
+ public HttpClient(
+ String phost,
+ int pport,
+ String url,
+ Map headers,
+ String method)
+ throws MalformedURLException
+ {
+ if (phost != null && pport != -1)
+ {
+ this.isProxy = true;
+ }
+
+ this.proxyHost = phost;
+ this.proxyPort = pport;
+
+ if (url.trim().startsWith("https:")) {
+ isHttps = true;
+ }
+
+ this.urlConnection = getURLConnection(url);
+ try {
+ this.urlConnection.setRequestMethod(method);
+ } catch (java.net.ProtocolException pe) {
+ HttpClient.getLogger().severe("Unable protocol method to " + method + " : " + pe);
+ }
+ this.headers = headers;
+ // seat headers
+ if (headers != null) {
+ Iterator it = headers.keySet().iterator();
+ if (it != null) {
+ while (it.hasNext()) {
+ String key = (String)it.next();
+ String value = (String)headers.get(key);
+ this.urlConnection.setRequestProperty (key, value);
+ }
+ }
+ }
+ }
+
+ /**
+ * @param phost PROXY host name
+ * @param pport PROXY port string
+ * @param url URL string
+ * @param headers Map
+ * @param userName string
+ * @param password string
+ */
+ public HttpClient(String phost,
+ int pport,
+ String url,
+ Map headers,
+ String method,
+ String userName,
+ String password)
+ throws MalformedURLException {
+ try
+ {
+ if (phost != null && pport != -1) {
+ this.isProxy = true;
+ }
+
+ this.proxyHost = phost;
+ this.proxyPort = pport;
+ if (url.trim().startsWith("https:")) {
+ isHttps = true;
+ }
+ this.urlConnection = getURLConnection(url);
+ try {
+ this.urlConnection.setRequestMethod(method);
+ } catch (java.net.ProtocolException pe) {
+ HttpClient.getLogger().severe("Unable protocol method to " + method + " : " + pe);
+ }
+ // set basic authentication information
+ String auth = userName + ":" + password;
+ String encoded = new sun.misc.BASE64Encoder().encode (auth.getBytes());
+ // set basic authorization
+ this.urlConnection.setRequestProperty ("Authorization", "Basic " + encoded);
+ this.headers = headers;
+ // seat headers
+ if (headers != null) {
+ Iterator it = headers.entrySet().iterator();
+ if (it != null) {
+ while (it.hasNext()) {
+ String key = (String)it.next();
+ String value = (String)headers.get(key);
+ this.urlConnection.setRequestProperty (key, value);
+ }
+ }
+ }
+ } catch (Exception ex) {
+ HttpClient.getLogger().severe("Unable to set basic authorization for " + userName + " : " +ex);
+ }
+ }
+
+ /**
+ * private method to get the URLConnection
+ * @param str URL string
+ */
+ private HttpURLConnection getURLConnection(String str)
+ throws MalformedURLException {
+ try {
+
+ if (isHttps) {
+ /* when communicating with the server which has unsigned or invalid
+ * certificate (https), SSLException or IOException is thrown.
+ * the following line is a hack to avoid that
+ */
+ Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
+ System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
+ if (isProxy) {
+ System.setProperty("https.proxyHost", proxyHost);
+ System.setProperty("https.proxyPort", proxyPort + "");
+ }
+ }
+ else
+ {
+ if (isProxy)
+ {
+ System.setProperty("http.proxyHost", proxyHost);
+ System.setProperty("http.proxyPort", proxyPort + "");
+ }
+ }
+
+ URL url = new URL(str);
+ HttpURLConnection uc = (HttpURLConnection)url.openConnection();
+ // if this header has not been set by a request set the user agent.
+ if (headers == null ||
+ (headers != null && headers.get("user-agent") == null)) {
+ // set user agent to mimic a common browser
+ String ua="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)";
+ uc.setRequestProperty("user-agent", ua);
+ }
+ return uc;
+ }
+ catch (MalformedURLException me)
+ {
+ throw new MalformedURLException(str + " is not a valid URL");
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Unknown error creating UrlConnection: " + e);
+ }
+ }
+
+ /**
+ * returns the inputstream from URLConnection
+ * @return InputStream
+ */
+ public InputStream getInputStream() {
+ try
+ {
+ // logger doesnt work, because it writes to stderr,
+ // which causes GwtTest to interpret it as failure
+ System.out.println(
+ this.urlConnection.getRequestMethod()+ " " +
+ this.urlConnection.getURL() +": "+
+ this.urlConnection.getResponseCode()
+ );
+ return (this.urlConnection.getInputStream());
+ } catch (Exception e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ /**
+ * return the OutputStream from URLConnection
+ * @return OutputStream
+ */
+ public OutputStream getOutputStream() {
+
+ try {
+ return (this.urlConnection.getOutputStream());
+ } catch (Exception e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ /**
+ * posts data to the inputstream and returns the InputStream.
+ * @param postData data to be posted. must be url-encoded already.
+ * @param contentType allows you to set the contentType of the request.
+ * @return InputStream input stream from URLConnection
+ */
+ public InputStream doPost(String postData, String contentType) {
+ this.urlConnection.setDoOutput(true);
+ if (contentType != null) this.urlConnection.setRequestProperty( "Content-type", contentType );
+
+ OutputStream os = this.getOutputStream();
+ PrintStream ps = new PrintStream(os);
+ ps.print(postData);
+ ps.close();
+ return (this.getInputStream());
+ }
+
+ public String getContentEncoding() {
+ if (this.urlConnection == null) return null;
+ return (this.urlConnection.getContentEncoding());
+ }
+ public int getContentLength() {
+ if (this.urlConnection == null) return -1;
+ return (this.urlConnection.getContentLength());
+ }
+ public String getContentType() {
+ if (this.urlConnection == null) return null;
+ return (this.urlConnection.getContentType());
+ }
+ public long getDate() {
+ if (this.urlConnection == null) return -1;
+ return (this.urlConnection.getDate());
+ }
+ public String getHeader(String name) {
+ if (this.urlConnection == null) return null;
+ return (this.urlConnection.getHeaderField(name));
+ }
+ public long getIfModifiedSince() {
+ if (this.urlConnection == null) return -1;
+ return (this.urlConnection.getIfModifiedSince());
+ }
+
+ public static Logger getLogger() {
+ if (logger == null) {
+ logger = Logger.getLogger("jmaki.xhp.Log");
+ }
+ return logger;
+ }
+}
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/java/jmaki/xhp/XmlHttpProxy.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/jmaki/xhp/XmlHttpProxy.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/jmaki/xhp/XmlHttpProxy.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,396 @@
+/* Copyright 2007 You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at:
+ http://developer.sun.com/berkeley_license.html
+ $Id: XmlHttpProxy.java 2660 2008-10-29 14:40:28Z heiko.braun at jboss.com $
+*/
+package jmaki.xhp;
+
+/* Copyright 2007 You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at:
+ http://developer.sun.com/berkeley_license.html
+ $Id: XmlHttpProxy.java 2660 2008-10-29 14:40:28Z heiko.braun at jboss.com $
+*/
+
+import java.io.*;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.*;
+import java.util.logging.*;
+
+import javax.xml.transform.*;
+import javax.xml.transform.stream.*;
+
+import org.json.*;
+
+public class XmlHttpProxy {
+
+ public static String GET = "GET";
+ public static String POST = "POST";
+ public static String DELETE = "DELETE";
+ public static String PUT = "PUT";
+
+ private String userName = null;
+ private String password = null;
+ private static Logger logger;
+ private String proxyHost = "";
+ int proxyPort = -1;
+ private JSONObject config;
+ private static String USAGE = "Usage: -url service_URL -id service_key [-url or -id required] -xslurl xsl_url [optional] -format json|xml [optional] -callback[optional] -config [optional] -resources base_directory_containing XSL stylesheets [optional]";
+
+ public XmlHttpProxy() {}
+
+ public XmlHttpProxy(String proxyHost, int proxyPort) {
+ this.proxyHost = proxyHost;
+ this.proxyPort = proxyPort;
+ }
+
+ public XmlHttpProxy(String proxyHost, int proxyPort,
+ String userName, String password) {
+ this.proxyHost = proxyHost;
+ this.proxyPort = proxyPort;
+ this.userName = userName;
+ this.password = password;
+ }
+
+ /**
+ * This method will go out and make the call and it will apply an XSLT Transformation with the
+ * set of parameters provided.
+ *
+ * @param urlString - The URL which you are looking up
+ * @param out - The OutputStream to which the resulting document is written
+ * @param xslInputStream - An input Stream to an XSL style sheet that is provided to the XSLT processor. If set to null there will be no transformation
+ * @param paramsMap - A Map of parameters that are feed to the XSLT Processor. These params may be used when generating content. This may be set to null if no parameters are necessary.
+ * @param method - The HTTP method used.
+ *
+ */
+ public void processRequest(String urlString,
+ OutputStream out,
+ InputStream xslInputStream,
+ Map paramsMap,
+ Map headers,
+ String method,
+ String userName,
+ String password) throws IOException, MalformedURLException {
+ doProcess(urlString, out, xslInputStream, paramsMap, headers,method, null,null, userName,password);
+ }
+ /**
+ * This method will go out and make the call and it will apply an XSLT Transformation with the
+ * set of parameters provided.
+ *
+ * @param urlString - The URL which you are looking up
+ * @param out - The OutputStream to which the resulting document is written
+ *
+ */
+ public void doPost(String urlString,
+ OutputStream out,
+ InputStream xslInputStream,
+ Map paramsMap,
+ Map headers,
+ String postData,
+ String postContentType,
+ String userName,
+ String password) throws IOException, MalformedURLException {
+ doProcess(urlString, out, xslInputStream, paramsMap, headers, XmlHttpProxy.POST, postData, postContentType, userName, password);
+ }
+
+ /**
+ * This method will go out and make the call and it will apply an XSLT Transformation with the
+ * set of parameters provided.
+ *
+ * @param urlString - The URL which you are looking up
+ * @param out - The OutputStream to which the resulting document is written
+ * @param xslInputStream - An input Stream to an XSL style sheet that is provided to the XSLT processor. If set to null there will be no transformation
+ * @param paramsMap - A Map of parameters that are feed to the XSLT Processor. These params may be used when generating content. This may be set to null if no parameters are necessary.
+ * @param method - the HTTP method used.
+ * @param postData - A String of the bodyContent to be posted. A doPost will be used if this is parameter is not null.
+ * @param postContentType - The request contentType used when posting data. Will not be set if this parameter is null.
+ * @param userName - userName used for basic authorization
+ * @param password - password used for basic authorization
+ */
+ public void doProcess(String urlString,
+ OutputStream out,
+ InputStream xslInputStream,
+ Map paramsMap,
+ Map headers,
+ String method,
+ String postData,
+ String postContentType,
+ String userName,
+ String password) throws IOException, MalformedURLException {
+
+ if (paramsMap == null) {
+ paramsMap = new HashMap();
+ }
+
+ String format = (String)paramsMap.get("format");
+ if (format == null) {
+ format = "xml";
+ }
+
+ InputStream in = null;
+ BufferedOutputStream os = null;
+
+ HttpClient httpclient = null;
+
+ if (userName != null && password != null)
+ {
+ httpclient = new HttpClient(proxyHost, proxyPort, urlString, headers, method, userName, password);
+ }
+ else
+ {
+ httpclient = new HttpClient(proxyHost, proxyPort, urlString, headers, method);
+ }
+
+ // post data determines whether we are going to do a get or a post
+ if (postData == null) {
+ in = httpclient.getInputStream();
+ } else {
+ in = httpclient.doPost(postData, postContentType);
+ }
+
+ if(null==in)
+ {
+ throw new IOException("Failed to open input stream");
+ }
+
+ // read the encoding from the incoming document and default to UTF-8
+ // if an encoding is not provided
+ String ce = httpclient.getContentEncoding();
+ if (ce == null) {
+ String ct = httpclient.getContentType();
+ if (ct != null) {
+ int idx = ct.lastIndexOf("charset=");
+ if (idx >= 0) {
+ ce = ct.substring(idx+8);
+ } else {
+ ce = "UTF-8";
+ }
+ } else {
+ ce = "UTF-8";
+ }
+ }
+ // get the content type
+ String cType = null;
+ // write out the content type
+ //http://www.ietf.org/rfc/rfc4627.txt
+ if (format.equals("json")) {
+ cType = "application/json;charset="+ce;
+ } else {
+ cType = "text/xml;charset="+ce;
+ }
+ try {
+ byte[] buffer = new byte[1024];
+ int read = 0;
+ if (xslInputStream == null) {
+ while (true) {
+ read = in.read(buffer);
+ if (read <= 0) break;
+ out.write(buffer, 0, read );
+ }
+ } else {
+ transform(in, xslInputStream, paramsMap, out, ce);
+ }
+ } catch (Exception e) {
+ getLogger().severe("XmlHttpProxy transformation error: " + e);
+ } finally {
+ try {
+ if (in != null) {
+ in.close();
+ }
+ if (out != null) {
+ out.flush();
+ out.close();
+ }
+ } catch (Exception e) {
+ // do nothing
+ }
+ }
+ }
+
+ /**
+ * Do the XSLT transformation
+ */
+ public void transform( InputStream xmlIS,
+ InputStream xslIS,
+ Map params,
+ OutputStream result,
+ String encoding) {
+ try {
+ TransformerFactory trFac = TransformerFactory.newInstance();
+ Transformer transformer = trFac.newTransformer(new StreamSource(xslIS));
+ Iterator it = params.keySet().iterator();
+ while (it.hasNext()) {
+ String key = (String)it.next();
+ transformer.setParameter(key, (String)params.get(key));
+ }
+ transformer.setOutputProperty("encoding", encoding);
+ transformer.transform(new StreamSource(xmlIS), new StreamResult(result));
+ } catch (Exception e) {
+ getLogger().severe("XmlHttpProxy: Exception with xslt " + e);
+ }
+ }
+
+ /**
+ *
+ * CLI to the XmlHttpProxy
+ */
+ public static void main(String[] args)
+ throws IOException, MalformedURLException {
+
+ getLogger().info("XmlHttpProxy 1.8");
+ XmlHttpProxy xhp = new XmlHttpProxy();
+
+ if (args.length == 0) {
+ System.out.println(USAGE);
+ }
+
+ String method = XmlHttpProxy.GET;
+ InputStream xslInputStream = null;
+ String serviceKey = null;
+ String urlString = null;
+ String xslURLString = null;
+ String format = "xml";
+ String callback = null;
+ String urlParams = null;
+ String configURLString = "xhp.json";
+ String resourceBase = "file:src/conf/META-INF/resources/xsl/";
+ String username = null;
+ String password = null;
+
+ // read in the arguments
+ int index = 0;
+ while (index < args.length) {
+ if (args[index].toLowerCase().equals("-url") && index + 1 < args.length) {
+ urlString = args[++index];
+ } else if (args[index].toLowerCase().equals("-key") && index + 1 < args.length) {
+ serviceKey = args[++index];
+ } else if (args[index].toLowerCase().equals("-id") && index + 1 < args.length) {
+ serviceKey = args[++index];
+ } else if (args[index].toLowerCase().equals("-callback") && index + 1 < args.length) {
+ callback = args[++index];
+ } else if (args[index].toLowerCase().equals("-xslurl") && index + 1 < args.length) {
+ xslURLString = args[++index];
+ } else if (args[index].toLowerCase().equals("-method") && index + 1 < args.length) {
+ method = args[++index];
+ } else if (args[index].toLowerCase().equals("-username") && index + 1 < args.length) {
+ username = args[++index];
+ } else if (args[index].toLowerCase().equals("-password") && index + 1 < args.length) {
+ password = args[++index];
+ } else if (args[index].toLowerCase().equals("-urlparams") && index + 1 < args.length) {
+ urlParams = args[++index];
+ } else if (args[index].toLowerCase().equals("-config") && index + 1 < args.length) {
+ configURLString = args[++index];
+ } else if (args[index].toLowerCase().equals("-resources") && index + 1 < args.length) {
+ resourceBase = args[++index];
+ }
+ index++;
+ }
+
+ if (serviceKey != null) {
+ try {
+ InputStream is = (new URL(configURLString)).openStream();
+ JSONObject services = loadServices(is);
+ JSONObject service = services.getJSONObject(serviceKey);
+ // default to the service default if no url parameters are specified
+ if (urlParams == null && service.has("defaultURLParams")) {
+ urlParams = service.getString("defaultURLParams");
+ }
+ String serviceURL = service.getString("url");
+ // build the URL properly
+ if (urlParams != null && serviceURL.indexOf("?") == -1){
+ serviceURL += "?";
+ } else if (urlParams != null){
+ serviceURL += "&";
+ }
+ String apiKey = "";
+ if (service.has("apikey")) apiKey = service.getString("apikey");
+ urlString = serviceURL + apiKey + "&" + urlParams;
+ if (service.has("xslStyleSheet")) {
+ xslURLString = service.getString("xslStyleSheet");
+ // check if the url is correct of if to load from the classpath
+
+ }
+ } catch (Exception ex) {
+ getLogger().severe("XmlHttpProxy Error loading service: " + ex);
+ System.exit(1);
+ }
+ } else if (urlString == null) {
+ System.out.println(USAGE);
+ System.exit(1);
+ }
+ // The parameters are feed to the XSL Stylsheet during transformation.
+ // These parameters can provided data or conditional information.
+ Map paramsMap = new HashMap();
+ if (format != null) {
+ paramsMap.put("format", format);
+ }
+ if (callback != null) {
+ paramsMap.put("callback", callback);
+ }
+
+ if (xslURLString != null) {
+ URL xslURL = new URL(xslURLString);
+ if (xslURL != null) {
+ xslInputStream = xslURL.openStream();
+ } else {
+ getLogger().severe("Error: Unable to locate XSL at URL " + xslURLString);
+ }
+ }
+ xhp.processRequest(urlString, System.out, xslInputStream, paramsMap, null, method, username, password);
+ }
+
+ public static Logger getLogger() {
+ if (logger == null) {
+ logger = Logger.getLogger("jmaki.xhp.Log");
+ }
+ return logger;
+ }
+
+ public static JSONObject loadServices(InputStream is)
+ {
+ JSONObject config = null;
+ JSONObject services = new JSONObject();
+ try
+ {
+ config = loadJSONObject(is).getJSONObject("xhp");
+ JSONArray sA = config.getJSONArray("services");
+ for (int l=0; l < sA.length(); l++) {
+ JSONObject value = sA.getJSONObject(l);
+ String key = value.getString("id");
+ services.put(key,value);
+ }
+ }
+ catch (Exception ex)
+ {
+ getLogger().severe("XmlHttpProxy error loading services." + ex);
+ }
+ return services;
+ }
+
+ public static JSONObject loadJSONObject(InputStream in) {
+ ByteArrayOutputStream out = null;
+ try {
+ byte[] buffer = new byte[1024];
+ int read = 0;
+ out = new ByteArrayOutputStream();
+ while (true) {
+ read = in.read(buffer);
+ if (read <= 0) break;
+ out.write(buffer, 0, read );
+ }
+ return new JSONObject(out.toString());
+ } catch (Exception e) {
+ getLogger().severe("XmlHttpProxy error reading in json " + e);
+ } finally {
+ try {
+ if (in != null) {
+ in.close();
+ }
+ if (out != null) {
+ out.flush();
+ out.close();
+ }
+ } catch (Exception e) {
+ }
+ }
+ return null;
+ }
+}
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/java/jmaki/xhp/XmlHttpProxyServlet.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/jmaki/xhp/XmlHttpProxyServlet.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/jmaki/xhp/XmlHttpProxyServlet.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,494 @@
+/* Copyright 2007 You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at:
+ http://developer.sun.com/berkeley_license.html
+ $Id: XmlHttpProxyServlet.java 3181 2008-12-03 13:19:19Z heiko.braun at jboss.com $
+*/
+package jmaki.xhp;
+
+import java.io.*;
+import java.util.*;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLEncoder;
+import java.util.logging.*;
+
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+import org.json.*;
+
+/** XmlHttpProxyServlet
+ * @author Greg Murray
+ */
+public class XmlHttpProxyServlet extends HttpServlet
+{
+
+ public static String REMOTE_USER = "REMOTE_USER";
+
+ private static String XHP_LAST_MODIFIED = "xhp_last_modified_key";
+ private static String XHP_CONFIG = "xhp.json";
+
+ private static boolean allowXDomain = false;
+ private static boolean requireSession = false;
+ private static boolean createSession = false;
+ private static String defaultContentType = "application/json;charset=UTF-8";
+ private static boolean rDebug = false;
+ private Logger logger = null;
+ private XmlHttpProxy xhp = null;
+ private ServletContext ctx;
+ private JSONObject services = null;
+ private String resourcesDir = "/resources/";
+ private String classpathResourcesDir = "/META-INF/resources/";
+ private String headerToken = "jmaki-";
+ private String testToken = "xtest-";
+
+ public XmlHttpProxyServlet() {
+ if (rDebug) {
+ logger = getLogger();
+ }
+ }
+
+ public void init(ServletConfig config) throws ServletException {
+ super.init(config);
+ ctx = config.getServletContext();
+ // set the response content type
+ if (ctx.getInitParameter("responseContentType") != null) {
+ defaultContentType = ctx.getInitParameter("responseContentType");
+ }
+ // allow for resources dir over-ride at the xhp level otherwise allow
+ // for the jmaki level resources
+ if (ctx.getInitParameter("jmaki-xhp-resources") != null) {
+ resourcesDir = ctx.getInitParameter("jmaki-xhp-resources");
+ } else if (ctx.getInitParameter("jmaki-resources") != null) {
+ resourcesDir = ctx.getInitParameter("jmaki-resources");
+ }
+ // allow for resources dir over-ride
+ if (ctx.getInitParameter("jmaki-classpath-resources") != null) {
+ classpathResourcesDir = ctx.getInitParameter("jmaki-classpath-resources");
+ }
+ String requireSessionString = ctx.getInitParameter("requireSession");
+ if (requireSessionString == null) requireSessionString = ctx.getInitParameter("jmaki-requireSession");
+ if (requireSessionString != null) {
+ if ("false".equals(requireSessionString)) {
+ requireSession = false;
+ getLogger().severe("XmlHttpProxyServlet: intialization. Session requirement disabled.");
+ } else if ("true".equals(requireSessionString)) {
+ requireSession = true;
+ getLogger().severe("XmlHttpProxyServlet: intialization. Session requirement enabled.");
+ }
+ }
+ String xdomainString = ctx.getInitParameter("allowXDomain");
+ if (xdomainString == null) xdomainString = ctx.getInitParameter("jmaki-allowXDomain");
+ if (xdomainString != null) {
+ if ("true".equals(xdomainString)) {
+ allowXDomain = true;
+ getLogger().severe("XmlHttpProxyServlet: intialization. xDomain access is enabled.");
+ } else if ("false".equals(xdomainString)) {
+ allowXDomain = false;
+ getLogger().severe("XmlHttpProxyServlet: intialization. xDomain access is disabled.");
+ }
+ }
+ String createSessionString = ctx.getInitParameter("jmaki-createSession");
+ if (createSessionString != null) {
+ if ("true".equals(createSessionString)) {
+ createSession = true;
+ getLogger().severe("XmlHttpProxyServlet: intialization. create session is enabled.");
+ } else if ("false".equals(xdomainString)) {
+ createSession = false;
+ getLogger().severe("XmlHttpProxyServlet: intialization. create session is disabled.");
+ }
+ }
+ // if there is a proxyHost and proxyPort specified create an HttpClient with the proxy
+ String proxyHost = ctx.getInitParameter("proxyHost");
+ String proxyPortString = ctx.getInitParameter("proxyPort");
+ if (proxyHost != null && proxyPortString != null) {
+ int proxyPort = 8080;
+ try {
+ proxyPort= new Integer(proxyPortString).intValue();
+ xhp = new XmlHttpProxy(proxyHost, proxyPort);
+ } catch (NumberFormatException nfe) {
+ getLogger().severe("XmlHttpProxyServlet: intialization error. The proxyPort must be a number");
+ throw new ServletException("XmlHttpProxyServlet: intialization error. The proxyPort must be a number");
+ }
+ } else {
+ xhp = new XmlHttpProxy();
+ }
+ }
+
+ private void getServices(HttpServletResponse res)
+ {
+ InputStream is = null;
+ try
+ {
+ URL url = ctx.getResource(resourcesDir + XHP_CONFIG);
+ // use classpath if not found locally.
+ //if (url == null) url = XmlHttpProxyServlet.class.getResource(classpathResourcesDir + XHP_CONFIG);
+ if (url == null) url = XmlHttpProxyServlet.class.getResource(XHP_CONFIG); // same package
+ is = url.openStream();
+ }
+ catch (Exception ex)
+ {
+ try
+ {
+ getLogger().severe("XmlHttpProxyServlet error loading xhp.json : " + ex);
+ PrintWriter writer = res.getWriter();
+ writer.write("XmlHttpProxyServlet Error: Error loading xhp.json. Make sure it is available in the /resources directory of your applicaton.");
+ writer.flush();
+ }
+ catch (Exception iox) {}
+ }
+ services = xhp.loadServices(is);
+ }
+
+ public void doDelete(HttpServletRequest req, HttpServletResponse res) {
+ doProcess(req,res, XmlHttpProxy.DELETE);
+ }
+
+ public void doGet(HttpServletRequest req, HttpServletResponse res) {
+ doProcess(req,res, XmlHttpProxy.GET);
+ }
+
+ public void doPost(HttpServletRequest req, HttpServletResponse res) {
+ doProcess(req,res, XmlHttpProxy.POST);
+ }
+
+ public void doPut(HttpServletRequest req, HttpServletResponse res) {
+ doProcess(req,res, XmlHttpProxy.PUT);
+ }
+
+ public void doProcess(HttpServletRequest req, HttpServletResponse res, String method)
+ {
+
+ boolean isPost = XmlHttpProxy.POST.equals(method);
+ StringBuffer bodyContent = null;
+ OutputStream out = null;
+ PrintWriter writer = null;
+ String serviceKey = null;
+ try {
+ BufferedReader in = req.getReader();
+ String line = null;
+ while ((line = in.readLine()) != null) {
+ if (bodyContent == null) bodyContent = new StringBuffer();
+ bodyContent.append(line);
+ }
+ } catch (Exception e) {
+ }
+
+ try
+ {
+ HttpSession session = null;
+ // it really does not make sense to use create session with require session as
+ // the create session will always result in a session created and the requireSession
+ // will always succeed. Leaving the logic for now.
+ if (createSession) {
+ session = req.getSession(true);
+ }
+ if (requireSession) {
+ // check to see if there was a session created for this request
+ // if not assume it was from another domain and blow up
+ // Wrap this to prevent Portlet exeptions
+ session = req.getSession(false);
+ if (session == null) {
+ res.setStatus(HttpServletResponse.SC_FORBIDDEN);
+ return;
+ }
+ }
+ serviceKey = req.getParameter("id");
+ // only to preven regressions - Remove before 1.0
+ if (serviceKey == null) serviceKey = req.getParameter("key");
+ // check if the services have been loaded or if they need to be reloaded
+ if (services == null || configUpdated()) {
+ getServices(res);
+ }
+ String urlString = null;
+ String xslURLString = null;
+ String userName = null;
+ String password = null;
+ String format = "json";
+ String callback = req.getParameter("callback");
+ String urlParams = req.getParameter("urlparams");
+ String countString = req.getParameter("count");
+ boolean passthrough = false;
+ // encode the url to prevent spaces from being passed along
+ if (urlParams != null) {
+ urlParams = urlParams.replace(' ', '+');
+ }
+ // get the headers to pass through
+ Map headers = null;
+ // Forward all request headers starting with the header token jmaki-
+ // and chop off the jmaki-
+ Enumeration hnum = req.getHeaderNames();
+
+ // test hack
+
+ while (hnum.hasMoreElements()) {
+ String name = (String)hnum.nextElement();
+ if (name.startsWith(headerToken))
+ {
+ if (headers == null) headers = new HashMap();
+
+ String value = "";
+ // handle multi-value headers
+ Enumeration vnum = req.getHeaders(name);
+ while (vnum.hasMoreElements()) {
+ value += (String)vnum.nextElement();
+ if (vnum.hasMoreElements()) value += ";";
+ }
+ String sname = name.substring(headerToken.length(), name.length());
+ headers.put(sname,value);
+ }
+ else if(name.startsWith(testToken))
+ {
+ // hack test capabilities for authentication
+ if("xtest-user".equals(name)) userName = req.getHeader("xtest-user");
+ if("xtest-pass".equals(name)) password = req.getHeader("xtest-pass");
+ }
+ }
+
+ String contentType = null;
+ try
+ {
+ String actualServiceKey = serviceKey != null ? serviceKey : "default";
+ if (services.has(actualServiceKey))
+ {
+
+ JSONObject service = services.getJSONObject(actualServiceKey);
+ String serviceURL = service.getString("url");
+ if(null==serviceURL)
+ throw new IllegalArgumentException("xhp.json: service url is mising");
+
+ if (service.has("passthrough")) passthrough =
+ Boolean.valueOf(service.getString("passthrough"));
+
+ if(service.has("contentType")) contentType = service.getString("contentType");
+
+ if (service.has("username")) userName = service.getString("username");
+ if (service.has("password")) password = service.getString("password");
+
+ String apikey = "";
+ if (service.has("apikey")) apikey = service.getString("apikey");
+ if (service.has("xslStyleSheet")) xslURLString = service.getString("xslStyleSheet");
+
+ // default to the service default if no url parameters are specified
+ if(!passthrough)
+ {
+ if (urlParams == null && service.has("defaultURLParams")) {
+ urlParams = service.getString("defaultURLParams");
+ }
+
+ // build the URL
+ if (urlParams != null && serviceURL.indexOf("?") == -1){
+ serviceURL += "?";
+ } else if (urlParams != null) {
+ serviceURL += "&";
+ }
+
+ urlString = serviceURL + apikey;
+ if (urlParams != null) urlString += "&" + urlParams;
+ }
+
+ if(passthrough)
+ {
+ StringBuffer sb = new StringBuffer();
+ sb.append(serviceURL);
+
+ // override service url and url params
+ String path = req.getPathInfo();
+ path = path.substring(path.indexOf("xhp/")+3, path.length());
+
+ StringTokenizer tok = new StringTokenizer(path, "/");
+ while(tok.hasMoreTokens())
+ {
+ sb.append("/").append(URLEncoder.encode(tok.nextToken()));
+ }
+
+ sb.append("?").append(req.getQueryString());
+
+ urlString = sb.toString();
+ }
+ }
+ else
+ {
+ writer = res.getWriter();
+ if (serviceKey == null) writer.write("XmlHttpProxyServlet Error: id parameter specifying serivce required.");
+ else writer.write("XmlHttpProxyServlet Error : service for id '" + serviceKey + "' not found.");
+ writer.flush();
+ return;
+ }
+ }
+ catch (Exception ex)
+ {
+ getLogger().severe("XmlHttpProxyServlet Error loading service: " + ex);
+ res.setStatus(500);
+ }
+
+ Map paramsMap = new HashMap();
+ paramsMap.put("format", format);
+ // do not allow for xdomain unless the context level setting is enabled.
+ if (callback != null && allowXDomain) {
+ paramsMap.put("callback", callback);
+ }
+ if (countString != null) {
+ paramsMap.put("count", countString);
+ }
+
+ InputStream xslInputStream = null;
+
+ if (urlString == null) {
+ writer = res.getWriter();
+ writer.write("XmlHttpProxyServlet parameters: id[Required] urlparams[Optional] format[Optional] callback[Optional]");
+ writer.flush();
+ return;
+ }
+ // support for session properties and also authentication name
+ if (urlString.indexOf("${") != -1) {
+ urlString = processURL(urlString, req, res);
+ }
+ // default to JSON
+ String actualContentType = contentType!=null ? contentType : defaultContentType;
+ res.setContentType(actualContentType);
+
+ out = res.getOutputStream();
+ // get the stream for the xsl stylesheet
+ if (xslURLString != null) {
+ // check the web root for the resource
+ URL xslURL = null;
+ xslURL = ctx.getResource(resourcesDir + "xsl/"+ xslURLString);
+ // if not in the web root check the classpath
+ if (xslURL == null) {
+ xslURL = XmlHttpProxyServlet.class.getResource(classpathResourcesDir + "xsl/" + xslURLString);
+ }
+ if (xslURL != null) {
+ xslInputStream = xslURL.openStream();
+ } else {
+ String message = "Could not locate the XSL stylesheet provided for service id " + serviceKey + ". Please check the XMLHttpProxy configuration.";
+ getLogger().severe(message);
+ res.setStatus(500);
+ try {
+ out.write(message.getBytes());
+ out.flush();
+ return;
+ } catch (java.io.IOException iox){
+ }
+ }
+ }
+
+ if (!isPost)
+ {
+ xhp.processRequest(urlString, out, xslInputStream, paramsMap, headers, method, userName, password);
+ }
+ else
+ {
+ final String content = bodyContent != null ? bodyContent.toString() : "";
+ if (bodyContent == null)
+ getLogger().info("XmlHttpProxyServlet attempting to post to url " + urlString + " with no body content");
+ xhp.doPost(urlString, out, xslInputStream, paramsMap, headers, content, req.getContentType(), userName, password);
+ }
+ }
+ catch (Exception iox)
+ {
+ iox.printStackTrace();
+ getLogger().severe("XmlHttpProxyServlet: caught " + iox);
+ res.setStatus(500);
+ /*try {
+ writer = res.getWriter();
+ writer.write("XmlHttpProxyServlet error loading service for " + serviceKey + " . Please notify the administrator.");
+ writer.flush();
+ } catch (java.io.IOException ix) {
+ ix.printStackTrace();
+ }*/
+ return;
+ }
+ finally
+ {
+ try
+ {
+ if (out != null) out.close();
+ if (writer != null) writer.close();
+ } catch (java.io.IOException iox){}
+ }
+ }
+
+ /* Allow for a EL style replacements in the serviceURL
+ *
+ * The constant REMOTE_USER will replace the contents of ${REMOTE_USER}
+ * with the return value of request.getRemoteUserver() if it is not null
+ * otherwise the ${REMOTE_USER} is replaced with a blank.
+ *
+ * If you use ${session.somekey} the ${session.somekey} will be replaced with
+ * the String value of the session varialble somekey or blank if the session key
+ * does not exist.
+ *
+ */
+ private String processURL(String url, HttpServletRequest req, HttpServletResponse res) {
+ String serviceURL = url;
+ int start = url.indexOf("${");
+ int end = url.indexOf("}", start);
+ if (end != -1) {
+ String prop = url.substring(start + 2, end).trim();
+ // no matter what we will remove the ${}
+ // default to blank like the JSP EL
+ String replace = "";
+ if (REMOTE_USER.equals(prop)) {
+ if (req.getRemoteUser() != null) replace = req.getRemoteUser();
+ }
+ if (prop.toLowerCase().startsWith("session.")) {
+ String sessionKey = prop.substring("session.".length(), prop.length());
+ if (req.getSession().getAttribute(sessionKey) != null) {
+ // force to a string
+ replace = req.getSession().getAttribute(sessionKey).toString();
+ }
+ }
+ serviceURL = serviceURL.substring(0, start) +
+ replace +
+ serviceURL.substring(end + 1, serviceURL.length());
+ }
+ // call recursively to process more than one instance of a ${ in the serviceURL
+ if (serviceURL.indexOf("${") != -1) serviceURL = processURL(serviceURL, req, res);
+ return serviceURL;
+ }
+
+ /**
+ * Check to see if the configuration file has been updated so that it may be reloaded.
+ */
+ private boolean configUpdated() {
+ try {
+ URL url = ctx.getResource(resourcesDir + XHP_CONFIG);
+ URLConnection con;
+ if (url == null) return false ;
+ con = url.openConnection();
+ long lastModified = con.getLastModified();
+ long XHP_LAST_MODIFIEDModified = 0;
+ if (ctx.getAttribute(XHP_LAST_MODIFIED) != null) {
+ XHP_LAST_MODIFIEDModified = ((Long)ctx.getAttribute(XHP_LAST_MODIFIED)).longValue();
+ } else {
+ ctx.setAttribute(XHP_LAST_MODIFIED, new Long(lastModified));
+ return false;
+ }
+ if (XHP_LAST_MODIFIEDModified < lastModified) {
+ ctx.setAttribute(XHP_LAST_MODIFIED, new Long(lastModified));
+ return true;
+ }
+ } catch (Exception ex) {
+ getLogger().severe("XmlHttpProxyServlet error checking configuration: " + ex);
+ }
+ return false;
+ }
+
+ public Logger getLogger() {
+ if (logger == null) {
+ logger = Logger.getLogger("jmaki.services.xhp.Log");
+
+ // TODO: the logger breaks the GWT tests, because it writes to stderr
+ // we'll turn it off for now.
+ System.out.println("WARN: XHP proxy logging is turned off");
+ logger.setLevel(Level.OFF);
+ }
+ return logger;
+ }
+
+ private void logMessage(String message) {
+ if (rDebug) {
+ getLogger().info(message);
+ }
+ }
+}
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Application.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Application.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Application.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
+import com.google.gwt.user.client.DOM;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import com.allen_sauer.gwt.log.client.Log;
+
+/**
+ * Setup the main {@link com.mvc4g.client.Controller} and fire
+ * a login event.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class Application implements EntryPoint
+{
+
+ public void onModuleLoad() {
+ Log.setUncaughtExceptionHandler();
+
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+
+ // hide spash image
+ DOM.getElementById("splash_loading").getStyle().setProperty("display", "none");
+
+ // move the loading div to background
+ DOM.getElementById("splash").getStyle().setProperty("z-index", "-1");
+
+ onModuleLoad2();
+ }
+ });
+ }
+
+ public void onModuleLoad2()
+ {
+ Controller mainController = new com.mvc4g.client.Controller();
+ mainController.addAction("login", new LoginAction());
+ mainController.addView("loginView", new LoginView());
+ mainController.handleEvent(new Event("login", null));
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/BootstrapAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/BootstrapAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/BootstrapAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.model.ServerStatus;
+import org.jboss.bpm.console.client.model.DTOParser;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.google.gwt.json.client.JSONValue;
+import com.google.gwt.json.client.JSONParser;
+import com.mvc4g.client.Controller;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class BootstrapAction extends AbstractRESTAction
+{
+ public final static String ID = BootstrapAction.class.getName();
+
+ public BootstrapAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ return appContext.getUrlBuilder().getServerStatusURL();
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.GET;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ JSONValue json = JSONParser.parse(response.getText());
+ ServerStatus status = DTOParser.parseStatus(json);
+
+ // global var
+ ServerPlugins.setStatus(status);
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Header.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Header.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Header.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,128 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.google.gwt.user.client.ui.*;
+import com.google.gwt.user.client.Timer;
+import com.google.gwt.core.client.GWT;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.ViewInterface;
+
+import java.util.List;
+
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.AbsoluteLayout;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class Header extends LayoutPanel implements ViewInterface
+{
+ public final static String ID = Header.class.getName();
+
+ private ApplicationContext appContext;
+ private Controller controller;
+ private Image loadingImage;
+
+ // avoid flickering image
+ final Timer turnOffLoading = new Timer() {
+ public void run() {
+ loadingImage.setVisible(false);
+ }
+ };
+
+ public Header(ApplicationContext appContext, String username, List<String> roles)
+ {
+ super(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
+ this.setStyleName("bpm-header");
+
+ this.appContext = appContext;
+
+ createInfoPanel();
+ }
+
+ private void createInfoPanel()
+ {
+
+ // ----------- logo panel
+ LayoutPanel logoPanel = new LayoutPanel(new BoxLayout());
+ logoPanel.setStyleName("bpm-header-left");
+
+ Image logo = new Image(appContext.getConfig().getLogo());
+ logo.setHeight("50");
+ logoPanel.add(logo);
+
+ // ----------- info panel
+ HorizontalPanel infoPanel = new HorizontalPanel();
+ infoPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
+ infoPanel.setSpacing(5);
+ infoPanel.setStyleName("bpm-header-right");
+
+ LayoutPanel loadingImageContainer = new LayoutPanel();
+ loadingImageContainer.setStyleName("bpm-loading-image");
+
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+ loadingImage = new Image("images/icons/loading.gif");
+ loadingImageContainer.add(loadingImage);
+
+ setLoading(false);
+
+ // account info
+ Image img = icons.userIcon().createImage();
+ HTML html = new HTML(appContext.getAuthentication().getUsername());
+
+ Button btn = new Button("Logout", new ClickListener()
+ {
+
+ public void onClick(Widget widget)
+ {
+ appContext.getAuthentication().doLogout();
+ }
+ }
+ );
+
+ infoPanel.add(loadingImageContainer);
+ infoPanel.add(img);
+ infoPanel.add(html);
+ infoPanel.add(btn);
+
+ this.add(logoPanel, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+ this.add(infoPanel, new BoxLayoutData(150, 50));
+ }
+
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public void setLoading(boolean doDisplay)
+ {
+ if(doDisplay)
+ loadingImage.setVisible(doDisplay);
+ else
+ turnOffLoading.schedule(1000);
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoadingStatusAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoadingStatusAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoadingStatusAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class LoadingStatusAction implements ActionInterface
+{
+
+ public final static String ID = LoadingStatusAction.class.getName();
+
+ public final static Event ON = new Event(LoadingStatusAction.ID, true);
+ public final static Event OFF = new Event(LoadingStatusAction.ID, false);
+
+ /**
+ * @param controller
+ * @param object Boolean
+ */
+ public void execute(Controller controller, Object object)
+ {
+ Boolean b = (Boolean)object;
+ Header header = (Header)controller.getView(Header.ID);
+ header.setLoading(b);
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Controller;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.DeferredCommand;
+import com.google.gwt.user.client.Command;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class LoginAction implements ActionInterface
+{
+
+ public void execute(Controller controller, Object object)
+ {
+ LoginView loginView = (LoginView)controller.getView(LoginView.NAME);
+ loginView.display();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,239 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.http.client.Request;
+import com.google.gwt.http.client.Response;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.DeferredCommand;
+import com.google.gwt.user.client.WindowCloseListener;
+import com.google.gwt.user.client.ui.*;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.ViewInterface;
+import org.gwt.mosaic.ui.client.WindowPanel;
+import org.gwt.mosaic.ui.client.layout.*;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class LoginView implements ViewInterface
+{
+ public final static String NAME = "loginView";
+
+ private ConsoleConfig config;
+ private URLBuilder urlBuilder;
+ private Authentication auth;
+
+ private WindowPanel window = null;
+ private TextBox usernameInput;
+ private PasswordTextBox passwordInput;
+
+ public final static String[] KNOWN_ROLES = {"admin", "manager", "user"};
+
+ private Controller controller;
+
+ public LoginView()
+ {
+ config = new ConsoleConfig();
+
+ // setup
+ if (!GWT.isScript())
+ {
+ String proxyUrl = GWT.getModuleBaseURL() + "xhp";
+ config.setConsoleServerUrl(proxyUrl);
+ }
+ else
+ {
+ // extract host
+ String base = GWT.getHostPageBaseURL();
+ String protocol = base.substring(0, base.indexOf("//")+2);
+ String noProtocol = base.substring(base.indexOf(protocol)+protocol.length(), base.length());
+ String host = noProtocol.substring(0, noProtocol.indexOf("/"));
+
+ config.setConsoleServerUrl(protocol + host + config.getServerWebContext());
+ }
+
+ ConsoleLog.debug("Console server: " + config.getConsoleServerUrl());
+
+ urlBuilder = new URLBuilder(config);
+
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public void display()
+ {
+ createLayoutWindowPanel();
+ window.center();
+
+ // focus
+ usernameInput.setFocus(true);
+
+ }
+
+ /**
+ * The 'layout' window panel.
+ */
+ private void createLayoutWindowPanel() {
+ window = new WindowPanel(config.getProfileName());
+ window.setAnimationEnabled(true);
+ window.setSize("320px", "180px");
+
+ LayoutPanel panel = new LayoutPanel();
+
+ createLayoutContent(panel);
+ window.setWidget(panel);
+
+ window.addWindowCloseListener(new WindowCloseListener() {
+ public void onWindowClosed() {
+ window = null;
+ }
+
+ public String onWindowClosing() {
+ return null;
+ }
+ });
+
+
+ }
+
+ /**
+ * Create content for layout.
+ */
+ private void createLayoutContent(LayoutPanel layoutPanel) {
+
+ layoutPanel.setLayout(new BorderLayout());
+ layoutPanel.setPadding(5);
+
+ final Button submit = new Button("Submit");
+ submit.addClickListener(new ClickListener()
+ {
+
+ public void onClick(Widget widget)
+ {
+ doLoginRequest();
+ }
+ });
+
+ Widget form = createForm();
+
+ layoutPanel.add(form, new BorderLayoutData(BorderLayout.Region.CENTER));
+ layoutPanel.add(submit, new BorderLayoutData(BorderLayout.Region.SOUTH));
+
+ }
+
+ private void doLoginRequest()
+ {
+ String user = usernameInput.getText();
+ String pass = passwordInput.getText();
+
+ String url = urlBuilder.getUserInRoleURL(KNOWN_ROLES);
+ auth = new Authentication(url);
+ auth.setCallback(
+ new Authentication.AuthCallback()
+ {
+
+ public void onLoginSuccess(Request request, Response response)
+ {
+ // clear the form
+ usernameInput.setText("");
+ passwordInput.setText("");
+
+ // display main console
+ window.hide();
+
+ // assemble main layout
+ DeferredCommand.addCommand(
+ new Command()
+ {
+ public void execute()
+ {
+ // move the loading div to foreground
+ DOM.getElementById("splash").getStyle().setProperty("z-index", "1000");
+ DOM.getElementById("ui_loading").getStyle().setProperty("visibility", "visible");
+ new MainLayout(controller, auth, urlBuilder, config);
+ }
+ });
+
+ window = null;
+ }
+
+ public void onLoginFailed(Request request, Throwable t)
+ {
+ // auth failed
+ ConsoleLog.error("Authentication failed.", t);
+ }
+ }
+ );
+
+ auth.doLogin(user, pass);
+ }
+
+ private Widget createForm()
+ {
+ LayoutPanel p = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ Label label = new Label("Login");
+ label.setStyleName("bpm-label-header");
+ p.add(label, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ usernameInput = new TextBox();
+ passwordInput = new PasswordTextBox();
+
+ Grid grid = new Grid(2,2);
+ grid.setWidget(0,0, new Label("Username:"));
+ grid.setWidget(0,1, usernameInput);
+
+ grid.setWidget(1,0, new Label("Password:"));
+ grid.setWidget(1,1, passwordInput);
+
+ p.add(grid);
+
+ passwordInput.addKeyboardListener(
+ new KeyboardListener()
+ {
+
+ public void onKeyDown(Widget widget, char c, int i)
+ {
+ }
+
+ public void onKeyPress(Widget widget, char c, int i)
+ {
+ }
+
+ public void onKeyUp(Widget widget, char c, int i)
+ {
+ if(c == KeyboardListener.KEY_ENTER)
+ {
+ doLoginRequest();
+ }
+ }
+ }
+ );
+ return p;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,275 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.allen_sauer.gwt.log.client.DivLogger;
+import com.allen_sauer.gwt.log.client.Log;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.*;
+import com.google.gwt.user.client.ui.*;
+import com.google.gwt.user.client.ui.HTML;
+import com.mvc4g.client.*;
+import org.gwt.mosaic.ui.client.*;
+import org.gwt.mosaic.ui.client.layout.BorderLayout;
+import static org.gwt.mosaic.ui.client.layout.BorderLayout.Region;
+import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.gwt.mosaic.ui.client.util.ButtonHelper;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.jboss.bpm.console.client.util.WindowUtil;
+import org.jboss.bpm.console.client.engine.ViewDeploymentAction;
+import org.jboss.bpm.console.client.engine.UpdateDeploymentsAction;
+import org.jboss.bpm.console.client.process.UpdateDefinitionsAction;
+import org.jboss.bpm.console.client.task.TaskEditor;
+
+/**
+ * The main composite that assembles the gwt console application.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class MainLayout extends Composite implements ApplicationContext
+{
+
+ public final static String NAME = "mainLayout";
+
+ private Header header;
+ private Menu menu;
+
+ private Workspace workspace;
+ private URLBuilder urlBuilder;
+ private Authentication auth;
+ private ConsoleConfig config;
+
+ private Controller controller;
+ private Viewport viewport;
+
+ public MainLayout(Controller controller, Authentication auth, URLBuilder urlBuilder, ConsoleConfig config)
+ {
+ this.controller = controller;
+ this.auth = auth;
+ this.config = config;
+ this.urlBuilder = urlBuilder;
+
+ display();
+ }
+
+ public void display()
+ {
+ viewport = new Viewport();
+
+ // manually, otherwise it will appear on the login screen
+ Log.addLogger(new DivLogger());
+
+ LayoutPanel layout = createLayout();
+ viewport.add(layout);
+
+ Timer t = new Timer() {
+
+ public void run()
+ {
+ // hide the loading div
+ DeferredCommand.addCommand(
+ new Command()
+ {
+ public void execute()
+ {
+ DOM.getElementById("ui_loading").getStyle().setProperty("visibility", "hidden");
+ DOM.getElementById("splash").getStyle().setProperty("visibility", "hidden");
+ }
+ });
+
+ }
+ };
+ t.schedule(2000);
+
+ RootPanel.get().add(viewport);
+
+ }
+
+ private LayoutPanel createLayout()
+ {
+ final LayoutPanel layoutPanel = new LayoutPanel(new BorderLayout());
+
+ // header
+ header = new Header(this, auth.getUsername(), auth.getRolesAssigned());
+ layoutPanel.add(header, new BorderLayoutData(Region.NORTH, 50));
+
+ // menu
+ menu = new Menu();
+ layoutPanel.add(menu, new BorderLayoutData(Region.WEST, 200));
+
+ // workspace
+ workspace = createWorkspace();
+ layoutPanel.add(workspace, new BorderLayoutData(Region.CENTER, false));
+ registerGlobalViewsAndActions();
+
+ // message Panel
+ final CaptionLayoutPanel messagePanel = createMessagePanel(layoutPanel);
+ messagePanel.add(Log.getDivLogger().getWidget());
+ messagePanel.setCollapsed(true);
+ layoutPanel.add(messagePanel, new BorderLayoutData(Region.SOUTH, true));
+
+ // Turn on DivLogger
+ Log.getDivLogger().getWidget().setVisible(true);
+
+ // bootstrap
+ controller.handleEvent(
+ new com.mvc4g.client.Event(BootstrapAction.ID, null)
+ );
+
+ // show default editor
+ DeferredCommand.addCommand(
+ new Command()
+ {
+ public void execute()
+ {
+ if(workspace.hasEditor(TaskEditor.ID))
+ workspace.showEditor(TaskEditor.ID);
+ }
+ }
+ );
+
+ return layoutPanel;
+
+ }
+
+ /**
+ * Views and actions accessible from any component
+ */
+ private void registerGlobalViewsAndActions()
+ {
+ // register global views and actions, available across editors
+ controller.addView(Header.ID, header);
+ controller.addAction(LoadingStatusAction.ID, new LoadingStatusAction());
+ controller.addAction(ViewDeploymentAction.ID, new ViewDeploymentAction(this));
+ controller.addAction(UpdateDeploymentsAction.ID, new UpdateDeploymentsAction(this));
+ controller.addAction(UpdateDefinitionsAction.ID, new UpdateDefinitionsAction(this));
+ controller.addAction(BootstrapAction.ID, new BootstrapAction(this));
+ }
+
+ private CaptionLayoutPanel createMessagePanel(final LayoutPanel layoutPanel)
+ {
+ final CaptionLayoutPanel messagePanel = new CaptionLayoutPanel("Messages", true);
+
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+ Button collapse = new Button(
+ ButtonHelper.createButtonLabel(
+ icons.collapseDownIcon(),
+ "",
+ ButtonHelper.ButtonLabelType.TEXT_ON_TOP)
+ );
+ collapse.addClickListener(
+ new ClickListener()
+ {
+ public void onClick(Widget sender)
+ {
+ messagePanel.setCollapsed(!messagePanel.isCollapsed());
+ layoutPanel.layout();
+ }
+ }
+ );
+
+ messagePanel.getHeader().add(
+ collapse,
+ Caption.CaptionRegion.RIGHT
+ );
+ return messagePanel;
+ }
+
+ private Workspace createWorkspace()
+ {
+ Workspace workspace = new Workspace(menu, this);
+ WorkspaceLauncher launcher = GWT.create(WorkspaceLauncher.class);
+ launcher.launch(this, workspace); // calls Workspace.addEditor()
+ return workspace;
+ }
+
+// ---- ApplicationContext interface ----
+
+
+ public Viewport getViewport()
+ {
+ return viewport;
+ }
+
+ public Controller getController()
+ {
+ return this.controller;
+ }
+
+ public URLBuilder getUrlBuilder()
+ {
+ return this.urlBuilder;
+ }
+
+ public void displayMessage(final String message, final boolean isError)
+ {
+ if(isError)
+ {
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+
+ WindowPanel err = new WindowPanel("Error");
+ err.getHeader().add( icons.errorIcon().createImage() );
+ err.setAnimationEnabled(true);
+ err.setSize("320px", "240px");
+ ScrollLayoutPanel scrollLayoutPanel = new ScrollLayoutPanel();
+ scrollLayoutPanel.add(new HTML(message));
+ err.setWidget(scrollLayoutPanel);
+
+ WindowUtil.addMaximizeButton(err, Caption.CaptionRegion.RIGHT);
+ WindowUtil.addMinimizeButton(err, Caption.CaptionRegion.RIGHT);
+
+ err.center();
+ }
+ else
+ {
+ InfoPanel.show("", message, "");
+ }
+ }
+
+ public Authentication getAuthentication()
+ {
+ return auth;
+ }
+
+ public ConsoleConfig getConfig()
+ {
+ return config;
+ }
+
+ public Workspace getWorkpace()
+ {
+ return workspace;
+ }
+
+ /**
+ * hack in order to correctly display widgets that have
+ * been rendered hidden
+ */
+ public void refreshView()
+ {
+ final int width = Window.getClientWidth();
+ final int height = Window.getClientHeight();
+ getViewport().onWindowResized(width, height);
+ }
+}
+
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerPlugins.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerPlugins.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerPlugins.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import org.jboss.bpm.console.client.model.ServerStatus;
+import org.jboss.bpm.console.client.model.PluginInfo;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ServerPlugins
+{
+ private static ServerStatus status;
+
+ public static void setStatus(ServerStatus s)
+ {
+ status = s;
+ }
+
+ public static ServerStatus getStatus()
+ {
+ return status;
+ }
+
+ public static boolean has(String type)
+ {
+ boolean match = false;
+
+ if(status!=null)
+ {
+ for(PluginInfo p : status.getPlugins())
+ {
+ if(p.getType().equals(type))
+ {
+ match = p.isAvailable();
+ break;
+ }
+ }
+ }
+ return match;
+ }
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerStatusView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerStatusView.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerStatusView.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,98 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.google.gwt.user.client.ui.Grid;
+import com.google.gwt.user.client.ui.Image;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.ViewInterface;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.jboss.bpm.console.client.model.PluginInfo;
+import org.jboss.bpm.console.client.model.ServerStatus;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ServerStatusView extends LayoutPanel
+ implements ViewInterface, LazyPanel
+{
+
+ public final static String ID = ServerStatusView.class.getName();
+
+ private Controller controller;
+
+ private ApplicationContext appContext;
+
+ private boolean initialized;
+
+ public ServerStatusView(ApplicationContext appContext)
+ {
+ super();
+ this.appContext = appContext;
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+
+ public boolean isInitialized()
+ {
+ return initialized;
+ }
+
+ public void initialize()
+ {
+ if(!initialized)
+ {
+ update(ServerPlugins.getStatus());
+ initialized = true;
+ }
+ }
+
+ private void update(ServerStatus status)
+ {
+ this.clear();
+
+ Grid g = new Grid(status.getPlugins().size(), 2);
+ g.setWidth("100%");
+
+ for (int row = 0; row < status.getPlugins().size(); ++row)
+ {
+ PluginInfo p = status.getPlugins().get(row);
+ g.setText(row, 0, p.getType());
+
+ final Image img = p.isAvailable() ?
+ new Image("images/icons/confirm_small.png"):
+ new Image("images/icons/deny_small.png");
+
+ g.setWidget(row, 1, img );
+ }
+
+ this.add(g);
+
+ invalidate();
+
+ }
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,140 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.Grid;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
+import org.gwt.mosaic.ui.client.Label;
+import org.gwt.mosaic.ui.client.ScrollLayoutPanel;
+import org.gwt.mosaic.ui.client.TabLayoutPanel;
+import org.gwt.mosaic.ui.client.layout.*;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class SettingsEditor extends Editor
+{
+
+ public final static String ID = SettingsEditor.class.getName();
+
+ private TabLayoutPanel tabPanel;
+
+ public SettingsEditor(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public void initialize()
+ {
+ if(!isInitialized())
+ {
+
+ tabPanel = new DecoratedTabLayoutPanel();
+ tabPanel.setPadding(5);
+
+ final ScrollLayoutPanel layoutPanel = new ScrollLayoutPanel(
+ new BoxLayout(BoxLayout.Orientation.VERTICAL)
+ );
+ layoutPanel.setPadding(5);
+
+ // console info
+ Label console = new Label("Console Info");
+ console.setStyleName("bpm-label-header");
+ layoutPanel.add(console, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ Grid g1 = new Grid(1,2);
+ g1.setWidget(0,0, new Label("Version:"));
+ g1.setWidget(0,1, new Label(Version.VERSION));
+ g1.getColumnFormatter().setWidth(0, "20%");
+
+ layoutPanel.add(g1, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ // server info
+ Label server = new Label("Server Info");
+ server.setStyleName("bpm-label-header");
+ layoutPanel.add(server, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ ServerStatusView serverStatus = new ServerStatusView(appContext);
+ serverStatus.initialize();
+
+ Grid g2 = new Grid(1,2);
+ g2.setWidget(0,0, new Label("Host:"));
+ g2.setWidget(0,1, new Label(appContext.getConfig().getConsoleServerUrl()));
+
+ g2.getColumnFormatter().setWidth(0, "20%");
+
+ layoutPanel.add(g2, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ LayoutPanel pluginPanel = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ Label label = new Label("Plugins:");
+ label.setStyleName("bpm-label-header");
+
+ pluginPanel.add(label);
+ pluginPanel.add(serverStatus);
+
+ layoutPanel.add(pluginPanel, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ tabPanel.add(layoutPanel, "System Overview");
+
+ this.add(tabPanel, new BorderLayoutData(BorderLayout.Region.CENTER));
+
+ // view and actions
+ super.controller.addView(ServerStatusView.ID, serverStatus);
+
+ // load server status
+ super.controller.handleEvent(
+ new Event(BootstrapAction.ID, null)
+ );
+
+ // repaint
+ appContext.refreshView();
+
+ isInitialized = true;
+ }
+
+ }
+
+ public String getEditorId()
+ {
+ return ID;
+ }
+
+ public String getTitle()
+ {
+ return "Settings";
+ }
+
+ public MenuSection provideMenuSection()
+ {
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+
+ return new MenuSection(
+ "Settings",
+ icons.settingsIcon(),
+ new SettingsEditorNavigation(appContext)
+ );
+
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditorNavigation.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditorNavigation.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditorNavigation.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.google.gwt.user.client.ui.Tree;
+import com.google.gwt.user.client.ui.TreeItem;
+import com.google.gwt.user.client.ui.TreeListener;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.Workspace;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+class SettingsEditorNavigation extends Tree
+{
+
+ public SettingsEditorNavigation(final ApplicationContext appContext)
+ {
+ super.setTitle("Settings");
+
+ TreeItem root = addItem("System");
+ root.addItem("Overview");
+
+ addTreeListener(
+ new TreeListener()
+ {
+ public void onTreeItemSelected(TreeItem treeItem)
+ {
+ if("Overview".equals(treeItem.getText()))
+ {
+ Workspace workspace = appContext.getWorkpace();
+ workspace.showEditor(SettingsEditor.ID);
+ }
+ }
+
+ public void onTreeItemStateChanged(TreeItem treeItem)
+ {
+
+ }
+ }
+ );
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/WorkspaceLauncher.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/WorkspaceLauncher.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/WorkspaceLauncher.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public interface WorkspaceLauncher
+{
+ void launch(ApplicationContext appContext, Workspace workspace);
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,136 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.common;
+
+import com.google.gwt.http.client.*;
+import com.google.gwt.user.client.Timer;
+import com.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Controller;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.LoadingStatusAction;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+
+import java.io.IOException;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public abstract class AbstractRESTAction implements ActionInterface
+{
+ protected ApplicationContext appContext;
+
+ protected AbstractRESTAction(ApplicationContext appContetext)
+ {
+ this.appContext = appContetext;
+ }
+
+ public abstract String getId();
+ public abstract String getUrl(Object event);
+ public abstract RequestBuilder.Method getRequestMethod();
+ public abstract void handleSuccessfulResponse(final Controller controller, final Object event, Response response);
+
+ public void execute(final Controller controller, final Object object)
+ {
+ final String url = getUrl(object);
+ RequestBuilder builder = new RequestBuilder(getRequestMethod(), URL.encode(url));
+
+ ConsoleLog.debug(getRequestMethod() +": " + url);
+
+ try
+ {
+ controller.handleEvent( LoadingStatusAction.ON );
+
+ final Request request = builder.sendRequest(null,
+ new RequestCallback()
+ {
+ public void onError(Request request, Throwable exception) {
+ // Couldn't connect to server (could be timeout, SOP violation, etc.)
+ handleError(url, exception);
+ controller.handleEvent( LoadingStatusAction.OFF );
+ }
+
+ public void onResponseReceived(Request request, Response response) {
+ try
+ {
+ if (200 == response.getStatusCode())
+ {
+ handleSuccessfulResponse(controller, object, response);
+ }
+ else
+ {
+ final String msg = response.getText().equals("") ? "Unknown error" : response.getText();
+ handleError(
+ url,
+ new RequestException("HTTP "+ response.getStatusCode()+ ": " + msg)
+ );
+ }
+ }
+ finally
+ {
+ controller.handleEvent( LoadingStatusAction.OFF );
+ }
+ }
+ }
+ );
+
+ // Timer to handle pending request
+ Timer t = new Timer() {
+
+ public void run()
+ {
+ if(request.isPending())
+ {
+ request.cancel();
+ handleError(
+ url,
+ new IOException("Request timeout")
+ );
+ }
+
+ }
+ };
+ t.schedule(20000);
+
+ }
+ catch (RequestException e)
+ {
+ // Couldn't connect to server
+ handleError(url, e);
+ controller.handleEvent( LoadingStatusAction.OFF );
+ }
+ }
+
+ protected void handleError(String url, Throwable t)
+ {
+ final String out =
+ "<ul>"+
+ "<li>URL: '" + url + "'\n"+
+ "<li>Action: '" + getId() + "'\n" +
+ "<li>Exception: '" + t.getClass() +"'"+
+ "</ul>\n\n"+
+ t.getMessage();
+
+ ConsoleLog.error(out, t);
+ appContext.displayMessage(out, true);
+
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractView.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractView.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.common;
+
+import com.mvc4g.client.ViewInterface;
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
+import com.google.gwt.user.client.ui.HTML;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.jboss.bpm.console.client.LazyPanel;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public abstract class AbstractView extends LayoutPanel
+ implements ViewInterface, LazyPanel
+{
+ private AbstractImagePrototype icon;
+
+ protected boolean initialized;
+
+ protected AbstractView()
+ {
+ }
+
+ protected AbstractImagePrototype getIcon()
+ {
+ return icon;
+ }
+
+ protected void setIcon(AbstractImagePrototype icon)
+ {
+ this.icon = icon;
+ }
+
+ public String getIconTitle()
+ {
+ HTML html = new HTML(
+ (icon != null ? (icon.getHTML() + " ")
+ : (""))
+ + this.getTitle());
+
+ return html.toString();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/PropertyGrid.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/PropertyGrid.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/PropertyGrid.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,101 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.common;
+
+import com.google.gwt.user.client.ui.Grid;
+import com.google.gwt.user.client.ui.HTML;
+import org.gwt.mosaic.ui.client.Label;
+import org.gwt.mosaic.ui.client.ScrollLayoutPanel;
+
+/**
+ * A simple property grid that displays name-value pairs.
+ * <br>
+ * Used styles:
+ * <ul>
+ * <li>bpm-prop-grid
+ * <li>bpm-prop-grid-label
+ * <li>bpm-prop-grid-even
+ * <li>bpm-prop-grid-odd
+ * </ul>
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class PropertyGrid extends ScrollLayoutPanel
+{
+ private String[] fieldNames;
+
+ private Grid grid;
+
+ public PropertyGrid(String[] fieldDesc)
+ {
+ super();
+ this.grid = new Grid(fieldDesc.length, 2);
+ grid.setStyleName("bpm-prop-grid");
+ this.fieldNames = fieldDesc;
+
+ this.add(grid);
+
+ initReset();
+ }
+
+ private void initReset()
+ {
+ for(int i=0; i< fieldNames.length; i++)
+ {
+ Label label = new Label(fieldNames[i]);
+ label.setStyleName("bpm-prop-grid-label");
+ grid.setWidget(i,0, label);
+ grid.setWidget(i,1, new HTML(""));
+
+ if (i % 2 == 0)
+ {
+ // even
+ grid.getRowFormatter().setStyleName(i, "bpm-prop-grid-even");
+ }
+ else
+ {
+ // odd
+ grid.getRowFormatter().setStyleName(i, "bpm-prop-grid-odd");
+ }
+ }
+ }
+
+ public void clear()
+ {
+ initReset();
+ }
+
+ public void update(String[] fieldValues)
+ {
+ if(fieldValues.length!= fieldNames.length)
+ throw new IllegalArgumentException("fieldValues.length doesn't match fieldName.length: "+ fieldNames);
+
+ for(int i=0; i< fieldNames.length; i++)
+ {
+ Label label = new Label(fieldNames[i]);
+ label.setStyleName("bpm-prop-grid-label");
+ grid.setWidget(i,0, label);
+ grid.setWidget(i,1, new HTML(fieldValues[i]));
+ }
+ }
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeleteDeploymentAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeleteDeploymentAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeleteDeploymentAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.engine;
+
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class DeleteDeploymentAction extends AbstractRESTAction
+{
+
+ public final static String ID = DeleteDeploymentAction.class.getName();
+
+ public DeleteDeploymentAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ String id = (String)event;
+ return appContext.getUrlBuilder().getDeleteDeploymentUrl(id);
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.POST;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ // refresh view
+ controller.handleEvent(
+ new Event(UpdateDeploymentsAction.ID, null)
+ );
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentDetailView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentDetailView.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentDetailView.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,199 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.engine;
+
+import com.google.gwt.user.client.ui.ChangeListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.ViewInterface;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.*;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.jboss.bpm.console.client.common.PropertyGrid;
+import org.jboss.bpm.console.client.model.DeploymentRef;
+
+/**
+ * Detail panel associated with a selected deployment.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class DeploymentDetailView extends CaptionLayoutPanel implements ViewInterface
+{
+ public final static String ID = DeploymentDetailView.class.getName();
+
+ private Controller controller;
+
+ private PropertyGrid grid;
+
+ private DeploymentRef currentDeployment;
+
+ private ResourcePanel resourcePanel;
+
+ ToolButton suspendBtn;
+ ToolButton resumeBtn;
+
+ public DeploymentDetailView()
+ {
+ super("Deployment details");
+ super.setStyleName("bpm-detail-panel");
+
+ grid = new PropertyGrid(new String[] {"ID:", "Name:", "Processes:"});
+ LayoutPanel propLayout = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
+ propLayout.add(grid, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+
+ suspendBtn = new ToolButton("Suspend", new ClickListener() {
+ public void onClick(Widget sender) {
+
+ DeploymentRef deploymentRef = getSelection();
+ if(deploymentRef!=null)
+ {
+ MessageBox.confirm("Suspend deployment",
+ "Do you want to suspend this deployment? Any associated process will suspended aswell.",
+ new MessageBox.ConfirmationCallback() {
+ public void onResult(boolean doIt)
+ {
+ if(doIt)
+ {
+ controller.handleEvent(
+ new Event(
+ SuspendDeploymentAction.ID,
+ getSelection().getId()
+ )
+ );
+ }
+ }
+ });
+ }
+ else
+ {
+ MessageBox.alert("Missing selection", "Please select a deployment");
+ }
+ }
+ }
+ );
+ resumeBtn = new ToolButton("Resume", new ClickListener() {
+ public void onClick(Widget sender) {
+
+ DeploymentRef deploymentRef = getSelection();
+ if(deploymentRef!=null)
+ {
+ MessageBox.confirm("Resume deployment",
+ "Do you want to resume this deployment?",
+ new MessageBox.ConfirmationCallback() {
+ public void onResult(boolean doIt)
+ {
+ if(doIt)
+ {
+ controller.handleEvent(
+ new Event(
+ ResumeDeploymentAction.ID,
+ getSelection().getId()
+ )
+ );
+ }
+ }
+ });
+ }
+ else
+ {
+ MessageBox.alert("Missing selection", "Please select a deployment");
+ }
+ }
+ }
+ );
+
+ propLayout.add(suspendBtn);
+ propLayout.add(resumeBtn);
+
+ // properties
+ final DeckLayoutPanel deck = new DeckLayoutPanel();
+ deck.add(propLayout);
+
+ // resource info
+ ScrollLayoutPanel scrollPanel = new ScrollLayoutPanel();
+ resourcePanel = new ResourcePanel();
+ scrollPanel.add(resourcePanel);
+ deck.add(scrollPanel);
+
+ // selection
+ final com.google.gwt.user.client.ui.ListBox dropBox = new com.google.gwt.user.client.ui.ListBox(false);
+ dropBox.setStyleName("bpm-operation-ui");
+ dropBox.addItem("Properties");
+ dropBox.addItem("Resources");
+ dropBox.addChangeListener(new ChangeListener() {
+ public void onChange(Widget sender) {
+ deck.showWidget(dropBox.getSelectedIndex());
+ deck.layout();
+ }
+ });
+
+ this.getHeader().add(dropBox, Caption.CaptionRegion.RIGHT);
+ this.add(deck, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ deck.showWidget(dropBox.getSelectedIndex());
+
+ this.add(deck, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ }
+
+ private DeploymentRef getSelection()
+ {
+ return currentDeployment;
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ resourcePanel.setController(controller);
+ }
+
+ public void update(DeploymentRef deployment)
+ {
+ this.currentDeployment= deployment;
+
+ String[] values = new String[] {
+ deployment.getId(),
+ deployment.getName(),
+ deployment.getDefinitions().toString()
+ };
+
+ resumeBtn.setEnabled(deployment.isSuspended());
+ suspendBtn.setEnabled(!resumeBtn.isEnabled());
+
+ grid.update(values);
+ resourcePanel.update(deployment);
+ }
+
+ public void clearView()
+ {
+ this.currentDeployment = null;
+ grid.clear();
+ resourcePanel.clearView();
+
+ suspendBtn.setEnabled(false);
+ resumeBtn.setEnabled(false);
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,325 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.engine;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.ChangeListener;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.ListBox;
+import org.gwt.mosaic.ui.client.MessageBox;
+import org.gwt.mosaic.ui.client.ToolBar;
+import org.gwt.mosaic.ui.client.ToolButton;
+import org.gwt.mosaic.ui.client.layout.*;
+import org.gwt.mosaic.ui.client.list.DefaultListModel;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.jboss.bpm.console.client.model.DeploymentRef;
+import org.jboss.bpm.console.client.model.util.SimpleDateFormat;
+
+import java.util.List;
+import java.util.Date;
+
+/**
+ * List of deployments
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class DeploymentListView extends AbstractView
+{
+ public final static String ID = DeploymentListView.class.getName();
+
+ private Controller controller;
+
+ private boolean initialized;
+
+ private LayoutPanel deploymentList = null;
+
+ private ListBox<DeploymentRef> listBox;
+
+ private DeploymentRef selection = null;
+
+ private SimpleDateFormat dateFormat = new SimpleDateFormat();
+
+ private int FILTER_NONE = 10;
+ private int FILTER_ACTIVE = 20;
+ private int FILTER_SUSPENDED = 30;
+ private int currentFilter = FILTER_NONE;
+
+ private List<DeploymentRef> deployments = null;
+
+ private DeploymentDetailView detailView;
+
+ public DeploymentListView()
+ {
+ super();
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+ setTitle("Deployments");
+ setIcon(icons.deploymentIcon());
+
+ listBox = createListBox();
+
+ }
+
+ private ListBox createListBox()
+ {
+ final ListBox<DeploymentRef> listBox =
+ new ListBox<DeploymentRef>(
+ new String[] {
+ "ID", "Name", "Timestamp", "Suspended"}
+ );
+
+
+ listBox.setCellRenderer(new ListBox.CellRenderer<DeploymentRef>() {
+ public void renderCell(ListBox<DeploymentRef> listBox, int row, int column,
+ DeploymentRef item) {
+ switch (column) {
+ case 0:
+ listBox.setText(row, column, item.getId());
+ break;
+ case 1:
+ listBox.setText(row, column, item.getName());
+ break;
+ case 2:
+ listBox.setText(row, column, dateFormat.format(new Date(item.getTimestamp())));
+ break;
+ case 3:
+ listBox.setText(row, column, String.valueOf(item.isSuspended()));
+ break;
+ default:
+ throw new RuntimeException("Unexpected column size");
+ }
+ }
+ });
+
+ listBox.addChangeListener(new ChangeListener()
+ {
+ public void onChange(Widget widget)
+ {
+ int index = listBox.getSelectedIndex();
+ if(index!=-1)
+ {
+ DeploymentRef item = listBox.getItem(index);
+
+ controller.handleEvent(
+ new Event(UpdateDeploymentDetailAction.ID, item)
+ );
+ }
+ }
+ });
+
+ return listBox;
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public boolean isInitialized()
+ {
+ return initialized;
+ }
+
+ public void initialize()
+ {
+ if(!initialized)
+ {
+ deploymentList = new LayoutPanel( new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ deploymentList.setPadding(0);
+ deploymentList.setWidgetSpacing(0);
+
+ // toolbar
+
+ final LayoutPanel toolBox = new LayoutPanel();
+ toolBox.setPadding(0);
+ toolBox.setWidgetSpacing(0);
+ toolBox.setLayout(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
+
+ final ToolBar toolBar = new ToolBar();
+ toolBar.add(
+ new ToolButton("Refresh", new ClickListener() {
+ public void onClick(Widget sender) {
+ // force loading
+ controller.handleEvent(
+ new Event(UpdateDeploymentsAction.ID, null)
+ );
+ }
+ }
+ )
+ );
+
+ toolBar.addSeparator();
+
+ toolBar.add(
+ new ToolButton("Delete", new ClickListener() {
+ public void onClick(Widget sender) {
+
+ DeploymentRef deploymentRef = getSelection();
+ if(deploymentRef!=null)
+ {
+ MessageBox.confirm("Delete deployment",
+ "Do you want to delete this deployment? Any related data will be removed.",
+ new MessageBox.ConfirmationCallback() {
+ public void onResult(boolean doIt)
+ {
+ if(doIt)
+ {
+ controller.handleEvent(
+ new Event(
+ DeleteDeploymentAction.ID,
+ getSelection().getId()
+ )
+ );
+ }
+ }
+ });
+ }
+ else
+ {
+ MessageBox.alert("Missing selection", "Please select a deployment");
+ }
+ }
+ }
+ )
+ );
+
+ toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ // filter
+ LayoutPanel filterPanel = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ filterPanel.setStyleName("bpm-filter-panel");
+ final com.google.gwt.user.client.ui.ListBox dropBox = new com.google.gwt.user.client.ui.ListBox(false);
+ dropBox.setStyleName("bpm-operation-ui");
+ dropBox.addItem("All");
+ dropBox.addItem("Active");
+ dropBox.addItem("Suspended");
+
+ dropBox.addChangeListener(new ChangeListener() {
+ public void onChange(Widget sender) {
+ switch (dropBox.getSelectedIndex())
+ {
+ case 0:
+ currentFilter = FILTER_NONE;
+ break;
+ case 1:
+ currentFilter = FILTER_ACTIVE;
+ break;
+ case 2:
+ currentFilter = FILTER_SUSPENDED;
+ break;
+ default:
+ throw new IllegalArgumentException("No such index");
+ }
+
+ renderFiltered();
+ }
+ });
+ filterPanel.add(dropBox);
+
+ toolBox.add(filterPanel, new BoxLayoutData(BoxLayoutData.FillStyle.VERTICAL));
+
+ this.deploymentList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+ this.deploymentList.add(listBox, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ // layout
+ LayoutPanel layout = new LayoutPanel(new BorderLayout());
+ layout.add(deploymentList, new BorderLayoutData(BorderLayout.Region.CENTER));
+
+ // details
+ // detail panel
+ detailView = new DeploymentDetailView();
+ controller.addView(DeploymentDetailView.ID, detailView);
+ layout.add(detailView, new BorderLayoutData(BorderLayout.Region.SOUTH,10,200));
+
+ this.add(layout);
+
+ initialized = true;
+ }
+ }
+
+ public DeploymentRef getSelection()
+ {
+ DeploymentRef selection = null;
+ if(isInitialized() && listBox.getSelectedIndex()!=-1)
+ selection = listBox.getItem( listBox.getSelectedIndex());
+ return selection;
+ }
+
+ public void update(List<DeploymentRef> deployments)
+ {
+ this.deployments = deployments;
+
+ renderFiltered();
+ }
+
+ private void renderFiltered()
+ {
+ if(this.deployments!=null)
+ {
+ final DefaultListModel<DeploymentRef> model =
+ (DefaultListModel<DeploymentRef>) listBox.getModel();
+
+ model.clear();
+
+ for(DeploymentRef dpl : deployments)
+ {
+ if(FILTER_NONE==currentFilter)
+ {
+ model.add(dpl);
+ }
+ else
+ {
+ boolean showSuspended = (FILTER_SUSPENDED==currentFilter);
+ if(dpl.isSuspended()==showSuspended)
+ model.add(dpl);
+ }
+ }
+
+ if(listBox.getSelectedIndex()!=-1)
+ listBox.setItemSelected(listBox.getSelectedIndex(), false);
+
+ // clear details
+ controller.handleEvent(
+ new Event(UpdateDeploymentDetailAction.ID, null)
+ );
+ }
+ }
+
+ public void select(String deploymentId)
+ {
+ final DefaultListModel<DeploymentRef> model =
+ (DefaultListModel<DeploymentRef>) listBox.getModel();
+
+ for(int i=0; i<model.size(); i++)
+ {
+ DeploymentRef ref = model.get(i);
+ if(ref.getId().equals(deploymentId))
+ {
+ listBox.setSelectedIndex(i);
+ break;
+ }
+ }
+
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,164 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.engine;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.SourcesTabEvents;
+import com.google.gwt.user.client.ui.TabListener;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
+import org.gwt.mosaic.ui.client.TabLayoutPanel;
+import org.gwt.mosaic.ui.client.layout.BorderLayout;
+import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.Editor;
+import org.jboss.bpm.console.client.LazyPanel;
+import org.jboss.bpm.console.client.MenuSection;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Manage runtime aspects of a process engine
+ * (currently jbpm only).
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class EngineEditor extends Editor
+{
+ public final static String ID = EngineEditor.class.getName();
+
+ private TabLayoutPanel tabPanel;
+
+ private Map<String,Integer> view2index = new HashMap<String,Integer>();
+
+ public EngineEditor(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public void initialize()
+ {
+ if(!isInitialized)
+ {
+
+ // create inner tab layout
+ tabPanel = new DecoratedTabLayoutPanel();
+ tabPanel.setPadding(5);
+
+ tabPanel.addTabListener(
+ new TabListener()
+ {
+ public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ boolean showTab = true;
+ return showTab;
+ }
+
+ public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
+ if(!lazyPanel.isInitialized())
+ {
+ lazyPanel.initialize();
+ appContext.refreshView(); // TODO: hack around rendering problems
+ }
+
+ // load jobs
+ if(1==i)
+ {
+ controller.handleEvent(
+ new Event(UpdateJobsAction.ID, null)
+ );
+ }
+ }
+ }
+ );
+
+ this.add(tabPanel, new BorderLayoutData(BorderLayout.Region.CENTER));
+
+ // create and register views
+ registerView(DeploymentListView.ID, new DeploymentListView());
+ registerView(JobListView.ID, new JobListView(appContext));
+
+ // create and register actions
+ controller.addAction(UpdateDeploymentsAction.ID, new UpdateDeploymentsAction(appContext));
+ controller.addAction(UpdateDeploymentDetailAction.ID, new UpdateDeploymentDetailAction());
+ controller.addAction(DeleteDeploymentAction.ID, new DeleteDeploymentAction(appContext));
+ controller.addAction(SuspendDeploymentAction.ID, new SuspendDeploymentAction(appContext));
+ controller.addAction(ResumeDeploymentAction.ID, new ResumeDeploymentAction(appContext));
+ controller.addAction(ExecuteJobAction.ID, new ExecuteJobAction(appContext));
+
+ // display tab, needs to visible for correct rendering
+ tabPanel.selectTab( view2index.get(DeploymentListView.ID ));
+
+ // force loading
+ super.controller.handleEvent(
+ new Event(UpdateDeploymentsAction.ID, null)
+ );
+
+ isInitialized = true;
+ }
+ }
+
+ private void registerView(String id, AbstractView view)
+ {
+ view2index.put(id, tabPanel.getWidgetCount());
+
+ // register view with controller
+ super.controller.addView(id, view);
+
+ // add to tab layout
+ this.tabPanel.add(view, view.getIconTitle(), true);
+ }
+
+ public String getEditorId()
+ {
+ return ID;
+ }
+
+ public String getTitle()
+ {
+ return "Runtime";
+ }
+
+ public MenuSection provideMenuSection()
+ {
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+
+ return new MenuSection(
+ "Runtime",
+ icons.runtimeIcon(),
+ new EngineEditorNavigation(appContext)
+ );
+ }
+
+ public void showView(String viewId)
+ {
+ if(!view2index.containsKey(viewId))
+ throw new IllegalArgumentException("Unknown view: "+viewId);
+
+ tabPanel.selectTab( view2index.get(viewId) );
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorNavigation.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorNavigation.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorNavigation.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.engine;
+
+import com.google.gwt.user.client.ui.Tree;
+import com.google.gwt.user.client.ui.TreeItem;
+import com.google.gwt.user.client.ui.TreeListener;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.Workspace;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class EngineEditorNavigation extends Tree
+{
+
+ public EngineEditorNavigation(final ApplicationContext appContext)
+ {
+ super.setTitle("Deployments");
+
+ TreeItem root = addItem("Process Engine");
+ TreeItem jbpmDeployments = root.addItem("Deployments");
+ TreeItem jobs = root.addItem("Jobs");
+
+ addTreeListener(
+ new TreeListener()
+ {
+ public void onTreeItemSelected(TreeItem treeItem)
+ {
+ Workspace workspace = appContext.getWorkpace();
+
+ if("Deployments".equals(treeItem.getText()))
+ {
+ workspace.showEditor(EngineEditor.ID, DeploymentListView.ID);
+ }
+ else if("Jobs".equals(treeItem.getText()))
+ {
+ workspace.showEditor(EngineEditor.ID, JobListView.ID);
+ }
+ }
+
+ public void onTreeItemStateChanged(TreeItem treeItem)
+ {
+
+ }
+ }
+ );
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ExecuteJobAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ExecuteJobAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ExecuteJobAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.engine;
+
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ExecuteJobAction extends AbstractRESTAction
+{
+
+ public final static String ID = ExecuteJobAction.class.getName();
+
+ public ExecuteJobAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ String id = (String)event;
+ return appContext.getUrlBuilder().getExecuteJobURL(id);
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.POST;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ String id = (String)event;
+
+ // reload job list
+ controller.handleEvent(
+ new Event(UpdateJobsAction.ID, null)
+ );
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,306 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.engine;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.ChangeListener;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.ListBox;
+import org.gwt.mosaic.ui.client.ToolBar;
+import org.gwt.mosaic.ui.client.ToolButton;
+import org.gwt.mosaic.ui.client.MessageBox;
+import org.gwt.mosaic.ui.client.layout.*;
+import org.gwt.mosaic.ui.client.list.DefaultListModel;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.jboss.bpm.console.client.model.JobRef;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+import org.jboss.bpm.console.client.model.util.SimpleDateFormat;
+import org.jboss.bpm.console.client.ApplicationContext;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Display a list of jobs waiting for execution.<br/>
+ * I.e. pending Timers and Messages.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class JobListView extends AbstractView
+{
+ public final static String ID = JobListView.class.getName();
+
+ private Controller controller;
+
+ private LayoutPanel jobList = null;
+
+ private ListBox<JobRef> listBox;
+
+ private JobRef selection = null;
+
+ private SimpleDateFormat dateFormat = new SimpleDateFormat();
+
+ private int FILTER_NONE = 10;
+ private int FILTER_TIMER = 20;
+ private int FILTER_MESSAGE = 30;
+ private int currentFilter = FILTER_NONE;
+
+ private List<JobRef> jobs = null;
+
+ private ApplicationContext appContext;
+
+ public JobListView(ApplicationContext appContext)
+ {
+ setTitle("Jobs");
+ this.appContext = appContext;
+
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+ setIcon(icons.jobsIcon());
+
+ this.listBox = createListBox();
+ }
+
+ private ListBox createListBox()
+ {
+ final ListBox<JobRef> listBox =
+ new ListBox<JobRef>(
+ new String[] {
+ "ID", "Due Date", "Type"}
+ );
+
+
+ listBox.setCellRenderer(new ListBox.CellRenderer<JobRef>() {
+ public void renderCell(ListBox<JobRef> listBox, int row, int column,
+ JobRef item) {
+ switch (column) {
+ case 0:
+ listBox.setText(row, column, item.getId());
+ break;
+ case 1:
+ long ts = item.getTimestamp();
+ String ds = ts > 0 ? dateFormat.format(new Date(ts)) : "";
+ listBox.setText(row, column, ds);
+ break;
+ case 2:
+ listBox.setText(row, column, item.getType());
+ break;
+ default:
+ throw new RuntimeException("Unexpected column size");
+ }
+ }
+ });
+
+ listBox.addChangeListener(new ChangeListener()
+ {
+ public void onChange(Widget widget)
+ {
+ int index = listBox.getSelectedIndex();
+ if(index!=-1)
+ {
+ JobRef item = listBox.getItem(index);
+
+ /*controller.handleEvent(
+ new Event(UpdateJobDetailAction.ID, item)
+ );*/
+ }
+ }
+ });
+
+ return listBox;
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public boolean isInitialized()
+ {
+ return initialized;
+ }
+
+ public void initialize()
+ {
+ if(!initialized)
+ {
+ jobList = new LayoutPanel( new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ jobList.setPadding(0);
+ jobList.setWidgetSpacing(0);
+
+ // toolbar
+
+ final LayoutPanel toolBox = new LayoutPanel();
+ toolBox.setPadding(0);
+ toolBox.setWidgetSpacing(0);
+ toolBox.setLayout(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
+
+ // toolbar
+ final ToolBar toolBar = new ToolBar();
+ toolBar.add(
+ new ToolButton("Refresh", new ClickListener() {
+ public void onClick(Widget sender) {
+ // force loading
+ controller.handleEvent(
+ new Event(UpdateJobsAction.ID, null)
+ );
+ }
+ }
+ )
+ );
+
+ toolBar.addSeparator();
+
+ toolBar.add(
+ new ToolButton("Execute", new ClickListener() {
+ public void onClick(Widget sender) {
+ JobRef selection = getSelection();
+ if(null==selection)
+ {
+ MessageBox.alert("Missing selection", "Please select a job!");
+ }
+ else
+ {
+ controller.handleEvent(
+ new Event(ExecuteJobAction.ID, selection.getId())
+ );
+ }
+ }
+ }
+ )
+ );
+
+ toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ // filter
+ LayoutPanel filterPanel = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ filterPanel.setStyleName("bpm-filter-panel");
+ final com.google.gwt.user.client.ui.ListBox dropBox = new com.google.gwt.user.client.ui.ListBox(false);
+ dropBox.setStyleName("bpm-operation-ui");
+ dropBox.addItem("All");
+ dropBox.addItem("Timers");
+ dropBox.addItem("Messages");
+
+ dropBox.addChangeListener(new ChangeListener() {
+ public void onChange(Widget sender) {
+ switch (dropBox.getSelectedIndex())
+ {
+ case 0:
+ currentFilter = FILTER_NONE;
+ break;
+ case 1:
+ currentFilter = FILTER_TIMER;
+ break;
+ case 2:
+ currentFilter = FILTER_MESSAGE;
+ break;
+ default:
+ throw new IllegalArgumentException("No such index");
+ }
+
+ renderFiltered();
+ }
+ });
+ filterPanel.add(dropBox);
+
+ toolBox.add(filterPanel, new BoxLayoutData(BoxLayoutData.FillStyle.VERTICAL));
+
+ this.jobList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+ this.jobList.add(listBox, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ // layout
+ LayoutPanel layout = new LayoutPanel(new BorderLayout());
+ layout.add(jobList, new BorderLayoutData(BorderLayout.Region.CENTER));
+
+ // details
+ /*JobDetailView detailsView = new JobDetailView();
+ controller.addView(JobDetailView.ID, detailsView);
+ controller.addAction(UpdateJobDetailAction.ID, new UpdateJobDetailAction());
+ layout.add(detailsView, new BorderLayoutData(BorderLayout.Region.SOUTH, 10,200));
+ */
+
+ controller.addAction(UpdateJobsAction.ID, new UpdateJobsAction(appContext));
+
+ this.add(layout);
+
+ this.initialized = true;
+ }
+ }
+
+ public void update(List<JobRef> jobs)
+ {
+ this.jobs = jobs;
+
+ renderFiltered();
+ }
+
+ private void renderFiltered()
+ {
+ if(this.jobs!=null)
+ {
+ final DefaultListModel<JobRef> model =
+ (DefaultListModel<JobRef>) listBox.getModel();
+
+ model.clear();
+
+ for(JobRef def : jobs)
+ {
+ if(FILTER_NONE==currentFilter)
+ {
+ model.add(def);
+ }
+ else
+ {
+ if(FILTER_TIMER==currentFilter
+ && def.getType().equals("timer"))
+ {
+ model.add(def);
+ }
+ else if(FILTER_MESSAGE==currentFilter
+ && def.getType().equals("message"))
+ {
+ model.add(def);
+ }
+ }
+ }
+
+ if(listBox.getSelectedIndex()!=-1)
+ listBox.setItemSelected(listBox.getSelectedIndex(), false);
+
+ // clear details
+ /* controller.handleEvent(
+ new Event(UpdateJobDetailAction.ID, null)
+ ); */
+ }
+ }
+
+ public JobRef getSelection()
+ {
+ JobRef selection = null;
+ if(isInitialized() && listBox.getSelectedIndex()!=-1)
+ selection = listBox.getItem( listBox.getSelectedIndex());
+ return selection;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResourcePanel.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResourcePanel.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResourcePanel.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,106 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.engine;
+
+import com.mvc4g.client.Controller;
+import com.google.gwt.user.client.ui.HTML;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.jboss.bpm.console.client.common.PropertyGrid;
+import org.jboss.bpm.console.client.model.DeploymentRef;
+
+/**
+ * List resources associated with a process deployment.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ResourcePanel extends LayoutPanel
+{
+
+ private Controller controller;
+
+ private PropertyGrid propGrid;
+
+ private DeploymentRef currentDeployment = null;
+
+ private boolean initialized;
+
+ private LayoutPanel resources = new LayoutPanel();
+
+ public ResourcePanel()
+ {
+ super(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
+
+ }
+
+ private void initialize()
+ {
+ if(!initialized)
+ {
+ this.propGrid = new PropertyGrid(new String[]{"Deployment ID:"});
+
+ this.add(propGrid, new BoxLayoutData(BoxLayoutData.FillStyle.VERTICAL));
+ this.add(resources, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ this.initialized = true;
+ }
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public void update(DeploymentRef deployment)
+ {
+ initialize();
+ this.currentDeployment = deployment;
+
+ StringBuffer sb = new StringBuffer();
+ sb.append("<ul>");
+ for(String res : deployment.getResourceNames())
+ {
+ sb.append("<li>").append(res);
+ }
+ sb.append("</ul>");
+
+ HTML html = new HTML(sb.toString());
+ resources.clear();
+ resources.add(html);
+
+ propGrid.update(new String[]{deployment.getId()});
+ }
+
+ public void clearView()
+ {
+ initialize();
+ this.currentDeployment = null;
+ propGrid.clear();
+ resources.clear();
+ }
+
+ private DeploymentRef getSelection()
+ {
+ return this.currentDeployment;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResumeDeploymentAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResumeDeploymentAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResumeDeploymentAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.engine;
+
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ResumeDeploymentAction extends AbstractRESTAction
+{
+ public final static String ID = ResumeDeploymentAction.class.getName();
+
+ public ResumeDeploymentAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ String id = (String)event;
+ return appContext.getUrlBuilder().getResumeDeploymentUrl(id);
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.POST;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ // refresh view
+ controller.handleEvent(
+ new Event(UpdateDeploymentsAction.ID, null)
+ );
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/SuspendDeploymentAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/SuspendDeploymentAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/SuspendDeploymentAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.engine;
+
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class SuspendDeploymentAction extends AbstractRESTAction
+{
+ public final static String ID = SuspendDeploymentAction.class.getName();
+
+ public SuspendDeploymentAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ String id = (String)event;
+ return appContext.getUrlBuilder().getSuspendDeploymentUrl(id);
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.POST;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ // refresh view
+ controller.handleEvent(
+ new Event(UpdateDeploymentsAction.ID, null)
+ );
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentDetailAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentDetailAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentDetailAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.engine;
+
+import com.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Controller;
+import org.jboss.bpm.console.client.model.DeploymentRef;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class UpdateDeploymentDetailAction implements ActionInterface
+{
+ public final static String ID = UpdateDeploymentDetailAction.class.getName();
+
+ public void execute(Controller controller, Object object)
+ {
+ DeploymentRef ref = object!=null ? (DeploymentRef)object : null;
+ DeploymentDetailView view = (DeploymentDetailView)controller.getView(DeploymentDetailView.ID);
+
+ if(null==ref)
+ {
+ // clear view
+ view.clearView();
+ }
+ else
+ {
+ // update view
+ view.update(ref);
+ }
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.engine;
+
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.process.UpdateDefinitionsAction;
+import org.jboss.bpm.console.client.model.DTOParser;
+import org.jboss.bpm.console.client.model.DeploymentRef;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.google.gwt.json.client.JSONValue;
+import com.google.gwt.json.client.JSONParser;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+
+import java.util.List;
+
+/**
+ * Updates a list of deployment and can optionally select a particular one.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class UpdateDeploymentsAction extends AbstractRESTAction
+{
+
+ public final static String ID = UpdateDeploymentsAction.class.getName();
+
+
+ public UpdateDeploymentsAction(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ return appContext.getUrlBuilder().getDeploymentsUrl();
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.GET;
+ }
+
+ public void handleSuccessfulResponse(
+ final Controller controller, final Object event, Response response)
+ {
+ DeploymentListView view = (DeploymentListView)controller.getView(DeploymentListView.ID);
+
+ // deployment could be disabled
+ if(view!=null)
+ {
+ JSONValue json = JSONParser.parse(response.getText());
+ List<DeploymentRef> deployments = DTOParser.parseDeploymentRefList(json);
+
+ if(null==view)
+ throw new RuntimeException("View not initialized: " + DeploymentListView.ID);
+
+ view.update(deployments);
+
+ // optional
+ String deploymentId = (String)event;
+ if(deploymentId!=null)
+ {
+ System.out.println("activate " + deploymentId);
+ view.select(deploymentId);
+ }
+
+ // refresh process definitions
+ controller.handleEvent(
+ new Event(UpdateDefinitionsAction.ID, null)
+ );
+ }
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateJobsAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateJobsAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateJobsAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.engine;
+
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.google.gwt.json.client.JSONParser;
+import com.google.gwt.json.client.JSONValue;
+import com.mvc4g.client.Controller;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.model.DTOParser;
+import org.jboss.bpm.console.client.model.JobRef;
+
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class UpdateJobsAction extends AbstractRESTAction
+{
+ public final static String ID = UpdateJobsAction.class.getName();
+
+ public UpdateJobsAction(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ return appContext.getUrlBuilder().getJobsUrl();
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.GET;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ JSONValue json = JSONParser.parse(response.getText());
+ List<JobRef> jobs = DTOParser.parseJobRefList(json);
+ JobListView view = (JobListView)controller.getView(JobListView.ID);
+ view.update(jobs);
+
+ }
+}
+
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.engine;
+
+import com.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.Workspace;
+
+/**
+ * Cross editor view toggle.
+ * Event requires to be a deployment ID.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ViewDeploymentAction implements ActionInterface
+{
+ public final static String ID = ViewDeploymentAction.class.getName();
+
+ private ApplicationContext appContext;
+
+ public ViewDeploymentAction(ApplicationContext appContext)
+ {
+ this.appContext = appContext;
+ }
+
+ public void execute(Controller controller, Object object)
+ {
+ String dplId = (String)object;
+ System.out.println("view deployment " + dplId);
+
+ Workspace workspace = appContext.getWorkpace();
+ if(workspace.hasEditor(EngineEditor.ID))
+ {
+ workspace.showEditor(EngineEditor.ID);
+ }
+
+ controller.handleEvent(
+ new Event(UpdateDeploymentsAction.ID, dplId)
+ );
+
+
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/events/BootstrapEvent.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/events/BootstrapEvent.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/events/BootstrapEvent.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.events;
+
+import org.jboss.bpm.console.client.Authentication;
+import org.jboss.bpm.console.client.URLBuilder;
+import org.jboss.bpm.console.client.ConsoleConfig;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public final class BootstrapEvent
+{
+ Authentication auth;
+ URLBuilder urlBuilder;
+ ConsoleConfig config;
+
+ public BootstrapEvent(Authentication auth, URLBuilder urlBuilder, ConsoleConfig config)
+ {
+ this.auth = auth;
+ this.urlBuilder = urlBuilder;
+ this.config = config;
+ }
+
+ public Authentication getAuth()
+ {
+ return auth;
+ }
+
+ public URLBuilder getUrlBuilder()
+ {
+ return urlBuilder;
+ }
+
+ public ConsoleConfig getConfig()
+ {
+ return config;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/05_1.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/05_1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/13.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/13.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/27.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/27.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/49.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/49.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/ConsoleIconBundle.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/ConsoleIconBundle.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/ConsoleIconBundle.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,131 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.icons;
+
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
+import com.google.gwt.user.client.ui.ImageBundle;
+
+public interface ConsoleIconBundle extends ImageBundle
+{
+ /**
+ * @gwt.resource processIcon.png
+ */
+ AbstractImagePrototype processIcon();
+
+ /**
+ * @gwt.resource play.png
+ */
+ AbstractImagePrototype instanceIcon();
+
+ /**
+ * Would bundle the file 'open-file-icon.gif' residing in the same package as this type.
+ * @gwt.resource open-file-icon.gif
+
+ AbstractImagePrototype openFileIcon();
+
+ /**
+ * Would bundle the file 'savefile.gif' residing in the package 'org.example.icons'.
+ * @gwt.resource org/example/icons/savefile.gif
+
+ AbstractImagePrototype saveFileIcon();
+ */
+
+ /**
+ * @gwt.resource toolsIcon.png
+ */
+ AbstractImagePrototype settingsIcon();
+
+ /**
+ * @gwt.resource taskIcon.png
+ */
+ AbstractImagePrototype taskIcon();
+
+ /**
+ * @gwt.resource userIcon.png
+ */
+ AbstractImagePrototype userIcon();
+
+ /**
+ * @gwt.resource tool-button-collapse-down.png
+ */
+ AbstractImagePrototype collapseDownIcon();
+
+ /**
+ * @gwt.resource tool-button-collapse-left.png
+ */
+ AbstractImagePrototype collapseLeftIcon();
+
+ /**
+ * @gwt.resource errorIcon.png
+ */
+ AbstractImagePrototype errorIcon();
+
+ /**
+ * @gwt.resource dialog-information.png
+ */
+ AbstractImagePrototype infoIcon();
+
+ /**
+ * @gwt.resource dialog-warning.png
+ */
+ AbstractImagePrototype warnIcon();
+
+ /**
+ * @gwt.resource dialog-question.png
+ */
+ AbstractImagePrototype questionIcon();
+
+ /**
+ * @gwt.resource loading.gif
+ */
+ AbstractImagePrototype loadingIcon();
+
+ /**
+ * @gwt.resource reload.png
+ */
+ AbstractImagePrototype reloadIcon();
+
+ /**
+ * @gwt.resource reload_small.png
+ */
+ AbstractImagePrototype reloadSmallIcon();
+
+ /**
+ * @gwt.resource report.png
+ */
+ AbstractImagePrototype reportIcon();
+
+ /**
+ * @gwt.resource runtime.png
+ */
+ AbstractImagePrototype runtimeIcon();
+
+ /**
+ * @gwt.resource deployment.png
+ */
+ AbstractImagePrototype deploymentIcon();
+
+ /**
+ * @gwt.resource jobs.png
+ */
+ AbstractImagePrototype jobsIcon();
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/add.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/add.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/add_small.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/add_small.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/catForms.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/catForms.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/collapseDown.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/collapseDown.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/collapseLeft.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/collapseLeft.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/confirmIcon.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/confirmIcon.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/confirm_small.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/confirm_small.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/denyIcon.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/denyIcon.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/deny_small.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/deny_small.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/deployment.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/deployment.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/dialog-error.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/dialog-error.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/dialog-information.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/dialog-information.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/dialog-password.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/dialog-password.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/dialog-question.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/dialog-question.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/dialog-warning.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/dialog-warning.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/docIcon.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/docIcon.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/errorIcon.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/errorIcon.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/examine.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/examine.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/jobs.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/jobs.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/large.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/large.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/large_small.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/large_small.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/loading.gif
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/loading.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/lockIcon.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/lockIcon.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/lock_small.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/lock_small.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/pause.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/pause.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/pause_small.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/pause_small.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/play.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/play.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/play_small.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/play_small.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/processIcon.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/processIcon.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/reload.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/reload.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/reload_small.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/reload_small.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/remove.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/remove.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/remove_small.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/remove_small.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/report.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/report.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/runtime.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/runtime.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/stop.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/stop.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/stop_small.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/stop_small.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/taskIcon.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/taskIcon.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/tool-button-collapse-down.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/tool-button-collapse-down.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/tool-button-collapse-left.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/tool-button-collapse-left.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/tool-button-collapse-right.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/tool-button-collapse-right.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/tool-button-collapse-up.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/tool-button-collapse-up.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/tool-button-minus.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/tool-button-minus.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/tool-button-plus.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/tool-button-plus.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/tool-button-refresh.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/tool-button-refresh.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/toolsIcon.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/toolsIcon.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/unlock.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/unlock.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/userIcon.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/userIcon.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/window-button-close.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/window-button-close.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/window-button-maximize.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/window-button-maximize.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/window-button-minimize.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/window-button-minimize.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/window-button-restore.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/window-button-restore.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ActivityDiagramView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ActivityDiagramView.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ActivityDiagramView.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import java.util.List;
+
+import org.gwt.mosaic.ui.client.ScrollLayoutPanel;
+import org.jboss.bpm.console.client.model.ActiveNodeInfo;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+import org.jboss.bpm.console.client.process.events.ActivityDiagramResultEvent;
+
+import com.google.gwt.user.client.ui.HTML;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.ViewInterface;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ActivityDiagramView extends ScrollLayoutPanel
+ implements ViewInterface
+{
+
+ public final static String ID = ActivityDiagramView.class.getName();
+
+ private ProcessDefinitionRef processRef;
+
+ private ProcessInstanceRef instanceRef;
+
+ private Controller controller;
+
+ public ActivityDiagramView()
+ {
+ super();
+ }
+
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public void update(ActivityDiagramResultEvent event)
+ {
+
+ List<ActiveNodeInfo> activeNodeInfos = event.getActiveNodeInfo();
+ String imageUrl = event.getImageUrl();
+
+ // remove contents
+ this.clear();
+
+ // add overlay
+ /*HTML html = new HTML(
+ "<div style='width:1024px; height:768px; background-color:#ffffff;'><div id=\"imageContainer\" style=\"position:relative;top:-1;left:-1;height:"+activeNodeInfo.getHeight()+"px;width:"+activeNodeInfo.getWidth()+"px\">" +
+ "<img src=\""+imageUrl+"\" style=\"position:absolute;top:0;left:0\" />" +
+ "" +
+ "<div class=\"activeNode\" style=\"top:"+ (activeNode.getY()) +"px;left:"+activeNode.getX()+"px;width:"+(activeNode.getWidth()-2)+"px;height:"+(activeNode.getHeight()-2)+"px\"></div>" +
+ "" +
+ "<div class=\"activeNode-header\" style=\"top:"+(activeNode.getY()-15)+"px;left:"+activeNode.getX()+"px;width:"+activeNode.getWidth()+"px;height:15px\">" +
+ " <div class=\"activeNode-header-link\"><a href=\"javascript:alert('Not implemented!')\">Running</a></div>" +
+ "</div>" +
+ "</div></div>"
+ );*/
+
+ String s =
+ "<div style='width:1024px; height:768px; background-color:#ffffff;'>" +
+ "<div id=\"imageContainer\" style=\"position:relative;top:-1;left:-1;\">" +
+ "<img src=\""+imageUrl+"\" style=\"position:absolute;top:0;left:0\" />";
+ for (ActiveNodeInfo activeNodeInfo: activeNodeInfos) {
+ s+= "<div class=\"bpm-graphView-activityImage\" style=\"position:absolute;top:"+ (activeNodeInfo.getActiveNode().getY()-8) +"px;left:"+(activeNodeInfo.getActiveNode().getX()-8)+"px;width:50px;height:50px; z-index:1000;\"></div>";
+ }
+ s+= "</div>" +
+ "</div>";
+
+ HTML html = new HTML(s);
+
+ this.add(html);
+ invalidate();
+ }
+}
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,278 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.ChangeListener;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.ListBox;
+import org.gwt.mosaic.ui.client.ToolBar;
+import org.gwt.mosaic.ui.client.ToolButton;
+import org.gwt.mosaic.ui.client.layout.*;
+import org.gwt.mosaic.ui.client.list.DefaultListModel;
+import org.gwt.mosaic.ui.client.list.ListModel;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+import org.jboss.bpm.console.client.ServerPlugins;
+
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+class DefinitionListView extends AbstractView
+{
+ public final static String ID = DefinitionListView.class.getName();
+
+ private Controller controller;
+
+ private LayoutPanel definitionList = null;
+
+ private ListBox<ProcessDefinitionRef> listBox;
+
+ private boolean isInitialized;
+
+ private int FILTER_NONE = 10;
+ private int FILTER_ACTIVE = 20;
+ private int FILTER_SUSPENDED = 30;
+ private int currentFilter = FILTER_NONE;
+
+ private List<ProcessDefinitionRef> definitions = null;
+
+ public DefinitionListView()
+ {
+ super();
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+ setTitle("Process Definitions");
+ setIcon(icons.processIcon());
+
+ listBox = createListBox();
+
+ }
+
+ public boolean isInitialized()
+ {
+ return isInitialized;
+ }
+
+ public void initialize()
+ {
+ if(!isInitialized)
+ {
+ definitionList = new LayoutPanel( new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ definitionList.setPadding(0);
+ definitionList.setWidgetSpacing(0);
+
+ // toolbar
+
+ final LayoutPanel toolBox = new LayoutPanel();
+ toolBox.setPadding(0);
+ toolBox.setWidgetSpacing(0);
+ toolBox.setLayout(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
+
+ // toolbar
+ final ToolBar toolBar = new ToolBar();
+ toolBar.add(
+ new ToolButton("Refresh", new ClickListener() {
+ public void onClick(Widget sender) {
+ // force loading
+ controller.handleEvent(
+ new Event(UpdateDefinitionsAction.ID, null)
+ );
+ }
+ }
+ )
+ );
+ toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ // filter
+ LayoutPanel filterPanel = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ filterPanel.setStyleName("bpm-filter-panel");
+ final com.google.gwt.user.client.ui.ListBox dropBox = new com.google.gwt.user.client.ui.ListBox(false);
+ dropBox.setStyleName("bpm-operation-ui");
+ dropBox.addItem("All");
+ dropBox.addItem("Active");
+ dropBox.addItem("Suspended");
+
+ dropBox.addChangeListener(new ChangeListener() {
+ public void onChange(Widget sender) {
+ switch (dropBox.getSelectedIndex())
+ {
+ case 0:
+ currentFilter = FILTER_NONE;
+ break;
+ case 1:
+ currentFilter = FILTER_ACTIVE;
+ break;
+ case 2:
+ currentFilter = FILTER_SUSPENDED;
+ break;
+ default:
+ throw new IllegalArgumentException("No such index");
+ }
+
+ renderFiltered();
+ }
+ });
+ filterPanel.add(dropBox);
+
+ toolBox.add(filterPanel, new BoxLayoutData(BoxLayoutData.FillStyle.VERTICAL));
+
+ this.definitionList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+ this.definitionList.add(listBox, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ // layout
+ LayoutPanel layout = new LayoutPanel(new BorderLayout());
+ layout.add(definitionList, new BorderLayoutData(BorderLayout.Region.CENTER));
+
+ // details
+ ProcessDetailView detailsView = new ProcessDetailView();
+ controller.addView(ProcessDetailView.ID, detailsView);
+ controller.addAction(UpdateProcessDetailAction.ID, new UpdateProcessDetailAction());
+ layout.add(detailsView, new BorderLayoutData(BorderLayout.Region.SOUTH, 10,200));
+
+ this.add(layout);
+
+ isInitialized = true;
+ }
+ }
+
+ private ListBox createListBox()
+ {
+ final ListBox<ProcessDefinitionRef> listBox =
+ new ListBox<ProcessDefinitionRef>(
+ new String[] {
+ "Process ID", "Version", "Name", "Suspended"}
+ );
+
+
+ listBox.setCellRenderer(new ListBox.CellRenderer<ProcessDefinitionRef>() {
+ public void renderCell(ListBox<ProcessDefinitionRef> listBox, int row, int column,
+ ProcessDefinitionRef item) {
+ switch (column) {
+ case 0:
+ listBox.setText(row, column, item.getId());
+ break;
+ case 1:
+ listBox.setText(row, column, String.valueOf(item.getVersion()));
+ break;
+ case 2:
+ listBox.setText(row, column, item.getName());
+ break;
+ case 3:
+ listBox.setText(row, column, String.valueOf(item.isSuspended()));
+ break;
+ default:
+ throw new RuntimeException("Unexpected column size");
+ }
+ }
+ });
+
+ listBox.addChangeListener(new ChangeListener()
+ {
+ public void onChange(Widget widget)
+ {
+ int index = listBox.getSelectedIndex();
+ if(index!=-1)
+ {
+ ProcessDefinitionRef item = listBox.getItem(index);
+
+ // update details
+ controller.handleEvent(
+ new Event(UpdateProcessDetailAction.ID, item)
+ );
+
+ // load instances
+ controller.handleEvent(
+ new Event(
+ UpdateInstancesAction.ID,
+ item
+ )
+ );
+ }
+ }
+ });
+
+ ListModel<ProcessDefinitionRef> origModel = listBox.getModel();
+
+ return listBox;
+ }
+
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public void update(List<ProcessDefinitionRef> definitions)
+ {
+ this.definitions = definitions;
+
+ renderFiltered();
+ }
+
+ private void renderFiltered()
+ {
+ if(this.definitions!=null)
+ {
+ final DefaultListModel<ProcessDefinitionRef> model =
+ (DefaultListModel<ProcessDefinitionRef>) listBox.getModel();
+
+ model.clear();
+
+ for(ProcessDefinitionRef def : definitions)
+ {
+ if(FILTER_NONE==currentFilter)
+ {
+ model.add(def);
+ }
+ else
+ {
+ boolean showSuspended = (FILTER_SUSPENDED==currentFilter);
+ if(def.isSuspended()==showSuspended)
+ model.add(def);
+ }
+ }
+
+ if(listBox.getSelectedIndex()!=-1)
+ listBox.setItemSelected(listBox.getSelectedIndex(), false);
+
+ // clear details
+ controller.handleEvent(
+ new Event(UpdateProcessDetailAction.ID, null)
+ );
+ }
+ }
+
+ public ProcessDefinitionRef getSelection()
+ {
+ ProcessDefinitionRef selection = null;
+ if(isInitialized() && listBox.getSelectedIndex()!=-1)
+ selection = listBox.getItem( listBox.getSelectedIndex());
+ return selection;
+ }
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeleteDefinitionAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeleteDefinitionAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeleteDefinitionAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class DeleteDefinitionAction extends AbstractRESTAction
+{
+ public final static String ID = DeleteDefinitionAction.class.getName();
+
+ public DeleteDefinitionAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ ProcessDefinitionRef procRef = (ProcessDefinitionRef)event;
+ return appContext.getUrlBuilder().getRemoveDefinitionURL(procRef.getId());
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.POST;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ // refresh
+ controller.handleEvent(
+ new Event(UpdateDefinitionsAction.ID, null)
+ );
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeleteInstanceAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeleteInstanceAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeleteInstanceAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class DeleteInstanceAction extends AbstractRESTAction
+{
+
+ public final static String ID = DeleteInstanceAction.class.getName();
+
+ public DeleteInstanceAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ ProcessInstanceRef instance = (ProcessInstanceRef)event;
+ return appContext.getUrlBuilder().getInstanceDeleteURL(instance.getId());
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.POST;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ InstanceListView view = (InstanceListView) controller.getView(InstanceListView.ID);
+ ProcessDefinitionRef def = view.getCurrentDefinition();
+
+ // refresh instances
+ controller.handleEvent(
+ new Event(
+ UpdateInstancesAction.ID,
+ def
+ )
+ );
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeploymentPanel.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeploymentPanel.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeploymentPanel.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,104 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.Widget;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.jboss.bpm.console.client.common.PropertyGrid;
+import org.jboss.bpm.console.client.engine.ViewDeploymentAction;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class DeploymentPanel extends LayoutPanel
+{
+
+ private Controller controller;
+
+ private PropertyGrid propGrid;
+
+ String deploymentId = null;
+
+ private boolean initialized;
+
+ public DeploymentPanel()
+ {
+ super(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
+
+ }
+
+ private void initialize()
+ {
+ if(!initialized)
+ {
+ this.propGrid = new PropertyGrid(new String[]{"Deployment ID:"});
+
+ this.add(propGrid, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+ final Button button = new Button("View Deployment", new ClickListener(){
+
+ public void onClick(Widget widget)
+ {
+ controller.handleEvent(
+ new Event(ViewDeploymentAction.ID, getSelection())
+ );
+ }
+ });
+
+ this.add(button);
+
+ this.initialized = true;
+ }
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public void update(String id)
+ {
+ initialize();
+ this.deploymentId = id;
+ propGrid.update(new String[]{id});
+ }
+
+ public void clearView()
+ {
+ initialize();
+ this.deploymentId = null;
+ propGrid.clear();
+ }
+
+ private String getSelection()
+ {
+ return this.deploymentId;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDataView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDataView.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDataView.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,201 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import com.google.gwt.user.client.Window;
+import com.google.gwt.xml.client.*;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.ViewInterface;
+import org.gwt.mosaic.ui.client.ListBox;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.gwt.mosaic.ui.client.list.DefaultListModel;
+import org.jboss.bpm.console.client.LazyPanel;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class InstanceDataView extends LayoutPanel implements ViewInterface, LazyPanel
+{
+ public final static String ID = InstanceDataView.class.getName();
+
+ private Controller controller;
+
+ private ListBox listBox;
+
+ private String instanceId;
+
+ private boolean isInitialized;
+
+ public InstanceDataView()
+ {
+ super();
+ this.setPadding(5);
+ }
+
+ public void initialize()
+ {
+ if(!isInitialized)
+ {
+ listBox =
+ new ListBox<Node>(
+ new String[] {
+ "Key", "XSD Type", "Java Type", "Value"}
+ );
+
+ listBox.setCellRenderer(new ListBox.CellRenderer<DataEntry>() {
+ public void renderCell(ListBox<DataEntry> listBox, int row, int column,
+ DataEntry item) {
+ switch (column) {
+ case 0:
+ listBox.setText(row, column, item.key);
+ break;
+ case 1:
+ listBox.setText(row, column, item.xsd);
+ break;
+ case 2:
+ listBox.setText(row,column, item.java);
+ break;
+ case 3:
+ listBox.setText(row,column, item.value);
+ break;
+ default:
+ throw new RuntimeException("Unexpected column size");
+ }
+ }
+ });
+
+ this.add(listBox);
+
+ this.isInitialized = true;
+ }
+ }
+
+ public boolean isInitialized()
+ {
+ return isInitialized;
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public void update(String instanceId, Document xml)
+ {
+ this.instanceId = instanceId;
+ parseMessage(xml);
+ }
+
+ private void parseMessage(Document messageDom)
+ {
+ try
+ {
+ // parse the XML document into a DOM
+ //Document messageDom = XMLParser.parse(messageXml);
+
+ Node dataSetNode = messageDom.getElementsByTagName("dataset").item(0);
+ List<Node> dataSetNodeChildren = filterChildNodes(dataSetNode.getChildNodes());
+ List<DataEntry> results = new ArrayList<DataEntry>();
+
+ for(Node dataNode : dataSetNodeChildren)
+ {
+ DataEntry dataEntry = new DataEntry();
+ NamedNodeMap dataNodeAttributes = dataNode.getAttributes();
+
+ Node valueNode = filterChildNodes(dataNode.getChildNodes()).get(0); // expected to have just one childâ
+ NamedNodeMap valueNodeAttributes = valueNode.getAttributes();
+
+ dataEntry.key = dataNodeAttributes.getNamedItem("key").getNodeValue();
+ dataEntry.java = dataNodeAttributes.getNamedItem("javaType").getNodeValue();
+ dataEntry.xsd = valueNodeAttributes.getNamedItem("xsi:type").getNodeValue();
+
+ List<Node> valueChildElements = filterChildNodes(valueNode.getChildNodes());
+
+ if(valueChildElements.isEmpty()
+ && valueNode.hasChildNodes()
+ && Node.TEXT_NODE == valueNode.getChildNodes().item(0).getNodeType())
+ {
+ // simple type
+ dataEntry.value = valueNode.getFirstChild().getNodeValue();
+ }
+ else
+ {
+ // complex types or empty elements
+ dataEntry.value = "n/a";
+ }
+
+ results.add(dataEntry);
+ }
+
+ bindData(results);
+ }
+ catch (Throwable e)
+ {
+ ConsoleLog.error("Failed to parse XML document", e);
+ }
+
+ }
+
+ private void bindData(List<DataEntry> data)
+ {
+ initialize();
+
+ final DefaultListModel<DataEntry> model =
+ (DefaultListModel<DataEntry>) listBox.getModel();
+ model.clear();
+
+ for(DataEntry d : data)
+ {
+ model.add(d);
+ }
+
+ // layout again
+ this.layout();
+ }
+
+ private List<Node> filterChildNodes(NodeList childNodes)
+ {
+ List<Node> result = new ArrayList<Node>();
+
+ for(int i=0; i<childNodes.getLength(); i++)
+ {
+ Node n = childNodes.item(i);
+ if(n.getNodeType()!=Node.ELEMENT_NODE) // skip #text
+ continue;
+ else
+ result.add(n);
+ }
+ return result;
+ }
+
+ private class DataEntry
+ {
+ String key;
+ String xsd;
+ String java;
+ String value;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,274 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.ViewInterface;
+import com.mvc4g.client.Event;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.WindowCloseListener;
+import com.google.gwt.user.client.WindowResizeListener;
+import org.gwt.mosaic.ui.client.*;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.jboss.bpm.console.client.common.PropertyGrid;
+import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+import org.jboss.bpm.console.client.model.util.SimpleDateFormat;
+import org.jboss.bpm.console.client.util.WindowUtil;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.ServerPlugins;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class InstanceDetailView extends CaptionLayoutPanel implements ViewInterface
+{
+ public final static String ID = InstanceDetailView.class.getName();
+
+ private Controller controller;
+
+ private PropertyGrid grid;
+
+ private ProcessInstanceRef currentInstance;
+
+ private Button diagramBtn;
+
+ private Button instanceDataBtn;
+
+ private WindowPanel diagramWindowPanel;
+
+ private WindowPanel instanceDataWindowPanel;
+
+ private ApplicationContext appContext;
+
+ private ActivityDiagramView diagramView;
+
+ private InstanceDataView instanceDataView;
+
+ private boolean hasDiagramPlugin;
+
+ private SimpleDateFormat dateFormat = new SimpleDateFormat();
+ private ProcessDefinitionRef currentDefintion;
+
+ public InstanceDetailView(final ApplicationContext appContext)
+ {
+ super("Instance details");
+ this.appContext = appContext;
+
+ super.setStyleName("bpm-detail-panel");
+ super.setLayout(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
+
+ grid = new PropertyGrid(
+ new String[] {"ID:", "Key:", "State", "Start Date:", "Activity:"}
+ );
+
+ this.add(grid, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ LayoutPanel buttonPanel = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL) );
+ diagramBtn = new Button("Diagram",
+ new ClickListener()
+ {
+ public void onClick(Widget widget)
+ {
+ String diagramUrl = getCurrentDefintion().getDiagramUrl();
+ if(diagramUrl !=null && !diagramUrl.equals(""))
+ {
+ ProcessInstanceRef selection = getCurrentInstance();
+ if(selection!=null)
+ {
+ createDiagramWindow(selection);
+ controller.handleEvent(
+ new Event(LoadActivityDiagramAction.ID, selection)
+ );
+ }
+ }
+ else
+ {
+ MessageBox.alert("Incomplete deployment", "No diagram associated with process");
+ }
+
+ }
+ }
+ );
+
+ diagramBtn.setEnabled(false);
+ buttonPanel.add(diagramBtn);
+
+ instanceDataBtn = new Button("Instance Data",
+ new ClickListener()
+ {
+ public void onClick(Widget widget)
+ {
+ if(currentInstance!=null)
+ {
+ createDataWindow(currentInstance);
+ controller.handleEvent(
+ new Event(UpdateInstanceDataAction.ID, currentInstance.getId())
+ );
+ }
+ }
+ }
+ );
+ instanceDataBtn.setEnabled(false);
+ buttonPanel.add(instanceDataBtn);
+ this.add(buttonPanel);
+
+ // plugin availability
+ this.hasDiagramPlugin =
+ ServerPlugins.has("org.jboss.bpm.console.server.plugin.GraphViewerPlugin");
+
+ }
+
+ private void createDiagramWindow(ProcessInstanceRef inst)
+ {
+ diagramWindowPanel = new WindowPanel("Process Instance Activity");
+ diagramWindowPanel.setAnimationEnabled(true);
+ diagramWindowPanel.setSize("320px", "240px");
+
+ LayoutPanel layout = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ layout.setStyleName("bpm-window-layout");
+ layout.setPadding(5);
+
+ Label header = new Label("Instance: "+inst.getId());
+ header.setStyleName("bpm-label-header");
+ layout.add(header, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ diagramWindowPanel.addWindowCloseListener(new WindowCloseListener() {
+ public void onWindowClosed() {
+ diagramWindowPanel = null;
+
+ }
+
+ public String onWindowClosing() {
+ return null;
+ }
+ });
+
+
+ layout.add(diagramView, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+ diagramWindowPanel.setWidget(layout);
+
+ WindowUtil.addMaximizeButton(diagramWindowPanel, Caption.CaptionRegion.RIGHT);
+ WindowUtil.addMinimizeButton(diagramWindowPanel, Caption.CaptionRegion.RIGHT);
+
+ // display
+ diagramWindowPanel.center();
+
+ }
+
+ private void createDataWindow(ProcessInstanceRef inst)
+ {
+ instanceDataWindowPanel = new WindowPanel("Process Instance Data: "+inst.getId());
+ instanceDataWindowPanel.setAnimationEnabled(true);
+ instanceDataWindowPanel.setSize("320px", "240px");
+
+
+ instanceDataWindowPanel.addWindowCloseListener(new WindowCloseListener() {
+ public void onWindowClosed() {
+ instanceDataWindowPanel = null;
+
+ }
+
+ public String onWindowClosing() {
+ return null;
+ }
+ });
+
+ instanceDataWindowPanel.addWindowResizeListener(
+ new WindowResizeListener() {
+
+ public void onWindowResized(int i, int i1)
+ {
+ instanceDataView.invalidate();
+ }
+ }
+ );
+
+ instanceDataWindowPanel.setWidget(instanceDataView);
+
+ WindowUtil.addMaximizeButton(instanceDataWindowPanel, Caption.CaptionRegion.RIGHT);
+ WindowUtil.addMinimizeButton(instanceDataWindowPanel, Caption.CaptionRegion.RIGHT);
+
+ // display
+ instanceDataWindowPanel.center();
+
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+
+ this.diagramView = new ActivityDiagramView();
+ this.instanceDataView = new InstanceDataView();
+
+ controller.addView(ActivityDiagramView.ID, diagramView);
+ controller.addView(InstanceDataView.ID, instanceDataView);
+ controller.addAction(LoadActivityDiagramAction.ID, new LoadActivityDiagramAction(appContext));
+ controller.addAction(UpdateInstanceDataAction.ID, new UpdateInstanceDataAction(appContext));
+ }
+
+ public void update(ProcessDefinitionRef def, ProcessInstanceRef instance)
+ {
+ this.currentDefintion = def;
+ this.currentInstance = instance;
+
+ String[] values = new String[] {
+ instance.getId(),
+ instance.getKey(),
+ String.valueOf( instance.getState() ),
+ dateFormat.format(instance.getStartDate()),
+ instance.getRootToken().getCurrentNodeName()
+ };
+
+ grid.update(values);
+
+ if(hasDiagramPlugin)
+ this.diagramBtn.setEnabled(true);
+
+ instanceDataBtn.setEnabled(true);
+ }
+
+ public void clearView()
+ {
+ grid.clear();
+ this.currentDefintion=null;
+ this.currentInstance = null;
+ this.diagramBtn.setEnabled(false);
+ instanceDataBtn.setEnabled(false);
+
+ }
+
+
+ private ProcessDefinitionRef getCurrentDefintion()
+ {
+ return currentDefintion;
+ }
+
+ private ProcessInstanceRef getCurrentInstance()
+ {
+ return currentInstance;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,419 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.WindowCloseListener;
+import com.google.gwt.user.client.ui.ChangeListener;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Frame;
+import com.google.gwt.user.client.ui.Widget;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.*;
+import org.gwt.mosaic.ui.client.layout.*;
+import org.gwt.mosaic.ui.client.list.DefaultListModel;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.process.events.InstanceEvent;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+import org.jboss.bpm.console.client.model.util.SimpleDateFormat;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.bpm.console.client.util.WindowUtil;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+class InstanceListView extends AbstractView
+{
+ public final static String ID = InstanceListView.class.getName();
+
+ private Controller controller;
+
+ private LayoutPanel instanceList = null;
+
+ private ListBox<ProcessInstanceRef> listBox;
+
+ private ProcessDefinitionRef currentDefinition;
+
+ private boolean isInitialized;
+
+ private List<ProcessInstanceRef> cachedInstances = null;
+
+ private SimpleDateFormat dateFormat = new SimpleDateFormat();
+
+ private ApplicationContext appContext;
+
+ private WindowPanel windowPanel = null;
+ private Frame frame = null;
+
+ public InstanceListView(ApplicationContext appContext)
+ {
+ super();
+ this.appContext = appContext;
+
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+ setTitle("Process Instances");
+ setIcon(icons.instanceIcon());
+ }
+
+ public boolean isInitialized()
+ {
+ return isInitialized;
+ }
+
+ public void initialize()
+ {
+ if(!isInitialized)
+ {
+ instanceList = new LayoutPanel( new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ instanceList.setPadding(0);
+ instanceList.setWidgetSpacing(0);
+
+ listBox =
+ new ListBox<ProcessInstanceRef>(
+ new String[] {
+ "Instance ID", "State", "Start Date"}
+ );
+
+ listBox.setCellRenderer(new ListBox.CellRenderer<ProcessInstanceRef>() {
+ public void renderCell(ListBox<ProcessInstanceRef> listBox, int row, int column,
+ ProcessInstanceRef item) {
+ switch (column) {
+ case 0:
+ listBox.setText(row, column, item.getId());
+ break;
+ case 1:
+ listBox.setText(row, column, item.getState().toString());
+ break;
+ case 2:
+ String d = item.getStartDate() != null ? dateFormat.format(item.getStartDate()) : "";
+ listBox.setText(row, column, d);
+ break;
+ default:
+ throw new RuntimeException("Unexpected column size");
+ }
+ }
+ });
+
+ listBox.addChangeListener(new ChangeListener()
+ {
+ public void onChange(Widget widget)
+ {
+ int index = listBox.getSelectedIndex();
+ if(index!=-1)
+ {
+ ProcessInstanceRef item = listBox.getItem(index);
+
+ // update details
+ controller.handleEvent(
+ new Event(UpdateInstanceDetailAction.ID,
+ new InstanceEvent(currentDefinition, item)
+ )
+ );
+ }
+ }
+ });
+
+ // toolbar
+ final LayoutPanel toolBox = new LayoutPanel();
+ toolBox.setPadding(0);
+ toolBox.setWidgetSpacing(5);
+
+ final ToolBar toolBar = new ToolBar();
+ toolBar.add(
+ new ToolButton("Refresh", new ClickListener() {
+ public void onClick(Widget sender) {
+ controller.handleEvent(
+ new Event(
+ UpdateInstancesAction.ID,
+ getCurrentDefinition()
+ )
+ );
+ }
+ }
+ )
+ );
+
+ toolBar.addSeparator();
+
+ toolBar.add(
+ new ToolButton("Start", new ClickListener()
+ {
+ public void onClick(Widget sender)
+ {
+ MessageBox.confirm("Start new execution",
+ "Do you want to start a new execution of this process?",
+ new MessageBox.ConfirmationCallback() {
+ public void onResult(boolean doIt)
+ {
+ if(doIt)
+ {
+ String url = getCurrentDefinition().getFormUrl();
+ boolean hasForm = (url !=null && !url.equals(""));
+ if(hasForm)
+ {
+ createProcessFormWindow(getCurrentDefinition());
+ }
+ else
+ {
+ controller.handleEvent(
+ new Event(
+ StartNewInstanceAction.ID,
+ getCurrentDefinition()
+ )
+ );
+ }
+ }
+
+ }
+ });
+
+ }
+ }
+ )
+ );
+
+ toolBar.addSeparator();
+
+ toolBar.add(
+ new ToolButton("Terminate", new ClickListener()
+ {
+ public void onClick(Widget sender)
+ {
+
+ if(getSelection()!=null)
+ {
+
+ MessageBox.confirm("Terminate instance",
+ "Terminating this instance will stop further execution.",
+ new MessageBox.ConfirmationCallback() {
+ public void onResult(boolean doIt)
+ {
+ if(doIt)
+ {
+ ProcessInstanceRef selection = getSelection();
+ selection.setState(ProcessInstanceRef.STATE.ENDED);
+ selection.setEndResult(ProcessInstanceRef.RESULT.OBSOLETE);
+ controller.handleEvent(
+ new Event(
+ StateChangeAction.ID,
+ selection
+ )
+ );
+ }
+ }
+ });
+ }
+ else
+ {
+ MessageBox.alert("Missing selection", "Please select an instance");
+ }
+ }
+ }
+ )
+ );
+
+ toolBar.addSeparator();
+
+ toolBar.add(
+ new ToolButton("Delete", new ClickListener()
+ {
+ public void onClick(Widget sender)
+ {
+
+ if(getSelection()!=null)
+ {
+ MessageBox.confirm("Delete instance",
+ "Deleting this instance will remove any history information and associated tasks as well.",
+ new MessageBox.ConfirmationCallback() {
+ public void onResult(boolean doIt)
+ {
+
+ if(doIt)
+ {
+ ProcessInstanceRef selection = getSelection();
+ selection.setState(ProcessInstanceRef.STATE.ENDED);
+
+ controller.handleEvent(
+ new Event(
+ DeleteInstanceAction.ID,
+ selection
+ )
+ );
+ }
+ }
+ });
+
+ }
+ else
+ {
+ MessageBox.alert("Missing selection", "Please select an instance");
+ }
+ }
+ }
+ )
+ );
+
+ toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ instanceList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+ instanceList.add(listBox, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ // cached data?
+ if(this.cachedInstances!=null)
+ bindData(this.cachedInstances);
+
+ // layout
+ LayoutPanel layout = new LayoutPanel(new BorderLayout());
+ layout.add(instanceList, new BorderLayoutData(BorderLayout.Region.CENTER));
+
+ // details
+ InstanceDetailView detailsView = new InstanceDetailView(appContext);
+ controller.addView(InstanceDetailView.ID, detailsView);
+
+ controller.addAction(UpdateInstanceDetailAction.ID, new UpdateInstanceDetailAction());
+
+ layout.add(detailsView, new BorderLayoutData(BorderLayout.Region.SOUTH,10,200));
+
+ this.add(layout);
+
+ isInitialized = true;
+
+ }
+ }
+
+ private void createProcessFormWindow(ProcessDefinitionRef process)
+ {
+ windowPanel = new WindowPanel("Process Interface");
+ windowPanel.setAnimationEnabled(true);
+ windowPanel.setSize("320px", "240px");
+
+ LayoutPanel layout = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ layout.setStyleName("bpm-window-layout");
+ layout.setPadding(5);
+ // info
+ Label header = new Label("Process: "+process.getId());
+ header.setStyleName("bpm-label-header");
+ layout.add(header, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ // task form iframe
+
+ windowPanel.addWindowCloseListener(new WindowCloseListener() {
+ public void onWindowClosed() {
+ controller.handleEvent(
+ new Event(UpdateInstancesAction.ID, getCurrentDefinition())
+ );
+
+ windowPanel = null;
+ frame = null;
+
+ }
+
+ public String onWindowClosing() {
+ return null;
+ }
+ });
+
+ // iframe
+ frame = new Frame();
+ DOM.setStyleAttribute(frame.getElement(), "border", "none");
+
+ // https://jira.jboss.org/jira/browse/JBPM-2244
+ frame.getElement().setId(
+ String.valueOf( new Date().getTime())
+ );
+
+ ConsoleLog.debug(frame.getElement().toString());
+ frame.setUrl(process.getFormUrl());
+
+ layout.add(frame, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+ windowPanel.setWidget(layout);
+
+ WindowUtil.addMaximizeButton(windowPanel, Caption.CaptionRegion.RIGHT);
+ WindowUtil.addMinimizeButton(windowPanel, Caption.CaptionRegion.RIGHT);
+
+ // display
+ windowPanel.center();
+
+ }
+
+
+ public ProcessInstanceRef getSelection()
+ {
+ ProcessInstanceRef selection = null;
+ if(listBox.getSelectedIndex()!=-1)
+ selection = listBox.getItem( listBox.getSelectedIndex());
+ return selection;
+ }
+
+ public ProcessDefinitionRef getCurrentDefinition()
+ {
+ return this.currentDefinition;
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+
+ public void update(final ProcessDefinitionRef def, List<ProcessInstanceRef> instances)
+ {
+ this.currentDefinition = def;
+ this.cachedInstances = instances;
+
+ if(isInitialized())
+ {
+ bindData(instances);
+
+ // clear details
+ controller.handleEvent(
+ new Event(UpdateInstanceDetailAction.ID,
+ new InstanceEvent(def, null)
+ )
+ );
+
+ }
+ }
+
+ private void bindData(List<ProcessInstanceRef> instances)
+ {
+ final DefaultListModel<ProcessInstanceRef> model =
+ (DefaultListModel<ProcessInstanceRef>) listBox.getModel();
+ model.clear();
+
+ for(ProcessInstanceRef inst : instances)
+ {
+ model.add(inst);
+ }
+
+ // layout again
+ this.invalidate();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/LoadActivityDiagramAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/LoadActivityDiagramAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/LoadActivityDiagramAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,119 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.model.ActiveNodeInfo;
+import org.jboss.bpm.console.client.model.DiagramNodeInfo;
+import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+import org.jboss.bpm.console.client.process.events.ActivityDiagramResultEvent;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.bpm.console.client.util.JSONWalk;
+import org.jboss.bpm.console.client.util.JSONWalk.JSONWrapper;
+
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.google.gwt.json.client.JSONArray;
+import com.google.gwt.json.client.JSONObject;
+import com.google.gwt.json.client.JSONParser;
+import com.google.gwt.json.client.JSONValue;
+import com.mvc4g.client.Controller;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class LoadActivityDiagramAction extends AbstractRESTAction
+{
+ public final static String ID = LoadActivityDiagramAction.class.getName();
+
+ public LoadActivityDiagramAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ ProcessInstanceRef inst = (ProcessInstanceRef)event;
+ return appContext.getUrlBuilder().getActiveNodeInfoURL(inst.getId());
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.GET;
+ }
+
+ public void handleSuccessfulResponse(
+ final Controller controller, final Object event, Response response)
+ {
+ ProcessInstanceRef inst = (ProcessInstanceRef)event;
+
+ ConsoleLog.debug("Parse: " + response.getText());
+
+ //TODO: move to DTO Parser
+ JSONValue root = JSONParser.parse(response.getText());
+ //int diagramWidth = JSONWalk.on(root).next("diagramWidth").asInt();
+ //int diagramHeight = JSONWalk.on(root).next("diagramHeight").asInt();
+
+ if (root instanceof JSONArray) {
+ JSONArray array = (JSONArray) root;
+ List<ActiveNodeInfo> activeNodeInfos = new ArrayList<ActiveNodeInfo>();
+ for (int i = 0; i < array.size(); i++) {
+ JSONWalk walk = JSONWalk.on(array.get(i));
+ JSONWrapper wrapper = walk.next("activeNode");
+ JSONObject activeNode = wrapper.asObject();
+
+ int x = JSONWalk.on(activeNode).next("x").asInt();
+ int y = JSONWalk.on(activeNode).next("y").asInt();
+
+ int width = JSONWalk.on(activeNode).next("width").asInt();
+ int height = JSONWalk.on(activeNode).next("height").asInt();
+ String name = JSONWalk.on(activeNode).next("name").asString();
+
+ activeNodeInfos.add(
+ new ActiveNodeInfo(
+ -1, -1,
+ new DiagramNodeInfo(name, x, y, width, height)
+ )
+ );
+ wrapper = walk.next("activeNode");
+ }
+
+ // update view
+ ActivityDiagramView view = (ActivityDiagramView) controller.getView(ActivityDiagramView.ID);
+ view.update(
+ new ActivityDiagramResultEvent(
+ appContext.getUrlBuilder().getProcessImageURL(inst.getDefinitionId()),
+ activeNodeInfos
+ )
+ );
+ }
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDetailView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDetailView.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDetailView.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import com.google.gwt.user.client.ui.ChangeListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.ViewInterface;
+import org.gwt.mosaic.ui.client.Caption;
+import org.gwt.mosaic.ui.client.CaptionLayoutPanel;
+import org.gwt.mosaic.ui.client.DeckLayoutPanel;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.jboss.bpm.console.client.common.PropertyGrid;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+import org.jboss.bpm.console.client.ServerPlugins;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ProcessDetailView extends CaptionLayoutPanel implements ViewInterface
+{
+ public final static String ID = ProcessDetailView.class.getName();
+
+ private Controller controller;
+
+ private PropertyGrid grid;
+
+ private ProcessDefinitionRef currentProcess;
+
+ private DeploymentPanel deploymentPanel;
+
+ private boolean showDeployment;
+
+ public ProcessDetailView()
+ {
+ super("Process details");
+ super.setStyleName("bpm-detail-panel");
+
+ grid = new PropertyGrid(
+ new String[] {"ID:", "Key:", "Name:", "Suspended:", "Package:", "Description:"}
+ );
+
+
+ // properties
+ final DeckLayoutPanel deck = new DeckLayoutPanel();
+ deck.add(grid);
+
+ // selection
+ final com.google.gwt.user.client.ui.ListBox dropBox = new com.google.gwt.user.client.ui.ListBox(false);
+ dropBox.setStyleName("bpm-operation-ui");
+ dropBox.addItem("Properties");
+
+ // deployment info
+ if(ServerPlugins.has("org.jboss.bpm.console.server.plugin.ProcessEnginePlugin"))
+ {
+ dropBox.addItem("Deployment");
+ deploymentPanel = new DeploymentPanel();
+ deck.add(deploymentPanel);
+ }
+
+ dropBox.addChangeListener(new ChangeListener() {
+ public void onChange(Widget sender) {
+ deck.showWidget(dropBox.getSelectedIndex());
+ deck.layout();
+ }
+ });
+
+ this.getHeader().add(dropBox, Caption.CaptionRegion.RIGHT);
+ this.add(deck, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ deck.showWidget(dropBox.getSelectedIndex());
+
+ this.add(deck, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ if(deploymentPanel!=null)//if(ServerPlugins.has("org.jboss.bpm.console.server.plugin.ProcessEnginePlugin"))
+ deploymentPanel.setController(controller);
+ }
+
+ public void update(ProcessDefinitionRef process)
+ {
+ this.currentProcess = process;
+
+ String[] values = new String[] {
+ process.getId(),
+ process.getKey(),
+ process.getName(),
+ String.valueOf(process.isSuspended()),
+ process.getPackageName(),
+ process.getDescription()
+ };
+
+ grid.update(values);
+ deploymentPanel.update(process.getDeploymentId());
+ }
+
+ public void clearView()
+ {
+ grid.clear();
+ deploymentPanel.clearView();
+ this.currentProcess = null;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,158 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import com.google.gwt.user.client.ui.SourcesTabEvents;
+import com.google.gwt.user.client.ui.TabListener;
+import com.google.gwt.core.client.GWT;
+import com.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
+import org.gwt.mosaic.ui.client.MessageBox;
+import org.gwt.mosaic.ui.client.TabLayoutPanel;
+import static org.gwt.mosaic.ui.client.layout.BorderLayout.Region;
+import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.Editor;
+import org.jboss.bpm.console.client.MenuSection;
+import org.jboss.bpm.console.client.LazyPanel;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ProcessEditor extends Editor
+{
+ public final static String ID = ProcessEditor.class.getName();
+
+ private TabLayoutPanel tabPanel;
+
+ public ProcessEditor(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public void initialize()
+ {
+ if(!isInitialized)
+ {
+ // create inner tab layout
+ tabPanel = new DecoratedTabLayoutPanel();
+ tabPanel.setPadding(5);
+ tabPanel.addTabListener(
+ new TabListener()
+ {
+ public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ boolean showTab = true;
+
+ if(i!=0)
+ {
+ DefinitionListView view = ((DefinitionListView) controller.getView(DefinitionListView.ID));
+ boolean hasSelection = view.getSelection() != null;
+ if(!hasSelection)
+ {
+ MessageBox.alert("Missing selection", "Please select a process");
+ showTab=false;
+ }
+ }
+
+ return showTab;
+ }
+
+ public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
+ if(!lazyPanel.isInitialized())
+ {
+ lazyPanel.initialize();
+ appContext.refreshView(); // TODO: hack around rendering problems
+ }
+ }
+ }
+ );
+
+ this.add(tabPanel, new BorderLayoutData(Region.CENTER));
+
+ // create and register views
+ registerView(DefinitionListView.ID, new DefinitionListView());
+ registerView(InstanceListView.ID, new InstanceListView(appContext));
+
+ // create and register actions
+
+ registerAction(UpdateInstancesAction.ID, new UpdateInstancesAction(appContext));
+ registerAction(StartNewInstanceAction.ID, new StartNewInstanceAction(appContext));
+ registerAction(StateChangeAction.ID, new StateChangeAction(appContext));
+ registerAction(DeleteDefinitionAction.ID, new DeleteDefinitionAction(appContext));
+ registerAction(DeleteInstanceAction.ID, new DeleteInstanceAction(appContext));
+
+ // display tab, needs to visible for correct rendering
+ tabPanel.selectTab(0);
+
+ // force loading
+ super.controller.handleEvent(
+ new Event(UpdateDefinitionsAction.ID, null)
+ );
+
+ appContext.refreshView();
+
+ isInitialized = true;
+ }
+ }
+
+ private void registerView(String id, AbstractView view)
+ {
+ // register view with controller
+ super.controller.addView(id, view);
+
+ // add to tab layout
+ this.tabPanel.add(view, view.getIconTitle(), true);
+ }
+
+ private void registerAction(String name, ActionInterface action)
+ {
+ super.controller.addAction(name, action);
+ }
+
+ public String getEditorId()
+ {
+ return ID;
+ }
+
+ public String getTitle()
+ {
+ return "Processes";
+ }
+
+ public MenuSection provideMenuSection()
+ {
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+
+ return new MenuSection(
+ "Processes",
+ icons.processIcon(),
+ new ProcessEditorNavigation(appContext)
+ );
+ }
+}
+
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditorNavigation.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditorNavigation.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditorNavigation.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import com.google.gwt.user.client.ui.Tree;
+import com.google.gwt.user.client.ui.TreeItem;
+import com.google.gwt.user.client.ui.TreeListener;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.Workspace;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+class ProcessEditorNavigation extends Tree
+{
+
+ public ProcessEditorNavigation(final ApplicationContext appContext)
+ {
+ super.setTitle("Processes");
+
+ TreeItem root = addItem("Process Definitions");
+ TreeItem definitions = root.addItem("Definition List");
+
+ addTreeListener(
+ new TreeListener()
+ {
+ public void onTreeItemSelected(TreeItem treeItem)
+ {
+ if("Definition List".equals(treeItem.getText()))
+ {
+ Workspace workspace = appContext.getWorkpace();
+ workspace.showEditor(ProcessEditor.ID);
+ }
+ }
+
+ public void onTreeItemStateChanged(TreeItem treeItem)
+ {
+
+ }
+ }
+ );
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/StartNewInstanceAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/StartNewInstanceAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/StartNewInstanceAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+
+/**
+ * Starts a new process instance.
+ * Triggered through {@link org.jboss.bpm.console.client.model.ProcessDefinitionRef}
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+class StartNewInstanceAction extends AbstractRESTAction
+{
+ public final static String ID = StartNewInstanceAction.class.getName();
+
+ public StartNewInstanceAction(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ final ProcessDefinitionRef def = (ProcessDefinitionRef)event;
+ return appContext.getUrlBuilder().getStartNewInstanceURL(def.getId());
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.POST;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ final ProcessDefinitionRef def = (ProcessDefinitionRef)event;
+
+ // force reload instance list
+ controller.handleEvent(
+ new Event(UpdateInstancesAction.ID, def)
+ );
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/StateChangeAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/StateChangeAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/StateChangeAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import com.google.gwt.http.client.*;
+
+/**
+ * Starts a new process instance.
+ * Triggered through {@link org.jboss.bpm.console.client.model.ProcessInstanceRef}
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+class StateChangeAction extends AbstractRESTAction
+{
+ public final static String ID = StateChangeAction.class.getName();
+
+ public StateChangeAction(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ final ProcessInstanceRef inst = (ProcessInstanceRef)event;
+ if(ProcessInstanceRef.STATE.ENDED == inst.getState())
+ return appContext.getUrlBuilder().getInstanceEndURL(inst.getId(), inst.getEndResult());
+ else
+ return appContext.getUrlBuilder().getStateChangeURL(inst.getId(), inst.getState());
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.POST;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ InstanceListView view = (InstanceListView) controller.getView(InstanceListView.ID);
+ ProcessDefinitionRef def = view.getCurrentDefinition();
+
+ // force reload instance list
+ controller.handleEvent( new Event(UpdateInstancesAction.ID, def));
+ }
+}
+
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateDefinitionsAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateDefinitionsAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateDefinitionsAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.google.gwt.json.client.JSONParser;
+import com.google.gwt.json.client.JSONValue;
+import com.mvc4g.client.Controller;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.model.DTOParser;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+
+import java.util.List;
+
+/**
+ * Loads a process definition list
+ * and updates {@link org.jboss.bpm.console.client.process.DefinitionListView}
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class UpdateDefinitionsAction extends AbstractRESTAction
+{
+ public final static String ID = UpdateDefinitionsAction.class.getName();
+
+ public UpdateDefinitionsAction(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ return appContext.getUrlBuilder().getProcessDefinitionsURL();
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.GET;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ DefinitionListView view = (DefinitionListView) controller.getView(DefinitionListView.ID);
+ if(view!=null) // may not be initialized (lazy)
+ {
+ JSONValue json = JSONParser.parse(response.getText());
+ List<ProcessDefinitionRef> definitions = DTOParser.parseProcessDefinitions(json);
+
+ view.update(definitions);
+
+ ConsoleLog.info("Loaded " + definitions.size() + " process definitions");
+ }
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstanceDataAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstanceDataAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstanceDataAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.google.gwt.xml.client.Document;
+import com.google.gwt.xml.client.XMLParser;
+import com.mvc4g.client.Controller;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class UpdateInstanceDataAction extends AbstractRESTAction
+{
+
+ public final static String ID = UpdateInstanceDataAction.class.getName();
+
+ public UpdateInstanceDataAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ String id = (String)event;
+ return appContext.getUrlBuilder().getInstanceDataURL(id);
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.GET;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ String id = (String)event;
+ String xml = response.getText();
+ System.out.println(xml);
+ Document messageDom = XMLParser.parse(xml);
+ InstanceDataView view = (InstanceDataView)controller.getView(InstanceDataView.ID);
+ view.update(id, messageDom);
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstanceDetailAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstanceDetailAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstanceDetailAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import com.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Controller;
+import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+import org.jboss.bpm.console.client.process.events.InstanceEvent;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class UpdateInstanceDetailAction implements ActionInterface
+{
+ public final static String ID = UpdateInstanceDetailAction.class.getName();
+
+ public void execute(Controller controller, Object object)
+ {
+ InstanceEvent event = (InstanceEvent)object;
+
+ InstanceDetailView view = (InstanceDetailView)controller.getView(InstanceDetailView.ID);
+
+ if(event.getInstance()!=null)
+ view.update(event.getDefinition(), event.getInstance());
+ else
+ view.clearView();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstancesAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstancesAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstancesAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.google.gwt.json.client.JSONParser;
+import com.google.gwt.json.client.JSONValue;
+import com.mvc4g.client.Controller;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.model.DTOParser;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+
+import java.util.List;
+
+/**
+ * Loads a process instance list and updates
+ * {@link org.jboss.bpm.console.client.process.InstanceListView}.<br>
+ * Triggered by {@link org.jboss.bpm.console.client.model.ProcessDefinitionRef}.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class UpdateInstancesAction extends AbstractRESTAction
+{
+ public final static String ID = UpdateInstancesAction.class.getName();
+
+ public UpdateInstancesAction(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ final ProcessDefinitionRef def = (ProcessDefinitionRef)event;
+ return appContext.getUrlBuilder().getProcessInstancesURL(def.getId());
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.GET;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ final ProcessDefinitionRef def = (ProcessDefinitionRef)event;
+ JSONValue json = JSONParser.parse(response.getText());
+
+ List<ProcessInstanceRef> instances = DTOParser.parseProcessInstances(json);
+ InstanceListView view = (InstanceListView) controller.getView(InstanceListView.ID);
+ view.update(def, instances);
+
+ ConsoleLog.info("Loaded " + instances.size() + " process instance(s)");
+
+ }
+
+}
+
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateProcessDetailAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateProcessDetailAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateProcessDetailAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import com.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Controller;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class UpdateProcessDetailAction implements ActionInterface
+{
+ public final static String ID = UpdateProcessDetailAction.class.getName();
+
+ public void execute(Controller controller, Object object)
+ {
+ ProcessDefinitionRef process = object!=null ? (ProcessDefinitionRef)object : null;
+ ProcessDetailView view = (ProcessDetailView)controller.getView(ProcessDetailView.ID);
+
+ if(process!=null)
+ view.update(process);
+ else
+ view.clearView();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/events/ActivityDiagramResultEvent.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/events/ActivityDiagramResultEvent.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/events/ActivityDiagramResultEvent.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process.events;
+
+import java.util.List;
+
+import org.jboss.bpm.console.client.model.ActiveNodeInfo;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ActivityDiagramResultEvent
+{
+ private String imageUrl;
+ private List<ActiveNodeInfo> activeNodeInfo;
+
+ public ActivityDiagramResultEvent()
+ {
+ }
+
+ public ActivityDiagramResultEvent(String imageUrl, List<ActiveNodeInfo> activeNodeInfo)
+ {
+ this.imageUrl = imageUrl;
+ this.activeNodeInfo = activeNodeInfo;
+ }
+
+ public String getImageUrl()
+ {
+ return imageUrl;
+ }
+
+ public void setImageUrl(String imageUrl)
+ {
+ this.imageUrl = imageUrl;
+ }
+
+ public List<ActiveNodeInfo> getActiveNodeInfo()
+ {
+ return activeNodeInfo;
+ }
+
+ public void setActiveNodeInfo(List<ActiveNodeInfo> activeNodeInfo)
+ {
+ this.activeNodeInfo = activeNodeInfo;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/events/InstanceEvent.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/events/InstanceEvent.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/events/InstanceEvent.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process.events;
+
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class InstanceEvent
+{
+ private ProcessDefinitionRef definition;
+ private ProcessInstanceRef instance;
+
+ public InstanceEvent(ProcessDefinitionRef definition, ProcessInstanceRef instance)
+ {
+ this.definition = definition;
+ this.instance = instance;
+ }
+
+ public ProcessDefinitionRef getDefinition()
+ {
+ return definition;
+ }
+
+ public ProcessInstanceRef getInstance()
+ {
+ return instance;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/RenderDispatchEvent.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/RenderDispatchEvent.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/RenderDispatchEvent.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.report;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public final class RenderDispatchEvent
+{
+ String targetView;
+ String dispatchUrl;
+
+ public RenderDispatchEvent(String targetView, String dispatchUrl)
+ {
+ this.targetView = targetView;
+ this.dispatchUrl = dispatchUrl;
+ }
+
+ public String getTargetView()
+ {
+ return targetView;
+ }
+
+ public String getDispatchUrl()
+ {
+ return dispatchUrl;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/RenderReportAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/RenderReportAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/RenderReportAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,146 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.report;
+
+import com.google.gwt.http.client.*;
+import com.google.gwt.user.client.Timer;
+import com.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Controller;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.LoadingStatusAction;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+
+import java.io.IOException;
+
+/**
+ * Engage a report generation and update {@link org.jboss.bpm.console.client.report.ReportView}
+ * when the report is finished.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class RenderReportAction implements ActionInterface
+{
+
+ public final static String ID = RenderReportAction.class.getName();
+
+ private ApplicationContext appContext;
+
+ public RenderReportAction(ApplicationContext appContext)
+ {
+ this.appContext = appContext;
+ }
+
+ public void execute(final Controller controller, Object object)
+ {
+ final RenderDispatchEvent event = (RenderDispatchEvent)object;
+
+ final String url = event.getDispatchUrl();
+ RequestBuilder builder = new RequestBuilder(
+ RequestBuilder.GET, url);
+
+ ConsoleLog.debug(RequestBuilder.GET +": " + url);
+ final ReportView view = (ReportView)controller.getView(event.getTargetView());
+
+ try
+ {
+ controller.handleEvent( LoadingStatusAction.ON );
+ view.setLoading(true);
+
+ final Request request = builder.sendRequest(null,
+ new RequestCallback()
+ {
+ public void onError(Request request, Throwable exception) {
+ // Couldn't connect to server (could be timeout, SOP violation, etc.)
+ handleError(url, exception);
+ controller.handleEvent( LoadingStatusAction.OFF );
+ }
+
+ public void onResponseReceived(Request request, Response response) {
+ try
+ {
+ if (200 == response.getStatusCode())
+ {
+ // update view
+
+ view.update(event.getDispatchUrl());
+ }
+ else
+ {
+ final String msg = response.getText().equals("") ? "Unknown error" : response.getText();
+ handleError(
+ url,
+ new RequestException("HTTP "+ response.getStatusCode()+ ": " + msg)
+ );
+ }
+ }
+ finally
+ {
+ controller.handleEvent( LoadingStatusAction.OFF );
+ view.setLoading(false);
+ }
+ }
+ }
+ );
+
+ // Timer to handle pending request
+ Timer t = new Timer() {
+
+ public void run()
+ {
+ if(request.isPending())
+ {
+ request.cancel();
+ handleError(
+ url,
+ new IOException("Request timeout")
+ );
+ }
+
+ }
+ };
+ t.schedule(20000);
+
+ }
+ catch (RequestException e)
+ {
+ // Couldn't connect to server
+ handleError(url, e);
+ controller.handleEvent( LoadingStatusAction.OFF );
+ view.setLoading(false);
+ }
+ }
+
+ protected void handleError(String url, Throwable t)
+ {
+ final String out =
+ "<ul>"+
+ "<li>URL: '" + url + "'\n"+
+ "<li>Action: '" + ID + "'\n" +
+ "<li>Exception: '" + t.getClass() +"'"+
+ "</ul>\n\n"+
+ t.getMessage();
+
+ ConsoleLog.error(out, t);
+ appContext.displayMessage(out, true);
+
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,141 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.report;
+
+import org.jboss.bpm.console.client.Editor;
+import org.jboss.bpm.console.client.MenuSection;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.LazyPanel;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
+import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
+import org.gwt.mosaic.ui.client.layout.BorderLayout;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.TabListener;
+import com.google.gwt.user.client.ui.SourcesTabEvents;
+import com.mvc4g.client.ActionInterface;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ReportEditor extends Editor
+{
+ public final static String ID = ReportEditor.class.getName();
+
+ private DecoratedTabLayoutPanel tabPanel;
+
+ public ReportEditor(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public void initialize()
+ {
+ if(!isInitialized())
+ {
+ tabPanel = new DecoratedTabLayoutPanel();
+ tabPanel.setPadding(5);
+ tabPanel.addTabListener(
+ new TabListener()
+ {
+ public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ boolean showTab = true;
+
+ if(i!=0)
+ {
+ /*DefinitionListView view = ((DefinitionListView) controller.getView(DefinitionListView.ID));
+ boolean hasSelection = view.getSelection() != null;
+ if(!hasSelection)
+ {
+ MessageBox.alert("Missing selection", "Please select a process");
+ showTab=false;
+ } */
+ }
+
+ return showTab;
+ }
+
+ public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
+ if(!lazyPanel.isInitialized())
+ {
+ lazyPanel.initialize();
+ appContext.refreshView(); // TODO: hack around rendering problems
+ }
+ }
+ }
+ );
+
+ this.add(tabPanel, new BorderLayoutData(BorderLayout.Region.CENTER));
+
+ // create and register views
+ registerView(ReportView.ID, new ReportView(appContext));
+
+ // create and register actions
+ //registerAction(UpdateDefinitionsAction.ID, new UpdateDefinitionsAction(appContext));
+
+ // display tab, needs to visible for correct rendering
+ tabPanel.selectTab(0);
+
+ appContext.refreshView();
+ this.isInitialized = true;
+ }
+ }
+
+ private void registerView(String id, AbstractView view)
+ {
+ // register view with controller
+ super.controller.addView(id, view);
+
+ // add to tab layout
+ this.tabPanel.add(view, view.getIconTitle(), true);
+ }
+
+ private void registerAction(String name, ActionInterface action)
+ {
+ super.controller.addAction(name, action);
+ }
+
+ public String getEditorId()
+ {
+ return ID;
+ }
+
+ public String getTitle()
+ {
+ return "Reporting";
+ }
+
+ public MenuSection provideMenuSection()
+ {
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+
+ return new MenuSection(
+ "Reporting",
+ icons.reportIcon(),
+ new ReportEditorNavigation(appContext)
+ );
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditorNavigation.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditorNavigation.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditorNavigation.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.report;
+
+import com.google.gwt.user.client.ui.Tree;
+import com.google.gwt.user.client.ui.TreeItem;
+import com.google.gwt.user.client.ui.TreeListener;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.Workspace;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+class ReportEditorNavigation extends Tree
+{
+ public ReportEditorNavigation(final ApplicationContext appContext)
+ {
+ super.setTitle("Reporting");
+
+ TreeItem root = addItem("Available Reports");
+ TreeItem definitions = root.addItem("Processes");
+
+ addTreeListener(
+ new TreeListener()
+ {
+ public void onTreeItemSelected(TreeItem treeItem)
+ {
+ if("Processes".equals(treeItem.getText()))
+ {
+ Workspace workspace = appContext.getWorkpace();
+ workspace.showEditor(ReportEditor.ID);
+ }
+ }
+
+ public void onTreeItemStateChanged(TreeItem treeItem)
+ {
+
+ }
+ }
+ );
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportView.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportView.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,253 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.report;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Timer;
+import com.google.gwt.user.client.ui.Frame;
+import com.google.gwt.user.client.ui.MenuBar;
+import com.google.gwt.user.client.ui.Widget;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.PopupMenu;
+import org.gwt.mosaic.ui.client.ToolBar;
+import org.gwt.mosaic.ui.client.ToolButton;
+import org.gwt.mosaic.ui.client.Label;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.jboss.bpm.console.client.search.SearchDefinitionView;
+import org.jboss.bpm.console.client.search.SearchDelegate;
+import org.jboss.bpm.console.client.search.SearchWindow;
+import org.jboss.bpm.console.client.search.UpdateSearchDefinitionsAction;
+
+import java.util.Date;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ReportView extends AbstractView
+{
+ public final static String ID = ReportView.class.getName();
+
+ private Controller controller;
+ private boolean isInitialized;
+ private ApplicationContext appContext;
+ private LayoutPanel layout;
+ private Frame frame;
+
+ private SearchDefinitionView search;
+
+ private LayoutPanel loadingPanel;
+
+ public ReportView(ApplicationContext appContext)
+ {
+ super();
+ this.appContext = appContext;
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+ setTitle("Process Reports");
+ setIcon(icons.reportIcon());
+ }
+
+ public boolean isInitialized()
+ {
+ return isInitialized;
+ }
+
+ public void initialize()
+ {
+ if(!isInitialized)
+ {
+
+ // layout
+ layout = new LayoutPanel( new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ layout.setPadding(0);
+ layout.setWidgetSpacing(0);
+
+ // search capabilities
+ search = new SearchDefinitionView(
+ appContext,
+ new SearchDelegate()
+ {
+ public void handleResult(String procDefId)
+ {
+ String reportUrl = appContext.getUrlBuilder().getProcessSummaryReportUrl(procDefId);
+
+ // load report
+ controller.handleEvent(
+ new Event(RenderReportAction.ID,
+ new RenderDispatchEvent(
+ ReportView.ID, reportUrl
+ )
+ )
+ );
+ }
+
+ public String getActionName()
+ {
+ return "Open report";
+ }
+ }
+ );
+
+
+ // report frame
+ frame = new Frame();
+ DOM.setStyleAttribute(frame.getElement(), "border", "none");
+
+ // toolbar
+ final LayoutPanel toolBox = new LayoutPanel();
+ toolBox.setPadding(0);
+ toolBox.setWidgetSpacing(5);
+ //toolBox.setLayout(new BoxLayout(BoxLayout.Orientation.VERTICAL));
+
+ final ToolBar toolBar = new ToolBar();
+ toolBar.add(createMenuBtn());
+ toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ // loading panel
+ loadingPanel = new LayoutPanel();
+ loadingPanel.add(new Label("Loading, please wait..."));
+ loadingPanel.setVisible(false);
+
+ // assembly
+ layout.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+ layout.add(loadingPanel, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+ layout.add(frame, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ this.add(layout);
+
+ // views and actions
+ controller.addView(
+ "report.definition.search", search
+ );
+
+ controller.addAction(UpdateSearchDefinitionsAction.ID, new UpdateSearchDefinitionsAction(appContext));
+ controller.addAction(RenderReportAction.ID, new RenderReportAction(appContext));
+
+ // initial report
+ controller.handleEvent(
+ new Event(RenderReportAction.ID,
+ new RenderDispatchEvent(
+ ReportView.ID, appContext.getUrlBuilder().getOverallReportUrl()
+ )
+ )
+ );
+
+ this.isInitialized = true;
+ }
+ }
+
+
+ public void onClick(Widget widget)
+ {
+ System.out.println(widget);
+ }
+
+
+ private Widget createMenuBtn()
+ {
+ // Add a menu button
+ ToolButton menuButton = new ToolButton("Available Reports");
+ menuButton.setStyle(ToolButton.ToolButtonStyle.MENU);
+
+ // Make a command that we will execute from all menu items.
+ Command cmd1 = new Command() {
+ public void execute() {
+ setFrameUrl(appContext.getUrlBuilder().getOverallReportUrl());
+ }
+ };
+
+ Command cmd2 = new Command() {
+ public void execute()
+ {
+ SearchWindow sw = new SearchWindow("Open process summary report", search);
+ sw.center();
+
+ controller.handleEvent(
+ new Event(
+ UpdateSearchDefinitionsAction.ID,
+ "report.definition.search"
+ )
+ );
+
+ }
+ };
+
+ PopupMenu menuBtnMenu = new PopupMenu();
+ menuBtnMenu.addItem("Overall System Activity", cmd1);
+ menuBtnMenu.addItem("Process Summary", cmd2);
+
+ menuButton.setMenu(menuBtnMenu);
+
+ return menuButton;
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ private void setFrameUrl(String url)
+ {
+ // https://jira.jboss.org/jira/browse/JBPM-2244
+ frame.getElement().setId(
+ String.valueOf( new Date().getTime())
+ );
+
+ frame.setUrl(url);
+
+ }
+
+ public void update(String reportUrl)
+ {
+ setFrameUrl(reportUrl);
+ }
+
+ void setLoading(boolean b)
+ {
+ loadingPanel.setVisible(b);
+ if(!b)
+ {
+ Timer t = new Timer()
+ {
+
+ public void run()
+ {
+ frame.setVisible(true);
+ appContext.refreshView();
+ }
+ };
+
+ t.schedule(1500);
+ }
+ else
+ {
+ frame.setVisible(false);
+ }
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchDefinitionView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchDefinitionView.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchDefinitionView.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,132 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.search;
+
+import com.google.gwt.user.client.ui.*;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.ViewInterface;
+import org.gwt.mosaic.ui.client.Label;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class SearchDefinitionView
+ extends LayoutPanel implements ViewInterface
+{
+
+ private Controller controller;
+ private ApplicationContext appContext;
+ private SearchDelegate delegate;
+ private SuggestBox suggestBox;
+
+ private String selection = null;
+
+ private SearchWindow parent;
+
+ public SearchDefinitionView(ApplicationContext appContext, SearchDelegate delegate)
+ {
+ super(new BoxLayout(BoxLayout.Orientation.VERTICAL));
+
+ this.appContext = appContext;
+ this.delegate = delegate;
+ this.setPadding(5);
+
+ this.add(new Label("Loading, please wait..."));
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ private MultiWordSuggestOracle createOracle(List<ProcessDefinitionRef> definitions)
+ {
+ MultiWordSuggestOracle oracle = new MultiWordSuggestOracle();
+
+ for(ProcessDefinitionRef p : definitions)
+ {
+ oracle.add(p.getId());
+ }
+
+ return oracle;
+ }
+
+ public void update(List<ProcessDefinitionRef> definitions)
+ {
+ this.clear();
+ this.selection = null;
+
+ Label desc = new Label("Please enter a process definition ID");
+ //desc.setStyleName("bpm-label-header");
+ this.add(desc, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ suggestBox = new SuggestBox(
+ createOracle(definitions)
+ );
+
+ suggestBox.addEventHandler(
+ new SuggestionHandler()
+ {
+ public void onSuggestionSelected(SuggestionEvent suggestionEvent)
+ {
+ selection = suggestionEvent.getSelectedSuggestion().getReplacementString();
+ }
+ }
+ );
+
+ this.add(suggestBox);
+
+ Grid g = new Grid(2,2);
+ g.setWidget(0,0, new Label("ID: "));
+ g.setWidget(0,1, suggestBox);
+
+ Button button = new Button(delegate.getActionName(),
+ new ClickListener()
+ {
+ public void onClick(Widget widget)
+ {
+ if(selection!=null)
+ {
+ delegate.handleResult(selection);
+ parent.close();
+ }
+ }
+ });
+
+ g.setWidget(1,1, button);
+ this.add(g, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ invalidate();
+ }
+
+ void setParent(SearchWindow window)
+ {
+ this.parent = window;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchDelegate.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchDelegate.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchDelegate.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.search;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public interface SearchDelegate
+{
+ void handleResult(String procDefId);
+
+ String getActionName();
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchWindow.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchWindow.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchWindow.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.search;
+
+import com.google.gwt.user.client.WindowCloseListener;
+import org.gwt.mosaic.ui.client.WindowPanel;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class SearchWindow
+{
+ private WindowPanel window;
+
+ public SearchWindow(String title, SearchDefinitionView view)
+ {
+ view.setParent(this);
+ createLayoutWindowPanel(title, view);
+
+ }
+
+ /**
+ * The 'layout' window panel.
+ */
+ private void createLayoutWindowPanel(String title, SearchDefinitionView view) {
+ window = new WindowPanel(title);
+ window.setAnimationEnabled(true);
+ window.setSize("250px", "160px");
+
+ window.setWidget(view);
+
+ window.addWindowCloseListener(new WindowCloseListener() {
+ public void onWindowClosed() {
+ window = null;
+ }
+
+ public String onWindowClosing() {
+ return null;
+ }
+ });
+ }
+
+ public void center()
+ {
+ window.center();
+ }
+
+ public void close()
+ {
+ window.hide();
+ window = null;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/UpdateSearchDefinitionsAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/UpdateSearchDefinitionsAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/UpdateSearchDefinitionsAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.search;
+
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.google.gwt.json.client.JSONParser;
+import com.google.gwt.json.client.JSONValue;
+import com.mvc4g.client.Controller;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.model.DTOParser;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+
+import java.util.List;
+
+/**
+ * Loads a process definition list
+ * and updates a search view.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class UpdateSearchDefinitionsAction extends AbstractRESTAction
+{
+ public final static String ID = UpdateSearchDefinitionsAction.class.getName();
+
+ public UpdateSearchDefinitionsAction(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ return appContext.getUrlBuilder().getProcessDefinitionsURL();
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.GET;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ String target = (String)event;
+
+ JSONValue json = JSONParser.parse(response.getText());
+ List<ProcessDefinitionRef> definitions = DTOParser.parseProcessDefinitions(json);
+
+ SearchDefinitionView view = (SearchDefinitionView)controller.getView(target);
+ view.update(definitions);
+
+ ConsoleLog.info("Loaded " + definitions.size() + " process definitions");
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AbstractTaskList.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AbstractTaskList.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AbstractTaskList.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task;
+
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.gwt.mosaic.ui.client.list.DefaultListModel;
+import org.gwt.mosaic.ui.client.ListBox;
+import org.jboss.bpm.console.client.LazyPanel;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.bpm.console.client.model.TaskRef;
+import com.mvc4g.client.ViewInterface;
+import com.mvc4g.client.Controller;
+
+import java.util.List;
+
+/**
+ * Base class for task lists.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public abstract class AbstractTaskList extends AbstractView
+{
+ protected Controller controller;
+ protected LayoutPanel taskList = null;
+ protected ListBox<TaskRef> listBox;
+ protected boolean isInitialized;
+ protected String identity;
+
+ public AbstractTaskList()
+ {
+ super();
+ }
+
+ public boolean isInitialized()
+ {
+ return isInitialized;
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public abstract void update(String identity, List<TaskRef> tasks);
+
+ public TaskRef getSelection()
+ {
+ TaskRef selection = null;
+ if(isInitialized() && listBox.getSelectedIndex()!=-1)
+ {
+ selection = listBox.getItem( listBox.getSelectedIndex());
+ }
+ return selection;
+ }
+
+ public String getAssignedIdentity()
+ {
+ return identity;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignTaskAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignTaskAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignTaskAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task;
+
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.task.events.AssignEvent;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class AssignTaskAction extends AbstractRESTAction
+{
+
+ public final static String ID = AssignTaskAction.class.getName();
+
+ public AssignTaskAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ AssignEvent payload = (AssignEvent)event;
+ return appContext.getUrlBuilder().getTaskAssignURL(payload.getTask().getId(), payload.getIdRef());
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.POST;
+ }
+
+ public void handleSuccessfulResponse(
+ final Controller controller, final Object event, Response response)
+ {
+ // refresh all task list
+ controller.handleEvent(
+ new Event(ReloadAllTaskListsAction.ID, null)
+ );
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,307 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task;
+
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.WindowCloseListener;
+import com.google.gwt.user.client.ui.ChangeListener;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Frame;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.core.client.GWT;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.*;
+import org.gwt.mosaic.ui.client.layout.*;
+import org.gwt.mosaic.ui.client.list.DefaultListModel;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.ServerPlugins;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.jboss.bpm.console.client.model.TaskRef;
+import org.jboss.bpm.console.client.model.util.SimpleDateFormat;
+import org.jboss.bpm.console.client.task.events.TaskIdentityEvent;
+import org.jboss.bpm.console.client.task.events.DetailViewEvent;
+import org.jboss.bpm.console.client.util.WindowUtil;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+
+import java.util.List;
+import java.util.Date;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class AssignedTasksView extends AbstractTaskList
+{
+
+ public final static String ID = AssignedTasksView.class.getName();
+
+ private final ApplicationContext appContext;
+
+ private WindowPanel windowPanel;
+ private Frame frame;
+
+ private TaskDetailView detailsView;
+
+ private SimpleDateFormat dateFormat = new SimpleDateFormat();
+
+ private boolean hasDispatcherPlugin;
+
+ public AssignedTasksView(ApplicationContext appContext, TaskDetailView detailsView)
+ {
+ super();
+ this.appContext = appContext;
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+ setTitle("Personal Tasks");
+ setIcon(icons.userIcon());
+
+ this.detailsView = detailsView;
+ }
+
+ public void initialize()
+ {
+ if(!isInitialized)
+ {
+ taskList = new LayoutPanel( new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ taskList.setPadding(0);
+ taskList.setWidgetSpacing(0);
+
+ listBox =
+ new ListBox<TaskRef>(
+ new String[] {
+ "Priority", "Process", "Task Name", "Due Date"
+ }
+ );
+
+
+ listBox.setCellRenderer(new ListBox.CellRenderer<TaskRef>() {
+ public void renderCell(ListBox<TaskRef> listBox, int row, int column,
+ TaskRef item) {
+ switch (column) {
+ case 0:
+ listBox.setText(row, column, String.valueOf(item.getPriority()));
+ break;
+ case 1:
+ listBox.setText(row, column, item.getProcessId());
+ break;
+ case 2:
+ listBox.setText(row, column, item.getName());
+ break;
+ case 3:
+ String d = item.getDueDate() != null ? dateFormat.format(item.getDueDate()):"";
+ listBox.setText(row, column, d);
+ break;
+ default:
+ throw new RuntimeException("Unexpected column size");
+ }
+ }
+ });
+
+ listBox.addChangeListener(
+ new ChangeListener() {
+
+ public void onChange(Widget widget)
+ {
+ TaskRef task = getSelection(); // first call always null?
+ if(task!=null)
+ {
+ controller.handleEvent(
+ new Event(UpdateDetailsAction.ID, new DetailViewEvent("AssignedDetailView", task))
+ );
+ }
+ }
+ }
+ );
+
+ // toolbar
+ final LayoutPanel toolBox = new LayoutPanel();
+ toolBox.setPadding(0);
+ toolBox.setWidgetSpacing(5);
+ //toolBox.setLayout(new BoxLayout(BoxLayout.Orientation.VERTICAL));
+
+ final ToolBar toolBar = new ToolBar();
+ toolBar.add(
+ new ToolButton("Refresh", new ClickListener() {
+ public void onClick(Widget sender) {
+ // force loading
+ controller.handleEvent(
+ new Event(LoadTasksAction.ID, appContext.getAuthentication().getUsername())
+ );
+ }
+ }
+ )
+ );
+
+ toolBar.addSeparator();
+
+ ToolButton viewBtn = new ToolButton("View", new ClickListener()
+ {
+ public void onClick(Widget sender)
+ {
+
+ TaskRef selection = getSelection();
+
+ if (selection != null)
+ {
+ if (selection.getUrl() != null && !selection.getUrl().equals(""))
+ createTaskFormWindow(selection);
+ else
+ MessageBox.alert("Invalid operation", "The task doesn't provide a UI");
+ }
+ else
+ {
+ MessageBox.alert("Missing selection", "Please select a task");
+ }
+ }
+ }
+ );
+ toolBar.add(viewBtn);
+
+ toolBar.addSeparator();
+
+ toolBar.add(
+ new ToolButton("Release", new ClickListener() {
+ public void onClick(Widget sender) {
+
+ TaskRef selection = getSelection();
+
+ if(selection!=null)
+ {
+ TaskIdentityEvent payload = new TaskIdentityEvent(
+ null, selection
+ );
+
+ controller.handleEvent(
+ new Event(ReleaseTaskAction.ID, payload)
+ );
+ }
+ else
+ {
+ MessageBox.alert("Missing selection", "Please select a task");
+ }
+ }
+ }
+ )
+ );
+
+
+ toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ this.taskList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+ this.taskList.add(listBox, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ LayoutPanel layout = new LayoutPanel(new BorderLayout());
+ layout.add(taskList, new BorderLayoutData(BorderLayout.Region.CENTER));
+ layout.add(detailsView, new BorderLayoutData(BorderLayout.Region.SOUTH, 10 , 200));
+
+ this.add(layout);
+
+ // plugin availability
+ this.hasDispatcherPlugin =
+ ServerPlugins.has("org.jboss.bpm.console.server.plugin.FormDispatcherPlugin");
+ viewBtn.setEnabled(hasDispatcherPlugin);
+
+ isInitialized = true;
+ }
+ }
+
+ private void createTaskFormWindow(TaskRef task)
+ {
+ windowPanel = new WindowPanel("Task Interface");
+ windowPanel.setAnimationEnabled(true);
+ windowPanel.setSize("320px", "240px");
+
+ LayoutPanel layout = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ layout.setStyleName("bpm-window-layout");
+ layout.setPadding(5);
+ // info
+ Label header = new Label("Process: "+task.getProcessId()+", Task: "+task.getName());
+ header.setStyleName("bpm-label-header");
+ layout.add(header, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ // task form iframe
+
+ windowPanel.addWindowCloseListener(new WindowCloseListener() {
+ public void onWindowClosed() {
+ controller.handleEvent(
+ new Event(LoadTasksAction.ID, appContext.getAuthentication().getUsername())
+ );
+
+ windowPanel = null;
+ frame = null;
+
+ }
+
+ public String onWindowClosing() {
+ return null;
+ }
+ });
+
+ // iframe
+ frame = new Frame();
+ DOM.setStyleAttribute(frame.getElement(), "border", "none");
+
+ // https://jira.jboss.org/jira/browse/JBPM-2244
+ frame.getElement().setId(
+ String.valueOf( new Date().getTime())
+ );
+
+ ConsoleLog.debug(frame.getElement().toString());
+ frame.setUrl(task.getUrl());
+
+ layout.add(frame, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+ windowPanel.setWidget(layout);
+
+ WindowUtil.addMaximizeButton(windowPanel, Caption.CaptionRegion.RIGHT);
+ WindowUtil.addMinimizeButton(windowPanel, Caption.CaptionRegion.RIGHT);
+
+ // display
+ windowPanel.center();
+
+ }
+
+ public void update(String identity, List<TaskRef> tasks)
+ {
+
+ this.identity = identity;
+
+ // lazy init
+ initialize();
+
+ final DefaultListModel<TaskRef> model =
+ (DefaultListModel<TaskRef>) listBox.getModel();
+
+ model.clear();
+
+ for(TaskRef task : tasks)
+ {
+ if(TaskRef.STATE.ASSIGNED ==task.getCurrentState())
+ model.add(task);
+ }
+
+ // clear details
+ controller.handleEvent(
+ new Event(UpdateDetailsAction.ID, new DetailViewEvent("AssignedDetailView", null))
+ );
+
+ this.invalidate();
+ }
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ClaimTaskAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ClaimTaskAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ClaimTaskAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task;
+
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.task.events.TaskIdentityEvent;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ClaimTaskAction extends AbstractRESTAction
+{
+ public final static String ID = ClaimTaskAction.class.getName();
+
+ public ClaimTaskAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ TaskIdentityEvent claimEvent = (TaskIdentityEvent)event;
+
+ return appContext.getUrlBuilder().getTaskAssignURL(
+ claimEvent.getTask().getId(), claimEvent.getIdentity()
+ );
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.POST;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ controller.handleEvent(
+ new Event(ReloadAllTaskListsAction.ID, null)
+ );
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task;
+
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.task.events.DetailViewEvent;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.bpm.console.client.model.DTOParser;
+import org.jboss.bpm.console.client.model.TaskRef;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+
+import java.util.List;
+
+/**
+ * Loads a task list for a particular identity.
+ *
+ * @see org.jboss.bpm.console.client.task.AssignedTasksView
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class LoadTasksAction extends AbstractRESTAction
+{
+ public final static String ID = LoadTasksAction.class.getName();
+
+ public LoadTasksAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ String identity = (String)event;
+ return appContext.getUrlBuilder().getTaskListURL(identity);
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.GET;
+ }
+
+ public void handleSuccessfulResponse(
+ final Controller controller, final Object event, Response response)
+ {
+ String identity = (String)event;
+
+ List<TaskRef> tasks = DTOParser.parseTaskReferenceList(response.getText());
+ AssignedTasksView view = (AssignedTasksView)controller.getView(AssignedTasksView.ID);
+
+ view.update(identity, tasks);
+
+ ConsoleLog.info("Loaded " + tasks.size() + " tasks");
+
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksParticipationAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksParticipationAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksParticipationAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task;
+
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.task.events.DetailViewEvent;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.bpm.console.client.model.DTOParser;
+import org.jboss.bpm.console.client.model.TaskRef;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+
+import java.util.List;
+
+/**
+ * Load a task list where user participates
+ *
+ * @see OpenTasksView
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class LoadTasksParticipationAction extends AbstractRESTAction
+{
+ public final static String ID = LoadTasksParticipationAction.class.getName();
+
+ public LoadTasksParticipationAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ String identity = (String)event;
+ return appContext.getUrlBuilder().getParticipationTaskListURL(identity);
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.GET;
+ }
+
+ public void handleSuccessfulResponse(
+ final Controller controller, final Object event, Response response)
+ {
+ String identity = (String)event;
+
+ List<TaskRef> tasks = DTOParser.parseTaskReferenceList(response.getText());
+ OpenTasksView view = (OpenTasksView)controller.getView(OpenTasksView.ID);
+
+ ConsoleLog.info("Loaded " + tasks.size() + " tasks");
+ view.update(identity, tasks);
+
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,209 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.*;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.*;
+import org.gwt.mosaic.ui.client.ListBox;
+import org.gwt.mosaic.ui.client.layout.*;
+import org.gwt.mosaic.ui.client.list.DefaultListModel;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.jboss.bpm.console.client.model.TaskRef;
+import org.jboss.bpm.console.client.model.util.SimpleDateFormat;
+import org.jboss.bpm.console.client.task.events.TaskIdentityEvent;
+import org.jboss.bpm.console.client.task.events.DetailViewEvent;
+import org.jboss.bpm.console.client.ApplicationContext;
+
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+class OpenTasksView extends AbstractTaskList
+{
+
+ public final static String ID = OpenTasksView.class.getName();
+
+ private TaskDetailView detailsView;
+
+ private ApplicationContext appContext;
+
+ private SimpleDateFormat dateFormat = new SimpleDateFormat();
+
+ public OpenTasksView(ApplicationContext appContext, TaskDetailView detailView)
+ {
+ super();
+ this.appContext = appContext;
+
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+ setTitle("Group Tasks");
+ setIcon(icons.taskIcon());
+
+ this.detailsView = detailView;
+ }
+
+ public void initialize()
+ {
+ if(!isInitialized)
+ {
+ taskList = new LayoutPanel( new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ taskList.setPadding(0);
+ taskList.setWidgetSpacing(0);
+
+ listBox =
+ new ListBox<TaskRef>(
+ new String[] {
+ "Priority", "Process", "Task Name", "Status", "Due Date"}
+ );
+
+
+ listBox.setCellRenderer(new ListBox.CellRenderer<TaskRef>() {
+ public void renderCell(ListBox<TaskRef> listBox, int row, int column,
+ TaskRef item) {
+ switch (column) {
+ case 0:
+ listBox.setText(row, column, String.valueOf(item.getPriority()));
+ break;
+ case 1:
+ listBox.setText(row, column, item.getProcessId());
+ break;
+ case 2:
+ listBox.setText(row, column, item.getName());
+ break;
+ case 3:
+ listBox.setText(row, column, String.valueOf(item.getCurrentState()));
+ break;
+ case 4:
+ String d = item.getDueDate() != null ? dateFormat.format(item.getDueDate()):"";
+ listBox.setText(row, column, d);
+ break;
+ default:
+ throw new RuntimeException("Unexpected column size");
+ }
+ }
+ });
+
+
+ listBox.addChangeListener(
+ new ChangeListener() {
+
+ public void onChange(Widget widget)
+ {
+ TaskRef task = getSelection(); // first call always null?
+ if(task!=null)
+ {
+ controller.handleEvent(
+ new Event(UpdateDetailsAction.ID, new DetailViewEvent("OpenDetailView", task))
+ );
+ }
+ }
+ }
+ );
+
+ // toolbar
+ final LayoutPanel toolBox = new LayoutPanel();
+ toolBox.setPadding(0);
+ toolBox.setWidgetSpacing(5);
+
+ final ToolBar toolBar = new ToolBar();
+ toolBar.add(
+ new ToolButton("Refresh", new ClickListener() {
+ public void onClick(Widget sender) {
+ // force loading
+ controller.handleEvent(
+ new Event(LoadTasksParticipationAction.ID, getAssignedIdentity())
+ );
+ }
+ }
+ )
+ );
+
+ toolBar.addSeparator();
+
+ toolBar.add(
+ new ToolButton("Claim", new ClickListener() {
+ public void onClick(Widget sender)
+ {
+ TaskRef selection = getSelection();
+
+ if(selection!=null)
+ {
+ controller.handleEvent(
+ new Event(
+ ClaimTaskAction.ID,
+ new TaskIdentityEvent(appContext.getAuthentication().getUsername(), selection)
+ )
+ );
+ }
+ else
+ {
+ MessageBox.alert("Missing selection", "Please select a task");
+ }
+ }
+ }
+ )
+ );
+
+ toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ this.taskList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+ this.taskList.add(listBox, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ // main layout
+ LayoutPanel layout = new LayoutPanel(new BorderLayout());
+ layout.add(taskList, new BorderLayoutData(BorderLayout.Region.CENTER));
+ layout.add(detailsView, new BorderLayoutData(BorderLayout.Region.SOUTH, 10,200));
+
+ this.add(layout);
+ isInitialized = true;
+ }
+ }
+
+ public void update(String identity, List<TaskRef> tasks)
+ {
+
+ this.identity = identity;
+
+ // lazy init
+ initialize();
+
+ final DefaultListModel<TaskRef> model =
+ (DefaultListModel<TaskRef>) listBox.getModel();
+
+ model.clear();
+
+ for(TaskRef task : tasks)
+ {
+ if(TaskRef.STATE.OPEN ==task.getCurrentState())
+ model.add(task);
+ }
+
+ // details
+ controller.handleEvent(
+ new Event(UpdateDetailsAction.ID, new DetailViewEvent("OpenDetailView", null))
+ );
+
+ }
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ParticipantPanel.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ParticipantPanel.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ParticipantPanel.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,156 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task;
+
+
+import com.google.gwt.user.client.ui.*;
+import com.mvc4g.client.ViewInterface;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.ScrollLayoutPanel;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.jboss.bpm.console.client.model.ParticipantRef;
+import org.jboss.bpm.console.client.model.TaskRef;
+import org.jboss.bpm.console.client.task.events.AssignEvent;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+class ParticipantPanel extends LayoutPanel implements ViewInterface
+{
+
+ public final static String ID = ParticipantPanel.class.getName();
+
+ public final static String PARTICIPANTS = "Participants";
+ public final static String GROUPS = "Groups";
+ public final static String USERS = "Users";
+
+ private Controller controller;
+
+ private Tree tree;
+ private Button assignmentBtn;
+ private String selection = null;
+ private TaskRef currentTask;
+
+ public ParticipantPanel()
+ {
+ super(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
+ setPadding(5);
+
+ // particpants
+ ScrollLayoutPanel treePanel = new ScrollLayoutPanel();
+ tree = new Tree();
+ treePanel.add(tree);
+ this.add(treePanel, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ tree.addTreeListener(
+ new TreeListener()
+ {
+ public void onTreeItemSelected(TreeItem treeItem)
+ {
+ String name = treeItem.getText();
+ if(
+ !name.equals(PARTICIPANTS)
+ &! name.equals(GROUPS)
+ &! name.equals(USERS)
+ )
+ {
+ selection = name;
+ assignmentBtn.setEnabled(true);
+ }
+ else
+ {
+ selection = null;
+ assignmentBtn.setEnabled(false);
+ }
+ }
+
+ public void onTreeItemStateChanged(TreeItem treeItem)
+ {
+
+ }
+ }
+ );
+
+ // operations
+ assignmentBtn = new Button(
+ "Assign",
+ new ClickListener() {
+
+ public void onClick(Widget widget)
+ {
+ if(selection!=null)
+ {
+ controller.handleEvent(
+ new Event(AssignTaskAction.ID, new AssignEvent(selection, currentTask))
+ );
+ }
+ }
+ }
+ );
+
+ assignmentBtn.setStyleName("bpm-operation-ui");
+ assignmentBtn.setEnabled(false);
+ add(assignmentBtn);
+ }
+
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public void update(TaskRef task)
+ {
+ currentTask = task;
+
+ tree.clear();
+
+ TreeItem root = tree.addItem(PARTICIPANTS);
+
+ // groups
+ TreeItem groups = root.addItem(GROUPS);
+ for(ParticipantRef gref : task.getParticipantGroups())
+ {
+ groups.addItem(gref.getIdRef());
+ }
+
+ // users
+ TreeItem users = root.addItem(USERS);
+ for(ParticipantRef uref : task.getParticipantUsers())
+ {
+ users.addItem(uref.getIdRef());
+ }
+
+ root.setState(true); // open users
+
+ this.invalidate();
+ }
+
+ public void clearView()
+ {
+ tree.clear();
+ currentTask = null;
+ }
+}
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReleaseTaskAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReleaseTaskAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReleaseTaskAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task;
+
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.task.events.TaskIdentityEvent;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ReleaseTaskAction extends AbstractRESTAction
+{
+ public final static String ID = ReleaseTaskAction.class.getName();
+
+ public ReleaseTaskAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ TaskIdentityEvent tie = (TaskIdentityEvent)event;
+ return appContext.getUrlBuilder().getTaskReleaseURL(tie.getTask().getId());
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.POST;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ // force refresh reload
+ controller.handleEvent(
+ new Event(ReloadAllTaskListsAction.ID, null)
+ );
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReloadAllTaskListsAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReloadAllTaskListsAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReloadAllTaskListsAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task;
+
+import com.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.jboss.bpm.console.client.ApplicationContext;
+
+/**
+ * Reloads all task lists after assignment or completion of a task.
+
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ReloadAllTaskListsAction implements ActionInterface
+{
+
+ public final static String ID = ReloadAllTaskListsAction.class.getName();
+
+ private ApplicationContext appContext;
+
+ public ReloadAllTaskListsAction(ApplicationContext appContext)
+ {
+ this.appContext = appContext;
+ }
+
+ public void execute(Controller controller, Object object)
+ {
+ // assigned tasks
+ String currentUser = appContext.getAuthentication().getUsername();
+ controller.handleEvent(
+ new Event(LoadTasksAction.ID, currentUser)
+ );
+
+ // open tasks
+ controller.handleEvent(
+ new Event(LoadTasksParticipationAction.ID, currentUser)
+ );
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskDetailView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskDetailView.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskDetailView.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,156 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task;
+
+import com.google.gwt.user.client.ui.ChangeListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.ViewInterface;
+import org.gwt.mosaic.ui.client.Caption;
+import org.gwt.mosaic.ui.client.CaptionLayoutPanel;
+import org.gwt.mosaic.ui.client.DeckLayoutPanel;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.jboss.bpm.console.client.common.PropertyGrid;
+import org.jboss.bpm.console.client.model.TaskRef;
+import org.jboss.bpm.console.client.LazyPanel;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class TaskDetailView extends CaptionLayoutPanel
+ implements ViewInterface, LazyPanel
+{
+ public final static String ID = TaskDetailView.class.getName();
+
+ private Controller controller;
+
+ private TaskRef currentTask = null;
+
+ private PropertyGrid grid;
+ private ParticipantPanel participantPanel;
+
+ private boolean openView;
+
+ private boolean initialzed;
+
+ public TaskDetailView(boolean openView)
+ {
+
+ // render
+ super("Task details");
+
+ super.setStyleName("bpm-detail-panel");
+
+ this.openView = openView;
+
+ }
+
+ public boolean isInitialized()
+ {
+ return initialzed;
+ }
+
+ public void initialize()
+ {
+ if(!this.initialzed)
+ {
+
+ grid = new PropertyGrid(
+ new String[] {"ID:", "Process:", "Name:", "Assignee:", "Description:"}
+ );
+
+ if(openView)
+ {
+ // properties
+ final DeckLayoutPanel deck = new DeckLayoutPanel();
+ deck.add(grid);
+
+ // participants
+ participantPanel = new ParticipantPanel();
+ participantPanel.setController(controller);
+
+ // selection
+ final com.google.gwt.user.client.ui.ListBox dropBox = new com.google.gwt.user.client.ui.ListBox(false);
+ dropBox.setStyleName("bpm-operation-ui");
+ dropBox.addItem("Properties");
+ dropBox.addItem("Participants");
+ dropBox.addChangeListener(new ChangeListener() {
+ public void onChange(Widget sender) {
+ deck.showWidget(dropBox.getSelectedIndex());
+ deck.layout();
+ }
+ });
+
+ deck.add(participantPanel);
+
+ this.getHeader().add(dropBox, Caption.CaptionRegion.RIGHT);
+ this.add(deck, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ deck.showWidget(dropBox.getSelectedIndex());
+ }
+ else
+ {
+ LayoutPanel p = new LayoutPanel();
+ p.add(grid);
+ this.add(p);
+ }
+
+ this.initialzed = true;
+ }
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public void update(TaskRef task)
+ {
+ String description = task.getDescription()!=null? task.getDescription():"";
+
+ String[] values = new String[] {
+ String.valueOf(task.getId()),
+ task.getProcessId(),
+ task.getName(),
+ task.getAssignee(),
+ description
+ };
+
+ grid.update(values);
+
+ if(openView && participantPanel !=null)
+ participantPanel.update(task);
+ }
+
+ public void clearView()
+ {
+ grid.clear();
+
+ if(openView && participantPanel !=null) // event handling is broken. The change listener fires too early
+ participantPanel.clearView();
+
+ currentTask = null;
+ }
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,153 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.SourcesTabEvents;
+import com.google.gwt.user.client.ui.TabListener;
+import com.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
+import org.gwt.mosaic.ui.client.TabLayoutPanel;
+import org.gwt.mosaic.ui.client.layout.BorderLayout;
+import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.Editor;
+import org.jboss.bpm.console.client.LazyPanel;
+import org.jboss.bpm.console.client.MenuSection;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class TaskEditor extends Editor
+{
+ public final static String ID = TaskEditor.class.getName();
+
+ private TabLayoutPanel tabPanel;
+
+ public TaskEditor(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public void initialize()
+ {
+ if(!isInitialized)
+ {
+ // create inner tab layout
+ tabPanel = new DecoratedTabLayoutPanel();
+ tabPanel.setPadding(5);
+ tabPanel.addTabListener(
+ new TabListener()
+ {
+ public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ return true;
+ }
+
+ public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
+ if(!lazyPanel.isInitialized())
+ {
+ lazyPanel.initialize();
+ appContext.refreshView(); // TODO: hack around rendering problems
+ }
+ }
+ }
+ );
+
+ this.add(tabPanel, new BorderLayoutData(BorderLayout.Region.CENTER));
+
+ TaskDetailView openDetailView = new TaskDetailView(true);
+ TaskDetailView assignedDetailView = new TaskDetailView(false);
+
+ // create and register views
+ controller.addView("OpenDetailView", openDetailView);
+ controller.addView("AssignedDetailView", assignedDetailView);
+
+ openDetailView.initialize();
+ assignedDetailView.initialize();
+
+ registerView(OpenTasksView.ID, new OpenTasksView(appContext, openDetailView));
+ registerView(AssignedTasksView.ID, new AssignedTasksView(appContext, assignedDetailView));
+
+ // create and register actions
+ registerAction(LoadTasksAction.ID, new LoadTasksAction(appContext));
+ registerAction(LoadTasksParticipationAction.ID, new LoadTasksParticipationAction(appContext));
+ registerAction(ClaimTaskAction.ID, new ClaimTaskAction(appContext));
+ registerAction(ReleaseTaskAction.ID, new ReleaseTaskAction(appContext));
+ registerAction(UpdateDetailsAction.ID, new UpdateDetailsAction());
+ registerAction(AssignTaskAction.ID, new AssignTaskAction(appContext));
+ registerAction(ReloadAllTaskListsAction.ID, new ReloadAllTaskListsAction(appContext));
+
+ // display tab, needs to visible for correct rendering
+ tabPanel.selectTab(0);
+
+ // force loading
+ super.controller.handleEvent(
+ new Event(ReloadAllTaskListsAction.ID, null)
+ );
+
+ appContext.refreshView();
+
+ isInitialized = true;
+ }
+ }
+
+ private void registerView(String id, AbstractView view)
+ {
+ // register view with controller
+ super.controller.addView(id, view);
+
+ // add to tab layout
+ this.tabPanel.add(view, view.getIconTitle(), true);
+ }
+
+ private void registerAction(String name, ActionInterface action)
+ {
+ super.controller.addAction(name, action);
+ }
+
+ public String getEditorId()
+ {
+ return ID;
+ }
+
+ public String getTitle()
+ {
+ return "Task Management";
+ }
+
+ public MenuSection provideMenuSection()
+ {
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+
+ return new MenuSection(
+ "Tasks",
+ icons.taskIcon(),
+ new TaskEditorNavigation(appContext)
+ );
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task;
+
+import com.google.gwt.user.client.ui.Tree;
+import com.google.gwt.user.client.ui.TreeItem;
+import com.google.gwt.user.client.ui.TreeListener;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.Workspace;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+class TaskEditorNavigation extends Tree
+{
+ public TaskEditorNavigation(final ApplicationContext appContext)
+ {
+ super.setTitle("Tasks");
+
+ TreeItem root = addItem("Task Management");
+ TreeItem definitions = root.addItem("Task Lists");
+
+ addTreeListener(
+ new TreeListener()
+ {
+ public void onTreeItemSelected(TreeItem treeItem)
+ {
+ if("Task Lists".equals(treeItem.getText()))
+ {
+ Workspace workspace = appContext.getWorkpace();
+ workspace.showEditor(TaskEditor.ID);
+ }
+ }
+
+ public void onTreeItemStateChanged(TreeItem treeItem)
+ {
+
+ }
+ }
+ );
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/UpdateDetailsAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/UpdateDetailsAction.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/UpdateDetailsAction.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task;
+
+import com.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Controller;
+import org.jboss.bpm.console.client.model.TaskRef;
+import org.jboss.bpm.console.client.task.events.DetailViewEvent;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class UpdateDetailsAction implements ActionInterface
+{
+
+ public final static String ID = UpdateDetailsAction.class.getName();
+
+ public void execute(Controller controller, Object object)
+ {
+ DetailViewEvent event = (DetailViewEvent)object;
+ TaskRef task = event.getTask()!=null? event.getTask() : null;
+ TaskDetailView view = (TaskDetailView)controller.getView(event.getViewRef());
+
+ if(task!=null)
+ view.update(task);
+ else
+ view.clearView();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/events/AssignEvent.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/events/AssignEvent.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/events/AssignEvent.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task.events;
+
+import org.jboss.bpm.console.client.model.TaskRef;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public final class AssignEvent
+{
+ private String idRef;
+ private TaskRef task;
+
+ public AssignEvent(String idRef, TaskRef task)
+ {
+ this.idRef = idRef;
+ this.task = task;
+ }
+
+ public String getIdRef()
+ {
+ return idRef;
+ }
+
+ public TaskRef getTask()
+ {
+ return task;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/events/DetailViewEvent.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/events/DetailViewEvent.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/events/DetailViewEvent.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task.events;
+
+import org.jboss.bpm.console.client.model.TaskRef;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public final class DetailViewEvent
+{
+ String viewRef = null;
+ TaskRef task;
+
+ public DetailViewEvent(String viewRef, TaskRef task)
+ {
+ this.viewRef = viewRef;
+ this.task = task;
+ }
+
+ public String getViewRef()
+ {
+ return viewRef;
+ }
+
+ public TaskRef getTask()
+ {
+ return task;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/events/TaskIdentityEvent.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/events/TaskIdentityEvent.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/events/TaskIdentityEvent.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task.events;
+
+import org.jboss.bpm.console.client.model.TaskRef;
+
+/**
+ * Composite event that represents Identities working on tasks.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public final class TaskIdentityEvent
+{
+ private String identity;
+ private TaskRef task;
+
+ public TaskIdentityEvent(String identity, TaskRef task)
+ {
+ this.identity = identity;
+ this.task = task;
+ }
+
+ public String getIdentity()
+ {
+ return identity;
+ }
+
+ public TaskRef getTask()
+ {
+ return task;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/WindowUtil.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/WindowUtil.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/WindowUtil.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.util;
+
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Widget;
+import org.gwt.mosaic.ui.client.Caption;
+import org.gwt.mosaic.ui.client.ImageButton;
+import org.gwt.mosaic.ui.client.WindowPanel;
+
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class WindowUtil
+{
+ /**
+ *
+ * @param windowPanel
+ */
+ public static void addMaximizeButton(final WindowPanel windowPanel,
+ Caption.CaptionRegion captionRegion) {
+ final ImageButton maximizeBtn = new ImageButton(
+ Caption.IMAGES.windowMaximize());
+ maximizeBtn.addClickListener(new ClickListener() {
+ public void onClick(Widget sender) {
+ if (windowPanel.getWindowState() == WindowPanel.WindowState.MAXIMIZED) {
+ windowPanel.setWindowState(WindowPanel.WindowState.NORMAL);
+ } else {
+ windowPanel.setWindowState(WindowPanel.WindowState.MAXIMIZED);
+ }
+ }
+ });
+ windowPanel.addWindowStateListener(new WindowPanel.WindowStateListener() {
+ public void onWindowStateChange(WindowPanel sender) {
+ if (sender.getWindowState() == WindowPanel.WindowState.MAXIMIZED) {
+ maximizeBtn.setImage(Caption.IMAGES.windowRestore().createImage());
+ } else {
+ maximizeBtn.setImage(Caption.IMAGES.windowMaximize().createImage());
+ }
+
+ }
+ });
+ windowPanel.getHeader().add(maximizeBtn, captionRegion);
+ }
+
+ /**
+ *
+ * @param windowPanel
+ */
+ public static void addMinimizeButton(final WindowPanel windowPanel,
+ Caption.CaptionRegion captionRegion) {
+ final ImageButton minimizeBtn = new ImageButton(
+ Caption.IMAGES.windowMinimize());
+ minimizeBtn.addClickListener(new ClickListener() {
+ public void onClick(Widget sender) {
+ windowPanel.setWindowState(WindowPanel.WindowState.NORMAL);
+ }
+ });
+ windowPanel.getHeader().add(minimizeBtn, captionRegion);
+ }
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,187 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.rebind;
+
+import com.google.gwt.core.ext.Generator;
+import com.google.gwt.core.ext.TreeLogger;
+import com.google.gwt.core.ext.GeneratorContext;
+import com.google.gwt.core.ext.UnableToCompleteException;
+import com.google.gwt.core.ext.typeinfo.TypeOracle;
+import com.google.gwt.core.ext.typeinfo.JClassType;
+import com.google.gwt.user.rebind.ClassSourceFileComposerFactory;
+import com.google.gwt.user.rebind.SourceWriter;
+
+import java.io.*;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class WorkspaceGenerator extends Generator
+{
+ /**
+ * Simple name of class to be generated
+ */
+ private String className = null;
+ /**
+ * Package name of class to be generated
+ */
+ private String packageName = null;
+ /**
+ * Fully qualified class name passed into GWT.create()
+ */
+ private String typeName = null;
+
+ public static final String WORKSPACE_CONFIG_DEFAULT = "org/jboss/bpm/console/workspace-default.cfg";
+ public static final String WORKSPACE_CONFIG = "org/jboss/bpm/console/workspace.cfg";
+
+ public String generate(TreeLogger logger, GeneratorContext context, String typeName)
+ throws UnableToCompleteException
+ {
+ this.typeName = typeName;
+ TypeOracle typeOracle = context.getTypeOracle();
+
+ try
+ {
+ // get classType and save instance variables
+ JClassType classType = typeOracle.getType(typeName);
+ packageName = classType.getPackage().getName();
+ className = classType.getSimpleSourceName() + "Wrapper";
+
+ // Generate class source code
+ generateClass(logger, context);
+
+ }
+ catch (Exception e)
+ {
+ // record to logger that Map generation threw an exception
+ e.printStackTrace(System.out);
+ logger.log(TreeLogger.ERROR, "Failed to generate workspace launcher", e);
+ }
+
+ // return the fully qualifed name of the class generated
+ return packageName + "." + className;
+ }
+
+ /**
+ * Generate source code for new class. Class extends
+ * <code>HashMap</code>.
+ *
+ * @param logger Logger object
+ * @param context Generator context
+ */
+ private void generateClass(TreeLogger logger, GeneratorContext
+ context)
+ {
+
+ // get print writer that receives the source code
+ PrintWriter printWriter = null;
+ printWriter = context.tryCreate(logger, packageName, className);
+
+ // print writer if null, source code has ALREADY been generated, return
+ if (printWriter == null) return;
+
+ // init composer, set class properties, create source writer
+ ClassSourceFileComposerFactory composerFactory =
+ new ClassSourceFileComposerFactory(packageName, className);
+
+ // Imports
+ composerFactory.addImport("org.jboss.bpm.console.client.ApplicationContext");
+ composerFactory.addImport("org.jboss.bpm.console.client.Workspace");
+ composerFactory.addImport("org.jboss.bpm.console.client.WorkspaceLauncher");
+
+ // Interfaces
+ composerFactory.addImplementedInterface("org.jboss.bpm.console.client.WorkspaceLauncher");
+
+ // SourceWriter
+ SourceWriter sourceWriter = composerFactory.createSourceWriter(context, printWriter);
+
+ // Methods
+ generateMethods(sourceWriter);
+
+ // close generated class
+ sourceWriter.outdent();
+ sourceWriter.println("}");
+
+ // commit generated class
+ context.commit(logger, printWriter);
+ }
+
+ private void generateMethods(SourceWriter sourceWriter)
+ {
+ // start constructor source generation
+ sourceWriter.println("public void launch(ApplicationContext appContext, Workspace workspace) { ");
+ sourceWriter.indent();
+
+ InputStream in = getClass().getClassLoader().getResourceAsStream(WORKSPACE_CONFIG);
+
+ if (null == in)
+ {
+ in = getClass().getClassLoader().getResourceAsStream(WORKSPACE_CONFIG_DEFAULT);
+ if(null==in)
+ throw new RuntimeException("Cannot find '"+WORKSPACE_CONFIG+"' or '"+WORKSPACE_CONFIG_DEFAULT+"'");
+ }
+
+ try
+ {
+ //use buffering, reading one line at a time
+ //FileReader always assumes default encoding is OK!
+ BufferedReader input = new BufferedReader(new InputStreamReader(in));
+ try
+ {
+ String line = null;
+ while ((line = input.readLine()) != null)
+ {
+
+ // ignore comments and empty lines
+ if (line.equals("") || line.startsWith("#"))
+ continue;
+
+ sourceWriter.println("workspace.addEditor( new " + line + "(appContext), false );");
+ }
+ }
+ finally
+ {
+ input.close();
+ }
+ }
+ catch (IOException ex)
+ {
+ throw new RuntimeException("Error reading '"+WORKSPACE_CONFIG+"'");
+ }
+
+ // end constructor source generation
+ sourceWriter.outdent();
+ sourceWriter.println("}");
+ }
+
+ /*private void generateConstructor(SourceWriter sourceWriter)
+ {
+ // start constructor source generation
+ sourceWriter.println("public " + className + "() { ");
+ sourceWriter.indent();
+ sourceWriter.println("super();");
+ // end constructor source generation
+ sourceWriter.outdent();
+ sourceWriter.println("}");
+ }*/
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/json/CDL.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/json/CDL.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/json/CDL.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,310 @@
+package org.json;
+
+/*
+Copyright (c) 2002 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+/**
+ * This provides static methods to convert comma delimited text into a
+ * JSONArray, and to covert a JSONArray into comma delimited text. Comma
+ * delimited text is a very popular format for data interchange. It is
+ * understood by most database, spreadsheet, and organizer programs.
+ * <p/>
+ * Each row of text represents a row in a table or a data record. Each row
+ * ends with a NEWLINE character. Each row contains one or more values.
+ * Values are separated by commas. A value can contain any character except
+ * for comma, unless is is wrapped in single quotes or double quotes.
+ * <p/>
+ * The first row usually contains the names of the columns.
+ * <p/>
+ * A comma delimited list can be converted into a JSONArray of JSONObjects.
+ * The names for the elements in the JSONObjects can be taken from the names
+ * in the first row.
+ *
+ * @author JSON.org
+ * @version 2008-09-18
+ */
+public class CDL
+{
+
+ /**
+ * Get the next value. The value can be wrapped in quotes. The value can
+ * be empty.
+ *
+ * @param x A JSONTokener of the source text.
+ * @return The value string, or null if empty.
+ * @throws JSONException if the quoted string is badly formed.
+ */
+ private static String getValue(JSONTokener x) throws JSONException
+ {
+ char c;
+ do
+ {
+ c = x.next();
+ }
+ while (c == ' ' || c == '\t');
+ switch (c)
+ {
+ case 0:
+ return null;
+ case'"':
+ case'\'':
+ return x.nextString(c);
+ case',':
+ x.back();
+ return "";
+ default:
+ x.back();
+ return x.nextTo(',');
+ }
+ }
+
+ /**
+ * Produce a JSONArray of strings from a row of comma delimited values.
+ *
+ * @param x A JSONTokener of the source text.
+ * @return A JSONArray of strings.
+ * @throws JSONException
+ */
+ public static JSONArray rowToJSONArray(JSONTokener x) throws JSONException
+ {
+ JSONArray ja = new JSONArray();
+ for (; ;)
+ {
+ String value = getValue(x);
+ if (value == null || (ja.length() == 0 && value.length() == 0))
+ {
+ return null;
+ }
+ ja.put(value);
+ for (; ;)
+ {
+ char c = x.next();
+ if (c == ',')
+ {
+ break;
+ }
+ if (c != ' ')
+ {
+ if (c == '\n' || c == '\r' || c == 0)
+ {
+ return ja;
+ }
+ throw x.syntaxError("Bad character '" + c + "' (" +
+ (int) c + ").");
+ }
+ }
+ }
+ }
+
+ /**
+ * Produce a JSONObject from a row of comma delimited text, using a
+ * parallel JSONArray of strings to provides the names of the elements.
+ *
+ * @param names A JSONArray of names. This is commonly obtained from the
+ * first row of a comma delimited text file using the rowToJSONArray
+ * method.
+ * @param x A JSONTokener of the source text.
+ * @return A JSONObject combining the names and values.
+ * @throws JSONException
+ */
+ public static JSONObject rowToJSONObject(JSONArray names, JSONTokener x)
+ throws JSONException
+ {
+ JSONArray ja = rowToJSONArray(x);
+ return ja != null ? ja.toJSONObject(names) : null;
+ }
+
+ /**
+ * Produce a JSONArray of JSONObjects from a comma delimited text string,
+ * using the first row as a source of names.
+ *
+ * @param string The comma delimited text.
+ * @return A JSONArray of JSONObjects.
+ * @throws JSONException
+ */
+ public static JSONArray toJSONArray(String string) throws JSONException
+ {
+ return toJSONArray(new JSONTokener(string));
+ }
+
+ /**
+ * Produce a JSONArray of JSONObjects from a comma delimited text string,
+ * using the first row as a source of names.
+ *
+ * @param x The JSONTokener containing the comma delimited text.
+ * @return A JSONArray of JSONObjects.
+ * @throws JSONException
+ */
+ public static JSONArray toJSONArray(JSONTokener x) throws JSONException
+ {
+ return toJSONArray(rowToJSONArray(x), x);
+ }
+
+ /**
+ * Produce a JSONArray of JSONObjects from a comma delimited text string
+ * using a supplied JSONArray as the source of element names.
+ *
+ * @param names A JSONArray of strings.
+ * @param string The comma delimited text.
+ * @return A JSONArray of JSONObjects.
+ * @throws JSONException
+ */
+ public static JSONArray toJSONArray(JSONArray names, String string)
+ throws JSONException
+ {
+ return toJSONArray(names, new JSONTokener(string));
+ }
+
+ /**
+ * Produce a JSONArray of JSONObjects from a comma delimited text string
+ * using a supplied JSONArray as the source of element names.
+ *
+ * @param names A JSONArray of strings.
+ * @param x A JSONTokener of the source text.
+ * @return A JSONArray of JSONObjects.
+ * @throws JSONException
+ */
+ public static JSONArray toJSONArray(JSONArray names, JSONTokener x)
+ throws JSONException
+ {
+ if (names == null || names.length() == 0)
+ {
+ return null;
+ }
+ JSONArray ja = new JSONArray();
+ for (; ;)
+ {
+ JSONObject jo = rowToJSONObject(names, x);
+ if (jo == null)
+ {
+ break;
+ }
+ ja.put(jo);
+ }
+ if (ja.length() == 0)
+ {
+ return null;
+ }
+ return ja;
+ }
+
+
+ /**
+ * Produce a comma delimited text row from a JSONArray. Values containing
+ * the comma character will be quoted.
+ *
+ * @param ja A JSONArray of strings.
+ * @return A string ending in NEWLINE.
+ */
+ public static String rowToString(JSONArray ja)
+ {
+ StringBuffer sb = new StringBuffer();
+ for (int i = 0; i < ja.length(); i += 1)
+ {
+ if (i > 0)
+ {
+ sb.append(',');
+ }
+ Object o = ja.opt(i);
+ if (o != null)
+ {
+ String s = o.toString();
+ if (s.indexOf(',') >= 0)
+ {
+ if (s.indexOf('"') >= 0)
+ {
+ sb.append('\'');
+ sb.append(s);
+ sb.append('\'');
+ }
+ else
+ {
+ sb.append('"');
+ sb.append(s);
+ sb.append('"');
+ }
+ }
+ else
+ {
+ sb.append(s);
+ }
+ }
+ }
+ sb.append('\n');
+ return sb.toString();
+
+ }
+
+ /**
+ * Produce a comma delimited text from a JSONArray of JSONObjects. The
+ * first row will be a list of names obtained by inspecting the first
+ * JSONObject.
+ *
+ * @param ja A JSONArray of JSONObjects.
+ * @return A comma delimited text.
+ * @throws JSONException
+ */
+ public static String toString(JSONArray ja) throws JSONException
+ {
+ JSONObject jo = ja.optJSONObject(0);
+ if (jo != null)
+ {
+ JSONArray names = jo.names();
+ if (names != null)
+ {
+ return rowToString(names) + toString(names, ja);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Produce a comma delimited text from a JSONArray of JSONObjects using
+ * a provided list of names. The list of names is not included in the
+ * output.
+ *
+ * @param names A JSONArray of strings.
+ * @param ja A JSONArray of JSONObjects.
+ * @return A comma delimited text.
+ * @throws JSONException
+ */
+ public static String toString(JSONArray names, JSONArray ja)
+ throws JSONException
+ {
+ if (names == null || names.length() == 0)
+ {
+ return null;
+ }
+ StringBuffer sb = new StringBuffer();
+ for (int i = 0; i < ja.length(); i += 1)
+ {
+ JSONObject jo = ja.optJSONObject(i);
+ if (jo != null)
+ {
+ sb.append(rowToString(jo.toJSONArray(names)));
+ }
+ }
+ return sb.toString();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/json/Cookie.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/json/Cookie.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/json/Cookie.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,199 @@
+package org.json;
+
+/*
+Copyright (c) 2002 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+/**
+ * Convert a web browser cookie specification to a JSONObject and back.
+ * JSON and Cookies are both notations for name/value pairs.
+ *
+ * @author JSON.org
+ * @version 2008-09-18
+ */
+public class Cookie
+{
+
+ /**
+ * Produce a copy of a string in which the characters '+', '%', '=', ';'
+ * and control characters are replaced with "%hh". This is a gentle form
+ * of URL encoding, attempting to cause as little distortion to the
+ * string as possible. The characters '=' and ';' are meta characters in
+ * cookies. By convention, they are escaped using the URL-encoding. This is
+ * only a convention, not a standard. Often, cookies are expected to have
+ * encoded values. We encode '=' and ';' because we must. We encode '%' and
+ * '+' because they are meta characters in URL encoding.
+ *
+ * @param string The source string.
+ * @return The escaped result.
+ */
+ public static String escape(String string)
+ {
+ char c;
+ String s = string.trim();
+ StringBuffer sb = new StringBuffer();
+ int len = s.length();
+ for (int i = 0; i < len; i += 1)
+ {
+ c = s.charAt(i);
+ if (c < ' ' || c == '+' || c == '%' || c == '=' || c == ';')
+ {
+ sb.append('%');
+ sb.append(Character.forDigit((char) ((c >>> 4) & 0x0f), 16));
+ sb.append(Character.forDigit((char) (c & 0x0f), 16));
+ }
+ else
+ {
+ sb.append(c);
+ }
+ }
+ return sb.toString();
+ }
+
+
+ /**
+ * Convert a cookie specification string into a JSONObject. The string
+ * will contain a name value pair separated by '='. The name and the value
+ * will be unescaped, possibly converting '+' and '%' sequences. The
+ * cookie properties may follow, separated by ';', also represented as
+ * name=value (except the secure property, which does not have a value).
+ * The name will be stored under the key "name", and the value will be
+ * stored under the key "value". This method does not do checking or
+ * validation of the parameters. It only converts the cookie string into
+ * a JSONObject.
+ *
+ * @param string The cookie specification string.
+ * @return A JSONObject containing "name", "value", and possibly other
+ * members.
+ * @throws JSONException
+ */
+ public static JSONObject toJSONObject(String string) throws JSONException
+ {
+ String n;
+ JSONObject o = new JSONObject();
+ Object v;
+ JSONTokener x = new JSONTokener(string);
+ o.put("name", x.nextTo('='));
+ x.next('=');
+ o.put("value", x.nextTo(';'));
+ x.next();
+ while (x.more())
+ {
+ n = unescape(x.nextTo("=;"));
+ if (x.next() != '=')
+ {
+ if (n.equals("secure"))
+ {
+ v = Boolean.TRUE;
+ }
+ else
+ {
+ throw x.syntaxError("Missing '=' in cookie parameter.");
+ }
+ }
+ else
+ {
+ v = unescape(x.nextTo(';'));
+ x.next();
+ }
+ o.put(n, v);
+ }
+ return o;
+ }
+
+
+ /**
+ * Convert a JSONObject into a cookie specification string. The JSONObject
+ * must contain "name" and "value" members.
+ * If the JSONObject contains "expires", "domain", "path", or "secure"
+ * members, they will be appended to the cookie specification string.
+ * All other members are ignored.
+ *
+ * @param o A JSONObject
+ * @return A cookie specification string
+ * @throws JSONException
+ */
+ public static String toString(JSONObject o) throws JSONException
+ {
+ StringBuffer sb = new StringBuffer();
+
+ sb.append(escape(o.getString("name")));
+ sb.append("=");
+ sb.append(escape(o.getString("value")));
+ if (o.has("expires"))
+ {
+ sb.append(";expires=");
+ sb.append(o.getString("expires"));
+ }
+ if (o.has("domain"))
+ {
+ sb.append(";domain=");
+ sb.append(escape(o.getString("domain")));
+ }
+ if (o.has("path"))
+ {
+ sb.append(";path=");
+ sb.append(escape(o.getString("path")));
+ }
+ if (o.optBoolean("secure"))
+ {
+ sb.append(";secure");
+ }
+ return sb.toString();
+ }
+
+ /**
+ * Convert <code>%</code><i>hh</i> sequences to single characters, and
+ * convert plus to space.
+ *
+ * @param s A string that may contain
+ * <code>+</code> <small>(plus)</small> and
+ * <code>%</code><i>hh</i> sequences.
+ * @return The unescaped string.
+ */
+ public static String unescape(String s)
+ {
+ int len = s.length();
+ StringBuffer b = new StringBuffer();
+ for (int i = 0; i < len; ++i)
+ {
+ char c = s.charAt(i);
+ if (c == '+')
+ {
+ c = ' ';
+ }
+ else if (c == '%' && i + 2 < len)
+ {
+ int d = JSONTokener.dehexchar(s.charAt(i + 1));
+ int e = JSONTokener.dehexchar(s.charAt(i + 2));
+ if (d >= 0 && e >= 0)
+ {
+ c = (char) (d * 16 + e);
+ i += 2;
+ }
+ }
+ b.append(c);
+ }
+ return b.toString();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/json/CookieList.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/json/CookieList.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/json/CookieList.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,100 @@
+package org.json;
+
+/*
+Copyright (c) 2002 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+import java.util.Iterator;
+
+/**
+ * Convert a web browser cookie list string to a JSONObject and back.
+ *
+ * @author JSON.org
+ * @version 2008-09-18
+ */
+public class CookieList
+{
+
+ /**
+ * Convert a cookie list into a JSONObject. A cookie list is a sequence
+ * of name/value pairs. The names are separated from the values by '='.
+ * The pairs are separated by ';'. The names and the values
+ * will be unescaped, possibly converting '+' and '%' sequences.
+ * <p/>
+ * To add a cookie to a cooklist,
+ * cookielistJSONObject.put(cookieJSONObject.getString("name"),
+ * cookieJSONObject.getString("value"));
+ *
+ * @param string A cookie list string
+ * @return A JSONObject
+ * @throws JSONException
+ */
+ public static JSONObject toJSONObject(String string) throws JSONException
+ {
+ JSONObject o = new JSONObject();
+ JSONTokener x = new JSONTokener(string);
+ while (x.more())
+ {
+ String name = Cookie.unescape(x.nextTo('='));
+ x.next('=');
+ o.put(name, Cookie.unescape(x.nextTo(';')));
+ x.next();
+ }
+ return o;
+ }
+
+
+ /**
+ * Convert a JSONObject into a cookie list. A cookie list is a sequence
+ * of name/value pairs. The names are separated from the values by '='.
+ * The pairs are separated by ';'. The characters '%', '+', '=', and ';'
+ * in the names and values are replaced by "%hh".
+ *
+ * @param o A JSONObject
+ * @return A cookie list string
+ * @throws JSONException
+ */
+ public static String toString(JSONObject o) throws JSONException
+ {
+ boolean b = false;
+ Iterator keys = o.keys();
+ String s;
+ StringBuffer sb = new StringBuffer();
+ while (keys.hasNext())
+ {
+ s = keys.next().toString();
+ if (!o.isNull(s))
+ {
+ if (b)
+ {
+ sb.append(';');
+ }
+ sb.append(Cookie.escape(s));
+ sb.append("=");
+ sb.append(Cookie.escape(o.getString(s)));
+ b = true;
+ }
+ }
+ return sb.toString();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/json/HTTP.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/json/HTTP.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/json/HTTP.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,182 @@
+package org.json;
+
+/*
+Copyright (c) 2002 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+import java.util.Iterator;
+
+/**
+ * Convert an HTTP header to a JSONObject and back.
+ *
+ * @author JSON.org
+ * @version 2008-09-18
+ */
+public class HTTP
+{
+
+ /**
+ * Carriage return/line feed.
+ */
+ public static final String CRLF = "\r\n";
+
+ /**
+ * Convert an HTTP header string into a JSONObject. It can be a request
+ * header or a response header. A request header will contain
+ * <pre>{
+ * Method: "POST" (for example),
+ * "Request-URI": "/" (for example),
+ * "HTTP-Version": "HTTP/1.1" (for example)
+ * }</pre>
+ * A response header will contain
+ * <pre>{
+ * "HTTP-Version": "HTTP/1.1" (for example),
+ * "Status-Code": "200" (for example),
+ * "Reason-Phrase": "OK" (for example)
+ * }</pre>
+ * In addition, the other parameters in the header will be captured, using
+ * the HTTP field names as JSON names, so that <pre>
+ * Date: Sun, 26 May 2002 18:06:04 GMT
+ * Cookie: Q=q2=PPEAsg--; B=677gi6ouf29bn&b=2&f=s
+ * Cache-Control: no-cache</pre>
+ * become
+ * <pre>{...
+ * Date: "Sun, 26 May 2002 18:06:04 GMT",
+ * Cookie: "Q=q2=PPEAsg--; B=677gi6ouf29bn&b=2&f=s",
+ * "Cache-Control": "no-cache",
+ * ...}</pre>
+ * It does no further checking or conversion. It does not parse dates.
+ * It does not do '%' transforms on URLs.
+ *
+ * @param string An HTTP header string.
+ * @return A JSONObject containing the elements and attributes
+ * of the XML string.
+ * @throws JSONException
+ */
+ public static JSONObject toJSONObject(String string) throws JSONException
+ {
+ JSONObject o = new JSONObject();
+ HTTPTokener x = new HTTPTokener(string);
+ String t;
+
+ t = x.nextToken();
+ if (t.toUpperCase().startsWith("HTTP"))
+ {
+
+// Response
+
+ o.put("HTTP-Version", t);
+ o.put("Status-Code", x.nextToken());
+ o.put("Reason-Phrase", x.nextTo('\0'));
+ x.next();
+
+ }
+ else
+ {
+
+// Request
+
+ o.put("Method", t);
+ o.put("Request-URI", x.nextToken());
+ o.put("HTTP-Version", x.nextToken());
+ }
+
+// Fields
+
+ while (x.more())
+ {
+ String name = x.nextTo(':');
+ x.next(':');
+ o.put(name, x.nextTo('\0'));
+ x.next();
+ }
+ return o;
+ }
+
+
+ /**
+ * Convert a JSONObject into an HTTP header. A request header must contain
+ * <pre>{
+ * Method: "POST" (for example),
+ * "Request-URI": "/" (for example),
+ * "HTTP-Version": "HTTP/1.1" (for example)
+ * }</pre>
+ * A response header must contain
+ * <pre>{
+ * "HTTP-Version": "HTTP/1.1" (for example),
+ * "Status-Code": "200" (for example),
+ * "Reason-Phrase": "OK" (for example)
+ * }</pre>
+ * Any other members of the JSONObject will be output as HTTP fields.
+ * The result will end with two CRLF pairs.
+ *
+ * @param o A JSONObject
+ * @return An HTTP header string.
+ * @throws JSONException if the object does not contain enough
+ * information.
+ */
+ public static String toString(JSONObject o) throws JSONException
+ {
+ Iterator keys = o.keys();
+ String s;
+ StringBuffer sb = new StringBuffer();
+ if (o.has("Status-Code") && o.has("Reason-Phrase"))
+ {
+ sb.append(o.getString("HTTP-Version"));
+ sb.append(' ');
+ sb.append(o.getString("Status-Code"));
+ sb.append(' ');
+ sb.append(o.getString("Reason-Phrase"));
+ }
+ else if (o.has("Method") && o.has("Request-URI"))
+ {
+ sb.append(o.getString("Method"));
+ sb.append(' ');
+ sb.append('"');
+ sb.append(o.getString("Request-URI"));
+ sb.append('"');
+ sb.append(' ');
+ sb.append(o.getString("HTTP-Version"));
+ }
+ else
+ {
+ throw new JSONException("Not enough material for an HTTP header.");
+ }
+ sb.append(CRLF);
+ while (keys.hasNext())
+ {
+ s = keys.next().toString();
+ if (!s.equals("HTTP-Version") && !s.equals("Status-Code") &&
+ !s.equals("Reason-Phrase") && !s.equals("Method") &&
+ !s.equals("Request-URI") && !o.isNull(s))
+ {
+ sb.append(s);
+ sb.append(": ");
+ sb.append(o.getString(s));
+ sb.append(CRLF);
+ }
+ }
+ sb.append(CRLF);
+ return sb.toString();
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/json/HTTPTokener.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/json/HTTPTokener.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/json/HTTPTokener.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,91 @@
+package org.json;
+
+/*
+Copyright (c) 2002 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+/**
+ * The HTTPTokener extends the JSONTokener to provide additional methods
+ * for the parsing of HTTP headers.
+ *
+ * @author JSON.org
+ * @version 2008-09-18
+ */
+public class HTTPTokener extends JSONTokener
+{
+
+ /**
+ * Construct an XMLTokener from a string.
+ *
+ * @param s A source string.
+ */
+ public HTTPTokener(String s)
+ {
+ super(s);
+ }
+
+
+ /**
+ * Get the next token or string. This is used in parsing HTTP headers.
+ *
+ * @return A String.
+ * @throws JSONException
+ */
+ public String nextToken() throws JSONException
+ {
+ char c;
+ char q;
+ StringBuffer sb = new StringBuffer();
+ do
+ {
+ c = next();
+ }
+ while (Character.isWhitespace(c));
+ if (c == '"' || c == '\'')
+ {
+ q = c;
+ for (; ;)
+ {
+ c = next();
+ if (c < ' ')
+ {
+ throw syntaxError("Unterminated string.");
+ }
+ if (c == q)
+ {
+ return sb.toString();
+ }
+ sb.append(c);
+ }
+ }
+ for (; ;)
+ {
+ if (c == 0 || Character.isWhitespace(c))
+ {
+ return sb.toString();
+ }
+ sb.append(c);
+ c = next();
+ }
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/json/JSONArray.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/json/JSONArray.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/json/JSONArray.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,1086 @@
+package org.json;
+
+/*
+Copyright (c) 2002 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+import java.io.IOException;
+import java.io.Writer;
+import java.lang.reflect.Array;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * A JSONArray is an ordered sequence of values. Its external text form is a
+ * string wrapped in square brackets with commas separating the values. The
+ * internal form is an object having <code>get</code> and <code>opt</code>
+ * methods for accessing the values by index, and <code>put</code> methods for
+ * adding or replacing values. The values can be any of these types:
+ * <code>Boolean</code>, <code>JSONArray</code>, <code>JSONObject</code>,
+ * <code>Number</code>, <code>String</code>, or the
+ * <code>JSONObject.NULL object</code>.
+ * <p/>
+ * The constructor can convert a JSON text into a Java object. The
+ * <code>toString</code> method converts to JSON text.
+ * <p/>
+ * A <code>get</code> method returns a value if one can be found, and throws an
+ * exception if one cannot be found. An <code>opt</code> method returns a
+ * default value instead of throwing an exception, and so is useful for
+ * obtaining optional values.
+ * <p/>
+ * The generic <code>get()</code> and <code>opt()</code> methods return an
+ * object which you can cast or query for type. There are also typed
+ * <code>get</code> and <code>opt</code> methods that do type checking and type
+ * coersion for you.
+ * <p/>
+ * The texts produced by the <code>toString</code> methods strictly conform to
+ * JSON syntax rules. The constructors are more forgiving in the texts they will
+ * accept:
+ * <ul>
+ * <li>An extra <code>,</code> <small>(comma)</small> may appear just
+ * before the closing bracket.</li>
+ * <li>The <code>null</code> value will be inserted when there
+ * is <code>,</code> <small>(comma)</small> elision.</li>
+ * <li>Strings may be quoted with <code>'</code> <small>(single
+ * quote)</small>.</li>
+ * <li>Strings do not need to be quoted at all if they do not begin with a quote
+ * or single quote, and if they do not contain leading or trailing spaces,
+ * and if they do not contain any of these characters:
+ * <code>{ } [ ] / \ : , = ; #</code> and if they do not look like numbers
+ * and if they are not the reserved words <code>true</code>,
+ * <code>false</code>, or <code>null</code>.</li>
+ * <li>Values can be separated by <code>;</code> <small>(semicolon)</small> as
+ * well as by <code>,</code> <small>(comma)</small>.</li>
+ * <li>Numbers may have the <code>0-</code> <small>(octal)</small> or
+ * <code>0x-</code> <small>(hex)</small> prefix.</li>
+ * <li>Comments written in the slashshlash, slashstar, and hash conventions
+ * will be ignored.</li>
+ * </ul>
+ *
+ * @author JSON.org
+ * @version 2008-09-18
+ */
+public class JSONArray
+{
+
+
+ /**
+ * The arrayList where the JSONArray's properties are kept.
+ */
+ private ArrayList myArrayList;
+
+
+ /**
+ * Construct an empty JSONArray.
+ */
+ public JSONArray()
+ {
+ this.myArrayList = new ArrayList();
+ }
+
+ /**
+ * Construct a JSONArray from a JSONTokener.
+ *
+ * @param x A JSONTokener
+ * @throws JSONException If there is a syntax error.
+ */
+ public JSONArray(JSONTokener x) throws JSONException
+ {
+ this();
+ char c = x.nextClean();
+ char q;
+ if (c == '[')
+ {
+ q = ']';
+ }
+ else if (c == '(')
+ {
+ q = ')';
+ }
+ else
+ {
+ throw x.syntaxError("A JSONArray text must start with '['");
+ }
+ if (x.nextClean() == ']')
+ {
+ return;
+ }
+ x.back();
+ for (; ;)
+ {
+ if (x.nextClean() == ',')
+ {
+ x.back();
+ this.myArrayList.add(null);
+ }
+ else
+ {
+ x.back();
+ this.myArrayList.add(x.nextValue());
+ }
+ c = x.nextClean();
+ switch (c)
+ {
+ case';':
+ case',':
+ if (x.nextClean() == ']')
+ {
+ return;
+ }
+ x.back();
+ break;
+ case']':
+ case')':
+ if (q != c)
+ {
+ throw x.syntaxError("Expected a '" + new Character(q) + "'");
+ }
+ return;
+ default:
+ throw x.syntaxError("Expected a ',' or ']'");
+ }
+ }
+ }
+
+
+ /**
+ * Construct a JSONArray from a source JSON text.
+ *
+ * @param source A string that begins with
+ * <code>[</code> <small>(left bracket)</small>
+ * and ends with <code>]</code> <small>(right bracket)</small>.
+ * @throws JSONException If there is a syntax error.
+ */
+ public JSONArray(String source) throws JSONException
+ {
+ this(new JSONTokener(source));
+ }
+
+
+ /**
+ * Construct a JSONArray from a Collection.
+ *
+ * @param collection A Collection.
+ */
+ public JSONArray(Collection collection)
+ {
+ this.myArrayList = (collection == null) ?
+ new ArrayList() :
+ new ArrayList(collection);
+ }
+
+ /**
+ * Construct a JSONArray from a collection of beans.
+ * The collection should have Java Beans.
+ *
+ * @throws JSONException If not an array.
+ */
+
+ public JSONArray(Collection collection, boolean includeSuperClass)
+ {
+ this.myArrayList = new ArrayList();
+ if (collection != null)
+ {
+ for (Iterator iter = collection.iterator(); iter.hasNext();)
+ {
+ this.myArrayList.add(new JSONObject(iter.next(), includeSuperClass));
+ }
+ }
+ }
+
+
+ /**
+ * Construct a JSONArray from an array
+ *
+ * @throws JSONException If not an array.
+ */
+ public JSONArray(Object array) throws JSONException
+ {
+ this();
+ if (array.getClass().isArray())
+ {
+ int length = Array.getLength(array);
+ for (int i = 0; i < length; i += 1)
+ {
+ this.put(Array.get(array, i));
+ }
+ }
+ else
+ {
+ throw new JSONException("JSONArray initial value should be a string or collection or array.");
+ }
+ }
+
+ /**
+ * Construct a JSONArray from an array with a bean.
+ * The array should have Java Beans.
+ *
+ * @throws JSONException If not an array.
+ */
+ public JSONArray(Object array, boolean includeSuperClass) throws JSONException
+ {
+ this();
+ if (array.getClass().isArray())
+ {
+ int length = Array.getLength(array);
+ for (int i = 0; i < length; i += 1)
+ {
+ this.put(new JSONObject(Array.get(array, i), includeSuperClass));
+ }
+ }
+ else
+ {
+ throw new JSONException("JSONArray initial value should be a string or collection or array.");
+ }
+ }
+
+
+ /**
+ * Get the object value associated with an index.
+ *
+ * @param index The index must be between 0 and length() - 1.
+ * @return An object value.
+ * @throws JSONException If there is no value for the index.
+ */
+ public Object get(int index) throws JSONException
+ {
+ Object o = opt(index);
+ if (o == null)
+ {
+ throw new JSONException("JSONArray[" + index + "] not found.");
+ }
+ return o;
+ }
+
+
+ /**
+ * Get the boolean value associated with an index.
+ * The string values "true" and "false" are converted to boolean.
+ *
+ * @param index The index must be between 0 and length() - 1.
+ * @return The truth.
+ * @throws JSONException If there is no value for the index or if the
+ * value is not convertable to boolean.
+ */
+ public boolean getBoolean(int index) throws JSONException
+ {
+ Object o = get(index);
+ if (o.equals(Boolean.FALSE) ||
+ (o instanceof String &&
+ ((String) o).equalsIgnoreCase("false")))
+ {
+ return false;
+ }
+ else if (o.equals(Boolean.TRUE) ||
+ (o instanceof String &&
+ ((String) o).equalsIgnoreCase("true")))
+ {
+ return true;
+ }
+ throw new JSONException("JSONArray[" + index + "] is not a Boolean.");
+ }
+
+
+ /**
+ * Get the double value associated with an index.
+ *
+ * @param index The index must be between 0 and length() - 1.
+ * @return The value.
+ * @throws JSONException If the key is not found or if the value cannot
+ * be converted to a number.
+ */
+ public double getDouble(int index) throws JSONException
+ {
+ Object o = get(index);
+ try
+ {
+ return o instanceof Number ?
+ ((Number) o).doubleValue() :
+ Double.valueOf((String) o).doubleValue();
+ }
+ catch (Exception e)
+ {
+ throw new JSONException("JSONArray[" + index +
+ "] is not a number.");
+ }
+ }
+
+
+ /**
+ * Get the int value associated with an index.
+ *
+ * @param index The index must be between 0 and length() - 1.
+ * @return The value.
+ * @throws JSONException If the key is not found or if the value cannot
+ * be converted to a number.
+ * if the value cannot be converted to a number.
+ */
+ public int getInt(int index) throws JSONException
+ {
+ Object o = get(index);
+ return o instanceof Number ?
+ ((Number) o).intValue() : (int) getDouble(index);
+ }
+
+
+ /**
+ * Get the JSONArray associated with an index.
+ *
+ * @param index The index must be between 0 and length() - 1.
+ * @return A JSONArray value.
+ * @throws JSONException If there is no value for the index. or if the
+ * value is not a JSONArray
+ */
+ public JSONArray getJSONArray(int index) throws JSONException
+ {
+ Object o = get(index);
+ if (o instanceof JSONArray)
+ {
+ return (JSONArray) o;
+ }
+ throw new JSONException("JSONArray[" + index +
+ "] is not a JSONArray.");
+ }
+
+
+ /**
+ * Get the JSONObject associated with an index.
+ *
+ * @param index subscript
+ * @return A JSONObject value.
+ * @throws JSONException If there is no value for the index or if the
+ * value is not a JSONObject
+ */
+ public JSONObject getJSONObject(int index) throws JSONException
+ {
+ Object o = get(index);
+ if (o instanceof JSONObject)
+ {
+ return (JSONObject) o;
+ }
+ throw new JSONException("JSONArray[" + index +
+ "] is not a JSONObject.");
+ }
+
+
+ /**
+ * Get the long value associated with an index.
+ *
+ * @param index The index must be between 0 and length() - 1.
+ * @return The value.
+ * @throws JSONException If the key is not found or if the value cannot
+ * be converted to a number.
+ */
+ public long getLong(int index) throws JSONException
+ {
+ Object o = get(index);
+ return o instanceof Number ?
+ ((Number) o).longValue() : (long) getDouble(index);
+ }
+
+
+ /**
+ * Get the string associated with an index.
+ *
+ * @param index The index must be between 0 and length() - 1.
+ * @return A string value.
+ * @throws JSONException If there is no value for the index.
+ */
+ public String getString(int index) throws JSONException
+ {
+ return get(index).toString();
+ }
+
+
+ /**
+ * Determine if the value is null.
+ *
+ * @param index The index must be between 0 and length() - 1.
+ * @return true if the value at the index is null, or if there is no value.
+ */
+ public boolean isNull(int index)
+ {
+ return JSONObject.NULL.equals(opt(index));
+ }
+
+
+ /**
+ * Make a string from the contents of this JSONArray. The
+ * <code>separator</code> string is inserted between each element.
+ * Warning: This method assumes that the data structure is acyclical.
+ *
+ * @param separator A string that will be inserted between the elements.
+ * @return a string.
+ * @throws JSONException If the array contains an invalid number.
+ */
+ public String join(String separator) throws JSONException
+ {
+ int len = length();
+ StringBuffer sb = new StringBuffer();
+
+ for (int i = 0; i < len; i += 1)
+ {
+ if (i > 0)
+ {
+ sb.append(separator);
+ }
+ sb.append(JSONObject.valueToString(this.myArrayList.get(i)));
+ }
+ return sb.toString();
+ }
+
+
+ /**
+ * Get the number of elements in the JSONArray, included nulls.
+ *
+ * @return The length (or size).
+ */
+ public int length()
+ {
+ return this.myArrayList.size();
+ }
+
+
+ /**
+ * Get the optional object value associated with an index.
+ *
+ * @param index The index must be between 0 and length() - 1.
+ * @return An object value, or null if there is no
+ * object at that index.
+ */
+ public Object opt(int index)
+ {
+ return (index < 0 || index >= length()) ?
+ null : this.myArrayList.get(index);
+ }
+
+
+ /**
+ * Get the optional boolean value associated with an index.
+ * It returns false if there is no value at that index,
+ * or if the value is not Boolean.TRUE or the String "true".
+ *
+ * @param index The index must be between 0 and length() - 1.
+ * @return The truth.
+ */
+ public boolean optBoolean(int index)
+ {
+ return optBoolean(index, false);
+ }
+
+
+ /**
+ * Get the optional boolean value associated with an index.
+ * It returns the defaultValue if there is no value at that index or if
+ * it is not a Boolean or the String "true" or "false" (case insensitive).
+ *
+ * @param index The index must be between 0 and length() - 1.
+ * @param defaultValue A boolean default.
+ * @return The truth.
+ */
+ public boolean optBoolean(int index, boolean defaultValue)
+ {
+ try
+ {
+ return getBoolean(index);
+ }
+ catch (Exception e)
+ {
+ return defaultValue;
+ }
+ }
+
+
+ /**
+ * Get the optional double value associated with an index.
+ * NaN is returned if there is no value for the index,
+ * or if the value is not a number and cannot be converted to a number.
+ *
+ * @param index The index must be between 0 and length() - 1.
+ * @return The value.
+ */
+ public double optDouble(int index)
+ {
+ return optDouble(index, Double.NaN);
+ }
+
+
+ /**
+ * Get the optional double value associated with an index.
+ * The defaultValue is returned if there is no value for the index,
+ * or if the value is not a number and cannot be converted to a number.
+ *
+ * @param index subscript
+ * @param defaultValue The default value.
+ * @return The value.
+ */
+ public double optDouble(int index, double defaultValue)
+ {
+ try
+ {
+ return getDouble(index);
+ }
+ catch (Exception e)
+ {
+ return defaultValue;
+ }
+ }
+
+
+ /**
+ * Get the optional int value associated with an index.
+ * Zero is returned if there is no value for the index,
+ * or if the value is not a number and cannot be converted to a number.
+ *
+ * @param index The index must be between 0 and length() - 1.
+ * @return The value.
+ */
+ public int optInt(int index)
+ {
+ return optInt(index, 0);
+ }
+
+
+ /**
+ * Get the optional int value associated with an index.
+ * The defaultValue is returned if there is no value for the index,
+ * or if the value is not a number and cannot be converted to a number.
+ *
+ * @param index The index must be between 0 and length() - 1.
+ * @param defaultValue The default value.
+ * @return The value.
+ */
+ public int optInt(int index, int defaultValue)
+ {
+ try
+ {
+ return getInt(index);
+ }
+ catch (Exception e)
+ {
+ return defaultValue;
+ }
+ }
+
+
+ /**
+ * Get the optional JSONArray associated with an index.
+ *
+ * @param index subscript
+ * @return A JSONArray value, or null if the index has no value,
+ * or if the value is not a JSONArray.
+ */
+ public JSONArray optJSONArray(int index)
+ {
+ Object o = opt(index);
+ return o instanceof JSONArray ? (JSONArray) o : null;
+ }
+
+
+ /**
+ * Get the optional JSONObject associated with an index.
+ * Null is returned if the key is not found, or null if the index has
+ * no value, or if the value is not a JSONObject.
+ *
+ * @param index The index must be between 0 and length() - 1.
+ * @return A JSONObject value.
+ */
+ public JSONObject optJSONObject(int index)
+ {
+ Object o = opt(index);
+ return o instanceof JSONObject ? (JSONObject) o : null;
+ }
+
+
+ /**
+ * Get the optional long value associated with an index.
+ * Zero is returned if there is no value for the index,
+ * or if the value is not a number and cannot be converted to a number.
+ *
+ * @param index The index must be between 0 and length() - 1.
+ * @return The value.
+ */
+ public long optLong(int index)
+ {
+ return optLong(index, 0);
+ }
+
+
+ /**
+ * Get the optional long value associated with an index.
+ * The defaultValue is returned if there is no value for the index,
+ * or if the value is not a number and cannot be converted to a number.
+ *
+ * @param index The index must be between 0 and length() - 1.
+ * @param defaultValue The default value.
+ * @return The value.
+ */
+ public long optLong(int index, long defaultValue)
+ {
+ try
+ {
+ return getLong(index);
+ }
+ catch (Exception e)
+ {
+ return defaultValue;
+ }
+ }
+
+
+ /**
+ * Get the optional string value associated with an index. It returns an
+ * empty string if there is no value at that index. If the value
+ * is not a string and is not null, then it is coverted to a string.
+ *
+ * @param index The index must be between 0 and length() - 1.
+ * @return A String value.
+ */
+ public String optString(int index)
+ {
+ return optString(index, "");
+ }
+
+
+ /**
+ * Get the optional string associated with an index.
+ * The defaultValue is returned if the key is not found.
+ *
+ * @param index The index must be between 0 and length() - 1.
+ * @param defaultValue The default value.
+ * @return A String value.
+ */
+ public String optString(int index, String defaultValue)
+ {
+ Object o = opt(index);
+ return o != null ? o.toString() : defaultValue;
+ }
+
+
+ /**
+ * Append a boolean value. This increases the array's length by one.
+ *
+ * @param value A boolean value.
+ * @return this.
+ */
+ public JSONArray put(boolean value)
+ {
+ put(value ? Boolean.TRUE : Boolean.FALSE);
+ return this;
+ }
+
+
+ /**
+ * Put a value in the JSONArray, where the value will be a
+ * JSONArray which is produced from a Collection.
+ *
+ * @param value A Collection value.
+ * @return this.
+ */
+ public JSONArray put(Collection value)
+ {
+ put(new JSONArray(value));
+ return this;
+ }
+
+
+ /**
+ * Append a double value. This increases the array's length by one.
+ *
+ * @param value A double value.
+ * @return this.
+ * @throws JSONException if the value is not finite.
+ */
+ public JSONArray put(double value) throws JSONException
+ {
+ Double d = new Double(value);
+ JSONObject.testValidity(d);
+ put(d);
+ return this;
+ }
+
+
+ /**
+ * Append an int value. This increases the array's length by one.
+ *
+ * @param value An int value.
+ * @return this.
+ */
+ public JSONArray put(int value)
+ {
+ put(new Integer(value));
+ return this;
+ }
+
+
+ /**
+ * Append an long value. This increases the array's length by one.
+ *
+ * @param value A long value.
+ * @return this.
+ */
+ public JSONArray put(long value)
+ {
+ put(new Long(value));
+ return this;
+ }
+
+
+ /**
+ * Put a value in the JSONArray, where the value will be a
+ * JSONObject which is produced from a Map.
+ *
+ * @param value A Map value.
+ * @return this.
+ */
+ public JSONArray put(Map value)
+ {
+ put(new JSONObject(value));
+ return this;
+ }
+
+
+ /**
+ * Append an object value. This increases the array's length by one.
+ *
+ * @param value An object value. The value should be a
+ * Boolean, Double, Integer, JSONArray, JSONObject, Long, or String, or the
+ * JSONObject.NULL object.
+ * @return this.
+ */
+ public JSONArray put(Object value)
+ {
+ this.myArrayList.add(value);
+ return this;
+ }
+
+
+ /**
+ * Put or replace a boolean value in the JSONArray. If the index is greater
+ * than the length of the JSONArray, then null elements will be added as
+ * necessary to pad it out.
+ *
+ * @param index The subscript.
+ * @param value A boolean value.
+ * @return this.
+ * @throws JSONException If the index is negative.
+ */
+ public JSONArray put(int index, boolean value) throws JSONException
+ {
+ put(index, value ? Boolean.TRUE : Boolean.FALSE);
+ return this;
+ }
+
+
+ /**
+ * Put a value in the JSONArray, where the value will be a
+ * JSONArray which is produced from a Collection.
+ *
+ * @param index The subscript.
+ * @param value A Collection value.
+ * @return this.
+ * @throws JSONException If the index is negative or if the value is
+ * not finite.
+ */
+ public JSONArray put(int index, Collection value) throws JSONException
+ {
+ put(index, new JSONArray(value));
+ return this;
+ }
+
+
+ /**
+ * Put or replace a double value. If the index is greater than the length of
+ * the JSONArray, then null elements will be added as necessary to pad
+ * it out.
+ *
+ * @param index The subscript.
+ * @param value A double value.
+ * @return this.
+ * @throws JSONException If the index is negative or if the value is
+ * not finite.
+ */
+ public JSONArray put(int index, double value) throws JSONException
+ {
+ put(index, new Double(value));
+ return this;
+ }
+
+
+ /**
+ * Put or replace an int value. If the index is greater than the length of
+ * the JSONArray, then null elements will be added as necessary to pad
+ * it out.
+ *
+ * @param index The subscript.
+ * @param value An int value.
+ * @return this.
+ * @throws JSONException If the index is negative.
+ */
+ public JSONArray put(int index, int value) throws JSONException
+ {
+ put(index, new Integer(value));
+ return this;
+ }
+
+
+ /**
+ * Put or replace a long value. If the index is greater than the length of
+ * the JSONArray, then null elements will be added as necessary to pad
+ * it out.
+ *
+ * @param index The subscript.
+ * @param value A long value.
+ * @return this.
+ * @throws JSONException If the index is negative.
+ */
+ public JSONArray put(int index, long value) throws JSONException
+ {
+ put(index, new Long(value));
+ return this;
+ }
+
+
+ /**
+ * Put a value in the JSONArray, where the value will be a
+ * JSONObject which is produced from a Map.
+ *
+ * @param index The subscript.
+ * @param value The Map value.
+ * @return this.
+ * @throws JSONException If the index is negative or if the the value is
+ * an invalid number.
+ */
+ public JSONArray put(int index, Map value) throws JSONException
+ {
+ put(index, new JSONObject(value));
+ return this;
+ }
+
+
+ /**
+ * Put or replace an object value in the JSONArray. If the index is greater
+ * than the length of the JSONArray, then null elements will be added as
+ * necessary to pad it out.
+ *
+ * @param index The subscript.
+ * @param value The value to put into the array. The value should be a
+ * Boolean, Double, Integer, JSONArray, JSONObject, Long, or String, or the
+ * JSONObject.NULL object.
+ * @return this.
+ * @throws JSONException If the index is negative or if the the value is
+ * an invalid number.
+ */
+ public JSONArray put(int index, Object value) throws JSONException
+ {
+ JSONObject.testValidity(value);
+ if (index < 0)
+ {
+ throw new JSONException("JSONArray[" + index + "] not found.");
+ }
+ if (index < length())
+ {
+ this.myArrayList.set(index, value);
+ }
+ else
+ {
+ while (index != length())
+ {
+ put(JSONObject.NULL);
+ }
+ put(value);
+ }
+ return this;
+ }
+
+
+ /**
+ * Produce a JSONObject by combining a JSONArray of names with the values
+ * of this JSONArray.
+ *
+ * @param names A JSONArray containing a list of key strings. These will be
+ * paired with the values.
+ * @return A JSONObject, or null if there are no names or if this JSONArray
+ * has no values.
+ * @throws JSONException If any of the names are null.
+ */
+ public JSONObject toJSONObject(JSONArray names) throws JSONException
+ {
+ if (names == null || names.length() == 0 || length() == 0)
+ {
+ return null;
+ }
+ JSONObject jo = new JSONObject();
+ for (int i = 0; i < names.length(); i += 1)
+ {
+ jo.put(names.getString(i), this.opt(i));
+ }
+ return jo;
+ }
+
+
+ /**
+ * Make a JSON text of this JSONArray. For compactness, no
+ * unnecessary whitespace is added. If it is not possible to produce a
+ * syntactically correct JSON text then null will be returned instead. This
+ * could occur if the array contains an invalid number.
+ * <p/>
+ * Warning: This method assumes that the data structure is acyclical.
+ *
+ * @return a printable, displayable, transmittable
+ * representation of the array.
+ */
+ public String toString()
+ {
+ try
+ {
+ return '[' + join(",") + ']';
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
+ }
+
+
+ /**
+ * Make a prettyprinted JSON text of this JSONArray.
+ * Warning: This method assumes that the data structure is acyclical.
+ *
+ * @param indentFactor The number of spaces to add to each level of
+ * indentation.
+ * @return a printable, displayable, transmittable
+ * representation of the object, beginning
+ * with <code>[</code> <small>(left bracket)</small> and ending
+ * with <code>]</code> <small>(right bracket)</small>.
+ * @throws JSONException
+ */
+ public String toString(int indentFactor) throws JSONException
+ {
+ return toString(indentFactor, 0);
+ }
+
+
+ /**
+ * Make a prettyprinted JSON text of this JSONArray.
+ * Warning: This method assumes that the data structure is acyclical.
+ *
+ * @param indentFactor The number of spaces to add to each level of
+ * indentation.
+ * @param indent The indention of the top level.
+ * @return a printable, displayable, transmittable
+ * representation of the array.
+ * @throws JSONException
+ */
+ String toString(int indentFactor, int indent) throws JSONException
+ {
+ int len = length();
+ if (len == 0)
+ {
+ return "[]";
+ }
+ int i;
+ StringBuffer sb = new StringBuffer("[");
+ if (len == 1)
+ {
+ sb.append(JSONObject.valueToString(this.myArrayList.get(0),
+ indentFactor, indent));
+ }
+ else
+ {
+ int newindent = indent + indentFactor;
+ sb.append('\n');
+ for (i = 0; i < len; i += 1)
+ {
+ if (i > 0)
+ {
+ sb.append(",\n");
+ }
+ for (int j = 0; j < newindent; j += 1)
+ {
+ sb.append(' ');
+ }
+ sb.append(JSONObject.valueToString(this.myArrayList.get(i),
+ indentFactor, newindent));
+ }
+ sb.append('\n');
+ for (i = 0; i < indent; i += 1)
+ {
+ sb.append(' ');
+ }
+ }
+ sb.append(']');
+ return sb.toString();
+ }
+
+
+ /**
+ * Write the contents of the JSONArray as JSON text to a writer.
+ * For compactness, no whitespace is added.
+ * <p/>
+ * Warning: This method assumes that the data structure is acyclical.
+ *
+ * @return The writer.
+ * @throws JSONException
+ */
+ public Writer write(Writer writer) throws JSONException
+ {
+ try
+ {
+ boolean b = false;
+ int len = length();
+
+ writer.write('[');
+
+ for (int i = 0; i < len; i += 1)
+ {
+ if (b)
+ {
+ writer.write(',');
+ }
+ Object v = this.myArrayList.get(i);
+ if (v instanceof JSONObject)
+ {
+ ((JSONObject) v).write(writer);
+ }
+ else if (v instanceof JSONArray)
+ {
+ ((JSONArray) v).write(writer);
+ }
+ else
+ {
+ writer.write(JSONObject.valueToString(v));
+ }
+ b = true;
+ }
+ writer.write(']');
+ return writer;
+ }
+ catch (IOException e)
+ {
+ throw new JSONException(e);
+ }
+ }
+}
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/java/org/json/JSONException.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/json/JSONException.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/json/JSONException.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,33 @@
+package org.json;
+
+/**
+ * The JSONException is thrown by the JSON.org classes then things are amiss.
+ *
+ * @author JSON.org
+ * @version 2008-09-18
+ */
+public class JSONException extends Exception
+{
+ private Throwable cause;
+
+ /**
+ * Constructs a JSONException with an explanatory message.
+ *
+ * @param message Detail about the reason for the exception.
+ */
+ public JSONException(String message)
+ {
+ super(message);
+ }
+
+ public JSONException(Throwable t)
+ {
+ super(t.getMessage());
+ this.cause = t;
+ }
+
+ public Throwable getCause()
+ {
+ return this.cause;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/json/JSONML.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/json/JSONML.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/json/JSONML.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,553 @@
+package org.json;
+
+/*
+Copyright (c) 2008 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+import java.util.Iterator;
+
+
+/**
+ * This provides static methods to convert an XML text into a JSONArray or
+ * JSONObject, and to covert a JSONArray or JSONObject into an XML text using
+ * the JsonML transform.
+ *
+ * @author JSON.org
+ * @version 2008-09-18
+ */
+public class JSONML
+{
+
+ /**
+ * Parse XML values and store them in a JSONArray.
+ *
+ * @param x The XMLTokener containing the source string.
+ * @param arrayForm true if array form, false if object form.
+ * @param ja The JSONArray that is containing the current tag or null
+ * if we are at the outermost level.
+ * @return A JSONArray if the value is the outermost tag, otherwise null.
+ * @throws JSONException
+ */
+ private static Object parse(XMLTokener x, boolean arrayForm,
+ JSONArray ja) throws JSONException
+ {
+ String attribute;
+ char c;
+ String closeTag = null;
+ int i;
+ JSONArray newja = null;
+ JSONObject newjo = null;
+ Object token;
+ String tagName = null;
+
+// Test for and skip past these forms:
+// <!-- ... -->
+// <![ ... ]]>
+// <! ... >
+// <? ... ?>
+
+ while (true)
+ {
+ token = x.nextContent();
+ if (token == XML.LT)
+ {
+ token = x.nextToken();
+ if (token instanceof Character)
+ {
+ if (token == XML.SLASH)
+ {
+
+// Close tag </
+
+ token = x.nextToken();
+ if (!(token instanceof String))
+ {
+ throw new JSONException(
+ "Expected a closing name instead of '" +
+ token + "'.");
+ }
+ if (x.nextToken() != XML.GT)
+ {
+ throw x.syntaxError("Misshaped close tag");
+ }
+ return token;
+ }
+ else if (token == XML.BANG)
+ {
+
+// <!
+
+ c = x.next();
+ if (c == '-')
+ {
+ if (x.next() == '-')
+ {
+ x.skipPast("-->");
+ }
+ x.back();
+ }
+ else if (c == '[')
+ {
+ token = x.nextToken();
+ if (token.equals("CDATA") && x.next() == '[')
+ {
+ if (ja != null)
+ {
+ ja.put(x.nextCDATA());
+ }
+ }
+ else
+ {
+ throw x.syntaxError("Expected 'CDATA['");
+ }
+ }
+ else
+ {
+ i = 1;
+ do
+ {
+ token = x.nextMeta();
+ if (token == null)
+ {
+ throw x.syntaxError("Missing '>' after '<!'.");
+ }
+ else if (token == XML.LT)
+ {
+ i += 1;
+ }
+ else if (token == XML.GT)
+ {
+ i -= 1;
+ }
+ }
+ while (i > 0);
+ }
+ }
+ else if (token == XML.QUEST)
+ {
+
+// <?
+
+ x.skipPast("?>");
+ }
+ else
+ {
+ throw x.syntaxError("Misshaped tag");
+ }
+
+// Open tag <
+
+ }
+ else
+ {
+ if (!(token instanceof String))
+ {
+ throw x.syntaxError("Bad tagName '" + token + "'.");
+ }
+ tagName = (String) token;
+ newja = new JSONArray();
+ newjo = new JSONObject();
+ if (arrayForm)
+ {
+ newja.put(tagName);
+ if (ja != null)
+ {
+ ja.put(newja);
+ }
+ }
+ else
+ {
+ newjo.put("tagName", tagName);
+ if (ja != null)
+ {
+ ja.put(newjo);
+ }
+ }
+ token = null;
+ for (; ;)
+ {
+ if (token == null)
+ {
+ token = x.nextToken();
+ }
+ if (token == null)
+ {
+ throw x.syntaxError("Misshaped tag");
+ }
+ if (!(token instanceof String))
+ {
+ break;
+ }
+
+// attribute = value
+
+ attribute = (String) token;
+ if (!arrayForm && (attribute == "tagName" || attribute == "childNode"))
+ {
+ throw x.syntaxError("Reserved attribute.");
+ }
+ token = x.nextToken();
+ if (token == XML.EQ)
+ {
+ token = x.nextToken();
+ if (!(token instanceof String))
+ {
+ throw x.syntaxError("Missing value");
+ }
+ newjo.accumulate(attribute, JSONObject.stringToValue((String) token));
+ token = null;
+ }
+ else
+ {
+ newjo.accumulate(attribute, "");
+ }
+ }
+ if (arrayForm && newjo.length() > 0)
+ {
+ newja.put(newjo);
+ }
+
+// Empty tag <.../>
+
+ if (token == XML.SLASH)
+ {
+ if (x.nextToken() != XML.GT)
+ {
+ throw x.syntaxError("Misshaped tag");
+ }
+ if (ja == null)
+ {
+ return arrayForm ? newja : newjo;
+ }
+
+// Content, between <...> and </...>
+
+ }
+ else
+ {
+ if (token != XML.GT)
+ {
+ throw x.syntaxError("Misshaped tag");
+ }
+ closeTag = (String) parse(x, arrayForm, newja);
+ if (closeTag != null)
+ {
+ if (!closeTag.equals(tagName))
+ {
+ throw x.syntaxError("Mismatched '" + tagName +
+ "' and '" + closeTag + "'");
+ }
+ tagName = null;
+ if (!arrayForm && newja.length() > 0)
+ {
+ newjo.put("childNodes", newja);
+ }
+ if (ja == null)
+ {
+ return arrayForm ? newja : newjo;
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ if (ja != null)
+ {
+ ja.put(token instanceof String ?
+ JSONObject.stringToValue((String) token) : token);
+ }
+ }
+ }
+ }
+
+
+ /**
+ * Convert a well-formed (but not necessarily valid) XML string into a
+ * JSONArray using the JsonML transform. Each XML tag is represented as
+ * a JSONArray in which the first element is the tag name. If the tag has
+ * attributes, then the second element will be JSONObject containing the
+ * name/value pairs. If the tag contains children, then strings and
+ * JSONArrays will represent the child tags.
+ * Comments, prologs, DTDs, and <code><[ [ ]]></code> are ignored.
+ *
+ * @param string The source string.
+ * @return A JSONArray containing the structured data from the XML string.
+ * @throws JSONException
+ */
+ public static JSONArray toJSONArray(String string) throws JSONException
+ {
+ return toJSONArray(new XMLTokener(string));
+ }
+
+
+ /**
+ * Convert a well-formed (but not necessarily valid) XML string into a
+ * JSONArray using the JsonML transform. Each XML tag is represented as
+ * a JSONArray in which the first element is the tag name. If the tag has
+ * attributes, then the second element will be JSONObject containing the
+ * name/value pairs. If the tag contains children, then strings and
+ * JSONArrays will represent the child content and tags.
+ * Comments, prologs, DTDs, and <code><[ [ ]]></code> are ignored.
+ *
+ * @param x An XMLTokener.
+ * @return A JSONArray containing the structured data from the XML string.
+ * @throws JSONException
+ */
+ public static JSONArray toJSONArray(XMLTokener x) throws JSONException
+ {
+ return (JSONArray) parse(x, true, null);
+ }
+
+
+ /**
+ * Convert a well-formed (but not necessarily valid) XML string into a
+ * JSONObject using the JsonML transform. Each XML tag is represented as
+ * a JSONObject with a "tagName" property. If the tag has attributes, then
+ * the attributes will be in the JSONObject as properties. If the tag
+ * contains children, the object will have a "childNodes" property which
+ * will be an array of strings and JsonML JSONObjects.
+ * <p/>
+ * Comments, prologs, DTDs, and <code><[ [ ]]></code> are ignored.
+ *
+ * @param x An XMLTokener of the XML source text.
+ * @return A JSONObject containing the structured data from the XML string.
+ * @throws JSONException
+ */
+ public static JSONObject toJSONObject(XMLTokener x) throws JSONException
+ {
+ return (JSONObject) parse(x, false, null);
+ }
+
+ /**
+ * Convert a well-formed (but not necessarily valid) XML string into a
+ * JSONObject using the JsonML transform. Each XML tag is represented as
+ * a JSONObject with a "tagName" property. If the tag has attributes, then
+ * the attributes will be in the JSONObject as properties. If the tag
+ * contains children, the object will have a "childNodes" property which
+ * will be an array of strings and JsonML JSONObjects.
+ * <p/>
+ * Comments, prologs, DTDs, and <code><[ [ ]]></code> are ignored.
+ *
+ * @param string The XML source text.
+ * @return A JSONObject containing the structured data from the XML string.
+ * @throws JSONException
+ */
+ public static JSONObject toJSONObject(String string) throws JSONException
+ {
+ return toJSONObject(new XMLTokener(string));
+ }
+
+
+ /**
+ * Reverse the JSONML transformation, making an XML text from a JSONArray.
+ *
+ * @param ja A JSONArray.
+ * @return An XML string.
+ * @throws JSONException
+ */
+ public static String toString(JSONArray ja) throws JSONException
+ {
+ Object e;
+ int i;
+ JSONObject jo;
+ String k;
+ Iterator keys;
+ int length;
+ StringBuffer sb = new StringBuffer();
+ String tagName;
+ String v;
+
+// Emit <tagName
+
+ tagName = ja.getString(0);
+ XML.noSpace(tagName);
+ tagName = XML.escape(tagName);
+ sb.append('<');
+ sb.append(tagName);
+
+ e = ja.opt(1);
+ if (e instanceof JSONObject)
+ {
+ i = 2;
+ jo = (JSONObject) e;
+
+// Emit the attributes
+
+ keys = jo.keys();
+ while (keys.hasNext())
+ {
+ k = keys.next().toString();
+ XML.noSpace(k);
+ v = jo.optString(k);
+ if (v != null)
+ {
+ sb.append(' ');
+ sb.append(XML.escape(k));
+ sb.append('=');
+ sb.append('"');
+ sb.append(XML.escape(v));
+ sb.append('"');
+ }
+ }
+ }
+ else
+ {
+ i = 1;
+ }
+
+//Emit content in body
+
+ length = ja.length();
+ if (i >= length)
+ {
+ sb.append('/');
+ sb.append('>');
+ }
+ else
+ {
+ sb.append('>');
+ do
+ {
+ e = ja.get(i);
+ i += 1;
+ if (e != null)
+ {
+ if (e instanceof String)
+ {
+ sb.append(XML.escape(e.toString()));
+ }
+ else if (e instanceof JSONObject)
+ {
+ sb.append(toString((JSONObject) e));
+ }
+ else if (e instanceof JSONArray)
+ {
+ sb.append(toString((JSONArray) e));
+ }
+ }
+ }
+ while (i < length);
+ sb.append('<');
+ sb.append('/');
+ sb.append(tagName);
+ sb.append('>');
+ }
+ return sb.toString();
+ }
+
+ /**
+ * Reverse the JSONML transformation, making an XML text from a JSONObject.
+ * The JSONObject must contain a "tagName" property. If it has children,
+ * then it must have a "childNodes" property containing an array of objects.
+ * The other properties are attributes with string values.
+ *
+ * @param jo A JSONObject.
+ * @return An XML string.
+ * @throws JSONException
+ */
+ public static String toString(JSONObject jo) throws JSONException
+ {
+ StringBuffer sb = new StringBuffer();
+ Object e;
+ int i;
+ JSONArray ja;
+ String k;
+ Iterator keys;
+ int len;
+ String tagName;
+ String v;
+
+//Emit <tagName
+
+ tagName = jo.optString("tagName");
+ if (tagName == null)
+ {
+ return XML.escape(jo.toString());
+ }
+ XML.noSpace(tagName);
+ tagName = XML.escape(tagName);
+ sb.append('<');
+ sb.append(tagName);
+
+//Emit the attributes
+
+ keys = jo.keys();
+ while (keys.hasNext())
+ {
+ k = keys.next().toString();
+ if (!k.equals("tagName") && !k.equals("childNodes"))
+ {
+ XML.noSpace(k);
+ v = jo.optString(k);
+ if (v != null)
+ {
+ sb.append(' ');
+ sb.append(XML.escape(k));
+ sb.append('=');
+ sb.append('"');
+ sb.append(XML.escape(v));
+ sb.append('"');
+ }
+ }
+ }
+
+//Emit content in body
+
+ ja = jo.optJSONArray("childNodes");
+ if (ja == null)
+ {
+ sb.append('/');
+ sb.append('>');
+ }
+ else
+ {
+ sb.append('>');
+ len = ja.length();
+ for (i = 0; i < len; i += 1)
+ {
+ e = ja.get(i);
+ if (e != null)
+ {
+ if (e instanceof String)
+ {
+ sb.append(XML.escape(e.toString()));
+ }
+ else if (e instanceof JSONObject)
+ {
+ sb.append(toString((JSONObject) e));
+ }
+ else if (e instanceof JSONArray)
+ {
+ sb.append(toString((JSONArray) e));
+ }
+ }
+ }
+ sb.append('<');
+ sb.append('/');
+ sb.append(tagName);
+ sb.append('>');
+ }
+ return sb.toString();
+ }
+}
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/java/org/json/JSONObject.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/json/JSONObject.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/json/JSONObject.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,1832 @@
+package org.json;
+
+/*
+Copyright (c) 2002 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+import java.io.IOException;
+import java.io.Writer;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.TreeSet;
+
+/**
+ * A JSONObject is an unordered collection of name/value pairs. Its
+ * external form is a string wrapped in curly braces with colons between the
+ * names and values, and commas between the values and names. The internal form
+ * is an object having <code>get</code> and <code>opt</code> methods for
+ * accessing the values by name, and <code>put</code> methods for adding or
+ * replacing values by name. The values can be any of these types:
+ * <code>Boolean</code>, <code>JSONArray</code>, <code>JSONObject</code>,
+ * <code>Number</code>, <code>String</code>, or the <code>JSONObject.NULL</code>
+ * object. A JSONObject constructor can be used to convert an external form
+ * JSON text into an internal form whose values can be retrieved with the
+ * <code>get</code> and <code>opt</code> methods, or to convert values into a
+ * JSON text using the <code>put</code> and <code>toString</code> methods.
+ * A <code>get</code> method returns a value if one can be found, and throws an
+ * exception if one cannot be found. An <code>opt</code> method returns a
+ * default value instead of throwing an exception, and so is useful for
+ * obtaining optional values.
+ * <p/>
+ * The generic <code>get()</code> and <code>opt()</code> methods return an
+ * object, which you can cast or query for type. There are also typed
+ * <code>get</code> and <code>opt</code> methods that do type checking and type
+ * coercion for you.
+ * <p/>
+ * The <code>put</code> methods adds values to an object. For example, <pre>
+ * myString = new JSONObject().put("JSON", "Hello, World!").toString();</pre>
+ * produces the string <code>{"JSON": "Hello, World"}</code>.
+ * <p/>
+ * The texts produced by the <code>toString</code> methods strictly conform to
+ * the JSON syntax rules.
+ * The constructors are more forgiving in the texts they will accept:
+ * <ul>
+ * <li>An extra <code>,</code> <small>(comma)</small> may appear just
+ * before the closing brace.</li>
+ * <li>Strings may be quoted with <code>'</code> <small>(single
+ * quote)</small>.</li>
+ * <li>Strings do not need to be quoted at all if they do not begin with a quote
+ * or single quote, and if they do not contain leading or trailing spaces,
+ * and if they do not contain any of these characters:
+ * <code>{ } [ ] / \ : , = ; #</code> and if they do not look like numbers
+ * and if they are not the reserved words <code>true</code>,
+ * <code>false</code>, or <code>null</code>.</li>
+ * <li>Keys can be followed by <code>=</code> or <code>=></code> as well as
+ * by <code>:</code>.</li>
+ * <li>Values can be followed by <code>;</code> <small>(semicolon)</small> as
+ * well as by <code>,</code> <small>(comma)</small>.</li>
+ * <li>Numbers may have the <code>0-</code> <small>(octal)</small> or
+ * <code>0x-</code> <small>(hex)</small> prefix.</li>
+ * </ul>
+ *
+ * @author JSON.org
+ * @version 2008-09-18
+ */
+public class JSONObject
+{
+
+ /**
+ * JSONObject.NULL is equivalent to the value that JavaScript calls null,
+ * whilst Java's null is equivalent to the value that JavaScript calls
+ * undefined.
+ */
+ private static final class Null
+ {
+
+ /**
+ * There is only intended to be a single instance of the NULL object,
+ * so the clone method returns itself.
+ *
+ * @return NULL.
+ */
+ protected final Object clone()
+ {
+ return this;
+ }
+
+
+ /**
+ * A Null object is equal to the null value and to itself.
+ *
+ * @param object An object to test for nullness.
+ * @return true if the object parameter is the JSONObject.NULL object
+ * or null.
+ */
+ public boolean equals(Object object)
+ {
+ return object == null || object == this;
+ }
+
+
+ /**
+ * Get the "null" string value.
+ *
+ * @return The string "null".
+ */
+ public String toString()
+ {
+ return "null";
+ }
+ }
+
+
+ /**
+ * The map where the JSONObject's properties are kept.
+ */
+ private Map map;
+
+
+ /**
+ * It is sometimes more convenient and less ambiguous to have a
+ * <code>NULL</code> object than to use Java's <code>null</code> value.
+ * <code>JSONObject.NULL.equals(null)</code> returns <code>true</code>.
+ * <code>JSONObject.NULL.toString()</code> returns <code>"null"</code>.
+ */
+ public static final Object NULL = new Null();
+
+
+ /**
+ * Construct an empty JSONObject.
+ */
+ public JSONObject()
+ {
+ this.map = new HashMap();
+ }
+
+
+ /**
+ * Construct a JSONObject from a subset of another JSONObject.
+ * An array of strings is used to identify the keys that should be copied.
+ * Missing keys are ignored.
+ *
+ * @param jo A JSONObject.
+ * @param names An array of strings.
+ * @throws JSONException If a value is a non-finite number or if a name is duplicated.
+ */
+ public JSONObject(JSONObject jo, String[] names) throws JSONException
+ {
+ this();
+ for (int i = 0; i < names.length; i += 1)
+ {
+ putOnce(names[i], jo.opt(names[i]));
+ }
+ }
+
+
+ /**
+ * Construct a JSONObject from a JSONTokener.
+ *
+ * @param x A JSONTokener object containing the source string.
+ * @throws JSONException If there is a syntax error in the source string
+ * or a duplicated key.
+ */
+ public JSONObject(JSONTokener x) throws JSONException
+ {
+ this();
+ char c;
+ String key;
+
+ if (x.nextClean() != '{')
+ {
+ throw x.syntaxError("A JSONObject text must begin with '{'");
+ }
+ for (; ;)
+ {
+ c = x.nextClean();
+ switch (c)
+ {
+ case 0:
+ throw x.syntaxError("A JSONObject text must end with '}'");
+ case'}':
+ return;
+ default:
+ x.back();
+ key = x.nextValue().toString();
+ }
+
+ /*
+ * The key is followed by ':'. We will also tolerate '=' or '=>'.
+ */
+
+ c = x.nextClean();
+ if (c == '=')
+ {
+ if (x.next() != '>')
+ {
+ x.back();
+ }
+ }
+ else if (c != ':')
+ {
+ throw x.syntaxError("Expected a ':' after a key");
+ }
+ putOnce(key, x.nextValue());
+
+ /*
+ * Pairs are separated by ','. We will also tolerate ';'.
+ */
+
+ switch (x.nextClean())
+ {
+ case';':
+ case',':
+ if (x.nextClean() == '}')
+ {
+ return;
+ }
+ x.back();
+ break;
+ case'}':
+ return;
+ default:
+ throw x.syntaxError("Expected a ',' or '}'");
+ }
+ }
+ }
+
+
+ /**
+ * Construct a JSONObject from a Map.
+ *
+ * @param map A map object that can be used to initialize the contents of
+ * the JSONObject.
+ */
+ public JSONObject(Map map)
+ {
+ this.map = (map == null) ? new HashMap() : map;
+ }
+
+ /**
+ * Construct a JSONObject from a Map.
+ * <p/>
+ * Note: Use this constructor when the map contains <key,bean>.
+ *
+ * @param map - A map with Key-Bean data.
+ * @param includeSuperClass - Tell whether to include the super class properties.
+ */
+ public JSONObject(Map map, boolean includeSuperClass)
+ {
+ this.map = new HashMap();
+ if (map != null)
+ {
+ for (Iterator i = map.entrySet().iterator(); i.hasNext();)
+ {
+ Map.Entry e = (Map.Entry) i.next();
+ this.map.put(e.getKey(), new JSONObject(e.getValue(), includeSuperClass));
+ }
+ }
+ }
+
+
+ /**
+ * Construct a JSONObject from an Object using bean getters.
+ * It reflects on all of the public methods of the object.
+ * For each of the methods with no parameters and a name starting
+ * with <code>"get"</code> or <code>"is"</code> followed by an uppercase letter,
+ * the method is invoked, and a key and the value returned from the getter method
+ * are put into the new JSONObject.
+ * <p/>
+ * The key is formed by removing the <code>"get"</code> or <code>"is"</code> prefix. If the second remaining
+ * character is not upper case, then the first
+ * character is converted to lower case.
+ * <p/>
+ * For example, if an object has a method named <code>"getName"</code>, and
+ * if the result of calling <code>object.getName()</code> is <code>"Larry Fine"</code>,
+ * then the JSONObject will contain <code>"name": "Larry Fine"</code>.
+ *
+ * @param bean An object that has getter methods that should be used
+ * to make a JSONObject.
+ */
+ public JSONObject(Object bean)
+ {
+ this();
+ populateInternalMap(bean, false);
+ }
+
+
+ /**
+ * Construct JSONObject from the given bean. This will also create JSONObject
+ * for all internal object (List, Map, Inner Objects) of the provided bean.
+ * <p/>
+ * -- See Documentation of JSONObject(Object bean) also.
+ *
+ * @param bean An object that has getter methods that should be used
+ * to make a JSONObject.
+ * @param includeSuperClass - Tell whether to include the super class properties.
+ */
+ public JSONObject(Object bean, boolean includeSuperClass)
+ {
+ this();
+ populateInternalMap(bean, includeSuperClass);
+ }
+
+ private void populateInternalMap(Object bean, boolean includeSuperClass)
+ {
+ Class klass = bean.getClass();
+
+ //If klass.getSuperClass is System class then includeSuperClass = false;
+
+ if (klass.getClassLoader() == null)
+ {
+ includeSuperClass = false;
+ }
+
+ Method[] methods = (includeSuperClass) ?
+ klass.getMethods() : klass.getDeclaredMethods();
+ for (int i = 0; i < methods.length; i += 1)
+ {
+ try
+ {
+ Method method = methods[i];
+ String name = method.getName();
+ String key = "";
+ if (name.startsWith("get"))
+ {
+ key = name.substring(3);
+ }
+ else if (name.startsWith("is"))
+ {
+ key = name.substring(2);
+ }
+ if (key.length() > 0 &&
+ Character.isUpperCase(key.charAt(0)) &&
+ method.getParameterTypes().length == 0)
+ {
+ if (key.length() == 1)
+ {
+ key = key.toLowerCase();
+ }
+ else if (!Character.isUpperCase(key.charAt(1)))
+ {
+ key = key.substring(0, 1).toLowerCase() +
+ key.substring(1);
+ }
+
+ Object result = method.invoke(bean, (Object[]) null);
+ if (result == null)
+ {
+ map.put(key, NULL);
+ }
+ else if (result.getClass().isArray())
+ {
+ map.put(key, new JSONArray(result, includeSuperClass));
+ }
+ else if (result instanceof Collection)
+ { //List or Set
+ map.put(key, new JSONArray((Collection) result, includeSuperClass));
+ }
+ else if (result instanceof Map)
+ {
+ map.put(key, new JSONObject((Map) result, includeSuperClass));
+ }
+ else if (isStandardProperty(result.getClass()))
+ { //Primitives, String and Wrapper
+ map.put(key, result);
+ }
+ else
+ {
+ if (result.getClass().getPackage().getName().startsWith("java") ||
+ result.getClass().getClassLoader() == null)
+ {
+ map.put(key, result.toString());
+ }
+ else
+ { //User defined Objects
+ map.put(key, new JSONObject(result, includeSuperClass));
+ }
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ private boolean isStandardProperty(Class clazz)
+ {
+ return clazz.isPrimitive() ||
+ clazz.isAssignableFrom(Byte.class) ||
+ clazz.isAssignableFrom(Short.class) ||
+ clazz.isAssignableFrom(Integer.class) ||
+ clazz.isAssignableFrom(Long.class) ||
+ clazz.isAssignableFrom(Float.class) ||
+ clazz.isAssignableFrom(Double.class) ||
+ clazz.isAssignableFrom(Character.class) ||
+ clazz.isAssignableFrom(String.class) ||
+ clazz.isAssignableFrom(Boolean.class);
+ }
+
+ /**
+ * Construct a JSONObject from an Object, using reflection to find the
+ * public members. The resulting JSONObject's keys will be the strings
+ * from the names array, and the values will be the field values associated
+ * with those keys in the object. If a key is not found or not visible,
+ * then it will not be copied into the new JSONObject.
+ *
+ * @param object An object that has fields that should be used to make a
+ * JSONObject.
+ * @param names An array of strings, the names of the fields to be obtained
+ * from the object.
+ */
+ public JSONObject(Object object, String names[])
+ {
+ this();
+ Class c = object.getClass();
+ for (int i = 0; i < names.length; i += 1)
+ {
+ String name = names[i];
+ try
+ {
+ putOpt(name, c.getField(name).get(object));
+ }
+ catch (Exception e)
+ {
+ /* forget about it */
+ }
+ }
+ }
+
+
+ /**
+ * Construct a JSONObject from a source JSON text string.
+ * This is the most commonly used JSONObject constructor.
+ *
+ * @param source A string beginning
+ * with <code>{</code> <small>(left brace)</small> and ending
+ * with <code>}</code> <small>(right brace)</small>.
+ * @throws JSONException If there is a syntax error in the source
+ * string or a duplicated key.
+ */
+ public JSONObject(String source) throws JSONException
+ {
+ this(new JSONTokener(source));
+ }
+
+
+ /**
+ * Accumulate values under a key. It is similar to the put method except
+ * that if there is already an object stored under the key then a
+ * JSONArray is stored under the key to hold all of the accumulated values.
+ * If there is already a JSONArray, then the new value is appended to it.
+ * In contrast, the put method replaces the previous value.
+ *
+ * @param key A key string.
+ * @param value An object to be accumulated under the key.
+ * @return this.
+ * @throws JSONException If the value is an invalid number
+ * or if the key is null.
+ */
+ public JSONObject accumulate(String key, Object value)
+ throws JSONException
+ {
+ testValidity(value);
+ Object o = opt(key);
+ if (o == null)
+ {
+ put(key, value instanceof JSONArray ?
+ new JSONArray().put(value) :
+ value);
+ }
+ else if (o instanceof JSONArray)
+ {
+ ((JSONArray) o).put(value);
+ }
+ else
+ {
+ put(key, new JSONArray().put(o).put(value));
+ }
+ return this;
+ }
+
+
+ /**
+ * Append values to the array under a key. If the key does not exist in the
+ * JSONObject, then the key is put in the JSONObject with its value being a
+ * JSONArray containing the value parameter. If the key was already
+ * associated with a JSONArray, then the value parameter is appended to it.
+ *
+ * @param key A key string.
+ * @param value An object to be accumulated under the key.
+ * @return this.
+ * @throws JSONException If the key is null or if the current value
+ * associated with the key is not a JSONArray.
+ */
+ public JSONObject append(String key, Object value)
+ throws JSONException
+ {
+ testValidity(value);
+ Object o = opt(key);
+ if (o == null)
+ {
+ put(key, new JSONArray().put(value));
+ }
+ else if (o instanceof JSONArray)
+ {
+ put(key, ((JSONArray) o).put(value));
+ }
+ else
+ {
+ throw new JSONException("JSONObject[" + key +
+ "] is not a JSONArray.");
+ }
+ return this;
+ }
+
+
+ /**
+ * Produce a string from a double. The string "null" will be returned if
+ * the number is not finite.
+ *
+ * @param d A double.
+ * @return A String.
+ */
+ static public String doubleToString(double d)
+ {
+ if (Double.isInfinite(d) || Double.isNaN(d))
+ {
+ return "null";
+ }
+
+// Shave off trailing zeros and decimal point, if possible.
+
+ String s = Double.toString(d);
+ if (s.indexOf('.') > 0 && s.indexOf('e') < 0 && s.indexOf('E') < 0)
+ {
+ while (s.endsWith("0"))
+ {
+ s = s.substring(0, s.length() - 1);
+ }
+ if (s.endsWith("."))
+ {
+ s = s.substring(0, s.length() - 1);
+ }
+ }
+ return s;
+ }
+
+
+ /**
+ * Get the value object associated with a key.
+ *
+ * @param key A key string.
+ * @return The object associated with the key.
+ * @throws JSONException if the key is not found.
+ */
+ public Object get(String key) throws JSONException
+ {
+ Object o = opt(key);
+ if (o == null)
+ {
+ throw new JSONException("JSONObject[" + quote(key) +
+ "] not found.");
+ }
+ return o;
+ }
+
+
+ /**
+ * Get the boolean value associated with a key.
+ *
+ * @param key A key string.
+ * @return The truth.
+ * @throws JSONException if the value is not a Boolean or the String "true" or "false".
+ */
+ public boolean getBoolean(String key) throws JSONException
+ {
+ Object o = get(key);
+ if (o.equals(Boolean.FALSE) ||
+ (o instanceof String &&
+ ((String) o).equalsIgnoreCase("false")))
+ {
+ return false;
+ }
+ else if (o.equals(Boolean.TRUE) ||
+ (o instanceof String &&
+ ((String) o).equalsIgnoreCase("true")))
+ {
+ return true;
+ }
+ throw new JSONException("JSONObject[" + quote(key) +
+ "] is not a Boolean.");
+ }
+
+
+ /**
+ * Get the double value associated with a key.
+ *
+ * @param key A key string.
+ * @return The numeric value.
+ * @throws JSONException if the key is not found or
+ * if the value is not a Number object and cannot be converted to a number.
+ */
+ public double getDouble(String key) throws JSONException
+ {
+ Object o = get(key);
+ try
+ {
+ return o instanceof Number ?
+ ((Number) o).doubleValue() :
+ Double.valueOf((String) o).doubleValue();
+ }
+ catch (Exception e)
+ {
+ throw new JSONException("JSONObject[" + quote(key) +
+ "] is not a number.");
+ }
+ }
+
+
+ /**
+ * Get the int value associated with a key. If the number value is too
+ * large for an int, it will be clipped.
+ *
+ * @param key A key string.
+ * @return The integer value.
+ * @throws JSONException if the key is not found or if the value cannot
+ * be converted to an integer.
+ */
+ public int getInt(String key) throws JSONException
+ {
+ Object o = get(key);
+ return o instanceof Number ?
+ ((Number) o).intValue() : (int) getDouble(key);
+ }
+
+
+ /**
+ * Get the JSONArray value associated with a key.
+ *
+ * @param key A key string.
+ * @return A JSONArray which is the value.
+ * @throws JSONException if the key is not found or
+ * if the value is not a JSONArray.
+ */
+ public JSONArray getJSONArray(String key) throws JSONException
+ {
+ Object o = get(key);
+ if (o instanceof JSONArray)
+ {
+ return (JSONArray) o;
+ }
+ throw new JSONException("JSONObject[" + quote(key) +
+ "] is not a JSONArray.");
+ }
+
+
+ /**
+ * Get the JSONObject value associated with a key.
+ *
+ * @param key A key string.
+ * @return A JSONObject which is the value.
+ * @throws JSONException if the key is not found or
+ * if the value is not a JSONObject.
+ */
+ public JSONObject getJSONObject(String key) throws JSONException
+ {
+ Object o = get(key);
+ if (o instanceof JSONObject)
+ {
+ return (JSONObject) o;
+ }
+ throw new JSONException("JSONObject[" + quote(key) +
+ "] is not a JSONObject.");
+ }
+
+
+ /**
+ * Get the long value associated with a key. If the number value is too
+ * long for a long, it will be clipped.
+ *
+ * @param key A key string.
+ * @return The long value.
+ * @throws JSONException if the key is not found or if the value cannot
+ * be converted to a long.
+ */
+ public long getLong(String key) throws JSONException
+ {
+ Object o = get(key);
+ return o instanceof Number ?
+ ((Number) o).longValue() : (long) getDouble(key);
+ }
+
+
+ /**
+ * Get an array of field names from a JSONObject.
+ *
+ * @return An array of field names, or null if there are no names.
+ */
+ public static String[] getNames(JSONObject jo)
+ {
+ int length = jo.length();
+ if (length == 0)
+ {
+ return null;
+ }
+ Iterator i = jo.keys();
+ String[] names = new String[length];
+ int j = 0;
+ while (i.hasNext())
+ {
+ names[j] = (String) i.next();
+ j += 1;
+ }
+ return names;
+ }
+
+
+ /**
+ * Get an array of field names from an Object.
+ *
+ * @return An array of field names, or null if there are no names.
+ */
+ public static String[] getNames(Object object)
+ {
+ if (object == null)
+ {
+ return null;
+ }
+ Class klass = object.getClass();
+ Field[] fields = klass.getFields();
+ int length = fields.length;
+ if (length == 0)
+ {
+ return null;
+ }
+ String[] names = new String[length];
+ for (int i = 0; i < length; i += 1)
+ {
+ names[i] = fields[i].getName();
+ }
+ return names;
+ }
+
+
+ /**
+ * Get the string associated with a key.
+ *
+ * @param key A key string.
+ * @return A string which is the value.
+ * @throws JSONException if the key is not found.
+ */
+ public String getString(String key) throws JSONException
+ {
+ return get(key).toString();
+ }
+
+
+ /**
+ * Determine if the JSONObject contains a specific key.
+ *
+ * @param key A key string.
+ * @return true if the key exists in the JSONObject.
+ */
+ public boolean has(String key)
+ {
+ return this.map.containsKey(key);
+ }
+
+
+ /**
+ * Determine if the value associated with the key is null or if there is
+ * no value.
+ *
+ * @param key A key string.
+ * @return true if there is no value associated with the key or if
+ * the value is the JSONObject.NULL object.
+ */
+ public boolean isNull(String key)
+ {
+ return JSONObject.NULL.equals(opt(key));
+ }
+
+
+ /**
+ * Get an enumeration of the keys of the JSONObject.
+ *
+ * @return An iterator of the keys.
+ */
+ public Iterator keys()
+ {
+ return this.map.keySet().iterator();
+ }
+
+
+ /**
+ * Get the number of keys stored in the JSONObject.
+ *
+ * @return The number of keys in the JSONObject.
+ */
+ public int length()
+ {
+ return this.map.size();
+ }
+
+
+ /**
+ * Produce a JSONArray containing the names of the elements of this
+ * JSONObject.
+ *
+ * @return A JSONArray containing the key strings, or null if the JSONObject
+ * is empty.
+ */
+ public JSONArray names()
+ {
+ JSONArray ja = new JSONArray();
+ Iterator keys = keys();
+ while (keys.hasNext())
+ {
+ ja.put(keys.next());
+ }
+ return ja.length() == 0 ? null : ja;
+ }
+
+ /**
+ * Produce a string from a Number.
+ *
+ * @param n A Number
+ * @return A String.
+ * @throws JSONException If n is a non-finite number.
+ */
+ static public String numberToString(Number n)
+ throws JSONException
+ {
+ if (n == null)
+ {
+ throw new JSONException("Null pointer");
+ }
+ testValidity(n);
+
+// Shave off trailing zeros and decimal point, if possible.
+
+ String s = n.toString();
+ if (s.indexOf('.') > 0 && s.indexOf('e') < 0 && s.indexOf('E') < 0)
+ {
+ while (s.endsWith("0"))
+ {
+ s = s.substring(0, s.length() - 1);
+ }
+ if (s.endsWith("."))
+ {
+ s = s.substring(0, s.length() - 1);
+ }
+ }
+ return s;
+ }
+
+
+ /**
+ * Get an optional value associated with a key.
+ *
+ * @param key A key string.
+ * @return An object which is the value, or null if there is no value.
+ */
+ public Object opt(String key)
+ {
+ return key == null ? null : this.map.get(key);
+ }
+
+
+ /**
+ * Get an optional boolean associated with a key.
+ * It returns false if there is no such key, or if the value is not
+ * Boolean.TRUE or the String "true".
+ *
+ * @param key A key string.
+ * @return The truth.
+ */
+ public boolean optBoolean(String key)
+ {
+ return optBoolean(key, false);
+ }
+
+
+ /**
+ * Get an optional boolean associated with a key.
+ * It returns the defaultValue if there is no such key, or if it is not
+ * a Boolean or the String "true" or "false" (case insensitive).
+ *
+ * @param key A key string.
+ * @param defaultValue The default.
+ * @return The truth.
+ */
+ public boolean optBoolean(String key, boolean defaultValue)
+ {
+ try
+ {
+ return getBoolean(key);
+ }
+ catch (Exception e)
+ {
+ return defaultValue;
+ }
+ }
+
+
+ /**
+ * Put a key/value pair in the JSONObject, where the value will be a
+ * JSONArray which is produced from a Collection.
+ *
+ * @param key A key string.
+ * @param value A Collection value.
+ * @return this.
+ * @throws JSONException
+ */
+ public JSONObject put(String key, Collection value) throws JSONException
+ {
+ put(key, new JSONArray(value));
+ return this;
+ }
+
+
+ /**
+ * Get an optional double associated with a key,
+ * or NaN if there is no such key or if its value is not a number.
+ * If the value is a string, an attempt will be made to evaluate it as
+ * a number.
+ *
+ * @param key A string which is the key.
+ * @return An object which is the value.
+ */
+ public double optDouble(String key)
+ {
+ return optDouble(key, Double.NaN);
+ }
+
+
+ /**
+ * Get an optional double associated with a key, or the
+ * defaultValue if there is no such key or if its value is not a number.
+ * If the value is a string, an attempt will be made to evaluate it as
+ * a number.
+ *
+ * @param key A key string.
+ * @param defaultValue The default.
+ * @return An object which is the value.
+ */
+ public double optDouble(String key, double defaultValue)
+ {
+ try
+ {
+ Object o = opt(key);
+ return o instanceof Number ? ((Number) o).doubleValue() :
+ new Double((String) o).doubleValue();
+ }
+ catch (Exception e)
+ {
+ return defaultValue;
+ }
+ }
+
+
+ /**
+ * Get an optional int value associated with a key,
+ * or zero if there is no such key or if the value is not a number.
+ * If the value is a string, an attempt will be made to evaluate it as
+ * a number.
+ *
+ * @param key A key string.
+ * @return An object which is the value.
+ */
+ public int optInt(String key)
+ {
+ return optInt(key, 0);
+ }
+
+
+ /**
+ * Get an optional int value associated with a key,
+ * or the default if there is no such key or if the value is not a number.
+ * If the value is a string, an attempt will be made to evaluate it as
+ * a number.
+ *
+ * @param key A key string.
+ * @param defaultValue The default.
+ * @return An object which is the value.
+ */
+ public int optInt(String key, int defaultValue)
+ {
+ try
+ {
+ return getInt(key);
+ }
+ catch (Exception e)
+ {
+ return defaultValue;
+ }
+ }
+
+
+ /**
+ * Get an optional JSONArray associated with a key.
+ * It returns null if there is no such key, or if its value is not a
+ * JSONArray.
+ *
+ * @param key A key string.
+ * @return A JSONArray which is the value.
+ */
+ public JSONArray optJSONArray(String key)
+ {
+ Object o = opt(key);
+ return o instanceof JSONArray ? (JSONArray) o : null;
+ }
+
+
+ /**
+ * Get an optional JSONObject associated with a key.
+ * It returns null if there is no such key, or if its value is not a
+ * JSONObject.
+ *
+ * @param key A key string.
+ * @return A JSONObject which is the value.
+ */
+ public JSONObject optJSONObject(String key)
+ {
+ Object o = opt(key);
+ return o instanceof JSONObject ? (JSONObject) o : null;
+ }
+
+
+ /**
+ * Get an optional long value associated with a key,
+ * or zero if there is no such key or if the value is not a number.
+ * If the value is a string, an attempt will be made to evaluate it as
+ * a number.
+ *
+ * @param key A key string.
+ * @return An object which is the value.
+ */
+ public long optLong(String key)
+ {
+ return optLong(key, 0);
+ }
+
+
+ /**
+ * Get an optional long value associated with a key,
+ * or the default if there is no such key or if the value is not a number.
+ * If the value is a string, an attempt will be made to evaluate it as
+ * a number.
+ *
+ * @param key A key string.
+ * @param defaultValue The default.
+ * @return An object which is the value.
+ */
+ public long optLong(String key, long defaultValue)
+ {
+ try
+ {
+ return getLong(key);
+ }
+ catch (Exception e)
+ {
+ return defaultValue;
+ }
+ }
+
+
+ /**
+ * Get an optional string associated with a key.
+ * It returns an empty string if there is no such key. If the value is not
+ * a string and is not null, then it is coverted to a string.
+ *
+ * @param key A key string.
+ * @return A string which is the value.
+ */
+ public String optString(String key)
+ {
+ return optString(key, "");
+ }
+
+
+ /**
+ * Get an optional string associated with a key.
+ * It returns the defaultValue if there is no such key.
+ *
+ * @param key A key string.
+ * @param defaultValue The default.
+ * @return A string which is the value.
+ */
+ public String optString(String key, String defaultValue)
+ {
+ Object o = opt(key);
+ return o != null ? o.toString() : defaultValue;
+ }
+
+
+ /**
+ * Put a key/boolean pair in the JSONObject.
+ *
+ * @param key A key string.
+ * @param value A boolean which is the value.
+ * @return this.
+ * @throws JSONException If the key is null.
+ */
+ public JSONObject put(String key, boolean value) throws JSONException
+ {
+ put(key, value ? Boolean.TRUE : Boolean.FALSE);
+ return this;
+ }
+
+
+ /**
+ * Put a key/double pair in the JSONObject.
+ *
+ * @param key A key string.
+ * @param value A double which is the value.
+ * @return this.
+ * @throws JSONException If the key is null or if the number is invalid.
+ */
+ public JSONObject put(String key, double value) throws JSONException
+ {
+ put(key, new Double(value));
+ return this;
+ }
+
+
+ /**
+ * Put a key/int pair in the JSONObject.
+ *
+ * @param key A key string.
+ * @param value An int which is the value.
+ * @return this.
+ * @throws JSONException If the key is null.
+ */
+ public JSONObject put(String key, int value) throws JSONException
+ {
+ put(key, new Integer(value));
+ return this;
+ }
+
+
+ /**
+ * Put a key/long pair in the JSONObject.
+ *
+ * @param key A key string.
+ * @param value A long which is the value.
+ * @return this.
+ * @throws JSONException If the key is null.
+ */
+ public JSONObject put(String key, long value) throws JSONException
+ {
+ put(key, new Long(value));
+ return this;
+ }
+
+
+ /**
+ * Put a key/value pair in the JSONObject, where the value will be a
+ * JSONObject which is produced from a Map.
+ *
+ * @param key A key string.
+ * @param value A Map value.
+ * @return this.
+ * @throws JSONException
+ */
+ public JSONObject put(String key, Map value) throws JSONException
+ {
+ put(key, new JSONObject(value));
+ return this;
+ }
+
+
+ /**
+ * Put a key/value pair in the JSONObject. If the value is null,
+ * then the key will be removed from the JSONObject if it is present.
+ *
+ * @param key A key string.
+ * @param value An object which is the value. It should be of one of these
+ * types: Boolean, Double, Integer, JSONArray, JSONObject, Long, String,
+ * or the JSONObject.NULL object.
+ * @return this.
+ * @throws JSONException If the value is non-finite number
+ * or if the key is null.
+ */
+ public JSONObject put(String key, Object value) throws JSONException
+ {
+ if (key == null)
+ {
+ throw new JSONException("Null key.");
+ }
+ if (value != null)
+ {
+ testValidity(value);
+ this.map.put(key, value);
+ }
+ else
+ {
+ remove(key);
+ }
+ return this;
+ }
+
+
+ /**
+ * Put a key/value pair in the JSONObject, but only if the key and the
+ * value are both non-null, and only if there is not already a member
+ * with that name.
+ *
+ * @param key
+ * @param value
+ * @return his.
+ * @throws JSONException if the key is a duplicate
+ */
+ public JSONObject putOnce(String key, Object value) throws JSONException
+ {
+ if (key != null && value != null)
+ {
+ if (opt(key) != null)
+ {
+ throw new JSONException("Duplicate key \"" + key + "\"");
+ }
+ put(key, value);
+ }
+ return this;
+ }
+
+
+ /**
+ * Put a key/value pair in the JSONObject, but only if the
+ * key and the value are both non-null.
+ *
+ * @param key A key string.
+ * @param value An object which is the value. It should be of one of these
+ * types: Boolean, Double, Integer, JSONArray, JSONObject, Long, String,
+ * or the JSONObject.NULL object.
+ * @return this.
+ * @throws JSONException If the value is a non-finite number.
+ */
+ public JSONObject putOpt(String key, Object value) throws JSONException
+ {
+ if (key != null && value != null)
+ {
+ put(key, value);
+ }
+ return this;
+ }
+
+
+ /**
+ * Produce a string in double quotes with backslash sequences in all the
+ * right places. A backslash will be inserted within </, allowing JSON
+ * text to be delivered in HTML. In JSON text, a string cannot contain a
+ * control character or an unescaped quote or backslash.
+ *
+ * @param string A String
+ * @return A String correctly formatted for insertion in a JSON text.
+ */
+ public static String quote(String string)
+ {
+ if (string == null || string.length() == 0)
+ {
+ return "\"\"";
+ }
+
+ char b;
+ char c = 0;
+ int i;
+ int len = string.length();
+ StringBuffer sb = new StringBuffer(len + 4);
+ String t;
+
+ sb.append('"');
+ for (i = 0; i < len; i += 1)
+ {
+ b = c;
+ c = string.charAt(i);
+ switch (c)
+ {
+ case'\\':
+ case'"':
+ sb.append('\\');
+ sb.append(c);
+ break;
+ case'/':
+ if (b == '<')
+ {
+ sb.append('\\');
+ }
+ sb.append(c);
+ break;
+ case'\b':
+ sb.append("\\b");
+ break;
+ case'\t':
+ sb.append("\\t");
+ break;
+ case'\n':
+ sb.append("\\n");
+ break;
+ case'\f':
+ sb.append("\\f");
+ break;
+ case'\r':
+ sb.append("\\r");
+ break;
+ default:
+ if (c < ' ' || (c >= '\u0080' && c < '\u00a0') ||
+ (c >= '\u2000' && c < '\u2100'))
+ {
+ t = "000" + Integer.toHexString(c);
+ sb.append("\\u" + t.substring(t.length() - 4));
+ }
+ else
+ {
+ sb.append(c);
+ }
+ }
+ }
+ sb.append('"');
+ return sb.toString();
+ }
+
+ /**
+ * Remove a name and its value, if present.
+ *
+ * @param key The name to be removed.
+ * @return The value that was associated with the name,
+ * or null if there was no value.
+ */
+ public Object remove(String key)
+ {
+ return this.map.remove(key);
+ }
+
+ /**
+ * Get an enumeration of the keys of the JSONObject.
+ * The keys will be sorted alphabetically.
+ *
+ * @return An iterator of the keys.
+ */
+ public Iterator sortedKeys()
+ {
+ return new TreeSet(this.map.keySet()).iterator();
+ }
+
+ /**
+ * Try to convert a string into a number, boolean, or null. If the string
+ * can't be converted, return the string.
+ *
+ * @param s A String.
+ * @return A simple JSON value.
+ */
+ static public Object stringToValue(String s)
+ {
+ if (s.equals(""))
+ {
+ return s;
+ }
+ if (s.equalsIgnoreCase("true"))
+ {
+ return Boolean.TRUE;
+ }
+ if (s.equalsIgnoreCase("false"))
+ {
+ return Boolean.FALSE;
+ }
+ if (s.equalsIgnoreCase("null"))
+ {
+ return JSONObject.NULL;
+ }
+
+ /*
+ * If it might be a number, try converting it. We support the 0- and 0x-
+ * conventions. If a number cannot be produced, then the value will just
+ * be a string. Note that the 0-, 0x-, plus, and implied string
+ * conventions are non-standard. A JSON parser is free to accept
+ * non-JSON forms as long as it accepts all correct JSON forms.
+ */
+
+ char b = s.charAt(0);
+ if ((b >= '0' && b <= '9') || b == '.' || b == '-' || b == '+')
+ {
+ if (b == '0')
+ {
+ if (s.length() > 2 &&
+ (s.charAt(1) == 'x' || s.charAt(1) == 'X'))
+ {
+ try
+ {
+ return new Integer(Integer.parseInt(s.substring(2),
+ 16));
+ }
+ catch (Exception e)
+ {
+ /* Ignore the error */
+ }
+ }
+ else
+ {
+ try
+ {
+ return new Integer(Integer.parseInt(s, 8));
+ }
+ catch (Exception e)
+ {
+ /* Ignore the error */
+ }
+ }
+ }
+ try
+ {
+ return new Integer(s);
+ }
+ catch (Exception e)
+ {
+ try
+ {
+ return new Long(s);
+ }
+ catch (Exception f)
+ {
+ try
+ {
+ return new Double(s);
+ }
+ catch (Exception g)
+ {
+ /* Ignore the error */
+ }
+ }
+ }
+ }
+ return s;
+ }
+
+
+ /**
+ * Throw an exception if the object is an NaN or infinite number.
+ *
+ * @param o The object to test.
+ * @throws JSONException If o is a non-finite number.
+ */
+ static void testValidity(Object o) throws JSONException
+ {
+ if (o != null)
+ {
+ if (o instanceof Double)
+ {
+ if (((Double) o).isInfinite() || ((Double) o).isNaN())
+ {
+ throw new JSONException(
+ "JSON does not allow non-finite numbers.");
+ }
+ }
+ else if (o instanceof Float)
+ {
+ if (((Float) o).isInfinite() || ((Float) o).isNaN())
+ {
+ throw new JSONException(
+ "JSON does not allow non-finite numbers.");
+ }
+ }
+ }
+ }
+
+
+ /**
+ * Produce a JSONArray containing the values of the members of this
+ * JSONObject.
+ *
+ * @param names A JSONArray containing a list of key strings. This
+ * determines the sequence of the values in the result.
+ * @return A JSONArray of values.
+ * @throws JSONException If any of the values are non-finite numbers.
+ */
+ public JSONArray toJSONArray(JSONArray names) throws JSONException
+ {
+ if (names == null || names.length() == 0)
+ {
+ return null;
+ }
+ JSONArray ja = new JSONArray();
+ for (int i = 0; i < names.length(); i += 1)
+ {
+ ja.put(this.opt(names.getString(i)));
+ }
+ return ja;
+ }
+
+ /**
+ * Make a JSON text of this JSONObject. For compactness, no whitespace
+ * is added. If this would not result in a syntactically correct JSON text,
+ * then null will be returned instead.
+ * <p/>
+ * Warning: This method assumes that the data structure is acyclical.
+ *
+ * @return a printable, displayable, portable, transmittable
+ * representation of the object, beginning
+ * with <code>{</code> <small>(left brace)</small> and ending
+ * with <code>}</code> <small>(right brace)</small>.
+ */
+ public String toString()
+ {
+ try
+ {
+ Iterator keys = keys();
+ StringBuffer sb = new StringBuffer("{");
+
+ while (keys.hasNext())
+ {
+ if (sb.length() > 1)
+ {
+ sb.append(',');
+ }
+ Object o = keys.next();
+ sb.append(quote(o.toString()));
+ sb.append(':');
+ sb.append(valueToString(this.map.get(o)));
+ }
+ sb.append('}');
+ return sb.toString();
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
+ }
+
+
+ /**
+ * Make a prettyprinted JSON text of this JSONObject.
+ * <p/>
+ * Warning: This method assumes that the data structure is acyclical.
+ *
+ * @param indentFactor The number of spaces to add to each level of
+ * indentation.
+ * @return a printable, displayable, portable, transmittable
+ * representation of the object, beginning
+ * with <code>{</code> <small>(left brace)</small> and ending
+ * with <code>}</code> <small>(right brace)</small>.
+ * @throws JSONException If the object contains an invalid number.
+ */
+ public String toString(int indentFactor) throws JSONException
+ {
+ return toString(indentFactor, 0);
+ }
+
+
+ /**
+ * Make a prettyprinted JSON text of this JSONObject.
+ * <p/>
+ * Warning: This method assumes that the data structure is acyclical.
+ *
+ * @param indentFactor The number of spaces to add to each level of
+ * indentation.
+ * @param indent The indentation of the top level.
+ * @return a printable, displayable, transmittable
+ * representation of the object, beginning
+ * with <code>{</code> <small>(left brace)</small> and ending
+ * with <code>}</code> <small>(right brace)</small>.
+ * @throws JSONException If the object contains an invalid number.
+ */
+ String toString(int indentFactor, int indent) throws JSONException
+ {
+ int j;
+ int n = length();
+ if (n == 0)
+ {
+ return "{}";
+ }
+ Iterator keys = sortedKeys();
+ StringBuffer sb = new StringBuffer("{");
+ int newindent = indent + indentFactor;
+ Object o;
+ if (n == 1)
+ {
+ o = keys.next();
+ sb.append(quote(o.toString()));
+ sb.append(": ");
+ sb.append(valueToString(this.map.get(o), indentFactor,
+ indent));
+ }
+ else
+ {
+ while (keys.hasNext())
+ {
+ o = keys.next();
+ if (sb.length() > 1)
+ {
+ sb.append(",\n");
+ }
+ else
+ {
+ sb.append('\n');
+ }
+ for (j = 0; j < newindent; j += 1)
+ {
+ sb.append(' ');
+ }
+ sb.append(quote(o.toString()));
+ sb.append(": ");
+ sb.append(valueToString(this.map.get(o), indentFactor,
+ newindent));
+ }
+ if (sb.length() > 1)
+ {
+ sb.append('\n');
+ for (j = 0; j < indent; j += 1)
+ {
+ sb.append(' ');
+ }
+ }
+ }
+ sb.append('}');
+ return sb.toString();
+ }
+
+
+ /**
+ * Make a JSON text of an Object value. If the object has an
+ * value.toJSONString() method, then that method will be used to produce
+ * the JSON text. The method is required to produce a strictly
+ * conforming text. If the object does not contain a toJSONString
+ * method (which is the most common case), then a text will be
+ * produced by other means. If the value is an array or Collection,
+ * then a JSONArray will be made from it and its toJSONString method
+ * will be called. If the value is a MAP, then a JSONObject will be made
+ * from it and its toJSONString method will be called. Otherwise, the
+ * value's toString method will be called, and the result will be quoted.
+ * <p/>
+ * <p/>
+ * Warning: This method assumes that the data structure is acyclical.
+ *
+ * @param value The value to be serialized.
+ * @return a printable, displayable, transmittable
+ * representation of the object, beginning
+ * with <code>{</code> <small>(left brace)</small> and ending
+ * with <code>}</code> <small>(right brace)</small>.
+ * @throws JSONException If the value is or contains an invalid number.
+ */
+ static String valueToString(Object value) throws JSONException
+ {
+ if (value == null || value.equals(null))
+ {
+ return "null";
+ }
+ if (value instanceof JSONString)
+ {
+ Object o;
+ try
+ {
+ o = ((JSONString) value).toJSONString();
+ }
+ catch (Exception e)
+ {
+ throw new JSONException(e);
+ }
+ if (o instanceof String)
+ {
+ return (String) o;
+ }
+ throw new JSONException("Bad value from toJSONString: " + o);
+ }
+ if (value instanceof Number)
+ {
+ return numberToString((Number) value);
+ }
+ if (value instanceof Boolean || value instanceof JSONObject ||
+ value instanceof JSONArray)
+ {
+ return value.toString();
+ }
+ if (value instanceof Map)
+ {
+ return new JSONObject((Map) value).toString();
+ }
+ if (value instanceof Collection)
+ {
+ return new JSONArray((Collection) value).toString();
+ }
+ if (value.getClass().isArray())
+ {
+ return new JSONArray(value).toString();
+ }
+ return quote(value.toString());
+ }
+
+
+ /**
+ * Make a prettyprinted JSON text of an object value.
+ * <p/>
+ * Warning: This method assumes that the data structure is acyclical.
+ *
+ * @param value The value to be serialized.
+ * @param indentFactor The number of spaces to add to each level of
+ * indentation.
+ * @param indent The indentation of the top level.
+ * @return a printable, displayable, transmittable
+ * representation of the object, beginning
+ * with <code>{</code> <small>(left brace)</small> and ending
+ * with <code>}</code> <small>(right brace)</small>.
+ * @throws JSONException If the object contains an invalid number.
+ */
+ static String valueToString(Object value, int indentFactor, int indent)
+ throws JSONException
+ {
+ if (value == null || value.equals(null))
+ {
+ return "null";
+ }
+ try
+ {
+ if (value instanceof JSONString)
+ {
+ Object o = ((JSONString) value).toJSONString();
+ if (o instanceof String)
+ {
+ return (String) o;
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ /* forget about it */
+ }
+ if (value instanceof Number)
+ {
+ return numberToString((Number) value);
+ }
+ if (value instanceof Boolean)
+ {
+ return value.toString();
+ }
+ if (value instanceof JSONObject)
+ {
+ return ((JSONObject) value).toString(indentFactor, indent);
+ }
+ if (value instanceof JSONArray)
+ {
+ return ((JSONArray) value).toString(indentFactor, indent);
+ }
+ if (value instanceof Map)
+ {
+ return new JSONObject((Map) value).toString(indentFactor, indent);
+ }
+ if (value instanceof Collection)
+ {
+ return new JSONArray((Collection) value).toString(indentFactor, indent);
+ }
+ if (value.getClass().isArray())
+ {
+ return new JSONArray(value).toString(indentFactor, indent);
+ }
+ return quote(value.toString());
+ }
+
+
+ /**
+ * Write the contents of the JSONObject as JSON text to a writer.
+ * For compactness, no whitespace is added.
+ * <p/>
+ * Warning: This method assumes that the data structure is acyclical.
+ *
+ * @return The writer.
+ * @throws JSONException
+ */
+ public Writer write(Writer writer) throws JSONException
+ {
+ try
+ {
+ boolean b = false;
+ Iterator keys = keys();
+ writer.write('{');
+
+ while (keys.hasNext())
+ {
+ if (b)
+ {
+ writer.write(',');
+ }
+ Object k = keys.next();
+ writer.write(quote(k.toString()));
+ writer.write(':');
+ Object v = this.map.get(k);
+ if (v instanceof JSONObject)
+ {
+ ((JSONObject) v).write(writer);
+ }
+ else if (v instanceof JSONArray)
+ {
+ ((JSONArray) v).write(writer);
+ }
+ else
+ {
+ writer.write(valueToString(v));
+ }
+ b = true;
+ }
+ writer.write('}');
+ return writer;
+ }
+ catch (IOException e)
+ {
+ throw new JSONException(e);
+ }
+ }
+}
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/java/org/json/JSONString.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/json/JSONString.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/json/JSONString.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,20 @@
+package org.json;
+
+/**
+ * The <code>JSONString</code> interface allows a <code>toJSONString()</code>
+ * method so that a class can change the behavior of
+ * <code>JSONObject.toString()</code>, <code>JSONArray.toString()</code>,
+ * and <code>JSONWriter.value(</code>Object<code>)</code>. The
+ * <code>toJSONString</code> method will be used instead of the default behavior
+ * of using the Object's <code>toString()</code> method and quoting the result.
+ */
+public interface JSONString
+{
+ /**
+ * The <code>toJSONString</code> method allows a class to produce its own JSON
+ * serialization.
+ *
+ * @return A strictly syntactically correct JSON text.
+ */
+ public String toJSONString();
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/json/JSONStringer.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/json/JSONStringer.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/json/JSONStringer.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,83 @@
+package org.json;
+
+/*
+Copyright (c) 2006 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+import java.io.StringWriter;
+
+/**
+ * JSONStringer provides a quick and convenient way of producing JSON text.
+ * The texts produced strictly conform to JSON syntax rules. No whitespace is
+ * added, so the results are ready for transmission or storage. Each instance of
+ * JSONStringer can produce one JSON text.
+ * <p/>
+ * A JSONStringer instance provides a <code>value</code> method for appending
+ * values to the
+ * text, and a <code>key</code>
+ * method for adding keys before values in objects. There are <code>array</code>
+ * and <code>endArray</code> methods that make and bound array values, and
+ * <code>object</code> and <code>endObject</code> methods which make and bound
+ * object values. All of these methods return the JSONWriter instance,
+ * permitting cascade style. For example, <pre>
+ * myString = new JSONStringer()
+ * .object()
+ * .key("JSON")
+ * .value("Hello, World!")
+ * .endObject()
+ * .toString();</pre> which produces the string <pre>
+ * {"JSON":"Hello, World!"}</pre>
+ * <p/>
+ * The first method called must be <code>array</code> or <code>object</code>.
+ * There are no methods for adding commas or colons. JSONStringer adds them for
+ * you. Objects and arrays can be nested up to 20 levels deep.
+ * <p/>
+ * This can sometimes be easier than using a JSONObject to build a string.
+ *
+ * @author JSON.org
+ * @version 2008-09-18
+ */
+public class JSONStringer extends JSONWriter
+{
+ /**
+ * Make a fresh JSONStringer. It can be used to build one JSON text.
+ */
+ public JSONStringer()
+ {
+ super(new StringWriter());
+ }
+
+ /**
+ * Return the JSON text. This method is used to obtain the product of the
+ * JSONStringer instance. It will return <code>null</code> if there was a
+ * problem in the construction of the JSON text (such as the calls to
+ * <code>array</code> were not properly balanced with calls to
+ * <code>endArray</code>).
+ *
+ * @return The JSON text.
+ */
+ public String toString()
+ {
+ return this.mode == 'd' ? this.writer.toString() : null;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/json/JSONTokener.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/json/JSONTokener.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/json/JSONTokener.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,486 @@
+package org.json;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+
+/*
+Copyright (c) 2002 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+/**
+ * A JSONTokener takes a source string and extracts characters and tokens from
+ * it. It is used by the JSONObject and JSONArray constructors to parse
+ * JSON source strings.
+ *
+ * @author JSON.org
+ * @version 2008-09-18
+ */
+public class JSONTokener
+{
+
+ private int index;
+ private Reader reader;
+ private char lastChar;
+ private boolean useLastChar;
+
+
+ /**
+ * Construct a JSONTokener from a string.
+ *
+ * @param reader A reader.
+ */
+ public JSONTokener(Reader reader)
+ {
+ this.reader = reader.markSupported() ?
+ reader : new BufferedReader(reader);
+ this.useLastChar = false;
+ this.index = 0;
+ }
+
+
+ /**
+ * Construct a JSONTokener from a string.
+ *
+ * @param s A source string.
+ */
+ public JSONTokener(String s)
+ {
+ this(new StringReader(s));
+ }
+
+
+ /**
+ * Back up one character. This provides a sort of lookahead capability,
+ * so that you can test for a digit or letter before attempting to parse
+ * the next number or identifier.
+ */
+ public void back() throws JSONException
+ {
+ if (useLastChar || index <= 0)
+ {
+ throw new JSONException("Stepping back two steps is not supported");
+ }
+ index -= 1;
+ useLastChar = true;
+ }
+
+
+ /**
+ * Get the hex value of a character (base16).
+ *
+ * @param c A character between '0' and '9' or between 'A' and 'F' or
+ * between 'a' and 'f'.
+ * @return An int between 0 and 15, or -1 if c was not a hex digit.
+ */
+ public static int dehexchar(char c)
+ {
+ if (c >= '0' && c <= '9')
+ {
+ return c - '0';
+ }
+ if (c >= 'A' && c <= 'F')
+ {
+ return c - ('A' - 10);
+ }
+ if (c >= 'a' && c <= 'f')
+ {
+ return c - ('a' - 10);
+ }
+ return -1;
+ }
+
+
+ /**
+ * Determine if the source string still contains characters that next()
+ * can consume.
+ *
+ * @return true if not yet at the end of the source.
+ */
+ public boolean more() throws JSONException
+ {
+ char nextChar = next();
+ if (nextChar == 0)
+ {
+ return false;
+ }
+ back();
+ return true;
+ }
+
+
+ /**
+ * Get the next character in the source string.
+ *
+ * @return The next character, or 0 if past the end of the source string.
+ */
+ public char next() throws JSONException
+ {
+ if (this.useLastChar)
+ {
+ this.useLastChar = false;
+ if (this.lastChar != 0)
+ {
+ this.index += 1;
+ }
+ return this.lastChar;
+ }
+ int c;
+ try
+ {
+ c = this.reader.read();
+ }
+ catch (IOException exc)
+ {
+ throw new JSONException(exc);
+ }
+
+ if (c <= 0)
+ { // End of stream
+ this.lastChar = 0;
+ return 0;
+ }
+ this.index += 1;
+ this.lastChar = (char) c;
+ return this.lastChar;
+ }
+
+
+ /**
+ * Consume the next character, and check that it matches a specified
+ * character.
+ *
+ * @param c The character to match.
+ * @return The character.
+ * @throws JSONException if the character does not match.
+ */
+ public char next(char c) throws JSONException
+ {
+ char n = next();
+ if (n != c)
+ {
+ throw syntaxError("Expected '" + c + "' and instead saw '" +
+ n + "'");
+ }
+ return n;
+ }
+
+
+ /**
+ * Get the next n characters.
+ *
+ * @param n The number of characters to take.
+ * @return A string of n characters.
+ * @throws JSONException Substring bounds error if there are not
+ * n characters remaining in the source string.
+ */
+ public String next(int n) throws JSONException
+ {
+ if (n == 0)
+ {
+ return "";
+ }
+
+ char[] buffer = new char[n];
+ int pos = 0;
+
+ if (this.useLastChar)
+ {
+ this.useLastChar = false;
+ buffer[0] = this.lastChar;
+ pos = 1;
+ }
+
+ try
+ {
+ int len;
+ while ((pos < n) && ((len = reader.read(buffer, pos, n - pos)) != -1))
+ {
+ pos += len;
+ }
+ }
+ catch (IOException exc)
+ {
+ throw new JSONException(exc);
+ }
+ this.index += pos;
+
+ if (pos < n)
+ {
+ throw syntaxError("Substring bounds error");
+ }
+
+ this.lastChar = buffer[n - 1];
+ return new String(buffer);
+ }
+
+
+ /**
+ * Get the next char in the string, skipping whitespace.
+ *
+ * @return A character, or 0 if there are no more characters.
+ * @throws JSONException
+ */
+ public char nextClean() throws JSONException
+ {
+ for (; ;)
+ {
+ char c = next();
+ if (c == 0 || c > ' ')
+ {
+ return c;
+ }
+ }
+ }
+
+
+ /**
+ * Return the characters up to the next close quote character.
+ * Backslash processing is done. The formal JSON format does not
+ * allow strings in single quotes, but an implementation is allowed to
+ * accept them.
+ *
+ * @param quote The quoting character, either
+ * <code>"</code> <small>(double quote)</small> or
+ * <code>'</code> <small>(single quote)</small>.
+ * @return A String.
+ * @throws JSONException Unterminated string.
+ */
+ public String nextString(char quote) throws JSONException
+ {
+ char c;
+ StringBuffer sb = new StringBuffer();
+ for (; ;)
+ {
+ c = next();
+ switch (c)
+ {
+ case 0:
+ case'\n':
+ case'\r':
+ throw syntaxError("Unterminated string");
+ case'\\':
+ c = next();
+ switch (c)
+ {
+ case'b':
+ sb.append('\b');
+ break;
+ case't':
+ sb.append('\t');
+ break;
+ case'n':
+ sb.append('\n');
+ break;
+ case'f':
+ sb.append('\f');
+ break;
+ case'r':
+ sb.append('\r');
+ break;
+ case'u':
+ sb.append((char) Integer.parseInt(next(4), 16));
+ break;
+ case'x':
+ sb.append((char) Integer.parseInt(next(2), 16));
+ break;
+ default:
+ sb.append(c);
+ }
+ break;
+ default:
+ if (c == quote)
+ {
+ return sb.toString();
+ }
+ sb.append(c);
+ }
+ }
+ }
+
+
+ /**
+ * Get the text up but not including the specified character or the
+ * end of line, whichever comes first.
+ *
+ * @param d A delimiter character.
+ * @return A string.
+ */
+ public String nextTo(char d) throws JSONException
+ {
+ StringBuffer sb = new StringBuffer();
+ for (; ;)
+ {
+ char c = next();
+ if (c == d || c == 0 || c == '\n' || c == '\r')
+ {
+ if (c != 0)
+ {
+ back();
+ }
+ return sb.toString().trim();
+ }
+ sb.append(c);
+ }
+ }
+
+
+ /**
+ * Get the text up but not including one of the specified delimiter
+ * characters or the end of line, whichever comes first.
+ *
+ * @param delimiters A set of delimiter characters.
+ * @return A string, trimmed.
+ */
+ public String nextTo(String delimiters) throws JSONException
+ {
+ char c;
+ StringBuffer sb = new StringBuffer();
+ for (; ;)
+ {
+ c = next();
+ if (delimiters.indexOf(c) >= 0 || c == 0 ||
+ c == '\n' || c == '\r')
+ {
+ if (c != 0)
+ {
+ back();
+ }
+ return sb.toString().trim();
+ }
+ sb.append(c);
+ }
+ }
+
+
+ /**
+ * Get the next value. The value can be a Boolean, Double, Integer,
+ * JSONArray, JSONObject, Long, or String, or the JSONObject.NULL object.
+ *
+ * @return An object.
+ * @throws JSONException If syntax error.
+ */
+ public Object nextValue() throws JSONException
+ {
+ char c = nextClean();
+ String s;
+
+ switch (c)
+ {
+ case'"':
+ case'\'':
+ return nextString(c);
+ case'{':
+ back();
+ return new JSONObject(this);
+ case'[':
+ case'(':
+ back();
+ return new JSONArray(this);
+ }
+
+ /*
+ * Handle unquoted text. This could be the values true, false, or
+ * null, or it can be a number. An implementation (such as this one)
+ * is allowed to also accept non-standard forms.
+ *
+ * Accumulate characters until we reach the end of the text or a
+ * formatting character.
+ */
+
+ StringBuffer sb = new StringBuffer();
+ while (c >= ' ' && ",:]}/\\\"[{;=#".indexOf(c) < 0)
+ {
+ sb.append(c);
+ c = next();
+ }
+ back();
+
+ s = sb.toString().trim();
+ if (s.equals(""))
+ {
+ throw syntaxError("Missing value");
+ }
+ return JSONObject.stringToValue(s);
+ }
+
+
+ /**
+ * Skip characters until the next character is the requested character.
+ * If the requested character is not found, no characters are skipped.
+ *
+ * @param to A character to skip to.
+ * @return The requested character, or zero if the requested character
+ * is not found.
+ */
+ public char skipTo(char to) throws JSONException
+ {
+ char c;
+ try
+ {
+ int startIndex = this.index;
+ reader.mark(Integer.MAX_VALUE);
+ do
+ {
+ c = next();
+ if (c == 0)
+ {
+ reader.reset();
+ this.index = startIndex;
+ return c;
+ }
+ }
+ while (c != to);
+ }
+ catch (IOException exc)
+ {
+ throw new JSONException(exc);
+ }
+
+ back();
+ return c;
+ }
+
+ /**
+ * Make a JSONException to signal a syntax error.
+ *
+ * @param message The error message.
+ * @return A JSONException object, suitable for throwing
+ */
+ public JSONException syntaxError(String message)
+ {
+ return new JSONException(message + toString());
+ }
+
+
+ /**
+ * Make a printable string of this JSONTokener.
+ *
+ * @return " at character [this.index]"
+ */
+ public String toString()
+ {
+ return " at character " + index;
+ }
+}
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/java/org/json/JSONWriter.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/json/JSONWriter.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/json/JSONWriter.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,375 @@
+package org.json;
+
+import java.io.IOException;
+import java.io.Writer;
+
+/*
+Copyright (c) 2006 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+/**
+ * JSONWriter provides a quick and convenient way of producing JSON text.
+ * The texts produced strictly conform to JSON syntax rules. No whitespace is
+ * added, so the results are ready for transmission or storage. Each instance of
+ * JSONWriter can produce one JSON text.
+ * <p/>
+ * A JSONWriter instance provides a <code>value</code> method for appending
+ * values to the
+ * text, and a <code>key</code>
+ * method for adding keys before values in objects. There are <code>array</code>
+ * and <code>endArray</code> methods that make and bound array values, and
+ * <code>object</code> and <code>endObject</code> methods which make and bound
+ * object values. All of these methods return the JSONWriter instance,
+ * permitting a cascade style. For example, <pre>
+ * new JSONWriter(myWriter)
+ * .object()
+ * .key("JSON")
+ * .value("Hello, World!")
+ * .endObject();</pre> which writes <pre>
+ * {"JSON":"Hello, World!"}</pre>
+ * <p/>
+ * The first method called must be <code>array</code> or <code>object</code>.
+ * There are no methods for adding commas or colons. JSONWriter adds them for
+ * you. Objects and arrays can be nested up to 20 levels deep.
+ * <p/>
+ * This can sometimes be easier than using a JSONObject to build a string.
+ *
+ * @author JSON.org
+ * @version 2008-09-18
+ */
+public class JSONWriter
+{
+ private static final int maxdepth = 20;
+
+ /**
+ * The comma flag determines if a comma should be output before the next
+ * value.
+ */
+ private boolean comma;
+
+ /**
+ * The current mode. Values:
+ * 'a' (array),
+ * 'd' (done),
+ * 'i' (initial),
+ * 'k' (key),
+ * 'o' (object).
+ */
+ protected char mode;
+
+ /**
+ * The object/array stack.
+ */
+ private JSONObject stack[];
+
+ /**
+ * The stack top index. A value of 0 indicates that the stack is empty.
+ */
+ private int top;
+
+ /**
+ * The writer that will receive the output.
+ */
+ protected Writer writer;
+
+ /**
+ * Make a fresh JSONWriter. It can be used to build one JSON text.
+ */
+ public JSONWriter(Writer w)
+ {
+ this.comma = false;
+ this.mode = 'i';
+ this.stack = new JSONObject[maxdepth];
+ this.top = 0;
+ this.writer = w;
+ }
+
+ /**
+ * Append a value.
+ *
+ * @param s A string value.
+ * @return this
+ * @throws JSONException If the value is out of sequence.
+ */
+ private JSONWriter append(String s) throws JSONException
+ {
+ if (s == null)
+ {
+ throw new JSONException("Null pointer");
+ }
+ if (this.mode == 'o' || this.mode == 'a')
+ {
+ try
+ {
+ if (this.comma && this.mode == 'a')
+ {
+ this.writer.write(',');
+ }
+ this.writer.write(s);
+ }
+ catch (IOException e)
+ {
+ throw new JSONException(e);
+ }
+ if (this.mode == 'o')
+ {
+ this.mode = 'k';
+ }
+ this.comma = true;
+ return this;
+ }
+ throw new JSONException("Value out of sequence.");
+ }
+
+ /**
+ * Begin appending a new array. All values until the balancing
+ * <code>endArray</code> will be appended to this array. The
+ * <code>endArray</code> method must be called to mark the array's end.
+ *
+ * @return this
+ * @throws JSONException If the nesting is too deep, or if the object is
+ * started in the wrong place (for example as a key or after the end of the
+ * outermost array or object).
+ */
+ public JSONWriter array() throws JSONException
+ {
+ if (this.mode == 'i' || this.mode == 'o' || this.mode == 'a')
+ {
+ this.push(null);
+ this.append("[");
+ this.comma = false;
+ return this;
+ }
+ throw new JSONException("Misplaced array.");
+ }
+
+ /**
+ * End something.
+ *
+ * @param m Mode
+ * @param c Closing character
+ * @return this
+ * @throws JSONException If unbalanced.
+ */
+ private JSONWriter end(char m, char c) throws JSONException
+ {
+ if (this.mode != m)
+ {
+ throw new JSONException(m == 'o' ? "Misplaced endObject." :
+ "Misplaced endArray.");
+ }
+ this.pop(m);
+ try
+ {
+ this.writer.write(c);
+ }
+ catch (IOException e)
+ {
+ throw new JSONException(e);
+ }
+ this.comma = true;
+ return this;
+ }
+
+ /**
+ * End an array. This method most be called to balance calls to
+ * <code>array</code>.
+ *
+ * @return this
+ * @throws JSONException If incorrectly nested.
+ */
+ public JSONWriter endArray() throws JSONException
+ {
+ return this.end('a', ']');
+ }
+
+ /**
+ * End an object. This method most be called to balance calls to
+ * <code>object</code>.
+ *
+ * @return this
+ * @throws JSONException If incorrectly nested.
+ */
+ public JSONWriter endObject() throws JSONException
+ {
+ return this.end('k', '}');
+ }
+
+ /**
+ * Append a key. The key will be associated with the next value. In an
+ * object, every value must be preceded by a key.
+ *
+ * @param s A key string.
+ * @return this
+ * @throws JSONException If the key is out of place. For example, keys
+ * do not belong in arrays or if the key is null.
+ */
+ public JSONWriter key(String s) throws JSONException
+ {
+ if (s == null)
+ {
+ throw new JSONException("Null key.");
+ }
+ if (this.mode == 'k')
+ {
+ try
+ {
+ if (this.comma)
+ {
+ this.writer.write(',');
+ }
+ stack[top - 1].putOnce(s, Boolean.TRUE);
+ this.writer.write(JSONObject.quote(s));
+ this.writer.write(':');
+ this.comma = false;
+ this.mode = 'o';
+ return this;
+ }
+ catch (IOException e)
+ {
+ throw new JSONException(e);
+ }
+ }
+ throw new JSONException("Misplaced key.");
+ }
+
+
+ /**
+ * Begin appending a new object. All keys and values until the balancing
+ * <code>endObject</code> will be appended to this object. The
+ * <code>endObject</code> method must be called to mark the object's end.
+ *
+ * @return this
+ * @throws JSONException If the nesting is too deep, or if the object is
+ * started in the wrong place (for example as a key or after the end of the
+ * outermost array or object).
+ */
+ public JSONWriter object() throws JSONException
+ {
+ if (this.mode == 'i')
+ {
+ this.mode = 'o';
+ }
+ if (this.mode == 'o' || this.mode == 'a')
+ {
+ this.append("{");
+ this.push(new JSONObject());
+ this.comma = false;
+ return this;
+ }
+ throw new JSONException("Misplaced object.");
+
+ }
+
+
+ /**
+ * Pop an array or object scope.
+ *
+ * @param c The scope to close.
+ * @throws JSONException If nesting is wrong.
+ */
+ private void pop(char c) throws JSONException
+ {
+ if (this.top <= 0)
+ {
+ throw new JSONException("Nesting error.");
+ }
+ char m = this.stack[this.top - 1] == null ? 'a' : 'k';
+ if (m != c)
+ {
+ throw new JSONException("Nesting error.");
+ }
+ this.top -= 1;
+ this.mode = this.top == 0 ? 'd' : this.stack[this.top - 1] == null ? 'a' : 'k';
+ }
+
+ /**
+ * Push an array or object scope.
+ *
+ * @param c The scope to open.
+ * @throws JSONException If nesting is too deep.
+ */
+ private void push(JSONObject jo) throws JSONException
+ {
+ if (this.top >= maxdepth)
+ {
+ throw new JSONException("Nesting too deep.");
+ }
+ this.stack[this.top] = jo;
+ this.mode = jo == null ? 'a' : 'k';
+ this.top += 1;
+ }
+
+
+ /**
+ * Append either the value <code>true</code> or the value
+ * <code>false</code>.
+ *
+ * @param b A boolean.
+ * @return this
+ * @throws JSONException
+ */
+ public JSONWriter value(boolean b) throws JSONException
+ {
+ return this.append(b ? "true" : "false");
+ }
+
+ /**
+ * Append a double value.
+ *
+ * @param d A double.
+ * @return this
+ * @throws JSONException If the number is not finite.
+ */
+ public JSONWriter value(double d) throws JSONException
+ {
+ return this.value(new Double(d));
+ }
+
+ /**
+ * Append a long value.
+ *
+ * @param l A long.
+ * @return this
+ * @throws JSONException
+ */
+ public JSONWriter value(long l) throws JSONException
+ {
+ return this.append(Long.toString(l));
+ }
+
+
+ /**
+ * Append an object value.
+ *
+ * @param o The object to append. It can be null, or a Boolean, Number,
+ * String, JSONObject, or JSONArray, or an object with a toJSONString()
+ * method.
+ * @return this
+ * @throws JSONException If the value is out of sequence.
+ */
+ public JSONWriter value(Object o) throws JSONException
+ {
+ return this.append(JSONObject.valueToString(o));
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/json/Test.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/json/Test.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/json/Test.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,685 @@
+package org.json;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
+import java.io.StringWriter;
+
+/**
+ * Test class. This file is not formally a member of the org.json library.
+ * It is just a casual test tool.
+ */
+public class Test
+{
+
+ /**
+ * Entry point.
+ *
+ * @param args
+ */
+ public static void main(String args[])
+ {
+ Iterator it;
+ JSONArray a;
+ JSONObject j;
+ JSONStringer jj;
+ String s;
+
+/**
+ * Obj is a typical class that implements JSONString. It also
+ * provides some beanie methods that can be used to
+ * construct a JSONObject. It also demonstrates constructing
+ * a JSONObject with an array of names.
+ */
+ class Obj implements JSONString
+ {
+ public String aString;
+ public double aNumber;
+ public boolean aBoolean;
+
+ public Obj(String string, double n, boolean b)
+ {
+ this.aString = string;
+ this.aNumber = n;
+ this.aBoolean = b;
+ }
+
+ public double getNumber()
+ {
+ return this.aNumber;
+ }
+
+ public String getString()
+ {
+ return this.aString;
+ }
+
+ public boolean isBoolean()
+ {
+ return this.aBoolean;
+ }
+
+ public String getBENT()
+ {
+ return "All uppercase key";
+ }
+
+ public String getX()
+ {
+ return "x";
+ }
+
+ public String toJSONString()
+ {
+ return "{" + JSONObject.quote(this.aString) + ":" +
+ JSONObject.doubleToString(this.aNumber) + "}";
+ }
+
+ public String toString()
+ {
+ return this.getString() + " " + this.getNumber() + " " +
+ this.isBoolean() + "." + this.getBENT() + " " + this.getX();
+ }
+ }
+
+ Obj obj = new Obj("A beany object", 42, true);
+
+ try
+ {
+ j = XML.toJSONObject("<![CDATA[This is a collection of test patterns and examples for org.json.]]> Ignore the stuff past the end. ");
+ System.out.println(j.toString());
+
+ s = "<recipe name=\"bread\" prep_time=\"5 mins\" cook_time=\"3 hours\"> <title>Basic bread</title> <ingredient amount=\"8\" unit=\"dL\">Flour</ingredient> <ingredient amount=\"10\" unit=\"grams\">Yeast</ingredient> <ingredient amount=\"4\" unit=\"dL\" state=\"warm\">Water</ingredient> <ingredient amount=\"1\" unit=\"teaspoon\">Salt</ingredient> <instructions> <step>Mix all ingredients together.</step> <step>Knead thoroughly.</step> <step>Cover with a cloth, and leave for one hour in warm room.</step> <step>Knead again.</step> <step>Place in a bread baking tin.</step> <step>Cover with a cloth, and leave for one hour in warm room.</step> <step>Bake in the oven at 180(degrees)C for 30 minutes.</step> </instructions> </recipe> ";
+ j = XML.toJSONObject(s);
+ System.out.println(j.toString(4));
+ System.out.println();
+
+ j = JSONML.toJSONObject(s);
+ System.out.println(j.toString());
+ System.out.println(JSONML.toString(j));
+ System.out.println();
+
+ a = JSONML.toJSONArray(s);
+ System.out.println(a.toString(4));
+ System.out.println(JSONML.toString(a));
+ System.out.println();
+
+ s = "<div id=\"demo\" class=\"JSONML\"><p>JSONML is a transformation between <b>JSON</b> and <b>XML</b> that preserves ordering of document features.</p><p>JSONML can work with JSON arrays or JSON objects.</p><p>Three<br/>little<br/>words</p></div>";
+ j = JSONML.toJSONObject(s);
+ System.out.println(j.toString(4));
+ System.out.println(JSONML.toString(j));
+ System.out.println();
+
+ a = JSONML.toJSONArray(s);
+ System.out.println(a.toString(4));
+ System.out.println(JSONML.toString(a));
+ System.out.println();
+
+ s = "<person created=\"2006-11-11T19:23\" modified=\"2006-12-31T23:59\">\n <firstName>Robert</firstName>\n <lastName>Smith</lastName>\n <address type=\"home\">\n <street>12345 Sixth Ave</street>\n <city>Anytown</city>\n <state>CA</state>\n <postalCode>98765-4321</postalCode>\n </address>\n </person>";
+ j = XML.toJSONObject(s);
+ System.out.println(j.toString(4));
+
+ j = new JSONObject(obj);
+ System.out.println(j.toString());
+
+ s = "{ \"entity\": { \"imageURL\": \"\", \"name\": \"IXXXXXXXXXXXXX\", \"id\": 12336, \"ratingCount\": null, \"averageRating\": null } }";
+ j = new JSONObject(s);
+ System.out.println(j.toString(2));
+
+ jj = new JSONStringer();
+ s = jj
+ .object()
+ .key("single")
+ .value("MARIE HAA'S")
+ .key("Johnny")
+ .value("MARIE HAA\\'S")
+ .key("foo")
+ .value("bar")
+ .key("baz")
+ .array()
+ .object()
+ .key("quux")
+ .value("Thanks, Josh!")
+ .endObject()
+ .endArray()
+ .key("obj keys")
+ .value(JSONObject.getNames(obj))
+ .endObject()
+ .toString();
+ System.out.println(s);
+
+ System.out.println(new JSONStringer()
+ .object()
+ .key("a")
+ .array()
+ .array()
+ .array()
+ .value("b")
+ .endArray()
+ .endArray()
+ .endArray()
+ .endObject()
+ .toString());
+
+ jj = new JSONStringer();
+ jj.array();
+ jj.value(1);
+ jj.array();
+ jj.value(null);
+ jj.array();
+ jj.object();
+ jj.key("empty-array").array().endArray();
+ jj.key("answer").value(42);
+ jj.key("null").value(null);
+ jj.key("false").value(false);
+ jj.key("true").value(true);
+ jj.key("big").value(123456789e+88);
+ jj.key("small").value(123456789e-88);
+ jj.key("empty-object").object().endObject();
+ jj.key("long");
+ jj.value(9223372036854775807L);
+ jj.endObject();
+ jj.value("two");
+ jj.endArray();
+ jj.value(true);
+ jj.endArray();
+ jj.value(98.6);
+ jj.value(-100.0);
+ jj.object();
+ jj.endObject();
+ jj.object();
+ jj.key("one");
+ jj.value(1.00);
+ jj.endObject();
+ jj.value(obj);
+ jj.endArray();
+ System.out.println(jj.toString());
+
+ System.out.println(new JSONArray(jj.toString()).toString(4));
+
+ int ar[] = {1, 2, 3};
+ JSONArray ja = new JSONArray(ar);
+ System.out.println(ja.toString());
+
+ String sa[] = {"aString", "aNumber", "aBoolean"};
+ j = new JSONObject(obj, sa);
+ j.put("Testing JSONString interface", obj);
+ System.out.println(j.toString(4));
+
+ j = new JSONObject("{slashes: '///', closetag: '</script>', backslash:'\\\\', ei: {quotes: '\"\\''},eo: {a: '\"quoted\"', b:\"don't\"}, quotes: [\"'\", '\"']}");
+ System.out.println(j.toString(2));
+ System.out.println(XML.toString(j));
+ System.out.println("");
+
+ j = new JSONObject(
+ "{foo: [true, false,9876543210, 0.0, 1.00000001, 1.000000000001, 1.00000000000000001," +
+ " .00000000000000001, 2.00, 0.1, 2e100, -32,[],{}, \"string\"], " +
+ " to : null, op : 'Good'," +
+ "ten:10} postfix comment");
+ j.put("String", "98.6");
+ j.put("JSONObject", new JSONObject());
+ j.put("JSONArray", new JSONArray());
+ j.put("int", 57);
+ j.put("double", 123456789012345678901234567890.);
+ j.put("true", true);
+ j.put("false", false);
+ j.put("null", JSONObject.NULL);
+ j.put("bool", "true");
+ j.put("zero", -0.0);
+ j.put("\\u2028", "\u2028");
+ j.put("\\u2029", "\u2029");
+ a = j.getJSONArray("foo");
+ a.put(666);
+ a.put(2001.99);
+ a.put("so \"fine\".");
+ a.put("so <fine>.");
+ a.put(true);
+ a.put(false);
+ a.put(new JSONArray());
+ a.put(new JSONObject());
+ j.put("keys", JSONObject.getNames(j));
+ System.out.println(j.toString(4));
+ System.out.println(XML.toString(j));
+
+ System.out.println("String: " + j.getDouble("String"));
+ System.out.println(" bool: " + j.getBoolean("bool"));
+ System.out.println(" to: " + j.getString("to"));
+ System.out.println(" true: " + j.getString("true"));
+ System.out.println(" foo: " + j.getJSONArray("foo"));
+ System.out.println(" op: " + j.getString("op"));
+ System.out.println(" ten: " + j.getInt("ten"));
+ System.out.println(" oops: " + j.optBoolean("oops"));
+
+ s = "<xml one = 1 two=' \"2\" '><five></five>First \u0009<content><five></five> This is \"content\". <three> 3 </three>JSON does not preserve the sequencing of elements and contents.<three> III </three> <three> T H R E E</three><four/>Content text is an implied structure in XML. <six content=\"6\"/>JSON does not have implied structure:<seven>7</seven>everything is explicit.<![CDATA[CDATA blocks<are><supported>!]]></xml>";
+ j = XML.toJSONObject(s);
+ System.out.println(j.toString(2));
+ System.out.println(XML.toString(j));
+ System.out.println("");
+
+ ja = JSONML.toJSONArray(s);
+ System.out.println(ja.toString(4));
+ System.out.println(JSONML.toString(ja));
+ System.out.println("");
+
+ s = "<xml do='0'>uno<a re='1' mi='2'>dos<b fa='3'/>tres<c>true</c>quatro</a>cinqo<d>seis<e/></d></xml>";
+ ja = JSONML.toJSONArray(s);
+ System.out.println(ja.toString(4));
+ System.out.println(JSONML.toString(ja));
+ System.out.println("");
+
+ s = "<mapping><empty/> <class name = \"Customer\"> <field name = \"ID\" type = \"string\"> <bind-xml name=\"ID\" node=\"attribute\"/> </field> <field name = \"FirstName\" type = \"FirstName\"/> <field name = \"MI\" type = \"MI\"/> <field name = \"LastName\" type = \"LastName\"/> </class> <class name = \"FirstName\"> <field name = \"text\"> <bind-xml name = \"text\" node = \"text\"/> </field> </class> <class name = \"MI\"> <field name = \"text\"> <bind-xml name = \"text\" node = \"text\"/> </field> </class> <class name = \"LastName\"> <field name = \"text\"> <bind-xml name = \"text\" node = \"text\"/> </field> </class></mapping>";
+ j = XML.toJSONObject(s);
+
+ System.out.println(j.toString(2));
+ System.out.println(XML.toString(j));
+ System.out.println("");
+ ja = JSONML.toJSONArray(s);
+ System.out.println(ja.toString(4));
+ System.out.println(JSONML.toString(ja));
+ System.out.println("");
+
+ j = XML.toJSONObject("<?xml version=\"1.0\" ?><Book Author=\"Anonymous\"><Title>Sample Book</Title><Chapter id=\"1\">This is chapter 1. It is not very long or interesting.</Chapter><Chapter id=\"2\">This is chapter 2. Although it is longer than chapter 1, it is not any more interesting.</Chapter></Book>");
+ System.out.println(j.toString(2));
+ System.out.println(XML.toString(j));
+ System.out.println("");
+
+ j = XML.toJSONObject("<!DOCTYPE bCard 'http://www.cs.caltech.edu/~adam/schemas/bCard'><bCard><?xml default bCard firstname = '' lastname = '' company = '' email = '' homepage = ''?><bCard firstname = 'Rohit' lastname = 'Khare' company = 'MCI' email = 'khare at mci.net' homepage = 'http://pest.w3.org/'/><bCard firstname = 'Adam' lastname = 'Rifkin' company = 'Caltech Infospheres Project' email = 'adam at cs.caltech.edu' homepage = 'http://www.cs.caltech.edu/~adam/'/></bCard>");
+ System.out.println(j.toString(2));
+ System.out.println(XML.toString(j));
+ System.out.println("");
+
+ j = XML.toJSONObject("<?xml version=\"1.0\"?><customer> <firstName> <text>Fred</text> </firstName> <ID>fbs0001</ID> <lastName> <text>Scerbo</text> </lastName> <MI> <text>B</text> </MI></customer>");
+ System.out.println(j.toString(2));
+ System.out.println(XML.toString(j));
+ System.out.println("");
+
+ j = XML.toJSONObject("<!ENTITY tp-address PUBLIC '-//ABC University::Special Collections Library//TEXT (titlepage: name and address)//EN' 'tpspcoll.sgm'><list type='simple'><head>Repository Address </head><item>Special Collections Library</item><item>ABC University</item><item>Main Library, 40 Circle Drive</item><item>Ourtown, Pennsylvania</item><item>17654 USA</item></list>");
+ System.out.println(j.toString());
+ System.out.println(XML.toString(j));
+ System.out.println("");
+
+ j = XML.toJSONObject("<test intertag status=ok><empty/>deluxe<blip sweet=true>&"toot"&toot;A</blip><x>eks</x><w>bonus</w><w>bonus2</w></test>");
+ System.out.println(j.toString(2));
+ System.out.println(XML.toString(j));
+ System.out.println("");
+
+ j = HTTP.toJSONObject("GET / HTTP/1.0\nAccept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*\nAccept-Language: en-us\nUser-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90; T312461; Q312461)\nHost: www.nokko.com\nConnection: keep-alive\nAccept-encoding: gzip, deflate\n");
+ System.out.println(j.toString(2));
+ System.out.println(HTTP.toString(j));
+ System.out.println("");
+
+ j = HTTP.toJSONObject("HTTP/1.1 200 Oki Doki\nDate: Sun, 26 May 2002 17:38:52 GMT\nServer: Apache/1.3.23 (Unix) mod_perl/1.26\nKeep-Alive: timeout=15, max=100\nConnection: Keep-Alive\nTransfer-Encoding: chunked\nContent-Type: text/html\n");
+ System.out.println(j.toString(2));
+ System.out.println(HTTP.toString(j));
+ System.out.println("");
+
+ j = new JSONObject("{nix: null, nux: false, null: 'null', 'Request-URI': '/', Method: 'GET', 'HTTP-Version': 'HTTP/1.0'}");
+ System.out.println(j.toString(2));
+ System.out.println("isNull: " + j.isNull("nix"));
+ System.out.println(" has: " + j.has("nix"));
+ System.out.println(XML.toString(j));
+ System.out.println(HTTP.toString(j));
+ System.out.println("");
+
+ j = XML.toJSONObject("<?xml version='1.0' encoding='UTF-8'?>" + "\n\n" + "<SOAP-ENV:Envelope" +
+ " xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"" +
+ " xmlns:xsi=\"http://www.w3.org/1999/XMLSchema-instance\"" +
+ " xmlns:xsd=\"http://www.w3.org/1999/XMLSchema\">" +
+ "<SOAP-ENV:Body><ns1:doGoogleSearch" +
+ " xmlns:ns1=\"urn:GoogleSearch\"" +
+ " SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">" +
+ "<key xsi:type=\"xsd:string\">GOOGLEKEY</key> <q" +
+ " xsi:type=\"xsd:string\">'+search+'</q> <start" +
+ " xsi:type=\"xsd:int\">0</start> <maxResults" +
+ " xsi:type=\"xsd:int\">10</maxResults> <filter" +
+ " xsi:type=\"xsd:boolean\">true</filter> <restrict" +
+ " xsi:type=\"xsd:string\"></restrict> <safeSearch" +
+ " xsi:type=\"xsd:boolean\">false</safeSearch> <lr" +
+ " xsi:type=\"xsd:string\"></lr> <ie" +
+ " xsi:type=\"xsd:string\">latin1</ie> <oe" +
+ " xsi:type=\"xsd:string\">latin1</oe>" +
+ "</ns1:doGoogleSearch>" +
+ "</SOAP-ENV:Body></SOAP-ENV:Envelope>");
+ System.out.println(j.toString(2));
+ System.out.println(XML.toString(j));
+ System.out.println("");
+
+ j = new JSONObject("{Envelope: {Body: {\"ns1:doGoogleSearch\": {oe: \"latin1\", filter: true, q: \"'+search+'\", key: \"GOOGLEKEY\", maxResults: 10, \"SOAP-ENV:encodingStyle\": \"http://schemas.xmlsoap.org/soap/encoding/\", start: 0, ie: \"latin1\", safeSearch:false, \"xmlns:ns1\": \"urn:GoogleSearch\"}}}}");
+ System.out.println(j.toString(2));
+ System.out.println(XML.toString(j));
+ System.out.println("");
+
+ j = CookieList.toJSONObject(" f%oo = b+l=ah ; o;n%40e = t.wo ");
+ System.out.println(j.toString(2));
+ System.out.println(CookieList.toString(j));
+ System.out.println("");
+
+ j = Cookie.toJSONObject("f%oo=blah; secure ;expires = April 24, 2002");
+ System.out.println(j.toString(2));
+ System.out.println(Cookie.toString(j));
+ System.out.println("");
+
+ j = new JSONObject("{script: 'It is not allowed in HTML to send a close script tag in a string<script>because it confuses browsers</script>so we insert a backslash before the /'}");
+ System.out.println(j.toString());
+ System.out.println("");
+
+ JSONTokener jt = new JSONTokener("{op:'test', to:'session', pre:1}{op:'test', to:'session', pre:2}");
+ j = new JSONObject(jt);
+ System.out.println(j.toString());
+ System.out.println("pre: " + j.optInt("pre"));
+ int i = jt.skipTo('{');
+ System.out.println(i);
+ j = new JSONObject(jt);
+ System.out.println(j.toString());
+ System.out.println("");
+
+ a = CDL.toJSONArray("No quotes, 'Single Quotes', \"Double Quotes\"\n1,'2',\"3\"\n,'It is \"good,\"', \"It works.\"\n\n");
+
+ System.out.println(CDL.toString(a));
+ System.out.println("");
+ System.out.println(a.toString(4));
+ System.out.println("");
+
+ a = new JSONArray(" [\"<escape>\", next is an implied null , , ok,] ");
+ System.out.println(a.toString());
+ System.out.println("");
+ System.out.println(XML.toString(a));
+ System.out.println("");
+
+ j = new JSONObject("{ fun => with non-standard forms ; forgiving => This package can be used to parse formats that are similar to but not stricting conforming to JSON; why=To make it easier to migrate existing data to JSON,one = [[1.00]]; uno=[[{1=>1}]];'+':+6e66 ;pluses=+++;empty = '' , 'double':0.666,true: TRUE, false: FALSE, null=NULL;[true] = [[!,@;*]]; string=> o. k. ; \r oct=0666; hex=0x666; dec=666; o=0999; noh=0x0x}");
+ System.out.println(j.toString(4));
+ System.out.println("");
+ if (j.getBoolean("true") && !j.getBoolean("false"))
+ {
+ System.out.println("It's all good");
+ }
+
+ System.out.println("");
+ j = new JSONObject(j, new String[]{"dec", "oct", "hex", "missing"});
+ System.out.println(j.toString(4));
+
+ System.out.println("");
+ System.out.println(new JSONStringer().array().value(a).value(j).endArray());
+
+ j = new JSONObject("{string: \"98.6\", long: 2147483648, int: 2147483647, longer: 9223372036854775807, double: 9223372036854775808}");
+ System.out.println(j.toString(4));
+
+ System.out.println("\ngetInt");
+ System.out.println("int " + j.getInt("int"));
+ System.out.println("long " + j.getInt("long"));
+ System.out.println("longer " + j.getInt("longer"));
+ System.out.println("double " + j.getInt("double"));
+ System.out.println("string " + j.getInt("string"));
+
+ System.out.println("\ngetLong");
+ System.out.println("int " + j.getLong("int"));
+ System.out.println("long " + j.getLong("long"));
+ System.out.println("longer " + j.getLong("longer"));
+ System.out.println("double " + j.getLong("double"));
+ System.out.println("string " + j.getLong("string"));
+
+ System.out.println("\ngetDouble");
+ System.out.println("int " + j.getDouble("int"));
+ System.out.println("long " + j.getDouble("long"));
+ System.out.println("longer " + j.getDouble("longer"));
+ System.out.println("double " + j.getDouble("double"));
+ System.out.println("string " + j.getDouble("string"));
+
+ j.put("good sized", 9223372036854775807L);
+ System.out.println(j.toString(4));
+
+ a = new JSONArray("[2147483647, 2147483648, 9223372036854775807, 9223372036854775808]");
+ System.out.println(a.toString(4));
+
+ System.out.println("\nKeys: ");
+ it = j.keys();
+ while (it.hasNext())
+ {
+ s = (String) it.next();
+ System.out.println(s + ": " + j.getString(s));
+ }
+
+
+ System.out.println("\naccumulate: ");
+ j = new JSONObject();
+ j.accumulate("stooge", "Curly");
+ j.accumulate("stooge", "Larry");
+ j.accumulate("stooge", "Moe");
+ a = j.getJSONArray("stooge");
+ a.put(5, "Shemp");
+ System.out.println(j.toString(4));
+
+ System.out.println("\nwrite:");
+ System.out.println(j.write(new StringWriter()));
+
+ s = "<xml empty><a></a><a>1</a><a>22</a><a>333</a></xml>";
+ j = XML.toJSONObject(s);
+ System.out.println(j.toString(4));
+ System.out.println(XML.toString(j));
+
+ s = "<book><chapter>Content of the first chapter</chapter><chapter>Content of the second chapter <chapter>Content of the first subchapter</chapter> <chapter>Content of the second subchapter</chapter></chapter><chapter>Third Chapter</chapter></book>";
+ j = XML.toJSONObject(s);
+ System.out.println(j.toString(4));
+ System.out.println(XML.toString(j));
+
+ a = JSONML.toJSONArray(s);
+ System.out.println(a.toString(4));
+ System.out.println(JSONML.toString(a));
+
+ Collection c = null;
+ Map m = null;
+
+ j = new JSONObject(m);
+ a = new JSONArray(c);
+ j.append("stooge", "Joe DeRita");
+ j.append("stooge", "Shemp");
+ j.accumulate("stooges", "Curly");
+ j.accumulate("stooges", "Larry");
+ j.accumulate("stooges", "Moe");
+ j.accumulate("stoogearray", j.get("stooges"));
+ j.put("map", m);
+ j.put("collection", c);
+ j.put("array", a);
+ a.put(m);
+ a.put(c);
+ System.out.println(j.toString(4));
+
+ s = "{plist=Apple; AnimalSmells = { pig = piggish; lamb = lambish; worm = wormy; }; AnimalSounds = { pig = oink; lamb = baa; worm = baa; Lisa = \"Why is the worm talking like a lamb?\" } ; AnimalColors = { pig = pink; lamb = black; worm = pink; } } ";
+ j = new JSONObject(s);
+ System.out.println(j.toString(4));
+
+ s = " (\"San Francisco\", \"New York\", \"Seoul\", \"London\", \"Seattle\", \"Shanghai\")";
+ a = new JSONArray(s);
+ System.out.println(a.toString());
+
+ s = "<a ichi='1' ni='2'><b>The content of b</b> and <c san='3'>The content of c</c><d>do</d><e></e><d>re</d><f/><d>mi</d></a>";
+ j = XML.toJSONObject(s);
+
+ System.out.println(j.toString(2));
+ System.out.println(XML.toString(j));
+ System.out.println("");
+ ja = JSONML.toJSONArray(s);
+ System.out.println(ja.toString(4));
+ System.out.println(JSONML.toString(ja));
+ System.out.println("");
+
+
+ System.out.println("\nTesting Exceptions: ");
+
+ System.out.print("Exception: ");
+ try
+ {
+ a = new JSONArray();
+ a.put(Double.NEGATIVE_INFINITY);
+ a.put(Double.NaN);
+ System.out.println(a.toString());
+ }
+ catch (Exception e)
+ {
+ System.out.println(e);
+ }
+ System.out.print("Exception: ");
+ try
+ {
+ System.out.println(j.getDouble("stooge"));
+ }
+ catch (Exception e)
+ {
+ System.out.println(e);
+ }
+ System.out.print("Exception: ");
+ try
+ {
+ System.out.println(j.getDouble("howard"));
+ }
+ catch (Exception e)
+ {
+ System.out.println(e);
+ }
+ System.out.print("Exception: ");
+ try
+ {
+ System.out.println(j.put(null, "howard"));
+ }
+ catch (Exception e)
+ {
+ System.out.println(e);
+ }
+ System.out.print("Exception: ");
+ try
+ {
+ System.out.println(a.getDouble(0));
+ }
+ catch (Exception e)
+ {
+ System.out.println(e);
+ }
+ System.out.print("Exception: ");
+ try
+ {
+ System.out.println(a.get(-1));
+ }
+ catch (Exception e)
+ {
+ System.out.println(e);
+ }
+ System.out.print("Exception: ");
+ try
+ {
+ System.out.println(a.put(Double.NaN));
+ }
+ catch (Exception e)
+ {
+ System.out.println(e);
+ }
+ System.out.print("Exception: ");
+ try
+ {
+ j = XML.toJSONObject("<a><b> ");
+ }
+ catch (Exception e)
+ {
+ System.out.println(e);
+ }
+ System.out.print("Exception: ");
+ try
+ {
+ j = XML.toJSONObject("<a></b> ");
+ }
+ catch (Exception e)
+ {
+ System.out.println(e);
+ }
+ System.out.print("Exception: ");
+ try
+ {
+ j = XML.toJSONObject("<a></a ");
+ }
+ catch (Exception e)
+ {
+ System.out.println(e);
+ }
+ System.out.print("Exception: ");
+ try
+ {
+ ja = new JSONArray(new Object());
+ System.out.println(ja.toString());
+ }
+ catch (Exception e)
+ {
+ System.out.println(e);
+ }
+
+ System.out.print("Exception: ");
+ try
+ {
+ s = "[)";
+ a = new JSONArray(s);
+ System.out.println(a.toString());
+ }
+ catch (Exception e)
+ {
+ System.out.println(e);
+ }
+
+ System.out.print("Exception: ");
+ try
+ {
+ s = "<xml";
+ ja = JSONML.toJSONArray(s);
+ System.out.println(ja.toString(4));
+ }
+ catch (Exception e)
+ {
+ System.out.println(e);
+ }
+
+ System.out.print("Exception: ");
+ try
+ {
+ s = "<right></wrong>";
+ ja = JSONML.toJSONArray(s);
+ System.out.println(ja.toString(4));
+ }
+ catch (Exception e)
+ {
+ System.out.println(e);
+ }
+
+ System.out.print("Exception: ");
+ try
+ {
+ s = "{\"koda\": true, \"koda\": true}";
+ j = new JSONObject(s);
+ System.out.println(j.toString(4));
+ }
+ catch (Exception e)
+ {
+ System.out.println(e);
+ }
+
+ System.out.print("Exception: ");
+ try
+ {
+ jj = new JSONStringer();
+ s = jj
+ .object()
+ .key("bosanda")
+ .value("MARIE HAA'S")
+ .key("bosanda")
+ .value("MARIE HAA\\'S")
+ .endObject()
+ .toString();
+ System.out.println(j.toString(4));
+ }
+ catch (Exception e)
+ {
+ System.out.println(e);
+ }
+ }
+ catch (Exception e)
+ {
+ System.out.println(e.toString());
+ }
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/json/XML.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/json/XML.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/json/XML.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,544 @@
+package org.json;
+
+/*
+Copyright (c) 2002 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+import java.util.Iterator;
+
+
+/**
+ * This provides static methods to convert an XML text into a JSONObject,
+ * and to covert a JSONObject into an XML text.
+ *
+ * @author JSON.org
+ * @version 2008-09-18
+ */
+public class XML
+{
+
+ /**
+ * The Character '&'.
+ */
+ public static final Character AMP = new Character('&');
+
+ /**
+ * The Character '''.
+ */
+ public static final Character APOS = new Character('\'');
+
+ /**
+ * The Character '!'.
+ */
+ public static final Character BANG = new Character('!');
+
+ /**
+ * The Character '='.
+ */
+ public static final Character EQ = new Character('=');
+
+ /**
+ * The Character '>'.
+ */
+ public static final Character GT = new Character('>');
+
+ /**
+ * The Character '<'.
+ */
+ public static final Character LT = new Character('<');
+
+ /**
+ * The Character '?'.
+ */
+ public static final Character QUEST = new Character('?');
+
+ /**
+ * The Character '"'.
+ */
+ public static final Character QUOT = new Character('"');
+
+ /**
+ * The Character '/'.
+ */
+ public static final Character SLASH = new Character('/');
+
+ /**
+ * Replace special characters with XML escapes:
+ * <pre>
+ * & <small>(ampersand)</small> is replaced by &amp;
+ * < <small>(less than)</small> is replaced by &lt;
+ * > <small>(greater than)</small> is replaced by &gt;
+ * " <small>(double quote)</small> is replaced by &quot;
+ * </pre>
+ *
+ * @param string The string to be escaped.
+ * @return The escaped string.
+ */
+ public static String escape(String string)
+ {
+ StringBuffer sb = new StringBuffer();
+ for (int i = 0, len = string.length(); i < len; i++)
+ {
+ char c = string.charAt(i);
+ switch (c)
+ {
+ case'&':
+ sb.append("&");
+ break;
+ case'<':
+ sb.append("<");
+ break;
+ case'>':
+ sb.append(">");
+ break;
+ case'"':
+ sb.append(""");
+ break;
+ default:
+ sb.append(c);
+ }
+ }
+ return sb.toString();
+ }
+
+ /**
+ * Throw an exception if the string contains whitespace.
+ * Whitespace is not allowed in tagNames and attributes.
+ *
+ * @param string
+ * @throws JSONException
+ */
+ public static void noSpace(String string) throws JSONException
+ {
+ int i, length = string.length();
+ if (length == 0)
+ {
+ throw new JSONException("Empty string.");
+ }
+ for (i = 0; i < length; i += 1)
+ {
+ if (Character.isWhitespace(string.charAt(i)))
+ {
+ throw new JSONException("'" + string +
+ "' contains a space character.");
+ }
+ }
+ }
+
+ /**
+ * Scan the content following the named tag, attaching it to the context.
+ *
+ * @param x The XMLTokener containing the source string.
+ * @param context The JSONObject that will include the new material.
+ * @param name The tag name.
+ * @return true if the close tag is processed.
+ * @throws JSONException
+ */
+ private static boolean parse(XMLTokener x, JSONObject context,
+ String name) throws JSONException
+ {
+ char c;
+ int i;
+ String n;
+ JSONObject o = null;
+ String s;
+ Object t;
+
+// Test for and skip past these forms:
+// <!-- ... -->
+// <! ... >
+// <![ ... ]]>
+// <? ... ?>
+// Report errors for these forms:
+// <>
+// <=
+// <<
+
+ t = x.nextToken();
+
+// <!
+
+ if (t == BANG)
+ {
+ c = x.next();
+ if (c == '-')
+ {
+ if (x.next() == '-')
+ {
+ x.skipPast("-->");
+ return false;
+ }
+ x.back();
+ }
+ else if (c == '[')
+ {
+ t = x.nextToken();
+ if (t.equals("CDATA"))
+ {
+ if (x.next() == '[')
+ {
+ s = x.nextCDATA();
+ if (s.length() > 0)
+ {
+ context.accumulate("content", s);
+ }
+ return false;
+ }
+ }
+ throw x.syntaxError("Expected 'CDATA['");
+ }
+ i = 1;
+ do
+ {
+ t = x.nextMeta();
+ if (t == null)
+ {
+ throw x.syntaxError("Missing '>' after '<!'.");
+ }
+ else if (t == LT)
+ {
+ i += 1;
+ }
+ else if (t == GT)
+ {
+ i -= 1;
+ }
+ }
+ while (i > 0);
+ return false;
+ }
+ else if (t == QUEST)
+ {
+
+// <?
+
+ x.skipPast("?>");
+ return false;
+ }
+ else if (t == SLASH)
+ {
+
+// Close tag </
+
+ t = x.nextToken();
+ if (name == null)
+ {
+ throw x.syntaxError("Mismatched close tag" + t);
+ }
+ if (!t.equals(name))
+ {
+ throw x.syntaxError("Mismatched " + name + " and " + t);
+ }
+ if (x.nextToken() != GT)
+ {
+ throw x.syntaxError("Misshaped close tag");
+ }
+ return true;
+
+ }
+ else if (t instanceof Character)
+ {
+ throw x.syntaxError("Misshaped tag");
+
+// Open tag <
+
+ }
+ else
+ {
+ n = (String) t;
+ t = null;
+ o = new JSONObject();
+ for (; ;)
+ {
+ if (t == null)
+ {
+ t = x.nextToken();
+ }
+
+// attribute = value
+
+ if (t instanceof String)
+ {
+ s = (String) t;
+ t = x.nextToken();
+ if (t == EQ)
+ {
+ t = x.nextToken();
+ if (!(t instanceof String))
+ {
+ throw x.syntaxError("Missing value");
+ }
+ o.accumulate(s, JSONObject.stringToValue((String) t));
+ t = null;
+ }
+ else
+ {
+ o.accumulate(s, "");
+ }
+
+// Empty tag <.../>
+
+ }
+ else if (t == SLASH)
+ {
+ if (x.nextToken() != GT)
+ {
+ throw x.syntaxError("Misshaped tag");
+ }
+ context.accumulate(n, o);
+ return false;
+
+// Content, between <...> and </...>
+
+ }
+ else if (t == GT)
+ {
+ for (; ;)
+ {
+ t = x.nextContent();
+ if (t == null)
+ {
+ if (n != null)
+ {
+ throw x.syntaxError("Unclosed tag " + n);
+ }
+ return false;
+ }
+ else if (t instanceof String)
+ {
+ s = (String) t;
+ if (s.length() > 0)
+ {
+ o.accumulate("content", JSONObject.stringToValue(s));
+ }
+
+// Nested element
+
+ }
+ else if (t == LT)
+ {
+ if (parse(x, o, n))
+ {
+ if (o.length() == 0)
+ {
+ context.accumulate(n, "");
+ }
+ else if (o.length() == 1 &&
+ o.opt("content") != null)
+ {
+ context.accumulate(n, o.opt("content"));
+ }
+ else
+ {
+ context.accumulate(n, o);
+ }
+ return false;
+ }
+ }
+ }
+ }
+ else
+ {
+ throw x.syntaxError("Misshaped tag");
+ }
+ }
+ }
+ }
+
+
+ /**
+ * Convert a well-formed (but not necessarily valid) XML string into a
+ * JSONObject. Some information may be lost in this transformation
+ * because JSON is a data format and XML is a document format. XML uses
+ * elements, attributes, and content text, while JSON uses unordered
+ * collections of name/value pairs and arrays of values. JSON does not
+ * does not like to distinguish between elements and attributes.
+ * Sequences of similar elements are represented as JSONArrays. Content
+ * text may be placed in a "content" member. Comments, prologs, DTDs, and
+ * <code><[ [ ]]></code> are ignored.
+ *
+ * @param string The source string.
+ * @return A JSONObject containing the structured data from the XML string.
+ * @throws JSONException
+ */
+ public static JSONObject toJSONObject(String string) throws JSONException
+ {
+ JSONObject o = new JSONObject();
+ XMLTokener x = new XMLTokener(string);
+ while (x.more() && x.skipPast("<"))
+ {
+ parse(x, o, null);
+ }
+ return o;
+ }
+
+
+ /**
+ * Convert a JSONObject into a well-formed, element-normal XML string.
+ *
+ * @param o A JSONObject.
+ * @return A string.
+ * @throws JSONException
+ */
+ public static String toString(Object o) throws JSONException
+ {
+ return toString(o, null);
+ }
+
+
+ /**
+ * Convert a JSONObject into a well-formed, element-normal XML string.
+ *
+ * @param o A JSONObject.
+ * @param tagName The optional name of the enclosing tag.
+ * @return A string.
+ * @throws JSONException
+ */
+ public static String toString(Object o, String tagName)
+ throws JSONException
+ {
+ StringBuffer b = new StringBuffer();
+ int i;
+ JSONArray ja;
+ JSONObject jo;
+ String k;
+ Iterator keys;
+ int len;
+ String s;
+ Object v;
+ if (o instanceof JSONObject)
+ {
+
+// Emit <tagName>
+
+ if (tagName != null)
+ {
+ b.append('<');
+ b.append(tagName);
+ b.append('>');
+ }
+
+// Loop thru the keys.
+
+ jo = (JSONObject) o;
+ keys = jo.keys();
+ while (keys.hasNext())
+ {
+ k = keys.next().toString();
+ v = jo.opt(k);
+ if (v == null)
+ {
+ v = "";
+ }
+ if (v instanceof String)
+ {
+ s = (String) v;
+ }
+ else
+ {
+ s = null;
+ }
+
+// Emit content in body
+
+ if (k.equals("content"))
+ {
+ if (v instanceof JSONArray)
+ {
+ ja = (JSONArray) v;
+ len = ja.length();
+ for (i = 0; i < len; i += 1)
+ {
+ if (i > 0)
+ {
+ b.append('\n');
+ }
+ b.append(escape(ja.get(i).toString()));
+ }
+ }
+ else
+ {
+ b.append(escape(v.toString()));
+ }
+
+// Emit an array of similar keys
+
+ }
+ else if (v instanceof JSONArray)
+ {
+ ja = (JSONArray) v;
+ len = ja.length();
+ for (i = 0; i < len; i += 1)
+ {
+ b.append(toString(ja.get(i), k));
+ }
+ }
+ else if (v.equals(""))
+ {
+ b.append('<');
+ b.append(k);
+ b.append("/>");
+
+// Emit a new tag <k>
+
+ }
+ else
+ {
+ b.append(toString(v, k));
+ }
+ }
+ if (tagName != null)
+ {
+
+// Emit the </tagname> close tag
+
+ b.append("</");
+ b.append(tagName);
+ b.append('>');
+ }
+ return b.toString();
+
+// XML does not have good support for arrays. If an array appears in a place
+// where XML is lacking, synthesize an <array> element.
+
+ }
+ else if (o instanceof JSONArray)
+ {
+ ja = (JSONArray) o;
+ len = ja.length();
+ for (i = 0; i < len; ++i)
+ {
+ b.append(toString(
+ ja.opt(i), (tagName == null) ? "array" : tagName));
+ }
+ return b.toString();
+ }
+ else
+ {
+ s = (o == null) ? "null" : escape(o.toString());
+ return (tagName == null) ? "\"" + s + "\"" :
+ (s.length() == 0) ? "<" + tagName + "/>" :
+ "<" + tagName + ">" + s + "</" + tagName + ">";
+ }
+ }
+}
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/java/org/json/XMLTokener.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/json/XMLTokener.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/json/XMLTokener.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,430 @@
+package org.json;
+
+/*
+Copyright (c) 2002 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+/**
+ * The XMLTokener extends the JSONTokener to provide additional methods
+ * for the parsing of XML texts.
+ *
+ * @author JSON.org
+ * @version 2008-09-18
+ */
+public class XMLTokener extends JSONTokener
+{
+
+
+ /**
+ * The table of entity values. It initially contains Character values for
+ * amp, apos, gt, lt, quot.
+ */
+ public static final java.util.HashMap entity;
+
+ static
+ {
+ entity = new java.util.HashMap(8);
+ entity.put("amp", XML.AMP);
+ entity.put("apos", XML.APOS);
+ entity.put("gt", XML.GT);
+ entity.put("lt", XML.LT);
+ entity.put("quot", XML.QUOT);
+ }
+
+ /**
+ * Construct an XMLTokener from a string.
+ *
+ * @param s A source string.
+ */
+ public XMLTokener(String s)
+ {
+ super(s);
+ }
+
+ /**
+ * Get the text in the CDATA block.
+ *
+ * @return The string up to the <code>]]></code>.
+ * @throws JSONException If the <code>]]></code> is not found.
+ */
+ public String nextCDATA() throws JSONException
+ {
+ char c;
+ int i;
+ StringBuffer sb = new StringBuffer();
+ for (; ;)
+ {
+ c = next();
+ if (c == 0)
+ {
+ throw syntaxError("Unclosed CDATA");
+ }
+ sb.append(c);
+ i = sb.length() - 3;
+ if (i >= 0 && sb.charAt(i) == ']' &&
+ sb.charAt(i + 1) == ']' && sb.charAt(i + 2) == '>')
+ {
+ sb.setLength(i);
+ return sb.toString();
+ }
+ }
+ }
+
+
+ /**
+ * Get the next XML outer token, trimming whitespace. There are two kinds
+ * of tokens: the '<' character which begins a markup tag, and the content
+ * text between markup tags.
+ *
+ * @return A string, or a '<' Character, or null if there is no more
+ * source text.
+ * @throws JSONException
+ */
+ public Object nextContent() throws JSONException
+ {
+ char c;
+ StringBuffer sb;
+ do
+ {
+ c = next();
+ }
+ while (Character.isWhitespace(c));
+ if (c == 0)
+ {
+ return null;
+ }
+ if (c == '<')
+ {
+ return XML.LT;
+ }
+ sb = new StringBuffer();
+ for (; ;)
+ {
+ if (c == '<' || c == 0)
+ {
+ back();
+ return sb.toString().trim();
+ }
+ if (c == '&')
+ {
+ sb.append(nextEntity(c));
+ }
+ else
+ {
+ sb.append(c);
+ }
+ c = next();
+ }
+ }
+
+
+ /**
+ * Return the next entity. These entities are translated to Characters:
+ * <code>& ' > < "</code>.
+ *
+ * @param a An ampersand character.
+ * @return A Character or an entity String if the entity is not recognized.
+ * @throws JSONException If missing ';' in XML entity.
+ */
+ public Object nextEntity(char a) throws JSONException
+ {
+ StringBuffer sb = new StringBuffer();
+ for (; ;)
+ {
+ char c = next();
+ if (Character.isLetterOrDigit(c) || c == '#')
+ {
+ sb.append(Character.toLowerCase(c));
+ }
+ else if (c == ';')
+ {
+ break;
+ }
+ else
+ {
+ throw syntaxError("Missing ';' in XML entity: &" + sb);
+ }
+ }
+ String s = sb.toString();
+ Object e = entity.get(s);
+ return e != null ? e : a + s + ";";
+ }
+
+
+ /**
+ * Returns the next XML meta token. This is used for skipping over <!...>
+ * and <?...?> structures.
+ *
+ * @return Syntax characters (<code>< > / = ! ?</code>) are returned as
+ * Character, and strings and names are returned as Boolean. We don't care
+ * what the values actually are.
+ * @throws JSONException If a string is not properly closed or if the XML
+ * is badly structured.
+ */
+ public Object nextMeta() throws JSONException
+ {
+ char c;
+ char q;
+ do
+ {
+ c = next();
+ }
+ while (Character.isWhitespace(c));
+ switch (c)
+ {
+ case 0:
+ throw syntaxError("Misshaped meta tag");
+ case'<':
+ return XML.LT;
+ case'>':
+ return XML.GT;
+ case'/':
+ return XML.SLASH;
+ case'=':
+ return XML.EQ;
+ case'!':
+ return XML.BANG;
+ case'?':
+ return XML.QUEST;
+ case'"':
+ case'\'':
+ q = c;
+ for (; ;)
+ {
+ c = next();
+ if (c == 0)
+ {
+ throw syntaxError("Unterminated string");
+ }
+ if (c == q)
+ {
+ return Boolean.TRUE;
+ }
+ }
+ default:
+ for (; ;)
+ {
+ c = next();
+ if (Character.isWhitespace(c))
+ {
+ return Boolean.TRUE;
+ }
+ switch (c)
+ {
+ case 0:
+ case'<':
+ case'>':
+ case'/':
+ case'=':
+ case'!':
+ case'?':
+ case'"':
+ case'\'':
+ back();
+ return Boolean.TRUE;
+ }
+ }
+ }
+ }
+
+
+ /**
+ * Get the next XML Token. These tokens are found inside of angle
+ * brackets. It may be one of these characters: <code>/ > = ! ?</code> or it
+ * may be a string wrapped in single quotes or double quotes, or it may be a
+ * name.
+ *
+ * @return a String or a Character.
+ * @throws JSONException If the XML is not well formed.
+ */
+ public Object nextToken() throws JSONException
+ {
+ char c;
+ char q;
+ StringBuffer sb;
+ do
+ {
+ c = next();
+ }
+ while (Character.isWhitespace(c));
+ switch (c)
+ {
+ case 0:
+ throw syntaxError("Misshaped element");
+ case'<':
+ throw syntaxError("Misplaced '<'");
+ case'>':
+ return XML.GT;
+ case'/':
+ return XML.SLASH;
+ case'=':
+ return XML.EQ;
+ case'!':
+ return XML.BANG;
+ case'?':
+ return XML.QUEST;
+
+// Quoted string
+
+ case'"':
+ case'\'':
+ q = c;
+ sb = new StringBuffer();
+ for (; ;)
+ {
+ c = next();
+ if (c == 0)
+ {
+ throw syntaxError("Unterminated string");
+ }
+ if (c == q)
+ {
+ return sb.toString();
+ }
+ if (c == '&')
+ {
+ sb.append(nextEntity(c));
+ }
+ else
+ {
+ sb.append(c);
+ }
+ }
+ default:
+
+// Name
+
+ sb = new StringBuffer();
+ for (; ;)
+ {
+ sb.append(c);
+ c = next();
+ if (Character.isWhitespace(c))
+ {
+ return sb.toString();
+ }
+ switch (c)
+ {
+ case 0:
+ return sb.toString();
+ case'>':
+ case'/':
+ case'=':
+ case'!':
+ case'?':
+ case'[':
+ case']':
+ back();
+ return sb.toString();
+ case'<':
+ case'"':
+ case'\'':
+ throw syntaxError("Bad character in a name");
+ }
+ }
+ }
+ }
+
+
+ /**
+ * Skip characters until past the requested string.
+ * If it is not found, we are left at the end of the source with a result of false.
+ *
+ * @param to A string to skip past.
+ * @throws JSONException
+ */
+ public boolean skipPast(String to) throws JSONException
+ {
+ boolean b;
+ char c;
+ int i;
+ int j;
+ int offset = 0;
+ int n = to.length();
+ char[] circle = new char[n];
+
+ /*
+ * First fill the circle buffer with as many characters as are in the
+ * to string. If we reach an early end, bail.
+ */
+
+ for (i = 0; i < n; i += 1)
+ {
+ c = next();
+ if (c == 0)
+ {
+ return false;
+ }
+ circle[i] = c;
+ }
+ /*
+ * We will loop, possibly for all of the remaining characters.
+ */
+ for (; ;)
+ {
+ j = offset;
+ b = true;
+ /*
+ * Compare the circle buffer with the to string.
+ */
+ for (i = 0; i < n; i += 1)
+ {
+ if (circle[j] != to.charAt(i))
+ {
+ b = false;
+ break;
+ }
+ j += 1;
+ if (j >= n)
+ {
+ j -= n;
+ }
+ }
+ /*
+ * If we exit the loop with b intact, then victory is ours.
+ */
+ if (b)
+ {
+ return true;
+ }
+ /*
+ * Get the next character. If there isn't one, then defeat is ours.
+ */
+ c = next();
+ if (c == 0)
+ {
+ return false;
+ }
+ /*
+ * Shove the character in the circle buffer and advance the
+ * circle offset. The offset is mod n.
+ */
+ circle[offset] = c;
+ offset += 1;
+ if (offset >= n)
+ {
+ offset -= n;
+ }
+ }
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/resources/jmaki/xhp/xhp.json
===================================================================
--- bpm-console/trunk/gui/war/src/main/resources/jmaki/xhp/xhp.json (rev 0)
+++ bpm-console/trunk/gui/war/src/main/resources/jmaki/xhp/xhp.json 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,17 @@
+{"xhp": {
+ "version": "1.1",
+ "services": [
+ {"id": "default",
+ "url":"http://localhost:8080/gwt-console-server",
+ "passthrough":true,
+ "username":"peter",
+ "password":"password"
+ },
+ {"id": "birt",
+ "url":"http://localhost:8080/gwt-console-server",
+ "passthrough":true,
+ "contentType":"text/html"
+ }
+ ]
+ }
+}
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/resources/mvc4g-conf.xml
===================================================================
--- bpm-console/trunk/gui/war/src/main/resources/mvc4g-conf.xml (rev 0)
+++ bpm-console/trunk/gui/war/src/main/resources/mvc4g-conf.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+ Console MVC configuration
+ Further explanations canbe found here:
+ http://code.google.com/p/mvc4g
+ -->
+<mvc4g>
+ <controller name="mainController" class="com.mvc4g.client.Controller">
+ <views>
+ <view name="loginView" class="org.jboss.bpm.console.client.LoginView" />
+ </views>
+ <actions>
+ <action name="login" class="org.jboss.bpm.console.client.LoginAction" />
+ </actions>
+ </controller>
+
+ <start controllerName="mainController" actionName="login" />
+
+ <!--
+ ${webcontext}
+ @webcontext@
+ -->
+</mvc4g>
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/Application.gwt.xml
===================================================================
--- bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/Application.gwt.xml (rev 0)
+++ bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/Application.gwt.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,62 @@
+<module>
+
+ <!-- Inherit the core Web Toolkit stuff. -->
+ <inherits name='com.google.gwt.user.User' />
+ <inherits name='com.google.gwt.json.JSON'/>
+ <inherits name="com.google.gwt.i18n.I18N"/>
+ <inherits name="com.google.gwt.user.ImageBundle"/>
+ <inherits name="com.google.gwt.xml.XML" />
+
+ <!-- Add gwt-log support, default level `DEBUG` -->
+ <inherits name="com.allen_sauer.gwt.log.gwt-log-DEBUG" />
+
+ <!-- Inherit Mosaic Web Toolkit stuff. -->
+ <inherits name='org.gwt.mosaic.Mosaic' />
+ <inherits name='org.gwt.mosaic.forms.Forms' />
+
+ <!-- Includes the public resources used by the GWT Mosaic -->
+ <!-- themes. Those files do not inject a style sheet into the -->
+ <!-- application. -->
+ <!--inherits name="org.gwt.mosaic.theme.standard.StandardResources" />
+ <inherits name="org.gwt.mosaic.theme.chrome.ChromeResources" />
+ <inherits name="org.gwt.mosaic.theme.dark.DarkResources" /-->
+ <inherits name="org.gwt.mosaic.theme.aegean.AegeanResources" />
+
+ <!-- Inherit the default GWT Mosaic style sheet. You can change -->
+ <!-- the theme of your GWT Mosaic application by uncommenting -->
+ <!-- any one of the following lines. -->
+ <!-- <inherits name='org.gwt.mosaic.theme.standard.Standard' /> -->
+ <!-- <inherits name="org.gwt.mosaic.chrome.Chrome"/> -->
+ <!-- <inherits name="org.gwt.mosaic.dark.Dark"/> -->
+ <inherits name='org.gwt.mosaic.theme.aegean.Aegean' />
+
+ <!-- mvc4g -->
+ <inherits name='com.mvc4g.Mvc4gModule'/>
+
+ <generate-with class="org.jboss.bpm.console.rebind.WorkspaceGenerator" >
+ <when-type-assignable class="org.jboss.bpm.console.client.WorkspaceLauncher"/>
+ </generate-with>
+
+ <!-- Add the `WARN` and `DEBUG` compile time log level -->
+ <!--extend-property name="log_level" values="DEBUG,WARN"/-->
+
+ <!-- Loggers Enabled by default -->
+ <set-property name="log_ConsoleLogger" value="ENABLED" />
+ <set-property name="log_DivLogger" value="DISABLED" />
+ <set-property name="log_FirebugLogger" value="DISABLED" />
+ <set-property name="log_GWTLogger" value="ENABLED" />
+ <set-property name="log_SystemLogger" value="ENABLED" />
+
+ <!-- Loggers Disabled by default -->
+ <set-property name="log_RemoteLogger" value="DISABLED" />
+ <set-property name="log_WindowLogger" value="DISABLED" />
+
+ <!-- Specify the app entry point class. -->
+ <entry-point class="org.jboss.bpm.console.client.Application" />
+
+ <servlet path="/xhp" class="jmaki.xhp.XmlHttpProxyServlet"/>
+
+ <!-- Specify a css to load into your gwt application -->
+ <stylesheet src='console.css' />
+
+</module>
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/Application.html
===================================================================
--- bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/Application.html (rev 0)
+++ bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/Application.html 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,63 @@
+<html>
+<head>
+ <title>GWT Console Application</title>
+
+ <!-- BPM console configuration -->
+ <script src="console.config.js" type="text/javascript"></script>
+
+ <!-- -->
+ <!-- This script loads your compiled module. -->
+ <!-- If you add any GWT meta tags, they must -->
+ <!-- be added before this line. -->
+ <!-- -->
+ <script src="org.jboss.bpm.console.Application.nocache.js" type="text/javascript"></script>
+
+ <link rel="stylesheet" href="console.css" type="text/css">
+
+ <style type="text/css">
+ html, body { height: 100%; overflow: hidden; margin: 0; padding: 0; }
+ #splash {
+ background:#ffffff;
+ cursor: wait;
+ position:
+ absolute; top: 0; left: 0;
+ z-index:1000;
+ }
+ .bpm-loader {
+ background-image: url('images/loading_lite.gif');
+ background-repeat:no-repeat;
+ height: 24px; width: 130px;
+ padding-left:26px;
+ padding-top:8px;
+ font-family: Arial, sans-serif;
+ font-size: 10px;
+ font-weight: bold;
+ color: #777;
+ cursor: wait;
+ }
+ </style>
+</head>
+
+<!-- -->
+<!-- The body can have arbitrary html, or -->
+<!-- you can leave the body empty if you want -->
+<!-- to create a completely dynamic ui -->
+<!-- -->
+<body>
+
+<!-- OPTIONAL: include this if you want history support -->
+<!--iframe src="javascript:''" id="__gwt_historyFrame" style="width: 0; height: 0; border: 0"></iframe-->
+
+<div id="splash" style="height:100%;width:100%;">
+ <table width="100%" height="100%" >
+ <tr>
+ <td width="100%" height="100%" align="center" valign="middle">
+ <div id="ui_loading" class="bpm-loader" style="visibility:hidden;z-index:1001;" alttext="Error">Creating Workspace ...</div>
+ <div id="splash_loading" class="bpm-loader" alttext="Error">Loading ...</div>
+ </td>
+ </tr>
+ </table>
+</div>
+
+</body>
+</html>
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/console.css
===================================================================
--- bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/console.css (rev 0)
+++ bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/console.css 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,292 @@
+
+.bpm-layout {
+ border: 1px solid green;
+ margin: 10px;
+}
+
+.bpm-header{
+ background-color:#ffffff;
+}
+
+.bpm-header-left {
+ background-color:#ffffff;
+ vertical-align:bottom;
+ margin-left:15px;
+}
+
+.bpm-header-right {
+ background-color:#ffffff;
+ vertical-align:bottom;
+ margin-right:15px;
+}
+
+.bpm-label-header {
+ background-color:#F8F8F8;
+ font-weight:BOLD;
+ padding-bottom:2px;
+ padding-left:5px;
+ margin-bottom:5px;
+}
+.bpm-header-userinfo {
+ font-family: sans-serif;
+ width:150px;
+}
+
+.bpm-header-versioninfo {
+ font-family: sans-serif;
+ color: #C8C8C8;
+}
+
+.bpm-property-image {
+ padding-top:10px;
+}
+
+.bpm-filter-panel {
+ padding-top:5px;
+ padding-right:2px;
+ background-color:#dfe8f6;
+ border-bottom: 1px solid #bbbbbb;
+}
+
+.bpm-editor-info {
+ font-family: sans-serif;
+ font-size:18px;
+}
+
+.bpm-editor-header {
+ font-family: sans-serif;
+ background-color: #E0E0E0;
+}
+
+.bpm-menu {
+ height: 50px;
+ width: 100%;
+ border: 1px solid;
+}
+
+.bpm-workspace {
+ width: 100%;
+ height:100%;
+}
+
+.bpm-label {
+ font-family: sans-serif;
+ font-size: small;
+}
+
+.bpm-ListHeaderRow {
+ font-weight: bold;
+}
+
+.bpm-EvenRow {
+ background-color: #f0f4f8;
+}
+
+.bpm-FieldValue {
+
+}
+
+.bpm-EditorHeader {
+
+}
+
+.bpm-loading-image {
+ background-color:#ffffff;
+ width:16px;
+ height:16px;
+}
+
+.bpm-ProcessImage {
+ border: 0px;
+}
+
+.bpm-SplitPanel {
+ border: 1px dashed green;
+ vertical-align: top;
+ position:relative; top:5px; left:5px;
+}
+
+.piechart-types {
+ font-size: small;
+ list-style-type:decimal;
+ font-family: sans-serif;
+}
+
+.bpm-help-panel {
+ background-color:#F0F0F0;
+ font-family: sans-serif;
+ font-size: small;
+}
+
+.bpm-help-icon {
+ background-image: url( images/icons/14.png)
+}
+
+.bpm-report-icon {
+ background-image: url( images/icons/31.png)
+}
+
+.bpm-process-icon {
+ background-image: url( images/icons/41.png)
+}
+
+.bpm-task-icon {
+ background-image: url( images/icons/29.png)
+}
+
+.bpm-instance-icon {
+ background-image: url( images/icons/05_1.png)
+}
+
+.bpm-settings-icon {
+
+}
+
+.bpm-operation-ui {
+ font-size: 10px;
+}
+
+.bpm-tools-icon {
+ background-image: url( images/icons/36.png)
+}
+
+.bpm-switch-context-icon {
+ background-image: url( images/icons/13.png)
+}
+
+.bpm-comment-icon {
+ background-image: url( images/icons/27.png)
+}
+
+.bpm-enalrge-icon {
+ background-image: url( images/icons/49.png)
+}
+
+.login-panel-content {
+ text-align: center;
+}
+
+.bpm-examine-icon {
+ background-image: url( images/icons/examine.png)
+}
+
+.bpm-add-icon {
+ background-image: url( images/icons/add.png)
+}
+
+.bpm-lock-icon-small {
+ background-image: url( images/icons/lock_small.png)
+}
+
+.bpm-remove-icon {
+ background-image: url( images/icons/remove.png)
+}
+
+.bpm-play-icon {
+ background-image: url( images/icons/play.png)
+}
+
+.bpm-stop-icon {
+ background-image: url( images/icons/stop.png)
+}
+
+.bpm-pause-icon {
+ background-image: url( images/icons/pause.png)
+}
+
+div.activeNode {
+ position:absolute;
+ border-width:1px;
+ border-style:solid;
+ border-color:#339933;
+}
+
+div.activeNode-header {
+ position:absolute;
+ overflow:hidden;
+}
+
+div.activeNode-header-link {
+ cursor:default;
+ font-family:sans-serif;
+ font-size:10px;
+ white-space:nowrap;
+ color:#ffffff;
+ padding-left:3px;
+ padding-right:3px;
+ border-width:1px;
+ border-style:solid;
+ border-color:#339933;
+ background-color:#339933;
+}
+
+div.activeNode-header-link a {
+ color:#ffffff;
+ text-decoration:none;
+}
+
+div.activeNode-header-link a:hover {
+ text-decoration:underline;
+}
+
+/* start - override gwt-log styles */
+.log-panel {
+ background-color: #ECF2FC;
+ border: 0px solid black;
+ margin: 0px;
+ padding:10px;
+}
+
+.log-panel .log-scroll-panel {
+ width: 100% !important;
+ height: 80px !important;
+}
+
+.log-panel .log-text-area,.log-panel BUTTON {
+ font-size: 8pt;
+ margin: 0em;
+}
+
+.log-resize-se {
+ visibility:hidden;
+}
+
+/* end - override gwt-log styles */
+
+/* start - custom widgets */
+.bpm-detail-panel {
+ border:1px solid #E8E8E8;
+}
+
+.bpm-prop-grid {
+
+}
+
+.bpm-prop-grid-even {
+ background: #F8F8F8;
+}
+
+.bpm-prop-grid-odd {
+
+}
+
+.bpm-prop-grid-label {
+
+}
+
+/* end - custom widgets */
+
+.gwt-SuggestBoxPopup { z-index:100000; border: 1px solid #ffffff;}
+.gwt-SuggestBoxPopup .item { padding: 2px;}
+.gwt-SuggestBoxPopup .item-selected { background-color: #C3D9FF; padding: 1px;}
+
+.bpm-graphView-activityImage {
+ background-image: url(images/icons/play_red_big.png);
+ background-repeat:no-repeat;
+ width:16px;
+ height:16px;
+}
+
+.bpm-window-layout {
+ margin: 1px;
+}
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/Jbpm_logo.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/Jbpm_logo.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/Jbpm_logo_small.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/Jbpm_logo_small.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/bg_gradient.gif
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/bg_gradient.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/bg_headergradient.gif
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/bg_headergradient.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/bg_listgradient.gif
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/bg_listgradient.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/bg_suggestgradient.gif
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/bg_suggestgradient.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/blank_loading.gif
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/blank_loading.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/blank_splash.gif
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/blank_splash.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/gwt-logo.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/gwt-logo.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/05.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/05.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/05_1.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/05_1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/13.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/13.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/14.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/14.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/27.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/27.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/29.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/29.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/31.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/31.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/36.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/36.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/41.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/41.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/49.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/49.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/add.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/add.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/add_small.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/add_small.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/confirm.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/confirm.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/confirm_small.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/confirm_small.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/deny.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/deny.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/deny_small.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/deny_small.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/error.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/error.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/examine.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/examine.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/large.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/large.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/large_small.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/large_small.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/loading.gif
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/loading.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/lock.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/lock.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/lock_small.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/lock_small.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/pause.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/pause.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/pause_small.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/pause_small.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/play.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/play.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/play_red_big.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/play_red_big.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/play_small.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/play_small.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/remove.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/remove.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/remove_small.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/remove_small.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/stop.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/stop.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/stop_small.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/stop_small.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/unlock.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/icons/unlock.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/loading-circle.gif
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/loading-circle.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/loading.gif
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/loading.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/loading_lite.gif
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/loading_lite.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/processSample.jpg
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/processSample.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/tab.gif
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/tab.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/js/ox.ajast.js
===================================================================
--- bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/js/ox.ajast.js (rev 0)
+++ bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/js/ox.ajast.js 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,123 @@
+// This file contains a simple Javascript broker that encapsulates
+// the AJAST technique, allowing for cross-domain REST
+// (REpresentatoinal State Transfer) calls.
+//
+// Copyright (c) 2008 Håvard Stranden <havard.stranden at gmail.com>
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+
+if(typeof(OX) === 'undefined') OX = {};
+OX.AJAST =
+{
+ Broker : function(url, callbackparameter, optional_decode_json_response, optional_timeout_milliseconds, optional_default_params)
+ {
+ this.url = url;
+ this.cb = callbackparameter;
+ this.params = [];
+ this.timeout = optional_timeout_milliseconds || 5000; // Timeout in milliseconds
+ if(typeof(optional_default_params) !== 'undefined')
+ {
+ for(p in optional_default_params)
+ this.params.push(p + '=' + encodeURIComponent(optional_default_params[p]));
+ }
+
+ this.jsonmode = optional_decode_json_response || false;
+ },
+
+ __callbacks__ : {},
+
+ __callid__ : 1,
+
+ call: function(url, callbackparameter, callbackfunction, optional_timeout, optional_decode_json_response)
+ {
+ var callbackid = 'callback' + OX.AJAST.__callid__;
+
+ // Append callback parameter (this also implicitly avoids caching, since the callback id is different for each call)
+ url += '&' + encodeURIComponent(callbackparameter) + '=' + encodeURIComponent('OX.AJAST.__callbacks__.' + callbackid);
+
+ // Create script tag for the call
+ var tag = OX.AJAST.createScriptTag(url);
+ // Get the head of the document
+ var head = document.getElementsByTagName('head').item(0);
+
+
+ // Create a timeout function
+ var timedout = function()
+ {
+ if(OX.AJAST.__callbacks__[callbackid] !== 'undefined') // If the callback still exists...
+ {
+ // Replace original wrapped callback with a dummy that just deletes itself
+ OX.AJAST.__callbacks__[callbackid] = function(){ delete OX.AJAST.__callbacks__[callbackid]; };
+ // Signal that the call timed out
+ callbackfunction(false);
+ // Remove the script tag (timed out)
+ head.removeChild(tag);
+ }
+ };
+
+ // Create timer for the timeout function
+ var timer = setTimeout(timedout, optional_timeout || 5000);
+
+ var decode_response = optional_decode_json_response || false;
+
+ // Create the callback function
+ OX.AJAST.__callbacks__[callbackid] = function(data)
+ {
+ // Clear the timeout
+ clearTimeout(timer);
+
+ if(typeof(data) === 'undefined')
+ callbackfunction(false); // Callback with nothing
+ else
+ {
+ callbackfunction(true, decode_response ? eval(data) : data);
+ }
+ // Replace original callback with a dummy function
+ delete OX.AJAST.__callbacks__[callbackid];
+ // Remove the script tag (finished)
+ head.removeChild(tag);
+ };
+
+ // Inject the call
+ head.appendChild(tag);
+ },
+
+ createScriptTag: function(url)
+ {
+ var s = document.createElement('script');
+ s.setAttribute('type', 'text/javascript');
+ s.setAttribute('id', 'oxajastcall' + OX.AJAST.Broker.__callid__++);
+ s.setAttribute('src', url);
+ return s;
+ }
+};
+
+OX.AJAST.Broker.prototype.call = function(params, callback)
+{
+ // Create arguments
+ var args = [];
+ for(p in params)
+ args.push(p + '=' + encodeURIComponent(params[p]));
+ for(p in this.params)
+ args.push(this.params[p]);
+ OX.AJAST.call(this.url + '?' + args.join('&'), this.cb, callback, this.timeout, this.jsonmode);
+};
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg
===================================================================
--- bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg (rev 0)
+++ bpm-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,5 @@
+org.jboss.bpm.console.client.SettingsEditor
+org.jboss.bpm.console.client.process.ProcessEditor
+org.jboss.bpm.console.client.task.TaskEditor
+org.jboss.bpm.console.client.report.ReportEditor
+#org.jboss.bpm.console.client.engine.EngineEditor
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/templates/WEB-INF/jboss-web.xml
===================================================================
--- bpm-console/trunk/gui/war/src/main/templates/WEB-INF/jboss-web.xml (rev 0)
+++ bpm-console/trunk/gui/war/src/main/templates/WEB-INF/jboss-web.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC
+ "-//JBoss//DTD Web Application 2.4//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
+
+<jboss-web>
+
+ <!--security-domain>java:/jaas/jbpm-console</security-domain-->
+
+ <context-root>${console.app.webcontext}</context-root>
+
+ <!--resource-ref>
+ <res-ref-name>jdbc/JbpmDataSource</res-ref-name>
+ <jndi-name>java:/JbpmDS</jndi-name>
+ </resource-ref>
+ -->
+
+</jboss-web>
Added: bpm-console/trunk/gui/war/src/main/webapp/WEB-INF/web.xml
===================================================================
--- bpm-console/trunk/gui/war/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ bpm-console/trunk/gui/war/src/main/webapp/WEB-INF/web.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,23 @@
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd" >
+
+<web-app>
+ <display-name>Archetype Created Web Application</display-name>
+
+ <!--servlet>
+ <servlet-name>com.jsos.httpproxy.HttpProxyServlet/org.jboss.bpm.console.Application/proxy</servlet-name>
+ <servlet-class>com.jsos.httpproxy.HttpProxyServlet</servlet-class>
+ <init-param>
+ <param-name>host</param-name>
+ <param-value>http://localhost:8080/</param-value>
+ </init-param>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>com.jsos.httpproxy.HttpProxyServlet/org.jboss.bpm.console.Application/proxy</servlet-name>
+ <url-pattern>/org.jboss.bpm.console.Application/proxy</url-pattern>
+ </servlet-mapping-->
+
+
+</web-app>
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/main/webapp/index.html
===================================================================
--- bpm-console/trunk/gui/war/src/main/webapp/index.html (rev 0)
+++ bpm-console/trunk/gui/war/src/main/webapp/index.html 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<!-- forward to the GWT Example Application -->
+<meta http-equiv="REFRESH"
+ content="0;url=org.jboss.bpm.console.Application/Application.html">
+</HEAD>
+</HTML>
\ No newline at end of file
Added: bpm-console/trunk/gui/war/src/test/examples/ForkJoinExample.par
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/test/examples/ForkJoinExample.par
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/test/examples/TaskAssignmentExample.par
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/test/examples/TaskAssignmentExample.par
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/test/java/HTTP.java
===================================================================
--- bpm-console/trunk/gui/war/src/test/java/HTTP.java (rev 0)
+++ bpm-console/trunk/gui/war/src/test/java/HTTP.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,166 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.UUID;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class HTTP
+{
+ public static String post(String urlString, InputStream inputStream)
+ throws Exception
+ {
+
+ String userPassword = "admin:admin";
+ String encoding = new sun.misc.BASE64Encoder().encode (userPassword.getBytes());
+
+ HttpURLConnection conn = null;
+ BufferedReader br = null;
+ DataOutputStream dos = null;
+ DataInputStream inStream = null;
+
+ InputStream is = null;
+ OutputStream os = null;
+ boolean ret = false;
+ String StrMessage = "";
+
+
+ String lineEnd = "\r\n";
+ String twoHyphens = "--";
+ String boundary = "*****";
+
+
+ int bytesRead, bytesAvailable, bufferSize;
+
+ byte[] buffer;
+
+ int maxBufferSize = 1*1024*1024;
+
+ String responseFromServer = "";
+
+ try
+ {
+ //------------------ CLIENT REQUEST
+
+ // open a URL connection to the Servlet
+
+ URL url = new URL(urlString);
+
+
+ // Open a HTTP connection to the URL
+
+ conn = (HttpURLConnection) url.openConnection();
+ conn.setRequestProperty ("Authorization", "Basic " + encoding);
+
+ // Allow Inputs
+ conn.setDoInput(true);
+
+ // Allow Outputs
+ conn.setDoOutput(true);
+
+ // Don't use a cached copy.
+ conn.setUseCaches(false);
+
+ // Use a post method.
+ conn.setRequestMethod("POST");
+
+ conn.setRequestProperty("Connection", "Keep-Alive");
+
+ conn.setRequestProperty("Content-Type", "multipart/form-data;boundary="+boundary);
+
+ dos = new DataOutputStream( conn.getOutputStream() );
+
+ dos.writeBytes(twoHyphens + boundary + lineEnd);
+ dos.writeBytes("Content-Disposition: form-data; name=\"upload\";"
+ + " filename=\"" + UUID.randomUUID().toString() +"\"" + lineEnd);
+ dos.writeBytes(lineEnd);
+
+ // create a buffer of maximum size
+ bytesAvailable = inputStream.available();
+ bufferSize = Math.min(bytesAvailable, maxBufferSize);
+ buffer = new byte[bufferSize];
+
+ // read file and write it into form...
+ bytesRead = inputStream.read(buffer, 0, bufferSize);
+
+ while (bytesRead > 0)
+ {
+ dos.write(buffer, 0, bufferSize);
+ bytesAvailable = inputStream.available();
+ bufferSize = Math.min(bytesAvailable, maxBufferSize);
+ bytesRead = inputStream.read(buffer, 0, bufferSize);
+ }
+
+ // send multipart form data necesssary after file data...
+
+ dos.writeBytes(lineEnd);
+ dos.writeBytes(twoHyphens + boundary + twoHyphens + lineEnd);
+
+ // close streams
+
+ inputStream.close();
+ dos.flush();
+ dos.close();
+
+ }
+ catch (MalformedURLException ex)
+ {
+ throw ex;
+ }
+
+ catch (IOException ioe)
+ {
+ throw ioe;
+ }
+
+
+ //------------------ read the SERVER RESPONSE
+
+ StringBuffer sb = new StringBuffer();
+
+ try
+ {
+ inStream = new DataInputStream ( conn.getInputStream() );
+ String str;
+ while (( str = inStream.readLine()) != null)
+ {
+ sb.append(str).append("");
+ }
+ inStream.close();
+
+ }
+ catch (IOException ioex)
+ {
+ System.out.println("From (ServerResponse): "+ioex);
+
+ }
+
+
+ return sb.toString();
+
+ }
+}
Added: bpm-console/trunk/gui/war/src/test/java/PreparationTest.java
===================================================================
--- bpm-console/trunk/gui/war/src/test/java/PreparationTest.java (rev 0)
+++ bpm-console/trunk/gui/war/src/test/java/PreparationTest.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class PreparationTest extends TestCase
+{
+
+ protected void setUp() throws Exception
+ {
+
+ }
+
+ public void testSuccess()
+ {
+ Assert.assertTrue(true);
+ }
+
+}
Added: bpm-console/trunk/gui/war/src/test/resources/ForkJoinExample3.par
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/test/resources/ForkJoinExample3.par
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/war/src/test/resources/SampleProcess.par
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/gui/war/src/test/resources/SampleProcess.par
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/gui/workspace-api/pom.xml
===================================================================
--- bpm-console/trunk/gui/workspace-api/pom.xml (rev 0)
+++ bpm-console/trunk/gui/workspace-api/pom.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <name>JBoss BPM - GWT Console (GUI Workspace-API)</name>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-workspace-api</artifactId>
+ <packaging>jar</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-guimodule</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <properties>
+ <jaxb.version>2.1</jaxb.version>
+ </properties>
+ <!-- Dependencies -->
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-rpc</artifactId>
+ <version>${version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>${jaxb.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
+ <version>${gwt.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.code.gwt-log</groupId>
+ <artifactId>gwt-log</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic-dnd</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic-incubator</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic-gwtx</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.googlecode.mvc4g</groupId>
+ <artifactId>mvc4g</artifactId>
+ </dependency>
+
+ <!-- 3rd party -->
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-configuration</groupId>
+ <artifactId>commons-configuration</artifactId>
+ </dependency>
+
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <showDeprecation>true</showDeprecation>
+ <showWarnings>true</showWarnings>
+ <optimize>true</optimize>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-version-class</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <ant antfile="scripts/antrun-version.xml" inheritAll="false" inheritRefs="false">
+ <property name="version" value="${version}" />
+ <property name="src.dir" value="${project.build.directory}/generated-sources" />
+ </ant>
+ </tasks>
+ <sourceRoot>
+ ${project.build.directory}/generated-sources
+ </sourceRoot>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: bpm-console/trunk/gui/workspace-api/scripts/antrun-version.xml
===================================================================
--- bpm-console/trunk/gui/workspace-api/scripts/antrun-version.xml (rev 0)
+++ bpm-console/trunk/gui/workspace-api/scripts/antrun-version.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,12 @@
+<project basedir=".." default="generate-version">
+ <target name="generate-version">
+ <mkdir dir="${src.dir}/org/jboss/bpm/console/client"/>
+ <echo file="${src.dir}/org/jboss/bpm/console/client/Version.java">
+ package org.jboss.bpm.console.client;
+ /** Automatically generated by ant. */
+ public class Version {
+ public static final String VERSION = "${version}";
+ }
+ </echo>
+ </target>
+</project>
\ No newline at end of file
Added: bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java
===================================================================
--- bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java (rev 0)
+++ bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.mvc4g.client.Controller;
+import org.gwt.mosaic.ui.client.Viewport;
+
+/**
+ * Provides context information to console components and plugins.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public interface ApplicationContext
+{
+ Workspace getWorkpace();
+
+ URLBuilder getUrlBuilder();
+
+ void displayMessage(String message, boolean isError);
+
+ Authentication getAuthentication();
+
+ ConsoleConfig getConfig();
+
+ Controller getController();
+
+ Viewport getViewport();
+
+ void refreshView();
+}
Added: bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Authentication.java
===================================================================
--- bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Authentication.java (rev 0)
+++ bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Authentication.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,158 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.google.gwt.http.client.*;
+import com.google.gwt.core.client.GWT;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.bpm.console.client.model.DTOParser;
+
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * Does HTTP Basic Auth and keeps assigned roles
+ * (piggy backed on response) and the username that was used.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class Authentication
+{
+ private String loginUrl;
+ private AuthCallback callback;
+ private List<String> rolesAssigned = new ArrayList<String>();
+ private String username;
+
+ public Authentication(String loginUrl)
+ {
+ this.loginUrl = loginUrl;
+ }
+
+ public Authentication(String loginUrl, AuthCallback callback)
+ {
+ this.loginUrl = loginUrl;
+ this.callback = callback;
+ }
+
+ /**
+ * Login, but leave credentials to GWT.
+ * This will pop up a username/password dialog netive to the browser.
+ */
+ public void doLogin()
+ {
+ doLogin(null, null);
+ }
+
+ /**
+ * Login using specific credentials.
+ * This delegates to {@link com.google.gwt.http.client.RequestBuilder#setUser(String)}
+ * and {@link com.google.gwt.http.client.RequestBuilder#setPassword(String)}
+ */
+ public void doLogin(String user, String pass)
+ {
+
+ RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, loginUrl);
+ this.username = user;
+ // discard password
+
+ ConsoleLog.debug("Authentication against: " + rb.getUrl());
+
+ if (user != null && pass != null)
+ {
+ rb.setUser(user);
+ rb.setPassword(pass);
+
+ if (!GWT.isScript()) // hosted mode only
+ {
+ rb.setHeader("xtest-user", user);
+ rb.setHeader("xtest-pass", pass); // NOTE: This is plaintext, use for testing only
+ }
+ }
+
+ try
+ {
+ rb.sendRequest(null,
+ new RequestCallback()
+ {
+
+ public void onResponseReceived(Request request, Response response)
+ {
+ // parse roles
+ if (200 == response.getStatusCode())
+ {
+ rolesAssigned = DTOParser.parseRolesAssigned(response.getText());
+ if (callback != null) callback.onLoginSuccess(request, response);
+ }
+ else
+ {
+ onError(request, new Exception(response.getText()));
+ }
+ }
+
+ public void onError(Request request, Throwable t)
+ {
+ // auth failed
+ // Couldn't connect to server (could be timeout, SOP violation, etc.)
+ if (callback != null)
+ callback.onLoginFailed(request, t);
+ else
+ throw new RuntimeException("Unknown exception upon login attempt", t);
+ }
+ });
+ }
+
+ catch (RequestException e1)
+ {
+ // Couldn't connect to server
+ throw new RuntimeException("Unknown error upon login attempt", e1);
+ }
+ }
+
+
+ public void setCallback(AuthCallback callback)
+ {
+ this.callback = callback;
+ }
+
+ public native void doLogout() /*-{
+ $wnd.location.reload();
+ }-*/;
+
+
+ public interface AuthCallback
+ {
+ void onLoginSuccess(Request request, Response response);
+
+ void onLoginFailed(Request request, Throwable t);
+ }
+
+
+ public List<String> getRolesAssigned()
+ {
+ return rolesAssigned;
+ }
+
+ public String getUsername()
+ {
+ return username;
+ }
+}
Added: bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/ConsoleConfig.java
===================================================================
--- bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/ConsoleConfig.java (rev 0)
+++ bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/ConsoleConfig.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.google.gwt.i18n.client.Dictionary;
+
+/**
+ * Initialize console config from host page (<code>Application.html</code>) variable:
+ * <pre>
+ * var consoleConfig = {
+ * consoleServerUrl: "http://localhost:8080/gwt-console-server",
+ * reportServerUrl: "http://localhost:8080/report",
+ * [...]
+ * };
+ * </pre>
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ * @see com.google.gwt.i18n.client.Dictionary
+ */
+public class ConsoleConfig
+{
+ private String serverWebContext;
+
+ private String overallReportFile;
+ private String processSummaryReportFile;
+ private String instanceSummaryReportFile;
+
+ private String profileName;
+ private String logo;
+
+ private String consoleServerUrl;
+
+ public ConsoleConfig()
+ {
+ Dictionary theme = Dictionary.getDictionary("consoleConfig");
+ profileName = theme.get("profileName");
+ logo = theme.get("logo");
+
+ serverWebContext = theme.get("serverWebContext");
+
+ overallReportFile = theme.get("overallReportFile");
+ processSummaryReportFile = theme.get("processSummaryReportFile");
+ instanceSummaryReportFile = theme.get("instanceSummaryReportFile");
+ }
+
+ public String getProfileName()
+ {
+ return profileName;
+ }
+
+ public String getLogo()
+ {
+ return logo;
+ }
+
+ public String getConsoleServerUrl()
+ {
+ if(consoleServerUrl ==null)
+ throw new RuntimeException("Config not properly setup: console server URL is null");
+ return consoleServerUrl;
+ }
+
+ public void setConsoleServerUrl(String consoleServerUrl)
+ {
+ this.consoleServerUrl = consoleServerUrl;
+ }
+
+ public String getServerWebContext()
+ {
+ return serverWebContext;
+ }
+
+ public void setServerWebContext(String serverWebContext)
+ {
+ this.serverWebContext = serverWebContext;
+ }
+
+ public String getOverallReportFile()
+ {
+ return overallReportFile;
+ }
+
+ public void setOverallReportFile(String overallReportFile)
+ {
+ this.overallReportFile = overallReportFile;
+ }
+
+ public String getProcessSummaryReportFile()
+ {
+ return processSummaryReportFile;
+ }
+
+ public void setProcessSummaryReportFile(String processSummaryReportFile)
+ {
+ this.processSummaryReportFile = processSummaryReportFile;
+ }
+
+ public String getInstanceSummaryReportFile()
+ {
+ return instanceSummaryReportFile;
+ }
+
+ public void setInstanceSummaryReportFile(String instanceSummaryReportFile)
+ {
+ this.instanceSummaryReportFile = instanceSummaryReportFile;
+ }
+}
Added: bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java
===================================================================
--- bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java (rev 0)
+++ bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.mvc4g.client.Controller;
+import com.google.gwt.user.client.Window;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.gwt.mosaic.ui.client.layout.BorderLayout;
+import org.jboss.bpm.console.client.LazyPanel;
+
+
+/**
+ * <h2>Composition</h2>
+ * An editor can be plugged into a {@link org.jboss.bpm.console.client.Workspace}.
+ * Editors do aggregate {@link com.mvc4g.client.ViewInterface}'s and {@link com.mvc4g.client.ActionInterface}'s,
+ * which are maintained through a {@link com.mvc4g.client.Controller}.
+
+ * <h2>Event handling</h2>
+ * Views and actions communicate though a hirarchical controller chain by issuing events:<p>
+ * <code>
+ * Controller.handleEvent( new Event(...));
+ * </code>
+ * <p/>
+ * By default every editor get's it's own controller that delegates to the main {@link org.jboss.bpm.console.client.ApplicationContext}
+ * controller as it's parent.
+ *
+ * <h2>Layout</h2>
+ * Each Editor uses a {@link org.gwt.mosaic.ui.client.layout.BorderLayout} by default.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public abstract class Editor extends LayoutPanel implements LazyPanel
+{
+ protected ApplicationContext appContext;
+
+ protected Controller controller;
+
+ protected boolean isInitialized;
+
+ public Editor(ApplicationContext appContext)
+ {
+ super(new BorderLayout());
+ this.appContext = appContext;
+
+ // hmvc controller chain.
+ //this.controller = new Controller();
+ //this.controller.setParent(appContext.getController());
+
+ this.controller = appContext.getController();
+ }
+
+ public boolean isInitialized()
+ {
+ return this.isInitialized;
+ }
+
+ /**
+ * should be overwritten if needed
+ * @param viewId
+ */
+ public void showView(String viewId)
+ {
+ throw new IllegalArgumentException("Illegal call. This method should be overridden.");
+ }
+
+ public abstract void initialize();
+
+ public abstract String getEditorId();
+
+ public abstract String getTitle();
+
+ public abstract MenuSection provideMenuSection();
+
+}
Added: bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/LazyPanel.java
===================================================================
--- bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/LazyPanel.java (rev 0)
+++ bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/LazyPanel.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public interface LazyPanel
+{
+ boolean isInitialized();
+
+ /**
+ * Expected to be an idempotent implementation
+ */
+ void initialize();
+}
Added: bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Menu.java
===================================================================
--- bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Menu.java (rev 0)
+++ bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Menu.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+
+import org.gwt.mosaic.ui.client.StackLayoutPanel;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import com.mvc4g.client.ViewInterface;
+import com.mvc4g.client.Controller;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * The main menu on the left hand.
+ * Keeps a list of {@link org.jboss.bpm.console.client.MenuSection}.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class Menu extends LayoutPanel implements ViewInterface
+{
+ private StackLayoutPanel stack;
+ private Controller controller;
+
+ private Map<String, Integer> name2Index = new HashMap<String, Integer>();
+ private int stackCount = 0;
+
+ public Menu()
+ {
+ super(new BoxLayout(BoxLayout.Orientation.VERTICAL));
+
+ this.setWidgetSpacing(5);
+
+ this.stack = new StackLayoutPanel();
+ //stack.showStack(0); // todo: loading event
+ this.add(stack, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH, true));
+ }
+
+ public void createMenu(Editor editor)
+ {
+ MenuSection menuSection = editor.provideMenuSection();
+ this.stack.add(menuSection, menuSection.getMenuTitle(), true);
+ name2Index.put(editor.getEditorId(), stackCount);
+ stackCount++;
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public void toggle(String editorId)
+ {
+ if(!name2Index.containsKey(editorId))
+ throw new IllegalArgumentException("Unknown menu for Editor: "+editorId);
+
+ int index = name2Index.get(editorId);
+ stack.showStack(index);
+ stack.layout();
+ }
+}
Added: bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/MenuSection.java
===================================================================
--- bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/MenuSection.java (rev 0)
+++ bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/MenuSection.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.google.gwt.user.client.ui.Tree;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+
+
+/**
+ * One section in the lefthand main menu.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class MenuSection extends LayoutPanel
+{
+
+ private HTML menuTitle;
+
+ public MenuSection(String title, AbstractImagePrototype icon, Tree tree)
+ {
+ super();
+
+ this.menuTitle = new HTML(
+ (icon != null ? (icon.getHTML() + " ")
+ : (""))
+ + title);
+
+ if (tree != null)
+ add(tree);
+ }
+
+ public String getMenuTitle()
+ {
+ return menuTitle.getHTML();
+ }
+}
Added: bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/UIConstants.java
===================================================================
--- bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/UIConstants.java (rev 0)
+++ bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/UIConstants.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class UIConstants
+{
+ public static final int OVERALL_WIDTH = 1024;
+ public static final int OVERALL_HEIGHT = 768;
+ public static final int MAIN_MENU_MIN = 175;
+ public static final int MAIN_MENU_MAX = 400;
+ public static final int EDITOR_WIDTH = 680;
+ public static final int TEASER_PANEL_WIDTH = 200;
+ public static final int EDITOR_PANEL_WIDTH = 450;
+
+ public static final String DEFAULT_TRANSITION = "default transition";
+ public static final String DATE_FORMAT = "yyyy-m-j H:i:s"; //08-10-02 13:51:27
+}
Added: bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java
===================================================================
--- bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java (rev 0)
+++ bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,222 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.google.gwt.http.client.URL;
+import com.google.gwt.core.client.GWT;
+import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+import org.jboss.bpm.console.client.model.TokenReference;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class URLBuilder
+{
+ ConsoleConfig config;
+
+ public URLBuilder(ConsoleConfig config)
+ {
+ this.config = config;
+ }
+
+
+ public String getProcessDefinitionsURL()
+ {
+ return config.getConsoleServerUrl() + "/rs/process/definitions";
+ }
+
+ public String getProcessInstancesURL(String processId)
+ {
+ String encodedId = URL.encode(processId);
+ return config.getConsoleServerUrl() + "/rs/process/definition/" + encodedId + "/instances";
+ }
+
+ public String getUserInRoleURL(String[] possibleRoles)
+ {
+ StringBuffer sb = new StringBuffer();
+ for (int i = 0; i < possibleRoles.length; i++)
+ {
+ sb.append(URL.encode(possibleRoles[i]));
+ if (i < possibleRoles.length - 1)
+ sb.append(",");
+ }
+ return config.getConsoleServerUrl() + "/rs/identity/user/roles?roleCheck=" + sb.toString();
+ }
+
+ public String getServerStatusURL()
+ {
+ return config.getConsoleServerUrl() + "/rs/server/status";
+ }
+
+ @Deprecated
+ public String getRemoveDefinitionURL(String processId)
+ {
+ String encodedId = URL.encode(processId);
+ return config.getConsoleServerUrl() + "/rs/process/definition/" + encodedId+ "/remove";
+ }
+
+ public String getProcessImageURL(String processId)
+ {
+ String encodedId = URL.encode(processId);
+ return config.getConsoleServerUrl() + "/rs/process/definition/"+ encodedId+ "/image";
+ }
+
+ public String getActiveNodeInfoURL(String instanceId)
+ {
+ return config.getConsoleServerUrl() + "/rs/process/instance/" + instanceId + "/activeNodeInfo";
+ }
+
+ public String getStateChangeURL(String instanceId, ProcessInstanceRef.STATE state)
+ {
+ return config.getConsoleServerUrl() + "/rs/process/instance/" + instanceId + "/state/" + state;
+ }
+
+ public String getInstanceEndURL(String instanceId, ProcessInstanceRef.RESULT result)
+ {
+ return config.getConsoleServerUrl() + "/rs/process/instance/" + instanceId + "/end/" + result;
+ }
+
+ public String getInstanceDeleteURL(String instanceId)
+ {
+ return config.getConsoleServerUrl() + "/rs/process/instance/" + instanceId + "/delete";
+ }
+
+ public String getInstanceDataURL(String instanceId)
+ {
+ return config.getConsoleServerUrl() + "/rs/process/instance/" + instanceId + "/dataset";
+ }
+
+ public String getStartNewInstanceURL(String processId)
+ {
+ String encodedID = URL.encode(processId);
+ return config.getConsoleServerUrl() + "/rs/process/definition/" + encodedID + "/new_instance";
+ }
+
+ public String getTaskListURL(String idRef)
+ {
+ return config.getConsoleServerUrl() + "/rs/tasks/" + URL.encode(idRef);
+ }
+
+ public String getParticipationTaskListURL(String idRef)
+ {
+ return config.getConsoleServerUrl() + "/rs/tasks/" + URL.encode(idRef) +"/participation";
+ }
+
+ public String getTaskReleaseURL(long id)
+ {
+ return config.getConsoleServerUrl() + "/rs/task/" + id + "/release";
+ }
+
+ public String getTaskCompleteURL(long id)
+ {
+ return config.getConsoleServerUrl() + "/rs/task/" + id + "/close";
+ }
+
+ public String getTaskCompleteURL(long id, String outcome)
+ {
+ return config.getConsoleServerUrl() + "/rs/task/" + id + "/close/" + URL.encode(outcome);
+ }
+
+ public String getTaskAssignURL(long id, String idRef)
+ {
+ return config.getConsoleServerUrl() + "/rs/task/" + id + "/assign/" + URL.encode(idRef);
+ }
+
+ public String getExecutionSignalUrl(TokenReference tok)
+ {
+ return config.getConsoleServerUrl() + "/rs/process/tokens/" + tok.getId() + "/transition/default";
+ }
+
+ public String getExecutionSignalUrl(TokenReference tok, String signal)
+ {
+ String encodedSignal = URL.encode(signal);
+ return config.getConsoleServerUrl() + "/rs/process/tokens/" + tok.getId() + "/transition?signal=" + encodedSignal;
+ }
+
+ public String getAvailableActorsUrl(String actorId)
+ {
+ return config.getConsoleServerUrl() + "/rs/identity/user/" + actorId + "/actors";
+ }
+
+ public String getDeployTestHarnessUrl()
+ {
+ return config.getConsoleServerUrl() + "/rs/test/deploy/harness";
+ }
+
+ public String getUndeployTestHarnessUrl()
+ {
+ return config.getConsoleServerUrl() + "/rs/test/undeploy/harness";
+ }
+
+ public String getOverallReportUrl()
+ {
+ String name = URL.encode(config.getOverallReportFile());
+ String url = config.getConsoleServerUrl() + "/rs/report/view/" + name;
+ if (!GWT.isScript())
+ url += "?id=birt";
+ return url;
+ }
+
+ public String getProcessSummaryReportUrl(String defintionId)
+ {
+ String encId = URL.encode(defintionId);
+ String reportFileName = URL.encode(config.getProcessSummaryReportFile());
+ String url = config.getConsoleServerUrl() + "/rs/report/view/" + reportFileName + "?procId=" + encId;
+ if (!GWT.isScript())
+ url += "&id=birt";
+ return url;
+ }
+
+ public String getDeploymentsUrl()
+ {
+ return config.getConsoleServerUrl() + "/rs/engine/deployments";
+ }
+
+ public String getSuspendDeploymentUrl(String id)
+ {
+ String encodedId = URL.encode(id);
+ return config.getConsoleServerUrl() + "/rs/engine/deployment/"+encodedId+"/suspend";
+ }
+
+ public String getResumeDeploymentUrl(String id)
+ {
+ String encodedId = URL.encode(id);
+ return config.getConsoleServerUrl() + "/rs/engine/deployment/"+encodedId+"/resume";
+ }
+
+ public String getDeleteDeploymentUrl(String id)
+ {
+ String encodedId = URL.encode(id);
+ return config.getConsoleServerUrl() + "/rs/engine/deployment/"+encodedId+"/delete";
+ }
+
+ public String getJobsUrl()
+ {
+ return config.getConsoleServerUrl() + "/rs/engine/jobs";
+ }
+
+ public String getExecuteJobURL(String id)
+ {
+ String encodedId = URL.encode(id);
+ return config.getConsoleServerUrl() + "/rs/engine/job/"+encodedId+"/execute";
+ }
+}
Added: bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java
===================================================================
--- bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java (rev 0)
+++ bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,127 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import org.gwt.mosaic.ui.client.DeckLayoutPanel;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import com.google.gwt.user.client.Timer;
+import com.google.gwt.user.client.DeferredCommand;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DOM;
+
+/**
+ * Maintains {@link Editor}'s
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class Workspace extends DeckLayoutPanel
+{
+ protected ApplicationContext appContext;
+ private Menu menu;
+
+ public Workspace(Menu menu, ApplicationContext appContext)
+ {
+ super();
+ this.appContext = appContext;
+ this.menu = menu;
+ this.setPadding(5);
+
+ }
+
+ public void addEditor(Editor editor, boolean closeable)
+ {
+ // Menu
+ MenuSection menuSection = editor.provideMenuSection();
+ if(menuSection!=null) // some editors don't contribute to the menu
+ menu.createMenu(editor);
+
+ // Editor deck
+ EditorDeck deck = createDeck(editor);
+ deck.index = this.getWidgetCount();
+ this.add(deck);
+ }
+
+ public boolean hasEditor(String id)
+ {
+ return findEditor(id)!=null;
+ }
+
+ public void showEditor(final String editorId)
+ {
+ showEditor(editorId, null);
+ }
+
+ public void showEditor(final String editorId, final String viewId)
+ {
+ EditorDeck deck = findEditor(editorId);
+ if(null==deck)
+ throw new IllegalArgumentException("No such editor: " +editorId);
+
+ // display editor
+ this.showWidget(deck.index);
+ deck.editor.initialize();
+ if(viewId!=null) deck.editor.showView(viewId);
+
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ menu.toggle(editorId);
+ }
+ });
+
+ }
+
+ private EditorDeck createDeck(Editor editor)
+ {
+ EditorDeck deck = new EditorDeck(editor);
+ deck.add(editor);
+ return deck;
+ }
+
+ private EditorDeck findEditor(String id)
+ {
+ EditorDeck match = null;
+ for(int i=0; i<this.getWidgetCount(); i++)
+ {
+ EditorDeck deck = (EditorDeck) this.getWidget(i);
+ if(id.equals( deck.editor.getEditorId()))
+ {
+ match = deck;
+ break;
+ }
+ }
+
+ return match;
+ }
+
+ private class EditorDeck extends LayoutPanel
+ {
+ Editor editor;
+ int index;
+
+ public EditorDeck(Editor editor)
+ {
+ super();
+ this.editor = editor;
+ }
+
+ }
+}
Added: bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
===================================================================
--- bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java (rev 0)
+++ bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,412 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import com.google.gwt.json.client.*;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.bpm.console.client.util.JSONWalk;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class DTOParser
+{
+ public static List<ProcessDefinitionRef> parseProcessDefinitions(JSONValue jso)
+ {
+ List<ProcessDefinitionRef> results = new ArrayList<ProcessDefinitionRef>();
+
+ JSONArray arr = JSONWalk.on(jso).next("definitions").asArray();
+ for(int i=0; i<arr.size(); i++)
+ {
+ results.add(parseProcessDefinition(arr.get(i)));
+ }
+ return results;
+ }
+
+ public static ProcessDefinitionRef parseProcessDefinition(JSONValue root)
+ {
+ ConsoleLog.debug("parse " + root);
+
+ String id = JSONWalk.on(root).next("id").asString();
+ Long version = JSONWalk.on(root).next("version").asLong();
+ String name = JSONWalk.on(root).next("name").asString();
+ boolean isSuspended = JSONWalk.on(root).next("suspended").asBool();
+
+ String dplId = JSONWalk.on(root).next("deploymentId").asString();
+ ProcessDefinitionRef ref = new ProcessDefinitionRef(id, name, version);
+ ref.setDeploymentId(dplId);
+ ref.setSuspended(isSuspended);
+
+ // optional start form url
+ JSONWalk.JSONWrapper formUrl = JSONWalk.on(root).next("formUrl");
+ if(formUrl !=null)
+ ref.setFormUrl(formUrl.asString());
+
+ // optional diagram url
+ JSONWalk.JSONWrapper diagramUrl = JSONWalk.on(root).next("diagramUrl");
+ if(diagramUrl !=null)
+ ref.setDiagramUrl(diagramUrl.asString());
+
+ return ref;
+ }
+
+ public static ProcessDefinitionRef parseProcessDefinition(String json)
+ {
+ JSONValue root = JSONParser.parse(json);
+ return parseProcessDefinition(root);
+ }
+
+ public static List<String> parseRolesAssigned(String json)
+ {
+ // parse roles
+ List<String> roles = new ArrayList<String>();
+
+ // {"roles":[{"isAssigned":true,"role":"admin"},{"isAssigned":true,"role":"user"}]}
+
+ JSONValue root = JSONParser.parse(json);
+ JSONArray array = JSONWalk.on(root).next("roles").asArray();
+
+ for (int i = 0; i < array.size(); ++i)
+ {
+ JSONObject item = array.get(i).isObject();
+ boolean assigned = JSONWalk.on(item).next("assigned").asBool();
+ String roleName = JSONWalk.on(item).next("role").asString();
+
+ if (assigned)
+ {
+ roles.add(roleName);
+ }
+ }
+
+ return roles;
+ }
+
+ public static List<TaskRef> parseTaskReferenceList(String json)
+ {
+ List<TaskRef> results = new ArrayList<TaskRef>();
+
+ JSONValue root = JSONParser.parse(json);
+ JSONArray array = JSONWalk.on(root).next("tasks").asArray();
+
+ for (int i = 0; i < array.size(); ++i)
+ {
+ JSONObject item = array.get(i).isObject();
+ TaskRef ref = parseTaskReference(item);
+ results.add(ref);
+ }
+
+ return results;
+ }
+
+ public static TaskRef parseTaskReference(JSONObject item)
+ {
+ ConsoleLog.debug("parse " + item);
+
+ long id = JSONWalk.on(item).next("id").asLong();
+ String executionId = JSONWalk.on(item).next("processInstanceId").asString();
+ String processId = JSONWalk.on(item).next("processId").asString();
+ String name = JSONWalk.on(item).next("name").asString();
+ String assignee = JSONWalk.on(item).next("assignee").asString();
+ boolean isBlocking = JSONWalk.on(item).next("isBlocking").asBool();
+ boolean isSignalling = JSONWalk.on(item).next("isSignalling").asBool();
+
+ TaskRef ref = new TaskRef(
+ id, executionId,
+ processId,
+ name, assignee,
+ isSignalling, isBlocking
+ );
+
+ // task url reference maybe null
+ JSONWalk.JSONWrapper jsonWrapper = JSONWalk.on(item).next("url");
+ if(jsonWrapper!=null)
+ {
+ String url = jsonWrapper.asString();
+ ref.setUrl(url);
+ }
+ else
+ {
+ ref.setUrl("");
+ }
+
+ // participant users
+ JSONArray arrUsers = JSONWalk.on(item).next("participantUsers").asArray();
+ for (int k = 0; k < arrUsers.size(); ++k)
+ {
+ JSONValue jsonValue = arrUsers.get(k);
+ ParticipantRef p = parseParticipant(jsonValue, k);
+ ref.getParticipantUsers().add(p);
+ }
+
+ JSONArray arrGroups = JSONWalk.on(item).next("participantGroups").asArray();
+ for (int k = 0; k < arrGroups.size(); ++k)
+ {
+ JSONValue jsonValue = arrGroups.get(k);
+ ParticipantRef p = parseParticipant(jsonValue, k);
+ ref.getParticipantGroups().add(p);
+ }
+
+ if (isSignalling)
+ {
+ JSONArray arr = JSONWalk.on(item).next("outcomes").asArray();
+ for (int k = 0; k < arr.size(); ++k)
+ {
+ JSONValue jsonValue = arr.get(k);
+ if (jsonValue.toString().equals("null"))
+ {
+ ConsoleLog.warn("FIXME JBPM-1828: Null value on outcomes:" + arr.toString());
+ continue; // TODO: JBPM-1828
+ }
+ JSONString t = jsonValue.isString();
+ ref.getOutcomes().add(t.stringValue());
+ }
+
+ }
+
+ int prio = JSONWalk.on(item).next("priority").asInt();
+ ref.setPriority(prio);
+
+ JSONWalk.JSONWrapper dueDate = JSONWalk.on(item).next("dueDate");
+ if(dueDate!=null) // optional
+ {
+ Date due = dueDate.asDate();
+ ref.setDueDate(due);
+ }
+
+ JSONWalk.JSONWrapper createDate = JSONWalk.on(item).next("createDate");
+ if(createDate!=null) // optional
+ {
+ Date due = createDate.asDate();
+ ref.setDueDate(due);
+ }
+
+ return ref;
+ }
+
+ private static ParticipantRef parseParticipant(JSONValue jsonValue, int k)
+ {
+ String type = JSONWalk.on(jsonValue).next("type").asString();
+ String idRef = JSONWalk.on(jsonValue).next("idRef").asString();
+ ParticipantRef p = new ParticipantRef(type, idRef);
+
+ boolean isGroup = JSONWalk.on(jsonValue).next("isGroup").asBool();
+ p.setGroup(isGroup);
+
+ return p;
+ }
+
+ public static List<ProcessInstanceRef> parseProcessInstances(JSONValue jso)
+ {
+ List<ProcessInstanceRef> results = new ArrayList<ProcessInstanceRef>();
+
+ JSONArray arr = JSONWalk.on(jso).next("instances").asArray();
+ for(int i=0; i<arr.size(); i++)
+ {
+ results.add(parseProcessInstance(arr.get(i)));
+ }
+ return results;
+ }
+
+ public static ProcessInstanceRef parseProcessInstance(JSONValue root)
+ {
+ ConsoleLog.debug("parse " + root);
+
+ String id = JSONWalk.on(root).next("id").asString();
+ String definitionId = JSONWalk.on(root).next("definitionId").asString();
+ Date start = JSONWalk.on(root).next("startDate").asDate();
+
+ JSONWalk.JSONWrapper endDateJSON = JSONWalk.on(root).next("endDate");
+ Date end = null;
+ if (endDateJSON != null)
+ end = endDateJSON.asDate();
+
+ boolean suspended = JSONWalk.on(root).next("suspended").asBool();
+
+ ProcessInstanceRef processInstance = new ProcessInstanceRef(
+ id, definitionId,
+ start, end,
+ suspended
+ );
+
+ // tokens
+ JSONObject tokJso = JSONWalk.on(root).next("rootToken").asObject();
+ TokenReference rootToken = parseTokenReference(tokJso);
+ processInstance.setRootToken(rootToken);
+ return processInstance;
+ }
+
+ public static TokenReference parseTokenReference(JSONObject jso)
+ {
+ ConsoleLog.debug("parse " + jso);
+
+ String rootTokenId = JSONWalk.on(jso).next("id").asString();
+ //String name = JSONWalk.on(jso).next("name").asString();
+ String nodeName = JSONWalk.on(jso).next("currentNodeName").asString();
+
+ // TDOD: Fix token name
+ TokenReference rt = new TokenReference(rootTokenId, "", nodeName);
+
+ boolean canBeSignaled = JSONWalk.on(jso).next("canBeSignaled").asBool();
+ rt.setCanBeSignaled(canBeSignaled);
+
+ JSONArray signals = JSONWalk.on(jso).next("availableSignals").asArray();
+ for (int i = 0; i < signals.size(); i++)
+ {
+ JSONValue jsonValue = signals.get(i);
+ if (jsonValue.toString().equals("null"))
+ {
+ ConsoleLog.warn("FIXME JBPM-1828: Null value on availableSignals:" + signals.toString());
+ continue; // TODO: JBPM-1828
+ }
+ JSONString item = jsonValue.isString();
+ rt.getAvailableSignals().add(item.stringValue());
+ }
+
+ JSONArray childArr = JSONWalk.on(jso).next("children").asArray();
+ for (int i = 0; i < childArr.size(); i++)
+ {
+ JSONObject item = childArr.get(i).isObject();
+ rt.getChildren().add(parseTokenReference(item));
+ }
+
+ return rt;
+ }
+
+ public static List<String> parseStringArray(JSONValue jso)
+ {
+ List<String> result = new ArrayList<String>();
+
+ JSONArray jsonArray = jso.isArray();
+
+ if (null == jsonArray)
+ throw new IllegalArgumentException("Not an array: " + jso);
+
+ for (int i = 0; i < jsonArray.size(); i++)
+ {
+ JSONValue jsonValue = jsonArray.get(i);
+ if (jsonValue.toString().equals("null"))
+ {
+ ConsoleLog.warn("FIXME JBPM-1828: Null value on string array:" + jsonArray.toString());
+ continue; // TODO: JBPM-1828
+ }
+ JSONString item = jsonValue.isString();
+ result.add(item.stringValue());
+ }
+
+ return result;
+ }
+
+ public static ServerStatus parseStatus(JSONValue json)
+ {
+ ConsoleLog.debug("parse " + json);
+
+ ServerStatus status = new ServerStatus();
+
+ JSONArray jsonArray = JSONWalk.on(json).next("plugins").asArray();
+ for (int i = 0; i < jsonArray.size(); i++)
+ {
+ JSONValue item = jsonArray.get(i);
+ String type = JSONWalk.on(item).next("type").asString();
+ boolean avail = JSONWalk.on(item).next("available").asBool();
+ status.getPlugins().add( new PluginInfo(type, avail) );
+ }
+
+ return status;
+ }
+
+ public static List<DeploymentRef> parseDeploymentRefList(JSONValue json)
+ {
+ ConsoleLog.debug("parse " + json);
+
+ List<DeploymentRef> result = new ArrayList<DeploymentRef>();
+
+ JSONArray jsonArray = JSONWalk.on(json).next("deployments").asArray();
+ for (int i = 0; i < jsonArray.size(); i++)
+ {
+ JSONValue item = jsonArray.get(i);
+ String id = JSONWalk.on(item).next("id").asString();
+ boolean suspended = JSONWalk.on(item).next("suspended").asBool();
+
+ String name = JSONWalk.on(item).next("name").asString();
+ long ts = JSONWalk.on(item).next("timestamp").asLong();
+
+ DeploymentRef ref = new DeploymentRef(id, suspended);
+ ref.setName(name);
+ ref.setTimestamp(ts);
+
+ // defintions
+ JSONArray defArr = JSONWalk.on(item).next("definitions").asArray();
+ for (int c = 0; c < defArr.size(); c++)
+ {
+ String defId = defArr.get(c).isString().stringValue();
+ ref.getDefinitions().add(defId);
+ }
+
+ // resource names
+ JSONArray resArr = JSONWalk.on(item).next("resourceNames").asArray();
+ for (int c = 0; c < resArr.size(); c++)
+ {
+ String resourceName = resArr.get(c).isString().stringValue();
+ ref.getResourceNames().add(resourceName);
+ }
+
+ result.add(ref);
+ }
+
+ return result;
+ }
+
+ public static List<JobRef> parseJobRefList(JSONValue json)
+ {
+ ConsoleLog.debug("parse " + json);
+
+ List<JobRef> result = new ArrayList<JobRef>();
+
+ JSONArray jsonArray = JSONWalk.on(json).next("jobs").asArray();
+ for (int i = 0; i < jsonArray.size(); i++)
+ {
+ JSONValue item = jsonArray.get(i);
+ String id = JSONWalk.on(item).next("id").asString();
+ String type = JSONWalk.on(item).next("type").asString();
+
+ JobRef ref = new JobRef();
+ ref.setId(id);
+ ref.setType(type);
+
+ JSONWalk.JSONWrapper tsEl = JSONWalk.on(item).next("timestamp");
+ if(tsEl!=null)
+ ref.setTimestamp(tsEl.asLong());
+
+ JSONWalk.JSONWrapper err = JSONWalk.on(item).next("errMsg");
+ if(err!=null) // optional
+ ref.setErrMsg(err.asString());
+
+ result.add(ref);
+ }
+
+ return result;
+ }
+}
Added: bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/util/ConsoleLog.java
===================================================================
--- bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/util/ConsoleLog.java (rev 0)
+++ bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/util/ConsoleLog.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.util;
+
+/**
+ * The maven gwt:test mojo treats any output to stderr as
+ * a test failure. gwt-log does dump some information there,
+ * hence we need to proxy log invocation and be able to disable them at all.
+ * <p/>
+ * If you want to test the application, make sure to lauch it using
+ * {@link org.jboss.bpm.console.client.Application#onModuleLoad2()}.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ConsoleLog
+{
+ private static boolean enabled = true; // see javadoc comments
+
+ public static void warn(String msg)
+ {
+ if (enabled)
+ com.allen_sauer.gwt.log.client.Log.warn(msg);
+ }
+
+ public static void info(String msg)
+ {
+ if (enabled)
+ com.allen_sauer.gwt.log.client.Log.info(msg);
+ }
+
+ public static void debug(String msg)
+ {
+ if (enabled)
+ com.allen_sauer.gwt.log.client.Log.debug(msg);
+ }
+
+ public static void error(String msg)
+ {
+ if (enabled)
+ com.allen_sauer.gwt.log.client.Log.error(msg);
+ }
+
+ public static void error(String msg, Throwable t)
+ {
+ if (enabled)
+ com.allen_sauer.gwt.log.client.Log.error(msg, t);
+ }
+
+ public static void setUncaughtExceptionHandler()
+ {
+ if (enabled)
+ com.allen_sauer.gwt.log.client.Log.setUncaughtExceptionHandler();
+ }
+
+ public static boolean isEnabled()
+ {
+ return enabled;
+ }
+
+ public static void setEnabled(boolean enabled)
+ {
+ ConsoleLog.enabled = enabled;
+ }
+}
Added: bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/util/JSONWalk.java
===================================================================
--- bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/util/JSONWalk.java (rev 0)
+++ bpm-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/util/JSONWalk.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,193 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.util;
+
+import com.google.gwt.json.client.JSONArray;
+import com.google.gwt.json.client.JSONException;
+import com.google.gwt.json.client.JSONObject;
+import com.google.gwt.json.client.JSONValue;
+import org.jboss.bpm.console.client.model.util.SimpleDateFormat;
+
+import java.util.Date;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class JSONWalk
+{
+ private JSONValue root;
+
+
+ private JSONWalk(JSONValue root)
+ {
+ this.root = root;
+ }
+
+ public static JSONWalk on(JSONValue root)
+ {
+ return new JSONWalk(root);
+ }
+
+ public JSONWrapper next(String name)
+ {
+ if (null == root || root.isObject() == null) return null;
+ JSONObject rootObject = root.isObject();
+
+ JSONWrapper match = null;
+ Set<String> keySet = rootObject.keySet();
+
+ Iterator it = keySet.iterator();
+ while (it.hasNext())
+ {
+ String s = (String) it.next();
+ JSONValue child = rootObject.get(s);
+ if (name.equals(s))
+ {
+ match = new JSONWrapper(child);
+ break;
+ }
+ else
+ {
+ match = JSONWalk.on(child).next(name);
+ }
+ }
+
+ return match;
+ }
+
+ public class JSONWrapper
+ {
+
+ private JSONValue value;
+
+ public JSONWrapper(JSONValue value)
+ {
+ this.value = value;
+ }
+
+ public int asInt()
+ {
+ if (value.isNumber() != null)
+ {
+ return new Double(value.isNumber().getValue()).intValue();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Not a number: " + value);
+ }
+ }
+
+ public long asLong()
+ {
+ if (value.isNumber() != null)
+ {
+ return new Double(value.isNumber().getValue()).longValue();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Not a number: " + value);
+ }
+ }
+
+ public double asDouble()
+ {
+ if (value.isNumber() != null)
+ {
+ return value.isNumber().getValue();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Not a number: " + value);
+ }
+ }
+
+ public String asString()
+ {
+ if (value.isString() != null)
+ {
+ return value.isString().stringValue();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Not a string: " + value);
+ }
+ }
+
+ public boolean asBool()
+ {
+ if (value.isBoolean() != null)
+ {
+ return value.isBoolean().booleanValue();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Not a boolean: " + value);
+ }
+ }
+
+ public Date asDate()
+ {
+ if (value.isString() != null)
+ {
+ SimpleDateFormat df = new SimpleDateFormat();
+ return df.parse(value.isString().stringValue());
+ }
+ else
+ {
+ throw new IllegalArgumentException("Not a date string: " + value);
+ }
+ }
+
+
+ public JSONArray asArray()
+ {
+ if (value.isArray() != null)
+ {
+ return value.isArray();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Not a number: " + value);
+ }
+ }
+
+ public JSONObject asObject()
+ {
+ if (value.isObject() != null)
+ {
+ return value.isObject();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Not an object: " + value);
+ }
+ }
+
+
+ public String toString() throws JSONException
+ {
+ return value.toString();
+ }
+ }
+}
Added: bpm-console/trunk/gui/workspace-api/workspace-api.iml
===================================================================
--- bpm-console/trunk/gui/workspace-api/workspace-api.iml (rev 0)
+++ bpm-console/trunk/gui/workspace-api/workspace-api.iml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="gwt-parent" />
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.code.gwt-log:gwt-log:jar:2.5.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/code/gwt-log/gwt-log/2.5.2/gwt-log-2.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.activation:activation:jar:1.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.3:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.3/gwt-user-1.5.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-collections:commons-collections:jar:3.2.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-logging:commons-logging:jar:1.1.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-lang:commons-lang:jar:2.4:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-digester:commons-digester:jar:1.8:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-digester/commons-digester/1.8/commons-digester-1.8.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.mvc4g:mvc4g:jar:1.0.0-jboss:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/mvc4g/mvc4g/1.0.0-jboss/mvc4g-1.0.0-jboss.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-beanutils:commons-beanutils:jar:1.7.0:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-configuration:commons-configuration:jar:1.6:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-configuration/commons-configuration/1.6/commons-configuration-1.6.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-beanutils:commons-beanutils-core:jar:1.8.0:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-beanutils/commons-beanutils-core/1.8.0/commons-beanutils-core-1.8.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic/0.1.10/gwt-mosaic-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-dnd:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-dnd/0.1.10/gwt-mosaic-dnd-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-gwtx:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-gwtx/0.1.10/gwt-mosaic-gwtx-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-incubator:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-incubator/0.1.10/gwt-mosaic-incubator-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+</module>
+
Added: bpm-console/trunk/gwt-console.iml
===================================================================
--- bpm-console/trunk/gwt-console.iml (rev 0)
+++ bpm-console/trunk/gwt-console.iml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/server/target/classes" />
+ <exclude-output />
+ <output-test url="file://$MODULE_DIR$/../../../../../../IdeaProjects/jBPM3/classes/test/gwt-console" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/rpc/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/war/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/war/src/main/resources" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/war/src/test/java" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/war/src/test/resources" isTestSource="true" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.2:runtime">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.2/gwt-servlet-1.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.gwt:gchart:jar:2.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gchart/2.2/gchart-2.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.2:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.2/gwt-user-1.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: junit:junit:jar:3.8.1:test">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.gwt:gwt-dev:jar:mac:1.5.2:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-dev/1.5.2/gwt-dev-1.5.2-mac.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.activation:activation:jar:1.1:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.gwtext:gwtext:jar:2.0.5:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/gwtext/gwtext/2.0.5/gwtext-2.0.5.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.code.gwt-log:gwt-log:jar:2.5.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/code/gwt-log/gwt-log/2.5.2/gwt-log-2.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+</module>
+
Added: bpm-console/trunk/gwt-parent.iml
===================================================================
--- bpm-console/trunk/gwt-parent.iml (rev 0)
+++ bpm-console/trunk/gwt-parent.iml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,568 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/common/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/gui/profiles/drools/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/gui/profiles/drools/src/main/resources" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/gui/profiles/jbpm/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/gui/profiles/jbpm/src/main/resources" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/gui/war/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/gui/war/src/main/resources" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/gui/war/src/test/java" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/gui/war/src/test/resources" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/gui/workspace-api/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/gui/workspace-api/src/main/resources" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/rpc/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/sam/gui/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/sam/gui/src/main/resources" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/sam/profile/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/sam/profile/src/main/resources" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/sam/server/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/sam/server/src/main/resources" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/server/server-core/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/server/server-core/src/main/resources" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/server/server-core/src/test/java" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/server/server-integration/src/main/java" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="profiles" exported="" />
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: junit:junit:jar:3.8.1:test">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-logging:commons-logging:jar:1.1.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.ejb:ejb-api:jar:3.0:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/ejb/ejb-api/3.0/ejb-api-3.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.code.gwt-log:gwt-log:jar:2.5.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/code/gwt-log/gwt-log/2.5.2/gwt-log-2.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.jboss.javaee:jboss-javaee:jar:5.0.0.GA:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/javaee/jboss-javaee/5.0.0.GA/jboss-javaee-5.0.0.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/javaee/jboss-javaee/5.0.0.GA/jboss-javaee-5.0.0.GA-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.gwt:gwt-dev:jar:mac:1.5.3:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-dev/1.5.3/gwt-dev-1.5.3-mac.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.3:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.3/gwt-user-1.5.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.3:runtime">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.3/gwt-servlet-1.5.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.mvc4g:mvc4g:jar:1.0.0-jboss:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/googlecode/mvc4g/mvc4g/1.0.0-jboss/mvc4g-1.0.0-jboss.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-collections:commons-collections:jar:3.2.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-digester:commons-digester:jar:1.8:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-digester/commons-digester/1.8/commons-digester-1.8.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-configuration:commons-configuration:jar:1.6:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-configuration/commons-configuration/1.6/commons-configuration-1.6.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-beanutils:commons-beanutils-core:jar:1.8.0:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-beanutils/commons-beanutils-core/1.8.0/commons-beanutils-core-1.8.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.activation:activation:jar:1.1:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-beanutils:commons-beanutils:jar:1.7.0:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-lang:commons-lang:jar:2.4:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-dnd:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-dnd/0.1.10/gwt-mosaic-dnd-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-gwtx:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-gwtx/0.1.10/gwt-mosaic-gwtx-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-incubator:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-incubator/0.1.10/gwt-mosaic-incubator-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic/0.1.10/gwt-mosaic-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.slf4j:slf4j-simple:jar:1.5.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/slf4j/slf4j-simple/1.5.2/slf4j-simple-1.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.jboss.resteasy:resteasy-jaxrs:jar:1.0.2.GA:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/resteasy/resteasy-jaxrs/1.0.2.GA/resteasy-jaxrs-1.0.2.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.eclipse.birt:chartengineapi:jar:2.3.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/eclipse/birt/chartengineapi/2.3.2/chartengineapi-2.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.eclipse.emf:common:jar:2.4.0:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/eclipse/emf/common/2.4.0/common-2.4.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.jboss.resteasy:resteasy-multipart-provider:jar:1.0.2.GA:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/resteasy/resteasy-multipart-provider/1.0.2.GA/resteasy-multipart-provider-1.0.2.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.eclipse.birt:scriptapi:jar:2.3.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/eclipse/birt/scriptapi/2.3.2/scriptapi-2.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.eclipse.birt:engineapi:jar:2.3.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/eclipse/birt/engineapi/2.3.2/engineapi-2.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.jboss:jboss-common-core:jar:2.2.7.GA:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.7.GA/jboss-common-core-2.2.7.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: net.sf.ezmorph:ezmorph:jar:1.0.6:test">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-codec:commons-codec:jar:1.3:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-codec/commons-codec/1.3/commons-codec-1.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-codec/commons-codec/1.3/commons-codec-1.3-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.slf4j:slf4j-api:jar:1.5.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/slf4j/slf4j-api/1.5.2/slf4j-api-1.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.eclipse.birt:coreapi:jar:2.3.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/eclipse/birt/coreapi/2.3.2/coreapi-2.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: rhino:js:jar:1.6R2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/rhino/js/1.6R2/js-1.6R2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javassist:javassist:jar:3.6.0.GA:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javassist/javassist/3.6.0.GA/javassist-3.6.0.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.jboss.bpm:report-core:jar:1.0.0-SNAPSHOT:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/bpm/report-core/1.0.0-SNAPSHOT/report-core-1.0.0-SNAPSHOT.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.eclipse.emf:ecore:jar:2.4.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/eclipse/emf/ecore/2.4.2/ecore-2.4.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.w3c:flute:jar:1.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/w3c/flute/1.2/flute-1.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.jboss.resteasy:jaxrs-api:jar:1.0.2.GA:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/resteasy/jaxrs-api/1.0.2.GA/jaxrs-api-1.0.2.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.ibm.icu:icu4j:jar:3.8.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/ibm/icu/icu4j/3.8.1/icu4j-3.8.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: net.sf.json-lib:json-lib:jar:2.2.3:test">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/net/sf/json-lib/json-lib/2.2.3/json-lib-2.2.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.eclipse.birt:modelapi:jar:2.3.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/eclipse/birt/modelapi/2.3.2/modelapi-2.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-discovery:commons-discovery:jar:0.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-discovery/commons-discovery/0.2/commons-discovery-0.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.xml:jaxb-impl:jar:2.1:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/xml/jaxb-impl/2.1/jaxb-impl-2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.eclipse.birt:dataadapterapi:jar:2.3.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/eclipse/birt/dataadapterapi/2.3.2/dataadapterapi-2.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-io:commons-io:jar:1.3.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-io/commons-io/1.3.2/commons-io-1.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-fileupload:commons-fileupload:jar:1.2.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.annotation:jsr250-api:jar:1.0:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.eclipse.emf:ecore-xmi:jar:2.4.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/eclipse/emf/ecore-xmi/2.4.1/ecore-xmi-2.4.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-cli:commons-cli:jar:1.0:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-cli/commons-cli/1.0/commons-cli-1.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.eclipse.birt:dteapi:jar:2.3.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/eclipse/birt/dteapi/2.3.2/dteapi-2.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.w3c:sac:jar:1.3:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/w3c/sac/1.3/sac-1.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.lowagie:itext:jar:1.3:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/lowagie/itext/1.3/itext-1.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-collections:commons-collections:jar:3.2:test">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-collections/commons-collections/3.2/commons-collections-3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.scannotation:scannotation:jar:1.0.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/scannotation/scannotation/1.0.2/scannotation-1.0.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+</module>
+
Added: bpm-console/trunk/pom.xml
===================================================================
--- bpm-console/trunk/pom.xml (rev 0)
+++ bpm-console/trunk/pom.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,247 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <name>JBoss BPM - GWT Console</name>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jbpm</groupId>
+ <artifactId>jbpm-parent</artifactId>
+ <version>1.0.0.GA</version>
+ </parent>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <commons.fileupload.version>1.2.1</commons.fileupload.version>
+ <commons.io.version>1.3.2</commons.io.version>
+ <commons.logging.version>1.1.1</commons.logging.version>
+ <commons-lang.version>2.4</commons-lang.version>
+ <commons-config.version>1.6</commons-config.version>
+ <gson.version>1.2.2</gson.version>
+ <gwt.version>1.5.3</gwt.version>
+
+ <gwt-mosaic.version>0.1.10</gwt-mosaic.version>
+ <gwt-log.version>2.5.2</gwt-log.version>
+ <jaf.version>1.1</jaf.version>
+ <javax.ejb.version>3.0</javax.ejb.version>
+ <javax.jaxb.version>2.1</javax.jaxb.version>
+ <jboss.common.version>2.2.7.GA</jboss.common.version>
+ <junit.version>3.8.1</junit.version>
+ <mvc4g.version>1.0.0-jboss</mvc4g.version>
+ <resteasy.version>1.0.2.GA</resteasy.version>
+ <stax-api.version>1.0-2</stax-api.version>
+ <report.server.version>1.0.0-SNAPSHOT</report.server.version>
+ </properties>
+
+ <modules>
+ <module>rpc</module>
+ <module>server</module>
+ <module>gui</module>
+ <module>sam</module>
+ <module>common</module>
+ </modules>
+
+ <dependencyManagement>
+ <dependencies>
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>${commons-lang.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-configuration</groupId>
+ <artifactId>commons-configuration</artifactId>
+ <version>${commons-config.version}</version>
+ </dependency>
+
+ <!-- GWT related -->
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-servlet</artifactId>
+ <version>${gwt.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
+ <version>${gwt.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gchart</artifactId>
+ <version>${gchart.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>${gson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gwt-log</groupId>
+ <artifactId>gwt-log</artifactId>
+ <version>${gwt-log.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic</artifactId>
+ <version>${gwt-mosaic.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic-dnd</artifactId>
+ <version>${gwt-mosaic.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic-incubator</artifactId>
+ <version>${gwt-mosaic.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic-gwtx</artifactId>
+ <version>${gwt-mosaic.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.googlecode.mvc4g</groupId>
+ <artifactId>mvc4g</artifactId>
+ <version>${mvc4g.version}</version>
+ </dependency>
+
+ <!-- Other -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${commons.logging.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>${stax-api.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ <version>${jaf.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>${javax.jaxb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>${javax.jaxb.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.ejb</groupId>
+ <artifactId>ejb-api</artifactId>
+ <version>${javax.ejb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <version>${jboss.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxrs</artifactId>
+ <version>${resteasy.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-multipart-provider</artifactId>
+ <version>${resteasy.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <version>${commons.fileupload.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>${commons.io.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>report-core</artifactId>
+ <version>${report.server.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <!-- Profiles -->
+ <profiles>
+
+ <profile>
+ <id>enableTests</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>false</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ </profiles>
+
+
+ <!-- Repositories -->
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <url>http://repository.jboss.org/maven2</url>
+ </repository>
+ <repository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshot Repository</name>
+ <url>http://snapshots.jboss.org/maven2</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>gwt-maven</id>
+ <url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo</url>
+ </pluginRepository>
+ </pluginRepositories>
+
+</project>
Added: bpm-console/trunk/rpc/.classpath
===================================================================
--- bpm-console/trunk/rpc/.classpath (rev 0)
+++ bpm-console/trunk/rpc/.classpath 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: bpm-console/trunk/rpc/.project
===================================================================
--- bpm-console/trunk/rpc/.project (rev 0)
+++ bpm-console/trunk/rpc/.project 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>gwt-console-rpc</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added: bpm-console/trunk/rpc/gwt-rpc.iml
===================================================================
--- bpm-console/trunk/rpc/gwt-rpc.iml (rev 0)
+++ bpm-console/trunk/rpc/gwt-rpc.iml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.activation:activation:jar:1.1:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.3:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.3/gwt-user-1.5.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+</module>
+
Added: bpm-console/trunk/rpc/pom.xml
===================================================================
--- bpm-console/trunk/rpc/pom.xml (rev 0)
+++ bpm-console/trunk/rpc/pom.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,45 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <name>JBoss BPM - GWT Console (RPC)</name>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-rpc</artifactId>
+ <packaging>jar</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
+ <version>${gwt.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <!-- Include SOURCE in output artifact for GWT (GWT libraries must include source) -->
+ <resources>
+ <resource>
+ <directory>src/main/java</directory>
+ </resource>
+ </resources>
+ </build>
+</project>
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ActiveNodeInfo.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ActiveNodeInfo.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ActiveNodeInfo.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name = "activeNodeInfo")
+public class ActiveNodeInfo
+{
+ private int width = -1;
+ private int height = -1;
+
+ private DiagramNodeInfo activeNode;
+
+
+ public ActiveNodeInfo()
+ {
+ }
+
+ public ActiveNodeInfo(int width, int height, DiagramNodeInfo activeNode)
+ {
+ this.width = width;
+ this.height = height;
+ this.activeNode = activeNode;
+ }
+
+ @XmlElement(name = "diagramWidth")
+ public int getWidth()
+ {
+ return width;
+ }
+
+ public void setWidth(int width)
+ {
+ this.width = width;
+ }
+
+ @XmlElement(name = "diagramHeight")
+ public int getHeight()
+ {
+ return height;
+ }
+
+ public void setHeight(int height)
+ {
+ this.height = height;
+ }
+
+ @XmlElement(name = "activeNode")
+ public DiagramNodeInfo getActiveNode()
+ {
+ return activeNode;
+ }
+
+ public void setActiveNode(DiagramNodeInfo activeNode)
+ {
+ this.activeNode = activeNode;
+ }
+}
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRef.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRef.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRef.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name = "deploymentRef")
+public class DeploymentRef
+{
+ private String id;
+
+ private boolean suspended;
+
+ private String name;
+
+ private long timestamp;
+
+ private List<String> definitions = new ArrayList<String>();
+
+ private List<String> resourceNames = new ArrayList<String>();
+
+ public DeploymentRef()
+ {
+ }
+
+ public DeploymentRef(String id, boolean suspended)
+ {
+ this.id = id;
+ this.suspended = suspended;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ public boolean isSuspended()
+ {
+ return suspended;
+ }
+
+ public void setSuspended(boolean suspended)
+ {
+ this.suspended = suspended;
+ }
+
+ public List<String> getDefinitions()
+ {
+ return definitions;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public long getTimestamp()
+ {
+ return timestamp;
+ }
+
+ public void setTimestamp(long timestamp)
+ {
+ this.timestamp = timestamp;
+ }
+
+ public List<String> getResourceNames()
+ {
+ return resourceNames;
+ }
+}
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRefWrapper.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRefWrapper.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRefWrapper.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name = "wrapper")
+public class DeploymentRefWrapper
+{
+ List<DeploymentRef> deployments = new ArrayList<DeploymentRef>();
+
+
+ public DeploymentRefWrapper()
+ {
+ }
+
+ public DeploymentRefWrapper(List<DeploymentRef> deployments)
+ {
+ this.deployments = deployments;
+ }
+
+ public List<DeploymentRef> getDeployments()
+ {
+ return deployments;
+ }
+
+ public void setDeployments(List<DeploymentRef> deployments)
+ {
+ this.deployments = deployments;
+ }
+
+ public int getTotalCount()
+ {
+ return deployments.size();
+ }
+}
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DiagramInfo.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DiagramInfo.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DiagramInfo.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.*;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name = "diagramInfo")
+public class DiagramInfo
+{
+ private int width = -1;
+ private int height = -1;
+ private List<DiagramNodeInfo> nodeList = new ArrayList<DiagramNodeInfo>();
+
+ public DiagramInfo()
+ {
+ }
+
+ public DiagramInfo(final int height, final int width, final List<DiagramNodeInfo> l) {
+ this.height = height;
+ this.width = width;
+ final List<DiagramNodeInfo> list = new ArrayList<DiagramNodeInfo>();
+ for (DiagramNodeInfo nodeInfo : l) {
+ list.add(nodeInfo);
+ }
+ nodeList = Collections.unmodifiableList(list);
+ }
+
+ public int getWidth()
+ {
+ return width;
+ }
+
+ public void setWidth(int width)
+ {
+ this.width = width;
+ }
+
+ public int getHeight()
+ {
+ return height;
+ }
+
+ public void setHeight(int height)
+ {
+ this.height = height;
+ }
+
+ public List<DiagramNodeInfo> getNodeList()
+ {
+ return nodeList;
+ }
+
+ public void setNodeList(List<DiagramNodeInfo> nodeList)
+ {
+ this.nodeList = nodeList;
+ }
+
+}
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DiagramNodeInfo.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DiagramNodeInfo.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DiagramNodeInfo.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,103 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name = "nodeInfo")
+public class DiagramNodeInfo
+{
+ private String name;
+ private int x;
+ private int y;
+ private int width;
+ private int height;
+
+ public DiagramNodeInfo()
+ {
+ }
+
+ public DiagramNodeInfo(
+ final String name,
+ final int x, final int y,
+ final int width, final int height)
+ {
+ this.height = height;
+ this.name = name;
+ this.width = width;
+ this.x = x;
+ this.y = y;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public int getX()
+ {
+ return x;
+ }
+
+ public void setX(int x)
+ {
+ this.x = x;
+ }
+
+ public int getY()
+ {
+ return y;
+ }
+
+ public void setY(int y)
+ {
+ this.y = y;
+ }
+
+ public int getWidth()
+ {
+ return width;
+ }
+
+ public void setWidth(int width)
+ {
+ this.width = width;
+ }
+
+ public int getHeight()
+ {
+ return height;
+ }
+
+ public void setHeight(int height)
+ {
+ this.height = height;
+ }
+}
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRef.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRef.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRef.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name ="jobRef")
+public class JobRef
+{
+
+ private String id;
+ private long timestamp;
+ private String type;
+ private String errMsg;
+
+
+ public JobRef(String id, long timestamp, String type)
+ {
+ this.id = id;
+ this.timestamp = timestamp;
+ this.type = type;
+ }
+
+
+ public JobRef()
+ {
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ public long getTimestamp()
+ {
+ return timestamp;
+ }
+
+ public void setTimestamp(long timestamp)
+ {
+ this.timestamp = timestamp;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public void setType(String type)
+ {
+ this.type = type;
+ }
+
+ public void setError(String msg)
+ {
+ this.errMsg = msg;
+ }
+
+ public String getErrMsg()
+ {
+ return errMsg;
+ }
+
+ public void setErrMsg(String errMsg)
+ {
+ this.errMsg = errMsg;
+ }
+}
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRefWrapper.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRefWrapper.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRefWrapper.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name = "wrapper")
+public class JobRefWrapper
+{
+ List<JobRef> jobs = new ArrayList<JobRef>();
+
+
+ public JobRefWrapper()
+ {
+ }
+
+ public JobRefWrapper(List<JobRef> deployments)
+ {
+ this.jobs = deployments;
+ }
+
+ public List<JobRef> getJobs()
+ {
+ return jobs;
+ }
+
+ public void setJobs(List<JobRef> jobs)
+ {
+ this.jobs = jobs;
+ }
+
+ public int getTotalCount()
+ {
+ return jobs.size();
+ }
+}
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ParticipantRef.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ParticipantRef.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ParticipantRef.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ParticipantRef
+{
+ private String type;
+ private String idRef;
+ private boolean isGroup;
+
+ public ParticipantRef()
+ {
+ }
+
+ public ParticipantRef(String type, String idRef)
+ {
+ this.type = type;
+ this.idRef = idRef;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public void setType(String type)
+ {
+ this.type = type;
+ }
+
+ public String getIdRef()
+ {
+ return idRef;
+ }
+
+ public void setIdRef(String idRef)
+ {
+ this.idRef = idRef;
+ }
+
+ public boolean isGroup()
+ {
+ return isGroup;
+ }
+
+ public void setGroup(boolean group)
+ {
+ isGroup = group;
+ }
+}
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/PluginInfo.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/PluginInfo.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/PluginInfo.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class PluginInfo
+{
+ private String type;
+ private boolean available;
+
+
+ public PluginInfo()
+ {
+ }
+
+ public PluginInfo(String type, boolean available)
+ {
+ this.type = type;
+ this.available = available;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public void setType(String type)
+ {
+ this.type = type;
+ }
+
+ public boolean isAvailable()
+ {
+ return available;
+ }
+
+ public void setAvailable(boolean available)
+ {
+ this.available = available;
+ }
+}
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,188 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name="processDefinition")
+public class ProcessDefinitionRef
+{
+ private String id;
+
+ private String name;
+ private long version;
+ private String key;
+ private String description;
+ private String packageName;
+
+ private String deploymentId;
+ private boolean suspended;
+ private String formUrl = null;
+ private String diagramUrl = null;
+
+ public ProcessDefinitionRef()
+ {
+ }
+
+ public ProcessDefinitionRef(String id, String name, long version)
+ {
+ this.id = id;
+ this.name = name;
+ this.version = version;
+ }
+
+ @XmlElement(name = "processId")
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlElement(name = "name")
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public long getVersion()
+ {
+ return version;
+ }
+
+ public void setVersion(long version)
+ {
+ this.version = version;
+ }
+
+ public String toString()
+ {
+ return "ProcessDefinitionRef{id="+this.id +", name="+this.name+", version="+this.version+"}";
+ }
+
+ public String getKey()
+ {
+ return key;
+ }
+
+ public void setKey(String key)
+ {
+ this.key = key;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
+
+ public String getPackageName()
+ {
+ return packageName;
+ }
+
+ public void setPackageName(String packageName)
+ {
+ this.packageName = packageName;
+ }
+
+ public String getDeploymentId()
+ {
+ return deploymentId;
+ }
+
+ public void setDeploymentId(String deploymentId)
+ {
+ this.deploymentId = deploymentId;
+ }
+
+ public boolean isSuspended()
+ {
+ return suspended;
+ }
+
+ public void setSuspended(boolean suspended)
+ {
+ this.suspended = suspended;
+ }
+
+ public boolean equals(Object o)
+ {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ ProcessDefinitionRef that = (ProcessDefinitionRef) o;
+
+ if (version != that.version) return false;
+ if (id != null ? !id.equals(that.id) : that.id != null) return false;
+ if (key != null ? !key.equals(that.key) : that.key != null) return false;
+ if (name != null ? !name.equals(that.name) : that.name != null) return false;
+
+ return true;
+ }
+
+ public int hashCode()
+ {
+ int result;
+ result = (id != null ? id.hashCode() : 0);
+ result = 31 * result + (name != null ? name.hashCode() : 0);
+ result = 31 * result + (int) (version ^ (version >>> 32));
+ result = 31 * result + (key != null ? key.hashCode() : 0);
+ return result;
+ }
+
+ public void setFormUrl(String s)
+ {
+ this.formUrl = s;
+ }
+
+ public String getFormUrl()
+ {
+ return formUrl;
+ }
+
+ public String getDiagramUrl()
+ {
+ return diagramUrl;
+ }
+
+ public void setDiagramUrl(String diagramUrl)
+ {
+ this.diagramUrl = diagramUrl;
+ }
+}
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRefWrapper.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRefWrapper.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRefWrapper.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name = "wrapper")
+public class ProcessDefinitionRefWrapper
+{
+
+ List<ProcessDefinitionRef> definitions;
+
+ public ProcessDefinitionRefWrapper()
+ {
+ }
+
+ public ProcessDefinitionRefWrapper(List<ProcessDefinitionRef> defs)
+ {
+ this.definitions = defs;
+ }
+
+ @XmlElement
+ public List<ProcessDefinitionRef> getDefinitions()
+ {
+ return definitions;
+ }
+
+ @XmlElement(name = "totalCount")
+ public int getTotalCount()
+ {
+ return definitions.size();
+ }
+
+ public void setDefinitions(List<ProcessDefinitionRef> definitions)
+ {
+ this.definitions = definitions;
+ }
+}
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstancePerformance.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstancePerformance.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstancePerformance.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import java.util.Map;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public final class ProcessInstancePerformance
+{
+ private long id;
+ private String processName;
+
+ Map instanceMetrics; // Map<instanceId,averageExectime>
+
+ public ProcessInstancePerformance(long processId, String processName, Map instanceMetrics)
+ {
+ this.id = processId;
+ this.processName = processName;
+ this.instanceMetrics = instanceMetrics;
+ }
+
+
+ public long getId()
+ {
+ return id;
+ }
+
+ public String getProcessName()
+ {
+ return processName;
+ }
+
+ public Map getInstanceMetrics()
+ {
+ return instanceMetrics;
+ }
+}
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceRef.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceRef.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceRef.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,329 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+
+import org.jboss.bpm.console.client.model.TokenReference;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.Date;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name="processInstance")
+public class ProcessInstanceRef
+{
+ private String id;
+ private String definitionId;
+
+ private String key;
+
+ /**
+ * the active state of an instance
+ */
+ public static enum STATE {RUNNING, SUSPENDED, ENDED};
+
+ /**
+ * the end state of an instance
+ */
+ public static enum RESULT {COMPLETED, FAILED, ERROR, EXITED, OBSOLETE};
+
+ private Date startDate;
+ private Date endDate;
+
+ private boolean suspended;
+ private RESULT endResult;
+
+ private transient Lifecycle lifecycle;
+
+ private TokenReference rootToken;
+
+ public ProcessInstanceRef()
+ {
+ initLifecycle();
+ }
+
+ public ProcessInstanceRef(String id, String processDefinitionId, Date startDate, Date endDate, boolean suspended)
+ {
+
+ if(null==startDate)
+ throw new IllegalArgumentException("An instance requires a start date");
+
+ if(endDate!=null && suspended)
+ throw new IllegalArgumentException("An instance cannot be ended and suspended at the same time");
+
+ this.id = id;
+ this.definitionId = processDefinitionId;
+ this.startDate = startDate;
+ this.endDate = endDate;
+ this.suspended = suspended;
+ initLifecycle();
+ }
+
+ /**
+ * If not ENDED or SUSPENDED the instance is RUNNING
+ */
+ private void initLifecycle()
+ {
+ if(hasEnded())
+ this.lifecycle = new Lifecycle(this, STATE.ENDED);
+ else if(isSuspended())
+ this.lifecycle = new Lifecycle(this, STATE.SUSPENDED);
+ else
+ this.lifecycle = new Lifecycle(this, STATE.RUNNING);
+ }
+
+ @XmlElement(name = "instanceId")
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlElement(name = "definitionId")
+ public String getDefinitionId()
+ {
+ return definitionId;
+ }
+
+ public void setDefinitionId(String definitionId)
+ {
+ this.definitionId = definitionId;
+ }
+
+ @XmlElement(name = "key")
+ public String getKey()
+ {
+ return key !=null ? key : "";
+ }
+
+ public void setKey(String key)
+ {
+ this.key = key;
+ }
+
+ @XmlElement(name = "status")
+ public STATE getState()
+ {
+ return this.lifecycle.getState();
+ }
+
+ public void setState(String nextState)
+ {
+ setState(STATE.valueOf(nextState));
+ }
+
+ public void setState(STATE nextState)
+ {
+ this.lifecycle = this.lifecycle.transitionTo(nextState);
+ }
+
+ @XmlElement(name = "start")
+ public Date getStartDate()
+ {
+ return startDate;
+ }
+
+ public void setStartDate(Date startDate)
+ {
+ this.startDate = startDate;
+ }
+
+ @XmlElement(name = "end")
+ public Date getEndDate()
+ {
+ return endDate;
+ }
+
+ public void setEndDate(Date endDate)
+ {
+ this.endDate = endDate;
+ }
+
+ public boolean isRunning()
+ {
+ return this.startDate!=null && !isSuspended();
+ }
+
+ public boolean hasEnded()
+ {
+ return this.startDate!=null
+ && this.endDate!=null;
+ }
+
+ public boolean isSuspended()
+ {
+ return null==this.endDate && suspended;
+ }
+
+ private class Lifecycle
+ {
+ private STATE current;
+ private ProcessInstanceRef instance;
+
+ public Lifecycle(ProcessInstanceRef instance, STATE current)
+ {
+ this.instance = instance;
+ this.current = current;
+ }
+
+ public Lifecycle transitionTo(STATE next)
+ {
+ Lifecycle nextLifecycle = null;
+
+ switch(next)
+ {
+ case SUSPENDED: // only RUNNING instances can be SUSPENDED
+ if(STATE.RUNNING.equals(current))
+ {
+ nextLifecycle = new Lifecycle(instance, next);
+ instance.suspended = true;
+ break;
+ }
+ else
+ {
+ throw new IllegalTransitionException(current, next);
+ }
+ case ENDED: // both RUNNING and SUSPENDED instances can be ENDED
+ if(STATE.RUNNING.equals(current) || STATE.SUSPENDED.equals(current))
+ {
+ nextLifecycle = new Lifecycle(instance, next);
+ instance.suspended = false;
+ instance.endDate = new Date();
+ break;
+ }
+ else
+ {
+ throw new IllegalTransitionException(current, next);
+ }
+ case RUNNING: // only SUSPENDED instances can become RUNNING
+ if(STATE.SUSPENDED.equals(current))
+ {
+ nextLifecycle = new Lifecycle(instance, next);
+ instance.suspended = false;
+ break;
+ }
+ else
+ {
+ throw new IllegalTransitionException(current, next);
+ }
+ default:
+ throw new IllegalTransitionException(current, next);
+ }
+
+ return nextLifecycle;
+ }
+
+ public STATE getState()
+ {
+ return current;
+ }
+
+
+ public boolean equals(Object o)
+ {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ Lifecycle lifecycle = (Lifecycle) o;
+
+ if (current != lifecycle.current) return false;
+
+ return true;
+ }
+
+ public int hashCode()
+ {
+ int result;
+ result = (current != null ? current.hashCode() : 0);
+ return result;
+ }
+ }
+
+ private class IllegalTransitionException extends IllegalArgumentException
+ {
+
+ public IllegalTransitionException(STATE current, STATE next)
+ {
+ super("Illegal transition current " + current + " next " + next);
+ }
+ }
+
+ public TokenReference getRootToken()
+ {
+ return rootToken;
+ }
+
+ public void setRootToken(TokenReference rootToken)
+ {
+ this.rootToken = rootToken;
+ }
+
+ // it's actually just used for unmarshalling, TODO: fix it
+ public void setSuspended(boolean suspended)
+ {
+ this.suspended = suspended;
+ initLifecycle();
+ }
+
+ public RESULT getEndResult()
+ {
+ return endResult;
+ }
+
+ public void setEndResult(RESULT endResult)
+ {
+ if(getState()!=STATE.ENDED)
+ throw new IllegalArgumentException("Cannot set end result in state "+getState());
+
+ this.endResult = endResult;
+ }
+
+ public boolean equals(Object o)
+ {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ ProcessInstanceRef that = (ProcessInstanceRef) o;
+
+ if (definitionId != null ? !definitionId.equals(that.definitionId) : that.definitionId != null) return false;
+ if (id != null ? !id.equals(that.id) : that.id != null) return false;
+ if (key != null ? !key.equals(that.key) : that.key != null) return false;
+
+ return true;
+ }
+
+ public int hashCode()
+ {
+ int result;
+ result = (id != null ? id.hashCode() : 0);
+ result = 31 * result + (definitionId != null ? definitionId.hashCode() : 0);
+ result = 31 * result + (key != null ? key.hashCode() : 0);
+ return result;
+ }
+}
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceRefWrapper.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceRefWrapper.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceRefWrapper.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name = "wrapper")
+public class ProcessInstanceRefWrapper
+{
+
+ List<ProcessInstanceRef> instances;
+
+ public ProcessInstanceRefWrapper()
+ {
+ }
+
+ public ProcessInstanceRefWrapper(List<ProcessInstanceRef> instances)
+ {
+ this.instances = instances;
+ }
+
+ @XmlElement
+ public List<ProcessInstanceRef> getInstances()
+ {
+ return instances;
+ }
+
+ public void setInstances(List<ProcessInstanceRef> instances)
+ {
+ this.instances = instances;
+ }
+
+ @XmlElement(name = "totalCount")
+ public int getTotalCount()
+ {
+ return instances.size();
+ }
+}
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/RoleAssignmentRef.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/RoleAssignmentRef.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/RoleAssignmentRef.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name = "roleAssignment")
+public class RoleAssignmentRef
+{
+ private String role;
+ private boolean assigned;
+
+
+ public RoleAssignmentRef()
+ {
+ }
+
+ public RoleAssignmentRef(String role, boolean isAssigned)
+ {
+ this.role = role;
+ this.assigned = isAssigned;
+ }
+
+ @XmlElement(name = "role")
+ public String getRole()
+ {
+ return role;
+ }
+
+ public void setRole(String role)
+ {
+ this.role = role;
+ }
+
+ @XmlElement(name = "assigned")
+ public boolean isAssigned()
+ {
+ return assigned;
+ }
+
+ public void setAssigned(boolean assigned)
+ {
+ this.assigned = assigned;
+ }
+
+}
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/RoleAssignmentRefWrapper.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/RoleAssignmentRefWrapper.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/RoleAssignmentRefWrapper.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name = "wrapper")
+public class RoleAssignmentRefWrapper
+{
+ List<RoleAssignmentRef> roles;
+
+ public RoleAssignmentRefWrapper()
+ {
+ }
+
+ public RoleAssignmentRefWrapper(List<RoleAssignmentRef> roles)
+ {
+ this.roles = roles;
+ }
+
+ public List<RoleAssignmentRef> getRoles()
+ {
+ return roles;
+ }
+
+ public void setRoles(List<RoleAssignmentRef> roles)
+ {
+ this.roles = roles;
+ }
+}
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ServerStatus.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ServerStatus.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ServerStatus.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ServerStatus
+{
+ List<PluginInfo> plugins = new ArrayList<PluginInfo>();
+
+ public List<PluginInfo> getPlugins()
+ {
+ return plugins;
+ }
+}
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskRef.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskRef.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskRef.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,252 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Date;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name = "taskReference")
+public class TaskRef
+{
+ private long id;
+ private String processInstanceId;
+ private String processId;
+
+ private String name;
+ private String assignee = "";
+
+ private boolean isBlocking;
+ private boolean isSignalling = true;
+
+ private List<String> outcomes = new ArrayList<String>();
+
+ public enum STATE {OPEN, ASSIGNED, CLOSED};
+ private STATE currentState;
+
+ private List<ParticipantRef> participantUsers = new ArrayList<ParticipantRef>();
+ private List<ParticipantRef> participantGroups = new ArrayList<ParticipantRef>();
+
+ private String url;
+
+ private Date dueDate;
+ private Date createDate;
+ private int priority;
+
+ private String description;
+
+ public TaskRef()
+ {
+ initOrUpdateState();
+ }
+
+ public TaskRef(
+ long taskId,
+ String processInstanceId, String processId,
+ String taskName, String assignee,
+ boolean blocking, boolean signalling
+ )
+ {
+ this.id = taskId;
+ this.processInstanceId = processInstanceId;
+ this.processId = processId;
+ this.name = taskName;
+ setAssignee(assignee);
+ isBlocking = blocking;
+ isSignalling = signalling;
+
+ initOrUpdateState();
+ }
+
+ public long getId()
+ {
+ return id;
+ }
+
+ public void setId(long id)
+ {
+ this.id = id;
+ }
+
+ public String getProcessInstanceId()
+ {
+ return processInstanceId;
+ }
+
+ public void setProcessInstanceId(String processInstanceId)
+ {
+ this.processInstanceId = processInstanceId;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getAssignee()
+ {
+ return assignee;
+ }
+
+ public void setAssignee(String assignee)
+ {
+ if(null== assignee)
+ assignee = "";
+
+ this.assignee = assignee;
+ initOrUpdateState();
+ }
+
+ public boolean isBlocking()
+ {
+ return isBlocking;
+ }
+
+ public void setBlocking(boolean blocking)
+ {
+ isBlocking = blocking;
+ }
+
+ public boolean isSignalling()
+ {
+ return isSignalling;
+ }
+
+ public void setSignalling(boolean signalling)
+ {
+ isSignalling = signalling;
+ }
+
+ public List<String> getOutcomes()
+ {
+ return outcomes;
+ }
+
+ public void setProcessId(String processId)
+ {
+ this.processId = processId;
+ }
+
+ public List<ParticipantRef> getParticipantUsers()
+ {
+ return participantUsers;
+ }
+
+ public List<ParticipantRef> getParticipantGroups()
+ {
+ return participantGroups;
+ }
+
+ private void initOrUpdateState()
+ {
+ if(assignee ==null || assignee.equals(""))
+ {
+ currentState = STATE.OPEN;
+ }
+ else
+ {
+ currentState = STATE.ASSIGNED;
+ }
+ }
+
+ public void close()
+ {
+ if(STATE.ASSIGNED != currentState)
+ throw new IllegalArgumentException("Cannot close task in state " + currentState);
+
+ currentState = STATE.CLOSED;
+ }
+
+ public String getProcessId()
+ {
+ return processId;
+ }
+
+ public STATE getCurrentState()
+ {
+ return currentState;
+ }
+
+ public String getUrl()
+ {
+ return url;
+ }
+
+ public void setUrl(String url)
+ {
+ this.url = url;
+ }
+
+ public Date getDueDate()
+ {
+ return dueDate;
+ }
+
+ public void setDueDate(Date dueDate)
+ {
+ this.dueDate = dueDate;
+ }
+
+ public int getPriority()
+ {
+ return priority;
+ }
+
+ public void setPriority(int priority)
+ {
+ this.priority = priority;
+ }
+
+ public Date getCreateDate()
+ {
+ return createDate;
+ }
+
+ public void setCreateDate(Date createDate)
+ {
+ this.createDate = createDate;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
+
+ public String toString()
+ {
+ return "TaskRef{id:"+id+",state:"+currentState+"}";
+ }
+}
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskRefWrapper.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskRefWrapper.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskRefWrapper.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlElement;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name = "wrapper")
+public class TaskRefWrapper
+{
+ List<TaskRef> tasks = new ArrayList<TaskRef>();
+
+ public TaskRefWrapper()
+ {
+ }
+
+ public TaskRefWrapper(List<TaskRef> tasks)
+ {
+ this.tasks = tasks;
+ }
+
+ public List<TaskRef> getTasks()
+ {
+ return tasks;
+ }
+
+ public void setTasks(List<TaskRef> tasks)
+ {
+ this.tasks = tasks;
+ }
+
+ @XmlElement(name = "totalCount")
+ public int getTotalCount()
+ {
+ return tasks.size();
+ }
+}
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TokenReference.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TokenReference.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TokenReference.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name = "tokenReference")
+public class TokenReference
+{
+ private String id;
+ private String name;
+
+ private String currentNodeName;
+
+ private List<TokenReference> children = new ArrayList<TokenReference>();
+ private List<String> availableSignals = new ArrayList<String>();
+
+ private boolean canBeSignaled = true;
+
+ public TokenReference()
+ {
+ }
+
+ public TokenReference(String id, String name, String nodeName)
+ {
+ this.id = id;
+ this.name = name!=null ? name : "";
+ this.currentNodeName = nodeName;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public void setCurrentNodeName(String currentNodeName)
+ {
+ this.currentNodeName = currentNodeName;
+ }
+
+ public void setChildren(List<TokenReference> children)
+ {
+ this.children = children;
+ }
+
+ public void setAvailableSignals(List<String> availableSignals)
+ {
+ this.availableSignals = availableSignals;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public List<TokenReference> getChildren()
+ {
+ return children;
+ }
+
+ public List<String> getAvailableSignals()
+ {
+ return availableSignals;
+ }
+
+ public String getCurrentNodeName()
+ {
+ return currentNodeName;
+ }
+
+ public boolean canBeSignaled()
+ {
+ return canBeSignaled;
+ }
+
+ public void setCanBeSignaled(boolean canBeSignaled)
+ {
+ this.canBeSignaled = canBeSignaled;
+ }
+
+}
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/DateLocale.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/DateLocale.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/DateLocale.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2006 Robert Hanson <iamroberthanson AT gmail.com>
+ *
+ * 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.bpm.console.client.model.util;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Date locale support for the {@link SimpleDateParser}. You are encouraged to
+ * extend this class and provide implementations for other locales.
+ * @author <a href="mailto:g.georgovassilis at gmail.com">George Georgovassilis</a>
+ *
+ */
+public class DateLocale {
+ public final static String TOKEN_DAY_OF_WEEK = "E";
+
+ public final static String TOKEN_DAY_OF_MONTH = "d";
+
+ public final static String TOKEN_MONTH = "M";
+
+ public final static String TOKEN_YEAR = "y";
+
+ public final static String TOKEN_HOUR_12 = "h";
+
+ public final static String TOKEN_HOUR_24 = "H";
+
+ public final static String TOKEN_MINUTE = "m";
+
+ public final static String TOKEN_SECOND = "s";
+
+ public final static String TOKEN_MILLISECOND = "S";
+
+ public final static String TOKEN_AM_PM = "a";
+
+ public final static String AM = "AM";
+
+ public final static String PM = "PM";
+
+ public final static List SUPPORTED_DF_TOKENS = Arrays.asList(new String[] {
+ TOKEN_DAY_OF_WEEK, TOKEN_DAY_OF_MONTH, TOKEN_MONTH, TOKEN_YEAR,
+ TOKEN_HOUR_12, TOKEN_HOUR_24, TOKEN_MINUTE, TOKEN_SECOND,
+ TOKEN_AM_PM });
+
+ public String[] MONTH_LONG = { "January", "February", "March", "April",
+ "May", "June", "July", "August", "September", "October",
+ "November", "December" };
+
+ public String[] MONTH_SHORT = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sept", "Oct", "Nov", "Dec" };
+
+ public String[] WEEKDAY_LONG = { "Sunday", "Monday", "Tuesday",
+ "Wednesday", "Thursday", "Friday", "Saturday" };
+
+ public String[] WEEKDAY_SHORT = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri",
+ "Sat" };
+
+ public static String getAM() {
+ return AM;
+ }
+
+ public static String getPM() {
+ return PM;
+ }
+
+ public String[] getWEEKDAY_LONG() {
+ return WEEKDAY_LONG;
+ }
+
+ public String[] getWEEKDAY_SHORT() {
+ return WEEKDAY_SHORT;
+ }
+
+}
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/MapEntry.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/MapEntry.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/MapEntry.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model.util;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class MapEntry
+{
+ String name;
+ Object value;
+
+ public MapEntry(String name, Object value)
+ {
+ this.name = name;
+ this.value = value;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public Object getValue()
+ {
+ return value;
+ }
+}
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/SimpleDateFormat.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/SimpleDateFormat.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/SimpleDateFormat.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,190 @@
+/*
+ * Copyright 2006 Robert Hanson <iamroberthanson AT gmail.com>
+ *
+ * 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.bpm.console.client.model.util;
+
+import java.util.Date;
+
+ at SuppressWarnings("deprecation")
+public class SimpleDateFormat {
+ private String format;
+ private DateLocale locale = new DateLocale();
+ public static final String DEFAULT_FORMAT = "yyyy-MM-dd HH:mm:ss";
+
+
+ /**
+ * Gets the support locale for formatting and parsing dates
+ * @return
+ */
+ public DateLocale getLocale() {
+ return locale;
+ }
+
+ public void setLocale(DateLocale locale) {
+ this.locale = locale;
+ }
+
+ /**
+ * Use {@link #DEFAULT_FORMAT}
+ */
+ public SimpleDateFormat()
+ {
+ format = DEFAULT_FORMAT;
+ }
+
+ /**
+ * Use a custom format
+ */
+ public SimpleDateFormat(String pattern) {
+ format = pattern;
+ }
+
+ public String format(Date date) {
+ String f = "";
+ if (format != null && format.length() > 0) {
+ String lastTokenType = null;
+ String currentToken = "";
+ for (int i = 0; i < format.length(); i++) {
+ String thisChar = format.substring(i, i + 1);
+ String currentTokenType = DateLocale.SUPPORTED_DF_TOKENS
+ .contains(thisChar) ? thisChar : "";
+ if (currentTokenType.equals(lastTokenType) || i == 0) {
+ currentToken += thisChar;
+ lastTokenType = currentTokenType;
+ } else {
+ if ("".equals(lastTokenType))
+ f += currentToken;
+ else
+ f += handleToken(currentToken, date);
+ currentToken = thisChar;
+ lastTokenType = currentTokenType;
+ }
+ }
+ if ("".equals(lastTokenType))
+ f += currentToken;
+ else
+ f += handleToken(currentToken, date);
+ }
+ return f;
+ }
+
+ /**
+ * takes a date format string and returns the formatted portion of the date.
+ * For instance if the token is MMMM then the full month name is returned.
+ *
+ * @param token
+ * date format token
+ * @param date
+ * date to format
+ * @return formatted portion of the date
+ */
+ private String handleToken(String token, Date date) {
+ String response = token;
+ String tc = token.substring(0, 1);
+ if (DateLocale.TOKEN_DAY_OF_WEEK.equals(tc)) {
+ if (token.length() > 3)
+ response = locale.getWEEKDAY_LONG()[date.getDay()];
+ else
+ response = locale.getWEEKDAY_SHORT()[date.getDay()];
+ } else if (DateLocale.TOKEN_DAY_OF_MONTH.equals(tc)) {
+ if (token.length() == 1)
+ response = Integer.toString(date.getDate());
+ else
+ response = twoCharDateField(date.getDate());
+ } else if (DateLocale.TOKEN_MONTH.equals(tc)) {
+ switch (token.length()) {
+ case 1:
+ response = Integer.toString(date.getMonth() + 1);
+ break;
+ case 2:
+ response = twoCharDateField(date.getMonth() + 1);
+ break;
+ case 3:
+ response = locale.MONTH_SHORT[date.getMonth()];
+ break;
+ default:
+ response = locale.MONTH_LONG[date.getMonth()];
+ break;
+ }
+ } else if (DateLocale.TOKEN_YEAR.equals(tc)) {
+ if (token.length() > 2)
+ response = Integer.toString(date.getYear() + 1900);
+ else
+ response = twoCharDateField(date.getYear());
+ } else if (DateLocale.TOKEN_HOUR_12.equals(tc)) {
+ int h = date.getHours();
+ if (h == 0)
+ h = 12;
+ else if (h > 12)
+ h -= 12;
+ if (token.length() > 1)
+ response = twoCharDateField(h);
+ else
+ response = Integer.toString(h);
+ } else if (DateLocale.TOKEN_HOUR_24.equals(tc)) {
+ if (token.length() > 1)
+ response = twoCharDateField(date.getHours());
+ else
+ response = Integer.toString(date.getHours());
+ } else if (DateLocale.TOKEN_MINUTE.equals(tc)) {
+ if (token.length() > 1)
+ response = twoCharDateField(date.getMinutes());
+ else
+ response = Integer.toString(date.getMinutes());
+ } else if (DateLocale.TOKEN_SECOND.equals(tc)) {
+ if (token.length() > 1)
+ response = twoCharDateField(date.getSeconds());
+ else
+ response = Integer.toString(date.getSeconds());
+ } else if (DateLocale.TOKEN_AM_PM.equals(tc)) {
+ int hour = date.getHours();
+ if (hour > 11)
+ response = DateLocale.getPM();
+ else
+ response = DateLocale.getAM();
+ }
+ return response;
+ }
+
+ /**
+ * This is basically just a sneaky way to guarantee that our 1 or 2 digit
+ * numbers come out as a 2 character string. we add an arbitrary number
+ * larger than 100, convert this new number to a string, then take the right
+ * most 2 characters.
+ *
+ * @param num
+ * @return
+ */
+ private String twoCharDateField(int num) {
+ String res = Integer.toString(num + 1900);
+ res = res.substring(res.length() - 2);
+ return res;
+ }
+
+ private static Date newDate(long time) {
+ return new Date(time);
+ }
+
+ /**
+ * Parses text and returns the corresponding date object.
+ *
+ * @param source
+ * @return java.util.Date
+ */
+ public Date parse(String source){
+ return SimpleDateParser.parse(source, format);
+ };
+
+}
\ No newline at end of file
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/SimpleDateParser.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/SimpleDateParser.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/SimpleDateParser.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,161 @@
+/*
+ * Copyright 2006 Robert Hanson <iamroberthanson AT gmail.com>
+ *
+ * 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.bpm.console.client.model.util;
+
+import org.jboss.bpm.console.client.model.util.regex.Pattern;
+
+import java.util.Date;
+
+
+/**
+ * This is a simple regular expression based parser for date notations.
+ * While our aim is to fully support in the future the JDK date parser, currently
+ * only numeric notations and literals are supported such as <code>dd/MM/yyyy HH:mm:ss.SSSS</code>.
+ * Each entity is parsed with the same number of digits, i.e. for <code>dd</code> two digits will be
+ * parsed while for <code>d</code> only one will be parsed.
+ * @author <a href="mailto:g.georgovassilis at gmail.com">George Georgovassilis</a>
+ *
+ */
+
+ at SuppressWarnings("deprecation")
+public class SimpleDateParser {
+
+
+ private final static String DAY_IN_MONTH = "d";
+
+ private final static String MONTH = "M";
+
+ private final static String YEAR = "y";
+
+ private final static String LITERAL = "\\";
+
+ private final static int DATE_PATTERN = 0;
+
+ private final static int REGEX_PATTERN = 1;
+
+ private final static int COMPONENT = 2;
+
+ private final static int REGEX = 0;
+
+ private final static int INSTRUCTION = 1;
+
+ private final static String[] TOKENS[] = {
+ { "SSSS", "(\\d\\d\\d\\d)",DateLocale.TOKEN_MILLISECOND },
+ { "SSS", "(\\d\\d\\d)", DateLocale.TOKEN_MILLISECOND },
+ { "SS", "(\\d\\d)", DateLocale.TOKEN_MILLISECOND },
+ { "S", "(\\d)", DateLocale.TOKEN_MILLISECOND },
+ { "ss", "(\\d\\d)", DateLocale.TOKEN_SECOND },
+ { "s", "(\\d)", DateLocale.TOKEN_SECOND },
+ { "mm", "(\\d\\d)", DateLocale.TOKEN_MINUTE },
+ { "m", "(\\d)", DateLocale.TOKEN_MINUTE},
+ { "HH", "(\\d\\d)", DateLocale.TOKEN_HOUR_24},
+ { "H", "(\\d)", DateLocale.TOKEN_HOUR_24 },
+ { "dd", "(\\d\\d)", DateLocale.TOKEN_DAY_OF_MONTH },
+ { "d", "(\\d)", DateLocale.TOKEN_DAY_OF_MONTH },
+ { "MM", "(\\d\\d)", DateLocale.TOKEN_MONTH },
+ { "M", "(\\d)", DateLocale.TOKEN_MONTH },
+ { "yyyy", "(\\d\\d\\d\\d)", DateLocale.TOKEN_YEAR },
+ { "yyy", "(\\d\\d\\d)", DateLocale.TOKEN_YEAR },
+ { "yy", "(\\d\\d)", DateLocale.TOKEN_YEAR },
+ { "y", "(\\d)", DateLocale.TOKEN_YEAR }
+ };
+
+ private Pattern regularExpression;
+
+ private String instructions = "";
+
+ private static void _parse(String format, String[] args) {
+ if (format.length() == 0)
+ return;
+ if (format.startsWith("'")){
+ format = format.substring(1);
+ int end = format.indexOf("'");
+ if (end == -1)
+ throw new IllegalArgumentException("Unmatched single quotes.");
+ args[REGEX]+=Pattern.quote(format.substring(0,end));
+ format = format.substring(end+1);
+ }
+ for (int i = 0; i < TOKENS.length; i++) {
+ String[] row = TOKENS[i];
+ String datePattern = row[DATE_PATTERN];
+ if (!format.startsWith(datePattern))
+ continue;
+ format = format.substring(datePattern.length());
+ args[REGEX] += row[REGEX_PATTERN];
+ args[INSTRUCTION] += row[COMPONENT];
+ _parse(format, args);
+ return;
+ }
+ args[REGEX] += Pattern.quote(""+format.charAt(0));
+ format = format.substring(1);
+ _parse(format, args);
+ }
+
+ private static void load(Date date, String text, String component) {
+ if (component.equals(DateLocale.TOKEN_MILLISECOND)) {
+ //TODO: implement
+ }
+
+ if (component.equals(DateLocale.TOKEN_SECOND)) {
+ date.setSeconds(Integer.parseInt(text));
+ }
+
+ if (component.equals(DateLocale.TOKEN_MINUTE)) {
+ date.setMinutes(Integer.parseInt(text));
+ }
+
+ if (component.equals(DateLocale.TOKEN_HOUR_24)) {
+ date.setHours(Integer.parseInt(text));
+ }
+
+ if (component.equals(DateLocale.TOKEN_DAY_OF_MONTH)) {
+ date.setDate(Integer.parseInt(text));
+ }
+ if (component.equals(DateLocale.TOKEN_MONTH)) {
+ date.setMonth(Integer.parseInt(text)-1);
+ }
+ if (component.equals(DateLocale.TOKEN_YEAR)) {
+ //TODO: fix for short patterns
+ date.setYear(Integer.parseInt(text)-1900);
+ }
+
+ }
+
+ public SimpleDateParser(String format) {
+ String[] args = new String[] { "", "" };
+ _parse(format, args);
+ regularExpression = new Pattern(args[REGEX]);
+ instructions = args[INSTRUCTION];
+ }
+
+ public Date parse(String input) {
+ Date date = new Date(0, 0, 1, 0, 0, 0);
+ String matches[] = regularExpression.match(input);
+ if (matches == null)
+ throw new IllegalArgumentException(input+" does not match "+regularExpression.pattern());
+ if (matches.length-1!=instructions.length())
+ throw new IllegalArgumentException("Different group count - "+input+" does not match "+regularExpression.pattern());
+ for (int group = 0; group < instructions.length(); group++) {
+ String match = matches[group + 1];
+ load(date, match, ""+instructions.charAt(group));
+ }
+ return date;
+ }
+
+ public static Date parse(String input, String pattern){
+ return new SimpleDateParser(pattern).parse(input);
+ }
+}
Added: bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/regex/Pattern.java
===================================================================
--- bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/regex/Pattern.java (rev 0)
+++ bpm-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/regex/Pattern.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,186 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model.util.regex;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.google.gwt.core.client.JavaScriptObject;
+
+/**
+ * <p>
+ * Implementation of the {@link java.util.regex.Pattern} class with a
+ * wrapper aroung the Javascript <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Regular_Expressions">RegExp</a> object.
+ * As most of the methods delegate to the JavaScript RegExp object, certain differences in the
+ * declaration and behaviour of regular expressions must be expected.
+ * </p>
+ * <p>
+ * Please note that neither the {@link java.util.regex.Pattern#compile(String)} method nor
+ * {@link Matcher} instances are supported. For the later, consider using {@link Pattern#match(String)}.
+ * </p>
+ *
+ * @author George Georgovassilis
+ *
+ */
+public class Pattern {
+
+ /**
+ * Declares that regular expressions should be matched across line borders.
+ */
+ public final static int MULTILINE = 1;
+
+ /**
+ * Declares that characters are matched reglardless of case.
+ */
+ public final static int CASE_INSENSITIVE = 2;
+
+ private JavaScriptObject regExp;
+
+ private static JavaScriptObject createExpression(String pattern, int flags) {
+ String sFlags = "";
+ if ((flags & MULTILINE) != 0)
+ sFlags += "m";
+ if ((flags & CASE_INSENSITIVE) != 0)
+ sFlags += "i";
+ return _createExpression(pattern, sFlags);
+ }
+
+ private static native JavaScriptObject _createExpression(String pattern,
+ String flags)/*-{
+ return new RegExp(pattern, flags);
+ }-*/;
+
+ private native void _match(String text, List matches)/*-{
+ var regExp = this. at org.jboss.bpm.console.client.model.util.regex.Pattern::regExp;
+ var result = text.match(regExp);
+ if (result == null) return;
+ for (var i=0;i<result.length;i++)
+ matches. at java.util.ArrayList::add(Ljava/lang/Object;)(result[i]);
+ }-*/;
+
+ /**
+ * Determines wether the specified regular expression is validated by the
+ * provided input.
+ * @param regex Regular expression
+ * @param input String to validate
+ * @return <code>true</code> if matched.
+ */
+ public static boolean matches(String regex, String input) {
+ return new Pattern(regex).matches(input);
+ }
+
+ /**
+ * Escape a provided string so that it will be interpreted as a literal
+ * in regular expressions.
+ * The current implementation does escape each character even if not neccessary,
+ * generating verbose literals.
+ * @param input
+ * @return
+ */
+ public static String quote(String input) {
+ String output = "";
+ for (int i = 0; i < input.length(); i++) {
+ output += "\\" + input.charAt(i);
+ }
+ return output;
+ }
+
+ /**
+ * Class constructor
+ * @param pattern Regular expression
+ */
+ public Pattern(String pattern) {
+ this(pattern, 0);
+ }
+
+ /**
+ * Class constructor
+ * @param pattern Regular expression
+ * @param flags
+ */
+ public Pattern(String pattern, int flags) {
+ regExp = createExpression(pattern, flags);
+ }
+
+ /**
+ * This method is borrowed from the JavaScript RegExp object.
+ * It parses a string and returns as an array any assignments to parenthesis groups
+ * in the pattern's regular expression
+ * @param text
+ * @return Array of strings following java's Pattern convention for groups:
+ * Group 0 is the entire input string and the remaining groups are the matched parenthesis.
+ * In case nothing was matched an empty array is returned.
+ */
+ public String[] match(String text) {
+ List matches = new ArrayList();
+ _match(text, matches);
+ String arr[] = new String[matches.size()];
+ for (int i = 0; i < matches.size(); i++)
+ arr[i] = matches.get(i).toString();
+ return arr;
+ }
+
+ /**
+ * Determines wether a provided text matches the regular expression
+ * @param text
+ * @return
+ */
+ public native boolean matches(String text)/*-{
+ var regExp = this. at org.jboss.bpm.console.client.model.util.regex.Pattern::regExp;
+ return regExp.test(text);
+ }-*/;
+
+ /**
+ * Returns the regular expression for this pattern
+ * @return
+ */
+ public native String pattern()/*-{
+ var regExp = this. at org.jboss.bpm.console.client.model.util.regex.Pattern::regExp;
+ return regExp.source;
+ }-*/;
+
+ private native void _split(String input, List results)/*-{
+ var regExp = this. at org.jboss.bpm.console.client.model.util.regex.Pattern::regExp;
+ var parts = input.split(regExp);
+ for (var i=0;i<parts.length;i++)
+ results. at java.util.ArrayList::add(Ljava/lang/Object;)(parts[i] );
+ }-*/;
+
+ /**
+ * Split an input string by the pattern's regular expression
+ * @param input
+ * @return Array of strings
+ */
+ public String[] split(String input){
+ List results = new ArrayList();
+ _split(input, results);
+ String[] parts = new String[results.size()];
+ for (int i=0;i<results.size();i++)
+ parts[i] = (String)results.get(i);
+ return parts;
+ }
+
+ public String toString() {
+ return regExp.toString();
+ }
+}
+
Added: bpm-console/trunk/sam/gui/pom.xml
===================================================================
--- bpm-console/trunk/sam/gui/pom.xml (rev 0)
+++ bpm-console/trunk/sam/gui/pom.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,27 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <name>JBoss BPM - SAM Console (GUI SAM)</name>
+ <groupId>org.jboss.sam</groupId>
+ <artifactId>sam-gui</artifactId>
+ <packaging>jar</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.sam</groupId>
+ <artifactId>sam-console-extension</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-workspace-api</artifactId>
+ <version>${version}</version>
+ </dependency>
+ </dependencies>
+
+</project>
Added: bpm-console/trunk/sam/gui/sam-gui.iml
===================================================================
--- bpm-console/trunk/sam/gui/sam-gui.iml (rev 0)
+++ bpm-console/trunk/sam/gui/sam-gui.iml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="gwt-parent" />
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-collections:commons-collections:jar:3.2.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-lang:commons-lang:jar:2.4:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic/0.1.10/gwt-mosaic-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-logging:commons-logging:jar:1.1.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-digester:commons-digester:jar:1.8:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-digester/commons-digester/1.8/commons-digester-1.8.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.googlecode.mvc4g:mvc4g:jar:1.0.0-jboss:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/mvc4g/mvc4g/1.0.0-jboss/mvc4g-1.0.0-jboss.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-dnd:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-dnd/0.1.10/gwt-mosaic-dnd-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-gwtx:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-gwtx/0.1.10/gwt-mosaic-gwtx-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-beanutils:commons-beanutils:jar:1.7.0:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-configuration:commons-configuration:jar:1.6:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-configuration/commons-configuration/1.6/commons-configuration-1.6.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-beanutils:commons-beanutils-core:jar:1.8.0:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-beanutils/commons-beanutils-core/1.8.0/commons-beanutils-core-1.8.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-incubator:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-incubator/0.1.10/gwt-mosaic-incubator-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.activation:activation:jar:1.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.code.gwt-log:gwt-log:jar:2.5.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/code/gwt-log/gwt-log/2.5.2/gwt-log-2.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+</module>
+
Added: bpm-console/trunk/sam/gui/src/main/java/org/jboss/bpm/console/client/SAMEditor.java
===================================================================
--- bpm-console/trunk/sam/gui/src/main/java/org/jboss/bpm/console/client/SAMEditor.java (rev 0)
+++ bpm-console/trunk/sam/gui/src/main/java/org/jboss/bpm/console/client/SAMEditor.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import org.gwt.mosaic.ui.client.Label;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class SAMEditor extends Editor
+{
+ public final static String ID = SAMEditor.class.getName();
+
+ private boolean initialized;
+
+ public SAMEditor(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public void initialize()
+ {
+ if(!initialized)
+ {
+ LayoutPanel layout = new LayoutPanel();
+ layout.add(new Label("Hello form SAM"));
+
+ this.add(layout);
+
+ initialized = true;
+ }
+ }
+
+ public String getEditorId()
+ {
+ return ID;
+ }
+
+ public String getTitle()
+ {
+ return "Overview";
+ }
+
+ public MenuSection provideMenuSection()
+ {
+ //ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+
+ return new MenuSection(
+ "Activity Monitor",
+ null,
+ new SAMEditorNavigation(appContext)
+ );
+ }
+}
Added: bpm-console/trunk/sam/gui/src/main/java/org/jboss/bpm/console/client/SAMEditorNavigation.java
===================================================================
--- bpm-console/trunk/sam/gui/src/main/java/org/jboss/bpm/console/client/SAMEditorNavigation.java (rev 0)
+++ bpm-console/trunk/sam/gui/src/main/java/org/jboss/bpm/console/client/SAMEditorNavigation.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.google.gwt.user.client.ui.Tree;
+import com.google.gwt.user.client.ui.TreeItem;
+import com.google.gwt.user.client.ui.TreeListener;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+class SAMEditorNavigation extends Tree
+{
+
+ public SAMEditorNavigation(final ApplicationContext appContext)
+ {
+ super.setTitle("Activity Monitor");
+
+ TreeItem root = addItem("Base Setup");
+ TreeItem epn= root.addItem("List EPN");
+
+ addTreeListener(
+ new TreeListener()
+ {
+ public void onTreeItemSelected(TreeItem treeItem)
+ {
+ if("List EPN".equals(treeItem.getText()))
+ {
+ //Workspace workspace = appContext.getWorkpace();
+ //workspace.showEditor(ProcessEditor.ID);
+ }
+ }
+
+ public void onTreeItemStateChanged(TreeItem treeItem)
+ {
+
+ }
+ }
+ );
+ }
+}
+
Added: bpm-console/trunk/sam/pom.xml
===================================================================
--- bpm-console/trunk/sam/pom.xml (rev 0)
+++ bpm-console/trunk/sam/pom.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,24 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <name>JBoss BPM - SAM Console (SAM)</name>
+ <groupId>org.jboss.sam</groupId>
+ <artifactId>sam-console-extension</artifactId>
+ <packaging>pom</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <modules>
+ <module>server</module>
+ <module>profile</module>
+ <module>gui</module>
+ </modules>
+</project>
Added: bpm-console/trunk/sam/profile/pom.xml
===================================================================
--- bpm-console/trunk/sam/profile/pom.xml (rev 0)
+++ bpm-console/trunk/sam/profile/pom.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,19 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <name>JBoss BPM - SAM Console (GUI Profile SAM)</name>
+ <groupId>org.jboss.sam</groupId>
+ <artifactId>gwt-console-profile-sam</artifactId>
+ <packaging>jar</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.sam</groupId>
+ <artifactId>sam-console-extension</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+</project>
Added: bpm-console/trunk/sam/profile/sam-gui-profile.iml
===================================================================
--- bpm-console/trunk/sam/profile/sam-gui-profile.iml (rev 0)
+++ bpm-console/trunk/sam/profile/sam-gui-profile.iml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="gwt-parent" />
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-collections:commons-collections:jar:3.2.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-lang:commons-lang:jar:2.4:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic/0.1.10/gwt-mosaic-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-logging:commons-logging:jar:1.1.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-digester:commons-digester:jar:1.8:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-digester/commons-digester/1.8/commons-digester-1.8.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.googlecode.mvc4g:mvc4g:jar:1.0.0-jboss:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/mvc4g/mvc4g/1.0.0-jboss/mvc4g-1.0.0-jboss.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-dnd:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-dnd/0.1.10/gwt-mosaic-dnd-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-gwtx:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-gwtx/0.1.10/gwt-mosaic-gwtx-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-beanutils:commons-beanutils:jar:1.7.0:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-configuration:commons-configuration:jar:1.6:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-configuration/commons-configuration/1.6/commons-configuration-1.6.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-beanutils:commons-beanutils-core:jar:1.8.0:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-beanutils/commons-beanutils-core/1.8.0/commons-beanutils-core-1.8.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-incubator:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-incubator/0.1.10/gwt-mosaic-incubator-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.activation:activation:jar:1.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.code.gwt-log:gwt-log:jar:2.5.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/code/gwt-log/gwt-log/2.5.2/gwt-log-2.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+</module>
+
Added: bpm-console/trunk/sam/profile/sam-profile.iml
===================================================================
--- bpm-console/trunk/sam/profile/sam-profile.iml (rev 0)
+++ bpm-console/trunk/sam/profile/sam-profile.iml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="gwt-parent" />
+ <orderEntry type="module" module-name="workspace-api" />
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-collections:commons-collections:jar:3.2.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-lang:commons-lang:jar:2.4:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic/0.1.10/gwt-mosaic-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-logging:commons-logging:jar:1.1.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-digester:commons-digester:jar:1.8:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/commons-digester/commons-digester/1.8/commons-digester-1.8.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.googlecode.mvc4g:mvc4g:jar:1.0.0-jboss:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/com/googlecode/mvc4g/mvc4g/1.0.0-jboss/mvc4g-1.0.0-jboss.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-dnd:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-dnd/0.1.10/gwt-mosaic-dnd-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-gwtx:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-gwtx/0.1.10/gwt-mosaic-gwtx-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.3:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.3/gwt-user-1.5.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-beanutils:commons-beanutils:jar:1.7.0:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-configuration:commons-configuration:jar:1.6:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/commons-configuration/commons-configuration/1.6/commons-configuration-1.6.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-beanutils:commons-beanutils-core:jar:1.8.0:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/commons-beanutils/commons-beanutils-core/1.8.0/commons-beanutils-core-1.8.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-incubator:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-incubator/0.1.10/gwt-mosaic-incubator-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.activation:activation:jar:1.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.code.gwt-log:gwt-log:jar:2.5.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/com/google/code/gwt-log/gwt-log/2.5.2/gwt-log-2.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+</module>
+
Added: bpm-console/trunk/sam/profile/src/main/resources/jmaki/xhp/xhp.json
===================================================================
--- bpm-console/trunk/sam/profile/src/main/resources/jmaki/xhp/xhp.json (rev 0)
+++ bpm-console/trunk/sam/profile/src/main/resources/jmaki/xhp/xhp.json 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,12 @@
+{"xhp": {
+ "version": "1.1",
+ "services": [
+ {"id": "default",
+ "url":"http://localhost:8080/activity-monitor",
+ "passthrough":true,
+ "username":"sam",
+ "password":"password"
+ },
+ ]
+ }
+}
\ No newline at end of file
Added: bpm-console/trunk/sam/profile/src/main/resources/org/jboss/bpm/console/public/console.config.js
===================================================================
--- bpm-console/trunk/sam/profile/src/main/resources/org/jboss/bpm/console/public/console.config.js (rev 0)
+++ bpm-console/trunk/sam/profile/src/main/resources/org/jboss/bpm/console/public/console.config.js 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,8 @@
+var consoleConfig = {
+ profileName: "SAM Console",
+ logo: "sam-logo.png",
+ serverWebContext: "/activity-monitor",
+ overallReportFile: "",
+ processSummaryReportFile: "",
+ instanceSummaryReportFile: ""
+};
\ No newline at end of file
Added: bpm-console/trunk/sam/profile/src/main/resources/org/jboss/bpm/console/public/sam-logo.png
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/sam/profile/src/main/resources/org/jboss/bpm/console/public/sam-logo.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/sam/profile/src/main/resources/org/jboss/bpm/console/workspace.cfg
===================================================================
--- bpm-console/trunk/sam/profile/src/main/resources/org/jboss/bpm/console/workspace.cfg (rev 0)
+++ bpm-console/trunk/sam/profile/src/main/resources/org/jboss/bpm/console/workspace.cfg 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1 @@
+org.jboss.bpm.console.client.SAMEditor
\ No newline at end of file
Added: bpm-console/trunk/sam/sam-toplevel.iml
===================================================================
--- bpm-console/trunk/sam/sam-toplevel.iml (rev 0)
+++ bpm-console/trunk/sam/sam-toplevel.iml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,332 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/gui/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/gui/src/main/resources" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/profile/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/profile/src/main/resources" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/server/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/server/src/main/resources" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="gwt-parent" />
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-collections:commons-collections:jar:3.2.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-lang:commons-lang:jar:2.4:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic/0.1.10/gwt-mosaic-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-logging:commons-logging:jar:1.1.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-digester:commons-digester:jar:1.8:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-digester/commons-digester/1.8/commons-digester-1.8.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.googlecode.mvc4g:mvc4g:jar:1.0.0-jboss:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/googlecode/mvc4g/mvc4g/1.0.0-jboss/mvc4g-1.0.0-jboss.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-dnd:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-dnd/0.1.10/gwt-mosaic-dnd-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-gwtx:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-gwtx/0.1.10/gwt-mosaic-gwtx-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-beanutils:commons-beanutils:jar:1.7.0:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-configuration:commons-configuration:jar:1.6:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-configuration/commons-configuration/1.6/commons-configuration-1.6.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-beanutils:commons-beanutils-core:jar:1.8.0:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-beanutils/commons-beanutils-core/1.8.0/commons-beanutils-core-1.8.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-incubator:jar:0.1.10:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-incubator/0.1.10/gwt-mosaic-incubator-0.1.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.activation:activation:jar:1.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.code.gwt-log:gwt-log:jar:2.5.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/code/gwt-log/gwt-log/2.5.2/gwt-log-2.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.slf4j:slf4j-simple:jar:1.5.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/slf4j/slf4j-simple/1.5.2/slf4j-simple-1.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.resteasy:resteasy-jaxrs:jar:1.0.2.GA:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/resteasy/resteasy-jaxrs/1.0.2.GA/resteasy-jaxrs-1.0.2.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.resteasy:resteasy-multipart-provider:jar:1.0.2.GA:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/resteasy/resteasy-multipart-provider/1.0.2.GA/resteasy-multipart-provider-1.0.2.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss:jboss-common-core:jar:2.2.7.GA:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.7.GA/jboss-common-core-2.2.7.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.slf4j:slf4j-api:jar:1.5.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/slf4j/slf4j-api/1.5.2/slf4j-api-1.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.3:runtime">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.3/gwt-servlet-1.5.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javassist:javassist:jar:3.6.0.GA:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javassist/javassist/3.6.0.GA/javassist-3.6.0.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.resteasy:jaxrs-api:jar:1.0.2.GA:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/resteasy/jaxrs-api/1.0.2.GA/jaxrs-api-1.0.2.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: junit:junit:jar:3.8.1:test">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.xml:jaxb-impl:jar:2.1:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/xml/jaxb-impl/2.1/jaxb-impl-2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-fileupload:commons-fileupload:jar:1.2.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-io:commons-io:jar:1.3.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-io/commons-io/1.3.2/commons-io-1.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.annotation:jsr250-api:jar:1.0:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.ejb:ejb-api:jar:3.0:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/ejb/ejb-api/3.0/ejb-api-3.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.scannotation:scannotation:jar:1.0.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/scannotation/scannotation/1.0.2/scannotation-1.0.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.3:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.3/gwt-user-1.5.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+</module>
+
Added: bpm-console/trunk/sam/server/pom.xml
===================================================================
--- bpm-console/trunk/sam/server/pom.xml (rev 0)
+++ bpm-console/trunk/sam/server/pom.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,195 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <name>JBoss BPM - SAM Console (SAM Server)</name>
+ <groupId>org.jboss.sam</groupId>
+ <artifactId>sam-server</artifactId>
+ <packaging>war</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.sam</groupId>
+ <artifactId>sam-console-extension</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <!-- Properties -->
+ <properties>
+ <report.server.version>1.0.0-SNAPSHOT</report.server.version>
+ </properties>
+
+ <dependencies>
+ <!-- Module -->
+ <dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-common</artifactId>
+ <version>${version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-rpc</artifactId>
+ <version>${version}</version>
+ </dependency>
+
+ <!-- GWT related -->
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-servlet</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- Other -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.ejb</groupId>
+ <artifactId>ejb-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxrs</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>tjws</groupId>
+ <artifactId>webserver</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-multipart-provider</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>tjws</groupId>
+ <artifactId>webserver</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <!-- Include SOURCE in output artifact for GWT (GWT libraries must include source) -->
+ <resources>
+ <resource>
+ <directory>src/main/java</directory>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ <finalName>sam-server</finalName>
+ </build>
+</project>
Added: bpm-console/trunk/sam/server/sam-server.iml
===================================================================
--- bpm-console/trunk/sam/server/sam-server.iml (rev 0)
+++ bpm-console/trunk/sam/server/sam-server.iml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,218 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="gwt-parent" />
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-logging:commons-logging:jar:1.1.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.slf4j:slf4j-simple:jar:1.5.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/slf4j/slf4j-simple/1.5.2/slf4j-simple-1.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: junit:junit:jar:3.8.1:test">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.3:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.3/gwt-user-1.5.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.xml:jaxb-impl:jar:2.1:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/jaxb-impl/2.1/jaxb-impl-2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-fileupload:commons-fileupload:jar:1.2.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-io:commons-io:jar:1.3.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-io/commons-io/1.3.2/commons-io-1.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.resteasy:resteasy-jaxrs:jar:1.0.2.GA:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/resteasy/resteasy-jaxrs/1.0.2.GA/resteasy-jaxrs-1.0.2.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.annotation:jsr250-api:jar:1.0:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.resteasy:resteasy-multipart-provider:jar:1.0.2.GA:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/resteasy/resteasy-multipart-provider/1.0.2.GA/resteasy-multipart-provider-1.0.2.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.activation:activation:jar:1.1:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss:jboss-common-core:jar:2.2.7.GA:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.7.GA/jboss-common-core-2.2.7.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.ejb:ejb-api:jar:3.0:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/ejb/ejb-api/3.0/ejb-api-3.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.slf4j:slf4j-api:jar:1.5.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/slf4j/slf4j-api/1.5.2/slf4j-api-1.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.3:runtime">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.3/gwt-servlet-1.5.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javassist:javassist:jar:3.6.0.GA:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javassist/javassist/3.6.0.GA/javassist-3.6.0.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.resteasy:jaxrs-api:jar:1.0.2.GA:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/resteasy/jaxrs-api/1.0.2.GA/jaxrs-api-1.0.2.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.scannotation:scannotation:jar:1.0.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/scannotation/scannotation/1.0.2/scannotation-1.0.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+</module>
+
Added: bpm-console/trunk/sam/server/src/main/java/org/jboss/sam/console/server/ConsoleServerApplication.java
===================================================================
--- bpm-console/trunk/sam/server/src/main/java/org/jboss/sam/console/server/ConsoleServerApplication.java (rev 0)
+++ bpm-console/trunk/sam/server/src/main/java/org/jboss/sam/console/server/ConsoleServerApplication.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.sam.console.server;
+
+import javax.ws.rs.core.Application;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * JAX-RS core component.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ConsoleServerApplication extends Application
+{
+ HashSet<Object> singletons = new HashSet<Object>();
+
+ public ConsoleServerApplication()
+ {
+ singletons.add(new InfoFacade());
+ singletons.add(new UserMgmtFacade());
+
+ }
+
+ @Override
+ public Set<Class<?>> getClasses()
+ {
+ HashSet<Class<?>> set = new HashSet<Class<?>>();
+ return set;
+ }
+
+ @Override
+ public Set<Object> getSingletons()
+ {
+ return singletons;
+ }
+}
+
Added: bpm-console/trunk/sam/server/src/main/java/org/jboss/sam/console/server/InfoFacade.java
===================================================================
--- bpm-console/trunk/sam/server/src/main/java/org/jboss/sam/console/server/InfoFacade.java (rev 0)
+++ bpm-console/trunk/sam/server/src/main/java/org/jboss/sam/console/server/InfoFacade.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.sam.console.server;
+
+import com.google.gson.Gson;
+
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.Path;
+import javax.ws.rs.GET;
+import javax.ws.rs.Produces;
+import javax.servlet.http.HttpServletRequest;
+import org.jboss.bpm.console.server.util.*;
+import org.jboss.bpm.console.server.gson.GsonFactory;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at Path("server")
+ at RsComment(
+ title = "Server Info",
+ description = "General REST server information"
+)
+public class InfoFacade
+{
+
+ @GET
+ @Path("resources")
+ @Produces("text/html")
+ public Response getPublishedUrls(
+ @Context
+ HttpServletRequest request
+ )
+ {
+ final Class[] rootResources = new Class[]
+ {
+ InfoFacade.class,
+ UserMgmtFacade.class
+ };
+
+ RsDocBuilder rsDocBuilder = new RsDocBuilder(request.getContextPath(),rootResources);
+ StringBuffer sb = rsDocBuilder.build();
+ return Response.ok(sb.toString()).build();
+ }
+
+ private Response createJsonResponse(Object wrapper)
+ {
+ Gson gson = GsonFactory.createInstance();
+ String json = gson.toJson(wrapper);
+ return Response.ok(json).type("application/json").build();
+ }
+}
+
Added: bpm-console/trunk/sam/server/src/main/java/org/jboss/sam/console/server/UserMgmtFacade.java
===================================================================
--- bpm-console/trunk/sam/server/src/main/java/org/jboss/sam/console/server/UserMgmtFacade.java (rev 0)
+++ bpm-console/trunk/sam/server/src/main/java/org/jboss/sam/console/server/UserMgmtFacade.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.sam.console.server;
+
+import com.google.gson.Gson;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.console.client.model.RoleAssignmentRef;
+import org.jboss.bpm.console.client.model.RoleAssignmentRefWrapper;
+import org.jboss.bpm.console.server.gson.GsonFactory;
+import org.jboss.bpm.console.server.util.RsComment;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+/**
+ * REST server module for accessing user related data.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at Path("identity")
+ at RsComment(
+ title = "User management",
+ description = "Manage user and groups"
+)
+public class UserMgmtFacade
+{
+ private static final Log log = LogFactory.getLog(UserMgmtFacade.class);
+
+ @GET
+ @Path("user/roles")
+ @Produces("application/json")
+ public Response getRolesForJAASPrincipal(
+ @Context
+ HttpServletRequest request,
+ @QueryParam("roleCheck")
+ String roleCheck
+ )
+ {
+ List<RoleAssignmentRef> actualRoles = new ArrayList<RoleAssignmentRef>();
+
+ StringTokenizer tok = new StringTokenizer(roleCheck, ",");
+ while(tok.hasMoreTokens())
+ {
+ String possibleRole = tok.nextToken();
+ actualRoles.add( new RoleAssignmentRef(possibleRole, true));
+ }
+ return createJsonResponse( new RoleAssignmentRefWrapper(actualRoles));
+ }
+
+ private Response createJsonResponse(Object wrapper)
+ {
+ Gson gson = GsonFactory.createInstance();
+ String json = gson.toJson(wrapper);
+ return Response.ok(json).type("application/json").build();
+ }
+}
Added: bpm-console/trunk/sam/server/src/main/webapp/WEB-INF/jboss-web.xml
===================================================================
--- bpm-console/trunk/sam/server/src/main/webapp/WEB-INF/jboss-web.xml (rev 0)
+++ bpm-console/trunk/sam/server/src/main/webapp/WEB-INF/jboss-web.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC
+ "-//JBoss//DTD Web Application 2.4//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd">
+
+<jboss-web>
+
+ <!--security-domain>java:/jaas/jbpm-console</security-domain-->
+
+ <context-root>activity-monitor</context-root>
+
+</jboss-web>
Added: bpm-console/trunk/sam/server/src/main/webapp/WEB-INF/web.xml
===================================================================
--- bpm-console/trunk/sam/server/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ bpm-console/trunk/sam/server/src/main/webapp/WEB-INF/web.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,66 @@
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd" >
+
+<web-app>
+ <display-name>GWT Console Server</display-name>
+
+ <context-param>
+ <param-name>javax.ws.rs.core.Application</param-name>
+ <param-value>org.jboss.sam.console.server.ConsoleServerApplication</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>resteasy.servlet.mapping.prefix</param-name>
+ <param-value>/rs</param-value>
+ </context-param>
+
+ <listener>
+ <listener-class>
+ org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
+ </listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>Resteasy</servlet-name>
+ <servlet-class>
+ org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
+ </servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Resteasy</servlet-name>
+ <url-pattern>/rs/*</url-pattern>
+ </servlet-mapping>
+
+ <!--security-constraint>
+ <web-resource-collection>
+ <web-resource-name>Resteasy</web-resource-name>
+ <url-pattern>/rs/process/*</url-pattern>
+ <url-pattern>/rs/task/*</url-pattern>
+ <url-pattern>/rs/tasks/*</url-pattern>
+ <url-pattern>/rs/identity/*</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>administrator</role-name>
+ <role-name>manager</role-name>
+ <role-name>user</role-name>
+ </auth-constraint>
+ </security-constraint>
+
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ <realm-name>GWT Console Server</realm-name>
+ </login-config>
+
+ <security-role>
+ <role-name>administrator</role-name>
+ </security-role>
+ <security-role>
+ <role-name>manager</role-name>
+ </security-role>
+ <security-role>
+ <role-name>user</role-name>
+ </security-role-->
+
+</web-app>
Added: bpm-console/trunk/sam/server/src/main/webapp/index.html
===================================================================
--- bpm-console/trunk/sam/server/src/main/webapp/index.html (rev 0)
+++ bpm-console/trunk/sam/server/src/main/webapp/index.html 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,13 @@
+<html>
+<body style='font-family: sans-serif; font-size:10pt;'>
+
+<h1>SAM Console Server</h1>
+
+<h2>Published URL's</h2>
+You can find a list of resources <a href="/activity-monitor/rs/server/resources">here</a>.
+
+<h2>Problems?</h2>
+Please post any questions to the <a href="http://www.jboss.org/index.html?module=bb&op=viewforum&f=295">gwt-console developer forum</a>.
+
+</body>
+</html>
\ No newline at end of file
Added: bpm-console/trunk/server/pom.xml
===================================================================
--- bpm-console/trunk/server/pom.xml (rev 0)
+++ bpm-console/trunk/server/pom.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,23 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <name>JBoss BPM - GWT Console (Server)</name>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-servermodule</artifactId>
+ <packaging>pom</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <modules>
+ <module>server-core</module>
+ <module>server-integration</module>
+ </modules>
+</project>
Added: bpm-console/trunk/server/server-core/.classpath
===================================================================
--- bpm-console/trunk/server/server-core/.classpath (rev 0)
+++ bpm-console/trunk/server/server-core/.classpath 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: bpm-console/trunk/server/server-core/.project
===================================================================
--- bpm-console/trunk/server/server-core/.project (rev 0)
+++ bpm-console/trunk/server/server-core/.project 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>gwt-console-server</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added: bpm-console/trunk/server/server-core/SQL.txt
===================================================================
--- bpm-console/trunk/server/server-core/SQL.txt (rev 0)
+++ bpm-console/trunk/server/server-core/SQL.txt 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,21 @@
+Group membership
+----------------
+select u.NAME_ as userName, g.NAME_ as groupName, m.ROLE_ as role from JBPM_ID_USER as u, JBPM_ID_GROUP as g, JBPM_ID_MEMBERSHIP as m
+where u.ID_=m.USER_ AND m.GROUP_=g.ID_
+
+Log analysis
+-------------
+
+[Instance start and end]
+
+SELECT l.CLASS_, l.DATE_, l.TOKEN_, i.ID_ as instanceID, p.NAME_ as processName, p.ID_ as processID
+ FROM JBPM_LOG l, JBPM_TOKEN t, JBPM_PROCESSINSTANCE i, JBPM_PROCESSDEFINITION p
+WHERE l.CLASS_='I' OR l.CLASS_='X'
+AND t.ID_=l.TOKEN_
+AND t.PROCESSINSTANCE_=i.ID_
+AND i.PROCESSDEFINITION_=p.ID_
+GROUP BY l.CLASS_
+ORDER BY l.DATE_ ASC, l.TOKEN_
+
+
+
Added: bpm-console/trunk/server/server-core/default-identities.mysql.sql
===================================================================
--- bpm-console/trunk/server/server-core/default-identities.mysql.sql (rev 0)
+++ bpm-console/trunk/server/server-core/default-identities.mysql.sql 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,115 @@
+-- MySQL dump 10.11
+--
+-- Host: localhost Database: jbpmtest
+-- ------------------------------------------------------
+-- Server version 5.0.67
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+
+--
+-- Table structure for table `JBPM_ID_USER`
+--
+
+DROP TABLE IF EXISTS `JBPM_ID_USER`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `JBPM_ID_USER` (
+ `ID_` bigint(20) NOT NULL auto_increment,
+ `CLASS_` char(1) NOT NULL,
+ `NAME_` varchar(255) default NULL,
+ `EMAIL_` varchar(255) default NULL,
+ `PASSWORD_` varchar(255) default NULL,
+ PRIMARY KEY (`ID_`)
+) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Dumping data for table `JBPM_ID_USER`
+--
+
+LOCK TABLES `JBPM_ID_USER` WRITE;
+/*!40000 ALTER TABLE `JBPM_ID_USER` DISABLE KEYS */;
+INSERT INTO `JBPM_ID_USER` VALUES (3,'U','admin','','admin'),(4,'U','manager','','manager'),(5,'U','fred','','fred'),(6,'U','mary','','mary');
+/*!40000 ALTER TABLE `JBPM_ID_USER` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `JBPM_ID_GROUP`
+--
+
+DROP TABLE IF EXISTS `JBPM_ID_GROUP`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `JBPM_ID_GROUP` (
+ `ID_` bigint(20) NOT NULL auto_increment,
+ `CLASS_` char(1) NOT NULL,
+ `NAME_` varchar(255) default NULL,
+ `TYPE_` varchar(255) default NULL,
+ `PARENT_` bigint(20) default NULL,
+ PRIMARY KEY (`ID_`),
+ KEY `FK_ID_GRP_PARENT` (`PARENT_`),
+ CONSTRAINT `FK_ID_GRP_PARENT` FOREIGN KEY (`PARENT_`) REFERENCES `jbpm_id_group` (`ID_`)
+) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Dumping data for table `JBPM_ID_GROUP`
+--
+
+LOCK TABLES `JBPM_ID_GROUP` WRITE;
+/*!40000 ALTER TABLE `JBPM_ID_GROUP` DISABLE KEYS */;
+INSERT INTO `JBPM_ID_GROUP` VALUES (7,'','admin','security-role',NULL),(8,'','user','security-role',NULL),(9,'','manager','security-role',NULL),(10,'','manager','organisation',NULL),(11,'','user','organisation',NULL),(12,'G','sales','organisation',NULL),(13,'G','hr','organisation',NULL);
+/*!40000 ALTER TABLE `JBPM_ID_GROUP` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `JBPM_ID_MEMBERSHIP`
+--
+
+DROP TABLE IF EXISTS `JBPM_ID_MEMBERSHIP`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `JBPM_ID_MEMBERSHIP` (
+ `ID_` bigint(20) NOT NULL auto_increment,
+ `CLASS_` char(1) NOT NULL,
+ `NAME_` varchar(255) default NULL,
+ `ROLE_` varchar(255) default NULL,
+ `USER_` bigint(20) default NULL,
+ `GROUP_` bigint(20) default NULL,
+ PRIMARY KEY (`ID_`),
+ KEY `FK_ID_MEMSHIP_GRP` (`GROUP_`),
+ KEY `FK_ID_MEMSHIP_USR` (`USER_`),
+ CONSTRAINT `FK_ID_MEMSHIP_USR` FOREIGN KEY (`USER_`) REFERENCES `jbpm_id_user` (`ID_`),
+ CONSTRAINT `FK_ID_MEMSHIP_GRP` FOREIGN KEY (`GROUP_`) REFERENCES `jbpm_id_group` (`ID_`)
+) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Dumping data for table `JBPM_ID_MEMBERSHIP`
+--
+
+LOCK TABLES `JBPM_ID_MEMBERSHIP` WRITE;
+/*!40000 ALTER TABLE `JBPM_ID_MEMBERSHIP` DISABLE KEYS */;
+INSERT INTO `JBPM_ID_MEMBERSHIP` VALUES (3,'M',NULL,NULL,3,7),(4,'M',NULL,NULL,3,9),(5,'M',NULL,NULL,3,8),(6,'M',NULL,NULL,3,10),(7,'M',NULL,NULL,4,9),(9,'M',NULL,NULL,4,8),(10,'M',NULL,NULL,4,13),(11,'M',NULL,NULL,4,11),(12,'M',NULL,NULL,5,11),(13,'M',NULL,NULL,5,8),(14,'',NULL,NULL,6,8),(15,'M',NULL,NULL,6,11);
+/*!40000 ALTER TABLE `JBPM_ID_MEMBERSHIP` ENABLE KEYS */;
+UNLOCK TABLES;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+-- Dump completed on 2008-11-20 10:39:38
Added: bpm-console/trunk/server/server-core/deploy.sh
===================================================================
--- bpm-console/trunk/server/server-core/deploy.sh (rev 0)
+++ bpm-console/trunk/server/server-core/deploy.sh 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,10 @@
+#! /bin/bash
+
+mvn -o -DskipTests install
+
+SRC=target/gwt-console-server.war
+DEST=$JBOSS422/server/default/deploy/jbpm
+
+echo
+echo "cp $SRC $DEST"
+cp $SRC $DEST
Property changes on: bpm-console/trunk/server/server-core/deploy.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: bpm-console/trunk/server/server-core/pom.xml
===================================================================
--- bpm-console/trunk/server/server-core/pom.xml (rev 0)
+++ bpm-console/trunk/server/server-core/pom.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,228 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <name>JBoss BPM - GWT Console (Server Main)</name>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-server</artifactId>
+ <packaging>war</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-servermodule</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <!-- Properties -->
+ <properties>
+ <report.server.version>1.0.0-SNAPSHOT</report.server.version>
+ <json-lib.version>2.2.3</json-lib.version>
+ </properties>
+
+ <dependencies>
+ <!-- Module -->
+ <dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-server-integration</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-common</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- GWT related -->
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-servlet</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- Other -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.ejb</groupId>
+ <artifactId>ejb-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxrs</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>tjws</groupId>
+ <artifactId>webserver</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-multipart-provider</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>tjws</groupId>
+ <artifactId>webserver</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.json-lib</groupId>
+ <artifactId>json-lib</artifactId>
+ <version>${json-lib.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>report-core</artifactId>
+
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <!-- Include SOURCE in output artifact for GWT (GWT libraries must include source) -->
+ <resources>
+ <resource>
+ <directory>src/main/java</directory>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <finalName>${project.build.finalName}</finalName>
+ <appendAssemblyId>true</appendAssemblyId>
+ <descriptors>
+ <descriptor>scripts/assembly-config.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ <finalName>gwt-console-server</finalName>
+ </build>
+</project>
Added: bpm-console/trunk/server/server-core/scripts/assembly-config.xml
===================================================================
--- bpm-console/trunk/server/server-core/scripts/assembly-config.xml (rev 0)
+++ bpm-console/trunk/server/server-core/scripts/assembly-config.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,17 @@
+<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+ <id>report</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <fileSets>
+ <fileSet>
+ <directory>${project.build.outputDirectory}</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>*.rpt*</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+</assembly>
\ No newline at end of file
Added: bpm-console/trunk/server/server-core/server-core.iml
===================================================================
--- bpm-console/trunk/server/server-core/server-core.iml (rev 0)
+++ bpm-console/trunk/server/server-core/server-core.iml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,454 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <exclude-output />
+ <output-test url="file://$MODULE_DIR$/../../../../../jbpm4/trunk/classes/test/server-core" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="gwt-rpc" exported="" />
+ <orderEntry type="module" module-name="server-integration" exported="" />
+ <orderEntry type="module" module-name="report-server" exported="" />
+ <orderEntry type="module" module-name="gwt-parent" />
+ <orderEntry type="library" name="jaxb-impl-2.1" level="application" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/resteasy/resteasy-multipart-provider/1.0.2.GA/resteasy-multipart-provider-1.0.2.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.slf4j:slf4j-simple:jar:1.5.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/slf4j/slf4j-simple/1.5.2/slf4j-simple-1.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: junit:junit:jar:3.8.1:test">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-logging:commons-logging:jar:1.1.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: net.sf.json-lib:json-lib:jar:2.2.3:test">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/net/sf/json-lib/json-lib/2.2.3/json-lib-2.2.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.eclipse.birt:modelapi:jar:2.3.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/eclipse/birt/modelapi/2.3.2/modelapi-2.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-discovery:commons-discovery:jar:0.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-discovery/commons-discovery/0.2/commons-discovery-0.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.3:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.3/gwt-user-1.5.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.xml:jaxb-impl:jar:2.1:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/jaxb-impl/2.1/jaxb-impl-2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.eclipse.birt:dataadapterapi:jar:2.3.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/eclipse/birt/dataadapterapi/2.3.2/dataadapterapi-2.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-beanutils:commons-beanutils:jar:1.7.0:test">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-fileupload:commons-fileupload:jar:1.2.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-io:commons-io:jar:1.3.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-io/commons-io/1.3.2/commons-io-1.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.resteasy:resteasy-jaxrs:jar:1.0.2.GA:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/resteasy/resteasy-jaxrs/1.0.2.GA/resteasy-jaxrs-1.0.2.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.annotation:jsr250-api:jar:1.0:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.eclipse.birt:chartengineapi:jar:2.3.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/eclipse/birt/chartengineapi/2.3.2/chartengineapi-2.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.eclipse.emf:common:jar:2.4.0:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/eclipse/emf/common/2.4.0/common-2.4.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.eclipse.emf:ecore-xmi:jar:2.4.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/eclipse/emf/ecore-xmi/2.4.1/ecore-xmi-2.4.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.resteasy:resteasy-multipart-provider:jar:1.0.2.GA:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/resteasy/resteasy-multipart-provider/1.0.2.GA/resteasy-multipart-provider-1.0.2.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-cli:commons-cli:jar:1.0:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-cli/commons-cli/1.0/commons-cli-1.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.eclipse.birt:scriptapi:jar:2.3.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/eclipse/birt/scriptapi/2.3.2/scriptapi-2.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.activation:activation:jar:1.1:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss:jboss-common-core:jar:2.2.7.GA:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.7.GA/jboss-common-core-2.2.7.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.eclipse.birt:engineapi:jar:2.3.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/eclipse/birt/engineapi/2.3.2/engineapi-2.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: net.sf.ezmorph:ezmorph:jar:1.0.6:test">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.eclipse.birt:dteapi:jar:2.3.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/eclipse/birt/dteapi/2.3.2/dteapi-2.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-codec:commons-codec:jar:1.3:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-codec/commons-codec/1.3/commons-codec-1.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-codec/commons-codec/1.3/commons-codec-1.3-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-lang:commons-lang:jar:2.4:test">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.w3c:sac:jar:1.3:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/w3c/sac/1.3/sac-1.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.ejb:ejb-api:jar:3.0:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/ejb/ejb-api/3.0/ejb-api-3.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.slf4j:slf4j-api:jar:1.5.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/slf4j/slf4j-api/1.5.2/slf4j-api-1.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.3:runtime">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.3/gwt-servlet-1.5.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.eclipse.birt:coreapi:jar:2.3.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/eclipse/birt/coreapi/2.3.2/coreapi-2.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: rhino:js:jar:1.6R2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/rhino/js/1.6R2/js-1.6R2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javassist:javassist:jar:3.6.0.GA:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javassist/javassist/3.6.0.GA/javassist-3.6.0.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.lowagie:itext:jar:1.3:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/lowagie/itext/1.3/itext-1.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.bpm:report-core:jar:1.0.0-SNAPSHOT:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/bpm/report-core/1.0.0-SNAPSHOT/report-core-1.0.0-SNAPSHOT.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.eclipse.emf:ecore:jar:2.4.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/eclipse/emf/ecore/2.4.2/ecore-2.4.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-collections:commons-collections:jar:3.2:test">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-collections/commons-collections/3.2/commons-collections-3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.w3c:flute:jar:1.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/w3c/flute/1.2/flute-1.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.resteasy:jaxrs-api:jar:1.0.2.GA:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/resteasy/jaxrs-api/1.0.2.GA/jaxrs-api-1.0.2.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.ibm.icu:icu4j:jar:3.8.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/ibm/icu/icu4j/3.8.1/icu4j-3.8.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.scannotation:scannotation:jar:1.0.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/scannotation/scannotation/1.0.2/scannotation-1.0.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+</module>
+
Added: bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java
===================================================================
--- bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server;
+
+import org.jboss.bpm.report.ReportFacade;
+
+import javax.ws.rs.core.Application;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * JAX-RS core component.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ConsoleServerApplication extends Application
+{
+ HashSet<Object> singletons = new HashSet<Object>();
+
+ public ConsoleServerApplication()
+ {
+ singletons.add(new InfoFacade());
+ singletons.add(new ProcessMgmtFacade());
+ singletons.add(new TaskListFacade());
+ singletons.add(new TaskMgmtFacade());
+ singletons.add(new UserMgmtFacade());
+ singletons.add(new EngineFacade());
+ singletons.add(new FormProcessingFacade());
+ singletons.add(new ReportFacade() );
+ }
+
+ @Override
+ public Set<Class<?>> getClasses()
+ {
+ HashSet<Class<?>> set = new HashSet<Class<?>>();
+ return set;
+ }
+
+ @Override
+ public Set<Object> getSingletons()
+ {
+ return singletons;
+ }
+}
Added: bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/EngineFacade.java
===================================================================
--- bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/EngineFacade.java (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/EngineFacade.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,200 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server;
+
+import com.google.gson.Gson;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.console.client.model.DeploymentRef;
+import org.jboss.bpm.console.client.model.DeploymentRefWrapper;
+import org.jboss.bpm.console.client.model.JobRef;
+import org.jboss.bpm.console.client.model.JobRefWrapper;
+import org.jboss.bpm.console.server.gson.GsonFactory;
+import org.jboss.bpm.console.server.plugin.ProcessEnginePlugin;
+import org.jboss.bpm.console.server.plugin.PluginMgr;
+import org.jboss.bpm.console.server.util.RsComment;
+
+import javax.ws.rs.*;
+import javax.ws.rs.core.Response;
+import java.util.List;
+
+/**
+ * Manage process deployments
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at Path("engine")
+ at RsComment(
+ title = "Process Engine",
+ description = "Process runtime state"
+)
+public class EngineFacade
+{
+ private static final Log log = LogFactory.getLog(EngineFacade.class);
+
+ private ProcessEnginePlugin processEnginePlugin;
+
+ private ProcessEnginePlugin getDeploymentPlugin()
+ {
+ if(null==this.processEnginePlugin)
+ {
+ this.processEnginePlugin = PluginMgr.load(ProcessEnginePlugin.class);
+ }
+
+ return this.processEnginePlugin;
+ }
+
+ @GET
+ @Path("deployments")
+ @Produces("application/json")
+ public Response getDeployments()
+ {
+
+ ProcessEnginePlugin dplPlugin = getDeploymentPlugin();
+ if(processEnginePlugin !=null)
+ {
+ List<DeploymentRef> dpls = dplPlugin.getDeployments();
+ return createJsonResponse(
+ new DeploymentRefWrapper(dpls)
+ );
+ }
+ else
+ {
+ log.error("ProcessEnginePlugin not available");
+ return Response.serverError().build();
+ }
+
+ }
+
+ @POST
+ @Path("deployment/{id}/suspend")
+ @Produces("application/json")
+ public Response suspendDeployment(
+ @PathParam("id")
+ String id
+ )
+ {
+ return doSuspend(id, true);
+ }
+
+ @POST
+ @Path("deployment/{id}/resume")
+ @Produces("application/json")
+ public Response resumeDeployment(
+ @PathParam("id")
+ String id
+ )
+ {
+ return doSuspend(id, false);
+ }
+
+ private Response doSuspend(String id, boolean suspended)
+ {
+ ProcessEnginePlugin dplPlugin = getDeploymentPlugin();
+ if(processEnginePlugin !=null)
+ {
+ processEnginePlugin.suspendDeployment(id, suspended);
+ return Response.ok().build();
+ }
+ else
+ {
+ log.error("ProcessEnginePlugin not available");
+ return Response.serverError().build();
+ }
+ }
+
+ @POST
+ @Path("deployment/{id}/delete")
+ @Produces("application/json")
+ public Response deleteDeployment(
+ @PathParam("id")
+ String id
+ )
+ {
+
+ ProcessEnginePlugin dplPlugin = getDeploymentPlugin();
+ if(processEnginePlugin !=null)
+ {
+ processEnginePlugin.deleteDeployment(id);
+ return Response.ok().build();
+ }
+ else
+ {
+ log.error("ProcessEnginePlugin not available");
+ return Response.serverError().build();
+ }
+
+ }
+
+
+ @GET
+ @Path("jobs")
+ @Produces("application/json")
+ public Response getJobs()
+ {
+
+ ProcessEnginePlugin dplPlugin = getDeploymentPlugin();
+ if(processEnginePlugin !=null)
+ {
+ List<JobRef> jobs = dplPlugin.getJobs();
+ return createJsonResponse(
+ new JobRefWrapper(jobs)
+ );
+ }
+ else
+ {
+ log.error("ProcessEnginePlugin not available");
+ return Response.serverError().build();
+ }
+
+ }
+
+ @POST
+ @Path("job/{id}/execute")
+ @Produces("application/json")
+ public Response executeJob(
+ @PathParam("id")
+ String id
+ )
+ {
+
+ ProcessEnginePlugin dplPlugin = getDeploymentPlugin();
+ if(processEnginePlugin !=null)
+ {
+ dplPlugin.executeJob(id);
+ return Response.ok().build();
+ }
+ else
+ {
+ log.error("ProcessEnginePlugin not available");
+ return Response.serverError().build();
+ }
+
+ }
+
+ private Response createJsonResponse(Object wrapper)
+ {
+ Gson gson = GsonFactory.createInstance();
+ String json = gson.toJson(wrapper);
+ return Response.ok(json).type("application/json").build();
+ }
+}
Added: bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/FormProcessingFacade.java
===================================================================
--- bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/FormProcessingFacade.java (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/FormProcessingFacade.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,290 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+import org.jboss.bpm.console.server.integration.ManagementFactory;
+import org.jboss.bpm.console.server.integration.ProcessManagement;
+import org.jboss.bpm.console.server.integration.TaskManagement;
+import org.jboss.bpm.console.server.plugin.FormAuthorityRef;
+import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
+import org.jboss.bpm.console.server.plugin.PluginMgr;
+import org.jboss.bpm.console.server.util.RsComment;
+import org.jboss.resteasy.plugins.providers.multipart.InputPart;
+import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
+
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.*;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at Path("form")
+ at RsComment(
+ title = "Form Processing",
+ description = "Web based form processing"
+)
+public class FormProcessingFacade
+{
+ private static final Log log = LogFactory.getLog(FormProcessingFacade.class);
+
+ private FormDispatcherPlugin formPlugin;
+
+ private ProcessManagement processManagement;
+
+ private TaskManagement taskManagement;
+
+ /**
+ * Lazy load the {@link org.jboss.bpm.console.server.integration.TaskManagement}
+ */
+ private TaskManagement getTaskManagement()
+ {
+ if(null==this.taskManagement)
+ {
+ ManagementFactory factory = ManagementFactory.newInstance();
+ this.taskManagement = factory.createTaskManagement();
+ log.debug("Using ManagementFactory impl:" + factory.getClass().getName());
+ }
+
+ return this.taskManagement;
+ }
+
+ private ProcessManagement getProcessManagement()
+ {
+ if(null==this.processManagement)
+ {
+ ManagementFactory factory = ManagementFactory.newInstance();
+ this.processManagement = factory.createProcessManagement();
+ log.debug("Using ManagementFactory impl:" + factory.getClass().getName());
+ }
+
+ return this.processManagement;
+ }
+
+ /**
+ * Lazy load the {@link org.jboss.bpm.console.server.integration.TaskManagement}
+ */
+ private FormDispatcherPlugin getFormDispatcherPlugin()
+ {
+ if(null==this.formPlugin)
+ {
+ this.formPlugin = PluginMgr.load(FormDispatcherPlugin.class);
+ log.debug("Using FormDispatcherPlugin impl:" + this.formPlugin);
+ }
+
+ return this.formPlugin;
+ }
+
+
+ @GET
+ @Path("task/{id}/render")
+ @Produces("text/html")
+ public Response renderTaskUI(
+ @PathParam("id")
+ String taskId
+ )
+ {
+ return provideForm(new FormAuthorityRef(taskId));
+ }
+
+ @GET
+ @Path("process/{id}/render")
+ @Produces("text/html")
+ public Response renderProcessUI(
+ @PathParam("id")
+ String definitionId
+ )
+ {
+ return provideForm(new FormAuthorityRef(definitionId, FormAuthorityRef.Type.PROCESS));
+ }
+
+ @POST
+ @Path("task/{id}/complete")
+ @Produces("text/html")
+ @Consumes("multipart/form-data")
+ public Response closeTaskWithUI(
+ @Context
+ HttpServletRequest request,
+ @PathParam("id")
+ String taskId,
+ MultipartFormDataInput payload
+ )
+ {
+ FieldMapping mapping = createFieldMapping(payload);
+
+ // complete task
+ String username = request.getUserPrincipal() != null ?
+ request.getUserPrincipal().getName() : null;
+
+ String outcomeDirective = mapping.directives.get("outcome");
+
+ if(outcomeDirective!=null)
+ {
+ getTaskManagement().completeTask(
+ Long.valueOf(taskId), // TODO: change to string id's
+ outcomeDirective, // actually a plugin implementation detail
+ mapping.processVars,
+ username
+ );
+ }
+ else
+ {
+ getTaskManagement().completeTask(
+ Long.valueOf(taskId),
+ mapping.processVars,
+ username
+ );
+ }
+
+ return Response.ok("Successfully processed input").build();
+ }
+
+ @POST
+ @Path("process/{id}/complete")
+ @Produces("text/html")
+ @Consumes("multipart/form-data")
+ public Response startProcessWithUI(
+ @Context
+ HttpServletRequest request,
+ @PathParam("id")
+ String definitionId,
+ MultipartFormDataInput payload
+ )
+ {
+ FieldMapping mapping = createFieldMapping(payload);
+
+ // start process
+ ProcessInstanceRef instance =
+ getProcessManagement().newInstance(definitionId, mapping.processVars);
+
+ return Response.ok("Successfully processed input").build();
+ }
+
+ private Response provideForm(FormAuthorityRef authorityRef)
+ {
+ DataHandler dh = getFormDispatcherPlugin().provideForm(
+ authorityRef
+ );
+
+ if(null==dh)
+ {
+ throw new RuntimeException("No UI associated with "+authorityRef.getType()+" " + authorityRef.getReferenceId());
+ }
+
+ return Response.ok(dh.getDataSource()).type("text/html").build();
+ }
+
+ private FieldMapping createFieldMapping(MultipartFormDataInput payload)
+ {
+ FieldMapping mapping = new FieldMapping();
+
+ Map<String, InputPart> formData = payload.getFormData();
+ Iterator<String> partNames = formData.keySet().iterator();
+
+ while(partNames.hasNext())
+ {
+ final String partName = partNames.next();
+ final InputPart part = formData.get(partName);
+ final MediaType mediaType = part.getMediaType();
+
+ if(MediaType.TEXT_PLAIN_TYPE.equals(mediaType))
+ {
+ // RFC2045: Each part has an optional "Content-Type" header
+ // that defaults to "text/plain".
+ // Can go into process without conversion
+ if(mapping.isReserved(partName))
+ mapping.directives.put(partName, part.getBodyAsString());
+ else
+ mapping.processVars.put(partName, part.getBodyAsString());
+ }
+ else
+ {
+ // anything else turns into a DataHandler
+ final byte[] data = part.getBodyAsString().getBytes();
+ DataHandler dh = new DataHandler(
+ new DataSource()
+ {
+ public InputStream getInputStream() throws IOException
+ {
+ return new ByteArrayInputStream(data);
+ }
+
+ public OutputStream getOutputStream() throws IOException
+ {
+ throw new RuntimeException("This is a readonly DataHandler");
+ }
+
+ public String getContentType()
+ {
+ return mediaType.getType();
+ }
+
+ public String getName()
+ {
+ return partName;
+ }
+ }
+ );
+
+ mapping.processVars.put(partName, dh);
+ }
+ }
+
+ return mapping;
+ }
+
+ private class FieldMapping
+ {
+ final String[] reservedNames = {"outcome", "form"}; // TODO: implementation detail of the form plugin
+
+ Map<String,Object> processVars = new HashMap<String,Object>();
+ Map<String,String> directives = new HashMap<String,String>();
+
+ public boolean isReserved(String name)
+ {
+ boolean result = false;
+ for(String s : reservedNames)
+ {
+ if(s.equals(name))
+ {
+ result = true;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
Added: bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/InfoFacade.java
===================================================================
--- bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/InfoFacade.java (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/InfoFacade.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,123 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server;
+
+import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
+import org.jboss.bpm.console.server.plugin.PluginMgr;
+import org.jboss.bpm.console.server.plugin.GraphViewerPlugin;
+import org.jboss.bpm.console.server.plugin.ProcessEnginePlugin;
+import org.jboss.bpm.console.server.gson.GsonFactory;
+import org.jboss.bpm.console.server.util.RsDocBuilder;
+import org.jboss.bpm.console.server.util.RsComment;
+import org.jboss.bpm.console.client.model.ServerStatus;
+import org.jboss.bpm.console.client.model.PluginInfo;
+import org.jboss.bpm.report.ReportFacade;
+
+import javax.ws.rs.Path;
+import javax.ws.rs.GET;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Context;
+import javax.servlet.http.HttpServletRequest;
+
+import com.google.gson.Gson;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at Path("server")
+ at RsComment(
+ title = "Server Info",
+ description = "General REST server information"
+)
+public class InfoFacade
+{
+
+ private Class[] pluginInterfaces = {
+ FormDispatcherPlugin.class,
+ GraphViewerPlugin.class,
+ ProcessEnginePlugin.class
+ };
+
+ private ServerStatus status = null;
+
+ @GET
+ @Path("status")
+ @Produces("application/json")
+ @RsComment(
+ title = "Plugins",
+ description = "Plugin availablity"
+ )
+ public Response getServerInfo()
+ {
+ ServerStatus status = getServerStatus();
+ return createJsonResponse(status);
+ }
+
+ private ServerStatus getServerStatus()
+ {
+ if(null==this.status) // expensive to create
+ {
+ this.status = new ServerStatus();
+ for(Class type : pluginInterfaces)
+ {
+ Object impl = PluginMgr.load(type);
+ boolean isAvailable = (impl!=null);
+
+ status.getPlugins().add(new PluginInfo(type.getName(), isAvailable));
+ }
+ }
+ return status;
+ }
+
+ @GET
+ @Path("resources")
+ @Produces("text/html")
+ public Response getPublishedUrls(
+ @Context
+ HttpServletRequest request
+ )
+ {
+ final Class[] rootResources = new Class[]
+ {
+ InfoFacade.class,
+ ProcessMgmtFacade.class,
+ TaskListFacade.class,
+ TaskMgmtFacade.class,
+ UserMgmtFacade.class,
+ EngineFacade.class,
+ FormProcessingFacade.class
+ //,ReportFacade.class
+ };
+
+ RsDocBuilder rsDocBuilder = new RsDocBuilder(request.getContextPath(),rootResources);
+ StringBuffer sb = rsDocBuilder.build();
+ return Response.ok(sb.toString()).build();
+ }
+
+ private Response createJsonResponse(Object wrapper)
+ {
+ Gson gson = GsonFactory.createInstance();
+ String json = gson.toJson(wrapper);
+ return Response.ok(json).type("application/json").build();
+ }
+}
Added: bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java
===================================================================
--- bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,339 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server;
+
+import com.google.gson.Gson;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.console.client.model.*;
+import org.jboss.bpm.console.server.gson.GsonFactory;
+import org.jboss.bpm.console.server.integration.ManagementFactory;
+import org.jboss.bpm.console.server.integration.ProcessManagement;
+import org.jboss.bpm.console.server.plugin.FormAuthorityRef;
+import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
+import org.jboss.bpm.console.server.plugin.GraphViewerPlugin;
+import org.jboss.bpm.console.server.plugin.PluginMgr;
+import org.jboss.bpm.console.server.util.Payload2XML;
+import org.jboss.bpm.console.server.util.RsComment;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.*;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * REST server module for accessing process related data.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at Path("process")
+ at RsComment(
+ title = "Process Management",
+ description = "Process related data.")
+public class ProcessMgmtFacade
+{
+ private static final Log log = LogFactory.getLog(ProcessMgmtFacade.class);
+
+ private ProcessManagement processManagement;
+ private GraphViewerPlugin graphViewerPlugin;
+
+ private FormDispatcherPlugin formPlugin;
+
+ /**
+ * Lazy load the {@link org.jboss.bpm.console.server.plugin.FormDispatcherPlugin}.
+ * Can be null if the plugin is not available.
+ */
+ private FormDispatcherPlugin getFormDispatcherPlugin()
+ {
+ if(null==this.formPlugin)
+ {
+ this.formPlugin = PluginMgr.load(FormDispatcherPlugin.class);
+ }
+
+ return this.formPlugin;
+ }
+
+ private ProcessManagement getProcessManagement()
+ {
+ if(null==this.processManagement)
+ {
+ ManagementFactory factory = ManagementFactory.newInstance();
+ this.processManagement = factory.createProcessManagement();
+ log.debug("Using ManagementFactory impl:" + factory.getClass().getName());
+ }
+
+ return this.processManagement;
+ }
+
+ private GraphViewerPlugin getGraphViewerPlugin()
+ {
+ if(graphViewerPlugin==null)
+ {
+ graphViewerPlugin = PluginMgr.load(
+ GraphViewerPlugin.class
+ );
+ }
+
+ return graphViewerPlugin;
+ }
+
+ @GET
+ @Path("definitions")
+ @Produces("application/json")
+ public Response getDefinitionsJSON()
+ {
+ List<ProcessDefinitionRef> processDefinitions = getProcessManagement().getProcessDefinitions();
+ return decorateProcessDefintions(processDefinitions);
+ }
+
+ /**
+ * Enriches {@link org.jboss.bpm.console.client.model.ProcessDefinitionRef} with
+ * form and diagram URLs if applicable.
+ */
+ private Response decorateProcessDefintions( List<ProcessDefinitionRef> processDefinitions)
+ {
+ // decorate process form URL if plugin available
+ FormDispatcherPlugin formPlugin = getFormDispatcherPlugin();
+ if(formPlugin!=null)
+ {
+ for(ProcessDefinitionRef def : processDefinitions)
+ {
+ URL processFormURL = formPlugin.getDispatchUrl(
+ new FormAuthorityRef(def.getId(), FormAuthorityRef.Type.PROCESS)
+ );
+ if(processFormURL!=null)
+ {
+ def.setFormUrl(processFormURL.toExternalForm());
+ }
+ }
+ }
+
+ // decorate the diagram URL if available
+ GraphViewerPlugin graphViewer = getGraphViewerPlugin();
+ if(graphViewer!=null)
+ {
+ for(ProcessDefinitionRef def : processDefinitions)
+ {
+ URL diagramUrl = graphViewer.getDiagramURL(def.getId());
+ if(diagramUrl!=null)
+ {
+ def.setDiagramUrl(diagramUrl.toExternalForm());
+ }
+ }
+ }
+
+ ProcessDefinitionRefWrapper wrapper =
+ new ProcessDefinitionRefWrapper(processDefinitions);
+ return createJsonResponse(wrapper);
+ }
+
+ @POST
+ @Path("definition/{id}/remove")
+ @Produces("application/json")
+ public Response removeDefinitionsJSON(
+ @PathParam("id")
+ String definitionId
+ )
+ {
+ ProcessDefinitionRefWrapper wrapper =
+ new ProcessDefinitionRefWrapper( getProcessManagement().removeProcessDefinition(definitionId));
+ return createJsonResponse(wrapper);
+ }
+
+ @GET
+ @Path("definition/{id}/instances")
+ @Produces("application/json")
+ public Response getInstancesJSON(
+ @PathParam("id")
+ String definitionId
+ )
+ {
+ ProcessInstanceRefWrapper wrapper =
+ new ProcessInstanceRefWrapper(getProcessManagement().getProcessInstances(definitionId));
+ return createJsonResponse(wrapper);
+ }
+
+ @POST
+ @Path("definition/{id}/new_instance")
+ @Produces("application/json")
+ public Response newInstance(
+ @PathParam("id")
+ String definitionId)
+ {
+
+ ProcessInstanceRef instance = null;
+ try
+ {
+ instance = getProcessManagement().newInstance(definitionId);
+ return createJsonResponse(instance);
+ }
+ catch (Throwable t)
+ {
+ throw new WebApplicationException(t, 500);
+ }
+
+ }
+
+ @GET
+ @Path("instance/{id}/dataset")
+ @Produces("text/xml")
+ public Response getInstanceData(
+ @PathParam("id")
+ String instanceId
+ )
+ {
+ Map<String, Object> javaPayload = getProcessManagement().getInstanceData(instanceId);
+ Payload2XML payload2XML = new Payload2XML();
+ StringBuffer sb = payload2XML.convert(instanceId, javaPayload);
+ return Response.ok(sb.toString()).build();
+ }
+
+ @POST
+ @Path("instance/{id}/state/{next}")
+ @Produces("application/json")
+ public Response changeState(
+ @PathParam("id")
+ String executionId,
+ @PathParam("next")
+ String next)
+ {
+ ProcessInstanceRef.STATE state = ProcessInstanceRef.STATE.valueOf(next);
+ log.debug("Change instance (ID "+executionId+") to state " +state);
+ getProcessManagement().setProcessState(executionId, state);
+ return Response.ok().type("application/json").build();
+ }
+
+ @POST
+ @Path("instance/{id}/end/{result}")
+ @Produces("application/json")
+ public Response endInstance(
+ @PathParam("id")
+ String executionId,
+ @PathParam("result")
+ String resultValue)
+ {
+ ProcessInstanceRef.RESULT result = ProcessInstanceRef.RESULT.valueOf(resultValue);
+ log.debug("Change instance (ID "+executionId+") to state " + ProcessInstanceRef.STATE.ENDED);
+ getProcessManagement().endInstance(executionId, result);
+ return Response.ok().type("application/json").build();
+ }
+
+ @POST
+ @Path("instance/{id}/delete")
+ @Produces("application/json")
+ public Response deleteInstance(
+ @PathParam("id")
+ String executionId
+ )
+ {
+ log.debug("Delete instance (ID "+executionId+")");
+ getProcessManagement().deleteInstance(executionId);
+ return Response.ok().type("application/json").build();
+ }
+
+ @POST
+ @Path("tokens/{id}/transition")
+ @Produces("application/json")
+ public Response signalExecution(
+ @PathParam("id")
+ String id,
+ @QueryParam("signal")
+ String signalName)
+ {
+ log.debug("Signal token " + id + " -> " + signalName);
+
+ if ("default transition".equals(signalName))
+ signalName = null;
+
+ getProcessManagement().signalExecution(id, signalName);
+ return Response.ok().type("application/json").build();
+ }
+
+ @POST
+ @Path("tokens/{id}/transition/default")
+ @Produces("application/json")
+ public Response signalExecutionDefault(
+ @PathParam("id")
+ String id)
+ {
+ log.debug("Signal token " + id);
+
+ getProcessManagement().signalExecution(id, null);
+ return Response.ok().type("application/json").build();
+ }
+
+ @GET
+ @Path("definition/{id}/image")
+ @Produces("image/*")
+ public Response getProcessImage(
+ @Context
+ HttpServletRequest request,
+ @PathParam("id")
+ String id
+ )
+ {
+ GraphViewerPlugin plugin = getGraphViewerPlugin();
+ if(plugin !=null)
+ {
+ byte[] processImage = plugin.getProcessImage(id);
+ if(processImage!=null)
+ return Response.ok(processImage).type("image/png").build();
+ else
+ return Response.status(404).build();
+ }
+
+ throw new RuntimeException(
+ GraphViewerPlugin.class.getName()+ " not available."
+ );
+ }
+
+ @GET
+ @Path("instance/{id}/activeNodeInfo")
+ @Produces("application/json")
+ public Response getActiveNodeInfo(
+ @PathParam("id")
+ String id)
+ {
+
+ GraphViewerPlugin plugin = getGraphViewerPlugin();
+ if(plugin !=null)
+ {
+ List<ActiveNodeInfo> info = plugin.getActiveNodeInfo(id);
+ return createJsonResponse(info);
+ }
+
+ throw new RuntimeException(
+ GraphViewerPlugin.class.getName()+ " not available."
+ );
+
+ }
+
+ private Response createJsonResponse(Object wrapper)
+ {
+ Gson gson = GsonFactory.createInstance();
+ String json = gson.toJson(wrapper);
+ return Response.ok(json).type("application/json").build();
+ }
+}
Added: bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskListFacade.java
===================================================================
--- bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskListFacade.java (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskListFacade.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,143 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server;
+
+import com.google.gson.Gson;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.console.client.model.TaskRef;
+import org.jboss.bpm.console.client.model.TaskRefWrapper;
+import org.jboss.bpm.console.server.gson.GsonFactory;
+import org.jboss.bpm.console.server.integration.ManagementFactory;
+import org.jboss.bpm.console.server.integration.TaskManagement;
+import org.jboss.bpm.console.server.plugin.PluginMgr;
+import org.jboss.bpm.console.server.plugin.FormAuthorityRef;
+import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
+import org.jboss.bpm.console.server.util.RsComment;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Response;
+import java.net.URL;
+import java.util.List;
+
+/**
+ * REST server module for accessing task related data.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at Path("tasks")
+ at RsComment(
+ title = "Task Lists",
+ description = "Access task lists"
+)
+public class TaskListFacade
+{
+ private static final Log log = LogFactory.getLog(TaskMgmtFacade.class);
+
+ private TaskManagement taskManagement;
+ private FormDispatcherPlugin formPlugin;
+
+ /**
+ * Lazy load the {@link org.jboss.bpm.console.server.integration.TaskManagement}
+ */
+ private TaskManagement getTaskManagement()
+ {
+ if(null==this.taskManagement)
+ {
+ ManagementFactory factory = ManagementFactory.newInstance();
+ this.taskManagement = factory.createTaskManagement();
+ log.debug("Using ManagementFactory impl:" + factory.getClass().getName());
+ }
+
+ return this.taskManagement;
+ }
+
+ /**
+ * Lazy load the {@link org.jboss.bpm.console.server.plugin.FormDispatcherPlugin}.
+ * Can be null if the plugin is not available.
+ */
+ private FormDispatcherPlugin getFormDispatcherPlugin()
+ {
+ if(null==this.formPlugin)
+ {
+ this.formPlugin = PluginMgr.load(FormDispatcherPlugin.class);
+ }
+
+ return this.formPlugin;
+ }
+
+ @GET
+ @Path("{idRef}")
+ @Produces("application/json")
+ public Response getTasksForIdRef(
+ @PathParam("idRef")
+ String idRef
+ )
+ {
+ List<TaskRef> assignedTasks = getTaskManagement().getAssignedTasks(idRef);
+ return processTaskListResponse(assignedTasks);
+ }
+
+ @GET
+ @Path("{idRef}/participation")
+ @Produces("application/json")
+ public Response getTasksForIdRefParticipation(
+ @PathParam("idRef")
+ String idRef
+ )
+ {
+ List<TaskRef> taskParticipation = getTaskManagement().getUnassignedTasks(idRef, null);
+ return processTaskListResponse(taskParticipation);
+ }
+
+ private Response processTaskListResponse(List<TaskRef> taskList)
+ {
+ // decorate task form URL if plugin available
+ FormDispatcherPlugin formPlugin = getFormDispatcherPlugin();
+ if(formPlugin!=null)
+ {
+ for(TaskRef task : taskList)
+ {
+ URL taskFormURL = formPlugin.getDispatchUrl(
+ new FormAuthorityRef(String.valueOf(task.getId()))
+ );
+ if(taskFormURL!=null)
+ {
+ task.setUrl(taskFormURL.toExternalForm());
+ }
+ }
+ }
+
+ TaskRefWrapper wrapper = new TaskRefWrapper(taskList);
+ return createJsonResponse(wrapper);
+ }
+
+ private Response createJsonResponse(Object wrapper)
+ {
+ Gson gson = GsonFactory.createInstance();
+ String json = gson.toJson(wrapper);
+ return Response.ok(json).type("application/json").build();
+ }
+}
Added: bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java
===================================================================
--- bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,148 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.console.server.integration.ManagementFactory;
+import org.jboss.bpm.console.server.integration.TaskManagement;
+import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
+import org.jboss.bpm.console.server.plugin.PluginMgr;
+import org.jboss.bpm.console.server.util.RsComment;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.*;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+
+/**
+ * REST server module for accessing task related data.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at Path("task")
+ at RsComment(
+ title = "Task Management",
+ description = "Manage task instances"
+)
+public class TaskMgmtFacade
+{
+ private static final Log log = LogFactory.getLog(TaskMgmtFacade.class);
+
+ private TaskManagement taskManagement;
+
+ private FormDispatcherPlugin formPlugin;
+
+ /**
+ * Lazy load the {@link org.jboss.bpm.console.server.integration.TaskManagement}
+ */
+ private TaskManagement getTaskManagement()
+ {
+ if(null==this.taskManagement)
+ {
+ ManagementFactory factory = ManagementFactory.newInstance();
+ this.taskManagement = factory.createTaskManagement();
+ log.debug("Using ManagementFactory impl:" + factory.getClass().getName());
+ }
+
+ return this.taskManagement;
+ }
+
+ /**
+ * Lazy load the {@link org.jboss.bpm.console.server.integration.TaskManagement}
+ */
+ private FormDispatcherPlugin getFormDispatcherPlugin()
+ {
+ if(null==this.formPlugin)
+ {
+ this.formPlugin = PluginMgr.load(FormDispatcherPlugin.class);
+ log.debug("Using FormDispatcherPlugin impl:" + this.formPlugin);
+ }
+
+ return this.formPlugin;
+ }
+
+ @POST
+ @Path("{taskId}/assign/{ifRef}")
+ @Produces("application/json")
+ public Response assignTask(
+ @Context
+ HttpServletRequest request,
+ @PathParam("taskId")
+ long taskId,
+ @PathParam("ifRef")
+ String idRef
+ )
+ {
+ log.debug("Assign task " + taskId + " to '" + idRef +"'");
+ getTaskManagement().assignTask(taskId, idRef, request.getUserPrincipal().getName());
+ return Response.ok().build();
+ }
+
+ @POST
+ @Path("{taskId}/release")
+ @Produces("application/json")
+ public Response releaseTask(
+ @Context
+ HttpServletRequest request,
+ @PathParam("taskId")
+ long taskId
+ )
+ {
+ log.debug("Release task " + taskId);
+ getTaskManagement().assignTask(taskId, null, request.getUserPrincipal().getName());
+ return Response.ok().build();
+ }
+
+ @POST
+ @Path("{taskId}/close")
+ @Produces("application/json")
+ public Response closeTask(
+ @Context
+ HttpServletRequest request,
+ @PathParam("taskId")
+ long taskId
+ )
+ {
+ log.debug("Close task " + taskId );
+ getTaskManagement().completeTask(taskId, null, request.getUserPrincipal().getName());
+ return Response.ok().build();
+ }
+
+ @POST
+ @Path("{taskId}/close/{outcome}")
+ @Produces("application/json")
+ public Response closeTaskWithSignal(
+ @Context
+ HttpServletRequest request,
+ @PathParam("taskId")
+ long taskId,
+ @QueryParam("outcome")
+ String outcome
+ )
+ {
+ log.debug("Close task " + taskId + " outcome " + outcome);
+ getTaskManagement().completeTask(taskId, outcome, null, request.getUserPrincipal().getName());
+ return Response.ok().build();
+ }
+
+}
Added: bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/UserMgmtFacade.java
===================================================================
--- bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/UserMgmtFacade.java (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/UserMgmtFacade.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,148 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server;
+
+import com.google.gson.Gson;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.console.client.model.RoleAssignmentRef;
+import org.jboss.bpm.console.client.model.RoleAssignmentRefWrapper;
+import org.jboss.bpm.console.server.gson.GsonFactory;
+import org.jboss.bpm.console.server.integration.ManagementFactory;
+import org.jboss.bpm.console.server.integration.UserManagement;
+import org.jboss.bpm.console.server.util.RsComment;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.*;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import java.util.*;
+
+/**
+ * REST server module for accessing user related data.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at Path("identity")
+ at RsComment(
+ title = "User management",
+ description = "Manage user and groups"
+)
+public class UserMgmtFacade
+{
+
+ private static final Log log = LogFactory.getLog(UserMgmtFacade.class);
+
+ private UserManagement userManagement;
+
+ private UserManagement getUserManagement()
+ {
+ if(null==userManagement)
+ {
+ ManagementFactory factory = ManagementFactory.newInstance();
+ this.userManagement = factory.createUserManagement();
+ }
+
+ return this.userManagement;
+ }
+
+ @GET
+ @Path("user/roles")
+ @Produces("application/json")
+ public Response getRolesForJAASPrincipal(
+ @Context
+ HttpServletRequest request,
+ @QueryParam("roleCheck")
+ String roleCheck
+ )
+ {
+ // TODO: Why not use the identity DB right away?
+ // These roles are security roles
+ if(null==roleCheck)
+ throw new WebApplicationException( new IllegalArgumentException("Missing parameter 'roleCheck'") );
+
+ log.debug("Role check user: " + request.getUserPrincipal().getName() + ", actualRoles requested: " + roleCheck);
+
+ List<RoleAssignmentRef> actualRoles = new ArrayList<RoleAssignmentRef>();
+
+ StringTokenizer tok = new StringTokenizer(roleCheck, ",");
+ while(tok.hasMoreTokens())
+ {
+ String possibleRole = tok.nextToken();
+ actualRoles.add( new RoleAssignmentRef(possibleRole, request.isUserInRole(possibleRole)));
+ }
+ return createJsonResponse( new RoleAssignmentRefWrapper(actualRoles));
+ }
+
+ @GET
+ @Path("user/{actorId}/groups/")
+ @Produces("application/json")
+ public Response getGroupsForActor(
+ @PathParam("actorId")
+ String actorId
+ )
+ {
+ List<String> groups = getUserManagement().getGroupsForActor(actorId);
+ return createJsonResponse(groups);
+ }
+
+ @GET
+ @Path("group/{groupName}/members")
+ @Produces("application/json")
+ public Response getActorsForGroup(
+ @PathParam("groupName")
+ String groupName
+ )
+ {
+ List<String> groups = getUserManagement().getActorsForGroup(groupName);
+ return createJsonResponse(groups);
+ }
+
+ @GET
+ @Path("user/{actorId}/actors")
+ @Produces("application/json")
+ public Response getAvailableActors(
+ @PathParam("actorId")
+ String actorId
+ )
+ {
+ Set<String> users = new HashSet<String>();
+ List<String> groups = getUserManagement().getGroupsForActor(actorId);
+ for(String group : groups)
+ {
+ List<String> actors = getUserManagement().getActorsForGroup(group);
+ users.addAll(actors);
+ }
+
+ List<String> availableActors = new ArrayList<String>();
+ availableActors.addAll(users);
+ availableActors.addAll(groups);
+ return createJsonResponse(availableActors);
+ }
+
+ private Response createJsonResponse(Object wrapper)
+ {
+ Gson gson = GsonFactory.createInstance();
+ String json = gson.toJson(wrapper);
+ return Response.ok(json).type("application/json").build();
+ }
+}
\ No newline at end of file
Added: bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/BufferedResponseWrapper.java
===================================================================
--- bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/BufferedResponseWrapper.java (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/BufferedResponseWrapper.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.util;
+
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletResponseWrapper;
+import java.io.ByteArrayOutputStream;
+import java.io.PrintWriter;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at SuppressWarnings("deprecation")
+public class BufferedResponseWrapper extends HttpServletResponseWrapper
+{
+ private ByteArrayOutputStream output;
+ private int contentLength;
+ private String contentType = "";
+
+ public BufferedResponseWrapper(HttpServletResponse httpServletResponse)
+ {
+ super(httpServletResponse);
+ output=new ByteArrayOutputStream();
+ }
+
+ public byte[] getData() {
+ return output.toByteArray();
+ }
+
+ public ServletOutputStream getOutputStream() {
+ return new FilterServletOutputStream(output);
+ }
+
+ public PrintWriter getWriter() {
+ return new PrintWriter(getOutputStream(),true);
+ }
+
+ public void setContentLength(int length) {
+ this.contentLength = length;
+ super.setContentLength(length);
+ }
+
+ public int getContentLength() {
+ return contentLength;
+ }
+
+ public void setContentType(String type) {
+ this.contentType = type;
+ super.setContentType(type);
+ }
+
+ public String getContentType() {
+ return contentType;
+ }
+}
Added: bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/DOMUtils.java
===================================================================
--- bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/DOMUtils.java (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/DOMUtils.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,713 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.util;
+
+import org.jboss.logging.Logger;
+import org.w3c.dom.*;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.*;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import java.io.*;
+import java.util.*;
+
+/**
+ * DOM2 utilites
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @author alessio.soldano at jboss.com
+ */
+public final class DOMUtils
+{
+ private static Logger log = Logger.getLogger(DOMUtils.class);
+
+ // All elements created by the same thread are created by the same builder and belong to the same doc
+ private static ThreadLocal<Document> documentThreadLocal = new ThreadLocal<Document>();
+ private static ThreadLocal<DocumentBuilder> builderThreadLocal = new ThreadLocal<DocumentBuilder>()
+ {
+ protected DocumentBuilder initialValue()
+ {
+ try
+ {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setValidating(false);
+ factory.setNamespaceAware(true);
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ setEntityResolver(builder);
+ return builder;
+ }
+ catch (ParserConfigurationException e)
+ {
+ throw new RuntimeException("Failed to create DocumentBuilder", e);
+ }
+ }
+
+ private void setEntityResolver(DocumentBuilder builder)
+ {
+ String[] resolvers = new String[] { "org.jboss.ws.core.utils.JBossWSEntityResolver", "org.jboss.util.xml.JBossEntityResolver" };
+
+ EntityResolver entityResolver = null;
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ for (String resolver : resolvers)
+ {
+ try
+ {
+ Class<?> resolverClass = loader.loadClass(resolver);
+ entityResolver = (EntityResolver)resolverClass.newInstance();
+ }
+ catch (Exception ex)
+ {
+ log.debug("Cannot load: " + resolver);
+ }
+ }
+
+ if (entityResolver != null)
+ builder.setEntityResolver(entityResolver);
+ }
+ };
+
+ public static void clearThreadLocals()
+ {
+ documentThreadLocal.remove();
+ builderThreadLocal.remove();
+ }
+
+ // Hide the constructor
+ private DOMUtils()
+ {
+ }
+
+ /** Initialize the DocumentBuilder
+ */
+ public static DocumentBuilder getDocumentBuilder()
+ {
+ return builderThreadLocal.get();
+ }
+
+ /** Parse the given XML string and return the root Element
+ */
+ public static Element parse(String xmlString) throws IOException
+ {
+ try
+ {
+ return parse(new ByteArrayInputStream(xmlString.getBytes("UTF-8")));
+ }
+ catch (IOException e)
+ {
+ log.error("Cannot parse: " + xmlString);
+ throw e;
+ }
+ }
+
+ /** Parse the given XML stream and return the root Element
+ */
+ public static Element parse(InputStream xmlStream) throws IOException
+ {
+ try
+ {
+ return getDocumentBuilder().parse(xmlStream).getDocumentElement();
+ }
+ catch (SAXException se)
+ {
+ throw new IOException(se.toString());
+ }
+ finally
+ {
+ xmlStream.close();
+ }
+ }
+
+ /** Parse the given input source and return the root Element
+ */
+ public static Element parse(InputSource source) throws IOException
+ {
+ try
+ {
+ return getDocumentBuilder().parse(source).getDocumentElement();
+ }
+ catch (SAXException se)
+ {
+ throw new IOException(se.toString());
+ }
+ finally
+ {
+ InputStream is = source.getByteStream();
+ if (is != null)
+ {
+ is.close();
+ }
+ Reader r = source.getCharacterStream();
+ if (r != null)
+ {
+ r.close();
+ }
+ }
+ }
+
+ /** Create an Element for a given name
+ */
+ public static Element createElement(String localPart)
+ {
+ Document doc = getOwnerDocument();
+ log.trace("createElement {}" + localPart);
+ return doc.createElement(localPart);
+ }
+
+ /** Create an Element for a given name and prefix
+ */
+ public static Element createElement(String localPart, String prefix)
+ {
+ Document doc = getOwnerDocument();
+ log.trace("createElement {}" + prefix + ":" + localPart);
+ return doc.createElement(prefix + ":" + localPart);
+ }
+
+ /** Create an Element for a given name, prefix and uri
+ */
+ public static Element createElement(String localPart, String prefix, String uri)
+ {
+ Document doc = getOwnerDocument();
+ if (prefix == null || prefix.length() == 0)
+ {
+ log.trace("createElement {" + uri + "}" + localPart);
+ return doc.createElementNS(uri, localPart);
+ }
+ else
+ {
+ log.trace("createElement {" + uri + "}" + prefix + ":" + localPart);
+ return doc.createElementNS(uri, prefix + ":" + localPart);
+ }
+ }
+
+ /** Create an Element for a given QName
+ */
+ public static Element createElement(QName qname)
+ {
+ return createElement(qname.getLocalPart(), qname.getPrefix(), qname.getNamespaceURI());
+ }
+
+ /** Create a org.w3c.dom.Text node
+ */
+ public static Text createTextNode(String value)
+ {
+ Document doc = getOwnerDocument();
+ return doc.createTextNode(value);
+ }
+
+ /** Get the qname of the given node.
+ */
+ public static QName getElementQName(Element el)
+ {
+ String qualifiedName = el.getNodeName();
+ return resolveQName(el, qualifiedName);
+ }
+
+ /** Transform the given qualified name into a QName
+ */
+ public static QName resolveQName(Element el, String qualifiedName)
+ {
+ QName qname;
+ String prefix = "";
+ String namespaceURI = "";
+ String localPart = qualifiedName;
+
+ int colIndex = qualifiedName.indexOf(":");
+ if (colIndex > 0)
+ {
+ prefix = qualifiedName.substring(0, colIndex);
+ localPart = qualifiedName.substring(colIndex + 1);
+
+ if ("xmlns".equals(prefix))
+ {
+ namespaceURI = "URI:XML_PREDEFINED_NAMESPACE";
+ }
+ else
+ {
+ Element nsElement = el;
+ while (namespaceURI.equals("") && nsElement != null)
+ {
+ namespaceURI = nsElement.getAttribute("xmlns:" + prefix);
+ if (namespaceURI.equals(""))
+ nsElement = getParentElement(nsElement);
+ }
+ }
+
+ if (namespaceURI.equals(""))
+ throw new IllegalArgumentException("Cannot find namespace uri for: " + qualifiedName);
+ }
+ else
+ {
+ Element nsElement = el;
+ while (namespaceURI.equals("") && nsElement != null)
+ {
+ namespaceURI = nsElement.getAttribute("xmlns");
+ if (namespaceURI.equals(""))
+ nsElement = getParentElement(nsElement);
+ }
+ }
+
+ qname = new QName(namespaceURI, localPart, prefix);
+ return qname;
+ }
+
+ /** Get the value from the given attribute
+ *
+ * @return null if the attribute value is empty or the attribute is not present
+ */
+ public static String getAttributeValue(Element el, String attrName)
+ {
+ return getAttributeValue(el, new QName(attrName));
+ }
+
+ /** Get the value from the given attribute
+ *
+ * @return null if the attribute value is empty or the attribute is not present
+ */
+ public static String getAttributeValue(Element el, QName attrName)
+ {
+ String attr = null;
+ if ("".equals(attrName.getNamespaceURI()))
+ attr = el.getAttribute(attrName.getLocalPart());
+ else attr = el.getAttributeNS(attrName.getNamespaceURI(), attrName.getLocalPart());
+
+ if ("".equals(attr))
+ attr = null;
+
+ return attr;
+ }
+
+ /** Get the qname value from the given attribute
+ */
+ public static QName getAttributeValueAsQName(Element el, String attrName)
+ {
+ return getAttributeValueAsQName(el, new QName(attrName));
+
+ }
+
+ /** Get the qname value from the given attribute
+ */
+ public static QName getAttributeValueAsQName(Element el, QName attrName)
+ {
+ QName qname = null;
+
+ String qualifiedName = getAttributeValue(el, attrName);
+ if (qualifiedName != null)
+ {
+ qname = resolveQName(el, qualifiedName);
+ }
+
+ return qname;
+ }
+
+ /** Get the boolean value from the given attribute
+ */
+ public static boolean getAttributeValueAsBoolean(Element el, String attrName)
+ {
+ return getAttributeValueAsBoolean(el, new QName(attrName));
+ }
+
+ /** Get the boolean value from the given attribute
+ */
+ public static boolean getAttributeValueAsBoolean(Element el, QName attrName)
+ {
+ String attrVal = getAttributeValue(el, attrName);
+ boolean ret = "true".equalsIgnoreCase(attrVal) || "1".equalsIgnoreCase(attrVal);
+ return ret;
+ }
+
+ /** Get the integer value from the given attribute
+ */
+ public static Integer getAttributeValueAsInteger(Element el, String attrName)
+ {
+ return getAttributeValueAsInteger(el, new QName(attrName));
+ }
+
+ /** Get the integer value from the given attribute
+ */
+ public static Integer getAttributeValueAsInteger(Element el, QName attrName)
+ {
+ String attrVal = getAttributeValue(el, attrName);
+ return (attrVal != null ? new Integer(attrVal) : null);
+ }
+
+ /** Get the attributes as Map<QName, String>
+ */
+ public static Map getAttributes(Element el)
+ {
+ Map attmap = new HashMap();
+ NamedNodeMap attribs = el.getAttributes();
+ for (int i = 0; i < attribs.getLength(); i++)
+ {
+ Attr attr = (Attr)attribs.item(i);
+ String name = attr.getName();
+ QName qname = resolveQName(el, name);
+ String value = attr.getNodeValue();
+ attmap.put(qname, value);
+ }
+ return attmap;
+ }
+
+ /** Copy attributes between elements
+ */
+ public static void copyAttributes(Element destElement, Element srcElement)
+ {
+ NamedNodeMap attribs = srcElement.getAttributes();
+ for (int i = 0; i < attribs.getLength(); i++)
+ {
+ Attr attr = (Attr)attribs.item(i);
+ String uri = attr.getNamespaceURI();
+ String qname = attr.getName();
+ String value = attr.getNodeValue();
+
+ // Prevent DOMException: NAMESPACE_ERR: An attempt is made to create or
+ // change an object in a way which is incorrect with regard to namespaces.
+ if (uri == null && qname.startsWith("xmlns"))
+ {
+ log.trace("Ignore attribute: [uri=" + uri + ",qname=" + qname + ",value=" + value + "]");
+ }
+ else
+ {
+ destElement.setAttributeNS(uri, qname, value);
+ }
+ }
+ }
+
+ /** True if the node has text child elements only
+ */
+ public static boolean hasTextChildNodesOnly(Node node)
+ {
+ NodeList nodeList = node.getChildNodes();
+ if (nodeList.getLength() == 0)
+ return false;
+
+ for (int i = 0; i < nodeList.getLength(); i++)
+ {
+ Node acksToChildNode = nodeList.item(i);
+ if (acksToChildNode.getNodeType() != Node.TEXT_NODE)
+ return false;
+ }
+
+ return true;
+ }
+
+ /** True if the node has child elements
+ */
+ public static boolean hasChildElements(Node node)
+ {
+ NodeList nlist = node.getChildNodes();
+ for (int i = 0; i < nlist.getLength(); i++)
+ {
+ Node child = nlist.item(i);
+ if (child.getNodeType() == Node.ELEMENT_NODE)
+ return true;
+ }
+ return false;
+ }
+
+ /** Gets child elements
+ */
+ public static Iterator<Element> getChildElements(Node node)
+ {
+ List<Element> list = new LinkedList<Element>();
+ NodeList nlist = node.getChildNodes();
+ for (int i = 0; i < nlist.getLength(); i++)
+ {
+ Node child = nlist.item(i);
+ if (child.getNodeType() == Node.ELEMENT_NODE)
+ list.add((Element)child);
+ }
+ return list.iterator();
+ }
+
+ /** Get the concatenated text content, or null.
+ */
+ public static String getTextContent(Node node)
+ {
+ boolean hasTextContent = false;
+ StringBuffer buffer = new StringBuffer();
+ NodeList nlist = node.getChildNodes();
+ for (int i = 0; i < nlist.getLength(); i++)
+ {
+ Node child = nlist.item(i);
+ if (child.getNodeType() == Node.TEXT_NODE)
+ {
+ buffer.append(child.getNodeValue());
+ hasTextContent = true;
+ }
+ }
+ return (hasTextContent ? buffer.toString() : null);
+ }
+
+ /** Gets the first child element
+ */
+ public static Element getFirstChildElement(Node node)
+ {
+ return getFirstChildElement(node, false);
+ }
+
+ /** Gets the first child element
+ */
+ public static Element getFirstChildElement(Node node, boolean recursive)
+ {
+ return getFirstChildElementIntern(node, null, recursive);
+ }
+
+ /** Gets the first child element for a given local name without namespace
+ */
+ public static Element getFirstChildElement(Node node, String nodeName)
+ {
+ return getFirstChildElement(node, nodeName, false);
+ }
+
+ /** Gets the first child element for a given local name without namespace
+ */
+ public static Element getFirstChildElement(Node node, String nodeName, boolean recursive)
+ {
+ return getFirstChildElementIntern(node, new QName(nodeName), recursive);
+ }
+
+ /** Gets the first child element for a given qname
+ */
+ public static Element getFirstChildElement(Node node, QName nodeName)
+ {
+ return getFirstChildElement(node, nodeName, false);
+ }
+
+ /** Gets the first child element for a given qname
+ */
+ public static Element getFirstChildElement(Node node, QName nodeName, boolean recursive)
+ {
+ return getFirstChildElementIntern(node, nodeName, recursive);
+ }
+
+ private static Element getFirstChildElementIntern(Node node, QName nodeName, boolean recursive)
+ {
+ Element childElement = null;
+ Iterator it = getChildElementsIntern(node, nodeName, recursive);
+ if (it.hasNext())
+ {
+ childElement = (Element)it.next();
+ }
+ return childElement;
+ }
+
+ /** Gets the child elements for a given local name without namespace
+ */
+ public static Iterator getChildElements(Node node, String nodeName)
+ {
+ return getChildElements(node, nodeName, false);
+ }
+
+ /** Gets the child elements for a given local name without namespace
+ */
+ public static Iterator getChildElements(Node node, String nodeName, boolean recursive)
+ {
+ return getChildElementsIntern(node, new QName(nodeName), recursive);
+ }
+
+ /** Gets the child element for a given qname
+ */
+ public static Iterator getChildElements(Node node, QName nodeName)
+ {
+ return getChildElements(node, nodeName, false);
+ }
+
+ /** Gets the child element for a given qname
+ */
+ public static Iterator getChildElements(Node node, QName nodeName, boolean recursive)
+ {
+ return getChildElementsIntern(node, nodeName, recursive);
+ }
+
+ public static List<Element> getChildElementsAsList(Node node, String nodeName)
+ {
+ return getChildElementsAsList(node, nodeName, false);
+ }
+
+ public static List<Element> getChildElementsAsList(Node node, String nodeName, boolean recursive)
+ {
+ return getChildElementsAsListIntern(node, new QName(nodeName), recursive);
+ }
+
+ public static List<Element> getChildElementsAsList(Node node, QName nodeName)
+ {
+ return getChildElementsAsList(node, nodeName, false);
+ }
+
+ public static List<Element> getChildElementsAsList(Node node, QName nodeName, boolean recursive)
+ {
+ return getChildElementsAsListIntern(node, nodeName, recursive);
+ }
+
+ private static List<Element> getChildElementsAsListIntern(Node node, QName nodeName, boolean recursive)
+ {
+ List<Element> list = new LinkedList<Element>();
+ NodeList nlist = node.getChildNodes();
+ for (int i = 0; i < nlist.getLength(); i++)
+ {
+ Node child = nlist.item(i);
+ if (child.getNodeType() == Node.ELEMENT_NODE)
+ {
+ search(list, (Element)child, nodeName, recursive);
+ }
+ }
+ return list;
+ }
+
+ private static void search(List<Element> list, Element baseElement, QName nodeName, boolean recursive)
+ {
+ if (nodeName == null)
+ {
+ list.add(baseElement);
+ }
+ else
+ {
+ QName qname;
+ if (nodeName.getNamespaceURI().length() > 0)
+ {
+ qname = new QName(baseElement.getNamespaceURI(), baseElement.getLocalName());
+ }
+ else
+ {
+ qname = new QName(baseElement.getLocalName());
+ }
+ if (qname.equals(nodeName))
+ {
+ list.add(baseElement);
+ }
+ }
+ if (recursive)
+ {
+ NodeList nlist = baseElement.getChildNodes();
+ for (int i = 0; i < nlist.getLength(); i++)
+ {
+ Node child = nlist.item(i);
+ if (child.getNodeType() == Node.ELEMENT_NODE)
+ {
+ search(list, (Element)child, nodeName, recursive);
+ }
+ }
+ }
+ }
+
+ private static Iterator getChildElementsIntern(Node node, QName nodeName, boolean recursive)
+ {
+ return getChildElementsAsListIntern(node, nodeName, recursive).iterator();
+ }
+
+ /** Gets parent element or null if there is none
+ */
+ public static Element getParentElement(Node node)
+ {
+ Node parent = node.getParentNode();
+ return (parent instanceof Element ? (Element)parent : null);
+ }
+
+ /** Get the owner document that is associated with the current thread */
+ public static Document getOwnerDocument()
+ {
+ Document doc = documentThreadLocal.get();
+ if (doc == null)
+ {
+ doc = getDocumentBuilder().newDocument();
+ documentThreadLocal.set(doc);
+ }
+ return doc;
+ }
+
+ public static Element sourceToElement(Source source) throws IOException
+ {
+ Element retElement = null;
+
+ try
+ {
+ if (source instanceof StreamSource)
+ {
+ StreamSource streamSource = (StreamSource)source;
+
+ InputStream ins = streamSource.getInputStream();
+ if (ins != null)
+ {
+ retElement = DOMUtils.parse(ins);
+ }
+ else
+ {
+ Reader reader = streamSource.getReader();
+ retElement = DOMUtils.parse(new InputSource(reader));
+ }
+ }
+ else if (source instanceof DOMSource)
+ {
+ DOMSource domSource = (DOMSource)source;
+ Node node = domSource.getNode();
+ if (node instanceof Element)
+ {
+ retElement = (Element)node;
+ }
+ else if (node instanceof Document)
+ {
+ retElement = ((Document)node).getDocumentElement();
+ }
+ else
+ {
+ throw new RuntimeException("Unsupported Node type: " + node.getClass().getName());
+ }
+ }
+ else if (source instanceof SAXSource)
+ {
+ // The fact that JAXBSource derives from SAXSource is an implementation detail.
+ // Thus in general applications are strongly discouraged from accessing methods defined on SAXSource.
+ // The XMLReader object obtained by the getXMLReader method shall be used only for parsing the InputSource object returned by the getInputSource method.
+
+ TransformerFactory tf = TransformerFactory.newInstance();
+ ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
+ Transformer transformer = tf.newTransformer();
+ transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+ transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+ transformer.transform(source, new StreamResult(baos));
+ retElement = DOMUtils.parse(new ByteArrayInputStream(baos.toByteArray()));
+ }
+ else
+ {
+ throw new RuntimeException("Source type not implemented: " + source.getClass().getName());
+ }
+
+ }
+ catch (TransformerException ex)
+ {
+ IOException ioex = new IOException();
+ ioex.initCause(ex);
+ throw ioex;
+ }
+
+ return retElement;
+ }
+}
\ No newline at end of file
Added: bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/FilterServletOutputStream.java
===================================================================
--- bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/FilterServletOutputStream.java (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/FilterServletOutputStream.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.util;
+
+import javax.servlet.ServletOutputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class FilterServletOutputStream extends ServletOutputStream
+{
+
+ private DataOutputStream stream;
+
+ public FilterServletOutputStream(OutputStream output) {
+ stream = new DataOutputStream(output);
+ }
+
+ public void write(int b) throws IOException {
+ stream.write(b);
+ }
+
+ public void write(byte[] b) throws IOException {
+ stream.write(b);
+ }
+
+ public void write(byte[] b, int off, int len) throws IOException
+ {
+ stream.write(b,off,len);
+ }
+
+}
Added: bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/GWTJsonFilter.java
===================================================================
--- bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/GWTJsonFilter.java (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/GWTJsonFilter.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,112 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.util;
+
+import javax.servlet.*;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class GWTJsonFilter implements Filter
+{
+
+ public FilterConfig filterConfig;
+ private static final String COLLECTION_PREFIX = "{\"wrapper\":";
+ private static final String COLLECTION_SUFFIX = "}";
+
+ public void init(FilterConfig filterConfig) throws ServletException
+ {
+ this.filterConfig = filterConfig;
+ }
+
+ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
+ throws IOException, ServletException
+ {
+
+ boolean isSOPCallback = false;
+
+ // identify GWT json requests
+ if(request.getParameter("callback")!=null)
+ isSOPCallback = true;
+
+ // sneak in repsonse wrapper
+ OutputStream out = response.getOutputStream();
+ BufferedResponseWrapper wrapper = new BufferedResponseWrapper((HttpServletResponse) response);
+
+ // proceed chain
+ chain.doFilter(request, wrapper);
+
+ // add callback std. json output
+ String contentType = response.getContentType() != null ? response.getContentType() : "application/octet-stream";
+ boolean isJSONEncoding = contentType.equals("application/json");
+ StringBuffer sb = null;
+ if(isJSONEncoding)
+ {
+ String payload = new String(wrapper.getData());
+ String gwtextFriendly = trimPayload(payload);
+
+ sb = new StringBuffer();
+
+ if(isSOPCallback)
+ {
+ sb.append(request.getParameter("callback"));
+ sb.append("(");
+ }
+
+ // Strip wrapper when JSONRequest
+ sb.append(gwtextFriendly);
+
+ if(isSOPCallback)
+ {
+ sb.append(");");
+ }
+
+ }
+
+ // flush
+ if(sb!=null)
+ out.write(sb.toString().getBytes());
+ else
+ out.write(wrapper.getData());
+
+ out.flush();
+ out.close();
+ }
+
+ private String trimPayload(String payload)
+ {
+ String s = payload;
+ if(s.startsWith(COLLECTION_PREFIX))
+ {
+ s = payload.substring( COLLECTION_PREFIX.length(), payload.lastIndexOf(COLLECTION_SUFFIX));
+ }
+ return s;
+ }
+
+ public void destroy()
+ {
+
+ }
+}
Added: bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/Payload2XML.java
===================================================================
--- bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/Payload2XML.java (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/Payload2XML.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.util;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import java.io.ByteArrayOutputStream;
+import java.util.Map;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * Simple java to xml conversion for displaying process data
+ * within the console.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class Payload2XML
+{
+
+ public StringBuffer convert(String refId, Map<String, Object> javaPayload)
+ {
+
+ StringBuffer sb = new StringBuffer();
+
+ try
+ {
+ List<Class> clz = new ArrayList<Class>(javaPayload.size()+2);
+ clz.add(PayloadCollection.class);
+ clz.add(PayloadEntry.class);
+
+ List<PayloadEntry> data = new ArrayList<PayloadEntry>();
+
+ for(String key : javaPayload.keySet())
+ {
+ Object payload = javaPayload.get(key);
+ clz.add(payload.getClass());
+ data.add(new PayloadEntry(key, payload));
+ }
+
+ PayloadCollection dataset = new PayloadCollection(refId, data);
+ JAXBContext jaxbContext = JAXBContext.newInstance(clz.toArray(new Class[]{}));
+ ByteArrayOutputStream bout = new ByteArrayOutputStream();
+
+ Marshaller m = jaxbContext.createMarshaller();
+ //m.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
+ m.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE );
+
+ m.marshal(dataset, bout);
+ sb.append(new String(bout.toByteArray()));
+
+ }
+ catch (JAXBException e)
+ {
+ throw new RuntimeException("Payload2XML conversion failed",e );
+ }
+
+ return sb;
+ }
+}
+
Added: bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/PayloadCollection.java
===================================================================
--- bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/PayloadCollection.java (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/PayloadCollection.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.util;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlAttribute;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name="dataset")
+public class PayloadCollection
+{
+ List<PayloadEntry> payloadEntries;
+ String ref;
+
+
+ public PayloadCollection()
+ {
+ }
+
+ public PayloadCollection(String ref, List<PayloadEntry> payloadEntries)
+ {
+ this.ref = ref;
+ this.payloadEntries = payloadEntries;
+ }
+
+ @XmlElement(name = "data")
+ public List<PayloadEntry> getPayload()
+ {
+ return payloadEntries;
+ }
+
+ public void setPayload(List<PayloadEntry> payloadEntries)
+ {
+ this.payloadEntries = payloadEntries;
+ }
+
+ @XmlAttribute
+ public String getRef()
+ {
+ return ref;
+ }
+
+ public void setRef(String ref)
+ {
+ this.ref = ref;
+ }
+}
Added: bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/PayloadEntry.java
===================================================================
--- bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/PayloadEntry.java (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/PayloadEntry.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.util;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name = "data")
+public class PayloadEntry
+{
+ private String key;
+
+ private Object value;
+
+ public PayloadEntry()
+ {
+ }
+
+ public PayloadEntry(String key, Object value)
+ {
+ this.key = key;
+ this.value = value;
+ }
+
+ @XmlAttribute(name = "key")
+ public String getKey()
+ {
+ return key;
+ }
+
+ public void setKey(String key)
+ {
+ this.key = key;
+ }
+
+ @XmlElement(name = "value")
+ public Object getValue()
+ {
+ return value;
+ }
+
+ public void setValue(Object value)
+ {
+ this.value = value;
+ }
+
+ @XmlAttribute
+ public String getJavaType()
+ {
+ return value.getClass().getName();
+ }
+}
Added: bpm-console/trunk/server/server-core/src/main/resources/definition_report.rptconfig
===================================================================
--- bpm-console/trunk/server/server-core/src/main/resources/definition_report.rptconfig (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/resources/definition_report.rptconfig 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.15" id="1">
+ <list-property name="configVars">
+ <structure>
+ <property name="name">__isdisplay__name_283_0</property>
+ <property name="value">simple</property>
+ </structure>
+ <structure>
+ <property name="name">name_283_1</property>
+ <property name="value">simple</property>
+ </structure>
+ <structure>
+ <property name="name">name_283_type_</property>
+ <property name="value">string</property>
+ </structure>
+ <structure>
+ <property name="name">name_283_expr_</property>
+ <property name="value">dataSetRow["NAME_"]</property>
+ </structure>
+ </list-property>
+ <styles>
+ <style name="crosstab" id="2">
+ <property name="borderBottomColor">#CCCCCC</property>
+ <property name="borderBottomStyle">solid</property>
+ <property name="borderBottomWidth">1pt</property>
+ <property name="borderLeftColor">#CCCCCC</property>
+ <property name="borderLeftStyle">solid</property>
+ <property name="borderLeftWidth">1pt</property>
+ <property name="borderRightColor">#CCCCCC</property>
+ <property name="borderRightStyle">solid</property>
+ <property name="borderRightWidth">1pt</property>
+ <property name="borderTopColor">#CCCCCC</property>
+ <property name="borderTopStyle">solid</property>
+ <property name="borderTopWidth">1pt</property>
+ </style>
+ <style name="crosstab-cell" id="3">
+ <property name="borderBottomColor">#CCCCCC</property>
+ <property name="borderBottomStyle">solid</property>
+ <property name="borderBottomWidth">1pt</property>
+ <property name="borderLeftColor">#CCCCCC</property>
+ <property name="borderLeftStyle">solid</property>
+ <property name="borderLeftWidth">1pt</property>
+ <property name="borderRightColor">#CCCCCC</property>
+ <property name="borderRightStyle">solid</property>
+ <property name="borderRightWidth">1pt</property>
+ <property name="borderTopColor">#CCCCCC</property>
+ <property name="borderTopStyle">solid</property>
+ <property name="borderTopWidth">1pt</property>
+ </style>
+ </styles>
+</report>
Added: bpm-console/trunk/server/server-core/src/main/resources/definition_report.rptdesign
===================================================================
--- bpm-console/trunk/server/server-core/src/main/resources/definition_report.rptdesign (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/resources/definition_report.rptdesign 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,1759 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.15" id="1">
+ <property name="createdBy">Eclipse BIRT Designer Version 2.2.2.r222_v20071226 Build <2.2.2.v20080226-1155></property>
+ <property name="units">in</property>
+ <property name="comments">Copyright (c) 2007 <<Your Company Name here>></property>
+ <html-property name="description">Creates a blank report with no predefined content.</html-property>
+ <text-property name="displayName">Blank Report</text-property>
+ <property name="iconFile">/templates/blank_report.gif</property>
+ <parameters>
+ <scalar-parameter name="name" id="283">
+ <property name="valueType">dynamic</property>
+ <property name="dataType">string</property>
+ <property name="paramType">simple</property>
+ <property name="controlType">list-box</property>
+ <property name="dataSetName">ProcessDefinitions</property>
+ <expression name="valueExpr">dataSetRow["NAME_"]</expression>
+ <property name="mustMatch">true</property>
+ <property name="fixedOrder">true</property>
+ <property name="defaultValue">TaskAssignmentExample</property>
+ <property name="distinct">true</property>
+ <structure name="format">
+ <property name="category">Unformatted</property>
+ </structure>
+ </scalar-parameter>
+ </parameters>
+ <data-sources>
+ <oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="MySQL Local" id="6">
+ <property name="odaDriverClass">com.mysql.jdbc.Driver</property>
+ <property name="odaURL">jdbc:mysql://localhost:3306/jbpmtest</property>
+ <property name="odaUser">jbpmtest</property>
+ <property name="odaJndiName">java:/JbpmDS</property>
+ </oda-data-source>
+ </data-sources>
+ <data-sets>
+ <oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="ExecQuartileByInstance" id="228">
+ <list-property name="computedColumns">
+ <structure>
+ <property name="name">exec</property>
+ <expression name="expression">DateTimeSpan.seconds(row["startDate"],row["endDate"])</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">q3</property>
+ <expression name="expression">row["exec"]</expression>
+ <property name="dataType">any</property>
+ <property name="aggregateFunction">QUARTILE</property>
+ <list-property name="arguments">
+ <structure>
+ <property name="name">QUARTILE</property>
+ <expression name="value">3</expression>
+ </structure>
+ </list-property>
+ </structure>
+ <structure>
+ <property name="name">q1</property>
+ <expression name="expression">row["exec"]</expression>
+ <property name="dataType">any</property>
+ <property name="aggregateFunction">QUARTILE</property>
+ <list-property name="arguments">
+ <structure>
+ <property name="name">QUARTILE</property>
+ <expression name="value">1</expression>
+ </structure>
+ </list-property>
+ </structure>
+ <structure>
+ <property name="name">upperQuartile</property>
+ <expression name="expression">row["exec"]>row["q3"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ </list-property>
+ <list-property name="columnHints">
+ <structure>
+ <property name="columnName">startDate</property>
+ <property name="displayName">startDate</property>
+ </structure>
+ <structure>
+ <property name="columnName">endDate</property>
+ <property name="displayName">endDate</property>
+ </structure>
+ <structure>
+ <property name="columnName">TOKEN_</property>
+ <property name="displayName">TOKEN_</property>
+ </structure>
+ <structure>
+ <property name="columnName">instanceID</property>
+ <property name="displayName">instanceID</property>
+ </structure>
+ <structure>
+ <property name="columnName">NAME_</property>
+ <property name="displayName">NAME_</property>
+ </structure>
+ </list-property>
+ <structure name="cachedMetaData">
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">startDate</property>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="position">2</property>
+ <property name="name">endDate</property>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="position">3</property>
+ <property name="name">TOKEN_</property>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="position">4</property>
+ <property name="name">instanceID</property>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="position">5</property>
+ <property name="name">NAME_</property>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="position">6</property>
+ <property name="name">exec</property>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="position">7</property>
+ <property name="name">q3</property>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="position">8</property>
+ <property name="name">q1</property>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="position">9</property>
+ <property name="name">upperQuartile</property>
+ <property name="dataType">any</property>
+ </structure>
+ </list-property>
+ </structure>
+ <property name="rowFetchLimit">100</property>
+ <property name="dataSource">MySQL Local</property>
+ <list-property name="parameters">
+ <structure>
+ <property name="name">defName</property>
+ <property name="paramName">name</property>
+ <property name="dataType">string</property>
+ <property name="position">1</property>
+ <expression name="defaultValue">"TaskAssignmentExample"</expression>
+ <property name="isInput">true</property>
+ <property name="isOutput">false</property>
+ </structure>
+ </list-property>
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">startDate</property>
+ <property name="nativeName">startDate</property>
+ <property name="dataType">date-time</property>
+ <property name="nativeDataType">93</property>
+ </structure>
+ <structure>
+ <property name="position">2</property>
+ <property name="name">endDate</property>
+ <property name="nativeName">endDate</property>
+ <property name="dataType">date-time</property>
+ <property name="nativeDataType">93</property>
+ </structure>
+ <structure>
+ <property name="position">3</property>
+ <property name="name">TOKEN_</property>
+ <property name="nativeName">TOKEN_</property>
+ <property name="dataType">decimal</property>
+ <property name="nativeDataType">-5</property>
+ </structure>
+ <structure>
+ <property name="position">4</property>
+ <property name="name">instanceID</property>
+ <property name="nativeName">instanceID</property>
+ <property name="dataType">decimal</property>
+ <property name="nativeDataType">-5</property>
+ </structure>
+ <structure>
+ <property name="position">5</property>
+ <property name="name">NAME_</property>
+ <property name="nativeName">NAME_</property>
+ <property name="dataType">string</property>
+ <property name="nativeDataType">12</property>
+ </structure>
+ </list-property>
+ <property name="queryText">SELECT l1.DATE_ as startDate, l2.DATE_ as endDate,
+l1.TOKEN_, i.ID_ as instanceID, p.NAME_
+ FROM JBPM_LOG l1, JBPM_LOG l2, JBPM_TOKEN t, JBPM_PROCESSINSTANCE i, JBPM_PROCESSDEFINITION p
+WHERE (l1.CLASS_='I' AND l2.CLASS_='X')
+AND (l1.TOKEN_=l2.TOKEN_)
+AND t.ID_=l1.TOKEN_
+AND t.PROCESSINSTANCE_=i.ID_
+AND i.PROCESSDEFINITION_=p.ID_
+AND p.NAME_=?
+GROUP BY instanceId </property>
+ </oda-data-set>
+ <oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="ProcessDefinitions" id="282">
+ <list-property name="columnHints">
+ <structure>
+ <property name="columnName">ID_</property>
+ <property name="displayName">ID_</property>
+ </structure>
+ <structure>
+ <property name="columnName">NAME_</property>
+ <property name="displayName">NAME_</property>
+ </structure>
+ </list-property>
+ <structure name="cachedMetaData">
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">ID_</property>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="position">2</property>
+ <property name="name">NAME_</property>
+ <property name="dataType">string</property>
+ </structure>
+ </list-property>
+ </structure>
+ <property name="dataSource">MySQL Local</property>
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">ID_</property>
+ <property name="nativeName">ID_</property>
+ <property name="dataType">decimal</property>
+ <property name="nativeDataType">-5</property>
+ </structure>
+ <structure>
+ <property name="position">2</property>
+ <property name="name">NAME_</property>
+ <property name="nativeName">NAME_</property>
+ <property name="dataType">string</property>
+ <property name="nativeDataType">12</property>
+ </structure>
+ </list-property>
+ <property name="queryText">SELECT ID_,NAME_
+FROM JBPM_PROCESSDEFINITION</property>
+ <xml-property name="designerValues"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<model:DesignValues xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design" xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
+ <Version>1.0</Version>
+ <design:ResultSets derivedMetaData="true">
+ <design:resultSetDefinitions>
+ <design:resultSetColumns>
+ <design:resultColumnDefinitions>
+ <design:attributes>
+ <design:name>ID_</design:name>
+ <design:position>1</design:position>
+ <design:nativeDataTypeCode>-5</design:nativeDataTypeCode>
+ <design:precision>20</design:precision>
+ <design:scale>0</design:scale>
+ <design:nullability>NotNullable</design:nullability>
+ <design:uiHints>
+ <design:displayName>ID_</design:displayName>
+ </design:uiHints>
+ </design:attributes>
+ <design:usageHints>
+ <design:label>ID_</design:label>
+ <design:formattingHints>
+ <design:displaySize>20</design:displaySize>
+ </design:formattingHints>
+ </design:usageHints>
+ </design:resultColumnDefinitions>
+ <design:resultColumnDefinitions>
+ <design:attributes>
+ <design:name>NAME_</design:name>
+ <design:position>2</design:position>
+ <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
+ <design:precision>255</design:precision>
+ <design:scale>0</design:scale>
+ <design:nullability>Nullable</design:nullability>
+ <design:uiHints>
+ <design:displayName>NAME_</design:displayName>
+ </design:uiHints>
+ </design:attributes>
+ <design:usageHints>
+ <design:label>NAME_</design:label>
+ <design:formattingHints>
+ <design:displaySize>255</design:displaySize>
+ </design:formattingHints>
+ </design:usageHints>
+ </design:resultColumnDefinitions>
+ </design:resultSetColumns>
+ </design:resultSetDefinitions>
+ </design:ResultSets>
+</model:DesignValues>]]></xml-property>
+ </oda-data-set>
+ </data-sets>
+ <styles>
+ <style name="crosstab" id="4">
+ <property name="borderBottomColor">#CCCCCC</property>
+ <property name="borderBottomStyle">solid</property>
+ <property name="borderBottomWidth">1pt</property>
+ <property name="borderLeftColor">#CCCCCC</property>
+ <property name="borderLeftStyle">solid</property>
+ <property name="borderLeftWidth">1pt</property>
+ <property name="borderRightColor">#CCCCCC</property>
+ <property name="borderRightStyle">solid</property>
+ <property name="borderRightWidth">1pt</property>
+ <property name="borderTopColor">#CCCCCC</property>
+ <property name="borderTopStyle">solid</property>
+ <property name="borderTopWidth">1pt</property>
+ </style>
+ <style name="crosstab-cell" id="5">
+ <property name="borderBottomColor">#CCCCCC</property>
+ <property name="borderBottomStyle">solid</property>
+ <property name="borderBottomWidth">1pt</property>
+ <property name="borderLeftColor">#CCCCCC</property>
+ <property name="borderLeftStyle">solid</property>
+ <property name="borderLeftWidth">1pt</property>
+ <property name="borderRightColor">#CCCCCC</property>
+ <property name="borderRightStyle">solid</property>
+ <property name="borderRightWidth">1pt</property>
+ <property name="borderTopColor">#CCCCCC</property>
+ <property name="borderTopStyle">solid</property>
+ <property name="borderTopWidth">1pt</property>
+ </style>
+ </styles>
+ <page-setup>
+ <simple-master-page name="Simple MasterPage" id="2"/>
+ </page-setup>
+ <body>
+ <extended-item extensionName="Chart" name="ExecQuartiles" id="223">
+ <xml-property name="xmlRepresentation"><![CDATA[<model:ChartWithAxes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:attribute="http://www.birt.eclipse.org/ChartModelAttribute" xmlns:data="http://www.birt.eclipse.org/ChartModelData" xmlns:layout="http://www.birt.eclipse.org/ChartModelLayout" xmlns:model="http://www.birt.eclipse.org/ChartModel" xmlns:type="http://www.birt.eclipse.org/ChartModelType">
+ <Type>Bar Chart</Type>
+ <SubType>Side-by-side</SubType>
+ <Block>
+ <Children xsi:type="layout:TitleBlock">
+ <Bounds>
+ <Left>0.0</Left>
+ <Top>0.0</Top>
+ <Width>0.0</Width>
+ <Height>0.0</Height>
+ </Bounds>
+ <Insets>
+ <Top>3.0</Top>
+ <Left>3.0</Left>
+ <Bottom>3.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Row>-1</Row>
+ <Column>-1</Column>
+ <Rowspan>-1</Rowspan>
+ <Columnspan>-1</Columnspan>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Visible>false</Visible>
+ <Label>
+ <Caption>
+ <Value>Execution time quartiles</Value>
+ <Font>
+ <Size>16.0</Size>
+ <Bold>true</Bold>
+ <Alignment>
+ <horizontalAlignment>Center</horizontalAlignment>
+ <verticalAlignment>Center</verticalAlignment>
+ </Alignment>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>true</Visible>
+ </Label>
+ </Children>
+ <Children xsi:type="layout:Plot">
+ <Bounds>
+ <Left>0.0</Left>
+ <Top>0.0</Top>
+ <Width>0.0</Width>
+ <Height>0.0</Height>
+ </Bounds>
+ <Insets>
+ <Top>3.0</Top>
+ <Left>3.0</Left>
+ <Bottom>3.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Row>-1</Row>
+ <Column>-1</Column>
+ <Rowspan>-1</Rowspan>
+ <Columnspan>-1</Columnspan>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Visible>true</Visible>
+ <HorizontalSpacing>5</HorizontalSpacing>
+ <VerticalSpacing>5</VerticalSpacing>
+ <ClientArea>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>0</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>0.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>0.0</Right>
+ </Insets>
+ </ClientArea>
+ </Children>
+ <Children xsi:type="layout:Legend">
+ <Bounds>
+ <Left>0.0</Left>
+ <Top>0.0</Top>
+ <Width>0.0</Width>
+ <Height>0.0</Height>
+ </Bounds>
+ <Insets>
+ <Top>3.0</Top>
+ <Left>3.0</Left>
+ <Bottom>3.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Row>-1</Row>
+ <Column>-1</Column>
+ <Rowspan>-1</Rowspan>
+ <Columnspan>-1</Columnspan>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Visible>false</Visible>
+ <ClientArea>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>0</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>2.0</Top>
+ <Left>2.0</Left>
+ <Bottom>2.0</Bottom>
+ <Right>2.0</Right>
+ </Insets>
+ </ClientArea>
+ <Text>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Text>
+ <Orientation>Vertical</Orientation>
+ <Direction>Top_Bottom</Direction>
+ <Separator>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </Separator>
+ <Position>Right</Position>
+ <ItemType>Series</ItemType>
+ <Title>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Title>
+ <TitlePosition>Above</TitlePosition>
+ </Children>
+ <Bounds>
+ <Left>0.0</Left>
+ <Top>0.0</Top>
+ <Width>212.0</Width>
+ <Height>130.0</Height>
+ </Bounds>
+ <Insets>
+ <Top>3.0</Top>
+ <Left>3.0</Left>
+ <Bottom>3.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Row>-1</Row>
+ <Column>-1</Column>
+ <Rowspan>-1</Rowspan>
+ <Columnspan>-1</Columnspan>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Visible>true</Visible>
+ </Block>
+ <Dimension>Two_Dimensional</Dimension>
+ <Script>/*function beforeDrawDataPoint(dataPointHints, fill, scriptContext )
+{
+ val = dataPointHints.getOrthogonalValue();
+ chart = scriptContext.getChartInstance();
+ marker = chart.getAxes().get(0).getAssociatedAxes().get(0).getMarkerLines().get(0).getValue().getValue();
+
+ if (val > marker) //crosses marker?
+ fill.set(255, 0, 0); //yes - display in red
+ else
+ fill.set(0, 0, 255); //no - display in blue
+}*/
+
+
+/**
+ * Called before generation of chart model to GeneratedChartState.
+ *
+ * @param chart
+ * Chart
+ * @param icsc
+ * IChartScriptContext
+ */
+
+function beforeGeneration(chart, icsc){
+ importPackage(Packages.org.eclipse.birt.chart.model.component.impl);
+ importPackage(Packages.org.eclipse.birt.chart.model.data.impl);
+ importPackage(Packages.org.eclipse.birt.chart.model.attribute);
+ importPackage(Packages.org.eclipse.birt.chart.model.attribute.impl);
+
+ reportContext = icsc.getExternalContext().getScriptable();
+
+ var chart = icsc.getChartInstance();
+ var yAxis = chart.getAxes().get(0).getAssociatedAxes().get(0);
+
+ var topValue = reportContext.getGlobalVariable("q3");
+ var bottomValue = reportContext.getGlobalVariable("q1");
+
+ top_ml = MarkerLineImpl.create(yAxis, NumberDataElementImpl.create(topValue));
+ top_ml.getLabel().getCaption().setValue("Q.75");
+ top_ml.getLineAttributes().getColor().set(204,204,204);
+ top_ml.getLineAttributes().setStyle(LineStyle.SOLID_LITERAL);
+ top_ml.getLineAttributes().setThickness(1);
+
+ //bottom_ml = MarkerLineImpl.create(yAxis, NumberDataElementImpl.create(bottomValue));
+ //bottom_ml.getLabel().getCaption().setValue("Q.25");
+ //bottom_ml.getLineAttributes().getColor().set(204,204,204);
+ //bottom_ml.getLineAttributes().setStyle(LineStyle.SOLID_LITERAL);
+ //bottom_ml.getLineAttributes().setThickness(1);
+}</Script>
+ <Units>Points</Units>
+ <SeriesThickness>10.0</SeriesThickness>
+ <GridColumnCount>1</GridColumnCount>
+ <SampleData>
+ <BaseSampleData>
+ <DataSetRepresentation>5.0,4.0,12.0</DataSetRepresentation>
+ </BaseSampleData>
+ <OrthogonalSampleData>
+ <DataSetRepresentation>5.0,4.0,12.0</DataSetRepresentation>
+ <SeriesDefinitionIndex>0</SeriesDefinitionIndex>
+ </OrthogonalSampleData>
+ </SampleData>
+ <Interactivity>
+ <Enable>true</Enable>
+ <LegendBehavior>None</LegendBehavior>
+ </Interactivity>
+ <Axes>
+ <Type>Linear</Type>
+ <Title>
+ <Caption>
+ <Value>Instance ID</Value>
+ <Font>
+ <Name>SansSerif</Name>
+ <Size>9.0</Size>
+ <Bold>true</Bold>
+ <Alignment>
+ <horizontalAlignment>Center</horizontalAlignment>
+ <verticalAlignment>Center</verticalAlignment>
+ </Alignment>
+ </Font>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>192</Red>
+ <Green>192</Green>
+ <Blue>192</Blue>
+ </Color>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>true</Visible>
+ </Title>
+ <TitlePosition>Below</TitlePosition>
+ <AssociatedAxes>
+ <Type>Logarithmic</Type>
+ <Title>
+ <Caption>
+ <Value>Exec time</Value>
+ <Font>
+ <Size>14.0</Size>
+ <Bold>true</Bold>
+ <Alignment>
+ <horizontalAlignment>Center</horizontalAlignment>
+ <verticalAlignment>Center</verticalAlignment>
+ </Alignment>
+ <Rotation>90.0</Rotation>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Title>
+ <TitlePosition>Left</TitlePosition>
+ <SeriesDefinitions>
+ <Query>
+ <Definition></Definition>
+ </Query>
+ <SeriesPalette>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>80</Red>
+ <Green>166</Green>
+ <Blue>218</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>242</Red>
+ <Green>88</Green>
+ <Blue>106</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>232</Red>
+ <Green>172</Green>
+ <Blue>57</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>255</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>64</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>170</Red>
+ <Green>85</Green>
+ <Blue>85</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>192</Red>
+ <Green>192</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>192</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>7</Red>
+ <Green>146</Green>
+ <Blue>94</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>128</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>0</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>64</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>80</Red>
+ <Green>240</Green>
+ <Blue>120</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>64</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>0</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>0</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>64</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>0</Blue>
+ </Entries>
+ </SeriesPalette>
+ <Series xsi:type="type:BarSeries">
+ <Visible>true</Visible>
+ <Label>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Label>
+ <DataDefinition>
+ <Definition>row["exec"]</Definition>
+ </DataDefinition>
+ <SeriesIdentifier></SeriesIdentifier>
+ <DataPoint>
+ <Components>
+ <Type>Orthogonal_Value</Type>
+ </Components>
+ <Separator>, </Separator>
+ </DataPoint>
+ <LabelPosition>Inside</LabelPosition>
+ <Stacked>false</Stacked>
+ <Riser>Rectangle</Riser>
+ </Series>
+ <Grouping>
+ <Enabled>false</Enabled>
+ <GroupingInterval>2</GroupingInterval>
+ <GroupType>Text</GroupType>
+ <AggregateExpression>Sum</AggregateExpression>
+ </Grouping>
+ <Sorting>Ascending</Sorting>
+ </SeriesDefinitions>
+ <Orientation>Vertical</Orientation>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>192</Red>
+ <Green>192</Green>
+ <Blue>192</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </LineAttributes>
+ <Label>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Label>
+ <LabelPosition>Left</LabelPosition>
+ <MajorGrid>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>196</Red>
+ <Green>196</Green>
+ <Blue>196</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </LineAttributes>
+ <TickStyle>Across</TickStyle>
+ <TickAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>196</Red>
+ <Green>196</Green>
+ <Blue>196</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </TickAttributes>
+ </MajorGrid>
+ <MinorGrid>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>225</Red>
+ <Green>225</Green>
+ <Blue>225</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </LineAttributes>
+ <TickStyle>Across</TickStyle>
+ <TickAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>225</Red>
+ <Green>225</Green>
+ <Blue>225</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </TickAttributes>
+ </MinorGrid>
+ <Scale>
+ <MinorGridsPerUnit>5</MinorGridsPerUnit>
+ </Scale>
+ <Origin>
+ <Type>Min</Type>
+ <Value xsi:type="data:NumberDataElement">
+ <Value>0.0</Value>
+ </Value>
+ </Origin>
+ <PrimaryAxis>true</PrimaryAxis>
+ <Percent>false</Percent>
+ </AssociatedAxes>
+ <SeriesDefinitions>
+ <Query>
+ <Definition></Definition>
+ </Query>
+ <SeriesPalette>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>80</Red>
+ <Green>166</Green>
+ <Blue>218</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>242</Red>
+ <Green>88</Green>
+ <Blue>106</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>232</Red>
+ <Green>172</Green>
+ <Blue>57</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>255</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>64</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>170</Red>
+ <Green>85</Green>
+ <Blue>85</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>192</Red>
+ <Green>192</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>192</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>7</Red>
+ <Green>146</Green>
+ <Blue>94</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>128</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>0</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>64</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>80</Red>
+ <Green>240</Green>
+ <Blue>120</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>64</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>0</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>0</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>64</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>0</Blue>
+ </Entries>
+ </SeriesPalette>
+ <Series>
+ <Visible>true</Visible>
+ <Label>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Label>
+ <DataDefinition>
+ <Definition>row["instanceID"]</Definition>
+ </DataDefinition>
+ <SeriesIdentifier></SeriesIdentifier>
+ <DataPoint>
+ <Components>
+ <Type>Orthogonal_Value</Type>
+ </Components>
+ <Separator>, </Separator>
+ </DataPoint>
+ <LabelPosition>Outside</LabelPosition>
+ <Stacked>false</Stacked>
+ </Series>
+ <Grouping>
+ <Enabled>false</Enabled>
+ <GroupingInterval>2</GroupingInterval>
+ <GroupType>Text</GroupType>
+ <AggregateExpression>Sum</AggregateExpression>
+ </Grouping>
+ </SeriesDefinitions>
+ <Orientation>Horizontal</Orientation>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </LineAttributes>
+ <Label>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Name>SansSerif</Name>
+ <Size>9.0</Size>
+ <Alignment/>
+ </Font>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>true</Visible>
+ </Label>
+ <LabelPosition>Below</LabelPosition>
+ <Staggered>false</Staggered>
+ <MajorGrid>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>196</Red>
+ <Green>196</Green>
+ <Blue>196</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </LineAttributes>
+ <TickStyle>Across</TickStyle>
+ <TickAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>196</Red>
+ <Green>196</Green>
+ <Blue>196</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </TickAttributes>
+ </MajorGrid>
+ <MinorGrid>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>225</Red>
+ <Green>225</Green>
+ <Blue>225</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </LineAttributes>
+ <TickStyle>Across</TickStyle>
+ <TickAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>225</Red>
+ <Green>225</Green>
+ <Blue>225</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </TickAttributes>
+ </MinorGrid>
+ <Scale>
+ <MinorGridsPerUnit>5</MinorGridsPerUnit>
+ </Scale>
+ <Origin>
+ <Type>Min</Type>
+ <Value xsi:type="data:NumberDataElement">
+ <Value>0.0</Value>
+ </Value>
+ </Origin>
+ <PrimaryAxis>true</PrimaryAxis>
+ <CategoryAxis>true</CategoryAxis>
+ <Percent>false</Percent>
+ </Axes>
+ <Orientation>Vertical</Orientation>
+ <Rotation/>
+</model:ChartWithAxes>
+]]></xml-property>
+ <property name="outputFormat">SVG</property>
+ <property name="dataSet">ExecQuartileByInstance</property>
+ <property name="height">130pt</property>
+ <property name="width">212pt</property>
+ <list-property name="boundDataColumns">
+ <structure>
+ <property name="name">startDate</property>
+ <expression name="expression">dataSetRow["startDate"]</expression>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="name">endDate</property>
+ <expression name="expression">dataSetRow["endDate"]</expression>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="name">TOKEN_</property>
+ <expression name="expression">dataSetRow["TOKEN_"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">instanceID</property>
+ <expression name="expression">dataSetRow["instanceID"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">NAME_</property>
+ <expression name="expression">dataSetRow["NAME_"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="name">exec</property>
+ <expression name="expression">dataSetRow["exec"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">q3</property>
+ <expression name="expression">dataSetRow["q3"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">q1</property>
+ <expression name="expression">dataSetRow["q1"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">upperQuartile</property>
+ <expression name="expression">dataSetRow["upperQuartile"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ </list-property>
+ </extended-item>
+ <text id="286">
+ <property name="fontFamily">sans-serif</property>
+ <property name="paddingTop">10pt</property>
+ <property name="paddingLeft">10pt</property>
+ <property name="contentType">html</property>
+ <text-property name="content"><![CDATA[Report for process: <value-of>params["name"]</value-of> ]]></text-property>
+ </text>
+ <table name="GlobalScriptTable" id="245">
+ <property name="width">100%</property>
+ <property name="dataSet">ExecQuartileByInstance</property>
+ <list-property name="boundDataColumns">
+ <structure>
+ <property name="name">startDate</property>
+ <expression name="expression">dataSetRow["startDate"]</expression>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="name">endDate</property>
+ <expression name="expression">dataSetRow["endDate"]</expression>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="name">TOKEN_</property>
+ <expression name="expression">dataSetRow["TOKEN_"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">instanceID</property>
+ <expression name="expression">dataSetRow["instanceID"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">NAME_</property>
+ <expression name="expression">dataSetRow["NAME_"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="name">exec</property>
+ <expression name="expression">dataSetRow["exec"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">q3</property>
+ <expression name="expression">dataSetRow["q3"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">q1</property>
+ <expression name="expression">dataSetRow["q1"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">upperQuartile</property>
+ <expression name="expression">dataSetRow["upperQuartile"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">Column Binding</property>
+ <expression name="expression">params["name"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ </list-property>
+ <method name="onCreate"><![CDATA[// make dataset values available as global variables
+var q3Value = this.getRowData().getColumnValue("q3");
+var q1Value = this.getRowData().getColumnValue("exec");
+reportContext.setGlobalVariable("q3", q3Value);
+reportContext.setGlobalVariable("q1", q1Value);]]></method>
+ <column id="258"/>
+ <column id="259"/>
+ <detail>
+ <row id="250">
+ <cell id="251"/>
+ <cell id="252"/>
+ </row>
+ </detail>
+ </table>
+ <table id="287">
+ <property name="marginTop">0pt</property>
+ <property name="canShrink">true</property>
+ <property name="width">620px</property>
+ <column id="300"/>
+ <column id="301"/>
+ <header>
+ <row id="288">
+ <cell id="289">
+ <text id="339">
+ <property name="fontFamily">sans-serif</property>
+ <property name="fontWeight">bold</property>
+ <property name="paddingTop">1pt</property>
+ <property name="paddingLeft">10pt</property>
+ <property name="textAlign">left</property>
+ <property name="contentType">auto</property>
+ <text-property name="content"><![CDATA[Execution time quartiles]]></text-property>
+ </text>
+ </cell>
+ <cell id="290">
+ <text id="341">
+ <property name="fontFamily">sans-serif</property>
+ <property name="fontWeight">bold</property>
+ <property name="textAlign">left</property>
+ <property name="contentType">auto</property>
+ <text-property name="content"><![CDATA[Upper quartile]]></text-property>
+ </text>
+ </cell>
+ </row>
+ </header>
+ <detail>
+ <row id="292">
+ <cell id="293"/>
+ <cell id="294">
+ <table id="319">
+ <property name="fontFamily">sans-serif</property>
+ <property name="fontSize">small</property>
+ <property name="marginTop">0pt</property>
+ <property name="width">160px</property>
+ <property name="dataSet">ExecQuartileByInstance</property>
+ <list-property name="boundDataColumns">
+ <structure>
+ <property name="name">startDate</property>
+ <expression name="expression">dataSetRow["startDate"]</expression>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="name">endDate</property>
+ <expression name="expression">dataSetRow["endDate"]</expression>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="name">TOKEN_</property>
+ <expression name="expression">dataSetRow["TOKEN_"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">instanceID</property>
+ <expression name="expression">dataSetRow["instanceID"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">NAME_</property>
+ <expression name="expression">dataSetRow["NAME_"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="name">exec</property>
+ <expression name="expression">dataSetRow["exec"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">q3</property>
+ <expression name="expression">dataSetRow["q3"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">q1</property>
+ <expression name="expression">dataSetRow["q1"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">upperQuartile</property>
+ <expression name="expression">dataSetRow["upperQuartile"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">Column Binding</property>
+ <expression name="expression">row["instanceID"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">Column Binding_1</property>
+ <expression name="expression">row["exec"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">Aggregation</property>
+ <property name="dataType">any</property>
+ <property name="aggregateFunction">COUNT</property>
+ <expression name="filterExpr">row["instanceID"]</expression>
+ </structure>
+ </list-property>
+ <list-property name="sort">
+ <structure>
+ <expression name="key">row["exec"]</expression>
+ <property name="direction">desc</property>
+ </structure>
+ </list-property>
+ <list-property name="filter">
+ <structure>
+ <property name="operator">is-true</property>
+ <expression name="expr">row["upperQuartile"]</expression>
+ </structure>
+ </list-property>
+ <column id="332"/>
+ <column id="333"/>
+ <header>
+ <row id="320">
+ <cell id="321">
+ <text id="335">
+ <property name="contentType">auto</property>
+ <text-property name="content"><![CDATA[ID]]></text-property>
+ </text>
+ </cell>
+ <cell id="322">
+ <text id="336">
+ <property name="contentType">auto</property>
+ <text-property name="content"><![CDATA[Exec time (seconds)]]></text-property>
+ </text>
+ </cell>
+ </row>
+ </header>
+ <detail>
+ <row id="324">
+ <cell id="325">
+ <data id="337">
+ <property name="resultSetColumn">Column Binding</property>
+ </data>
+ </cell>
+ <cell id="326">
+ <data id="338">
+ <property name="paddingTop">1pt</property>
+ <property name="paddingLeft">10px</property>
+ <property name="paddingRight">1pt</property>
+ <property name="resultSetColumn">Column Binding_1</property>
+ </data>
+ </cell>
+ </row>
+ </detail>
+ <footer>
+ <row id="328">
+ <cell id="329"/>
+ <cell id="330"/>
+ </row>
+ </footer>
+ </table>
+ </cell>
+ </row>
+ </detail>
+ </table>
+ </body>
+</report>
Added: bpm-console/trunk/server/server-core/src/main/resources/instance_report.rptconfig
===================================================================
--- bpm-console/trunk/server/server-core/src/main/resources/instance_report.rptconfig (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/resources/instance_report.rptconfig 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.15" id="1">
+ <list-property name="configVars">
+ <structure>
+ <property name="name">__isdisplay__name_283_0</property>
+ <property name="value">simple</property>
+ </structure>
+ <structure>
+ <property name="name">name_283_1</property>
+ <property name="value">simple</property>
+ </structure>
+ <structure>
+ <property name="name">name_283_type_</property>
+ <property name="value">string</property>
+ </structure>
+ <structure>
+ <property name="name">name_283_expr_</property>
+ <property name="value">dataSetRow["NAME_"]</property>
+ </structure>
+ </list-property>
+ <styles>
+ <style name="crosstab" id="2">
+ <property name="borderBottomColor">#CCCCCC</property>
+ <property name="borderBottomStyle">solid</property>
+ <property name="borderBottomWidth">1pt</property>
+ <property name="borderLeftColor">#CCCCCC</property>
+ <property name="borderLeftStyle">solid</property>
+ <property name="borderLeftWidth">1pt</property>
+ <property name="borderRightColor">#CCCCCC</property>
+ <property name="borderRightStyle">solid</property>
+ <property name="borderRightWidth">1pt</property>
+ <property name="borderTopColor">#CCCCCC</property>
+ <property name="borderTopStyle">solid</property>
+ <property name="borderTopWidth">1pt</property>
+ </style>
+ <style name="crosstab-cell" id="3">
+ <property name="borderBottomColor">#CCCCCC</property>
+ <property name="borderBottomStyle">solid</property>
+ <property name="borderBottomWidth">1pt</property>
+ <property name="borderLeftColor">#CCCCCC</property>
+ <property name="borderLeftStyle">solid</property>
+ <property name="borderLeftWidth">1pt</property>
+ <property name="borderRightColor">#CCCCCC</property>
+ <property name="borderRightStyle">solid</property>
+ <property name="borderRightWidth">1pt</property>
+ <property name="borderTopColor">#CCCCCC</property>
+ <property name="borderTopStyle">solid</property>
+ <property name="borderTopWidth">1pt</property>
+ </style>
+ </styles>
+</report>
Added: bpm-console/trunk/server/server-core/src/main/resources/instance_report.rptdesign
===================================================================
--- bpm-console/trunk/server/server-core/src/main/resources/instance_report.rptdesign (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/resources/instance_report.rptdesign 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,1760 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.15" id="1">
+ <property name="createdBy">Eclipse BIRT Designer Version 2.2.2.r222_v20071226 Build <2.2.2.v20080226-1155></property>
+ <property name="units">in</property>
+ <property name="comments">Copyright (c) 2007 <<Your Company Name here>></property>
+ <html-property name="description">Creates a blank report with no predefined content.</html-property>
+ <text-property name="displayName">Blank Report</text-property>
+ <property name="iconFile">/templates/blank_report.gif</property>
+ <parameters>
+ <scalar-parameter name="name" id="283">
+ <property name="valueType">dynamic</property>
+ <property name="dataType">string</property>
+ <property name="paramType">simple</property>
+ <property name="controlType">list-box</property>
+ <property name="dataSetName">ProcessDefinitions</property>
+ <expression name="valueExpr">dataSetRow["NAME_"]</expression>
+ <property name="mustMatch">true</property>
+ <property name="fixedOrder">true</property>
+ <property name="defaultValue">TaskAssignmentExample</property>
+ <property name="distinct">true</property>
+ <structure name="format">
+ <property name="category">Unformatted</property>
+ </structure>
+ </scalar-parameter>
+ </parameters>
+ <data-sources>
+ <oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="MySQL Local" id="6">
+ <property name="odaDriverClass">com.mysql.jdbc.Driver</property>
+ <property name="odaURL">jdbc:mysql://localhost:3306/jbpmtest</property>
+ <property name="odaUser">jbpmtest</property>
+ <property name="odaJndiName">java:/JbpmDS</property>
+ </oda-data-source>
+ </data-sources>
+ <data-sets>
+ <oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="ExecQuartileByInstance" id="228">
+ <list-property name="computedColumns">
+ <structure>
+ <property name="name">exec</property>
+ <expression name="expression">DateTimeSpan.seconds(row["startDate"],row["endDate"])</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">q3</property>
+ <expression name="expression">row["exec"]</expression>
+ <property name="dataType">any</property>
+ <property name="aggregateFunction">QUARTILE</property>
+ <list-property name="arguments">
+ <structure>
+ <property name="name">QUARTILE</property>
+ <expression name="value">3</expression>
+ </structure>
+ </list-property>
+ </structure>
+ <structure>
+ <property name="name">q1</property>
+ <expression name="expression">row["exec"]</expression>
+ <property name="dataType">any</property>
+ <property name="aggregateFunction">QUARTILE</property>
+ <list-property name="arguments">
+ <structure>
+ <property name="name">QUARTILE</property>
+ <expression name="value">1</expression>
+ </structure>
+ </list-property>
+ </structure>
+ <structure>
+ <property name="name">upperQuartile</property>
+ <expression name="expression">row["exec"]>row["q3"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ </list-property>
+ <list-property name="columnHints">
+ <structure>
+ <property name="columnName">startDate</property>
+ <property name="displayName">startDate</property>
+ </structure>
+ <structure>
+ <property name="columnName">endDate</property>
+ <property name="displayName">endDate</property>
+ </structure>
+ <structure>
+ <property name="columnName">TOKEN_</property>
+ <property name="displayName">TOKEN_</property>
+ </structure>
+ <structure>
+ <property name="columnName">instanceID</property>
+ <property name="displayName">instanceID</property>
+ </structure>
+ <structure>
+ <property name="columnName">NAME_</property>
+ <property name="displayName">NAME_</property>
+ </structure>
+ </list-property>
+ <structure name="cachedMetaData">
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">startDate</property>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="position">2</property>
+ <property name="name">endDate</property>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="position">3</property>
+ <property name="name">TOKEN_</property>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="position">4</property>
+ <property name="name">instanceID</property>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="position">5</property>
+ <property name="name">NAME_</property>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="position">6</property>
+ <property name="name">exec</property>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="position">7</property>
+ <property name="name">q3</property>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="position">8</property>
+ <property name="name">q1</property>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="position">9</property>
+ <property name="name">upperQuartile</property>
+ <property name="dataType">any</property>
+ </structure>
+ </list-property>
+ </structure>
+ <property name="rowFetchLimit">100</property>
+ <property name="dataSource">MySQL Local</property>
+ <list-property name="parameters">
+ <structure>
+ <property name="name">defName</property>
+ <property name="paramName">name</property>
+ <property name="dataType">string</property>
+ <property name="position">1</property>
+ <expression name="defaultValue">"TaskAssignmentExample"</expression>
+ <property name="isInput">true</property>
+ <property name="isOutput">false</property>
+ </structure>
+ </list-property>
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">startDate</property>
+ <property name="nativeName">startDate</property>
+ <property name="dataType">date-time</property>
+ <property name="nativeDataType">93</property>
+ </structure>
+ <structure>
+ <property name="position">2</property>
+ <property name="name">endDate</property>
+ <property name="nativeName">endDate</property>
+ <property name="dataType">date-time</property>
+ <property name="nativeDataType">93</property>
+ </structure>
+ <structure>
+ <property name="position">3</property>
+ <property name="name">TOKEN_</property>
+ <property name="nativeName">TOKEN_</property>
+ <property name="dataType">decimal</property>
+ <property name="nativeDataType">-5</property>
+ </structure>
+ <structure>
+ <property name="position">4</property>
+ <property name="name">instanceID</property>
+ <property name="nativeName">instanceID</property>
+ <property name="dataType">decimal</property>
+ <property name="nativeDataType">-5</property>
+ </structure>
+ <structure>
+ <property name="position">5</property>
+ <property name="name">NAME_</property>
+ <property name="nativeName">NAME_</property>
+ <property name="dataType">string</property>
+ <property name="nativeDataType">12</property>
+ </structure>
+ </list-property>
+ <property name="queryText">SELECT l1.DATE_ as startDate, l2.DATE_ as endDate,
+l1.TOKEN_, i.ID_ as instanceID, p.NAME_
+ FROM JBPM_LOG l1, JBPM_LOG l2, JBPM_TOKEN t, JBPM_PROCESSINSTANCE i, JBPM_PROCESSDEFINITION p
+WHERE (l1.CLASS_='I' AND l2.CLASS_='X')
+AND (l1.TOKEN_=l2.TOKEN_)
+AND t.ID_=l1.TOKEN_
+AND t.PROCESSINSTANCE_=i.ID_
+AND i.PROCESSDEFINITION_=p.ID_
+AND p.NAME_=?
+GROUP BY instanceId </property>
+ </oda-data-set>
+ <oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="ProcessDefinitions" id="282">
+ <list-property name="columnHints">
+ <structure>
+ <property name="columnName">ID_</property>
+ <property name="displayName">ID_</property>
+ </structure>
+ <structure>
+ <property name="columnName">NAME_</property>
+ <property name="displayName">NAME_</property>
+ </structure>
+ </list-property>
+ <structure name="cachedMetaData">
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">ID_</property>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="position">2</property>
+ <property name="name">NAME_</property>
+ <property name="dataType">string</property>
+ </structure>
+ </list-property>
+ </structure>
+ <property name="dataSource">MySQL Local</property>
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">ID_</property>
+ <property name="nativeName">ID_</property>
+ <property name="dataType">decimal</property>
+ <property name="nativeDataType">-5</property>
+ </structure>
+ <structure>
+ <property name="position">2</property>
+ <property name="name">NAME_</property>
+ <property name="nativeName">NAME_</property>
+ <property name="dataType">string</property>
+ <property name="nativeDataType">12</property>
+ </structure>
+ </list-property>
+ <property name="queryText">SELECT ID_,NAME_
+FROM JBPM_PROCESSDEFINITION</property>
+ <xml-property name="designerValues"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<model:DesignValues xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design" xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
+ <Version>1.0</Version>
+ <design:ResultSets derivedMetaData="true">
+ <design:resultSetDefinitions>
+ <design:resultSetColumns>
+ <design:resultColumnDefinitions>
+ <design:attributes>
+ <design:name>ID_</design:name>
+ <design:position>1</design:position>
+ <design:nativeDataTypeCode>-5</design:nativeDataTypeCode>
+ <design:precision>20</design:precision>
+ <design:scale>0</design:scale>
+ <design:nullability>NotNullable</design:nullability>
+ <design:uiHints>
+ <design:displayName>ID_</design:displayName>
+ </design:uiHints>
+ </design:attributes>
+ <design:usageHints>
+ <design:label>ID_</design:label>
+ <design:formattingHints>
+ <design:displaySize>20</design:displaySize>
+ </design:formattingHints>
+ </design:usageHints>
+ </design:resultColumnDefinitions>
+ <design:resultColumnDefinitions>
+ <design:attributes>
+ <design:name>NAME_</design:name>
+ <design:position>2</design:position>
+ <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
+ <design:precision>255</design:precision>
+ <design:scale>0</design:scale>
+ <design:nullability>Nullable</design:nullability>
+ <design:uiHints>
+ <design:displayName>NAME_</design:displayName>
+ </design:uiHints>
+ </design:attributes>
+ <design:usageHints>
+ <design:label>NAME_</design:label>
+ <design:formattingHints>
+ <design:displaySize>255</design:displaySize>
+ </design:formattingHints>
+ </design:usageHints>
+ </design:resultColumnDefinitions>
+ </design:resultSetColumns>
+ </design:resultSetDefinitions>
+ </design:ResultSets>
+</model:DesignValues>]]></xml-property>
+ </oda-data-set>
+ </data-sets>
+ <styles>
+ <style name="crosstab" id="4">
+ <property name="borderBottomColor">#CCCCCC</property>
+ <property name="borderBottomStyle">solid</property>
+ <property name="borderBottomWidth">1pt</property>
+ <property name="borderLeftColor">#CCCCCC</property>
+ <property name="borderLeftStyle">solid</property>
+ <property name="borderLeftWidth">1pt</property>
+ <property name="borderRightColor">#CCCCCC</property>
+ <property name="borderRightStyle">solid</property>
+ <property name="borderRightWidth">1pt</property>
+ <property name="borderTopColor">#CCCCCC</property>
+ <property name="borderTopStyle">solid</property>
+ <property name="borderTopWidth">1pt</property>
+ </style>
+ <style name="crosstab-cell" id="5">
+ <property name="borderBottomColor">#CCCCCC</property>
+ <property name="borderBottomStyle">solid</property>
+ <property name="borderBottomWidth">1pt</property>
+ <property name="borderLeftColor">#CCCCCC</property>
+ <property name="borderLeftStyle">solid</property>
+ <property name="borderLeftWidth">1pt</property>
+ <property name="borderRightColor">#CCCCCC</property>
+ <property name="borderRightStyle">solid</property>
+ <property name="borderRightWidth">1pt</property>
+ <property name="borderTopColor">#CCCCCC</property>
+ <property name="borderTopStyle">solid</property>
+ <property name="borderTopWidth">1pt</property>
+ </style>
+ </styles>
+ <page-setup>
+ <simple-master-page name="Simple MasterPage" id="2"/>
+ </page-setup>
+ <body>
+ <text id="286">
+ <property name="fontFamily">sans-serif</property>
+ <property name="paddingTop">10pt</property>
+ <property name="paddingLeft">10pt</property>
+ <property name="contentType">html</property>
+ <text-property name="content"><![CDATA[Report for process: <value-of>params["name"]</value-of> ]]></text-property>
+ </text>
+ <table name="GlobalScriptTable" id="245">
+ <property name="width">100%</property>
+ <property name="dataSet">ExecQuartileByInstance</property>
+ <list-property name="boundDataColumns">
+ <structure>
+ <property name="name">startDate</property>
+ <expression name="expression">dataSetRow["startDate"]</expression>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="name">endDate</property>
+ <expression name="expression">dataSetRow["endDate"]</expression>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="name">TOKEN_</property>
+ <expression name="expression">dataSetRow["TOKEN_"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">instanceID</property>
+ <expression name="expression">dataSetRow["instanceID"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">NAME_</property>
+ <expression name="expression">dataSetRow["NAME_"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="name">exec</property>
+ <expression name="expression">dataSetRow["exec"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">q3</property>
+ <expression name="expression">dataSetRow["q3"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">q1</property>
+ <expression name="expression">dataSetRow["q1"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">upperQuartile</property>
+ <expression name="expression">dataSetRow["upperQuartile"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">Column Binding</property>
+ <expression name="expression">params["name"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ </list-property>
+ <method name="onCreate"><![CDATA[// make dataset values available as global variables
+var q3Value = this.getRowData().getColumnValue("q3");
+var q1Value = this.getRowData().getColumnValue("q1");
+reportContext.setGlobalVariable("q3", q3Value);
+reportContext.setGlobalVariable("q1", q1Value);]]></method>
+ <column id="258"/>
+ <column id="259"/>
+ <detail>
+ <row id="250">
+ <cell id="251"/>
+ <cell id="252"/>
+ </row>
+ </detail>
+ </table>
+ <table id="287">
+ <property name="marginTop">0pt</property>
+ <property name="canShrink">true</property>
+ <property name="width">620px</property>
+ <column id="300"/>
+ <column id="301"/>
+ <header>
+ <row id="288">
+ <cell id="289">
+ <text id="339">
+ <property name="fontFamily">sans-serif</property>
+ <property name="fontWeight">bold</property>
+ <property name="paddingTop">1pt</property>
+ <property name="paddingLeft">10pt</property>
+ <property name="textAlign">left</property>
+ <property name="contentType">auto</property>
+ <text-property name="content"><![CDATA[Execution time quartiles]]></text-property>
+ </text>
+ </cell>
+ <cell id="290">
+ <text id="341">
+ <property name="fontFamily">sans-serif</property>
+ <property name="fontWeight">bold</property>
+ <property name="textAlign">left</property>
+ <property name="contentType">auto</property>
+ <text-property name="content"><![CDATA[Upper quartile]]></text-property>
+ </text>
+ </cell>
+ </row>
+ </header>
+ <detail>
+ <row id="292">
+ <cell id="293">
+ <extended-item extensionName="Chart" name="ExecQuartiles" id="223">
+ <xml-property name="xmlRepresentation"><![CDATA[<model:ChartWithAxes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:attribute="http://www.birt.eclipse.org/ChartModelAttribute" xmlns:data="http://www.birt.eclipse.org/ChartModelData" xmlns:layout="http://www.birt.eclipse.org/ChartModelLayout" xmlns:model="http://www.birt.eclipse.org/ChartModel" xmlns:type="http://www.birt.eclipse.org/ChartModelType">
+ <Type>Bar Chart</Type>
+ <SubType>Side-by-side</SubType>
+ <Block>
+ <Children xsi:type="layout:TitleBlock">
+ <Bounds>
+ <Left>0.0</Left>
+ <Top>0.0</Top>
+ <Width>0.0</Width>
+ <Height>0.0</Height>
+ </Bounds>
+ <Insets>
+ <Top>3.0</Top>
+ <Left>3.0</Left>
+ <Bottom>3.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Row>-1</Row>
+ <Column>-1</Column>
+ <Rowspan>-1</Rowspan>
+ <Columnspan>-1</Columnspan>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Visible>false</Visible>
+ <Label>
+ <Caption>
+ <Value>Execution time quartiles</Value>
+ <Font>
+ <Size>16.0</Size>
+ <Bold>true</Bold>
+ <Alignment>
+ <horizontalAlignment>Center</horizontalAlignment>
+ <verticalAlignment>Center</verticalAlignment>
+ </Alignment>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>true</Visible>
+ </Label>
+ </Children>
+ <Children xsi:type="layout:Plot">
+ <Bounds>
+ <Left>0.0</Left>
+ <Top>0.0</Top>
+ <Width>0.0</Width>
+ <Height>0.0</Height>
+ </Bounds>
+ <Insets>
+ <Top>3.0</Top>
+ <Left>3.0</Left>
+ <Bottom>3.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Row>-1</Row>
+ <Column>-1</Column>
+ <Rowspan>-1</Rowspan>
+ <Columnspan>-1</Columnspan>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Visible>true</Visible>
+ <HorizontalSpacing>5</HorizontalSpacing>
+ <VerticalSpacing>5</VerticalSpacing>
+ <ClientArea>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>0</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>0.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>0.0</Right>
+ </Insets>
+ </ClientArea>
+ </Children>
+ <Children xsi:type="layout:Legend">
+ <Bounds>
+ <Left>0.0</Left>
+ <Top>0.0</Top>
+ <Width>0.0</Width>
+ <Height>0.0</Height>
+ </Bounds>
+ <Insets>
+ <Top>3.0</Top>
+ <Left>3.0</Left>
+ <Bottom>3.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Row>-1</Row>
+ <Column>-1</Column>
+ <Rowspan>-1</Rowspan>
+ <Columnspan>-1</Columnspan>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Visible>false</Visible>
+ <ClientArea>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>0</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>2.0</Top>
+ <Left>2.0</Left>
+ <Bottom>2.0</Bottom>
+ <Right>2.0</Right>
+ </Insets>
+ </ClientArea>
+ <Text>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Text>
+ <Orientation>Vertical</Orientation>
+ <Direction>Top_Bottom</Direction>
+ <Separator>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </Separator>
+ <Position>Right</Position>
+ <ItemType>Series</ItemType>
+ <Title>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Title>
+ <TitlePosition>Above</TitlePosition>
+ </Children>
+ <Bounds>
+ <Left>0.0</Left>
+ <Top>0.0</Top>
+ <Width>212.0</Width>
+ <Height>130.0</Height>
+ </Bounds>
+ <Insets>
+ <Top>3.0</Top>
+ <Left>3.0</Left>
+ <Bottom>3.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Row>-1</Row>
+ <Column>-1</Column>
+ <Rowspan>-1</Rowspan>
+ <Columnspan>-1</Columnspan>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Visible>true</Visible>
+ </Block>
+ <Dimension>Two_Dimensional</Dimension>
+ <Script>/*function beforeDrawDataPoint(dataPointHints, fill, scriptContext )
+{
+ val = dataPointHints.getOrthogonalValue();
+ chart = scriptContext.getChartInstance();
+ marker = chart.getAxes().get(0).getAssociatedAxes().get(0).getMarkerLines().get(0).getValue().getValue();
+
+ if (val > marker) //crosses marker?
+ fill.set(255, 0, 0); //yes - display in red
+ else
+ fill.set(0, 0, 255); //no - display in blue
+}*/
+
+
+/**
+ * Called before generation of chart model to GeneratedChartState.
+ *
+ * @param chart
+ * Chart
+ * @param icsc
+ * IChartScriptContext
+ */
+
+function beforeGeneration(chart, icsc){
+ importPackage(Packages.org.eclipse.birt.chart.model.component.impl);
+ importPackage(Packages.org.eclipse.birt.chart.model.data.impl);
+ importPackage(Packages.org.eclipse.birt.chart.model.attribute);
+ importPackage(Packages.org.eclipse.birt.chart.model.attribute.impl);
+
+ reportContext = icsc.getExternalContext().getScriptable();
+
+ var chart = icsc.getChartInstance();
+ var yAxis = chart.getAxes().get(0).getAssociatedAxes().get(0);
+
+ var topValue = reportContext.getGlobalVariable("q3");
+ var bottomValue = reportContext.getGlobalVariable("q1");
+
+ top_ml = MarkerLineImpl.create(yAxis, NumberDataElementImpl.create(topValue));
+ top_ml.getLabel().getCaption().setValue("Q.75");
+ top_ml.getLineAttributes().getColor().set(204,204,204);
+ top_ml.getLineAttributes().setStyle(LineStyle.SOLID_LITERAL);
+ top_ml.getLineAttributes().setThickness(1);
+
+ //bottom_ml = MarkerLineImpl.create(yAxis, NumberDataElementImpl.create(bottomValue));
+ //bottom_ml.getLabel().getCaption().setValue("Q.25");
+ //bottom_ml.getLineAttributes().getColor().set(204,204,204);
+ //bottom_ml.getLineAttributes().setStyle(LineStyle.SOLID_LITERAL);
+ //bottom_ml.getLineAttributes().setThickness(1);
+}</Script>
+ <Units>Points</Units>
+ <SeriesThickness>10.0</SeriesThickness>
+ <GridColumnCount>1</GridColumnCount>
+ <SampleData>
+ <BaseSampleData>
+ <DataSetRepresentation>5.0,4.0,12.0</DataSetRepresentation>
+ </BaseSampleData>
+ <OrthogonalSampleData>
+ <DataSetRepresentation>5.0,4.0,12.0</DataSetRepresentation>
+ <SeriesDefinitionIndex>0</SeriesDefinitionIndex>
+ </OrthogonalSampleData>
+ </SampleData>
+ <Interactivity>
+ <Enable>true</Enable>
+ <LegendBehavior>None</LegendBehavior>
+ </Interactivity>
+ <Axes>
+ <Type>Linear</Type>
+ <Title>
+ <Caption>
+ <Value>Instance ID</Value>
+ <Font>
+ <Name>SansSerif</Name>
+ <Size>9.0</Size>
+ <Bold>true</Bold>
+ <Alignment>
+ <horizontalAlignment>Center</horizontalAlignment>
+ <verticalAlignment>Center</verticalAlignment>
+ </Alignment>
+ </Font>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>192</Red>
+ <Green>192</Green>
+ <Blue>192</Blue>
+ </Color>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>true</Visible>
+ </Title>
+ <TitlePosition>Below</TitlePosition>
+ <AssociatedAxes>
+ <Type>Logarithmic</Type>
+ <Title>
+ <Caption>
+ <Value>Exec time</Value>
+ <Font>
+ <Size>14.0</Size>
+ <Bold>true</Bold>
+ <Alignment>
+ <horizontalAlignment>Center</horizontalAlignment>
+ <verticalAlignment>Center</verticalAlignment>
+ </Alignment>
+ <Rotation>90.0</Rotation>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Title>
+ <TitlePosition>Left</TitlePosition>
+ <SeriesDefinitions>
+ <Query>
+ <Definition></Definition>
+ </Query>
+ <SeriesPalette>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>80</Red>
+ <Green>166</Green>
+ <Blue>218</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>242</Red>
+ <Green>88</Green>
+ <Blue>106</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>232</Red>
+ <Green>172</Green>
+ <Blue>57</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>255</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>64</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>170</Red>
+ <Green>85</Green>
+ <Blue>85</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>192</Red>
+ <Green>192</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>192</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>7</Red>
+ <Green>146</Green>
+ <Blue>94</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>128</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>0</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>64</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>80</Red>
+ <Green>240</Green>
+ <Blue>120</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>64</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>0</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>0</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>64</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>0</Blue>
+ </Entries>
+ </SeriesPalette>
+ <Series xsi:type="type:BarSeries">
+ <Visible>true</Visible>
+ <Label>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Label>
+ <DataDefinition>
+ <Definition>row["exec"]</Definition>
+ </DataDefinition>
+ <SeriesIdentifier></SeriesIdentifier>
+ <DataPoint>
+ <Components>
+ <Type>Orthogonal_Value</Type>
+ </Components>
+ <Separator>, </Separator>
+ </DataPoint>
+ <LabelPosition>Inside</LabelPosition>
+ <Stacked>false</Stacked>
+ <Riser>Rectangle</Riser>
+ </Series>
+ <Grouping>
+ <Enabled>false</Enabled>
+ <GroupingInterval>2</GroupingInterval>
+ <GroupType>Text</GroupType>
+ <AggregateExpression>Sum</AggregateExpression>
+ </Grouping>
+ <Sorting>Ascending</Sorting>
+ </SeriesDefinitions>
+ <Orientation>Vertical</Orientation>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>192</Red>
+ <Green>192</Green>
+ <Blue>192</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </LineAttributes>
+ <Label>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Label>
+ <LabelPosition>Left</LabelPosition>
+ <MajorGrid>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>196</Red>
+ <Green>196</Green>
+ <Blue>196</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </LineAttributes>
+ <TickStyle>Across</TickStyle>
+ <TickAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>196</Red>
+ <Green>196</Green>
+ <Blue>196</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </TickAttributes>
+ </MajorGrid>
+ <MinorGrid>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>225</Red>
+ <Green>225</Green>
+ <Blue>225</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </LineAttributes>
+ <TickStyle>Across</TickStyle>
+ <TickAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>225</Red>
+ <Green>225</Green>
+ <Blue>225</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </TickAttributes>
+ </MinorGrid>
+ <Scale>
+ <MinorGridsPerUnit>5</MinorGridsPerUnit>
+ </Scale>
+ <Origin>
+ <Type>Min</Type>
+ <Value xsi:type="data:NumberDataElement">
+ <Value>0.0</Value>
+ </Value>
+ </Origin>
+ <PrimaryAxis>true</PrimaryAxis>
+ <Percent>false</Percent>
+ </AssociatedAxes>
+ <SeriesDefinitions>
+ <Query>
+ <Definition></Definition>
+ </Query>
+ <SeriesPalette>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>80</Red>
+ <Green>166</Green>
+ <Blue>218</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>242</Red>
+ <Green>88</Green>
+ <Blue>106</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>232</Red>
+ <Green>172</Green>
+ <Blue>57</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>255</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>64</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>170</Red>
+ <Green>85</Green>
+ <Blue>85</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>192</Red>
+ <Green>192</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>192</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>7</Red>
+ <Green>146</Green>
+ <Blue>94</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>128</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>0</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>64</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>80</Red>
+ <Green>240</Green>
+ <Blue>120</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>64</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>0</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>0</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>64</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>0</Blue>
+ </Entries>
+ </SeriesPalette>
+ <Series>
+ <Visible>true</Visible>
+ <Label>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Label>
+ <DataDefinition>
+ <Definition>row["instanceID"]</Definition>
+ </DataDefinition>
+ <SeriesIdentifier></SeriesIdentifier>
+ <DataPoint>
+ <Components>
+ <Type>Orthogonal_Value</Type>
+ </Components>
+ <Separator>, </Separator>
+ </DataPoint>
+ <LabelPosition>Outside</LabelPosition>
+ <Stacked>false</Stacked>
+ </Series>
+ <Grouping>
+ <Enabled>false</Enabled>
+ <GroupingInterval>2</GroupingInterval>
+ <GroupType>Text</GroupType>
+ <AggregateExpression>Sum</AggregateExpression>
+ </Grouping>
+ </SeriesDefinitions>
+ <Orientation>Horizontal</Orientation>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </LineAttributes>
+ <Label>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Name>SansSerif</Name>
+ <Size>9.0</Size>
+ <Alignment/>
+ </Font>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>true</Visible>
+ </Label>
+ <LabelPosition>Below</LabelPosition>
+ <Staggered>false</Staggered>
+ <MajorGrid>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>196</Red>
+ <Green>196</Green>
+ <Blue>196</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </LineAttributes>
+ <TickStyle>Across</TickStyle>
+ <TickAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>196</Red>
+ <Green>196</Green>
+ <Blue>196</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </TickAttributes>
+ </MajorGrid>
+ <MinorGrid>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>225</Red>
+ <Green>225</Green>
+ <Blue>225</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </LineAttributes>
+ <TickStyle>Across</TickStyle>
+ <TickAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>225</Red>
+ <Green>225</Green>
+ <Blue>225</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </TickAttributes>
+ </MinorGrid>
+ <Scale>
+ <MinorGridsPerUnit>5</MinorGridsPerUnit>
+ </Scale>
+ <Origin>
+ <Type>Min</Type>
+ <Value xsi:type="data:NumberDataElement">
+ <Value>0.0</Value>
+ </Value>
+ </Origin>
+ <PrimaryAxis>true</PrimaryAxis>
+ <CategoryAxis>true</CategoryAxis>
+ <Percent>false</Percent>
+ </Axes>
+ <Orientation>Vertical</Orientation>
+ <Rotation/>
+</model:ChartWithAxes>
+]]></xml-property>
+ <property name="outputFormat">SVG</property>
+ <property name="dataSet">ExecQuartileByInstance</property>
+ <property name="height">130pt</property>
+ <property name="width">212pt</property>
+ <list-property name="boundDataColumns">
+ <structure>
+ <property name="name">startDate</property>
+ <expression name="expression">dataSetRow["startDate"]</expression>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="name">endDate</property>
+ <expression name="expression">dataSetRow["endDate"]</expression>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="name">TOKEN_</property>
+ <expression name="expression">dataSetRow["TOKEN_"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">instanceID</property>
+ <expression name="expression">dataSetRow["instanceID"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">NAME_</property>
+ <expression name="expression">dataSetRow["NAME_"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="name">exec</property>
+ <expression name="expression">dataSetRow["exec"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">q3</property>
+ <expression name="expression">dataSetRow["q3"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">q1</property>
+ <expression name="expression">dataSetRow["q1"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">upperQuartile</property>
+ <expression name="expression">dataSetRow["upperQuartile"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ </list-property>
+ </extended-item>
+ </cell>
+ <cell id="294">
+ <table id="319">
+ <property name="fontFamily">sans-serif</property>
+ <property name="fontSize">small</property>
+ <property name="marginTop">0pt</property>
+ <property name="width">160px</property>
+ <property name="dataSet">ExecQuartileByInstance</property>
+ <list-property name="boundDataColumns">
+ <structure>
+ <property name="name">startDate</property>
+ <expression name="expression">dataSetRow["startDate"]</expression>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="name">endDate</property>
+ <expression name="expression">dataSetRow["endDate"]</expression>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="name">TOKEN_</property>
+ <expression name="expression">dataSetRow["TOKEN_"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">instanceID</property>
+ <expression name="expression">dataSetRow["instanceID"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">NAME_</property>
+ <expression name="expression">dataSetRow["NAME_"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="name">exec</property>
+ <expression name="expression">dataSetRow["exec"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">q3</property>
+ <expression name="expression">dataSetRow["q3"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">q1</property>
+ <expression name="expression">dataSetRow["q1"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">upperQuartile</property>
+ <expression name="expression">dataSetRow["upperQuartile"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">Column Binding</property>
+ <expression name="expression">row["instanceID"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">Column Binding_1</property>
+ <expression name="expression">row["exec"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">Aggregation</property>
+ <property name="dataType">any</property>
+ <property name="aggregateFunction">COUNT</property>
+ <expression name="filterExpr">row["instanceID"]</expression>
+ </structure>
+ </list-property>
+ <list-property name="sort">
+ <structure>
+ <expression name="key">row["exec"]</expression>
+ <property name="direction">desc</property>
+ </structure>
+ </list-property>
+ <list-property name="filter">
+ <structure>
+ <property name="operator">is-true</property>
+ <expression name="expr">row["upperQuartile"]</expression>
+ </structure>
+ </list-property>
+ <column id="332"/>
+ <column id="333"/>
+ <header>
+ <row id="320">
+ <cell id="321">
+ <text id="335">
+ <property name="contentType">auto</property>
+ <text-property name="content"><![CDATA[ID]]></text-property>
+ </text>
+ </cell>
+ <cell id="322">
+ <text id="336">
+ <property name="contentType">auto</property>
+ <text-property name="content"><![CDATA[Exec time (seconds)]]></text-property>
+ </text>
+ </cell>
+ </row>
+ </header>
+ <detail>
+ <row id="324">
+ <cell id="325">
+ <data id="337">
+ <property name="resultSetColumn">Column Binding</property>
+ </data>
+ </cell>
+ <cell id="326">
+ <data id="338">
+ <property name="paddingTop">1pt</property>
+ <property name="paddingLeft">10px</property>
+ <property name="paddingRight">1pt</property>
+ <property name="resultSetColumn">Column Binding_1</property>
+ </data>
+ </cell>
+ </row>
+ </detail>
+ <footer>
+ <row id="328">
+ <cell id="329"/>
+ <cell id="330"/>
+ </row>
+ </footer>
+ </table>
+ </cell>
+ </row>
+ </detail>
+ </table>
+ </body>
+</report>
Added: bpm-console/trunk/server/server-core/src/main/resources/org/jboss/bpm/console/server/jbpm3/dao/internal/1.jpg
===================================================================
(Binary files differ)
Property changes on: bpm-console/trunk/server/server-core/src/main/resources/org/jboss/bpm/console/server/jbpm3/dao/internal/1.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: bpm-console/trunk/server/server-core/src/main/resources/org/jboss/bpm/console/server/jbpm3/dao/internal/gpd.xml
===================================================================
--- bpm-console/trunk/server/server-core/src/main/resources/org/jboss/bpm/console/server/jbpm3/dao/internal/gpd.xml (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/resources/org/jboss/bpm/console/server/jbpm3/dao/internal/gpd.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-diagram name="websale" width="566" height="541">
+ <node name="Create new web sale order" x="250" y="50" width="200" height="40">
+ <transition>
+ <label x="5" y="-10"/>
+ </transition>
+ </node>
+ <node name="Evaluate web order" x="280" y="125" width="140" height="40">
+ <transition name="ok">
+ <label x="9" y="-10"/>
+ </transition>
+ <transition name="more info needed">
+ <label x="-44" y="-18"/>
+ <bendpoint w1="-114" h1="-35" w2="116" h2="-35"/>
+ </transition>
+ </node>
+ <node name="Fix web order data" x="50" y="125" width="140" height="40">
+ <transition>
+ <label x="5" y="-10"/>
+ <bendpoint w1="109" h1="32" w2="-121" h2="32"/>
+ </transition>
+ </node>
+ <node name="salefork" x="250" y="200" width="200" height="25">
+ <transition name="payment">
+ <label x="12" y="-18"/>
+ <bendpoint w1="145" h1="31" w2="0" h2="-52"/>
+ </transition>
+ <transition name="shipping">
+ <label x="10" y="10"/>
+ <bendpoint w1="-130" h1="34" w2="0" h2="-89"/>
+ </transition>
+ </node>
+ <node name="Wait for money" x="425" y="275" width="140" height="40">
+ <transition>
+ <label x="5" y="-10"/>
+ </transition>
+ </node>
+ <node name="update books" x="425" y="350" width="140" height="40">
+ <transition>
+ <label x="5" y="-10"/>
+ <bendpoint w1="-1" h1="34" w2="144" h2="-33"/>
+ </transition>
+ </node>
+ <node name="ship item" x="150" y="315" width="140" height="40">
+ <transition>
+ <label x="5" y="-10"/>
+ <bendpoint w1="-1" h1="74" w2="-131" h2="-28"/>
+ </transition>
+ </node>
+ <node name="salejoin" x="250" y="425" width="200" height="25">
+ <transition>
+ <label x="5" y="-10"/>
+ </transition>
+ </node>
+ <node name="end" x="280" y="500" width="140" height="40"/>
+</process-diagram>
+
Added: bpm-console/trunk/server/server-core/src/main/resources/process.jpdl.xml
===================================================================
--- bpm-console/trunk/server/server-core/src/main/resources/process.jpdl.xml (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/resources/process.jpdl.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="StateSequence" xmlns="http://jbpm.org/4/jpdl">
+
+ <start g="16,18,48,48">
+ <flow to="a" />
+ </start>
+
+ <state name="a" g="96,16,75,52">
+ <flow to="b" />
+ </state>
+
+ <state name="b" g="203,16,73,52">
+ <flow to="c" />
+ </state>
+
+ <state name="c" g="308,16,76,52" >
+ <flow to="end"/>
+ </state>
+
+ <end name="end" g="239,40,48,48"/>
+
+</process>
\ No newline at end of file
Added: bpm-console/trunk/server/server-core/src/main/resources/process_activity.rptdesign
===================================================================
--- bpm-console/trunk/server/server-core/src/main/resources/process_activity.rptdesign (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/resources/process_activity.rptdesign 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,2227 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.15" id="1">
+ <property name="createdBy">Eclipse BIRT Designer Version 2.2.2.r222_v20071226 Build <2.2.2.v20080226-1155></property>
+ <property name="units">in</property>
+ <property name="comments">Copyright (c) 2007 <<Your Company Name here>></property>
+ <html-property name="description">Creates a blank report with no predefined content.</html-property>
+ <text-property name="displayName">Blank Report</text-property>
+ <property name="iconFile">/templates/blank_report.gif</property>
+ <property name="layoutPreference">fixed layout</property>
+ <data-sources>
+ <oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="MySQL Local" id="6">
+ <property name="odaDriverClass">com.mysql.jdbc.Driver</property>
+ <property name="odaURL">jdbc:mysql://localhost:3306/jbpmtest</property>
+ <property name="odaUser">jbpmtest</property>
+ <property name="odaJndiName">java:/JbpmDS</property>
+ </oda-data-source>
+ <script-data-source name="ScriptedDS" id="51"/>
+ </data-sources>
+ <data-sets>
+ <oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="AverageExecTime" id="7">
+ <list-property name="computedColumns">
+ <structure>
+ <property name="name">execSeconds</property>
+ <expression name="expression">DateTimeSpan.seconds(row["startDate"],row["endDate"])</expression>
+ <property name="dataType">integer</property>
+ </structure>
+ <structure>
+ <property name="name">q3</property>
+ <expression name="expression">row["execSeconds"]</expression>
+ <property name="dataType">any</property>
+ <property name="aggregateFunction">QUARTILE</property>
+ <list-property name="arguments">
+ <structure>
+ <property name="name">QUARTILE</property>
+ <expression name="value">3</expression>
+ </structure>
+ </list-property>
+ </structure>
+ </list-property>
+ <list-property name="columnHints">
+ <structure>
+ <property name="columnName">startDate</property>
+ <property name="displayName">startDate</property>
+ </structure>
+ <structure>
+ <property name="columnName">endDate</property>
+ <property name="displayName">endDate</property>
+ </structure>
+ <structure>
+ <property name="columnName">TOKEN_</property>
+ <property name="displayName">TOKEN_</property>
+ </structure>
+ <structure>
+ <property name="columnName">instanceID</property>
+ <property name="displayName">instanceID</property>
+ </structure>
+ <structure>
+ <property name="columnName">NAME_</property>
+ <property name="displayName">NAME_</property>
+ </structure>
+ </list-property>
+ <structure name="cachedMetaData">
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">startDate</property>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="position">2</property>
+ <property name="name">endDate</property>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="position">3</property>
+ <property name="name">TOKEN_</property>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="position">4</property>
+ <property name="name">instanceID</property>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="position">5</property>
+ <property name="name">NAME_</property>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="position">6</property>
+ <property name="name">execSeconds</property>
+ <property name="dataType">integer</property>
+ </structure>
+ <structure>
+ <property name="position">7</property>
+ <property name="name">q3</property>
+ <property name="dataType">any</property>
+ </structure>
+ </list-property>
+ </structure>
+ <property name="dataSource">MySQL Local</property>
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">startDate</property>
+ <property name="nativeName">startDate</property>
+ <property name="dataType">date-time</property>
+ <property name="nativeDataType">93</property>
+ </structure>
+ <structure>
+ <property name="position">2</property>
+ <property name="name">endDate</property>
+ <property name="nativeName">endDate</property>
+ <property name="dataType">date-time</property>
+ <property name="nativeDataType">93</property>
+ </structure>
+ <structure>
+ <property name="position">3</property>
+ <property name="name">TOKEN_</property>
+ <property name="nativeName">TOKEN_</property>
+ <property name="dataType">decimal</property>
+ <property name="nativeDataType">-5</property>
+ </structure>
+ <structure>
+ <property name="position">4</property>
+ <property name="name">instanceID</property>
+ <property name="nativeName">instanceID</property>
+ <property name="dataType">decimal</property>
+ <property name="nativeDataType">-5</property>
+ </structure>
+ <structure>
+ <property name="position">5</property>
+ <property name="name">NAME_</property>
+ <property name="nativeName">NAME_</property>
+ <property name="dataType">string</property>
+ <property name="nativeDataType">12</property>
+ </structure>
+ </list-property>
+ <property name="queryText">SELECT l1.DATE_ as startDate, l2.DATE_ as endDate,
+l1.TOKEN_, i.ID_ as instanceID, p.NAME_
+ FROM JBPM_LOG l1, JBPM_LOG l2, JBPM_TOKEN t, JBPM_PROCESSINSTANCE i, JBPM_PROCESSDEFINITION p
+WHERE (l1.CLASS_='I' AND l2.CLASS_='X')
+AND (l1.TOKEN_=l2.TOKEN_)
+AND t.ID_=l1.TOKEN_
+AND t.PROCESSINSTANCE_=i.ID_
+AND i.PROCESSDEFINITION_=p.ID_
+GROUP BY instanceId
+ORDER BY l1.DATE_ ASC, l1.TOKEN_</property>
+ </oda-data-set>
+ <oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="ProcessActivity" id="53">
+ <list-property name="columnHints">
+ <structure>
+ <property name="columnName">numberExec</property>
+ <property name="displayName">numberExec</property>
+ </structure>
+ <structure>
+ <property name="columnName">NAME_</property>
+ <property name="displayName">NAME_</property>
+ </structure>
+ </list-property>
+ <structure name="cachedMetaData">
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">numberExec</property>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="position">2</property>
+ <property name="name">NAME_</property>
+ <property name="dataType">string</property>
+ </structure>
+ </list-property>
+ </structure>
+ <property name="dataSource">MySQL Local</property>
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">numberExec</property>
+ <property name="nativeName">numberExec</property>
+ <property name="dataType">decimal</property>
+ <property name="nativeDataType">-5</property>
+ </structure>
+ <structure>
+ <property name="position">2</property>
+ <property name="name">NAME_</property>
+ <property name="nativeName">NAME_</property>
+ <property name="dataType">string</property>
+ <property name="nativeDataType">12</property>
+ </structure>
+ </list-property>
+ <property name="queryText">SELECT count(i.ID_) as numberExec, p.NAME_
+ FROM JBPM_LOG l1, JBPM_LOG l2, JBPM_TOKEN t, JBPM_PROCESSINSTANCE i, JBPM_PROCESSDEFINITION p
+WHERE (l1.CLASS_='I' AND l2.CLASS_='X')
+AND (l1.TOKEN_=l2.TOKEN_)
+AND t.ID_=l1.TOKEN_
+AND t.PROCESSINSTANCE_=i.ID_
+AND i.PROCESSDEFINITION_=p.ID_
+GROUP BY NAME_
+ORDER BY numberExec ASC LIMIT 15</property>
+ </oda-data-set>
+ <oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="RunningInstances" id="90">
+ <list-property name="columnHints">
+ <structure>
+ <property name="columnName">total</property>
+ <property name="displayName">total</property>
+ </structure>
+ </list-property>
+ <structure name="cachedMetaData">
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">total</property>
+ <property name="dataType">decimal</property>
+ </structure>
+ </list-property>
+ </structure>
+ <property name="dataSource">MySQL Local</property>
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">total</property>
+ <property name="nativeName">total</property>
+ <property name="dataType">decimal</property>
+ <property name="nativeDataType">-5</property>
+ </structure>
+ </list-property>
+ <property name="queryText">SELECT count(ID_) as total
+FROM JBPM_PROCESSINSTANCE
+WHERE END_ IS NULL</property>
+ </oda-data-set>
+ <oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="TotalDefinitions" id="171">
+ <list-property name="columnHints">
+ <structure>
+ <property name="columnName">count(ID_)</property>
+ <property name="displayName">count(ID_)</property>
+ </structure>
+ </list-property>
+ <structure name="cachedMetaData">
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">count(ID_)</property>
+ <property name="dataType">decimal</property>
+ </structure>
+ </list-property>
+ </structure>
+ <property name="dataSource">MySQL Local</property>
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">count(ID_)</property>
+ <property name="nativeName">count(ID_)</property>
+ <property name="dataType">decimal</property>
+ <property name="nativeDataType">-5</property>
+ </structure>
+ </list-property>
+ <property name="queryText">Select count(ID_) from JBPM_PROCESSDEFINITION</property>
+ <xml-property name="designerValues"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<model:DesignValues xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design" xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
+ <Version>1.0</Version>
+ <design:ResultSets derivedMetaData="true">
+ <design:resultSetDefinitions>
+ <design:resultSetColumns>
+ <design:resultColumnDefinitions>
+ <design:attributes>
+ <design:name>count(ID_)</design:name>
+ <design:position>1</design:position>
+ <design:nativeDataTypeCode>-5</design:nativeDataTypeCode>
+ <design:precision>21</design:precision>
+ <design:scale>0</design:scale>
+ <design:nullability>NotNullable</design:nullability>
+ <design:uiHints>
+ <design:displayName>count(ID_)</design:displayName>
+ </design:uiHints>
+ </design:attributes>
+ <design:usageHints>
+ <design:label>count(ID_)</design:label>
+ <design:formattingHints>
+ <design:displaySize>21</design:displaySize>
+ </design:formattingHints>
+ </design:usageHints>
+ </design:resultColumnDefinitions>
+ </design:resultSetColumns>
+ </design:resultSetDefinitions>
+ </design:ResultSets>
+</model:DesignValues>]]></xml-property>
+ </oda-data-set>
+ <oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="CompletedInstances" id="190">
+ <list-property name="columnHints">
+ <structure>
+ <property name="columnName">total</property>
+ <property name="displayName">total</property>
+ </structure>
+ </list-property>
+ <structure name="cachedMetaData">
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">total</property>
+ <property name="dataType">decimal</property>
+ </structure>
+ </list-property>
+ </structure>
+ <property name="dataSource">MySQL Local</property>
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">total</property>
+ <property name="nativeName">total</property>
+ <property name="dataType">decimal</property>
+ <property name="nativeDataType">-5</property>
+ </structure>
+ </list-property>
+ <property name="queryText">SELECT count(ID_) as total
+ FROM JBPM_PROCESSINSTANCE i
+WHERE i.END_ IS NOT NULL</property>
+ <xml-property name="designerValues"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<model:DesignValues xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design" xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
+ <Version>1.0</Version>
+ <design:ResultSets derivedMetaData="true">
+ <design:resultSetDefinitions>
+ <design:resultSetColumns>
+ <design:resultColumnDefinitions>
+ <design:attributes>
+ <design:name>total</design:name>
+ <design:position>1</design:position>
+ <design:nativeDataTypeCode>-5</design:nativeDataTypeCode>
+ <design:precision>21</design:precision>
+ <design:scale>0</design:scale>
+ <design:nullability>NotNullable</design:nullability>
+ <design:uiHints>
+ <design:displayName>total</design:displayName>
+ </design:uiHints>
+ </design:attributes>
+ <design:usageHints>
+ <design:label>total</design:label>
+ <design:formattingHints>
+ <design:displaySize>21</design:displaySize>
+ </design:formattingHints>
+ </design:usageHints>
+ </design:resultColumnDefinitions>
+ </design:resultSetColumns>
+ </design:resultSetDefinitions>
+ </design:ResultSets>
+</model:DesignValues>]]></xml-property>
+ </oda-data-set>
+ <oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="ProcessDefinitions" id="224">
+ <list-property name="columnHints">
+ <structure>
+ <property name="columnName">ID_</property>
+ <property name="displayName">ID_</property>
+ </structure>
+ <structure>
+ <property name="columnName">NAME_</property>
+ <property name="displayName">NAME_</property>
+ </structure>
+ </list-property>
+ <structure name="cachedMetaData">
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">ID_</property>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="position">2</property>
+ <property name="name">NAME_</property>
+ <property name="dataType">string</property>
+ </structure>
+ </list-property>
+ </structure>
+ <property name="dataSource">MySQL Local</property>
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">ID_</property>
+ <property name="nativeName">ID_</property>
+ <property name="dataType">decimal</property>
+ <property name="nativeDataType">-5</property>
+ </structure>
+ <structure>
+ <property name="position">2</property>
+ <property name="name">NAME_</property>
+ <property name="nativeName">NAME_</property>
+ <property name="dataType">string</property>
+ <property name="nativeDataType">12</property>
+ </structure>
+ </list-property>
+ <property name="queryText">select ID_, NAME_
+from JBPM_PROCESSDEFINITION
+</property>
+ </oda-data-set>
+ <oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="TimeDistributionDefinition" id="261">
+ <list-property name="computedColumns">
+ <structure>
+ <property name="name">weekAgo</property>
+ <expression name="expression">DateTimeSpan.subTime(row["start"],168,0)</expression>
+ <property name="dataType">date</property>
+ <property name="aggregateFunction">MAX</property>
+ </structure>
+ <structure>
+ <property name="name">included</property>
+ <expression name="expression">BirtComp.greaterOrEqual(row["start"], row["weekAgo"])</expression>
+ <property name="dataType">boolean</property>
+ </structure>
+ </list-property>
+ <list-property name="columnHints">
+ <structure>
+ <property name="columnName">start</property>
+ <property name="displayName">start</property>
+ </structure>
+ <structure>
+ <property name="columnName">end</property>
+ <property name="displayName">end</property>
+ </structure>
+ <structure>
+ <property name="columnName">instanceID</property>
+ <property name="displayName">instanceID</property>
+ </structure>
+ <structure>
+ <property name="columnName">NAME_</property>
+ <property name="displayName">NAME_</property>
+ </structure>
+ </list-property>
+ <structure name="cachedMetaData">
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">start</property>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="position">2</property>
+ <property name="name">end</property>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="position">3</property>
+ <property name="name">instanceID</property>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="position">4</property>
+ <property name="name">NAME_</property>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="position">5</property>
+ <property name="name">weekAgo</property>
+ <property name="dataType">date</property>
+ </structure>
+ <structure>
+ <property name="position">6</property>
+ <property name="name">included</property>
+ <property name="dataType">boolean</property>
+ </structure>
+ </list-property>
+ </structure>
+ <property name="dataSource">MySQL Local</property>
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">start</property>
+ <property name="nativeName">start</property>
+ <property name="dataType">date-time</property>
+ <property name="nativeDataType">93</property>
+ </structure>
+ <structure>
+ <property name="position">2</property>
+ <property name="name">end</property>
+ <property name="nativeName">end</property>
+ <property name="dataType">date-time</property>
+ <property name="nativeDataType">93</property>
+ </structure>
+ <structure>
+ <property name="position">3</property>
+ <property name="name">instanceID</property>
+ <property name="nativeName">instanceID</property>
+ <property name="dataType">decimal</property>
+ <property name="nativeDataType">-5</property>
+ </structure>
+ <structure>
+ <property name="position">4</property>
+ <property name="name">NAME_</property>
+ <property name="nativeName">NAME_</property>
+ <property name="dataType">string</property>
+ <property name="nativeDataType">12</property>
+ </structure>
+ </list-property>
+ <property name="queryText">SELECT l1.DATE_ as start, l2.DATE_ as end, i.ID_ as instanceID, p.NAME_
+ FROM JBPM_LOG l1, JBPM_LOG l2, JBPM_TOKEN t, JBPM_PROCESSINSTANCE i, JBPM_PROCESSDEFINITION p
+WHERE (l1.CLASS_='I' AND l2.CLASS_='X')
+AND (l1.TOKEN_=l2.TOKEN_)
+AND t.ID_=l1.TOKEN_
+AND t.PROCESSINSTANCE_=i.ID_
+AND i.PROCESSDEFINITION_=p.ID_
+ORDER BY start</property>
+ </oda-data-set>
+ </data-sets>
+ <styles>
+ <style name="crosstab" id="4">
+ <property name="borderBottomColor">#CCCCCC</property>
+ <property name="borderBottomStyle">solid</property>
+ <property name="borderBottomWidth">1pt</property>
+ <property name="borderLeftColor">#CCCCCC</property>
+ <property name="borderLeftStyle">solid</property>
+ <property name="borderLeftWidth">1pt</property>
+ <property name="borderRightColor">#CCCCCC</property>
+ <property name="borderRightStyle">solid</property>
+ <property name="borderRightWidth">1pt</property>
+ <property name="borderTopColor">#CCCCCC</property>
+ <property name="borderTopStyle">solid</property>
+ <property name="borderTopWidth">1pt</property>
+ </style>
+ <style name="crosstab-cell" id="5">
+ <property name="borderBottomColor">#CCCCCC</property>
+ <property name="borderBottomStyle">solid</property>
+ <property name="borderBottomWidth">1pt</property>
+ <property name="borderLeftColor">#CCCCCC</property>
+ <property name="borderLeftStyle">solid</property>
+ <property name="borderLeftWidth">1pt</property>
+ <property name="borderRightColor">#CCCCCC</property>
+ <property name="borderRightStyle">solid</property>
+ <property name="borderRightWidth">1pt</property>
+ <property name="borderTopColor">#CCCCCC</property>
+ <property name="borderTopStyle">solid</property>
+ <property name="borderTopWidth">1pt</property>
+ </style>
+ </styles>
+ <page-setup>
+ <simple-master-page name="âSimple MasterPage" id="2">
+ <property name="type">a4</property>
+ <property name="orientation">portrait</property>
+ </simple-master-page>
+ </page-setup>
+ <body>
+ <table id="338">
+ <property name="marginTop">10px</property>
+ <property name="marginLeft">10px</property>
+ <property name="width">620px</property>
+ <column id="351"/>
+ <column id="352"/>
+ <detail>
+ <row id="354">
+ <cell id="355">
+ <text id="357">
+ <property name="fontFamily">sans-serif</property>
+ <property name="fontWeight">bold</property>
+ <property name="marginTop">0pt</property>
+ <property name="marginLeft">20px</property>
+ <property name="contentType">auto</property>
+ <text-property name="content"><![CDATA[Most active processes]]></text-property>
+ </text>
+ </cell>
+ <cell id="356">
+ <text id="358">
+ <property name="fontFamily">sans-serif</property>
+ <property name="fontWeight">bold</property>
+ <property name="marginTop">0pt</property>
+ <property name="contentType">auto</property>
+ <text-property name="content"><![CDATA[Process workload]]></text-property>
+ </text>
+ </cell>
+ </row>
+ <row id="343">
+ <cell id="344">
+ <extended-item extensionName="Chart" name="MostActiveProcess" id="54">
+ <xml-property name="xmlRepresentation"><![CDATA[<model:ChartWithAxes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:attribute="http://www.birt.eclipse.org/ChartModelAttribute" xmlns:data="http://www.birt.eclipse.org/ChartModelData" xmlns:layout="http://www.birt.eclipse.org/ChartModelLayout" xmlns:model="http://www.birt.eclipse.org/ChartModel" xmlns:type="http://www.birt.eclipse.org/ChartModelType">
+ <Type>Bar Chart</Type>
+ <SubType>Side-by-side</SubType>
+ <Block>
+ <Children xsi:type="layout:TitleBlock">
+ <Bounds>
+ <Left>0.0</Left>
+ <Top>0.0</Top>
+ <Width>0.0</Width>
+ <Height>0.0</Height>
+ </Bounds>
+ <Anchor>North</Anchor>
+ <Stretch>Horizontal</Stretch>
+ <Insets>
+ <Top>3.0</Top>
+ <Left>3.0</Left>
+ <Bottom>3.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Row>-1</Row>
+ <Column>-1</Column>
+ <Rowspan>-1</Rowspan>
+ <Columnspan>-1</Columnspan>
+ <Outline>
+ <Style>Dotted</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Visible>false</Visible>
+ <Label>
+ <Caption>
+ <Value>Most active processes</Value>
+ <Font>
+ <Name>Helvetica</Name>
+ <Size>12.0</Size>
+ <Bold>true</Bold>
+ <Alignment>
+ <horizontalAlignment>Center</horizontalAlignment>
+ <verticalAlignment>Center</verticalAlignment>
+ </Alignment>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <ShadowColor>
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </ShadowColor>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>true</Visible>
+ </Label>
+ </Children>
+ <Children xsi:type="layout:Plot">
+ <Bounds>
+ <Left>0.0</Left>
+ <Top>0.0</Top>
+ <Width>0.0</Width>
+ <Height>0.0</Height>
+ </Bounds>
+ <Insets>
+ <Top>3.0</Top>
+ <Left>3.0</Left>
+ <Bottom>3.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Row>-1</Row>
+ <Column>-1</Column>
+ <Rowspan>-1</Rowspan>
+ <Columnspan>-1</Columnspan>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Visible>true</Visible>
+ <HorizontalSpacing>5</HorizontalSpacing>
+ <VerticalSpacing>5</VerticalSpacing>
+ <ClientArea>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>0</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>0.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>0.0</Right>
+ </Insets>
+ </ClientArea>
+ </Children>
+ <Children xsi:type="layout:Legend">
+ <Bounds>
+ <Left>0.0</Left>
+ <Top>0.0</Top>
+ <Width>0.0</Width>
+ <Height>0.0</Height>
+ </Bounds>
+ <Insets>
+ <Top>3.0</Top>
+ <Left>3.0</Left>
+ <Bottom>3.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Row>-1</Row>
+ <Column>-1</Column>
+ <Rowspan>-1</Rowspan>
+ <Columnspan>-1</Columnspan>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Visible>false</Visible>
+ <ClientArea>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>0</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>2.0</Top>
+ <Left>2.0</Left>
+ <Bottom>2.0</Bottom>
+ <Right>2.0</Right>
+ </Insets>
+ </ClientArea>
+ <Text>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Text>
+ <Orientation>Vertical</Orientation>
+ <Direction>Top_Bottom</Direction>
+ <Separator>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </Separator>
+ <Position>Right</Position>
+ <ItemType>Series</ItemType>
+ <Title>
+ <Caption>
+ <Value>Name</Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>true</Visible>
+ </Title>
+ <TitlePosition>Above</TitlePosition>
+ <ShowValue>false</ShowValue>
+ </Children>
+ <Bounds>
+ <Left>0.0</Left>
+ <Top>0.0</Top>
+ <Width>220.0</Width>
+ <Height>120.0</Height>
+ </Bounds>
+ <Insets>
+ <Top>3.0</Top>
+ <Left>3.0</Left>
+ <Bottom>3.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Row>-1</Row>
+ <Column>-1</Column>
+ <Rowspan>-1</Rowspan>
+ <Columnspan>-1</Columnspan>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Visible>true</Visible>
+ </Block>
+ <Dimension>Two_Dimensional</Dimension>
+ <Units>Points</Units>
+ <SeriesThickness>10.0</SeriesThickness>
+ <SampleData>
+ <BaseSampleData>
+ <DataSetRepresentation>A, B, C</DataSetRepresentation>
+ </BaseSampleData>
+ <OrthogonalSampleData>
+ <DataSetRepresentation>5.0,4.0,12.0</DataSetRepresentation>
+ <SeriesDefinitionIndex>0</SeriesDefinitionIndex>
+ </OrthogonalSampleData>
+ <AncillarySampleData>
+ <DataSetRepresentation>Series 1</DataSetRepresentation>
+ </AncillarySampleData>
+ </SampleData>
+ <Interactivity/>
+ <Axes>
+ <Type>Text</Type>
+ <Title>
+ <Caption>
+ <Value>X-Axis Title</Value>
+ <Font>
+ <Size>14.0</Size>
+ <Bold>true</Bold>
+ <Alignment>
+ <horizontalAlignment>Center</horizontalAlignment>
+ <verticalAlignment>Center</verticalAlignment>
+ </Alignment>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Title>
+ <TitlePosition>Below</TitlePosition>
+ <AssociatedAxes>
+ <Type>Logarithmic</Type>
+ <Title>
+ <Caption>
+ <Value>Y-Axis Title</Value>
+ <Font>
+ <Size>14.0</Size>
+ <Bold>true</Bold>
+ <Alignment>
+ <horizontalAlignment>Center</horizontalAlignment>
+ <verticalAlignment>Center</verticalAlignment>
+ </Alignment>
+ <Rotation>90.0</Rotation>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Title>
+ <TitlePosition>Left</TitlePosition>
+ <SeriesDefinitions>
+ <Query>
+ <Definition></Definition>
+ </Query>
+ <SeriesPalette>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>80</Red>
+ <Green>166</Green>
+ <Blue>218</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>242</Red>
+ <Green>88</Green>
+ <Blue>106</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>232</Red>
+ <Green>172</Green>
+ <Blue>57</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>255</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>64</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>170</Red>
+ <Green>85</Green>
+ <Blue>85</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>192</Red>
+ <Green>192</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>192</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>7</Red>
+ <Green>146</Green>
+ <Blue>94</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>128</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>0</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>64</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>80</Red>
+ <Green>240</Green>
+ <Blue>120</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>64</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>0</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>0</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>64</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>0</Blue>
+ </Entries>
+ </SeriesPalette>
+ <Series xsi:type="type:BarSeries">
+ <Visible>true</Visible>
+ <Label>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Label>
+ <DataDefinition>
+ <Definition>row["numberExec"]</Definition>
+ </DataDefinition>
+ <SeriesIdentifier></SeriesIdentifier>
+ <DataPoint>
+ <Components>
+ <Type>Orthogonal_Value</Type>
+ </Components>
+ <Separator>, </Separator>
+ </DataPoint>
+ <LabelPosition>Outside</LabelPosition>
+ <Stacked>false</Stacked>
+ <Riser>Rectangle</Riser>
+ </Series>
+ <Grouping>
+ <Enabled>false</Enabled>
+ <GroupingInterval>2</GroupingInterval>
+ <GroupType>Text</GroupType>
+ <AggregateExpression>Sum</AggregateExpression>
+ </Grouping>
+ <Sorting>Ascending</Sorting>
+ </SeriesDefinitions>
+ <Orientation>Vertical</Orientation>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </LineAttributes>
+ <Label>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Label>
+ <LabelPosition>Left</LabelPosition>
+ <MajorGrid>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>196</Red>
+ <Green>196</Green>
+ <Blue>196</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </LineAttributes>
+ <TickStyle>Across</TickStyle>
+ <TickAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>196</Red>
+ <Green>196</Green>
+ <Blue>196</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </TickAttributes>
+ </MajorGrid>
+ <MinorGrid>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>225</Red>
+ <Green>225</Green>
+ <Blue>225</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </LineAttributes>
+ <TickStyle>Across</TickStyle>
+ <TickAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>225</Red>
+ <Green>225</Green>
+ <Blue>225</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </TickAttributes>
+ </MinorGrid>
+ <Scale>
+ <MinorGridsPerUnit>5</MinorGridsPerUnit>
+ <ShowOutside>false</ShowOutside>
+ </Scale>
+ <Origin>
+ <Type>Min</Type>
+ <Value xsi:type="data:NumberDataElement">
+ <Value>0.0</Value>
+ </Value>
+ </Origin>
+ <PrimaryAxis>true</PrimaryAxis>
+ <Percent>false</Percent>
+ </AssociatedAxes>
+ <AncillaryAxes>
+ <Type>Text</Type>
+ <Title>
+ <Caption>
+ <Value>Z-Axis Title</Value>
+ <Font>
+ <Size>14.0</Size>
+ <Bold>true</Bold>
+ <Alignment>
+ <horizontalAlignment>Center</horizontalAlignment>
+ <verticalAlignment>Center</verticalAlignment>
+ </Alignment>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Title>
+ <TitlePosition>Below</TitlePosition>
+ <SeriesDefinitions>
+ <Query>
+ <Definition></Definition>
+ </Query>
+ <SeriesPalette>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>80</Red>
+ <Green>166</Green>
+ <Blue>218</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>242</Red>
+ <Green>88</Green>
+ <Blue>106</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>232</Red>
+ <Green>172</Green>
+ <Blue>57</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>255</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>64</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>170</Red>
+ <Green>85</Green>
+ <Blue>85</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>192</Red>
+ <Green>192</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>192</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>7</Red>
+ <Green>146</Green>
+ <Blue>94</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>128</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>0</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>64</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>80</Red>
+ <Green>240</Green>
+ <Blue>120</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>64</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>0</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>0</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>64</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>0</Blue>
+ </Entries>
+ </SeriesPalette>
+ <Series>
+ <Visible>true</Visible>
+ <Label>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Label>
+ <SeriesIdentifier></SeriesIdentifier>
+ <DataPoint>
+ <Components>
+ <Type>Orthogonal_Value</Type>
+ </Components>
+ <Separator>, </Separator>
+ </DataPoint>
+ <LabelPosition>Outside</LabelPosition>
+ <Stacked>false</Stacked>
+ </Series>
+ <Grouping>
+ <Enabled>false</Enabled>
+ <GroupingInterval>2</GroupingInterval>
+ <GroupType>Text</GroupType>
+ <AggregateExpression>Sum</AggregateExpression>
+ </Grouping>
+ </SeriesDefinitions>
+ <Orientation>Horizontal</Orientation>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </LineAttributes>
+ <Label>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>true</Visible>
+ </Label>
+ <LabelPosition>Below</LabelPosition>
+ <MajorGrid>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>196</Red>
+ <Green>196</Green>
+ <Blue>196</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </LineAttributes>
+ <TickStyle>Across</TickStyle>
+ <TickAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>196</Red>
+ <Green>196</Green>
+ <Blue>196</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </TickAttributes>
+ </MajorGrid>
+ <MinorGrid>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>225</Red>
+ <Green>225</Green>
+ <Blue>225</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </LineAttributes>
+ <TickStyle>Across</TickStyle>
+ <TickAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>225</Red>
+ <Green>225</Green>
+ <Blue>225</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </TickAttributes>
+ </MinorGrid>
+ <Scale>
+ <MinorGridsPerUnit>5</MinorGridsPerUnit>
+ </Scale>
+ <Origin>
+ <Type>Min</Type>
+ <Value xsi:type="data:NumberDataElement">
+ <Value>0.0</Value>
+ </Value>
+ </Origin>
+ <PrimaryAxis>true</PrimaryAxis>
+ <Percent>false</Percent>
+ </AncillaryAxes>
+ <SeriesDefinitions>
+ <Query>
+ <Definition></Definition>
+ </Query>
+ <SeriesPalette>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>80</Red>
+ <Green>166</Green>
+ <Blue>218</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>242</Red>
+ <Green>88</Green>
+ <Blue>106</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>232</Red>
+ <Green>172</Green>
+ <Blue>57</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>255</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>64</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>170</Red>
+ <Green>85</Green>
+ <Blue>85</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>192</Red>
+ <Green>192</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>192</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>7</Red>
+ <Green>146</Green>
+ <Blue>94</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>128</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>0</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>64</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>80</Red>
+ <Green>240</Green>
+ <Blue>120</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>64</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>0</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>0</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>64</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>0</Blue>
+ </Entries>
+ </SeriesPalette>
+ <Series>
+ <Visible>true</Visible>
+ <Label>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Label>
+ <DataDefinition>
+ <Definition>row["NAME_"]</Definition>
+ </DataDefinition>
+ <SeriesIdentifier></SeriesIdentifier>
+ <DataPoint>
+ <Components>
+ <Type>Orthogonal_Value</Type>
+ </Components>
+ <Separator>, </Separator>
+ </DataPoint>
+ <LabelPosition>Outside</LabelPosition>
+ <Stacked>false</Stacked>
+ </Series>
+ <Grouping>
+ <Enabled>false</Enabled>
+ <GroupingInterval>2</GroupingInterval>
+ <GroupType>Text</GroupType>
+ <AggregateExpression>Sum</AggregateExpression>
+ </Grouping>
+ </SeriesDefinitions>
+ <Orientation>Horizontal</Orientation>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </LineAttributes>
+ <Label>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Name>Helvetica</Name>
+ <Size>8.0</Size>
+ <Alignment/>
+ <Rotation>0.0</Rotation>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>true</Visible>
+ </Label>
+ <LabelPosition>Below</LabelPosition>
+ <Staggered>false</Staggered>
+ <MajorGrid>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>196</Red>
+ <Green>196</Green>
+ <Blue>196</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </LineAttributes>
+ <TickStyle>Across</TickStyle>
+ <TickAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>196</Red>
+ <Green>196</Green>
+ <Blue>196</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </TickAttributes>
+ </MajorGrid>
+ <MinorGrid>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>225</Red>
+ <Green>225</Green>
+ <Blue>225</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </LineAttributes>
+ <TickStyle>Across</TickStyle>
+ <TickAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>225</Red>
+ <Green>225</Green>
+ <Blue>225</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </TickAttributes>
+ </MinorGrid>
+ <Scale>
+ <MinorGridsPerUnit>5</MinorGridsPerUnit>
+ <ShowOutside>false</ShowOutside>
+ </Scale>
+ <Origin>
+ <Type>Min</Type>
+ <Value xsi:type="data:NumberDataElement">
+ <Value>0.0</Value>
+ </Value>
+ </Origin>
+ <PrimaryAxis>true</PrimaryAxis>
+ <CategoryAxis>true</CategoryAxis>
+ <Percent>false</Percent>
+ </Axes>
+ <Orientation>Horizontal</Orientation>
+ <UnitSpacing>50.0</UnitSpacing>
+ <Rotation>
+ <Angles>
+ <XAngle>-20.0</XAngle>
+ <YAngle>45.0</YAngle>
+ <ZAngle>0.0</ZAngle>
+ <Type>None</Type>
+ </Angles>
+ </Rotation>
+</model:ChartWithAxes>
+]]></xml-property>
+ <property name="outputFormat">JPG</property>
+ <property name="fontSize">smaller</property>
+ <property name="marginTop">10pt</property>
+ <property name="dataSet">ProcessActivity</property>
+ <property name="height">120px</property>
+ <property name="width">220px</property>
+ <list-property name="boundDataColumns">
+ <structure>
+ <property name="name">numberExec</property>
+ <expression name="expression">dataSetRow["numberExec"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">NAME_</property>
+ <expression name="expression">dataSetRow["NAME_"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ </list-property>
+ </extended-item>
+ </cell>
+ <cell id="345">
+ <table id="273">
+ <property name="marginTop">10px</property>
+ <property name="width">100%</property>
+ <property name="dataSet">TotalDefinitions</property>
+ <list-property name="boundDataColumns">
+ <structure>
+ <property name="name">count(ID_)</property>
+ <expression name="expression">dataSetRow["count(ID_)"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">Column Binding</property>
+ <property name="displayName">Number definitions</property>
+ <expression name="expression">row["count(ID_)"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ </list-property>
+ <column id="286"/>
+ <column id="287"/>
+ <detail>
+ <row id="278">
+ <cell id="279">
+ <text id="290">
+ <property name="fontFamily">sans-serif</property>
+ <property name="fontSize">small</property>
+ <property name="contentType">auto</property>
+ <text-property name="content"><![CDATA[Process definitions:]]></text-property>
+ </text>
+ </cell>
+ <cell id="280">
+ <data id="289">
+ <property name="paddingTop">1pt</property>
+ <property name="resultSetColumn">Column Binding</property>
+ </data>
+ </cell>
+ </row>
+ </detail>
+ </table>
+ <table id="302">
+ <property name="width">100%</property>
+ <property name="dataSet">RunningInstances</property>
+ <list-property name="boundDataColumns">
+ <structure>
+ <property name="name">total</property>
+ <expression name="expression">dataSetRow["total"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">Column Binding</property>
+ <expression name="expression">row["total"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ </list-property>
+ <column id="315"/>
+ <column id="316"/>
+ <detail>
+ <row id="307">
+ <cell id="308">
+ <text id="318">
+ <property name="fontFamily">sans-serif</property>
+ <property name="fontSize">small</property>
+ <property name="contentType">auto</property>
+ <text-property name="content"><![CDATA[Running instances:]]></text-property>
+ </text>
+ </cell>
+ <cell id="309">
+ <data id="319">
+ <property name="resultSetColumn">Column Binding</property>
+ </data>
+ </cell>
+ </row>
+ </detail>
+ </table>
+ <table id="320">
+ <property name="width">100%</property>
+ <property name="dataSet">CompletedInstances</property>
+ <list-property name="boundDataColumns">
+ <structure>
+ <property name="name">total</property>
+ <expression name="expression">dataSetRow["total"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">Column Binding</property>
+ <expression name="expression">row["total"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ </list-property>
+ <column id="333"/>
+ <column id="334"/>
+ <detail>
+ <row id="325">
+ <cell id="326">
+ <text id="336">
+ <property name="fontFamily">sans-serif</property>
+ <property name="fontSize">small</property>
+ <property name="contentType">auto</property>
+ <text-property name="content"><![CDATA[Completed instances:]]></text-property>
+ </text>
+ </cell>
+ <cell id="327">
+ <data id="337">
+ <property name="resultSetColumn">Column Binding</property>
+ </data>
+ </cell>
+ </row>
+ </detail>
+ </table>
+ <table id="361">
+ <property name="width">100%</property>
+ <column id="371"/>
+ <column id="372"/>
+ <header>
+ <row id="362">
+ <cell id="363">
+ <text id="359">
+ <property name="fontFamily">sans-serif</property>
+ <property name="fontWeight">bold</property>
+ <property name="marginTop">0pt</property>
+ <property name="paddingTop">10px</property>
+ <property name="contentType">auto</property>
+ <text-property name="content"><![CDATA[Report information]]></text-property>
+ </text>
+ </cell>
+ <cell id="364"/>
+ </row>
+ </header>
+ <detail>
+ <row id="365">
+ <cell id="366">
+ <text id="360">
+ <property name="fontFamily">sans-serif</property>
+ <property name="fontSize">small</property>
+ <property name="paddingTop">1pt</property>
+ <property name="contentType">html</property>
+ <text-property name="content"><![CDATA[Created: <value-of>new Date()</value-of>]]></text-property>
+ </text>
+ </cell>
+ <cell id="367"/>
+ </row>
+ </detail>
+ </table>
+ </cell>
+ </row>
+ </detail>
+ </table>
+ </body>
+</report>
Added: bpm-console/trunk/server/server-core/src/main/resources/task_report.rptdesign
===================================================================
--- bpm-console/trunk/server/server-core/src/main/resources/task_report.rptdesign (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/resources/task_report.rptdesign 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,1277 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.15" id="1">
+ <property name="createdBy">Eclipse BIRT Designer Version 2.2.2.r222_v20071226 Build <2.2.2.v20080226-1155></property>
+ <property name="units">in</property>
+ <property name="comments">Copyright (c) 2007 <<Your Company Name here>></property>
+ <html-property name="description">Creates a blank report with no predefined content.</html-property>
+ <text-property name="displayName">Blank Report</text-property>
+ <property name="iconFile">/templates/blank_report.gif</property>
+ <data-sources>
+ <oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="MySQL Local" id="6">
+ <property name="odaDriverClass">com.mysql.jdbc.Driver</property>
+ <property name="odaURL">jdbc:mysql://localhost:3306/jbpmtest</property>
+ <property name="odaUser">jbpmtest</property>
+ </oda-data-source>
+ </data-sources>
+ <data-sets>
+ <oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="NumberOfAssignments" id="67">
+ <list-property name="columnHints">
+ <structure>
+ <property name="columnName">count(TASKINSTANCE_)</property>
+ <property name="displayName">count(TASKINSTANCE_)</property>
+ </structure>
+ <structure>
+ <property name="columnName">TASKACTORID_</property>
+ <property name="displayName">TASKACTORID_</property>
+ </structure>
+ </list-property>
+ <structure name="cachedMetaData">
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">count(TASKINSTANCE_)</property>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="position">2</property>
+ <property name="name">TASKACTORID_</property>
+ <property name="dataType">string</property>
+ </structure>
+ </list-property>
+ </structure>
+ <property name="dataSource">MySQL Local</property>
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">count(TASKINSTANCE_)</property>
+ <property name="nativeName">count(TASKINSTANCE_)</property>
+ <property name="dataType">decimal</property>
+ <property name="nativeDataType">-5</property>
+ </structure>
+ <structure>
+ <property name="position">2</property>
+ <property name="name">TASKACTORID_</property>
+ <property name="nativeName">TASKACTORID_</property>
+ <property name="dataType">string</property>
+ <property name="nativeDataType">12</property>
+ </structure>
+ </list-property>
+ <property name="queryText">select count(TASKINSTANCE_), TASKACTORID_ from JBPM_LOG where CLASS_='2'
+GROUP BY TASKACTORID_</property>
+ <xml-property name="designerValues"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<model:DesignValues xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design" xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
+ <Version>1.0</Version>
+ <design:ResultSets derivedMetaData="true">
+ <design:resultSetDefinitions>
+ <design:resultSetColumns>
+ <design:resultColumnDefinitions>
+ <design:attributes>
+ <design:name>count(TASKINSTANCE_)</design:name>
+ <design:position>1</design:position>
+ <design:nativeDataTypeCode>-5</design:nativeDataTypeCode>
+ <design:precision>21</design:precision>
+ <design:scale>0</design:scale>
+ <design:nullability>NotNullable</design:nullability>
+ <design:uiHints>
+ <design:displayName>count(TASKINSTANCE_)</design:displayName>
+ </design:uiHints>
+ </design:attributes>
+ <design:usageHints>
+ <design:label>count(TASKINSTANCE_)</design:label>
+ <design:formattingHints>
+ <design:displaySize>21</design:displaySize>
+ </design:formattingHints>
+ </design:usageHints>
+ </design:resultColumnDefinitions>
+ <design:resultColumnDefinitions>
+ <design:attributes>
+ <design:name>TASKACTORID_</design:name>
+ <design:position>2</design:position>
+ <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
+ <design:precision>255</design:precision>
+ <design:scale>0</design:scale>
+ <design:nullability>Nullable</design:nullability>
+ <design:uiHints>
+ <design:displayName>TASKACTORID_</design:displayName>
+ </design:uiHints>
+ </design:attributes>
+ <design:usageHints>
+ <design:label>TASKACTORID_</design:label>
+ <design:formattingHints>
+ <design:displaySize>255</design:displaySize>
+ </design:formattingHints>
+ </design:usageHints>
+ </design:resultColumnDefinitions>
+ </design:resultSetColumns>
+ </design:resultSetDefinitions>
+ </design:ResultSets>
+</model:DesignValues>]]></xml-property>
+ </oda-data-set>
+ </data-sets>
+ <styles>
+ <style name="crosstab" id="4">
+ <property name="borderBottomColor">#CCCCCC</property>
+ <property name="borderBottomStyle">solid</property>
+ <property name="borderBottomWidth">1pt</property>
+ <property name="borderLeftColor">#CCCCCC</property>
+ <property name="borderLeftStyle">solid</property>
+ <property name="borderLeftWidth">1pt</property>
+ <property name="borderRightColor">#CCCCCC</property>
+ <property name="borderRightStyle">solid</property>
+ <property name="borderRightWidth">1pt</property>
+ <property name="borderTopColor">#CCCCCC</property>
+ <property name="borderTopStyle">solid</property>
+ <property name="borderTopWidth">1pt</property>
+ </style>
+ <style name="crosstab-cell" id="5">
+ <property name="borderBottomColor">#CCCCCC</property>
+ <property name="borderBottomStyle">solid</property>
+ <property name="borderBottomWidth">1pt</property>
+ <property name="borderLeftColor">#CCCCCC</property>
+ <property name="borderLeftStyle">solid</property>
+ <property name="borderLeftWidth">1pt</property>
+ <property name="borderRightColor">#CCCCCC</property>
+ <property name="borderRightStyle">solid</property>
+ <property name="borderRightWidth">1pt</property>
+ <property name="borderTopColor">#CCCCCC</property>
+ <property name="borderTopStyle">solid</property>
+ <property name="borderTopWidth">1pt</property>
+ </style>
+ </styles>
+ <page-setup>
+ <simple-master-page name="Simple MasterPage" id="2">
+ <page-footer>
+ <text id="3">
+ <property name="contentType">html</property>
+ <text-property name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property>
+ </text>
+ </page-footer>
+ </simple-master-page>
+ </page-setup>
+ <body>
+ <table id="68">
+ <property name="width">100%</property>
+ <column id="81"/>
+ <column id="82"/>
+ <column id="83"/>
+ <header>
+ <row id="69">
+ <cell id="70"/>
+ <cell id="71"/>
+ <cell id="72"/>
+ </row>
+ </header>
+ <detail>
+ <row id="73">
+ <cell id="74">
+ <extended-item extensionName="Chart" name="CompletedAssignments" id="84">
+ <xml-property name="xmlRepresentation"><![CDATA[<model:ChartWithAxes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:attribute="http://www.birt.eclipse.org/ChartModelAttribute" xmlns:data="http://www.birt.eclipse.org/ChartModelData" xmlns:layout="http://www.birt.eclipse.org/ChartModelLayout" xmlns:model="http://www.birt.eclipse.org/ChartModel" xmlns:type="http://www.birt.eclipse.org/ChartModelType">
+ <Type>Bar Chart</Type>
+ <SubType>Side-by-side</SubType>
+ <Block>
+ <Children xsi:type="layout:TitleBlock">
+ <Bounds>
+ <Left>0.0</Left>
+ <Top>0.0</Top>
+ <Width>0.0</Width>
+ <Height>0.0</Height>
+ </Bounds>
+ <Insets>
+ <Top>3.0</Top>
+ <Left>3.0</Left>
+ <Bottom>3.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Row>-1</Row>
+ <Column>-1</Column>
+ <Rowspan>-1</Rowspan>
+ <Columnspan>-1</Columnspan>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Visible>true</Visible>
+ <Label>
+ <Caption>
+ <Value>Current task assignments</Value>
+ <Font>
+ <Name>Helvetica</Name>
+ <Size>12.0</Size>
+ <Bold>true</Bold>
+ <Alignment>
+ <horizontalAlignment>Center</horizontalAlignment>
+ <verticalAlignment>Center</verticalAlignment>
+ </Alignment>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>true</Visible>
+ </Label>
+ </Children>
+ <Children xsi:type="layout:Plot">
+ <Bounds>
+ <Left>0.0</Left>
+ <Top>0.0</Top>
+ <Width>0.0</Width>
+ <Height>0.0</Height>
+ </Bounds>
+ <Insets>
+ <Top>3.0</Top>
+ <Left>3.0</Left>
+ <Bottom>3.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Row>-1</Row>
+ <Column>-1</Column>
+ <Rowspan>-1</Rowspan>
+ <Columnspan>-1</Columnspan>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Visible>true</Visible>
+ <HorizontalSpacing>5</HorizontalSpacing>
+ <VerticalSpacing>5</VerticalSpacing>
+ <ClientArea>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>0</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>0.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>0.0</Right>
+ </Insets>
+ </ClientArea>
+ </Children>
+ <Children xsi:type="layout:Legend">
+ <Bounds>
+ <Left>0.0</Left>
+ <Top>0.0</Top>
+ <Width>0.0</Width>
+ <Height>0.0</Height>
+ </Bounds>
+ <Insets>
+ <Top>3.0</Top>
+ <Left>3.0</Left>
+ <Bottom>3.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Row>-1</Row>
+ <Column>-1</Column>
+ <Rowspan>-1</Rowspan>
+ <Columnspan>-1</Columnspan>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Visible>false</Visible>
+ <ClientArea>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>0</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>2.0</Top>
+ <Left>2.0</Left>
+ <Bottom>2.0</Bottom>
+ <Right>2.0</Right>
+ </Insets>
+ </ClientArea>
+ <Text>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Text>
+ <Orientation>Vertical</Orientation>
+ <Direction>Top_Bottom</Direction>
+ <Separator>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </Separator>
+ <Position>Right</Position>
+ <ItemType>Series</ItemType>
+ <Title>
+ <Caption>
+ <Value>Assigments</Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Title>
+ <TitlePosition>Above</TitlePosition>
+ <ShowValue>false</ShowValue>
+ </Children>
+ <Bounds>
+ <Left>0.0</Left>
+ <Top>0.0</Top>
+ <Width>220.0</Width>
+ <Height>120.0</Height>
+ </Bounds>
+ <Insets>
+ <Top>3.0</Top>
+ <Left>3.0</Left>
+ <Bottom>3.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Row>-1</Row>
+ <Column>-1</Column>
+ <Rowspan>-1</Rowspan>
+ <Columnspan>-1</Columnspan>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Visible>true</Visible>
+ </Block>
+ <Dimension>Two_Dimensional</Dimension>
+ <Units>Points</Units>
+ <SeriesThickness>10.0</SeriesThickness>
+ <SampleData>
+ <BaseSampleData>
+ <DataSetRepresentation>A, B, C</DataSetRepresentation>
+ </BaseSampleData>
+ <OrthogonalSampleData>
+ <DataSetRepresentation>5.0,4.0,12.0</DataSetRepresentation>
+ <SeriesDefinitionIndex>0</SeriesDefinitionIndex>
+ </OrthogonalSampleData>
+ </SampleData>
+ <Interactivity>
+ <LegendBehavior>None</LegendBehavior>
+ </Interactivity>
+ <Axes>
+ <Type>Text</Type>
+ <Title>
+ <Caption>
+ <Value>X-Axis Title</Value>
+ <Font>
+ <Size>14.0</Size>
+ <Bold>true</Bold>
+ <Alignment>
+ <horizontalAlignment>Center</horizontalAlignment>
+ <verticalAlignment>Center</verticalAlignment>
+ </Alignment>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Title>
+ <TitlePosition>Below</TitlePosition>
+ <AssociatedAxes>
+ <Type>Logarithmic</Type>
+ <Title>
+ <Caption>
+ <Value>Y-Axis Title</Value>
+ <Font>
+ <Size>14.0</Size>
+ <Bold>true</Bold>
+ <Alignment>
+ <horizontalAlignment>Center</horizontalAlignment>
+ <verticalAlignment>Center</verticalAlignment>
+ </Alignment>
+ <Rotation>90.0</Rotation>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Title>
+ <TitlePosition>Left</TitlePosition>
+ <SeriesDefinitions>
+ <Query>
+ <Definition></Definition>
+ </Query>
+ <SeriesPalette>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>80</Red>
+ <Green>166</Green>
+ <Blue>218</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>242</Red>
+ <Green>88</Green>
+ <Blue>106</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>232</Red>
+ <Green>172</Green>
+ <Blue>57</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>255</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>64</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>170</Red>
+ <Green>85</Green>
+ <Blue>85</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>192</Red>
+ <Green>192</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>192</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>7</Red>
+ <Green>146</Green>
+ <Blue>94</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>128</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>0</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>64</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>80</Red>
+ <Green>240</Green>
+ <Blue>120</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>64</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>0</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>0</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>64</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>0</Blue>
+ </Entries>
+ </SeriesPalette>
+ <Series xsi:type="type:BarSeries">
+ <Visible>true</Visible>
+ <Label>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Label>
+ <DataDefinition>
+ <Definition>row["count(TASKINSTANCE_)"]</Definition>
+ </DataDefinition>
+ <SeriesIdentifier></SeriesIdentifier>
+ <DataPoint>
+ <Components>
+ <Type>Orthogonal_Value</Type>
+ </Components>
+ <Separator>, </Separator>
+ </DataPoint>
+ <LabelPosition>Outside</LabelPosition>
+ <Stacked>false</Stacked>
+ <Riser>Rectangle</Riser>
+ </Series>
+ <Grouping>
+ <Enabled>false</Enabled>
+ <GroupingInterval>2</GroupingInterval>
+ <GroupType>Text</GroupType>
+ <AggregateExpression>Sum</AggregateExpression>
+ </Grouping>
+ <Sorting>Ascending</Sorting>
+ </SeriesDefinitions>
+ <Orientation>Vertical</Orientation>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </LineAttributes>
+ <Label>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Label>
+ <LabelPosition>Left</LabelPosition>
+ <MajorGrid>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>196</Red>
+ <Green>196</Green>
+ <Blue>196</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </LineAttributes>
+ <TickStyle>Across</TickStyle>
+ <TickAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>196</Red>
+ <Green>196</Green>
+ <Blue>196</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </TickAttributes>
+ </MajorGrid>
+ <MinorGrid>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>225</Red>
+ <Green>225</Green>
+ <Blue>225</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </LineAttributes>
+ <TickStyle>Across</TickStyle>
+ <TickAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>225</Red>
+ <Green>225</Green>
+ <Blue>225</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </TickAttributes>
+ </MinorGrid>
+ <Scale>
+ <MinorGridsPerUnit>5</MinorGridsPerUnit>
+ </Scale>
+ <Origin>
+ <Type>Min</Type>
+ <Value xsi:type="data:NumberDataElement">
+ <Value>0.0</Value>
+ </Value>
+ </Origin>
+ <PrimaryAxis>true</PrimaryAxis>
+ <Percent>false</Percent>
+ </AssociatedAxes>
+ <SeriesDefinitions>
+ <Query>
+ <Definition></Definition>
+ </Query>
+ <SeriesPalette>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>80</Red>
+ <Green>166</Green>
+ <Blue>218</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>242</Red>
+ <Green>88</Green>
+ <Blue>106</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>232</Red>
+ <Green>172</Green>
+ <Blue>57</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>255</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>64</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>170</Red>
+ <Green>85</Green>
+ <Blue>85</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>192</Red>
+ <Green>192</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>192</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>7</Red>
+ <Green>146</Green>
+ <Blue>94</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>128</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>0</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>64</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>80</Red>
+ <Green>240</Green>
+ <Blue>120</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>64</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>0</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>0</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>64</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>0</Blue>
+ </Entries>
+ </SeriesPalette>
+ <Series>
+ <Visible>true</Visible>
+ <Label>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Label>
+ <DataDefinition>
+ <Definition>row["TASKACTORID_"]</Definition>
+ </DataDefinition>
+ <SeriesIdentifier></SeriesIdentifier>
+ <DataPoint>
+ <Components>
+ <Type>Orthogonal_Value</Type>
+ </Components>
+ <Separator>, </Separator>
+ </DataPoint>
+ <LabelPosition>Outside</LabelPosition>
+ <Stacked>false</Stacked>
+ </Series>
+ <Grouping>
+ <Enabled>false</Enabled>
+ <GroupingInterval>2</GroupingInterval>
+ <GroupType>Text</GroupType>
+ <AggregateExpression>Sum</AggregateExpression>
+ </Grouping>
+ </SeriesDefinitions>
+ <Orientation>Horizontal</Orientation>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </LineAttributes>
+ <Label>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Name>Helvetica</Name>
+ <Size>11.0</Size>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>254</Red>
+ <Green>254</Green>
+ <Blue>254</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>true</Visible>
+ </Label>
+ <LabelPosition>Below</LabelPosition>
+ <MajorGrid>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>196</Red>
+ <Green>196</Green>
+ <Blue>196</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </LineAttributes>
+ <TickStyle>Across</TickStyle>
+ <TickAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>196</Red>
+ <Green>196</Green>
+ <Blue>196</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </TickAttributes>
+ </MajorGrid>
+ <MinorGrid>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>225</Red>
+ <Green>225</Green>
+ <Blue>225</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </LineAttributes>
+ <TickStyle>Across</TickStyle>
+ <TickAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>225</Red>
+ <Green>225</Green>
+ <Blue>225</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </TickAttributes>
+ </MinorGrid>
+ <Scale>
+ <MinorGridsPerUnit>5</MinorGridsPerUnit>
+ </Scale>
+ <Origin>
+ <Type>Min</Type>
+ <Value xsi:type="data:NumberDataElement">
+ <Value>0.0</Value>
+ </Value>
+ </Origin>
+ <PrimaryAxis>true</PrimaryAxis>
+ <CategoryAxis>true</CategoryAxis>
+ <Percent>false</Percent>
+ </Axes>
+ <Orientation>Horizontal</Orientation>
+ <UnitSpacing>50.0</UnitSpacing>
+ <Rotation/>
+</model:ChartWithAxes>
+]]></xml-property>
+ <property name="outputFormat">SVG</property>
+ <property name="fontSize">smaller</property>
+ <property name="marginTop">10pt</property>
+ <property name="dataSet">NumberOfAssignments</property>
+ <property name="height">120px</property>
+ <property name="width">220px</property>
+ <list-property name="boundDataColumns">
+ <structure>
+ <property name="name">count(TASKINSTANCE_)</property>
+ <expression name="expression">dataSetRow["count(TASKINSTANCE_)"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">TASKACTORID_</property>
+ <expression name="expression">dataSetRow["TASKACTORID_"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ </list-property>
+ </extended-item>
+ </cell>
+ <cell id="75"/>
+ <cell id="76"/>
+ </row>
+ </detail>
+ <footer>
+ <row id="77">
+ <cell id="78"/>
+ <cell id="79"/>
+ <cell id="80"/>
+ </row>
+ </footer>
+ </table>
+ </body>
+</report>
Added: bpm-console/trunk/server/server-core/src/main/webapp/WEB-INF/jboss-web.xml
===================================================================
--- bpm-console/trunk/server/server-core/src/main/webapp/WEB-INF/jboss-web.xml (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/webapp/WEB-INF/jboss-web.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC
+ "-//JBoss//DTD Web Application 2.4//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd">
+
+<jboss-web>
+
+ <security-domain>java:/jaas/jbpm-console</security-domain>
+
+ <context-root>gwt-console-server</context-root>
+
+</jboss-web>
Added: bpm-console/trunk/server/server-core/src/main/webapp/WEB-INF/web.xml
===================================================================
--- bpm-console/trunk/server/server-core/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/webapp/WEB-INF/web.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,81 @@
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd" >
+
+<web-app>
+ <display-name>GWT Console Server</display-name>
+
+ <context-param>
+ <param-name>javax.ws.rs.core.Application</param-name>
+ <param-value>org.jboss.bpm.console.server.ConsoleServerApplication</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>resteasy.servlet.mapping.prefix</param-name>
+ <param-value>/rs</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>resteasy.providers</param-name>
+ <param-value>org.jboss.bpm.report.FileWriter</param-value>
+ </context-param>
+
+ <filter>
+ <filter-name>gwtJSON</filter-name>
+ <filter-class>org.jboss.bpm.console.server.util.GWTJsonFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>gwtJSON</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <listener>
+ <listener-class>
+ org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
+ </listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>Resteasy</servlet-name>
+ <servlet-class>
+ org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
+ </servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Resteasy</servlet-name>
+ <url-pattern>/rs/*</url-pattern>
+ </servlet-mapping>
+
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>Resteasy</web-resource-name>
+ <url-pattern>/rs/process/*</url-pattern>
+ <url-pattern>/rs/task/*</url-pattern>
+ <!--url-pattern>/rs/form/*</url-pattern https://jira.jboss.org/jira/browse/JBPM-2229-->
+ <url-pattern>/rs/tasks/*</url-pattern>
+ <url-pattern>/rs/identity/*</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>administrator</role-name>
+ <role-name>manager</role-name>
+ <role-name>user</role-name>
+ </auth-constraint>
+ </security-constraint>
+
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ <realm-name>GWT Console Server</realm-name>
+ </login-config>
+
+ <security-role>
+ <role-name>administrator</role-name>
+ </security-role>
+ <security-role>
+ <role-name>manager</role-name>
+ </security-role>
+ <security-role>
+ <role-name>user</role-name>
+ </security-role>
+
+</web-app>
Added: bpm-console/trunk/server/server-core/src/main/webapp/index.html
===================================================================
--- bpm-console/trunk/server/server-core/src/main/webapp/index.html (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/webapp/index.html 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,20 @@
+<html>
+<body style='font-family: sans-serif; font-size:10pt;'>
+
+<h1>GWT Console Server</h1>
+
+<h2>Published URL's</h2>
+You can find a list of resources <a href="/gwt-console-server/rs/server/resources">here</a>.
+
+<h2>Example usage</h2>
+
+<pre>
+ curl -u "user:password" -H 'Accept: application/json' http://localhost:8080/gwt-console-server/rs/process/definitions
+ curl -H 'Accept: application/json' http://localhost:8080/gwt-console-server/rs/process/definition/1/instances
+</pre>
+
+<h2>Problems?</h2>
+Please post any questions to the <a href="http://www.jboss.org/index.html?module=bb&op=viewforum&f=295">gwt-console developer forum</a>.
+
+</body>
+</html>
\ No newline at end of file
Added: bpm-console/trunk/server/server-core/src/main/webapp/login.html
===================================================================
--- bpm-console/trunk/server/server-core/src/main/webapp/login.html (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/webapp/login.html 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,9 @@
+<html>
+<body>
+<form method="POST" action="j_security_check">
+ User: <input type="text" name="j_username"><br>
+ Password: <input type="password" name="j_password"><br/>
+ <input type="submit"/>
+</form>
+</body>
+</html>
\ No newline at end of file
Added: bpm-console/trunk/server/server-core/src/main/webapp/login_failed.html
===================================================================
--- bpm-console/trunk/server/server-core/src/main/webapp/login_failed.html (rev 0)
+++ bpm-console/trunk/server/server-core/src/main/webapp/login_failed.html 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,5 @@
+<html>
+<body>
+Login failed!
+</body>
+</html>
\ No newline at end of file
Added: bpm-console/trunk/server/server-core/src/test/java/org/jboss/bpm/test/typeconversion/AnnotatedComplexType.java
===================================================================
--- bpm-console/trunk/server/server-core/src/test/java/org/jboss/bpm/test/typeconversion/AnnotatedComplexType.java (rev 0)
+++ bpm-console/trunk/server/server-core/src/test/java/org/jboss/bpm/test/typeconversion/AnnotatedComplexType.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.test.typeconversion;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import java.util.Date;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement()
+ at XmlType(namespace = "http://foo.bar.com", name = "Order")
+public class AnnotatedComplexType
+{
+ @XmlElement(name = "timestamp")
+ long data = new Date().getTime();
+}
Added: bpm-console/trunk/server/server-core/src/test/java/org/jboss/bpm/test/typeconversion/ComplexType.java
===================================================================
--- bpm-console/trunk/server/server-core/src/test/java/org/jboss/bpm/test/typeconversion/ComplexType.java (rev 0)
+++ bpm-console/trunk/server/server-core/src/test/java/org/jboss/bpm/test/typeconversion/ComplexType.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.test.typeconversion;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ComplexType
+{
+ String message;
+
+
+ public ComplexType()
+ {
+ }
+
+ public String getMessage()
+ {
+ return message;
+ }
+
+ public void setMessage(String message)
+ {
+ this.message = message;
+ }
+
+ public ComplexType(String message)
+ {
+ this.message = message;
+ }
+}
Added: bpm-console/trunk/server/server-core/src/test/java/org/jboss/bpm/test/typeconversion/IllegalType.java
===================================================================
--- bpm-console/trunk/server/server-core/src/test/java/org/jboss/bpm/test/typeconversion/IllegalType.java (rev 0)
+++ bpm-console/trunk/server/server-core/src/test/java/org/jboss/bpm/test/typeconversion/IllegalType.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.test.typeconversion;
+
+import java.io.InputStream;
+import java.io.ByteArrayInputStream;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class IllegalType
+{
+ InputStream in = new ByteArrayInputStream("Hwllo World".getBytes());
+}
Added: bpm-console/trunk/server/server-core/src/test/java/org/jboss/bpm/test/typeconversion/TypeConversionTestCase.java
===================================================================
--- bpm-console/trunk/server/server-core/src/test/java/org/jboss/bpm/test/typeconversion/TypeConversionTestCase.java (rev 0)
+++ bpm-console/trunk/server/server-core/src/test/java/org/jboss/bpm/test/typeconversion/TypeConversionTestCase.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.test.typeconversion;
+
+import junit.framework.TestCase;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Date;
+
+import org.jboss.bpm.console.server.util.Payload2XML;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class TypeConversionTestCase extends TestCase
+{
+ public void testComplexTypes() throws Exception
+ {
+ Map<String, Object> javaPayload = new HashMap<String,Object>();
+ javaPayload.put("not annotated", new ComplexType("Hello World"));
+ javaPayload.put("a simple type", "Just a java String");
+ javaPayload.put("a date field", new Date());
+ javaPayload.put("annotation present", new AnnotatedComplexType());
+ javaPayload.put("illegal type", new IllegalType());
+ javaPayload.put("77illegal name % $$ - 1", "Hi There");
+ Payload2XML t = new Payload2XML();
+ System.out.println(t.convert("SampleProcess", javaPayload).toString());
+ }
+
+}
Added: bpm-console/trunk/server/server-integration/pom.xml
===================================================================
--- bpm-console/trunk/server/server-integration/pom.xml (rev 0)
+++ bpm-console/trunk/server/server-integration/pom.xml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,74 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <name>JBoss BPM - GWT Console (Server Integration)</name>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-server-integration</artifactId>
+ <packaging>jar</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-servermodule</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <dependencies>
+ <!-- Module -->
+ <dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-rpc</artifactId>
+ <version>${version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.ejb</groupId>
+ <artifactId>ejb-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.javaee</groupId>
+ <artifactId>jboss-javaee</artifactId>
+ <version>5.0.0.GA</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <!-- Include SOURCE in output artifact for GWT (GWT libraries must include source) -->
+ <resources>
+ <resource>
+ <directory>src/main/java</directory>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ <finalName>gwt-console-server-integration</finalName>
+ </build>
+</project>
Added: bpm-console/trunk/server/server-integration/server-integration.iml
===================================================================
--- bpm-console/trunk/server/server-integration/server-integration.iml (rev 0)
+++ bpm-console/trunk/server/server-integration/server-integration.iml 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <exclude-output />
+ <output-test url="file://$MODULE_DIR$/../../../../../jbpm4/trunk/classes/test/server-integration" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="gwt-rpc" exported="" />
+ <orderEntry type="module" module-name="gwt-parent" />
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.ejb:ejb-api:jar:3.0:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/ejb/ejb-api/3.0/ejb-api-3.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.activation:activation:jar:1.1:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.jboss.javaee:jboss-javaee:jar:5.0.0.GA:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/javaee/jboss-javaee/5.0.0.GA/jboss-javaee-5.0.0.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/javaee/jboss-javaee/5.0.0.GA/jboss-javaee-5.0.0.GA-sources.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/javaee/jboss-javaee/5.0.0.GA/jboss-javaee-5.0.0.GA-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-logging:commons-logging:jar:1.1.1:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+</module>
+
Added: bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ManagementFactory.java
===================================================================
--- bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ManagementFactory.java (rev 0)
+++ bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ManagementFactory.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.integration;
+
+// $Id: $
+
+import org.jboss.bpm.console.server.util.ServiceLoader;
+
+/**
+ * Construct management implementation.
+ * It uses the {@link org.jboss.bpm.console.server.util.ServiceLoader} to load concrete
+ * factory implementations.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ * @author Thomas.Diesler at jboss.com
+ */
+public abstract class ManagementFactory
+{
+ public static ManagementFactory newInstance()
+ {
+ return (ManagementFactory)
+ ServiceLoader.loadService(
+ ManagementFactory.class.getName(),
+ "org.jbpm.integration.console.ManagementFactoryImpl"
+ );
+ }
+
+ public abstract ProcessManagement createProcessManagement();
+
+ public abstract TaskManagement createTaskManagement();
+
+ public abstract UserManagement createUserManagement();
+
+}
Added: bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ProcessManagement.java
===================================================================
--- bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ProcessManagement.java (rev 0)
+++ bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ProcessManagement.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.integration;
+
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+import org.jboss.bpm.console.client.model.ProcessInstanceRef.STATE;
+
+import java.util.List;
+import java.util.Map;
+import java.io.InputStream;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ * @author Thomas.Diesler at jboss.com
+ */
+public interface ProcessManagement
+{
+ List<ProcessDefinitionRef> getProcessDefinitions();
+
+ ProcessDefinitionRef getProcessDefinition(String definitionId);
+
+ List<ProcessDefinitionRef> removeProcessDefinition(String definitionId);
+
+ List<ProcessInstanceRef> getProcessInstances(String definitionId);
+
+ ProcessInstanceRef getProcessInstance(String instanceId);
+
+ ProcessInstanceRef newInstance(String defintionId);
+
+ ProcessInstanceRef newInstance(String definitionId, Map<String, Object> processVars);
+
+ Map<String, Object> getInstanceData(String instanceId);
+
+ void setInstanceData(String instanceId, Map<String, Object> data);
+
+ void endInstance(String instanceId, ProcessInstanceRef.RESULT result);
+
+ void deleteInstance(String instanceId);
+
+ void setProcessState(String instanceId, ProcessInstanceRef.STATE nextState);
+
+ void signalExecution(String executionId, String signal);
+
+}
Added: bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/TaskManagement.java
===================================================================
--- bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/TaskManagement.java (rev 0)
+++ bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/TaskManagement.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.integration;
+
+import org.jboss.bpm.console.client.model.TaskRef;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public interface TaskManagement
+{
+ /**
+ * fetch a single task
+ */
+ TaskRef getTaskById(long taskId);
+
+ /**
+ * assign user to task
+ */
+ void assignTask(long taskId, String idRef, String userId);
+
+ /**
+ * unset a task assignment
+ */
+ void releaseTask(long taskId, String userId);
+
+ /**
+ * complete a task
+ */
+ void completeTask(long taskId, Map data, String userId);
+
+ /**
+ * complete a task with a given outcome (trigger)
+ */
+ void completeTask(long taskId, String outcome, Map data, String userId);
+
+ /**
+ * get tasks assingned to a user
+ */
+ List<TaskRef> getAssignedTasks(String idRef);
+
+ /**
+ * get unassigned tasks where a user participates
+ */
+ List<TaskRef> getUnassignedTasks(String idRef, String participationType);
+}
Added: bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/UserManagement.java
===================================================================
--- bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/UserManagement.java (rev 0)
+++ bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/UserManagement.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.integration;
+
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public interface UserManagement
+{
+ List<String> getGroupsForActor(String actorId);
+
+ List<String> getActorsForGroup(String groupName);
+}
\ No newline at end of file
Added: bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/FormAuthorityRef.java
===================================================================
--- bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/FormAuthorityRef.java (rev 0)
+++ bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/FormAuthorityRef.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.plugin;
+
+/**
+ * Identifies the source entity associated with a form.
+ * I.e. process or task.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class FormAuthorityRef
+{
+ public enum Type {TASK, PROCESS}
+
+ private Type currentType = null;
+
+ private String referenceId;
+
+ public FormAuthorityRef(String referenceId)
+ {
+ this.referenceId = referenceId;
+ this.currentType = Type.TASK;
+ }
+
+ public FormAuthorityRef(String referenceId, Type currentType)
+ {
+ this.currentType = currentType;
+ this.referenceId = referenceId;
+ }
+
+ public Type getType()
+ {
+ return this.currentType;
+ }
+
+ public String getReferenceId()
+ {
+ return referenceId;
+ }
+}
Added: bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/FormDispatcherPlugin.java
===================================================================
--- bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/FormDispatcherPlugin.java (rev 0)
+++ bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/FormDispatcherPlugin.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.plugin;
+
+import javax.activation.DataHandler;
+import java.net.URL;
+import java.util.Map;
+
+/**
+ * Render task UI's and process task completion.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public interface FormDispatcherPlugin
+{
+ URL getDispatchUrl(FormAuthorityRef ref);
+
+ DataHandler provideForm(FormAuthorityRef ref);
+}
Added: bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/GraphViewerPlugin.java
===================================================================
--- bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/GraphViewerPlugin.java (rev 0)
+++ bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/GraphViewerPlugin.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.plugin;
+
+import java.util.List;
+import java.net.URL;
+
+import org.jboss.bpm.console.client.model.ActiveNodeInfo;
+import org.jboss.bpm.console.client.model.DiagramInfo;
+
+/**
+ * Access process graph image and coordinates.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public interface GraphViewerPlugin
+{
+ /**
+ * Check {@link #getDiagramURL(String)} != null before invoking.
+ */
+ byte[] getProcessImage(String processId);
+
+ DiagramInfo getDiagramInfo(String processId);
+
+ List<ActiveNodeInfo> getActiveNodeInfo(String instanceId);
+
+ /**
+ * Can be null, in case no diagram is associated with the process
+ */
+ URL getDiagramURL(String id);
+}
Added: bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/PluginMgr.java
===================================================================
--- bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/PluginMgr.java (rev 0)
+++ bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/PluginMgr.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.plugin;
+
+import org.jboss.bpm.console.server.util.ServiceLoader;
+import org.jboss.bpm.console.server.util.InvocationProxy;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Loads plugins through the {@link org.jboss.bpm.console.server.util.ServiceLoader}.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class PluginMgr
+{
+
+ private static final Log log = LogFactory.getLog(PluginMgr.class);
+
+ /**
+ * Load a plugin through the {@link org.jboss.bpm.console.server.util.ServiceLoader}.
+ * The plugin interface name acts as the service key.
+ *
+ * @param type plugin interface
+ * @return a plugin implementation of type T or null if the plugin is not available.
+ */
+ public static <T> T load(Class<T> type)
+ {
+ T pluginImpl = (T) ServiceLoader.loadService(
+ type.getName(), null
+ );
+
+ if(pluginImpl!=null)
+ {
+ log.info("Successfully loaded plugin '" +type.getName()+ "': "+pluginImpl.getClass());
+ return (T)InvocationProxy.newInstance(pluginImpl);
+ }
+ else
+ {
+ log.warn("Unable to load plugin: '" + type.getName() + "'");
+ return null;
+ }
+ }
+}
Added: bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/ProcessEnginePlugin.java
===================================================================
--- bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/ProcessEnginePlugin.java (rev 0)
+++ bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/ProcessEnginePlugin.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.plugin;
+
+import org.jboss.bpm.console.client.model.DeploymentRef;
+import org.jboss.bpm.console.client.model.JobRef;
+
+import java.util.List;
+
+/**
+ * Manages runtime aspects of the underlying process engine.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public interface ProcessEnginePlugin
+{
+ List<DeploymentRef> getDeployments();
+
+ void deleteDeployment(String id);
+
+ void suspendDeployment(String id, boolean isSuspended);
+
+ List<JobRef> getJobs();
+
+ void executeJob(String jobId);
+}
Added: bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/util/InvocationProxy.java
===================================================================
--- bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/util/InvocationProxy.java (rev 0)
+++ bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/util/InvocationProxy.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.util;
+
+import javax.transaction.UserTransaction;
+import javax.transaction.SystemException;
+import javax.naming.InitialContext;
+import java.lang.reflect.Method;
+
+/**
+ * Decorates process engine invocations with common system aspects, i.e. transaction demarcation.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class InvocationProxy implements java.lang.reflect.InvocationHandler
+{
+ private Object obj;
+
+ public static Object newInstance(Object obj) {
+ return java.lang.reflect.Proxy.newProxyInstance(
+ obj.getClass().getClassLoader(),
+ obj.getClass().getInterfaces(),
+ new InvocationProxy(obj));
+ }
+
+ private InvocationProxy(Object obj) {
+ this.obj = obj;
+ }
+
+ public Object invoke(Object proxy, Method m, Object[] args)
+ throws Throwable
+ {
+ Object result;
+
+ InitialContext ctx = new InitialContext();
+ UserTransaction tx = (UserTransaction)ctx.lookup("UserTransaction");
+
+
+ try
+ {
+ // before method invocation
+ tx.begin();
+
+ // field target invocation
+ result = m.invoke(obj, args);
+
+ tx.commit();
+
+ }
+ catch (Exception e)
+ {
+ if(tx!=null)
+ {
+ try
+ {
+ tx.rollback();
+ }
+ catch (SystemException e1) {}
+ }
+
+ throw new RuntimeException("Unexpected invocation exception: " + e.getMessage(), e);
+
+ }
+ finally
+ {
+ // after method invocation
+
+ }
+
+ return result;
+ }
+}
\ No newline at end of file
Added: bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/util/ServiceLoader.java
===================================================================
--- bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/util/ServiceLoader.java (rev 0)
+++ bpm-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/util/ServiceLoader.java 2009-07-30 09:20:27 UTC (rev 697)
@@ -0,0 +1,246 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.util;
+
+import java.io.*;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.Properties;
+
+/**
+ * Load a service class using a ordered lookup procedure
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @author Heiko.Braun at jboss.com
+ *
+ * @since 14-Dec-2006
+ */
+public abstract class ServiceLoader
+{
+ /**
+ * This method uses the algorithm below using the JAXWS Provider as an example.
+ *
+ * 1. If a resource with the name of META-INF/services/javax.xml.ws.spi.Provider exists, then
+ * its first line, if present, is used as the UTF-8 encoded name of the implementation class.
+ *
+ * 2. If the ${java.home}/lib/service-loader.properties file exists and it is readable by the
+ * java.util.Properties.load(InputStream) method and it contains an entry whose key is
+ * javax.xml.ws.spi.Provider, then the value of that entry is used as the name of the implementation class.
+ *
+ * 3. If a system property with the name javax.xml.ws.spi.Provider is defined, then its value is used
+ * as the name of the implementation class.
+ *
+ * 4. Finally, a default implementation class name is used.
+ */
+ public static Object loadService(String propertyName, String defaultFactory)
+ {
+ Object factory = loadFromServices(propertyName, null);
+ if (factory == null)
+ {
+ factory = loadFromPropertiesFile(propertyName, null);
+ }
+ if (factory == null)
+ {
+ factory = loadFromSystemProperty(propertyName, defaultFactory);
+ }
+ return factory;
+ }
+
+ /** Use the Services API (as detailed in the JAR specification), if available, to determine the classname.
+ */
+ public static Object loadFromServices(String propertyName, String defaultFactory)
+ {
+ Object factory = null;
+ String factoryName = null;
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+
+ // Use the Services API (as detailed in the JAR specification), if available, to determine the classname.
+ String filename = "META-INF/services/" + propertyName;
+ InputStream inStream = loader.getResourceAsStream(filename);
+ if (inStream != null)
+ {
+ try
+ {
+ BufferedReader br = new BufferedReader(new InputStreamReader(inStream, "UTF-8"));
+ factoryName = br.readLine();
+ br.close();
+ if (factoryName != null)
+ {
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
+ }
+ }
+
+ // Use the default factory implementation class.
+ if (factory == null && defaultFactory != null)
+ {
+ factory = loadDefault(defaultFactory);
+ }
+
+ return factory;
+ }
+
+ /** Use the system property
+ */
+ public static Object loadFromSystemProperty(String propertyName, String defaultFactory)
+ {
+ Object factory = null;
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+
+ PrivilegedAction action = new PropertyAccessAction(propertyName);
+ String factoryName = (String)AccessController.doPrivileged(action);
+ if (factoryName != null)
+ {
+ try
+ {
+ //if(log.isDebugEnabled()) log.debug("Load from system property: " + factoryName);
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
+ }
+ }
+
+ // Use the default factory implementation class.
+ if (factory == null && defaultFactory != null)
+ {
+ factory = loadDefault(defaultFactory);
+ }
+
+ return factory;
+ }
+
+ /**
+ * Use the properties file "${java.home}/lib/service-loader.properties" in the JRE directory.
+ * This configuration file is in standard java.util.Properties format and contains the
+ * fully qualified name of the implementation class with the key being the system property defined above.
+ */
+ public static Object loadFromPropertiesFile(String propertyName, String defaultFactory)
+ {
+ Object factory = null;
+ String factoryName = null;
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+
+ // Use the properties file "lib/jaxm.properties" in the JRE directory.
+ // This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above.
+ PrivilegedAction action = new PropertyAccessAction("java.home");
+ String javaHome = (String)AccessController.doPrivileged(action);
+ File jaxmFile = new File(javaHome + "/lib/service-loader.properties");
+ if (jaxmFile.exists())
+ {
+ try
+ {
+ action = new PropertyFileAccessAction(jaxmFile.getCanonicalPath());
+ Properties jaxmProperties = (Properties)AccessController.doPrivileged(action);
+ factoryName = jaxmProperties.getProperty(propertyName);
+ if (factoryName != null)
+ {
+ //if(log.isDebugEnabled()) log.debug("Load from " + jaxmFile + ": " + factoryName);
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
+ }
+ }
+
+ // Use the default factory implementation class.
+ if (factory == null && defaultFactory != null)
+ {
+ factory = loadDefault(defaultFactory);
+ }
+
+ return factory;
+ }
+
+ private static Object loadDefault(String defaultFactory)
+ {
+ Object factory = null;
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+
+ // Use the default factory implementation class.
+ if (defaultFactory != null)
+ {
+ try
+ {
+ //if(log.isDebugEnabled()) log.debug("Load from default: " + factoryName);
+ Class factoryClass = loader.loadClass(defaultFactory);
+ factory = factoryClass.newInstance();
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load: " + defaultFactory, t);
+ }
+ }
+
+ return factory;
+ }
+
+ private static class PropertyAccessAction implements PrivilegedAction
+ {
+ private String name;
+
+ PropertyAccessAction(String name)
+ {
+ this.name = name;
+ }
+
+ public Object run()
+ {
+ return System.getProperty(name);
+ }
+ }
+
+ private static class PropertyFileAccessAction implements PrivilegedAction
+ {
+ private String filename;
+
+ PropertyFileAccessAction(String filename)
+ {
+ this.filename = filename;
+ }
+
+ public Object run()
+ {
+ try
+ {
+ InputStream inStream = new FileInputStream(filename);
+ Properties props = new Properties();
+ props.load(inStream);
+ return props;
+ }
+ catch (IOException ex)
+ {
+ throw new SecurityException("Cannot load properties: " + filename, ex);
+ }
+ }
+ }
+}
More information about the overlord-commits
mailing list