Guide to Common Structure

Modules

Common is broken up into modules that are somewhat optional and can be included or excluded using SAutoload::addModule(). Each module provides a service of some sort, or an API. Some modules are included by default, such as pr2 and helpers. Others, such as sdr and tsd, are not required and should only be included if these services are needed in the project.

Directory Structure

config

The config/ directory contains three files: The serverDefaults.php5 contains default settings and configuration options for all of the modules in common. These can be overridden in serverLocal.php5, which must be manually copied from serverLocal.master.php5 and configured on a per-checkout basis. serverStandardIncludes.php5 performs all of the initialization of the framework and should be included by a project's standardIncludes.php5.

content/

The content directory contains all classes related to processing content.

Doxyfile

This file contains the Doxygen configuration for generating the public documentation. Public documentation is intended for those who are only using common to develop, instead of actually developing in common itself.

See Guide to Documentation for more on configuration of this file.

Doxyfile.internal

This file contains the Doxygen configuration for generating the internal documentation. Internal documentation is intended for those who will be developing features in common itself and so need to know internal APIs and other information that is not relevant for simply using common.

See Guide to Documentation for more on configuration of this file.

doxygen/

In order to use certain versions of Doxygen, the source code and binaries for Doxygen live in here. The binaries are compiled to run on login.shodor.org, so you will have to recompile when using common on other machines. There is no script to do this, but one will likely be added in the near future.

helpers/

Helpers are static classes that provide globally useful helper functions:

jpgraph/

The jpgraph add-on stays in this directory. It only seems to be used by the Reflections tool.

pdoc/

This directory contains Doxygen-consumable documentation files for general common stuff. This page, for example, has a file called structure.pdoc located in the pdoc/ directory. All files in pdoc directories should end in .pdoc so that Doxygen knows to use them.

pr2/

The pr2 directory contains PageRender2, the page layout and templating system.

scripts/

This directory contains utility scripts. Right now, only two scripts reside in this directory: Any additional maintenance or auto-generation scripts should go in this directory.

sdr/

sdr/ contains objects used for querying the SDR Search Service and parsing the XML strings that it returns. These classes are only for querying SDR, not for submitting or updating any new metadata.

sdrservice/

sdrservice/ contains objects used for submitting to, updating, and directly querying the sdr metadata database. These classes do not relate to sending data over the SDR Search Service.

snap2/

The following subdirectories are present in snap2/: When creating new content types in Snap2, you should follow the Guide to Creating and Modifying Content Modules. Those objects go in content/, and the TK components in tk2/previews/ and tk2/editors/. The only other directory which should accept new objects is util/, for any new utility classes providing features above and beyond the original API.

The perl/ directory contains the Snap2 Perl API, which is itself in perl/Snap2/. The command line tool, which uses the API, but presents a user-interface, is called snapple and lives directly in perl/.

As with all modules, the pdoc/ directory contains documentation meant to be consumed by Doxygen and used to build special pages. New guides should be put here and should follow the documentation guidelines as described in the Doxygen Guide.

SWAT/

The SWAT directory contains the Shodor Web Application Toolkit, which handles ORM, sessions, and event handling

tcpdf/

The TCPDF add-on stays in this directory. It generates PDFs via an API. It will be used mostly by InteractivatePlus. The API is not in any way connected to the rest of the common API and is not configured via such.

tk2/

tsd/

ui/

This directory contains all of the CSS, JavaScript and image files needed for skins, themes and Ajax. Each project that wants to have a skin that can be used by other projects will have a directory in here. There is also the default skin, which belongs to no project and lives in the default/ directory. The fledgeling Ajax libraries live in swat/. They are not well-documented and are in flux and are, currently, pretty much only used by TSD, and some in Snap2. The documentation for them, such as it is, is at SWAT JavaScript Libraries.

XForms/

The XForms directory contains XForms, the framework for rendering and processing XML XForms using normal HTML forms.

Generated on Wed Nov 24 02:01:28 2010 for Common by  doxygen 1.5.6