Menu

AEM as cloud service, /apps and /libs directories are in ready only mode

AEM cloud service makes the out of the box and custom codes immutable. Once we deployed the code in AEM server, we will not be able to modify or create any content or node under the /apps and /libs directories using CRXDE Lite. When we try to do so, then it will throw an error "Could not save changes. Received 500 () for saving changes in workspace crx.default. Unknown error (Error Code: 500) OR Could not save changes. Received 409 () for saving changes in workspace crx.default. org.apache.jackrabbit.oak.spi.state.ReadyOnlyBuilderException: This builder is read-only.". Below is the screenshot, when we tried creating a folder "myProject" under /apps folder.

AEM as cloud service, could not save changes


The only way to change the code is go for a fresh build and deploy the code. You may read more about mutable and immutable concept and could service project structure in our previous post Package shouldn't contain mutable and Immutable content. [https://rashidjorvee.blogspot.com/2020/07/aem-cloud-service-ImmutableMutableMixedPackage.html]

Hope this helps you!

References:

Why people consume too much spices, specially those who are living in high temperature region? | ABOUT SPICES

Different kind of Spices
Those of us who don't live in desert countries or in extreme temperatures tend to think that a refreshing drink is a good solution to relieve heat. 
And it is curious from a distance to observe how the gastronomy of those countries is rich in spices and spicy flavors. 
What seems contradictory has a scientific and physiological explanation. 

I'm Spanish. I have always had the desire to know India and immerse myself in its smells, colors and enjoy the hospitality of its people. My friends told me: “it is very hot there! You won't resist it! ” 
But I am a curious person and I started to investigate. 
Although in many articles I read that the best thing to do was to hydrate yourself abundantly, I found in a scientific magazine what was going to answer not only my foreseeable problems with heat but also the reason for the success of spicy foods in India. 

It seems that taking spices and hot peppers increases the internal heat of the organism until they equal it with that of the environment. 
This stimulates blood circulation and produces more sweat, the evaporation of which helps us to cool down. 

Perhaps you, Indian readers, don't think while you are cooking that your preference for these flavors comes from an ancient custom. 
Rather we would be talking about how their ancestors searched in nature for a way to combat the heat without having to consult Google.

Git diff is showing complete file content as changed but there is only few line of changes in file.

This is expected behavior of Git diff and there is nothing wrong in this case. See the issue 52036
When we look the plain diff, we can see that, the old content used Windows style line endings (CR LF), whereas the new content is stored with Unix style line endings (LF).
>> old style.scss file content
Line 1 CR LF
Line 2 CR LF 
>> new style.scss file content
Line 1 LF
Line 2 LF 
We may skip those white space changes from compression using GitLab or Git via UI or command line. 
Steps to hide/ignore white space changes from git diff.
  1. Go to your merge request.
  2. Navigate to change between section.
  3. Click on the setting button, from right side of "change between section"
  4. Unchecked the option "Show whitespace changes"
After doing this you the compare section will show only real changes. Below is the screenshot which you refer.
Show-whitespace-changes-git-diff


We can also see the exact diff using ignore space command
git diff --ignore-space-at-eol

References

AEM Cloud Service deployment issue | Packages shouldn't mix mutable and immutable content

While deploying our old Adobe Experience Manager(AEM) code to AEM cloud service, we find some code smell issues,
ImmutableMutableMixedPackage in project build issue report. We will understand this issue here and also look how to fix this code issue from project.

Lets first understand what part of our AEM project is mutable and immutable.

Mutable

/content , /conf , /var , /etc , /oak:index , /system , /tmp , etc. are all mutable areas of AEM project, it means they can be changed at runtime.

Immutable

/apps and /libs are considered immutable areas of AEM as they cannot be changed and we are not allowed to perform CUD(create, update, delete) operation at runtime. Any attempt to change an immutable area at runtime will fail. On immutable areas we can only perform the read operation.

Issue Description


