diff --git a/.gitattributes b/.gitattributes index bdb0cabc..f8bb7565 100644 --- a/.gitattributes +++ b/.gitattributes @@ -15,3 +15,12 @@ *.PDF diff=astextplain *.rtf diff=astextplain *.RTF diff=astextplain + +# Linux start script should use lf +/gradlew text eol=lf + +# These are Windows script files and should use crlf +*.bat text eol=crlf + +# Binary files should be left untouched +*.jar binary \ No newline at end of file diff --git a/.github/gradle/publish-mendix-gradle-plugin.gradle b/.github/gradle/publish-mendix-gradle-plugin.gradle new file mode 100644 index 00000000..fcc33b4e --- /dev/null +++ b/.github/gradle/publish-mendix-gradle-plugin.gradle @@ -0,0 +1,16 @@ +allprojects { + pluginManager.withPlugin( 'maven-publish' ) { + publishing { + repositories { + maven { + name = "GitHubPackages" + url = "https://maven.pkg.github.com/mendix/MxPushNotifications" + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + } + } + } + } +} \ No newline at end of file diff --git a/.github/workflows/build-module.yml b/.github/workflows/build-module.yml new file mode 100644 index 00000000..3bfffb79 --- /dev/null +++ b/.github/workflows/build-module.yml @@ -0,0 +1,50 @@ +name: Build module +on: + workflow_call: + outputs: + package-json-version: + value: ${{ jobs.build-widget.outputs.package-json-version }} + package-xml-version: + value: ${{ jobs.build-widget.outputs.package-xml-version }} + build-gradle-version: + value: ${{ jobs.build-module.outputs.build-gradle-version }} +jobs: + build-widget: + uses: ./.github/workflows/build-widget.yml + secrets: inherit + build-module: + runs-on: windows-latest + needs: build-widget + outputs: + build-gradle-version: ${{ steps.build-gradle-version.outputs.build-gradle-version }} + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 + - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # 4.7.1 + with: + distribution: 'adopt' + java-version: '21' + - uses: gradle/actions/setup-gradle@06832c7b30a0129d7fb559bcc6e43d26f6374244 # 4.3.1 + - name: Get version from build.gradle + id: build-gradle-version + run: | + echo "build-gradle-version=$(./gradlew -q printModuleVersion)" >> $env:GITHUB_OUTPUT + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Show versions + run: | + echo "Version in build.gradle: ${{ steps.build-gradle-version.outputs.build-gradle-version }}" + - name: "Detected module version" + run: echo $env:MODULE_VERSION + - uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # 4.2.1 + with: + name: widget + path: module/widgets/ + - name: Build module + run: ./gradlew buildModule + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # 4.6.2 + with: + name: module + path: module/dist/PushNotifications-${{ steps.build-gradle-version.outputs.build-gradle-version }}.mpk + compression-level: 0 \ No newline at end of file diff --git a/.github/workflows/build-widget.yml b/.github/workflows/build-widget.yml new file mode 100644 index 00000000..5426112d --- /dev/null +++ b/.github/workflows/build-widget.yml @@ -0,0 +1,50 @@ +name: Build widget +on: + workflow_call: + outputs: + package-json-version: + value: ${{ jobs.build.outputs.package-json-version }} + package-xml-version: + value: ${{ jobs.build.outputs.package-xml-version }} +defaults: + run: + working-directory: ./widget +jobs: + build: + runs-on: ubuntu-latest + outputs: + package-json-version: ${{ steps.package-json-version.outputs.package-json-version }} + package-xml-version: ${{ steps.package-xml-version.outputs.info }} + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 + with: + sparse-checkout: widget + - uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # 4.3.0 + with: + node-version: 6 + cache: "npm" + cache-dependency-path: widget/package-lock.json + - name: Get version from package.json + id: package-json-version + working-directory: widget + run: | + echo "package-json-version=$(cat package.json | jq -r '.version')" >> $GITHUB_OUTPUT + - name: Get version from package.xml + id: package-xml-version + uses: mavrosxristoforos/get-xml-info@afaa5058ead44cfaff92c6a861b46dd7a8929f60 # 2.0.0 + with: + xml-file: "widget/src/package.xml" + xpath: "//*[local-name()='clientModule']/@version" + - name: Show versions + run: | + echo "Version in package.json: ${{ steps.package-json-version.outputs.package-json-version }}" + echo "Version in package.xml: ${{ steps.package-xml-version.outputs.info }}" + - name: "Install dependencies" + run: npm install + - name: "Build widget" + run: npm run build + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # 4.6.2 + with: + name: widget + path: widget/dist/MxPushNotifications.mpk + compression-level: 0 diff --git a/.github/workflows/export-mpk.yml b/.github/workflows/export-mpk.yml deleted file mode 100644 index ee696a68..00000000 --- a/.github/workflows/export-mpk.yml +++ /dev/null @@ -1,115 +0,0 @@ -name: Export module package - -on: - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3 - with: - path: app - - - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3 - with: - repository: 'mendixlabs/mx-docker-tools' - path: 'mx-tools' - - - name: Define MX_VERSION - run: | - cd $GITHUB_WORKSPACE/app/test - VERSION=$(sqlite3 PushNotfications.mpr 'SELECT _ProductVersion FROM _MetaData LIMIT 1') - echo "Detected Mendix version: $VERSION" - echo "MX_VERSION=$VERSION" >> $GITHUB_ENV - - - name: Read package.json - id: set_module_version - run: | - content=`cat $GITHUB_WORKSPACE/app/package.json` - # the following lines are only required for multi line json - content="${content//'%'/'%25'}" - content="${content//$'\n'/'%0A'}" - content="${content//$'\r'/'%0D'}" - # end of optional handling for multi line json - echo "::set-output name=packageJson::$content" - - - name: Define MODULE_VERSION - run: | - MODULE_VERSION=${{fromJson(steps.set_module_version.outputs.packageJson).version}} - echo "Detected module version: $MODULE_VERSION" - echo "MODULE_VERSION=$MODULE_VERSION" >> $GITHUB_ENV - - - name: Create output directory - run: mkdir $GITHUB_WORKSPACE/out - - - name: Build MX Util - run: | - cd $GITHUB_WORKSPACE/mx-tools - make version=${{env.MX_VERSION}} build - - - name: Run MX Util - run: | - MX_TOOLS_IMAGE="mendixlabs/mx-docker-tools:"${{env.MX_VERSION}} - mkdir { $GITHUB_WORKSPACE/app/tmp, $GITHUB_WORKSPACE/app/dist } - docker run -v $GITHUB_WORKSPACE/app:/opt/app -i $MX_TOOLS_IMAGE mxutil.exe create-module-package --package-dir /opt/app/tmp /opt/app/test/PushNotfications.mpr "PushNotifications" --filter-required-libs --exclude-files="resources" | tee $GITHUB_WORKSPACE/out/mxutil.log - cp -f $GITHUB_WORKSPACE/app/tmp/PushNotifications.mpk $GITHUB_WORKSPACE/app/dist/PushNotifications-${{env.MODULE_VERSION}}.mpk - - - name: Remove non-whitelisted widgets - run: | - TEMP_UNZIP_FOLDER="$GITHUB_WORKSPACE/temp" - TARGET_MPK="$GITHUB_WORKSPACE/app/dist/PushNotifications-${{env.MODULE_VERSION}}.mpk" - ALLOWED_LIST="$GITHUB_WORKSPACE/app/widgets-whitelist.txt" - if [ ! -f "$ALLOWED_LIST" ]; then - echo “Unable to find file widgets-whitelist.txt” - exit 1; - fi - if [ -d "$TEMP_UNZIP_FOLDER" ]; then rm -Rf $TEMP_UNZIP_FOLDER; fi - mkdir $TEMP_UNZIP_FOLDER - unzip -x $TARGET_MPK -d $TEMP_UNZIP_FOLDER - cd "$TEMP_UNZIP_FOLDER/widgets" - for i in *; do - if ! grep -q "$i" $ALLOWED_LIST; then - echo "Removing widget: $i" | tee -a $GITHUB_WORKSPACE/out/removed-widgets.log - rm "$i" - sed -i "/$i/d" $TEMP_UNZIP_FOLDER/package.xml - fi - done - - cd $TEMP_UNZIP_FOLDER - zip -r PushNotifications-${{env.MODULE_VERSION}}.mpk * - mv -f PushNotifications-${{env.MODULE_VERSION}}.mpk $GITHUB_WORKSPACE/app/dist/ - if [ -d "$TEMP_UNZIP_FOLDER" ]; then rm -Rf $TEMP_UNZIP_FOLDER; fi - - - name: Create release - id: create_release - uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: v${{env.MODULE_VERSION}} - release_name: Marketplace release v${{env.MODULE_VERSION}} - body: | - (insert release notes) - commitish: master - draft: true - prerelease: false - - - name: Upload release asset - id: upload-release-asset - uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}/app/dist/PushNotifications-${{env.MODULE_VERSION}}.mpk - asset_name: PushNotifications-${{env.MODULE_VERSION}}.mpk - asset_content_type: application/zip - - - name: Archive results - if: ${{ always() }} - uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2 - with: - name: Results - path: ${{ github.workspace }}/out/* diff --git a/.github/workflows/publish-mendix-gradle-plugin.yml b/.github/workflows/publish-mendix-gradle-plugin.yml new file mode 100644 index 00000000..b7a01249 --- /dev/null +++ b/.github/workflows/publish-mendix-gradle-plugin.yml @@ -0,0 +1,29 @@ +name: Publish Mendix Gradle plugin +on: + workflow_dispatch: +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 + with: + repository: 'mendixlabs/mendix-gradle-plugin' + ref: '114bde309b52b037583d95a9beffee18eb71b65f' + ssh-key: ${{ secrets.MENDIX_GRADLE_PLUGIN_SSH }} + ssh-strict: false + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 + with: + path: repo + sparse-checkout: .github/gradle + - run: cp repo/.github/gradle/publish-mendix-gradle-plugin.gradle ./ + - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # 4.7.1 + with: + distribution: 'adopt' + java-version: '21' + - uses: gradle/actions/setup-gradle@06832c7b30a0129d7fb559bcc6e43d26f6374244 # 4.3.1 + - name: Build mendix-gradle-plugin + run: | + echo "kotlin.jvm.target.validation.mode = IGNORE" >> gradle.properties + ./gradlew -I publish-mendix-gradle-plugin.gradle build publish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 00000000..d07f5003 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,10 @@ +name: Pull request +on: + pull_request: +jobs: + build-module: + uses: ./.github/workflows/build-module.yml + secrets: inherit + snyk: + uses: ./.github/workflows/snyk.yml + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/push-stable.yml b/.github/workflows/push-stable.yml new file mode 100644 index 00000000..19e06cfd --- /dev/null +++ b/.github/workflows/push-stable.yml @@ -0,0 +1,13 @@ +name: Push to stable branch +on: + push: + branches: + - "master" + - "mx8" +jobs: + snyk: + uses: ./.github/workflows/snyk.yml + with: + command: "monitor" + suffix: -${{ github.ref_name }} + secrets: inherit diff --git a/.github/workflows/release-draft.yml b/.github/workflows/release-draft.yml new file mode 100644 index 00000000..4cd8b1d4 --- /dev/null +++ b/.github/workflows/release-draft.yml @@ -0,0 +1,58 @@ +name: Create release draft +on: + push: + branches: + - master + - mx8 + tags: + - v*.*.* +jobs: + build-module: + uses: ./.github/workflows/build-module.yml + secrets: inherit + check-version: + runs-on: ubuntu-latest + needs: + - build-module + steps: + - run: | + if [[ ${{ needs.build-module.outputs.package-json-version }} != ${{ needs.build-module.outputs.package-xml-version }} || ${{ needs.build-module.outputs.package-json-version }} != ${{ needs.build-module.outputs.build-gradle-version }} ]]; then + echo "Versions do not match" + echo "package.json version: ${{ needs.build-module.outputs.package-json-version }}" + echo "package.xml version: ${{ needs.build-module.outputs.package-xml-version }}" + echo "build.gradle version: ${{ needs.build-module.outputs.build-gradle-version }}" + exit 1 + fi + documentation: + runs-on: ubuntu-latest + environment: docs + steps: + - run: echo "Documentation is ready" + create-draft-release: + needs: + - check-version + - documentation + - build-module + runs-on: ubuntu-latest + #if: github.ref_type == 'tag' + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 + with: + sparse-checkout: . + - uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # 4.2.1 + with: + name: module + - uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # 4.2.1 + with: + name: widget + - uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # 2.2.1 + with: + name: "Marketplace release v${{ needs.build-module.outputs.build-gradle-version }}" + body_path: CHANGELOG.md + draft: true + files: | + *.mpk + LICENSE + fail_on_unmatched_files: true + generate_release_notes: false + make_latest: ${{ github.ref_name == 'master' }} diff --git a/.github/workflows/snyk.yml b/.github/workflows/snyk.yml index f8588b84..13d211a6 100644 --- a/.github/workflows/snyk.yml +++ b/.github/workflows/snyk.yml @@ -1,19 +1,39 @@ -name: Run Snyk scan - +name: Run Snyk scans on: - push: - branches: [ "master" ] + workflow_call: + inputs: + command: + type: string + required: false + default: 'test' + suffix: + type: string + required: false workflow_dispatch: - jobs: - snyk-test: + gradle: runs-on: ubuntu-latest steps: - - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3 - - name: Run Snyk to check for vulnerabilities - uses: snyk/actions/gradle@7fc2a503b9b624bc777982df99412478ca61f05a # master + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 + - name: Run Snyk (Gradle) + uses: snyk/actions/gradle@b98d498629f1c368650224d6d212bf7dfa89e4bf # 0.4.0 env: SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ORG_GRADLE_PROJECT_gprusername: ${{ env.GITHUB_ACTOR }} + ORG_GRADLE_PROJECT_gprpassword: ${{ secrets.GITHUB_TOKEN }} with: - command: monitor - args: --project-name="MxPushNotifications" --file=build.gradle + command: ${{ inputs.command }} + args: --project-name="gradle${{ inputs.suffix }}" --file=module/build.gradle + node: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 + - name: Run Snyk (Node) + uses: snyk/actions/node@b98d498629f1c368650224d6d212bf7dfa89e4bf # 0.4.0 + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + command: ${{ inputs.command }} + args: --project-name="node${{ inputs.suffix }}" --file=widget/package.json diff --git a/.gitignore b/.gitignore index 84a13ecb..5755a7d0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,16 @@ -test/javasource/administration/proxies/ -test/javasource/communitycommons/proxies/ -test/javasource/pushnotifications/proxies/ -test/javasource/system/proxies/ -test/javasource/myfirstmodule/proxies/ -test/javasource/encryption/proxies/ -test/deployment/ -test/.classpath -test/.mendix-cache/ -test/.project -test/.svn/ -test/resources/Firestore/ +module/javasource/administration/proxies/ +module/javasource/communitycommons/proxies/ +module/javasource/pushnotifications/proxies/ +module/javasource/system/proxies/ +module/javasource/myfirstmodule/proxies/ +module/javasource/encryption/proxies/ +module/deployment/ +module/theme-cache/ +module/.classpath +module/.mendix-cache/ +module/.project +module/.svn/ +module/resources/Firestore/ *.launch *.tmp @@ -20,8 +21,12 @@ build/ dist/ -node_modules/ +widget/node_modules/ .editorconfig *DS_Store* .vscode/ *.bak + +module/userlib/*.jar +module/userlib/*.RequiredLib +module/widgets/MxPushNotifications.mpk diff --git a/test/userlib/animal-sniffer-annotations-1.17.jar.CommunityCommons.RequiredLib b/CHANGELOG.md similarity index 100% rename from test/userlib/animal-sniffer-annotations-1.17.jar.CommunityCommons.RequiredLib rename to CHANGELOG.md diff --git a/README.md b/README.md index 1166bc23..bf5d3ce1 100644 --- a/README.md +++ b/README.md @@ -1 +1,73 @@ +## Module usage + Please see [Push Notifications Connector](https://docs.mendix.com/appstore/modules/push-notifications) in the Mendix documentation for details. + +## Development + +### Widget + +#### Requirements + +- Node.js (v6+) +- nvm (optional) + +#### Setup + +```bash +cd widget +npm i +``` + +#### Build + +```bash +npm run build +``` + +### Module + +#### Requirements + +- JDK + +#### Setup + +```bash +./gradlew.bat updateUserLibs +``` + +#### Build + +```bash +# Do not update Java dependencies +./gradlew.bat exportModule +``` + +or + +```bash +# Update Java dependencies before export +./gradlew.bat buildModule +``` + +The resulting module package is placed in `module/dist/PushNotifications-.mpk`. + +## Release process + +- Create (and switch to) a new branch +- Bump the version number in `module/gradle.build` +- Bump the version number in `widget/package.json` +- Bump the version number inside the module +- Push the branch and create an MR +- Merge the MR +- Tag the resulting commit on `master`/`mx8` with `v*.*.*` +- Push the tag +- Follow the steps in the resulting pipeline + +## Notes + +The userlibs for the PushNotifications module are not part of the repo. +To fetch them, run the `updateUserLibs` task after checking out the repo (and after switching branches). + +Changes to the `userlib` folder are ignored by git. +If you make any changes to the libraries required by other modules, you must commit these explicitly, using e.g. `git add -f `. diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 813c80fd..00000000 --- a/build.gradle +++ /dev/null @@ -1,142 +0,0 @@ -apply plugin: 'java' - -sourceCompatibility = '1.8' -[compileJava]*.options*.encoding = 'UTF-8' - -import org.gradle.api.internal.file.copy.CopySpecInternal - -buildscript { - repositories { - mavenCentral() - maven { - url 'https://plugins.gradle.org/m2/' - } - } - dependencies { - classpath 'org.owasp:dependency-check-gradle:6.0.2' - classpath 'com.github.ben-manes:gradle-versions-plugin:0.26.0' - } -} - -apply plugin: 'org.owasp.dependencycheck' -apply plugin: 'com.github.ben-manes.versions' - -project.ext { - PNC_VERSION = '7.4.2' - MXBUILD_VERSION = '9.24.0.2965' - MODULE_NAME = 'PushNotifications' -} - -def runtimeLibs = "$buildDir/runtime/bundles" -def monoPath = '/Library/Frameworks/Mono.framework/Versions/Current/Commands' - -def userLibDir = "$projectDir/userlib-generated" -def testProject = "$projectDir/PushNotfications.mpr" - -configurations { - tar -} - -repositories { - mavenCentral() - ivy { - url 'https://cdn.mendix.com/' - patternLayout { - artifact '/[organisation]/[module]-[revision].[ext]' - } - metadataSources { - artifact() - } - } -} - -dependencies { - implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.7' - implementation group: 'commons-codec', name: 'commons-codec', version: '1.15' - - implementation('com.google.auth:google-auth-library-oauth2-http:1.7.0') { - exclude group: 'com.google.code.gson', module: 'gson' - exclude group: 'com.google.guava', module: 'guava' - } - - implementation('com.google.guava:guava') { - version { - strictly '32.0.1-android' - } - } - - implementation('com.turo:pushy:0.13.10') { - exclude group: 'io.netty', module: 'netty-codec-http2' - exclude group: 'io.netty', module: 'netty-handler-proxy' - exclude group: 'io.netty', module: 'netty-resolver-dns' - exclude group: 'com.google.code.gson', module: 'gson' - } - - implementation('io.netty:netty-codec-http2') { - version { - strictly '4.2.0.Final' - } - } - - implementation('io.netty:netty-handler-proxy') { - version { - strictly '4.2.0.Final' - } - } - - implementation('io.netty:netty-resolver-dns') { - version { - strictly '4.2.0.Final' - } - } - - implementation('com.google.code.gson:gson') { - version { - strictly '2.9.0' - } - } - - tar "runtime:mxbuild:${project.MXBUILD_VERSION}@tar.gz" -} - -task extractModule( type: Exec ) { - if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) { - executable "$buildDir/modeler/mxutil.exe" - args 'create-module-package', '--filter-required-libs', '--exclude-files=resources/.*', "--package-dir=${projectDir}/dist/${project.PNC_VERSION}/module", testProject, project.MODULE_NAME - } else { - executable "$monoPath/mono" - args "$buildDir/modeler/mxutil.exe", 'create-module-package', '--filter-required-libs', '--exclude-files=resources/.*', "--package-dir=${projectDir}/dist/${project.PNC_VERSION}/module", testProject, project.MODULE_NAME - } -} - -extractModule.doFirst { - mkdir "${projectDir}/dist/${project.PNC_VERSION}/module" -} - -task copyToUserlib( type: Copy ) { - into userLibDir - from configurations.runtimeClasspath - eachFile { fileCopyDetails -> - def requiredLibFlag = new File(destinationDir, "${fileCopyDetails.name}.${project.MODULE_NAME}.RequiredLib") - requiredLibFlag.write '' - } -} - -task untarMxbuild( type: Copy ) { - configurations.tar.findAll{it.name.endsWith('tar.gz')}.each { - from tarTree(resources.gzip(it)) - into buildDir - include('**/modeler/**') - includeEmptyDirs = false - } -} - -task prepareDeps { - dependsOn 'clean', 'copyToUserlib', 'untarMxbuild' -} - -clean { - delete "$userLibDir" -} - -tasks.untarMxbuild.shouldRunAfter tasks.copyToUserlib diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..a4b76b95 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..37f853b1 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100755 index 00000000..f5feea6d --- /dev/null +++ b/gradlew @@ -0,0 +1,252 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# 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 +# +# https://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. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 00000000..9d21a218 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,94 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/test/LICENSE b/module/LICENSE similarity index 100% rename from test/LICENSE rename to module/LICENSE diff --git a/test/PushNotfications.mpr b/module/PushNotifications.mpr old mode 100755 new mode 100644 similarity index 99% rename from test/PushNotfications.mpr rename to module/PushNotifications.mpr index a36d08cd..bb9ec3e3 Binary files a/test/PushNotfications.mpr and b/module/PushNotifications.mpr differ diff --git a/module/build.gradle b/module/build.gradle new file mode 100644 index 00000000..50768b0d --- /dev/null +++ b/module/build.gradle @@ -0,0 +1,122 @@ +plugins { + id "application" + id "com.mendixlabs.mendix-gradle-plugin" version "0.0.5" +} + +repositories { + mavenCentral() +} + +mendix { + mendixVersion = "9.24.0.2965" + mprFileName = "module/PushNotifications.mpr" +} + +project.ext { + PNC_VERSION = '7.4.2' + MODULE_NAME = 'PushNotifications' +} + +def userLibDir = "$projectDir/userlib" + +dependencies { + implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.7' + implementation group: 'commons-codec', name: 'commons-codec', version: '1.15' + + implementation('com.google.auth:google-auth-library-oauth2-http:1.7.0') { + exclude group: 'com.google.code.gson', module: 'gson' + exclude group: 'com.google.guava', module: 'guava' + } + + implementation('com.google.guava:guava') { + version { + strictly '32.0.1-android' + } + } + + implementation('com.turo:pushy:0.13.10') { + exclude group: 'io.netty', module: 'netty-codec-http2' + exclude group: 'io.netty', module: 'netty-handler-proxy' + exclude group: 'io.netty', module: 'netty-resolver-dns' + exclude group: 'com.google.code.gson', module: 'gson' + } + + implementation('io.netty:netty-codec-http2') { + version { + strictly '4.2.0.Final' + } + } + + implementation('io.netty:netty-handler-proxy') { + version { + strictly '4.2.0.Final' + } + } + + implementation('io.netty:netty-resolver-dns') { + version { + strictly '4.2.0.Final' + } + } + + implementation('com.google.code.gson:gson') { + version { + strictly '2.9.0' + } + } +} + +tasks.register('printModuleVersion') { + println project.PNC_VERSION +} + +tasks.register('updateUserLibs', Copy) { + dependsOn 'cleanUserLibs' + into userLibDir + from configurations.runtimeClasspath + eachFile { fileCopyDetails -> + def requiredLibFlag = new File(destinationDir, "${fileCopyDetails.name}.${project.MODULE_NAME}.RequiredLib") + requiredLibFlag.write '' + } +} + +tasks.register('cleanUserLibs', Delete) { + fileTree(userLibDir).each {userlib -> + def matcher = userlib.name =~ /^(.*\.jar)\.$project.MODULE_NAME\.RequiredLib$/ + if (matcher.matches()) { + def jarPath = "$userLibDir/${matcher.group(1)}" + def requiredLibPath = userlib + delete files(jarPath, requiredLibPath) + } + } +} + +tasks.register('buildModule') { + dependsOn tasks.updateUserLibs, tasks.exportModule +} + +tasks.register('exportModule') { + dependsOn tasks.mxutil { + args = ["create-module-package", "--filter-required-libs", "--package-dir=dist", "--exclude-files=resources", "PushNotifications.mpr", project.MODULE_NAME] + } + + finalizedBy tasks.fixWidgets, tasks.cleanModule +} + +tasks.register('fixWidgets', Zip) { + archiveFileName = "PushNotifications-${project.PNC_VERSION}.mpk" + destinationDirectory = layout.projectDirectory.dir('dist') + from zipTree('dist/PushNotifications.mpk').matching { + exclude 'widgets/**' + } + into("widgets") { + from file("widgets/MxPushNotifications.mpk") + } +} + +tasks.register('cleanModule', Delete) { + delete 'dist/PushNotifications.mpk' +} + +tasks.exportModule.mustRunAfter tasks.updateUserLibs +tasks.cleanModule.mustRunAfter tasks.fixWidgets diff --git a/test/javascriptsource/datawidgets/actions/Export_To_Excel.js b/module/javascriptsource/datawidgets/actions/Export_To_Excel.js similarity index 100% rename from test/javascriptsource/datawidgets/actions/Export_To_Excel.js rename to module/javascriptsource/datawidgets/actions/Export_To_Excel.js diff --git a/test/javascriptsource/datawidgets/actions/Reset_All_Filters.js b/module/javascriptsource/datawidgets/actions/Reset_All_Filters.js similarity index 100% rename from test/javascriptsource/datawidgets/actions/Reset_All_Filters.js rename to module/javascriptsource/datawidgets/actions/Reset_All_Filters.js diff --git a/test/javascriptsource/datawidgets/actions/Reset_Filter.js b/module/javascriptsource/datawidgets/actions/Reset_Filter.js similarity index 100% rename from test/javascriptsource/datawidgets/actions/Reset_Filter.js rename to module/javascriptsource/datawidgets/actions/Reset_Filter.js diff --git a/test/javascriptsource/datawidgets/actions/xlsx-export-tools.js b/module/javascriptsource/datawidgets/actions/xlsx-export-tools.js similarity index 100% rename from test/javascriptsource/datawidgets/actions/xlsx-export-tools.js rename to module/javascriptsource/datawidgets/actions/xlsx-export-tools.js diff --git a/test/javascriptsource/nanoflowcommons/actions/Base64Decode.js b/module/javascriptsource/nanoflowcommons/actions/Base64Decode.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/Base64Decode.js rename to module/javascriptsource/nanoflowcommons/actions/Base64Decode.js diff --git a/test/javascriptsource/nanoflowcommons/actions/Base64DecodeToImage.js b/module/javascriptsource/nanoflowcommons/actions/Base64DecodeToImage.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/Base64DecodeToImage.js rename to module/javascriptsource/nanoflowcommons/actions/Base64DecodeToImage.js diff --git a/test/javascriptsource/nanoflowcommons/actions/Base64Encode.js b/module/javascriptsource/nanoflowcommons/actions/Base64Encode.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/Base64Encode.js rename to module/javascriptsource/nanoflowcommons/actions/Base64Encode.js diff --git a/test/javascriptsource/nanoflowcommons/actions/CallPhoneNumber.js b/module/javascriptsource/nanoflowcommons/actions/CallPhoneNumber.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/CallPhoneNumber.js rename to module/javascriptsource/nanoflowcommons/actions/CallPhoneNumber.js diff --git a/test/javascriptsource/nanoflowcommons/actions/ClearCachedSessionData.js b/module/javascriptsource/nanoflowcommons/actions/ClearCachedSessionData.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/ClearCachedSessionData.js rename to module/javascriptsource/nanoflowcommons/actions/ClearCachedSessionData.js diff --git a/test/javascriptsource/nanoflowcommons/actions/ClearLocalStorage.js b/module/javascriptsource/nanoflowcommons/actions/ClearLocalStorage.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/ClearLocalStorage.js rename to module/javascriptsource/nanoflowcommons/actions/ClearLocalStorage.js diff --git a/test/javascriptsource/nanoflowcommons/actions/DraftEmail.js b/module/javascriptsource/nanoflowcommons/actions/DraftEmail.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/DraftEmail.js rename to module/javascriptsource/nanoflowcommons/actions/DraftEmail.js diff --git a/test/javascriptsource/nanoflowcommons/actions/FindObjectWithGUID.js b/module/javascriptsource/nanoflowcommons/actions/FindObjectWithGUID.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/FindObjectWithGUID.js rename to module/javascriptsource/nanoflowcommons/actions/FindObjectWithGUID.js diff --git a/test/javascriptsource/nanoflowcommons/actions/GenerateUniqueID.js b/module/javascriptsource/nanoflowcommons/actions/GenerateUniqueID.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/GenerateUniqueID.js rename to module/javascriptsource/nanoflowcommons/actions/GenerateUniqueID.js diff --git a/test/javascriptsource/nanoflowcommons/actions/GenerateUniqueID.json b/module/javascriptsource/nanoflowcommons/actions/GenerateUniqueID.json similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/GenerateUniqueID.json rename to module/javascriptsource/nanoflowcommons/actions/GenerateUniqueID.json diff --git a/test/javascriptsource/nanoflowcommons/actions/Geocode.js b/module/javascriptsource/nanoflowcommons/actions/Geocode.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/Geocode.js rename to module/javascriptsource/nanoflowcommons/actions/Geocode.js diff --git a/test/javascriptsource/nanoflowcommons/actions/Geocode.json b/module/javascriptsource/nanoflowcommons/actions/Geocode.json similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/Geocode.json rename to module/javascriptsource/nanoflowcommons/actions/Geocode.json diff --git a/test/javascriptsource/nanoflowcommons/actions/GetCurrentLocation.js b/module/javascriptsource/nanoflowcommons/actions/GetCurrentLocation.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/GetCurrentLocation.js rename to module/javascriptsource/nanoflowcommons/actions/GetCurrentLocation.js diff --git a/test/javascriptsource/nanoflowcommons/actions/GetCurrentLocation.json b/module/javascriptsource/nanoflowcommons/actions/GetCurrentLocation.json similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/GetCurrentLocation.json rename to module/javascriptsource/nanoflowcommons/actions/GetCurrentLocation.json diff --git a/test/javascriptsource/nanoflowcommons/actions/GetCurrentLocationMinimumAccuracy.js b/module/javascriptsource/nanoflowcommons/actions/GetCurrentLocationMinimumAccuracy.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/GetCurrentLocationMinimumAccuracy.js rename to module/javascriptsource/nanoflowcommons/actions/GetCurrentLocationMinimumAccuracy.js diff --git a/test/javascriptsource/nanoflowcommons/actions/GetCurrentLocationMinimumAccuracy.json b/module/javascriptsource/nanoflowcommons/actions/GetCurrentLocationMinimumAccuracy.json similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/GetCurrentLocationMinimumAccuracy.json rename to module/javascriptsource/nanoflowcommons/actions/GetCurrentLocationMinimumAccuracy.json diff --git a/test/javascriptsource/nanoflowcommons/actions/GetGuid.js b/module/javascriptsource/nanoflowcommons/actions/GetGuid.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/GetGuid.js rename to module/javascriptsource/nanoflowcommons/actions/GetGuid.js diff --git a/test/javascriptsource/nanoflowcommons/actions/GetObjectByGuid.js b/module/javascriptsource/nanoflowcommons/actions/GetObjectByGuid.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/GetObjectByGuid.js rename to module/javascriptsource/nanoflowcommons/actions/GetObjectByGuid.js diff --git a/test/javascriptsource/nanoflowcommons/actions/GetPlatform.js b/module/javascriptsource/nanoflowcommons/actions/GetPlatform.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/GetPlatform.js rename to module/javascriptsource/nanoflowcommons/actions/GetPlatform.js diff --git a/test/javascriptsource/nanoflowcommons/actions/GetRemoteUrl.js b/module/javascriptsource/nanoflowcommons/actions/GetRemoteUrl.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/GetRemoteUrl.js rename to module/javascriptsource/nanoflowcommons/actions/GetRemoteUrl.js diff --git a/test/javascriptsource/nanoflowcommons/actions/GetStorageItemObject.js b/module/javascriptsource/nanoflowcommons/actions/GetStorageItemObject.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/GetStorageItemObject.js rename to module/javascriptsource/nanoflowcommons/actions/GetStorageItemObject.js diff --git a/test/javascriptsource/nanoflowcommons/actions/GetStorageItemObject.json b/module/javascriptsource/nanoflowcommons/actions/GetStorageItemObject.json similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/GetStorageItemObject.json rename to module/javascriptsource/nanoflowcommons/actions/GetStorageItemObject.json diff --git a/test/javascriptsource/nanoflowcommons/actions/GetStorageItemObjectList.js b/module/javascriptsource/nanoflowcommons/actions/GetStorageItemObjectList.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/GetStorageItemObjectList.js rename to module/javascriptsource/nanoflowcommons/actions/GetStorageItemObjectList.js diff --git a/test/javascriptsource/nanoflowcommons/actions/GetStorageItemObjectList.json b/module/javascriptsource/nanoflowcommons/actions/GetStorageItemObjectList.json similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/GetStorageItemObjectList.json rename to module/javascriptsource/nanoflowcommons/actions/GetStorageItemObjectList.json diff --git a/test/javascriptsource/nanoflowcommons/actions/GetStorageItemString.js b/module/javascriptsource/nanoflowcommons/actions/GetStorageItemString.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/GetStorageItemString.js rename to module/javascriptsource/nanoflowcommons/actions/GetStorageItemString.js diff --git a/test/javascriptsource/nanoflowcommons/actions/GetStorageItemString.json b/module/javascriptsource/nanoflowcommons/actions/GetStorageItemString.json similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/GetStorageItemString.json rename to module/javascriptsource/nanoflowcommons/actions/GetStorageItemString.json diff --git a/test/javascriptsource/nanoflowcommons/actions/GetStraightLineDistance.js b/module/javascriptsource/nanoflowcommons/actions/GetStraightLineDistance.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/GetStraightLineDistance.js rename to module/javascriptsource/nanoflowcommons/actions/GetStraightLineDistance.js diff --git a/test/javascriptsource/nanoflowcommons/actions/HideProgress.js b/module/javascriptsource/nanoflowcommons/actions/HideProgress.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/HideProgress.js rename to module/javascriptsource/nanoflowcommons/actions/HideProgress.js diff --git a/test/javascriptsource/nanoflowcommons/actions/IsConnectedToServer.js b/module/javascriptsource/nanoflowcommons/actions/IsConnectedToServer.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/IsConnectedToServer.js rename to module/javascriptsource/nanoflowcommons/actions/IsConnectedToServer.js diff --git a/test/javascriptsource/nanoflowcommons/actions/LICENSE b/module/javascriptsource/nanoflowcommons/actions/LICENSE similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/LICENSE rename to module/javascriptsource/nanoflowcommons/actions/LICENSE diff --git a/test/javascriptsource/nanoflowcommons/actions/NavigateTo.js b/module/javascriptsource/nanoflowcommons/actions/NavigateTo.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/NavigateTo.js rename to module/javascriptsource/nanoflowcommons/actions/NavigateTo.js diff --git a/test/javascriptsource/nanoflowcommons/actions/OpenMap.js b/module/javascriptsource/nanoflowcommons/actions/OpenMap.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/OpenMap.js rename to module/javascriptsource/nanoflowcommons/actions/OpenMap.js diff --git a/test/javascriptsource/nanoflowcommons/actions/OpenURL.js b/module/javascriptsource/nanoflowcommons/actions/OpenURL.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/OpenURL.js rename to module/javascriptsource/nanoflowcommons/actions/OpenURL.js diff --git a/test/javascriptsource/nanoflowcommons/actions/RefreshEntity.js b/module/javascriptsource/nanoflowcommons/actions/RefreshEntity.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/RefreshEntity.js rename to module/javascriptsource/nanoflowcommons/actions/RefreshEntity.js diff --git a/test/javascriptsource/nanoflowcommons/actions/RefreshObject.js b/module/javascriptsource/nanoflowcommons/actions/RefreshObject.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/RefreshObject.js rename to module/javascriptsource/nanoflowcommons/actions/RefreshObject.js diff --git a/test/javascriptsource/nanoflowcommons/actions/Reload.js b/module/javascriptsource/nanoflowcommons/actions/Reload.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/Reload.js rename to module/javascriptsource/nanoflowcommons/actions/Reload.js diff --git a/test/javascriptsource/nanoflowcommons/actions/RemoveStorageItem.js b/module/javascriptsource/nanoflowcommons/actions/RemoveStorageItem.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/RemoveStorageItem.js rename to module/javascriptsource/nanoflowcommons/actions/RemoveStorageItem.js diff --git a/test/javascriptsource/nanoflowcommons/actions/RemoveStorageItem.json b/module/javascriptsource/nanoflowcommons/actions/RemoveStorageItem.json similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/RemoveStorageItem.json rename to module/javascriptsource/nanoflowcommons/actions/RemoveStorageItem.json diff --git a/test/javascriptsource/nanoflowcommons/actions/RequestLocationPermission.js b/module/javascriptsource/nanoflowcommons/actions/RequestLocationPermission.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/RequestLocationPermission.js rename to module/javascriptsource/nanoflowcommons/actions/RequestLocationPermission.js diff --git a/test/javascriptsource/nanoflowcommons/actions/RequestLocationPermission.json b/module/javascriptsource/nanoflowcommons/actions/RequestLocationPermission.json similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/RequestLocationPermission.json rename to module/javascriptsource/nanoflowcommons/actions/RequestLocationPermission.json diff --git a/test/javascriptsource/nanoflowcommons/actions/ReverseGeocode.js b/module/javascriptsource/nanoflowcommons/actions/ReverseGeocode.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/ReverseGeocode.js rename to module/javascriptsource/nanoflowcommons/actions/ReverseGeocode.js diff --git a/test/javascriptsource/nanoflowcommons/actions/ReverseGeocode.json b/module/javascriptsource/nanoflowcommons/actions/ReverseGeocode.json similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/ReverseGeocode.json rename to module/javascriptsource/nanoflowcommons/actions/ReverseGeocode.json diff --git a/test/javascriptsource/nanoflowcommons/actions/SendTextMessage.js b/module/javascriptsource/nanoflowcommons/actions/SendTextMessage.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/SendTextMessage.js rename to module/javascriptsource/nanoflowcommons/actions/SendTextMessage.js diff --git a/test/javascriptsource/nanoflowcommons/actions/SetStorageItemObject.js b/module/javascriptsource/nanoflowcommons/actions/SetStorageItemObject.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/SetStorageItemObject.js rename to module/javascriptsource/nanoflowcommons/actions/SetStorageItemObject.js diff --git a/test/javascriptsource/nanoflowcommons/actions/SetStorageItemObject.json b/module/javascriptsource/nanoflowcommons/actions/SetStorageItemObject.json similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/SetStorageItemObject.json rename to module/javascriptsource/nanoflowcommons/actions/SetStorageItemObject.json diff --git a/test/javascriptsource/nanoflowcommons/actions/SetStorageItemObjectList.js b/module/javascriptsource/nanoflowcommons/actions/SetStorageItemObjectList.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/SetStorageItemObjectList.js rename to module/javascriptsource/nanoflowcommons/actions/SetStorageItemObjectList.js diff --git a/test/javascriptsource/nanoflowcommons/actions/SetStorageItemObjectList.json b/module/javascriptsource/nanoflowcommons/actions/SetStorageItemObjectList.json similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/SetStorageItemObjectList.json rename to module/javascriptsource/nanoflowcommons/actions/SetStorageItemObjectList.json diff --git a/test/javascriptsource/nanoflowcommons/actions/SetStorageItemString.js b/module/javascriptsource/nanoflowcommons/actions/SetStorageItemString.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/SetStorageItemString.js rename to module/javascriptsource/nanoflowcommons/actions/SetStorageItemString.js diff --git a/test/javascriptsource/nanoflowcommons/actions/SetStorageItemString.json b/module/javascriptsource/nanoflowcommons/actions/SetStorageItemString.json similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/SetStorageItemString.json rename to module/javascriptsource/nanoflowcommons/actions/SetStorageItemString.json diff --git a/test/javascriptsource/nanoflowcommons/actions/Share.js b/module/javascriptsource/nanoflowcommons/actions/Share.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/Share.js rename to module/javascriptsource/nanoflowcommons/actions/Share.js diff --git a/test/javascriptsource/nanoflowcommons/actions/ShowConfirmation.js b/module/javascriptsource/nanoflowcommons/actions/ShowConfirmation.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/ShowConfirmation.js rename to module/javascriptsource/nanoflowcommons/actions/ShowConfirmation.js diff --git a/test/javascriptsource/nanoflowcommons/actions/ShowProgress.js b/module/javascriptsource/nanoflowcommons/actions/ShowProgress.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/ShowProgress.js rename to module/javascriptsource/nanoflowcommons/actions/ShowProgress.js diff --git a/test/javascriptsource/nanoflowcommons/actions/SignIn.js b/module/javascriptsource/nanoflowcommons/actions/SignIn.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/SignIn.js rename to module/javascriptsource/nanoflowcommons/actions/SignIn.js diff --git a/test/javascriptsource/nanoflowcommons/actions/SignOut.js b/module/javascriptsource/nanoflowcommons/actions/SignOut.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/SignOut.js rename to module/javascriptsource/nanoflowcommons/actions/SignOut.js diff --git a/test/javascriptsource/nanoflowcommons/actions/StorageItemExists.js b/module/javascriptsource/nanoflowcommons/actions/StorageItemExists.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/StorageItemExists.js rename to module/javascriptsource/nanoflowcommons/actions/StorageItemExists.js diff --git a/test/javascriptsource/nanoflowcommons/actions/StorageItemExists.json b/module/javascriptsource/nanoflowcommons/actions/StorageItemExists.json similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/StorageItemExists.json rename to module/javascriptsource/nanoflowcommons/actions/StorageItemExists.json diff --git a/test/javascriptsource/nanoflowcommons/actions/TimeBetween.js b/module/javascriptsource/nanoflowcommons/actions/TimeBetween.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/TimeBetween.js rename to module/javascriptsource/nanoflowcommons/actions/TimeBetween.js diff --git a/test/javascriptsource/nanoflowcommons/actions/ToggleSidebar.js b/module/javascriptsource/nanoflowcommons/actions/ToggleSidebar.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/ToggleSidebar.js rename to module/javascriptsource/nanoflowcommons/actions/ToggleSidebar.js diff --git a/test/javascriptsource/nanoflowcommons/actions/Wait.js b/module/javascriptsource/nanoflowcommons/actions/Wait.js similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/Wait.js rename to module/javascriptsource/nanoflowcommons/actions/Wait.js diff --git a/test/javascriptsource/nanoflowcommons/actions/dependencies.json b/module/javascriptsource/nanoflowcommons/actions/dependencies.json similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/dependencies.json rename to module/javascriptsource/nanoflowcommons/actions/dependencies.json diff --git a/test/javascriptsource/nanoflowcommons/actions/dependencies.txt b/module/javascriptsource/nanoflowcommons/actions/dependencies.txt similarity index 100% rename from test/javascriptsource/nanoflowcommons/actions/dependencies.txt rename to module/javascriptsource/nanoflowcommons/actions/dependencies.txt diff --git a/test/javascriptsource/nativemobileresources/actions/BiometricAuthentication.js b/module/javascriptsource/nativemobileresources/actions/BiometricAuthentication.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/BiometricAuthentication.js rename to module/javascriptsource/nativemobileresources/actions/BiometricAuthentication.js diff --git a/test/javascriptsource/nativemobileresources/actions/BiometricAuthentication.json b/module/javascriptsource/nativemobileresources/actions/BiometricAuthentication.json similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/BiometricAuthentication.json rename to module/javascriptsource/nativemobileresources/actions/BiometricAuthentication.json diff --git a/test/javascriptsource/nativemobileresources/actions/CancelAllScheduledNotifications.js b/module/javascriptsource/nativemobileresources/actions/CancelAllScheduledNotifications.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/CancelAllScheduledNotifications.js rename to module/javascriptsource/nativemobileresources/actions/CancelAllScheduledNotifications.js diff --git a/test/javascriptsource/nativemobileresources/actions/CancelAllScheduledNotifications.json b/module/javascriptsource/nativemobileresources/actions/CancelAllScheduledNotifications.json similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/CancelAllScheduledNotifications.json rename to module/javascriptsource/nativemobileresources/actions/CancelAllScheduledNotifications.json diff --git a/test/javascriptsource/nativemobileresources/actions/CancelScheduledNotification.js b/module/javascriptsource/nativemobileresources/actions/CancelScheduledNotification.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/CancelScheduledNotification.js rename to module/javascriptsource/nativemobileresources/actions/CancelScheduledNotification.js diff --git a/test/javascriptsource/nativemobileresources/actions/CancelScheduledNotification.json b/module/javascriptsource/nativemobileresources/actions/CancelScheduledNotification.json similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/CancelScheduledNotification.json rename to module/javascriptsource/nativemobileresources/actions/CancelScheduledNotification.json diff --git a/test/javascriptsource/nativemobileresources/actions/ChangeStatusBar.js b/module/javascriptsource/nativemobileresources/actions/ChangeStatusBar.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/ChangeStatusBar.js rename to module/javascriptsource/nativemobileresources/actions/ChangeStatusBar.js diff --git a/test/javascriptsource/nativemobileresources/actions/ClearAllDeliveredNotifications.js b/module/javascriptsource/nativemobileresources/actions/ClearAllDeliveredNotifications.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/ClearAllDeliveredNotifications.js rename to module/javascriptsource/nativemobileresources/actions/ClearAllDeliveredNotifications.js diff --git a/test/javascriptsource/nativemobileresources/actions/ClearAllDeliveredNotifications.json b/module/javascriptsource/nativemobileresources/actions/ClearAllDeliveredNotifications.json similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/ClearAllDeliveredNotifications.json rename to module/javascriptsource/nativemobileresources/actions/ClearAllDeliveredNotifications.json diff --git a/test/javascriptsource/nativemobileresources/actions/DisplayNotification.js b/module/javascriptsource/nativemobileresources/actions/DisplayNotification.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/DisplayNotification.js rename to module/javascriptsource/nativemobileresources/actions/DisplayNotification.js diff --git a/test/javascriptsource/nativemobileresources/actions/DisplayNotification.json b/module/javascriptsource/nativemobileresources/actions/DisplayNotification.json similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/DisplayNotification.json rename to module/javascriptsource/nativemobileresources/actions/DisplayNotification.json diff --git a/test/javascriptsource/nativemobileresources/actions/DownloadFile.js b/module/javascriptsource/nativemobileresources/actions/DownloadFile.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/DownloadFile.js rename to module/javascriptsource/nativemobileresources/actions/DownloadFile.js diff --git a/test/javascriptsource/nativemobileresources/actions/DownloadFile.json b/module/javascriptsource/nativemobileresources/actions/DownloadFile.json similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/DownloadFile.json rename to module/javascriptsource/nativemobileresources/actions/DownloadFile.json diff --git a/test/javascriptsource/nativemobileresources/actions/GetClipboardContent.js b/module/javascriptsource/nativemobileresources/actions/GetClipboardContent.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/GetClipboardContent.js rename to module/javascriptsource/nativemobileresources/actions/GetClipboardContent.js diff --git a/test/javascriptsource/nativemobileresources/actions/GetDeviceInfo.js b/module/javascriptsource/nativemobileresources/actions/GetDeviceInfo.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/GetDeviceInfo.js rename to module/javascriptsource/nativemobileresources/actions/GetDeviceInfo.js diff --git a/test/javascriptsource/nativemobileresources/actions/GetDeviceInfo.json b/module/javascriptsource/nativemobileresources/actions/GetDeviceInfo.json similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/GetDeviceInfo.json rename to module/javascriptsource/nativemobileresources/actions/GetDeviceInfo.json diff --git a/test/javascriptsource/nativemobileresources/actions/GetPushNotificationToken.js b/module/javascriptsource/nativemobileresources/actions/GetPushNotificationToken.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/GetPushNotificationToken.js rename to module/javascriptsource/nativemobileresources/actions/GetPushNotificationToken.js diff --git a/test/javascriptsource/nativemobileresources/actions/GetPushNotificationToken.json b/module/javascriptsource/nativemobileresources/actions/GetPushNotificationToken.json similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/GetPushNotificationToken.json rename to module/javascriptsource/nativemobileresources/actions/GetPushNotificationToken.json diff --git a/test/javascriptsource/nativemobileresources/actions/HasNotificationPermission.js b/module/javascriptsource/nativemobileresources/actions/HasNotificationPermission.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/HasNotificationPermission.js rename to module/javascriptsource/nativemobileresources/actions/HasNotificationPermission.js diff --git a/test/javascriptsource/nativemobileresources/actions/HideKeyboard.js b/module/javascriptsource/nativemobileresources/actions/HideKeyboard.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/HideKeyboard.js rename to module/javascriptsource/nativemobileresources/actions/HideKeyboard.js diff --git a/test/javascriptsource/nativemobileresources/actions/IsBiometricAuthenticationSupported.js b/module/javascriptsource/nativemobileresources/actions/IsBiometricAuthenticationSupported.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/IsBiometricAuthenticationSupported.js rename to module/javascriptsource/nativemobileresources/actions/IsBiometricAuthenticationSupported.js diff --git a/test/javascriptsource/nativemobileresources/actions/IsBiometricAuthenticationSupported.json b/module/javascriptsource/nativemobileresources/actions/IsBiometricAuthenticationSupported.json similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/IsBiometricAuthenticationSupported.json rename to module/javascriptsource/nativemobileresources/actions/IsBiometricAuthenticationSupported.json diff --git a/test/javascriptsource/nativemobileresources/actions/IsCellularConnection.js b/module/javascriptsource/nativemobileresources/actions/IsCellularConnection.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/IsCellularConnection.js rename to module/javascriptsource/nativemobileresources/actions/IsCellularConnection.js diff --git a/test/javascriptsource/nativemobileresources/actions/IsCellularConnection.json b/module/javascriptsource/nativemobileresources/actions/IsCellularConnection.json similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/IsCellularConnection.json rename to module/javascriptsource/nativemobileresources/actions/IsCellularConnection.json diff --git a/test/javascriptsource/nativemobileresources/actions/IsConnected.js b/module/javascriptsource/nativemobileresources/actions/IsConnected.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/IsConnected.js rename to module/javascriptsource/nativemobileresources/actions/IsConnected.js diff --git a/test/javascriptsource/nativemobileresources/actions/IsConnected.json b/module/javascriptsource/nativemobileresources/actions/IsConnected.json similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/IsConnected.json rename to module/javascriptsource/nativemobileresources/actions/IsConnected.json diff --git a/test/javascriptsource/nativemobileresources/actions/IsWifiConnection.js b/module/javascriptsource/nativemobileresources/actions/IsWifiConnection.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/IsWifiConnection.js rename to module/javascriptsource/nativemobileresources/actions/IsWifiConnection.js diff --git a/test/javascriptsource/nativemobileresources/actions/IsWifiConnection.json b/module/javascriptsource/nativemobileresources/actions/IsWifiConnection.json similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/IsWifiConnection.json rename to module/javascriptsource/nativemobileresources/actions/IsWifiConnection.json diff --git a/test/javascriptsource/nativemobileresources/actions/OpenInAppBrowser.js b/module/javascriptsource/nativemobileresources/actions/OpenInAppBrowser.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/OpenInAppBrowser.js rename to module/javascriptsource/nativemobileresources/actions/OpenInAppBrowser.js diff --git a/test/javascriptsource/nativemobileresources/actions/OpenInAppBrowser.json b/module/javascriptsource/nativemobileresources/actions/OpenInAppBrowser.json similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/OpenInAppBrowser.json rename to module/javascriptsource/nativemobileresources/actions/OpenInAppBrowser.json diff --git a/test/javascriptsource/nativemobileresources/actions/ParseUrlToObject.js b/module/javascriptsource/nativemobileresources/actions/ParseUrlToObject.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/ParseUrlToObject.js rename to module/javascriptsource/nativemobileresources/actions/ParseUrlToObject.js diff --git a/test/javascriptsource/nativemobileresources/actions/PlaySound.js b/module/javascriptsource/nativemobileresources/actions/PlaySound.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/PlaySound.js rename to module/javascriptsource/nativemobileresources/actions/PlaySound.js diff --git a/test/javascriptsource/nativemobileresources/actions/PlaySound.json b/module/javascriptsource/nativemobileresources/actions/PlaySound.json similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/PlaySound.json rename to module/javascriptsource/nativemobileresources/actions/PlaySound.json diff --git a/test/javascriptsource/nativemobileresources/actions/RegisterDeepLink.js b/module/javascriptsource/nativemobileresources/actions/RegisterDeepLink.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/RegisterDeepLink.js rename to module/javascriptsource/nativemobileresources/actions/RegisterDeepLink.js diff --git a/test/javascriptsource/nativemobileresources/actions/RequestGenericPermission.js b/module/javascriptsource/nativemobileresources/actions/RequestGenericPermission.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/RequestGenericPermission.js rename to module/javascriptsource/nativemobileresources/actions/RequestGenericPermission.js diff --git a/test/javascriptsource/nativemobileresources/actions/RequestGenericPermission.json b/module/javascriptsource/nativemobileresources/actions/RequestGenericPermission.json similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/RequestGenericPermission.json rename to module/javascriptsource/nativemobileresources/actions/RequestGenericPermission.json diff --git a/test/javascriptsource/nativemobileresources/actions/RequestNotificationPermission.js b/module/javascriptsource/nativemobileresources/actions/RequestNotificationPermission.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/RequestNotificationPermission.js rename to module/javascriptsource/nativemobileresources/actions/RequestNotificationPermission.js diff --git a/test/javascriptsource/nativemobileresources/actions/RequestNotificationPermission.json b/module/javascriptsource/nativemobileresources/actions/RequestNotificationPermission.json similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/RequestNotificationPermission.json rename to module/javascriptsource/nativemobileresources/actions/RequestNotificationPermission.json diff --git a/test/javascriptsource/nativemobileresources/actions/SaveToPictureLibrary.js b/module/javascriptsource/nativemobileresources/actions/SaveToPictureLibrary.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/SaveToPictureLibrary.js rename to module/javascriptsource/nativemobileresources/actions/SaveToPictureLibrary.js diff --git a/test/javascriptsource/nativemobileresources/actions/SaveToPictureLibrary.json b/module/javascriptsource/nativemobileresources/actions/SaveToPictureLibrary.json similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/SaveToPictureLibrary.json rename to module/javascriptsource/nativemobileresources/actions/SaveToPictureLibrary.json diff --git a/test/javascriptsource/nativemobileresources/actions/ScheduleNotification.js b/module/javascriptsource/nativemobileresources/actions/ScheduleNotification.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/ScheduleNotification.js rename to module/javascriptsource/nativemobileresources/actions/ScheduleNotification.js diff --git a/test/javascriptsource/nativemobileresources/actions/ScheduleNotification.json b/module/javascriptsource/nativemobileresources/actions/ScheduleNotification.json similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/ScheduleNotification.json rename to module/javascriptsource/nativemobileresources/actions/ScheduleNotification.json diff --git a/test/javascriptsource/nativemobileresources/actions/SetBadgeNumber.js b/module/javascriptsource/nativemobileresources/actions/SetBadgeNumber.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/SetBadgeNumber.js rename to module/javascriptsource/nativemobileresources/actions/SetBadgeNumber.js diff --git a/test/javascriptsource/nativemobileresources/actions/SetBadgeNumber.json b/module/javascriptsource/nativemobileresources/actions/SetBadgeNumber.json similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/SetBadgeNumber.json rename to module/javascriptsource/nativemobileresources/actions/SetBadgeNumber.json diff --git a/test/javascriptsource/nativemobileresources/actions/SetClipboardContent.js b/module/javascriptsource/nativemobileresources/actions/SetClipboardContent.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/SetClipboardContent.js rename to module/javascriptsource/nativemobileresources/actions/SetClipboardContent.js diff --git a/test/javascriptsource/nativemobileresources/actions/TakePicture.js b/module/javascriptsource/nativemobileresources/actions/TakePicture.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/TakePicture.js rename to module/javascriptsource/nativemobileresources/actions/TakePicture.js diff --git a/test/javascriptsource/nativemobileresources/actions/TakePicture.json b/module/javascriptsource/nativemobileresources/actions/TakePicture.json similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/TakePicture.json rename to module/javascriptsource/nativemobileresources/actions/TakePicture.json diff --git a/test/javascriptsource/nativemobileresources/actions/TakePictureAdvanced.js b/module/javascriptsource/nativemobileresources/actions/TakePictureAdvanced.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/TakePictureAdvanced.js rename to module/javascriptsource/nativemobileresources/actions/TakePictureAdvanced.js diff --git a/test/javascriptsource/nativemobileresources/actions/TakePictureAdvanced.json b/module/javascriptsource/nativemobileresources/actions/TakePictureAdvanced.json similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/TakePictureAdvanced.json rename to module/javascriptsource/nativemobileresources/actions/TakePictureAdvanced.json diff --git a/test/javascriptsource/nativemobileresources/actions/Vibrate.js b/module/javascriptsource/nativemobileresources/actions/Vibrate.js similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/Vibrate.js rename to module/javascriptsource/nativemobileresources/actions/Vibrate.js diff --git a/test/javascriptsource/nativemobileresources/actions/dependencies.json b/module/javascriptsource/nativemobileresources/actions/dependencies.json similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/dependencies.json rename to module/javascriptsource/nativemobileresources/actions/dependencies.json diff --git a/test/javascriptsource/nativemobileresources/actions/dependencies.txt b/module/javascriptsource/nativemobileresources/actions/dependencies.txt similarity index 100% rename from test/javascriptsource/nativemobileresources/actions/dependencies.txt rename to module/javascriptsource/nativemobileresources/actions/dependencies.txt diff --git a/test/javascriptsource/pushnotifications/actions/RegisterForPushNotificationsWeb.js b/module/javascriptsource/pushnotifications/actions/RegisterForPushNotificationsWeb.js similarity index 100% rename from test/javascriptsource/pushnotifications/actions/RegisterForPushNotificationsWeb.js rename to module/javascriptsource/pushnotifications/actions/RegisterForPushNotificationsWeb.js diff --git a/test/javasource/communitycommons/DateTime.java b/module/javasource/communitycommons/DateTime.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/DateTime.java rename to module/javasource/communitycommons/DateTime.java diff --git a/test/javasource/communitycommons/ImmutablePair.java b/module/javasource/communitycommons/ImmutablePair.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/ImmutablePair.java rename to module/javasource/communitycommons/ImmutablePair.java diff --git a/test/javasource/communitycommons/Logging.java b/module/javasource/communitycommons/Logging.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/Logging.java rename to module/javasource/communitycommons/Logging.java diff --git a/test/javasource/communitycommons/Misc.java b/module/javasource/communitycommons/Misc.java old mode 100755 new mode 100644 similarity index 98% rename from test/javasource/communitycommons/Misc.java rename to module/javasource/communitycommons/Misc.java index fffc18dd..8adb165d --- a/test/javasource/communitycommons/Misc.java +++ b/module/javasource/communitycommons/Misc.java @@ -63,11 +63,11 @@ public abstract static class IterateCallback { public abstract void hit(T1 key, T2 value) throws Exception; - public void exit() { + synchronized public void exit() { stop = true; } - public void remove() { + synchronized public void remove() { mapIter.remove(); } @@ -674,18 +674,19 @@ public static boolean overlayPdf(IContext context, IMendixObject generatedDocume Logging.trace(LOGNODE, "Overlay PDF start, retrieve overlay PDF"); Logging.trace(LOGNODE, "Perform overlay"); - Overlay overlay = new Overlay(); - overlay.setInputPDF(inputDoc); - overlay.setDefaultOverlayPDF(overlayDoc); - if (onTopOfContent == true) { - overlay.setOverlayPosition(Overlay.Position.FOREGROUND); - } else { - overlay.setOverlayPosition(Overlay.Position.BACKGROUND); - } + try (Overlay overlay = new Overlay()) { + overlay.setInputPDF(inputDoc); + overlay.setDefaultOverlayPDF(overlayDoc); + if (onTopOfContent) { + overlay.setOverlayPosition(Overlay.Position.FOREGROUND); + } else { + overlay.setOverlayPosition(Overlay.Position.BACKGROUND); + } - Logging.trace(LOGNODE, "Save result in output stream"); + Logging.trace(LOGNODE, "Save result in output stream"); - overlay.overlay(new HashMap<>()).save(baos); + overlay.overlay(new HashMap<>()).save(baos); + } Logging.trace(LOGNODE, "Duplicate result in input stream"); try (InputStream overlayedContent = new ByteArrayInputStream(baos.toByteArray())) { diff --git a/test/javasource/communitycommons/ORM.java b/module/javasource/communitycommons/ORM.java old mode 100755 new mode 100644 similarity index 97% rename from test/javasource/communitycommons/ORM.java rename to module/javasource/communitycommons/ORM.java index f666e32e..5ad0af95 --- a/test/javasource/communitycommons/ORM.java +++ b/module/javasource/communitycommons/ORM.java @@ -265,6 +265,11 @@ private static boolean isFileDocument(IMendixObject object) { public static Boolean cloneObject(IContext c, IMendixObject source, IMendixObject target, Boolean withAssociations) { + return cloneObject(c, source, target, withAssociations, false); + } + + public static Boolean cloneObject(IContext c, IMendixObject source, + IMendixObject target, Boolean withAssociations, Boolean skipIsBoth) { Map> members = source.getMembers(c); for (var entry : members.entrySet()) { @@ -279,6 +284,10 @@ public static Boolean cloneObject(IContext c, IMendixObject source, continue; } if (withAssociations || ((!(m instanceof MendixObjectReference) && !(m instanceof MendixObjectReferenceSet) && !(m instanceof MendixAutoNumber)))) { + if (skipIsBoth && ( + (m instanceof MendixObjectReference && ((MendixObjectReference) m).isBoth()) || + (m instanceof MendixObjectReferenceSet && ((MendixObjectReferenceSet) m).isBoth()))) + continue; target.setValue(c, entry.getKey(), m.getValue(c)); } } diff --git a/test/javasource/communitycommons/StringUtils.java b/module/javasource/communitycommons/StringUtils.java old mode 100755 new mode 100644 similarity index 87% rename from test/javasource/communitycommons/StringUtils.java rename to module/javasource/communitycommons/StringUtils.java index 8caf6711..624d054f --- a/test/javasource/communitycommons/StringUtils.java +++ b/module/javasource/communitycommons/StringUtils.java @@ -36,6 +36,7 @@ import javax.swing.text.html.parser.ParserDelegator; import org.apache.commons.io.IOUtils; +import org.apache.commons.io.input.BOMInputStream; import org.apache.commons.text.StringEscapeUtils; import org.owasp.html.PolicyFactory; import org.owasp.html.Sanitizers; @@ -48,7 +49,8 @@ public class StringUtils { private static final String UPPERCASE_ALPHA = stringRange('A', 'Z'); private static final String LOWERCASE_ALPHA = stringRange('a', 'z'); private static final String DIGITS = stringRange('0', '9'); - private static final String SPECIAL = stringRange('!', '/'); + // Used in tests as well + static final String SPECIAL = stringRange('!', '/'); private static final String ALPHANUMERIC = UPPERCASE_ALPHA + LOWERCASE_ALPHA + DIGITS; static final Map SANITIZER_POLICIES = @@ -63,6 +65,12 @@ public class StringUtils { public static final String HASH_ALGORITHM = "SHA-256"; + public static String hash(String value) throws NoSuchAlgorithmException, DigestException { + int LENGTH = 32; + return hash(value, LENGTH); + } + + @Deprecated public static String hash(String value, int length) throws NoSuchAlgorithmException, DigestException { byte[] inBytes = value.getBytes(StandardCharsets.UTF_8); byte[] outBytes = new byte[length]; @@ -215,10 +223,14 @@ public static String stringFromFile(IContext context, FileDocument source, Chars return null; } try (InputStream f = Core.getFileDocumentContent(context, source.getMendixObject())) { - return IOUtils.toString(f, charset); + return stringFromInputStream(f, charset); } } + public static String stringFromInputStream(InputStream inputStream, Charset charset) throws IOException { + return IOUtils.toString(BOMInputStream.builder().setInputStream(inputStream).get(), charset); + } + public static void stringToFile(IContext context, String value, FileDocument destination) throws IOException { stringToFile(context, value, destination, StandardCharsets.UTF_8); } @@ -279,16 +291,17 @@ public void handleEndTag(HTML.Tag tag, int pos) { } /** - * Returns a random strong password containing a specified minimum number of digits, uppercase - * and special characters. + * Returns a random strong password containing a specified minimum number of uppercase, digits + * and the exact number of special characters. * * @param minLen Minimum length * @param maxLen Maximum length - * @param noOfCAPSAlpha Number of capitals - * @param noOfDigits Number of digits - * @param noOfSplChars Number of special characters - * @return + * @param noOfCAPSAlpha Minimum number of capitals + * @param noOfDigits Minimum number of digits + * @param noOfSplChars Exact number of special characters + * @deprecated Use the overload randomStrongPassword instead */ + @Deprecated public static String randomStrongPassword(int minLen, int maxLen, int noOfCAPSAlpha, int noOfDigits, int noOfSplChars) { if (minLen > maxLen) { throw new IllegalArgumentException("Min. Length > Max. Length!"); @@ -296,22 +309,45 @@ public static String randomStrongPassword(int minLen, int maxLen, int noOfCAPSAl if ((noOfCAPSAlpha + noOfDigits + noOfSplChars) > minLen) { throw new IllegalArgumentException("Min. Length should be atleast sum of (CAPS, DIGITS, SPL CHARS) Length!"); } - return generateCommonLangPassword(minLen, maxLen, noOfCAPSAlpha, noOfDigits, noOfSplChars); + return generateCommonLangPassword(minLen, maxLen, noOfCAPSAlpha, 0, noOfDigits, noOfSplChars); + } + + /** + * Returns a random strong password containing a specified minimum number of uppercase, lowercase, digits + * and the exact number of special characters. + * + * @param minLen Minimum length + * @param maxLen Maximum length + * @param noOfCAPSAlpha Minimum number of capitals + * @param noOfLowercaseAlpha Minimum number of lowercase letters + * @param noOfDigits Minimum number of digits + * @param noOfSplChars Exact number of special characters + */ + public static String randomStrongPassword(int minLen, int maxLen, int noOfCAPSAlpha, int noOfLowercaseAlpha, int noOfDigits, int noOfSplChars) { + if (minLen > maxLen) { + throw new IllegalArgumentException("Min. Length > Max. Length!"); + } + if ((noOfCAPSAlpha + noOfLowercaseAlpha + noOfDigits + noOfSplChars) > minLen) { + throw new IllegalArgumentException("Min. Length should be atleast sum of (CAPS, LOWER, DIGITS, SPL CHARS) Length!"); + } + return generateCommonLangPassword(minLen, maxLen, noOfCAPSAlpha, noOfLowercaseAlpha, noOfDigits, noOfSplChars); } // See https://www.baeldung.com/java-generate-secure-password // Implementation inspired by https://github.com/eugenp/tutorials/tree/master/core-java-modules/core-java-string-apis (under MIT license) - private static String generateCommonLangPassword(int minLen, int maxLen, int noOfCapsAlpha, int noOfDigits, int noOfSplChars) { + private static String generateCommonLangPassword(int minLen, int maxLen, int noOfCapsAlpha, int noOfLowercaseAlpha, int noOfDigits, int noOfSplChars) { String upperCaseLetters = randomStringFromCharArray(noOfCapsAlpha, UPPERCASE_ALPHA.toCharArray()); + String lowerCaseLetters = randomStringFromCharArray(noOfLowercaseAlpha, LOWERCASE_ALPHA.toCharArray()); String numbers = randomStringFromCharArray(noOfDigits, DIGITS.toCharArray()); String specialChar = randomStringFromCharArray(noOfSplChars, SPECIAL.toCharArray()); - final int fixedNumber = noOfCapsAlpha + noOfDigits + noOfSplChars; + final int fixedNumber = noOfCapsAlpha + noOfLowercaseAlpha + noOfDigits + noOfSplChars; final int lowerBound = minLen - fixedNumber; final int upperBound = maxLen - fixedNumber; String totalChars = randomStringFromCharArray(lowerBound, upperBound, ALPHANUMERIC.toCharArray()); String combinedChars = upperCaseLetters + .concat(lowerCaseLetters) .concat(numbers) .concat(specialChar) .concat(totalChars); @@ -462,7 +498,12 @@ public static String sanitizeHTML(String html, List policyParam PolicyFactory policyFactory = null; for (SanitizerPolicy param : policyParams) { - policyFactory = (policyFactory == null) ? SANITIZER_POLICIES.get(param.name()) : policyFactory.and(SANITIZER_POLICIES.get(param.name())); + PolicyFactory policyFactoryForParam = SANITIZER_POLICIES.get(param.name()); + policyFactory = (policyFactory == null) ? policyFactoryForParam : policyFactory.and(policyFactoryForParam); + } + + if (policyFactory == null) { + throw new IllegalArgumentException("Sanitizer policy not found."); } return sanitizeHTML(html, policyFactory); diff --git a/test/javasource/communitycommons/UserThrownException.java b/module/javasource/communitycommons/UserThrownException.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/UserThrownException.java rename to module/javasource/communitycommons/UserThrownException.java diff --git a/test/javasource/communitycommons/XPath.java b/module/javasource/communitycommons/XPath.java old mode 100755 new mode 100644 similarity index 99% rename from test/javasource/communitycommons/XPath.java rename to module/javasource/communitycommons/XPath.java index 5fa0fe1f..e6f41eeb --- a/test/javasource/communitycommons/XPath.java +++ b/module/javasource/communitycommons/XPath.java @@ -528,7 +528,7 @@ public T firstOrWait(long timeoutMSecs) throws CoreException, InterruptedExcepti break; if (loopcount % 5 == 0) - sleepamount *= 1.5; + sleepamount = (int)(sleepamount * 1.5); // not expired, wait a bit if (result == null) diff --git a/test/javasource/communitycommons/actions/Base64Decode.java b/module/javasource/communitycommons/actions/Base64Decode.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/Base64Decode.java rename to module/javasource/communitycommons/actions/Base64Decode.java diff --git a/test/javasource/communitycommons/actions/Base64DecodeToFile.java b/module/javasource/communitycommons/actions/Base64DecodeToFile.java old mode 100755 new mode 100644 similarity index 95% rename from test/javasource/communitycommons/actions/Base64DecodeToFile.java rename to module/javasource/communitycommons/actions/Base64DecodeToFile.java index de771b8c..83ddef4e --- a/test/javasource/communitycommons/actions/Base64DecodeToFile.java +++ b/module/javasource/communitycommons/actions/Base64DecodeToFile.java @@ -1,58 +1,58 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IMendixObject; -import communitycommons.StringUtils; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Stores an base 64 encoded string plain in the provided target file document - * - * Note that targetFile will be committed. - */ -public class Base64DecodeToFile extends CustomJavaAction -{ - private java.lang.String encoded; - private IMendixObject __targetFile; - private system.proxies.FileDocument targetFile; - - public Base64DecodeToFile(IContext context, java.lang.String encoded, IMendixObject targetFile) - { - super(context); - this.encoded = encoded; - this.__targetFile = targetFile; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - this.targetFile = this.__targetFile == null ? null : system.proxies.FileDocument.initialize(getContext(), __targetFile); - - // BEGIN USER CODE - StringUtils.base64DecodeToFile(getContext(), encoded, targetFile); - return true; - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "Base64DecodeToFile"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IMendixObject; +import communitycommons.StringUtils; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Stores an base 64 encoded string plain in the provided target file document + * + * Note that targetFile will be committed. + */ +public class Base64DecodeToFile extends CustomJavaAction +{ + private java.lang.String encoded; + private IMendixObject __targetFile; + private system.proxies.FileDocument targetFile; + + public Base64DecodeToFile(IContext context, java.lang.String encoded, IMendixObject targetFile) + { + super(context); + this.encoded = encoded; + this.__targetFile = targetFile; + } + + @java.lang.Override + public java.lang.Boolean executeAction() throws Exception + { + this.targetFile = this.__targetFile == null ? null : system.proxies.FileDocument.initialize(getContext(), __targetFile); + + // BEGIN USER CODE + StringUtils.base64DecodeToFile(getContext(), encoded, targetFile); + return true; + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "Base64DecodeToFile"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/Base64Encode.java b/module/javasource/communitycommons/actions/Base64Encode.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/Base64Encode.java rename to module/javasource/communitycommons/actions/Base64Encode.java diff --git a/test/javasource/communitycommons/actions/Base64EncodeFile.java b/module/javasource/communitycommons/actions/Base64EncodeFile.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/Base64EncodeFile.java rename to module/javasource/communitycommons/actions/Base64EncodeFile.java diff --git a/test/javasource/communitycommons/actions/Clone.java b/module/javasource/communitycommons/actions/Clone.java old mode 100755 new mode 100644 similarity index 88% rename from test/javasource/communitycommons/actions/Clone.java rename to module/javasource/communitycommons/actions/Clone.java index a069edc5..4931dd6b --- a/test/javasource/communitycommons/actions/Clone.java +++ b/module/javasource/communitycommons/actions/Clone.java @@ -1,60 +1,60 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IMendixObject; -import communitycommons.ORM; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Clones objects - * - * - Source: the original object to copy - * - Target: the object to copy it into (should be of the same type, or a specialization) - * - includeAssociations: whether to clone associations. - * - * If associated objects need to be cloned as well, use deepClone, this function only copies the references, not the reffered objects. Target is not committed automatically. - */ -public class Clone extends CustomJavaAction -{ - private IMendixObject source; - private IMendixObject target; - private java.lang.Boolean withAssociations; - - public Clone(IContext context, IMendixObject source, IMendixObject target, java.lang.Boolean withAssociations) - { - super(context); - this.source = source; - this.target = target; - this.withAssociations = withAssociations; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - return ORM.cloneObject(this.getContext(), source, target, withAssociations); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "Clone"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IMendixObject; +import communitycommons.ORM; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Clones objects + * + * - Source: the original object to copy + * - Target: the object to copy it into (should be of the same type, or a specialization) + * - includeAssociations: whether to clone associations. + * + * If associated objects need to be cloned as well, use deepClone, this function only copies the references, not the reffered objects. Target is not committed automatically. + */ +public class Clone extends CustomJavaAction +{ + private IMendixObject source; + private IMendixObject target; + private java.lang.Boolean withAssociations; + + public Clone(IContext context, IMendixObject source, IMendixObject target, java.lang.Boolean withAssociations) + { + super(context); + this.source = source; + this.target = target; + this.withAssociations = withAssociations; + } + + @java.lang.Override + public java.lang.Boolean executeAction() throws Exception + { + // BEGIN USER CODE + return ORM.cloneObject(this.getContext(), source, target, withAssociations); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "Clone"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/CreateLogNode.java b/module/javasource/communitycommons/actions/CreateLogNode.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/CreateLogNode.java rename to module/javasource/communitycommons/actions/CreateLogNode.java diff --git a/test/javasource/communitycommons/actions/DateTimeToLong.java b/module/javasource/communitycommons/actions/DateTimeToLong.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/DateTimeToLong.java rename to module/javasource/communitycommons/actions/DateTimeToLong.java diff --git a/test/javasource/communitycommons/actions/DeepClone.java b/module/javasource/communitycommons/actions/DeepClone.java old mode 100755 new mode 100644 similarity index 89% rename from test/javasource/communitycommons/actions/DeepClone.java rename to module/javasource/communitycommons/actions/DeepClone.java index 2a78848c..ab07c679 --- a/test/javasource/communitycommons/actions/DeepClone.java +++ b/module/javasource/communitycommons/actions/DeepClone.java @@ -1,87 +1,87 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IMendixObject; -import communitycommons.ORM; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Clones objects, their associations and even referred objects. - * - * - Source: the original object to copy - * - Target: the object to copy it into (should be of the same type, or a specialization) - * - MembersToSkip: members which should not be set at all - * - MembersToKeep: references which should be set, but not cloned. (so source and target will refer to exactly the same object). If an association is not part of this property, it will be cloned. - * - ReverseAssociations: 1 - 0 assications which refer to target, which will be cloned as well. Only the reference name itself needs to be mentioned. - * - excludeEntities: entities that will not be cloned. references to these entities will refer to the same object as the source did. - * - excludeModules: modules that will have none of their enities cloned. Behaves similar to excludeEntities. - * - * members format: or or , where objecttype is the concrete type of the object being cloned. - * - * reverseAssociation: - * - * - * membersToSkip by automatically contains createdDate and changedDate. - * membersToKeep by automatically contains System.owner and System.changedBy - * - * Note that DeepClone does commit all objects, where Clone does not. - */ -public class DeepClone extends CustomJavaAction -{ - private IMendixObject source; - private IMendixObject target; - private java.lang.String membersToSkip; - private java.lang.String membersToKeep; - private java.lang.String reverseAssociations; - private java.lang.String excludeEntities; - private java.lang.String excludeModules; - - public DeepClone(IContext context, IMendixObject source, IMendixObject target, java.lang.String membersToSkip, java.lang.String membersToKeep, java.lang.String reverseAssociations, java.lang.String excludeEntities, java.lang.String excludeModules) - { - super(context); - this.source = source; - this.target = target; - this.membersToSkip = membersToSkip; - this.membersToKeep = membersToKeep; - this.reverseAssociations = reverseAssociations; - this.excludeEntities = excludeEntities; - this.excludeModules = excludeModules; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - java.lang.String membersToSkip = this.membersToSkip == null ? "" : this.membersToSkip; - java.lang.String membersToKeep = this.membersToKeep == null ? "" : this.membersToKeep; - java.lang.String reverseAssociations = this.reverseAssociations == null ? "" : this.reverseAssociations; - java.lang.String excludeEntities = this.excludeEntities == null ? "" : this.excludeEntities; - java.lang.String excludeModules = this.excludeModules == null ? "" : this.excludeModules; - - ORM.deepClone(getContext(), source, target, membersToSkip, membersToKeep, reverseAssociations, excludeEntities, excludeModules); - return true; - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "DeepClone"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IMendixObject; +import communitycommons.ORM; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Clones objects, their associations and even referred objects. + * + * - Source: the original object to copy + * - Target: the object to copy it into (should be of the same type, or a specialization) + * - MembersToSkip: members which should not be set at all + * - MembersToKeep: references which should be set, but not cloned. (so source and target will refer to exactly the same object). If an association is not part of this property, it will be cloned. + * - ReverseAssociations: 1 - 0 assications which refer to target, which will be cloned as well. Only the reference name itself needs to be mentioned. + * - excludeEntities: entities that will not be cloned. references to these entities will refer to the same object as the source did. + * - excludeModules: modules that will have none of their enities cloned. Behaves similar to excludeEntities. + * + * members format: or or , where objecttype is the concrete type of the object being cloned. + * + * reverseAssociation: + * + * + * membersToSkip by automatically contains createdDate and changedDate. + * membersToKeep by automatically contains System.owner and System.changedBy + * + * Note that DeepClone does commit all objects, where Clone does not. + */ +public class DeepClone extends CustomJavaAction +{ + private IMendixObject source; + private IMendixObject target; + private java.lang.String membersToSkip; + private java.lang.String membersToKeep; + private java.lang.String reverseAssociations; + private java.lang.String excludeEntities; + private java.lang.String excludeModules; + + public DeepClone(IContext context, IMendixObject source, IMendixObject target, java.lang.String membersToSkip, java.lang.String membersToKeep, java.lang.String reverseAssociations, java.lang.String excludeEntities, java.lang.String excludeModules) + { + super(context); + this.source = source; + this.target = target; + this.membersToSkip = membersToSkip; + this.membersToKeep = membersToKeep; + this.reverseAssociations = reverseAssociations; + this.excludeEntities = excludeEntities; + this.excludeModules = excludeModules; + } + + @java.lang.Override + public java.lang.Boolean executeAction() throws Exception + { + // BEGIN USER CODE + java.lang.String membersToSkip = this.membersToSkip == null ? "" : this.membersToSkip; + java.lang.String membersToKeep = this.membersToKeep == null ? "" : this.membersToKeep; + java.lang.String reverseAssociations = this.reverseAssociations == null ? "" : this.reverseAssociations; + java.lang.String excludeEntities = this.excludeEntities == null ? "" : this.excludeEntities; + java.lang.String excludeModules = this.excludeModules == null ? "" : this.excludeModules; + + ORM.deepClone(getContext(), source, target, membersToSkip, membersToKeep, reverseAssociations, excludeEntities, excludeModules); + return true; + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "DeepClone"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/Delay.java b/module/javasource/communitycommons/actions/Delay.java old mode 100755 new mode 100644 similarity index 92% rename from test/javasource/communitycommons/actions/Delay.java rename to module/javasource/communitycommons/actions/Delay.java index d5e4f840..c10341d3 --- a/test/javasource/communitycommons/actions/Delay.java +++ b/module/javasource/communitycommons/actions/Delay.java @@ -1,52 +1,52 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import communitycommons.Misc; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Causes this request to sleep for a while. Useful to prevent brute force attacks or to simulate latency delays. - * - * Delaytime : time in ms - */ -public class Delay extends CustomJavaAction -{ - private java.lang.Long delaytime; - - public Delay(IContext context, java.lang.Long delaytime) - { - super(context); - this.delaytime = delaytime; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - Misc.delay(delaytime); - return true; - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "Delay"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import communitycommons.Misc; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Causes this request to sleep for a while. Useful to prevent brute force attacks or to simulate latency delays. + * + * Delaytime : time in ms + */ +public class Delay extends CustomJavaAction +{ + private java.lang.Long delaytime; + + public Delay(IContext context, java.lang.Long delaytime) + { + super(context); + this.delaytime = delaytime; + } + + @java.lang.Override + public java.lang.Boolean executeAction() throws Exception + { + // BEGIN USER CODE + Misc.delay(delaytime); + return true; + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "Delay"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/DuplicateFileDocument.java b/module/javasource/communitycommons/actions/DuplicateFileDocument.java old mode 100755 new mode 100644 similarity index 90% rename from test/javasource/communitycommons/actions/DuplicateFileDocument.java rename to module/javasource/communitycommons/actions/DuplicateFileDocument.java index 1b5f5a06..50740ce5 --- a/test/javasource/communitycommons/actions/DuplicateFileDocument.java +++ b/module/javasource/communitycommons/actions/DuplicateFileDocument.java @@ -1,63 +1,63 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IMendixObject; -import communitycommons.Misc; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Clones the contents of one file document into another. - * - fileToClone : the source file - * - cloneTarget : an initialized file document, in which the file will be stored. - * - * Returns true if copied, returns file if the source had no contents, throws exception in any other case. - * Pre condition: HasContents of the 'fileToClone' need to be set to true, otherwise the action will not copy anything. - */ -public class DuplicateFileDocument extends CustomJavaAction -{ - private IMendixObject __fileToClone; - private system.proxies.FileDocument fileToClone; - private IMendixObject __cloneTarget; - private system.proxies.FileDocument cloneTarget; - - public DuplicateFileDocument(IContext context, IMendixObject fileToClone, IMendixObject cloneTarget) - { - super(context); - this.__fileToClone = fileToClone; - this.__cloneTarget = cloneTarget; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - this.fileToClone = this.__fileToClone == null ? null : system.proxies.FileDocument.initialize(getContext(), __fileToClone); - - this.cloneTarget = this.__cloneTarget == null ? null : system.proxies.FileDocument.initialize(getContext(), __cloneTarget); - - // BEGIN USER CODE - return Misc.duplicateFileDocument(this.getContext(), fileToClone.getMendixObject(), cloneTarget.getMendixObject()); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "DuplicateFileDocument"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IMendixObject; +import communitycommons.Misc; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Clones the contents of one file document into another. + * - fileToClone : the source file + * - cloneTarget : an initialized file document, in which the file will be stored. + * + * Returns true if copied, returns file if the source had no contents, throws exception in any other case. + * Pre condition: HasContents of the 'fileToClone' need to be set to true, otherwise the action will not copy anything. + */ +public class DuplicateFileDocument extends CustomJavaAction +{ + private IMendixObject __fileToClone; + private system.proxies.FileDocument fileToClone; + private IMendixObject __cloneTarget; + private system.proxies.FileDocument cloneTarget; + + public DuplicateFileDocument(IContext context, IMendixObject fileToClone, IMendixObject cloneTarget) + { + super(context); + this.__fileToClone = fileToClone; + this.__cloneTarget = cloneTarget; + } + + @java.lang.Override + public java.lang.Boolean executeAction() throws Exception + { + this.fileToClone = this.__fileToClone == null ? null : system.proxies.FileDocument.initialize(getContext(), __fileToClone); + + this.cloneTarget = this.__cloneTarget == null ? null : system.proxies.FileDocument.initialize(getContext(), __cloneTarget); + + // BEGIN USER CODE + return Misc.duplicateFileDocument(this.getContext(), fileToClone.getMendixObject(), cloneTarget.getMendixObject()); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "DuplicateFileDocument"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/DuplicateImageDocument.java b/module/javasource/communitycommons/actions/DuplicateImageDocument.java old mode 100755 new mode 100644 similarity index 92% rename from test/javasource/communitycommons/actions/DuplicateImageDocument.java rename to module/javasource/communitycommons/actions/DuplicateImageDocument.java index a82b5753..aef40953 --- a/test/javasource/communitycommons/actions/DuplicateImageDocument.java +++ b/module/javasource/communitycommons/actions/DuplicateImageDocument.java @@ -1,67 +1,67 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IMendixObject; -import communitycommons.Misc; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Clones the contents of one image document into another, and generates a thumbnail as well. - * - fileToClone : the source file - * - cloneTarget : an initialized file document, in which the file will be stored. - * - * Returns true if copied, returns file if the source had no contents, throws exception in any other case. - * Pre condition: HasContents of the 'fileToClone' need to be set to true, otherwise the action will not copy anything. - */ -public class DuplicateImageDocument extends CustomJavaAction -{ - private IMendixObject __fileToClone; - private system.proxies.Image fileToClone; - private IMendixObject __cloneTarget; - private system.proxies.Image cloneTarget; - private java.lang.Long thumbWidth; - private java.lang.Long thumbHeight; - - public DuplicateImageDocument(IContext context, IMendixObject fileToClone, IMendixObject cloneTarget, java.lang.Long thumbWidth, java.lang.Long thumbHeight) - { - super(context); - this.__fileToClone = fileToClone; - this.__cloneTarget = cloneTarget; - this.thumbWidth = thumbWidth; - this.thumbHeight = thumbHeight; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - this.fileToClone = this.__fileToClone == null ? null : system.proxies.Image.initialize(getContext(), __fileToClone); - - this.cloneTarget = this.__cloneTarget == null ? null : system.proxies.Image.initialize(getContext(), __cloneTarget); - - // BEGIN USER CODE - return Misc.duplicateImage(this.getContext(), fileToClone.getMendixObject(), cloneTarget.getMendixObject(), thumbWidth.intValue(), thumbHeight.intValue()); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "DuplicateImageDocument"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IMendixObject; +import communitycommons.Misc; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Clones the contents of one image document into another, and generates a thumbnail as well. + * - fileToClone : the source file + * - cloneTarget : an initialized file document, in which the file will be stored. + * + * Returns true if copied, returns file if the source had no contents, throws exception in any other case. + * Pre condition: HasContents of the 'fileToClone' need to be set to true, otherwise the action will not copy anything. + */ +public class DuplicateImageDocument extends CustomJavaAction +{ + private IMendixObject __fileToClone; + private system.proxies.Image fileToClone; + private IMendixObject __cloneTarget; + private system.proxies.Image cloneTarget; + private java.lang.Long thumbWidth; + private java.lang.Long thumbHeight; + + public DuplicateImageDocument(IContext context, IMendixObject fileToClone, IMendixObject cloneTarget, java.lang.Long thumbWidth, java.lang.Long thumbHeight) + { + super(context); + this.__fileToClone = fileToClone; + this.__cloneTarget = cloneTarget; + this.thumbWidth = thumbWidth; + this.thumbHeight = thumbHeight; + } + + @java.lang.Override + public java.lang.Boolean executeAction() throws Exception + { + this.fileToClone = this.__fileToClone == null ? null : system.proxies.Image.initialize(getContext(), __fileToClone); + + this.cloneTarget = this.__cloneTarget == null ? null : system.proxies.Image.initialize(getContext(), __cloneTarget); + + // BEGIN USER CODE + return Misc.duplicateImage(this.getContext(), fileToClone.getMendixObject(), cloneTarget.getMendixObject(), thumbWidth.intValue(), thumbHeight.intValue()); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "DuplicateImageDocument"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/EndTransaction.java b/module/javasource/communitycommons/actions/EndTransaction.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/EndTransaction.java rename to module/javasource/communitycommons/actions/EndTransaction.java diff --git a/test/javasource/communitycommons/actions/EnumerationFromString.java b/module/javasource/communitycommons/actions/EnumerationFromString.java old mode 100755 new mode 100644 similarity index 94% rename from test/javasource/communitycommons/actions/EnumerationFromString.java rename to module/javasource/communitycommons/actions/EnumerationFromString.java index 3d0fd659..341c6870 --- a/test/javasource/communitycommons/actions/EnumerationFromString.java +++ b/module/javasource/communitycommons/actions/EnumerationFromString.java @@ -1,56 +1,56 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; -import communitycommons.Misc; -import communitycommons.proxies.LogLevel; -import java.util.Optional; - -/** - * Use this Java action as a template for your own String-to-Enumeration conversions. - * Studio Pro requires specifying the exact Enumeration to return in the definition of a Java action so we cannot provide a generic implementation. - * This implementation will throw a NoSuchElementException if an invalid toConvert parameter is given, so remember to handle this error gracefully. - */ -public class EnumerationFromString extends CustomJavaAction -{ - private java.lang.String toConvert; - - public EnumerationFromString(IContext context, java.lang.String toConvert) - { - super(context); - this.toConvert = toConvert; - } - - @java.lang.Override - public java.lang.String executeAction() throws Exception - { - // BEGIN USER CODE - - // Replace LogLevel.class by the proxy class for your Enumeration - Optional result = Misc.enumFromString(LogLevel.class, toConvert); - return result.orElseThrow().name(); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "EnumerationFromString"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; +import communitycommons.Misc; +import communitycommons.proxies.LogLevel; +import java.util.Optional; + +/** + * Use this Java action as a template for your own String-to-Enumeration conversions. + * Studio Pro requires specifying the exact Enumeration to return in the definition of a Java action so we cannot provide a generic implementation. + * This implementation will throw a NoSuchElementException if an invalid toConvert parameter is given, so remember to handle this error gracefully. + */ +public class EnumerationFromString extends CustomJavaAction +{ + private java.lang.String toConvert; + + public EnumerationFromString(IContext context, java.lang.String toConvert) + { + super(context); + this.toConvert = toConvert; + } + + @java.lang.Override + public java.lang.String executeAction() throws Exception + { + // BEGIN USER CODE + + // Replace LogLevel.class by the proxy class for your Enumeration + Optional result = Misc.enumFromString(LogLevel.class, toConvert); + return result.orElseThrow().name(); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "EnumerationFromString"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/EscapeHTML.java b/module/javasource/communitycommons/actions/EscapeHTML.java old mode 100755 new mode 100644 similarity index 89% rename from test/javasource/communitycommons/actions/EscapeHTML.java rename to module/javasource/communitycommons/actions/EscapeHTML.java index 9bdc9993..933721cc --- a/test/javasource/communitycommons/actions/EscapeHTML.java +++ b/module/javasource/communitycommons/actions/EscapeHTML.java @@ -1,52 +1,52 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; -import communitycommons.StringUtils; - -/** - * Given a, escapes it to html codes, for example - * - * "< Joe & John >" will be converted to - * "< Joe & John >" - */ -public class EscapeHTML extends CustomJavaAction -{ - private java.lang.String rawString; - - public EscapeHTML(IContext context, java.lang.String rawString) - { - super(context); - this.rawString = rawString; - } - - @java.lang.Override - public java.lang.String executeAction() throws Exception - { - // BEGIN USER CODE - return StringUtils.escapeHTML(rawString); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "EscapeHTML"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; +import communitycommons.StringUtils; + +/** + * Given a, escapes it to html codes, for example + * + * "< Joe & John >" will be converted to + * "< Joe & John >" + */ +public class EscapeHTML extends CustomJavaAction +{ + private java.lang.String rawString; + + public EscapeHTML(IContext context, java.lang.String rawString) + { + super(context); + this.rawString = rawString; + } + + @java.lang.Override + public java.lang.String executeAction() throws Exception + { + // BEGIN USER CODE + return StringUtils.escapeHTML(rawString); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "EscapeHTML"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/FileDocumentFromFile.java b/module/javasource/communitycommons/actions/FileDocumentFromFile.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/FileDocumentFromFile.java rename to module/javasource/communitycommons/actions/FileDocumentFromFile.java diff --git a/test/javasource/communitycommons/actions/FileFromFileDocument.java b/module/javasource/communitycommons/actions/FileFromFileDocument.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/FileFromFileDocument.java rename to module/javasource/communitycommons/actions/FileFromFileDocument.java diff --git a/test/javasource/communitycommons/actions/GenerateHMAC_SHA256.java b/module/javasource/communitycommons/actions/GenerateHMAC_SHA256.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/GenerateHMAC_SHA256.java rename to module/javasource/communitycommons/actions/GenerateHMAC_SHA256.java diff --git a/test/javasource/communitycommons/actions/GenerateHMAC_SHA256_hash.java b/module/javasource/communitycommons/actions/GenerateHMAC_SHA256_hash.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/GenerateHMAC_SHA256_hash.java rename to module/javasource/communitycommons/actions/GenerateHMAC_SHA256_hash.java diff --git a/test/javasource/communitycommons/actions/GetApplicationUrl.java b/module/javasource/communitycommons/actions/GetApplicationUrl.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/GetApplicationUrl.java rename to module/javasource/communitycommons/actions/GetApplicationUrl.java diff --git a/test/javasource/communitycommons/actions/GetCFInstanceIndex.java b/module/javasource/communitycommons/actions/GetCFInstanceIndex.java old mode 100755 new mode 100644 similarity index 92% rename from test/javasource/communitycommons/actions/GetCFInstanceIndex.java rename to module/javasource/communitycommons/actions/GetCFInstanceIndex.java index 8c28f71a..4ca02ec0 --- a/test/javasource/communitycommons/actions/GetCFInstanceIndex.java +++ b/module/javasource/communitycommons/actions/GetCFInstanceIndex.java @@ -1,50 +1,50 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; -import communitycommons.Misc; - -/** - * Returns the Cloud Foundry Instance Index that is set during deployment of the application in a Cloud native environment. Based on the Cloud Foundry Instance Index, Mendix determines what is the leader instance (index 0 executes scheduled events, db sync, session management etc.) or slave instance. - * - * Returns 0 for the leader instance, 1 or higher for slave instances or -1 when the environment variable could not be read (when running locally or on premise). When -1 is returned, it will probably be the leader in the cluster. - * - * Make sure emulate cloud security is disabled. Otherwise, the policy restrictions will prevent the method to be executed. Action is tested in Mendix Cloud on 19-12-2018. - */ -public class GetCFInstanceIndex extends CustomJavaAction -{ - public GetCFInstanceIndex(IContext context) - { - super(context); - } - - @java.lang.Override - public java.lang.Long executeAction() throws Exception - { - // BEGIN USER CODE - return Misc.getCFInstanceIndex(); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "GetCFInstanceIndex"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; +import communitycommons.Misc; + +/** + * Returns the Cloud Foundry Instance Index that is set during deployment of the application in a Cloud native environment. Based on the Cloud Foundry Instance Index, Mendix determines what is the leader instance (index 0 executes scheduled events, db sync, session management etc.) or slave instance. + * + * Returns 0 for the leader instance, 1 or higher for slave instances or -1 when the environment variable could not be read (when running locally or on premise). When -1 is returned, it will probably be the leader in the cluster. + * + * Make sure emulate cloud security is disabled. Otherwise, the policy restrictions will prevent the method to be executed. Action is tested in Mendix Cloud on 19-12-2018. + */ +public class GetCFInstanceIndex extends CustomJavaAction +{ + public GetCFInstanceIndex(IContext context) + { + super(context); + } + + @java.lang.Override + public java.lang.Long executeAction() throws Exception + { + // BEGIN USER CODE + return Misc.getCFInstanceIndex(); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "GetCFInstanceIndex"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/GetDefaultLanguage.java b/module/javasource/communitycommons/actions/GetDefaultLanguage.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/GetDefaultLanguage.java rename to module/javasource/communitycommons/actions/GetDefaultLanguage.java diff --git a/test/javasource/communitycommons/actions/GetFileContentsFromResource.java b/module/javasource/communitycommons/actions/GetFileContentsFromResource.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/GetFileContentsFromResource.java rename to module/javasource/communitycommons/actions/GetFileContentsFromResource.java diff --git a/test/javasource/communitycommons/actions/GetImageDimensions.java b/module/javasource/communitycommons/actions/GetImageDimensions.java old mode 100755 new mode 100644 similarity index 93% rename from test/javasource/communitycommons/actions/GetImageDimensions.java rename to module/javasource/communitycommons/actions/GetImageDimensions.java index 582997a3..43d31dd5 --- a/test/javasource/communitycommons/actions/GetImageDimensions.java +++ b/module/javasource/communitycommons/actions/GetImageDimensions.java @@ -38,8 +38,10 @@ public IMendixObject executeAction() throws Exception ImageDimensions imageDimensions = new ImageDimensions(getContext()); try (InputStream inputStream = Core.getImage(getContext(), this.ImageParameter.getMendixObject(), false)) { BufferedImage bimg = ImageIO.read(inputStream); - imageDimensions.setHeight(bimg.getHeight()); - imageDimensions.setWidth(bimg.getWidth()); + if (bimg != null) { + imageDimensions.setHeight(bimg.getHeight()); + imageDimensions.setWidth(bimg.getWidth()); + } } return imageDimensions.getMendixObject(); diff --git a/test/javasource/communitycommons/actions/GetIntFromDateTime.java b/module/javasource/communitycommons/actions/GetIntFromDateTime.java old mode 100755 new mode 100644 similarity index 91% rename from test/javasource/communitycommons/actions/GetIntFromDateTime.java rename to module/javasource/communitycommons/actions/GetIntFromDateTime.java index b5c1bde1..82eddb9e --- a/test/javasource/communitycommons/actions/GetIntFromDateTime.java +++ b/module/javasource/communitycommons/actions/GetIntFromDateTime.java @@ -1,56 +1,56 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; -import communitycommons.DateTime; - -/** - * Converts a datetime to an integer based on the selector used. - * - * Selectors available are: - * - year (returns f. ex. 1980) - * - month (returns 1-12) - * - day (returns 1-31) - */ -public class GetIntFromDateTime extends CustomJavaAction -{ - private java.util.Date dateObj; - private communitycommons.proxies.DatePartSelector selectorObj; - - public GetIntFromDateTime(IContext context, java.util.Date dateObj, java.lang.String selectorObj) - { - super(context); - this.dateObj = dateObj; - this.selectorObj = selectorObj == null ? null : communitycommons.proxies.DatePartSelector.valueOf(selectorObj); - } - - @java.lang.Override - public java.lang.Long executeAction() throws Exception - { - // BEGIN USER CODE - return DateTime.dateTimeToInteger(dateObj, selectorObj); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "GetIntFromDateTime"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; +import communitycommons.DateTime; + +/** + * Converts a datetime to an integer based on the selector used. + * + * Selectors available are: + * - year (returns f. ex. 1980) + * - month (returns 1-12) + * - day (returns 1-31) + */ +public class GetIntFromDateTime extends CustomJavaAction +{ + private java.util.Date dateObj; + private communitycommons.proxies.DatePartSelector selectorObj; + + public GetIntFromDateTime(IContext context, java.util.Date dateObj, java.lang.String selectorObj) + { + super(context); + this.dateObj = dateObj; + this.selectorObj = selectorObj == null ? null : communitycommons.proxies.DatePartSelector.valueOf(selectorObj); + } + + @java.lang.Override + public java.lang.Long executeAction() throws Exception + { + // BEGIN USER CODE + return DateTime.dateTimeToInteger(dateObj, selectorObj); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "GetIntFromDateTime"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/GetModelVersion.java b/module/javasource/communitycommons/actions/GetModelVersion.java similarity index 100% rename from test/javasource/communitycommons/actions/GetModelVersion.java rename to module/javasource/communitycommons/actions/GetModelVersion.java diff --git a/test/javasource/communitycommons/actions/GetRuntimeVersion.java b/module/javasource/communitycommons/actions/GetRuntimeVersion.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/GetRuntimeVersion.java rename to module/javasource/communitycommons/actions/GetRuntimeVersion.java diff --git a/test/javasource/communitycommons/actions/HTMLEncode.java b/module/javasource/communitycommons/actions/HTMLEncode.java old mode 100755 new mode 100644 similarity index 88% rename from test/javasource/communitycommons/actions/HTMLEncode.java rename to module/javasource/communitycommons/actions/HTMLEncode.java index c18e84fc..7603b934 --- a/test/javasource/communitycommons/actions/HTMLEncode.java +++ b/module/javasource/communitycommons/actions/HTMLEncode.java @@ -1,54 +1,54 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import communitycommons.StringUtils; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Encodes a string to HTML Entities, so that they can be displayed in the browser without breaking any layout. - * - * This is useful for special widgets which allow HTML to be rendered properly, including special characters as '<' and '&'. - * For example '<' will be encoded as '<' and '&' will be encoded as '&' - * - * Returns the encoded string. - */ -public class HTMLEncode extends CustomJavaAction -{ - private java.lang.String value; - - public HTMLEncode(IContext context, java.lang.String value) - { - super(context); - this.value = value; - } - - @java.lang.Override - public java.lang.String executeAction() throws Exception - { - // BEGIN USER CODE - return StringUtils.HTMLEncode(value); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "HTMLEncode"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import communitycommons.StringUtils; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Encodes a string to HTML Entities, so that they can be displayed in the browser without breaking any layout. + * + * This is useful for special widgets which allow HTML to be rendered properly, including special characters as '<' and '&'. + * For example '<' will be encoded as '<' and '&' will be encoded as '&' + * + * Returns the encoded string. + */ +public class HTMLEncode extends CustomJavaAction +{ + private java.lang.String value; + + public HTMLEncode(IContext context, java.lang.String value) + { + super(context); + this.value = value; + } + + @java.lang.Override + public java.lang.String executeAction() throws Exception + { + // BEGIN USER CODE + return StringUtils.HTMLEncode(value); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "HTMLEncode"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/HTMLToPlainText.java b/module/javasource/communitycommons/actions/HTMLToPlainText.java old mode 100755 new mode 100644 similarity index 92% rename from test/javasource/communitycommons/actions/HTMLToPlainText.java rename to module/javasource/communitycommons/actions/HTMLToPlainText.java index 8976462a..7a526474 --- a/test/javasource/communitycommons/actions/HTMLToPlainText.java +++ b/module/javasource/communitycommons/actions/HTMLToPlainText.java @@ -1,50 +1,50 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import communitycommons.StringUtils; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Use this function to convert HTML text to plain text. - * It will preserve linebreaks but strip all other markup. including html entity decoding. - */ -public class HTMLToPlainText extends CustomJavaAction -{ - private java.lang.String html; - - public HTMLToPlainText(IContext context, java.lang.String html) - { - super(context); - this.html = html; - } - - @java.lang.Override - public java.lang.String executeAction() throws Exception - { - // BEGIN USER CODE - return StringUtils.HTMLToPlainText(html); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "HTMLToPlainText"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import communitycommons.StringUtils; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Use this function to convert HTML text to plain text. + * It will preserve linebreaks but strip all other markup. including html entity decoding. + */ +public class HTMLToPlainText extends CustomJavaAction +{ + private java.lang.String html; + + public HTMLToPlainText(IContext context, java.lang.String html) + { + super(context); + this.html = html; + } + + @java.lang.Override + public java.lang.String executeAction() throws Exception + { + // BEGIN USER CODE + return StringUtils.HTMLToPlainText(html); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "HTMLToPlainText"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/Hash.java b/module/javasource/communitycommons/actions/Hash.java old mode 100755 new mode 100644 similarity index 83% rename from test/javasource/communitycommons/actions/Hash.java rename to module/javasource/communitycommons/actions/Hash.java index 2d7d2ba0..67f81946 --- a/test/javasource/communitycommons/actions/Hash.java +++ b/module/javasource/communitycommons/actions/Hash.java @@ -1,56 +1,55 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import communitycommons.StringUtils; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Hashes a value using the SHA-256 hash algorithm. - * - * - value : the value to hash - * - length : the desired length of the hash. - * - * Returns a SHA-256 hash of 'value', with length 'length' - */ -public class Hash extends CustomJavaAction -{ - private java.lang.String value; - private java.lang.Long length; - - public Hash(IContext context, java.lang.String value, java.lang.Long length) - { - super(context); - this.value = value; - this.length = length; - } - - @java.lang.Override - public java.lang.String executeAction() throws Exception - { - // BEGIN USER CODE - return StringUtils.hash(value, length.intValue()); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "Hash"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import communitycommons.StringUtils; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Hashes a value using the SHA-256 hash algorithm. + * + * - value : the value to hash + * + * Returns a SHA-256 hash of 'value' + */ +public class Hash extends CustomJavaAction +{ + private java.lang.String value; + private java.lang.Long length; + + public Hash(IContext context, java.lang.String value, java.lang.Long length) + { + super(context); + this.value = value; + this.length = length; + } + + @java.lang.Override + public java.lang.String executeAction() throws Exception + { + // BEGIN USER CODE + return StringUtils.hash(value); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "Hash"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/IsInDevelopment.java b/module/javasource/communitycommons/actions/IsInDevelopment.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/IsInDevelopment.java rename to module/javasource/communitycommons/actions/IsInDevelopment.java diff --git a/test/javasource/communitycommons/actions/IsStringSimplified.java b/module/javasource/communitycommons/actions/IsStringSimplified.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/IsStringSimplified.java rename to module/javasource/communitycommons/actions/IsStringSimplified.java diff --git a/test/javasource/communitycommons/actions/ListTop.java b/module/javasource/communitycommons/actions/ListTop.java similarity index 100% rename from test/javasource/communitycommons/actions/ListTop.java rename to module/javasource/communitycommons/actions/ListTop.java diff --git a/test/javasource/communitycommons/actions/LongToDateTime.java b/module/javasource/communitycommons/actions/LongToDateTime.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/LongToDateTime.java rename to module/javasource/communitycommons/actions/LongToDateTime.java diff --git a/test/javasource/communitycommons/actions/MergeMultiplePdfs.java b/module/javasource/communitycommons/actions/MergeMultiplePdfs.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/MergeMultiplePdfs.java rename to module/javasource/communitycommons/actions/MergeMultiplePdfs.java diff --git a/test/javasource/communitycommons/actions/MonthsBetween.java b/module/javasource/communitycommons/actions/MonthsBetween.java old mode 100755 new mode 100644 similarity index 91% rename from test/javasource/communitycommons/actions/MonthsBetween.java rename to module/javasource/communitycommons/actions/MonthsBetween.java index 0d14a789..9c102509 --- a/test/javasource/communitycommons/actions/MonthsBetween.java +++ b/module/javasource/communitycommons/actions/MonthsBetween.java @@ -1,63 +1,63 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; -import communitycommons.DateTime; -import communitycommons.Logging; -import communitycommons.proxies.LogLevel; -import communitycommons.proxies.LogNodes; -import java.util.Date; - -/** - * Calculates the number of months between two dates. - * - dateTime : the original (oldest) dateTime - * - compareDate: the second date. If EMPTY, the current datetime will be used. Effectively this means that the age of the dateTime is calculated. - */ -public class MonthsBetween extends CustomJavaAction -{ - private java.util.Date date1; - private java.util.Date date2; - - public MonthsBetween(IContext context, java.util.Date date1, java.util.Date date2) - { - super(context); - this.date1 = date1; - this.date2 = date2; - } - - @java.lang.Override - public java.lang.Long executeAction() throws Exception - { - // BEGIN USER CODE - try { - return DateTime.periodBetween(date1, date2 == null ? new Date() : date2).toTotalMonths(); - } catch (Exception e) { - - Logging.log(LogNodes.CommunityCommons.name(), LogLevel.Warning, "DateTime calculation error, returning -1", e); - return -1L; - } - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "MonthsBetween"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; +import communitycommons.DateTime; +import communitycommons.Logging; +import communitycommons.proxies.LogLevel; +import communitycommons.proxies.LogNodes; +import java.util.Date; + +/** + * Calculates the number of months between two dates. + * - dateTime : the original (oldest) dateTime + * - compareDate: the second date. If EMPTY, the current datetime will be used. Effectively this means that the age of the dateTime is calculated. + */ +public class MonthsBetween extends CustomJavaAction +{ + private java.util.Date date1; + private java.util.Date date2; + + public MonthsBetween(IContext context, java.util.Date date1, java.util.Date date2) + { + super(context); + this.date1 = date1; + this.date2 = date2; + } + + @java.lang.Override + public java.lang.Long executeAction() throws Exception + { + // BEGIN USER CODE + try { + return DateTime.periodBetween(date1, date2 == null ? new Date() : date2).toTotalMonths(); + } catch (Exception e) { + + Logging.log(LogNodes.CommunityCommons.name(), LogLevel.Warning, "DateTime calculation error, returning -1", e); + return -1L; + } + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "MonthsBetween"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/OverlayPdfDocument.java b/module/javasource/communitycommons/actions/OverlayPdfDocument.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/OverlayPdfDocument.java rename to module/javasource/communitycommons/actions/OverlayPdfDocument.java diff --git a/test/javasource/communitycommons/actions/ParseDateTimeWithTimezone.java b/module/javasource/communitycommons/actions/ParseDateTimeWithTimezone.java old mode 100755 new mode 100644 similarity index 95% rename from test/javasource/communitycommons/actions/ParseDateTimeWithTimezone.java rename to module/javasource/communitycommons/actions/ParseDateTimeWithTimezone.java index 7465b408..6a96fe74 --- a/test/javasource/communitycommons/actions/ParseDateTimeWithTimezone.java +++ b/module/javasource/communitycommons/actions/ParseDateTimeWithTimezone.java @@ -1,72 +1,72 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import java.text.SimpleDateFormat; -import java.util.TimeZone; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; -import communitycommons.Logging; -import communitycommons.proxies.LogLevel; -import communitycommons.proxies.LogNodes; -import java.text.ParseException; - -/** - * This method parses a date from a string with a given pattern according to a specific timezone. - * The timezone has to be a valid timezone id http://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html (e.g. one of https://garygregory.wordpress.com/2013/06/18/what-are-the-java-timezone-ids/) - */ -public class ParseDateTimeWithTimezone extends CustomJavaAction -{ - private java.lang.String date; - private java.lang.String pattern; - private java.lang.String timeZone; - private java.util.Date defaultValue; - - public ParseDateTimeWithTimezone(IContext context, java.lang.String date, java.lang.String pattern, java.lang.String timeZone, java.util.Date defaultValue) - { - super(context); - this.date = date; - this.pattern = pattern; - this.timeZone = timeZone; - this.defaultValue = defaultValue; - } - - @java.lang.Override - public java.util.Date executeAction() throws Exception - { - // BEGIN USER CODE - if (date == null || date.trim().equals("")) { - return defaultValue; - } - - try { - SimpleDateFormat sdf = new SimpleDateFormat(pattern); - sdf.setTimeZone(TimeZone.getTimeZone(timeZone)); - return sdf.parse(date); - } catch (ParseException e) { - Logging.log(LogNodes.CommunityCommons.name(), LogLevel.Warning, "Unable to parse date " + date, e); - return defaultValue; - } - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "ParseDateTimeWithTimezone"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import java.text.SimpleDateFormat; +import java.util.TimeZone; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; +import communitycommons.Logging; +import communitycommons.proxies.LogLevel; +import communitycommons.proxies.LogNodes; +import java.text.ParseException; + +/** + * This method parses a date from a string with a given pattern according to a specific timezone. + * The timezone has to be a valid timezone id http://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html (e.g. one of https://garygregory.wordpress.com/2013/06/18/what-are-the-java-timezone-ids/) + */ +public class ParseDateTimeWithTimezone extends CustomJavaAction +{ + private java.lang.String date; + private java.lang.String pattern; + private java.lang.String timeZone; + private java.util.Date defaultValue; + + public ParseDateTimeWithTimezone(IContext context, java.lang.String date, java.lang.String pattern, java.lang.String timeZone, java.util.Date defaultValue) + { + super(context); + this.date = date; + this.pattern = pattern; + this.timeZone = timeZone; + this.defaultValue = defaultValue; + } + + @java.lang.Override + public java.util.Date executeAction() throws Exception + { + // BEGIN USER CODE + if (date == null || date.trim().equals("")) { + return defaultValue; + } + + try { + SimpleDateFormat sdf = new SimpleDateFormat(pattern); + sdf.setTimeZone(TimeZone.getTimeZone(timeZone)); + return sdf.parse(date); + } catch (ParseException e) { + Logging.log(LogNodes.CommunityCommons.name(), LogLevel.Warning, "Unable to parse date " + date, e); + return defaultValue; + } + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "ParseDateTimeWithTimezone"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/RandomHash.java b/module/javasource/communitycommons/actions/RandomHash.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/RandomHash.java rename to module/javasource/communitycommons/actions/RandomHash.java diff --git a/test/javasource/communitycommons/actions/RandomString.java b/module/javasource/communitycommons/actions/RandomString.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/RandomString.java rename to module/javasource/communitycommons/actions/RandomString.java diff --git a/test/javasource/communitycommons/actions/RandomStrongPassword.java b/module/javasource/communitycommons/actions/RandomStrongPassword.java old mode 100755 new mode 100644 similarity index 82% rename from test/javasource/communitycommons/actions/RandomStrongPassword.java rename to module/javasource/communitycommons/actions/RandomStrongPassword.java index 886aefe0..62222468 --- a/test/javasource/communitycommons/actions/RandomStrongPassword.java +++ b/module/javasource/communitycommons/actions/RandomStrongPassword.java @@ -1,65 +1,72 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; -import communitycommons.StringUtils; - -/** - * Returns a random strong password containing a specified minimum number of digits, uppercase and special characters. - * - * Note:Minimumlength should be equal or larger than NrOfCapitalizedCharacters, NrOfDigits and NrOfSpecialCharacters - */ -public class RandomStrongPassword extends CustomJavaAction -{ - private java.lang.Long MinLength; - private java.lang.Long MaxLength; - private java.lang.Long NrOfCapitalizedCharacters; - private java.lang.Long NrOfDigits; - private java.lang.Long NrOfSpecialCharacters; - - public RandomStrongPassword(IContext context, java.lang.Long MinLength, java.lang.Long MaxLength, java.lang.Long NrOfCapitalizedCharacters, java.lang.Long NrOfDigits, java.lang.Long NrOfSpecialCharacters) - { - super(context); - this.MinLength = MinLength; - this.MaxLength = MaxLength; - this.NrOfCapitalizedCharacters = NrOfCapitalizedCharacters; - this.NrOfDigits = NrOfDigits; - this.NrOfSpecialCharacters = NrOfSpecialCharacters; - } - - @java.lang.Override - public java.lang.String executeAction() throws Exception - { - // BEGIN USER CODE - return StringUtils.randomStrongPassword(safeLongToInt(this.MinLength), safeLongToInt(this.MaxLength), safeLongToInt(this.NrOfCapitalizedCharacters), safeLongToInt(NrOfDigits), safeLongToInt(NrOfSpecialCharacters)); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "RandomStrongPassword"; - } - - // BEGIN EXTRA CODE - public static int safeLongToInt(long l) { - if (l < Integer.MIN_VALUE || l > Integer.MAX_VALUE) { - throw new IllegalArgumentException(l + " cannot be cast to int without changing its value."); - } - return (int) l; - } - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; +import communitycommons.StringUtils; + +/** + * Returns a random strong password containing a specified minimum number of digits, uppercase and special characters. + * + * Note:Minimumlength should be equal or larger than NrOfCapitalizedCharacters, NrOfDigits and NrOfSpecialCharacters + */ +public class RandomStrongPassword extends CustomJavaAction +{ + private java.lang.Long MinLength; + private java.lang.Long MaxLength; + private java.lang.Long NrOfCapitalizedCharacters; + private java.lang.Long NrOfDigits; + private java.lang.Long NrOfSpecialCharacters; + + public RandomStrongPassword(IContext context, java.lang.Long MinLength, java.lang.Long MaxLength, java.lang.Long NrOfCapitalizedCharacters, java.lang.Long NrOfDigits, java.lang.Long NrOfSpecialCharacters) + { + super(context); + this.MinLength = MinLength; + this.MaxLength = MaxLength; + this.NrOfCapitalizedCharacters = NrOfCapitalizedCharacters; + this.NrOfDigits = NrOfDigits; + this.NrOfSpecialCharacters = NrOfSpecialCharacters; + } + + @java.lang.Override + public java.lang.String executeAction() throws Exception + { + // BEGIN USER CODE + return StringUtils.randomStrongPassword( + safeLongToInt(MinLength), + safeLongToInt(MaxLength), + safeLongToInt(NrOfCapitalizedCharacters), + safeLongToInt(NrOfDigits), + safeLongToInt(NrOfSpecialCharacters) + ); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "RandomStrongPassword"; + } + + // BEGIN EXTRA CODE + public static int safeLongToInt(Long l) { + if (l == null) return 0; + if (l < Integer.MIN_VALUE || l > Integer.MAX_VALUE) { + throw new IllegalArgumentException(l + " cannot be cast to int without changing its value."); + } + return l.intValue(); + } + // END EXTRA CODE +} diff --git a/module/javasource/communitycommons/actions/RandomStrongPasswordWithLowercase.java b/module/javasource/communitycommons/actions/RandomStrongPasswordWithLowercase.java new file mode 100644 index 00000000..56d11702 --- /dev/null +++ b/module/javasource/communitycommons/actions/RandomStrongPasswordWithLowercase.java @@ -0,0 +1,75 @@ +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; +import communitycommons.StringUtils; + +/** + * Returns a random strong password containing a specified minimum number of digits, uppercase, lowercase and special characters. + * + * Note:Minimumlength should be equal or larger than NrOfCapitalizedCharacters, NrOfLowercaseCharacters, NrOfDigits and NrOfSpecialCharacters + */ +public class RandomStrongPasswordWithLowercase extends CustomJavaAction +{ + private java.lang.Long MinLength; + private java.lang.Long MaxLength; + private java.lang.Long NrOfCapitalizedCharacters; + private java.lang.Long NrOfLowercaseCharacters; + private java.lang.Long NrOfDigits; + private java.lang.Long NrOfSpecialCharacters; + + public RandomStrongPasswordWithLowercase(IContext context, java.lang.Long MinLength, java.lang.Long MaxLength, java.lang.Long NrOfCapitalizedCharacters, java.lang.Long NrOfLowercaseCharacters, java.lang.Long NrOfDigits, java.lang.Long NrOfSpecialCharacters) + { + super(context); + this.MinLength = MinLength; + this.MaxLength = MaxLength; + this.NrOfCapitalizedCharacters = NrOfCapitalizedCharacters; + this.NrOfLowercaseCharacters = NrOfLowercaseCharacters; + this.NrOfDigits = NrOfDigits; + this.NrOfSpecialCharacters = NrOfSpecialCharacters; + } + + @java.lang.Override + public java.lang.String executeAction() throws Exception + { + // BEGIN USER CODE + return StringUtils.randomStrongPassword( + safeLongToInt(MinLength), + safeLongToInt(MaxLength), + safeLongToInt(NrOfCapitalizedCharacters), + safeLongToInt(NrOfLowercaseCharacters), + safeLongToInt(NrOfDigits), + safeLongToInt(NrOfSpecialCharacters) + ); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "RandomStrongPasswordWithLowercase"; + } + + // BEGIN EXTRA CODE + public static int safeLongToInt(Long l) { + if (l == null) return 0; + if (l < Integer.MIN_VALUE || l > Integer.MAX_VALUE) { + throw new IllegalArgumentException(l + " cannot be cast to int without changing its value."); + } + return l.intValue(); + } + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/RegexQuote.java b/module/javasource/communitycommons/actions/RegexQuote.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/RegexQuote.java rename to module/javasource/communitycommons/actions/RegexQuote.java diff --git a/test/javasource/communitycommons/actions/RegexReplaceAll.java b/module/javasource/communitycommons/actions/RegexReplaceAll.java old mode 100755 new mode 100644 similarity index 90% rename from test/javasource/communitycommons/actions/RegexReplaceAll.java rename to module/javasource/communitycommons/actions/RegexReplaceAll.java index 3a82d5fe..1a709990 --- a/test/javasource/communitycommons/actions/RegexReplaceAll.java +++ b/module/javasource/communitycommons/actions/RegexReplaceAll.java @@ -1,59 +1,59 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import communitycommons.StringUtils; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Performs a regular expression. Similar to the replaceAll microflow function, but supports more advanced usages such as capture variables. - * - * For the regexp specification see: - * https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html - * - * A decent regexp tester can be found at: - * http://www.fileformat.info/tool/regex.htm - */ -public class RegexReplaceAll extends CustomJavaAction -{ - private java.lang.String haystack; - private java.lang.String needleRegex; - private java.lang.String replacement; - - public RegexReplaceAll(IContext context, java.lang.String haystack, java.lang.String needleRegex, java.lang.String replacement) - { - super(context); - this.haystack = haystack; - this.needleRegex = needleRegex; - this.replacement = replacement; - } - - @java.lang.Override - public java.lang.String executeAction() throws Exception - { - // BEGIN USER CODE - return StringUtils.regexReplaceAll(haystack, needleRegex, replacement); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "RegexReplaceAll"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import communitycommons.StringUtils; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Performs a regular expression. Similar to the replaceAll microflow function, but supports more advanced usages such as capture variables. + * + * For the regexp specification see: + * https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html + * + * A decent regexp tester can be found at: + * http://www.fileformat.info/tool/regex.htm + */ +public class RegexReplaceAll extends CustomJavaAction +{ + private java.lang.String haystack; + private java.lang.String needleRegex; + private java.lang.String replacement; + + public RegexReplaceAll(IContext context, java.lang.String haystack, java.lang.String needleRegex, java.lang.String replacement) + { + super(context); + this.haystack = haystack; + this.needleRegex = needleRegex; + this.replacement = replacement; + } + + @java.lang.Override + public java.lang.String executeAction() throws Exception + { + // BEGIN USER CODE + return StringUtils.regexReplaceAll(haystack, needleRegex, replacement); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "RegexReplaceAll"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/RemoveEnd.java b/module/javasource/communitycommons/actions/RemoveEnd.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/RemoveEnd.java rename to module/javasource/communitycommons/actions/RemoveEnd.java diff --git a/test/javasource/communitycommons/actions/RunMicroflowAsyncInQueue.java b/module/javasource/communitycommons/actions/RunMicroflowAsyncInQueue.java old mode 100755 new mode 100644 similarity index 93% rename from test/javasource/communitycommons/actions/RunMicroflowAsyncInQueue.java rename to module/javasource/communitycommons/actions/RunMicroflowAsyncInQueue.java index ae18ee45..c3bf7381 --- a/test/javasource/communitycommons/actions/RunMicroflowAsyncInQueue.java +++ b/module/javasource/communitycommons/actions/RunMicroflowAsyncInQueue.java @@ -1,51 +1,51 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import communitycommons.Misc; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Runs a microflow asynchronous, that is, this action immediately returns but schedules the microflow to be run in the near future. The queue guarantees a first come first serve order of the microflows, and only one action is served at a time. - * - * The microflow is run with system rights in its own transaction, and is very useful to run heavy microflows on the background. - */ -public class RunMicroflowAsyncInQueue extends CustomJavaAction -{ - private java.lang.String microflow; - - public RunMicroflowAsyncInQueue(IContext context, java.lang.String microflow) - { - super(context); - this.microflow = microflow; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - return Misc.runMicroflowAsyncInQueue(microflow); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "RunMicroflowAsyncInQueue"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import communitycommons.Misc; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Runs a microflow asynchronous, that is, this action immediately returns but schedules the microflow to be run in the near future. The queue guarantees a first come first serve order of the microflows, and only one action is served at a time. + * + * The microflow is run with system rights in its own transaction, and is very useful to run heavy microflows on the background. + */ +public class RunMicroflowAsyncInQueue extends CustomJavaAction +{ + private java.lang.String microflow; + + public RunMicroflowAsyncInQueue(IContext context, java.lang.String microflow) + { + super(context); + this.microflow = microflow; + } + + @java.lang.Override + public java.lang.Boolean executeAction() throws Exception + { + // BEGIN USER CODE + return Misc.runMicroflowAsyncInQueue(microflow); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "RunMicroflowAsyncInQueue"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/StartTransaction.java b/module/javasource/communitycommons/actions/StartTransaction.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/StartTransaction.java rename to module/javasource/communitycommons/actions/StartTransaction.java diff --git a/test/javasource/communitycommons/actions/StringFromFile.java b/module/javasource/communitycommons/actions/StringFromFile.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/StringFromFile.java rename to module/javasource/communitycommons/actions/StringFromFile.java diff --git a/test/javasource/communitycommons/actions/StringLeftPad.java b/module/javasource/communitycommons/actions/StringLeftPad.java old mode 100755 new mode 100644 similarity index 84% rename from test/javasource/communitycommons/actions/StringLeftPad.java rename to module/javasource/communitycommons/actions/StringLeftPad.java index 72dc4883..1b9152ca --- a/test/javasource/communitycommons/actions/StringLeftPad.java +++ b/module/javasource/communitycommons/actions/StringLeftPad.java @@ -1,59 +1,59 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Pads a string on the left to a certain length. - * value : the original value - * amount: the desired length of the resulting string. - * fillCharacter: the character to pad with. (or space if empty) - * - * For example - * StringLeftPad("hello", 8, "-") returns "---hello" - * StringLeftPad("hello", 2, "-") returns "hello" - */ -public class StringLeftPad extends CustomJavaAction -{ - private java.lang.String value; - private java.lang.Long amount; - private java.lang.String fillCharacter; - - public StringLeftPad(IContext context, java.lang.String value, java.lang.Long amount, java.lang.String fillCharacter) - { - super(context); - this.value = value; - this.amount = amount; - this.fillCharacter = fillCharacter; - } - - @java.lang.Override - public java.lang.String executeAction() throws Exception - { - // BEGIN USER CODE - return communitycommons.StringUtils.leftPad(value, amount, fillCharacter); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "StringLeftPad"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Pads a string on the left to a certain length. + * value : the original value + * amount: the desired length of the resulting string. + * fillCharacter: the character to pad with. (or space if empty) + * + * For example + * StringLeftPad("hello", 8, "-") returns "---hello" + * StringLeftPad("hello", 2, "-") returns "hello" + */ +public class StringLeftPad extends CustomJavaAction +{ + private java.lang.String value; + private java.lang.Long amount; + private java.lang.String fillCharacter; + + public StringLeftPad(IContext context, java.lang.String value, java.lang.Long amount, java.lang.String fillCharacter) + { + super(context); + this.value = value; + this.amount = amount; + this.fillCharacter = fillCharacter; + } + + @java.lang.Override + public java.lang.String executeAction() throws Exception + { + // BEGIN USER CODE + return communitycommons.StringUtils.leftPad(value, amount, fillCharacter); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "StringLeftPad"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/StringRightPad.java b/module/javasource/communitycommons/actions/StringRightPad.java old mode 100755 new mode 100644 similarity index 84% rename from test/javasource/communitycommons/actions/StringRightPad.java rename to module/javasource/communitycommons/actions/StringRightPad.java index 7cf0cf87..2bdb2dc5 --- a/test/javasource/communitycommons/actions/StringRightPad.java +++ b/module/javasource/communitycommons/actions/StringRightPad.java @@ -1,59 +1,59 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Pads a string on the right to a certain length. - * value : the original value - * amount: the desired length of the resulting string. - * fillCharacter: the character to pad with. (or space if empty) - * - * For example - * StringRightPad("hello", 8, "-") returns "hello---" - * StringLeftpad("hello", 2, "-") returns "hello" - */ -public class StringRightPad extends CustomJavaAction -{ - private java.lang.String value; - private java.lang.Long amount; - private java.lang.String fillCharacter; - - public StringRightPad(IContext context, java.lang.String value, java.lang.Long amount, java.lang.String fillCharacter) - { - super(context); - this.value = value; - this.amount = amount; - this.fillCharacter = fillCharacter; - } - - @java.lang.Override - public java.lang.String executeAction() throws Exception - { - // BEGIN USER CODE - return communitycommons.StringUtils.rightPad(value, amount, fillCharacter); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "StringRightPad"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Pads a string on the right to a certain length. + * value : the original value + * amount: the desired length of the resulting string. + * fillCharacter: the character to pad with. (or space if empty) + * + * For example + * StringRightPad("hello", 8, "-") returns "hello---" + * StringLeftpad("hello", 2, "-") returns "hello" + */ +public class StringRightPad extends CustomJavaAction +{ + private java.lang.String value; + private java.lang.Long amount; + private java.lang.String fillCharacter; + + public StringRightPad(IContext context, java.lang.String value, java.lang.Long amount, java.lang.String fillCharacter) + { + super(context); + this.value = value; + this.amount = amount; + this.fillCharacter = fillCharacter; + } + + @java.lang.Override + public java.lang.String executeAction() throws Exception + { + // BEGIN USER CODE + return communitycommons.StringUtils.rightPad(value, amount, fillCharacter); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "StringRightPad"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/StringSimplify.java b/module/javasource/communitycommons/actions/StringSimplify.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/StringSimplify.java rename to module/javasource/communitycommons/actions/StringSimplify.java diff --git a/test/javasource/communitycommons/actions/StringSplit.java b/module/javasource/communitycommons/actions/StringSplit.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/StringSplit.java rename to module/javasource/communitycommons/actions/StringSplit.java diff --git a/test/javasource/communitycommons/actions/StringToFile.java b/module/javasource/communitycommons/actions/StringToFile.java old mode 100755 new mode 100644 similarity index 96% rename from test/javasource/communitycommons/actions/StringToFile.java rename to module/javasource/communitycommons/actions/StringToFile.java index cb87fe76..dbde6802 --- a/test/javasource/communitycommons/actions/StringToFile.java +++ b/module/javasource/communitycommons/actions/StringToFile.java @@ -1,64 +1,64 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IMendixObject; -import communitycommons.StringUtils; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Stores a string into the provided FileDocument, using the specified encoding. - * Note that destination will be committed. - */ -public class StringToFile extends CustomJavaAction -{ - private java.lang.String value; - private IMendixObject __destination; - private system.proxies.FileDocument destination; - private communitycommons.proxies.StandardEncodings encoding; - - public StringToFile(IContext context, java.lang.String value, IMendixObject destination, java.lang.String encoding) - { - super(context); - this.value = value; - this.__destination = destination; - this.encoding = encoding == null ? null : communitycommons.proxies.StandardEncodings.valueOf(encoding); - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - this.destination = this.__destination == null ? null : system.proxies.FileDocument.initialize(getContext(), __destination); - - // BEGIN USER CODE - Charset charset = StandardCharsets.UTF_8; - if (this.encoding != null) - charset = Charset.forName(this.encoding.name().replace('_', '-')); - StringUtils.stringToFile(getContext(), value, destination, charset); - return true; - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "StringToFile"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IMendixObject; +import communitycommons.StringUtils; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Stores a string into the provided FileDocument, using the specified encoding. + * Note that destination will be committed. + */ +public class StringToFile extends CustomJavaAction +{ + private java.lang.String value; + private IMendixObject __destination; + private system.proxies.FileDocument destination; + private communitycommons.proxies.StandardEncodings encoding; + + public StringToFile(IContext context, java.lang.String value, IMendixObject destination, java.lang.String encoding) + { + super(context); + this.value = value; + this.__destination = destination; + this.encoding = encoding == null ? null : communitycommons.proxies.StandardEncodings.valueOf(encoding); + } + + @java.lang.Override + public java.lang.Boolean executeAction() throws Exception + { + this.destination = this.__destination == null ? null : system.proxies.FileDocument.initialize(getContext(), __destination); + + // BEGIN USER CODE + Charset charset = StandardCharsets.UTF_8; + if (this.encoding != null) + charset = Charset.forName(this.encoding.name().replace('_', '-')); + StringUtils.stringToFile(getContext(), value, destination, charset); + return true; + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "StringToFile"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/StringTrim.java b/module/javasource/communitycommons/actions/StringTrim.java old mode 100755 new mode 100644 similarity index 92% rename from test/javasource/communitycommons/actions/StringTrim.java rename to module/javasource/communitycommons/actions/StringTrim.java index fc4f3eee..e343b1aa --- a/test/javasource/communitycommons/actions/StringTrim.java +++ b/module/javasource/communitycommons/actions/StringTrim.java @@ -1,51 +1,51 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Left and right trims a string (that is; removes all surrounding whitespace characters such as tabs, spaces and returns). - * Returns the empty string if value is the empty value. Returns the trimmed string otherwise. - */ -public class StringTrim extends CustomJavaAction -{ - private java.lang.String value; - - public StringTrim(IContext context, java.lang.String value) - { - super(context); - this.value = value; - } - - @java.lang.Override - public java.lang.String executeAction() throws Exception - { - // BEGIN USER CODE - if (this.value == null) - return ""; - return this.value.trim(); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "StringTrim"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Left and right trims a string (that is; removes all surrounding whitespace characters such as tabs, spaces and returns). + * Returns the empty string if value is the empty value. Returns the trimmed string otherwise. + */ +public class StringTrim extends CustomJavaAction +{ + private java.lang.String value; + + public StringTrim(IContext context, java.lang.String value) + { + super(context); + this.value = value; + } + + @java.lang.Override + public java.lang.String executeAction() throws Exception + { + // BEGIN USER CODE + if (this.value == null) + return ""; + return this.value.trim(); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "StringTrim"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/SubstituteTemplate.java b/module/javasource/communitycommons/actions/SubstituteTemplate.java old mode 100755 new mode 100644 similarity index 84% rename from test/javasource/communitycommons/actions/SubstituteTemplate.java rename to module/javasource/communitycommons/actions/SubstituteTemplate.java index 29507550..e3984bd6 --- a/test/javasource/communitycommons/actions/SubstituteTemplate.java +++ b/module/javasource/communitycommons/actions/SubstituteTemplate.java @@ -1,69 +1,69 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IMendixObject; -import communitycommons.StringUtils; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Given an object and a template, substitutes all fields in the template. Supports attributes, references, referencesets and constants. - * - * The general field syntax is '{fieldname}'. - * - * Fieldname can be a member of the example object, an attribute which need to be retrieved over an reference(set) or a project constant. All paths are relative from the provided substitute obect. An example template: - * ------------------ - * Dear {EmailOrName}, - * - * {System.changedBy/FullName} has invited you to join the project {Module.MemberShip_Project/Name}. - * Sign up is free and can be done here: - * {@Module.PublicURL}link/Signup - * ------------------------- - * - * useHTMLEncoding identifies whether HTMLEncode is applied to the values before substituting. - * - * datetimeformat identifies a format string which is applied to date/time based attributes. Can be left empty. Defaults to "EEE dd MMM yyyy, HH:mm" - */ -public class SubstituteTemplate extends CustomJavaAction -{ - private java.lang.String template; - private IMendixObject substitute; - private java.lang.Boolean useHTMLEncoding; - - public SubstituteTemplate(IContext context, java.lang.String template, IMendixObject substitute, java.lang.Boolean useHTMLEncoding) - { - super(context); - this.template = template; - this.substitute = substitute; - this.useHTMLEncoding = useHTMLEncoding; - } - - @java.lang.Override - public java.lang.String executeAction() throws Exception - { - // BEGIN USER CODE - return StringUtils.substituteTemplate(this.getContext(), template, substitute, useHTMLEncoding, null); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "SubstituteTemplate"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IMendixObject; +import communitycommons.StringUtils; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Given an object and a template, substitutes all fields in the template. Supports attributes, references, referencesets and constants. + * + * The general field syntax is '{fieldname}'. + * + * Fieldname can be a member of the example object, an attribute which need to be retrieved over an reference(set) or a project constant. All paths are relative from the provided substitute obect. An example template: + * ------------------ + * Dear {EmailOrName}, + * + * {System.changedBy/FullName} has invited you to join the project {Module.MemberShip_Project/Name}. + * Sign up is free and can be done here: + * {@Module.PublicURL}link/Signup + * ------------------------- + * + * useHTMLEncoding identifies whether HTMLEncode is applied to the values before substituting. + * + * datetimeformat identifies a format string which is applied to date/time based attributes. Can be left empty. Defaults to "EEE dd MMM yyyy, HH:mm" + */ +public class SubstituteTemplate extends CustomJavaAction +{ + private java.lang.String template; + private IMendixObject substitute; + private java.lang.Boolean useHTMLEncoding; + + public SubstituteTemplate(IContext context, java.lang.String template, IMendixObject substitute, java.lang.Boolean useHTMLEncoding) + { + super(context); + this.template = template; + this.substitute = substitute; + this.useHTMLEncoding = useHTMLEncoding; + } + + @java.lang.Override + public java.lang.String executeAction() throws Exception + { + // BEGIN USER CODE + return StringUtils.substituteTemplate(this.getContext(), template, substitute, useHTMLEncoding, null); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "SubstituteTemplate"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/SubstituteTemplate2.java b/module/javasource/communitycommons/actions/SubstituteTemplate2.java old mode 100755 new mode 100644 similarity index 96% rename from test/javasource/communitycommons/actions/SubstituteTemplate2.java rename to module/javasource/communitycommons/actions/SubstituteTemplate2.java index 98195c40..c7318774 --- a/test/javasource/communitycommons/actions/SubstituteTemplate2.java +++ b/module/javasource/communitycommons/actions/SubstituteTemplate2.java @@ -1,58 +1,58 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IMendixObject; -import communitycommons.StringUtils; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Identical to SubstituteTemplate, but adds an datetimeformat argument - * - * DateTimeFormat identifies a format string which is applied to date/time based attributes. Can be left empty. Defaults to "EEE dd MMM yyyy, HH:mm" - */ -public class SubstituteTemplate2 extends CustomJavaAction -{ - private java.lang.String template; - private IMendixObject substitute; - private java.lang.Boolean useHTMLEncoding; - private java.lang.String datetimeformat; - - public SubstituteTemplate2(IContext context, java.lang.String template, IMendixObject substitute, java.lang.Boolean useHTMLEncoding, java.lang.String datetimeformat) - { - super(context); - this.template = template; - this.substitute = substitute; - this.useHTMLEncoding = useHTMLEncoding; - this.datetimeformat = datetimeformat; - } - - @java.lang.Override - public java.lang.String executeAction() throws Exception - { - // BEGIN USER CODE - return StringUtils.substituteTemplate(this.getContext(), template, substitute, useHTMLEncoding, this.datetimeformat); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "SubstituteTemplate2"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IMendixObject; +import communitycommons.StringUtils; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Identical to SubstituteTemplate, but adds an datetimeformat argument + * + * DateTimeFormat identifies a format string which is applied to date/time based attributes. Can be left empty. Defaults to "EEE dd MMM yyyy, HH:mm" + */ +public class SubstituteTemplate2 extends CustomJavaAction +{ + private java.lang.String template; + private IMendixObject substitute; + private java.lang.Boolean useHTMLEncoding; + private java.lang.String datetimeformat; + + public SubstituteTemplate2(IContext context, java.lang.String template, IMendixObject substitute, java.lang.Boolean useHTMLEncoding, java.lang.String datetimeformat) + { + super(context); + this.template = template; + this.substitute = substitute; + this.useHTMLEncoding = useHTMLEncoding; + this.datetimeformat = datetimeformat; + } + + @java.lang.Override + public java.lang.String executeAction() throws Exception + { + // BEGIN USER CODE + return StringUtils.substituteTemplate(this.getContext(), template, substitute, useHTMLEncoding, this.datetimeformat); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "SubstituteTemplate2"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/SubstringAfter.java b/module/javasource/communitycommons/actions/SubstringAfter.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/SubstringAfter.java rename to module/javasource/communitycommons/actions/SubstringAfter.java diff --git a/test/javasource/communitycommons/actions/SubstringAfterLast.java b/module/javasource/communitycommons/actions/SubstringAfterLast.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/SubstringAfterLast.java rename to module/javasource/communitycommons/actions/SubstringAfterLast.java diff --git a/test/javasource/communitycommons/actions/SubstringBefore.java b/module/javasource/communitycommons/actions/SubstringBefore.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/SubstringBefore.java rename to module/javasource/communitycommons/actions/SubstringBefore.java diff --git a/test/javasource/communitycommons/actions/SubstringBeforeLast.java b/module/javasource/communitycommons/actions/SubstringBeforeLast.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/SubstringBeforeLast.java rename to module/javasource/communitycommons/actions/SubstringBeforeLast.java diff --git a/test/javasource/communitycommons/actions/ThrowException.java b/module/javasource/communitycommons/actions/ThrowException.java old mode 100755 new mode 100644 similarity index 92% rename from test/javasource/communitycommons/actions/ThrowException.java rename to module/javasource/communitycommons/actions/ThrowException.java index f4e9608b..8d8e8b31 --- a/test/javasource/communitycommons/actions/ThrowException.java +++ b/module/javasource/communitycommons/actions/ThrowException.java @@ -1,54 +1,54 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import communitycommons.Misc; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * This action always throws an exception (of type communityutils.UserThrownError), which is, in combination with custom error handling, quite useful to end a microflow prematurely or to bail out to the calling action/ microflow. - * - * The message of the last thrown error can be inspected by using the variable $lasterrormessage - * - * Example usuage: In general, if an Event (before commit especially) returns false, it should call this action and then return true instead. If an Before commit returns false, the object will not be committed, but there is no easy way for the calling Microflow/ action to detect this! An exception on the other hand, will be noticed. - */ -public class ThrowException extends CustomJavaAction -{ - private java.lang.String message; - - public ThrowException(IContext context, java.lang.String message) - { - super(context); - this.message = message; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - Misc.throwException(message); - return null; - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "ThrowException"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import communitycommons.Misc; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * This action always throws an exception (of type communityutils.UserThrownError), which is, in combination with custom error handling, quite useful to end a microflow prematurely or to bail out to the calling action/ microflow. + * + * The message of the last thrown error can be inspected by using the variable $lasterrormessage + * + * Example usuage: In general, if an Event (before commit especially) returns false, it should call this action and then return true instead. If an Before commit returns false, the object will not be committed, but there is no easy way for the calling Microflow/ action to detect this! An exception on the other hand, will be noticed. + */ +public class ThrowException extends CustomJavaAction +{ + private java.lang.String message; + + public ThrowException(IContext context, java.lang.String message) + { + super(context); + this.message = message; + } + + @java.lang.Override + public java.lang.Boolean executeAction() throws Exception + { + // BEGIN USER CODE + Misc.throwException(message); + return null; + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "ThrowException"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/ThrowWebserviceException.java b/module/javasource/communitycommons/actions/ThrowWebserviceException.java old mode 100755 new mode 100644 similarity index 93% rename from test/javasource/communitycommons/actions/ThrowWebserviceException.java rename to module/javasource/communitycommons/actions/ThrowWebserviceException.java index a27a5ed5..c69b8bf1 --- a/test/javasource/communitycommons/actions/ThrowWebserviceException.java +++ b/module/javasource/communitycommons/actions/ThrowWebserviceException.java @@ -1,54 +1,54 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import communitycommons.Misc; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * (Behavior has changed since version 3.2. The exception is now properly propagated to the cient). - * - * Throws an exception. This is very useful if the microflow is called by a webservice. If you throw this kind of exceptions, an fault message will be generated in the output, instead of an '501 Internal server' error. - * - * If debug level of community commons is set to 'debug' the errors will be locally visible as well, otherwise not. Throwing a webservice exception states that the webservice invocation was incorrect, not the webservice implementation. - */ -public class ThrowWebserviceException extends CustomJavaAction -{ - private java.lang.String faultstring; - - public ThrowWebserviceException(IContext context, java.lang.String faultstring) - { - super(context); - this.faultstring = faultstring; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - Misc.throwWebserviceException(faultstring); - return true; - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "ThrowWebserviceException"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import communitycommons.Misc; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * (Behavior has changed since version 3.2. The exception is now properly propagated to the cient). + * + * Throws an exception. This is very useful if the microflow is called by a webservice. If you throw this kind of exceptions, an fault message will be generated in the output, instead of an '501 Internal server' error. + * + * If debug level of community commons is set to 'debug' the errors will be locally visible as well, otherwise not. Throwing a webservice exception states that the webservice invocation was incorrect, not the webservice implementation. + */ +public class ThrowWebserviceException extends CustomJavaAction +{ + private java.lang.String faultstring; + + public ThrowWebserviceException(IContext context, java.lang.String faultstring) + { + super(context); + this.faultstring = faultstring; + } + + @java.lang.Override + public java.lang.Boolean executeAction() throws Exception + { + // BEGIN USER CODE + Misc.throwWebserviceException(faultstring); + return true; + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "ThrowWebserviceException"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/TimeMeasureEnd.java b/module/javasource/communitycommons/actions/TimeMeasureEnd.java old mode 100755 new mode 100644 similarity index 89% rename from test/javasource/communitycommons/actions/TimeMeasureEnd.java rename to module/javasource/communitycommons/actions/TimeMeasureEnd.java index 540d6472..90cb8064 --- a/test/javasource/communitycommons/actions/TimeMeasureEnd.java +++ b/module/javasource/communitycommons/actions/TimeMeasureEnd.java @@ -1,56 +1,56 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import communitycommons.Logging; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * End timing something, and print the result to the log. - * - TimerName. Should correspond to the TimerName used with TimeMeasureStart. - * - LogLevel. The loglevel used to print the result. - * - The message to be printed in the log. - */ -public class TimeMeasureEnd extends CustomJavaAction -{ - private java.lang.String TimerName; - private communitycommons.proxies.LogLevel Loglevel; - private java.lang.String message; - - public TimeMeasureEnd(IContext context, java.lang.String TimerName, java.lang.String Loglevel, java.lang.String message) - { - super(context); - this.TimerName = TimerName; - this.Loglevel = Loglevel == null ? null : communitycommons.proxies.LogLevel.valueOf(Loglevel); - this.message = message; - } - - @java.lang.Override - public java.lang.Long executeAction() throws Exception - { - // BEGIN USER CODE - return Logging.measureEnd(TimerName, Loglevel, message); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "TimeMeasureEnd"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import communitycommons.Logging; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * End timing something, and print the result to the log. + * - TimerName. Should correspond to the TimerName used with TimeMeasureStart. + * - LogLevel. The loglevel used to print the result. + * - The message to be printed in the log. + */ +public class TimeMeasureEnd extends CustomJavaAction +{ + private java.lang.String TimerName; + private communitycommons.proxies.LogLevel Loglevel; + private java.lang.String message; + + public TimeMeasureEnd(IContext context, java.lang.String TimerName, java.lang.String Loglevel, java.lang.String message) + { + super(context); + this.TimerName = TimerName; + this.Loglevel = Loglevel == null ? null : communitycommons.proxies.LogLevel.valueOf(Loglevel); + this.message = message; + } + + @java.lang.Override + public java.lang.Long executeAction() throws Exception + { + // BEGIN USER CODE + return Logging.measureEnd(TimerName, Loglevel, message); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "TimeMeasureEnd"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/TimeMeasureStart.java b/module/javasource/communitycommons/actions/TimeMeasureStart.java old mode 100755 new mode 100644 similarity index 91% rename from test/javasource/communitycommons/actions/TimeMeasureStart.java rename to module/javasource/communitycommons/actions/TimeMeasureStart.java index b8ff5d97..3a478fd7 --- a/test/javasource/communitycommons/actions/TimeMeasureStart.java +++ b/module/javasource/communitycommons/actions/TimeMeasureStart.java @@ -1,53 +1,53 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import communitycommons.Logging; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Start timing something, and print the result to the log. - * - TimerName. Should correspond to the TimerName used in TimeMeasureEnd. - * - * Note that multiple timers can run at once. Existing timers can be restarted using this function as well. - */ -public class TimeMeasureStart extends CustomJavaAction -{ - private java.lang.String TimerName; - - public TimeMeasureStart(IContext context, java.lang.String TimerName) - { - super(context); - this.TimerName = TimerName; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - Logging.measureStart(TimerName); - return true; - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "TimeMeasureStart"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import communitycommons.Logging; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Start timing something, and print the result to the log. + * - TimerName. Should correspond to the TimerName used in TimeMeasureEnd. + * + * Note that multiple timers can run at once. Existing timers can be restarted using this function as well. + */ +public class TimeMeasureStart extends CustomJavaAction +{ + private java.lang.String TimerName; + + public TimeMeasureStart(IContext context, java.lang.String TimerName) + { + super(context); + this.TimerName = TimerName; + } + + @java.lang.Override + public java.lang.Boolean executeAction() throws Exception + { + // BEGIN USER CODE + Logging.measureStart(TimerName); + return true; + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "TimeMeasureStart"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/XSSSanitize.java b/module/javasource/communitycommons/actions/XSSSanitize.java old mode 100755 new mode 100644 similarity index 88% rename from test/javasource/communitycommons/actions/XSSSanitize.java rename to module/javasource/communitycommons/actions/XSSSanitize.java index ab4a47bd..ae6c8055 --- a/test/javasource/communitycommons/actions/XSSSanitize.java +++ b/module/javasource/communitycommons/actions/XSSSanitize.java @@ -1,95 +1,95 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.MendixRuntimeException; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; -import communitycommons.proxies.SanitizerPolicy; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import org.apache.commons.lang3.StringUtils; - -/** - * Removes all potential dangerous HTML from a string so that it can be safely displayed in a browser. - * - * This function should be applied to all HTML which is displayed in the browser, and can be entered by (untrusted) users. - * - * - HTML: The html to sanitize - * - policy1... policy6: one or more values of SanitizerPolicy. You may leave these policy parameters empty if you don't want to allow additional elements. - * - * BLOCKS: Allows common block elements including

