roller-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guy Katz" <>
Subject RE: expose weblog uploaded files model?
Date Mon, 20 Aug 2007 16:55:02 GMT
Thanks for the help!;
It was fairly easy to write.
Here is the code if someone browses through the archives. It does
nothing special yet prints to console the uploaded resources if you use
{$files.filePrint} in your template. You can modify it however you like:

public class UploadedFilesModel implements Model {

    private static Log log =
    private WeblogPageRequest weblogPageRequest = null;
	public String getModelName() {
		return "files";

	public void init(Map params) throws RollerException {
		this.weblogPageRequest =
(WeblogPageRequest)params.get("weblogRequest");	}

	public Object getFilePrint(){
		try {
			FileManager fileManager =
			WebsiteData webSiteData =
			WeblogResource[] resources =
			for (WeblogResource resource : resources) {
		} catch (RollerException e) {
			log.warn("ERROR: FileManager failure", e);
		return new Object();

-----Original Message-----
From: Dave [] 
Sent: Monday, August 20, 2007 6:13 PM
Subject: Re: expose weblog uploaded files model?

On 8/20/07, Guy Katz <> wrote:
> How do I make the new model accessible (UploadedFilesModel)?
> Do I need to configure it somewhere?

The README.html explains that

>What does the getModelName method do?

That is the name by which you will refer to the model in templates. For

   #set($myfiles = $mymodel.getMyFiles())

Where the model name is "mymodel"

- Dave

View raw message