Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ Below are all of the options available in the current version. To specify an opt
| Dispatcher Artifact ID | example-project.dispatcher | dispatcherArtifactId |
| Folder to create under `/apps` | my-aem-project | appsFolderName |
| Folder to use under `/content` | my-aem-project | contentFolderName |
| Include a separate module for configurations | no | generateConfigArtifact |
| Config Artifact ID | example-project.config | configArtifactId |
| Create AEM Editable Templates folders? | yes | createEditableTemplatesStructure |
| Folder to create under `/conf` | my-aem-project | confFolderName |
| Create a site design? | no | createDesign |
Expand Down
105 changes: 105 additions & 0 deletions templates/aem-multimodule-project/config/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="UTF-8"?>
<project 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- ====================================================================== -->
<!-- P A R E N T P R O J E C T D E S C R I P T I O N -->
<!-- ====================================================================== -->
<parent>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
</parent>

<!-- ====================================================================== -->
<!-- P R O J E C T D E S C R I P T I O N -->
<!-- ====================================================================== -->

<artifactId>${configArtifactId}</artifactId>
<packaging>content-package</packaging>
<name>${projectName} Configuration Content Package</name>

<build>
<resources>
<resource>
<directory>src/main/content/jcr_root</directory>
<filtering>false</filtering>
<excludes>
<exclude>**/.vlt</exclude>
<exclude>**/.vltignore</exclude>
</excludes>
</resource>
</resources>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<includeEmptyDirs>true</includeEmptyDirs>
</configuration>
</plugin>

<plugin>
<groupId>com.day.jcr.vault</groupId>
<artifactId>content-package-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<group>${packageGroup}</group>
<filterSource>src/main/content/META-INF/vault/filter.xml</filterSource>
<targetURL>http://\${crx.host}:\${crx.port}/crx/packmgr/service.jsp</targetURL>
<properties>
<acHandling>merge_preserve</acHandling>
</properties>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>autoInstallPackage</id>
<build>
<plugins>
<plugin>
<groupId>com.day.jcr.vault</groupId>
<artifactId>content-package-maven-plugin</artifactId>
<executions>
<execution>
<id>install-content-package</id>
<phase>install</phase>
<goals>
<goal>install</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>autoInstallPackagePublish</id>
<build>
<plugins>
<plugin>
<groupId>com.day.jcr.vault</groupId>
<artifactId>content-package-maven-plugin</artifactId>
<executions>
<execution>
<id>install-content-package-publish</id>
<phase>install</phase>
<goals>
<goal>install</goal>
</goals>
<configuration>
<targetURL>http://\${publish.crx.host}:\${publish.crx.port}/crx/packmgr/service.jsp</targetURL>
<userId>\${publish.crx.username}</userId>
<password>\${publish.crx.password}</password>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<vaultfs version="1.1">
<!--
Defines the content aggregation. The order of the defined aggregates
is important for finding the correct aggregator.
-->
<aggregates>
<!--
Defines an aggregate that handles nt:file and nt:resource nodes.
-->
<aggregate type="file" title="File Aggregate"/>

<!--
Defines an aggregate that handles file/folder like nodes. It matches
all nt:hierarchyNode nodes that have or define a jcr:content
child node and excludes child nodes that are nt:hierarchyNodes.
-->
<aggregate type="filefolder" title="File/Folder Aggregate"/>

<!--
Defines an aggregate that handles nt:nodeType nodes and serializes
them into .cnd notation.
-->
<aggregate type="nodetype" title="Node Type Aggregate" />

<!--
Defines an aggregate that defines full coverage for certain node
types that cannot be covered by the default aggregator.
-->
<aggregate type="full" title="Full Coverage Aggregate">
<matches>
<include nodeType="rep:AccessControl" respectSupertype="true" />
<include nodeType="rep:Policy" respectSupertype="true" />
<include nodeType="cq:Widget" respectSupertype="true" />
<include nodeType="cq:EditConfig" respectSupertype="true" />
<include nodeType="cq:WorkflowModel" respectSupertype="true" />
<include nodeType="vlt:FullCoverage" respectSupertype="true" />
<include nodeType="mix:language" respectSupertype="true" />
<include nodeType="sling:OsgiConfig" respectSupertype="true" />
</matches>
</aggregate>

