• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AssetRendererFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;
}
 
开发者ID:savoirfairelinux,项目名称:flashlight-search,代码行数:40,代码来源:JournalArticleSearchResultProcessor.java


示例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;
}
 
开发者ID:peerkar,项目名称:liferay-gsearch,代码行数:22,代码来源:BaseResultItemBuilder.java


示例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;
}
 
开发者ID:jorgediaz-lr,项目名称:staging-checker,代码行数:16,代码来源:ConfigurationUtil.java


示例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;
}
 
开发者ID:inofix,项目名称:ch-inofix-timetracker,代码行数:20,代码来源:TaskRecordActivityInterpreter.java


示例5: getPortletId

import com.liferay.asset.kernel.model.AssetRendererFactory; //导入依赖的package包/类
@Override
public String getPortletId() {
    AssetRendererFactory<TaskRecord> assetRendererFactory = getAssetRendererFactory();

    return assetRendererFactory.getPortletId();
}
 
开发者ID:inofix,项目名称:ch-inofix-timetracker,代码行数:7,代码来源:TaskRecordAssetRenderer.java


示例6: getPortletId

import com.liferay.asset.kernel.model.AssetRendererFactory; //导入依赖的package包/类
@Override
public String getPortletId() {
    AssetRendererFactory<Contact> assetRendererFactory = getAssetRendererFactory();

    return assetRendererFactory.getPortletId();
}
 
开发者ID:inofix,项目名称:ch-inofix-contact-manager,代码行数:7,代码来源:ContactAssetRenderer.java


示例7: getPortletId

import com.liferay.asset.kernel.model.AssetRendererFactory; //导入依赖的package包/类
@Override
public String getPortletId() {
    AssetRendererFactory<Measurement> assetRendererFactory = getAssetRendererFactory();

    return assetRendererFactory.getPortletId();
}
 
开发者ID:inofix,项目名称:ch-inofix-data-manager,代码行数:7,代码来源:MeasurementAssetRenderer.java


示例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;
}
 
开发者ID:inofix,项目名称:ch-inofix-contact-manager,代码行数:16,代码来源:ContactActivityInterpreter.java



注:本文中的com.liferay.asset.kernel.model.AssetRendererFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Menu类代码示例发布时间:2022-05-22
下一篇:
Java Icon类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap