Updating Hierarchies

For changing the properties of an Hierarchy the following functions can be used.

UpdateHierarchy

This function updates the given Hierarchy in Itlearning, by changing the properties that are given in the hierarchy object. Changing the SyncId of a Hierarchy has to be done with the ChangeHierarchyId function.

Syntax:

OperationResult warning = ImsEsClient.UpdateHierarchy(Hierarchy updatedHierarchy);

Parameters:

updatedHierarchy:

The Hierarchy object containing the updated properties.

Returns:

The OperationResult containing the warning that Itslearning has send back, or if there was none, null.

Exceptions:

  • ImsEsException: If IMS-ES encountered an error in Itslearning, this exception will be thrown.

  • ValidationException: If the updated Hierarchy is not valid (properties too long) this exception will be thrown.


UpdateHierarchies

This function updates the given Hierarchies in Itlearning, by changing the properties that are given in the hierarchy objects.

Syntax:

BatchOperationResult warnings = ImsEsClient.UpdateHierarchies(ICollection<Hierarchy> updatedHierarchies);

Parameters:

updatedHierarchies:

An ICollection with the Hierarchy objects containing the updated properties.

Returns:

A BatchOperationResult with the list of warnings that Itslearning has send back (this list can be empty).

Exceptions:

  • ImsEsBatchException: If IMS-ES encountered an error in Itslearning, this exception will be thrown.

  • ValidationException: If one of the updated Hierarchies is not valid (properties too long) this exception will be thrown.


ReplaceHierarchy

This function replaces the given Hierarchy in Itslearning, by changing the properties that are given in the hierarchy object, and deleting all the properties that are not given. Changing the SyncId of a Hierarchy has to be done with the ChangeHierarchyId function.

Syntax:

OperationResult warning = ImsEsClient.ReplaceHierarchy(Hierarchy updatedHierarchy);

Parameters:

updatedHierarchy:

The Hierarchy object containing the updated properties.

Returns:

The OperationResult containing the warning that Itslearning has send back, or if there was none, null.

Exceptions:

  • ImsEsException: If IMS-ES encountered an error in Itslearning, this exception will be thrown.

  • ValidationException: If the updated Hierarchy is not valid (required properties not filled in, other properties too long) this exception will be thrown.


ReplaceHierarchies

This function replaces the given Hierarchies in Itslearning, by changing the properties that are given in the hierarchy objects, and deleting all the properties that are not given.

Syntax:

BatchOperationResult warnings = ImsEsClient.ReplaceHierarchies(ICollection<Hierarchy> updatedHierarchies);

Parameters:

updatedHierarchies:

An ICollection with the Hierarchy objects containing the updated properties.

Returns:

A BatchOperationResult with the list of warnings that Itslearning has send back (this list can be empty).

Exceptions:

  • ImsEsBatchException: If IMS-ES encountered an error in Itslearning, this exception will be thrown.

  • ValidationException: If one of the updated Hierarchies is not valid (required properties not filled in, other properties too long) this exception will be thrown.


ChangeHierarchyId

This function changes the SyncId of a Hierarchy.

Syntax:

OperationResult warning = ImsEsClient.ChangeHierarchyId(string oldId, string newId);

Parameters:

oldId:

The current SyncId of the Hierarchy.

newId:

The new SyncId for the Hierarchy.

Returns:

The OperationResult containing the warning that Itslearning has send back, or if there was none, null.

Exceptions:

  • ImsEsException: If IMS-ES encountered an error in Itslearning, this exception will be thrown.


ChangeHierarchyIds

This function changed the SyncId of a Hierarchy. The input of this function is an array with KeyPairs, an KeyPair is an custom object with two properties: OldKey and NewKey. This is done to easily group the keys (ids) together.

Syntax:

BatchOperationResult warnings = ImsEsClient.ChangeHierarchyIds(ICollection<KeyPair> syncIdPairs);

Parameters:

syncIdPairs:

An array with the id pairs that need changing.

Returns:

A BatchOperationResult with the list of warnings that Itslearning has send back (this list can be empty).

Exceptions:

  • ImsEsBatchException: If IMS-ES encountered an error in Itslearning, this exception will be thrown.