@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.
Files changed (40) hide show
  1. package/index.d.ts +5 -0
  2. package/package.json +2 -2
  3. package/server/ContentFormat/index.d.ts +20 -0
  4. package/server/ContentFormat/index.js +12 -0
  5. package/server/ContentRendererBuilder/index.d.ts +93 -0
  6. package/server/ContentRendererBuilder/index.js +14 -0
  7. package/server/CreateContentFactory/index.d.ts +53 -0
  8. package/server/CreateContentFactory/index.js +13 -0
  9. package/server/FileUtil/index.d.ts +21 -0
  10. package/server/FileUtil/index.js +1 -0
  11. package/server/FolderUtil/index.d.ts +24 -11
  12. package/server/GeolocationValueBuilder/index.d.ts +95 -0
  13. package/server/GeolocationValueBuilder/index.js +15 -0
  14. package/server/ImageUtil/index.d.ts +25 -4
  15. package/server/ImageUtil/index.js +1 -0
  16. package/server/LinkValueBuilder/index.d.ts +1 -1
  17. package/server/MetadataUtil/index.d.ts +23 -2
  18. package/server/MetadataUtil/index.js +2 -1
  19. package/server/OutputUtil/index.d.ts +5 -1
  20. package/server/PermissionUtil.Permission/index.d.ts +1 -0
  21. package/server/PermissionUtil.Permission/index.js +2 -1
  22. package/server/RelatedValueBuilder/index.d.ts +1 -1
  23. package/server/RendererBuilderFactory/index.d.ts +44 -0
  24. package/server/RendererBuilderFactory/index.js +13 -0
  25. package/server/TagUtil/index.d.ts +6 -3
  26. package/server/TextModuleRendererBuilder/index.d.ts +2 -2
  27. package/server/Utils/index.d.ts +16 -0
  28. package/server/Utils/index.js +3 -1
  29. package/server/ai/index.d.ts +19 -1
  30. package/types/senselogic/sitevision/api/metadata/value/GeolocationValue/index.d.ts +25 -0
  31. package/types/senselogic/sitevision/api/metadata/value/GeolocationValue/index.js +10 -0
  32. package/types/senselogic/sitevision/api/render/ContentRenderer/index.d.ts +127 -0
  33. package/types/senselogic/sitevision/api/render/ContentRenderer/index.js +16 -0
  34. package/types/senselogic/sitevision/api/render/TextModuleRenderer/index.d.ts +24 -3
  35. package/types/senselogic/sitevision/api/render/TextModuleRenderer/index.js +1 -0
  36. package/types/senselogic/sitevision/api/script/VersionedRestApi/index.d.ts +1 -1
  37. package/types/senselogic/sitevision/api/webresource/webcontent/TextModuleCreator/index.d.ts +157 -0
  38. package/types/senselogic/sitevision/api/webresource/webcontent/TextModuleCreator/index.js +17 -0
  39. package/types/senselogic/sitevision/api/webresource/webcontent/TextModuleUpdater/index.d.ts +147 -0
  40. package/types/senselogic/sitevision/api/webresource/webcontent/TextModuleUpdater/index.js +16 -0
