This API was built to create a link element of an old type. Please use Create.Extension.Instance Link instead.

This method will create a single link element within a course.  The link is created under a specified parent folder in the course. If parent folder is not specified, then by default it will be placed under the course root folder.

If the specified link does not start with an http protocol, then the message processor will pre-append “http://”. It is good practice to

No other checks are made by itslearning to ensure the link is valid. These checks should be made by 3rd party user.


This type of message will create a link in a course.  The link element can be added to the course root folder or another folder within a course.  Each link should have a unique SynchKey associated with it up to the size of 128 characters.

A UserId or UserSyncKey needs to be specified which identifies the user who created the link.  

An Active parameter can be set on the link. This decides whether a link is shown in the course or not.  By default if the active parameter is set to false, so the element will not be displayed.

By default all link types (LinkType) are “Ordinary” links. Other options do include SCORM and AICC

Links have an OpenIn option, where you can specify how a link gets opened when it is clicked on. By default a link is opened in the existing window.  However, there are other options to open in a New, or various popup sized windows (800x600Popup, 640x4800Popup, 1024x768Popup).


Name
Description
Type
M/O
Message Type
ID of the course where the element is to be created.
Text. "CreateCourseElementLink"
M
SyncKey
External SyncKey for the created content.
Text
M

SiteId

Site where action will be executed

Integer

O

VendorId

VendorId which will be associated with created content

Text

O

CourseID
ID of the course where the element is to be created.
Integer
O/M
CourseSyncKey
SyncKeyID of the course where the element is to be created.
Text
O/M

ParentID

ID of the folder where the element is to be created. If not specified then create in root.
This is a ID of a previously created folder int he course.

Integer

O

ParentSyncKey
SyncKey of the folder where the element is to be created. If not specified then create in root.
This is a SyncKey of a previously created folder int he course.
Text

O

UserID
UserID of the creator.
Integer
O/M
UserSyncKey
User SyncKeyID of the creator.
Text
O/M
Active
Is the element active?
True = "Active".
False = "Not Active".
Default is "Active".
Boolean.
O
Title

Description of the link.
Text
Must not be blank. Must follow same rules as UI
M

Link
Link
Text
Must not be blank. Must follow same rules as UI
M
LinkType
Link type.
Default is "Ordinary".
Normal = "Ordinary Link".
Scorm = "SCORM API Communication"
AICC = "AICC HACP Communication"
  • Ordinary
  • SCORM
  • AICC
O
OpenIn

How the link should open. Open in
Default is ?Existing?.
Existing= ?Existing window?.
New = ?New window?.
800x600Popup = ?800x600 Popup?
640x480Popup = ?800x600Popup?
1024x768Popup=?1024x768Popup?
  • Existing
  • New
  • 800x600Popup
  • 640x480Popup
  • 1024x768Popup

O

Notes:

Either CourseID or CourseSyncKey must be specified. This means specify at least one is mandatory.
Either CreatorUserID or CreatorSyncKey must be specified. This means specify at least one is mandatory.
Both ParentID and ParentSyncKey are optional. Possible use only one of them either ParentID or ParentSyncKey.

In order to create a course link element, a user needs to add a message with type corresponding to action Create.Course.Link.Element.

Result of that message processing can be acquired using GetMessageResult method with message identifier as an input parameter.


Create Course Link Schema
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:message-schema" elementFormDefault="qualified"
targetNamespace="urn:message-schema">
<xs:element name="Message" type="MessageType" />
<xs:complexType name="MessageType">
<xs:sequence>
<xs:element name="SyncKeys" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="SyncKey" minOccurs="0" maxOccurs="1" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SiteId" minOccurs="0" maxOccurs="1" type="xs:int" />
<xs:element name="VendorId" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="36"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="CreateCourseElementLink" type="CreateLinkElementType" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="CreateLinkElementType">
<xs:sequence>
<xs:choice minOccurs="1" maxOccurs="1">
<xs:element name="CourseId" type="xs:integer" />
<xs:element name="CourseSyncKey" type="xs:string" />
</xs:choice>
<xs:choice minOccurs="0" maxOccurs="1">
<xs:element name="ParentId" type="xs:integer" />
<xs:element name="ParentSyncKey" type="xs:string" />
</xs:choice>
<xs:choice minOccurs="1" maxOccurs="1">
<xs:element name="UserId" type="xs:integer" />
<xs:element name="UserSyncKey" type="xs:string" />
</xs:choice>
<xs:element name="Active" type="xs:boolean" default="true" minOccurs="0" maxOccurs="1" />
<xs:element name="Title" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="64"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Link" minOccurs="1" maxOccurs="1" type="xs:string" />
<xs:element name="LinkType" minOccurs="0" maxOccurs="1" type="LinkTypeValue" />
<xs:element name="OpenIn" minOccurs="0" maxOccurs="1" type="OpenInType" />
</xs:sequence>
</xs:complexType>
<xs:simpleType name="LinkTypeValue">
<xs:restriction base="xs:string">
<xs:enumeration value="Ordinary" />
<xs:enumeration value="SCORM" />
<xs:enumeration value="AICC" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="OpenInType">
<xs:restriction base="xs:string">
<xs:enumeration value="New" />
<xs:enumeration value="Existing" />
<xs:enumeration value="800x600Popup" />
<xs:enumeration value="640x480Popup" />
<xs:enumeration value="1024x768Popup" />
</xs:restriction>
</xs:simpleType>
</xs:schema>



<Message xmlns="urn:message-schema">
<SyncKeys>
<SyncKey>SyncKey1</SyncKey>
</SyncKeys>
<CreateCourseElementLink>
<CourseId>1</CourseId>
<ParentSyncKey>ParentSyncKey1</ParentSyncKey>
<UserId>1</UserId>
<Active>true</Active>
<Title>Title1</Title>
<Link>Link1</Link>
<LinkType>Ordinary</LinkType>
<OpenIn>New</OpenIn>
</CreateCourseElementLink>
</Message>


Before message is processed the MigrationProcessor will validate the message content and state of objects referred in it. These are validation rules:

  1. Input matches the schema below.
  2. Check the SyncKey is unqiue.
  3. User must exist.
  4. User must not be external. Check the flag (external_user_id and external_customer_id for user created AICC).
  5. User must not be deleted.
  6. Course must exist.
  7. Course must not be external.
  8. Course must not be deleted.
  9. If specified: ParentId must be the ID of a folder within the course.
  10. If specified: ParentId must be a folder.
  11. If specified: ParentId must not be deleted.
  12. If specified: ParentSyncKey must be the SyncKey of a folder within the course.
  13. If specified: ParentSyncKey must be a folder.
  14. If specified: ParentSyncKey must not be deleted.
  15. Consumer must have access to organisation where course is created. The following error is returned - Your security settings doesn't allow you to perform that operation. Please contact administration to grant you an access to {HieararchyName} organisation.