Fórum

No assets shown for custom asset in asset publisher?

thumbnail
Cameron McBride, modificado 11 Anos atrás.

No assets shown for custom asset in asset publisher?

New Member Postagens: 8 Data de Entrada: 11/07/12 Postagens Recentes
I am using Liferay 6.1.2 EE GA2. I have a simple model, a class extending AssetRenderer and a class extending AssetRendererFactory. I can call AssetEntryLocalServiceUtil to add a new entry. I can see the asset entry in the database, I can update it, delete it, select it by id, etc.

In the asset publisher I can see my new asset type in the configuration. However, the asset is never displayed. Visible is set to true. I am not sure how to approach this problem of it not displaying. It makes me wonder if my AssetRendererFactory is even being registered. I do have the asset-renderer-factory in the liferay-portlet.xml.

Thanks for any tips!
thumbnail
Brian Scott Schupbach, modificado 11 Anos atrás.

RE: No assets shown for custom asset in asset publisher?

Expert Postagens: 329 Data de Entrada: 23/10/08 Postagens Recentes
Did you ever figure this out? I added my custom asset in the liferay-portlet.xml and I can see it as a type in the asset publisher configuration. However, when I add in new entries it doesn't show up. Any ideas? Did you ever get this solved?
Bhavik Shah, modificado 6 Anos atrás.

RE: No assets shown for custom asset in asset publisher?

Junior Member Postagens: 64 Data de Entrada: 21/05/15 Postagens Recentes
I am facing same issue in liferay DXP enterprise SP3. I have created 2 classes CustomAssetRenderer and CustomAssetRendererFactory which instantiate CustomAssetRenderer object. I have register factory class as component as follows:

@Component(
immediate = true,
property = {"javax.portlet.name=" + EmployeeMasterPortletKeys.EmployeeMaster},
service = AssetRendererFactory.class
)

So I am able to see my custom asset in configuration of Asset Publisher but I can not see my custom asset when viewing Asset Publisher Portlet.
How ever I have also created WorkflowHandler for same and apply out of the box workflow to my custom asset and it is working properly.
Please guide what can be done to view in Asset Publisher Portlet.

Regards,
Bhavik
alex r, modificado 10 Anos atrás.

RE: No assets shown for custom asset in asset publisher?

New Member Postagens: 16 Data de Entrada: 30/04/13 Postagens Recentes
Pullling my hair out over this ... I have tried debugging the asset render but the code is never hit ...


There has to be something I'm missing:


AssetEntryQuery assetEntryQuery = new AssetEntryQuery();

AssetEntry entry = AssetEntryServiceUtil.getEntry(18402);

long[] catt = new long[1];
catt[0] = entry.getCategories().get(0).getCategoryId();
java.lang.System.out.println(catt[0]);
assetEntryQuery.setAllCategoryIds(catt);
assetEntryQuery.setStart(0);
assetEntryQuery.setEnd(10);

List<assetentry> results = AssetEntryServiceUtil.getEntries(assetEntryQuery);</assetentry>


So I get the asset by id, which works fine.

Then I try and get all Assets with the categoryId of that asset I just fetched. I get no results???????

I have narrowed down the problem to the AssetEntryServiceUtil.getEntries() not finding any custom assets.

Another thing that is bothering me is if the asset-renderer-factory is in liferay-portlet.xml (portlet level), how does that map to an asset(portal). When an asset is created using AssetEntryLocalServiceUtil.updateEntry(....), then searched for using AssetEntryServiceUtil.getEntries(), how would the class defined in some random custom portlet be mapped to a portal wide method??


Scratch all this ... I just found that in the http://www.liferay.com/documentation/liferay-portal/6.0/development/-/ai/asset-framework page describing AssetEntryLocalServiceUtil.updateEntry(....) there is a value visible which is not addressed and the example is set to false. Setting to true allows for the custom asset to be searched for.