6.5 BOU Database Management
6.5.1 Website Management
6.5.1.1 Working with the BOU structure
The developed BOU website is composed of many small snippets of HTML code. These snippets reside in JSP files. JSP files can contain HTML and java tag library code which is OpenCMS specific. When rendered on a web page, the result is that the specific information from the CMS forms is displayed and formatted in the way dictated by the HTML on the page.
The JSP templates can be accessed by switching the site location. When one logs into the BOU OpenCMS system, the Site location is . Switching the site location is done by using the drop-down arrow, and selecting the “/” option. The VFS now shows a different view. This root folder is the base of the VFS.
When you publish the Offline project, for instance, you are publishing everything inside the root folder (including all of the contents of the /sites folder). There are three folders inside the root folder: /channels, /sites, and /system. Each of these folders serves a special purpose.
Do not delete any of these three folders. Doing so can cause serious damage to the CMS, even rendering it unusable. Additionally, you should not create additional folders or files in this directory unless you know what you are doing.
The Sites Folder
The /sites folder contains a separate subdirectory for each site that is to be served by this instance of OpenCms. A site is an organizational unit in OpenCms. Most commonly, each site is considered to be a stand-alone unit (that is, not reliant on other sites), and will have its own domain name (e.g. http://mysite.example.com), as well as its own set of editors or content owners.
Editors should only place content inside of a subfolder in the /sites directory. Typically, this means content should only go inside of the /sites/default folder, unless you are hosting multiple sites on your OpenCms server. The only site we are concerned with at this time is the default site.
Content should absolutely never be placed in the root folder, or in the channels or system folders. Doing so can result in unexpected behavior, and in some cases can compromise the security of your system.
The System Folder
The /system folder has special significance. It contains items that are functionally important for OpenCms. And each of the subfolders has a particular function.
The galleries/ folder: Various OpenCms tools can leverage shared resources (such as images or commonly-used fragments of HTML). These are grouped together into galleries. Each of the galleries is stored as a subfolder inside the /system/galleries/ folder. While it is possible to maintain the galleries by working directly with these folders, there are tools in the Administrator view much better suited for the job.
The handler/ folder: Under certain circumstances, OpenCms executes different handlers.
Supporting files for these handlers are stored in this directory. For example, error pages are stored in the /system/handler/contents folder.
The login/ folder: The login/ subdirectory contains files for managing user logins (typically the login screen for the OpenCms Workplace).
The lost-found/ folder: If a page should become “lost” in the VFS, and its location cannot be determined, for some reason, by OpenCms, then it will be placed in the /system/lost-found folder. This is similar to the concept of the lost+found/ folder typical in Linux file systems.
The modules/ folder: The modules/ directory is the location in which new OpenCms modules are placed when installed. Modules are used to extend the basic function of OpenCms. Help text, for instance, is packaged in a module, as are functional add-ons such as calendar widgets, search engines, and guest books.
The shared/ folder: The next subfolder, shared/, contains a couple of templates that are shared by many resources across multiple sites.
The workplace/ folder: This final folder contains all of the files—templates, images and content—that make up the very Workplace we are using. Developers can customize the Workplace itself (through the Workplace) by modifying these files. As you may have guessed, editing these files can be dangerous, and mistakes can lead to disaster. If, at some point, you decide to edit these files, do so on an installation that does not have important data on it.
The contents of the root folder (/) are largely used for administration and development purposes only. Most content editors will never need to work directly in this folder (or in the /channels or /system subfolders). Content should be restricted only to subfolders under /sites.
Expand the system/modules folder and click on the BOU module folder which is named bou.or.ug.site. The folder expands to show the subfolders within:
A brief explanation of the content of each of these folders follows:
• ug.or.bou.site: this is the BOU module folder which contains all the backend processing files for the BOU website.
• classes: the classes folder contains the file workplace.properties at the path /classes/ug/or/bou/site/. The file is a plain text file that contains the settings for the template forms that are created within the system. Settings such as field labels, user help, error messages are stored here. For example, the form type BouArticle has a section in this file as indicated:
• When a user creates an article, these labels are seen within the BouArticle type form that is presented to the user.
• dumps: this is a code backup folder/archive for old developer code.
• elements: the main JSP template files are in a folder titled “main” within the elements folder.
These are the JSP templates that are used on all pages of the website. If a change is page to these JSP templates, it will be reflected throughout the website. The website images are also contained within a folder here called “template_images”
• jsptemplates: this folder contains other JSP template files that are specific to webpages on the site.
• lib: this is a repository for compiled code.
• resources: this folder contains css(cascading stylesheet) files which are used to modularize the various styles such as font type, font size and colours used on the website. The benefit of this is that changing these attributes in one place will allow for the changes to propagate to all required areas of the website. The sitemap images are stored in a subfolder titled sitemap_resources here.
• schemas: files with extension .xsd are stored here. The code within these files determines the elements such as text boxes, check boxes and so on that will appear on forms created within the system. Data validation schemes can also be performed here.
The diagram below indicates the relationship among all the data in the folders described above