,

, etc. - * FORMATTING: Allows common formatting elements including , , etc. - * IMAGES: Allows elements from HTTP, HTTPS, and relative sources. - * LINKS: Allows HTTP, HTTPS, MAILTO and relative links - * STYLES: Allows certain safe CSS properties in style="..." attributes. - * TABLES: Allows commons table elements. - * - * For more information, visit: - * - * http://javadoc.io/doc/com.googlecode.owasp-java-html-sanitizer/owasp-java-html-sanitizer/20180219.1 - */ -public class XSSSanitize extends CustomJavaAction -{ - private java.lang.String html; - private communitycommons.proxies.SanitizerPolicy policy1; - private communitycommons.proxies.SanitizerPolicy policy2; - private communitycommons.proxies.SanitizerPolicy policy3; - private communitycommons.proxies.SanitizerPolicy policy4; - private communitycommons.proxies.SanitizerPolicy policy5; - private communitycommons.proxies.SanitizerPolicy policy6; - - public XSSSanitize(IContext context, java.lang.String html, java.lang.String policy1, java.lang.String policy2, java.lang.String policy3, java.lang.String policy4, java.lang.String policy5, java.lang.String policy6) - { - super(context); - this.html = html; - this.policy1 = policy1 == null ? null : communitycommons.proxies.SanitizerPolicy.valueOf(policy1); - this.policy2 = policy2 == null ? null : communitycommons.proxies.SanitizerPolicy.valueOf(policy2); - this.policy3 = policy3 == null ? null : communitycommons.proxies.SanitizerPolicy.valueOf(policy3); - this.policy4 = policy4 == null ? null : communitycommons.proxies.SanitizerPolicy.valueOf(policy4); - this.policy5 = policy5 == null ? null : communitycommons.proxies.SanitizerPolicy.valueOf(policy5); - this.policy6 = policy6 == null ? null : communitycommons.proxies.SanitizerPolicy.valueOf(policy6); - } - - @java.lang.Override - public java.lang.String executeAction() throws Exception - { - // BEGIN USER CODE - if (StringUtils.isEmpty(html)) { - return ""; - } - - List policyParams = Stream.of(policy1, policy2, policy3, policy4, policy5, policy6) - .filter(Objects::nonNull) - .collect(Collectors.toList()); - - if (policyParams.isEmpty()) { - throw new MendixRuntimeException("At least one policy is required"); - } - - return communitycommons.StringUtils.sanitizeHTML(html, policyParams); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "XSSSanitize"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.MendixRuntimeException; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; +import communitycommons.proxies.SanitizerPolicy; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.apache.commons.lang3.StringUtils; + +/** + * Removes all potential dangerous HTML from a string so that it can be safely displayed in a browser. + * + * This function should be applied to all HTML which is displayed in the browser, and can be entered by (untrusted) users. + * + * - HTML: The html to sanitize + * - policy1... policy6: one or more values of SanitizerPolicy. You may leave these policy parameters empty if you don't want to allow additional elements. + * + * BLOCKS: Allows common block elements including

