I’m sorry, but this isn’t currently supported. You have a very valid use case and a reasonable expectation to use the API, but as you’ve noted our API expects to be invoked in a Request/Response cycle which doesn’t exist when rendering notifications.
I don’t have a document that describes the internal workings of our Portlet URLs, but if you have simple enough requirements you can probably generate this at runtime.
One way to go about this is to create a throwaway application that using the APIs or PortletURL controls, generates the appropriate URL. Then you could extract out the Format of the URL and in your notification view, inject the appropriate values. The real trick will be if you are setting properties on a portlet at runtime. The dbID of that portlet will change from environment to envionment so you’ll have to obtain that dynamically.
I already tried to generate the portlet URL by hand using
URLUtils.getFrontEndURL(getFacesContext());
and a page alias. The hard part are the parameters that have to be prefixed with a generated string. This string seems to contain the portlet id. So a parameter myParam becomes wmp31221.myParam where 31221 is the portlet id. Is that right? Is there a way to obtain this id using a MWS API using a portlet alias?