Skip to content

Instantly share code, notes, and snippets.

@dfparker2002
dfparker2002 / gist:cfdf04389807da39ec2bc5c2d400efa8
Created May 20, 2017 11:11 — forked from gabhi/gist:37a2a053030d574f07c0
Spring RESTTEMPLATE example using post and GET
package sample;
import java.util.HashMap;
import org.springframework.web.client.RestTemplate;
public class HelloWorld {
public static void main(String args[]) {
RestTemplate restTemplate = new RestTemplate();
@dfparker2002
dfparker2002 / DropDownServlet.java
Created May 18, 2023 05:51 — forked from sgaem/DropDownServlet.java
This gist shows the dynamic population of drop down using datasource in AEM.
package com.aem.project.core.servlets;
import com.adobe.cq.commerce.common.ValueMapDecorator;
import com.adobe.granite.ui.components.ds.DataSource;
import com.adobe.granite.ui.components.ds.SimpleDataSource;
import com.adobe.granite.ui.components.ds.ValueMapResource;
import com.day.crx.JcrConstants;
import org.apache.commons.collections4.iterators.TransformIterator;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
@dfparker2002
dfparker2002 / showhidedialogfieldstabs.js
Created December 31, 2019 00:00
Show/hide dialog fields tabs
// src: https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/206203e4a37e1a24c5558e5fed109ee8686eb82c/ui.apps/src/main/content/jcr_root/apps/acs-commons/touchui-widgets/showhidedialogfields/source/showhidedialogfieldstabs.js
/**
* Extension to the standard dropdown/select and checkbox component. It enables hidding/unhidding of multiple dialog fields
* and dialog tabs based on the selection made in the dropdown/select or on checkbox check or their combination.
*
* How to use:
* - add the empty property acs-cq-dialog-dropdown-checkbox-showhide to the dropdown/select or checkbox element
* - add the data attribute acs-cq-dialog-dropdown-checkbox-showhide-target to the dropdown/select or checkbox element,
* value should be the selector, usually a specific class name, to find all possible target elements that can be shown/hidden.
* - add the target class to each target component that can be shown/hidden
---Reactor pom (add dependencies)
<dependency>
<groupId>com.adobe.acs</groupId>
<artifactId>acs-aem-commons-content</artifactId>
<version>3.2.4</version>
<type>content-package</type>
<classifier>min</classifier>
</dependency>
<dependency>
@dfparker2002
dfparker2002 / ReadMe.md
Created June 20, 2022 19:21 — forked from GAM3RG33K/ReadMe.md
A Guide to setup and use Plantuml
@dfparker2002
dfparker2002 / GraphQLServletTest.java
Created March 11, 2022 18:56
AEM OSGi GraphQLServletTest w/ servlet subject
// src: https://github.com/apache/sling-org-apache-sling-graphql-core/blob/6bcbd14910c76bcee6c32aa118d02d856e5be8ed/src/test/java/org/apache/sling/graphql/core/servlet/GraphQLServletTest.java
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
@dfparker2002
dfparker2002 / panelselect.js
Created March 7, 2022 18:14
AEM panel selector / editor
// src: https://github.com/adobe/aem-core-wcm-components/blob/e696d5d24a0d0fd973d28c5a4b8706487cc146c3/content/src/content/jcr_root/apps/core/wcm/components/commons/editor/clientlibs/panelselect/js/panelselect.js
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright 2018 Adobe
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
@dfparker2002
dfparker2002 / README.md
Created March 3, 2022 01:05 — forked from ahmed-musallam/README.md
A simple groovy console script to find AEM pages with a certain component then display them in a nice table

A simple groovy console script to find AEM pages with a certain component then display them in a nice table

Copy script to AEM groovy console, change parameters and run!

package blog.techrevel.api;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import org.apache.commons.codec.binary.Base64;
package com.techrevel.dam.core.servlets;
import java.io.IOException;
import java.util.Dictionary;
import javax.servlet.Servlet;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.servlets.HttpConstants;