Skip to content

Commit

Permalink
release composum-nodes-3.2.1
Browse files Browse the repository at this point in the history
release composum-nodes-3.2.1
  • Loading branch information
ist-rw authored Dec 18, 2021
2 parents e55a9a4 + e2593f6 commit 6b1c1d9
Show file tree
Hide file tree
Showing 35 changed files with 93 additions and 45 deletions.
2 changes: 1 addition & 1 deletion commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.composum.nodes</groupId>
<artifactId>composum-nodes</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</parent>

<artifactId>composum-nodes-commons</artifactId>
Expand Down
6 changes: 5 additions & 1 deletion console/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.composum.nodes</groupId>
<artifactId>composum-nodes</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</parent>

<artifactId>composum-nodes-console</artifactId>
Expand Down Expand Up @@ -154,6 +154,10 @@
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.settings</artifactId>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.scripting.jsp</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.settings.SlingSettingsService;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
Expand Down Expand Up @@ -44,6 +45,7 @@ public interface Condition {
String KEY_CLASS = "class";
String KEY_SERVLET = "servlet";
String KEY_HTTP = "http";
String KEY_RUNMODE = "runmode";
String KEY_PERMISSION = "permission";

/**
Expand Down Expand Up @@ -155,9 +157,35 @@ public boolean accept(@NotNull BeanContext context, @NotNull Resource resource)

// implementations

/**
* check the avaiability of a servlet registered fo a given resource type
*/
class RunmodePermission implements Condition {

public static final Logger LOG = LoggerFactory.getLogger(ClassAvailability.class);

protected final List<String> alternatives;

public RunmodePermission(@NotNull final String pattern) {
alternatives = Arrays.asList(StringUtils.split(pattern, ","));
}

@Override
public boolean accept(@NotNull final BeanContext context, @NotNull final Resource resource) {
final SlingSettingsService settings = context.getService(SlingSettingsService.class);
final java.util.Set<String> runmodes = settings.getRunModes();
for (final String pattern : alternatives) {
if ((!pattern.startsWith("!") && runmodes.contains(pattern))
|| (pattern.startsWith("!") && !runmodes.contains(pattern.substring(1)))) {
return true;
}
}
return alternatives.size() == 0;
}
}

/**
* check the permissions of a given service key (feature)
* check the avaiability of a servlet registered fo a given resource type
*/
class ServletPermission implements Condition {

Expand Down Expand Up @@ -416,6 +444,8 @@ public Options addFactory(@NotNull final String key, @NotNull final Factory fact
.addFactory(KEY_JCR, (key, pattern) -> JCR_RESOURCE)
.addFactory(KEY_PERMISSION, (key, pattern) ->
pattern instanceof String ? new NodesPermission((String) pattern) : null)
.addFactory(KEY_RUNMODE, (key, pattern) ->
pattern instanceof String ? new RunmodePermission((String) pattern) : null)
.addFactory(KEY_SERVLET, (key, pattern) ->
pattern instanceof String ? new ServletPermission((String) pattern) : null)
.addFactory(KEY_CLASS, (key, pattern) ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,14 @@
var $link = $(event.currentTarget);
var redirectUrl = $link.data('redirect');
if (redirectUrl) {
var currentPath = CPM.nodes.browser ? CPM.nodes.browser.getCurrentPath() : '';
var currentPath = CPM.nodes.browser && _.isFunction(CPM.nodes.browser.getCurrentPath)
? CPM.nodes.browser.getCurrentPath() : '';
var pathCondition = $link.data('path-condition');
var linkTarget = $link.attr('target');
redirectUrl = redirectUrl.replaceAll(/\${path(\..+)?}/g,
(!pathCondition || new RegExp(pathCondition).exec(currentPath)) ? (currentPath + '$1') : '');
window.open(redirectUrl, $link.attr('target'));
(currentPath && (!pathCondition || new RegExp(pathCondition).exec(currentPath)))
? (currentPath + '$1') : '');
window.open(redirectUrl, linkTarget ? linkTarget : '_self');
event.preventDefault();
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion corecfg/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.composum.nodes</groupId>
<artifactId>composum-nodes</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</parent>

<artifactId>composum-nodes-config</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jslibs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.composum.nodes</groupId>
<artifactId>composum-nodes</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</parent>

<artifactId>composum-nodes-jslibs</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion osgi/pckginstall/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.composum.nodes.osgi</groupId>
<artifactId>composum-nodes-osgi</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</parent>

<artifactId>composum-nodes-osgi-package-installer</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion osgi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.composum.nodes</groupId>
<artifactId>composum-nodes</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</parent>

<groupId>com.composum.nodes.osgi</groupId>
Expand Down
2 changes: 1 addition & 1 deletion package/aem/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.composum.nodes</groupId>
<artifactId>composum-nodes-package</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</parent>

<artifactId>composum-nodes-aem-package</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@
description="/libs/composum/nodes/aem/console/components/crxde/description"
categories="[aem,nodes]"
order="{Long}20"
target="aem"/>
target="aem"
precondition="[permission:nodes/aem/crxde=read,http:/crx/de/index.jsp]"/>
<packmgr
jcr:primaryType="nt:unstructured"
jcr:title="Packages"
sling:resourceType="composum/nodes/aem/console/components/packmgr"
description="/libs/composum/nodes/aem/console/components/packmgr/description"
categories="[aem,nodes]"
order="{Long}30"
target="aem"/>
target="aem"
precondition="[permission:nodes/aem/packmgr=read,http:/crx/packmgr/index.jsp]"/>
<assets
jcr:primaryType="nt:unstructured"
jcr:title="Assets"
Expand All @@ -27,7 +29,8 @@
dynamicRedirect="{Boolean}true"
categories="[aem,nodes]"
order="{Long}200"
target="aem"/>
target="aem"
precondition="[permission:nodes/aem/assets=read,runmode:author]"/>
<fragments
jcr:primaryType="nt:unstructured"
jcr:title="Fragments"
Expand All @@ -36,7 +39,8 @@
dynamicRedirect="{Boolean}true"
categories="[aem,nodes]"
order="{Long}300"
target="aem"/>
target="aem"
precondition="[permission:nodes/aem/fragments=read,runmode:author]"/>
<sites
jcr:primaryType="nt:unstructured"
jcr:title="Sites"
Expand All @@ -45,7 +49,8 @@
dynamicRedirect="{Boolean}true"
categories="[aem,nodes]"
order="{Long}400"
target="aem"/>
target="aem"
precondition="[permission:nodes/aem/sites=read,runmode:author]"/>
<edit
jcr:primaryType="nt:unstructured"
jcr:title="Edit"
Expand All @@ -54,14 +59,16 @@
dynamicRedirect="{Boolean}true"
categories="[aem,nodes]"
order="{Long}500"
target="_blank"/>
target="_blank"
precondition="[permission:nodes/aem/edit=read,runmode:author]"/>
<view
jcr:primaryType="nt:unstructured"
jcr:title="View"
sling:redirect="${path.html}"
pathCondition="^/content(?!(/(dam)/)).*$"
dynamicRedirect="{Boolean}true"
categories="[aem,nodes]"
order="{Long}500"
target="_blank"/>
order="{Long}550"
target="_blank"
precondition="[permission:nodes/aem/view=read]"/>
</jcr:root>
2 changes: 1 addition & 1 deletion package/commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.composum.nodes</groupId>
<artifactId>composum-nodes-package</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</parent>

<artifactId>composum-nodes-commons-bundle</artifactId>
Expand Down
6 changes: 5 additions & 1 deletion package/console/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.composum.nodes</groupId>
<artifactId>composum-nodes-package</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</parent>

<artifactId>composum-nodes-console-bundle</artifactId>
Expand Down Expand Up @@ -144,6 +144,10 @@
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.settings</artifactId>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.scripting.jsp</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion package/jslibs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.composum.nodes</groupId>
<artifactId>composum-nodes-package</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</parent>

<artifactId>composum-nodes-jslibs-package</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion package/pckgmgr/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.composum.nodes</groupId>
<artifactId>composum-nodes-package</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</parent>

<artifactId>composum-nodes-pckgmgr-bundle</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion package/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.composum.nodes</groupId>
<artifactId>composum-nodes</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</parent>

<artifactId>composum-nodes-package</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion package/setup/bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.composum.nodes.setup</groupId>
<artifactId>composum-nodes-package-setup</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</parent>

<artifactId>composum-nodes-package-setup-bundle</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion package/setup/hook/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.composum.nodes.setup</groupId>
<artifactId>composum-nodes-package-setup</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</parent>

<artifactId>composum-nodes-package-setup-hook</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion package/setup/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.composum.nodes</groupId>
<artifactId>composum-nodes-package</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</parent>

<groupId>com.composum.nodes.setup</groupId>
Expand Down
2 changes: 1 addition & 1 deletion package/sling/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.composum.nodes</groupId>
<artifactId>composum-nodes-package</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</parent>

<artifactId>composum-nodes-sling-package</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion package/usermgr/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.composum.nodes</groupId>
<artifactId>composum-nodes-package</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</parent>

<artifactId>composum-nodes-usermgr-bundle</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pckgmgr/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.composum.nodes</groupId>
<artifactId>composum-nodes</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</parent>

<artifactId>composum-nodes-pckgmgr</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pckgmgr/src/test/bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.composum.nodes.test</groupId>
<artifactId>maven-package-test</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</parent>

<artifactId>maven-package-test-bundle</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pckgmgr/src/test/package/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.composum.nodes.test</groupId>
<artifactId>maven-package-test</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</parent>

<artifactId>maven-package-test-package</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pckgmgr/src/test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.composum.nodes</groupId>
<artifactId>composum-nodes</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
<relativePath>../../../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>com.composum.nodes</groupId>
<artifactId>composum-nodes</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
<packaging>pom</packaging>

<name>Composum Nodes</name>
Expand Down
2 changes: 1 addition & 1 deletion setup/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.composum.nodes</groupId>
<artifactId>composum-nodes</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</parent>

<groupId>com.composum.nodes.setup</groupId>
Expand Down
2 changes: 1 addition & 1 deletion setup/slingfeature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.composum.nodes.setup</groupId>
<artifactId>composum-nodes-setup</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</parent>

<artifactId>composum-nodes-slingfeature</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion setup/util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.composum.nodes.setup</groupId>
<artifactId>composum-nodes-setup</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</parent>

<artifactId>composum-nodes-setup-util</artifactId>
Expand Down
Loading

0 comments on commit 6b1c1d9

Please sign in to comment.