AnsweredAssumed Answered

How to create action on document that opens page returned from webscript

Question asked by lex91 on Mar 22, 2018
Latest reply on Mar 23, 2018 by lex91

I know this must be something simple but I can't seem to find the solution.

 

I have a custom webscript which returns a html page accessible by going to a url like so:

http://localhost:8080/alfresco/s/sts/report?nodeRef=workspace://SpacesStore/9b7ae522-75ae-4960-b579-1ec805f…  

The only argument the webscript needs is the nodeRef={nodeRef} argument.

 

What I want to do is create an entry in the Document Actions pane (available for every document) that will take me to the url with the nodeRef argument of the respective document. By document actions pane I mean this:

 

I'm guessing the solution lies with custom actions but I can't figure out how and where to define the action.

Btw, I used the alfresco maven sdk to create an all-in-one project. I plan to take the resulting amp files and install them into the production alfresco server.

 

Thank you!

 

// Edit

 

I managed to create an entry with an action of type:"link" and the following params:

<param name="href">/alfresco/s/sts/report?nodeRef={node.nodeRef}</param>
<param name="target">_blank</param>

The problem with this solution is it requires additional authentication for "/alfresco/s" (service). Is there a way to access my webscript from a share page so the user is already logged in?

For example: "localhost:8080/share/page/sts/report?nodeRef={node.nodeRef}"

Outcomes