Skip to content

Commit d64a7cf

Browse files
committed
Changed expansion algorithm
1 parent 2478b5e commit d64a7cf

File tree

3 files changed

+33
-34
lines changed

3 files changed

+33
-34
lines changed

vocabularies/Hierarchy.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,18 +221,18 @@
221221
"@Validation.Minimum": 1
222222
},
223223
{
224-
"$Name": "ShowTargets",
224+
"$Name": "ExpandLevels",
225225
"$Collection": true,
226-
"@Core.Description": "Targets (for example, of end-user messages) to be shown",
227-
"@Core.LongDescription": "Each target has the format of the `resourcePath` ABNF rule and\n identifies an entity whose node in the current hierarchy is to be shown.\n Showing a node makes the node and its ancestors visible.\n Example: `ShowTargets=[\"HierarchyDirectory(1)/Nodes('A')\"]`",
226+
"$Type": "Hierarchy.TopLevelsExpandType",
227+
"@Core.Description": "Nodes to be expanded",
228+
"@Core.LongDescription": "Expansion of nodes happens in the following steps:\n1. Make all nodes from the top n levels visible.\n2. For each entry in `ExpandLevels` in the given order: If the entry identifies a visible node,\n expand or collapse that node (making certain descendants visible or invisible).\n3. Make the nodes identified by `ShowTargets` and their ancestors visible.",
228229
"@Core.OptionalParameter": {}
229230
},
230231
{
231-
"$Name": "ExpandLevels",
232+
"$Name": "ShowTargets",
232233
"$Collection": true,
233-
"$Type": "Hierarchy.TopLevelsExpandType",
234-
"@Core.Description": "Nodes to be expanded",
235-
"@Core.LongDescription": "Expansion of nodes happens in the following steps:\n1. Make all nodes from the top n levels visible.\n2. For each entry in `ExpandLevels` that identifies a visible node, expand or collapse that node\n (making certain descendants visible or invisible) and mark the entry as done.\n3. If at least one entry was marked during the most recent execution of step 2 and\n there are unmarked entries left, go back to step 2.",
234+
"@Core.Description": "Targets (for example, of end-user messages) to be shown",
235+
"@Core.LongDescription": "Each target has the format of the `resourcePath` ABNF rule and\n identifies an entity whose node in the current hierarchy is to be shown.\n Showing a node makes the node and its ancestors visible.\n Example: `ShowTargets=[\"HierarchyDirectory(1)/Nodes('A')\"]`",
236236
"@Core.OptionalParameter": {}
237237
}
238238
],

