It does not work, and I reopened
LEP-3458.
Even if it works... temporary workaround in RuntimeTag.java:
if (Validator.isNotNull(defaultPreferences)) {
PortletPreferences prefs = PortletPreferencesFactoryUtil.getPortletSetup(
req, portletId, true, true, defaultPreferences);
prefs.setValue("article-id", defaultPreferences);
prefs.store();
}
- pass $articleId instead of $velocityPortletPreferences.toString().
Even if it works, it is not 'thread-safe', it changes PortletPreferences for current Request:
?articleId=99999
When we call $theme.runtime("JOURNAL_CONTENT_$journalArticleId", "", $velocityPortletPreferences.toString())
with non-existing PortletPreferences "JOURNAL_CONTENT_$journalArticleId" - it will be created! But it won't be added to Layout.
It seems that I can't use such technics for the task...
Another possible solution:
com.liferay.portal.servlet.FriendlyURLServlet
- here I can put a code which will create non-existing Layout with PortletPreferences etc...
P.S.
I have a business requirements: when new article is added, Asset Publisher should 'publish' a link to a new article page.
Please sign in to flag this as inappropriate.