Document Repository

Update Aug 26, 2011

Today I pushed out version 0.2.4 which has script fixes for link insertion & cross domain support for IE (tested with 8 & 9). It’s the go version. Those two issues with IE were the only things we found since 0.2.3.

Update Aug 11, 2011

Today I pushed out version 0.2.3 which is a release candidate. Essentially everything is done with the plugin but more extensive/wider use may reveal a bug. Updates/additions:

  • Several script fixes
  • filter for uses custom caps with the custom taxonomies document_taxonomy_capabilities
  • If you have selected text in the post editor and insert a document link, the selected text is used as the link text for the document link
  • translation support

Original post

Over the weekend I released the beta version of the Document Repository plugin.I’ve labeled it as a beta because I have a bit more work to do on it. However, the current version does work and only lacks a few minor things like translation support, etc. Over the next week or so I will be rolling those final touches in. I’ll update this post accordingly.

The main goal of the plugin is to provide a central repository of documents for a website using WordPress as a CMS. Many organizations implementing a CMS update their documents on an ongoing basis. Using the default media handling in a WordPress would mean updating URLs to uploaded documents throughout the website’s content as new versions of documents were uploaded. The document repository does not contain any workflow, collaboration, version control or approval features. If you are looking for a document authoring collaboration tool, please see WP Document Revisions.

The Document Repository implements a custom post type and custom attachments to achieve document revisioning where the permalink to the latest version of the document persists for the life of the document post (although the permalink is editable). The permalink to the current version of the document is

/document/document-name

Earlier versions of the document are also available via permalink

/document/document-name/version/3

Assuming there is an attachment available for downloading, a request to either of the permalinks above generates a direct download of the associated document.

The Document Repository plugin was developed in collaboration with the University of Mary Washington.

Usage

In a single WP install, activate the document repository and any of the included optional plugins you wish.

In a network,

  • activate the document repository on one site in the network. Do not network activate it unless you want all the sites in the network to be document repositories.
  • if you are implementing the custom taxonomies, activate that plugin on the document repository site.
  • if you are implementing the custom roles, activate that plugin on the document repository site.
  • if you are implementing the network extras, network activate that plugin.

The document repository plugin adds a Document post type to the WP dashboard. When editing a document post, enter a title and description/abstract which will be shown in search results in the document repository site. Click on the media button to open the media library. In the media library upload the document file. Once uploaded, click the finish button to return to the Document post.

The custom taxonomy plugin is included as a sample of implementing custom taxonomies with Document posts. It requires a document be given a term from all the custom taxonomies before allowing the document to be published. If you modify the taxonomy plugin to suit your implementation, copy it out of the document-repository folder and rename the PHP class to avoid duplicate classes and having your version overwritten by an update.

The custom roles plugin adds an Roles screen under the Documents menu. Add your roles through this screen. Then edit the site users’ profiles and assign the appropriate roles to the editors, authors & contributors. Once these roles are assigned, editors will only have edit permission on their own Document posts and authors & contributors that have the same Document role as they do. Site admins & super admins have access to all the document posts.

The extras plugin adds a media button to the media buttons in the edit post & page screens. Clicking this button opens a custom media screen to a search feature for the document repository. Documents can be searched by text string (same as default WP search), tag and/or custom taxonomy (if active on the document site). An Insert into Post link is provided for each Document.

About Ron

Homeschooling dad of 4 (ages 27 - 14), grampy to 3, WordPress core contributor, former farmboy & software developer by profession.

