To be able to use the downloads portlet for a project, you must:
First, checkout your project's working copy which contains the downloads directory in <portal-name>/members/<project-id>. This directory has already been created for you and contains a few sample directories and files.
There should already be an element: <page>downloads</page> in your project.xml, for example:
<?xml version="1.0"?> <project> <id>your-id</id> <name>your-proj-name</name> <company-name>company-name</company-name> <category>cat1</category> <description>projectDescription.html</description> <info> Enter some information here </info> <page>wiki</page> <page>downloads</page> </project>
The <page>downloads</page> element is what triggers the display of the "Downloads" in the left hand nav bar for your project.
Now, inside this same project.xml file, you will find a <downloads> element containing a few example downloads categories and entries. So, here's a snippet:
<?xml version="1.0"?> <project> <id>your-id</id> <name>your-proj-name</name> <company-name>company-name</company-name> <category>cat1</category> <description>projectDescription.html</description> <info> Enter some information here </info> <page>wiki</page> <page>downloads</page> <downloads> <!-- lots of entries describing your downloads. See Below. --> </downloads> </project>
If you already have downloads configured for your project, as has been done for some, you will see a few entries for your project. Otherwise, you can use the section below as a guide on how to add to your downloads section:
<downloads> <categories> <!-- Here you define subcategories. Each subcategory id should correspond to a subdirectory. In these subdirectories, download.xml descriptors should be placed describing a given subcategory. --> <category> <id>Id of the subcategory = name of the subdirectory</id> <name>Screen name of the subcategory</name> <description>Description of the subcategory</description> </category> </categories> <root-category> <!-- This tag should only be present in the "root" subdirectory. It is needed, because there exist no super-category to provide a name and description for it. --> <name>Name of the root category</name> <description>Description of the root category</description> </root-category> <files> <!-- Here you list the files that should be displayed as available for download. --> <file> <id>Name of the file as it is in the working copy (without and directories) OR an absolute URL to a file (begining with http:// or ftp://)</id> <name>Screen name of the file</name> <description>Description of the file</description> <size>Size of the file with a suffix B/KB/MB - only if the id is an absolute link; if the download isn't external, the size will be computed.</size> <license>Optionally, you can include license information here (LGPL, GPL, etc.).</license> <release>For a normal file, if this tag is not present, the release date is auto-generated basing on the check-out time of a file. If this tag is present, text contained in it will be displayed in the "released" column.</release> <button> <!-- Places a button next to the "downloads" one. --> <id>An outside link to any page/file, name of a file in the current downloads category, freezone page</id> <name>Display name of the button.</name> <freezone>Optional, set this to "true" only when the link in the id tag is a freezone page.</freezone> </button> </file> </files> </downloads>
Once you update your project.xml file to describe your downloads and check it in. There will be a minute or two before your donwloads are regenerated. You will see the results shortly. Also, don't forget to run xmllint ./project.xml or an equivalent XML syntax verifier. This will make sure you are using proper markup. If you don't use proper markup, your project will disappear from the list of projects. If it disappears, run a verifier on your project.xml and fix any errors.
Note that any files that you put in the ./YOURPROJECT/downloads directory will be downloadable, even if they are not displayed on the download pages.
Adding download counter to your downloads:
Please refer to DownloadCounters