@sitevision/api 2024.10.1 → 2025.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sitevision/api",
3
- "version": "2024.10.1",
3
+ "version": "2025.1.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": "b6fdc8a76630adf0ac7bc20efce1a39bf3dacd4c"
33
+ "gitHead": "fef445686db4d5d6ccf41b93179735c9604c05f8"
34
34
  }
@@ -69,11 +69,11 @@ import type { Builder } from "../../types/senselogic/sitevision/api/base/Builder
69
69
  export interface LinkValueBuilder extends Builder {
70
70
  /**
71
71
  * Sets the target.
72
- * @param anURL the link target URL
72
+ * @param aURL the link target URL
73
73
  * @return this builder
74
- * @throws IllegalArgumentException if <code>anURL</code> is <code>null</code> or whitespace only
74
+ * @throws IllegalArgumentException if <code>aURL</code> is <code>null</code> or whitespace only
75
75
  */
76
- setExternalTarget(anURL: String | string): LinkValueBuilder;
76
+ setExternalTarget(aURL: String | string): LinkValueBuilder;
77
77
 
78
78
  /**
79
79
  * Sets the target.
@@ -5,6 +5,7 @@ import type { Collection } from "../../types/java/util/Collection";
5
5
  import type { FilterSplit } from "../../types/senselogic/sitevision/api/base/FilterSplit";
6
6
  import type { CompoundAndFilterBuilder } from "../CompoundAndFilterBuilder";
7
7
  import type { CompoundOrFilterBuilder } from "../CompoundOrFilterBuilder";
8
+
8
9
  import type { String } from "../../types/java/lang/String";
9
10
 
10
11
  import type { Calendar } from "../../types/java/util/Calendar";
@@ -202,6 +203,36 @@ export interface NodeFilterUtil {
202
203
  */
203
204
  getNonNullFilter(): Filter;
204
205
 
206
+ /**
207
+ * Gets a filter that skips a given number of nodes.
208
+ *
209
+ * <p>
210
+ * <em>Note!</em> The skip filter is typically used in combination with a <em>Compound AND Filter</em>.
211
+ * Example:
212
+ * </p>
213
+ * <ul>
214
+ * <li>
215
+ * This filter skips 5 nodes, regardless of type:<br>
216
+ * <pre><code> filter = nodeFilterUtil.getSkipFilter(5);</code></pre>
217
+ * </li>
218
+ * <li>
219
+ * This page filter skips 5 nodes <em>(i.e. rejects first 5 sv:page nodes that otherwise would have been accepted)</em>:<br>
220
+ * <pre><code> filter = nodeFilterUtil.getCompoundAndFilterBuilder()
221
+ * .addFilter(nodeFilterUtil.getPrimaryNodeTypeFilter("sv:page"))
222
+ * .addFilter(nodeFilterUtil.getSkipFilter(5))
223
+ * .build();</code></pre>
224
+ * </li>
225
+ * </ul>
226
+ * <p>
227
+ * Also note that this filter is <em>stateful</em>, i.e. a created filter instance can't be used more than one time.
228
+ * </p>
229
+ * @param aSkip the number of nodes to skip
230
+ * @return a filter that rejects aSkip number of nodes
231
+ * @throws IllegalArgumentException if aSkip is less than zero
232
+ * @since Sitevision 2025.01.1
233
+ */
234
+ getSkipFilter(aSkip: number): Filter;
235
+
205
236
  /**
206
237
  * Gets a filter that inverts the result of another filter.
207
238
  * @param aFilter the filter to invert
@@ -15,6 +15,7 @@ var _default = exports["default"] = {
15
15
  getNeverAcceptFilter: function getNeverAcceptFilter() {},
16
16
  getNullFilter: function getNullFilter() {},
17
17
  getNonNullFilter: function getNonNullFilter() {},
18
+ getSkipFilter: function getSkipFilter() {},
18
19
  getInvertedFilter: function getInvertedFilter() {},
19
20
  getIdentifierFilter: function getIdentifierFilter() {},
20
21
  getIdentifierPrefixFilter: function getIdentifierPrefixFilter() {},
@@ -42,15 +42,15 @@ export interface NodeIteratorUtil {
42
42
  * ...
43
43
  * }</code></pre>
44
44
  * @param aNodeIterator a NodeIterator, must not be null
45
- * @param aNodeFilter a Node Filter, must not be null
45
+ * @param aFilter a Node Filter, must not be null
46
46
  * @return a filtered NodeIterator
47
- * @throws NullPointerException if aNodeIterator or aNodeFilter is null
47
+ * @throws NullPointerException if aNodeIterator or aFilter is null
48
48
  * @see NodeFilterUtil
49
49
  * @since Sitevision 8.1
50
50
  */
51
51
  getFilteredNodeIterator(
52
52
  aNodeIterator: NodeIterator,
53
- aNodeFilter: Filter
53
+ aFilter: Filter
54
54
  ): NodeIterator;
55
55
 
56
56
  /**
@@ -61,8 +61,8 @@ export interface NodeIteratorUtil {
61
61
  * </p>
62
62
  * <ul>
63
63
  * <li>
64
- * <em>Convenience.</em> This method combines {@link javax.jcr.Session#getNodeByIdentifier(String)} and {@link Node#getNodes()},
65
- * i.e. a shortcut to get an iterator without having to actually lookup/resolve the parent node.
64
+ * <em>Convenience.</em> This method combines {@link senselogic.sitevision.api.resource.ResourceLocatorUtil#getNodeByIdentifier(String)}
65
+ * and {@link Node#getNodes()}, i.e. a shortcut to get an iterator without having to actually lookup/resolve the parent node.
66
66
  * </li>
67
67
  * <li>
68
68
  * <em>Permission workaround.</em> This method does <em>not</em> do any permission checks on the resolved parent Node, i.e.
@@ -90,8 +90,8 @@ export interface NodeIteratorUtil {
90
90
  * </p>
91
91
  * <ul>
92
92
  * <li>
93
- * <em>Convenience.</em> This method combines {@link javax.jcr.Session#getNodeByIdentifier(String)} and {@link #getMenuItems(Node)},
94
- * i.e. a shortcut to get a menu iterator without having to actually lookup/resolve the parent node.
93
+ * <em>Convenience.</em> This method combines {@link senselogic.sitevision.api.resource.ResourceLocatorUtil#getNodeByIdentifier(String)}
94
+ * and {@link #getMenuItems(Node)}, i.e. a shortcut to get a menu iterator without having to actually lookup/resolve the parent node.
95
95
  * </li>
96
96
  * <li>
97
97
  * <em>Permission workaround.</em> This method does <em>not</em> do any permission checks on the resolved parent Node, i.e.
@@ -121,7 +121,7 @@ export interface NodeIteratorUtil {
121
121
  * </p>
122
122
  * <ul>
123
123
  * <li>
124
- * <em>Convenience.</em> This method combines {@link javax.jcr.Session#getNodeByIdentifier(String)} and
124
+ * <em>Convenience.</em> This method combines {@link senselogic.sitevision.api.resource.ResourceLocatorUtil#getNodeByIdentifier(String)} and
125
125
  * {@link #getMenuItemsIncludingFolders(Node)}, i.e. a shortcut to get a menu iterator without having to actually
126
126
  * lookup/resolve the parent node.
127
127
  * </li>
@@ -164,20 +164,46 @@ export interface NodeIteratorUtil {
164
164
  * </p>
165
165
  * @param aNodeIterator a node iterator
166
166
  * @param aFilter a node filter
167
- * @param aMaxNodesToFind max number of nodes to include in the result
168
- * @return a list of nodes that matches <code>aFilter</code>, never <code>null</code>.&#xA; The list will contain at most <code>aMaxNodesToFind</code> nodes.&#xA; If <code>aFilter</code> is <code>null</code>, the filter will be ignored (all nodes will be accepted).&#xA; If <code>aNodeIterator</code> is <code>null</code>, an empty list will be returned.&#xA; If <code>aMaxNodesToFind</code> is negative, an empty list will be returned.
167
+ * @param aLimit max number of nodes to include in the result
168
+ * @return a list of nodes that matches <code>aFilter</code>, never <code>null</code>.&#xA; The list will contain at most aLimit nodes.&#xA; If aNodeIterator is null, an empty list will be returned.&#xA; If aFilter is null, the filter will be ignored (all nodes will be accepted).&#xA; If aLimit is negative or zero, an empty list will be returned.
169
169
  * @since Sitevision 3.6.2
170
170
  */
171
- findNodes(
171
+ findNodes(aNodeIterator: NodeIterator, aFilter: Filter, aLimit: number): List;
172
+
173
+ /**
174
+ * Gets a max-sized node list from a node iterator that matches a specified filter, skipping a specified number of matching nodes.
175
+ *
176
+ * <p>
177
+ * Executing <code>findMoreNodes(nodeIterator, filter, 0, 10)</code> is conceptually equivalent
178
+ * to executing <code>findNodes(nodeIterator, filter, 10)</code>.
179
+ * </p>
180
+ *
181
+ * <p>
182
+ * <em>Tip!</em> Use {@link senselogic.sitevision.api.node.NodeFilterUtil} to get an appropriate node filter.
183
+ * </p>
184
+ * @param aNodeIterator a node iterator
185
+ * @param aFilter a node filter
186
+ * @param aSkip number of matching nodes to skip
187
+ * @param aLimit max number of nodes to include in the result
188
+ * @return a list of nodes that matches aFilter, never null.&#xA; The list will contain at most aLimit number of nodes and aSkip number of nodes will be ignored.&#xA; If aNodeIterator is null, an empty list will be returned.&#xA; If aFilter is null, the filter will be ignored (all nodes will be accepted).&#xA; If aSkip is negative or zero, no nodes will be skipped.&#xA; If aLimit is negative or zero, an empty list will be returned.
189
+ * @since Sitevision 2025.01.1
190
+ */
191
+ findMoreNodes(
172
192
  aNodeIterator: NodeIterator,
173
193
  aFilter: Filter,
174
- aMaxNodesToFind: number
194
+ aSkip: number,
195
+ aLimit: number
175
196
  ): List;
176
197
 
177
198
  /**
178
199
  * Gets a list of all nodes from a node iterator that matches a specified filter.
179
200
  *
180
201
  * <p>
202
+ * Executing <code>findAll(nodeIterator, null)</code> is conceptually equivalent
203
+ * to executing <code>toList(nodeIterator)</code>.
204
+ * </p>
205
+ *
206
+ * <p>
181
207
  * <em>Tip!</em> Use {@link senselogic.sitevision.api.node.NodeFilterUtil} to get
182
208
  * an appropriate node filter. If the list of nodes should be sorted by a specific property value,
183
209
  * you would typically use {@link senselogic.sitevision.api.node.NodeComparatorUtil}
@@ -13,6 +13,7 @@ var _default = exports["default"] = {
13
13
  getMenuItemsIncludingFoldersByIdentifier: function getMenuItemsIncludingFoldersByIdentifier() {},
14
14
  findFirst: function findFirst() {},
15
15
  findNodes: function findNodes() {},
16
+ findMoreNodes: function findMoreNodes() {},
16
17
  findAll: function findAll() {},
17
18
  toList: function toList() {},
18
19
  split: function split() {}
@@ -84,6 +84,22 @@ export interface NodeTreeUtil {
84
84
  */
85
85
  getWebPathNodes(aDescendantNode: Node): List;
86
86
 
87
+ /**
88
+ * Find a portlet with a specific content identifier on a page node.
89
+ *
90
+ * <p>
91
+ * The <em>content identifier</em> of the portlet is determined by the <em>contentIdentifier</em> property.
92
+ * </p>
93
+ * @param aPageNode the page node that has content, typically a sv:page or sv:article
94
+ * @param aContentIdentifier the content identifier of the sv:portlet that should be found
95
+ * @return the first occurrence of a sv:portlet with matching aContentIdentifier, or null if no such portlet can be found&#xA; or if aPageNode is not a page node
96
+ * @since Sitevision 2025.01.1
97
+ */
98
+ findPortletByContentIdentifier(
99
+ aPageNode: Node,
100
+ aContentIdentifier: String | string
101
+ ): Node;
102
+
87
103
  /**
88
104
  * Find a portlet with a specific name on a page node.
89
105
  *
@@ -9,6 +9,7 @@ var _default = exports["default"] = {
9
9
  getParent: function getParent() {},
10
10
  isDescendantOf: function isDescendantOf() {},
11
11
  getWebPathNodes: function getWebPathNodes() {},
12
+ findPortletByContentIdentifier: function findPortletByContentIdentifier() {},
12
13
  findPortletByName: function findPortletByName() {},
13
14
  findPortletsByName: function findPortletsByName() {},
14
15
  findPortletsByType: function findPortletsByType() {},
@@ -1260,6 +1260,12 @@ export interface NodeTypeUtil extends NodeTypeUtilConstants {
1260
1260
  */
1261
1261
  METADATA_GEOLOCATION_DEFINITION_TYPE: "sv:metadataGeolocationDefinition";
1262
1262
 
1263
+ /**
1264
+ * The primary node type name for the metadata module definition type
1265
+ * @since Sitevision 2025.01.1
1266
+ */
1267
+ METADATA_MODULE_DEFINITION_TYPE: "sv:metadataModuleDefinition";
1268
+
1263
1269
  /**
1264
1270
  * Checks if a node is a layout.
1265
1271
  * @param aNode the node to be checked
@@ -1625,6 +1631,7 @@ export interface NodeTypeUtil extends NodeTypeUtilConstants {
1625
1631
  * <li>{@link #METADATA_SINGLE_TARGET_AUDIENCE_DEFINITION_TYPE sv:metadataSingleTargetAudienceDefinition}</li>
1626
1632
  * <li>{@link #METADATA_MULTIPLE_TARGET_AUDIENCE_DEFINITION_TYPE sv:metadataMultipleTargetAudienceDefinition}</li>
1627
1633
  * <li>{@link #METADATA_GEOLOCATION_DEFINITION_TYPE sv:metadataGeolocationDefinition}</li>
1634
+ * <li>{@link #METADATA_MODULE_DEFINITION_TYPE sv:metadataModuleDefinition}</li>
1628
1635
  * </ul>
1629
1636
  * @param aNode the node to be checked
1630
1637
  * @return whether aNode is a "metadata definition node" or not.
@@ -175,6 +175,11 @@ export type CollaborationGroupWrapper = Wrapper & {
175
175
  * current user must also have {@link senselogic.sitevision.api.security.PermissionUtil.Permission#CREATE_CLOSED_COLLABORATION_GROUP}
176
176
  * on the wrapped collaboration group.
177
177
  * </p>
178
+ * <p>
179
+ * <strong>Note!</strong> Setting a group to <em>CLOSED</em> will break any potential permission inheritance for the group page of the group.
180
+ * Hence the user that sets the group to {@link CollaborationGroupType#CLOSED} can potentially lose its permissions to access the (now closed)
181
+ * group!
182
+ * </p>
178
183
  * @param aCollaborationGroupType the collaboration group type
179
184
  * @since Sitevision 4.1
180
185
  */
@@ -1401,4 +1401,11 @@ export type NodeTypeUtilConstants = {
1401
1401
  * @since SiteVision 2024.10.1
1402
1402
  */
1403
1403
  getMETADATA_GEOLOCATION_DEFINITION_TYPE(): string;
1404
+
1405
+ /**
1406
+ * Get accessor for {@link senselogic.sitevision.api.node.NodeTypeUtil#METADATA_MODULE_DEFINITION_TYPE}.
1407
+ * @return {@link senselogic.sitevision.api.node.NodeTypeUtil#METADATA_MODULE_DEFINITION_TYPE}
1408
+ * @since SiteVision 2025.01.1
1409
+ */
1410
+ getMETADATA_MODULE_DEFINITION_TYPE(): string;
1404
1411
  };
@@ -207,5 +207,6 @@ var _default = exports["default"] = {
207
207
  getMETADATA_SINGLE_TARGET_AUDIENCE_DEFINITION_TYPE: function getMETADATA_SINGLE_TARGET_AUDIENCE_DEFINITION_TYPE() {},
208
208
  getMETADATA_MULTIPLE_TARGET_AUDIENCE_DEFINITION_TYPE: function getMETADATA_MULTIPLE_TARGET_AUDIENCE_DEFINITION_TYPE() {},
209
209
  getGEOLOCATION_TYPE: function getGEOLOCATION_TYPE() {},
210
- getMETADATA_GEOLOCATION_DEFINITION_TYPE: function getMETADATA_GEOLOCATION_DEFINITION_TYPE() {}
210
+ getMETADATA_GEOLOCATION_DEFINITION_TYPE: function getMETADATA_GEOLOCATION_DEFINITION_TYPE() {},
211
+ getMETADATA_MODULE_DEFINITION_TYPE: function getMETADATA_MODULE_DEFINITION_TYPE() {}
211
212
  };