buildbot success in on ofbizTrunkFrameworkPlugins

2020-08-23 Thread buildbot
The Buildbot has detected a restored build on builder 
ofbizTrunkFrameworkPlugins while building ofbiz-framework. Full details are 
available at:
https://ci.apache.org/builders/ofbizTrunkFrameworkPlugins/builds/1681

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf945_ubuntu

Build Reason: downstream
Build Source Stamp: [branch trunk] 2d18b93a2eab5a7d79c6bd336f74d0a8246d93d8
Blamelist: James Yong 

Build succeeded!

Sincerely,
 -The Buildbot





[ofbiz-framework] branch trunk updated: Fixed: multi-block attribute for html-template tag (OFBIZ-11686)

2020-08-23 Thread jamesyong
This is an automated email from the ASF dual-hosted git repository.

jamesyong pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 2d18b93  Fixed: multi-block attribute for html-template tag 
(OFBIZ-11686)
2d18b93 is described below

commit 2d18b93a2eab5a7d79c6bd336f74d0a8246d93d8
Author: James Yong 
AuthorDate: Mon Aug 24 07:41:01 2020 +0800

Fixed: multi-block attribute for html-template tag (OFBIZ-11686)

checkstyle issues
---
 .../org/apache/ofbiz/widget/model/HtmlWidget.java  | 48 ++
 .../widget/model/MultiBlockHtmlTemplateUtil.java   | 35 +++-
 2 files changed, 26 insertions(+), 57 deletions(-)

diff --git 
a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/HtmlWidget.java 
b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/HtmlWidget.java
index 1a160ad..77a2153 100644
--- 
a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/HtmlWidget.java
+++ 
b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/HtmlWidget.java
@@ -18,20 +18,15 @@
  
***/
 package org.apache.ofbiz.widget.model;
 
-import java.io.IOException;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Stack;
-
-import javax.servlet.http.HttpServletRequest;
-
+import freemarker.ext.beans.BeansWrapper;
+import freemarker.ext.beans.CollectionModel;
+import freemarker.ext.beans.StringModel;
+import freemarker.template.Configuration;
+import freemarker.template.Template;
+import freemarker.template.TemplateException;
+import freemarker.template.TemplateModel;
+import freemarker.template.TemplateModelException;
+import freemarker.template.Version;
 import org.apache.ofbiz.base.util.Debug;
 import org.apache.ofbiz.base.util.GeneralException;
 import org.apache.ofbiz.base.util.UtilCodec;
@@ -51,15 +46,16 @@ import org.jsoup.nodes.Document;
 import org.jsoup.select.Elements;
 import org.w3c.dom.Element;
 
-import freemarker.ext.beans.BeansWrapper;
-import freemarker.ext.beans.CollectionModel;
-import freemarker.ext.beans.StringModel;
-import freemarker.template.Configuration;
-import freemarker.template.Template;
-import freemarker.template.TemplateException;
-import freemarker.template.TemplateModel;
-import freemarker.template.TemplateModelException;
-import freemarker.template.Version;
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Stack;
 
 /**
  * Widget Library - Screen model HTML class.
@@ -190,9 +186,7 @@ public class HtmlWidget extends ModelScreenWidget {
 /**
  * Render html template when multi-block=true. We use stack to store the 
string writer because a freemarker template may also render a sub screen
  * widget by using ${screens.render(link to the screen)}. So before 
rendering the sub screen widget, ScreenRenderer class will check for the
- * existence of the stack and retrieve the correct string writer. The 
following tags are removed from the final rendering: 1. External and inline
- * javascript tags 2. Css link tags
- * 
+ * existence of the stack and retrieve the correct string writer. Inline 
script tags are removed from the final rendering.
  * @param writer
  * @param locationExdr
  * @param context
@@ -273,7 +267,7 @@ public class HtmlWidget extends ModelScreenWidget {
 
 public static class HtmlTemplate extends ModelScreenWidget {
 protected FlexibleStringExpander locationExdr;
-protected boolean multiBlock;
+private boolean multiBlock;
 
 public HtmlTemplate(ModelScreen modelScreen, Element 
htmlTemplateElement) {
 super(modelScreen, htmlTemplateElement);
diff --git 
a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/MultiBlockHtmlTemplateUtil.java
 
b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/MultiBlockHtmlTemplateUtil.java
index 9da9124..bc20bf2 100644
--- 
a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/MultiBlockHtmlTemplateUtil.java
+++ 
b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/MultiBlockHtmlTemplateUtil.java
@@ -18,28 +18,15 @@
  
***/
 package org.apache.ofbiz.widget.model;
 
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
+import org.apache.ofbiz.base.util.UtilGenerics;
+
+import 

