2
votes

I'm using Alfresco Share 4.2c and I have an aspect with a property of type d:text. On the Edit Metadata page I would like to create a custom picker for that property.
The closest thing to a file picker I've seen is the association.ftl control. However, if I use it, it doesn't let me select my items, I don't have the symbol "+" beside.
I don't use associations, but maybe I can extend association.ftl to choose my items? Or there is another way to solve my problem?

Thanks in advance,
Jana

3
What items do you want to pick from? Where do you store those? So the functionality is like a muliselect, but insted you want the look and feel of the association-picker? - billerby
Actually I want to pick Nodes from a folder in a repository. In view mode my text property should be a link to the node with the same name in that folder, like using association.ftl. And on Edit Metadata page I want to be able to pick Nodes from that folder. Maybe I could use multiselect, it's not necessary to look like association-picker, but my main problem is how to pass value from folder in the repository to multiselect list. Do you know how to do that? Thank you for your time and attention. - Jana

3 Answers

4
votes

The thing is you'll also need the add a custom object-finder.js

In the client site JS file it does a specific call to Alfresco.constants.PROXY_URI + "api/forms/picker/" + this.options.itemFamily;

So you'll need to define a custom repo webscript which will return your aspect node so you can pick that one.

So in short:

  1. Custom association.ftl & picker.inc.ftl to initialize your custom object-finder
  2. Custom (new name) object-finder.js
  3. Change the form.get.head (probably changed in 4.2) and include your new js
  4. Custom repo webscript which returns in the same matter as the default webscript your aspect nodes

---- UPDATE ----

After seeing your comment to start in a specific location take a look at the wiki. There is a startLocation param you can fill & the displayMode can be set to list to do a multi-select.

2
votes

You can find detailed instructions on how to extend object finder to meet your requirements.

With custom association.ftl, picker.inc.ftl and object-finder.js .

http://alfrescoblog.com/2014/05/28/alfresco-share-custom-object-finder-js/

1
votes

You can create customAssociation.ftl and change itemType: "${field.endpointType}" to itemType: "my:nameType" where "my:nameType" is the type of nodes you want to select. In that way they become selectable. Tahir gave you a good explanation, but maybe this is another way to solve that issue.