In some cases, you may need to configure custom modules to store information on the server’s file system. You can use the New exportpoint screen to specify which location in the VFS should be exported and where it should reside on the server’s file system. Any time that your module uses java library files (JARS or Class files), you will need to make sure that an export point is defined for those files. Modules can only export content to places within the $CATALINA_HOME/webapps/ opencms folder. Files cannot be written to other locations in the server’s file system. The Module Dependencies Screen The Module dependencies screen provides information on which modules are required by the present module for it to function correctly.
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Low Cost Web Hosting services
The Module Resources Screen Clicking the second button on the first Edit Module screen loads the Module Resources screen, which details where the module stores its files. By default, every module stores information in its own module directory. This directory is located in the /system/modules folder (which is located in the site root, not in the /sites/default folder). This folder is named after the module’s full package name (a java convention for naming). For example, the St. Nicholas Template module’s main module directory is /system/modules/com.st.nicholas.church.template. StNicholasTemplate.
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Discount Web Hosting services
But modules may also need to store information elsewhere in the VFS. The Module Resources screen shows the other folders the module uses to store information. When a module is exported, all of the files in every one of the Resources directories will be included in the module. Avoid listing a folder as a resource unless it is used exclusively for module content. You can use the Module Resources screen to add more Resource folders as well. All of the content that the module created is now in the VFS and is treated just like all other files. Module content can be locked, edit, published, etc. The Module Parameters Screen Clicking the third button on the first Edit Module screen loads the Module Parameters screen. Like files, modules can have specialized parameters, in which additional information is stored. Sometimes, developers use these parameters to store configuration information, though in this case, no parameters have been specified for the St. Nicholas Template module. The Module Exportpoints Screen The Module exportpoints screen deals with static export information. Sometimes, some of the module data must be exported from the VFS to the real file system, and the Module exportpoints screen allows you to specify which content must be exported and where it should go.
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Discount Web Hosting services
At the top of this screen, there are seven buttons in the Module actions section. Beneath that, there is a Module information section, which contains various details about the module. At the bottom is a small section, Module creator, which provides information about who made the module and how they may be contacted. The Second Edit Module Screen Clicking on the first button on this screen loads another screen, which is also called Edit Module. (The fact that there are two screens named Edit Module is a minor bug, which is likely to be fixed in future releases.) The second Edit Module screen is for editing the fields that show up in the Module information and Module creator sections of the first Edit Module screen.
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Discount Web Hosting services
The file we will be working with is com.st.nicholas.church.template. StNicholasTemplate_0.4.zip, and I have downloaded it to my local workstation. I will upload it to the server using OpenCms’s HTTP import. You can also install modules from the server’s file system, but the modules must be located in $CATALINA_HOME/webapps/ opencms/WEB-INF/packages/modules. Modules are named by strict convention. A module name should always begin with the full java package name for the module (for example, org.opencms.help). The package name should be followed by an underscore and then a version number of the form MAJOR.minor (for example, _1.1). Finally, each module file must have the .zip extension. Since the St. Nicholas Template module is stored on my workstation, we will use the Import Module with HTTP screen. You can load this screen by clicking on the Import Module with HTTP button in the Module actions section of the Module Management screen. This screen has an upload field, Filename. Once we have selected the appropriate file, clicking Ok will begin the upload and installation process. As usual, progress will be displayed as the installation takes place. Once installation is complete, the Ok button at the bottom of the progress screen will be activated. Clicking it will take you back to the Module Management screen. The new module is now listed (along with the others) in the Installed Modules table. The First Edit Module Screen Clicking on the module’s name in the Module column in the Installed Modules table on the Module Management screen will load a screen. The name of this screen is Edit Module, and it provides access to tools that manage the module.
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Low Cost Web Hosting services
1. Documentation: This archive contains supplemental documentation for OpenCms. Most of the documentation is packaged as OpenCms modules, though there are a few stand-alone files, such as a slide show introducing OpenCms. It is found at http://www.opencms.org/opencms/en/download/documentation.html. 2. Localizations: This archive contains modules that provide localizations for the Workplace. It is found at http://www.opencms.org/opencms/en/download/ localizations.html. 3. Modules: This archive is for stable, production-quality modules. Usually, modules in this category are functional extensions to OpenCms. However, there are still some documentation modules from older versions of OpenCms in this archive. It is at http://www.opencms.org/opencms/en/download/modules/index.html. 4. Module Sandbox: This archive is similar to the last one, but these modules are considered less stable. Often times, they are under active development, so that new versions are released more often. While many of the modules in this archive are production-quality, you ought to test out a module before you install it on a production server. It is found at http://www.opencms.org/opencms/en/ download/sandbox.html. In addition to those found in the “official” module repositories, there are a number of modules available elsewhere. Often, information about new modules is posted to the OpenCms mailing list or to one of the OpenCms forums. The Synx OpenCms Forum is at: http://opencms-forum.de/index.php Information on the OpenCms mailing list can be found at: http://www.opencms.org/opencms/en/development/mailinglist.html. In previous versions of OpenCms, the help modules and tutorials had to be installed individually after the system installation. With OpenCms 6 and later, that is no longer the case. These modules are now installed by default. Below, we will look at the process of installing a module. As an example, I will install a very simple module from the OpenCms module sandbox. This module, the St. Nicholas Template module, just contains a set of templates. It is available in the Modules Sandbox archive on the OpenCms website. The St. Nicholas Template module is a simple module that contains one template. The author, Nico Michael, developed it for his own site but decided to share it as an example of a complete and functional template. This template is not as complex as the TemplateOne templates included with OpenCms, but it is a very useful example of how to use jsp tag libraries to create your own templates.
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Low Cost Web Hosting services
The Module Management screen in the administration view provides the primary interface for installing, modifying, and removing modules. This screen can be used to upload and install new modules, as well as creating, editing, and exporting modules. In fact, you can even use it to create and distribute your own modules. At the top of the screen is the Module actions section, which contains three buttons. Beneath it, is the Installed Modules table, which should already contain a number of modules. Mine, which is only the default installation, has over fifty modules. Here, we will look at module management, including finding new modules, adding and removing modules, and creating your own modules. Obtaining Official OpenCms Modules The OpenCms website (http://www.opencms.org/) has four different module archives, each providing a particular kind of module. These archives are:
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Low Cost Web Hosting services
The Start Static Export screen has just two items, the Ok button and the Cancel button: As soon as you click the Ok button, the export will begin. OpenCms scans all the files in the site, determines which files can be exported (according to the current OpenCms configuration) and exports them. An export can take several minutes or more. You will be able to watch the progress. Once the process is done, the Ok button at the bottom of the screen will become active. Clicking it will take you back to the Database Management screen. All the exported files are written to the static export directory in OpenCms, usually located in $CATALINA_HOME/webapps/opencms/export/sites. When requests come in for these files, OpenCms will serve the exported file rather than the file stored in the VFS. This can speed up the server by avoiding needless processing. Modules OpenCms is not a one-size-fits-all content management system. It can be tailored to fit the needs of an organization. In order to provide their users with the ability to fit OpenCms into their own environment, the OpenCms developers implemented a module architecture that can be used to extend OpenCms with new functionality and content. These modules are portable collections of code and content, including JAR files, java classes, and jsp files. When we installed OpenCms in Chapter 2, we installed a number of default modules, many of which contained only help information and documentation. But there are many more modules for OpenCms, some provided by Alkacon (the company that oversees OpenCms development) and some provided by third parties. An OpenCms module consists of a well defined set of folders and files stored in a ZIP archive. A module may contain java Archive (JAR) files, java classes, jsp scripts, images, stylesheets, and any other type of content that OpenCms supports.
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Low Cost Web Hosting services
Switching to the explorer view, we can see the newly imported files in the /old-site directory. Note that the images folder was imported, though the only file that was contained in that directory, the penguin.jpg image, is now in the image gallery. The imported files are now pieces of OpenCms content and can be treated just like any other OpenCms file. Static Exports The last item on the Database Management screen is the Start Static Export button. Like the Database Export screen, the Start Static Export screen is used to export the contents of the VFS site to the server’s file system. But it does so in a very different way and for a very different purpose in a static export, files in the VFS are prepared for delivery to a client. Some resources, such as images and download files, are not processed by OpenCms at all, so it is quicker for OpenCms to export these files to the file system and serve them from there. This is the simplest form of static export, and this type of export is done by default. In a more complex configuration, the entire site can be exported. Pages are rendered in their templates, code is executed, and the results are formatted for delivery. But instead of delivering these processed files to the web browser (as would be the case in a normal request), OpenCms writes the files to the server’s file system. The result is a completely static representation of the site.
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Low Cost Web Hosting services
When OpenCms imports HTML files, it will attempt to retrieve the content from the body of the HTML file and save it as a Page type file. When displaying the file, OpenCms will apply a template. (See Chapter 3 for more on file types and templates.) The Template field on the Extended HTML Import form determines which template the imported pages will use. As mentioned above, the import tool will use a template when rendering the document, and the Element field determines where in the template the content will go. Most templates define an area called body (the default) or content. The Locale field determines the language for the imported HTML files. This language must already be one supported by OpenCms. You may need to download and install a particular language module to get the desired locale. The Input encoding field should be set to the character set used by the imported documents. The default, ISO-8859-1 (a.k.a. Latin-1), is the most common character set for English-language documents. The next two fields, Start regular expression pattern and End regular expression pattern (both optional) provide an advanced method of indicating where content begins and ends within an HTML document. By default, OpenCms will import what it finds in the body element in the HTML file. If the web pages have a complex layout, simply importing everything in the body element may create a significant editing task. To avoid importing unnecessary formatting, you can specify a regular expression (a short piece of code that searches for patterns in a document) to tell OpenCms what to consider as the beginning and the end of the content section. OpenCms uses the Jakarta ORO package to handle regular expressions. This library supports the well-documented Perl5 style of regular expressions. The Jakarta ORO package is an Open Source project maintained on the Apache Jakarta site: http://jakarta.apache.org/oro/index.html. The regular expression tools can be very useful when importing, but for our simple site, they are not necessary. The last field on the form is a checkbox called Overwrite files. When this box is checked, OpenCms will privilege the imported copy over files already in the VFS. If an imported file has the same name as another file in the destination folder, the imported file will overwrite the existing file. Unchecking this box will prevent imported files from overwriting existing files. Once the form is completed, you can click the Ok button to begin importing. OpenCms will show you progress information as it imports. Once the import is complete, you can click the Ok button again to return to the Database Management screen.
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Low Cost Web Hosting services