Message Boards

Searchable Asset wih REST-Portlet?

thumbnail
Fredi B, modified 3 Years ago.

Searchable Asset wih REST-Portlet?

Junior Member Posts: 69 Join Date: 4/1/20 Recent Posts
Hey Liferay-People,
I am whacking my head against Assets and Asset-Permissions (Liferay 7.2).
Maybe you Liferay-Gurus can enlighten me...

How can I create a SEARCHABLE Asset from within a REST-Module?
​​​​​​​
I am atm only able to create a searchable asset with a MVC-Portlet... 

Cheers,
Fredi
thumbnail
Olaf Kock, modified 3 Years ago.

RE: Searchable Asset wih REST-Portlet?

Liferay Legend Posts: 6396 Join Date: 9/23/08 Recent Posts
Fredi B:

How can I create a SEARCHABLE Asset from within a REST-Module?
​​​​​​​
I am atm only able to create a searchable asset with a MVC-Portlet...

I would encapsulate such code in a service - then whoever uses that service would create the same kind of asset, with all the same data and mechanics.
thumbnail
Fredi B, modified 3 Years ago.

RE: Searchable Asset wih REST-Portlet?

Junior Member Posts: 69 Join Date: 4/1/20 Recent Posts
Hey Olaf,
thx for your response.

Can you elaborate a little bit further?

I create an Asset via MVC Portlet... In this MVC-Portlet is the AssetRenderer and AssetRendererFactory and their AssetViews (abstract.jsp  + fullcontent.jsp)
Example: _newsLocalService.addTestNews(groupId, serviceContext)
Result: I can find it in Asset Publisher and Liferay Search.
By just using the same add-Command (_newsLocalService.addTestNews(groupId, serviceContext)) in my REST-Module the Asset can not be found.

I have the feeling that this might be related to the Ressource-Permission defined in ServiceBuilderModule?