Sunday, November 5, 2017

Url mapping in AEM

Step1: We need to change the resource resolver configuration and add a new parameter in the url mapping. /content/ProjectName/en/-/. It will shorten the url in application by removing /content/Projectname/en.

Step2: To redirect request path to target path I have added sling:mapping in etc/map/http
Created a node with internal_redirect of jcr:primaryType:sling:mapping
Add the properties
sling:redirect/requestpath
sling:match [^/]+/targetPath

Step3: I have created a vanitypath property in /content/requestpagepath/jcr:content.
sling:vanityPath: /vanityname

testing

Sidekick Workflow tab Issue / Workflow tab is coming blank

widgets.js:163768 Uncaught TypeError: Cannot read property 'wcm' of undefined . 
The problem occurs when we are upgrading from 5.6, 6.0 to uppper version of aem or install service pack. i have resolved this issue by overlaying the sidekick.js and then inside there is method loadWorflowtab.
In that please change the line 
var pageInfo=CQ.WCM.getPageInfo(this.getPath(), true).
It will resolve the problem

Wednesday, February 3, 2016

How to use getAdministrativeResourceResolver()

Problem: How to use getAdministrativeResourceResolver() in AEM 6.0 and above. Since method has been deprecated.


Solutions : 
You have to create a system user (rep:SystemUser) and need to assign the admin privileges. then we will use this user to get the admin resolver.

Below follow the below steps to get resolver.

1.   Go to Felix Console configuration tab i.e. http://localhost:4502/system/console/configMgr

2. Search for User Mapping as shown in figure-
Adobe Configuration Manager
User Mapper Configuration



1.   Click on this service to edit it’s configuration.
Here you have to add one entry and the syntax of the entry is –
“Bundle symbolic Name”:”SubServieName”=”User Name”

1. “Bundle symbolic Name :-  Here you have to add the bundle symbolic name where you are creating service.

2. “SubServieName”:- This is the name you provided as a value of  ResourceResolverFactory.SUBSERVICE property i.e. “testService”.

3. “User Name” :- This  is the user name for ex. “admin”So in my case this configuration field value becomes“com.blog.blog-bundles:testService=admin”

After adding this entry your configuration looks like-

User Mapper Configuration







For creating System User, follow these steps-
2.   Login as Administrator i.e. using “admin:admin”
3.   Click on “User Administration”, you will see a screen just like this –



System admin user
rep:SystemUser

4.   Here you will see a option of “Create System User”, Click on this button.
5.   Add a value for User Id field for ex. “AdminUser”
6.   Click on green button.
7.   Close the window.

8.   Go to CRXDE Lite, your “AdminUser” will be created under /home/system directory. If you are not able to find then search for “AdminUser” in home screen. You will get the location.