Monday, 11 July 2016

Root Mapping Configuration in Adobe CQ5

In Adobe AEM, As we see that if we hit http://<host>:<port>/ by default it is redirected to
Author: /project.html
Publish: /content.html

Did you think about that How it works?

In this post, I will explain how it works and how we can change these URLs.

If you go to http://<host>:<port>/system/console/configMgr and search for the Day CQ Root Mapping, you would be seen like these screen:

RootMappingAuthor:



RootMappingPublish:



In author instance it is straight forward but if you see publish instance, though its configured as '/content.html' but its redirected to /content/geometrixx/en. This reason is being the 2 properties which is set for the node '/content'.

sling:resourceType as sling:redirect and
sling:target as /geohome

/geohome is set as the vanityPath for the geometixx-outdoors site,which is turn has a redirectTarget set to /content/geometrixx/en.

How to Change ?

Most likely, we would want to change the root mapping from /geohome to our own application in the publish instance and the same can be done by 2 types which are mention below:

1. /Content :

We know, in publish instance root mapping is set to /content.html. So go to the content node and change the URL for the property sling:target to your own application content node and save.


2. ConfigMgr :

Login to the config manager console directly either in author or publish which you want to change, search for the Day CQ Root Mapping and change the 'Target Path' to the page which you want to show and click on save. Next time when you access instance, it should redirect to the configured path.




Be Happy

Tuesday, 28 June 2016

Reset the forgotten password

In this post, I am going to explain "How will you reset your AEM password if you have forgotten your password."

