Forum OpenACS Development: Re: Ajax Helper 0.8d committed to CVS HEAD

Collapse
Posted by Malte Sussdorff on
I managed to get the filestorage-ui to work and even committed a lib so I can include it as the default for file storage on my site.

Sadly, this leaves me with a couple of questions to which I can't find the answer:

a) How can I pass the header_stuff variable from an include to the master template?
b) How can I make the ajax-filestorage-ui view open the folder contents of the main folder by default ?

Thanks for any guideance on this

Collapse
Posted by Malte Sussdorff on
And even more questions.

- How could I add a new file
- Is there a plan to add the capabilities (aka actions) from file-storage folder chunk, or is it just for viewing files ?
- What is your current use case ?

Collapse
Posted by Hamilton Chua on
More responses inline :

How could I add a new file ?

The code on CVS does not have this feature yet.

Is there a plan to add the capabilities (aka actions) from file-storage folder chunk, or is it just for viewing files ?

Yes, I have plans to add sorting, adding, deleting, copying and moving of files and folders.

What is your current use case ?

The intention is to develop a user interface that mimics windows explorer. The package will initially allow you to view files and folders but I hope to be able to integrate the other file storage actions soon.

Collapse
Posted by Caroline Meeks on
My vision for the FS AJAX UI is to provide a clean attractive UI for the most common use cases. Then you have a link to an "admin" page, which is the old UI for occasional tasks like uploading zip files, uploading new versions, renaming etc.
Collapse
Posted by Hamilton Chua on
Hello Malte,

My responses inline ...

a) How can I pass the header_stuff variable from an include to the master template?

The only way I know how to do that is thru global variables. In fact if you check ajax/doc/ there are instruction on pasting some code into your blank-master files to enable auto loading of javascript sources when you use helpers.

This means that if you use ah::effects, for example, and you have that piece of code in the blank-master, you won't need to worry anymore about what javascript source files to load as this will be taken cared of by ajaxhelper.

The intention is to take away the guess work, to minimize effort of using ajax and to prevent double declaration of js sources.

This mechanism is still a bit messy and I'm in the process of refactoring but it should work ok on 0.8.

So for ajax-file-storage, you might want to use global variables in your template files if you intend to make it an include.

b) How can I make the ajax-filestorage-ui view open the folder contents of the main folder by default ?

Looking at index.tcl, look for the comment "#create node". You'll see a list of items. On the particular file storage instance where you want it to open just add "1" to the list after "${dyn_load_script}". If you check the code in ajax-yahoo-procs.tcl you'll see that the item corresponds to -open which tells the tree to open the partcular node/folder.

So as the code loops thru all the fs_instances, you have to put a check for the file storage instance you want opened by default and add "1" to the list.

I hope that helps.