getReferencedAssets(String pagePath);
10 | }
11 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/text/text.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Text entered by the user is: ${properties.text}
6 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/dam/aemtutorials/color.json/_jcr_content/renditions/original:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "text" : "Red",
4 | "value": "#FF0000"
5 | },
6 | {
7 | "text" : "Blue",
8 | "value": "#0000FF"
9 | },
10 | {
11 | "text" : "Green",
12 | "value": "#008000"
13 | }
14 | ]
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/clientlibs/clientlib-grid/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/clientlibs/clientlib-site/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/template-types/page/thumbnail.png.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_300.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ani03sha/AEM-Tutorials/HEAD/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/template-types/page/thumbnail.png.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_300.png
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/template-types/page/thumbnail.png.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_319.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ani03sha/AEM-Tutorials/HEAD/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/template-types/page/thumbnail.png.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_319.png
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/template-types/page/thumbnail.png.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ani03sha/AEM-Tutorials/HEAD/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/template-types/page/thumbnail.png.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_48.png
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/clientlibs/customClientlibs/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/tests/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/page-content/thumbnail.png.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_300.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ani03sha/AEM-Tutorials/HEAD/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/page-content/thumbnail.png.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_300.png
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/page-content/thumbnail.png.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_319.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ani03sha/AEM-Tutorials/HEAD/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/page-content/thumbnail.png.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_319.png
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/page-content/thumbnail.png.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ani03sha/AEM-Tutorials/HEAD/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/page-content/thumbnail.png.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_48.png
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/card/clientlib/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/search/clientlibs/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/core/src/main/java/org/redquark/aem/tutorials/core/services/WriteTODOService.java:
--------------------------------------------------------------------------------
1 | package org.redquark.aem.tutorials.core.services;
2 |
3 | /**
4 | * @author Anirudh Sharma
5 | *
6 | * This interface represents the service which writes to-do data in the repository
7 | */
8 | public interface WriteTODOService {
9 |
10 | void writeData(String todoData);
11 | }
12 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/clientlibs/clientlib-dependencies/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/xf-web-variation/thumbnail.png.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ani03sha/AEM-Tutorials/HEAD/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/xf-web-variation/thumbnail.png.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_128.png
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/xf-web-variation/thumbnail.png.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_319.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ani03sha/AEM-Tutorials/HEAD/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/xf-web-variation/thumbnail.png.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_319.png
--------------------------------------------------------------------------------
/core/src/main/java/org/redquark/aem/tutorials/core/services/EmailService.java:
--------------------------------------------------------------------------------
1 | package org.redquark.aem.tutorials.core.services;
2 |
3 | public interface EmailService {
4 |
5 | void sendEmail(
6 | String toEmail,
7 | String ccEmail,
8 | String fromEmail,
9 | String subject,
10 | String content
11 | );
12 | }
13 |
--------------------------------------------------------------------------------
/core/src/main/java/org/redquark/aem/tutorials/core/utils/DropdownData.java:
--------------------------------------------------------------------------------
1 | package org.redquark.aem.tutorials.core.utils;
2 |
3 | public class DropdownData {
4 |
5 | private final String text;
6 | private final String value;
7 |
8 | public DropdownData(final String text, final String value) {
9 | this.text = text;
10 | this.value = value;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/image/image.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/core/src/main/java/org/redquark/aem/tutorials/core/services/CardService.java:
--------------------------------------------------------------------------------
1 | package org.redquark.aem.tutorials.core.services;
2 |
3 | public interface CardService {
4 |
5 | /**
6 | * @return name of the organization
7 | */
8 | String getOrganizationName();
9 |
10 | /**
11 | * @return URL of the home page
12 | */
13 | String getHomepageURL();
14 | }
15 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/card/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/user/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/template-types/_rep_policy.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/todo/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/experience-fragments/aemtutorials/us/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/htl/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/experience-fragments/aemtutorials/us/en/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ui.frontend/src/App.js:
--------------------------------------------------------------------------------
1 | import { Page, withModel } from '@adobe/cq-react-editable-components';
2 | import React from 'react';
3 |
4 | // This component is the application entry point
5 | class App extends Page {
6 | render() {
7 | return (
8 |
9 | {this.childComponents}
10 | {this.childPages}
11 |
12 | );
13 | }
14 | }
15 |
16 | export default withModel(App);
17 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/preferences/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/image/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/dam/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/htl/_cq_dialog/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/todo/_cq_dialog/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/template-types/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/dam/aemtutorials/asset.jpg/_jcr_content/renditions/original.dir/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/dam/aemtutorials/font.json/_jcr_content/renditions/original:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "text": "8 Pixel",
4 | "value": "8px"
5 | },
6 | {
7 | "text": "16 Pixel",
8 | "value": "16px"
9 | },
10 | {
11 | "text": "24 Pixel",
12 | "value": "24px"
13 | },
14 | {
15 | "text": "32 Pixel",
16 | "value": "32px"
17 | }
18 | ]
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/card/card.html.dir/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/htl/htl.html.dir/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/search/_cq_dialog/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/text/text.html.dir/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/user/user.html.dir/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/experience-fragments/aemtutorials/us/en/site/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/image/image.html.dir/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/search/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/text/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/preferences/preferences.html.dir/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/clientlibs/customClientlibs/js/altTextValidation.js.dir/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/template-types/page/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/page/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/META-INF/vault/filter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/var/workflow/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/search/search.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/template-types/base-page/initial/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/i18n/fr.json.dir/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/dam/aemtutorials/country.json/_jcr_content/renditions/original:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "text": "India",
4 | "value": "india"
5 | },
6 | {
7 | "text": "USA",
8 | "value": "usa"
9 | },
10 | {
11 | "text": "Israel",
12 | "value": "israel"
13 | },
14 | {
15 | "text": "Canada",
16 | "value": "canada"
17 | },
18 | {
19 | "text": "Russia",
20 | "value": "russia"
21 | }
22 | ]
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/experience-fragments/aemtutorials/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/template-types/page/thumbnail.png.dir/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
10 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/page-content/thumbnail.png.dir/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
10 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/xf-web-variation/thumbnail.png.dir/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
10 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/segments/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/dam/aemtutorials/color.json/_jcr_content/renditions/original.dir/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
10 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/dam/aemtutorials/font.json/_jcr_content/renditions/original.dir/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
10 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/dam/aemtutorials/country.json/_jcr_content/renditions/original.dir/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
10 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/aemtutorials/_jcr_content/image/file.dir/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/structure/page/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/spa-app-template/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
10 |
11 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/xf-web-variation/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
10 |
11 |
--------------------------------------------------------------------------------
/core/src/main/java/org/redquark/aem/tutorials/core/models/Card.java:
--------------------------------------------------------------------------------
1 | package org.redquark.aem.tutorials.core.models;
2 |
3 | public interface Card {
4 |
5 | /**
6 | * @return the title of the card
7 | */
8 | String getCardTitle();
9 |
10 | /**
11 | * @return the text on the button
12 | */
13 | String getButtonText();
14 |
15 | /**
16 | * @return organization name from the osgi config
17 | */
18 | String getOrganizationName();
19 |
20 | /**
21 | * @return homepage url from the osgi config
22 | */
23 | String getHomepageURL();
24 | }
25 |
--------------------------------------------------------------------------------
/core/src/main/java/org/redquark/aem/tutorials/core/services/ResourceResolverService.java:
--------------------------------------------------------------------------------
1 | package org.redquark.aem.tutorials.core.services;
2 |
3 | import org.apache.sling.api.resource.ResourceResolver;
4 |
5 | /**
6 | * @author Anirudh Sharma
7 | *
8 | * This service gives instance of the resource resolver using service user approach
9 | */
10 | public interface ResourceResolverService {
11 |
12 | /**
13 | * This method returns the instance of resource resolver
14 | *
15 | * @return @{@link ResourceResolver}
16 | */
17 | ResourceResolver getResourceResolver();
18 | }
19 |
--------------------------------------------------------------------------------
/ui.frontend/src/utils/extract-model-id.test.js:
--------------------------------------------------------------------------------
1 | import extractModelId from './extract-model-id';
2 |
3 | describe('Utils ->', () => {
4 | const CONTENT_PATH = '/content/test/cq/jcr:content/path';
5 | const CONTENT_PATH_CONVERTED = '_content_test_cq_jcr_content_path';
6 |
7 | describe('extractModelId ->', () => {
8 | it('should convert not fail', () => {
9 | expect(extractModelId()).toBeUndefined();
10 | });
11 |
12 | it('should convert the given path into an id', () => {
13 | expect(extractModelId(CONTENT_PATH)).toBe(CONTENT_PATH_CONVERTED);
14 | });
15 | });
16 | });
17 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/clientlibs/clientlib-base/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/preferences/preferences.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Name: ${properties.name}
6 | Country: ${properties.country}
7 | Favourite color: ${properties.color}
8 | Favourite font: ${properties.font}
9 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/template-types/base-page/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/template-types/xf/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/user/user.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
ID: ${user.id}
7 | Name: ${user.name}
8 | Gender: ${user.gender}
9 | Address: ${user.address}
10 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/spa-page-template/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/aemtutorials/us/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/ui.frontend/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "AEM Tutorials",
3 | "name": "AEM Tutorials",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": "/content/aemtutorials/us/en/home.html",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/experience-fragments/aemtutorials/us/en/site/footer/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/experience-fragments/aemtutorials/us/en/site/header/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/config/org.apache.sling.commons.log.LogManager.factory.config-aemtutorials.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/clientlibs/customClientlibs/js/altTextValidation.js:
--------------------------------------------------------------------------------
1 | $(window).adaptTo("foundation-registry")
2 | .register(
3 | "foundation.validation.validator", {
4 | selector : "#alt-special", // validates the specific alt field
5 | validate : function(el) {
6 | var $el = $(el);
7 | var $form = $el.closest('form'); // get the form
8 | var $upload = $form.find("coral-fileupload[name$=image]"); // find the file upload widget
9 | if ($upload.hasClass('is-filled') && !$el.val()) { // if class exists, return the validation message
10 | return "Enter Alt Text";
11 | } else {
12 | return;
13 | }
14 | }
15 | });
16 |
17 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/dam/aemtutorials/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/page-content/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
12 |
13 |
--------------------------------------------------------------------------------
/ui.frontend/assembly.xml:
--------------------------------------------------------------------------------
1 |
2 | distribution
3 |
4 | zip
5 |
6 | false
7 |
8 |
9 | ${basedir}/build/
10 |
11 | **/*
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/core/src/main/java/org/redquark/aem/tutorials/core/models/User.java:
--------------------------------------------------------------------------------
1 | package org.redquark.aem.tutorials.core.models;
2 |
3 | /**
4 | * @author Anirudh Sharma
5 | *
6 | * Represents the "User" component
7 | */
8 | public interface User {
9 |
10 | /**
11 | * @return unique id of the user
12 | */
13 | String getId();
14 |
15 | /**
16 | * @return String to represent the name of the user
17 | */
18 | String getName();
19 |
20 | /**
21 | * @return String to represent the gender of the user
22 | */
23 | String getGender();
24 |
25 | /**
26 | * @return String to represent the address of the user
27 | */
28 | String getAddress();
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/template-types/base-page/policies/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/base-template/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
12 |
13 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/card/card.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
15 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/template-types/xf/policies/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/var/workflow/_rep_policy.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
12 |
16 |
17 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/search/clientlibs/js/script.js:
--------------------------------------------------------------------------------
1 | $(function () {
2 | $('#fulltext-search').submit(function (event) {
3 | event.preventDefault();
4 |
5 | var formEl = $(this);
6 | var submitButton = $('input[type=submit]', formEl);
7 |
8 | $.ajax({
9 | type: 'POST',
10 | url: formEl.prop('action'),
11 | accept: {
12 | javascript: 'application/javascript'
13 | },
14 | data: {
15 | 'keyword': $('#keyword').val()
16 | },
17 | beforeSend: function () {
18 | submitButton.prop('disabled', 'disabled');
19 | }
20 | }).done(function (data) {
21 | submitButton.prop('disabled', false);
22 | });
23 | });
24 | });
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/clientlibs/clientlib-base/css.txt:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright 2017 Adobe Systems Incorporated
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | ###############################################################################
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/clientlibs/clientlib-base/js.txt:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright 2017 Adobe Systems Incorporated
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | ###############################################################################
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/clientlibs/clientlib-site/css.txt:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright 2018 Adobe Systems Incorporated
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | ###############################################################################
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/clientlibs/clientlib-site/js.txt:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright 2018 Adobe Systems Incorporated
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | ###############################################################################
--------------------------------------------------------------------------------
/core/src/main/java/org/redquark/aem/tutorials/core/configs/CardConfiguration.java:
--------------------------------------------------------------------------------
1 | package org.redquark.aem.tutorials.core.configs;
2 |
3 | import org.osgi.service.metatype.annotations.AttributeDefinition;
4 | import org.osgi.service.metatype.annotations.ObjectClassDefinition;
5 |
6 | @ObjectClassDefinition(
7 | name = "AEM Tutorials Card Configuration",
8 | description = "This configuration captures the card details"
9 | )
10 | public @interface CardConfiguration {
11 |
12 | @AttributeDefinition(
13 | name = "Organization Name",
14 | description = "Name of the organization you wish to display on the card"
15 | )
16 | String getOrganizationName();
17 |
18 | @AttributeDefinition(
19 | name = "Homepage URL",
20 | description = "URL of the website's homepage"
21 | )
22 | String getHomepageURL();
23 | }
24 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/clientlibs/clientlib-dependencies/js.txt:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright 2017 Adobe Systems Incorporated
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | ###############################################################################
16 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/clientlibs/clientlib-dependencies/css.txt:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright 2017 Adobe Systems Incorporated
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | ###############################################################################
16 |
17 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/clientlibs/clientlib-grid/css.txt:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Copyright 2018 Adobe Systems Incorporated
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | ###############################################################################
16 |
17 | less/grid.less
--------------------------------------------------------------------------------
/ui.frontend/src/components/import-components.js:
--------------------------------------------------------------------------------
1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 | ~ Copyright 2020 Adobe Systems Incorporated
3 | ~
4 | ~ Licensed under the Apache License, Version 2.0 (the "License");
5 | ~ you may not use this file except in compliance with the License.
6 | ~ You may obtain a copy of the License at
7 | ~
8 | ~ http://www.apache.org/licenses/LICENSE-2.0
9 | ~
10 | ~ Unless required by applicable law or agreed to in writing, software
11 | ~ distributed under the License is distributed on an "AS IS" BASIS,
12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | ~ See the License for the specific language governing permissions and
14 | ~ limitations under the License.
15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
16 |
17 | import './Page/Page';
18 | import './Text/Text';
19 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/base-template/policies/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
10 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/template-types/xf/initial/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
11 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/xf-web-variation/initial/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
11 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/ui.frontend/src/components/Page/Page.css:
--------------------------------------------------------------------------------
1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 | ~ Copyright 2020 Adobe Systems Incorporated
3 | ~
4 | ~ Licensed under the Apache License, Version 2.0 (the "License");
5 | ~ you may not use this file except in compliance with the License.
6 | ~ You may obtain a copy of the License at
7 | ~
8 | ~ http://www.apache.org/licenses/LICENSE-2.0
9 | ~
10 | ~ Unless required by applicable law or agreed to in writing, software
11 | ~ distributed under the License is distributed on an "AS IS" BASIS,
12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | ~ See the License for the specific language governing permissions and
14 | ~ limitations under the License.
15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
16 |
17 | .page {
18 | max-width: 1024px;
19 | margin: 0 auto;
20 | padding: 12px;
21 | }
22 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/template-types/page/initial/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
12 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/ui.frontend/utils/entrypoints.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 |
3 | /**
4 | * Returns all entrypoint chunks (JS and CSS) of the React app. These chunks
5 | * will not need to be precached because they're already requested from the HTML
6 | * file)
7 | *
8 | * @param {string} assetManifestPath: Path to the asset manifest file from which
9 | * the entrypoint files can be read
10 | */
11 | function getEntrypoints(assetManifestPath) {
12 | if (!fs.existsSync(assetManifestPath)) {
13 | throw Error(
14 | `Cannot determine entrypoints: No asset manifest found at path ${assetManifestPath}`
15 | );
16 | }
17 | const manifest = fs.readFileSync(assetManifestPath, { encoding: 'utf8' });
18 | const manifestContent = JSON.parse(manifest);
19 | if (!('entrypoints' in manifestContent)) {
20 | throw Error(
21 | `Cannot determine entrypoints: Missing "entrypoints" key in ${assetManifestPath}`
22 | );
23 | }
24 | return manifestContent.entrypoints;
25 | }
26 |
27 | module.exports = getEntrypoints;
28 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/policies/_rep_policy.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
12 |
16 |
20 |
21 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/_rep_policy.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
12 |
16 |
20 |
21 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/aemtutorials/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/spa-app-template/structure/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
12 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/base-template/initial/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
11 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/all/src/main/content/META-INF/vault/filter.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/ui.frontend/src/setupTests.js:
--------------------------------------------------------------------------------
1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 | ~ Copyright 2020 Adobe Systems Incorporated
3 | ~
4 | ~ Licensed under the Apache License, Version 2.0 (the "License");
5 | ~ you may not use this file except in compliance with the License.
6 | ~ You may obtain a copy of the License at
7 | ~
8 | ~ http://www.apache.org/licenses/LICENSE-2.0
9 | ~
10 | ~ Unless required by applicable law or agreed to in writing, software
11 | ~ distributed under the License is distributed on an "AS IS" BASIS,
12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | ~ See the License for the specific language governing permissions and
14 | ~ limitations under the License.
15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
16 |
17 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
18 | // allows you to do things like:
19 | // expect(element).toHaveTextContent(/react/i)
20 | // learn more: https://github.com/testing-library/jest-dom
21 | import '@testing-library/jest-dom/extend-expect';
22 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/template-types/page/policies/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
13 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/spa-page-template/policies/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
13 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/ui.frontend/src/utils/extract-model-id.js:
--------------------------------------------------------------------------------
1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 | ~ Copyright 2020 Adobe Systems Incorporated
3 | ~
4 | ~ Licensed under the Apache License, Version 2.0 (the "License");
5 | ~ you may not use this file except in compliance with the License.
6 | ~ You may obtain a copy of the License at
7 | ~
8 | ~ http://www.apache.org/licenses/LICENSE-2.0
9 | ~
10 | ~ Unless required by applicable law or agreed to in writing, software
11 | ~ distributed under the License is distributed on an "AS IS" BASIS,
12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | ~ See the License for the specific language governing permissions and
14 | ~ limitations under the License.
15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
16 |
17 | /**
18 | * Extract an id from the cqModel field of given properties
19 | *
20 | * @param path - Path to be converted into an id
21 | * @returns {string|undefined}
22 | */
23 | export default function extractModelId(path) {
24 | return path && path.replace(/\/|:/g, '_');
25 | }
26 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/var/_rep_policy.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
12 |
16 |
19 |
20 |
24 |
25 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/page/customfooterlibs.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 |
22 |
26 |
--------------------------------------------------------------------------------
/core/src/main/java/org/redquark/aem/tutorials/core/utils/IDGenerator.java:
--------------------------------------------------------------------------------
1 | package org.redquark.aem.tutorials.core.utils;
2 |
3 | import java.nio.charset.StandardCharsets;
4 | import java.util.Random;
5 |
6 | public class IDGenerator {
7 |
8 | /**
9 | * @return Unique id
10 | */
11 | public static String generateUniqueID(int n) {
12 | // Length is bounded by 256 Character
13 | byte[] array = new byte[256];
14 | new Random().nextBytes(array);
15 |
16 | String randomString = new String(array, StandardCharsets.UTF_8);
17 | // Create a StringBuffer to store the result
18 | StringBuilder r = new StringBuilder();
19 |
20 | // Append first 20 alphanumeric characters
21 | // from the generated random String into the result
22 | for (int k = 0; k < randomString.length(); k++) {
23 | char ch = randomString.charAt(k);
24 | if (((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9')) && (n > 0)) {
25 | r.append(ch);
26 | n--;
27 | }
28 | }
29 | // return the resultant string
30 | return r.toString();
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/spa-app-template/initial/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
12 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/spa-page-template/initial/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
12 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/spa-app-template/policies/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
11 |
15 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/all/src/main/content/META-INF/vault/definition/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
23 |
24 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/dam/aemtutorials/color.json/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
13 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/dam/aemtutorials/country.json/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
13 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/dam/aemtutorials/font.json/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
13 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/ui.frontend/src/index.css:
--------------------------------------------------------------------------------
1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 | ~ Copyright 2020 Adobe Systems Incorporated
3 | ~
4 | ~ Licensed under the Apache License, Version 2.0 (the "License");
5 | ~ you may not use this file except in compliance with the License.
6 | ~ You may obtain a copy of the License at
7 | ~
8 | ~ http://www.apache.org/licenses/LICENSE-2.0
9 | ~
10 | ~ Unless required by applicable law or agreed to in writing, software
11 | ~ distributed under the License is distributed on an "AS IS" BASIS,
12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | ~ See the License for the specific language governing permissions and
14 | ~ limitations under the License.
15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
16 |
17 | /* Global styles */
18 |
19 | html,
20 | body {
21 | border: 0;
22 | font: inherit;
23 | font-size: 100%;
24 | margin: 0;
25 | padding: 0;
26 | vertical-align: baseline;
27 | }
28 |
29 | body {
30 | background-color: #ffffff;
31 | }
32 |
33 | h1,
34 | h2,
35 | h3,
36 | h4,
37 | h5,
38 | p,
39 | .nav-container,
40 | .rw-box {
41 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
42 | color: #000000;
43 | }
44 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/clientlibs/clientlib-grid/less/grid.less:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 Adobe Systems Incorporated
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | @import (once) "/libs/wcm/foundation/clientlibs/grid/grid_base.less";
18 |
19 | /* maximum amount of grid cells to be provided */
20 | @max_col: 12;
21 |
22 | /* default breakpoint */
23 | .aem-Grid {
24 | .generate-grid(default, @max_col);
25 | }
26 |
27 | /* phone breakpoint */
28 | @media (max-width: 650px) {
29 | .aem-Grid {
30 | .generate-grid(phone, @max_col);
31 | }
32 | }
33 |
34 | /* tablet breakpoint */
35 | @media (min-width: 651px) and (max-width: 1200px) {
36 | .aem-Grid {
37 | .generate-grid(tablet, @max_col);
38 | }
39 | }
--------------------------------------------------------------------------------
/ui.frontend/.env:
--------------------------------------------------------------------------------
1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 | ~ Copyright 2020 Adobe Systems Incorporated
3 | ~
4 | ~ Licensed under the Apache License, Version 2.0 (the "License");
5 | ~ you may not use this file except in compliance with the License.
6 | ~ You may obtain a copy of the License at
7 | ~
8 | ~ http://www.apache.org/licenses/LICENSE-2.0
9 | ~
10 | ~ Unless required by applicable law or agreed to in writing, software
11 | ~ distributed under the License is distributed on an "AS IS" BASIS,
12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | ~ See the License for the specific language governing permissions and
14 | ~ limitations under the License.
15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
16 |
17 | # Path to the `public` directory when the web app is deployed. In the case of
18 | # AEM, that's the path to the `resources` ClientLib directory. Specifying this
19 | # path is required for features like code splitting to work (because it will be
20 | # prepended to paths in the `asset-manifest.json` file)
21 | PUBLIC_URL=/etc.clientlibs/aemtutorials/clientlibs/clientlib-react/resources
22 |
23 | REACT_APP_PAGE_MODEL_PATH=
24 | REACT_APP_API_HOST=
25 | REACT_APP_AEM_AUTHORIZATION_HEADER=
26 | REACT_APP_ROOT=
27 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/template-types/base-page/structure/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
12 |
13 |
14 |
18 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/ui.frontend/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "aemtutorials",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "start": "react-scripts start",
7 | "build": "react-scripts build && clientlib",
8 | "test": "react-scripts test",
9 | "eject": "react-scripts eject",
10 | "sync": "aemsync -d -w ../ui.apps/src/main/content"
11 | },
12 | "dependencies": {
13 | "@adobe/cq-react-editable-components": "^1.2.0",
14 | "@adobe/cq-spa-component-mapping": "^1.0.3",
15 | "@adobe/cq-spa-page-model-manager": "^1.1.0",
16 | "custom-event-polyfill": "^1.0.7",
17 | "dompurify": "^2.0.7",
18 | "history": "^4.10.1",
19 | "react": "^16.12.0",
20 | "react-app-polyfill": "^1.0.5",
21 | "react-dom": "^16.12.0",
22 | "react-router-dom": "^5.1.2"
23 | },
24 | "devDependencies": {
25 | "@testing-library/jest-dom": "^4.2.4",
26 | "@testing-library/react": "^9.3.2",
27 | "@testing-library/user-event": "^7.1.2",
28 | "aem-clientlib-generator": "^1.5.0",
29 | "aemsync": "^4.0.0",
30 | "enzyme": "^3.10.0",
31 | "enzyme-adapter-react-16": "^1.15.1",
32 | "react-scripts": "~3.3.0",
33 | "sinon": "^7.5.0"
34 | },
35 | "proxy": "http://localhost:4502",
36 | "browserslist": [
37 | "defaults"
38 | ],
39 | "eslintConfig": {
40 | "extends": "react-app"
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/page-content/initial/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
12 |
15 |
18 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/tests/SampleTests.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Adobe Systems Incorporated
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | new hobs.TestSuite("AEM Tutorials Tests", {path:"/apps/aemtutorials/tests/SampleTests.js", register: true})
17 |
18 | .addTestCase(new hobs.TestCase("Hello World component on english page")
19 | .navigateTo("/content/aemtutorials/en.html")
20 | .asserts.location("/content/aemtutorials/en.html", true)
21 | .asserts.visible(".helloworld", true)
22 | )
23 |
24 | .addTestCase(new hobs.TestCase("Hello World component on french page")
25 | .navigateTo("/content/aemtutorials/fr.html")
26 | .asserts.location("/content/aemtutorials/fr.html", true)
27 | .asserts.visible(".helloworld", true)
28 | );
29 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/policies/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/xf-web-variation/structure/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
10 |
14 |
15 |
16 |
20 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/ui.frontend/.env.development:
--------------------------------------------------------------------------------
1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 | ~ Copyright 2020 Adobe Systems Incorporated
3 | ~
4 | ~ Licensed under the Apache License, Version 2.0 (the "License");
5 | ~ you may not use this file except in compliance with the License.
6 | ~ You may obtain a copy of the License at
7 | ~
8 | ~ http://www.apache.org/licenses/LICENSE-2.0
9 | ~
10 | ~ Unless required by applicable law or agreed to in writing, software
11 | ~ distributed under the License is distributed on an "AS IS" BASIS,
12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | ~ See the License for the specific language governing permissions and
14 | ~ limitations under the License.
15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
16 |
17 | # Path to the `public` directory when the web app is deployed. In the case of
18 | # AEM, that's the path to the `resources` ClientLib directory. Specifying this
19 | # path is required for features like code splitting to work (because it will be
20 | # prepended to paths in the `asset-manifest.json` file)
21 | PUBLIC_URL=/etc.clientlibs/aemtutorials/clientlibs/clientlib-react/resources
22 |
23 | REACT_APP_PAGE_MODEL_PATH=/content/aemtutorials/en.model.json
24 | REACT_APP_API_HOST=http://localhost:4502
25 | REACT_APP_AEM_AUTHORIZATION_HEADER='Basic YWRtaW46YWRtaW4='
26 | REACT_APP_ROOT=/content/aemtutorials/us/en/home.html
27 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/template-types/xf/structure/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
10 |
15 |
16 |
17 |
21 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/ui.frontend/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | AEM Tutorials
14 |
15 |
16 |
20 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/experience-fragments/aemtutorials/us/en/site/footer/master/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
12 |
16 |
19 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/search/clientlibs/css/style.css:
--------------------------------------------------------------------------------
1 | form {
2 | outline: 0;
3 | float: left;
4 | -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
5 | box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
6 | -webkit-border-radius: 4px;
7 | border-radius: 4px;
8 | }
9 |
10 | form>.textbox {
11 | outline: 0;
12 | height: 42px;
13 | width: 244px;
14 | line-height: 42px;
15 | padding: 0 16px;
16 | background-color: rgba(255, 255, 255, 0.8);
17 | color: #212121;
18 | float: left;
19 | -webkit-border-radius: 4px 0 0 4px;
20 | border-radius: 4px 0 0 4px;
21 | }
22 |
23 | form>.textbox:focus {
24 | outline: 0;
25 | background-color: #FFF;
26 | }
27 |
28 | form>.button {
29 | outline: 0;
30 | background: none;
31 | background-color: rgba(38, 50, 56, 0.8);
32 | float: left;
33 | height: 42px;
34 | width: 75px;
35 | text-align: center;
36 | line-height: 42px;
37 | border: 0;
38 | color: #FFF;
39 | font: normal normal normal 14px/1 FontAwesome;
40 | font-size: 16px;
41 | text-rendering: auto;
42 | text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
43 | -webkit-transition: background-color .4s ease;
44 | transition: background-color .4s ease;
45 | -webkit-border-radius: 0 4px 4px 0;
46 | border-radius: 0 4px 4px 0;
47 | }
48 |
49 | form>.button:hover {
50 | background-color: rgba(0, 150, 136, 0.8);
51 | }
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/aemtutorials/us/en/home/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
12 |
15 |
18 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/aemtutorials/us/en/base-page/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
12 |
17 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/templates/page-content/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
12 |
15 |
18 |
21 |
24 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/templates/page-home/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
12 |
15 |
18 |
21 |
24 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/template-types/page/structure/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
10 |
13 |
18 |
19 |
20 |
21 |
25 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/ui.frontend/src/components/Page/Page.js:
--------------------------------------------------------------------------------
1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 | ~ Copyright 2020 Adobe Systems Incorporated
3 | ~
4 | ~ Licensed under the Apache License, Version 2.0 (the "License");
5 | ~ you may not use this file except in compliance with the License.
6 | ~ You may obtain a copy of the License at
7 | ~
8 | ~ http://www.apache.org/licenses/LICENSE-2.0
9 | ~
10 | ~ Unless required by applicable law or agreed to in writing, software
11 | ~ distributed under the License is distributed on an "AS IS" BASIS,
12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | ~ See the License for the specific language governing permissions and
14 | ~ limitations under the License.
15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
16 |
17 | import {
18 | MapTo,
19 | Page,
20 | withComponentMappingContext
21 | } from '@adobe/cq-react-editable-components';
22 | import { withRoute } from '../RouteHelper/RouteHelper';
23 |
24 | require('./Page.css');
25 |
26 | // This component is a variant of a Page component mapped to the
27 | // "aemtutorials/components/page" resource type. For now, the rendering is
28 | // the same as the RootPage; this is more for illustration purposes
29 | class AppPage extends Page {
30 | get containerProps() {
31 | let attrs = super.containerProps;
32 | attrs.className =
33 | (attrs.className || '') + ' page ' + (this.props.cssClassNames || '');
34 | return attrs;
35 | }
36 | }
37 |
38 | export default MapTo('aemtutorials/components/page')(
39 | withComponentMappingContext(withRoute(AppPage))
40 | );
41 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/htl/htl.html:
--------------------------------------------------------------------------------
1 | HTL Code Snippets
2 |
3 |
4 | Example 1:
5 | Title of the page is: ${currentPage.title}
6 |
7 |
8 | Example 2:
9 | Sling Resource Type property of the component node: ${properties.sling:resourceType}
10 |
11 |
12 | Example 3:
13 | Array join: ${['Batman', 'Superman', 'Flash'] @ join='-'}
14 |
15 |
16 | Example 4:
17 |
18 | We are in the edit mode
19 |
20 |
21 | We are in the preview mode
22 |
23 |
24 |
25 | Example 5:
26 |
27 |
28 | -
29 |
${item.title}
30 |
31 |
32 |
33 |
34 |
35 | Example 6:
36 | This text will be replaced.
37 |
38 |
39 | Example 7:
40 | Attributes are set for this element
41 |
42 |
43 | Example 8:
44 | ${item.name}
45 |
46 |
47 | Example 9:
48 |
49 |
50 |
51 | Example 10:
52 |
53 |
54 |
55 | Example 11:
56 |
57 | This can be called by using 'call'
58 |
59 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by https://www.gitignore.io/api/eclipse,java,maven
2 |
3 | ### Eclipse ###
4 | *.pydevproject
5 | .metadata
6 | .gradle
7 | bin/
8 | tmp/
9 | *.tmp
10 | *.bak
11 | *.swp
12 | *~.nib
13 | local.properties
14 | .settings/
15 | .loadpath
16 |
17 | # Eclipse Core
18 | .project
19 |
20 | # External tool builders
21 | .externalToolBuilders/
22 |
23 | # Locally stored "Eclipse launch configurations"
24 | *.launch
25 |
26 | # CDT-specific
27 | .cproject
28 |
29 | # JDT-specific (Eclipse Java Development Tools)
30 | .classpath
31 |
32 | # Java annotation processor (APT)
33 | .factorypath
34 |
35 | # PDT-specific
36 | .buildpath
37 |
38 | # sbteclipse plugin
39 | .target
40 |
41 | # TeXlipse plugin
42 | .texlipse
43 |
44 |
45 | ### Java ###
46 | *.class
47 |
48 | # Mobile Tools for Java (J2ME)
49 | .mtj.tmp/
50 |
51 | # Package Files #
52 | *.jar
53 | *.war
54 | *.ear
55 |
56 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
57 | hs_err_pid*
58 |
59 |
60 | ### Maven ###
61 | target/
62 | pom.xml.tag
63 | pom.xml.releaseBackup
64 | pom.xml.versionsBackup
65 | pom.xml.next
66 | release.properties
67 | dependency-reduced-pom.xml
68 | buildNumber.properties
69 | .mvn/timing.properties
70 |
71 |
72 | ### Vault ###
73 | .vlt
74 |
75 |
76 | ### IntelliJ ###
77 | .idea/
78 | *.iml
79 |
80 |
81 | ### Node.js ###
82 |
83 | # Log files
84 | *.log
85 |
86 | # NPM
87 | node_modules/
88 | package-lock.json
89 | yarn.lock
90 |
91 | # Webpack
92 | build/
93 | dist/
94 |
95 | # Frontend Maven Plugin
96 | node/
97 |
98 | # Tests
99 | coverage/
100 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/base-template/structure/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
12 |
18 |
19 |
20 |
24 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/core/src/main/java/org/redquark/aem/tutorials/core/services/impl/CardServiceImpl.java:
--------------------------------------------------------------------------------
1 | package org.redquark.aem.tutorials.core.services.impl;
2 |
3 | import org.osgi.framework.Constants;
4 | import org.osgi.service.component.annotations.Activate;
5 | import org.osgi.service.component.annotations.Component;
6 | import org.osgi.service.metatype.annotations.Designate;
7 | import org.redquark.aem.tutorials.core.configs.CardConfiguration;
8 | import org.redquark.aem.tutorials.core.services.CardService;
9 | import org.slf4j.Logger;
10 | import org.slf4j.LoggerFactory;
11 |
12 | @Component(
13 | service = CardService.class,
14 | immediate = true,
15 | property = {
16 | Constants.SERVICE_ID + "=Card Service",
17 | Constants.SERVICE_DESCRIPTION + "=This service reads values from Card Configuration"
18 | })
19 | @Designate(ocd = CardConfiguration.class)
20 | public class CardServiceImpl implements CardService {
21 |
22 | private static final String TAG = CardServiceImpl.class.getSimpleName();
23 | private static final Logger LOGGER = LoggerFactory.getLogger(CardServiceImpl.class);
24 |
25 | private CardConfiguration configuration;
26 |
27 | @Activate
28 | protected void activate(CardConfiguration configuration) {
29 | this.configuration = configuration;
30 | }
31 |
32 | @Override
33 | public String getOrganizationName() {
34 | LOGGER.info("{}: reading organization name", TAG);
35 | return configuration.getOrganizationName();
36 | }
37 |
38 | @Override
39 | public String getHomepageURL() {
40 | LOGGER.info("{}: reading homepage url", TAG);
41 | return configuration.getHomepageURL();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/conf/aemtutorials/settings/wcm/templates/spa-page-template/structure/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
10 |
13 |
17 |
18 |
19 |
20 |
21 |
22 |
26 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/experience-fragments/aemtutorials/us/en/site/header/master/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
12 |
16 |
23 |
28 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/core/src/main/java/org/redquark/aem/tutorials/core/constants/AppConstants.java:
--------------------------------------------------------------------------------
1 | package org.redquark.aem.tutorials.core.constants;
2 |
3 | /**
4 | * @author Anirudh Sharma
5 | *
6 | * This class keeps all the app level constants
7 | */
8 | public final class AppConstants {
9 |
10 | public static final String FORWARD_SLASH = "/";
11 | public static final String EQUALS = "=";
12 | public static final String NEW_LINE = "\n";
13 |
14 | // TO-DO related constants
15 | public static final String TODO_ENDPOINT = "https://jsonplaceholder.typicode.com/todos/";
16 | public static final long TODO_THREAD_SLEEP_TIME = 14400000;
17 |
18 | // Resource Resolver Factory sub-service
19 | public static final String SUB_SERVICE = "tutorialSubService";
20 |
21 | // Workflow Process Label
22 | public static final String PROCESS_LABEL = "process.label";
23 | // Workflow Chooser Label
24 | public static final String CHOOSER_LABEL = "chooser.label";
25 | // Child page count
26 | public static final String CHILD_PAGE_COUNT = "childPageCount";
27 |
28 | // User groups
29 | public static final String ADMINISTRATORS = "administrators";
30 | public static final String CONTENT_AUTHORS = "content-authors";
31 |
32 | // Dynamic datasource
33 | public static final String DATASOURCE = "datasource";
34 | public static final String DROPDOWN_SELECTOR = "dropdownSelector";
35 | public static final String COUNTRY_LIST = "countryList";
36 | public static final String COUNTRY_LIST_PATH = "/content/dam/aemtutorials/country.json";
37 | public static final String COLOR_LIST = "colorList";
38 | public static final String COLOR_LIST_PATH = "/content/dam/aemtutorials/color.json";
39 | public static final String FONT_LIST = "fontList";
40 | public static final String FONT_LIST_PATH = "/content/dam/aemtutorials/font.json";
41 |
42 | public static final String PAGE_REPLICATION_TOPIC = "aemtutorials/replication/job";
43 | }
44 |
--------------------------------------------------------------------------------
/ui.frontend/src/components/Text/Text.css:
--------------------------------------------------------------------------------
1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 | ~ Copyright 2020 Adobe Systems Incorporated
3 | ~
4 | ~ Licensed under the Apache License, Version 2.0 (the "License");
5 | ~ you may not use this file except in compliance with the License.
6 | ~ You may obtain a copy of the License at
7 | ~
8 | ~ http://www.apache.org/licenses/LICENSE-2.0
9 | ~
10 | ~ Unless required by applicable law or agreed to in writing, software
11 | ~ distributed under the License is distributed on an "AS IS" BASIS,
12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | ~ See the License for the specific language governing permissions and
14 | ~ limitations under the License.
15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
16 |
17 | h1,
18 | h2,
19 | h3,
20 | h4,
21 | h5,
22 | h6,
23 | p {
24 | border: 0;
25 | font-size: 100%;
26 | margin: 0;
27 | padding: 0;
28 | vertical-align: baseline;
29 | }
30 |
31 | h1,
32 | h2,
33 | h3,
34 | h4,
35 | h5,
36 | h6 {
37 | color: rgba(0, 0, 0, 0.8);
38 | text-transform: uppercase;
39 | }
40 |
41 | p {
42 | color: rgba(0, 0, 0, 0.8);
43 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
44 | font-size: 18px;
45 | font-weight: 200;
46 | line-height: 32px;
47 | }
48 |
49 | h1 {
50 | font-size: 48px;
51 | letter-spacing: 0.8em;
52 | }
53 |
54 | h2 {
55 | font-size: 48px;
56 | font-weight: 700;
57 | letter-spacing: 0.02em;
58 | }
59 |
60 | h3 {
61 | font-size: 18px;
62 | font-weight: 700;
63 | letter-spacing: 0.02em;
64 | padding: 4px 0;
65 | }
66 |
67 | h5 {
68 | color: rgba(0, 0, 0, 0.8);
69 | font-size: 18px;
70 | text-align: center;
71 | }
72 |
73 | @media (min-width: 651px) and (max-width: 1200px) {
74 | h1 {
75 | font-size: 30px;
76 | }
77 |
78 | h2 {
79 | font-size: 30px;
80 | }
81 |
82 | h3 {
83 | font-weight: 400;
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/page/customheaderlibs.html:
--------------------------------------------------------------------------------
1 |
16 |
18 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
32 |
33 |
34 |
35 |
36 |
40 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/text/_cq_dialog/.content.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
15 |
19 |
20 |
23 |
24 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/ui.frontend/src/index.js:
--------------------------------------------------------------------------------
1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 | ~ Copyright 2020 Adobe Systems Incorporated
3 | ~
4 | ~ Licensed under the Apache License, Version 2.0 (the "License");
5 | ~ you may not use this file except in compliance with the License.
6 | ~ You may obtain a copy of the License at
7 | ~
8 | ~ http://www.apache.org/licenses/LICENSE-2.0
9 | ~
10 | ~ Unless required by applicable law or agreed to in writing, software
11 | ~ distributed under the License is distributed on an "AS IS" BASIS,
12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | ~ See the License for the specific language governing permissions and
14 | ~ limitations under the License.
15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
16 |
17 | // Use polyfills for modern language features
18 | // The imports and dependencies can be removed if only modern browsers should be
19 | // supported
20 | import 'react-app-polyfill/stable';
21 | import 'react-app-polyfill/ie9';
22 | import 'custom-event-polyfill';
23 |
24 | import { Constants, ModelManager } from '@adobe/cq-spa-page-model-manager';
25 | import { createBrowserHistory } from 'history';
26 | import React from 'react';
27 | import { render } from 'react-dom';
28 | import { Router } from 'react-router-dom';
29 | import App from './App';
30 | import './components/import-components';
31 | import './index.css';
32 |
33 | document.addEventListener('DOMContentLoaded', () => {
34 | ModelManager.initialize().then(pageModel => {
35 | const history = createBrowserHistory();
36 | render(
37 |
38 |
46 | ,
47 | document.getElementById('spa-root')
48 | );
49 | });
50 | });
51 |
--------------------------------------------------------------------------------
/ui.frontend/src/components/Text/Text.js:
--------------------------------------------------------------------------------
1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 | ~ Copyright 2020 Adobe Systems Incorporated
3 | ~
4 | ~ Licensed under the Apache License, Version 2.0 (the "License");
5 | ~ you may not use this file except in compliance with the License.
6 | ~ You may obtain a copy of the License at
7 | ~
8 | ~ http://www.apache.org/licenses/LICENSE-2.0
9 | ~
10 | ~ Unless required by applicable law or agreed to in writing, software
11 | ~ distributed under the License is distributed on an "AS IS" BASIS,
12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | ~ See the License for the specific language governing permissions and
14 | ~ limitations under the License.
15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
16 |
17 | import { MapTo } from '@adobe/cq-react-editable-components';
18 | import DOMPurify from 'dompurify';
19 | import React, { Component } from 'react';
20 | import extractModelId from '../../utils/extract-model-id';
21 |
22 | require('./Text.css');
23 |
24 | /**
25 | * Default Edit configuration for the Text component that interact with the Core Text component and sub-types
26 | *
27 | * @type EditConfig
28 | */
29 | const TextEditConfig = {
30 | emptyLabel: 'Text',
31 |
32 | isEmpty: function(props) {
33 | return !props || !props.text || props.text.trim().length < 1;
34 | }
35 | };
36 |
37 | /**
38 | * Text React component
39 | */
40 | class Text extends Component {
41 | get richTextContent() {
42 | return (
43 |
50 | );
51 | }
52 |
53 | get textContent() {
54 | return {this.props.text}
;
55 | }
56 |
57 | render() {
58 | return this.props.richText ? this.richTextContent : this.textContent;
59 | }
60 | }
61 |
62 | export default MapTo('aemtutorials/components/text')(
63 | Text,
64 | TextEditConfig
65 | );
66 |
--------------------------------------------------------------------------------
/ui.frontend/src/components/RouteHelper/RouteHelper.js:
--------------------------------------------------------------------------------
1 | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 | ~ Copyright 2020 Adobe Systems Incorporated
3 | ~
4 | ~ Licensed under the Apache License, Version 2.0 (the "License");
5 | ~ you may not use this file except in compliance with the License.
6 | ~ You may obtain a copy of the License at
7 | ~
8 | ~ http://www.apache.org/licenses/LICENSE-2.0
9 | ~
10 | ~ Unless required by applicable law or agreed to in writing, software
11 | ~ distributed under the License is distributed on an "AS IS" BASIS,
12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | ~ See the License for the specific language governing permissions and
14 | ~ limitations under the License.
15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
16 |
17 | import React, { Component } from 'react';
18 | import { Route } from 'react-router-dom';
19 |
20 | /**
21 | * Helper that facilitate the use of the {@link Route} component
22 | */
23 |
24 | /**
25 | * Returns a composite component where a {@link Route} component wraps the provided component
26 | *
27 | * @param {React.Component} WrappedComponent - React component to be wrapped
28 | * @param {string} [extension=html] - extension used to identify a route amongst the tree of resource URLs
29 | * @returns {CompositeRoute}
30 | */
31 | export const withRoute = (WrappedComponent, extension) => {
32 | return class CompositeRoute extends Component {
33 | render() {
34 | let routePath = this.props.cqPath;
35 | if (!routePath) {
36 | return ;
37 | }
38 |
39 | extension = extension || 'html';
40 |
41 | // Context path + route path + extension
42 | return (
43 | {
48 | return ;
49 | }}
50 | />
51 | );
52 | }
53 | };
54 | };
55 |
--------------------------------------------------------------------------------
/core/src/main/java/org/redquark/aem/tutorials/core/workflows/participant/ReviewChildrenPagesStep.java:
--------------------------------------------------------------------------------
1 | package org.redquark.aem.tutorials.core.workflows.participant;
2 |
3 | import com.adobe.granite.workflow.WorkflowSession;
4 | import com.adobe.granite.workflow.exec.ParticipantStepChooser;
5 | import com.adobe.granite.workflow.exec.WorkItem;
6 | import com.adobe.granite.workflow.metadata.MetaDataMap;
7 | import org.osgi.service.component.annotations.Component;
8 | import org.slf4j.Logger;
9 | import org.slf4j.LoggerFactory;
10 |
11 | import static org.redquark.aem.tutorials.core.constants.AppConstants.ADMINISTRATORS;
12 | import static org.redquark.aem.tutorials.core.constants.AppConstants.CHILD_PAGE_COUNT;
13 | import static org.redquark.aem.tutorials.core.constants.AppConstants.CHOOSER_LABEL;
14 | import static org.redquark.aem.tutorials.core.constants.AppConstants.CONTENT_AUTHORS;
15 | import static org.redquark.aem.tutorials.core.constants.AppConstants.EQUALS;
16 | import static org.redquark.aem.tutorials.core.workflows.participant.ReviewChildrenPagesStep.CHOOSER_LABEL_VALUE;
17 |
18 | @Component(
19 | service = ParticipantStepChooser.class,
20 | property = {
21 | CHOOSER_LABEL + EQUALS + CHOOSER_LABEL_VALUE
22 | }
23 | )
24 | public class ReviewChildrenPagesStep implements ParticipantStepChooser {
25 |
26 | protected static final String CHOOSER_LABEL_VALUE = "Review Children Pages";
27 | private static final String TAG = ReviewChildrenPagesStep.class.getSimpleName();
28 | private static final Logger LOGGER = LoggerFactory.getLogger(ReviewChildrenPagesStep.class);
29 |
30 | @Override
31 | public String getParticipant(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap) {
32 | // Get the count of the children pages in the workflow
33 | int childPagesCount = workItem.getWorkflow().getMetaDataMap().get(CHILD_PAGE_COUNT, 0);
34 | LOGGER.debug("{}: child pages count: {}", TAG, childPagesCount);
35 | // Return the user group based on the number of child pages
36 | return childPagesCount > 0 ? ADMINISTRATORS : CONTENT_AUTHORS;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/core/src/main/java/org/redquark/aem/tutorials/core/models/impl/CardImpl.java:
--------------------------------------------------------------------------------
1 | package org.redquark.aem.tutorials.core.models.impl;
2 |
3 | import org.apache.sling.api.resource.Resource;
4 | import org.apache.sling.models.annotations.DefaultInjectionStrategy;
5 | import org.apache.sling.models.annotations.Model;
6 | import org.apache.sling.models.annotations.injectorspecific.OSGiService;
7 | import org.redquark.aem.tutorials.core.models.Card;
8 | import org.redquark.aem.tutorials.core.services.CardService;
9 | import org.slf4j.Logger;
10 | import org.slf4j.LoggerFactory;
11 |
12 | import javax.annotation.PostConstruct;
13 | import javax.inject.Inject;
14 |
15 | @Model(
16 | adaptables = {Resource.class},
17 | adapters = {Card.class},
18 | resourceType = {CardImpl.RESOURCE_TYPE},
19 | defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL
20 | )
21 | public class CardImpl implements Card {
22 |
23 | protected static final String RESOURCE_TYPE = "aemtutorials/components/content/card";
24 | private static final Logger LOGGER = LoggerFactory.getLogger(CardImpl.class);
25 | private static final String TAG = CardImpl.class.getSimpleName();
26 |
27 | @Inject
28 | String cardTitle;
29 |
30 | @Inject
31 | String buttonText;
32 |
33 | @OSGiService
34 | CardService cardService;
35 |
36 | private String organizationName;
37 |
38 | private String homepageURL;
39 |
40 | @PostConstruct
41 | protected void init() {
42 | organizationName = cardService.getOrganizationName();
43 | homepageURL = cardService.getHomepageURL();
44 | LOGGER.info("{}: organization name: {}", TAG, organizationName);
45 | LOGGER.info("{}: homepage url: {}", TAG, homepageURL);
46 | }
47 |
48 | @Override
49 | public String getCardTitle() {
50 | return cardTitle;
51 | }
52 |
53 | @Override
54 | public String getButtonText() {
55 | return buttonText;
56 | }
57 |
58 | public String getOrganizationName() {
59 | return organizationName;
60 | }
61 |
62 | public String getHomepageURL() {
63 | return homepageURL;
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/ui.apps/src/main/content/jcr_root/apps/aemtutorials/components/content/card/clientlib/css/style.css:
--------------------------------------------------------------------------------
1 | *{margin:0px;padding:0px;-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;font-family: 'Roboto';}
2 |
3 | /* --- card ---- */
4 |
5 | .card{
6 | position: relative;
7 | display: inline-block;
8 | width: 300px;
9 | height: 300px;
10 | margin: 1em;
11 | background-size: cover;
12 | border-radius: 10px;
13 | box-shadow: 0px 25px 50px rgba(0, 0, 0, 0.5);
14 | overflow: hidden;
15 | -moz-transition: 0.5s;-o-transition: 0.5s;-webkit-transition: 0.5s;transition: 0.5s;
16 | }
17 | .card.ph1{background: url('//cs622627.vk.me/v622627615/26cdb/sBCCzAw79Cw.jpg') center no-repeat ;background-size: cover;}
18 | .card.ph2{background: url('//cs622627.vk.me/v622627615/26ce5/L2xeil9_uqg.jpg') center no-repeat;background-size: cover;}
19 |
20 | .card .overlay{
21 | width: 100%;
22 | height: 100%;
23 | position: absolute;
24 | padding: 1em;
25 | top: 0;
26 | z-index: 10;
27 | color: #fff;
28 | -moz-transition: 0.5s;-o-transition: 0.5s;-webkit-transition: 0.5s;transition: 0.5s;
29 | }
30 |
31 | .card .overlay h2{
32 | position: relative;
33 | margin: 2em 0px;
34 | top: -200px;
35 | -moz-transition: 0.5s;-o-transition: 0.5s;-webkit-transition: 0.5s;transition: 0.5s;
36 | }
37 |
38 | .card .overlay a{
39 | position: relative;
40 | width: 60%;
41 | top: 200px;
42 | padding: 0.5em 2em;
43 | border: 2px solid #fff;
44 | text-decoration: none;
45 | color:#FFFFFF;
46 | border-radius: 3px;
47 | -moz-transition: 0.5s;-o-transition: 0.5s;-webkit-transition: 0.5s;transition: 0.5s;
48 | }
49 | .card a:hover{background: #fff;color:#5c5c5c;}
50 |
51 | .card:hover .overlay{background: rgba(92, 92, 92, 0.8);}
52 | .card:hover h2{top: 0px;}
53 | .card:hover a{top: 0px;}
54 |
55 | @media screen and (max-width: 700px){
56 |
57 | .card{
58 | position: relative;
59 | display:block;
60 | width: 100%;
61 | height: 300px;
62 | margin: 3em 0em;
63 | border-radius: 0px;
64 | box-shadow: 0px 25px 50px rgba(0, 0, 0, 0.5);
65 | overflow: hidden;
66 | transition: all .4s ease;
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/ui.content/src/main/content/jcr_root/content/aemtutorials/_jcr_content/image/file:
--------------------------------------------------------------------------------
1 | �PNG
2 |
3 |
4 | IHDR � �
5 | �{� 7IDATx����j�` �a��.rT���5��G� !l'F��b_��sn���K~���|>�� ��{= �"�� @@� � ` 0 �� @@� � ` 0 �� @@� � ` 0 �� @@� � ` 0 �� @@� � ` 0 �� @@� � ` 0 �� @@� � ` 0 �� @@� � ` 0 �� @@� � ` 0 �� @@� � ` 0 �� @@� � ` 0 �� @@� � ` 0 �� @@� � ` 0 �� @@� � ` 0 �� @@� � ` 0 �� @@� � ` 0 �� @@� � ` 0 �� @@� � ` 0 �� @@� � ` 0 �� @@� � ` 0 �� @@� � ` 0 �� @@� � ` 0 �� @@� � ` 0 �� @@� � ` 0 �� @�G= n�~��,�Rϸk�0l�i�g��`x�wx�y��<�eY�����u���$�!��j�ߋ��������9�ܩ]���$� ` 0 �� @@� � ` 0 �!|���K=��v�z��<==�n��t�'��q
6 | �� @@� � �4��p8�>�v��'��`X��x�'\���s=�#h 0 �� @@� � ` 0 �� @@� ���a%~/�� �
7 | ��m=�3�� � ` 0 ����O��{O[����