Passing variables inside dashlet scripts
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2010 10:39 AM
Hello,
I'd like to create a script that shows all workflows associated to a specific document, this is related to a document details page modification.
I have modified the document details page to show and modify metadata infos… Now I want to show the workflows related to that document.
I have already made the script to show all workflows (a really simple html - ftl script inside Alfresco without javascript controller) but now I want to put the condition that this script can shows workflows only if the "document details" document nodeRef is equal to the nodeRef of the workflow displayed.
But… how can I pass a variable into an another script inside a region?? Is it possible to do?? The nodeRef variable lives inside the document-details page, that page has a region called "test" that show the Alfresco script using the "alfresco" connector.
If this is possible I can put the condition inside the script ftl like this:
<if> "workflow.package = ${node}"…than show workflow infos</if> where "node" is the nodeRef passed by the document details page.
Thankyou all,
regards
Raptus
I'd like to create a script that shows all workflows associated to a specific document, this is related to a document details page modification.
I have modified the document details page to show and modify metadata infos… Now I want to show the workflows related to that document.
I have already made the script to show all workflows (a really simple html - ftl script inside Alfresco without javascript controller) but now I want to put the condition that this script can shows workflows only if the "document details" document nodeRef is equal to the nodeRef of the workflow displayed.
But… how can I pass a variable into an another script inside a region?? Is it possible to do?? The nodeRef variable lives inside the document-details page, that page has a region called "test" that show the Alfresco script using the "alfresco" connector.
If this is possible I can put the condition inside the script ftl like this:
<if> "workflow.package = ${node}"…than show workflow infos</if> where "node" is the nodeRef passed by the document details page.
Thankyou all,
regards
Raptus
Labels:
- Labels:
-
Archive
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2010 11:02 AM
${page.url.args.nodeRef}‍
Thanks,
Mike
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2010 09:28 AM
Thank you for your precious help but I still have problems…
I am a beginner but when I try this code (my script is an HTML-FTL webscript without JS, I put it into the document details as a region-script component - <@region id="test" scope="template" protected=true /> - this region is a component script that simply calls my alfresco script by the connector).
My alfresco "workflow-list" script:
I always get "error 500 - undefined term "page", I try also ${page.url.args.nodeRef} with and without " " but still get errors…. why?
Must I define a variable "page" inside the FTL or writing a javascript file? But… if so what is the correct javascript file?
Thankyou again…
regards,
Raptus
I am a beginner but when I try this code (my script is an HTML-FTL webscript without JS, I put it into the document details as a region-script component - <@region id="test" scope="template" protected=true /> - this region is a component script that simply calls my alfresco script by the connector).
My alfresco "workflow-list" script:
<table cellspacing=0 cellpadding=2> <#list workflow.assignedTasks as t><br/> <#if t.package == "page.url.args.nodeRef"><div class="task-transitions"> <#list t.transitions as transition> <li> <span class="link" <a href="http://localhost:8080/alfresco/service/api/workflow/task/end/${t.id}/${transition.id}?alf_method=pos... " title="transitions">${transition.label?html}</a></span></li> </#list> </div> <#else></#if> </#list></table>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
I always get "error 500 - undefined term "page", I try also ${page.url.args.nodeRef} with and without " " but still get errors…. why?
Must I define a variable "page" inside the FTL or writing a javascript file? But… if so what is the correct javascript file?
Thankyou again…
regards,
Raptus
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2010 10:00 AM
The page.url.args.nodeRef statement should be on the web-tier, i.e. in the Share webscript that calls your remote one. You need to pass the nodeRef through to the Repository-tier webscript (the one you're seeing the problem with) and access it via args.nodeRef.
Thanks,
Mike
Thanks,
Mike

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2013 04:17 PM
Hi Mike, Thank You for the reply and I spent almost 2 days ripping my hair to pass the parameter for dashlet and finally I found your reply for this post and it works.
I should have googled with correct keyword to get this thread. Anyhow it is going to be interesting for me from now.
1000 Thanks
Saran
I should have googled with correct keyword to get this thread. Anyhow it is going to be interesting for me from now.
1000 Thanks
Saran
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2010 05:44 AM
Thanks for all your help…really appreciated!
Raptus
Raptus
