Class ScormVersionDetector
java.lang.Object
dev.jcputney.elearning.parser.util.ScormVersionDetector
Utility class for detecting the version of SCORM modules based on their manifest files.
This class examines the imsmanifest.xml file of a SCORM module to determine whether it's a SCORM 1.2 or SCORM 2004 module. The detection is based on:
- The schema and schemaversion elements in the manifest
- The presence of SCORM 2004-specific namespaces
If the version can't be determined with certainty, the class defaults to SCORM 1.2.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ModuleTypedetectScormVersion(FileAccess fileAccess) Detects the version of a SCORM module based on its manifest file.
-
Method Details
-
detectScormVersion
public static ModuleType detectScormVersion(FileAccess fileAccess) throws ParserConfigurationException, IOException, SAXException Detects the version of a SCORM module based on its manifest file.This method examines the imsmanifest.xml file to determine whether the module is SCORM 1.2 or SCORM 2004. It first checks the schema and schemaversion elements, and if those are inconclusive, it looks for SCORM 2004-specific namespaces.
- Parameters:
fileAccess- the FileAccess implementation to use for accessing the manifest file- Returns:
- the detected SCORM version as a
ModuleType(SCORM_12 or SCORM_2004) - Throws:
ParserConfigurationException- if a DocumentBuilder can't be createdIOException- if an I/O error occurs while reading the manifest fileSAXException- if a parsing error occurs while reading the manifest file
-