<!--
Defines an aggregate that handles nt:folder like nodes.
-->
<aggregate type="generic" title="Folder Aggregate">
<matches>
<include nodeType="nt:folder" respectSupertype="true" />
</matches>
<contains>
<exclude isNode="true" />
</contains>
</aggregate>

<!--
Defines the default aggregate
-->
<aggregate type="generic" title="Default Aggregator" isDefault="true">
<matches>
<!-- all -->
</matches>
<contains>
<exclude nodeType="nt:hierarchyNode" respectSupertype="true" />
</contains>
</aggregate>

</aggregates>

<!--
defines the input handlers
-->
<handlers>
<handler type="folder"/>
<handler type="file"/>
<handler type="nodetype"/>
<handler type="generic"/>
</handlers>
</vaultfs>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:vlt="http://www.day.com/jcr/vault/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:description="${projectName} Configuration Package"
jcr:primaryType="vlt:PackageDefinition"
sling:resourceType="cq/packaging/components/pack/definition"
buildCount="1"
cqVersion="${aemVersion}"
group="${packageGroup}"
name="${configArtifactId}"
path="/etc/packages/${packageGroup}/${configArtifactId}-${version}"
version="${version}">
<filter jcr:primaryType="nt:unstructured">
<f0
jcr:primaryType="nt:unstructured"
mode="replace"
root="/apps/${appsFolderName}"
rules="[include:/apps/${appsFolderName}/config(.*)?]"/>
</filter>
</jcr:root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
<filter root="/apps/${appsFolderName}">
<include pattern="/apps/${appsFolderName}/config(.*)?" />
</filter>
</workspaceFilter>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<'cq'='http://www.day.com/jcr/cq/1.0'>
<'nt'='http://www.jcp.org/jcr/nt/1.0'>
<'jcr'='http://www.jcp.org/jcr/1.0'>
<'sling'='http://sling.apache.org/jcr/sling/1.0'>
<'rep'='internal'>

[cq:Page] > nt:hierarchyNode
orderable primaryitem jcr:content
+ * (nt:base) = nt:base version
+ jcr:content (nt:base) = nt:unstructured

[sling:Folder] > nt:folder
- * (undefined) multiple
- * (undefined)
+ * (nt:base) = sling:Folder version

