@sitevision/api 2025.10.1 → 2026.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +5 -0
- package/package.json +2 -2
- package/server/ContentFormat/index.d.ts +20 -0
- package/server/ContentFormat/index.js +12 -0
- package/server/ContentRendererBuilder/index.d.ts +93 -0
- package/server/ContentRendererBuilder/index.js +14 -0
- package/server/CreateContentFactory/index.d.ts +53 -0
- package/server/CreateContentFactory/index.js +13 -0
- package/server/FileUtil/index.d.ts +21 -0
- package/server/FileUtil/index.js +1 -0
- package/server/FolderUtil/index.d.ts +24 -11
- package/server/GeolocationValueBuilder/index.d.ts +95 -0
- package/server/GeolocationValueBuilder/index.js +15 -0
- package/server/ImageUtil/index.d.ts +25 -4
- package/server/ImageUtil/index.js +1 -0
- package/server/LinkValueBuilder/index.d.ts +1 -1
- package/server/MetadataUtil/index.d.ts +23 -2
- package/server/MetadataUtil/index.js +2 -1
- package/server/OutputUtil/index.d.ts +5 -1
- package/server/PermissionUtil.Permission/index.d.ts +1 -0
- package/server/PermissionUtil.Permission/index.js +2 -1
- package/server/RelatedValueBuilder/index.d.ts +1 -1
- package/server/RendererBuilderFactory/index.d.ts +44 -0
- package/server/RendererBuilderFactory/index.js +13 -0
- package/server/TagUtil/index.d.ts +6 -3
- package/server/TextModuleRendererBuilder/index.d.ts +2 -2
- package/server/Utils/index.d.ts +16 -0
- package/server/Utils/index.js +3 -1
- package/server/ai/index.d.ts +19 -1
- package/types/senselogic/sitevision/api/metadata/value/GeolocationValue/index.d.ts +25 -0
- package/types/senselogic/sitevision/api/metadata/value/GeolocationValue/index.js +10 -0
- package/types/senselogic/sitevision/api/render/ContentRenderer/index.d.ts +127 -0
- package/types/senselogic/sitevision/api/render/ContentRenderer/index.js +16 -0
- package/types/senselogic/sitevision/api/render/TextModuleRenderer/index.d.ts +24 -3
- package/types/senselogic/sitevision/api/render/TextModuleRenderer/index.js +1 -0
- package/types/senselogic/sitevision/api/script/VersionedRestApi/index.d.ts +1 -1
- package/types/senselogic/sitevision/api/webresource/webcontent/TextModuleCreator/index.d.ts +157 -0
- package/types/senselogic/sitevision/api/webresource/webcontent/TextModuleCreator/index.js +17 -0
- package/types/senselogic/sitevision/api/webresource/webcontent/TextModuleUpdater/index.d.ts +147 -0
- package/types/senselogic/sitevision/api/webresource/webcontent/TextModuleUpdater/index.js +16 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto generated from JavaDoc. Do not modify it manually.
|
|
3
|
+
*/
|
|
4
|
+
import type { TextModuleRendererBuilder } from "../TextModuleRendererBuilder";
|
|
5
|
+
import type { ContentRendererBuilder } from "../ContentRendererBuilder";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Factory for creating various builders for rendering page content.
|
|
9
|
+
*
|
|
10
|
+
* <p>
|
|
11
|
+
* Currently, the factory can create builders for rendering of <strong>content nodes on a given page</strong>:
|
|
12
|
+
* </p>
|
|
13
|
+
* <ul>
|
|
14
|
+
* <li>Use {@link #getTextModuleRendererBuilder()} to create a renderer for Text modules.</li>
|
|
15
|
+
* <li>Use {@link #getContentRendererBuilder()} to create a renderer for other type of content nodes (i.e. layouts, modules etc).</li>
|
|
16
|
+
* </ul>
|
|
17
|
+
*
|
|
18
|
+
* <p>
|
|
19
|
+
* An instance of the Sitevision class implementing this interface can be obtained via
|
|
20
|
+
* {@link senselogic.sitevision.api.Utils#getRendererBuilderFactory()}.
|
|
21
|
+
* See {@link senselogic.sitevision.api.Utils} for how to obtain an instance of the <code>Utils</code> interface.
|
|
22
|
+
* </p>
|
|
23
|
+
* @author Magnus Lövgren
|
|
24
|
+
* @since Sitevision 2026.01.1
|
|
25
|
+
*/
|
|
26
|
+
export interface RendererBuilderFactory {
|
|
27
|
+
/**
|
|
28
|
+
* Gets a TextModuleRendererBuilder instance.
|
|
29
|
+
* @return a TextModuleRendererBuilder instance
|
|
30
|
+
*/
|
|
31
|
+
getTextModuleRendererBuilder(): TextModuleRendererBuilder;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Gets a ContentRendererBuilder instance.
|
|
35
|
+
* @return a ContentRendererBuilder instance
|
|
36
|
+
*/
|
|
37
|
+
getContentRendererBuilder(): ContentRendererBuilder;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
declare namespace RendererBuilderFactory {}
|
|
41
|
+
|
|
42
|
+
declare var rendererBuilderFactory: RendererBuilderFactory;
|
|
43
|
+
|
|
44
|
+
export default rendererBuilderFactory;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* This file is auto generated. Do not modify it manually.
|
|
9
|
+
*/
|
|
10
|
+
var _default = exports["default"] = {
|
|
11
|
+
getTextModuleRendererBuilder: function getTextModuleRendererBuilder() {},
|
|
12
|
+
getContentRendererBuilder: function getContentRendererBuilder() {}
|
|
13
|
+
};
|
|
@@ -47,7 +47,8 @@ export interface TagUtil {
|
|
|
47
47
|
*
|
|
48
48
|
* <p>
|
|
49
49
|
* <strong>Permission note:</strong> Current user must have {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE WRITE}
|
|
50
|
-
* permission on the taggable Node that is mutated.
|
|
50
|
+
* permission on the taggable Node that is mutated. <em>Note that members of a sv:collaborationGroup is also allowed to add tags
|
|
51
|
+
* for the group files.</em>
|
|
51
52
|
* </p>
|
|
52
53
|
* <p>
|
|
53
54
|
* <strong>Versioning note:</strong> Mutation of the taggable Node is always executed in the
|
|
@@ -68,7 +69,8 @@ export interface TagUtil {
|
|
|
68
69
|
*
|
|
69
70
|
* <p>
|
|
70
71
|
* <strong>Permission note:</strong> Current user must have {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE WRITE}
|
|
71
|
-
* permission on the taggable Node that is mutated.
|
|
72
|
+
* permission on the taggable Node that is mutated. <em>Note that members of a sv:collaborationGroup is also allowed to add tags
|
|
73
|
+
* for the group files.</em>
|
|
72
74
|
* </p>
|
|
73
75
|
* <p>
|
|
74
76
|
* <strong>Versioning note:</strong> Mutation of the taggable Node is always executed in the
|
|
@@ -99,7 +101,8 @@ export interface TagUtil {
|
|
|
99
101
|
*
|
|
100
102
|
* <p>
|
|
101
103
|
* <strong>Permission note:</strong> Current user must have {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE WRITE}
|
|
102
|
-
* permission on the taggable Node that is mutated.
|
|
104
|
+
* permission on the taggable Node that is mutated. <em>Note that members of a sv:collaborationGroup is also allowed to remove tags
|
|
105
|
+
* for the group files.</em>
|
|
103
106
|
* </p>
|
|
104
107
|
* <p>
|
|
105
108
|
* <strong>Versioning note:</strong> Mutation of the taggable Node is always executed in the
|
|
@@ -45,8 +45,8 @@ import type { Builder } from "../../types/senselogic/sitevision/api/base/Builder
|
|
|
45
45
|
*
|
|
46
46
|
* <p>
|
|
47
47
|
* An instance of the Sitevision class implementing this interface can be obtained via
|
|
48
|
-
* {@link
|
|
49
|
-
* See {@link
|
|
48
|
+
* {@link RendererBuilderFactory#getTextModuleRendererBuilder()}.
|
|
49
|
+
* See {@link RendererBuilderFactory} for how to obtain an instance of the <code>RendererBuilderFactory</code> interface.
|
|
50
50
|
* </p>
|
|
51
51
|
* @author Magnus Lövgren
|
|
52
52
|
* @since Sitevision 7
|
package/server/Utils/index.d.ts
CHANGED
|
@@ -90,6 +90,8 @@ import type { TagUtil } from "../TagUtil";
|
|
|
90
90
|
import type { AliasUtil } from "../AliasUtil";
|
|
91
91
|
import type { MessagesFactory } from "../MessagesFactory";
|
|
92
92
|
import type { TargetAudienceUtil } from "../TargetAudienceUtil";
|
|
93
|
+
import type { RendererBuilderFactory } from "../RendererBuilderFactory";
|
|
94
|
+
import type { CreateContentFactory } from "../CreateContentFactory";
|
|
93
95
|
|
|
94
96
|
/**
|
|
95
97
|
* Main entry point to get instances of interfaces in the Sitevision Utility API.
|
|
@@ -754,6 +756,20 @@ export interface Utils {
|
|
|
754
756
|
* @since Sitevision 2024.09.2
|
|
755
757
|
*/
|
|
756
758
|
getTargetAudienceUtil(): TargetAudienceUtil;
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* Gets an instance of a renderer builder factory class.
|
|
762
|
+
* @return a renderer builder factory class
|
|
763
|
+
* @since Sitevision 2026.01.1
|
|
764
|
+
*/
|
|
765
|
+
getRendererBuilderFactory(): RendererBuilderFactory;
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* Gets an instance of a content builder factory.
|
|
769
|
+
* @return a content builder factory.
|
|
770
|
+
* @since Sitevision 2026.01.1
|
|
771
|
+
*/
|
|
772
|
+
getCreateContentFactory(): CreateContentFactory;
|
|
757
773
|
}
|
|
758
774
|
|
|
759
775
|
declare namespace Utils {}
|
package/server/Utils/index.js
CHANGED
|
@@ -92,5 +92,7 @@ var _default = exports["default"] = {
|
|
|
92
92
|
getTagUtil: function getTagUtil() {},
|
|
93
93
|
getAliasUtil: function getAliasUtil() {},
|
|
94
94
|
getMessagesFactory: function getMessagesFactory() {},
|
|
95
|
-
getTargetAudienceUtil: function getTargetAudienceUtil() {}
|
|
95
|
+
getTargetAudienceUtil: function getTargetAudienceUtil() {},
|
|
96
|
+
getRendererBuilderFactory: function getRendererBuilderFactory() {},
|
|
97
|
+
getCreateContentFactory: function getCreateContentFactory() {}
|
|
96
98
|
};
|
package/server/ai/index.d.ts
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import type { Node } from '../../types/javax/jcr/Node';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Represents a text part of a message.
|
|
5
|
+
*/
|
|
6
|
+
export interface TextPart {
|
|
7
|
+
type: 'text';
|
|
8
|
+
text: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Represents an image part of a message.
|
|
13
|
+
*/
|
|
14
|
+
export interface ImagePart {
|
|
15
|
+
type: 'image';
|
|
16
|
+
image: string;
|
|
17
|
+
mimeType: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
3
20
|
/**
|
|
4
21
|
* Represents a message in an AI conversation.
|
|
5
22
|
*/
|
|
@@ -14,8 +31,9 @@ export interface Message {
|
|
|
14
31
|
|
|
15
32
|
/**
|
|
16
33
|
* The actual content of the message.
|
|
34
|
+
* Can be either a string or an array of text and image parts.
|
|
17
35
|
*/
|
|
18
|
-
content: string
|
|
36
|
+
content: string | Array<TextPart | ImagePart>;
|
|
19
37
|
}
|
|
20
38
|
|
|
21
39
|
/**
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto generated from JavaDoc. Do not modify it manually.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A temporary representation of a geolocation metadata value.
|
|
7
|
+
*
|
|
8
|
+
* <p>
|
|
9
|
+
* An instance of this interface can be used in MetadataUtil when setting a geolocation metadata via the
|
|
10
|
+
* {@link senselogic.sitevision.api.metadata.MetadataUtil#setMetadataPropertyValue(javax.jcr.Node, String, Object)}
|
|
11
|
+
* or
|
|
12
|
+
* {@link senselogic.sitevision.api.metadata.MetadataUtil#setMetadataPropertyValue(javax.jcr.Node, javax.jcr.Property, Object)}
|
|
13
|
+
* </p>
|
|
14
|
+
*
|
|
15
|
+
* <p>
|
|
16
|
+
* An instance of the Sitevision class implementing this interface can be obtained via
|
|
17
|
+
* {@link senselogic.sitevision.api.metadata.builder.GeolocationValueBuilder#build()}.
|
|
18
|
+
* See {@link senselogic.sitevision.api.metadata.builder.GeolocationValueBuilder} for how to obtain an instance of the
|
|
19
|
+
* <code>GeolocationValueBuilder</code> interface.
|
|
20
|
+
* </p>
|
|
21
|
+
* @author Magnus Lövgren
|
|
22
|
+
* @since Sitevision 2025.11.1
|
|
23
|
+
* @see senselogic.sitevision.api.metadata.builder.GeolocationValueBuilder
|
|
24
|
+
*/
|
|
25
|
+
export type GeolocationValue = {};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto generated from JavaDoc. Do not modify it manually.
|
|
3
|
+
*/
|
|
4
|
+
import type { Node } from "../../../../../javax/jcr/Node";
|
|
5
|
+
|
|
6
|
+
import type { String } from "../../../../../java/lang/String";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* ContentRenderer is a stateful renderer of content on a specific page.
|
|
10
|
+
*
|
|
11
|
+
* <p>
|
|
12
|
+
* This rendering utility is a page content-specific sibling to {@link OutputUtil#getNodeOutput(Node, Node, int)}
|
|
13
|
+
* but it has some nifty advantages:
|
|
14
|
+
* </p>
|
|
15
|
+
* <ul>
|
|
16
|
+
* <li>
|
|
17
|
+
* This renderer is more <em>efficient</em> than {@code OutputUtil} for subsequent rendering of page content.
|
|
18
|
+
* </li>
|
|
19
|
+
* <li>
|
|
20
|
+
* This renderer provides <em>convenience methods</em> for easy access of page content to render.
|
|
21
|
+
* </li>
|
|
22
|
+
* <li>
|
|
23
|
+
* This renderer can use request <em>parameters</em> when rendering page content (if created via the {@link ContentRendererBuilder}).
|
|
24
|
+
* </li>
|
|
25
|
+
* </ul>
|
|
26
|
+
*
|
|
27
|
+
* <p>
|
|
28
|
+
* <strong>Note!</strong> This renderer has generic support for page content (i.e. modules, layouts etc.)
|
|
29
|
+
* but if you should render <em>Text modules</em> - you should use {@link TextModuleRenderer} instead!
|
|
30
|
+
* The TextModuleRenderer is much, much more efficient and provides more versatile behaviour when rendering text modules.
|
|
31
|
+
* </p>
|
|
32
|
+
*
|
|
33
|
+
* <p>
|
|
34
|
+
* Using the ContentRenderer is pretty straightforward, if you remember that it is <strong>stateful</strong> and it adheres to an immutable page
|
|
35
|
+
* determined at creation time.<br>
|
|
36
|
+
* Conceptually you would typically use it like this:
|
|
37
|
+
* </p>
|
|
38
|
+
* <ol>
|
|
39
|
+
* <li>Get the ContentRenderer for a specific page and parameters via {@link ContentRendererBuilder}.</li>
|
|
40
|
+
* <li>Update the renderer with a content node on the page.</li>
|
|
41
|
+
* <li>Check if the renderer is loaded (i.e. could the update process resolve a valid/renderable content node).</li>
|
|
42
|
+
* <li>Do render</li>
|
|
43
|
+
* </ol>
|
|
44
|
+
* <p>
|
|
45
|
+
* When you have rendered once, you can re-use the ContentRenderer until you are done. Something like:
|
|
46
|
+
* </p>
|
|
47
|
+
* <ol>
|
|
48
|
+
* <li>Update the renderer with a another content node on the page.</li>
|
|
49
|
+
* <li>Check if the renderer is loaded (i.e. could the update process resolve a valid/renderable content node).</li>
|
|
50
|
+
* <li>Do render</li>
|
|
51
|
+
* </ol>
|
|
52
|
+
*
|
|
53
|
+
* <p>
|
|
54
|
+
* An instance of the Sitevision class implementing this interface can be obtained via
|
|
55
|
+
* {@link ContentRendererBuilder#build()} .
|
|
56
|
+
* See {@link ContentRendererBuilder} for how to obtain an instance of the <code>ContentRendererBuilder</code> interface.
|
|
57
|
+
* </p>
|
|
58
|
+
* @author Magnus Lövgren
|
|
59
|
+
* @since Sitevision 2026.01.1
|
|
60
|
+
* @see ContentRendererBuilder
|
|
61
|
+
*/
|
|
62
|
+
export type ContentRenderer = {
|
|
63
|
+
/**
|
|
64
|
+
* Updates the state of this renderer using a content Node.
|
|
65
|
+
*
|
|
66
|
+
* <p>
|
|
67
|
+
* <em>
|
|
68
|
+
* Note! If this state update fails (i.e. argument was null or not specifying a supported content part that exists on the page
|
|
69
|
+
* this renderer was created for) there will be nothing to render. The state can always be checked via the
|
|
70
|
+
* {@link #isLoaded()} method.
|
|
71
|
+
* </em>
|
|
72
|
+
* </p>
|
|
73
|
+
* @param aContentNode the content node, typically a sv:portlet, sv:layout or sv:referenceLayout
|
|
74
|
+
*/
|
|
75
|
+
update(aContentNode: Node): void;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Updates the state of this renderer using the identifier of a content Node.
|
|
79
|
+
*
|
|
80
|
+
* <p>
|
|
81
|
+
* The "identifier" is the JCR Node identifier (also the <code>jcr:uuid</code> property) of the content node.
|
|
82
|
+
* </p>
|
|
83
|
+
* <p>
|
|
84
|
+
* <em>
|
|
85
|
+
* Note! If this state update fails (i.e. argument was null or not specifying a supported content part that exists on the page
|
|
86
|
+
* this renderer was created for) there will be nothing to render. The state can always be checked via the
|
|
87
|
+
* {@link #isLoaded()} method.
|
|
88
|
+
* </em>
|
|
89
|
+
* </p>
|
|
90
|
+
* @param aNodeIdentifier the node identifier that specifies the content node (typically a sv:portlet, sv:layout or sv:referenceLayout)
|
|
91
|
+
*/
|
|
92
|
+
updateByIdentifier(aNodeIdentifier: String | string): void;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Updates the state of this renderer using the content identifier of a content Node.
|
|
96
|
+
*
|
|
97
|
+
* <p>
|
|
98
|
+
* The "content identifier" is the <code>contentIdentifier</code> property for the sv:portlet on the context page.
|
|
99
|
+
* </p>
|
|
100
|
+
* <p>
|
|
101
|
+
* <em>
|
|
102
|
+
* Note! If this state update fails (i.e. argument was null or not specifying a supported content part that exists on the page
|
|
103
|
+
* this renderer was created for) there will be nothing to render. The state can always be checked via the
|
|
104
|
+
* {@link #isLoaded()} method.
|
|
105
|
+
* </em>
|
|
106
|
+
* </p>
|
|
107
|
+
* @param aContentIdentifier the content identifier that specifies the content node (i.e. a sv:portlet)
|
|
108
|
+
*/
|
|
109
|
+
updateByContentIdentifier(aContentIdentifier: String | string): void;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Whether this renderer has been updated with a renderable content Node.
|
|
113
|
+
* @return true if this renderer has a valid content Node to render, false otherwise
|
|
114
|
+
*/
|
|
115
|
+
isLoaded(): boolean;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Renders html for the loaded content node.
|
|
119
|
+
*
|
|
120
|
+
* <p>
|
|
121
|
+
* <strong>Note!</strong> The returned value will always be empty string if the {@link #isLoaded()} state is <code>false</code>
|
|
122
|
+
* when invoking this render method <em>(i.e. you would typically always check the loaded state before calling this method).</em>
|
|
123
|
+
* </p>
|
|
124
|
+
* @return the html of the loaded content node, or empty String if rendering fails or no content node is loaded
|
|
125
|
+
*/
|
|
126
|
+
renderHtml(): string;
|
|
127
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* This file is auto generated. Do not modify it manually.
|
|
9
|
+
*/
|
|
10
|
+
var _default = exports["default"] = {
|
|
11
|
+
update: function update() {},
|
|
12
|
+
updateByIdentifier: function updateByIdentifier() {},
|
|
13
|
+
updateByContentIdentifier: function updateByContentIdentifier() {},
|
|
14
|
+
isLoaded: function isLoaded() {},
|
|
15
|
+
renderHtml: function renderHtml() {}
|
|
16
|
+
};
|
|
@@ -170,19 +170,40 @@ export type TextModuleRenderer = {
|
|
|
170
170
|
* Updates the state of this renderer (potentially "loads" a Text module for rendering) using the identifier of a Text module Node.
|
|
171
171
|
*
|
|
172
172
|
* <p>
|
|
173
|
+
* The "identifier" is the JCR Node identifier (also the <code>jcr:uuid</code> property) of the Text module.
|
|
174
|
+
* </p>
|
|
175
|
+
* <p>
|
|
173
176
|
* <em>
|
|
174
177
|
* Note! If this state update fails (i.e. argument was null or not specifying a supported Text module that exists on the page
|
|
175
178
|
* this renderer was created for) there will be nothing to render. The state can always be checked via the
|
|
176
179
|
* {@link #isLoaded()} method.
|
|
177
180
|
* </em>
|
|
178
181
|
* </p>
|
|
179
|
-
* @param aTextModuleIdentifier the identifier of the Text module
|
|
182
|
+
* @param aTextModuleIdentifier the node identifier of the Text module
|
|
180
183
|
*/
|
|
181
184
|
updateByIdentifier(aTextModuleIdentifier: String | string): void;
|
|
182
185
|
|
|
183
186
|
/**
|
|
184
|
-
*
|
|
185
|
-
*
|
|
187
|
+
* Updates the state of this renderer (potentially "loads" a Text module for rendering) using the content identifier that specifies a Text module.
|
|
188
|
+
*
|
|
189
|
+
* <p>
|
|
190
|
+
* The "content identifier" is the <code>contentIdentifier</code> property of the sv:portlet (i.e. a Text module).
|
|
191
|
+
* </p>
|
|
192
|
+
* <p>
|
|
193
|
+
* <em>
|
|
194
|
+
* Note! If this state update fails (i.e. argument was null or not specifying a supported Text module that exists on the page
|
|
195
|
+
* this renderer was created for) there will be nothing to render. The state can always be checked via the
|
|
196
|
+
* {@link #isLoaded()} method.
|
|
197
|
+
* </em>
|
|
198
|
+
* </p>
|
|
199
|
+
* @param aContentIdentifier the content identifier that specifies the Text module
|
|
200
|
+
* @since Sitevision 2026.01.1
|
|
201
|
+
*/
|
|
202
|
+
updateByContentIdentifier(aContentIdentifier: String | string): void;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Whether this renderer has been updated with a renderable Text module.
|
|
206
|
+
* @return true if this renderer has a valid Text module to render, false otherwise
|
|
186
207
|
*/
|
|
187
208
|
isLoaded(): boolean;
|
|
188
209
|
|
|
@@ -11,6 +11,7 @@ var _default = exports["default"] = {
|
|
|
11
11
|
update: function update() {},
|
|
12
12
|
updateByName: function updateByName() {},
|
|
13
13
|
updateByIdentifier: function updateByIdentifier() {},
|
|
14
|
+
updateByContentIdentifier: function updateByContentIdentifier() {},
|
|
14
15
|
isLoaded: function isLoaded() {},
|
|
15
16
|
renderHtml: function renderHtml() {},
|
|
16
17
|
renderText: function renderText() {},
|
|
@@ -146,7 +146,7 @@ export type VersionedRestApi = {
|
|
|
146
146
|
): unknown;
|
|
147
147
|
|
|
148
148
|
/**
|
|
149
|
-
* Executes a PUT endpoint of the REST API
|
|
149
|
+
* Executes a PUT endpoint of the REST API, targeting an instance of the context.
|
|
150
150
|
*
|
|
151
151
|
* <p>
|
|
152
152
|
* Delegates execution to {@link RestApi#put(javax.jcr.Node, String, javax.jcr.Node, Object) RestApi.put(Node,String,Node,Options)}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto generated from JavaDoc. Do not modify it manually.
|
|
3
|
+
*/
|
|
4
|
+
import type { String } from "../../../../../../java/lang/String";
|
|
5
|
+
import type { Node } from "../../../../../../javax/jcr/Node";
|
|
6
|
+
import type ContentFormat from "../../../../../../../server/ContentFormat";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Builder for creating new text modules (text portlets).
|
|
10
|
+
*
|
|
11
|
+
* <p>
|
|
12
|
+
* <strong>Required configuration:</strong>
|
|
13
|
+
* </p>
|
|
14
|
+
* <ul>
|
|
15
|
+
* <li>Parent - the page, layout or portlet where the text module will be created</li>
|
|
16
|
+
* <li>Content - the text content and its format</li>
|
|
17
|
+
* </ul>
|
|
18
|
+
*
|
|
19
|
+
* <p>
|
|
20
|
+
* <strong>Optional configuration:</strong>
|
|
21
|
+
* </p>
|
|
22
|
+
* <ul>
|
|
23
|
+
* <li>Name - the display name/title of the text module</li>
|
|
24
|
+
* </ul>
|
|
25
|
+
*
|
|
26
|
+
* <p>
|
|
27
|
+
* <strong>Usage example:</strong>
|
|
28
|
+
* </p>
|
|
29
|
+
* <pre><code>
|
|
30
|
+
* const factory = utils.getCreateContentFactory();
|
|
31
|
+
*
|
|
32
|
+
* const creator = factory.getTextModuleCreator();
|
|
33
|
+
* creator
|
|
34
|
+
* .setName('Welcome Message')
|
|
35
|
+
* .setParent(pageNode)
|
|
36
|
+
* .setMarkdownContent('# Welcome\n\nThis is a **welcome** message.');
|
|
37
|
+
*
|
|
38
|
+
* // Optionally check if configuration is valid before executing
|
|
39
|
+
* if (creator.isValid()) {
|
|
40
|
+
* const node = creator.execute();
|
|
41
|
+
* }
|
|
42
|
+
* </code></pre>
|
|
43
|
+
*
|
|
44
|
+
* <p>
|
|
45
|
+
* <strong>Permission requirements:</strong>
|
|
46
|
+
* </p>
|
|
47
|
+
* <p>
|
|
48
|
+
* The current user must have permission to update the parent page. An exception will be
|
|
49
|
+
* thrown during {@link #execute()} if the user lacks the necessary permissions.
|
|
50
|
+
* </p>
|
|
51
|
+
*
|
|
52
|
+
* <p>
|
|
53
|
+
* An instance of the Sitevision class implementing this interface can be obtained via
|
|
54
|
+
* {@link senselogic.sitevision.api.webresource.webcontent.CreateContentFactory#getTextModuleCreator()}.
|
|
55
|
+
* See {@link senselogic.sitevision.api.webresource.webcontent.CreateContentFactory} for how to
|
|
56
|
+
* obtain an instance of the <code>CreateContentFactory</code> interface.
|
|
57
|
+
* </p>
|
|
58
|
+
* @author Jens Kalshoven
|
|
59
|
+
* @since Sitevision 2026.01.1
|
|
60
|
+
*/
|
|
61
|
+
export type TextModuleCreator = {
|
|
62
|
+
/**
|
|
63
|
+
* Sets the display name of the text module to be created.
|
|
64
|
+
*
|
|
65
|
+
* <p>
|
|
66
|
+
* The name is displayed as the portlet title and should be descriptive.
|
|
67
|
+
* </p>
|
|
68
|
+
* @param aName The name of the text module
|
|
69
|
+
* @return This builder instance for method chaining
|
|
70
|
+
*/
|
|
71
|
+
setName(aName: String | string): TextModuleCreator;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Sets the parent node where the text module will be created.
|
|
75
|
+
*
|
|
76
|
+
* <p>
|
|
77
|
+
* The parent can be either:
|
|
78
|
+
* </p>
|
|
79
|
+
* <ul>
|
|
80
|
+
* <li>Page (e.g. sv:page, sv:article) - the text module will be appended to the first layout on the page</li>
|
|
81
|
+
* <li>Layout (e.g. sv:layout) - the text module will be appended to the layout</li>
|
|
82
|
+
* <li>Module (sv:portlet) - the text module will be inserted after the module</li>
|
|
83
|
+
* </ul>
|
|
84
|
+
*
|
|
85
|
+
* <p>
|
|
86
|
+
* This is a required configuration parameter.
|
|
87
|
+
* </p>
|
|
88
|
+
* @param aParent The parent node. Must be a valid page or content node
|
|
89
|
+
* @return This builder instance for method chaining
|
|
90
|
+
*/
|
|
91
|
+
setParent(aParent: Node): TextModuleCreator;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Sets the content of the text module using Markdown format.
|
|
95
|
+
*
|
|
96
|
+
* <p>
|
|
97
|
+
* This is a convenience method equivalent to calling
|
|
98
|
+
* {@code setContent(aMarkdownContent, ContentFormat.MARKDOWN)}.
|
|
99
|
+
* The Markdown content will be parsed and converted to rich text elements.
|
|
100
|
+
* </p>
|
|
101
|
+
*
|
|
102
|
+
* <p>
|
|
103
|
+
* See {@link ContentFormat#MARKDOWN} for details on supported syntax.
|
|
104
|
+
* </p>
|
|
105
|
+
* @param aMarkdownContent The Markdown content. Must not be null or empty
|
|
106
|
+
* @return This builder instance for method chaining
|
|
107
|
+
*/
|
|
108
|
+
setMarkdownContent(aMarkdownContent: String | string): TextModuleCreator;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Sets the content of the text module with an explicit format.
|
|
112
|
+
*
|
|
113
|
+
* <p>
|
|
114
|
+
* This method allows you to specify the content and its format explicitly.
|
|
115
|
+
* The content will be parsed according to the specified format and converted
|
|
116
|
+
* to rich text elements.
|
|
117
|
+
* </p>
|
|
118
|
+
* @param aContent The text content. Must not be null or empty
|
|
119
|
+
* @param aContentFormat The format of the content. Must not be null
|
|
120
|
+
* @return This builder instance for method chaining
|
|
121
|
+
*/
|
|
122
|
+
setContent(
|
|
123
|
+
aContent: String | string,
|
|
124
|
+
aContentFormat: ContentFormat
|
|
125
|
+
): TextModuleCreator;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Best-attempt validation of the current builder configuration.
|
|
129
|
+
*
|
|
130
|
+
* <p>
|
|
131
|
+
* Checks if all required parameters are set and valid:
|
|
132
|
+
* </p>
|
|
133
|
+
* <ul>
|
|
134
|
+
* <li>Parent is not null and is a valid page, layout or portlet</li>
|
|
135
|
+
* <li>Content is not null and not empty</li>
|
|
136
|
+
* <li>Content format is not null</li>
|
|
137
|
+
* <li>The page is not trashed</li>
|
|
138
|
+
* <li>The user has permission to update the page</li>
|
|
139
|
+
* </ul>
|
|
140
|
+
* @return true if the configuration is valid, false otherwise
|
|
141
|
+
*/
|
|
142
|
+
isValid(): boolean;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Creates the text module with the configured settings.
|
|
146
|
+
*
|
|
147
|
+
* <p>
|
|
148
|
+
* <strong>Important:</strong> This method modifies the {@link senselogic.sitevision.api.versioning.VersionUtil#OFFLINE_VERSION}
|
|
149
|
+
* of the page content and saves the changes. The operation is performed under a lock to ensure consistency.
|
|
150
|
+
* </p>
|
|
151
|
+
* @return The newly created sv:portlet node
|
|
152
|
+
* @throws IllegalStateException If the configuration is invalid
|
|
153
|
+
* @throws ConstraintViolationException If the parent is invalid, or the user lacks permission to update the page, or the page is trashed
|
|
154
|
+
* @throws RepositoryException If something else goes wrong
|
|
155
|
+
*/
|
|
156
|
+
execute(): Node;
|
|
157
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* This file is auto generated. Do not modify it manually.
|
|
9
|
+
*/
|
|
10
|
+
var _default = exports["default"] = {
|
|
11
|
+
setName: function setName() {},
|
|
12
|
+
setParent: function setParent() {},
|
|
13
|
+
setMarkdownContent: function setMarkdownContent() {},
|
|
14
|
+
setContent: function setContent() {},
|
|
15
|
+
isValid: function isValid() {},
|
|
16
|
+
execute: function execute() {}
|
|
17
|
+
};
|