[opencms-dev] How to associate downloads with pages?

Dimitri Bougoulias D.Bougoulias at ieee.org
Wed May 14 12:04:00 CEST 2003


Hi Tristan,

See how OpenCms is doing that for the explorer filelist in the opencms
sources src/com/opencms/workplace/CmsNewExplorerFileList.java using
/system/workplace/templates/explore_files as template.

I'm working on a module that does that easily and I may be able to publish
it to the opencms site by the end of the month.

Best regards,

Dimitri
 
-----Original Message-----  
From: opencms-dev-admin at opencms.org [mailto:opencms-dev-admin at opencms.org]
On Behalf Of Tristan Roddis
Sent: Wednesday, May 14, 2003 1:34 PM
To: opencms-dev at opencms.org
Subject: [opencms-dev] How to associate downloads with pages?


I need to let site administrators assign downloadable files to any page 
within the site, and have them appear as a prettily-formatted table at the 
bottom of the page with the following fields:

Title, file size, file type

Because the design dictates that these need to be in a table, then I can't 
just use the standard HTML page editor, as our administrators don't know 
HTML [plus the downloads function doesn't seem to work in 4.6.6 :) - see 
thread 'Ledit is driving me crazy')] 

So, I was wondering if anybody had any suggestions as to the best (and 
most OpenCMS-like) way of doing this?

Essentially I can see two problems: 1) where to store the information that 
associates download files with pages and 2) how best to let the user 
assign downloads to pages. 

For 1) I can think of:

a) in a new database table (two columns: pageUri and downloadUri)
b) in an XML definition file somewhere in the VFS (lots of blocks along 
the lines of:
<page name="/website/section/foo.html">
  <download>/downloads/gallery1/bar.doc</download>
  <download>/downloads/gallery2/baz.pdf</download>
</page>
c) as a Property of the page (along the lines of 
Downloads: /downloads/gallery1/bar.doc,/downloads/gallery2/baz.pdf )
d) other (please state)

Then my display class can read from one of the above, get the resource
title, filesize and type, and insert some prettily-formatted HTML as a data
block into the display template.

For 2) I can think of:

a) A module or other admin template that will firstly allow a user to 
select a page, and secondly allow a user to add and remove the downloads 
assigned to the page
b) Adding/reusing a button on the HTML editor to allow users to assign 
downloads to that page
c) other (please state)

Has anybody got any opinions on which of the above choices would be best?  
Factors to consider include i) how easy is it to implement and ii) how well
does it fit in with the rest of OpenCMS (e.g. I'd imagine that reading a
page's properties is easier and more OpenCMS-like than using a sepearate
database table). Efficiency isn't a great concern as it's a very small site,
and we'll be using static export.

Also, any pointers or tips for how to use any exisiting OpenCMS components 
(e.g. the file picker or the download gallery selection pages) would be 
greatly appreciated.

Thanks in advance,

-Tristan.

-- 
tristan at roddis.org                              http://www.roddis.org
_______________________________.oOo._________________________________
"Software without secrets."                      http://www.linux.org
_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://mail.opencms.org/mailman/listinfo/opencms-dev




More information about the opencms-dev mailing list