Class TincanManifest

java.lang.Object
dev.jcputney.elearning.parser.input.xapi.tincan.TincanManifest
All Implemented Interfaces:
PackageManifest, Serializable

public class TincanManifest extends Object implements PackageManifest
Represents the root element of a TinCan/xAPI manifest file.

Implements PackageManifest to provide common manifest functionality. All PackageManifest methods delegate to the first activity in the manifest.

Example XML:


 <?xml version="1.0" encoding="utf-8" ?>
 <tincan xmlns="http://projecttincan.com/tincan.xsd">
   <activities>
     <activity id="http://example.com/activity/1"
               type="http://adlnet.gov/expapi/activities/course">
       <name>Course Name</name>
       <description lang="en-US">Course description</description>
       <launch lang="en-us">index.html</launch>
     </activity>
   </activities>
 </tincan>
 
See Also:
  • Constructor Details

    • TincanManifest

      public TincanManifest()
      Default no-argument constructor.
    • TincanManifest

      public TincanManifest(List<TincanActivity> activities)
      Constructor with activities list.
      Parameters:
      activities - the list of activities
  • Method Details

    • getTitle

      public String getTitle()
      Returns the title from the first activity.
      Specified by:
      getTitle in interface PackageManifest
      Returns:
      the activity name, or null if no activities
    • getDescription

      public String getDescription()
      Returns the description from the first activity.
      Specified by:
      getDescription in interface PackageManifest
      Returns:
      the activity description, or null if no activities
    • getLaunchUrl

      public String getLaunchUrl()
      Returns the launch URL from the first activity.
      Specified by:
      getLaunchUrl in interface PackageManifest
      Returns:
      the launch URL, or null if no activities
    • getIdentifier

      public String getIdentifier()
      Returns the activity ID from the first activity.
      Specified by:
      getIdentifier in interface PackageManifest
      Returns:
      the activity ID, or null if no activities
    • getVersion

      public String getVersion()
      Returns null as TinCan manifests do not include version information.
      Specified by:
      getVersion in interface PackageManifest
      Returns:
      null
    • getDuration

      public Duration getDuration()
      Returns zero duration as TinCan manifests do not include duration.
      Specified by:
      getDuration in interface PackageManifest
      Returns:
      Duration.ZERO
    • getActivities

      public List<TincanActivity> getActivities()
      Gets the list of activities in this TinCan package.
      Returns:
      the list of activities
    • setActivities

      public void setActivities(List<TincanActivity> activities)
      Sets the list of activities in this TinCan package.
      Parameters:
      activities - the list of activities
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object