Class ModuleMetadata<M extends PackageManifest>
- Type Parameters:
M- the type of the package manifest
- All Implemented Interfaces:
PackageManifest,Serializable
- Direct Known Subclasses:
BaseModuleMetadata,XapiMetadata
Each module type can extend this class to include additional fields specific to that type.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected MThe package manifest for the module.protected ModuleEditionTypeThe specific edition type of the module, including SCORM 2004 edition information.protected ModuleTypeThe type of the module (for example, SCORM, AICC, cmi5).protected longThe total size of all files in the module in bytes.protected booleanIndicates whether xAPI is enabled for the module. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor for the ModuleMetadata class.protectedModuleMetadata(M manifest, ModuleType moduleType, ModuleEditionType moduleEditionType, boolean xapiEnabled) Constructor for ModuleMetadata. -
Method Summary
Modifier and TypeMethodDescriptionbooleanRetrieves the description of the module.Retrieves the duration of the module.Retrieves the unique identifier of the module.Retrieves the launch URL for the module.Retrieves the manifest associated with this module metadata.abstract StringRetrieves the filename of the manifest file for this module.Retrieves the edition type of the module.Retrieves the type of the module.longGets the total size of all files in the module on disk.getTitle()Retrieves the title of the module.Retrieves the version of the module.inthashCode()abstract booleanDetermines whether this module contains multiple launchable units.booleanChecks whether xAPI is enabled for the module.voidsetManifestFile(String manifestFile) Sets the name of the manifest file associated with the module.voidsetSizeOnDisk(long sizeOnDisk) Sets the total size of all files in the module on disk.
-
Field Details
-
manifest
The package manifest for the module. -
moduleType
The type of the module (for example, SCORM, AICC, cmi5). -
moduleEditionType
The specific edition type of the module, including SCORM 2004 edition information. -
xapiEnabled
protected boolean xapiEnabledIndicates whether xAPI is enabled for the module. -
sizeOnDisk
protected long sizeOnDiskThe total size of all files in the module in bytes. A value of -1 indicates the size is not available.
-
-
Constructor Details
-
ModuleMetadata
protected ModuleMetadata(M manifest, ModuleType moduleType, ModuleEditionType moduleEditionType, boolean xapiEnabled) Constructor for ModuleMetadata.- Parameters:
manifest- the package manifestmoduleType- the module typemoduleEditionType- the module edition typexapiEnabled- whether xAPI is enabled
-
ModuleMetadata
protected ModuleMetadata()Default constructor for the ModuleMetadata class.This constructor is protected and does not perform any specific initialization. It is intended for use by subclasses or internal processes where explicit instantiation of the ModuleMetadata class is required.
-
-
Method Details
-
getTitle
Retrieves the title of the module. This method delegates to the underlying manifest to obtain the human-readable name of the package.- Specified by:
getTitlein interfacePackageManifest- Returns:
- the title of the module as a String
-
getDescription
Retrieves the description of the module. This method delegates to the underlying manifest to obtain additional information about the module in the form of a description.- Specified by:
getDescriptionin interfacePackageManifest- Returns:
- the description of the module as a String
-
getLaunchUrl
Retrieves the launch URL for the module. This method delegates to the underlying manifest to obtain the URL used to start or launch the module.- Specified by:
getLaunchUrlin interfacePackageManifest- Returns:
- the launch URL of the module as a String
-
getIdentifier
Retrieves the unique identifier of the module. This method delegates to the underlying manifest to obtain the identifier.- Specified by:
getIdentifierin interfacePackageManifest- Returns:
- the unique identifier of the module as a String
-
getVersion
Retrieves the version of the module. This method delegates to the underlying manifest to obtain the version of the package.- Specified by:
getVersionin interfacePackageManifest- Returns:
- the version of the module as a String
-
getDuration
Retrieves the duration of the module. This method delegates to the underlying manifest to obtain the duration, indicating the expected time to complete the module.- Specified by:
getDurationin interfacePackageManifest- Returns:
- the duration of the module as a
Duration
-
hasMultipleLaunchableUnits
public abstract boolean hasMultipleLaunchableUnits()Determines whether this module contains multiple launchable units.This affects player configuration defaults such as navigation controls, table of contents display, and launch behavior. In Rustici Engine and similar LMS platforms, this flag is used to conditionally enable multi-SCO navigation features.
- SCORM 1.2: Multiple resources with scormType="sco"
- SCORM 2004: Multiple items in organization
- AICC: Multiple assignable units
- cmi5/xAPI: Always false (single AU/activity)
- Returns:
- true if the module contains multiple launchable units, false otherwise
-
getManifestFile
Retrieves the filename of the manifest file for this module.For most module types, this is a constant defined by the specification (e.g., "imsmanifest.xml" for SCORM, "cmi5.xml" for cmi5). For AICC modules, the filename is discovered during parsing as the .crs file can have any name.
- Returns:
- the manifest filename (e.g., "imsmanifest.xml", "cmi5.xml", "course.crs")
-
setManifestFile
Sets the name of the manifest file associated with the module.- Parameters:
manifestFile- the filename of the manifest, typically representing the module's metadata file (e.g., "imsmanifest.xml" for SCORM)
-
getSizeOnDisk
public long getSizeOnDisk()Gets the total size of all files in the module on disk.- Returns:
- Total size of all files in bytes, or -1 if not available
-
setSizeOnDisk
public void setSizeOnDisk(long sizeOnDisk) Sets the total size of all files in the module on disk.- Parameters:
sizeOnDisk- The total size of the module's files in bytes.
-
equals
-
hashCode
public int hashCode() -
getManifest
Retrieves the manifest associated with this module metadata.- Returns:
- the manifest of the module as an instance of type M
-
getModuleType
Retrieves the type of the module.- Returns:
- the module type as an instance of
ModuleType
-
getModuleEditionType
Retrieves the edition type of the module.- Returns:
- the module edition type as an instance of
ModuleEditionType
-
isXapiEnabled
public boolean isXapiEnabled()Checks whether xAPI is enabled for the module.- Returns:
- true if xAPI is enabled, false otherwise
-