-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
...main/content/jcr_root/apps/aemdesign/components/cloudservices/genericsnippet/.content.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<jcr:root xmlns:granite="http://www.adobe.com/jcr/granite/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" | ||
jcr:primaryType="cq:Component"/> |
20 changes: 20 additions & 0 deletions
20
...ontent/jcr_root/apps/aemdesign/components/cloudservices/genericsnippet/genericsnippet.jsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<%@page session="false" | ||
import="com.day.cq.wcm.webservicesupport.Configuration, | ||
com.day.cq.wcm.webservicesupport.ConfigurationManager" %><% | ||
%><%@taglib prefix="cq" uri="http://www.day.com/taglibs/cq/1.0" %><% | ||
%><cq:defineObjects/><% | ||
String[] services = pageProperties.getInherited("cq:cloudserviceconfigs", new String[]{}); | ||
ConfigurationManager cfgMgr = resource.getResourceResolver().adaptTo(ConfigurationManager.class); | ||
if(cfgMgr != null) { | ||
String snippetCode = null; | ||
Configuration cfg = cfgMgr.getConfiguration("generic-snippet", services); | ||
if(cfg != null) { | ||
snippetCode = cfg.get("snippetcode", null); | ||
} | ||
if(snippetCode != null) { | ||
%><%= snippetCode %><% | ||
} | ||
} | ||
%> |
6 changes: 6 additions & 0 deletions
6
.../content/jcr_root/apps/aemdesign/components/cloudservices/genericsnippetpage/.content.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" | ||
cq:defaultView="html" | ||
jcr:primaryType="cq:Component" | ||
sling:resourceSuperType="cq/cloudserviceconfigs/components/configpage" | ||
componentGroup="AEM.Design - Cloud Services"/> |
47 changes: 47 additions & 0 deletions
47
...r_root/apps/aemdesign/components/cloudservices/genericsnippetpage/_cq_dialog/.content.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/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" | ||
jcr:title="Generic Snippet Settings" | ||
sling:resourceType="cq/gui/components/authoring/dialog"> | ||
<content | ||
jcr:primaryType="nt:unstructured" | ||
sling:resourceType="granite/ui/components/foundation/container"> | ||
<layout | ||
jcr:primaryType="nt:unstructured" | ||
sling:resourceType="granite/ui/components/foundation/layouts/tabs" | ||
type="nav"/> | ||
<items jcr:primaryType="nt:unstructured"> | ||
<configTab | ||
jcr:primaryType="nt:unstructured" | ||
jcr:title="Config" | ||
sling:resourceType="granite/ui/components/foundation/section"> | ||
<layout | ||
jcr:primaryType="nt:unstructured" | ||
sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns" | ||
margin="{Boolean}false"/> | ||
<items jcr:primaryType="nt:unstructured"> | ||
<column | ||
jcr:primaryType="nt:unstructured" | ||
sling:resourceType="granite/ui/components/foundation/container"> | ||
<items jcr:primaryType="nt:unstructured"> | ||
<variant | ||
jcr:primaryType="nt:unstructured" | ||
jcr:title="Config" | ||
sling:resourceType="granite/ui/components/coral/foundation/form/fieldset"> | ||
<items jcr:primaryType="nt:unstructured"> | ||
<snippet | ||
jcr:primaryType="nt:unstructured" | ||
sling:resourceType="granite/ui/components/coral/foundation/form/textarea" | ||
fieldDescription="Enter snippet code to be added at the bottom of the page. This text will be added as-is to the bottom of the page." | ||
fieldLabel="Snippet Code" | ||
name="./snippetcode" | ||
required="false"/> | ||
</items> | ||
</variant> | ||
</items> | ||
</column> | ||
</items> | ||
</configTab> | ||
</items> | ||
</content> | ||
</jcr:root> |
27 changes: 27 additions & 0 deletions
27
...n/content/jcr_root/apps/aemdesign/components/cloudservices/genericsnippetpage/content.jsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<%@page session="false"%> | ||
<%@page contentType="text/html" | ||
pageEncoding="utf-8" | ||
import="javax.jcr.Node" | ||
%><%@include file="/libs/foundation/global.jsp" | ||
%><%@include file="/libs/wcm/global.jsp" | ||
%><%@include file="/libs/cq/cloudserviceconfigs/components/configpage/init.jsp" | ||
%><% I18n i18n = new I18n(request); %> | ||
<cq:setContentBundle/> | ||
<% | ||
if (currentPage.getParent().getProperties().get("componentReference","") == "") { | ||
log.error("Generic Snippet config is missing componentReference, updating to aemdesign/components/cloudservices/genericsnippet."); | ||
Node contentnode = currentPage.getParent().getContentResource().adaptTo(Node.class); | ||
contentnode.setProperty("componentReference","aemdesign/components/cloudservices/genericsnippet"); | ||
Session resourceSession = resource.getResourceResolver().adaptTo(Session.class); | ||
resourceSession.save(); | ||
} | ||
%> | ||
<div class="content"> | ||
<h3><fmt:message key="Generic Snippet Settings"/></h3> | ||
<ul style="float: left; margin: 0px;"> | ||
<li><div class="li-bullet"><strong><fmt:message key="Snippet"/>: </strong><%= xssAPI.encodeForHTML(properties.get("snippetcode", "")).replaceAll("\\&\\#xa;","<br>") %></div></li> | ||
<li class="config-successful-message when-config-successful" style="display: none"> | ||
<fmt:message key="Configuration is successful."/><br> | ||
</li> | ||
</ul> | ||
</div> |
20 changes: 20 additions & 0 deletions
20
...in/content/jcr_root/apps/aemdesign/components/cloudservices/genericsnippetpage/dialog.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" | ||
jcr:primaryType="cq:Dialog" | ||
xtype="dialog"> | ||
<items jcr:primaryType="cq:WidgetCollection"> | ||
<general | ||
jcr:primaryType="nt:unstructured" | ||
title="Generic Snippet Settings" | ||
xtype="panel"> | ||
<items jcr:primaryType="cq:WidgetCollection"> | ||
<snippet | ||
jcr:primaryType="cq:Widget" | ||
fieldDescription="This text will be added as-is to the bottom of the page." | ||
fieldLabel="Snippet Code" | ||
name="./snippetcode" | ||
xtype="textarea"/> | ||
</items> | ||
</general> | ||
</items> | ||
</jcr:root> |
14 changes: 14 additions & 0 deletions
14
...rc/main/content/jcr_root/apps/aemdesign/templates/cloudconfig/genericsnippet/.content.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:granite="http://www.adobe.com/jcr/granite/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" | ||
jcr:description="Generic Snippet configuration" | ||
jcr:primaryType="cq:Template" | ||
jcr:title="Generic Snippet Configuration" | ||
sling:resourceSuperType="cq/cloudserviceconfigs/templates/configpage" | ||
allowedChildren="[/apps/aemdesign/templates/cloudconfig/genericsnippet]" | ||
allowedPaths="[/etc/cloudservices/generic-snippet(/.*)?]" | ||
ranking="{Long}90"> | ||
<jcr:content | ||
cq:cloudservicename="genericsnippet" | ||
jcr:primaryType="cq:PageContent" | ||
sling:resourceType="aemdesign/components/cloudservices/genericsnippetpage"/> | ||
</jcr:root> |
3 changes: 3 additions & 0 deletions
3
...tent/jcr_root/apps/aemdesign/templates/cloudconfig/genericsnippet/thumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.