[ofbiz-framework] branch trunk updated: Fixed: multi-block attribute for html-template tag (OFBIZ-11686)

2020-08-23 Thread jamesyong
This is an automated email from the ASF dual-hosted git repository.

jamesyong pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 145eeba  Fixed: multi-block attribute for html-template tag 
(OFBIZ-11686)
145eeba is described below

commit 145eeba9ed301113a0453e71ad4e658c6b0081b2
Author: James Yong 
AuthorDate: Mon Aug 24 08:01:24 2020 +0800

Fixed: multi-block attribute for html-template tag (OFBIZ-11686)

update lower value for checkstyleMain.maxErrors
---
 build.gradle | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.gradle b/build.gradle
index 2e12fb6..1c38d4b 100644
--- a/build.gradle
+++ b/build.gradle
@@ -288,7 +288,7 @@ checkstyle {
 // the sum of errors found last time it was changed after using the
 // ‘checkstyle’ tool present in the framework and in the official
 // plugins.
-tasks.checkstyleMain.maxErrors = 5424
+tasks.checkstyleMain.maxErrors = 5420
 // Currently there are a lot of errors so we need to temporarily
 // hide them to avoid polluting the terminal output.
 showViolations = false



[ofbiz-framework] branch trunk updated: Fixed: svg files not removed on clean (OFBIZ-11976)

2020-08-23 Thread jleroux
This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
 new fda56c6  Fixed: svg files not removed on clean (OFBIZ-11976)
fda56c6 is described below

commit fda56c6852294fc982b9319320b10995b1bc1a60
Author: Jacques Le Roux 
AuthorDate: Sun Aug 23 17:41:45 2020 +0200

Fixed: svg files not removed on clean (OFBIZ-11976)

Files like birt/src/docs/asciidoc/images/OFBiz-Logo.svg, in many plugins,
don't get removed on clean.

I simply missed to clean them in pluginAsciidoc Gradle task (OFBIZ-10677)

Thanks: Alex Bodnaru for report
---
 build.gradle | 1 +
 1 file changed, 1 insertion(+)

diff --git a/build.gradle b/build.gradle
index d87022d..2e12fb6 100644
--- a/build.gradle
+++ b/build.gradle
@@ -598,6 +598,7 @@ task generateAllPluginsDocumentation(group: docsGroup,
 doLast { println "Documentation generated for 
plugin ${component.name}" }
 }
 mustRunAfter deleteAllPluginsDocumentation
+doLast { delete 
"${component}/src/docs/asciidoc/images/OFBiz-Logo.svg" }
 }
 
 dependsOn pluginAsciidoc



[ofbiz-framework] branch release18.12 updated: Fixed: svg files not removed on clean (OFBIZ-11976)

2020-08-23 Thread jleroux
This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch release18.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release18.12 by this push:
 new a61fe71  Fixed: svg files not removed on clean (OFBIZ-11976)
a61fe71 is described below

commit a61fe713f2417c889e67a3f6c3c512171fc442bb
Author: Jacques Le Roux 
AuthorDate: Sun Aug 23 17:41:45 2020 +0200

Fixed: svg files not removed on clean (OFBIZ-11976)

Files like birt/src/docs/asciidoc/images/OFBiz-Logo.svg, in many plugins,
don't get removed on clean.

I simply missed to clean them in pluginAsciidoc Gradle task (OFBIZ-10677)

Thanks: Alex Bodnaru for report
---
 build.gradle | 1 +
 1 file changed, 1 insertion(+)

diff --git a/build.gradle b/build.gradle
index 6aa4992..7ad9591 100644
--- a/build.gradle
+++ b/build.gradle
@@ -631,6 +631,7 @@ task generateAllPluginsDocumentation(group: docsGroup,
 doLast { println "Documentation generated for 
plugin ${component.name}" }
 }
 mustRunAfter deleteAllPluginsDocumentation
+doLast { delete 
"${component}/src/docs/asciidoc/images/OFBiz-Logo.svg" }
 }
 
 dependsOn pluginAsciidoc



[ofbiz-framework] branch release17.12 updated: Fixed: svg files not removed on clean (OFBIZ-11976)

2020-08-23 Thread jleroux
This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch release17.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release17.12 by this push:
 new 31a3a75  Fixed: svg files not removed on clean (OFBIZ-11976)
31a3a75 is described below

commit 31a3a75938f2fd9fc0f8bb407ce7048d34fc8205
Author: Jacques Le Roux 
AuthorDate: Sun Aug 23 17:41:45 2020 +0200

Fixed: svg files not removed on clean (OFBIZ-11976)

Files like birt/src/docs/asciidoc/images/OFBiz-Logo.svg, in many plugins,
don't get removed on clean.

I simply missed to clean them in pluginAsciidoc Gradle task (OFBIZ-10677)

Thanks: Alex Bodnaru for report
---
 build.gradle | 1 +
 1 file changed, 1 insertion(+)

diff --git a/build.gradle b/build.gradle
index 0d6e70c..bb2071c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -603,6 +603,7 @@ task generateAllPluginsDocumentation(group: docsGroup,
 doLast { println "Documentation generated for 
plugin ${component.name}" }
 }
 mustRunAfter deleteAllPluginsDocumentation
+doLast { delete 
"${component}/src/docs/asciidoc/images/OFBiz-Logo.svg" }
 }
 
 dependsOn pluginAsciidoc



buildbot failure in on ofbizTrunkFrameworkPlugins

2020-08-23 Thread buildbot
The Buildbot has detected a new failure on builder ofbizTrunkFrameworkPlugins 
while building ofbiz-framework. Full details are available at:
https://ci.apache.org/builders/ofbizTrunkFrameworkPlugins/builds/1679

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: downstream
Build Source Stamp: [branch trunk] 4612e49fa6af21a1a68180c8b079546ff94485bb
Blamelist: James Yong 

BUILD FAILED: failed check

Sincerely,
 -The Buildbot





[ofbiz-framework] branch trunk updated: Improved: multi-block attribute for html-template tag (OFBIZ-11686)

2020-08-23 Thread jamesyong
This is an automated email from the ASF dual-hosted git repository.

jamesyong pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 4612e49  Improved: multi-block attribute for html-template tag 
(OFBIZ-11686)
4612e49 is described below

commit 4612e49fa6af21a1a68180c8b079546ff94485bb
Author: James Yong 
AuthorDate: Sun Aug 23 21:55:09 2020 +0800

Improved: multi-block attribute for html-template tag (OFBIZ-11686)

Remove support to headerize script and css links from html-template
as importLibrary js function is a more simple solution.
---
 framework/widget/dtd/widget-screen.xsd |   4 +-
 .../org/apache/ofbiz/widget/model/HtmlWidget.java  |  34 ---
 .../ofbiz/widget/model/ModelScreenWidget.java  |  10 +-
 .../widget/model/MultiBlockHtmlTemplateUtil.java   | 301 +
 4 files changed, 3 insertions(+), 346 deletions(-)

diff --git a/framework/widget/dtd/widget-screen.xsd 
b/framework/widget/dtd/widget-screen.xsd
index 3bf4f1b..99f32b1 100644
--- a/framework/widget/dtd/widget-screen.xsd
+++ b/framework/widget/dtd/widget-screen.xsd
@@ -522,9 +522,7 @@ under the License.
 
 
 
-Multi-block processing of template targeted for the html 
body.
-Inline script will be rendered as external script after 
html body tag.
-External script tag with attribute data-import='head' will 
be rendered within html head tag.
+Inline script will be rendered as external script at 
bottom of body tag.
 
 
 
diff --git 
a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/HtmlWidget.java 
b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/HtmlWidget.java
index e1ee228..1a160ad 100644
--- 
a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/HtmlWidget.java
+++ 
b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/HtmlWidget.java
@@ -232,12 +232,6 @@ public class HtmlWidget extends ModelScreenWidget {
 scripts.append(script.data());
 script.remove();
 }
-} else {
-String dataImport = script.attr("data-import");
-if ("head".equals(dataImport)) {
-// remove external script in the template that is 
meant to be imported in the html header
-script.remove();
-}
 }
 }
 
