[opencms-dev] Writing a simple MasterModule

tol opencms at recordcaster.de
Sat Jan 24 14:54:01 CET 2004


Hi @all!

I want to understand the concept of the MasterModules. Therfore I trying 
to write a first simple MasterModule example - learning by doing ;)
I read the docs in the usermanual again and again. But all questions 
can't be resolved, so I hope someone can help me :)

There have to defined a function called filterAll(...). In the pdf-doc 
is written the following sample-code:

/**
* Filter method.
* @param cms - the CmsObject to get access to the cms ressources.
* @return a Vector of Content Definition.
*/
public static Vector filterAll(CmsObject cms) throws CmsException {
return ((CmsDbAccess)getDbAccessObject(C_SUB_ID)).filterAll
(cms, CmsContentDefinition.class, C_SUB_ID);
}


I assume, the comment

  * @return a Vector of Content Definition.

conflicts with the return statment

   return ((CmsDbAccess)getDbAccessObject

If I understand it right, than the result was changed to CmsDbAccess. 
And that is not equal to ContentDefinition ... What is correct? The 
comment or the changeoperator?

Which CmsDbAccess should be used???
- com.opencms.file.generic.CmsDbAccess
- com.opencms.file.mysql.CmsDbAccess
- com.opencms.defaults.master.generic.CmsDbAccess

None of them semms to implement the filterAll(..) function ... ??

In the return statment there is called the filterAll function  with the 
paramter "CmsContentDefinition.class". m I right CmsContentDefinition is 
a Class? ... but there exists no Class called CmsContentDefinition!? .. 
or I couldn't find it ;)

But I found an abstract class A_CmsContentDefinition! Have I to write:
A_CmsContentDefinition.class??

Argh! Feeling confused! If someone can help - I would be very happy!! :)

Tol
-- 
independent internet radio berlin
http://www.recordcaster.de





More information about the opencms-dev mailing list