[Building Sakai] Using FilePicker for Resources selecting

Jim Eng jimeng at umich.edu
Mon Nov 28 06:02:49 PST 2011


Hi Suparoek,

It's been a long time since I looked at the filepicker, but if I recall correctly, it may be possible to configure the filepicker as you wish. Since work has been done in this area by other people in recent years, my understanding of it may be out of date.

When I last looked, there were two different ways in which attachments could be made.  One is to link to an existing resource, leaving it where it is in a site's resources collection (or uploading a new file to a site's resources folder and linking to it).  The other is to create a new resource in the attachments collection (by uploading a file there or making a copy of an existing resource there) and then linking to the copy rather than the original. There are advantages and disadvantages to each of these approaches, and it's important to figure our which best suits your needs and that the way it works is communicated to users.  In particular, you want to make sure users will not be surprised by the way it works when a file changes or is deleted. 

The ePortfolio tools and some other sakai tools use the approach of linking to an existing resource rather than copying it to the attachments folder.  This allows users to revise, update and delete the items through the resources tool, webdav, or possibly other tools within sakai. With that approach, the link takes you to the updated version of the file even after it changes.  It may also be possible that a file will be deleted or moved, and the link to it will be broken.  I don't recall how that is handled.  

Most of the older sakai tools (calendar, announcements, assignments, etc) use the other approach, in which attachments exist in a separate collection.  The only access to those items is through the link provided within the item they are attached to, and the primary action available is to delete the link from that item.  If a user saves the link to the attachment, deleting the attachment in the other tool does not necessarily prevent the user from accessing that resource later, using the saved URL.    

For either approach, it may be possible to restrict where to look for things to link to (either by allowing/disallowing creation of new resources or by indicating the default resources folder to display when the user is trying to make an attachment). That would be done by setting properties in session state when launching the file picker.  I believe the properties are defined in this file, though again my information may be out of date: 

https://source.sakaiproject.org/svn/content/trunk/content-tool/tool/src/java/org/sakaiproject/content/tool/FilePickerAction.java

HTH.

Jim



On Nov 28, 2011, at 3:19 AM, Suparoek Leesaen wrote:

> Hi all,
> 
> I've been looking to use file picker in order to implement how a resource
> could be selected in my tool. I saw some good examples in Annoucement tool
> but that isn't exactly what I need.
> 
> In Announcement tool's "Add attachment", there are 2 elements select a
> file from local drive and select a file from Resources. For my tool, the
> user will only be allowed to select a file from Resources tool. Once the
> user click add a file(Only one file), he will be taken back to my tool
> dialog.
> 
> Do you think I still can take advantage of the file picker as a tool
> helper? Thanks in advance
> 
> 
> Suparoek Leesaen
> 
> 
> 
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
> 
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"
> 
> 



More information about the sakai-dev mailing list