Can anyone help me how to get path context in liferay without themedisplay object (means in scheduler )
I am using liferay 6.1
Unfortunately, there's no (simple) way of doing that.
The reason is that the ThemeDisplay
object is tied to the current user and the current page. In the context of a scheduler (i.e., an automatically triggered event made by the system itself), there's no current logged in user (ok, you could use the default user, but...), and there's no displayed page.
What you can do however is to make the required data available from somewhere else. You can store it in a custom property, read it from the DB or get it through services and so on. The PortalUtil.getPortalURL()
function for instance may be your friend.
Otherwise, you need the request object to get the ThemeDisplay.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With