Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
Cameron McBride
No assets shown for custom asset in asset publisher?
15 de enero de 2013 17:36
Respuesta

Cameron McBride

Ranking: New Member

Mensajes: 1

Fecha de incorporación: 11 de julio de 2012

Mensajes recientes

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!
Brian Scott Schupbach
RE: No assets shown for custom asset in asset publisher?
26 de febrero de 2013 8:47
Respuesta

Brian Scott Schupbach

Ranking: Expert

Mensajes: 329

Fecha de incorporación: 23 de octubre de 2008

Mensajes recientes

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?
alex r
RE: No assets shown for custom asset in asset publisher?
22 de mayo de 2013 11:23
Respuesta

alex r

Ranking: New Member

Mensajes: 16

Fecha de incorporación: 30 de abril de 2013

Mensajes recientes

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:


 1AssetEntryQuery assetEntryQuery = new AssetEntryQuery();
 2
 3AssetEntry entry = AssetEntryServiceUtil.getEntry(18402);
 4
 5long[] catt = new long[1];
 6catt[0] = entry.getCategories().get(0).getCategoryId();
 7java.lang.System.out.println(catt[0]);
 8assetEntryQuery.setAllCategoryIds(catt);
 9assetEntryQuery.setStart(0);
10assetEntryQuery.setEnd(10);
11
12List<AssetEntry> results = AssetEntryServiceUtil.getEntries(assetEntryQuery);


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.