Skip to content

Commit

Permalink
GH-174 responsive dialog
Browse files Browse the repository at this point in the history
- some change to core API, mispelled label, shared type utils,
- ResponsiveInclude in admin core that includes special resource type from a cache it builds looping over breakpoints,
- add special exclusion from jacoco coverage check as it seems we can get granite commons ui publicly available for mocking.
  • Loading branch information
npeltier committed Oct 19, 2020
1 parent 1cf1efb commit 422c88f
Show file tree
Hide file tree
Showing 15 changed files with 857 additions and 284 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
scripts=["create path (sling:Folder) /var/dx
create service user dx-admin-write
set ACL for dx-admin-write
allow jcr:read on /,/apps,/conf
allow jcr:read,rep:write,jcr:lockManagement,jcr:versionManagement on /var/dx
end"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?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"
jcr:primaryType="sling:OsgiConfig"
service.ranking="0"
user.mapping="[com.adobe.dx.admin:adminService\=dx-admin-write]"/>
35 changes: 31 additions & 4 deletions apps/admin/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,48 @@ Bundle-DocURL:
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-baseline-maven-plugin</artifactId>
</plugin>

</plugins>
</build>
<profiles>
<profile>
<id>jacoco-report</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>check-coverage</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<excludes>
<exclude>com/adobe/dx/admin/responsive/internal/IncludeHelper.class</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

</profiles>

<dependencies>
<!--testing-->
<dependency>
<groupId>com.adobe.dx</groupId>
<artifactId>testing-extensions</artifactId>
<version>0.0.1</version>
<version>0.0.2-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.adobe.dx</groupId>
<artifactId>core</artifactId>
<version>0.1.0</version>
<version>0.1.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>javax.jcr</groupId>
Expand All @@ -106,8 +133,8 @@ Bundle-DocURL:
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<version>${aem.version}</version>
<classifier>apis</classifier>
<scope>provided</scope>
<classifier>apis</classifier>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright 2020 Adobe
~
~ 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
~
~ http://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.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
package com.adobe.dx.admin.responsive.internal;

import com.adobe.granite.ui.components.htl.ComponentHelper;

import java.io.IOException;

import javax.script.Bindings;
import javax.servlet.ServletException;

import org.apache.commons.lang3.StringUtils;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.scripting.SlingBindings;

public class IncludeHelper extends ComponentHelper {

SlingHttpServletRequest request;
Resource targetResource;

IncludeHelper (SlingHttpServletRequest request, Resource targetResource) {
this.request = request;
this.targetResource = targetResource;
init((Bindings)request.getAttribute(SlingBindings.class.getName()));
}

@Override
protected void activate() {
}

String include() throws ServletException, IOException {
return super.include(targetResource, targetResource.getResourceType(), StringUtils.EMPTY, getOptions());
}
}
Loading

0 comments on commit 422c88f

Please sign in to comment.