,

, etc. + * FORMATTING: Allows common formatting elements including , , etc. + * IMAGES: Allows elements from HTTP, HTTPS, and relative sources. + * LINKS: Allows HTTP, HTTPS, MAILTO and relative links + * STYLES: Allows certain safe CSS properties in style="..." attributes. + * TABLES: Allows commons table elements. + * + * For more information, visit: + * + * http://javadoc.io/doc/com.googlecode.owasp-java-html-sanitizer/owasp-java-html-sanitizer/20180219.1 + */ +public class XSSSanitize extends CustomJavaAction +{ + private java.lang.String html; + private communitycommons.proxies.SanitizerPolicy policy1; + private communitycommons.proxies.SanitizerPolicy policy2; + private communitycommons.proxies.SanitizerPolicy policy3; + private communitycommons.proxies.SanitizerPolicy policy4; + private communitycommons.proxies.SanitizerPolicy policy5; + private communitycommons.proxies.SanitizerPolicy policy6; + + public XSSSanitize(IContext context, java.lang.String html, java.lang.String policy1, java.lang.String policy2, java.lang.String policy3, java.lang.String policy4, java.lang.String policy5, java.lang.String policy6) + { + super(context); + this.html = html; + this.policy1 = policy1 == null ? null : communitycommons.proxies.SanitizerPolicy.valueOf(policy1); + this.policy2 = policy2 == null ? null : communitycommons.proxies.SanitizerPolicy.valueOf(policy2); + this.policy3 = policy3 == null ? null : communitycommons.proxies.SanitizerPolicy.valueOf(policy3); + this.policy4 = policy4 == null ? null : communitycommons.proxies.SanitizerPolicy.valueOf(policy4); + this.policy5 = policy5 == null ? null : communitycommons.proxies.SanitizerPolicy.valueOf(policy5); + this.policy6 = policy6 == null ? null : communitycommons.proxies.SanitizerPolicy.valueOf(policy6); + } + + @java.lang.Override + public java.lang.String executeAction() throws Exception + { + // BEGIN USER CODE + if (StringUtils.isEmpty(html)) { + return ""; + } + + List policyParams = Stream.of(policy1, policy2, policy3, policy4, policy5, policy6) + .filter(Objects::nonNull) + .collect(Collectors.toList()); + + if (policyParams.isEmpty()) { + throw new MendixRuntimeException("At least one policy is required"); + } + + return communitycommons.StringUtils.sanitizeHTML(html, policyParams); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "XSSSanitize"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/YearsBetween.java b/module/javasource/communitycommons/actions/YearsBetween.java old mode 100755 new mode 100644 similarity index 91% rename from test/javasource/communitycommons/actions/YearsBetween.java rename to module/javasource/communitycommons/actions/YearsBetween.java index a54a38ae..406ee889 --- a/test/javasource/communitycommons/actions/YearsBetween.java +++ b/module/javasource/communitycommons/actions/YearsBetween.java @@ -1,63 +1,63 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; -import communitycommons.DateTime; -import communitycommons.Logging; -import communitycommons.proxies.LogLevel; -import communitycommons.proxies.LogNodes; -import java.util.Date; - -/** - * Calculates the number of years between two dates. - * - dateTime : the original (oldest) dateTime - * - compareDate: the second date. If EMPTY, the current datetime will be used. Effectively this means that the age of the dateTime is calculated. - */ -public class YearsBetween extends CustomJavaAction -{ - private java.util.Date dateTime; - private java.util.Date compareDate; - - public YearsBetween(IContext context, java.util.Date dateTime, java.util.Date compareDate) - { - super(context); - this.dateTime = dateTime; - this.compareDate = compareDate; - } - - @java.lang.Override - public java.lang.Long executeAction() throws Exception - { - // BEGIN USER CODE - try { - return Long.valueOf(DateTime.periodBetween(this.dateTime, compareDate == null ? new Date() : compareDate) - .getYears()); - } catch (Exception e) { - Logging.log(LogNodes.CommunityCommons.name(), LogLevel.Warning, "DateTime calculation error, returning -1", e); - return -1L; - } - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "YearsBetween"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; +import communitycommons.DateTime; +import communitycommons.Logging; +import communitycommons.proxies.LogLevel; +import communitycommons.proxies.LogNodes; +import java.util.Date; + +/** + * Calculates the number of years between two dates. + * - dateTime : the original (oldest) dateTime + * - compareDate: the second date. If EMPTY, the current datetime will be used. Effectively this means that the age of the dateTime is calculated. + */ +public class YearsBetween extends CustomJavaAction +{ + private java.util.Date dateTime; + private java.util.Date compareDate; + + public YearsBetween(IContext context, java.util.Date dateTime, java.util.Date compareDate) + { + super(context); + this.dateTime = dateTime; + this.compareDate = compareDate; + } + + @java.lang.Override + public java.lang.Long executeAction() throws Exception + { + // BEGIN USER CODE + try { + return Long.valueOf(DateTime.periodBetween(this.dateTime, compareDate == null ? new Date() : compareDate) + .getYears()); + } catch (Exception e) { + Logging.log(LogNodes.CommunityCommons.name(), LogLevel.Warning, "DateTime calculation error, returning -1", e); + return -1L; + } + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "YearsBetween"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/commitInSeparateDatabaseTransaction.java b/module/javasource/communitycommons/actions/commitInSeparateDatabaseTransaction.java old mode 100755 new mode 100644 similarity index 83% rename from test/javasource/communitycommons/actions/commitInSeparateDatabaseTransaction.java rename to module/javasource/communitycommons/actions/commitInSeparateDatabaseTransaction.java index 368747b0..8845f810 --- a/test/javasource/communitycommons/actions/commitInSeparateDatabaseTransaction.java +++ b/module/javasource/communitycommons/actions/commitInSeparateDatabaseTransaction.java @@ -1,55 +1,57 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.core.Core; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.systemwideinterfaces.core.ISession; -import com.mendix.webui.CustomJavaAction; -import com.mendix.systemwideinterfaces.core.IMendixObject; - -/** - * This function commits an object in a seperate context and transaction, making sure it gets persisted in the database (regarding which exception happens after invocation). - */ -public class commitInSeparateDatabaseTransaction extends CustomJavaAction -{ - private IMendixObject mxObject; - - public commitInSeparateDatabaseTransaction(IContext context, IMendixObject mxObject) - { - super(context); - this.mxObject = mxObject; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - ISession session = getContext().getSession(); - IContext newContext = session.createContext(); - Core.commit(newContext, mxObject); - newContext.endTransaction(); - return true; - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "commitInSeparateDatabaseTransaction"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.core.Core; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.systemwideinterfaces.core.ISession; +import com.mendix.webui.CustomJavaAction; +import com.mendix.systemwideinterfaces.core.IMendixObject; + +/** + * This function commits an object in a seperate context and transaction, making sure it gets persisted in the database (regarding which exception happens after invocation). + * + * Please note that this action is prone to deadlock. For example if you commit an object in one transaction and then use this action to commit the same object in a separate transaction. We do not recommend the use of this action. + */ +public class commitInSeparateDatabaseTransaction extends CustomJavaAction +{ + private IMendixObject mxObject; + + public commitInSeparateDatabaseTransaction(IContext context, IMendixObject mxObject) + { + super(context); + this.mxObject = mxObject; + } + + @java.lang.Override + public java.lang.Boolean executeAction() throws Exception + { + // BEGIN USER CODE + ISession session = getContext().getSession(); + IContext newContext = session.createContext(); + Core.commit(newContext, mxObject); + newContext.endTransaction(); + return true; + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "commitInSeparateDatabaseTransaction"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/commitWithoutEvents.java b/module/javasource/communitycommons/actions/commitWithoutEvents.java old mode 100755 new mode 100644 similarity index 93% rename from test/javasource/communitycommons/actions/commitWithoutEvents.java rename to module/javasource/communitycommons/actions/commitWithoutEvents.java index 110042eb..f8c3de67 --- a/test/javasource/communitycommons/actions/commitWithoutEvents.java +++ b/module/javasource/communitycommons/actions/commitWithoutEvents.java @@ -1,52 +1,52 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IMendixObject; -import communitycommons.ORM; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Commits an object, but without events. - * - * N.B. This function is not very useful when called from the model, but it is useful when called from custom Java code. - */ -public class commitWithoutEvents extends CustomJavaAction -{ - private IMendixObject subject; - - public commitWithoutEvents(IContext context, IMendixObject subject) - { - super(context); - this.subject = subject; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - return ORM.commitWithoutEvents(this.getContext(), subject); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "commitWithoutEvents"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IMendixObject; +import communitycommons.ORM; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Commits an object, but without events. + * + * N.B. This function is not very useful when called from the model, but it is useful when called from custom Java code. + */ +public class commitWithoutEvents extends CustomJavaAction +{ + private IMendixObject subject; + + public commitWithoutEvents(IContext context, IMendixObject subject) + { + super(context); + this.subject = subject; + } + + @java.lang.Override + public java.lang.Boolean executeAction() throws Exception + { + // BEGIN USER CODE + return ORM.commitWithoutEvents(this.getContext(), subject); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "commitWithoutEvents"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/copyAttributes.java b/module/javasource/communitycommons/actions/copyAttributes.java old mode 100755 new mode 100644 similarity index 92% rename from test/javasource/communitycommons/actions/copyAttributes.java rename to module/javasource/communitycommons/actions/copyAttributes.java index 8aefd593..eaa06c87 --- a/test/javasource/communitycommons/actions/copyAttributes.java +++ b/module/javasource/communitycommons/actions/copyAttributes.java @@ -1,55 +1,55 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; -import com.mendix.systemwideinterfaces.core.IMendixObject; -import communitycommons.ORM; - -/** - * Copies all common primitive attributes from source to target, which are not necessarily of the same type. This is useful to, for example, translate database object into view objects. - * - * Note that no automatic type conversion is done. - */ -public class copyAttributes extends CustomJavaAction -{ - private IMendixObject source; - private IMendixObject target; - - public copyAttributes(IContext context, IMendixObject source, IMendixObject target) - { - super(context); - this.source = source; - this.target = target; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - ORM.copyAttributes(getContext(), source, target); - return true; - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "copyAttributes"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; +import com.mendix.systemwideinterfaces.core.IMendixObject; +import communitycommons.ORM; + +/** + * Copies all common primitive attributes from source to target, which are not necessarily of the same type. This is useful to, for example, translate database object into view objects. + * + * Note that no automatic type conversion is done. + */ +public class copyAttributes extends CustomJavaAction +{ + private IMendixObject source; + private IMendixObject target; + + public copyAttributes(IContext context, IMendixObject source, IMendixObject target) + { + super(context); + this.source = source; + this.target = target; + } + + @java.lang.Override + public java.lang.Boolean executeAction() throws Exception + { + // BEGIN USER CODE + ORM.copyAttributes(getContext(), source, target); + return true; + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "copyAttributes"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/deleteAll.java b/module/javasource/communitycommons/actions/deleteAll.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/deleteAll.java rename to module/javasource/communitycommons/actions/deleteAll.java diff --git a/test/javasource/communitycommons/actions/executeMicroflowAsUser.java b/module/javasource/communitycommons/actions/executeMicroflowAsUser.java old mode 100755 new mode 100644 similarity index 93% rename from test/javasource/communitycommons/actions/executeMicroflowAsUser.java rename to module/javasource/communitycommons/actions/executeMicroflowAsUser.java index 2c10fe38..ff8e5664 --- a/test/javasource/communitycommons/actions/executeMicroflowAsUser.java +++ b/module/javasource/communitycommons/actions/executeMicroflowAsUser.java @@ -1,58 +1,58 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import communitycommons.Misc; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Executes the given microflow as if the $currentuser is the provided user (delegation). Use sudoContext to determine if 'apply entity access' should be used - * - * - microflowName: the fully qualified microflow name, 'CommunityCommons.CreateUserIfNotExists' - * - username: The user that should be used to execute the microflow - * - sudoContext: whether entity access should be applied. - */ -public class executeMicroflowAsUser extends CustomJavaAction -{ - private java.lang.String microflow; - private java.lang.String username; - private java.lang.Boolean sudoContext; - - public executeMicroflowAsUser(IContext context, java.lang.String microflow, java.lang.String username, java.lang.Boolean sudoContext) - { - super(context); - this.microflow = microflow; - this.username = username; - this.sudoContext = sudoContext; - } - - @java.lang.Override - public java.lang.String executeAction() throws Exception - { - // BEGIN USER CODE - Object res = Misc.executeMicroflowAsUser(getContext(), microflow, username, sudoContext); - return res == null ? null : res.toString(); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "executeMicroflowAsUser"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import communitycommons.Misc; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Executes the given microflow as if the $currentuser is the provided user (delegation). Use sudoContext to determine if 'apply entity access' should be used + * + * - microflowName: the fully qualified microflow name, 'CommunityCommons.CreateUserIfNotExists' + * - username: The user that should be used to execute the microflow + * - sudoContext: whether entity access should be applied. + */ +public class executeMicroflowAsUser extends CustomJavaAction +{ + private java.lang.String microflow; + private java.lang.String username; + private java.lang.Boolean sudoContext; + + public executeMicroflowAsUser(IContext context, java.lang.String microflow, java.lang.String username, java.lang.Boolean sudoContext) + { + super(context); + this.microflow = microflow; + this.username = username; + this.sudoContext = sudoContext; + } + + @java.lang.Override + public java.lang.String executeAction() throws Exception + { + // BEGIN USER CODE + Object res = Misc.executeMicroflowAsUser(getContext(), microflow, username, sudoContext); + return res == null ? null : res.toString(); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "executeMicroflowAsUser"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/executeMicroflowAsUser_1.java b/module/javasource/communitycommons/actions/executeMicroflowAsUser_1.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/executeMicroflowAsUser_1.java rename to module/javasource/communitycommons/actions/executeMicroflowAsUser_1.java diff --git a/test/javasource/communitycommons/actions/executeMicroflowAsUser_2.java b/module/javasource/communitycommons/actions/executeMicroflowAsUser_2.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/executeMicroflowAsUser_2.java rename to module/javasource/communitycommons/actions/executeMicroflowAsUser_2.java diff --git a/test/javasource/communitycommons/actions/executeMicroflowInBackground.java b/module/javasource/communitycommons/actions/executeMicroflowInBackground.java old mode 100755 new mode 100644 similarity index 90% rename from test/javasource/communitycommons/actions/executeMicroflowInBackground.java rename to module/javasource/communitycommons/actions/executeMicroflowInBackground.java index 061747bd..5cfcc54a --- a/test/javasource/communitycommons/actions/executeMicroflowInBackground.java +++ b/module/javasource/communitycommons/actions/executeMicroflowInBackground.java @@ -1,64 +1,64 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IMendixObject; -import communitycommons.Misc; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * This action allows an microflow to be executed independently from this microflow. - * This function is identical to "RunMicroflowAsyncInQueue", except that it takes one argument which will be passed to the microflow being called. - * - * This might be useful to model for example your own batching system, or to run a microflow in its own (system) transaction. The microflow is delayed for at least 200ms and then run with low priority in a system context. Since the microflow run in its own transaction, it is not affected with rollbacks (due to exceptions) or commits in this microflow. - * - * Invocations to this method are guaranteed to be run in FIFO order, only one microflow is run at a time. - * - * Note that since the microflow is run as system transaction, $currentUser is not available and no security restrictions are applied. - * - * - The microflowname specifies the fully qualified name of the microflow (case sensitive) e.g.: 'MyFirstModule.MyFirstMicroflow'. - * - The context object specifies an argument that should be passed to the microflow if applicable. Currently only zero or one argument are supported. Note that editing this object in both microflows might lead to unexpected behavior. - * - * Returns true if scheduled successfully. - */ -public class executeMicroflowInBackground extends CustomJavaAction -{ - private java.lang.String microflow; - private IMendixObject contextObject; - - public executeMicroflowInBackground(IContext context, java.lang.String microflow, IMendixObject contextObject) - { - super(context); - this.microflow = microflow; - this.contextObject = contextObject; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - return Misc.runMicroflowInBackground(getContext(), microflow, contextObject); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "executeMicroflowInBackground"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IMendixObject; +import communitycommons.Misc; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * This action allows an microflow to be executed independently from this microflow. + * This function is identical to "RunMicroflowAsyncInQueue", except that it takes one argument which will be passed to the microflow being called. + * + * This might be useful to model for example your own batching system, or to run a microflow in its own (system) transaction. The microflow is delayed for at least 200ms and then run with low priority in a system context. Since the microflow run in its own transaction, it is not affected with rollbacks (due to exceptions) or commits in this microflow. + * + * Invocations to this method are guaranteed to be run in FIFO order, only one microflow is run at a time. + * + * Note that since the microflow is run as system transaction, $currentUser is not available and no security restrictions are applied. + * + * - The microflowname specifies the fully qualified name of the microflow (case sensitive) e.g.: 'MyFirstModule.MyFirstMicroflow'. + * - The context object specifies an argument that should be passed to the microflow if applicable. Currently only zero or one argument are supported. Note that editing this object in both microflows might lead to unexpected behavior. + * + * Returns true if scheduled successfully. + */ +public class executeMicroflowInBackground extends CustomJavaAction +{ + private java.lang.String microflow; + private IMendixObject contextObject; + + public executeMicroflowInBackground(IContext context, java.lang.String microflow, IMendixObject contextObject) + { + super(context); + this.microflow = microflow; + this.contextObject = contextObject; + } + + @java.lang.Override + public java.lang.Boolean executeAction() throws Exception + { + // BEGIN USER CODE + return Misc.runMicroflowInBackground(getContext(), microflow, contextObject); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "executeMicroflowInBackground"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/executeMicroflowInBatches.java b/module/javasource/communitycommons/actions/executeMicroflowInBatches.java old mode 100755 new mode 100644 similarity index 84% rename from test/javasource/communitycommons/actions/executeMicroflowInBatches.java rename to module/javasource/communitycommons/actions/executeMicroflowInBatches.java index 2b21d24e..6a4595f7 --- a/test/javasource/communitycommons/actions/executeMicroflowInBatches.java +++ b/module/javasource/communitycommons/actions/executeMicroflowInBatches.java @@ -1,72 +1,72 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import communitycommons.Misc; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Invokes a microflow in batches. The microflow is invoked for each individual item returned by the xpath query. - * - * The objects will be processed in small batches (based on the batchsize), which makes this function very useful to process large amounts of objects without using much memory. All defaut behavior such as commit events are applied as defined in your microflow. - * - * Parameters: - * - xpath: Fully qualified xpath query that indicates the set of objects the microflow should be invoked on. For example: - * '//System.User[Active = true()]' - * - microflow: The microflow that should be invoked. Should accept one argument of the same type as the xpath. For example: - * 'MyFirstModule.UpdateBirthday' - * - batchsize: The amount of objects that should be processed in a single transaction. When in doubt, 1 is fine, but larger batches (for example; 100) will be faster due to less overhead. - * - waitUntilFinished: Whether this call should block (wait) until all objects are - * processed. - * - * Returns true if the batch has successfully started, or, if waitUntilFinished is true, returns true if the batch succeeded completely. - * - * Note, if new objects are added to the dataset while the batch is still running, those objects will be processed as well. - */ -public class executeMicroflowInBatches extends CustomJavaAction -{ - private java.lang.String xpath; - private java.lang.String microflow; - private java.lang.Long batchsize; - private java.lang.Boolean waitUntilFinished; - private java.lang.Boolean ascending; - - public executeMicroflowInBatches(IContext context, java.lang.String xpath, java.lang.String microflow, java.lang.Long batchsize, java.lang.Boolean waitUntilFinished, java.lang.Boolean ascending) - { - super(context); - this.xpath = xpath; - this.microflow = microflow; - this.batchsize = batchsize; - this.waitUntilFinished = waitUntilFinished; - this.ascending = ascending; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - return Misc.executeMicroflowInBatches(xpath, microflow, batchsize.intValue(), waitUntilFinished.booleanValue(), ascending); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "executeMicroflowInBatches"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import communitycommons.Misc; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Invokes a microflow in batches. The microflow is invoked for each individual item returned by the xpath query. + * + * The objects will be processed in small batches (based on the batchsize), which makes this function very useful to process large amounts of objects without using much memory. All defaut behavior such as commit events are applied as defined in your microflow. + * + * Parameters: + * - xpath: Fully qualified xpath query that indicates the set of objects the microflow should be invoked on. For example: + * '//System.User[Active = true()]' + * - microflow: The microflow that should be invoked. Should accept one argument of the same type as the xpath. For example: + * 'MyFirstModule.UpdateBirthday' + * - batchsize: The amount of objects that should be processed in a single transaction. When in doubt, 1 is fine, but larger batches (for example; 100) will be faster due to less overhead. + * - waitUntilFinished: Whether this call should block (wait) until all objects are + * processed. + * + * Returns true if the batch has successfully started, or, if waitUntilFinished is true, returns true if the batch succeeded completely. + * + * Note, if new objects are added to the dataset while the batch is still running, those objects will be processed as well. + */ +public class executeMicroflowInBatches extends CustomJavaAction +{ + private java.lang.String xpath; + private java.lang.String microflow; + private java.lang.Long batchsize; + private java.lang.Boolean waitUntilFinished; + private java.lang.Boolean ascending; + + public executeMicroflowInBatches(IContext context, java.lang.String xpath, java.lang.String microflow, java.lang.Long batchsize, java.lang.Boolean waitUntilFinished, java.lang.Boolean ascending) + { + super(context); + this.xpath = xpath; + this.microflow = microflow; + this.batchsize = batchsize; + this.waitUntilFinished = waitUntilFinished; + this.ascending = ascending; + } + + @java.lang.Override + public java.lang.Boolean executeAction() throws Exception + { + // BEGIN USER CODE + return Misc.executeMicroflowInBatches(xpath, microflow, batchsize.intValue(), waitUntilFinished.booleanValue(), ascending); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "executeMicroflowInBatches"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/executeUnverifiedMicroflowAsUser.java b/module/javasource/communitycommons/actions/executeUnverifiedMicroflowAsUser.java old mode 100755 new mode 100644 similarity index 93% rename from test/javasource/communitycommons/actions/executeUnverifiedMicroflowAsUser.java rename to module/javasource/communitycommons/actions/executeUnverifiedMicroflowAsUser.java index 723a421d..7fc9c25b --- a/test/javasource/communitycommons/actions/executeUnverifiedMicroflowAsUser.java +++ b/module/javasource/communitycommons/actions/executeUnverifiedMicroflowAsUser.java @@ -1,58 +1,58 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; -import communitycommons.Misc; - -/** - * Executes the given microflow as if the $currentuser is the provided user (delegation). Use sudoContext to determine if 'apply entity access' should be used - * - * - microflowName: the fully qualified microflow name, 'CommunityCommons.CreateUserIfNotExists' - * - username: The user that should be used to execute the microflow - * - sudoContext: whether entity access should be applied. - */ -public class executeUnverifiedMicroflowAsUser extends CustomJavaAction -{ - private java.lang.String microflowName; - private java.lang.String username; - private java.lang.Boolean sudoContext; - - public executeUnverifiedMicroflowAsUser(IContext context, java.lang.String microflowName, java.lang.String username, java.lang.Boolean sudoContext) - { - super(context); - this.microflowName = microflowName; - this.username = username; - this.sudoContext = sudoContext; - } - - @java.lang.Override - public java.lang.String executeAction() throws Exception - { - // BEGIN USER CODE - Object res = Misc.executeMicroflowAsUser(getContext(), microflowName, username, sudoContext); - return res == null ? null : res.toString(); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "executeUnverifiedMicroflowAsUser"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; +import communitycommons.Misc; + +/** + * Executes the given microflow as if the $currentuser is the provided user (delegation). Use sudoContext to determine if 'apply entity access' should be used + * + * - microflowName: the fully qualified microflow name, 'CommunityCommons.CreateUserIfNotExists' + * - username: The user that should be used to execute the microflow + * - sudoContext: whether entity access should be applied. + */ +public class executeUnverifiedMicroflowAsUser extends CustomJavaAction +{ + private java.lang.String microflowName; + private java.lang.String username; + private java.lang.Boolean sudoContext; + + public executeUnverifiedMicroflowAsUser(IContext context, java.lang.String microflowName, java.lang.String username, java.lang.Boolean sudoContext) + { + super(context); + this.microflowName = microflowName; + this.username = username; + this.sudoContext = sudoContext; + } + + @java.lang.Override + public java.lang.String executeAction() throws Exception + { + // BEGIN USER CODE + Object res = Misc.executeMicroflowAsUser(getContext(), microflowName, username, sudoContext); + return res == null ? null : res.toString(); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "executeUnverifiedMicroflowAsUser"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/executeUnverifiedMicroflowAsUser_1.java b/module/javasource/communitycommons/actions/executeUnverifiedMicroflowAsUser_1.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/executeUnverifiedMicroflowAsUser_1.java rename to module/javasource/communitycommons/actions/executeUnverifiedMicroflowAsUser_1.java diff --git a/test/javasource/communitycommons/actions/executeUnverifiedMicroflowAsUser_2.java b/module/javasource/communitycommons/actions/executeUnverifiedMicroflowAsUser_2.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/executeUnverifiedMicroflowAsUser_2.java rename to module/javasource/communitycommons/actions/executeUnverifiedMicroflowAsUser_2.java diff --git a/test/javasource/communitycommons/actions/executeUnverifiedMicroflowInBackground.java b/module/javasource/communitycommons/actions/executeUnverifiedMicroflowInBackground.java old mode 100755 new mode 100644 similarity index 90% rename from test/javasource/communitycommons/actions/executeUnverifiedMicroflowInBackground.java rename to module/javasource/communitycommons/actions/executeUnverifiedMicroflowInBackground.java index eea19d8a..42218df0 --- a/test/javasource/communitycommons/actions/executeUnverifiedMicroflowInBackground.java +++ b/module/javasource/communitycommons/actions/executeUnverifiedMicroflowInBackground.java @@ -1,64 +1,64 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; -import communitycommons.Misc; -import com.mendix.systemwideinterfaces.core.IMendixObject; - -/** - * This action allows an microflow to be executed independently from this microflow. - * This function is identical to "RunMicroflowAsyncInQueue", except that it takes one argument which will be passed to the microflow being called. - * - * This might be useful to model for example your own batching system, or to run a microflow in its own (system) transaction. The microflow is delayed for at least 200ms and then run with low priority in a system context. Since the microflow run in its own transaction, it is not affected with rollbacks (due to exceptions) or commits in this microflow. - * - * Invocations to this method are guaranteed to be run in FIFO order, only one microflow is run at a time. - * - * Note that since the microflow is run as system transaction, $currentUser is not available and no security restrictions are applied. - * - * - The microflowname specifies the fully qualified name of the microflow (case sensitive) e.g.: 'MyFirstModule.MyFirstMicroflow'. - * - The context object specifies an argument that should be passed to the microflow if applicable. Currently only zero or one argument are supported. Note that editing this object in both microflows might lead to unexpected behavior. - * - * Returns true if scheduled successfully. - */ -public class executeUnverifiedMicroflowInBackground extends CustomJavaAction -{ - private java.lang.String microflowName; - private IMendixObject contextObject; - - public executeUnverifiedMicroflowInBackground(IContext context, java.lang.String microflowName, IMendixObject contextObject) - { - super(context); - this.microflowName = microflowName; - this.contextObject = contextObject; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - return Misc.runMicroflowInBackground(getContext(), microflowName, contextObject); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "executeUnverifiedMicroflowInBackground"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; +import communitycommons.Misc; +import com.mendix.systemwideinterfaces.core.IMendixObject; + +/** + * This action allows an microflow to be executed independently from this microflow. + * This function is identical to "RunMicroflowAsyncInQueue", except that it takes one argument which will be passed to the microflow being called. + * + * This might be useful to model for example your own batching system, or to run a microflow in its own (system) transaction. The microflow is delayed for at least 200ms and then run with low priority in a system context. Since the microflow run in its own transaction, it is not affected with rollbacks (due to exceptions) or commits in this microflow. + * + * Invocations to this method are guaranteed to be run in FIFO order, only one microflow is run at a time. + * + * Note that since the microflow is run as system transaction, $currentUser is not available and no security restrictions are applied. + * + * - The microflowname specifies the fully qualified name of the microflow (case sensitive) e.g.: 'MyFirstModule.MyFirstMicroflow'. + * - The context object specifies an argument that should be passed to the microflow if applicable. Currently only zero or one argument are supported. Note that editing this object in both microflows might lead to unexpected behavior. + * + * Returns true if scheduled successfully. + */ +public class executeUnverifiedMicroflowInBackground extends CustomJavaAction +{ + private java.lang.String microflowName; + private IMendixObject contextObject; + + public executeUnverifiedMicroflowInBackground(IContext context, java.lang.String microflowName, IMendixObject contextObject) + { + super(context); + this.microflowName = microflowName; + this.contextObject = contextObject; + } + + @java.lang.Override + public java.lang.Boolean executeAction() throws Exception + { + // BEGIN USER CODE + return Misc.runMicroflowInBackground(getContext(), microflowName, contextObject); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "executeUnverifiedMicroflowInBackground"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/executeUnverifiedMicroflowInBatches.java b/module/javasource/communitycommons/actions/executeUnverifiedMicroflowInBatches.java old mode 100755 new mode 100644 similarity index 85% rename from test/javasource/communitycommons/actions/executeUnverifiedMicroflowInBatches.java rename to module/javasource/communitycommons/actions/executeUnverifiedMicroflowInBatches.java index 3c5006d0..c3d3700c --- a/test/javasource/communitycommons/actions/executeUnverifiedMicroflowInBatches.java +++ b/module/javasource/communitycommons/actions/executeUnverifiedMicroflowInBatches.java @@ -1,72 +1,72 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; -import communitycommons.Misc; - -/** - * Invokes a microflow in batches. The microflow is invoked for each individual item returned by the xpath query. - * - * The objects will be processed in small batches (based on the batchsize), which makes this function very useful to process large amounts of objects without using much memory. All defaut behavior such as commit events are applied as defined in your microflow. - * - * Parameters: - * - xpath: Fully qualified xpath query that indicates the set of objects the microflow should be invoked on. For example: - * '//System.User[Active = true()]' - * - microflow: The microflow that should be invoked. Should accept one argument of the same type as the xpath. For example: - * 'MyFirstModule.UpdateBirthday' - * - batchsize: The amount of objects that should be processed in a single transaction. When in doubt, 1 is fine, but larger batches (for example; 100) will be faster due to less overhead. - * - waitUntilFinished: Whether this call should block (wait) until all objects are - * processed. - * - * Returns true if the batch has successfully started, or, if waitUntilFinished is true, returns true if the batch succeeded completely. - * - * Note, if new objects are added to the dataset while the batch is still running, those objects will be processed as well. - */ -public class executeUnverifiedMicroflowInBatches extends CustomJavaAction -{ - private java.lang.String xpath; - private java.lang.String microflowName; - private java.lang.Long batchsize; - private java.lang.Boolean waitUntilFinished; - private java.lang.Boolean ascending; - - public executeUnverifiedMicroflowInBatches(IContext context, java.lang.String xpath, java.lang.String microflowName, java.lang.Long batchsize, java.lang.Boolean waitUntilFinished, java.lang.Boolean ascending) - { - super(context); - this.xpath = xpath; - this.microflowName = microflowName; - this.batchsize = batchsize; - this.waitUntilFinished = waitUntilFinished; - this.ascending = ascending; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - return Misc.executeMicroflowInBatches(xpath, microflowName, batchsize.intValue(), waitUntilFinished.booleanValue(), ascending); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "executeUnverifiedMicroflowInBatches"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; +import communitycommons.Misc; + +/** + * Invokes a microflow in batches. The microflow is invoked for each individual item returned by the xpath query. + * + * The objects will be processed in small batches (based on the batchsize), which makes this function very useful to process large amounts of objects without using much memory. All defaut behavior such as commit events are applied as defined in your microflow. + * + * Parameters: + * - xpath: Fully qualified xpath query that indicates the set of objects the microflow should be invoked on. For example: + * '//System.User[Active = true()]' + * - microflow: The microflow that should be invoked. Should accept one argument of the same type as the xpath. For example: + * 'MyFirstModule.UpdateBirthday' + * - batchsize: The amount of objects that should be processed in a single transaction. When in doubt, 1 is fine, but larger batches (for example; 100) will be faster due to less overhead. + * - waitUntilFinished: Whether this call should block (wait) until all objects are + * processed. + * + * Returns true if the batch has successfully started, or, if waitUntilFinished is true, returns true if the batch succeeded completely. + * + * Note, if new objects are added to the dataset while the batch is still running, those objects will be processed as well. + */ +public class executeUnverifiedMicroflowInBatches extends CustomJavaAction +{ + private java.lang.String xpath; + private java.lang.String microflowName; + private java.lang.Long batchsize; + private java.lang.Boolean waitUntilFinished; + private java.lang.Boolean ascending; + + public executeUnverifiedMicroflowInBatches(IContext context, java.lang.String xpath, java.lang.String microflowName, java.lang.Long batchsize, java.lang.Boolean waitUntilFinished, java.lang.Boolean ascending) + { + super(context); + this.xpath = xpath; + this.microflowName = microflowName; + this.batchsize = batchsize; + this.waitUntilFinished = waitUntilFinished; + this.ascending = ascending; + } + + @java.lang.Override + public java.lang.Boolean executeAction() throws Exception + { + // BEGIN USER CODE + return Misc.executeMicroflowInBatches(xpath, microflowName, batchsize.intValue(), waitUntilFinished.booleanValue(), ascending); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "executeUnverifiedMicroflowInBatches"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/getCreatedByUser.java b/module/javasource/communitycommons/actions/getCreatedByUser.java old mode 100755 new mode 100644 similarity index 92% rename from test/javasource/communitycommons/actions/getCreatedByUser.java rename to module/javasource/communitycommons/actions/getCreatedByUser.java index 2bf96b7a..cd7dec5c --- a/test/javasource/communitycommons/actions/getCreatedByUser.java +++ b/module/javasource/communitycommons/actions/getCreatedByUser.java @@ -1,52 +1,52 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IMendixObject; -import communitycommons.ORM; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Returns the user that created an object - * - * (or empty if not applicable). - */ -public class getCreatedByUser extends CustomJavaAction -{ - private IMendixObject thing; - - public getCreatedByUser(IContext context, IMendixObject thing) - { - super(context); - this.thing = thing; - } - - @java.lang.Override - public IMendixObject executeAction() throws Exception - { - // BEGIN USER CODE - return ORM.getCreatedByUser(getContext(), thing); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "getCreatedByUser"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IMendixObject; +import communitycommons.ORM; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Returns the user that created an object + * + * (or empty if not applicable). + */ +public class getCreatedByUser extends CustomJavaAction +{ + private IMendixObject thing; + + public getCreatedByUser(IContext context, IMendixObject thing) + { + super(context); + this.thing = thing; + } + + @java.lang.Override + public IMendixObject executeAction() throws Exception + { + // BEGIN USER CODE + return ORM.getCreatedByUser(getContext(), thing); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "getCreatedByUser"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/getFileSize.java b/module/javasource/communitycommons/actions/getFileSize.java old mode 100755 new mode 100644 similarity index 91% rename from test/javasource/communitycommons/actions/getFileSize.java rename to module/javasource/communitycommons/actions/getFileSize.java index 7cfcdee7..344a3e6c --- a/test/javasource/communitycommons/actions/getFileSize.java +++ b/module/javasource/communitycommons/actions/getFileSize.java @@ -1,58 +1,58 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IMendixObject; -import communitycommons.Misc; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Returns the filesize of a file document in bytes. - * - * From version 2.3 on, this function can be used in cloud environments as well. - * - * NOTE: - * before 2.1, this functioned returned the size in kilobytes, although this documentation mentioned bytes - */ -public class getFileSize extends CustomJavaAction -{ - private IMendixObject __document; - private system.proxies.FileDocument document; - - public getFileSize(IContext context, IMendixObject document) - { - super(context); - this.__document = document; - } - - @java.lang.Override - public java.lang.Long executeAction() throws Exception - { - this.document = this.__document == null ? null : system.proxies.FileDocument.initialize(getContext(), __document); - - // BEGIN USER CODE - return Misc.getFileSize(this.getContext(), document.getMendixObject()); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "getFileSize"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IMendixObject; +import communitycommons.Misc; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Returns the filesize of a file document in bytes. + * + * From version 2.3 on, this function can be used in cloud environments as well. + * + * NOTE: + * before 2.1, this functioned returned the size in kilobytes, although this documentation mentioned bytes + */ +public class getFileSize extends CustomJavaAction +{ + private IMendixObject __document; + private system.proxies.FileDocument document; + + public getFileSize(IContext context, IMendixObject document) + { + super(context); + this.__document = document; + } + + @java.lang.Override + public java.lang.Long executeAction() throws Exception + { + this.document = this.__document == null ? null : system.proxies.FileDocument.initialize(getContext(), __document); + + // BEGIN USER CODE + return Misc.getFileSize(this.getContext(), document.getMendixObject()); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "getFileSize"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/getGUID.java b/module/javasource/communitycommons/actions/getGUID.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/getGUID.java rename to module/javasource/communitycommons/actions/getGUID.java diff --git a/test/javasource/communitycommons/actions/getLastChangedByUser.java b/module/javasource/communitycommons/actions/getLastChangedByUser.java old mode 100755 new mode 100644 similarity index 95% rename from test/javasource/communitycommons/actions/getLastChangedByUser.java rename to module/javasource/communitycommons/actions/getLastChangedByUser.java index d35ca980..dd73fe29 --- a/test/javasource/communitycommons/actions/getLastChangedByUser.java +++ b/module/javasource/communitycommons/actions/getLastChangedByUser.java @@ -1,52 +1,52 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IMendixObject; -import communitycommons.ORM; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Returns the user that last changed this object as System.User - * - * (or empty if not applicable). - */ -public class getLastChangedByUser extends CustomJavaAction -{ - private IMendixObject thing; - - public getLastChangedByUser(IContext context, IMendixObject thing) - { - super(context); - this.thing = thing; - } - - @java.lang.Override - public IMendixObject executeAction() throws Exception - { - // BEGIN USER CODE - return ORM.getLastChangedByUser(getContext(), thing); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "getLastChangedByUser"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IMendixObject; +import communitycommons.ORM; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Returns the user that last changed this object as System.User + * + * (or empty if not applicable). + */ +public class getLastChangedByUser extends CustomJavaAction +{ + private IMendixObject thing; + + public getLastChangedByUser(IContext context, IMendixObject thing) + { + super(context); + this.thing = thing; + } + + @java.lang.Override + public IMendixObject executeAction() throws Exception + { + // BEGIN USER CODE + return ORM.getLastChangedByUser(getContext(), thing); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "getLastChangedByUser"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/getOriginalValueAsString.java b/module/javasource/communitycommons/actions/getOriginalValueAsString.java old mode 100755 new mode 100644 similarity index 87% rename from test/javasource/communitycommons/actions/getOriginalValueAsString.java rename to module/javasource/communitycommons/actions/getOriginalValueAsString.java index 827445e1..7841b0a7 --- a/test/javasource/communitycommons/actions/getOriginalValueAsString.java +++ b/module/javasource/communitycommons/actions/getOriginalValueAsString.java @@ -1,58 +1,58 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IMendixObject; -import communitycommons.ORM; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Returns the original value of an object member, that is, the last committed value. - * - * This is useful if you want to compare the actual value with the last stored value. - * - item : the object of which you want to inspect a member - * - member: the member to retrieve the previous value from. Note that for references, the module name needs to be included. - * - * The function is applicable for non-String members as well, but always returns a String representation of the previous value. - */ -public class getOriginalValueAsString extends CustomJavaAction -{ - private IMendixObject item; - private java.lang.String member; - - public getOriginalValueAsString(IContext context, IMendixObject item, java.lang.String member) - { - super(context); - this.item = item; - this.member = member; - } - - @java.lang.Override - public java.lang.String executeAction() throws Exception - { - // BEGIN USER CODE - return ORM.getOriginalValueAsString(this.getContext(), item, member); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "getOriginalValueAsString"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IMendixObject; +import communitycommons.ORM; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Returns the original value of an object member, that is, the last committed value. + * + * This is useful if you want to compare the actual value with the last stored value. + * - item : the object of which you want to inspect a member + * - member: the member to retrieve the previous value from. Note that for references, the module name needs to be included. + * + * The function is applicable for non-String members as well, but always returns a String representation of the previous value. + */ +public class getOriginalValueAsString extends CustomJavaAction +{ + private IMendixObject item; + private java.lang.String member; + + public getOriginalValueAsString(IContext context, IMendixObject item, java.lang.String member) + { + super(context); + this.item = item; + this.member = member; + } + + @java.lang.Override + public java.lang.String executeAction() throws Exception + { + // BEGIN USER CODE + return ORM.getOriginalValueAsString(this.getContext(), item, member); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "getOriginalValueAsString"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/getTypeAsString.java b/module/javasource/communitycommons/actions/getTypeAsString.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/getTypeAsString.java rename to module/javasource/communitycommons/actions/getTypeAsString.java diff --git a/test/javasource/communitycommons/actions/memberHasChanged.java b/module/javasource/communitycommons/actions/memberHasChanged.java old mode 100755 new mode 100644 similarity index 88% rename from test/javasource/communitycommons/actions/memberHasChanged.java rename to module/javasource/communitycommons/actions/memberHasChanged.java index 1bf69144..ce7b2d66 --- a/test/javasource/communitycommons/actions/memberHasChanged.java +++ b/module/javasource/communitycommons/actions/memberHasChanged.java @@ -1,57 +1,57 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IMendixObject; -import communitycommons.ORM; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Checks whether a member has changed since the last commit. Useful in combination with getOriginalValueAsString. - * - * - item : the object to inspect - * - member: the name of the member to inspect. Note that for references, the module name needs to be included. - * - * Returns true if changed. - */ -public class memberHasChanged extends CustomJavaAction -{ - private IMendixObject item; - private java.lang.String member; - - public memberHasChanged(IContext context, IMendixObject item, java.lang.String member) - { - super(context); - this.item = item; - this.member = member; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - return ORM.memberHasChanged(this.getContext(), item, member); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "memberHasChanged"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IMendixObject; +import communitycommons.ORM; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Checks whether a member has changed since the last commit. Useful in combination with getOriginalValueAsString. + * + * - item : the object to inspect + * - member: the name of the member to inspect. Note that for references, the module name needs to be included. + * + * Returns true if changed. + */ +public class memberHasChanged extends CustomJavaAction +{ + private IMendixObject item; + private java.lang.String member; + + public memberHasChanged(IContext context, IMendixObject item, java.lang.String member) + { + super(context); + this.item = item; + this.member = member; + } + + @java.lang.Override + public java.lang.Boolean executeAction() throws Exception + { + // BEGIN USER CODE + return ORM.memberHasChanged(this.getContext(), item, member); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "memberHasChanged"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/objectHasChanged.java b/module/javasource/communitycommons/actions/objectHasChanged.java old mode 100755 new mode 100644 similarity index 94% rename from test/javasource/communitycommons/actions/objectHasChanged.java rename to module/javasource/communitycommons/actions/objectHasChanged.java index 0d41f6a2..282e4f01 --- a/test/javasource/communitycommons/actions/objectHasChanged.java +++ b/module/javasource/communitycommons/actions/objectHasChanged.java @@ -1,52 +1,52 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IMendixObject; -import communitycommons.ORM; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Returns true if at least one member (including owned associations) of this object has changed. - * - * For Mendix < 9.5 this action keeps track of changes to the object except when 'changing to the same value'. For Mendix >= 9.5 this action keeps track of all changes. This is a result of a change of the underlying Mendix runtime-server behaviour. - */ -public class objectHasChanged extends CustomJavaAction -{ - private IMendixObject item; - - public objectHasChanged(IContext context, IMendixObject item) - { - super(context); - this.item = item; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - return ORM.objectHasChanged(item); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "objectHasChanged"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IMendixObject; +import communitycommons.ORM; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Returns true if at least one member (including owned associations) of this object has changed. + * + * For Mendix < 9.5 this action keeps track of changes to the object except when 'changing to the same value'. For Mendix >= 9.5 this action keeps track of all changes. This is a result of a change of the underlying Mendix runtime-server behaviour. + */ +public class objectHasChanged extends CustomJavaAction +{ + private IMendixObject item; + + public objectHasChanged(IContext context, IMendixObject item) + { + super(context); + this.item = item; + } + + @java.lang.Override + public java.lang.Boolean executeAction() throws Exception + { + // BEGIN USER CODE + return ORM.objectHasChanged(item); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "objectHasChanged"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/objectIsNew.java b/module/javasource/communitycommons/actions/objectIsNew.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/objectIsNew.java rename to module/javasource/communitycommons/actions/objectIsNew.java diff --git a/test/javasource/communitycommons/actions/recommitInBatches.java b/module/javasource/communitycommons/actions/recommitInBatches.java old mode 100755 new mode 100644 similarity index 100% rename from test/javasource/communitycommons/actions/recommitInBatches.java rename to module/javasource/communitycommons/actions/recommitInBatches.java diff --git a/test/javasource/communitycommons/actions/refreshClass.java b/module/javasource/communitycommons/actions/refreshClass.java old mode 100755 new mode 100644 similarity index 91% rename from test/javasource/communitycommons/actions/refreshClass.java rename to module/javasource/communitycommons/actions/refreshClass.java index 6c85cb90..c04b9208 --- a/test/javasource/communitycommons/actions/refreshClass.java +++ b/module/javasource/communitycommons/actions/refreshClass.java @@ -1,53 +1,53 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; -import com.mendix.webui.FeedbackHelper; - -/** - * Refreshes a certain domain object type in the client. Useful to enforce a datagrid to refresh for example. - * - * -objectType : Type of the domain objects to refresh, such as System.User or MyModule.MyFirstEntity. - * (you can use getTypeAsString to determine this dynamically, so that the invoke of this action is not be sensitive to domain model changes). - */ -public class refreshClass extends CustomJavaAction -{ - private java.lang.String objectType; - - public refreshClass(IContext context, java.lang.String objectType) - { - super(context); - this.objectType = objectType; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - FeedbackHelper.addRefreshClass(this.getContext(), objectType); - return true; - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "refreshClass"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; +import com.mendix.webui.FeedbackHelper; + +/** + * Refreshes a certain domain object type in the client. Useful to enforce a datagrid to refresh for example. + * + * -objectType : Type of the domain objects to refresh, such as System.User or MyModule.MyFirstEntity. + * (you can use getTypeAsString to determine this dynamically, so that the invoke of this action is not be sensitive to domain model changes). + */ +public class refreshClass extends CustomJavaAction +{ + private java.lang.String objectType; + + public refreshClass(IContext context, java.lang.String objectType) + { + super(context); + this.objectType = objectType; + } + + @java.lang.Override + public java.lang.Boolean executeAction() throws Exception + { + // BEGIN USER CODE + FeedbackHelper.addRefreshClass(this.getContext(), objectType); + return true; + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "refreshClass"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/refreshClassByObject.java b/module/javasource/communitycommons/actions/refreshClassByObject.java old mode 100755 new mode 100644 similarity index 93% rename from test/javasource/communitycommons/actions/refreshClassByObject.java rename to module/javasource/communitycommons/actions/refreshClassByObject.java index a9a39f53..68e86179 --- a/test/javasource/communitycommons/actions/refreshClassByObject.java +++ b/module/javasource/communitycommons/actions/refreshClassByObject.java @@ -1,55 +1,55 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.systemwideinterfaces.core.IMendixObject; -import com.mendix.webui.CustomJavaAction; -import com.mendix.webui.FeedbackHelper; - -/** - * Refreshes a certain domain object type in the client. Useful to enforce a datagrid to refresh for example. - * - * - instance : This object is used to identify the type of objects that need to be refreshed. For example passing $currentUser will refresh all System.Account's. - */ -public class refreshClassByObject extends CustomJavaAction -{ - private IMendixObject instance; - - public refreshClassByObject(IContext context, IMendixObject instance) - { - super(context); - this.instance = instance; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - if (instance != null) { - FeedbackHelper.addRefreshClass(this.getContext(), instance.getType()); - } - return true; - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "refreshClassByObject"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.systemwideinterfaces.core.IMendixObject; +import com.mendix.webui.CustomJavaAction; +import com.mendix.webui.FeedbackHelper; + +/** + * Refreshes a certain domain object type in the client. Useful to enforce a datagrid to refresh for example. + * + * - instance : This object is used to identify the type of objects that need to be refreshed. For example passing $currentUser will refresh all System.Account's. + */ +public class refreshClassByObject extends CustomJavaAction +{ + private IMendixObject instance; + + public refreshClassByObject(IContext context, IMendixObject instance) + { + super(context); + this.instance = instance; + } + + @java.lang.Override + public java.lang.Boolean executeAction() throws Exception + { + // BEGIN USER CODE + if (instance != null) { + FeedbackHelper.addRefreshClass(this.getContext(), instance.getType()); + } + return true; + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "refreshClassByObject"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/retrieveURL.java b/module/javasource/communitycommons/actions/retrieveURL.java old mode 100755 new mode 100644 similarity index 80% rename from test/javasource/communitycommons/actions/retrieveURL.java rename to module/javasource/communitycommons/actions/retrieveURL.java index 88dd235e..204152e0 --- a/test/javasource/communitycommons/actions/retrieveURL.java +++ b/module/javasource/communitycommons/actions/retrieveURL.java @@ -1,61 +1,61 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import communitycommons.Misc; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Retrieves data (such as an HTML page) from an URL using the HTTP protocol, and returns it as string. - * - * - url : The URL to retrieve. - * - post : Data to be sent in the request body. If set, a POST request will be send, otherwise a GET request is used. - * - * Example urls: - * 'https://mxforum.mendix.com/search/' - * 'http://www.google.nl/#hl=nl&q=download+mendix' - * - * Example post data: - * 'ipSearchTag=url&x=0&y=0' - */ -public class retrieveURL extends CustomJavaAction -{ - private java.lang.String url; - private java.lang.String postdata; - - public retrieveURL(IContext context, java.lang.String url, java.lang.String postdata) - { - super(context); - this.url = url; - this.postdata = postdata; - } - - @java.lang.Override - public java.lang.String executeAction() throws Exception - { - // BEGIN USER CODE - return Misc.retrieveURL(url, postdata); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "retrieveURL"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import communitycommons.Misc; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Retrieves data (such as an HTML page) from an URL using the HTTP protocol, and returns it as string. + * + * - url : The URL to retrieve. + * - post : Data to be sent in the request body. If set, a POST request will be send, otherwise a GET request is used. + * + * Example urls: + * 'https://mxforum.mendix.com/search/' + * 'http://www.google.nl/#hl=nl&q=download+mendix' + * + * Example post data: + * 'ipSearchTag=url&x=0&y=0' + */ +public class retrieveURL extends CustomJavaAction +{ + private java.lang.String url; + private java.lang.String postdata; + + public retrieveURL(IContext context, java.lang.String url, java.lang.String postdata) + { + super(context); + this.url = url; + this.postdata = postdata; + } + + @java.lang.Override + public java.lang.String executeAction() throws Exception + { + // BEGIN USER CODE + return Misc.retrieveURL(url, postdata); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "retrieveURL"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/communitycommons/actions/storeURLToFileDocument.java b/module/javasource/communitycommons/actions/storeURLToFileDocument.java old mode 100755 new mode 100644 similarity index 86% rename from test/javasource/communitycommons/actions/storeURLToFileDocument.java rename to module/javasource/communitycommons/actions/storeURLToFileDocument.java index 8c0f80d3..14755ab3 --- a/test/javasource/communitycommons/actions/storeURLToFileDocument.java +++ b/module/javasource/communitycommons/actions/storeURLToFileDocument.java @@ -1,64 +1,64 @@ -// This file was generated by Mendix Studio Pro. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package communitycommons.actions; - -import com.mendix.systemwideinterfaces.core.IMendixObject; -import communitycommons.Misc; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Retrieve a document from an URL using a HTTP GET request. - * - url : the URL to retrieve - * - document: the document to store the data into - * - filename: the filename to store it under. Only for internal use, so it can be an arbitrary filename. - * - * Example URL: 'http://www.mendix.com/wordpress/wp-content/themes/mendix_new/images/mendix.png' - * - * NOTE: For images, no thumbnail will be generated. - */ -public class storeURLToFileDocument extends CustomJavaAction -{ - private java.lang.String url; - private IMendixObject __document; - private system.proxies.FileDocument document; - private java.lang.String filename; - - public storeURLToFileDocument(IContext context, java.lang.String url, IMendixObject document, java.lang.String filename) - { - super(context); - this.url = url; - this.__document = document; - this.filename = filename; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - this.document = this.__document == null ? null : system.proxies.FileDocument.initialize(getContext(), __document); - - // BEGIN USER CODE - return Misc.storeURLToFileDocument(this.getContext(), url, document.getMendixObject(), filename); - // END USER CODE - } - - /** - * Returns a string representation of this action - * @return a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "storeURLToFileDocument"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package communitycommons.actions; + +import com.mendix.systemwideinterfaces.core.IMendixObject; +import communitycommons.Misc; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.webui.CustomJavaAction; + +/** + * Retrieve a document from an URL using a HTTP GET request. + * - url : the URL to retrieve + * - document: the document to store the data into + * - filename: the filename to store it under. Only for internal use, so it can be an arbitrary filename. + * + * Example URL: 'http://www.mendix.com/wordpress/wp-content/themes/mendix_new/images/mendix.png' + * + * NOTE: For images, no thumbnail will be generated. + */ +public class storeURLToFileDocument extends CustomJavaAction +{ + private java.lang.String url; + private IMendixObject __document; + private system.proxies.FileDocument document; + private java.lang.String filename; + + public storeURLToFileDocument(IContext context, java.lang.String url, IMendixObject document, java.lang.String filename) + { + super(context); + this.url = url; + this.__document = document; + this.filename = filename; + } + + @java.lang.Override + public java.lang.Boolean executeAction() throws Exception + { + this.document = this.__document == null ? null : system.proxies.FileDocument.initialize(getContext(), __document); + + // BEGIN USER CODE + return Misc.storeURLToFileDocument(this.getContext(), url, document.getMendixObject(), filename); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "storeURLToFileDocument"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +} diff --git a/test/javasource/encryption/actions/DecryptString.java b/module/javasource/encryption/actions/DecryptString.java similarity index 100% rename from test/javasource/encryption/actions/DecryptString.java rename to module/javasource/encryption/actions/DecryptString.java diff --git a/test/javasource/encryption/actions/EncryptString.java b/module/javasource/encryption/actions/EncryptString.java similarity index 100% rename from test/javasource/encryption/actions/EncryptString.java rename to module/javasource/encryption/actions/EncryptString.java diff --git a/test/javasource/encryption/actions/GeneratePGPKeyRing.java b/module/javasource/encryption/actions/GeneratePGPKeyRing.java similarity index 100% rename from test/javasource/encryption/actions/GeneratePGPKeyRing.java rename to module/javasource/encryption/actions/GeneratePGPKeyRing.java diff --git a/test/javasource/encryption/actions/PGPDecryptDocument.java b/module/javasource/encryption/actions/PGPDecryptDocument.java similarity index 100% rename from test/javasource/encryption/actions/PGPDecryptDocument.java rename to module/javasource/encryption/actions/PGPDecryptDocument.java diff --git a/test/javasource/encryption/actions/PGPEncryptDocument.java b/module/javasource/encryption/actions/PGPEncryptDocument.java similarity index 100% rename from test/javasource/encryption/actions/PGPEncryptDocument.java rename to module/javasource/encryption/actions/PGPEncryptDocument.java diff --git a/test/javasource/encryption/actions/ValidatePrivateKeyRing.java b/module/javasource/encryption/actions/ValidatePrivateKeyRing.java similarity index 100% rename from test/javasource/encryption/actions/ValidatePrivateKeyRing.java rename to module/javasource/encryption/actions/ValidatePrivateKeyRing.java diff --git a/test/javasource/encryption/pgp/PGPFileProcessor.java b/module/javasource/encryption/pgp/PGPFileProcessor.java similarity index 100% rename from test/javasource/encryption/pgp/PGPFileProcessor.java rename to module/javasource/encryption/pgp/PGPFileProcessor.java diff --git a/test/javasource/encryption/pgp/PGPUtils.java b/module/javasource/encryption/pgp/PGPUtils.java similarity index 100% rename from test/javasource/encryption/pgp/PGPUtils.java rename to module/javasource/encryption/pgp/PGPUtils.java diff --git a/test/javasource/pushnotifications/actions/GetFCMAccessToken.java b/module/javasource/pushnotifications/actions/GetFCMAccessToken.java similarity index 100% rename from test/javasource/pushnotifications/actions/GetFCMAccessToken.java rename to module/javasource/pushnotifications/actions/GetFCMAccessToken.java diff --git a/test/javasource/pushnotifications/actions/SendAPNSMessage_Impl.java b/module/javasource/pushnotifications/actions/SendAPNSMessage_Impl.java similarity index 100% rename from test/javasource/pushnotifications/actions/SendAPNSMessage_Impl.java rename to module/javasource/pushnotifications/actions/SendAPNSMessage_Impl.java diff --git a/test/javasource/pushnotifications/actions/SendMessageToDevice.java b/module/javasource/pushnotifications/actions/SendMessageToDevice.java similarity index 100% rename from test/javasource/pushnotifications/actions/SendMessageToDevice.java rename to module/javasource/pushnotifications/actions/SendMessageToDevice.java diff --git a/test/javasource/pushnotifications/actions/SendMessageToDevices.java b/module/javasource/pushnotifications/actions/SendMessageToDevices.java similarity index 100% rename from test/javasource/pushnotifications/actions/SendMessageToDevices.java rename to module/javasource/pushnotifications/actions/SendMessageToDevices.java diff --git a/test/javasource/pushnotifications/actions/SendMessageToUser.java b/module/javasource/pushnotifications/actions/SendMessageToUser.java similarity index 100% rename from test/javasource/pushnotifications/actions/SendMessageToUser.java rename to module/javasource/pushnotifications/actions/SendMessageToUser.java diff --git a/test/javasource/pushnotifications/actions/SendMessageToUsers.java b/module/javasource/pushnotifications/actions/SendMessageToUsers.java similarity index 100% rename from test/javasource/pushnotifications/actions/SendMessageToUsers.java rename to module/javasource/pushnotifications/actions/SendMessageToUsers.java diff --git a/test/javasource/pushnotifications/actions/StartAPNS.java b/module/javasource/pushnotifications/actions/StartAPNS.java similarity index 100% rename from test/javasource/pushnotifications/actions/StartAPNS.java rename to module/javasource/pushnotifications/actions/StartAPNS.java diff --git a/test/javasource/pushnotifications/actions/StopAPNS.java b/module/javasource/pushnotifications/actions/StopAPNS.java similarity index 100% rename from test/javasource/pushnotifications/actions/StopAPNS.java rename to module/javasource/pushnotifications/actions/StopAPNS.java diff --git a/test/javasource/pushnotifications/implementation/apns/APNSConnection.java b/module/javasource/pushnotifications/implementation/apns/APNSConnection.java similarity index 100% rename from test/javasource/pushnotifications/implementation/apns/APNSConnection.java rename to module/javasource/pushnotifications/implementation/apns/APNSConnection.java diff --git a/test/javasource/pushnotifications/implementation/apns/Exceptions.java b/module/javasource/pushnotifications/implementation/apns/Exceptions.java similarity index 100% rename from test/javasource/pushnotifications/implementation/apns/Exceptions.java rename to module/javasource/pushnotifications/implementation/apns/Exceptions.java diff --git a/test/resources/Design_header.png b/module/resources/Design_header.png similarity index 100% rename from test/resources/Design_header.png rename to module/resources/Design_header.png diff --git a/test/resources/communitycommons/antisamy/Developer Guide.pdf b/module/resources/communitycommons/antisamy/Developer Guide.pdf similarity index 100% rename from test/resources/communitycommons/antisamy/Developer Guide.pdf rename to module/resources/communitycommons/antisamy/Developer Guide.pdf diff --git a/test/resources/communitycommons/antisamy/antisamy-anythinggoes-1.4.4.xml b/module/resources/communitycommons/antisamy/antisamy-anythinggoes-1.4.4.xml similarity index 100% rename from test/resources/communitycommons/antisamy/antisamy-anythinggoes-1.4.4.xml rename to module/resources/communitycommons/antisamy/antisamy-anythinggoes-1.4.4.xml diff --git a/test/resources/communitycommons/antisamy/antisamy-bootstraprte-1.4.4.xml b/module/resources/communitycommons/antisamy/antisamy-bootstraprte-1.4.4.xml similarity index 100% rename from test/resources/communitycommons/antisamy/antisamy-bootstraprte-1.4.4.xml rename to module/resources/communitycommons/antisamy/antisamy-bootstraprte-1.4.4.xml diff --git a/test/resources/communitycommons/antisamy/antisamy-bootstraprte_nolink-1.4.4.xml b/module/resources/communitycommons/antisamy/antisamy-bootstraprte_nolink-1.4.4.xml similarity index 100% rename from test/resources/communitycommons/antisamy/antisamy-bootstraprte_nolink-1.4.4.xml rename to module/resources/communitycommons/antisamy/antisamy-bootstraprte_nolink-1.4.4.xml diff --git a/test/resources/communitycommons/antisamy/antisamy-ebay-1.4.4.xml b/module/resources/communitycommons/antisamy/antisamy-ebay-1.4.4.xml similarity index 100% rename from test/resources/communitycommons/antisamy/antisamy-ebay-1.4.4.xml rename to module/resources/communitycommons/antisamy/antisamy-ebay-1.4.4.xml diff --git a/test/resources/communitycommons/antisamy/antisamy-myspace-1.4.4.xml b/module/resources/communitycommons/antisamy/antisamy-myspace-1.4.4.xml similarity index 100% rename from test/resources/communitycommons/antisamy/antisamy-myspace-1.4.4.xml rename to module/resources/communitycommons/antisamy/antisamy-myspace-1.4.4.xml diff --git a/test/resources/communitycommons/antisamy/antisamy-slashdot-1.4.4.xml b/module/resources/communitycommons/antisamy/antisamy-slashdot-1.4.4.xml similarity index 100% rename from test/resources/communitycommons/antisamy/antisamy-slashdot-1.4.4.xml rename to module/resources/communitycommons/antisamy/antisamy-slashdot-1.4.4.xml diff --git a/test/resources/communitycommons/antisamy/antisamy-tinymce-1.4.4.xml b/module/resources/communitycommons/antisamy/antisamy-tinymce-1.4.4.xml similarity index 100% rename from test/resources/communitycommons/antisamy/antisamy-tinymce-1.4.4.xml rename to module/resources/communitycommons/antisamy/antisamy-tinymce-1.4.4.xml diff --git a/test/resources/icon-bb.png b/module/resources/icon-bb.png similarity index 100% rename from test/resources/icon-bb.png rename to module/resources/icon-bb.png diff --git a/test/resources/icon-list.png b/module/resources/icon-list.png similarity index 100% rename from test/resources/icon-list.png rename to module/resources/icon-list.png diff --git a/test/resources/icon-list2.png b/module/resources/icon-list2.png similarity index 100% rename from test/resources/icon-list2.png rename to module/resources/icon-list2.png diff --git a/test/resources/icon-widget.png b/module/resources/icon-widget.png similarity index 100% rename from test/resources/icon-widget.png rename to module/resources/icon-widget.png diff --git a/test/theme/native/custom-variables.js b/module/theme/native/custom-variables.js similarity index 100% rename from test/theme/native/custom-variables.js rename to module/theme/native/custom-variables.js diff --git a/test/theme/native/exclusion-variables.js b/module/theme/native/exclusion-variables.js similarity index 100% rename from test/theme/native/exclusion-variables.js rename to module/theme/native/exclusion-variables.js diff --git a/test/theme/native/main.js b/module/theme/native/main.js similarity index 100% rename from test/theme/native/main.js rename to module/theme/native/main.js diff --git a/test/theme/web/custom-variables.scss b/module/theme/web/custom-variables.scss similarity index 100% rename from test/theme/web/custom-variables.scss rename to module/theme/web/custom-variables.scss diff --git a/test/theme/web/exclusion-variables.scss b/module/theme/web/exclusion-variables.scss similarity index 100% rename from test/theme/web/exclusion-variables.scss rename to module/theme/web/exclusion-variables.scss diff --git a/test/theme/web/firebase-messaging-sw.js b/module/theme/web/firebase-messaging-sw.js similarity index 59% rename from test/theme/web/firebase-messaging-sw.js rename to module/theme/web/firebase-messaging-sw.js index 5d444c64..b123bd57 100644 --- a/test/theme/web/firebase-messaging-sw.js +++ b/module/theme/web/firebase-messaging-sw.js @@ -2,12 +2,12 @@ importScripts('https://www.gstatic.com/firebasejs/10.11.0/firebase-app-compat.js importScripts('https://www.gstatic.com/firebasejs/10.11.0/firebase-messaging-compat.js'); const firebaseConfig = { - apiKey: "", - authDomain: "", - projectId: "", - storageBucket: "", - messagingSenderId: "", - appId: "" + apiKey: "", + authDomain: "", + projectId: "", + storageBucket: "", + messagingSenderId: "", + appId: "" }; firebase.initializeApp(firebaseConfig); diff --git a/test/theme/web/index.html b/module/theme/web/index.html similarity index 85% rename from test/theme/web/index.html rename to module/theme/web/index.html index 77a56abf..8e66c4f6 100644 --- a/test/theme/web/index.html +++ b/module/theme/web/index.html @@ -32,12 +32,12 @@