Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DROOLS-4249: Implement client-side marshalling #1306

Merged
merged 17 commits into from Feb 18, 2020
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,18 @@
/target
/local

# Eclipse, Netbeans and IntelliJ files
/.*
/**/.*
!.gitignore
/nbproject
*.ipr
*.iws
*.iml

# Repository wide ignore mac DS_Store files
.DS_Store
*.log
/src/main/java/org/
/src/main/resources/org/drools/workbench/scenariosimulation/kogito/marshaller/js/SCESIM.js
/src/main/resources/org/drools/workbench/scenariosimulation/kogito/marshaller/js/Jsonix-all.js
@@ -0,0 +1,212 @@
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.drools</groupId>
<artifactId>drools-wb-scenario-simulation-editor</artifactId>
<version>7.34.0-SNAPSHOT</version>
</parent>

<artifactId>drools-wb-scenario-simulation-editor-kogito-marshaller</artifactId>
<packaging>jar</packaging>

<name>Drools Workbench - Scenario Simulation Editor - Kogito - Marshaller</name>
<description>Drools Workbench - Scenario Simulation Editor - Kogito - Marshaller</description>

<properties>
<jsinterop-annotations.version>1.0.2</jsinterop-annotations.version>
<jsinterop-base-version>1.0.0-beta-1</jsinterop-base-version>
<jsonix-scripts.version>3.0.0</jsonix-scripts.version>
<js.destination>${project.basedir}/src/main/resources/org/drools/workbench/scenariosimulation/kogito/marshaller/js</js.destination>
<gwt-jsonix-schema-compiler.version>1.1.0</gwt-jsonix-schema-compiler.version>
<gwt-interop-utils.version>0.3.0</gwt-interop-utils.version>
<maven-jaxb2-plugin.version>0.14.0</maven-jaxb2-plugin.version>
</properties>
Comment on lines +19 to +27
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@manstis @yesamer is it expected that the list of dependencies differ slightly from DMN? I do not mean versions.

https://github.com/kiegroup/kie-wb-common/blob/master/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/pom.xml

Copy link
Member Author

@yesamer yesamer Feb 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jomarko @manstis This is a good point, thank you to raise it. I'll analyze the differences. At first glance, a change in DMN side is required for gwt-jsonix-schema-compiler, in my understanding 1.1.0 is the last version generated by @gcardosi

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

@yesamer yesamer Feb 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jomarko

                <plugin>
                  <groupId>org.jvnet.jaxb2_commons</groupId>
                  <artifactId>jaxb2-basics</artifactId>
                </plugin>
                <plugin>
                  <groupId>org.jvnet.jaxb2_commons</groupId>
                  <artifactId>jaxb2-namespace-prefix</artifactId>
                </plugin>

It seems that jaxb2-namespace-prefix version.jaxb2-basics are sub plugin used in maven-jaxb2-plugin together with gwt-jsonix-schema-compiler. IDK why these 2 plugins are required in DMN and NOT in SCESIM. @manstis do you have any idea?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDK if they're required..

It could be they're dead baggage that can be tidied up (when @jomarko looks at the JIRA he reported).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@manstis Thank you! @jomarko probably another "cleanup" change required in DMN is the one spotted by @danielezonca: remove Errai.properties and beans.xml files which should be useless in this module.


<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
</dependency>
<dependency>
<groupId>com.google.jsinterop</groupId>
<artifactId>base</artifactId>
</dependency>
<dependency>
<groupId>com.google.jsinterop</groupId>
<artifactId>jsinterop-annotations</artifactId>
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.kogito</groupId>
<artifactId>gwt-jsonix-schema-compiler</artifactId>
<version>${gwt-jsonix-schema-compiler.version}</version>
</dependency>
<dependency>
<groupId>com.google.jsinterop</groupId>
<artifactId>jsinterop-annotations</artifactId>
<version>${jsinterop-annotations.version}</version>
</dependency>
<dependency>
<groupId>com.google.jsinterop</groupId>
<artifactId>base</artifactId>
<version>${jsinterop-base-version}</version>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<failOnError>false</failOnError>
<filesets>
<fileset>
<directory>src/main/java/org/drools/workbench/scenariosimulation/kogito/marshaller/js/model</directory>
<includes>
<include>**</include>
</includes>
</fileset>
<fileset>
<directory>${js.destination}</directory>
<includes>
<include>SCESIM.js</include>
<include>Jsonix-all.js</include>
</includes>
</fileset>
<fileset>
<directory>src/main/java/org/drools/workbench/scenariosimulation/kogito/marshaller/mapper</directory>
<includes>
<include>JsUtils.java</include>
<include>JSIName.java</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<executions>
<execution>
<id>generate-javascript</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<extension>true</extension>
<addCompileSourceRoot>false</addCompileSourceRoot>
<debug>false</debug>
<verbose>false</verbose>
<args>
<arg>-Xgwtjsonix</arg>
<arg>-Xinheritance</arg>
<arg>-jsid=${project.build.sourceDirectory}</arg>
<arg>-jsmpkg=org.drools.workbench.scenariosimulation.kogito.marshaller.mapper</arg>
<arg>-jsmn=SCESIMMainJs</arg>
</args>
<plugins>
<plugin>
<groupId>org.kogito</groupId>
<artifactId>gwt-jsonix-schema-compiler</artifactId>
</plugin>
</plugins>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-javascript</id>
<phase>generate-sources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.hisrc.jsonix</groupId>
<artifactId>jsonix-scripts</artifactId>
<version>${jsonix-scripts.version}</version>
<type>js</type>
<classifier>all</classifier>
<outputDirectory>${js.destination}</outputDirectory>
<destFileName>Jsonix-all.js</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>move-generated-sources</id>
<phase>process-sources</phase>
<configuration>
<target>
<copy file="${project.build.directory}/generated-sources/xjc/SCESIM.js" tofile="${js.destination}/SCESIM.js"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- GWT Maven Plugin-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>generateAsync</goal>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<module>org.drools.workbench.scenariosimulation.kogito.marshaller.ScesimMarshaller</module>
<style>PRETTY</style>
<compileReport>true</compileReport>
<soycDetailed>true</soycDetailed>
<logLevel>TRACE</logLevel>
<noServer>false</noServer>
</configuration>
</plugin>
<!-- DISABLE CHECKSTYLE -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<skip>true</skip>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't be disabled just for special folders?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jomarko good point, done!

