LCMS Basic Application Structure
From Dokeos
Contents |
File Structure
Most applications in the LCMS projects have the same filestructure. This makes it easier for developers to get an overview of the applications in general and it also makes it easier for developers to locate specific pieces of code within each application.
- /
- applicationpublication.class.php
- applicationpublicationform.class.php
- applicationdatamanager.class.php
- applicationmenu.class.php
- /data_manager
- /database
- databaseapplicationpublicationresultset.class.php
- database.class.php
- /database
- /install
- application_installer.class.php
- application_publication.xml
- /application_manager
- /component
- /applicationpublicationbrowser
- deleter.class.php
- editor.class.php
- viewer.class.php
- application.class.php
- applicationcomponent.class.php
- /component
- /application_publication_table
Database
A typical LCMS application will have at least one table in the database (it's own database if so configured during the initial platform configuration), containing the different publications made within that application. This table typically contains the following fields:
- id: a numerical id
- object: the numerical id of the published object
- publisher: the numerical id of the user that made the publication
- published: the date and time the publication was made, a numerical timestamp
Classes
DataManager
The DataManager is an abstract class that provides functionality to create, retrieve, store, delete, etc. publications. Different implementations of this DataManager are possible. One example is DatabaseApplicationDataManager which uses PEAR::MDB2 as a database abstraction layer. In short all database functionality to manage the application is centralized in this class.
Manager & Components
The application's manager provides functionality to manage the application and it's publications/ To perform this functionality, the manager uses several smaller ManagerComponents:
- browser: to list (all) publications
- editor: to edit publications
- creator: to add new publications
- deleter: to delete one or more publications
- ...
To implement some new functionality one typically implements a new Component
class MyComponent extends ApplicationManagerComponent
Forms
A standard application has a publication form class where properties specific to the publication in that application can be defined. Normally one gets to see this form after he or she has either made a new learning object or selected one and decides to publish it in the application. The form can be displayed in several modes, the two standard modes are create and edit.
Object Classes
The publication class defines the structure of the publication object as used within the application. It typically contains getters and setters for all of the publication's properties as well as the following functions:
- create: to create the publication once the publication form has been sent
- update: to update the publication after changing some of it's properties by means of the editor-component and the publication-form.
- delete: to delete the publication
- get_publication_object: to retrieve the object published with this publication from the repository
- get_publication_publisher: to retrieve the user that published the object in the application
Various
Publication Tabe
The publication table classes contain a framework to display a (filtered) list of publications in e.g. the browser component. the table is implemented by the publicationbrowser which is located in the manager's components-folder.
Installer
Each application has it's own installer class which creates the necessary tables and/or executes some pre-existing sql code and/or add some example publications to the database. Tables are defined by means of xml-files, which are located in the same folder.

