Represents a single learning program: a directory resource holding a set of course folders, plus enrolment and completion information for the current user or a given profile. Appears as a child of a website's ProgramsFolder in the WebDAV/URL tree, one resource per program directory. It is used to check whether a profile or group has an enrolement in the program, to list its courses, and to summarise completion progress across those courses.

Group: Resources

Extends: DirectoryResource


Properties

PropertyReturnsDescription
availCoursesList<CourseFolder>The courses in this program that the current user has a viewable or completable enrolement for.
courseFoldersList<CourseFolder>The course folders that are direct children of this program, in their natural child order.
firstCourseCourseFolderThe first course in this program which is available to the current user, in child listing order.
mostRecentModuleModuleFolderThe module the current user was most recently working on across all courses in this program, determined by comparing the modified dates of in-progress module statuses.
numberCompletionslongThe number of module status records across all users, on this website, for this program that are complete.
numberIncompletelongThe number of module status records across all users, on this website, for this program that are not yet complete.
numberStartedlongThe number of module status records across all users, on this website, for this program, whether complete or not.
orderIntegerThe "order" request parameter, used to control the display order of this program relative to its siblings.
orgModuleStatsOrgModulesStatsModule completion statistics, scoped to this program, for the current principal's primary organisation. Computed on first access and cached for the lifetime of this instance.
percentCompleteIntegerThe average percent complete across the courses in this program: the sum of each course's percent complete divided by the number of courses.
publicbooleanAlways false: program folders are never served as public content, regardless of the repository's isPublicContent setting.
sortedCourseFoldersList<CourseFolder>The course folders that are direct children of this program, sorted by their "order" field.

Inherited from DirectoryResource

Properties

PropertyReturnsDescription
bodyStringBody content of this directory's index page, or an empty string if it has no index page.
branchBranchThe branch this directory belongs to, delegated to from its parent resource.
childrenResourceList<CommonResource>The child files and folders of this directory, including any browseable application pages registered by ApplicationManager. Built lazily on first access and cached for the lifetime of this resource.
contentManagedPermissionsbooleanWhether this directory's permissions are managed as content, rather than through the standard role system. Always true for a directory resource.
dirbooleanWhether this resource is a directory. Always true.
directoryNodeDirectoryNodeThe underlying directory node for this resource in the versioned content repository, creating it from the parent node if it does not yet exist.
filesList<ContentResource>Files (not folders) that are direct children of this directory.
hashStringContent hash of this directory's underlying directory node, or null if the node has not been created.
indexRenderFileResourceThe index.html page of this directory, if one has already been created, otherwise null.
itemTypeStringThe "itemType" template parameter of this directory's index page, used to classify the folder for search.
paramNamesList<String>Names of the template parameters set on this directory's index page.
pathFromBranchPathThis directory's path relative to the root of its branch, built from its parent's path plus its own name.
searchCategoryStringThe "category" template parameter of this directory's index page, used to classify the folder for search.
searchTagsStringThe "tags" template parameter of this directory's index page, used to tag the folder for search.
subFoldersList<ContentDirectoryResource>Subfolders of this directory, excluding the reserved ".mil" metadata folder.
titleStringTitle of the directory: the title attribute of its index page if one exists and has a title, otherwise the directory's name.

Methods

getChildren() · createDirectoryResource(String newName) · save() · isDir() · getDirectoryNode() · getIndex() · getHtmlPage(String name, boolean autocreate) · getTitle() · getBody() · getParam(String name) · getParamNames() · doSaveHtml() · is(String type) · getBranch() · getHash() · getSubFolders() · getFiles() · isContentManagedPermissions() · getItemType() · getSearchCategory() · getSearchTags() · getPathFromBranch()

getChildren()

Returns: ResourceList<CommonResource>

The child files and folders of this directory, including any browseable application pages registered by ApplicationManager. Built lazily on first access and cached for the lifetime of this resource.

createDirectoryResource(String newName)

Returns: DirectoryResource

Creates a new subdirectory of this directory with the given name and saves the change. Fails if a resource with that name already exists.

ParameterDescription
newNamethe name of the subdirectory to create

save()

Returns: void

Persists this directory by delegating to its parent's save method. Requires a logged-in user.

isDir()

Returns: boolean

Whether this resource is a directory. Always true.

getDirectoryNode()

Returns: DirectoryNode

The underlying directory node for this resource in the versioned content repository, creating it from the parent node if it does not yet exist.

getIndex()

Returns: RenderFileResource

The index.html page of this directory, if one has already been created, otherwise null.

getHtmlPage(String name, boolean autocreate)

Returns: RenderFileResource

Finds a named HTML page among this directory's children, parsing it for templating, or creates a new one if autocreate is true and no page with that name exists.

ParameterDescription
namethe name of the HTML page to find or create
autocreateif true, creates and returns a new page when none exists; otherwise returns null

getTitle()

Returns: String

