本文整理汇总了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;未经允许,请勿转载。 |
请发表评论