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 Scorm12MetadataextractMetadata(Scorm12Manifest manifest, ValidationResult validation) Extracts metadata from a parsed and validated manifest.protected Class<Scorm12Manifest>Returns the class type of the SCORM 1.2 manifest.protected StringAbstract method to return the filename of the manifest for the specific parser.protected ValidationResultvalidateManifest(Scorm12Manifest manifest) Validates a parsed manifest and returns validation results.Methods inherited from class dev.jcputney.elearning.parser.parsers.BaseParser
checkForXapi, getModuleType, getOptions, loadExternalMetadataIntoMetadata, parseAndValidate, parseManifest, parseOnly, 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
-
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<Scorm12Metadata,Scorm12Manifest> - Parameters:
manifest- The parsed manifest to validate- Returns:
- ValidationResult containing any errors or warnings
-
extractMetadata
protected Scorm12Metadata extractMetadata(Scorm12Manifest manifest, ValidationResult validation) throws ModuleException Description copied from class:BaseParserExtracts metadata from a parsed and validated manifest.- Specified by:
extractMetadatain classBaseParser<Scorm12Metadata,Scorm12Manifest> - 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<Scorm12Metadata,Scorm12Manifest> - Returns:
- The manifest filename (e.g., "imsmanifest.xml", "cmi5.xml")
-
getManifestClass
Returns the class type of the SCORM 1.2 manifest.- Specified by:
getManifestClassin classBaseParser<Scorm12Metadata,Scorm12Manifest> - Returns:
- The class object representing Scorm12Manifest.
-