cancel
Showing results for 
Search instead for 
Did you mean: 

Extending 'Selected Items...' menu in Share

drocco88
Champ in-the-making
Champ in-the-making
Hi there,

I've seen some examples online on how to put an action under "Selected Items…" but all of them replace "toolbar.get.config.xml" and "repo-toolbar.get.config.xml".

My idea is to only put an action in <actionSet id="default"> and make it merge with alfresco's.

How can I achieve that?

Many thanks
Rocco
8 REPLIES 8

ddraper
World-Class Innovator
World-Class Innovator
This blog post describes what you need to do: http://blogs.alfresco.com/wp/mikeh/2011/09/26/share-document-library-extensions-in-v4-0/

Regards,
Dave

drocco88
Champ in-the-making
Champ in-the-making
Thanks for the info David.

Ok was was using the dependencies to load the .js and .css (condition="DocLibCustom") but I still don't know how to put the action in "Selected Items…" without having to override toolbar.get.config.xml

drocco88
Champ in-the-making
Champ in-the-making
Basically this is the render of the toolbar:

<#list actionSet as action>
   <li><a type="${action.asset!""}" rel="${action.permission!""}" href="${action.href}"><span class="${action.id}">${msg(action.label)}</span></a></li>
</#list>

I see is using an actionSet instead of the ActionGroup

drocco88
Champ in-the-making
Champ in-the-making
Well at least is a known issue (I'm on alfresco 4.1.1):

https://issues.alfresco.com/jira/browse/ALF-13592

It says fix version for 4.1.1 though

drocco88
Champ in-the-making
Champ in-the-making

ddraper
World-Class Innovator
World-Class Innovator
The only place that any .config.xml WebScript file is ever used is from the JavaScript controller for that WebScript (in the case of the toolbar.get.js file it is actually refrenced from the included toolbar.lib.js file). This means that you can use the current extensibility methods available for extending the JavaScript controller to add additional actions (or even remove actions defined in the default configuration file).

I think that we're going to begin phasing out the use of the the .config.xml files and either move the configuration directly into the JS controllers (so that it's easier to extend) or into global configuration so that it is easier to find and re-use.

Regards,
Dave

mluraschi
Champ in-the-making
Champ in-the-making
Hello, I am using Alfresco 5.0.0.3 Enterprise. My task is to hide the "Start Workflow…" action in the toolbar in specific conditions, for which I already have an evaluator (I check if they are children of a specific type).
I tried to follow up the discussion and the links provided and what I ended up doing is copy repo-toolbar.get.config.xml file in web-extension folder, and change the line from:
<blockcode>
<action type="action-link" id="onActionAssignWorkflow" asset="document" label="menu.selected-items.assign-workflow" />
</blockcode>
to:
<blockcode>
<action type="action-link" id="onActionAssignWorkflow" asset="document" label="menu.selected-items.assign-workflow">
     <evaluator>evaluator.doclib.action.is.admin</evaluator>
     <evaluator negate="true">evaluator.doclib.action.is-in-report-or-wave</evaluator>
</action>
</blockcode>

But that didn't change a thing. Another tentative was to copy the whole
<multi-select>
section in my share-config-custom.xml file and apply the same changes (add the evaluator to the action). Still no results.

I'm sorry but I have a very poor understanding of these configuration files, I got into Alfresco only recently and the way
<extension>
works for newer things makes much more sense to me. 😕

Also: I would like to hide the "Start Workflow" button from the "Workflow" section in Document Details, have you got any indications?

Thank you very much for any help.

EDIT:

I've checked <a href=http://www.ixxus.com/blog201211alfresco-share-customisation-document-library-toolbar-0/>this</a> link, which is probably the updated link for the one Rocco provided, and checked against 5.0.0.3 version of toolbar.lib.js and it already does something similar to what he described, only the delimiting tag is
<multi-select>
instead of
<toolbar-actions>
.

ctan
Champ in-the-making
Champ in-the-making
An improvement Jira can be tracked here: https://issues.alfresco.com/jira/browse/MNT-13998