Hi,
I am currently writing a module for generic xsl transformations.
(Upload xml, xsl and define a few parameters if you wish)
Should I use the UserFiles directory for uploading these files or should
I create my own directory inside the modules folder?
Thinking of this, it could be helpful to implement a service layer in the core
for file management (wasn't something like this on the wishlist?)
Yes, a global service for handling files would always be great. Maybe we can even write a plugin for the FCKEditor that utilizes this feature :).
Also, with a global service, it is gonna be an easy task to write a file manager for admins.
I think the very same principle applies as with the content abstraction:
Define a base class BaseFile, with essential information and provide a service layer for common used scenarios:
- check file (path/ content type)
- save HttpPostedFile or a file already on server
- save all files in a specific tmp upload folder
- delete files
- retrieval methods
As part of the name always use the BaseFile id, which, using joined-subclasses for this scenario will provide a system wide unique identifier.
So actually, all files could reside in the same directory.
If a module needs more information with a file (e.g. number of downloads etc.),
derive from BaseFile and add it.
If nobody disagrees, I will start implementing a preliminary version.
mgaerberI think the very same principle applies as with the content abstraction:
Define a base class BaseFile, with essential information and provide a service layer for common used scenarios:
- check file (path/ content type)
- save HttpPostedFile or a file already on server
- save all files in a specific tmp upload folder
- delete files
- retrieval methods
As part of the name always use the BaseFile id, which, using joined-subclasses for this scenario will provide a system wide unique identifier.
So actually, all files could reside in the same directory.
If a module needs more information with a file (e.g. number of downloads etc.),
derive from BaseFile and add it.
Doing it that way would even allow us to support versioning if the need ever arose.
While working on some ideas and looking at the JSR stuff for CMS repositories, I got to the point where I am thinking about NOT differing between "ContentItem" and "FileItem".....
..........
-- moved this post to "architecture" ---
Hi Mgaerber
if your after some ideas on CMS and XSL, have a look at Umbrco (
http://www.umbraco.org/), it's an Open Source .NET project that uses XSL as it's primary rendering engine.
Thanks, might get some more ideas!
Actually it only should give the possibility to render some xml, for example if you have an excel list or such and want to publish it on a website, just save as xml and with the right stylesheet you can have it published nicely on the site.