Apps for Open Atrium: Atrium Folders
A file repository for Open Atrium
Open Atrium's default set of features covers most of the common needs of an average organization, except one: a file repository with the familiar look and feel of a folders tree. By deploying customized versions of Open Atrium for different kinds of organizations we noticed that the built-in Notebook feature is still cumbersome for intranet users to store and categorize their documents (meeting reports, minutes, etc...): they are used to store their files in directories and subdirectories and not as books and child pages.
On the other hand, the needed technology for a more familiar documents repository is there: Drupal's core Book module can create hierarchical relations among nodes and files can be easily attached to nodes, so it's enough to interpret book pages as folders and their attachments as files to get the same paradigm users are familiar with.
Enter Atrium Folders: A simple file repository application
The idea behind Atrium Folders is to have a very simple file repository application with no external dependencies that users can just download, enable and start playing with. To get started, download the code directly from Nuvole's GitHub, place it under sites/all/modules/features
in your Open Atrium installation and enable the new feature. Atrium Folders is shipped as an ordinary Drupal feature so, after enabling it as a module, we need to enable it in the Open Atrium group.
We can now visit the new Folders section and start adding the first folder.
As already mentioned, folders are nodes: we just need to specify its name, press Save and we are good to go. Now, say goodbye to the ordinary Drupal node interface; from now on we will be managing our repository from an intuitive "filesystem browser"-like interface:
Managing your repository
Use the top menu to manage the folder currently being displayed; it contains the following four items.
Basic information: change name and description of the current folder:
Subfolders: easily add a bunch of subfolders by entering their names, one per line:
Attach files to this folder: just the reinterpretation of the good old Drupal file upload form, it gives the possibility to upload as many files as we need to the current folder:
Notifications: specify who will get a notification of the current changes (again, we don't reinvent the wheel but we integrate with the default Open Atrium notifications system):
Upload multiple files: quickly upload a ZIP archive containing several files and folders: Atrium Folders will unzip it for you and place its content in the current folder (PHP must have ZIP support enabled in order for this functionality to be available)
Rearranging folders
The Reorder tab allows to rearrange the structure of our repository by simple drag-and-drop. This handy interface, borrowed from Drupal's core Book module, is also very helpful when we have to rename several folders at once.
File toolbox
Each file has a toolbox that will allow to rename, move or delete the respective file. The toolbox uses jQuery and AJAX calls extensively, to guarantee a smooth user interaction: files will be modified and changes will take immediate effect, with no need to reload the page.
Creating your own toolbox
Atrium Folders exposes hook_folder_toolbox()
to enable third party modules to expose their own toolbox. As an example, here is the default atrium_folders_folder_toolbox()
implementation:
<span style="color: #000000"><span style="color: #0000BB"><?php<br><br><br></span><span style="color: #FF8000">/**<br> * Implementation of hook_folder_toolbox()<br> */<br></span><span style="color: #007700">function </span><span style="color: #0000BB">atrium_folders_folder_toolbox</span><span style="color: #007700">() {<br> return array(<br> array(</span><span style="color: #DD0000">'op' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'move'</span><span style="color: #007700">,<br> </span><span style="color: #DD0000">'type' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'file'</span><span style="color: #007700">,<br> </span><span style="color: #DD0000">'title' </span><span style="color: #007700">=> </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Move'</span><span style="color: #007700">),<br> </span><span style="color: #DD0000">'description' </span><span style="color: #007700">=> </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Move the file to another location.'</span><span style="color: #007700">),<br> </span><span style="color: #DD0000">'form callback' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'atrium_folders_move_file'</span><span style="color: #007700">,<br> </span><span style="color: #DD0000">'ajax callback' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'atrium_folders_move_file_ajax_callback'</span><span style="color: #007700">,<br> ),<br> ...<br> );<br>}<br></span><span style="color: #0000BB">?></span></span>
Drag and Drop Upload
Atrium Folders ships with a built-in integration for the Drag'n'Drop Uploads module which gives the possibility to simply drag and drop files on the upload form to attach them to a node. If Drag'n'Drop Uploads module is enabled a Drop zone will be visible in the Attach files to this folder panel.
Drush integration: import an existing structure
When an organization wants to switch to Open Atrium, in most cases they need to migrate a shared folder to the new intranet. Atrium Folders includes the folder-import
Drush command that allows to import a directory located in our local filesystem into a certain folder of a specific Open Atrium group. We just need to specify the full path of the directory we want to import and the Drupal path of the group we want it to be imported:
$ drush folder-import /tmp/meeting secretariat<br>Created 13 folders and 168 files.
Type $ drush help folder-import
for more.
Tags: Drupal Planet, Open AtriumImage: