AnsweredAssumed Answered

Paid Project: Metadata field dropdown based on lucene query

Question asked by aantonop on Feb 28, 2010
Latest reply on Mar 22, 2010 by eddiem
We are accepting proposals for paid Alfresco development, via the elance.com system. If interested in getting paid to develop this simple customization project please use elance to submit a bid (all work must be done via elance). If you are interested in this result, check here afterwards for an update. We will contribute any resulting code and documentation back to the community:

The goal of this project is to populate a text field in a custom aspect by presenting the user with a dropdown. The dropdown choices are populated dynamically by the results of a lucene query, in this case a the names of subfolders of a specific folder. This allows us to dynamically update the list simply by adding a folder a space. The project is intended to be easily generalizable. It is a custom implementation of an idea by jbarmash.

http://www.elance.com/job?jobid=19265008&rid=WD01

We are implementing an Alfresco custom model to apply an Alfresco "aspect" to our content. The aspect is the name of the client that the content (file) is related to. We want to be able to tag different files as related to one of our clients

Alfresco allows us to extend the content model and define new fields. We are defining "client" as a text field. Rather than having the user enter the information manually, we would like to present a select dropdown with a specific list of clients. But, because the list of clients changes often, we don't want to hard code it into the model. Instead we want to dynamically create the list from an Alfresco/Lucene search query. Essentially, we want to search the "Clients" folder and use the names of the sub-folders to create the list. To add a new client, all you would need to do is create a new subfolder in the Client space and the next time you try to add content anywhere, the list of clients includes the new client.

Example:

We have a folder called Clients (somewhere in the repository). Underneath are subfolders like this -
Clients/A
Clients/B
Clients/C

When a user uploads new content (anywhere in the repository), they must select which client it is related to. The form shows them a drop down that contains A, B, C because those are the subfolders found *at that time* in a real-time search of the "Clients" folder. The user selects "A" and the string "A" is put into the client field of the client-specific aspect.

There is sample code that already does this (dropdown based on Lucene query). You can find an article here:

http://blogs.alfresco.com/wp/jbarmash/2008/08/08/dynamic-data-driven-drop-downs-for-list-properties/

The sample code itself is here:

http://share.alfresco.com/share/page/site/community/document-details?nodeRef=workspace://SpacesStore/077e45f2-423f-43d5-8137-d88490d85d50

We need this code customized for our needs, as described above, to summarize:

A dynamic dropdown, generated by running a query, searching for the subfolders of a specific folder, and listing the name of each subfolder as one of the options in the dropdown, so when the user selects it, it populates the text field.

We will provide a completely blank test server (with Alfresco installed and configured correctly) where you can have unlimited ability to modify and test anything you want

The final deliverable will be:
a) source code, under GPLv2 license that implements what we describe above
b) documentation for installation of this code in a new Alfresco setup
c) documentation of 3 examples that allow us to repurpose the code to do a different kind of search by offering three example search queries and where we would modify the code
d) (optional) packaging as an Alfresco amp plugin for easy installation

Outcomes