Comments

  1. This really looks aewsome, and something I’ve been looking for the last weeks.Will try it out!
    Thanks a lot!!

  2. The Gravityforms-add button appears next to the media button in the admin-post-edit section. Perhaps nicer if this doesn’t happen…
    Am experimenting with the roles. Possible hard to combine with the premium membership plugin…
    I’ll you know.

    Thx and cheers!

    • You’re paying the folks at Gravity forms for support. They are the logical people to ask about issues related to their plugin.

      I’ve never used either Gravity forms or any premium membership plugin, so I’m really not the person you should be asking about those.

      • Point taken.
        I just thought that, since the other media upload icons were gone in the post-edit section of this simple but effective plugin, you wanted to know so you could perhaps enhance the code.
        Don’t know, I’m no expert in that. That’s why I use perium plugins every once in a while…
        Cheers!

        • I just thought that, since the other media upload icons were gone in the post-edit section of this simple but effective plugin, you wanted to know so you could perhaps enhance the code.

          You lost me actually. This plugin removes all but one of the upload buttons in the document post window. In the edit post window it adds one but doesn’t remove any. I’m not sure how that relates to either of the plugins you mentioned.

          • No problem. I checked and see in both New Document and the Document Edit screen two upload buttons: Media upload and the form icon.
            So the removal goes OK, but it leaves one button extra, and it makes no difference between the windows you mention in your reply.
            Just to let you know, not to nag or be negative.

          • On your local computer search the gravity forms plugin for ‘media_buttons_context’. You should find an add_filter or add_action line.

            If you leave that line in a comment I’ll see if I can come up with a small plugin you can use to remove the GF button on the documents screen.

          • Actually, Ron, this is an issue we’ll need to tackle at UMW, too; so I’ll see if I can find the solution and will share it with you guys once I’ve done so.

  3. Hi Ron,

    Do you have some screenshot or a link to a working sample
    Diane Mercier

    • No I don’t have a link to a working sample. You’ll have to download it and try it. I’m hoping to have a new version out by the end of the day.

  4. Ron,

    Thanks for the shoutout. Agree our plugins are very different. Gave yours a try, and looking forward to future versions. May be some opportunities to collaborate here.

    If you’re interested in more info on WP Document Revisions, I just posted a screencast of a typical use case, and brief overview of top-level features over on the WP Document Revisions page.

    • Hey Ben,

      I haven’t had a chance to get back to looking at document revisions in a couple months (and probably won’t for a while due to some things that have come up offline). The last time I looked at it it was looking really great.

      Excepting FOSS projects, any of the document collaboration implementations I’ve seen have been secured very far away from direct access via the Internet. Typically someone would be responsible for downloading the document from the collaboration site and publishing it on the public facing web site. That’s a place where we might be able to work some magic :)

  5. Adam J. Blust says:

    How would I go about creating display pages for the documents? I would like to use this plugin as the basis for a public document library on my site, organized by categories.

    Thanks,
    Adam J. Blust

  6. Hi,
    great plugin – but I am having an issue with the insert document button.
    it pops the window where I would expect to select or search for the document, but the dialogue is blank.
    I have tested in Firefox 8, Chrome, IE9 and same issue occurs.
    HELP!

    • In Firefox or Chrome, right click the media frame and view source. You’ll probably see an error.The media frame sometimes doesn’t show PHP error messages.

    • Hi Ron and Adam,

      I am having the same problem with the file insertion pop up window. I’m not sure that I do see an error in the source. Adam, how did you solve your? Ron, any more suggestions for trouble shooting?

      Thanks.

      Sarah

      • If you are using WP 3.3 get the development version of the document repository. I haven’t released the new version yet because I’m waiting for testing feedback.

  7. Hey ! What a wonderful plugin.
    I get some troubles… maybe you could help.
    First, permalinks don’t work when wordpress is in a subfolder. Il don’t know how to modify it…
    Second, when I upload a document, I don’t have any message or any view of this document. I mean, the media library for the post is empty…
    But, with your plugin I achieved what I expected to do ;-)
    I’m working with the last release of WordPress.

    • For permalinks, are you using the default.

      The media tool/screen for your post area is in the Extras plugin included with the document repository. Activate it and you’ll get an extra media button for inserting documents into posts.

      • Thank you for your response.
        About the permalinks, I’m using a personnalized syntax, but nothing weird. And, just for the documents, I’m getting the subfolder twice in the url.
        About the media tool/screen… this is a bit different. Extras plugin was activated. When I want to upload, in the media popup, I can choose and upload the file. But there’s nothing else than a “finished” message and no view of any document. But it’s here !!

        • You don’t need to see the document in the media window since it can’t be cropped and otherwise manipulated as media. When you click Finish the window closes & the edit post window is refreshed. The link to the document is in the Revision metabox.

          For the purposes of revisioning it was necessary to remove the document from the media library.

          • Good to know !!
            As the revision box is misplaced by default (not your fault !), I didn’t see it… now I should be more accurate with the next documents ;-)

            Anything about my other problem with the permalinks ? Is it solvable with url rewriting or your code have to be twicked to do the trick ?

          • The rewrites are handling starts on line 488 of document-repository.php.Not sure why your path/base is being doubled.

  8. Now I’m starting to feel dumb at this moment. I am new to wordpress (about an 1hr) and added this Doc Repo plugin. I can see where to upload varuious forms of media etc. But for the life of me I can’t see how to upload pdf/docx/xlsx documents. Hopefully someone (Ron) can help me point my mouse in the right direction.

    Tks..Jim

  9. Hi Ron,
    I would like to change the taxonomies used with this plugin. When you state ‘ If you modify the taxonomy plugin to suit your implementation, copy it out of the document-repository folder and rename the PHP class to avoid duplicate classes and having your version overwritten by an update.’ I am not sure where to copy it to? Duplicate file and rename the class? I apologize I am not that great with php but would love to try and use this. Thank you, it looks like a great plugin :-)

    Also, if I create other taxonomies in my site, would that cause a conflict with the taxonomies created with this plugin. I have another created but it doesn’t show as a selection choice when I create a new document/post.

    Thanks again.

    • You can copy it to your plugins folder.

      When you register your taxonomy is has to be attached to or associated with the post type(s) when it’s registered that you want it to be associated with. If you are using my samples as a model, that plugin has code for that.

      The only time you’ll have taxonomy conflicts is if two different taxonomies have either the same name or the same rewrite slug.

  10. Ron – Has this plugin been updated to support WordPress 3.3. I am getting an error related to media files on extras.php file. Can you check it out for me? Thanks.

Trackbacks

  1. [...] seen it, Ron Rennick wrote an amazing plugin for us at University of Mary Washington that lets us manage all of our documents (PDF, Word, Excel, etc.) from a single site in our WordPress network; and then insert links to those documents from within any other site in the network. The plugin [...]