@sitevision/api 2024.1.2 → 2024.3.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 CHANGED
@@ -58,6 +58,7 @@ import './server/MailBuilder';
58
58
  import './server/MailUtil';
59
59
  import './server/MathInstance';
60
60
  import './server/MessageDigesterFactory';
61
+ import './server/MessagesFactory';
61
62
  import './server/MetadataDefinitionUtil';
62
63
  import './server/MetadataUtil';
63
64
  import './server/MimeTypeUtil';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sitevision/api",
3
- "version": "2024.1.2",
3
+ "version": "2024.3.1",
4
4
  "author": "Sitevision AB",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -30,5 +30,5 @@
30
30
  "access": "public",
31
31
  "directory": "dist"
32
32
  },
33
- "gitHead": "162f416958e93e3cc24c7b23a5eeafc46db6c2e7"
33
+ "gitHead": "ac4d35923f8a61c4fdaccbd6ffe6c46be9fddd8a"
34
34
  }
@@ -0,0 +1,28 @@
1
+ import type { Node } from "../../types/javax/jcr/Node";
2
+ import type { ChannelWrapper } from "../../types/senselogic/sitevision/api/message/ChannelWrapper";
3
+
4
+ /**
5
+ * Factory for creating messages-related instances.
6
+ *
7
+ * <p>
8
+ * An instance of the Sitevision class implementing this interface can be obtained via
9
+ * {@link senselogic.sitevision.api.Utils#getMessagesFactory()}.
10
+ * See {@link senselogic.sitevision.api.Utils} for how to obtain an instance of the <code>Utils</code> interface.
11
+ * </p>
12
+ * @author Elias Abrache
13
+ * @since Sitevision 2024.03.01
14
+ */
15
+ export interface MessagesFactory {
16
+ /**
17
+ * Gets a wrapper for the specified channel.
18
+ * @param aChannel the channel node (node of type sv:topic).
19
+ * @return a channel wrapper for <code>aChannel</code>, or <code>null</code> if <code>aChannel</code>&#xA; isn't a channel, is archived, Social Collaboration isn't activated or operating user doesn't have a social user identity.
20
+ */
21
+ getChannelWrapper(aChannel: Node): ChannelWrapper;
22
+ }
23
+
24
+ declare namespace MessagesFactory {}
25
+
26
+ declare var messagesFactory: MessagesFactory;
27
+
28
+ export default messagesFactory;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _default = {
8
+ getChannelWrapper: function getChannelWrapper() {}
9
+ };
10
+ exports["default"] = _default;
@@ -1086,6 +1086,12 @@ export interface NodeTypeUtil extends NodeTypeUtilConstants {
1086
1086
  */
1087
1087
  MARKETPLACE_HEADLESS_CUSTOM_MODULE_TYPE: "sv:marketplaceHeadlessCustomModule";
1088
1088
 
1089
+ /**
1090
+ * The primary node type name for the Marketplace widget custom module type.
1091
+ * @since Sitevision 2024.02.1
1092
+ */
1093
+ MARKETPLACE_WIDGET_CUSTOM_MODULE_TYPE: "sv:marketplaceWidgetCustomModule";
1094
+
1089
1095
  /**
1090
1096
  * The primary node type name for the responsive breakpoint repository type.
1091
1097
  * @since Sitevision 6.2
@@ -1176,6 +1182,18 @@ export interface NodeTypeUtil extends NodeTypeUtilConstants {
1176
1182
  */
1177
1183
  WORK_STATUS_TEMPLATE_REPOSITORY_TYPE: "sv:workStatusTemplateRepository";
1178
1184
 
1185
+ /**
1186
+ * The primary node type name for the dashboard type.
1187
+ * @since Sitevision 2024.02.1
1188
+ */
1189
+ DASHBOARD_TYPE: "sv:dashboard";
1190
+
1191
+ /**
1192
+ * The primary node type name for the widget custom module type.
1193
+ * @since Sitevision 2024.02.1
1194
+ */
1195
+ WIDGET_CUSTOM_MODULE_TYPE: "sv:widgetCustomModule";
1196
+
1179
1197
  /**
1180
1198
  * Checks if a node is a layout.
1181
1199
  * @param aNode the node to be checked
@@ -53,6 +53,7 @@ declare enum Permission {
53
53
  MANAGE_TYPES_IDENTIFIERS,
54
54
  MANAGE_CUSTOM_SEARCH_INDEX,
55
55
  MANAGE_PUBLISHING_LOCK,
56
+ MANAGE_DASHBOARDS,
56
57
  }
57
58
 
58
59
  export default Permission;
@@ -37,6 +37,7 @@ var _default = {
37
37
  MANAGE_PINNING: "MANAGE_PINNING",
38
38
  MANAGE_TYPES_IDENTIFIERS: "MANAGE_TYPES_IDENTIFIERS",
39
39
  MANAGE_CUSTOM_SEARCH_INDEX: "MANAGE_CUSTOM_SEARCH_INDEX",
40
- MANAGE_PUBLISHING_LOCK: "MANAGE_PUBLISHING_LOCK"
40
+ MANAGE_PUBLISHING_LOCK: "MANAGE_PUBLISHING_LOCK",
41
+ MANAGE_DASHBOARDS: "MANAGE_DASHBOARDS"
41
42
  };
42
43
  exports["default"] = _default;
@@ -50,6 +50,13 @@ export interface PortletContextUtil extends PortletContextUtilConstants {
50
50
  */
51
51
  getCurrentModuleElement(): Node;
52
52
 
53
+ /**
54
+ * Gets current dashboard node (applicable during render of a sv:widgetCustomModule).
55
+ * @return current dashboard as <code>Node</code>, or <code>null</code> if indeterminable&#xA; (i.e. this method is not called from within a sv:widgetCustomModule)
56
+ * @since Sitevision 2024.02.1
57
+ */
58
+ getCurrentDashboard(): Node;
59
+
53
60
  /**
54
61
  * Gets current Locale.
55
62
  * @return current <code>Locale</code>, or default <code>Locale</code> if indeterminable
@@ -8,6 +8,7 @@ var _default = {
8
8
  getCurrentPage: function getCurrentPage() {},
9
9
  getCurrentPortlet: function getCurrentPortlet() {},
10
10
  getCurrentModuleElement: function getCurrentModuleElement() {},
11
+ getCurrentDashboard: function getCurrentDashboard() {},
11
12
  getCurrentLocale: function getCurrentLocale() {},
12
13
  getCurrentUser: function getCurrentUser() {},
13
14
  getCurrentUserIdentity: function getCurrentUserIdentity() {},
@@ -85,6 +85,7 @@ import type { FormatterBuilderFactory } from "../FormatterBuilderFactory";
85
85
  import type { TextModuleRendererBuilder } from "../TextModuleRendererBuilder";
86
86
  import type { TagUtil } from "../TagUtil";
87
87
  import type { AliasUtil } from "../AliasUtil";
88
+ import type { MessagesFactory } from "../MessagesFactory";
88
89
 
89
90
  /**
90
91
  * Main entry point to get instances of interfaces in the Sitevision Utility API.
@@ -747,6 +748,13 @@ export interface Utils {
747
748
  * @since Sitevision 2022.10.2
748
749
  */
749
750
  getAliasUtil(): AliasUtil;
751
+
752
+ /**
753
+ * Gets an instance of a messages factory class.
754
+ * @return a messages factory class
755
+ * @since Sitevision 2024.03.01
756
+ */
757
+ getMessagesFactory(): MessagesFactory;
750
758
  }
