Developing with CRXDE Lite

This section describes how to develop your AEM application using CRXDE Lite.

Please refer to the overview documentation for more information on the different development environments that are available.

CRXDE Lite is embedded into AEM and enables you to perform standard development tasks in the browser. With CRXDE Lite, you can create a project, create and edit files (like .jsp and .java), folders, templates, components, dialogs, nodes, properties and bundles while logging and integrating with SVN.
CRXDE Lite is recommended when you do not have direct access to the AEM server, when you develop an application by extending or modifying the out-of-the-box components and Java bundles or when you do not need a dedicated debugger, code completion and syntax highlighting.

ملاحظة:

By default, all AEM users can access CRXDE Lite. If desired, configure ACLs for the following node so that only developers can access CRX DE Lite:

Getting Started with CRXDE Lite

In your browser, enter http://<host>:<port>/crx/de. By default it is http://localhost:4502/crx/de.

Enter your username and password. By default it is admin and admin.

Click OK.

The CRXDE Lite User Interface looks as follows in your browser:

You can now use CRXDE Lite to develop your application.

Overview of the User Interface

CRXDE Lite offers the following functionality:

Top switcher bar

Allows you to quickly switch between CRXDE Lite, Package Manager, and Package Share.

Node path widget

Displays the path to the currently selected node.

You can also use it to jump to a node, by entering the path by hand, or pasting it from somewhere else, and hitting Enter.

It also provides support for looking for nodes with specific node name. Enter the name of the node you would like to find, and wait (or hit the search symbol on the right-hand side). You can try entering, e.g., the string oak into the widget to see how it works. If a given node or nodes is loaded into the explorer pane, the list will be displayed, and you can select the path and hit Enter to navigate to it. Note that it only works for the nodes currently loaded into the CRXDE client application in browser. If you want to search the whole repository, use Tools, then Query.

Explorer pane

Displays a tree of all the nodes in the repository.

Click a node to display its properties in the Properties tab. After clicking a node, you can select an action in the toolbar. Click the node again to rename it.

Tree Navigation Filter (binocular icon): enables you to filter the nodes in the repository for which the name contains the input text. It only applies to nodes that have been loaded locally.

Double-click a file in the Explorer pane to display its content; like for example a .jsp or a .java file. You can then modify it and save the changes.

Once a file is edited in the Edit pane, the following tools are available on the toolbar:

- Show in tree: shows the file in the repository tree.
- Search/Replace ...: do search or replace.

Double-click on the status line of the Edit pane opens the Go to line dialog so you can enter a specific line number to go to.

Properties tab

Displays the properties of the node that you have selected. You can add new properties or delete existing ones.

Access Control tab

Display permissions based on current path, repository-level or principal.

The permissions are broken down into

- Applicable Access Control Policy: The policies that can be applied to the current selection.

- Local Access Control Policies: The current policies applied locally to the current selection.

- Effective Access Control Policies: The current policies applied for the current selection, might be set locally or inherited from parent nodes.

Note. To be able to see the Access Control information at all, the user logged in to CRXDE Lite must have rights to read ACL entries. The anonymous user cannot see this information by default - please log in as, e.g., admin to see the information.

Replication tab

Display the replication status of current node. You can replicate and replicate delete the current node.

Console tab

Server Logs:

Displays logs messages. You can configure the log level, clear the console, pin at the selected scroll position and enable/disable the displaying of messages.

Version Control:

Displays version control messages.

Build Info tab

Displays information when a bundle is being built.

Refresh

Refreshes the current selection. Changes from other users are updated in your view of the repository. Changes you have made are unaffected.

Save All

Save All:

Saves all the changes you have made. Until you click save, the changes are temporary, and will be lost when you exit the console.

Revert:

Discards all the changes that you have made on the selected node since the last save action, then reloads the current state of the repository for the selected node.

Revert All:

Discards all the changes that you have made throughout the entire repository since the last save action, then reloads the current state of the repository.

Create ...

Drop-down menu to create the following under the selected node:

- Node: a node with an arbitrary node type

- File: nt:file node and its nt:resource subnode

- Folder: nt:folder node

- Template: AEM template

- Component: AEM component

- Dialog: AEM dialog

Delete

Deletes the selected node.

Copy

Copies the selected node.

Paste

Pastes the copied node under the selected node.

Move ...

Moves the selected node to the node that is set through the dialog.

Rename ...

Renames the selected node.

Mixins ...

Allows you to add mixin types to the node type. The mixin types are mostly used to add advanced features such as versioning, access control, referencing, and locking to the node.

Team

Drop-down menu to perform standard version control tasks:

- Update repository from SVN server

- Commit local changes to SVN server

- View Status of the current node

- View Recursive Status of the subtree of the current node

- Checkout a working copy from SVN server

- Export a project from SVN server (without creating a working copy)

