Search code examples
alfrescoalfresco-sharealfresco-webscriptsdms

Document Upload Approval in Alfresco Community


i've recently installed Alfresco Community Edition on my Laptop for testing purposes, and now i want to know how (or if it is possible) to configure alfresco so that documents to be uploaded to the repository (regardless of being shared or personal or being in a site) is are subject to be an admin's approval ?

i've seen this feature on Sense.NET, i know that they are two different system one or the other. but i just want to know if i can achieve such configuration. it is just ashame that SenseNET did not meet my requirements.

i hope somebody can give me a walkthrough here.


Solution

  • There is no easy way to make every document, regardless of where the user wants to put it, subject to admin approval before it shows up where it is supposed to.

    Alfresco, which literally means "in the open" is a collaborative system that defaults to be permissive, not restrictive. But the tools are there to allow you to meet these requirements and I've written tutorials that will show you how to do it.

    The first problem is, how do you hide a newly created document until the admin reviews it? For this you need to automatically set the permissions so that only the admin and the creator can see it. Use a Behavior for this. It will watch for the creation of new cm:content nodes and automatically set the permissions as I've described. See http://ecmarchitect.com/alfresco-developer-series-tutorials/behaviors/tutorial/tutorial.html.

    A good reason to use a behavior for this is that it will trigger your custom code regardless of how the document gets added to the repository, whether through Share, FTP, WebDAV, CMIS, etc.

    You might also want to add a "marker" aspect to the document so that you can show an indicator in the document library that tells the creator it is under admin review. The content types tutorial talks about custom aspects: http://ecmarchitect.com/alfresco-developer-series-tutorials/content/tutorial/tutorial.html

    And you could add a "Review Complete" action that would show up in the list of UI actions that an admin could click to signify that the review was complete. The action would reset the permissions to be whatever they should be based on where the document resides (basically, re-enable ACL inheritance and remove the admin-only entry).

    For both of these look at the custom actions tutorial here: http://ecmarchitect.com/alfresco-developer-series-tutorials/actions/tutorial/tutorial.html.

    The next problem is how does the admin know when there is a document they need to review? Probably the best thing to do would be to start a workflow. The behavior that sets the permissions could do this. That way, every new file will spawn a task that sits in the admin's task list. If you have more than one admin, use a pooled task. That way only one of the admins needs to work the task. For this, take a look at the workflows tutorial here: http://ecmarchitect.com/alfresco-developer-series-tutorials/workflow/tutorial/tutorial.html.

    You can do what you are trying to do by combining all of these techniques. The good news is you'll know a lot about Alfresco when you are done!