Creating a new multiple action for a specific datalist

In the current project I’m working on there is a requirement that for one type of datalist the user should be able to select some of the items and based upon those items a pdf will be constructed and placed in a predefined folder in the document library.

One challenge in the implementation was to make the menu alternative only show up for one datalist type.

The server side javascript file responsible for displaying the drop-down menu is called data-list/toolbar.get.js, when putting this in the correct path mapped by your extension module to “site-webscripts/org/alfresco/components/data-lists/” our extended file will be processed after the alfresco original toolbar.get.js

First we need to make sure we add the menu alternative for the correct list. We will look at the query string to find out the name of the clicked list.

   var queryString = url.queryString;
   var listName = getQueryVariable('list', queryString);

   function getQueryVariable(variable, queryString) {
	var vars = queryString.split("&");
	for (var i = 0; i < vars.length; i++) {
		var pair = vars[i].split("=");
		if (pair[0] == variable) {
			return pair[1];
	return (false);

Then we make a remote call to the Alfresco repository and ask for all datalists in the current site, looping them through and when we find the correct type of list and the name of the list matches we will push the new menu alternative onto the actionSet array.

   var site =,
      theUrl = "/slingshot/datalists/lists/site/" + site + "/dataLists",
      result =,
      canCreate = false,
      lists = [];
   if (result.status == 200)
      response = JSON.parse(result.response);
      lists = response.datalists;
      var arrayLength = lists.length;
      for (var i = 0; i < arrayLength; i++) {
          if(lists[i].itemType=='somecodl:issueList' && lists[i].name==listName){
    		// add action for our list type
				id : 'onActionCreateMeetingMinutes',
				type : 'action-link',
				permission : 'create',
				asset : '',
				href : '',
				label : 'menu.selected-items.meetingMinutes'

The final code will then look like this:

function extended_main(url){
   var queryString = url.queryString;
   var listName = getQueryVariable('list', queryString);

   var site =,
      theUrl = "/slingshot/datalists/lists/site/" + site + "/dataLists",
      result =,
      canCreate = false,
      lists = [];
   if (result.status == 200)
      response = JSON.parse(result.response);
      lists = response.datalists;
      var arrayLength = lists.length;
      for (var i = 0; i < arrayLength; i++) {
          if(lists[i].itemType=='somecodl:issueList' && lists[i].name==listName){
    		// add action for Action List
				id : 'onActionCreateMeetingMinutes',
				type : 'action-link',
				permission : 'create',
				asset : '',
				href : '',
				label : 'menu.selected-items.meetingMinutes'
   // Widget instantiation metadata...
   var toolbar = {
      id : "DataListToolbar",
      name : "Alfresco.component.DataListToolbar",
      options : {
         siteId : ( != null) ? : ""
   model.widgets = [toolbar];

function getQueryVariable(variable, queryString) {
	var vars = queryString.split("&");
	for (var i = 0; i < vars.length; i++) {
		var pair = vars[i].split("=");
		if (pair[0] == variable) {
			return pair[1];
	return (false);


When the new menu alternative is selected we will present a metadataform, and upon submission create a pdf in the documentLibrary, but thats another (yet to come) blogpost.

This entry was posted in Alfresco, datalists, Javascript. Bookmark the permalink.

152 Responses to Creating a new multiple action for a specific datalist

  1. I am genuinely pleased to read this blog
    posts which consists of plenty of helpful facts, thanks for providing these information.

  2. Verlene says:

    Hi there, I want to subscribe for this web site to
    take newest updates, so where can i do it please help out.

    • Trisha says:

      Emre,tat duyunuz konusuna üzüldüm, biz de yerine getirmek için çalışıyoruz ÅžiÅŸ House için ne yazık ki size katılmıyorum, çok titiz bir iÅnentml,ürüeleriŸin kalitesi çok yüksek.Selamlar

    • The “told you so” was referring to my allegation that the Spurs were the better team, which I think is quite clear. And I stand by Timmy. Best power forward EVER.

    • I just don’t know about this episode .I know what the facts they found were . I understand their conclusions , yet something about it does not ring true .Anyone else feeling a bit skeptical about this one ?

    • hehe und das erste unverschlüsselte Bild deiner Frau im Blog… wenn sie das rausfindet ;-) Habe heute noch meinSiemens C55 mit einem blauen Display. Sollte mir vielleicht mal ein neues kaufen heheBin Ende September bis Oktober wieder in Taiwan. Man könnte sich ja mal treffen von deguo-ren zu deguo-ren falls Zeit hast. Der Selbsthildeverein Taiwan geschädigter lao-wai Ehemänner wartet auf seine Gründung ;-) Komme auch nach Tapei..

    • ejemplo, pero ahora en el lado contrario. Si hablábamos hace unos días de aprender a gestionar la publicidad de una marca en determinadas webs, por la mala relación que se podía establecer entre el contenido donde iba insertada tu

    • I can't afford a Hermes birkin but I sure as hell wouldn't pose as somebody else to get one..This is so wrong on so many levels, that email to you is so rude. x

    • Tweet Florence on You are adorable and super awesome. Your blog is amazing,i’ve only watched you on Youtube but feel like i personally know you. Keep blogging…

    • http://www./ says:

      Bonjour,J’aimerais être informée des activités qui se dérouleront aux diverses places publiques soutenues par le Quartier des spectacles.Merci,Andrée Blais, Muséologue

    • This is an appalling situation. The London Metropolitan Police behaved not just in a shameful manner — they behaved in a real, totalitarian Police State manner. These are dangerous times. If peaceful protest against a serious and growing threat is removed from the people, then the people will eventually protest violently. — Paul WestonYep.And as I pointed out to some unreceptive Leftwingers recently, law and order is already breaking down all across Europe….in Muslim No Go Shariah Zones. Balkanization of much of Europe, will lead to predictable outcomes.EV

    • http://www./ says:

      What a great way to sneak in vegetables to a family favorite (and a great use for left over adobo sauce). It also seems like this recipe would be pretty flexible for changing out ingredients. Thank you for the inspiration.

    • http://www./ says:

      I love both sizzling rice and shrimp! Plus I keep on finding recipes with shrimp in them…I think it's a sign to stop being lazy and go buy some :)

    • http://www./ says:

      “Women are routinely sold into arranged marriages by their fathers who receive a dowry for the “sale”; the dowry sometimes issued in the form of goats or other forms of livestock.”Slavery.

    • http://www./ says:

      Die Idee ist so genial und so simpel, das musste ja einfach ein Knaller werden!Ich bin sowieso ein großer Fan dieser Fotoprojekte, aber das hier ist schon richtig, richtig weit vorne mit dabei!Nicht zuletzt, weil die Jungs einfach wirklich Freunde sind….

    • paradoxalement, je trouve un formidable espoir dans cette photo. certes, la violence est forte, mais en même temps, la confrontation est celle qu’on peut voir un peu partout dans le monde. « espoir » est peut-être excessif, mais il me semble qu’il y a là, dans ce corps-à-cors quelque chose de presque rassurant.

    • - It¡¦s really a nice and helpful piece of info. I¡¦m glad that you simply shared this useful information with us. Please keep us up to date like this. Thanks for sharing.

    • max can you stop others from sharing your cover photo ? it seems whenever i upload something cool, some one from my friends lists steals it by “sharing”

    • You are right Benny, everyday is a gift! I always try to improve and learn something new to help me get closer to my goals. More often than not it is a good idea to sit back and reflect upon all that surrounds us and as you’ve stated; focusing on the positives rather than the negatives will bring that what is desired.

    • I love that you share so much! Especially for someone like me who is just starting out in Boudoir. I pre-ordered your book a few weeks ago…can not wait for it to arrive! I’m sure you cover this in your book, but I am having trouble getting women to even want to pose for free photos (for portfolio building). How did you get the ball rolling? Any tips would be apreciated!

    • color bju memg sweet coz jrg org guna…schawal??..blh la..selalu sgt berkepit…so, bese jelah tgk..hehehe..anyway, mga bhgia hingga akhir hayat..

    • That is interesting news. The first I’ve seen of it. I live in New Mexico and followed Bishop’s Steenson’s journey with interest. I don’t know how you find the time to blog like you do, Father, but you definitely have a good one. God Bless.

    • Hola, creo que la versión 1.7 de Android no existe, debes tener la 1.5 o 1.6 pero no hay ninguna versión de Flash Player compatible con esas versiones de Android. Saludos.

    • Hi. I used to love electro 9 as a kid. I’ve searched everywhere to find a digital copy of it. Would you be able to email me a copy, I would be forever in your debt. Many thanks.

    • Is it any wonder that an increasing parents are choosing to home school, and that more and more churches, big and small, are starting their own schools. Wake up America, or elas many of yourl children will be turned into soldiers to hunt down and eliminiate you, your traditions, your beliefs and your dreams.

  3. I do not even know how I finished up here, however I
    believed this submit was once great. I don’t know who you are but
    certainly you’re going to a famous blogger in the event you are not
    already. Cheers!

  4. Freddy says:

    Thanks for the marvelous posting! I certainly enjoyed reading it, you will
    be a great author. I will make certain to bookmark your
    blog and may come back in the foreseeable future.
    I want to encourage one to continue your great work, have a nice evening!

  5. I’m glad that it turned out so effectively and I hope it will continue inside the future because it’s so interesting and meaningful towards the community.

  6. Very intriguing subject , thanks for putting up.

  7. This article will help the internet people for creating new blog or even a weblog from
    start to end.

  8. Sammie Garcias says:

    I discovered your site site on the internet and check some of your early posts. Continue to keep up the top notch operate. I recently additional increase your Feed to my MSN News Reader. Seeking forward to reading much more from you finding out later on!…

  9. I was more than happy to discover this website. I need to to thank you for ones time just for this fantastic read!! I definitely loved every bit of it and i also have you book-marked to see new stuff on your website.|

  10. webpage says:

    Hi, always i used to check webpage posts here in the early hours in the dawn, as i enjoy to find out more and more.|

  11. It’s all ahout Ray Ban Sunglasses click to view
    From : Ray Ban Justin vs Wayfarer

  12. Nancy DOR says:

    I am trying to had a new multiple action on Share too, your post helped me. However, I see my new action but it doesn’t work. I noticed that perharps we haven’t worked with the same Alfresco version. I am using Alfresco 4.2.f
    Could you help me to find what is wrong?

    I added in the toolbar.get.config.xml the line in the actionset :

    In C:\Alfresco\tomcat\webapps\share\components\data-lists\sample-action.js I added
    (I copied the onActionDuplicate in actions.js)
    Alfresco.service.DataListActions.prototype.onActionSample1 = function DL_onActionSample1(p_items)
    var me = this,
    items = YAHOO.lang.isArray(p_items) ? p_items : [p_items],
    destinationNodeRef = new Alfresco.util.NodeRef(this.modules.dataGrid.datalistMeta.nodeRef),
    nodeRefs = [];

    for (var i = 0, ii = items.length; i < ii; i++)

    name: "dataItemsDuplicated",
    items: items
    message: this.msg("message.duplicate.success", items.length)
    message: this.msg("message.duplicate.failure")
    method: Alfresco.util.Ajax.POST,
    name: "duplicate/node/" + destinationNodeRef.uri
    requestContentType: Alfresco.util.Ajax.JSON,
    nodeRefs: nodeRefs

    In sample-action.css (next to sample-action.js) I added
    .toolbar .onActionSample
    background-image: url(file-16.png) !important;

    I added in the actions-common.get.head.ftl :

  13. spam scammer says:

    If you are going for most excellent contents like me, just go to see this web page daily because it offers quality contents, thanks|

  14. What’s up mates, how is the whole thing, and what you wish
    for to say about this piece of writing, in my view its actually
    awesome for me.

  15. It’s not it’s volume of Which I realize corresponds rather strongly to mass, but it’s not mass per se, but disruption of a magnetic

  16. free says:

    This post will help the internet viewers for setting up new blog or even a blog from start to end.

  17. click says:

    What’s Going down i’m new to this, I stumbled upon this I have discovered It positively useful
    and it has helped me out loads. I’m hoping to
    give a contribution & aid different users like its aided me.
    Good job.

  18. click says:

    What’s up it’s me, I am also visiting this web site regularly, this site
    is in fact good and the viewers are genuinely sharing nice thoughts.

  19. I believe that is one of the most vital information for me.

    And i’m happy reading your article. But should observation on some genneral things, The web site style is ideal, the articles iis really great : D.

    Good job, cheers

  20. Hi there, for all time i used to check weblog posts here early in the dawn, as i enjoy
    to find out more and more.

  21. It’s a shame you don’t have a donate button! I’d without a
    doubt donate to this fantastic blog! I guess for now i’ll settle for book-marking and adding your RSS feed to my Google account.
    I look forward to brand new updates and will talk
    about this blog with my Facebook group. Chat soon!

  22. Aw, this was an extremely nice post. Spending some time
    and actual effort to make a really good article… but what can I say… I hesitate a whole
    lot and never manage to get nearly anything done.

  23. Hi there, after reading this awesome paragraph i am
    also happy to share my knowledge here with colleagues.

  24. This web site really has all the information I wanted about
    this subject and didn’t know who to ask.

  25. datador says:

    Isso me leva a acreditar que tenho muito a estudar nessa vida.


  26. An outstanding share! I’ve just forwarded this onto a co-worker who has been doing a little
    homework on this. And he in fact bought me lunch simply because I
    stumbled upon it for him… lol. So let me reword this….
    Thanks for the meal!! But yeah, thanx for spending the time to discuss this issue here on your website.

  27. Medaillen says:

    Es sind maximal 28 von 31 Trophäen erspielbar.

  28. Mini Pokale says:

    Das betrifft beide Versionen des Spiels (DE, INT).

  29. Den WSA-Teilnehmern werden zur Information bzw.

  30. Trophäen says:

    H-Anker,, die die Grundidee als Steinbruch benutzt.

  31. Name says:

    comment text

  32. Thanks-a-mundo for the article post.Really looking forward to read more.

  33. bud on line says:

    Thank you ever so for you blog article.Really thank you! Keep writing.

  34. Say, you got a nice post.Really looking forward to read more. Awesome.

  35. feelcbd says:

    This blog is definitely educating and also informative. I have chosen a bunch of handy tips out of this amazing blog. I ad love to return every once in a while. Thanks!

  36. Thanks-a-mundo for the article.Much thanks again. Will read on

  37. visitor retention, page ranking, and revenue potential.

  38. Thanks again for the blog post.Really looking forward to read more. Fantastic.

  39. I think this is a real great blog post.Much thanks again. Great.

  40. Im obliged for the blog article.Really looking forward to read more.

  41. Tattoo says:

    I value the blog article.Really looking forward to read more. Really Cool. this site

  42. Thanks-a-mundo for the blog.Much thanks again. Really Great.

  43. Thanks for another great article. Where else may anybody get that kind of info in such a perfect means of writing? I have a presentation subsequent week, and I am on the look for such information.

  44. Rolet online says:

    You might have a very great layout for your blog i want it to utilize on my web-site also.

  45. účtovník says:

    Very neat blog article.Thanks Again. Keep writing.

  46. EKDV 640 says:

    What as up all, here every person is sharing these kinds of familiarity, thus it as pleasant to read this web site, and I used to pay a visit this website all the time.

  47. Really informative blog article.Really looking forward to read more. Really Great.

  48. Thanks so much for the blog article.Much thanks again. Awesome.

  49. This genuinely answered my challenge, thank you!

  50. Just read this I was reading through some of your posts on this site and I think this internet site is rattling informative ! Keep on posting.

  51. two says:

    I reckon something genuinely special in this site.

  52. It as not that I want to duplicate your web site, but I really like the layout. Could you tell me which style are you using? Or was it custom made?

  53. very good publish, i actually love this web site, keep on it

  54. erotik says:

    wow, awesome article.Thanks Again. Really Cool.

  55. I relish, result in I found exactly what I used to be looking for. You have ended my four day long hunt! God Bless you man. Have a great day. Bye

  56. wow, awesome article.Thanks Again. Will read on

  57. Wow, great post.Really thank you! Really Cool.

  58. to read more says:

    Very informative article post. Really Cool.

  59. very good publish, i certainly love this website, carry on it

  60. Really appreciate you sharing this article post.Really looking forward to read more.

  61. Wir freuen uns auf Ihren Anruf oder Ihren Besuch.

  62. says:

    Terrific post however , I was wondering if you could write

  63. istik says:

    with hackers and I am looking at alternatives for another platform. I would be great if you could point me in the direction of a good platform.

  64. 인천오피 says:

    There is certainly noticeably a bundle to know about this. I assume you produced specific nice points in attributes also.

  65. this website says:

    Respect to post author, some fantastic info .

  66. Useful information. Lucky me I found your web site by accident, and I am stunned why this twist of fate did not happened in advance! I bookmarked it.

  67. whoah this blog is wonderful i love reading your articles. Keep up the good work! You know, many people are hunting around for this info, you could aid them greatly.

  68. 에세머 says:

    There is apparently a lot to identify about this. I assume you made some nice points in features also.

  69. 부커취 says:

    Looking around I like to browse in various places on the online world, regularly I will go to Stumble Upon and read and check stuff out

  70. Major thanks for the blog post.Thanks Again. Awesome.

  71. 관전클럽 says:

    Until then the michael kors outlet should take a serious interest.

  72. Tattoo says:

    I think you have mentioned some very interesting details , regards for the post.

  73. xvideos says:

    I really liked your post.Really thank you! Awesome.

  74. brcko says:

    Please reply back as I’m trying to create my very own website and want to know where you got this from or just what the

  75. Pinganillos says:

    Im obliged for the blog.Thanks Again. Really Cool.

  76. This blog is obviously entertaining additionally factual. I have picked a bunch of interesting tips out of this amazing blog. I ad love to return again soon. Thanks a bunch!

  77. Dating says:

    Major thanks for the blog post.Really looking forward to read more. Want more.

  78. Very interesting info!Perfect just what I was searching for!

  79. This unique blog is obviously interesting additionally diverting. I have discovered helluva useful tips out of it. I ad love to come back every once in a while. Thanks a lot!

  80. President says:

    Would you be thinking about exchanging hyperlinks?

  81. This is one awesome article post.Thanks Again. Fantastic.

  82. New car loans is probably the common loans in the financial

  83. I thought it was going to be some boring old publish, but it really compensated for my time. I will post a link to this page on my blog. I am positive my visitors will find that very useful

  84. NEYMAR says:

    Life is not about how fast you run or how high you climb, but how well you bounce

  85. great says:

    Thanks a lot.

  86. Perfect says:

    Perfect, thanks.

  87. Religious outlet gucci footwear. It as safe to say that they saw some one

  88. This page certainly has all the info I needed concerning this subject and didn at know who to ask.

  89. Thanks-a-mundo for the blog article.Really thank you! Cool.

  90. lojal says:

    Awesome Article.Thanks for sharing this post that is really helpful for everyone thank u for altadefinizione01

  91. Watch your favorite Pinoy Tambayan, Pinoy Teleserye Replay, Pinoy TV Series and Pinoy TV Shows online for free!

  92. Excellent post. I used to be checking constantly this
    weblog and I am impressed! Extremely useful information specifically the ultimate part :
    ) I handle such information a lot. I was looking for this particular info for a long time.
    Thank you and best of luck.

  93. I am genuinely delighted to read this website posts which carries plenty of useful data, thanks for providing these
    kinds of information.

  94. Hello, always i used to check webpage posts here early in the daylight, for the reason that i love to gain knowledge of more and more.

  95. Baldorn says:

    great knowledge

  96. catfight says:

    Hi there, I discovered your web site via a search engine at the same time as searching for a similar topic. I really appreciate this post. I have been looking everywhere for this! Your site hit the nail upon the top and outlined the whole thing without having side effect , other people could take a benefit and will probably come again to get more. Thanks!

  97. hidibf says:

    Здравствуйте, я обнаружил ваш сайт через поисковую систему в то же время, когда искал похожую тему. Я очень ценю этот пост. Я искал это повсюду! Ваш сайт попал в самую точку и изложил все без побочных эффектов, другие люди могли бы извлечь пользу и, вероятно, придут снова, чтобы получить больше. Спасибо!

  98. glour says:

    नमस्ते, मैंने उसी समय एक खोज इंजन के माध्यम से आपकी वेब साइट की खोज की थी जब एक समान विषय की खोज की गई थी। मेरे द्वारा इस पोस्ट में वास्तव में प्रसंशा की जाती है। मेरे द्वारा इसे हर जगह ढूंढा जा रहा था! आपकी साइट ने शीर्ष पर कील ठोक दी और साइड इफेक्ट के बिना पूरी बात को रेखांकित किया, अन्य लोग लाभ उठा सकते थे और शायद अधिक प्राप्त करने के लिए फिर से आएंगे। धन्यवाद!

  99. brirlle says:

    Bonjour, j’ai découvert votre site web via un moteur de recherche en même temps que je cherchais un sujet similaire. J’apprécie vraiment cet article. Je l’ai cherché partout ! Votre site a frappé le clou sur le dessus et a souligné l’ensemble de la chose sans avoir d’effet secondaire, d’autres personnes pourraient prendre un avantage et sera probablement revenir pour obtenir plus. Je vous remercie !

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>