<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://cafuego.net"  xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>Cafuego - sharepoint killer</title>
 <link>http://cafuego.net/taxonomy/term/235/0</link>
 <description></description>
 <language>en</language>
<item>
 <title>Simple Drupal Document Management System</title>
 <link>http://cafuego.net/2009/07/11/simple-drupal-document-management-system</link>
 <description>&lt;!-- google_ad_section_start --&gt;&lt;p&gt;Many moons ago I needed a way of storing documents online, so they could be shared between users and easily accessed from many locations.&amp;nbsp; Thus, &lt;a href=&quot;http://sdms.cafuego.net&quot;&gt;Simple Document Management System&lt;/a&gt; was born. SDMS is a PHP based front-end to a MySQL database that allows users to upload and download files into and from virtual directories using only a web browser.&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Generic Document Icons&quot; src=&quot;/sites/cafuego.net/files/sddms.png&quot; align=&quot;left&quot; border=&quot;0&quot; height=&quot;56&quot; hspace=&quot;8&quot; vspace=&quot;2&quot; width=&quot;63&quot; /&gt;It was my second ever PHP project and I wrote it in (bad) php3, with only some informal C coding as experience. Needless to say the code was not great, it used globals and had SQL injection problems. Though I did fix these two particular issues, the code is still old and tired and I&#039;ve not really maintained it for years.&amp;nbsp; Bringing it up to date would probably involve more effort than just scrapping it and rewriting it from scratch.&lt;/p&gt;&lt;p&gt;I&#039;ve been doing a lot of work with Drupal over the past year and I had been vaguely considering reimplementing SDMS as a Drupal module, thus removing the need for me to also maintain code to handle users, passwords, commenting and permissions.&lt;/p&gt;&lt;p&gt;As I got more familiar with some 3rd party Drupal modules, it struck me that it should be completely possible to implement a document management system similar to SDMS in Drupal. Without doing any coding whatsoever. Thus, SDDMS was born.&lt;/p&gt;&lt;p&gt;&lt;!--break--&gt;&lt;/p&gt;&lt;h2&gt;The basics: Install Modules&lt;/h2&gt;&lt;p&gt;You&#039;ll need to enable a few additional core modules and obtain a bunch of third party modules to make this all work. First, go to &lt;em&gt;Administer → Site Building → Modules&lt;/em&gt; and enable the &lt;strong&gt;Book&lt;/strong&gt; and &lt;strong&gt;Statistics&lt;/strong&gt; modules.&amp;nbsp; These are not enabled by default, but SDDMS needs them.&lt;/p&gt;&lt;p&gt;When that is done, you will need to grab a dozen of 3rd party modules. I&#039;ve listed them here. For each one, download the latest stable 6.x tarball. When done, unpack them into the site-wide (&lt;em&gt;sites/all/modules&lt;/em&gt;) or per-site (&lt;em&gt;sites/mysite.com/modules&lt;/em&gt;) module directory.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/cck&quot;&gt;CCK&lt;/a&gt; - Allows you to create custom node types.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Nodereference&amp;nbsp; - Allows you to reference a node from another node (Included with CCK).&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/viewfield&quot;&gt;Viewfield&lt;/a&gt; - Allows you to reference a view from nodes. (No stable version yet, grab the -dev one)&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/filefield&quot;&gt;Filefield&lt;/a&gt; - Allows you to attach files to nodes.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Filefield meta -&amp;nbsp;Manage attachment file meta information (Included with&amp;nbsp;Filefield).&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/filefield_paths&quot;&gt;Filefield paths&lt;/a&gt; - Adds filefield tokens to Pathauto.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/mimedetect&quot;&gt;Mimedetect&lt;/a&gt; -&amp;nbsp;Detect file attachment meta information.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/getid3&quot;&gt;Getid3()&lt;/a&gt; - Detect media attachment file meta information.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/pathauto&quot;&gt;Pathauto&lt;/a&gt; - Automatically create permanent urls for nodes.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/token&quot;&gt;Token&lt;/a&gt; - Tokeniser needed to automatically create permanent urls for nodes.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/views&quot;&gt;Views&lt;/a&gt; - Create custom displays and listings of content.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Views UI - Management interface for Views (Included with Views).&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;When installed, visit &lt;em&gt;Administer → Site Building → Modules&lt;/em&gt; again and enable each of these modules. Some need other modules to be enabled and Drupal will first ask and then automatically enable these other modules for you.&lt;/p&gt;&lt;h2&gt;Next: Configure the modules&lt;/h2&gt;&lt;p&gt;Now that you have installed all required modules, it&#039;s time to configure them for use.&lt;/p&gt;&lt;h3&gt;Book&lt;/h3&gt;&lt;p&gt;The Book module provides us with the tree-like structure we need for directories. Go to &lt;em&gt;Administer&amp;nbsp;→ Content Management&amp;nbsp;→ Content types&lt;/em&gt; and edit &lt;strong&gt;Book page&lt;/strong&gt;.&amp;nbsp; Change the name from Book page to Directory and (optionally) change the description. In &lt;em&gt;Submission Form Settings &lt;/em&gt;a bit further down the page, change Title to Name and Body to&amp;nbsp;Description.&lt;/p&gt;&lt;h3&gt;CCK:&amp;nbsp;Create a custom content type&lt;/h3&gt;&lt;p&gt;You have a directory content type now, but you still lack the ability to upload documents. To rectify this, go to &lt;em&gt;Administer&amp;nbsp;→ Content Management&amp;nbsp;→ Content types&lt;/em&gt; and click Add a new content type. Name this new content type &lt;em&gt;Document&lt;/em&gt;, set its type to &lt;em&gt;document&lt;/em&gt; and add a description. In &lt;em&gt;Submission&amp;nbsp;Form Settings&lt;/em&gt;, change Title to Name and Body to Description, just like you did for the Directory type.&amp;nbsp; Make sure that  &lt;em&gt;Promoted to front page&lt;/em&gt; is not checked under &lt;em&gt;Workflow settings&lt;/em&gt; and save the content type.&lt;/p&gt;&lt;p&gt;Now its time to allow users to put a document in a specific directory and actually upload files. On &lt;em&gt;Administer&amp;nbsp;→ Content Management&amp;nbsp;→ Content types&lt;/em&gt;, click &lt;strong&gt;Manage fields&lt;/strong&gt; for the &lt;em&gt;Document&lt;/em&gt; content type.&lt;/p&gt;&lt;h4&gt;CCK:&amp;nbsp;Add fields&lt;/h4&gt;&lt;p&gt;Set the &lt;em&gt;Label&lt;/em&gt; to&amp;nbsp;&lt;strong&gt;Directory&lt;/strong&gt; and add &lt;strong&gt;document_directory&lt;/strong&gt; as the &lt;em&gt;Field name&lt;/em&gt;. In the &lt;em&gt;type of data to store&lt;/em&gt;, select &lt;strong&gt;Node refence&lt;/strong&gt; and leave the &lt;em&gt;form element&lt;/em&gt; on&amp;nbsp;&lt;strong&gt;Select list&lt;/strong&gt;. When done, click Save. On the next page, add optional &lt;em&gt;help text&lt;/em&gt; for this field (for instance:&amp;nbsp;&quot;Select a directory to store this document.&quot;) and leave the default value as None.&lt;/p&gt;&lt;p&gt;In the global settings section, tick the &lt;strong&gt;required&lt;/strong&gt; box and leave the &lt;em&gt;number of values&lt;/em&gt; at &lt;strong&gt;1&lt;/strong&gt; - after all, we require each document to live in one directory only.  In the &lt;em&gt;Content types that can be referenced listing&lt;/em&gt;, check the box for &lt;strong&gt;Directory&lt;/strong&gt;. This will limit the nodes you can reference to directories only.&lt;/p&gt;&lt;p&gt;Click&amp;nbsp;&lt;strong&gt;Save field settings&lt;/strong&gt; to save your changes and return to the &lt;em&gt;Manage fields&lt;/em&gt; page.&lt;/p&gt;&lt;p&gt;Now add a field &lt;em&gt;labeled&lt;/em&gt; &lt;strong&gt;File&lt;/strong&gt; and &lt;em&gt;named&lt;/em&gt; &lt;strong&gt;document_file&lt;/strong&gt;. The &lt;em&gt;type of data to store&lt;/em&gt; is &lt;strong&gt;File&lt;/strong&gt; and the &lt;em&gt;form element&lt;/em&gt; should be &lt;strong&gt;File upload&lt;/strong&gt; and click&amp;nbsp;Save.&lt;/p&gt;&lt;p&gt;On the next page, add &lt;em&gt;help text&lt;/em&gt; (eg: &quot;Choose a file to upload to SDDMS.&quot;) and make sure the field for &lt;em&gt;Permitted upload file extension&lt;/em&gt; is empty.&amp;nbsp; This will allow your users to upload any kind of file.&amp;nbsp; If you want to limit the kinds of files they can upload, enter a list of permitted file extensions.&lt;/p&gt;&lt;p&gt;Under &lt;em&gt;File Size Restrictions&lt;/em&gt; you are able to limit the maximum file size your users may upload. This is blank by default and uploads will be limited by the value of &lt;em&gt;upload_max_filesize&lt;/em&gt; in your php.ini file.&amp;nbsp; You can enter a smaller value here to restrict your users more, but you cannot increase the maximum allowed size without editing php.ini.&lt;/p&gt;&lt;p&gt;So that you won&#039;t have clashes between uploaded files, you can specify where on the file system they should be stored an with what name.&amp;nbsp; Under &lt;em&gt;Filefield Path Settings&lt;/em&gt;, enter &lt;strong&gt;sdms/[bookpath]&lt;/strong&gt;.&amp;nbsp; The latter is a replacement token that is provided by the Token, Pathauto and Filefield Paths modules.&amp;nbsp; Together, they will store any uploaded file in a directory under &lt;em&gt;files/sddms&lt;/em&gt; named after the &lt;em&gt;Directory&lt;/em&gt; which is listed in this &lt;em&gt;Document&lt;/em&gt;. You can get a full listing of available tokens by clicking File path replacement patterns.&lt;/p&gt;&lt;p&gt;To avoid incompatible characters in file and directory names and keep them looking tidy, make sure you check the &lt;strong&gt;Cleanup using Pathauto&lt;/strong&gt; and &lt;strong&gt;Convert to lowercase&lt;/strong&gt; boxes.&lt;/p&gt;&lt;p&gt;For the File name field, you want to do essentially the same thing. Leave the tokens &lt;strong&gt;[filefield-onlyname-original].[filefield-extension-original]&lt;/strong&gt; in place and again check the &lt;strong&gt;Cleanup using Pathauto&lt;/strong&gt; and &lt;strong&gt;Convert to lowercase&lt;/strong&gt; boxes under the &lt;em&gt;File name cleanup settings&lt;/em&gt;.&lt;/p&gt;&lt;p&gt;After you check the &lt;strong&gt;Required&lt;/strong&gt; box under &lt;em&gt;global settings&lt;/em&gt; and leave both the list and description fields on&amp;nbsp;Disabled, you can click&amp;nbsp;Save field settings.&lt;/p&gt;&lt;p&gt;For the arch-lazy, you can also import the content type definitions from the attached &lt;a href=&quot;/sites/cafuego.net/files/cck-directory.txt&quot;&gt;directory&lt;/a&gt; and &lt;a href=&quot;/sites/cafuego.net/files/cck-document.txt&quot;&gt;document&lt;/a&gt; files.&lt;/p&gt;&lt;h3&gt;Views: List documents for a specified directory.&lt;/h3&gt;&lt;p&gt;You now have content types that represent documents and directories, but no way of listing the documents that are associated with a given directory.&amp;nbsp; This is where the Views module comes to the rescue. &amp;nbsp;You can use it to generate a list of document nodes without the need to write any PHP code.&lt;/p&gt;&lt;h4&gt;Views: Basic settings&lt;/h4&gt;&lt;p&gt;Go to &lt;em&gt;Administer → Site building → Views&lt;/em&gt; and click add. Choose a descriptive name for the new view, like &lt;strong&gt;list_documents_in_directory&lt;/strong&gt; and add a concise description. The &lt;em&gt;view type&lt;/em&gt; should be &lt;strong&gt;Node&lt;/strong&gt;. &amp;nbsp;When that&#039;s done, click&amp;nbsp;next.&lt;/p&gt;&lt;p&gt;This is the main&amp;nbsp;view adminsitative interface. Start by changing some of the basic settings for the new view.&amp;nbsp;Set the &lt;em&gt;style&lt;/em&gt; to &lt;strong&gt;Table&lt;/strong&gt; and change &lt;em&gt;Items to display&lt;/em&gt; to&lt;strong&gt; 0&lt;/strong&gt;, so all documents will be listed on a single page and set check the &lt;em&gt;Distinct&lt;/em&gt; box to prevent duplication from occurring. Make sure to click &lt;strong&gt;update&lt;/strong&gt; after changing each of these settings.&lt;/p&gt;&lt;p&gt;To make it easy for users to add new directories and documents, change the view footer. Check the &lt;em&gt;Display even if view has no result&lt;/em&gt; box and add the following HTML code in the text field:&lt;/p&gt;&lt;pre&gt;&amp;lt;a href=&quot;/node/add/document&quot;&amp;gt;Add a document&amp;lt;/a&amp;gt; or &amp;lt;a href=&quot;/node/add/book&quot;&amp;gt;add a directory&amp;lt;/a&amp;gt;.
