Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

rajareddych
rajareddych
Offline

Badges

Badges
10

Accepted Solutions

Accepted Solutions
1

Likes

Likes
0

Posts

Posts
25

Discussions

Discussions
15

Questions

Questions
10

Ideas

Ideas
0

Blog Posts

Blog Posts
0
Top badges earned by rajareddych
Customize the badges you want to showcase on your profile
Re: JUnit for Logic
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
I have resolved this myself. Thanks

Views

726

Likes

0

Replies

0
Re: JUnit for Logic
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
package service.core.workflows;import java.util.Collections;import java.util.UUID;import javax.jcr.Session;import org.apache.sling.api.resource.LoginException;import org.apache.sling.api.resource.ModifiableValueMap;import org.apache.sling.api.resource.Resource;import org.apache.sling.api.resource.ResourceResolver;import org.apache.sling.api.resource.ResourceResolverFactory;import org.apache.sling.jcr.resource.api.JcrResourceConstants;import org.osgi.framework.Constants;import org.osgi.service.co...

Views

712

Likes

0

Replies

0
Re: JUnit for Logic
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
did not help, i've gone through a lot of articles.Now I'm struck withif (childResource.getResourceType().equalsIgnoreCase(ServiceConstants.SOME_RESOURCE)) { name = "SomeResource"; } else if (childResource.getResourceType().equalsIgnoreCase(ServiceConstants.EXAMPLE_RESOURCE)) { name = "ExampleResource"; }

Views

712

Likes

0

Replies

