Fórumok
how can I get portal URL from API in workflow
Balázs Csönge, módosítva 8 év-val korábban
how can I get portal URL from API in workflow
Regular Member Bejegyzések: 107 Csatlakozás dátuma: 2014.11.10. Legújabb bejegyzések
Hi,
I am using liferay 6.2 CE with Activiti workflow engine.
In a workflow process I need to get an URL to a file entry like this:
http://tralllala.net/documents/10181/21820/The_winner_sample/d345d766-dc73-47f2-938e-03fb3675a215?t=1432647367449
I was able to make the /documents/10181/21820/The_winner_sample/d345d766-dc73-47f2-938e-03fb3675a215?t=1432647367449 part of that link, but how can I get the http://tralllala.net part?
In a portlet code the solution is themeDisplay.getPortalURL(), but in the workflow context I not have any themeDisplay. Is any other util, which can give me that portal URL back?
I am using liferay 6.2 CE with Activiti workflow engine.
In a workflow process I need to get an URL to a file entry like this:
http://tralllala.net/documents/10181/21820/The_winner_sample/d345d766-dc73-47f2-938e-03fb3675a215?t=1432647367449
I was able to make the /documents/10181/21820/The_winner_sample/d345d766-dc73-47f2-938e-03fb3675a215?t=1432647367449 part of that link, but how can I get the http://tralllala.net part?
In a portlet code the solution is themeDisplay.getPortalURL(), but in the workflow context I not have any themeDisplay. Is any other util, which can give me that portal URL back?
Balázs Csönge, módosítva 8 év-val korábban
RE: how can I get portal URL from API in workflow (Válasz)
Regular Member Bejegyzések: 107 Csatlakozás dátuma: 2014.11.10. Legújabb bejegyzések
I made some test log in order to examine values of different service context attributes.
Based on it, the sc.getPortalURL() seems as a right choice.
ServiceContext sc = (ServiceContext)execution.getVariable("serviceContext");
log.info("getCurrentURL: " + sc.getCurrentURL());
log.info("getLayoutFullURL: " + sc.getLayoutFullURL());
log.info("getLayoutURL: " + sc.getLayoutURL());
log.info("getPortalURL: " + sc.getPortalURL());
log.info("getPathFriendlyURLPublic: " + sc.getPathFriendlyURLPublic());
log.info("getRemoteAddr: " + sc.getRemoteAddr());
log.info("getRemoteHost: " + sc.getRemoteHost());
Based on it, the sc.getPortalURL() seems as a right choice.