&lt;/pre&gt;&lt;p&gt;Next, change the empty text to &lt;strong&gt;This directory contains no documents&lt;/strong&gt; and click update again.&lt;/p&gt;&lt;p&gt;To permanently save the changes you just made, click save.&lt;/p&gt;&lt;h4&gt;Views:&amp;nbsp;Relationships&lt;/h4&gt;&lt;p&gt;Now you&#039;ll need to do a bit more advanced configuration.&amp;nbsp; To make sure that only documents for a specific directory are listed by the view and so that some information about the attached file is available, you need to add some relationships. If you know about about SQL, a relationship in Views essentially adds a &lt;em&gt;JOIN&lt;/em&gt;&amp;nbsp;clause to the query that&amp;nbsp;Views uses to retrieve data.&amp;nbsp;This makes additional information available for filtering and display.&lt;/p&gt;&lt;p&gt;Start with the link between a document and the directory with which it is associated. Click the &lt;strong&gt;+&lt;/strong&gt; next to &lt;em&gt;Relationships&lt;/em&gt; and select &lt;strong&gt;Content&lt;/strong&gt; in the &lt;em&gt;groups&lt;/em&gt; pull-down menu. Check the box next to &lt;em&gt;Content: Directory (field_document_directory)&lt;/em&gt; and click add. The default label is fine, but ensure the &lt;em&gt;Require this relationship&lt;/em&gt; checkbox is checked before you click uUpdate.&lt;/p&gt;&lt;p&gt;Because it would be good to display some file attachment meta-data in the listing, you will also need a File relationship. Click &lt;strong&gt;+&lt;/strong&gt; and again select&amp;nbsp;&lt;strong&gt;Content&lt;/strong&gt; in the &lt;em&gt;groups&lt;/em&gt; pull-down. This time, check the box next to &lt;em&gt;Content: File (field_document_file) - fid&lt;/em&gt; and click add. This relationship is also required and when you agree that the default label is fine, click update.&lt;/p&gt;&lt;p&gt;Finally, you need a relationship that retrieves the ower of a document. Click &lt;strong&gt;+&lt;/strong&gt; again and select &lt;strong&gt;Node revision&lt;/strong&gt; from the &lt;em&gt;groups&lt;/em&gt; list. There is only one field to choose from; &lt;em&gt;Node revision: User.&lt;/em&gt;&amp;nbsp; Check its box and click add. Change the &lt;em&gt;label&lt;/em&gt; to &lt;strong&gt;Author&lt;/strong&gt; and make sure the &lt;em&gt;Require this relationship&lt;/em&gt; checkbox is checked before you click update.&lt;/p&gt;&lt;p&gt;To make the changes to the relationships permanent, click&amp;nbsp;Save.&lt;/p&gt;&lt;h4&gt;Views: Arguments&lt;/h4&gt;&lt;p&gt;This view is supposed to display the contents of a single directory when a user loads the directory in question. The node ID of a directory can be passed to the view as an argument and we can configure the view to make use of this.&lt;/p&gt;&lt;p&gt;Click the &lt;strong&gt;+&lt;/strong&gt; next to &lt;em&gt;Arguments&lt;/em&gt; and select &lt;strong&gt;Content&lt;/strong&gt; from the groups pull-down. The argument we want is a directory, so check the box next to &lt;em&gt;Content: Directory (field_document_directory)&lt;/em&gt; and click Add.&amp;nbsp; If a directory has no documents associated with it we need the view to display our empy text, so for &lt;em&gt;Action to take if argument is not present&lt;/em&gt; select&amp;nbsp; &lt;strong&gt;Display empty text&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Finally, to make sure that the argument for this view is always a directory you can perform argument validation. Select the &lt;strong&gt;Node&lt;/strong&gt; &lt;em&gt;Validator&lt;/em&gt; and select Directory as the type. Check the Validate user has access to the node box and set the &lt;em&gt;argument type&lt;/em&gt; to &lt;strong&gt;Node ID&lt;/strong&gt;. Change &lt;em&gt;Action to take if argument does not validate&lt;/em&gt; to &lt;strong&gt;Display empty text&lt;/strong&gt; and click update, then save.&lt;/p&gt;&lt;h4&gt;Views: Fields&lt;/h4&gt;&lt;p&gt;Next, add some fields to this view, so it actually displays documents and associated information. Start with the document name.&lt;/p&gt;&lt;p&gt;Click the &lt;strong&gt;+&lt;/strong&gt; after &lt;em&gt;Fields&lt;/em&gt; and select &lt;strong&gt;Node&lt;/strong&gt; in the &lt;em&gt;groups&lt;/em&gt; pull-down list.&amp;nbsp;Scroll down and check the box next to &lt;strong&gt;Node:&amp;nbsp;Title&lt;/strong&gt;, then click Add. Change the &lt;em&gt;label&lt;/em&gt; to &lt;strong&gt;Name&lt;/strong&gt; and check the &lt;em&gt;Link this field to its node&lt;/em&gt; box, then click update.&lt;/p&gt;&lt;p&gt;Next, add a field that contains the name of the attached file. Click the &lt;strong&gt;+&lt;/strong&gt; and select&amp;nbsp;&lt;strong&gt;File&lt;/strong&gt; in the groups pull-down.&amp;nbsp;Scroll the list down a bit an check the box next to &lt;em&gt;File: Name&lt;/em&gt;, then click&amp;nbsp;add. Change the &lt;em&gt;label&lt;/em&gt; to&amp;nbsp;&lt;strong&gt;File&lt;/strong&gt; and use the &lt;strong&gt;File&lt;/strong&gt; &lt;em&gt;relationship&lt;/em&gt; to retrieve this field.&amp;nbsp;Click update to add the field to the view.&lt;/p&gt;&lt;p&gt;Repeat the previous step twice to also add the &lt;em&gt;File: Mime type&lt;/em&gt; and &lt;em&gt;File: Size&lt;/em&gt; fields to the view.&lt;/p&gt;&lt;p&gt;To add the username of the uploader, click the &lt;strong&gt;+&lt;/strong&gt; and select &lt;strong&gt;User&lt;/strong&gt; from the &lt;em&gt;groups&lt;/em&gt; pull-down.&amp;nbsp;Scroll down the list a bit and check the box next to &lt;em&gt;User: Name&lt;/em&gt;, then click&amp;nbsp;add.&amp;nbsp; On the next page, select the &lt;strong&gt;user&lt;/strong&gt; &lt;em&gt;relationship&lt;/em&gt;, change the &lt;em&gt;label&lt;/em&gt; to &lt;strong&gt;Author&lt;/strong&gt;, and check the &lt;em&gt;Link this field to its user&lt;/em&gt; box. Click update to add the field.&lt;/p&gt;&lt;p&gt;Lastly, add a counter field that shows how many times the document has been viewed. Click the &lt;strong&gt;+&lt;/strong&gt; and select &lt;strong&gt;Node statistics&lt;/strong&gt; from the &lt;em&gt;groups&lt;/em&gt;, then click add. This field does not use a relationship, and when you are happy with the label and formatting options, click update.&lt;/p&gt;&lt;p&gt;These are all fields for now, so click save to permanently save your changes.&lt;/p&gt;&lt;h4&gt;Views:&amp;nbsp;Sorting and filtering&lt;/h4&gt;&lt;p&gt;To make sure the view displays the table of documents in an orderly format, click the &lt;strong&gt;+&lt;/strong&gt; next to &lt;em&gt;Sort criteria&lt;/em&gt;. Select &lt;strong&gt;Node&lt;/strong&gt; in the &lt;em&gt;groups&lt;/em&gt; pull-down and check the box next to &lt;strong&gt;Node:&amp;nbsp;Title&lt;/strong&gt; in the list, then click add.&amp;nbsp; This sort criterion does not use a relationship and ascending sort order is fine, so click update.&lt;/p&gt;&lt;p&gt;Finally, you want to make sure that this view only lists nodes of the Document type and not Directories, Pages, Stories or any other kind you may add later. Click the &lt;strong&gt;+&lt;/strong&gt; next to &lt;em&gt;Filters&lt;/em&gt; and select &lt;strong&gt;Node&lt;/strong&gt; in the &lt;em&gt;groups&lt;/em&gt; pull-down. Scroll down the list and check the box next to &lt;em&gt;Node:&amp;nbsp;Type&lt;/em&gt;, then click add.&amp;nbsp; You don&#039;t need a relationship here either, but you do want to select &lt;strong&gt;Is one of&lt;/strong&gt; as &lt;em&gt;Operator&lt;/em&gt; and &lt;strong&gt;Document&lt;/strong&gt; as &lt;em&gt;Node type&lt;/em&gt;. &amp;nbsp;When done, click update.&lt;/p&gt;&lt;p&gt;With that done, your view is complete, so click save to make these last changes permanent.&lt;/p&gt;&lt;p&gt;If you want to create this view a bit faster, you can import the &lt;a href=&quot;/sites/cafuego.net/files/list-files-in-directory.txt&quot;&gt;PHP code that I created&lt;/a&gt; by exporting my copy of this view as well.&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;The Views UI&quot; src=&quot;/sites/cafuego.net/files/document-list-view.png&quot; border=&quot;0&quot; height=&quot;265&quot; hspace=&quot;8&quot; vspace=&quot;2&quot; width=&quot;500&quot; /&gt;&lt;/p&gt;&lt;h3&gt;CCK&amp;nbsp;Revisted:&amp;nbsp;Add the View&lt;/h3&gt;&lt;p&gt;Now that you have a view, you&#039;ll need to have it listed on each Directory you access. Go back to &lt;em&gt;Administer&amp;nbsp;→ Content Management&amp;nbsp;→ Content types&lt;/em&gt; and click &lt;strong&gt;Manage fields&lt;/strong&gt; for the &lt;em&gt;Directory&lt;/em&gt; content type. Add a new field &lt;em&gt;labeled&lt;/em&gt; &lt;strong&gt;Documents&lt;/strong&gt; and &lt;em&gt;named&lt;/em&gt; &lt;strong&gt;directory_documents&lt;/strong&gt;. The field type is &lt;strong&gt;View field&lt;/strong&gt; and the &lt;em&gt;form element&lt;/em&gt; is &lt;strong&gt;select list&lt;/strong&gt;. When done, click save.&lt;/p&gt;&lt;p&gt;Because you always want to display the same view and disallow your users from changing this field, you should check the &lt;strong&gt;Force default&lt;/strong&gt; box. Also check the &lt;strong&gt;Required&lt;/strong&gt; box and set the number of values to &lt;strong&gt;1&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;The allowed views should be limited to the view you just created, &lt;strong&gt;list_documents_in_directory&lt;/strong&gt;. You should also select it in the list under the &lt;em&gt;Documents&lt;/em&gt; heading. &amp;nbsp;Finally, you can pass an argument to the view.&amp;nbsp; As you&#039;ll recall, the view requires a node ID for a Directory node.&amp;nbsp; That means that as &lt;em&gt;argument&lt;/em&gt; here you should enter &lt;strong&gt;%nid&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;/sites/cafuego.net/files/directory-document-field.png&quot; alt=&quot;Document field on directory node&quot; height=&quot;150&quot; width=&quot;500&quot; /&gt;&lt;/p&gt;&lt;p&gt;This means that when a Directory is accessed by a user, its node ID is passed to the view and the resulting list of documents is displayed to the user. Click save field settings to finish setting up Drupal.&lt;/p&gt;&lt;h2&gt;Nearly there: URL&amp;nbsp;Aliases&lt;/h2&gt;&lt;p&gt;To make useful permalinks to your directories and documents, you can have Drupal automaticallty generate URLs based on the names of nodes you create. Go to  &lt;em&gt;Administer&amp;nbsp;→ Site building&amp;nbsp;→ URL aliases&lt;/em&gt; and click Automated alias settings.&lt;/p&gt;&lt;p&gt;Under Node path settings you can enter a list of strings and token substitutions you want Drupal to use to generate URLs.&lt;/p&gt;&lt;p&gt;For the &lt;em&gt;Directory&lt;/em&gt; type, enter &lt;strong&gt;sddms/[bookpath-raw]/[title-raw]&lt;/strong&gt; and for the &lt;em&gt;Document&lt;/em&gt; type enter &lt;strong&gt;sddms/[bookpath-raw]/[field_document_directory-title-raw]/[title-raw]&lt;/strong&gt;, then click save configuration.&lt;/p&gt;&lt;h2&gt;Finally: Start Uploading&lt;/h2&gt;&lt;p&gt;You are now ready to create the first Directory node.&amp;nbsp;Go to &lt;em&gt;Create content →&amp;nbsp;Directory&lt;/em&gt; andenter a name and description for your root directory. Under &lt;em&gt;Book outline&lt;/em&gt;, be sure to select &lt;strong&gt;&amp;lt;create a new book&amp;gt;&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;When you save the directory, you&#039;ll see that it does not contain any documents, but it does now allow you to add a new directory or document.&lt;/p&gt;&lt;p&gt;Before you start making use of your new Drupal based document management system you will probably want to create a few roles and assign them permissions.&amp;nbsp; You could also use the &lt;a href=&quot;http://drupal.org/project/acl&quot;&gt;ACL&lt;/a&gt; or &lt;a href=&quot;http://drupal.org/project/taxonomy_access&quot;&gt;Taxonomy Access Control&lt;/a&gt; modules to provide more fine-grained access control.&amp;nbsp; You&#039;ll probably also want to grab some &lt;a href=&quot;http://themegarden.org/drupal6/&quot;&gt;themes&lt;/a&gt;, so you can make your DMS not look like a generic Drupal installation.&lt;/p&gt;&lt;p&gt;Note that you&#039;re not limited to a singe root directory, you can create as many as you want and so host multiple document repositories on the same Drupal instance.&lt;/p&gt;&lt;h2&gt;TODO: Profile&lt;/h2&gt;&lt;p&gt;Something that is still on my&amp;nbsp;TODO list is to provide an install profile, so setting up a new SDDMS instance is as easy as a few mouse clicks. Of course, patches are always welcome ;-)&lt;/p&gt;&lt;!-- google_ad_section_end --&gt;
&lt;!--
&lt;rdf:RDF xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:trackback=&quot;http://madskills.com/public/xml/rss/module/trackback/&quot;&gt;
&lt;rdf:Description rdf:about=&quot;http://cafuego.net/2009/07/11/simple-drupal-document-management-system&quot; dc:identifier=&quot;http://cafuego.net/2009/07/11/simple-drupal-document-management-system&quot; dc:title=&quot;Simple Drupal Document Management System&quot; trackback:ping=&quot;http://cafuego.net/trackback/339&quot; /&gt;
&lt;/rdf:RDF&gt;
--&gt;
&lt;div class=&quot;trackback-url&quot;&gt;&lt;div class=&quot;box&quot;&gt;

  &lt;h2&gt;Trackback URL for this post:&lt;/h2&gt;

  &lt;div class=&quot;content&quot;&gt;http://cafuego.net/trackback/339&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;table id=&quot;attachments&quot; class=&quot;sticky-enabled&quot;&gt;
 &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Attachment&lt;/th&gt;&lt;th&gt;Size&lt;/th&gt; &lt;/tr&gt;&lt;/thead&gt;
