cancel
Showing results for 
Search instead for 
Did you mean: 

Alternate URL to nodeRef /content in alfresco share

aditya_chaudhar
Champ on-the-rise
Champ on-the-rise
Hello Forum ,

My Question is regarding noderef document link customization

Document name : 1.pdf
folder : repository/myfolder

The document link in share
http://127.0.0.1:8080/share/page/document-details?nodeRef=workspace://SpacesStore/00eb44f3-604e-492a...

But my user requirement is to show unique tag or property in URL……

eg :by file name
http://127.0.0.1:8080/share/page/document-details?nodeRef=workspace://SpacesStore/myfolder/1.pdf

eg by unique tag
http://127.0.0.1:8080/share/page/document-details?nodeRef=workspace://SpacesStore/uniqueTagForDocume...



or anything which can give unique tag in URL.


I have tried following techniques but it does not satisfy my need :

1. WebDav URL  : This does not open final docment in share view it open in normal browser view.I want to view document in share
2. I also tried below link
https://forums.alfresco.com/forum/end-user-discussions/alfresco-share/accessing-file-url-without-uui...
answer by jeffPotts but in this also i am not able to open in share view.


Please tell me if any other technique is available.
8 REPLIES 8

angelborroy
Community Manager Community Manager
Community Manager
Jeff Potts is right, but maybe the editor has stripped "Company Home" from URL (you can see two backslash there).

Please, try with

http://localhost:8080/alfresco/s/api/path/content/workspace/SpacesStore/Company%20Home/Sites/test-si...
Hyland Developer Evangelist

Hi Angel Thank you for quick reply ,

I done what you said but i want some link which 'll have the special tag or complete path in URL instead of encrypted nodeRef

What is result with link you have provided is complete document view i want to show document in share repository view.

Please let me know how can i achieve this.


Thanks and Regards
Aditya C Chaudahri

angelborroy
Community Manager Community Manager
Community Manager
As far as I know this is not possible OOTB: no REST API or URL can be used in that way.
Hyland Developer Evangelist

Hi Angel ,
Thank You for your reply

I have found simple way to get around this ,
Just to make web script specifying the search term (tag ) in URL and then redirect to noderef content link in share ,
It seems to be easy,
But i am not getting how to redirect from Javascript controllwe or FTL file.

If you know how to redirect from JavaScript controller or FTL file please help me .
I have tried few FTL redirect links from google but it doesnt work.
can we redirect from JavaScript controller..? 

angelborroy
Community Manager Community Manager
Community Manager
Have you tried to develop a proxy filter on Share tier? Similar to VTI or WebDAV. You can develop some Java logic to get your URL transformed (or redirected) to content link in share.
Hyland Developer Evangelist

Hi Angel ,
I have solved my problem ,
I have done sort of hack , redirect from FTL file
I have used below code
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function redirect () {
<#assign var_link = "${documentLink}">
setTimeout("go_now()",0000); }
function go_now ()   { window.location.href = "${var_link}"; }
</SCRIPT>
</HEAD>
<BODY onLoad="redirect()">
<p>Preparing Your Document : ${args.name}!</p>

</body>
</html>
in my ftl file

Thank you for your help .

Please validate my approach
Its redirecting well , but it would be good if we know pros and cons of this technique.
All other Forum members please me your review about my approach to " redirect to share view of document using webscript"

I would like to know how all other developers doing redirect?
Thanks and Regards
Aditya C

Have you found a better way to do this?

angelborroy
Community Manager Community Manager
Community Manager
Standard Alfresco redirect can be done using following code in JS controller:

<javascript>
status.location = url.context + "/page/redirect";
status.code = 302;
status.redirect = true;
</javascript>

However, you have to evaluate if this technique is suitable for your case.
Hyland Developer Evangelist