Skip to content

Commit 3d5fcc7

Browse files
authored
Merge pull request #96 from oufimtse/assets-view-details-extension
Assets view details extension
2 parents 2f37d08 + 6f3cb39 commit 3d5fcc7

File tree

15 files changed

+1215
-4
lines changed

15 files changed

+1215
-4
lines changed

gatsby-config.js

+34
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ module.exports = {
4545
title: "Adobe Commerce Admin",
4646
path: "https://developer.adobe.com/commerce/extensibility/admin-ui-sdk/"
4747
},
48+
{
49+
title: "AEM Assets View (Beta)",
50+
path: "/services/aem-assets-view/"
51+
},
4852
]
4953
},
5054
{
@@ -203,6 +207,36 @@ module.exports = {
203207
title: "Code Generation",
204208
path: "/services/aem-cf-editor/code-generation/"
205209
},
210+
{
211+
title: "AEM Assets View",
212+
path: "/services/aem-assets-view/"
213+
},
214+
{
215+
title: "Extension Points",
216+
path: "/services/aem-assets-view/api/",
217+
pages: [
218+
{
219+
title: "Common Concepts",
220+
path: "/services/aem-assets-view/api/commons/"
221+
},
222+
{
223+
title: "Details View",
224+
path: "/services/aem-assets-view/api/details-view/"
225+
},
226+
]
227+
},
228+
{
229+
title: "Step-by-step Extension Development",
230+
path: "/services/aem-assets-view/extension-development/"
231+
},
232+
{
233+
title: "Code Generation",
234+
path: "/services/aem-assets-view/code-generation/"
235+
},
236+
{
237+
title: "Troubleshooting",
238+
path: "/services/aem-assets-view/debug/"
239+
},
206240
{
207241
title: "Extension Manager",
208242
path: "/extension-manager/"

src/pages/getting-started/app-builder/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ In other words, we can say that this is a contract between an Adobe product and
3232
- [Experience Cloud UI Extension Point](https://developer.adobe.com/app-builder/docs/guides/extensions/#experience-cloud-ui-extension-point)
3333
- [AEM Asset Microservices Extension Point](https://developer.adobe.com/app-builder/docs/guides/extensions/#aem-asset-microservices-extension-point)
3434
- [AEM Content Fragments Console Extension Point](../../services/aem-cf-console-admin/api)
35+
- [AEM Assets View (Beta) Extension Point](../../services/aem-assets-view/api)
3536

3637
## UI Extensibility
3738

src/pages/guides/development-flow/index.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ contributors:
66
---
77
# Create a New UI Extension
88

9-
The document provides high level overview for developers what to expect when creating UI Extension. For detailed instructions please refer to [step-by-step guide](../../services/aem-cf-console-admin/extension-development/).
9+
The document provides high level overview for developers what to expect when creating UI Extension.
10+
For detailed instructions please refer to step-by-step guides for [AEM Content Fragments Console](../../services/aem-cf-console-admin/extension-development/)
11+
or [AEM Assets View (Beta)](../../services/aem-assets-view/extension-development/).
1012

1113
## Get access
1214

@@ -34,7 +36,8 @@ Once your project is set up in [Adobe Developer Console](https://developer.adobe
3436
There are several ways how to do it.
3537

3638
We will initialize the UI Extension Project using [AIO CLI](https://github.com/adobe/aio-cli).
37-
You may find detailed guide at [Initialize the UI Extension Project using AIO CLI](../../services/aem-cf-console-admin/code-generation#launch-code-generation-during-project-initialization).
39+
You may find detailed guide for [AEM Content Fragments Console](../../services/aem-cf-console-admin/code-generation#launch-code-generation-during-project-initialization)
40+
or [AEM Assets View (Beta)](../../services/aem-assets-view/code-generation#launch-code-generation-during-project-initialization).
3841

3942
If necessary, you can find other options in [Bootstrapping new App using the CLI](https://developer.adobe.com/app-builder/docs/getting_started/first_app/#4-bootstrapping-new-app-using-the-cli).
4043

@@ -60,7 +63,8 @@ During project initialization, you will be able to select a specific template fo
6063

6164
## Implement logic of application
6265

63-
As the next step, we need to implement a logic which will use existing [Extension Points](../../services/aem-cf-console-admin/api) and provide necessary functionality.
66+
As the next step, we need to implement a logic which will use existing Extension Points exposed by one of the Adobe
67+
Services listed under `Extensible Services` in this documentation and provide necessary functionality.
6468
UI Extensions has default structure and preselected technology stack such as [React Spectrum](https://developer.adobe.com/app-builder/docs/resources/spectrum-intro/lesson3/) but developers are free to choose tools that they prefer to. The only requirements to make a proper UI Extension:
6569

6670
1. Supply configuration file that will declare application as an [extension](https://developer.adobe.com/app-builder/docs/guides/extensions/).
@@ -137,6 +141,7 @@ These steps are described in more detail in [UI Extensions Management](../public
137141

138142
## Additional resources
139143

140-
- [Step-by-step Extension Development Guide](../../services/aem-cf-console-admin/extension-development/)
144+
- [Step-by-step Extension Development Guide in AEM Content Fragments Console](../../services/aem-cf-console-admin/extension-development/)
145+
- [Step-by-step Extension Development Guide in AEM Assets View (Beta)](../../services/aem-assets-view/extension-development/)
141146
- [UI Extensibility Overview](../../)
142147
- [FAQ](../../overview/faq/)

src/pages/index.md

+6
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ Start building extensions for the Universal Editor
108108

109109
Start building extensions for Adobe Commerce Admin
110110

111+
<DiscoverBlock slots="link, text"/>
112+
113+
[AEM Assets View (Beta)](services/aem-assets-view/)
114+
115+
Start building extensions for AEM Assets View (Assets Ultimate only)
116+
111117
<DiscoverBlock slots="heading, link, text"/>
112118

113119
## Experiment
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
---
2+
title: AEM Assets View Extensibility
3+
description: Learn how to customize AEM Assets View
4+
contributors:
5+
- https://github.com/AdobeDocs/uix
6+
---
7+
8+
# Common Concepts in Creating Extensions
9+
10+
Understand the fundamentals required to develop an extension for the AEM Assets View.
11+
12+
## Extension Point
13+
14+
AEM Assets View has an `aem/assets/details/1` [extension point](https://developer.adobe.com/app-builder/docs/guides/extensions/)
15+
that allows you to extend its functionality in the Details View.
16+
To declare it to be used by your extension, you need to add the following configuration to your `app.config.yaml` at the
17+
root of your extension:
18+
19+
```yaml
20+
extensions:
21+
aem/assets/details/1:
22+
$include: src/aem-assets-details-1/ext.config.yaml
23+
```
24+
Here is an example of `ext.config.yaml` file:
25+
26+
```yaml
27+
operations:
28+
view:
29+
- type: web
30+
impl: index.html
31+
actions: actions
32+
web: web-src
33+
```
34+
35+
More **extension points** may be added in future releases to add extensibility features to other parts of the AEM Assets View.
36+
37+
## Extension Registration
38+
39+
Interaction between UI Extension and AEM Assets View starts with the initialization process that includes extension's
40+
capabilities registration so AEM Assets View knows when to invoke the extension and which APIs to expose. Registration is done by calling the `register()`
41+
function provided by `@adobe/uix-guest` library. This asynchronous function takes single object that describes extension
42+
and returns an object representing connection to the AEM Assets View.
43+
44+
The `register()` function should be invoked after extension initialization page is loaded.
45+
46+
Extension registration data must include:
47+
48+
- `id` - string with random extension identifier. This identifier is useful for debugging of interaction between AEM Assets
49+
View and extension and is needed if extension provides custom UI.
50+
- `methods` - objects with the extension APIs exposed to the AEM Assets View. All methods are grouped into
51+
**namespaces** that represent more granular areas of AEM Assets View functionality within the extension point.
52+
Currently, only the following **namespace** is available:
53+
- `detailSidePanel`, that allows to add custom side panels in the Details View
54+
55+
More **namespaces** may be added in future releases to add more extensibility features within the Details View.
56+
57+
```js
58+
import { register } from "@adobe/uix-guest";
59+
60+
// ...
61+
62+
const guestConnection = await register({
63+
id: "extension-id",
64+
methods: {
65+
detailSidePanel: {
66+
getPanels() {
67+
// ..
68+
}
69+
},
70+
}
71+
});
72+
// ...
73+
```
74+
## Building Extension UI
75+
76+
The `aem/assets/details/1` extension point and its `detailSidePanel` **namespace** requires UI extension to provide
77+
its own interface for the custom side panel. This interface should be implemented as a separate entry point within the extension
78+
web application.
79+
80+
Normally this interface needs data from the AEM Assets View or needs to trigger certain action within the host application.
81+
To support this the interface page should establish its own connection with AEM Assets View using the `attach()` function
82+
provided by `@adobe/uix-guest` library.
83+
84+
In this example, the interface page establishes a connection with the AEM Assets View using extension `id` and obtains
85+
the AEM host URL:
86+
87+
```js
88+
import { attach } from "@adobe/uix-guest";
89+
90+
const guestConnection = await attach({ id: "extension-id" });
91+
const aemHost = await guestConnection.discovery.getAemHost();
92+
```
93+
94+
## Set up communication with AEM Assets View
95+
96+
Both `register()` and `attach()` functions of `@adobe/uix-guest` library return the same connection object that has `host` property and
97+
exposes AEM Assets View API to UI Extensions. Through this API you can access data from the host application as well as
98+
invoke certain actions within it.
99+
100+
## Common APIs exposed by AEM Assets View to all UI Extensions
101+
102+
The APIs documented below are available to all AEM Assets View UI Extensions, irrespective of the extension point they are using.
103+
104+
Every API is defined under its own namespace, which in turn is contained within the `host` object of the connection instance.
105+
106+
All API invocations are asynchronous and return a `Promise`.
107+
108+
### Authentication API
109+
110+
This API provides information about the current Org, access token and API key in the AEM Assets View.
111+
The API uses `auth` namespace.
112+
113+
`auth.getIMSInfo()`
114+
115+
**Description:** returns information about IMS Org name, Id and access token.
116+
117+
**Return Object Structure**
118+
- `imsOrg` (`string`): The IMS organization identifier.
119+
- `imsOrgName` (`string`): The name of the IMS organization.
120+
- `accessToken` (`string`): The access token for the IMS.
121+
122+
`auth.getApiKey()`
123+
124+
**Description:** returns API key used by the AEM Assets View.
125+
126+
**Returns** (`string`): API key
127+
128+
**Example:**
129+
```js
130+
const { imsOrg, accessToken } = await guestConnection.host.auth.getIMSInfo();
131+
132+
const apiKey = await guestConnection.host.auth.getAPIKey();
133+
```
134+
135+
### Discovery API
136+
137+
This API provides information AEM author instance location.
138+
139+
`discovery.getAemHost()`
140+
141+
**Description:** returns the URL of the AEM author instance.
142+
143+
**Returns** (`string`): AEM author instance URL
144+
145+
**Example:**
146+
```js
147+
const aemHost = await guestConnection.host.discovery.getAemHost();
148+
```
149+
150+
### Toast API
151+
152+
This API provides methods to show toast messages in the AEM Assets View.
153+
154+
`toast.display({ variant, message })`
155+
156+
**Description:** shows a toast message in the AEM Assets View.
157+
158+
**Parameters:**
159+
- **options** (`object`): Object with the following properties:
160+
- variant (`string`, optional): The type of toast message. Possible values are `neutral`, `positive`, `info`, `negative`. Default value is `info`.
161+
- message (`string`, required): The message to display in the toast.
162+
163+
**Example:**
164+
```js
165+
guestConnection.host.toast.display({ variant: "positive", message: "Asset saved successfully" });
166+
```
167+
168+
### Router API
169+
170+
This API provides methods to navigate to different parts of the AEM Assets View.
171+
172+
`router.navigateToAssetDetails({ assetPath })`
173+
174+
**Description:** navigates to a Details View of the specific asset.
175+
176+
**Parameters:**
177+
- **options** (`object`): Object with the following properties:
178+
- assetPath (`string`, required): The path to the asset in the AEM Assets View.
179+
180+
**Example:**
181+
```js
182+
guestConnection.host.router.navigateToAssetDetails({ assetPath: '/content/dam/my-assets/image.jpg' });
183+
```
184+
### i18n API
185+
186+
This API provides methods to support localization of the UI Extension.
187+
188+
`i18n.getLocalizationInfo()`
189+
190+
**Description:** returns information about the current locale used in the AEM Assets View.
191+
192+
**Return Object Structure**
193+
- `locale` (`string`): The current locale used in the AEM Assets View.
194+
195+
**Example:**
196+
```js
197+
const { locale } = await guestConnection.host.i18n.getLocalizationInfo();
198+
```

0 commit comments

Comments
 (0)