0
JUnit for Logic
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
Help is appreciated in writing JUNIT for below code. @PostConstruct protected void invokepost() { super.Initialize(); qs = new ArrayList(); Iterator iteratorExp = resource.getChild("root/childParsys/").listChildren(); while (iteratorExp.hasNext()) { Resource childResource = iteratorExp.next(); SomeComponent map = childResource.adaptTo(SomeComponent.class); if(map != null) { qs.add(map); } if (childResource.getResourceType().equalsIgnoreCase(ServiceConstants.SOME_RESOURCE)) { name = "SomeResource...

Views

1.4K

Likes

0

Replies

6
JUnit for Workflow
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
Writing code is easy, but I'm finding it difficult to write JUnit tests for that code. Could anyone help in writing JUnit for the below workflow.public void execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap args) { log.info("\n------------- Workflow {Start} --------------------"); String contentPath = ""; WorkflowData workflowData = workItem.getWorkflowData(); final String type = workflowData.getPayloadType(); ResourceResolver resourceResolver = null; log.info("Workflow typ...

Views

589

Likes

0

Replies

0
Re: How to limit Parsys to one component dynamically.
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
I too got this idea, but unfortunately, I can use only 1 Parsys.

Views

724

Likes

0

Replies

0
How to limit Parsys to one component dynamically.
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
I have 2 components A & B and Parsys allowing both the 2 components.If I drag & drop component A, then the Parsys should only allow component A and should not be allowed for component B.If I drag & drop component B, then the Parsys should only allow component B and should not be allowed for component A.Can I achieve this condition? If so, how can I achieve this?

Views

777

Likes

0

Replies

2
Listener event not triggered
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
I am using below code to dynamically assign an ID to a component/template. Seems this is not getting triggered. Please helpimport javax.jcr.Node;import javax.jcr.RepositoryException;import javax.jcr.Session;import javax.jcr.observation.Event;import javax.jcr.observation.EventListener;import javax.jcr.observation.ObservationManager;import javax.jcr.observation.EventIterator;import org.apache.sling.api.resource.ResourceResolver;import org.apache.sling.api.resource.ResourceResolverFactory;import or...

Views

2.0K

Likes

0

Replies

2
Re: Generate Unique Component ID
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
I need a way to generate AEM inbuilt UUID for each component. I have read a lot of documents, but nothing has how to create it.

Views

1.3K

Likes

0

Replies

0
Workflow process step to assign a value to a node property in crx/de
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
I want to create a workflow process step for assigning a value to a component node's property in crx/de, /content folder.

Views

851

Likes

0

Replies

1
Generate Unique Component ID
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
After I create a page, I need my default component in the page to generate a unique ID and display it.I have read a lot of threads related to this. UUID is something I could use and below code also i could usef(F.P1.AUTO_NUM.rawValue == null) { var d = new Date(); var code = d.getDay().toString() + d.getMonth().toString() + d.getFullYear().toString() + d.getHours().toString() + d.getMinutes().toString() + d.getSeconds().toString() + d.getMilliseconds().toString(); //Set to code the the text fiel...

Views

1.6K

Likes

0

Replies

3
Re: Splecial characters in RTE are displayed differently after conversion to JSON view
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
Thank you guys, I have used replace keyword instead of decoding, and is working as expected.

Views

1.1K

Likes

0

Replies

1
Re: Splecial characters in RTE are displayed differently after conversion to JSON view
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
Answer Model is a JSON sling model exporter with 3 fields, 2 are RTE fields.

Views

3.0K

Likes

0

Replies

0
Re: Splecial characters in RTE are displayed differently after conversion to JSON view
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
[ERROR] /C:/Users/raja/Desktop/aem-release/core/src/main/java/com/core/servlets/qr/ContentServlet.java:[40,26] cannot find symbol symbol: method writeValueAsString(com.aetna.ahm.core.models.qr.AnswerModel) location: variable object of type java.lang.Object

Views

3.0K

Likes

0

Replies

4
Re: Splecial characters in RTE are displayed differently after conversion to JSON view
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
I have followed to crate similar servlet, I am getting error at json = object.writeValueAsString(answerModel); for writeValueAsString@SlingServlet(resourceTypes = {AHMJsonServiceConstants.ANSWER_RT},selectors = "servlet",extensions = "json",methods = "GET")public class ContentServlet extends SlingSafeMethodsServlet {private static final long serialVersionUID = -1765279544984834180L;private static Logger LOG = LoggerFactory.getLogger(AnswerModel.class);@Override protected void doGet(SlingHttpServ...

Views

3.0K

Likes

0

Replies

6
Splecial characters in RTE are displayed differently after conversion to JSON view
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
1. Created a custom component dialog, which has field='Answer Text' with richtext field2. Gave Special characters as input3. Create Sling Model Exporter for JSON output@PostConstructpublic void invokepost() {if (answerText != null && !answerText.isEmpty()) {answerText = formatAnswerRTEText(answerText);}}// In this method, rteText is passed as a parameter which needs to be trimmed and covered with double quotes and remove all the new lines in the textprivate String formatAnswerRTEText(String rteT...

Views

3.5K

Likes

0

Replies

12
Re: Resource Mapping
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager

Views

5.7K

Likes

0

Replies

2
Resource Mapping
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
Scenario: For folders under /content/folderAAA/folderBBBI have mapped "sling:internalRedirect = /content/folderAAA/folderBBB/$1/jcr:content.dt.json" to "sling:match = localhost.4502/folderAAA/en-us/(.+)"Could anyone please provide solution on how to map content under both "/content/folderAAA/folderBBB" and "/content/folderAAA/folderBBB/folderCCC" to "sling:match = localhost.4502/folderAAA/en-us/(.+)"

Views

6.0K

Likes

0

Replies

4
Re: Sling Model Exporter
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
I had posted different code. Please let me know the updates I need for the below code.Here I'm checking for formID to be null or empty, I think, I also need to check for duplicate ID@PostConstructprotected void invokePost() {Node jcrNode = null;Node currentNode = resource.adaptTo(Node.class);PageManager pageManager = resource.getResourceResolver().adaptTo(PageManager.class);if (pageManager != null) {jcrNode = pageManager.getContainingPage(resource).getContentResource().adaptTo(Node.class);}try {...

Views

2.3K

Likes

0

Replies

2
Re: Sling Model Exporter
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
Could you please explain with my code.

Views

2.3K

Likes

0

Replies

4
Sling Model Exporter
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
I have a sling model exporter to generate IDs for pages created in AEM.Issue: When I create pages under new folders, duplicate IDs is generated.Eg: "Folder 1 has page with ID 1234, If page is created under Folder 2, it also has ID 1234"I want to generate Unique IDs for every page created, irrespective of folder.Please help me if anything to be changed in my code.My Code:public class SequentialNumberImpl implements SequentialNumberService {private static Logger log = LoggerFactory.getLogger(Seque...

Views

2.6K

Likes

0

Replies

7
Re: JSON output for a page with different components
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
Created a Page using Template having pathParsys, pathParsys allow component A multiple times. Component A has componentParsys, componentParsys allow component B, component C, component D, component E, component F, component G, component H multiple times. Component C & Component D are configured with 1 default Answer component and have answerParsys (to add additional answer components), answerParsys allow Answer component multiple times. Component H is configured with 2 default Answer componentsN...

Views

2.9K

Likes

0

Replies

1
Re: JSON output for a page with different components
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
Thanks Donald,My requirement is, export JSON forpage with contentParsys [allow only 1 component with componentsParsys],componentsParsys allow multiple components [components without parsys & components with answerParsys] multiple times,answerParsys allow only multiple Answer components.The complexity of this requirement is confusing me.

Views

2.9K

Likes

0

Replies

3
Re: JSON output for a page with different components
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
I appreciate the help guys. I could not relate the concepts present at links provided to my requirement.It would be nice to have a code preview for point 1 or 2.

Views

2.9K

Likes

0

Replies

5
JSON output for a page with different components
Avatar
Ignite 10
Level 2
rajareddych
Level 2

Likes

0 likes

Total Posts

25 posts

Correct reply

1 solution
Top badges earned
Ignite 10
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
rajareddych
- Adobe Experience Manager
Could you please help me in writing Sling Model for generating custom JSON for1. Component with parsys (components can be added in parsys)2. Page level (with all the components and sub-components added)Any code example would help a lot.Thanks

Views

3.5K

Likes

0

Replies

9