本文整理汇总了Java中com.liferay.portal.model.PortletConstants类的典型用法代码示例。如果您正苦于以下问题:Java PortletConstants类的具体用法?Java PortletConstants怎么用?Java PortletConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PortletConstants类属于com.liferay.portal.model包,在下文中一共展示了PortletConstants类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prepareRuntimePortlet
import com.liferay.portal.model.PortletConstants; //导入依赖的package包/类
private void prepareRuntimePortlet(PortletURL portletURL)
throws SystemException, PortalException {
if(_isRuntimePortlet){
portletURL.setParameter("p_o_p_id",ACTIVITY_VIEWER_PORTLET_ID);
PortletPreferencesFactoryUtil.getLayoutPortletSetup(_layout, _portletId);
String resourcePrimKey = PortletPermissionUtil.getPrimaryKey(_layout.getPlid(), _portletId);
String portletName = _portletId;
int warSeparatorIndex = portletName.indexOf(PortletConstants.WAR_SEPARATOR);
if (warSeparatorIndex != -1) {
portletName = portletName.substring(0, warSeparatorIndex);
}
if ((ResourcePermissionLocalServiceUtil.getResourcePermissionsCount(
_learningactivity.getCompanyId(), portletName,
ResourceConstants.SCOPE_INDIVIDUAL, resourcePrimKey) == 0)&&
(ResourceActionLocalServiceUtil.fetchResourceAction(portletName, ACTION_VIEW)!=null)) {
Role siteMember = RoleLocalServiceUtil.getRole(_learningactivity.getCompanyId(),RoleConstants.SITE_MEMBER);
ResourcePermissionLocalServiceUtil.setResourcePermissions(_learningactivity.getCompanyId(), portletName, ResourceConstants.SCOPE_INDIVIDUAL,
resourcePrimKey,siteMember.getRoleId(), new String[]{ACTION_VIEW});
}
}
}