Title of the directory: the title attribute of its index page if one exists and has a title, otherwise the directory's name.

getBody()

Returns: String

Body content of this directory's index page, or an empty string if it has no index page.

getParam(String name)

Returns: String

Reads a named template parameter from this directory's index page.

ParameterDescription
namethe name of the parameter to read

getParamNames()

Returns: List<String>

Names of the template parameters set on this directory's index page.

doSaveHtml()

Returns: void

Saves the index page if any of its title, body or parameters have been changed via this resource. Does nothing if nothing has been changed, or if there is no index page to save.

is(String type)

Returns: boolean

Returns true for "folder", "physicalFolder" and "directory" (but not for a directory whose name starts with a full stop, ie a hidden directory), and for "html" because folders generate a HTML representation when accessed over the web.

ParameterDescription
typethe resource type to test

getBranch()

Returns: Branch

The branch this directory belongs to, delegated to from its parent resource.

getHash()

Returns: String

Content hash of this directory's underlying directory node, or null if the node has not been created.

getSubFolders()

Returns: List<ContentDirectoryResource>

Subfolders of this directory, excluding the reserved ".mil" metadata folder.

getFiles()

Returns: List<ContentResource>

Files (not folders) that are direct children of this directory.

isContentManagedPermissions()

Returns: boolean

Whether this directory's permissions are managed as content, rather than through the standard role system. Always true for a directory resource.

getItemType()

Returns: String

The "itemType" template parameter of this directory's index page, used to classify the folder for search.

getSearchCategory()

Returns: String

The "category" template parameter of this directory's index page, used to classify the folder for search.

getSearchTags()

Returns: String

The "tags" template parameter of this directory's index page, used to tag the folder for search.

getPathFromBranch()

Returns: Path

This directory's path relative to the root of its branch, built from its parent's path plus its own name.


Methods

getFirstCourse() · enrol(Group pharmacyAssistants, boolean completable) · findEnrolement(Group group) · isCompletable(Profile user) · isAvailable(Profile user) · getCourseFolders() · getSortedCourseFolders() · getAvailCourses() · isEnroled(Group g) · isPublic() · getMostRecentModule() · getOrgModuleStats() · getCourse(String courseCode) · getPercentComplete() · getNumberCompletions() · getNumberStarted() · getNumberIncomplete() · getOrder()

getFirstCourse()

Returns: CourseFolder

The first course in this program which is available to the current user, in child listing order.

enrol(Group pharmacyAssistants, boolean completable)

Returns: void

Enrols the given group in this program, optionally marking the enrolement as completable.

ParameterDescription
pharmacyAssistantsthe group to enrol in this program
completabletrue if members of the group should be able to complete the program, false for view-only

findEnrolement(Group group)

Returns: Enrolement

Looks up the given group's enrolement in this program, on this website.

ParameterDescription
groupthe group to find an enrolement for

isCompletable(Profile user)

Returns: boolean

True if the given user has a completable enrolement in this program, on this website.

ParameterDescription
userthe profile to check for a completable enrolement

isAvailable(Profile user)

Returns: boolean

True if the given user has an enrolement for this program, whether the enrolement allows only viewing or also completion.

ParameterDescription
userthe profile to check for an enrolement

getCourseFolders()

Returns: List<CourseFolder>

The course folders that are direct children of this program, in their natural child order.

getSortedCourseFolders()

Returns: List<CourseFolder>

The course folders that are direct children of this program, sorted by their "order" field.

getAvailCourses()

Returns: List<CourseFolder>

The courses in this program that the current user has a viewable or completable enrolement for.

isEnroled(Group g)

Returns: boolean

True if the given group has any enrolement in this program.

ParameterDescription
gthe group to check

isPublic()

Returns: boolean

Always false: program folders are never served as public content, regardless of the repository's isPublicContent setting.

getMostRecentModule()

Returns: ModuleFolder

The module the current user was most recently working on across all courses in this program, determined by comparing the modified dates of in-progress module statuses.

getOrgModuleStats()

Returns: OrgModulesStats

Module completion statistics, scoped to this program, for the current principal's primary organisation. Computed on first access and cached for the lifetime of this instance.

getCourse(String courseCode)

Returns: CourseFolder

Looks up the course folder in this program with the given course code. Returns null if no child resource is found with that name, or if one is found but it is not a course folder.

ParameterDescription
courseCodethe course code, ie the child resource name, to look up

getPercentComplete()

Returns: Integer

The average percent complete across the courses in this program: the sum of each course's percent complete divided by the number of courses.

getNumberCompletions()

Returns: long

The number of module status records across all users, on this website, for this program that are complete.

getNumberStarted()

Returns: long

The number of module status records across all users, on this website, for this program, whether complete or not.

getNumberIncomplete()

Returns: long

The number of module status records across all users, on this website, for this program that are not yet complete.

getOrder()

Returns: Integer

The "order" request parameter, used to control the display order of this program relative to its siblings.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.