Class Scorm2004Parser
java.lang.Object
dev.jcputney.elearning.parser.parsers.BaseParser<Scorm2004Metadata,Scorm2004Manifest>
dev.jcputney.elearning.parser.parsers.Scorm2004Parser
- All Implemented Interfaces:
ModuleParser<Scorm2004Manifest>
Parses SCORM 2004 modules by reading the imsmanifest.xml file and extracting core metadata,
including sequencing information, custom data (adlcp:data), prerequisites, mastery score, and any
additional metadata files referenced within the manifest.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of the manifest file for SCORM 2004 modules.Fields inherited from class dev.jcputney.elearning.parser.parsers.BaseParser
moduleFileProvider, options, XAPI_JS_FILE, XAPI_SEND_STATEMENT_FILE -
Constructor Summary
ConstructorsConstructorDescriptionScorm2004Parser(FileAccess fileAccess) Constructs a Scorm2004Parser with the specified FileAccess instance.Scorm2004Parser(FileAccess fileAccess, ParserOptions options) Constructs a Scorm2004Parser with the specified FileAccess instance and parser options.Scorm2004Parser(ModuleFileProvider moduleFileProvider) Constructs a Scorm2004Parser with the specified ModuleFileProvider instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected Scorm2004MetadataextractMetadata(Scorm2004Manifest manifest, ValidationResult validation) Extracts metadata from a parsed and validated manifest.Retrieves the class type of the SCORM 2004 manifest.protected StringAbstract method to return the filename of the manifest for the specific parser.parseManifest(String manifestPath) Parses and optionally XSD-validates the SCORM 2004 manifest.protected ValidationResultvalidateManifest(Scorm2004Manifest manifest) Validates a parsed manifest and returns validation results.Methods inherited from class dev.jcputney.elearning.parser.parsers.BaseParser
checkForXapi, getModuleType, getOptions, loadExternalMetadataIntoMetadata, parseAndValidate, parseOnly, parseXmlToObject
-
Field Details
-
MANIFEST_FILE
The name of the manifest file for SCORM 2004 modules.- See Also:
-
-
Constructor Details
-
Scorm2004Parser
Constructs a Scorm2004Parser with the specified FileAccess instance.- Parameters:
fileAccess- An instance of FileAccess for reading files in the module package.
-
Scorm2004Parser
Constructs a Scorm2004Parser with the specified FileAccess instance and parser options.- Parameters:
fileAccess- An instance of FileAccess for reading files in the module package.options- The parser options to control validation and calculation behavior.
-
Scorm2004Parser
Constructs a Scorm2004Parser with the specified ModuleFileProvider instance.- Parameters:
moduleFileProvider- An instance of ModuleFileProvider for reading files in the module package.
-
-
Method Details
-
getManifestClass
Retrieves the class type of the SCORM 2004 manifest.- Specified by:
getManifestClassin classBaseParser<Scorm2004Metadata,Scorm2004Manifest> - Returns:
- The class type of Scorm2004Manifest.
-
parseManifest
public Scorm2004Manifest parseManifest(String manifestPath) throws IOException, XMLStreamException, ManifestParseException Parses and optionally XSD-validates the SCORM 2004 manifest.- Overrides:
parseManifestin classBaseParser<Scorm2004Metadata,Scorm2004Manifest> - Parameters:
manifestPath- the file path to the manifest file to be parsed. This cannot be null.- Returns:
- an object of type M representing the parsed manifest content.
- Throws:
IOException- if an error occurs while reading the manifest file.XMLStreamException- if an error occurs while parsing the XML content of the manifest.ManifestParseException- if the manifest file cannot be read or parsed.
-
validateManifest
Description copied from class:BaseParserValidates a parsed manifest and returns validation results. Subclasses implement this to use their parser-specific validators.- Specified by:
validateManifestin classBaseParser<Scorm2004Metadata,Scorm2004Manifest> - Parameters:
manifest- The parsed manifest to validate- Returns:
- ValidationResult containing any errors or warnings
-
extractMetadata
protected Scorm2004Metadata extractMetadata(Scorm2004Manifest manifest, ValidationResult validation) throws ModuleException Description copied from class:BaseParserExtracts metadata from a parsed and validated manifest.- Specified by:
extractMetadatain classBaseParser<Scorm2004Metadata,Scorm2004Manifest> - Parameters:
manifest- The parsed manifestvalidation- The validation result (for reference during extraction)- Returns:
- Module-specific metadata
- Throws:
ModuleException- if metadata extraction fails
-
getManifestFileName
Description copied from class:BaseParserAbstract method to return the filename of the manifest for the specific parser.- Specified by:
getManifestFileNamein classBaseParser<Scorm2004Metadata,Scorm2004Manifest> - Returns:
- The manifest filename (e.g., "imsmanifest.xml", "cmi5.xml")
-