Class Scorm2004Manifest

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

public final 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()
      Default constructor for the Scorm2004Manifest class. This constructor initializes an instance of the Scorm2004Manifest without any additional setup or parameters.
  • 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 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()
      Retrieves the duration of the content package in a null-safe manner. If no duration is available, a default value of Duration.ZERO is returned.
      Specified by:
      getDuration in interface PackageManifest
      Returns:
      the duration of the content package, or Duration.ZERO if unavailable
    • 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.

      JSON serialization note: This property is exposed as "scoids" for backward compatibility but is marked as read-only to prevent Jackson from attempting to populate it during deserialization (which could cause UnsupportedOperationException due to immutable Sets).

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

      public 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
    • getSequencingLevel

      public SequencingUsageDetector.SequencingLevel getSequencingLevel()
      Returns the detected sequencing level for this manifest.
      Returns:
      the sequencing level (NONE, MINIMAL, or FULL)
    • getSequencingIndicators

      public Set<SequencingUsageDetector.SequencingIndicator> getSequencingIndicators()
      Returns the set of sequencing indicators discovered within this manifest.
      Returns:
      immutable set of detected sequencing indicators
    • getIdentifier

      public String getIdentifier()
      Retrieves the identifier of this SCORM 2004 manifest.
      Specified by:
      getIdentifier in interface PackageManifest
      Returns:
      the identifier of the manifest as a String
    • setIdentifier

      public void setIdentifier(String identifier)
      Sets the identifier for the SCORM 2004 manifest.
      Parameters:
      identifier - the unique identifier to be assigned to the manifest
    • getVersion

      public String getVersion()
      Retrieves the version of the SCORM 2004 manifest.
      Specified by:
      getVersion in interface PackageManifest
      Returns:
      the version as a String
    • setVersion

      public void setVersion(String version)
      Sets the version of the SCORM 2004 manifest.
      Parameters:
      version - the version to be assigned to the manifest
    • getMetadata

      public Scorm2004CourseMetadata getMetadata()
      Retrieves the metadata associated with the SCORM 2004 course manifest.
      Returns:
      the metadata of the SCORM 2004 course as an instance of Scorm2004CourseMetadata
    • setMetadata

      public void setMetadata(Scorm2004CourseMetadata metadata)
      Sets the metadata for the SCORM 2004 course manifest.
      Parameters:
      metadata - the metadata to be associated with the SCORM 2004 course
    • getOrganizations

      public Scorm2004Organizations getOrganizations()
      Retrieves the organizations defined in the SCORM 2004 manifest.
      Returns:
      an instance of Scorm2004Organizations representing the organizations in the manifest
    • setOrganizations

      public void setOrganizations(Scorm2004Organizations organizations)
      Sets the organizations information for the SCORM 2004 manifest.
      Parameters:
      organizations - an instance of Scorm2004Organizations representing the organizations to be defined in the manifest
    • getResources

      public Scorm2004Resources getResources()
      Retrieves the SCORM 2004 resources.
      Returns:
      the Scorm2004Resources object containing the resources.
    • setResources

      public void setResources(Scorm2004Resources resources)
      Sets the SCORM 2004 resources.
      Parameters:
      resources - the SCORM 2004 resources to be set
    • getSequencingCollection

      public SequencingCollection getSequencingCollection()
      Retrieves the sequencing collection instance associated with this object.
      Returns:
      the SequencingCollection instance maintained by this object
    • setSequencingCollection

      public void setSequencingCollection(SequencingCollection sequencingCollection)
      Sets the sequencingCollection with the provided SequencingCollection object.
      Parameters:
      sequencingCollection - the SequencingCollection to be assigned
    • getAdlcpNamespaceUri

      public String getAdlcpNamespaceUri()
      Retrieves the ADLCP (Advanced Distributed Learning Content Package) namespace URI.
      Returns:
      The ADLCP namespace URI as a String.
    • setAdlcpNamespaceUri

      public void setAdlcpNamespaceUri(String adlcpNamespaceUri)
      Sets the ADLCP namespace URI.
      Parameters:
      adlcpNamespaceUri - the ADLCP namespace URI to set
    • getImsssNamespaceUri

      public String getImsssNamespaceUri()
      Retrieves the IMS Simple Sequencing namespace URI.
      Returns:
      the IMS Simple Sequencing namespace URI as a string
    • setImsssNamespaceUri

      public void setImsssNamespaceUri(String imsssNamespaceUri)
      Sets the IMS Simple Sequencing (IMSSS) namespace URI.
      Parameters:
      imsssNamespaceUri - the namespace URI to be set for IMS Simple Sequencing
    • getAdlseqNamespaceUri

      public String getAdlseqNamespaceUri()
      Retrieves the namespace URI associated with the ADL sequence.
      Returns:
      the namespace URI as a String.
    • setAdlseqNamespaceUri

      public void setAdlseqNamespaceUri(String adlseqNamespaceUri)
      Sets the namespace URI for ADL sequencing.
      Parameters:
      adlseqNamespaceUri - the namespace URI to be set for ADL sequencing
    • getAdlnavNamespaceUri

      public String getAdlnavNamespaceUri()
      Retrieves the namespace URI associated with ADL navigation.
      Returns:
      the namespace URI as a String
    • setAdlnavNamespaceUri

      public void setAdlnavNamespaceUri(String adlnavNamespaceUri)
      Sets the ADL Navigation namespace URI.
      Parameters:
      adlnavNamespaceUri - the namespace URI to set for ADL Navigation
    • getSchemaLocation

      public String getSchemaLocation()
      Retrieves the schema location.
      Returns:
      the schema location as a String
    • setSchemaLocation

      public void setSchemaLocation(String schemaLocation)
      Sets the schema location for the current instance.
      Parameters:
      schemaLocation - the schema location to be set, typically a URI or path that specifies the location of the schema.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object