Class Scorm2004Manifest

java.lang.Object
dev.jcputney.elearning.parser.input.scorm2004.Scorm2004Manifest
All Implemented Interfaces:
PackageManifest, Serializable

public class Scorm2004Manifest extends Object implements PackageManifest
Represents the SCORM IMS Content Packaging (IMSCP) elements according to the imscp_v1p1 schema.

This class encapsulates properties and structure for SCORM content packages, including manifest, metadata, organizations, resources, and dependencies. It is designed to conform to the IMS Content Packaging specification, enabling SCORM-compliant content to be organized and referenced in an LMS.

The IMSCP namespace is specified by NAMESPACE_URI, and this class is designed to align with the SCORM 2004 standards.

The following schema shows the structure of a "manifest" element:

   <?xml version = "1.0" encoding = "UTF-8"?>
   <xsd:schema xmlns = "http://www.imsglobal.org/xsd/imscp_v1p1"
   	 targetNamespace = "http://www.imsglobal.org/xsd/imscp_v1p1"
   	 xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
   	 xmlns:xsd = "http://www.w3.org/2001/XMLSchema"
   	 version = "IMS CP 1.1.4"
   	 elementFormDefault = "qualified">
   	<xsd:import namespace = "http://www.w3.org/XML/1998/namespace" schemaLocation = "xml.xsd"/>

   	<xsd:attributeGroup name = "attr.base">
   		<xsd:attribute ref = "xml:base"/>
   	</xsd:attributeGroup>
   	<xsd:attributeGroup name = "attr.default">
   		<xsd:attribute name = "default" type = "xsd:IDREF"/>
   	</xsd:attributeGroup>
   	<xsd:attributeGroup name = "attr.href">
   		<xsd:attribute name = "href" type = "xsd:anyURI"/>
   	</xsd:attributeGroup>
   	<xsd:attributeGroup name = "attr.href.req">
   		<xsd:attribute name = "href" use = "required" type = "xsd:anyURI"/>
   	</xsd:attributeGroup>
   	<xsd:attributeGroup name = "attr.identifier.req">
   		<xsd:attribute name = "identifier" use = "required" type = "xsd:ID"/>
   	</xsd:attributeGroup>
   	<xsd:attributeGroup name = "attr.identifier">
   		<xsd:attribute name = "identifier" type = "xsd:ID"/>
   	</xsd:attributeGroup>
   	<xsd:attributeGroup name = "attr.isvisible">
   		<xsd:attribute name = "isvisible" type = "xsd:boolean"/>
   	</xsd:attributeGroup>
   	<xsd:attributeGroup name = "attr.parameters">
   		<xsd:attribute name = "parameters" type = "xsd:string"/>
   	</xsd:attributeGroup>
   	<xsd:attributeGroup name = "attr.identifierref">
   		<xsd:attribute name = "identifierref" type = "xsd:string"/>
   	</xsd:attributeGroup>
   	<xsd:attributeGroup name = "attr.identifierref.req">
   		<xsd:attribute name = "identifierref" use = "required" type = "xsd:string"/>
   	</xsd:attributeGroup>
   	<xsd:attributeGroup name = "attr.resourcetype.req">
   		<xsd:attribute name = "type" use = "required" type = "xsd:string"/>
   	</xsd:attributeGroup>
   	<xsd:attributeGroup name = "attr.structure.req">
   		<xsd:attribute name = "structure" default = "hierarchical" type = "xsd:string"/>
   	</xsd:attributeGroup>
   	<xsd:attributeGroup name = "attr.version">
   		<xsd:attribute name = "version" type = "xsd:string"/>
   	</xsd:attributeGroup>
   	<xsd:group name = "grp.any">
   		<xsd:annotation>
   		<xsd:documentation>Any namespaced element from any namespace may be included within an "any" element.  The namespace for the imported element must be defined in the instance, and the schema must be imported.  </xsd:documentation>
   		</xsd:annotation>
   		<xsd:sequence>
   			<xsd:any namespace = "##other" processContents = "lax" minOccurs = "0" maxOccurs = "unbounded"/>
   		</xsd:sequence>
   	</xsd:group>

   	<xsd:element name = "dependency" type = "dependencyType"/>
   	<xsd:element name = "file" type = "fileType"/>
   	<xsd:element name = "item" type = "itemType"/>
   	<xsd:element name = "manifest" type = "manifestType"/>
   	<xsd:element name = "metadata" type = "metadataType"/>
   	<xsd:element name = "organization" type = "organizationType"/>
   	<xsd:element name = "organizations" type = "organizationsType"/>
   	<xsd:element name = "resource" type = "resourceType"/>
   	<xsd:element name = "resources" type = "resourcesType"/>
   	<xsd:element name = "schema" type = "schemaType"/>
   	<xsd:element name = "schemaversion" type = "schemaversionType"/>
   	<xsd:element name = "title" type = "titleType"/>

   	<xsd:complexType name = "dependencyType">
   		<xsd:sequence>
   			<xsd:group ref = "grp.any"/>
   		</xsd:sequence>
   		<xsd:attributeGroup ref = "attr.identifierref.req"/>
   		<xsd:anyAttribute namespace = "##other" processContents = "strict"/>
   	</xsd:complexType>

   	<xsd:complexType name = "fileType">
   		<xsd:sequence>
   			<xsd:element ref = "metadata" minOccurs = "0"/>
   			<xsd:group ref = "grp.any"/>
   		</xsd:sequence>
   		<xsd:attributeGroup ref = "attr.href.req"/>
   		<xsd:anyAttribute namespace = "##other" processContents = "lax"/>
   	</xsd:complexType>

   	<xsd:complexType name = "itemType">
   		<xsd:sequence>
   			<xsd:element ref = "title" minOccurs = "0"/>
   			<xsd:element ref = "item" minOccurs = "0" maxOccurs = "unbounded"/>
   			<xsd:element ref = "metadata" minOccurs = "0"/>
   			<xsd:group ref = "grp.any"/>
   		</xsd:sequence>
   		<xsd:attributeGroup ref = "attr.identifier.req"/>
   		<xsd:attributeGroup ref = "attr.identifierref"/>
   		<xsd:attributeGroup ref = "attr.isvisible"/>
   		<xsd:attributeGroup ref = "attr.parameters"/>
   		<xsd:anyAttribute namespace = "##other" processContents = "lax"/>
   	</xsd:complexType>

   	<xsd:complexType name = "manifestType">
   		<xsd:sequence>
   			<xsd:element ref = "metadata" minOccurs = "0"/>
   			<xsd:element ref = "organizations"/>
   			<xsd:element ref = "resources"/>
   			<xsd:element ref = "manifest" minOccurs = "0" maxOccurs = "unbounded"/>
   			<xsd:group ref = "grp.any"/>
   		</xsd:sequence>
   		<xsd:attributeGroup ref = "attr.identifier.req"/>
   		<xsd:attributeGroup ref = "attr.version"/>
   		<xsd:attribute ref = "xml:base"/>
   		<xsd:anyAttribute namespace = "##other" processContents = "lax"/>
   	</xsd:complexType>

   	<xsd:complexType name = "metadataType">
   		<xsd:sequence>
   			<xsd:element ref = "schema" minOccurs = "0"/>
   			<xsd:element ref = "schemaversion" minOccurs = "0"/>
   			<xsd:group ref = "grp.any"/>
   		</xsd:sequence>
   		<xsd:anyAttribute namespace = "##other" processContents = "lax"/>
   	</xsd:complexType>

   	<xsd:complexType name = "organizationsType">
   		<xsd:sequence>
   			<xsd:element ref = "organization" minOccurs = "0" maxOccurs = "unbounded"/>
   			<xsd:group ref = "grp.any"/>
   		</xsd:sequence>
   		<xsd:attributeGroup ref = "attr.default"/>
   		<xsd:anyAttribute namespace = "##other" processContents = "lax"/>
   	</xsd:complexType>

   	<xsd:complexType name = "organizationType">
   		<xsd:sequence>
   			<xsd:element ref = "title" minOccurs = "0"/>
   			<xsd:element ref = "item" maxOccurs = "unbounded"/>
   			<xsd:element ref = "metadata" minOccurs = "0"/>
   			<xsd:group ref = "grp.any"/>
   		</xsd:sequence>
   		<xsd:attributeGroup ref = "attr.identifier.req"/>
   		<xsd:attributeGroup ref = "attr.structure.req"/>
   		<xsd:anyAttribute namespace = "##other" processContents = "lax"/>
   	</xsd:complexType>

   	<xsd:complexType name = "resourcesType">
   		<xsd:sequence>
   			<xsd:element ref = "resource" minOccurs = "0" maxOccurs = "unbounded"/>
   			<xsd:group ref = "grp.any"/>
   		</xsd:sequence>
   		<xsd:attributeGroup ref = "attr.base"/>
   		<xsd:anyAttribute namespace = "##other" processContents = "lax"/>
   	</xsd:complexType>

   	<xsd:complexType name = "resourceType">
   		<xsd:sequence>
   			<xsd:element ref = "metadata" minOccurs = "0"/>
   			<xsd:element ref = "file" minOccurs = "0" maxOccurs = "unbounded"/>
   			<xsd:element ref = "dependency" minOccurs = "0" maxOccurs = "unbounded"/>
   			<xsd:group ref = "grp.any"/>
   		</xsd:sequence>
   		<xsd:attributeGroup ref = "attr.identifier.req"/>
   		<xsd:attributeGroup ref = "attr.resourcetype.req"/>
   		<xsd:attributeGroup ref = "attr.base"/>
   		<xsd:attributeGroup ref = "attr.href"/>
   		<xsd:anyAttribute namespace = "##other" processContents = "lax"/>
   	</xsd:complexType>

   	<xsd:simpleType name = "schemaType">
   		<xsd:restriction base = "xsd:string"/>
   	</xsd:simpleType>
   	<xsd:simpleType name = "schemaversionType">
   		<xsd:restriction base = "xsd:string"/>
   	</xsd:simpleType>
   	<xsd:simpleType name = "titleType">
   		<xsd:restriction base = "xsd:string"/>
   	</xsd:simpleType>

   </xsd:schema>
 
