Requirements
1. AEM Perspective
From the menu, select Window > Perspective > Open Perspective > AEM
2. Create New Sling Content Project
From the menu, select File > New > Project > Sling > Sling Content Project
- Download and install Eclipse IDE for Java EE Developers (Eclipse Kepler or newer), eclipse.org/downloads/packages/release
- Install AEM Developer Tools For more information, helpx.adobe.com/experience-manager/6-4/sites/developing/using/aem-eclipse.html
1. AEM Perspective
From the menu, select Window > Perspective > Open Perspective > AEM
2. Create New Sling Content Project
From the menu, select File > New > Project > Sling > Sling Content Project
check "Show All Wizards" if needed
3. Select or Create the AEM Server when prompted, or right-click in the Servers panel and select New > Server > Adobe Experience Manager. The defaults should work fine for a localhost AEM server instance using the default admin account credentials.
If your AEM instance is running in a Virtual Machine (VM), you may want to update your host's file to map a hostname to the machine's IP address. For example, 192.168.122.111 aem-box
4. Resources
If you did not add a server during the project creation wizard or need to add a project resource.
In the Servers panel,
Right-click on the server,
Select Add and Remove,
Drag the available resource to the configured column,
e.g., add myproject
5. AEM Console
From the Open Console menu (red circle in the image below), select the AEM Console to monitor the server startup synchronization and subsequent file transfers.
In the Servers panel, right-click on the server to start or stop as needed.
AEM Eclipse Perspective and Open Console Menu
By default, the Project Workspace tab neglects to show .content.xml files imported from the JCR. This can be changed using the Menu dropdown within the panel. Select Filters and Customization to open the dialog to configure what files to show.
I prefer to add the Navigator panel to the perspective and use it instead since it will show all of my files and folders without any modifications.
Adding Navigator to the Perspective
To transfer files and folders to the AEM server, right-click the file or folder and select Export to server. This can be done in either the Navigator or Project panels. The Sling Repository Export dialog will prompt you for the Repository to export content. Typically this will match the name of the configured AEM server.
To transfer files and folders from the AEM Server, right-click the file or folder and select Import from the server.
If you receive this error when you attempt to import/export
No valid filter found in this project!
Delete the project from the workspace using the Project Explorer in Eclipse. Then re-create it using the wizard. Ignore the message that a jcr_root already exists if your project is linked, it is a symlink.
To automatically transfer saved file changes to the server, check the Server Publishing settings. Options are:
- Never publish automatically
- Automatically publish when resources change
- Automatically publish after build event
Folders and Files Created with CRXDE Lite
For folders, files, and nodes that have been created within CRXDE Lite and do not yet have a respective Sling Content project in Eclipse. Here are some tips on how to import these from the JCR.
1. Create New Sling Content Project as described under Setup > Step 2 above.
2. Edit the filter.xml file in META-INF/vault to include the JCR repository folder paths as needed. e.g.,
<workspaceFilter vesion="1.0">
<filter root="/apps/myproject"/>
<filter root="/content/my-project"/>
</workspaceFilter>
3. In the New Sling Content Project jcr_root folder, rename the example folders under apps and content with the names used in your CRXDE Lite project as needed.
4. You should now be able to right-click on the folders and select Sling > Import from the server…
Project Linking
You may have an existing AEM repo and/or project folder that you prefer not to move into the eclipse workspace. These steps will show you how to link them to the new Sling Content Project created above.
When creating your project using the wizard, consider giving it the same name as the existing AEM project folder you are linking. If you rename the project created by the wizard, you may need to re-attach it to the server. Right-click in the Servers panel and select Add and Remove.
You may have an existing AEM repo and/or project folder that you prefer not to move into the eclipse workspace. These steps will show you how to link them to the new Sling Content Project created above.
When creating your project using the wizard, consider giving it the same name as the existing AEM project folder you are linking. If you rename the project created by the wizard, you may need to re-attach it to the server. Right-click in the Servers panel and select Add and Remove.
To link an existing AEM project which should already have its own jcr_root and META-INF folders. Remove the jcr_root and META-INF folders created by the wizard if they already exist in the source project. For example,
cd ~/eclipse-workspace/myproject
rm -rf jcr_root
rm -rf META-INF
Symlink the new eclipse-workspace project to the existing AEM project jcr_root. For example, if your existing project jcr_root is in /home/dinesh/dev/aem/myproject/src/main/content/jcr_root
cd ~/eclipse-workspace/myproject
ln -sv /home/dinesh/dev/aem/myproject/src/main/content/jcr_root jcr_root
Repeat for META-INF
ln -sv /home/dinesh/dev/aem/myproject/src/main/content/META-INF META-INF
Components
This example shows how to create components.
In the Project panel, expand the myproject > jcr_root[nt:folder].
Right-click on the /apps/example folder and select New > node.
name: components
ln -sv /home/dinesh/dev/aem/myproject/src/main/content/META-INF META-INF
Components
This example shows how to create components.
In the Project panel, expand the myproject > jcr_root[nt:folder].
Right-click on the /apps/example folder and select New > node.
New node menu
name: components
New nt:folder node
If you get this error: Unable to validate node types since project myproject is not associated with a server or the server is not started. Start the server and/or verify the project is a configured resource.
Right-click on the new components folder and select New > node.
New cq:component node
name: title
Proxy Components
For the new title component, we’re going to use the Proxy Component Pattern. For more info, Create Proxy Components contains further documentation on using core components.
Select the title component to enable its context in the JCR Properties panel. Select the green plus sign to insert a property.
Add the following property to use the title core component version v1 with the super-type.
Name: sling:resourceSuperType
Value: core/wcm/components/title/v1/title
Periodically export to the AEM JCR to verify and test your code changes.
Source: https://jimfrenette.com/aem/eclipse-developer-tools/
For the new title component, we’re going to use the Proxy Component Pattern. For more info, Create Proxy Components contains further documentation on using core components.
Select the title component to enable its context in the JCR Properties panel. Select the green plus sign to insert a property.
JCR Properties panel - insert a property
Add the following property to use the title core component version v1 with the super-type.
Name: sling:resourceSuperType
Value: core/wcm/components/title/v1/title
Periodically export to the AEM JCR to verify and test your code changes.
Source: https://jimfrenette.com/aem/eclipse-developer-tools/
No comments:
Post a Comment
If you have any doubts or questions, please let us know.