The default password for administrator user admin is admin. If the password was changed to something else, to reset your password to admin you have to follow some steps which are mention below:
  • Stop AEM instance.
  • Place the package reset_admin_pass_to_admin.zip in <AEM Home> / crx-quickstart / install (Create it, if there isn't one). 

  • Start AEM instance.
  • Package should have installed. It contains /home/user/a/admin/.content.xml with rep:password set to text admin encrypted.


  • Login as admin/admin.

Be Happy


Friday, 24 June 2016

Change default admin password of AEM

In this blog, I am going to explain that how can we change the default admin password. Sometime my colleagues want to change the admin password so this post is very useful for those guys.

To change the admin password we have to follow some steps which are given below:
  • Open the welcome screen. (http://localhost:4502/projects.html).


  •  Click on the Tools >> Operations >> Security >> Users. You will get the below screen. 

  • Click on the administrator link and find the account setting.

  • Click on Change Password.
  • Fill all the widgets and click OK.
  • Now your password has been changed.


Be Happy


Wednesday, 22 June 2016

Create New User in AEM

In this post I will Explain how to create new User in AEM.

For creating the AEM User with specific permissions we have to follow some steps as I will explain below:
  • Open admin console of AEM.
  • Open User console from main admin console.

  • Create new user by click on Edit by selecting create >> create user:

  • Now, The new editable widget will open:

  • Enter the Login ID, First Name, Last Name, Password, Confirm Password whatever you want.
  • Like, I will create the user with the name content-author.
  • Search the ID from the user list and click on that.
  • In the right hand side of the user list, user details screen will appear.
  • click the permission tab from the user details screen.
  • Select the permissions which we want to give the content-author.
  • If we want to give the permissions to content-author of read, modify, create and delete than we have to select only these same.
  • Now, content-author can read, modify, create and delete under apps, content, etc, home, libs, system,temp and var directory.
  • But, If you want to give the permission to content-author only for content modify, create and delete than you have to tick only on content.Like this:


  • Click Create.
  • Now, login with the new user and you will see that this user can only that things which you gave the permission to this user.

Be Happy

Tuesday, 14 June 2016

Renditions Creation for the Image

In this post, I will explain how to create different type of renditions for the image in Adobe CQ5.

When we upload the images in the DAM, Adobe CQ5 creates the renditions of an image that includes different size of the same image. This can be helpful when we need to create thumbnails or similar views of large or high resolution images.




If we want to create the renditions according to us than we have to configure the DAM Asset workflow.

For this, We have to go this path:

http://localhost:4502/etc/workflow/models/dam/update_asset.html

At this path we will see the page like this image-



Now, Go to the edit mode and double click on the thumbnail creation step.


After click the thumbnail creation step, We will find a pop up like this:-


Now, We have to go on process tab, in the process tab of the step we can add custom rendition values. After this save the workflow.


 
Now, while uploading the image, the configured thumbnails will be created.



Be Happy

Sunday, 23 August 2015

Custom ComboBox with Dynamically Generated option value by the Servlet

In this post, I will explain how to create ComboBox with Dynamically generated option value in AEM6 dialog?
Let's see with the example:-



I created a dialog with a tab named as tab1. Under this node, I created a node named as items with the property jcr:primaryType = cq:widgetCollection.Under this node, I created a node named as comboBox with the property jcr:primaryType = cq:widget as shown in figure-



Now set the properties of this node as shown in figure-


For creating a comboBox, I used these properties-
type=select
xtype=selection









All other properties are explained below-

allowBlank = It restricts you from submitting the dialog without selecting any option from the comboBox.

fieldLabel = Text that will be shown before comboBox.

options = This property is used to define the servlet path that returns the JSON. This JSON will act as the option value for the comboBox. In my case it's value is /bin/page.html that returns a JSON as shown below-

{"1":[{"path":"/content/geometrixx/en/toolbar/contacts","title":"Contact"},{"path":"/content/geometrixx/en/toolbar/feedback","title":"Feedback"},{"path":"/content/geometrixx/en/toolbar/newsletter","title":"Newsletter"}]}


optionsRoot  = This property defines what property of the given JSON act as the source of options for this comboBox. As my JSON object contains an Array corresponding to a key "1", So my optionsRoot property value will be "1".

optionsTextField =  This field represents that which key from the JSON object will be treated as an options text values i.e. The text that will be displayed in the comboBox.

optionsValueField - This field represents that which key from the JSON object will be treated as the value of that option i.e. On selecting a value from comboBox what will be returned to the server.

Now, In my case the array has multiple JSON objects having two keys with corresponding values. These values are "path" & "title".
 I want to show "title" as option text value, i.e. It will be visible to the author & "path" is for returning the value to the server when user selects title value from the comboBox.
So I set these properties like this-
optionsTextField = title
optionsValueField = path

For example-
If user selects the "Contact" then "/content/geometrixx/en/toolbar/contacts" will be returned to the server for further processing.

After using all the above properties the dialog will be look like this-


NOTE:
If your servlet returns only single JSONArray and at the place of "path" and "title" are "key" and "value" like-

[{"key":"/content/geometrixx/en/toolbar/contacts","value":"Contact"},{"key":"/content/geometrixx/en/toolbar/feedback","value":"Feedback"},{"key":"/content/geometrixx/en/toolbar/newsletter","value":"Newsletter"}]
Then the last three  properties (optionsRoot, optionsTextField, optionsValueField) are not required because by default the value of optionsTextField is "key" & the value of optinosValueField is "value".

But if your JSON is in the form of like this-

{"1":[{"key":"/content/geometrixx/en/toolbar/contacts","value":"Contact"},{"key":"/content/geometrixx/en/toolbar/feedback","value":"Feedback"},{"key":"/content/geometrixx/en/toolbar/newsletter","value":"Newsletter"}]}
Then only optionsRoot value is mandatory.

But if you want to give another name at the place of "key" and "value" then, all of these three properties are mandatory.

If your JSONArray is like as-
[{"path":"/content/geometrixx/en/toolbar/contacts","title":"Contact"},{"path":"/content/geometrixx/en/toolbar/feedback","title":"Feedback"},{"path":"/content/geometrixx/en/toolbar/newsletter","title":"Newsletter"}]

Then, You have to convert your JSON in this form-

{"1":[{"path":"/content/geometrixx/en/toolbar/contacts","title":"Contact"},{"path":"/content/geometrixx/en/toolbar/feedback","title":"Feedback"},{"path":"/content/geometrixx/en/toolbar/newsletter","title":"Newsletter"}]}

Then, You can use last three properties properly.


Be Happy


Tuesday, 18 August 2015

Dispatcher Configuration on Apache2 Server

In this blog, I will explain the easiest way of dispatcher configuration on Apache2 Server and OS version Ubuntu 15.04. This configuration will also work on Ubuntu 14.04.

Let's start:-
Firstly, you have to install Apache2 server on your Ubuntu machine using this command-
sudo apt-get install apache2

Now type the command-
sudo service apache2 start

Now hit a url in a web browser-
http://localhost

You will get apache2 welcome screen as shown in figure-


Now download the dispatcher package from this link-
https://www.adobeaemcloud.com/content/companies/public/adobe/dispatcher/dispatcher.html

If you are using the apache2 version 2.4.10, you have to download dispatcher version 4.1.9
Extract this *.tar.gz file, You will get a folder named as dispatcher-apache2.4-linux-x86-64-4.1.9.

In this folder you have a file dispatcher-apache2.2-4.1.9.so file, just rename this file with dispatcher.so
The location of this file will be like as shown in figure-

Copy and paste this dispatcher.so file to /usr/lib/apache2/modules as shown in figure-


Before paste this file into this directory you have to change the permission of the directory using this command-
sudo chmod 777 -R /usr/lib/apache2/modules






Now copy an another file named as dispatcher.any file from dispatcher-apache2.4-linux-x86-64-4.1.9/conf directory and paste to the etc/apache2/conf-available directory.
Again, if you can't paste this file into this directory  you have to change the permission of the directory using this command-
sudo chmod 777 -R /etc/apache2

Now you can easily paste your file in this directory and all those directories which are placed into appache2 directory. The location of this directory is shown in figure-
"In this file you have to change the port number to 4503 as the default number 8080".





After this, you have to create a soft link of dispatcher.any file into the conf-enabled directory using this cammand-
ln -s /etc/apache2/conf-available/dispatcher.any /etc/apache2/conf-enabled/dispatcher.any



 It will look like this-









Now create a dispatcher.load file in mods-available folder and write a line in this file-
LoadModule dispatcher_module /usr/lib/apache2/modules/dispatcher.so

It will look like this-


"Note: - This file will be used to load dispatcher module on Apache2 server".

Now create a soft link in mods-enabled directory using this command-
ln -s /etc/apache2/mods-available/dispatcher.load /etc/apache2/mods-enabled/dispatcher.load

It will look like this-

Now open apache2-conf file which is placed in etc/apache2 directory and search for the Directory tag. Here you have to add one more directory tag as given below-

<Directory />
  <IfModule disp_apache2.c>
   SetHandler dispatcher-handler
  </IfModule>
  Options FollowSymLinks
  AllowOverride None
</Directory>

Now open ports.conf file & add these some line at the end of the file-

<IfModule disp_apache2.c>
     DispatcherConfig conf-enabled/dispatcher.any
     DispatcherLog    logs/dispatcher.log
     DispatcherLogLevel 3
     DispatcherNoServerHeader 0
     DispatcherDeclineRoot 0
     DispatcherUseProcessedURL 0
     DispatcherPassError 0
</IfModule>

Now go to /etc directory and open hosts file using this command-
sudo gedit /etc/hosts

Add one more line in this file-
127.0.0.1       publish.sjigaurav.com

You can add anything whatever you want at the place of publish.sjigaurav.com.

Now configuration is complete you can restart your apache2 server using this command-
sudo service apache2 restart

Go to your web browser and hit the url publish.sjigaurav.com you will find the welcome screen.
It starts successfully.



Be Happy