diff --git a/ContextAccess-core/pom.xml b/ContextAccess-core/pom.xml new file mode 100644 index 0000000..7212a1b --- /dev/null +++ b/ContextAccess-core/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + + + org.bonitasoft.rest.context + ContextAccess-parent + 1.0 + ../ContextAccess-parent + + + ContextAccess-core + ${context-access.version} + Context Access Core + Context access core + jar + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${java.version} + ${java.version} + + + + + diff --git a/src/main/java/src/org/bonitasoft/rest/context/RestContextAccessorJava.java b/ContextAccess-core/src/main/java/org/bonitasoft/rest/context/RestContextAccessorJava.java similarity index 100% rename from src/main/java/src/org/bonitasoft/rest/context/RestContextAccessorJava.java rename to ContextAccess-core/src/main/java/org/bonitasoft/rest/context/RestContextAccessorJava.java diff --git a/assemblyContextAccessZip.xml b/ContextAccess-modules/assemblyContextAccessRestAPIZip.xml similarity index 100% rename from assemblyContextAccessZip.xml rename to ContextAccess-modules/assemblyContextAccessRestAPIZip.xml diff --git a/assemblyDocumentPermissionRuleZip.xml b/ContextAccess-modules/assemblyDocumentPermissionRuleZip.xml similarity index 100% rename from assemblyDocumentPermissionRuleZip.xml rename to ContextAccess-modules/assemblyDocumentPermissionRuleZip.xml diff --git a/ContextAccess-modules/pom.xml b/ContextAccess-modules/pom.xml new file mode 100644 index 0000000..24b812e --- /dev/null +++ b/ContextAccess-modules/pom.xml @@ -0,0 +1,150 @@ + + + 4.0.0 + + + org.bonitasoft.rest.context + ContextAccess-parent + 1.0 + ../ContextAccess-parent + + + ContextAccess-modules + ${context-access.version} + Context Access Modules + context access modules + jar + + + + com.bonitasoft.web + bonita-web-extensions-sp + + + org.codehaus.groovy + groovy-all + + + com.googlecode.json-simple + json-simple + + + org.bonitasoft.rest.context + ContextAccess-core + + + + + ${project.artifactId} + + + src/main/resources + + + + src/main/groovy + src/test/groovy + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${java.version} + ${java.version} + groovy-eclipse-compiler + + + + org.codehaus.groovy + groovy-eclipse-compiler + ${groovy-eclipse-compiler.version} + + + org.codehaus.groovy + groovy-eclipse-batch + ${groovy-eclipse-batch.version} + + + + + com.google.code.maven-replacer-plugin + replacer + ${maven-replacer-plugin.version} + + + prepare-package + + replace + + + + + true + ${project.basedir}/target/assembly + ${document-permission-rule.name}-${project.version} + ${project.basedir}/src/main/groovy/org/bonitasoft/rest/context + + RestContextCaseId.groovy, + RestContextCheckDocumentDownload.groovy, + DocumentPermissionContextRule.groovy, + RestContextConfiguration.groovy, + RestContextPilot.groovy, + RestContextTrackPerformance.groovy, + + + src/**/RestContextCaseId.groovy + + + + + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + ${maven-assembly-plugin.version} + + + ContextAccessZip + package + + single + + false + + ${context-access-restapi.name}-${project.version} + true + false + + assemblyContextAccessRestAPIZip.xml + + + + + DocumentPermissionRuleZip + package + + single + + false + + ${document-permission-rule.name}-${project.version} + true + false + + assemblyDocumentPermissionRuleZip.xml + + + + + + + + + diff --git a/src/main/groovy/org/bonitasoft/rest/context/DocumentPermissionContextRule.groovy b/ContextAccess-modules/src/main/groovy/org/bonitasoft/rest/context/DocumentPermissionContextRule.groovy similarity index 100% rename from src/main/groovy/org/bonitasoft/rest/context/DocumentPermissionContextRule.groovy rename to ContextAccess-modules/src/main/groovy/org/bonitasoft/rest/context/DocumentPermissionContextRule.groovy diff --git a/src/main/groovy/org/bonitasoft/rest/context/RestContextCaseId.groovy b/ContextAccess-modules/src/main/groovy/org/bonitasoft/rest/context/RestContextCaseId.groovy similarity index 100% rename from src/main/groovy/org/bonitasoft/rest/context/RestContextCaseId.groovy rename to ContextAccess-modules/src/main/groovy/org/bonitasoft/rest/context/RestContextCaseId.groovy diff --git a/src/main/groovy/org/bonitasoft/rest/context/RestContextCheckDocumentDownload.groovy b/ContextAccess-modules/src/main/groovy/org/bonitasoft/rest/context/RestContextCheckDocumentDownload.groovy similarity index 100% rename from src/main/groovy/org/bonitasoft/rest/context/RestContextCheckDocumentDownload.groovy rename to ContextAccess-modules/src/main/groovy/org/bonitasoft/rest/context/RestContextCheckDocumentDownload.groovy diff --git a/src/main/groovy/org/bonitasoft/rest/context/RestContextConfiguration.groovy b/ContextAccess-modules/src/main/groovy/org/bonitasoft/rest/context/RestContextConfiguration.groovy similarity index 100% rename from src/main/groovy/org/bonitasoft/rest/context/RestContextConfiguration.groovy rename to ContextAccess-modules/src/main/groovy/org/bonitasoft/rest/context/RestContextConfiguration.groovy diff --git a/src/main/groovy/org/bonitasoft/rest/context/RestContextExpliciteVariable.groovy b/ContextAccess-modules/src/main/groovy/org/bonitasoft/rest/context/RestContextExpliciteVariable.groovy similarity index 100% rename from src/main/groovy/org/bonitasoft/rest/context/RestContextExpliciteVariable.groovy rename to ContextAccess-modules/src/main/groovy/org/bonitasoft/rest/context/RestContextExpliciteVariable.groovy diff --git a/src/main/groovy/org/bonitasoft/rest/context/RestContextHandleGet.groovy b/ContextAccess-modules/src/main/groovy/org/bonitasoft/rest/context/RestContextHandleGet.groovy similarity index 100% rename from src/main/groovy/org/bonitasoft/rest/context/RestContextHandleGet.groovy rename to ContextAccess-modules/src/main/groovy/org/bonitasoft/rest/context/RestContextHandleGet.groovy diff --git a/src/main/groovy/org/bonitasoft/rest/context/RestContextPilot.groovy b/ContextAccess-modules/src/main/groovy/org/bonitasoft/rest/context/RestContextPilot.groovy similarity index 100% rename from src/main/groovy/org/bonitasoft/rest/context/RestContextPilot.groovy rename to ContextAccess-modules/src/main/groovy/org/bonitasoft/rest/context/RestContextPilot.groovy diff --git a/src/main/groovy/org/bonitasoft/rest/context/RestContextTrackPerformance.groovy b/ContextAccess-modules/src/main/groovy/org/bonitasoft/rest/context/RestContextTrackPerformance.groovy similarity index 97% rename from src/main/groovy/org/bonitasoft/rest/context/RestContextTrackPerformance.groovy rename to ContextAccess-modules/src/main/groovy/org/bonitasoft/rest/context/RestContextTrackPerformance.groovy index de982ee..7095c42 100644 --- a/src/main/groovy/org/bonitasoft/rest/context/RestContextTrackPerformance.groovy +++ b/ContextAccess-modules/src/main/groovy/org/bonitasoft/rest/context/RestContextTrackPerformance.groovy @@ -1,154 +1,154 @@ -package org.bonitasoft.rest.context; - - -import java.util.logging.Logger -import java.util.Collections; - -import org.bonitasoft.web.extension.rest.RestAPIContext; -import org.bonitasoft.web.extension.rest.RestApiController -import groovy.json.JsonBuilder -import groovy.json.JsonException -import groovy.json.JsonSlurper - -import java.lang.reflect.Field -import java.lang.reflect.Method -import java.text.SimpleDateFormat -import java.util.logging.Logger - -import javax.servlet.http.HttpServletRequest -import javax.servlet.http.HttpServletResponse - -import org.apache.http.HttpHeaders -import org.bonitasoft.engine.api.APIClient -import org.bonitasoft.engine.api.BusinessDataAPI -import org.bonitasoft.engine.api.IdentityAPI -import org.bonitasoft.engine.api.ProcessAPI -import org.bonitasoft.engine.api.ProfileAPI -import org.bonitasoft.engine.bdm.Entity -import org.bonitasoft.engine.bdm.dao.BusinessObjectDAO -import org.bonitasoft.engine.bpm.data.ArchivedDataInstance -import org.bonitasoft.engine.bpm.data.ArchivedDataNotFoundException -import org.bonitasoft.engine.bpm.data.DataInstance -import org.bonitasoft.engine.bpm.data.DataNotFoundException -import org.bonitasoft.engine.bpm.document.Document -import org.bonitasoft.engine.bpm.document.DocumentCriterion -import org.bonitasoft.engine.bpm.document.DocumentDefinition -import org.bonitasoft.engine.bpm.document.DocumentListDefinition -import org.bonitasoft.engine.bpm.flownode.ActivityInstance; -import org.bonitasoft.engine.bpm.flownode.ArchivedActivityInstance; -import org.bonitasoft.engine.bpm.flownode.FlowElementContainerDefinition -import org.bonitasoft.engine.bpm.parameter.ParameterCriterion -import org.bonitasoft.engine.bpm.parameter.ParameterInstance -import org.bonitasoft.engine.bpm.process.ArchivedProcessInstance; -import org.bonitasoft.engine.bpm.process.DesignProcessDefinition -import org.bonitasoft.engine.bpm.process.ProcessInstance; -import org.bonitasoft.engine.business.data.BusinessDataReference -import org.bonitasoft.engine.business.data.MultipleBusinessDataReference -import org.bonitasoft.engine.business.data.SimpleBusinessDataReference -import org.bonitasoft.engine.identity.User -import org.bonitasoft.engine.session.APISession -import org.bonitasoft.web.extension.rest.RestAPIContext -import org.bonitasoft.web.extension.rest.RestApiController -import org.bonitasoft.web.extension.rest.RestApiResponse -import org.bonitasoft.web.extension.rest.RestApiResponseBuilder - - - - - -/* -------------------------------------------------------------------------------- */ -/* */ -/* class PerformanceTrace */ -/* */ -/* -------------------------------------------------------------------------------- */ -class RestContextTrackPerformance { - - - private static Logger logger = Logger.getLogger(RestContextTrackPerformance.class.getName()); - - private List> listOperations = new ArrayList>(); - private List> listSubOperations = new ArrayList>(); - long totalTime=0; - public void addMarker(String operation) { - long currentTime= System.currentTimeMillis(); - Map oneOperation = new HashMap(); - oneOperation.put("t",System.currentTimeMillis()); - oneOperation.put("n",operation); - listOperations.add( oneOperation ); - } - - - /** - * - * @param subOperation - * @param timeSubOperation - */ - public void addSubOperation(String subOperationName, long timeSubOperation) { - Map oneOperation = new HashMap(); - oneOperation.put("t",timeSubOperation); - oneOperation.put("n",subOperationName); - listSubOperations.add( oneOperation ); - } - - /** - * start the subPperation. Return an object, which has to be given a the endSubOperation - * @param subOperationName - * @return - */ - public Map startSubOperation(String subOperationName) { - Map oneOperation = new HashMap(); - long currentTime= System.currentTimeMillis(); - oneOperation.put("s",currentTime); - oneOperation.put("n",subOperationName); - return oneOperation; - } - /** - * end the siboperation. Calculate the time and register it - * @param subOperation - */ - public void endSubOperation(Map subOperation) { - long currentTime= System.currentTimeMillis(); - long startTime = (Long) subOperation.get( "s"); - - subOperation.put("t",currentTime - startTime ); - listSubOperations.add( subOperation ); - } - - - - - public String trace() { - String result=""; - - - Collections.sort(listSubOperations, new Comparator>() { - public int compare(Map s1, - Map s2) { - Long t1= Long.valueOf( s1.get("t") ); - Long t2= Long.valueOf( s2.get("t") ); - // in first the BIGGER time - return t2.compareTo( t1 ); - } - }); - - result+=" SUB_OPERATION:"; - // first sub operation - for (int i=1;i> listOperations = new ArrayList>(); + private List> listSubOperations = new ArrayList>(); + long totalTime=0; + public void addMarker(String operation) { + long currentTime= System.currentTimeMillis(); + Map oneOperation = new HashMap(); + oneOperation.put("t",System.currentTimeMillis()); + oneOperation.put("n",operation); + listOperations.add( oneOperation ); + } + + + /** + * + * @param subOperation + * @param timeSubOperation + */ + public void addSubOperation(String subOperationName, long timeSubOperation) { + Map oneOperation = new HashMap(); + oneOperation.put("t",timeSubOperation); + oneOperation.put("n",subOperationName); + listSubOperations.add( oneOperation ); + } + + /** + * start the subPperation. Return an object, which has to be given a the endSubOperation + * @param subOperationName + * @return + */ + public Map startSubOperation(String subOperationName) { + Map oneOperation = new HashMap(); + long currentTime= System.currentTimeMillis(); + oneOperation.put("s",currentTime); + oneOperation.put("n",subOperationName); + return oneOperation; + } + /** + * end the siboperation. Calculate the time and register it + * @param subOperation + */ + public void endSubOperation(Map subOperation) { + long currentTime= System.currentTimeMillis(); + long startTime = (Long) subOperation.get( "s"); + + subOperation.put("t",currentTime - startTime ); + listSubOperations.add( subOperation ); + } + + + + + public String trace() { + String result=""; + + + Collections.sort(listSubOperations, new Comparator>() { + public int compare(Map s1, + Map s2) { + Long t1= Long.valueOf( s1.get("t") ); + Long t2= Long.valueOf( s2.get("t") ); + // in first the BIGGER time + return t2.compareTo( t1 ); + } + }); + + result+=" SUB_OPERATION:"; + // first sub operation + for (int i=1;i + + 4.0.0 + + org.bonitasoft.rest.context + ContextAccess-parent + 1.0 + Context Access Parent + Context Access Parent + pom + + + + 2.8 + + + 7.2.2 + 2.4.4 + 1.1 + + + DocumentPermissionRule + ContextAccess + UTF-8 + + + 1.8 + 3.3 + 2.9.2-01 + 2.4.3-01 + 1.5.2 + 2.4.1 + 3.0.2 + + + + + + com.bonitasoft.web + bonita-web-extensions-sp + ${bonita.version} + provided + + + org.codehaus.groovy + groovy-all + ${groovy.version} + provided + + + com.googlecode.json-simple + json-simple + ${json-simple.version} + + + org.bonitasoft.rest.context + ContextAccess-core + ${context-access.version} + + + + diff --git a/pom.xml b/pom.xml index a1e72ba..f96ba55 100644 --- a/pom.xml +++ b/pom.xml @@ -1,156 +1,50 @@ - + 4.0.0 - org.bonitasoft.rest.context + + org.bonitasoft.rest.context + ContextAccess-parent + 1.0 + ContextAccess-parent + + ContextAccess - 2.8 + ${context-access.version} Context Access Get context access + pom - - 7.2.2 - 2.4.4 - 1.1 - UTF-8 - DocumentPermissionRule - - - - - com.bonitasoft.web - bonita-web-extensions-sp - ${bonita.version} - provided - - - org.codehaus.groovy - groovy-all - ${groovy.version} - provided - - - com.googlecode.json-simple - json-simple - ${json-simple.version} - - + + ContextAccess-core + ContextAccess-modules + - ${project.artifactId} - - - src/main/resources - - - - src/main/groovy - src/test/groovy - - org.apache.maven.plugins - maven-compiler-plugin - 3.3 - - 1.8 - 1.8 - groovy-eclipse-compiler - - - - org.codehaus.groovy - groovy-eclipse-compiler - 2.9.2-01 - - - org.codehaus.groovy - groovy-eclipse-batch - 2.4.3-01 - - - - - com.google.code.maven-replacer-plugin - replacer - 1.5.2 - - - prepare-package - - replace - - - - - true - target/assembly - ${document-permission-rule.name}-${project.version} - src/main/groovy/org/bonitasoft/rest/context - - RestContextCaseId.groovy, - RestContextCheckDocumentDownload.groovy, - DocumentPermissionContextRule.groovy, - RestContextConfiguration.groovy, - RestContextPilot.groovy, - RestContextTrackPerformance.groovy, - - - src/**/RestContextCaseId.groovy - - - - - - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.4.1 + maven-resources-plugin + ${maven-resources-plugin.version} - ContextAccessZip - package - - single - - false - - ${project.build.finalName}-${project.version} - true - false - - assemblyContextAccessZip.xml - - - - - DocumentPermissionRuleZip + copy-resources package - single + copy-resources - false - ${document-permission-rule.name}-${project.version} - true - false - - assemblyDocumentPermissionRuleZip.xml - + ${basedir}/target/ + + + doc/${project.version} + true + + - - - - maven-resources-plugin - 3.0.2 - - copy-resources + copy-release package copy-resources @@ -159,8 +53,11 @@ ${basedir}/target/ - doc/${project.version} - true + ${basedir}/ContextAccess-modules/target/ + + ${document-permission-rule.name}-*.zip + ${context-access-restapi.name}-*.zip + diff --git a/src/main/java/pom.xml b/src/main/java/pom.xml deleted file mode 100644 index 94983e7..0000000 --- a/src/main/java/pom.xml +++ /dev/null @@ -1,19 +0,0 @@ - - 4.0.0 - org.bonitasoft.rest.context - RestContextComponentJava - 2.9 - - src - - - maven-compiler-plugin - 3.5.1 - - - - - - - - \ No newline at end of file