See Also:
  • Field Details

    • NAMESPACE_URI

      public static final String NAMESPACE_URI
      The XML namespace URI for SCORM IMS Content Packaging (imscp_v1p1).
      See Also:
  • Constructor Details

    • Scorm2004Manifest

      public Scorm2004Manifest()
  • Method Details

    • getTitle

      public String getTitle()
      Returns the title of the content package, which is typically the name or title of the course.
      Specified by:
      getTitle in interface PackageManifest
      Returns:
      the title of the content package
    • getDescription

      public String getDescription()
      Returns the description of the content package, which is typically a summary or overview of the content.
      Specified by:
      getDescription in interface PackageManifest
      Returns:
      the description of the content package
    • getLaunchUrl

      public String getLaunchUrl()
      Returns the launch URL for the content package, which is typically the URL of the first resource in the package.
      Specified by:
      getLaunchUrl in interface PackageManifest
      Returns:
      the launch URL for the content package
    • getLaunchUrlForItem

      public Optional<String> getLaunchUrlForItem(String itemId)
      Returns the launch URL for a specific item within the content package, which is typically the URL of the first resource associated with the item.
      Parameters:
      itemId - the unique identifier of the item
      Returns:
      an Optional containing the launch URL for the item, or empty if no URL is available
    • getDuration

      public Duration getDuration()
      Description copied from interface: PackageManifest
      The duration of the package, which indicates how long the package is expected to take.
      Specified by:
      getDuration in interface PackageManifest
      Returns:
      the duration of the package
    • getGlobalObjectiveIds

      public Set<String> getGlobalObjectiveIds()
      Retrieves the set of global objective IDs from the manifest.

      A global objective ID is defined by the presence of a targetObjectiveID in a mapInfo element. Global objectives are used to share data between different SCOs.

      Returns:
      A set of global objective IDs, or an empty set if none are found
    • getSCOIds

      public Set<String> getSCOIds()
      Retrieves the set of SCO IDs from the manifest.

      A SCO (Shareable Content Object) is a resource with scormType="sco". SCOs are the trackable, interactive components of a SCORM package that communicate with the LMS.

      Returns:
      A set of SCO IDs, or an empty set if none are found
    • buildActivityTree

      public Optional<ActivityTree> buildActivityTree()
      Builds an ActivityTree from this manifest.

      The ActivityTree represents the hierarchical structure of learning activities in the content package, including sequencing information. It can be used by an LMS to implement SCORM 2004 sequencing and navigation.

      Returns:
      An Optional containing the ActivityTree, or empty if no default organization is found
    • usesSequencing

      public boolean usesSequencing()
      Checks if this manifest uses sequencing.

      A manifest uses sequencing if it has a sequencing collection or if any organization or item in the manifest has sequencing information.

      Returns:
      true if this manifest uses sequencing, false otherwise