diff --git a/.github/workflows/deploy-snapshot.yml b/.github/workflows/deploy-snapshot.yml new file mode 100644 index 0000000..24eea0c --- /dev/null +++ b/.github/workflows/deploy-snapshot.yml @@ -0,0 +1,33 @@ +name: deploy snapshot + +on: + push: + branches: + - 6.4/develop + +jobs: + deploy-snapshot: + + runs-on: ubuntu-latest + + steps: + # Checkout source code + - name: Checkout + uses: actions/checkout@v4 + # Setup Java environment + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: 11 + distribution: zulu + # Run maven verify + - name: Maven verify + run: mvn verify --batch-mode + # Publish + - name: Release Maven package + uses: samuelmeuli/action-maven-publish@v1 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }} + nexus_username: ${{ secrets.OSSRH_USER }} + nexus_password: ${{ secrets.OSSRH_PASSWORD }} diff --git a/.github/workflows/release-and-deploy-release.yml b/.github/workflows/release-and-deploy-release.yml new file mode 100644 index 0000000..ff0261f --- /dev/null +++ b/.github/workflows/release-and-deploy-release.yml @@ -0,0 +1,66 @@ +name: release and deploy + +on: + push: + branches: + - 6.4/master + +jobs: + release: + + runs-on: ubuntu-latest + + steps: + # Checkout source code + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: '0' + # Setup Java environment + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: 11 + distribution: zulu + # Install xmllint + - name: Install dependencies + run: sudo apt-get install libxml2-utils + # Set git username and email + - name: Set up Git + run: | + chmod +x ci/setup-git.sh + ci/setup-git.sh + # Release, set correct versions and create tag + - name: Release (versioning/tag) + run: | + chmod +x ci/mvn-release.sh + ci/mvn-release.sh + + deploy-release: + + needs: release + runs-on: ubuntu-latest + + steps: + # Checkout source code + - name: Checkout + uses: actions/checkout@v4 + with: + ref: '6.4/master' + # Setup Java environment + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: 11 + distribution: zulu + # Run maven verify + - name: Maven verify + run: mvn verify --batch-mode + # Publish + - name: Release Maven package + uses: samuelmeuli/action-maven-publish@v1 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }} + nexus_username: ${{ secrets.OSSRH_USER }} + nexus_password: ${{ secrets.OSSRH_PASSWORD }} diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml new file mode 100644 index 0000000..d2105da --- /dev/null +++ b/.github/workflows/verify.yml @@ -0,0 +1,26 @@ +name: verify + +on: + push: + branches-ignore: + - 6.4/master + - 6.4/develop + +jobs: + verify: + + runs-on: ubuntu-latest + + steps: + # Checkout source code + - name: Checkout + uses: actions/checkout@v4 + # Setup Java environment + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: 11 + distribution: zulu + # Run maven verify + - name: Maven verify + run: mvn verify --batch-mode diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8693d7b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -language: java -env: - global: - - # ^^ OSSRH_USERNAME - - secure: "XpFDZKtWIrFYA8TpxM9kVbQjBvC7L2RSB1ZqxOL2Ba5ro0oo6fewec78brY09G9MJFeijA2MIMW1zUTHqu6oW/nCA4jIbk2g9UqLGwX1GqB0pLIPxkoU3XUao7umVDJW3OZ0S/uDOwqa8YaQiyMN1rCfC91JUpdDurAY/tog3c1VPU18bjO/H2LEiHFrecJZ05xmJbKQxbJlb9dc6AHabjfQm8sqbOyiYFM6J+6SFD4fIRd/dyAmQlLjdOJ35AfjWaGY7D9krVjVBrN6b2kxHkadalP9ii0Zutm74f4jJgoiHuOTQYK/HbFKftVBDuI5EmC49DqCMO0sO1wPuEJkbFJayJ/FGIbEQHf7kCaKp2lj8lSUs1IAEHAErZ8vI8fJdQTTYTVvFyNJMk3UbDxg96IjKjkDq7ZnpGUlEXECwWtV/FvwfCRewg5oWYu6znMSKZrFpMP8m4KtCbyWpZlW0/CN7fCJ83E2ApD8HQlG8N6J2d1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Czt2bTSBDcOGpjsvUowVOgP6IR5yiEwChGDr4SW2PF0y1dJ/QWgYyvVmESNnYCWhV6ZBWJq9qxN06IFAukR2W7LrGUbI3I+5IXhbn4fNP1TkiyEZgQw27pWmf7hTOtqwOqyn2bdTbUFCuqm0QrISYS/0IR9hLuvfVMB8DOXxcx2HE=" -before_install: - - openssl aes-256-cbc -K $encrypted_65add4e3a431_key -iv $encrypted_65add4e3a431_iv -in codesigning.asc.enc -out codesigning.asc -d - - gpg --yes --batch --import codesigning.asc -jdk: - - oraclejdk8 -install: mvn clean install -P !ossrh -B -V -U -script: -- mvn deploy -P ossrh --settings mvnsettings.xml -cache: - directories: - - ~/.m2/repository -branches: - only: - - /^\d+\.\d+(\.\d+)?\/master$/ - - /^\d+\.\d+(\.\d+)?\/develop$/ -notifications: - email: - on_success: change - on_failure: change \ No newline at end of file diff --git a/LICENSE b/LICENSE index 6d24370..92cc1c1 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 Namics AG +Copyright (c) 2018 Merkle Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index f16c51c..a9b0239 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Generic Multifield for AEM 6.4 -System | Status ---------------|------------------------------------------------ -CI master | [![Build Status][travis-master]][travis-url] -CI develop | [![Build Status][travis-develop]][travis-url] -Dependency | [![Maven Central][maven-central-version]][maven-central] +| System | Status | +|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| CI master | [![release and deploy](https://github.com/merkle-open/aem-generic-multifield/actions/workflows/release-and-deploy-release.yml/badge.svg?branch=6.4%2Fmaster)](https://github.com/merkle-open/aem-generic-multifield/actions/workflows/release-and-deploy-release.yml) | +| CI develop | [![deploy snapshot](https://github.com/merkle-open/aem-generic-multifield/actions/workflows/deploy-snapshot.yml/badge.svg?branch=6.4%2Fdevelop)](https://github.com/merkle-open/aem-generic-multifield/actions/workflows/deploy-snapshot.yml) | +| Dependency | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.namics.oss.aem/genericmultifield/badge.svg?version=2.0.4)](https://search.maven.org/artifact/com.namics.oss.aem/genericmultifield/2.0.4/bundle) | With this project you can use a widget in [Adobe Experience Manager 6.4](https://helpx.adobe.com/experience-manager/6-4/release-notes.html) Touch UI which lets you create a generic multifield in a dialog. @@ -15,7 +15,7 @@ With this project you can use a widget in [Adobe Experience Manager 6.4](https:/ com.namics.oss.aem genericmultifield - 2.0.3 + 2.0.4 ``` @@ -41,60 +41,104 @@ With the common AEM archetype it can be added within the embedded configuration ``` -#### Dialog -Use the Generic Multifield in your _cq_dialog.xml of a AEM 6.4 (with Touch UI) like this example: +#### Component Dialog +Example usage of the Generic Multifield in your component _cq_dialog.xml definition within AEM 6.4 (with Touch UI): ```xml - + + +<genericmultifield + jcr:primaryType="nt:unstructured" + sling:resourceType="namics/genericmultifield" + fieldLabel="Generic Multifield" + fieldDescription="A list of generic multfield items" + itemDialog="/your/project/path/component/item-dialog.xml" + itemNameProperty="itemTitle" + minElements="2" + maxElements="5" + required="{Boolean}true" + itemStorageNode="./items"/> ``` -Example dialog: - ![main dialog](docs/main.png) +##### Properties +**itemDialog**: path reference to the dialog definition of a generic multifield item.<br /> +**itemNameProperty**: Defines the value representation of a generic multifield entry within the component dialog. Must be a reference to a item dialog property.<br /> +**minElements**: Defines the min amount of generic multifield entries.<br /> +**maxElements**: Defines the max amount of generic multifield entries.<br /> +**required**: If set to "{Boolean}true", the main component dialog will not validate until at least one item hast been defined.<br /> +**itemStorageNode**: Defines the parent node name created within the component node. Generic multifield items will be save beneath this node.<br /> + #### Item-Dialog ```xml - <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" - xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + xmlns:jcr="http://www.jcp.org/jcr/1.0" + xmlns:nt="http://www.jcp.org/jcr/nt/1.0" + jcr:primaryType="nt:unstructured" + sling:resourceType="cq/gui/components/authoring/dialog" + jcr:title="Item Dialog"> + <content jcr:primaryType="nt:unstructured" - jcr:title="Item Dialog" - sling:resourceType="cq/gui/components/authoring/dialog"> - <!-- normal Granite UI dialog definition comes here !--> - </jcr:root> + sling:resourceType="granite/ui/components/coral/foundation/tabs"> + <items + jcr:primaryType="nt:unstructured"> + <basicTab + jcr:primaryType="nt:unstructured" + sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns" + margin="{Boolean}true" + jcr:title="Basic"> + <items + jcr:primaryType="nt:unstructured"> + <column + jcr:primaryType="nt:unstructured" + sling:resourceType="granite/ui/components/coral/foundation/container"> + <items jcr:primaryType="nt:unstructured"> + <itemTitle + jcr:primaryType="nt:unstructured" + sling:resourceType="granite/ui/components/coral/foundation/form/textfield" + fieldLabel="Item Title" + fieldDescription="Item Title Description" + required="{Boolean}true" + name="./itemTitle"/> + <itemText + jcr:primaryType="nt:unstructured" + sling:resourceType="granite/ui/components/coral/foundation/form/textarea" + fieldLabel="Item Text" + fieldDescription="Item Text Description" + name="./itemText"/> + <itemPath + jcr:primaryType="nt:unstructured" + sling:resourceType="granite/ui/components/coral/foundation/form/pathbrowser" + fieldLabel="Item Path" + fieldDescription="Item Path Description" + name="./item Path"/> + </items> + </column> + </items> + </basicTab> + </items> + </content> +</jcr:root> ``` -Example item dialog: - ![multifield dialog](docs/item.png) #### Storage -In the reporsitory the content is stored like this: +In the repository the content is stored as follows: ![content](docs/repo.png) ### Requirements -* AEM 6.4 with Touch UI +* AEM 6.4 (Touch UI) ### Development Build locally with Maven ``` mvn clean install -PautoInstallBundle ``` - - -[travis-master]: https://travis-ci.org/namics/aem-generic-multifield.svg?branch=6.4%2Fmaster -[travis-develop]: https://travis-ci.org/namics/aem-generic-multifield.svg?branch=6.4%2Fdevelop -[travis-url]: https://travis-ci.org/namics/aem-generic-multifield -[maven-central-version]: https://maven-badges.herokuapp.com/maven-central/com.namics.oss.aem/genericmultifield/badge.svg -[maven-central]: https://maven-badges.herokuapp.com/maven-central/com.namics.oss.aem/genericmultifield diff --git a/ci/mvn-release.sh b/ci/mvn-release.sh new file mode 100644 index 0000000..d237728 --- /dev/null +++ b/ci/mvn-release.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +function getVersion() { + xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' pom.xml +} + +CURRENT_VERSION=$(getVersion) +if [[ $CURRENT_VERSION == *-SNAPSHOT ]]; then + echo "perform release" + mvn versions:set -DremoveSnapshot versions:commit --no-transfer-progress + NEW_VERSION=$(getVersion) + + echo "commit new release version" + git commit -a -m "Release $NEW_VERSION: set master to new release version" + + echo "Update version in README.md" + sed -i -e "s|<version>[0-9A-Za-z._-]\{1,\}</version>|<version>$NEW_VERSION</version>|g" README.md && rm -f README.md-e + git commit -a -m "Release $NEW_VERSION: Update README.md" + + echo "create tag for new release" + git tag -a $NEW_VERSION -m "Release $NEW_VERSION: tag release" + + echo "update develop version" + git fetch --all + git checkout 6.4/develop + mvn versions:set -DnextSnapshot versions:commit --no-transfer-progress + NEXT_SNAPSHOT=$(getVersion) + echo "commit new snapshot version" + git commit -a -m "Release $NEW_VERSION: set develop to next development version $NEXT_SNAPSHOT" + + git push --all + git push --tags +fi diff --git a/ci/setup-git.sh b/ci/setup-git.sh new file mode 100644 index 0000000..0a09a30 --- /dev/null +++ b/ci/setup-git.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +git config --global user.email "oss@namics.com" +git config --global user.name "Namics OSS CI" diff --git a/codesigning.asc.enc b/codesigning.asc.enc deleted file mode 100644 index c6bccf3..0000000 Binary files a/codesigning.asc.enc and /dev/null differ diff --git a/docs/item.png b/docs/item.png index 28944c6..cb3ce75 100644 Binary files a/docs/item.png and b/docs/item.png differ diff --git a/docs/main.png b/docs/main.png index a1f791e..7ed24c8 100644 Binary files a/docs/main.png and b/docs/main.png differ diff --git a/docs/repo.png b/docs/repo.png index d713609..36428d5 100644 Binary files a/docs/repo.png and b/docs/repo.png differ diff --git a/mvnsettings.xml b/mvnsettings.xml deleted file mode 100644 index 3253b74..0000000 --- a/mvnsettings.xml +++ /dev/null @@ -1,23 +0,0 @@ -<settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> - <servers> - <server> - <id>ossrh</id> - <username>${env.OSSRH_USERNAME}</username> - <password>${env.OSSRH_PASSWORD}</password> - </server> - </servers> - <profiles> - <profile> - <id>ossrh</id> - <activation> - <activeByDefault>true</activeByDefault> - </activation> - <properties> - <gpg.executable>gpg</gpg.executable> - <gpg.keyname>${env.GPG_KEY_NAME}</gpg.keyname> - <gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase> - </properties> - </profile> - </profiles> -</settings> \ No newline at end of file diff --git a/pom.xml b/pom.xml index d0410d6..7430764 100644 --- a/pom.xml +++ b/pom.xml @@ -7,10 +7,10 @@ <groupId>com.namics.oss.aem</groupId> <artifactId>genericmultifield</artifactId> <packaging>bundle</packaging> - <version>2.0.3</version> + <version>2.0.4-SNAPSHOT</version> <name>Generic Multifield for AEM 6.4</name> <description>com.namics.oss.aem - Generic Multifield for AEM 6.4</description> - <url>https://github.com/namics/aem-generic-multifield</url> + <url>https://github.com/merkle-open/aem-generic-multifield</url> <licenses> <license> @@ -22,16 +22,10 @@ <developers> <developer> - <name>Samuel Schaeublin</name> - <email>samuel.schaeublin@namics.com</email> - <organization>Namics AG</organization> - <organizationUrl>http://www.namics.com</organizationUrl> - </developer> - <developer> - <name>Alexandru Suciu</name> - <email>alexandru.suciu@namics.com</email> - <organization>Namics AG</organization> - <organizationUrl>http://www.namics.com</organizationUrl> + <name>Merkle Open Source</name> + <email>opensource@merkle.com</email> + <organization>Merkle DACH</organization> + <organizationUrl>https://www.merkle.com/dach/de</organizationUrl> </developer> </developers> @@ -101,9 +95,9 @@ </distributionManagement> <scm> - <url>https://github.com/namics/aem-generic-multifield</url> - <connection>scm:git:git@github.com:namics/aem-generic-multifield</connection> - <developerConnection>scm:git:git@github.com:namics/aem-generic-multifield.git</developerConnection> + <url>https://github.com/merkle-open/aem-generic-multifield</url> + <connection>scm:git:git@github.com:merkle-open/aem-generic-multifield</connection> + <developerConnection>scm:git:git@github.com:merkle-open/aem-generic-multifield.git</developerConnection> </scm> diff --git a/src/main/resources/SLING-INF/apps/namics/genericmultifield/clientlibs/js/CUI.GenericMultiField.js b/src/main/resources/SLING-INF/apps/namics/genericmultifield/clientlibs/js/CUI.GenericMultiField.js index cf84e09..1c57b55 100644 --- a/src/main/resources/SLING-INF/apps/namics/genericmultifield/clientlibs/js/CUI.GenericMultiField.js +++ b/src/main/resources/SLING-INF/apps/namics/genericmultifield/clientlibs/js/CUI.GenericMultiField.js @@ -94,7 +94,7 @@ parent = parent[propertyValue[i]]; } - if (parent !== undefined){ + if (parent !== undefined) { propertyValue = parent[propertyValue[propertyValue.length - 1]]; } else { propertyValue = key; @@ -143,8 +143,10 @@ _createListEntry: function (key, label) { var escapedLabel = $("<div/>").text(label).html(); var labelWithKeyAsFallback = escapedLabel ? escapedLabel : key; - var li = null; - li = $("<li id=" + key + " title=" + labelWithKeyAsFallback + " class='coral-GenericMultiField-listEntry'>" + "<div class='coral-GenericMultiField-label'>" + labelWithKeyAsFallback + "</div></li>"); + var li = $('<li>', {id: key, title: labelWithKeyAsFallback, class: "coral-GenericMultiField-listEntry"}); + var liInner = $('<div>', {text: labelWithKeyAsFallback, class: "coral-GenericMultiField-label"}); + + li.append(liInner); li.append($(removeButton)); li.append(editButton); li.append(moveButton); @@ -281,8 +283,7 @@ }); }); }); - } - else { + } else { this.ui.alert(Granite.I18n.get("Maximum reached"), Granite.I18n.get("Maximum number of {0} item(s) reached, you cannot add any additional items.", this.maxElements), "warning"); } }, @@ -311,8 +312,7 @@ } } }]); - } - else { + } else { this.ui.alert(Granite.I18n.get("Minimum reached"), Granite.I18n.get("Minimum number of {0} item(s) reached, you cannot delete any additional items.", this.minElements), "warning"); } @@ -340,8 +340,7 @@ data: ":order=before " + before.attr("id"), url: this.crxPath + "/" + this.itemStorageNode + "/" + item.attr("id") }); - } - else if (after.length > 0) { + } else if (after.length > 0) { item.insertAfter(after); $.ajax({ type: "POST",