Example #1
0
        /// <summary>
        /// Get the Course Metadata in XML Format
        /// </summary>
        /// <param name="courseId">Unique Identifier for the course</param>
        /// <param name="versionId">Version of the specified course</param>
        /// <param name="scope">Defines the scope of the data to return: Course or Activity level</param>
        /// <param name="format">Defines the amount of data to return:  Summary or Detailed</param>
        /// <returns>XML string representing the Metadata</returns>
        public string GetMetadata(string courseId, int versionId, MetadataScope scope, MetadataFormat format)
        {
            ServiceRequest request = new ServiceRequest(configuration);

            request.Parameters.Add("courseid", courseId);
            if (versionId != Int32.MinValue)
            {
                request.Parameters.Add("versionid", versionId);
            }
            request.Parameters.Add("scope", Enum.GetName(scope.GetType(), scope).ToLower());
            request.Parameters.Add("format", Enum.GetName(format.GetType(), format).ToLower());
            XmlDocument response = request.CallService("rustici.course.getMetadata");

            // Return the subset of the xml starting with the top <object>
            return(response.ChildNodes[1].InnerXml);
        }
        /// <summary>
        /// Get the Course Metadata in XML Format
        /// </summary>
        /// <param name="courseId">Unique Identifier for the course</param>
        /// <param name="versionId">Version of the specified course</param>
        /// <param name="scope">Defines the scope of the data to return: Course or Activity level</param>
        /// <param name="format">Defines the amount of data to return:  Summary or Detailed</param>
        /// <returns>XML string representing the Metadata</returns>
        public string GetMetadata(string courseId, int versionId, MetadataScope scope, MetadataFormat format)
        {
            ServiceRequest request = new ServiceRequest(configuration);
            request.Parameters.Add("courseid", courseId);
            if (versionId != Int32.MinValue)
            {
                request.Parameters.Add("versionid", versionId);
            }
            request.Parameters.Add("scope", Enum.GetName(scope.GetType(), scope).ToLower());
            request.Parameters.Add("format", Enum.GetName(format.GetType(), format).ToLower());
            XmlDocument response = request.CallService("rustici.course.getMetadata");

            // Return the subset of the xml starting with the top <object>
            return response.ChildNodes[1].InnerXml;
        }