@@ -263,17 +257,6 @@ public class HtmlWidget extends ModelScreenWidget {
 MultiBlockHtmlTemplateUtil.addScriptLinkForFoot(request, url);
 }
 }
-// extract css link tags
-Elements csslinkElements = doc.select("link");
-if (csslinkElements != null && csslinkElements.size() > 0) {
-for (org.jsoup.nodes.Element link : csslinkElements) {
-String src = link.attr("href");
-if (UtilValidate.isNotEmpty(src)) {
-// remove external style sheet in the template that will 
be added to the html header
-link.remove();
-}
-}
-}
 
 // the 'template' block
 String body = doc.body().html();
@@ -296,23 +279,6 @@ public class HtmlWidget extends ModelScreenWidget {
 super(modelScreen, htmlTemplateElement);
 this.locationExdr = 
FlexibleStringExpander.getInstance(htmlTemplateElement.getAttribute("location"));
 this.multiBlock = 
!"false".equals(htmlTemplateElement.getAttribute("multi-block"));
-
-if (this.isMultiBlock()) {
-String origLoc = this.locationExdr.getOriginal();
-Set urls = null;
-if (origLoc.contains("${")) {
-urls = new LinkedHashSet<>();
-urls.add(origLoc);
-} else {
-try {
-urls = 
MultiBlockHtmlTemplateUtil.extractHtmlLinksFromRawHtmlTemplate(origLoc);
-} catch (IOException e) {
-String errMsg = "Error getting html imports from 
template at location [" + origLoc + "]: " + e.toString();
-Debug.logError(e, errMsg, MODULE);
-}
-}
-
MultiBlockHtmlTemplateUtil.addHtmlLinksToHtmlLinksForScreenCache(modelScreen.getSourceLocation(),
 modelScreen.getName(), urls);
-}
 }
 
 public String getLocation(Map context) {
diff --git 
a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelScreenWidget.java
 
b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelScreenWidget.java
index 7867197..6a6f54a 100644
--- 

buildbot success in on ofbizTrunkFrameworkPlugins

2020-08-23 Thread buildbot
The Buildbot has detected a restored build on builder 
ofbizTrunkFrameworkPlugins while building ofbiz-framework. Full details are 
available at:
https://ci.apache.org/builders/ofbizTrunkFrameworkPlugins/builds/1677

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf947_ubuntu

Build Reason: downstream
Build Source Stamp: [branch trunk] 135c7f5158d4c0b0eb548821d78bfbbd1aef625d
Blamelist: James Yong 

Build succeeded!

Sincerely,
 -The Buildbot





[ofbiz-plugins] branch trunk updated: Added support to read children attributes of the service for rendering openapi spec (#40)

2020-08-23 Thread grv
This is an automated email from the ASF dual-hosted git repository.

grv pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-plugins.git


The following commit(s) were added to refs/heads/trunk by this push:
 new dce5c97  Added support to read children attributes of the service for 
rendering openapi spec (#40)
dce5c97 is described below

commit dce5c976f7b1e509bc8d2f4046b2c370ca0adc45
Author: girishvasmatkar <47553544+girishvasmat...@users.noreply.github.com>
AuthorDate: Sun Aug 23 11:58:19 2020 +0530

Added support to read children attributes of the service for rendering 
openapi spec (#40)
---
 .../ofbiz/ws/rs/openapi/OFBizOpenApiReader.java|  48 +-
 .../ws/rs/resources/AuthenticationResource.java|   8 +-
 .../ws/rs/resources/OFBizServiceResource.java  |   5 +-
 .../org/apache/ofbiz/ws/rs/util/OpenApiUtil.java   | 169 -
 4 files changed, 177 insertions(+), 53 deletions(-)

diff --git 
a/ofbiz-rest-impl/src/main/java/org/apache/ofbiz/ws/rs/openapi/OFBizOpenApiReader.java
 
b/ofbiz-rest-impl/src/main/java/org/apache/ofbiz/ws/rs/openapi/OFBizOpenApiReader.java
index de1c9e8..20b9301 100644
--- 
a/ofbiz-rest-impl/src/main/java/org/apache/ofbiz/ws/rs/openapi/OFBizOpenApiReader.java
+++ 
b/ofbiz-rest-impl/src/main/java/org/apache/ofbiz/ws/rs/openapi/OFBizOpenApiReader.java
@@ -44,13 +44,9 @@ import io.swagger.v3.oas.models.OpenAPI;
 import io.swagger.v3.oas.models.Operation;
 import io.swagger.v3.oas.models.PathItem;
 import io.swagger.v3.oas.models.Paths;
-import io.swagger.v3.oas.models.media.ArraySchema;
 import io.swagger.v3.oas.models.media.Content;
-import io.swagger.v3.oas.models.media.IntegerSchema;
 import io.swagger.v3.oas.models.media.MediaType;
-import io.swagger.v3.oas.models.media.ObjectSchema;
 import io.swagger.v3.oas.models.media.Schema;
-import io.swagger.v3.oas.models.media.StringSchema;
 import io.swagger.v3.oas.models.parameters.QueryParameter;
 import io.swagger.v3.oas.models.parameters.RequestBody;
 import io.swagger.v3.oas.models.responses.ApiResponse;
@@ -159,7 +155,6 @@ public final class OFBizOpenApiReader extends Reader 
implements OpenApiReader {
 
 openApi.setPaths(paths);
 openApi.setComponents(components);
-
 return openApi;
 }
 
@@ -193,50 +188,11 @@ public final class OFBizOpenApiReader extends Reader 
implements OpenApiReader {
 }
 
 private void setOutSchemaForService(ModelService service) {
-Schema parentSchema = new Schema();
-parentSchema.setDescription("Out Schema for service: " + 
service.getName() + " response");
-parentSchema.setType("object");
-parentSchema.addProperties("statusCode", new 
IntegerSchema().description("HTTP Status Code"));
-parentSchema.addProperties("statusDescription", new 
StringSchema().description("HTTP Status Code Description"));
-parentSchema.addProperties("successMessage", new 
StringSchema().description("Success Message"));
-ObjectSchema dataSchema = new ObjectSchema();
-parentSchema.addProperties("data", dataSchema);
-service.getOutParamNamesMap().forEach((name, type) -> {
-Schema schema = null;
-Class schemaClass = OpenApiUtil.getOpenApiSchema(type);
-if (schemaClass == null) {
-return;
-}
-try {
-schema = (Schema) schemaClass.newInstance();
-} catch (InstantiationException | IllegalAccessException e) {
-}
-if (schema instanceof ArraySchema) {
-ArraySchema arraySchema = (ArraySchema) schema;
-arraySchema.items(new StringSchema());
-}
-dataSchema.addProperties(name, schema.description(name));
-});
-schemas.put(service.getName() + "Response", parentSchema);
+schemas.put(service.getName() + "Response", 
OpenApiUtil.getOutSchema(service));
 }
 
 private void setInSchemaForService(ModelService service) {
-Schema parentSchema = new Schema();
-parentSchema.setDescription("In Schema for service: " + 
service.getName() + " request");
-parentSchema.setType("object");
-service.getInParamNamesMap().forEach((name, type) -> {
-Schema schema = null;
-Class schemaClass = OpenApiUtil.getOpenApiSchema(type);
-if (schemaClass == null) {
-return;
-}
-try {
-schema = (Schema) schemaClass.newInstance();
-} catch (InstantiationException | IllegalAccessException e) {
-}
-parentSchema.addProperties(name, schema.description(name));
-});
-schemas.put(service.getName() + "Request", parentSchema);
+schemas.put(service.getName() + "Request", 
OpenApiUtil.getInSchema(service));
 }
 
 }
diff --git 
a/ofbiz-rest-impl/src/main/java/org/apache/ofbiz/ws/rs/resources/AuthenticationResource.java

[ofbiz-framework] branch trunk updated: Improved: Move page-specific script links to html template (OFBIZ-11799)

2020-08-23 Thread jamesyong
This is an automated email from the ASF dual-hosted git repository.

jamesyong pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 5088abe  Improved: Move page-specific script links to html template 
(OFBIZ-11799)
5088abe is described below

commit 5088abe59d2c60550fc1ae2298f264716f9bc4a3
Author: James Yong 
AuthorDate: Sun Aug 23 14:24:51 2020 +0800

Improved: Move page-specific script links to html template (OFBIZ-11799)

Use importLibrary js function to load jstree js at ProductStoreGroupTree.ftl
Tested at
https://localhost:8443/catalog/control/ListParentProductStoreGroup
---
 .../template/store/ProductStoreGroupTree.ftl   | 47 --
 1 file changed, 26 insertions(+), 21 deletions(-)

diff --git a/applications/product/template/store/ProductStoreGroupTree.ftl 
b/applications/product/template/store/ProductStoreGroupTree.ftl
index 91c0027..3c1 100644
--- a/applications/product/template/store/ProductStoreGroupTree.ftl
+++ b/applications/product/template/store/ProductStoreGroupTree.ftl
@@ -17,8 +17,6 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-
-