In order to make our project compatible with Cloud Service deployment model, individual content packages must contain either content for the immutable areas of the repository (that is, /apps and /libs, although /libs should not and never be modified by custom code and will cause a separate violation) or the mutable area (that is, everything else), but not both. For example, a package which includes both /apps/myproject/components/text and /etc/clientlibs/myproject is not compatible with Cloud Service and will cause an issue to be reported.
When we try to edit file under /apps directory and save, aem will not allow and show error message "Could not save changes. Received 409 () for saving changes in workspace crx.default. org.apache.jackrabbit.oak.spi.state.ReadyOnlyBuilderException: This builder is read-only."

Who bring the Coffee to India?

Coffee is a middle eastern drink prepare from Coffee beans. Coffee came in India in 16th century, when a Sufi saint Baba Budan. When he was returning from Hajj, he brings seven raw seeds of Coffee from a port of Yemen, so he can plant in India. Later he planted those beans near to his khanqah in Chandragiri Hills. 
Baba Budan shrine[Bababudangiri shrine] is located in southern part of India in Chikmagaluru District of state of Karnataka.

References:

  1. History of Coffee in India
  2. How coffee came to India?
  3. Coffee origin in India
  4. Coffee production in India | Wikipedia
  5. Sufi Saint Baba Budan

Roasted Coffee beans
Roasted coffee beans

"Right to THINK" a Human Rights

No one have right to force his/her own feeling and decision on others. every people have their own logic and aspect of thinking(except minors). Weather that person is illiterate or educated, the power of thinking, thought and decision making human received from the nature and even animals and birds can think and used to take decision, what is good and bad for them and their life.
You can't force someone to follow your decision, better you let that person understand and give some facts and valid reason to he/she could come to your decision of next to your decision.

Right to think and expression is a human rights and also the fundamental rights given by the constitution of a state. Every person shall have the equal rights to take his or her own decisions but make sure that, those decision should not harm others and violent the rights of others, if it does so then it will become a crime.

How to search the content only from the specified directory using AEM query builder?

Using the AEM query builder, will search a content which is available in specified directory only. This query will not search the content in sub directories, or not even child of the child directories. 

Open AEM Query Builder Debuggerhttp://localhost:4502/libs/cq/search/content/querydebug.html. Add the following options to perform the search.
path=/content/dam/we-retail/en/features

path.flat=true
type=dam:Asset
fulltext=cart

Filters definition:

  • path=? // On which path this query will perform the search operation.
  • path.flat=true // will look the content only in the specified directory.
  • fulltext=? //name or keyword which you are searching.

find-direct-children-in-aem-using-query-builder
find direct children using query builder

Query tree + URLs

ROOT=group: [
{fulltext=fulltext: fulltext=cart}
{path=path: path=/content/dam/we-retail/en/features, flat=true}
{type=type: type=dam:Asset}
]

XPath query to find the direct child in a directory

/jcr:root/content/dam/we-retail/en/features/element(*, dam:Asset)
[
(jcr:contains(., 'cart'))

]

JSON response 

You can get the JSON response of this query using this URL: (Note: update the domain(localhost:4502) to browse the url for your AEM instance)


Response:
{
  "success": true,
  "results": 1,
  "total": 1,
  "more": false,
  "offset": 0,
  "hits": [
    {
      "path": "/content/dam/we-retail/en/features/cart.png",
      "excerpt": "/content/dam/we-retail/en/features/cart.png",
      "name": "cart.png",
      "title": "cart.png",
      "lastModified": "2016-06-06 16:26:05"
    }
  ]
}

Configure and start remote debugger in Eclipse

Set the remote debugger configuration in Eclipse, to debug the running application code and identify the code issues.

Step 1: Open the Debug perspective from tool bar. if you don't see debug perspective option in your toolbar, then open the perspective from this path in Eclipse. 
Windows >> Perspective >> Open perspective >> Others >> Debug  
  1. Click on the perspective drop-down option very next to bug symbol.
  2. Select the option Debug configuration

Debug Configuration in Eclipse
Debug Configuration in Eclipse
Step 2: Debug Configuration will open a new window(below is the screenshot).
  1. Click on Remote Java Application option from left side rail.
  2. Click on the New Launch configuration(new configuration) button. As shown in the screenshot below.

Remote Java Application setup
Remote Java Application setup

Step 3: Once you click on new configuration button, a configuration setup option will appear right side on same window. Switch to connect tab, if you are not on the connect tab by default.
  1. In Name section, please provide a valid name.
  2. In Connection Properties section specify the host and port on which your application is running. 
    e.g. 
    Host: localhost
    Port: 30303 (default AEM debug mode port)
  3. Project: Select the core folder of your project.
  4. Connection type: Keep it as Standard.

Debugger remote connection setup
Debugger remote connection setup

Step 4: Now switch to source tab, next to connect and configure your Java project. Below is the screenshot.

  1. Switch to source tab
  2. Click on Add option
  3. Select Java Project option
  4. Hit Ok button
  5. Select your project 
  6. Hit Ok button
  7. After successful selection your project get added in the source section.  

Debug project setup in Eclipse
Debug project setup in Eclipse

You have successfully setup the debugger with your remote application. Now run or tune your application in debug mode and start the debugger in Eclipse from debug perspective to listen the request from your application server to Eclipse.

How to export the list of users from AEM?

To manage the user and security purpose, we always need the list of available and active users in our system for analysis. Adobe Experience Manager(AEM) also have an in build user management section to manage the AEM user and make the things secure. In this article we will export or generate the list of available user from AEM in an excel file. To perform this activity we will use the ACS commons. ACS commons provide so many powerful tools, which is easy to use and easily plug-able on AEM, by installing ACS commons package.

Prerequisite:

ACS commons should be installed in your AEM instance. If you don't have latest ACS commons installed in your AEM instance, then you can easily and free download the ACS package from here and install the package in your AEM instance using package manager.

Now we will perform the following steps to export the user list from AEM.

Step 1: Open the URL <domain>/miscadmin#/etc/acs-commons/exporters
If you are running on your local machine then; e.g. http://localhost:4502/miscadmin#/etc/acs-commons/exporters

Go to Tools >> acs-commons >> Exporters from left side rail. Below is the screenshot of steps.

  1. Click on the Exporter folder
  2. Click on New >> New Page
  3. Create a page with any title using the default selected template(User to CSV Exporter).
  4. Click on create button.
This will create a new page under the exporter directory. Open the newly created page by double clicking on that page name.

Export users and groups list in AEM
Export User list in AEM

Step 2: Your Page will now look like this(below screenshot). From here you may add or remove the user profile properties, which you want to export and get appended in your exported CSV file.

Add Custom Property will let you add user properties (Relative path from the [rep:User] node). if you don't know the path and property name then you may refer the CRXDE-Lite to get the exact path and property name.(Below is the screenshot)
Custom user properties- user list export
Custom user properties

Screenshot to get the property name from crx/de. e.g designation, familyName
Screenshot to get the property name from crx/de. e.g designation, familyName
User profile section in CRXDE

Step 3:
Now Select the group membership the way which you want to export. Using 
Only Include Users by Group Membership option.

  1. Direct Membership : Only the direct member of groups.
  2. Indirect Membership: Only Indirect member of groups, means a group which is member of another group.
  3. Direct and Indirect Membership: Both direct and indirect membership.
Only Include Users by Group Membership option
Only Include Users by Group Membership option

Step 4: Now select all those groups whose members and user you want to export using Filter by Group option.(Select none for all groups). 
Download User CSV Report in AEM
Download User CSV Report
Step 5: After selecting the all groups click on the Download User CSV Report button to download the csv file.

You may also save the configuration for later use using the save configuration button.


References: