Skip to content

Commit 24988f8

Browse files
author
StanZGenchev
committed
Removed loader.js and introduced the new platform assets config
Signed-off-by: StanZGenchev <stan.z.genchev@gmail.com>
1 parent deef4ea commit 24988f8

14 files changed

Lines changed: 1952 additions & 1966 deletions

File tree

docs-api/docs/loader/index.md

Lines changed: 0 additions & 51 deletions
This file was deleted.

docs-api/docs/locale/index.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ title: Locale
44
icon: help-features
55
---
66

7-
Loader
8-
===
7+
# Locale
98

109
The locale is a system service that returns the locale configurations and translations.
1110

1211
=== "Overview"
12+
1313
- Module: `platform-core`
1414
- Source: [platform-core/extension-services/locales.js](https://github.com/eclipse/dirigible/blob/master/components/ui/platform-core/src/main/resources/META-INF/dirigible/platform-core/extension-services/locales.js)
1515
- Service Link: `/services/js/platform-core/extension-services/locales.js`
@@ -20,20 +20,22 @@ The locale is a system service that returns the locale configurations and transl
2020

2121
---
2222

23-
Bundle name | Description
24-
------------ | -----------
25-
**langs** | BCP 47 language tag(s). Example - 'en-US'
26-
**namespaces** | Translation namespace(s). Usually, namspaces are the same as the name of the project they come from.
27-
**extensionPoints** | Extension point id(s)
23+
| Bundle name | Description |
24+
| ------------------- | ---------------------------------------------------------------------------------------------------- |
25+
| **langs** | BCP 47 language tag(s). Example - 'en-US' |
26+
| **namespaces** | Translation namespace(s). Usually, namspaces are the same as the name of the project they come from. |
27+
| **extensionPoints** | Extension point id(s) |
2828

2929
### Example
3030

3131
Request:
32+
3233
```
3334
/services/js/platform-core/extension-services/locales.js?langs=en-US
3435
```
3536

3637
Response:
38+
3739
```json
3840
{
3941
"locales": [
@@ -109,4 +111,4 @@ Response:
109111
}
110112
}
111113
}
112-
```
114+
```

docs-api/docs/platform/assets.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
layout: help
3+
title: PlatformAssets
4+
icon: help-features
5+
---
6+
7+
# PlatformAssets
8+
9+
PlatformAssets is a system service that scans all HTML files in the registry and replaces `<meta>` tags with the name attribute set to `platform-links` by injecting the corresponding `<script>` and `<link>` (CSS) tags defined in the `platform-links.json` configuration file.
10+
11+
=== "Overview"
12+
13+
- Module: `engine-web`
14+
- Source: [watcher/PlatformAssetsJsonLoader.java](https://github.com/eclipse/dirigible/blob/master/components/engine/engine-web/src/main/java/org/eclipse/dirigible/components/engine/web/watcher/PlatformAssetsJsonLoader.java)
15+
- Platform Links: [/components/engine/engine-web/src/main/resources/platform-links.json](https://github.com/eclipse/dirigible/blob/master/components/engine/engine-web/src/main/resources/platform-links.json)
16+
- Status: `stable`
17+
- Group: `platform`
18+
19+
## Configuration
20+
21+
---
22+
23+
The configuration file is defined as a JSON object with a prescribed structure.
24+
25+
Each top-level property represents a category name. The value associated with each category is an array of link configuration objects.
26+
27+
Two link types are supported: `SCRIPT` and `CSS`.
28+
29+
For `SCRIPT` entries, two optional boolean properties may be specified:
30+
31+
- `module` — When set to `true`, the generated `<script>` tag will use `type="module"`.
32+
- `defer` — When set to `true`, the generated `<script>` tag will include the `defer` attribute.
33+
34+
The following example illustrates the expected structure:
35+
36+
```json
37+
{
38+
"category-name": [
39+
{
40+
"type": "SCRIPT",
41+
"path": "/path/to/javascript.js"
42+
},
43+
{
44+
"type": "SCRIPT",
45+
"path": "/path/to/module.js",
46+
"module": true
47+
},
48+
{
49+
"type": "SCRIPT",
50+
"path": "/path/to/javascript.js",
51+
"defer": true
52+
},
53+
{
54+
"type": "CSS",
55+
"path": "/path/to/style.css"
56+
}
57+
]
58+
}
59+
```
60+
61+
## Categories
62+
63+
---
64+
65+
Links are organized into categories to simplify configuration and reuse.
66+
67+
| Category Name | Description |
68+
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
69+
| **ng-view** | Provides all required assets for rendering a standard view. |
70+
| **ng-editor** | Extends the base `ng-view` bundle with additional assets required for editor views. Must be used in combination with `ng-view`. |
71+
| **ng-perspective** | Extends the base `ng-view` bundle with assets required for perspective views. Must be used in combination with `ng-view`. |
72+
| **ng-shell** | Extends the base `ng-view` bundle with assets required for shell views. Must be used in combination with `ng-view`. |
73+
| **ng-file-upload** | Includes the `angular-file-upload` module. |
74+
| **ng-split** | Provides the Split.js library and the `<split>` directive. |
75+
| **ng-code-editor** | Provides an embeddable Monaco editor exposed through the `<code-editor>` directive. |
76+
| **ng-cookies** | Includes the AngularJS cookies module. |
77+
| **ng-jstree** | Includes the JSTree library with an indicator plugin and custom styles. |
78+
| **ng-editors-service** | Provides an AngularJS module for retrieving available editors and their associated file types. |
79+
80+
## Example
81+
82+
Basic view:
83+
84+
```html
85+
<head>
86+
...
87+
<meta name="platform-links" category="ng-view" />
88+
...
89+
</head>
90+
```
91+
92+
Perspective:
93+
94+
```html
95+
<head>
96+
...
97+
<meta name="platform-links" category="ng-view,ng-perspective" />
98+
...
99+
</head>
100+
```

docs-api/docs/user-interface/branding.md

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
title: Branding
33
---
44

5-
Branding
6-
===
5+
# Branding
76

87
Dirigible allows you to change the branding of the platform.
98

109
=== "Overview"
10+
1111
- Module: `platform-branding`
1212
- Source: [platform-branding/branding.js](https://github.com/eclipse/dirigible/blob/master/components/ui/platform-branding/src/main/resources/META-INF/dirigible/platform-branding/branding.js)
1313
- Source: [platform-branding/branding.mjs](https://github.com/eclipse/dirigible/blob/master/components/ui/platform-branding/src/main/resources/META-INF/dirigible/platform-branding/branding.mjs)
@@ -31,28 +31,28 @@ Use the `setBrandingInfo` function:
3131

3232
```javascript
3333
setBrandingInfo({
34-
name: 'Dirigible',
35-
brand: 'Eclipse',
36-
brandUrl: 'https://www.dirigible.io/',
37-
icons: {
38-
favicon: '/services/web/platform-branding/images/favicon.ico',
39-
},
40-
logo: '/services/web/platform-branding/images/dirigible.svg',
41-
theme: 'blimpkit-auto',
42-
prefix: 'dirigible'
34+
name: "Dirigible",
35+
brand: "Eclipse",
36+
brandUrl: "https://www.dirigible.io/",
37+
icons: {
38+
favicon: "/services/web/platform-branding/images/favicon.ico",
39+
},
40+
logo: "/services/web/platform-branding/images/dirigible.svg",
41+
theme: "blimpkit-auto",
42+
prefix: "dirigible",
4343
});
4444
```
4545

46-
Parameter | Description | Required
47-
------------ | ----------- | -----------
48-
**name** | The product name | no
49-
**brand** | The brand name | no
50-
**brandUrl** | The brand/product URL | no
51-
**icons** | Favicons | no
52-
**icons.favicon** | Favicon in `.ico` format | no
53-
**logo** | The brand/product logo | no
54-
**theme** | The default theme ID | no
55-
**prefix** | The prefix used for cookie and localStorage value keys | no
46+
| Parameter | Description | Required |
47+
| ----------------- | ------------------------------------------------------ | -------- |
48+
| **name** | The product name | no |
49+
| **brand** | The brand name | no |
50+
| **brandUrl** | The brand/product URL | no |
51+
| **icons** | Favicons | no |
52+
| **icons.favicon** | Favicon in `.ico` format | no |
53+
| **logo** | The brand/product logo | no |
54+
| **theme** | The default theme ID | no |
55+
| **prefix** | The prefix used for cookie and localStorage value keys | no |
5656

5757
### Getting the brand information
5858

@@ -64,15 +64,25 @@ The branding constant will be a reference to the global branding information obj
6464

6565
### Initializing the branding
6666

67-
For standard Dirigible shells/perspectives/views/etc. you can just use the loader. Example:
67+
For standard shells, perspectives, views, and related components in Eclipse Dirigible, the PlatformAssets loader can be used directly.
68+
69+
Example:
6870

6971
```html
70-
<script type="text/javascript" src="/services/js/platform-core/services/loader.js?id=view-js"></script>
72+
<meta name="platform-links" category="ng-view" />
7173
```
7274

73-
In a custom view, you must include those two files in your shell/perspective/view/etc. and make sure they are the first to load.
75+
This approach ensures that all required assets for the specified category are automatically resolved and injected.
76+
77+
In a custom view, you must include those two files in your view. and make sure they are the first to load.
7478

7579
```html
76-
<script type="text/javascript" src="/services/js/platform-branding/branding.js"></script>
77-
<script type="text/javascript" src="/services/web/platform-core/utilities/view.js"></script>
78-
```
80+
<script
81+
type="text/javascript"
82+
src="/services/js/platform-branding/branding.js"
83+
></script>
84+
<script
85+
type="text/javascript"
86+
src="/services/web/platform-core/utilities/view.js"
87+
></script>
88+
```

docs-api/docs/user-interface/editor.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ Editor
8989
<!-- Editor configuration module -->
9090
<script type="text/javascript" src="/services/web/new-editor/configs/editor.js"></script>
9191
<!-- Editor services and view styles -->
92-
<script type="text/javascript" src="/services/js/platform-core/services/loader.js?id=editor-js"></script>
93-
<link type="text/css" rel="stylesheet" href="/services/js/platform-core/services/loader.js?id=view-css" />
92+
<meta name="platform-links" category="ng-view,ng-editor">
9493
<!-- Editor controller -->
9594
<script type="text/javascript" src="js/editor.js"></script>
9695
</head>

docs-api/docs/user-interface/perspective.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ Perspective with a default layout:
9797
<script type="text/javascript" src="/services/web/new-perspective/configs/perspective.js"></script>
9898

9999
<!-- Perspective services and styles -->
100-
<script type="text/javascript" src="/services/js/platform-core/services/loader.js?id=perspective-js"></script>
101-
<link type="text/css" rel="stylesheet" href="/services/js/platform-core/services/loader.js?id=perspective-css" />
100+
<meta name="platform-links" category="ng-view,ng-perspective">
102101

103102
<!-- Perspective controller -->
104103
<script type="text/javascript" src="js/perspective.js"></script>
@@ -175,8 +174,7 @@ Perspective with a custom layout:
175174
<script type="text/javascript" src="/services/web/new-perspective/configs/perspective.js"></script>
176175

177176
<!-- Base perspective services and styles -->
178-
<script type="text/javascript" src="/services/js/platform-core/services/loader.js?id=perspective-js"></script>
179-
<link type="text/css" rel="stylesheet" href="/services/js/platform-core/services/loader.js?id=perspective-css" />
177+
<meta name="platform-links" category="ng-view,ng-perspective">
180178
</head>
181179

182180
<body>

docs-api/docs/user-interface/shell.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ Example of a basic shell:
8383
<script type="text/javascript" src="/services/web/new-shell/configs/shell.js"></script>
8484

8585
<!-- Shell services and styles -->
86-
<script type="text/javascript" src="/services/js/platform-core/services/loader.js?id=shell-js"></script>
87-
<link type="text/css" rel="stylesheet" href="/services/js/platform-core/services/loader.js?id=shell-css" />
86+
<meta name="platform-links" category="ng-view,ng-shell">
8887
</head>
8988

9089
<body>

docs-api/docs/user-interface/subview.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ Subview
8181
<script type="text/javascript" src="/services/web/new-subview/configs/subview.js"></script>
8282

8383
<!-- Base view services and styles -->
84-
<script type="text/javascript" src="/services/js/platform-core/services/loader.js?id=view-js"></script>
85-
<link type="text/css" rel="stylesheet" href="/services/js/platform-core/services/loader.js?id=view-css" />
84+
<meta name="platform-links" category="ng-view">
8685
</head>
8786

8887
<body>

docs-api/docs/user-interface/view.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ View
9090
<script type="text/javascript" src="/services/web/new-view/configs/view.js"></script>
9191

9292
<!-- View services and styles -->
93-
<script type="text/javascript" src="/services/js/platform-core/services/loader.js?id=view-js"></script>
94-
<link type="text/css" rel="stylesheet" href="/services/js/platform-core/services/loader.js?id=view-css" />
93+
<meta name="platform-links" category="ng-view">
9594

9695
<!-- View controller -->
9796
<script type="text/javascript" src="js/view.js"></script>

docs-api/docs/user-interface/window.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ Window
8484
<script type="text/javascript" src="/services/web/new-window/configs/window.js"></script>
8585

8686
<!-- Base view services and styles -->
87-
<script type="text/javascript" src="/services/js/platform-core/services/loader.js?id=view-js"></script>
88-
<link type="text/css" rel="stylesheet" href="/services/js/platform-core/services/loader.js?id=view-css" />
87+
<meta name="platform-links" category="ng-view">
8988
</head>
9089

9190
<body>

0 commit comments

Comments
 (0)