本文整理汇总了Java中com.liferay.asset.kernel.model.AssetRendererFactory类的典型用法代码示例。如果您正苦于以下问题:Java AssetRendererFactory类的具体用法?Java AssetRendererFactory怎么用?Java AssetRendererFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AssetRendererFactory类属于com.liferay.asset.kernel.model包,在下文中一共展示了AssetRendererFactory类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAssetViewURL
import com.liferay.asset.kernel.model.AssetRendererFactory; //导入依赖的package包/类
/**
* Gets the search result's view URL
*
* @param document The searched document
* @param request The request
* @param response The response
* @param currentLayout The current page
* @param tabId The search tab ID
*
* @return The search result URL
*/
private String getAssetViewURL(Document document, PortletRequest request, PortletResponse response, Layout currentLayout, String tabId, String keywords) {
String className = document.get(Field.ENTRY_CLASS_NAME);
long classPK = GetterUtil.getLong(document.get(Field.ENTRY_CLASS_PK));
String currentUrl = this.portal.getCurrentURL(request);
String returnedUrl;
if(ASSET_TYPE.equals(className) && classPK > 0) {
try {
String portletId = (String) request.getAttribute(WebKeys.PORTLET_ID);
PortletURL viewInPortletUrlObj = this.portletUrlFactory.create(request, portletId, currentLayout, LIFECYCLE_RENDER);
viewInPortletUrlObj.setParameter(PortletRequestParameter.VIEW_MODE.getName(), ViewMode.VIEW_JOURNAL.getParamValue());
viewInPortletUrlObj.setParameter(Field.ENTRY_CLASS_PK, Long.toString(classPK));
viewInPortletUrlObj.setParameter(PortletRequestParameter.TAB_ID.getName(), tabId);
viewInPortletUrlObj.setParameter(PortletRequestParameter.KEYWORDS.getName(), keywords);
String viewInPortletUrl = viewInPortletUrlObj.toString();
AssetRendererFactory<?> assetRendererFactory = AssetRendererFactoryRegistryUtil.getAssetRendererFactoryByClassName(className);
AssetRenderer<?> assetRenderer = assetRendererFactory.getAssetRenderer(classPK);
returnedUrl = assetRenderer.getURLViewInContext((LiferayPortletRequest) request, (LiferayPortletResponse) response, viewInPortletUrl);
} catch(Exception e) {
returnedUrl = currentUrl;
}
} else {
returnedUrl = currentUrl;
}
return returnedUrl;
}
示例2: getAssetRenderer
import com.liferay.asset.kernel.model.AssetRendererFactory; //导入依赖的package包/类
/**
* s Get AssetRenderer
*
* @return asset renderer object specific for the item type
* @throws PortalException
* @throws NumberFormatException
*/
protected AssetRenderer<?> getAssetRenderer()
throws NumberFormatException, PortalException {
if (_assetRenderer == null) {
AssetRendererFactory<?> assetRendererFactory =
AssetRendererFactoryRegistryUtil.getAssetRendererFactoryByClassName(
_entryClassName);
_assetRenderer =
assetRendererFactory.getAssetRenderer(_entryClassPK);
}
return _assetRenderer;
}
示例3: checkAssetEntryRelations
import com.liferay.asset.kernel.model.AssetRendererFactory; //导入依赖的package包/类
protected static boolean checkAssetEntryRelations(Model model) {
boolean assetEntryRelations = true;
AssetRendererFactory assetRendererFactory =
AssetRendererFactoryRegistryUtil.getAssetRendererFactoryByClassName(
model.getClassName());
if ((assetRendererFactory == null) ||
!assetRendererFactory.isSelectable()) {
assetEntryRelations = false;
}
return assetEntryRelations;
}
示例4: getPath
import com.liferay.asset.kernel.model.AssetRendererFactory; //导入依赖的package包/类
@Override
protected String getPath(SocialActivity activity, ServiceContext serviceContext) throws Exception {
_log.info("getPath");
AssetRendererFactory<?> assetRendererFactory = AssetRendererFactoryRegistryUtil
.getAssetRendererFactoryByClassName(TaskRecord.class.getName());
AssetRenderer<?> assetRenderer = assetRendererFactory.getAssetRenderer(activity.getClassPK());
_log.info(assetRenderer);
String path = assetRenderer.getURLViewInContext(serviceContext.getLiferayPortletRequest(),
serviceContext.getLiferayPortletResponse(), null);
path = HttpUtil.addParameter(path, "redirect", serviceContext.getCurrentURL());
return path;
}
示例5: getPortletId
import com.liferay.asset.kernel.model.AssetRendererFactory; //导入依赖的package包/类
@Override
public String getPortletId() {
AssetRendererFactory<TaskRecord> assetRendererFactory = getAssetRendererFactory();
return assetRendererFactory.getPortletId();
}
示例6: getPortletId
import com.liferay.asset.kernel.model.AssetRendererFactory; //导入依赖的package包/类
@Override
public String getPortletId() {
AssetRendererFactory<Contact> assetRendererFactory = getAssetRendererFactory();
return assetRendererFactory.getPortletId();
}
示例7: getPortletId
import com.liferay.asset.kernel.model.AssetRendererFactory; //导入依赖的package包/类
@Override
public String getPortletId() {
AssetRendererFactory<Measurement> assetRendererFactory = getAssetRendererFactory();
return assetRendererFactory.getPortletId();
}
示例8: getPath
import com.liferay.asset.kernel.model.AssetRendererFactory; //导入依赖的package包/类
@Override
protected String getPath(SocialActivity activity, ServiceContext serviceContext) throws Exception {
AssetRendererFactory<?> assetRendererFactory = AssetRendererFactoryRegistryUtil
.getAssetRendererFactoryByClassName(Contact.class.getName());
AssetRenderer<?> assetRenderer = assetRendererFactory.getAssetRenderer(activity.getClassPK());
String path = assetRenderer.getURLViewInContext(serviceContext.getLiferayPortletRequest(),
serviceContext.getLiferayPortletResponse(), null);
path = HttpUtil.addParameter(path, "redirect", serviceContext.getCurrentURL());
return path;
}