[opencms-dev] Custom Page type - How?

Anthony Roy aroy at hpi.co.uk
Wed Aug 2 12:16:12 CEST 2006


Hi all,

I am trying to create a custom page type for OpenCMS. What I want to be
able to do is to create a new Advert type (as a first basic example), so
that the users can select 'Advert' from the list after clicking the New
button, a custom form will give the users options to add an Image,
insert a link, choose a title etc. The page should then have its
template property set to a specified template.

Now so far I have created a module with default_bodies, schemas and
templates folders. I have a jsp template for the Advert in the templates
folder, a schema describing the XML format of the page in the schemas
folder, and a text file containing an XML document satisfying (and
referencing) the schema in the default_bodies folder.

I am however missing a substantial part of the plumbing to get it all to
work together. The Advert type appears in the drop-down list when I
choose New->Page with free text. So I think I am along the wrong lines
with the default_bodies folder - I am after something like the New ->
Structured Content -> News Article.

I get the impression that I don't have to code a page editor - that this
is generated from the schema, am I right?

So in a nutshell:

1) How do I get a menu entry in the New dialog "Advert" that creates a
new Advert page with a blank XML template satisfying the schema.
2) How do I ensure that the new page has the required template attached
by default.

Note: The schema is fine - if I create a new XML document, and copy the
content of the default template file into it, when I then edit the
document, an appropriate editor appears and I can alter the document.

Cheers,

Anthony Roy. 


This email and any files transmitted with it are confidential and are intended solely for the use of the individual or entity to whom they are addressed. This communication represents the originator's personal views and opinions, which do not necessarily reflect those of HPI Limited. If you are not the original recipient or the person responsible for delivering the email to the intended recipient, be advised that you have received this email in error, and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. If you received this email in error, please immediately notify postmaster at hpi.co.uk.This message has been scanned by Anti-Virus. Recipients are advised to apply their own virus checks to this message on delivery.




More information about the opencms-dev mailing list