- Import a project from repository to SVN server

Note you need to be logged in as user with sufficient permissions to be able to execute some of the tasks (especially the ones that write to the local repository).

Tools

Drop-down menu with the following tools:

- Server Config ...: to access the Felix Console.

- Query ...: to query the repository.

- Privileges ...: to open privilege management, where you can view and add privileges.

- Test Access Control ...: a place where you can test the permission for certain path and/or principal.

- Export Node Type: to export node types in the system as cnd notation.

- Import Node Type ...: to import node types using cnd notation.

- Import Site ...: opens the Site Importer tool to import an existing site into AEM

Displays the currently logged-in users and the workspace they are logged into, e.g., admin@crx.default.

Click it to log in or re-login as a specific user. If you don't specify a workspace to log in to, you will be logged into the default workspace, crx.default.

If you want to browse the repository as Anonymous user, use anonymous as the login name, and any password (e.g., a space or a dot).

If your authorization is no longer valid (e.g., it is expired), the login widget displays "Unauthorized - Login...". Click it to log in again.

Creating a Project

With CRXDE Lite you can create a working project in three clicks. The project wizard creates a new project under /apps, some content under /content and a package wrapping all the project the content under /etc/packages. The project can be used right away to render a sample page displaying Hello World, based on a jsp script that renders a property from the repository and calls a Java class to render some text.

To create a project with CRXDE Lite:

Open CRXDE Lite in your browser.

In the Navigation pane, right-click a node, select Create ..., then Create Project ....
Note: you can right-click any node in the tree navigation, as the new project nodes are, by design, created below /apps,/content and /etc/packages.

Define:

Project Name - the project name is used to create the new nodes and the bundle, e.g. myproject.

The Hello World page is based on a content node, that calls a jsp script through the sling:resourceType property. The script reads the jcr:title property from the repository and gets the body content by calling a method of the SampleUtil class, that is available in the project bundle.

The following nodes are created:

/apps/<project-name>: the application container.

/apps/<project-name>/components: the components container, containing the sample html.jsp file, used to render a page.

/etc/packages/<java-suffix>/<project-name>.zip, a package wrapping all the project app and content. You can use it to rebuild the project for further deployment (e.g. to other environments) or for sharing through Package Share.

The structure looks as follows in CRXDE Lite with a project called myproject and a java package suffix called mycompany:

Creating a Folder

To create a folder with CRXDE Lite:

Open CRXDE Lite in your browser.

In the Navigation pane, right-click the folder under which you want to create the new folder, select Create ..., then Create Folder ....

Enter the folder Name and click OK.

Click Save All to save the changes on the server.

Creating a Template

To create a template with CRXDE Lite:

Open CRXDE Lite in your browser.

In the Navigation pane, right-click the folder where you want to create the template, select Create ..., then Create Template ....

You can now adapt the dialog to your needs by modifying properties or creating new nodes.

You can also use the Dialog Editor to edit a dialog. Double clicking the dialog node in CRXDE Lite will bring up the editor. More information about the Dialog Editor can be found here.

Creating a Node

To create a node with CRXDE Lite:

Open CRXDE Lite in your browser.

In the Navigation pane, right-click the node where you want to create the new node, select Create ..., then Create Node ....

Enter the Name and the Type. Click OK.

Click Save All to save the changes on the server.

You can now adapt the node to your needs by modifying properties or creating new nodes.

ملاحظة:

Most of the edit operations, including Create Node, keeps all the changes in memory, and only stores them into the repository upon saving (via the "Save All" button).

The validation with regard to whether the newly created node is allowed by the node type of the parent node is also carried out by the JCR repository first when saving changes. If you receive an error message while saving a node, please check, whether the content structure is valid (e.g., you cannot create an nt:unstructured node as a child of nt:folder node).

Creating a Property

To create a property with CRXDE Lite:

Open CRXDE Lite in your browser.

In the Navigation pane, select the node where you want to add the new property.

In the Properties tab in the bottom pane, enter the Name, the Type and the Value. Click Add.

Click Save All to save the changes on the server.

Creating a Script

To create a new script:

Open CRXDE Lite in your browser.

In the Navigation pane, right-click the component where you want to create the script, select Create ..., then Create File ....

Enter the File Name including its extension. Click OK.

The new file opens as a tab in the Edit pane.

Edit the file.

Click Save All to save the changes.

Managing a Bundle

With CRXDE Lite, it is straightforward to create an OSGI bundle, add Java classes to it, and build it. The bundle is then automatically installed and started in the OSGI container.

This section describes how to create a Test bundle with a HelloWorld Java class that displays Hello World! in your browser when the resource is requested.

Creating a Bundle

To create the Test bundle with CRXDE Lite:

In CRXDE Lite create myapp project with the project wizard. Among others the following nodes are created: