Skip to content

Commit

Permalink
Merge pull request #58 from merkle-open/6.4/develop
Browse files Browse the repository at this point in the history
6.4/develop
  • Loading branch information
MichaelHeil authored Mar 22, 2024
2 parents 778ffef + a089c41 commit 10e24ab
Show file tree
Hide file tree
Showing 15 changed files with 264 additions and 118 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/deploy-snapshot.yml
Original file line number Diff line number Diff line change
@@ -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 }}
66 changes: 66 additions & 0 deletions .github/workflows/release-and-deploy-release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
26 changes: 26 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -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
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.
122 changes: 83 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -15,7 +15,7 @@ With this project you can use a widget in [Adobe Experience Manager 6.4](https:/
<dependency>
<groupId>com.namics.oss.aem</groupId>
<artifactId>genericmultifield</artifactId>
<version>2.0.3</version>
<version>2.0.4</version>
</dependency>
```

Expand All @@ -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"
itemDialog="path/to/a/item-dialog"
itemStorageNode="items"
itemNameProperty="title"
name="./items"
minElements="3"
maxElements="5"
required="{Boolean}true" />
<!-- Within the component dialog definition -->
<title
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
fieldLabel="Title"
name="./title"/>
<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
33 changes: 33 additions & 0 deletions ci/mvn-release.sh
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions ci/setup-git.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

git config --global user.email "[email protected]"
git config --global user.name "Namics OSS CI"
Binary file removed codesigning.asc.enc
Binary file not shown.
Binary file modified docs/item.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/repo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 10e24ab

Please sign in to comment.