Class Scorm12Parser
java.lang.Object
dev.jcputney.elearning.parser.parsers.BaseParser<Scorm12Metadata,Scorm12Manifest>
dev.jcputney.elearning.parser.parsers.Scorm12Parser
- All Implemented Interfaces:
ModuleParser<Scorm12Manifest>
Parses SCORM 1.2 modules by reading the imsmanifest.xml file and extracting core metadata.
This parser extracts key information such as title, description, identifier, launch URL, version,
and optional fields like mastery score and custom data, storing them in a standardized
ModuleMetadata object.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of the manifest file for SCORM 1.2 modules.Fields inherited from class dev.jcputney.elearning.parser.parsers.BaseParser
moduleFileProvider, options, XAPI_JS_FILE, XAPI_SEND_STATEMENT_FILE -
Constructor Summary
ConstructorsConstructorDescriptionScorm12Parser(FileAccess fileAccess) Constructs a Scorm12Parser with the specified FileAccess instance.Scorm12Parser(FileAccess fileAccess, ParserOptions options) Constructs a Scorm12Parser with the specified FileAccess instance and parser options.Scorm12Parser(ModuleFileProvider moduleFileProvider) Constructs a Scorm12Parser with the specified ModuleFileProvider instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected Class<Scorm12Manifest>Returns the class type of the SCORM 1.2 manifest.parse()Parses the SCORM 1.2 module located at the specified modulePath.validate()Validates the SCORM 1.2 module without fully parsing it.Methods inherited from class dev.jcputney.elearning.parser.parsers.BaseParser
checkForXapi, getOptions, loadExternalMetadataIntoMetadata, parseManifest, parseXmlToObject
-
Field Details
-
MANIFEST_FILE
The name of the manifest file for SCORM 1.2 modules.- See Also:
-
-
Constructor Details
-
Scorm12Parser
Constructs a Scorm12Parser with the specified FileAccess instance.- Parameters:
fileAccess- An instance of FileAccess for reading files in the module package.
-
Scorm12Parser
Constructs a Scorm12Parser 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.
-
Scorm12Parser
Constructs a Scorm12Parser with the specified ModuleFileProvider instance.- Parameters:
moduleFileProvider- An instance of ModuleFileProvider for reading files in the module package.
-
-
Method Details
-
validate
Validates the SCORM 1.2 module without fully parsing it. This method provides efficient validation by only parsing the manifest file and running structural validation checks.- Specified by:
validatein interfaceModuleParser<Scorm12Manifest>- Overrides:
validatein classBaseParser<Scorm12Metadata,Scorm12Manifest> - Returns:
- ValidationResult containing any errors or warnings found
-
parse
Parses the SCORM 1.2 module located at the specified modulePath. Extracts metadata, including title, description, identifier, launch URL, a default version string, and optional fields like mastery score and custom data.- Specified by:
parsein interfaceModuleParser<Scorm12Manifest>- Specified by:
parsein classBaseParser<Scorm12Metadata,Scorm12Manifest> - Returns:
- A populated ModuleMetadata object containing the extracted metadata.
- Throws:
ModuleParsingException- if an error occurs during parsing.ModuleException- If the module type can't be determined or there's an error parsing.
-
getManifestClass
Returns the class type of the SCORM 1.2 manifest.- Specified by:
getManifestClassin classBaseParser<Scorm12Metadata,Scorm12Manifest> - Returns:
- The class object representing Scorm12Manifest.
-