掲示板

Asset Publisher configuration storage

12年前 に Назойливый Вопрошатель によって更新されました。

Asset Publisher configuration storage

Junior Member 投稿: 45 参加年月日: 11/10/11 最新の投稿
Hello everyone! The question is following: I need to compare assetVocabularyId in request (which is being used in "Group by" option, as I assume) with assetVocabularyId chosen in asset publisher configurations (Ordering and grouping/Order by) to prevent rendering of current instance of publisher in case they are equal.

So, where are asset categories configurations stored, and how can I extract them?

Any help is appreciatedemoticon
thumbnail
12年前 に jelmer kuperus によって更新されました。

RE: Asset Publisher configuration storage

Liferay Legend 投稿: 1191 参加年月日: 10/03/10 最新の投稿
It is stored in the portlet preferences for that asset publisher instance

So if you are within the asset publisher instance you can do :

PortletPreferences preferences = renderRequest.getPreferences();
preferences.getValue("asset-vocabulary-id", "what ever your default value is");


And if you need to access the preferences from another portlet you can do

PortletPreferences preferences =  PortletPreferencesFactoryUtil.getPortletSetup(request, "your portlet id");
preferences.getValue("asset-vocabulary-id", "what ever your default value is");
12年前 に Назойливый Вопрошатель によって更新されました。

RE: Asset Publisher configuration storage

Junior Member 投稿: 45 参加年月日: 11/10/11 最新の投稿
Hello, Jelmer! Thanks for your answer. And what is the second parameter in getValue() method "what ever your default value is" ?
thumbnail
12年前 に jelmer kuperus によって更新されました。

RE: Asset Publisher configuration storage

Liferay Legend 投稿: 1191 参加年月日: 10/03/10 最新の投稿
What is returned when that property is unset
12年前 に Назойливый Вопрошатель によって更新されました。

RE: Asset Publisher configuration storage

Junior Member 投稿: 45 参加年月日: 11/10/11 最新の投稿
Thanks a lot, that was helpful!
12年前 に Назойливый Вопрошатель によって更新されました。

RE: Asset Publisher configuration storage

Junior Member 投稿: 45 参加年月日: 11/10/11 最新の投稿
By the way, did you try to set the preferences in similar way:

preferences.setValue("asset-vocabulary-id", "string value of id");


I hoped, it gonna change my asset publisher instance settings and change the output dynamically, but it didn't (
thumbnail
12年前 に jelmer kuperus によって更新されました。

RE: Asset Publisher configuration storage

Liferay Legend 投稿: 1191 参加年月日: 10/03/10 最新の投稿
You need to call store() after you change them
thumbnail
12年前 に Nagendra Kumar Busam によって更新されました。

RE: Asset Publisher configuration storage

Liferay Master 投稿: 678 参加年月日: 09/07/07 最新の投稿
to be more precise
preferences.store()
12年前 に Назойливый Вопрошатель によって更新されました。

RE: Asset Publisher configuration storage

Junior Member 投稿: 45 参加年月日: 11/10/11 最新の投稿
Yeah, I know that, sorry - didn't mentioned. But still - the value isn't stored emoticon