convertToSetArticle
Synopsis
string convertToSetArticle(SessionId sessionId,
BItemId folderId,
OperationMode opMode)
throws BasketServiceFault;
See also: SessionId, BItemId, OperationMode, BasketServiceFault
This operation converts the specified basket folder into a set-article. Upon successful completion, the folder item specified by the folderId parameter has been replaced by a new set-article item, all children of the folder item are now children of the set-article item, and a subset of the descendants of the set-article item (usually all) is part of the set-article. The item ID of the set-article item is returned.
The flags in the operation mode parameter opMode control the behaviour of the operation as described below.
The following list describes in detail how the set of parts of the new set-article is constructed, how special conditions are handled, and how the actual conversion of the folder to the set-article is finally done:
-
Descendants of the folder that can never be part of a set-article due to their type are ignored (except for set-article items, see below).
-
If at least one descendant is a set-article item, and the
breakUpSetArticlesflag is set inopMode, all such set-article items and their parts are added to the set of new parts. -
For each descendant that is neither a set-article item, a set-article part, or a sub-article item, add the item to the set of new parts.
-
If at least one descendant is a sub-article item whose main article item is neither an element of the set of new parts, nor part of a set-article, and the
mainArticlesflag is set inopMode, then ensure that the main article items of all such sub-article items are elements of the set of new parts, adding them if necessary. -
If the set of new parts contains one or more set-articles, the set-articles are broken up and the set-article items are replaced in the set of new parts with the folders created in place of the set-article items.
-
The new set-article item is created as an immediate sibling of the folder item, all children of the folder item are moved to the set-article item (including all their descendants), and the folder item is deleted.
-
All items in the set of new parts become parts of the new set-article item.