751
759
 
752
760
  declare namespace Utils {}
@@ -87,6 +87,7 @@ var _default = {
87
87
  getFormatterBuilderFactory: function getFormatterBuilderFactory() {},
88
88
  getTextModuleRendererBuilder: function getTextModuleRendererBuilder() {},
89
89
  getTagUtil: function getTagUtil() {},
90
- getAliasUtil: function getAliasUtil() {}
90
+ getAliasUtil: function getAliasUtil() {},
91
+ getMessagesFactory: function getMessagesFactory() {}
91
92
  };
92
93
  exports["default"] = _default;
@@ -457,6 +457,52 @@ export interface WebContentUtil {
457
457
  * @since Sitevision 3.6
458
458
  */
459
459
  resolveToResourceURL(aNode: Node, aUnresolvedURL: String | string): string;
460
+
461
+ /**
462
+ * Removes the page content of the first root layout for a sv:page, sv:article or a sv:template.
463
+ *
464
+ * <p>
465
+ * Content of the <strong>first</strong> root layout available on the node will be removed.
466
+ * Use {@link #removeAllContent(Node, String)} instead to specify a specific root layout.
467
+ * </p>
468
+ *
469
+ * <p>
470
+ * Current user must have effective WRITE permission to mutate the node or a <code>ConstraintViolationException</code> is thrown.
471
+ * </p>
472
+ *
473
+ * <p>
474
+ * <em>This method is typically called to clear all content before adding new content via {@link #updateContent(Node, String)}</em>
475
+ * </p>
476
+ * @param aPageNode the node that will be altered, typically a node with primary node type sv:page or sv:article.&#xA; May not be null and may not be the site page
477
+ * @throws NullPointerException if aPageNode is null
478
+ * @throws IllegalArgumentException if aPageNode is of invalid type
479
+ * @throws ConstraintViolationException if current user is not allowed to alter aPageNode
480
+ * @throws RepositoryException if something else goes wrong
481
+ * @see senselogic.sitevision.api.security.PermissionUtil#hasEffectiveWritePermission(Node, Node)
482
+ * @since Sitevision 2024.03.1
483
+ */
484
+ removeAllContent(aPageNode: Node): void;
485
+
486
+ /**
487
+ * Removes the page content of a root layout for a sv:page, sv:article or a sv:template.
488
+ *
489
+ * <p>
490
+ * Current user must have effective WRITE permission to mutate the node or a <code>ConstraintViolationException</code> is thrown.
491
+ * </p>
492
+ *
493
+ * <p>
494
+ * <em>This method is typically called to clear all content before adding new content via {@link #updateContent(Node, Map)}</em>
495
+ * </p>
496
+ * @param aPageNode the node that will be altered, typically a node with primary node type sv:page or sv:article.&#xA; May not be null and may not be the site page
497
+ * @param aRootLayoutName the name of the root layout of aPageNode to remove content from (e.g. "Mittenspalt")
498
+ * @throws NullPointerException if aPageNode or aRootLayoutName is null
499
+ * @throws IllegalArgumentException if aPageNode is of invalid type or if there are no root layout named aRootLayoutName
500
+ * @throws ConstraintViolationException if current user is not allowed to alter aPageNode
501
+ * @throws RepositoryException if something else goes wrong
502
+ * @see senselogic.sitevision.api.security.PermissionUtil#hasEffectiveWritePermission(Node, Node)
503
+ * @since Sitevision 2024.03.1
504
+ */
505
+ removeAllContent(aPageNode: Node, aRootLayoutName: String | string): void;
460
506
  }
