001
014
015 package com.liferay.taglib.ui;
016
017 import com.liferay.portal.kernel.exception.SystemException;
018 import com.liferay.portlet.asset.model.AssetEntry;
019 import com.liferay.portlet.asset.service.AssetEntryLocalServiceUtil;
020
021 import javax.servlet.http.HttpServletRequest;
022
023
027 public class InputAssetLinksTag extends AssetLinksTag {
028
029 @Override
030 protected String getPage() {
031 return _PAGE;
032 }
033
034 @Override
035 protected void setAttributes(HttpServletRequest request) {
036 long assetEntryId = getAssetEntryId();
037 String className = getClassName();
038 long classPK = getClassPK();
039
040 if ((assetEntryId <= 0) && (classPK > 0)) {
041 try {
042 AssetEntry assetEntry = AssetEntryLocalServiceUtil.fetchEntry(
043 className, classPK);
044
045 if (assetEntry != null) {
046 assetEntryId = assetEntry.getEntryId();
047 }
048 }
049 catch (SystemException se) {
050 }
051 }
052
053 request.setAttribute(
054 "liferay-ui:input-asset-links:assetEntryId",
055 String.valueOf(assetEntryId));
056 request.setAttribute(
057 "liferay-ui:input-asset-links:className", className);
058 }
059
060 private static final String _PAGE =
061 "/html/taglib/ui/input_asset_links/page.jsp";
062
063 }