07-01-2022 10:34 AM
Good morning,
regarding building URL Alfresco document something like this :
http://192.168.1.3:8080/share/s/g9yKWYpgQSyqXAaLPP7nA
at the moment I build URL String mainly with the alfresco-global.properties in this way :
------------------------------
NodeRef curNode = new NodeRef("workspace://SpacesStore/" + node );
QuickShareDTO qsdto = quickShareService.shareContent(curNode);
String id = qsdto.getId();
String protocol = properties.getProperty("share.protocol");
String host = properties.getProperty("share.host");
String port = properties.getProperty("share.port");
String context = properties.getProperty("share.context");
String stringUrl = protocol + "://" + host + ":" + port + "/" + context + "/s/" + id;
------------------------------
I'd like to know if there is another way with API Alfresco to do the same -> String stringUrl
Many thanks
07-01-2022 10:44 PM
You can use REST Api to create shared link for document.
https://api-explorer.alfresco.com/api-explorer/#/shared-links/createSharedLink
07-03-2022 03:42 AM
thanks sanjaybandhniya for help
but with REST as you suggested I could build the second part of the URL
for instance : I need the complete URL -> http://localhost:8180/share/s/g9yKWYpgQSyqXAaLHP74nA
in the response of REST there is -> /share/s/g9yKWYpgQSyqXAaLHP74nA
but how can I get -> http://localhost:8180/
many thanks
Explore our Alfresco products with the links below. Use labels to filter content by product module.