Saturday 30 April 2016

Quick way to disable upload file button for a specific folder in Alfresco Share

We all like to develop based on the best practices and that is what I recommend as well. However, sometimes in the interest of time, we may have to go for a quick solution considering the practical situation. For example, think of a scenario where you are preparing for a demo and at last moment you realize that you need to take care of some specific use case. I am sure, you must be looking forward to know how quickly and easily you can achieve it. That's where quick solutions would be very helpful. Here I am going to share with you one such quick trick which may be helpful to you somewhere sometime.

While working on Alfresco you may have come across a use case that, you want to disable upload file button in Alfresco Share for some specific folder and all folders under it.

Here is how you can have it working just in 5 minutes for your Alfresco Community 5.1 installation.

1. In your Alfresco installed directory, copy code from toolbar.js to toolbar-min.js at the location tomcat/webapps/share/components/documentlibrary/
[Note : It is always recommended to have your client side JS files minified for having a better page load performance. Although we are knowing that, however in order to get the things ready in the interest of time, we are not minifying the JS here]

2. Add following code snippet under onFilterChanged function in toolbar-min.js.Provide the folder name for which you want to hide the upload button.

//Custom start
if(this.doclistMetadata.parent.properties["cm:name"] == "Folder Name|| this.currentPath.indexOf("Folde Name") !== -1) {                       
        this.widgets.fileUpload.set("disabled", true);
} else {
        this.widgets.fileUpload.set("disabled", false); 
}
//Custom end

Above change in toolbar-min.js, will appear as shown in the following screenprint. Highlighted in blue is the custom code we have added to disable the upload file button for a folder named MyFolder and all its subfolder.

code snippet to disable upload file button for a specific folder and its subfolders
Hope this would be helpful.


Monday 4 April 2016

I have contributed an article about Alfresco on Open Source For You

Pleased to share with you that I have recently contributed an article on Open Source For You (OSFY) which talks about some of the basic key capabilities everyone must know about Alfresco. Take a look at 9 Things you must know about Alfresco – An Open Source ECM on OSFY which was formerly known as Linux For You. It has been Asia's first publication about Linux and Open Source Software. It's a complete magazine on Open Source and plays an important part of Open Source culture in India.

Friday 1 April 2016

3 Alfresco Share add-on topics to enhance user experience with Alfresco

Add-on is a great way to have additional functionalities/features/customization added on top of out-of-the-box Alfresco. Having the add-on with great functionalities which is freely available adds a lot of value for anyone using Alfresco.

I have 3 topics in my mind for Alfresco Share add-on and I think once implemented they surely will be useful for the users using Alfresco and will enrich their experience using Alfresco.

The list goes as following.

1. Workflow routing when user is out-of-office
Workflows are the integral part of any business solution implemented using Alfresco. Think of a scenario where a user is going on vacation and he wants to set someone else as an approver on his behalf for that specific duration. Hence, during his vacation period all the workflow tasks those are going to be assigned to him, should be sent to the approver he has setup. This seems to me a very generic functionality and having it implemented will surely complement out-of-the-box Alfresco Share workflow functionality and will help end users to have a simplified process.

2. Workflow assignees from a specific group
Sometimes in a workflow process, it may happen that you want to assign task to some users from some specific group only (not want to assign workflow task to entire group) and not want to search for users from the entire repository while selecting the assignee for the task. Instead you just want to have the select assignee popup pre-populated on the left hand side with users from the specific group for the workflow task and from this list user can select assignees. This will make it very easy for the end user to select the next approver and need not to worry about searching specific user from the repository in such scenarios.

3. Enhanced view of document details
Presently, from the document library, user clicks on a document which opens up document details screen and from there if user wants to take a look at another document, he has to come back to document library folder again. What if we have an additional view where the document/folder tree would be on the left hand side on document details page and click on it and the document details get updated with the newly selected document. Hence, from a single screen user can take a look at details of document without going back. I think this will be very useful.

These are the topics at high-level and if I get time would like to work on it to get them implemented and available as freely available add-on. If you have any comments to share on this ideas or any thoughts you have on this ideas, do share your thoughts. Also, if you would be interested to develop and contribute them as freely available add-on you are most welcome.

Another one topic that is not related to user experience however, it can help while working on some production issues. Sometimes it may happen that some functionality is not working for some XYZ user in production environment. While solving the functionality, only the issue description would not suffice and you may have to do followups with user in order to understand the problem. What if there is an option, wherein admin user has privilege after login to alfresco to run as other user. For example, admin user selects to run the present session as XYZ user to see what is going wrong and later on switch back from this context to his own. Just an idea and not sure how feasible it is, however I think could be a great help while solving/debugging some critical issues.