Dec 18
2009

Joomla Framework

Posted by: admin in CMS

Tagged in: joomla

Now that you possess the skills to program all three types of extensions (modules, components, and plug-ins), your development will probably require that you integrate any extension you create with the Joomla system. This means understanding how Joomla functions on an execution level, and likely being able to make calls to the Joomla framework.

 The complete Joomla framework is divided into a sizable number of packages, most of which are represented in an actual Joomla installation with a folder dedicated to the source files:

❑       Application Package — JApplication and related libraries are implemented as a factory class. The four classes extended from this package (JInstallation, JModel, JSite, and JAdministrator) make up the Joomla CMS application. Also included are the Data Access Object (DAO) libraries, including the abstract JModel class that is extended to create the classes JModelCategory, JModelComponent, JModelMenu, JModelModule, JModelPlugins, JModelSection, JModelSession, and JModelUser. It is located in the librariesjoomla directory.

❑       Cache Package — Cache libraries implemented as an abstract class that is extended by caching handlers. Includes the adapters JCacheCallback, JCacheView, JCacheOutput, and JCachePage.

❑       Base Package — The common package houses the base classes such as JObject, which is extended to create the classes JObservable and JTree. It is located in the librariesjoomlaase directory.

❑       Client Package — Connector libraries such as FTP (JFTP  class) and LDAP (JLDAP class) clients. This package is located in the librariesjoomlaclient directory.

❑       Database Package — JDatabase and related libraries provide the database connector function- ality. Classes extend the JDatabase class to provide database access. Currently, only the JDatabaseMySQL and JDatabaseMySQLi classes exist, but connectors for Oracle and Microsoft SQL Server are planned in the future. The JSimpleRecordSet classis used for database interaction. This package is located in the librariesjoomladatabase directory.

❑       Document Package — Libraries for building and rendering pages featuring the JDocument abstract class. The JDocumentHTML class used to render HTML pages is an extension of the JDocument class. This package is located in the librariesjoomladocument directory.

❑       Environment Package — Libraries for interacting with the user including classes for JResponse, JRequest, JBrowser, and JURI  (which parses the URI). This package is located in the librariesjoomlaenvironment directory.

❑       Event Package — Handles the Joomla events with classes that include JEventDispatcher, which extends JObservable (found in the Base Package); JPluginHelper; JEventHandler, which extends JObserver; and JPlugin, which extends JEventHandler. This package is located in the librariesjoomlaevent directory.

❑       Filesystem Package — Libraries for interacting with the file system, including classes for JArchive, JFile, JFolder, and JPath. The file management routines are used primarily for uploads of media, extensions, and languages. This package is located in the librariesjoomla filesystem directory.

❑       Filter Package — Libraries to filter input and output from any data source to prevent insertion attacks. Classes include JInputFilter and JOutputFilter. This package is located in the librariesjoomla ilter directory.

❑       i18n Package — Internationalization libraries, including the classes JLanguage (singleton pattern), JText, and JHelp. This package is located in the librariesjoomlai18n directory.

❑       Installer Package — Libraries for installing extensions, including the abstract class JInstaller, which is extended to create the classes JInstallerComponent, JInstallerLanguage, JInstallerModule, JInstallerPlugin, and JInstallerTemplate. This package is located in the librariesjoomlainstaller directory.

❑       Parameter Package — Parameter manipulation and rendering libraries. This package is located in the librariesjoomlaparameter directory.

❑       Registry Package — Configuration store libraries that include the classes JRegistry, JRegistryFormat, JRegistryFormatINI, JRegistryFormatXML, and JRegistryFormatPHP. This package is located in the librariesjoomla egistry directory.

❑       Session Package — Library to handle a Joomla session through the JSessionStorage and JSession classes. This package is located in the librariesjoomlasession directory.

❑       Template Package — Templating libraries that access patTemplate. Since Joomla is phasing out the use of patTemplate, it is not recommended you use classes or functions here in order to ensure future compatibility. This package is located in the librariesjoomla emplate directory.

❑       User Package — Libraries to activate, authorized, and authenticate a user login. Includes the classes JAuthorization; JUserHelper; JAuthentication; which extends JObservable; and JUser. This package is located in the librariesjoomlauser directory.

❑       Utilities Package — Miscellaneous libraries, including JError, JMail, JMailHelper, JProfiler, and JPagination. The JUtility class includes the functions sendMail(), sendAdminMail(), getHash(), getToken(), parseAttributes(), and isWinOS(). Other utility functions include tools for arrays, buffers, dates, errors, functions, logs, mail, profiling, simplexml, and strings. This package is located in the librariesjoomlautilities directory. Email-related libraries, including the JMail class that is extended from the PHP class PHPMailer. The JMailHelper class provides some email utility functions, including cleanLine(), cleanText(), cleanBody(), cleanSubject(), cleanAddress(), and isEmailAddress().

As mentioned in previous chapters, the Joomla CMS is actually an application that sits atop the general Joomla Framework. Other applications could be built using the Joomla Framework, although such devel- opment is beyond the scope of this book. Core framework development requires dedicated study of the actual Joomla source code.

There are two root classes for the Joomla framework: JFactory and JVersion. JFactory is a factory class used to create and return various framework objects, while the JVersion class holds the version information of the current installation. Although you will be unlikely to reference these classes, they sit at the most primitive level of the framework, so ground-up studies of Joomla might begin there.


Comments (0)Add Comment

Write comment

busy

Latest posts from our blog...

Tags

Copyright © 2009 Webhostingart.com. All rights reserved unless otherwise stated.