Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Asset Publisher OSGI Configuration
Hi,
Is there a way to configure Asset publisher portlet by OSGI ?
I want to set the default selected asset type to Web Content Article. I found AssetPublisherPortletInstanceConfiguration class in asset-publisher-web module, but it doesnt contain much config attributes.
Thank you,
Mounir Hallab:I want to set the default selected asset type to Web Content Article. I found AssetPublisherPortletInstanceConfiguration class in asset-publisher-web module, but it doesnt contain much config attributes.
In theory, the way you would do this is to change the default value
for the classNameIds
preference on the asset publisher
portlet, which you would do by overriding the
javax.portlet.preferences
component property (see David
Nebinger's blog on Overriding
Component Properties).
You can debug the code PortletTracker
to see what it's expecting. At a glance, it either wants a path to
some XML file in a bundle fragment for
com.liferay.asset.publisher.web
, or it wants the property
to be set to the full XML string. Coincidentally, you can see an
example of the former in a lot of the portlets that extend asset
publisher portlet (HighestRatedAssetsPortlet,
highest-rated-assets-default-portlet-preferences.xml).
As a warning, because the portlet preference ultimately corresponds
to the classNameId for the JournalArticle
model, the
value you set in the configuration would need to change in every
environnment, because that value is probably going to end up different
in every environment.
Powered by Liferay™