@@ -0,0 +1,147 @@
1
+ /**
2
+ * This file is auto generated from JavaDoc. Do not modify it manually.
3
+ */
4
+ import type { Node } from "../../../../../../javax/jcr/Node";
5
+ import type { String } from "../../../../../../java/lang/String";
6
+ import type ContentFormat from "../../../../../../../server/ContentFormat";
7
+
8
+ /**
9
+ * Builder for updating existing text modules (text portlets) with new content.
10
+ *
11
+ * <p>
12
+ * <strong>Required configuration:</strong>
13
+ * </p>
14
+ * <ul>
15
+ * <li>Text module - the existing text module node to update</li>
16
+ * <li>Content - the new text content and its format</li>
17
+ * </ul>
18
+ *
19
+ * <p>
20
+ * <strong>Usage example:</strong>
21
+ * </p>
22
+ * <pre><code>
23
+ * const factory = utils.getCreateContentFactory();
24
+ *
25
+ * const updater = factory.getTextModuleUpdater();
26
+ * updater
27
+ * .setTextModule(existingTextModuleNode)
28
+ * .setMarkdownContent('# Updated Title\n\nThis content has been **updated**.');
29
+ *
30
+ * // Optionally check if configuration is valid before executing
31
+ * if (updater.isValid()) {
32
+ * const node = updater.execute();
33
+ * }
34
+ * </code></pre>
35
+ *
36
+ * <p>
37
+ * <strong>Important notes:</strong>
38
+ * </p>
39
+ * <ul>
40
+ * <li>The update operation replaces the entire content of the text module</li>
41
+ * <li>The text module must be a text portlet (portlet ID "text")</li>
42
+ * <li>The text module must be on a page</li>
43
+ * </ul>
44
+ *
45
+ * <p>
46
+ * <strong>Permission requirements:</strong>
47
+ * </p>
48
+ * <p>
49
+ * The current user must have permission to update the parent page. An exception will be
50
+ * thrown during {@link #execute()} if the user lacks the necessary permissions.
51
+ * </p>
52
+ *
53
+ * <p>
54
+ * An instance of the Sitevision class implementing this interface can be obtained via
55
+ * {@link senselogic.sitevision.api.webresource.webcontent.CreateContentFactory#getTextModuleUpdater()}.
56
+ * See {@link senselogic.sitevision.api.webresource.webcontent.CreateContentFactory} for how to
57
+ * obtain an instance of the <code>CreateContentFactory</code> interface.
58
+ * </p>
59
+ * @author Jens Kalshoven
60
+ * @since Sitevision 2026.01.1
61
+ */
62
+ export type TextModuleUpdater = {
63
+ /**
64
+ * Sets the text module to be updated.
65
+ *
66
+ * <p>
67
+ * The node must be an existing text module sv:portlet (portlet ID "text") that is
68
+ * on a page. The entire content of this text module will be replaced when
69
+ * {@link #execute()} is called.
70
+ * </p>
71
+ *
72
+ * <p>
73
+ * This is a required configuration parameter.
74
+ * </p>
75
+ * @param aTextModule the text module node to update, must be a valid text portlet
76
+ * @return This builder instance for method chaining
77
+ */
78
+ setTextModule(aTextModule: Node): TextModuleUpdater;
79
+
80
+ /**
81
+ * Sets the new content for the text module using Markdown format.
82
+ *
83
+ * <p>
84
+ * This is a convenience method equivalent to calling
85
+ * {@code setContent(aMarkdownContent, ContentFormat.MARKDOWN)}.
86
+ * The Markdown content will be parsed and converted to rich text elements,
87
+ * replacing the existing content.
88
+ * </p>
89
+ *
90
+ * <p>
91
+ * See {@link ContentFormat#MARKDOWN} for details on supported syntax.
92
+ * </p>
93
+ * @param aMarkdownContent The new Markdown content, must not be null or empty
94
+ * @return This builder instance for method chaining
95
+ */
96
+ setMarkdownContent(aMarkdownContent: String | string): TextModuleUpdater;
97
+
98
+ /**
99
+ * Sets the new content for the text module with an explicit format.
100
+ *
101
+ * <p>
102
+ * This method allows you to specify the new content and its format explicitly.
103
+ * The content will be parsed according to the specified format and converted
104
+ * to rich text elements, replacing the existing content.
105
+ * </p>
106
+ * @param aContent The new text content. Must not be null or empty
107
+ * @param aContentFormat The format of the content. Must not be null
108
+ * @return This builder instance for method chaining
109
+ */
110
+ setContent(
111
+ aContent: String | string,
112
+ aContentFormat: ContentFormat
113
+ ): TextModuleUpdater;
114
+
115
+ /**
116
+ * Best-effort validation of the current builder configuration.
117
+ *
118
+ * <p>
119
+ * Checks if all required parameters are set and valid:
120
+ * </p>
121
+ * <ul>
122
+ * <li>Text module is not null and is a valid text portlet</li>
123
+ * <li>Text module's parent is a page</li>
124
+ * <li>Content is not null and not empty</li>
125
+ * <li>Content format is not null</li>
126
+ * <li>The page is not trashed</li>
127
+ * <li>The user has permission to update the page</li>
128
+ * </ul>
129
+ * @return true if the configuration is valid, false otherwise
130
+ */
131
+ isValid(): boolean;
132
+
133
+ /**
134
+ * Updates the text module with the new configured content.
135
+ *
136
+ * <p>
137
+ * <strong>Important:</strong> This method modifies {@link senselogic.sitevision.api.versioning.VersionUtil#OFFLINE_VERSION}
138
+ * of the page content and saves the changes. The operation is performed under a lock to ensure consistency. The entire existing
139
+ * content of the text module is replaced.
140
+ * </p>
141
+ * @return The updated sv:portlet node
142
+ * @throws IllegalStateException If the configuration is invalid
143
+ * @throws ConstraintViolationException If the targeted textModule is invalid,&#xA; or the user lacks permission to update the page,&#xA; or the page is trashed
144
+ * @throws RepositoryException If something else goes wrong
145
+ */
146
+ execute(): Node;
147
+ };
@@ -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
+ setTextModule: function setTextModule() {},
12
+ setMarkdownContent: function setMarkdownContent() {},
13
+ setContent: function setContent() {},
14
+ isValid: function isValid() {},
15
+ execute: function execute() {}
16
+ };