Applications¶
Developing your own application¶
When starting an application, you might want to consider whether you want to build a global application (rightly called "application") or a tool, that is an application limited to the context of a course. For the example here, we are going to create an "attendance" tool. Each example item given below will thus contain the "attendance" name, which you will have to replace by the name of your app or tool.
Both will have the same structure (only a few details will vary), but you will have to locate them- inside the /applications directory if it is an application (e.g. /applications/attendance), or
- inside the /applications/weblcms/tool/ directory if it is a tool (e.g. /applications/weblcms/tool/attendance).
Your application will probably use content stored in the database (or somewhere else on your server). If this is the case, you will need a content object defining the structure and the basic features of your content object. Content objects are defined in the /repository/content_object directory. In this case, /repository/content_object/attendance should be the directory. We will then use this content object reference inside the dependencies defined in the application's package.info.
Bitbucket repository¶
If you want to start working as a team from the beginning, create your repository right away in Bitbucket.org. You need a user account to do that, then go to "Create repository", choose the name of your repository as follows, enter a description, uncheck the "private" checkbox, select "PHP" and give the URL www.chamilo.org.
It is important to use the following naming convention for your app if you want it to be later integrated into Chamilo:
- if it is an application or a tool, name it chamilo-app-[your application name]-dev
- if it is a content object, name it chamilo-[your content object name]-dev
The -dev suffix means it is a development version. Later on, when building your app into the release package of Chamilo, we will create a copy of this package without the -dev suffix. This will allow us (including you) to manage a stable version (fixing reported bugs) and a development version (less stable, developing new features).
Cloning the repos¶
Once/If you created your repository on bitbucket.org (or any other nice place), pull it inside your development installation of Chamilo (see Downloading_a_Chamilo_2_development_version on how to do that).
Follow this set of rules (semi-column separate the different commands you would have to run on Linux):
Application¶
cd applications/; hg clone ssh://hg@bitbucket.org/[your bitbucket account]/chamilo-app-[your application name]-dev [your application name]
For example (for the attendance tool)
cd applications/; hg clone ssh://hg@bitbucket.org/ywarnier/chamilo-app-attendance-dev attendance
Tool¶
cd applications/weblcms/tool; hg clone ssh://hg@bitbucket.org/[your bitbucket account]/chamilo-app-[your application name]-dev [your application name]
For example (for the attendance tool)
cd applications/; hg clone ssh://hg@bitbucket.org/ywarnier/chamilo-app-attendance-dev attendance
Content object¶
cd repository/content_object/; hg clone ssh://hg@bitbucket.org/[your bitbucket account]/chamilo-[your application name]-dev [your application name]
For example (for the attendance content object)
cd repository/content_object/; hg clone ssh://hg@bitbucket.org/ywarnier/chamilo-attendance-dev attendance
Application / tool: creating description files¶
An application description file (package.info) has to be located in the "php" directory of the application and be called "package.info". The file will look like this:
<?xml version="1.0" encoding="UTF-8"?> <packages> <package> <name>Attendance</name> < code >attendance\< /code > <context>application\weblcms\tool\attendance</context> <section>tool</section> <category>education</category> <authors>Julio Montoya & Yannick Warnier</authors> <version>0.0.1</version> <cycle> <phase>general_availability</phase> <realm>main</realm> </cycle> <filename></filename> <size></size> <md5></md5> <sha1></sha1> <sha256></sha256> <sha512></sha512> <tagline></tagline> <description>A tool for the weblcms application where attendance content objects can be created and used.</description> <homepage></homepage> <dependencies> <server> <dependency> <id>php</id> <version type="4">5.3.0</version> <severity>1</severity> </dependency> </server> <content_objects> <dependency> <id>attendance</id> <version type="4">0.0.1</version> <severity>1</severity> </dependency> <dependency> <id>introduction</id> <version type="4">2.1.0</version> <severity>1</severity> </dependency> </content_objects> <application> <dependency> <id>weblcms</id> <version type="4">2.1.0</version> <severity>1</severity> </dependency> </application> </dependencies> </package> </packages>
(note the spaces around the < code > tag are not supposed to be there. This is just a quick fix to showing this tag in this documentation)
There is a properties.xml as well, which is generally much shorter:
<?xml version="1.0" encoding="UTF-8"?>
<tool name="attendance">
<properties>
<property name="section" value="basic" />
</properties>
</tool>
Content: creating description files¶
The next step is to go further into the content object creation, so that we can treat the data from inside the application. The first step to do that is to
Application/tool: creating the class file¶
The next step is to create a class file
Structure¶
Installation¶
Layers¶
Database¶
Datamanager¶
Manager¶
Components¶
Submanager / subcomponents¶
Settings¶
Rights¶
Repoviewer¶
Blocks¶
How to start a new application¶
Forms¶
Sortable Tables¶
Updated by Yannick Warnier over 10 years ago ยท 5 revisions