Skip to content

Commit 6140cf1

Browse files
authored
feat: Upload content to AEM (#11)
* Upload content package containing cq:Page(s) * Upload images using `aem-upload` * AEM credentials will be save in an encoded manner upon login.
1 parent 04db418 commit 6140cf1

10 files changed

+11159
-2851
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ node_modules
22
.idea
33
*.iml
44
coverage
5+
secret.key
6+
aem_config.json
57

68
# dotenv environment variable files
79
.env

README.md

+50
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,53 @@ Add an npm script entry to your Edge Delivery project's `package.json`:
9595
```
9696

9797
See [Import Assistant](./docs/import-assistant.md) for usage.
98+
99+
### Importing content into AEM
100+
101+
Add the npm script entries to your Edge Delivery project's `package.json`:
102+
103+
```
104+
"aem-login": "aem-import-helper aem login"
105+
"aem-upload": "aem-import-helper aem upload"
106+
```
107+
`aem-login`: Authenticates with your AEM Cloud Service environment.
108+
`aem-upload`: Uploads content packages and associated assets to AEM.
109+
110+
1. Run the following command to log in to your AEM environment::
111+
112+
```
113+
npm run aem-login -- --aemurl https://author-env-url/
114+
```
115+
116+
* You will be prompted to enter your username and password.
117+
* Once validated, your credentials will be securely stored in an encrypted format and used for future interactions.
118+
119+
```
120+
✔ Enter your AEM username: admin
121+
✔ Enter your AEM password:
122+
Validating credentials...
123+
Saving credentials...
124+
Login successful! Credentials saved securely.
125+
```
126+
127+
2. Run the following command to upload content package (JCR pages) and asociated images to your AEM author:
128+
```
129+
npm run aem-upload
130+
```
131+
132+
You’ll be prompted to provide the following details:
133+
* Absolute Path to the Content Package: Path to the .zip file containing JCR pages, generated by the importer tool.
134+
* Absolute Path to the Image Mapping File: Path to `jcr-image-mappings.json`, which contains mappings for image urls and their corresponding JCR paths.
135+
* Site Name: The site name (must match the one provided during import).
136+
137+
```
138+
Checking for credentials...
139+
✔ Enter the absolute path to the content package: /Users/maji/Desktop/test/xwalkdemo.zip
140+
✔ Enter the absolute path to the jcr-image-mappings.json file: /Users/maji/Desktop/test/jcr-image-mappings.json
141+
✔ Enter the site name: xwalkdemo
142+
```
143+
144+
Ensure that the content and images are successfully uploaded to your AEM instance. Verify the uploaded content through your AEM Author environment.
145+
146+
147+

0 commit comments

Comments
 (0)