Forum OpenACS Q&A: minor survey and file-storage questions

Two questions...

Is there a setting in the survey/simple survey package to allow bypassing html restrictions, can it be done site-wide, or is it not possible?  I know this is very unhealthy, but I'm teaching a small html class and in this case I'm not worried about the safety of their answers.

Also, in file-storage, is there a built-in way to make a file requested with no version id return the latest version?  In other words,

http://dingdong.com/file-storage/download/termclear.html

would return the latest version of termclear.html, and

http://dingdong.com/file-storage/download/termclear.html?version_id=749

would return version number something.

Thanks.

Collapse
Posted by Carl Robert Blesius on
1. Site Wide Admin -> Kernel Parameters ->  AllowedTag (is where you can set allowed html tags)

2. Not sure, but that should be the default behavior (the relative linking fix might have addressed this)

Collapse
Posted by Ola Hansson on
Derek,

As Carl suggests, that is the default behaviour on 5.0 HEAD (sort of).

Currently, there are actually (for better or worse) two "interfaces" to the file versions in File Storage.

In your example above, if you change the request

... download/termclear.html

to

... view/termclear.html

it should get processed by the new index.vuh file I added in order to make pretty URLs (and, consequently, relative linking of images, pages, etc. in HTML documents) work.

In File Storage (on HEAD), the ordinary links to files point with their relative paths (pretty URLs) to the "view" dir, and the index.vuh thereunder will make sure it returns the *live* revision (not necesserily the latest, although that is currently the case in FS) of the file wrapped in a template if it is of text/* MIME media type.

The file icons to the left of the links, OTOH, point to the good old "download" dir which depends on a version_id query var. I left it this way so that folks should be able to choose between templating or not when they download a file, and because there is a speed penalty associated with the "pretty URL" / templating approach.

Of course, neither templating nor pretty URLs will work in the download dir case. Neither will they work in the "view details" page, which also uses the "download" approach.

The "view details" page is for revision management and even if someone would expect it to work as the live revision browser on the main page there is, to the best of my knowledge, no way to determine which version of an (imagined) image in revision X of a certain HTML page should be shown... I don't think it makes any sense to simply assume it will be the live revision of that image.

But I'm sure there may people with other opinions and suggestions/solutions as to how that may be solved (if it is even conceived as a problem, that is). If I'm not mistaken, Talli is working on a usability study of the FS for Sloan. Let's hear with him what he has to say ... right, Talli?

Collapse
Posted by bill kellerman on
Carl,

For the surveys, I'd like to somehow bypass the accepted html kernel parameter completely.  In this html class, I need the surveys  to accept any html at all, even unsafe or incorrect tags.  Is this possible?

Ola,

Thanks for the info.  What I'm describing isn't really a "problem", just a feature request I guess.  Again, in my class, I'm using file-storage for the students' assignments and projects.  It would be nice if they could create projects on their local machines, then upload to file-storage with hyperlinks intact -- although maybe this out of the scope of file-storage.

I'll check out oacs5 once it is closer to release.

Collapse
Posted by Ola Hansson on
It would be nice if they could create projects on their local machines, then upload to file-storage with hyperlinks intact -- although maybe this out of the scope of file-storage.
Not at all out of the scope! Your students may upload the projects on their local machines to file storage, albeit one file at the time and as long as they make sure to keep the same structure and folder/file names as on the local box, hyperlinks should be kept intact. I realize it isn't very _practical_ to upload files one file at a time, though ... which is why I've been working on a bulk upload feature to enable upload of zip, rar, tar, etc. archives with automatic extraction and "inserting" of files and folders under any folder in the File Storage.

That will not be ready until 5.1, though.

/Ola

Collapse
Posted by Dave Bauer on
Hmmm.

I am not sure why uploaded pages should be wrapped in a template. That is an interesting idea.

The download links should just lead straight to the fodlers:

/file-storage/folder/filename.doc or whatever.

Relative linking of uploaded html content would also work in this case.