vocabularies/Hierarchy.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,24 @@ Term|Type|Description
1111
[RecursiveHierarchy](Hierarchy.xml#L41)|[RecursiveHierarchyType](#RecursiveHierarchyType)|<a name="RecursiveHierarchy"></a>Hierarchy-specific information in the result set of a hierarchical request<br>The [base term](https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Aggregation.V1.html#RecursiveHierarchy) governs what are the nodes and parents in the hierarchy, whereas this term defines derived information.
1212
[RecursiveHierarchyActions](Hierarchy.xml#L217)|[RecursiveHierarchyActionsType](#RecursiveHierarchyActionsType)|<a name="RecursiveHierarchyActions"></a>Actions for maintaining the recursive hierarchy defined by the [base term](https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Aggregation.V1.html#RecursiveHierarchy)<br>When an annotation with this term is present, the [`ParentNavigationProperty`](https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Aggregation.V1.html#RecursiveHierarchyType) in the base term must not have a collection-valued segment prior to its last segment.
1313
[MatchCount](Hierarchy.xml#L274) *([Experimental](Common.md#Experimental))*|Int64|<a name="MatchCount"></a>Instance annotation on the result of an `$apply` query option containing the number of matching nodes after hierarchical transformations<br>The service MAY designate a subset of the `$apply` result as "matching nodes". For requests following the pattern described [here](#RecursiveHierarchyType), this subset is the output set of the `filter` or `search` transformation that occurs as the fourth parameter of the last `ancestors` transformation or occurs nested into it.<br>For requests not following this pattern, the subset NEED NOT be defined.<br>This instance annotation is available if [`RecursiveHierarchy/Matched`](#RecursiveHierarchyType) and [`RecursiveHierarchy/MatchedDescendantCount`](#RecursiveHierarchyType) are also available.
14-
[RecursiveHierarchySupported](Hierarchy.xml#L370) *([Experimental](Common.md#Experimental))*|[Tag](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#Tag)|<a name="RecursiveHierarchySupported"></a>Whether the annotated collection acts as a [`RecursiveHierarchy`](#RecursiveHierarchy) with the given qualifier<br>This tag is applied to a collection with the same qualifier as the [`RecursiveHierarchy`](#RecursiveHierarchy) term which is applied to its entity type. The recursive hierarchy can then only be addressed through a collection where this tag is true.
14+
[RecursiveHierarchySupported](Hierarchy.xml#L369) *([Experimental](Common.md#Experimental))*|[Tag](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#Tag)|<a name="RecursiveHierarchySupported"></a>Whether the annotated collection acts as a [`RecursiveHierarchy`](#RecursiveHierarchy) with the given qualifier<br>This tag is applied to a collection with the same qualifier as the [`RecursiveHierarchy`](#RecursiveHierarchy) term which is applied to its entity type. The recursive hierarchy can then only be addressed through a collection where this tag is true.
1515

1616

1717
## Actions
1818

1919
<a name="Template_ChangeNextSiblingAction"></a>
20-
### [Template_ChangeNextSiblingAction](Hierarchy.xml#L380)
20+
### [Template_ChangeNextSiblingAction](Hierarchy.xml#L379)
2121

2222
Template for actions that move a node among its siblings and are named in [`RecursiveHierarchyActions/ChangeNextSiblingAction`](#RecursiveHierarchyActionsType)
2323

2424
Parameter|Type|Description
2525
:--------|:---|:----------
26-
**[Node](Hierarchy.xml#L382)**|EntityType|**Binding parameter:** The node T to be moved
27-
[NextSibling](Hierarchy.xml#L385)|ComplexType?|Key of the node's new next sibling S (null if the node shall become the last sibling)<br>This parameter has properties with the same names, types, and type facets as the key properties of the entity type. next(T) = S after the action. If R is a node with next(R) = S before the action, then next(R) = T after the action, even if S = null. It is an error if S has a different parent than T.
26+
**[Node](Hierarchy.xml#L381)**|EntityType|**Binding parameter:** The node T to be moved
27+
[NextSibling](Hierarchy.xml#L384)|ComplexType?|Key of the node's new next sibling S (null if the node shall become the last sibling)<br>This parameter has properties with the same names, types, and type facets as the key properties of the entity type. next(T) = S after the action. If R is a node with next(R) = S before the action, then next(R) = T after the action, even if S = null. It is an error if S has a different parent than T.
2828

2929

3030
<a name="Template_CopyAction"></a>
31-
### [Template_CopyAction](Hierarchy.xml#L412)
31+
### [Template_CopyAction](Hierarchy.xml#L411)
3232

3333
Template for actions that copy a node and its descendants and are named in [`RecursiveHierarchyActions/CopyAction`](#RecursiveHierarchyActionsType)
3434

@@ -58,8 +58,8 @@ If a certain position of the copy of A among its new siblings is desired, an add
5858

5959
Parameter|Type|Description
6060
:--------|:---|:----------
61-
**[Node](Hierarchy.xml#L439)**|EntityType|**Binding parameter:** The node to be copied
62-
[&rarr;](Hierarchy.xml#L442)|EntityType|The copied node
61+
**[Node](Hierarchy.xml#L438)**|EntityType|**Binding parameter:** The node to be copied
62+
[&rarr;](Hierarchy.xml#L441)|EntityType|The copied node
6363

6464

6565

@@ -87,9 +87,9 @@ Parameter|Type|Description
8787
[HierarchyQualifier](Hierarchy.xml#L321)|[HierarchyQualifier](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Aggregation.V1.md#HierarchyQualifier)|
8888
[NodeProperty](Hierarchy.xml#L322)|String|Property path to the node identifier, evaluated relative to the binding parameter
8989
*[Levels](Hierarchy.xml#L325)*|Int64|*Optional parameter:* The number n of levels to be output, absent means all levels
90-
*[ShowTargets](Hierarchy.xml#L332)*|\[String\]|*Optional parameter:* Targets (for example, of end-user messages) to be shown<br>Each target has the format of the `resourcePath` ABNF rule and identifies an entity whose node in the current hierarchy is to be shown. Showing a node makes the node and its ancestors visible. Example: `ShowTargets=["HierarchyDirectory(1)/Nodes('A')"]`
91-
*[ExpandLevels](Hierarchy.xml#L344)*|\[[TopLevelsExpandType](#TopLevelsExpandType)\]|*Optional parameter:* Nodes to be expanded<br><p>Expansion of nodes happens in the following steps:</p> <ol type="1"> <li>Make all nodes from the top n levels visible.</li> <li>For each entry in <code>ExpandLevels</code> that identifies a visible node, expand or collapse that node (making certain descendants visible or invisible) and mark the entry as done.</li> <li>If at least one entry was marked during the most recent execution of step 2 and there are unmarked entries left, go back to step 2.</li> </ol>
92-
[&rarr;](Hierarchy.xml#L358)|\[EntityType\]|
90+
*[ExpandLevels](Hierarchy.xml#L332)*|\[[TopLevelsExpandType](#TopLevelsExpandType)\]|*Optional parameter:* Nodes to be expanded<br><p>Expansion of nodes happens in the following steps:</p> <ol type="1"> <li>Make all nodes from the top n levels visible.</li> <li>For each entry in <code>ExpandLevels</code> in the given order: If the entry identifies a visible node, expand or collapse that node (making certain descendants visible or invisible).</li> <li>Make the nodes identified by <code>ShowTargets</code> and their ancestors visible.</li> </ol>
91+
*[ShowTargets](Hierarchy.xml#L345)*|\[String\]|*Optional parameter:* Targets (for example, of end-user messages) to be shown<br>Each target has the format of the `resourcePath` ABNF rule and identifies an entity whose node in the current hierarchy is to be shown. Showing a node makes the node and its ancestors visible. Example: `ShowTargets=["HierarchyDirectory(1)/Nodes('A')"]`
92+
[&rarr;](Hierarchy.xml#L357)|\[EntityType\]|
9393

9494

9595
<a name="HierarchyType"></a>
@@ -212,10 +212,10 @@ Property|Type|Description
212212
[CopyAction](Hierarchy.xml#L268)|[QualifiedName?](Common.md#QualifiedName)|Action that copies a node and its descendants, following [this template](#Template_CopyAction)
213213

214214
<a name="TopLevelsExpandType"></a>
215-
## [TopLevelsExpandType](Hierarchy.xml#L360)
215+
## [TopLevelsExpandType](Hierarchy.xml#L359)
216216
Information about nodes to be expanded
217217

218218
Property|Type|Description
219219
:-------|:---|:----------
220-
[NodeID](Hierarchy.xml#L362)|String|Identifier of a node to be expanded
221-
[Levels](Hierarchy.xml#L365)|Int64?|Number of levels to be expanded, null means all levels, 0 means collapsed
220+
[NodeID](Hierarchy.xml#L361)|String|Identifier of a node to be expanded
221+
[Levels](Hierarchy.xml#L364)|Int64?|Number of levels to be expanded, null means all levels, 0 means collapsed

vocabularies/Hierarchy.xml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -329,27 +329,26 @@ and [`RecursiveHierarchy/MatchedDescendantCount`](#RecursiveHierarchyType) are a
329329
</Annotation>
330330
<Annotation Term="Validation.Minimum" Int="1" />
331331
</Parameter>
332-
<Parameter Name="ShowTargets" Type="Collection(Edm.String)" Nullable="false">
333-
<Annotation Term="Core.Description" String="Targets (for example, of end-user messages) to be shown" />
332+
<Parameter Name="ExpandLevels" Type="Collection(Hierarchy.TopLevelsExpandType)" Nullable="false">
333+
<Annotation Term="Core.Description" String="Nodes to be expanded" />
334334
<Annotation Term="Core.LongDescription">
335-
<String>Each target has the format of the `resourcePath` ABNF rule and
336-
identifies an entity whose node in the current hierarchy is to be shown.
337-
Showing a node makes the node and its ancestors visible.
338-
Example: `ShowTargets=["HierarchyDirectory(1)/Nodes('A')"]`</String>
335+
<String>Expansion of nodes happens in the following steps:
336+
1. Make all nodes from the top n levels visible.
337+
2. For each entry in `ExpandLevels` in the given order: If the entry identifies a visible node,
338+
expand or collapse that node (making certain descendants visible or invisible).
339+
3. Make the nodes identified by `ShowTargets` and their ancestors visible.</String>
339340
</Annotation>
340341
<Annotation Term="Core.OptionalParameter">
341342
<Record/>
342343
</Annotation>
343344
</Parameter>
344-
<Parameter Name="ExpandLevels" Type="Collection(Hierarchy.TopLevelsExpandType)" Nullable="false">
345-
<Annotation Term="Core.Description" String="Nodes to be expanded" />
345+
<Parameter Name="ShowTargets" Type="Collection(Edm.String)" Nullable="false">
346+
<Annotation Term="Core.Description" String="Targets (for example, of end-user messages) to be shown" />
346347
<Annotation Term="Core.LongDescription">
347-
<String>Expansion of nodes happens in the following steps:
348-
1. Make all nodes from the top n levels visible.
349-
2. For each entry in `ExpandLevels` that identifies a visible node, expand or collapse that node
350-
(making certain descendants visible or invisible) and mark the entry as done.
351-
3. If at least one entry was marked during the most recent execution of step 2 and
352-
there are unmarked entries left, go back to step 2.</String>
348+
<String>Each target has the format of the `resourcePath` ABNF rule and
349+
identifies an entity whose node in the current hierarchy is to be shown.
350+
Showing a node makes the node and its ancestors visible.
351+
Example: `ShowTargets=["HierarchyDirectory(1)/Nodes('A')"]`</String>
353352
</Annotation>
354353
<Annotation Term="Core.OptionalParameter">
355354
<Record/>

0 commit comments

Comments
 (0)