&lt;tbody&gt;
 &lt;tr class=&quot;odd&quot;&gt;&lt;td&gt;&lt;a href=&quot;http://cafuego.net/sites/cafuego.net/files/list-files-in-directory.txt&quot;&gt;list-files-in-directory.txt&lt;/a&gt;&lt;/td&gt;&lt;td&gt;7.23 KB&lt;/td&gt; &lt;/tr&gt;
 &lt;tr class=&quot;even&quot;&gt;&lt;td&gt;&lt;a href=&quot;http://cafuego.net/sites/cafuego.net/files/cck-directory.txt&quot;&gt;cck-directory.txt&lt;/a&gt;&lt;/td&gt;&lt;td&gt;2.69 KB&lt;/td&gt; &lt;/tr&gt;
 &lt;tr class=&quot;odd&quot;&gt;&lt;td&gt;&lt;a href=&quot;http://cafuego.net/sites/cafuego.net/files/cck-document.txt&quot;&gt;cck-document.txt&lt;/a&gt;&lt;/td&gt;&lt;td&gt;4.69 KB&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
</description>
 <comments>http://cafuego.net/2009/07/11/simple-drupal-document-management-system#comments</comments>
 <category domain="http://cafuego.net/category/tags/alfresco">alfresco</category>
 <category domain="http://cafuego.net/category/tags/document-management">document management</category>
 <category domain="http://cafuego.net/category/tags/drupal">drupal</category>
 <category domain="http://cafuego.net/category/tags/sdms">sdms</category>
 <category domain="http://cafuego.net/category/tags/sharepoint-killer">sharepoint killer</category>
 <enclosure url="http://cafuego.net/sites/cafuego.net/files/list-files-in-directory.txt" length="7402" type="text/plain" />
 <pubDate>Sat, 11 Jul 2009 05:53:04 +0000</pubDate>
 <dc:creator>cafuego</dc:creator>
 <guid isPermaLink="false">339 at http://cafuego.net</guid>
</item>
</channel>
</rss>

