Menu

List of all the AEM components

List of all the AEM component and detail of that component and where all this component is being used.

First, navigate to the components path using the below URI.
http://localhost:4502/libs/wcm/core/content/sites/components.html

From right-hand side apply the filters on the basis of site path and group to get the filtered list of components.
http://localhost:4502/libs/wcm/core/content/sites/components.html
Components in AEM

From the filtered list select your component or click on the name of the component to open the detail of that component in AEM.


Now move to Live usage tab to view the list of pages where this component is dropped.


How to create session from resourceResolver object?

Sometimes we need a session to work with some special JCR API which we can,t use with the help of resourceResolver then we can create an instance of a session in the same class file using the object of resourceResolver. Below is the code snippet.

First, we need to inject the ResourceResolverFactory interface to create a new resourceResolver in AEM. You could inject using the SCR annotation @Reference or Sling Model annotation @Inject.
@Reference
private ResourceResolverFactory resolverFactory;
Now create the ResourceResolver object using resourceResolverFactory. This line of code will create a rsourceResolver with administrator login.
ResourceResolver resourceResolver=resolverFactory.getServiceResourceResolver(null);
Now will create the instance of Session using the object of resourceResolver.
Session session = resourceResolver.adaptTo(Session.class);

How to run a Java Application or program without main method?

Below is the code snippet to execute and run a java program without main method.


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
package rashid.jorvee;

import javafx.stage.Stage;

public class RunAJavaApplicationWithoutMainMethod extends javafx.application.Application {
 
 @Override
 public void start(Stage primaryStage) throws Exception {
  System.out.println("Running Application!!!");
 }
}