Skip to content

Instantly share code, notes, and snippets.

View ksurendra's full-sized avatar

Suren K ksurendra

View GitHub Profile
@ksurendra
ksurendra / AEMGetAllPropertiesOfAnAsset
Last active September 11, 2023 10:09
Get all properties of an Asset from AEM
Resource resource;
ValueMap mainProperties;
ValueMap assetMetadataProperties;
Resource metadataResource;
ValueMap jcrProperties;
Resource jcrdataResource;
ValueMap allProperties;
for (Hit hit : result.getHits()) {
//LOGGER.info("nHit path="+hit.getPath()+", title="+hit.getTitle()); resource = hit.getResource();
@ksurendra
ksurendra / ManipulateContentOnNodes.java
Last active January 17, 2022 20:05
Java Servlet to bulk update nodes
package com.web.core.servlets;
import com.day.cq.commons.jcr.JcrConstants;
import com.day.cq.search.PredicateGroup;
import com.day.cq.search.Query;
import com.day.cq.search.QueryBuilder;
import com.day.cq.search.result.Hit;
import com.day.cq.search.result.SearchResult;
import org.apache.commons.collections.CollectionUtils;
import org.apache.sling.api.SlingHttpServletRequest;
@ksurendra
ksurendra / AemTag.java
Created October 21, 2021 22:45
AEM - Read Tags and Children
import org.apache.sling.api.resource.NonExistingResource;
..
public class AemTag {
..
@Expose
private final String id;
@Expose
private final String title;
@ksurendra
ksurendra / filter.xml
Created May 16, 2018 14:59
vlt export command script and filter.xml using the same destination folder on adobe experience manager (aem)
<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
<filter root="/content">
<exclude pattern="/content/jcr:system"/>
<exclude pattern="/content/var/classes"/>
<exclude pattern="^.*/rep:accessControl"/>
</filter>
</workspaceFilter>
@ksurendra
ksurendra / TestController.java
Created March 26, 2020 21:36
Sample controller to print API values in browser
package com.engg.java.reactive;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.GetMapping;
@RestController
public class TestController {
@GetMapping
public String sample() {
ReqResWebClient webClient = new ReqResWebClient();
@ksurendra
ksurendra / ReactiveApplication.java
Created March 26, 2020 21:22
SpringBoot Application primary file
package com.engg.java.reactive;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class ReactiveApplication {
public static void main(String[] args) {
@ksurendra
ksurendra / WebClient.java
Created March 26, 2020 21:18
WebClient for the REST API
package com.engg.java.reactive;
import org.springframework.http.MediaType;
import org.springframework.web.reactive.function.client.ClientResponse;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;
import reactor.core.publisher.Flux;
import com.engg.java.reactive.reqres.User;
public class ReqResWebClient {
@ksurendra
ksurendra / USDZ Sample 1
Last active July 22, 2019 19:00
Universal Scene Description Zip - USDZ Sample Files
@ksurendra
ksurendra / AddTasksToRunCucumberFromPom.xml
Created April 27, 2019 00:25
Adding tasks to run cucumber tests from pom.xml
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>integration-test</id>
<phase>verify</phase>
<goals>
<goal>exec</goal>
@ksurendra
ksurendra / TestsInPom.xml
Created April 27, 2019 00:20
Including Cucumber tests in pom.xml files
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>install-tester</id>
<phase>generate-sources</phase>
<goals>
<goal>exec</goal>