461
507
 
462
508
  declare namespace WebContentUtil {}
@@ -9,6 +9,7 @@ var _default = {
9
9
  updateContentWithRawHtml: function updateContentWithRawHtml() {},
10
10
  appendContent: function appendContent() {},
11
11
  appendContentWithRawHtml: function appendContentWithRawHtml() {},
12
- resolveToResourceURL: function resolveToResourceURL() {}
12
+ resolveToResourceURL: function resolveToResourceURL() {},
13
+ removeAllContent: function removeAllContent() {}
13
14
  };
14
15
  exports["default"] = _default;
@@ -0,0 +1,91 @@
1
+ import type { Node } from "../../../../../javax/jcr/Node";
2
+
3
+ import type { Wrapper } from "../../base/Wrapper";
4
+
5
+ /**
6
+ * Channel administration interface.
7
+ *
8
+ * <p>
9
+ * This wrapper provides methods to update an existing channel (node of type sv:topic).
10
+ * </p>
11
+ *
12
+ * <p>
13
+ * An instance of the Sitevision class implementing this interface can be obtained via
14
+ * {@link MessagesFactory#getChannelWrapper(javax.jcr.Node)}.
15
+ * See {@link MessagesFactory} for how to obtain an instance of the MessagesFactory interface.
16
+ * </p>
17
+ * @author Elias Abrache
18
+ * @since Sitevision 2024.03.01
19
+ */
20
+ export type ChannelWrapper = Wrapper & {
21
+ /**
22
+ * Adds a user identity as member of the wrapped channel.
23
+ *
24
+ * <p>
25
+ * Requires enabled Social collaboration, and for the operating user to have a social user identity.
26
+ * </p>
27
+ *
28
+ * <p>
29
+ * <em>Only non-members will be added</em>, i.e. a user identity that already is a member will be ignored.
30
+ * Channels that are <em>archived</em> don't accept any new members.
31
+ * </p>
32
+ *
33
+ * <p>
34
+ * <strong>Permission notes!</strong>
35
+ * </p>
36
+ * <p>
37
+ * <em>Open channels</em> require the operating user to either have membership or the
38
+ * {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_CHANNELS} permission.
39
+ * </p>
40
+ * <p>
41
+ * <em>Private channels</em> require the operating user to have membership.
42
+ * </p>
43
+ * @param aUserIdentity a user identity (or user)
44
+ * @return true if aUserIdentity was added as member of the wrapped channel, false otherwise.&#xA; false is always returned if aUserIdentity is null or already a member of the wrapped channel.
45
+ */
46
+ addMember(aUserIdentity: Node): boolean;
47
+
48
+ /**
49
+ * Removes a member from the wrapped channel.
50
+ *
51
+ * <p>
52
+ * <em>Only members can be removed</em>, i.e. a user identity that is a non-member will be ignored.
53
+ * Members can not be removed from channels that are <em>archived</em>.
54
+ * </p>
55
+ *
56
+ * <p>
57
+ * <strong>Permission notes!</strong>
58
+ * </p>
59
+ * <p>
60
+ * <em>Open channels</em> require the operating user to have one of the following:
61
+ * </p>
62
+ * <ul>
63
+ * <li>
64
+ * {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_CHANNELS} permission.
65
+ * </li>
66
+ * <li>
67
+ * Be channel administrator (author of the channel).
68
+ * </li>
69
+ * <li>
70
+ * Operating user matches the user identity (i.e. "is yourself").
71
+ * </li>
72
+ * </ul>
73
+ * <p>
74
+ * <em>Private channels</em> require the operating user to have one of the following:
75
+ * </p>
76
+ * <ul>
77
+ * <li>
78
+ * Membership and the {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_CHANNELS} permission.
79
+ * </li>
80
+ * <li>
81
+ * Be channel administrator (author of the channel).
82
+ * </li>
83
+ * <li>
84
+ * Operating user matches the user identity (i.e. "is yourself").
85
+ * </li>
86
+ * </ul>
87
+ * @param aUserIdentity a user identity (or user)
88
+ * @return true if aUserIdentity was removed as member from the wrapped channel, false otherwise.&#xA; false is always returned if aUserIdentity is null or not a member of the wrapped channel.
89
+ */
90
+ removeMember(aUserIdentity: Node): boolean;
91
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _default = {
8
+ addMember: function addMember() {},
9
+ removeMember: function removeMember() {}
10
+ };
11
+ exports["default"] = _default;
@@ -1199,6 +1199,13 @@ export type NodeTypeUtilConstants = {
1199
1199
  */
1200
1200
  getMARKETPLACE_HEADLESS_CUSTOM_MODULE_TYPE(): string;
1201
1201
 
1202
+ /**
1203
+ * Get accessor for {@link senselogic.sitevision.api.node.NodeTypeUtil#MARKETPLACE_WIDGET_CUSTOM_MODULE_TYPE}.
1204
+ * @return {@link senselogic.sitevision.api.node.NodeTypeUtil#MARKETPLACE_WIDGET_CUSTOM_MODULE_TYPE}
1205
+ * @since Sitevision 2024.02.1
1206
+ */
1207
+ getMARKETPLACE_WIDGET_CUSTOM_MODULE_TYPE(): string;
1208
+
1202
1209
  /**
1203
1210
  * Get accessor for {@link senselogic.sitevision.api.node.NodeTypeUtil#RESPONSIVE_BREAKPOINT_REPOSITORY_TYPE}.
1204
1211
  * @return {@link senselogic.sitevision.api.node.NodeTypeUtil#RESPONSIVE_BREAKPOINT_REPOSITORY_TYPE}
@@ -1303,4 +1310,18 @@ export type NodeTypeUtilConstants = {
1303
1310
  * @since Sitevision 2023.09.2
1304
1311
  */
1305
1312
  getWORK_STATUS_TEMPLATE_REPOSITORY_TYPE(): string;
1313
+
1314
+ /**
1315
+ * Get accessor for {@link senselogic.sitevision.api.node.NodeTypeUtil#DASHBOARD_TYPE}.
1316
+ * @return {@link senselogic.sitevision.api.node.NodeTypeUtil#DASHBOARD_TYPE}
1317
+ * @since Sitevision 2024.02.1
1318
+ */
1319
+ getDASHBOARD_TYPE(): string;
1320
+
1321
+ /**
1322
+ * Get accessor for {@link senselogic.sitevision.api.node.NodeTypeUtil#WIDGET_CUSTOM_MODULE_TYPE}.
1323
+ * @return {@link senselogic.sitevision.api.node.NodeTypeUtil#WIDGET_CUSTOM_MODULE_TYPE}
1324
+ * @since Sitevision 2024.02.1
1325
+ */
1326
+ getWIDGET_CUSTOM_MODULE_TYPE(): string;
1306
1327
  };
@@ -179,6 +179,7 @@ var _default = {
179
179
  getUSER_FIELD_REPOSITORY_TYPE: function getUSER_FIELD_REPOSITORY_TYPE() {},
180
180
  getMARKETPLACE_CUSTOM_MODULE_TYPE: function getMARKETPLACE_CUSTOM_MODULE_TYPE() {},
181
181
  getMARKETPLACE_HEADLESS_CUSTOM_MODULE_TYPE: function getMARKETPLACE_HEADLESS_CUSTOM_MODULE_TYPE() {},
182
+ getMARKETPLACE_WIDGET_CUSTOM_MODULE_TYPE: function getMARKETPLACE_WIDGET_CUSTOM_MODULE_TYPE() {},
182
183
  getRESPONSIVE_BREAKPOINT_REPOSITORY_TYPE: function getRESPONSIVE_BREAKPOINT_REPOSITORY_TYPE() {},
183
184
  getTOPIC_REPOSITORY_TYPE: function getTOPIC_REPOSITORY_TYPE() {},
184
185
  getTOPIC_TYPE: function getTOPIC_TYPE() {},
@@ -193,6 +194,8 @@ var _default = {
193
194
  getOAUTH2_CONFIGURATION_TYPE: function getOAUTH2_CONFIGURATION_TYPE() {},
194
195
  getWORK_STATUS_TYPE: function getWORK_STATUS_TYPE() {},
195
196
  getWORK_STATUS_TEMPLATE_TYPE: function getWORK_STATUS_TEMPLATE_TYPE() {},
196
- getWORK_STATUS_TEMPLATE_REPOSITORY_TYPE: function getWORK_STATUS_TEMPLATE_REPOSITORY_TYPE() {}
197
+ getWORK_STATUS_TEMPLATE_REPOSITORY_TYPE: function getWORK_STATUS_TEMPLATE_REPOSITORY_TYPE() {},
198
+ getDASHBOARD_TYPE: function getDASHBOARD_TYPE() {},
199
+ getWIDGET_CUSTOM_MODULE_TYPE: function getWIDGET_CUSTOM_MODULE_TYPE() {}
197
200
  };
198
201
  exports["default"] = _default;