On Sun, Jan 31, 2010 at 8:32 PM, Ross Boylan <ross@biostat.ucsf.edu> wrote:
On Sun, 2010-01-31 at 19:33 -0500, John McKeon wrote:
> Hi Ross,
>
> On Sun, Jan 31, 2010 at 4:46 PM, Ross Boylan <ross@biostat.ucsf.edu>
> wrote:
>         I am trying to figure out the relation between PRFile,
>         MAFileModel,
>         MAFileDescription, and possibly others.  They seem to
>         duplicate a lot of
>         information, such as mimetype and filename.
>
>         I'm using the Pier-1.2 download.
>
>         PRFile says it references an instance of MAFileModel, but a
>         lot of test
>         code for seems to get by without an MAFileModel.
>
>
> Look at the class side of PRFile. Its in the descriptionFile method.
Ah: the file instance is lazily initialized with this, and then
PRFile>>filename: and PRFile>>contents, for example, pass through to the
file instance.
>
>         I've looked for references to the classes, but have found
>         either
>         extremely terse and trivial tests or the setupup for, e.g.,
>         defaultCSS.
>
>         I also don't know which of the classes is intended for
>         display, or how
>         to display them.
>
>         Initially, I just want to use these to display links to files
>         that are
>         on the disk.  Presumably that will use MAExternalFileModel
>         somehow.
>
>
> You really don't need to worry about all that in Pier I don't think.
> Just use the Add command and select PRFile from the combo box.
I need to generate these programmatically by scanning a directory on the
server.

That would probably take some custom code. Depending on how you would use it it could be a plain old Seaside component (easier) or a Pier component which would be a little more involved.


But PRFile itself has no display logic, and so I'm not sure how that
gets hooked up.

A PRFile is a structure, when added to the tree of structures that make up the site, Pier renders it with the proper PRViewComponent. Pier is very sophisticated that way.

Is the idea to add PRFile as a child of the PRPage?

Yes, exactly. Doing it this way, you can add all the files you like without writing any code. I.e. content management from the web browser. 
  
> Then edit the page to put a reference to it. Given that it is named
> MyFile the reference would look like +/MyFile+ (also given that it is
> added to the root page)
>
>
> Hope this helps
> John
>
>
>
>         Later on, I may want to have pseudo files that include the
>         ability to
>         select a format in which to download the file or to display
>         the file
>         inline on the web page.
>
>
>         Ross Boylan
>
>         _______________________________________________
>         Magritte, Pier and Related Tools ...
>         https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>
>
>
> --
> http://jmck.seasidehosting.st
> _______________________________________________
> Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki



--
http://jmck.seasidehosting.st