[rep:RepoAccessControllable]
mixin
+ rep:repoPolicy (rep:Policy) protected ignore

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>FileVault Package Properties</comment>
<entry key="buildCount">1</entry>
<entry key="version">${version}</entry>
<entry key="dependencies" />
<entry key="packageFormatVersion">2</entry>
<entry key="description">${projectName} Configuration Content Package</entry>
<entry key="group">${packageGroup}</entry>
<entry key="name">${configArtifactId}</entry>
<entry key="path">/etc/packages/${packageGroup}/${configArtifactId}-${version}.zip</entry>
</properties>
31 changes: 25 additions & 6 deletions templates/aem-multimodule-project/lazybones.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ def defaultFolderName = transformText(props.projectName, from: NameType.NATURAL,
props.appsFolderName = ask("Folder name under /apps for components and templates [${defaultFolderName}]: ", defaultFolderName, "appsFolderName")
props.contentFolderName = ask("Folder name under /content which will contain your site [${defaultFolderName}] (Don't worry, you can always add more, this is just for some default configuration.): ", defaultFolderName, "contentFolderName")

props.generateConfigArtifact = askBoolean("Include a separate module for configurations? [no]: ", "no", "generateConfigArtifact")
if (props.generateConfigArtifact) {
def defaultConfigArtifactId = "${props.artifactId}${props.useNewNamingConvention ? '.config' : '-config'}";
props.configArtifactId = ask("Maven artifact ID for the generated configuration content package module [${defaultConfigArtifactId}]: ", defaultConfigArtifactId as String, "configArtifactId")
} else {
new File(projectDir, "config").deleteDir()
}

// Create Editable Templates folders?
props.createEditableTemplatesStructure = askBoolean("Would you like to create AEM Editable Templates folders? [yes]: ", "yes", "createEditableTemplatesStructure");

Expand Down Expand Up @@ -261,6 +269,13 @@ processTemplates "ui.apps/src/main/content/META-INF/vault/properties.xml", props
processTemplates "ui.apps/src/main/content/META-INF/vault/filter.xml", props
processTemplates "ui.apps/src/main/content/META-INF/vault/definition/.content.xml", props

if (props.generateConfigArtifact) {
println "Processing config package metafiles..."
processTemplates "config/src/main/content/META-INF/vault/properties.xml", props
processTemplates "config/src/main/content/META-INF/vault/filter.xml", props
processTemplates "config/src/main/content/META-INF/vault/definition/.content.xml", props
}

println "Creating folders..."
def componentsDir = new File(projectDir, "ui.apps/src/main/content/jcr_root/apps/${props.appsFolderName}/components")
componentsDir.mkdirs()
Expand All @@ -270,21 +285,25 @@ new File(componentsDir, "page").mkdir()
def templatesDir = new File(projectDir, "ui.apps/src/main/content/jcr_root/apps/${props.appsFolderName}/templates")
templatesDir.mkdirs()

def configDir = new File(projectDir, "ui.apps/src/main/content/jcr_root/apps/${props.appsFolderName}/config")
def configDirBase = "ui.apps"
if (props.generateConfigArtifact) {
configDirBase = "config"
}
def configDir = new File(projectDir, "${configDirBase}/src/main/content/jcr_root/apps/${props.appsFolderName}/config")
configDir.mkdirs()
def authorConfigDir = new File(projectDir, "ui.apps/src/main/content/jcr_root/apps/${props.appsFolderName}/config.author")
def authorConfigDir = new File(projectDir, "${configDirBase}/src/main/content/jcr_root/apps/${props.appsFolderName}/config.author")
authorConfigDir.mkdirs()
def publishConfigDir = new File(projectDir, "ui.apps/src/main/content/jcr_root/apps/${props.appsFolderName}/config.publish")
def publishConfigDir = new File(projectDir, "${configDirBase}/src/main/content/jcr_root/apps/${props.appsFolderName}/config.publish")
publishConfigDir.mkdirs()

if (createEnvRunModeConfigFolders) {
for (int i = 0; i < envNames.length; i++) {
def dir = new File(projectDir, "ui.apps/src/main/content/jcr_root/apps/${props.appsFolderName}/config.${envNames[i]}")
def dir = new File(projectDir, "${configDirBase}/src/main/content/jcr_root/apps/${props.appsFolderName}/config.${envNames[i]}")
dir.mkdir()
if (createAuthorAndPublishPerEnv) {
dir = new File(projectDir, "ui.apps/src/main/content/jcr_root/apps/${props.appsFolderName}/config.author.${envNames[i]}")
dir = new File(projectDir, "${configDirBase}/src/main/content/jcr_root/apps/${props.appsFolderName}/config.author.${envNames[i]}")
dir.mkdir()
dir = new File(projectDir, "ui.apps/src/main/content/jcr_root/apps/${props.appsFolderName}/config.publish.${envNames[i]}")
dir = new File(projectDir, "${configDirBase}/src/main/content/jcr_root/apps/${props.appsFolderName}/config.publish.${envNames[i]}")
dir.mkdir()
}
}
Expand Down
3 changes: 3 additions & 0 deletions templates/aem-multimodule-project/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,9 @@
<% } %>
</profiles>
<modules>
<% if (generateConfigArtifact) { %>
<module>config</module>
<% } %>
<module>${bundleInBundlesDirectory ? 'bundles/' : ''}${useNewNamingConvention ? 'core' : 'bundle'}</module>
<module>${useNewNamingConvention ? 'ui.apps' : 'content'}</module>
<% if (generateDispatcherArtifact) { %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
jcr:primaryType="nt:unstructured"
mode="replace"
root="/apps/${appsFolderName}"
<% if (generateConfigArtifact) { %>
rules="[exclude:/apps/${appsFolderName}/config(.*)?]" />
<% } else { %>
rules="[]"/>
<% } %>
<% if (includeAcsAemCommons && enableErrorHandler) { %>
<f1
jcr:primaryType="nt:unstructured"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
<filter root="/apps/${appsFolderName}"/>
<filter root="/apps/${appsFolderName}">
<% if (generateConfigArtifact) { %>
<exclude pattern="/apps/${appsFolderName}/config(.*)?" />
<% } %>
</filter>
<% if (includeAcsAemCommons && enableErrorHandler) { %>
<filter root="/apps/sling/servlet/errorhandler"/>
<% } %>
Expand Down