</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>${maven-jaxb2-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>

</project>
@@ -0,0 +1,4 @@
# Ignore everything in this directory, it will contain auto-generated files
*
# Except this file
!.gitignore
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jaxb:bindings
version="2.1"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:jsonix="http://jsonix.highsource.org/customizations"
xmlns:xs="http://www.w3.org/2001/XMLSchema"

jaxb:extensionBindingPrefixes="jsonix">

<jaxb:bindings schemaLocation="scesim.xsd" node="/xs:schema">
<jaxb:schemaBindings>
<jaxb:package name="org.drools.workbench.scenariosimulation.kogito.marshaller.js.model"/>
</jaxb:schemaBindings>

<jsonix:packageMapping
packageName="org.drools.workbench.scenariosimulation.kogito.marshaller.js.model"
spaceName="SCESIM"/>
</jaxb:bindings>

</jaxb:bindings>
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
When updating your version of GWT, you should also update this DTD reference,
so that your app can take advantage of the latest GWT module capabilities.
-->
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.8.2//EN"
"http://gwtproject.org/doctype/2.8.2/gwt-module.dtd">
<module>

<inherits name="jsinterop.base.Base" />

<!-- We don't need to support IE10 or older -->
<!-- There is no "ie11" permutation. IE11 uses the Firefox one (gecko1_8) -->
<set-property name="user.agent" value="gecko1_8,safari"/>

<!-- Specify the paths for translatable code -->
<source path="js"/>
<source path="mapper"/>

<super-source path="jre"/>

</module>
@@ -0,0 +1,57 @@
/*
* Copyright 2019 Red Hat, Inc. and/or its affiliates.
*
* 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 javax.xml;

import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsType;

/**
* GWT Super-source version of javax.xml.XMLConstants.
*/
@SuppressWarnings("unused")
@JsType(namespace = JsPackage.GLOBAL)
public final class XMLConstants {

public static final String NULL_NS_URI = "";

public static final String DEFAULT_NS_PREFIX = "";

public static final String XML_NS_URI = "http://www.w3.org/XML/1998/namespace";

public static final String XML_NS_PREFIX = "xml";

public static final String XMLNS_ATTRIBUTE_NS_URI = "http://www.w3.org/2000/xmlns/";

public static final String XMLNS_ATTRIBUTE = "xmlns";

public static final String W3C_XML_SCHEMA_NS_URI = "http://www.w3.org/2001/XMLSchema";

public static final String W3C_XML_SCHEMA_INSTANCE_NS_URI = "http://www.w3.org/2001/XMLSchema-instance";

public static final String W3C_XPATH_DATATYPE_NS_URI = "http://www.w3.org/2003/11/xpath-datatypes";

public static final String XML_DTD_NS_URI = "http://www.w3.org/TR/REC-xml";

public static final String RELAXNG_NS_URI = "http://relaxng.org/ns/structure/1.0";

public static final String FEATURE_SECURE_PROCESSING = "http://javax.xml.XMLConstants/feature/secure-processing";

public static final String ACCESS_EXTERNAL_DTD = "http://javax.xml.XMLConstants/property/accessExternalDTD";

public static final String ACCESS_EXTERNAL_SCHEMA = "http://javax.xml.XMLConstants/property/accessExternalSchema";

public static final String ACCESS_EXTERNAL_STYLESHEET = "http://javax.xml.XMLConstants/property/accessExternalStylesheet";
}