svn commit: r1846979 - /ofbiz/ofbiz-framework/trunk/build.gradle

2018-11-19 Thread jleroux
Author: jleroux
Date: Tue Nov 20 07:50:10 2018
New Revision: 1846979

URL: http://svn.apache.org/viewvc?rev=1846979=rev
Log:
No functional change, dummy change to test documentation generation on site.

Modified:
ofbiz/ofbiz-framework/trunk/build.gradle

Modified: ofbiz/ofbiz-framework/trunk/build.gradle
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/build.gradle?rev=1846979=1846978=1846979=diff
==
--- ofbiz/ofbiz-framework/trunk/build.gradle (original)
+++ ofbiz/ofbiz-framework/trunk/build.gradle Tue Nov 20 07:50:10 2018
@@ -1090,4 +1090,3 @@ def gradlewSubprocess(commandList) {
 def gradlew = os.contains('windows') ? 'gradlew.bat' : './gradlew'
 exec { commandLine(gradlew, "--no-daemon", *commandList) }
 }
-




svn commit: r1846899 - /ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java

2018-11-19 Thread jleroux
Author: jleroux
Date: Mon Nov 19 14:31:21 2018
New Revision: 1846899

URL: http://svn.apache.org/viewvc?rev=1846899=rev
Log:
Improved: Remove duplicated code when running login/logout events
(OFBIZ-10474)

In an effort of refactoring the RequestHandler class, I have factored the code 
from runAfterLoginEvents and runBeforeLogoutEvents using a FunctionalInterface

Thanks: Mathieu Lirzin

Modified:

ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java

Modified: 
ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java?rev=1846899=1846898=1846899=diff
==
--- 
ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
 Mon Nov 19 14:31:21 2018
@@ -1222,40 +1222,49 @@ public class RequestHandler {
 return rh.makeLink(request, response, url, fullPath, secure, encode);
 }
 
