[opencms-dev] some newbie questions

Jonathan Woods jonathan.woods at scintillance.com
Fri Aug 11 11:48:27 CEST 2006


Eugeny -

0.  A module is, literally speaking, some VFS resources rooted at
/system/modules, together with configuration XML in opencms-modules.xml.
The module's VFS resources have a reasonably standard structure - for
example, OpenCms will make JAR files in folder /system/modules/<module
folder name>/lib accessible to the OpenCms-wide classpath.  Other folders or
parts of the module structure have names which are de facto (rather than
absolute) standards, but it's best to be consistent with general usage.  I
guess the best exposition of this subject is to be found in Matt Butcher's
book on OpenCms (published by Packt).

When OpenCms starts up, it loads things like resource types, search Lucene
Document factories according to its default configuration and any
configuration you applied during installation; then it looks in
opencms-modules.xml and adds resource types etc etc from the configuration
it finds there.

1.  (a) The best way to create a module is to develop and manage its
resources in an IDE like Eclipse, and then to upload them to your OpenCms
instance by some means.  I use an Ant build target and a fair bit of shell
scripting; other people are trying the Eclipse VFS plugin, which allows you
to make the VFS accessible to Eclipse.

(b) The biggest trick when developing with OpenCms is to make sure your
installation is in a well defined, reproducible state.  Being anally
retentive, I create a completely fresh OpenCms configuration (i.e. all
OpenCms XML config files, all new module files) every time I update the
module.

2.  Modules aren't really accessible as modules in JSPs etc: it's the
resources provided by modules which are.  That is, if your module provides
JSPs page1.jsp and page2.jsp and (in a module .jar file) class MyClass, then
you can refer to these directly in JSPs (and indeed any Java code) you
develop.

3.  Sorry; I think taglibs are mostly an antipattern... someone else had
better answer this.

4.  I soon got over my reluctance to modify OpenCms-distributed resources
(other than opencms.war).  I think all OpenCms config files - especially
opencms-modules.xml, opencms-vfs.xml etc - should be maintained in your IDE
and installable/updateable as part of your development process.  If you run
things in other web app contexts, I imagine that will end up causing you
other problems - but maybe other people can answer this better.

Jon

-----Original Message-----
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Eugeny N Dzhurinsky
Sent: 11 August 2006 10:28
To: opencms-dev at opencms.org
Subject: [opencms-dev] some newbie questions

Hello!

We are about to develop some custom modules to be included in OpenCMS. After
reading documentaion I learned a module is simply archive with pre-defined
folder structure, which contain JSP, HTML templates, styles, classess and
required resources. I'm not clear with few points:

1) How should I create module? Using OpenCMS? create a module and then
export it as ZIP file?

2) How should it be included in some pages? For example, we have a module
with votes. Vote can be included in some template. Is it done using some
custom JSP tag? 

3) Where TLDs should be stored and how to include them into JSP pages?

4) We would like to use Spring framework and iBATIS. These framewords
requires to have some special settings in web.xml. I don't like the idea to
modify web.xml for entire OpenCMS application, may be it is possible to
reuse some other applications, deployed in different context?

That's all for now, if the questions are answered somewhere - please provide
some URLs etc.

Thanks in advance, I really hope somebody could help us with a suggestion!

--
Eugene N Dzhurinsky

_______________________________________________
This mail is sent to you from the opencms-dev mailing list To change your
list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev





More information about the opencms-dev mailing list