Mariusz
Mariusz

Reputation: 1985

Custom asset is not visible in Asset Publisher portlet

My custom asset is not visible in Asset Publisher. I created portlets and service layer according to this guide. so I have Location model. After create or update location I update entry:

public void addLocation(ActionRequest request, ActionResponse response)
            throws Exception {

        Location location = _updateLocation(request);
        User user = PortalUtil.getUser(request);
            AssetEntryLocalServiceUtil.updateEntry(user.getUserId(),
                PortalUtil.getScopeGroupId(request), Location.class.getName(),
                location.getLocationId(), new long[0], new String[] { "mycat1",
                        "mucat2" });
        sendRedirect(request, response);
    }

AssetEntry is stored in database:

SELECT entryid, groupid, companyid, userid, username, createdate, modifieddate, 
       classnameid, classpk, classuuid, classtypeid, visible, startdate, 
       enddate, publishdate, expirationdate, mimetype, title, description, 
       summary, url, layoutuuid, height, width, priority, viewcount
  FROM assetentry order by createdate desc limit 1;

Result:

left side of result left side of result right side of result right side of result

Why Asset Publisher not show my asset if asset exists in database? Maybe I should specify some layout because Asset Publisher don't know how to show my asset.

Upvotes: 0

Views: 1919

Answers (1)

To utilize Asset Framework properly, you need to do few more things. First of all Asset Publisher needs to know how to access your objects metadata - you have to provide custom AssetRendererFactory / AssetRenderer classes and a JSP file which will render your entity.

Read more in https://www.liferay.com/documentation/liferay-portal/6.2/development/-/ai/asset-framework-liferay-portal-6-2-dev-guide-06-en under the section Publishing Assets with Asset Publisher.

Upvotes: 1

Related Questions