-public void runAfterLoginEvents(HttpServletRequest request, 
HttpServletResponse response) {
-try {
-for (ConfigXMLReader.Event event: 
getControllerConfig().getAfterLoginEventList().values()) {
-try {
-String returnString = this.runEvent(request, response, 
event, null, "after-login");
-if (returnString != null && 
!"success".equalsIgnoreCase(returnString)) {
-throw new EventHandlerException("Pre-Processor event 
did not return 'success'.");
-}
-} catch (EventHandlerException e) {
-Debug.logError(e, module);
-}
-}
-} catch (WebAppConfigurationException e) {
-Debug.logError(e, "Exception thrown while parsing controller.xml 
file: ", module);
-}
+@FunctionalInterface
+private interface EventCollectionProducer {
+Collection get() throws 
WebAppConfigurationException;
 }
 
-public void runBeforeLogoutEvents(HttpServletRequest request, 
HttpServletResponse response) {
+private void runEvents(HttpServletRequest req, HttpServletResponse res, 
+EventCollectionProducer prod, String trigger) {
 try {
-for (ConfigXMLReader.Event event: 
getControllerConfig().getBeforeLogoutEventList().values()) {
-try {
-String returnString = this.runEvent(request, response, 
event, null, "before-logout");
-if (returnString != null && 
!"success".equalsIgnoreCase(returnString)) {
-throw new EventHandlerException("Pre-Processor event 
did not return 'success'.");
-}
-} catch (EventHandlerException e) {
-Debug.logError(e, module);
+for (ConfigXMLReader.Event event: prod.get()) {
+String ret = runEvent(req, res, event, null, trigger);
+if (ret != null && !"success".equalsIgnoreCase(ret)) {
+throw new EventHandlerException("Pre-Processor event did 
not return 'success'.");
 }
 }
+} catch (EventHandlerException e) {
+Debug.logError(e, module);
 } catch (WebAppConfigurationException e) {
 Debug.logError(e, "Exception thrown while parsing controller.xml 
file: ", module);
 }
 }
 
+/**
+ * Run all the "after-login" Web events defined in the controller 
configuration.
+ *
+ * @param req the request to run the events with
+ * @param resp the response to run the events with
+ */
+public void runAfterLoginEvents(HttpServletRequest req, 
HttpServletResponse resp) {
+EventCollectionProducer prod = () -> 
getControllerConfig().getAfterLoginEventList().values();
+runEvents(req, resp, prod, "after-login");
+}
+
+/**
+ * Run all the "before-logout" Web events defined in the controller 
configuration.
+ *
+ * @param req the request to run the events with
+ * @param resp the response to run the events with
+ */
+public void runBeforeLogoutEvents(HttpServletRequest req, 
HttpServletResponse resp) {
+EventCollectionProducer prod = () -> 
getControllerConfig().getBeforeLogoutEventList().values();
+runEvents(req, resp, prod, "before-logout");
+}
+
 public boolean trackStats(HttpServletRequest request) {
 if (trackServerHit) {
 String uriString = 
RequestHandler.getRequestUri(request.getPathInfo());




buildbot exception in on ofbizTrunkFrameworkPlugins

2018-11-19 Thread buildbot
The Buildbot has detected a build exception on builder 
ofbizTrunkFrameworkPlugins while building . Full details are available at:
https://ci.apache.org/builders/ofbizTrunkFrameworkPlugins/builds/521

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

Buildslave for this Build: orcus_ubuntu

Build Reason: downstream
Build Source Stamp: [branch ofbiz/ofbiz-framework/trunk] 1846890
Blamelist: jleroux

BUILD FAILED: exception upload_1 upload_3

Sincerely,
 -The Buildbot





svn commit: r1846891 - /ofbiz/ofbiz-framework/trunk/build.gradle

2018-11-19 Thread jleroux
Author: jleroux
Date: Mon Nov 19 10:12:02 2018
New Revision: 1846891

URL: http://svn.apache.org/viewvc?rev=1846891=rev
Log:
No functional change, dummy change to test documentation generation on site.

Unfortunately presently I can't force with ofbiz-bot: INFRA-17259

Modified:
ofbiz/ofbiz-framework/trunk/build.gradle

Modified: ofbiz/ofbiz-framework/trunk/build.gradle
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/build.gradle?rev=1846891=1846890=1846891=diff
==
--- ofbiz/ofbiz-framework/trunk/build.gradle (original)
+++ ofbiz/ofbiz-framework/trunk/build.gradle Mon Nov 19 10:12:02 2018
@@ -1090,3 +1090,4 @@ def gradlewSubprocess(commandList) {
 def gradlew = os.contains('windows') ? 'gradlew.bat' : './gradlew'
 exec { commandLine(gradlew, "--no-daemon", *commandList) }
 }
+




svn commit: r1846890 - /ofbiz/ofbiz-framework/trunk/build.gradle

2018-11-19 Thread jleroux
Author: jleroux
Date: Mon Nov 19 09:37:35 2018
New Revision: 1846890

URL: http://svn.apache.org/viewvc?rev=1846890=rev
Log:
Implemented: Create a Gradle task to generate the documenation for all plugins
(OFBIZ-10651)

After INFRA-17258 Infra has created the directories needed to access the 
generated documentation from the site. 

Adds a generateAllPluginsDocumentation task to generate the plugins 
documentation under the build\asciidoc\plugins directory. It will be used in 
the 
Buildbot script to copy the plugins documentation in 
ci.apache.org/projects/ofbiz/site/pluginsdoc/ 
with the OFBiz documentation generated in build\asciidoc\ofbiz 
copied to ci.apache.org/projects/ofbiz/site/ofbizdoc/

The plugin documentation tasks are also changed to use the 
build/asciidoc/plugins
path instead of /build/asciidoc previously

Modified:
ofbiz/ofbiz-framework/trunk/build.gradle

Modified: ofbiz/ofbiz-framework/trunk/build.gradle
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/build.gradle?rev=1846890=1846889=1846890=diff
==
--- ofbiz/ofbiz-framework/trunk/build.gradle (original)
+++ ofbiz/ofbiz-framework/trunk/build.gradle Mon Nov 19 09:37:35 2018
@@ -536,13 +536,18 @@ task deletePluginDocumentation {
 if(!activeComponents.contains(pluginId)) {
 throw new GradleException("Could not find plugin with id 
${pluginId}")
 }
-delete "${buildDir}/asciidoc/${pluginId}"
+delete "${buildDir}/asciidoc/plugins/${pluginId}"
 }
 }
 
+task deleteAllPluginsDocumentation {
+doFirst { delete "${buildDir}/asciidoc/plugins" }
+}
+
+
 task generateOfbizDocumentation(group: docsGroup, type: AsciidoctorTask) {
 dependsOn deleteOfbizDocumentation
-description 'Generate OFBiz documentation manual'
+description 'Generate OFBiz documentation manuals'
 sourceDir "${rootDir}/docs/asciidoc"
 outputDir file("${buildDir}/asciidoc/ofbiz")
 }
@@ -554,7 +559,7 @@ task generatePluginDocumentation(group:
 if (project.hasProperty('pluginId') && component.name == pluginId) {
 def pluginAsciidoc = task "${component.name}Documentation" (type: 
AsciidoctorTask) {
 sourceDir file("${component}/src/docs/asciidoc")
-outputDir file("${buildDir}/asciidoc/${component.name}")
+outputDir 
file("${buildDir}/asciidoc/plugins/${component.name}")
 mustRunAfter deletePluginDocumentation
 }
 dependsOn pluginAsciidoc
@@ -562,6 +567,28 @@ task generatePluginDocumentation(group:
 }
 }
 
+task generateAllPluginsDocumentation(group: docsGroup, 
+description: 'Generate all plugins documentation.') {
+
+dependsOn deleteAllPluginsDocumentation
+file("${pluginsDir}").eachDir { plugin ->
+iterateOverActiveComponents { component ->
+if (component.name == plugin.name) {
+if (subprojectExists(":plugins:${plugin.name}")) {
+def pluginAsciidoc = task 
"${component.name}-Documentation" (type: AsciidoctorTask) {
+sourceDir file("${component}/src/docs/asciidoc")
+outputDir 
file("${buildDir}/asciidoc/plugins/${component.name}")
+doLast { println "Documentation generated for plugin 
${component.name}" }
+mustRunAfter deleteAllPluginsDocumentation
+}
+dependsOn pluginAsciidoc
+}
+}
+}
+}
+}
+
+
 // == System Administration tasks ==
 task createTestReports(group: sysadminGroup, description: 'Generate HTML 
reports from junit XML output') {
 doLast {