[opencms-dev] Content Definition Creation and Template Elements
David Seikel
david.seikel at icemedia.com.au
Fri Jun 27 06:04:02 CEST 2003
Stephen Scholtz wrote:
> > David Seikel wrote:
> > If you look a little bit further you will find my reply to
> > that person.
> > I gave a quickie tutorial on how to create a basic CD.
>
> This the one you're talking about?
>
> <http://mail.opencms.org/pipermail/opencms-dev/2003q2/005408.html>
Yep, thats it.
> I just want to make sure I got this straight (open to anybody). In all
> the examples I've been reading about, Content Definitions have all been
> about accessing Content in your own user created tables, not tables
> created by the installation of OpenCMS. (in the news sample I've seen,
Correct.
> "news_entry" table) OpenCMS somehow becomes aware of these new tables
> with the inserting of the table names into the OpenCMS table
> "CMS_SYSTEMID". (?)
I don't know, I never needed that.
> So, in a sense, you're using OpenCMS to edit content on your own
> external tables via a Content Definition class that you have to write
> yourself. Is this correct?
I think this is where the Back Office module comes into it. I don't
know for sure, I didn't go that far. I think that is correct though.
To clarify my position without going into too much detail (my work is
covered by an NDA). I needed to write forms that edit database data and
we are using OpenCMS. I looked for ways that OpenCMS could help with
this job. ContentDefinition looked like it solve part of the problem,
with Back Office modules maybe solving another part. The Back Office
stuff is for creating an editor that drops into the Workplace, but our
forms are not part of the workplace, they are only served by OpenCMS as
templates.
So I wrote a generic ContentDefinition, added some extra functionality,
and also wrote a generic form template class to match. The generic
ContentDefinition is basically what I described in the tutorial, plus
some of my own generic SQL code. Now the template classes I write for
forms just subclass the generic one with very little else needed to be
written. I defined a property called "ContentDefinition" that is set
for each form page to define the Java class used as it's
ContentDefinition, and they all subclass my generic one. The page
specific ContentDefinitions only need to have constructors and setX(),
getX(), as well as checkX() methods.
Sometime in the future, I may need to write a Back Office module for
this stuff, since I already have ContentDefinitions worked out, I'm half
way there.
Hmm, just realised that I should be writing this as system documentation
rather than posting it to the list. Oh well, back to work B-).
More information about the opencms-dev
mailing list