本文整理汇总了Java中com.liferay.portal.model.ResourceConstants类的典型用法代码示例。如果您正苦于以下问题:Java ResourceConstants类的具体用法?Java ResourceConstants怎么用?Java ResourceConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResourceConstants类属于com.liferay.portal.model包,在下文中一共展示了ResourceConstants类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: prepareRuntimePortlet
import com.liferay.portal.model.ResourceConstants; //导入依赖的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});
}
}
}
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:27,代码来源:LearningActivityBaseAssetRenderer.java
示例2: getVisibleActivities
import com.liferay.portal.model.ResourceConstants; //导入依赖的package包/类
public static List<LearningActivity> getVisibleActivities(ThemeDisplay themeDisplay,
List<LearningActivity> res, PermissionChecker permissionChecker)
throws PortalException, SystemException {
List<LearningActivity> res2 = null;
if(res != null && res.size()>0){
res2 = new ArrayList<LearningActivity>();
res2.addAll(res);
Role siteMemberRole = RoleLocalServiceUtil.getRole(themeDisplay.getCompanyId(), RoleConstants.SITE_MEMBER);
for(java.util.ListIterator<LearningActivity> itr = res2.listIterator(); itr.hasNext();){
LearningActivity activity = itr.next();
try {
if(!ResourcePermissionLocalServiceUtil.hasResourcePermission(activity.getCompanyId(), LearningActivity.class.getName(),
ResourceConstants.SCOPE_INDIVIDUAL, Long.toString(activity.getActId()),siteMemberRole.getRoleId(), ActionKeys.VIEW)
&& !permissionChecker.hasPermission(activity.getGroupId(), LearningActivity.class.getName(), activity.getActId() , "CORRECT"))
itr.remove();
} catch (SystemException e) {
e.printStackTrace();
}
}
}
return res2;
}
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:23,代码来源:LiferaylmsUtil.java
示例3: remove
import com.liferay.portal.model.ResourceConstants; //导入依赖的package包/类
public void remove(Module fileobj, long userIdAction) throws SystemException {
// modulePersistence.remove(fileobj);
try {
resourceLocalService.deleteResource(
fileobj.getCompanyId(), Module.class.getName(),
ResourceConstants.SCOPE_INDIVIDUAL, fileobj.getPrimaryKey());
} catch (PortalException e) {
if(log.isDebugEnabled())e.printStackTrace();
if(log.isInfoEnabled())log.info(e.getMessage());
throw new SystemException(e);
}
modulePersistence.remove(fileobj);
//auditing
AuditingLogFactory.audit(fileobj.getCompanyId(), fileobj.getGroupId(), Module.class.getName(),
fileobj.getModuleId(), userIdAction, AuditConstants.DELETE, null);
}
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:19,代码来源:ModuleLocalServiceImpl.java
示例4: deleteLearningactivity
import com.liferay.portal.model.ResourceConstants; //导入依赖的package包/类
public void deleteLearningactivity (LearningActivity lernact) throws SystemException,
PortalException {
long companyId = lernact.getCompanyId();
assetEntryLocalService.deleteEntry(LearningActivity.class.getName(),lernact.getActId());
resourceLocalService.deleteResource(
companyId, LearningActivity.class.getName(),
ResourceConstants.SCOPE_INDIVIDUAL, lernact.getPrimaryKey());
assetEntryLocalService.deleteEntry(
LearningActivity.class.getName(), lernact.getActId());
LearningActivityUtil.remove(lernact.getActId());
SocialActivityLocalServiceUtil.addActivity(
lernact.getUserId(), lernact.getGroupId(),
LearningActivity.class.getName(), lernact.getActId(),
2, StringPool.BLANK, 0);
}
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:17,代码来源:LearningActivityLocalServiceImpl.java
示例5: setRolePermissions
import com.liferay.portal.model.ResourceConstants; //导入依赖的package包/类
private static void setRolePermissions(Role role, String name, java.util.List<ResourceAction>actions) throws PortalException, SystemException {
String[] actionIds=new String[actions.size()];
int counter=0;
for(ResourceAction raction:actions){
actionIds[counter]=raction.getActionId();
counter++;
}
if (ResourceBlockLocalServiceUtil.isSupported(name))
ResourceBlockLocalServiceUtil.setCompanyScopePermissions(role.getCompanyId(), name, role.getRoleId(),Arrays.asList(actionIds));
else
ResourcePermissionLocalServiceUtil.setResourcePermissions(role.getCompanyId(), name, ResourceConstants.SCOPE_COMPANY, String.valueOf(role.getCompanyId()), role.getRoleId(), actionIds);
}
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:16,代码来源:StartupAction.java
示例6: updateModule
import com.liferay.portal.model.ResourceConstants; //导入依赖的package包/类
@Override
public Module updateModule(Module module, long userIdAction) throws SystemException {
module = LmsLocaleUtil.checkDefaultLocale(Module.class, module, "title");
module = LmsLocaleUtil.checkDefaultLocale(Module.class, module, "description");
module.setModifiedDate(new java.util.Date(System.currentTimeMillis()));
try {
if(resourceLocalService.getResource(module.getCompanyId(), Module.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL,Long.toString( module.getPrimaryKey()))==null)
{
resourceLocalService.addResources(
module.getCompanyId(), module.getGroupId(), module.getUserId(),
Module.class.getName(), module.getPrimaryKey(), false,
true, true);
}
} catch (PortalException e) {
if(log.isDebugEnabled())e.printStackTrace();
if(log.isInfoEnabled())log.info(e.getMessage());
throw new SystemException(e);
}
module = super.updateModule(module);
//auditing
AuditingLogFactory.audit(module.getCompanyId(), module.getGroupId(), Module.class.getName(),
module.getModuleId(), userIdAction, AuditConstants.UPDATE, null);
return module;
}
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:28,代码来源:ModuleLocalServiceImpl.java
示例7: doRun
import com.liferay.portal.model.ResourceConstants; //导入依赖的package包/类
private void doRun(String[] ids) throws Exception{
ExpandoTable table = null;
long companyId = Long.parseLong(ids[0]);
try {
table = ExpandoTableLocalServiceUtil.addDefaultTable(
companyId, LayoutSetPrototype.class.getName());
}
catch(DuplicateTableNameException dtne) {
table = ExpandoTableLocalServiceUtil.getDefaultTable(
companyId, LayoutSetPrototype.class.getName());
}
long tableId = table.getTableId();
try {
Role guestUserRole = RoleLocalServiceUtil.getRole(companyId, RoleConstants.USER);
ExpandoColumn column = ExpandoColumnLocalServiceUtil.addColumn(
tableId, COLUMN_NAME, ExpandoColumnConstants.BOOLEAN);
ExpandoColumnLocalServiceUtil.updateExpandoColumn(column);
ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId,
ExpandoColumn.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL,
String.valueOf(column.getColumnId()), guestUserRole.getRoleId(), new String[] { ActionKeys.VIEW});
}
catch(DuplicateColumnNameException dcne) {
LOG.debug("Expando" + COLUMN_NAME + " already exist!");
}
}
开发者ID:rivetlogic,项目名称:liferay-microsite-manager,代码行数:32,代码来源:ExpandoStartupAction.java
示例8: createExpandoColumn
import com.liferay.portal.model.ResourceConstants; //导入依赖的package包/类
/**
* Leget eine ExpandoColumn an und gibt ihr das Leserecht für 'Guest' und
* das Schreibrecht für 'Power User' in Layouts
*
* @param expandoTable
* Die ExpandoTabelle, zu der die Spalte gehört
* @param name
* Der Name
* @param type
* der Typ
* @throws PortalException
* @throws SystemException
*/
private ExpandoColumn createExpandoColumn(ExpandoTable expandoTable,
String name, int type) throws PortalException, SystemException {
ExpandoColumn expandoColumn = ExpandoColumnLocalServiceUtil.getColumn(
expandoTable.getTableId(), name);
if (expandoColumn == null) {
expandoColumn = ExpandoColumnLocalServiceUtil.addColumn(
expandoTable.getTableId(), name, type);
expandoColumn.persist();
}
// stelle sicher, dass die Resource existiert. Durch eine Race-Condition
// in Liferay ist
// jedoch nicht sichergestellt, dass Guest auch lesen darf.
ResourceLocalServiceUtil.addResources(expandoTable.getCompanyId(), 0,
0, ExpandoColumn.class.getName(), expandoColumn.getColumnId(),
false, false, false);
// stelle sicher, dass Guest lesen darf
Role role = RoleLocalServiceUtil.getRole(expandoTable.getCompanyId(),
RoleConstants.GUEST);
ResourcePermissionLocalServiceUtil.setResourcePermissions(
expandoTable.getCompanyId(), ExpandoColumn.class.getName(),
ResourceConstants.SCOPE_INDIVIDUAL,
String.valueOf(expandoColumn.getColumnId()), role.getRoleId(),
new String[] { "VIEW" });
// stelle sicher, dass Power User in Layouts schreiben darf
// (siehe https://issues.liferay.com/browse/LPS-44592)
if (expandoTable.getClassName().equals(Layout.class.getName())) {
Role powerUserRole = RoleLocalServiceUtil.getRole(
expandoTable.getCompanyId(), RoleConstants.POWER_USER);
ResourcePermissionLocalServiceUtil.setResourcePermissions(
expandoTable.getCompanyId(), ExpandoColumn.class.getName(),
ResourceConstants.SCOPE_INDIVIDUAL,
String.valueOf(expandoColumn.getColumnId()),
powerUserRole.getRoleId(),
new String[] { "VIEW", "UPDATE" });
}
return expandoColumn;
}
开发者ID:frickeo,项目名称:liferay-junction-point-hook,代码行数:53,代码来源:JunctionPointApplicationStartupEvent.java
示例9: deleteShortUrl
import com.liferay.portal.model.ResourceConstants; //导入依赖的package包/类
public ShortUrl deleteShortUrl(ShortUrl shortUrl) throws SystemException {
try {
resourceLocalService.deleteResource(shortUrl.getCompanyId(), ShortUrl.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, shortUrl.getShortUrlId());
} catch (PortalException e) {
log.error(e);
}
return super.deleteShortUrl(shortUrl);
}
开发者ID:moddavid,项目名称:Ancud_ShortURL-portlet,代码行数:10,代码来源:ShortUrlLocalServiceImpl.java
示例10: removeEbPartnerShip
import com.liferay.portal.model.ResourceConstants; //导入依赖的package包/类
public void removeEbPartnerShip(EbPartnerShip ebPartnerShip) throws PortalException, SystemException {
ebPartnerShipPersistence.remove(ebPartnerShip);
resourceLocalService.deleteResource(ebPartnerShip.getCompanyId(), EbPartnerShip.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, ebPartnerShip.getEbPartnerShipId());
}
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:5,代码来源:EbPartnerShipLocalServiceImpl.java
示例11: removeDossierProcAgent
import com.liferay.portal.model.ResourceConstants; //导入依赖的package包/类
public void removeDossierProcAgent(DossierProcAgent dossierProcAgent) throws PortalException, SystemException {
dossierProcAgentPersistence.remove(dossierProcAgent);
resourceLocalService.deleteResource(dossierProcAgent.getCompanyId(), DossierProcAgent.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, dossierProcAgent.getDossierProcAgentId());
}
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:5,代码来源:DossierProcAgentLocalServiceImpl.java
示例12: removeDocFileVersion
import com.liferay.portal.model.ResourceConstants; //导入依赖的package包/类
public void removeDocFileVersion(DocFileVersion docFileVersion) throws PortalException, SystemException {
docFileVersionPersistence.remove(docFileVersion);
resourceLocalService.deleteResource(docFileVersion.getCompanyId(), DocFileVersion.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, docFileVersion.getDocFileVersionId());
}
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:5,代码来源:DocFileVersionLocalServiceImpl.java
示例13: removeDocFile
import com.liferay.portal.model.ResourceConstants; //导入依赖的package包/类
public void removeDocFile(DocFile docFile) throws PortalException, SystemException {
docFilePersistence.remove(docFile);
resourceLocalService.deleteResource(docFile.getCompanyId(), DocFile.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, docFile.getDocFileId());
}
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:5,代码来源:DocFileLocalServiceImpl.java
示例14: removeEbMessage
import com.liferay.portal.model.ResourceConstants; //导入依赖的package包/类
public void removeEbMessage(EbMessage ebMessage) throws PortalException, SystemException {
ebMessagePersistence.remove(ebMessage);
resourceLocalService.deleteResource(ebMessage.getCompanyId(), EbMessage.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, ebMessage.getEbMessageId());
}
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:5,代码来源:EbMessageLocalServiceImpl.java
示例15: removeDossier
import com.liferay.portal.model.ResourceConstants; //导入依赖的package包/类
public void removeDossier(Dossier dossier) throws PortalException, SystemException {
dossierPersistence.remove(dossier);
resourceLocalService.deleteResource(dossier.getCompanyId(), Dossier.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, dossier.getDossierId());
}
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:5,代码来源:DossierLocalServiceImpl.java
示例16: removePaymentRequest
import com.liferay.portal.model.ResourceConstants; //导入依赖的package包/类
public void removePaymentRequest(PaymentRequest paymentRequest) throws PortalException, SystemException {
paymentRequestPersistence.remove(paymentRequest);
resourceLocalService.deleteResource(paymentRequest.getCompanyId(), PaymentRequest.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, paymentRequest.getPaymentRequestId());
}
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:5,代码来源:PaymentRequestLocalServiceImpl.java
示例17: removePaymentConfig
import com.liferay.portal.model.ResourceConstants; //导入依赖的package包/类
public void removePaymentConfig(PaymentConfig paymentConfig) throws PortalException, SystemException {
paymentConfigPersistence.remove(paymentConfig);
resourceLocalService.deleteResource(paymentConfig.getCompanyId(), PaymentConfig.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, paymentConfig.getPaymentConfigId());
}
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:5,代码来源:PaymentConfigLocalServiceImpl.java
示例18: removeDossierDoc
import com.liferay.portal.model.ResourceConstants; //导入依赖的package包/类
public void removeDossierDoc(DossierDoc dossierDoc) throws PortalException, SystemException {
dossierDocPersistence.remove(dossierDoc);
resourceLocalService.deleteResource(dossierDoc.getCompanyId(), DossierDoc.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, dossierDoc.getDossierDocId());
}
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:5,代码来源:DossierDocLocalServiceImpl.java
示例19: removePaymentFile
import com.liferay.portal.model.ResourceConstants; //导入依赖的package包/类
public void removePaymentFile(PaymentFile paymentFile) throws PortalException, SystemException {
paymentFilePersistence.remove(paymentFile);
resourceLocalService.deleteResource(paymentFile.getCompanyId(), PaymentFile.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, paymentFile.getPaymentFileId());
}
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:5,代码来源:PaymentFileLocalServiceImpl.java
示例20: removeDossierFolder
import com.liferay.portal.model.ResourceConstants; //导入依赖的package包/类
public void removeDossierFolder(DossierFolder dossierFolder) throws PortalException, SystemException {
dossierFolderPersistence.remove(dossierFolder);
resourceLocalService.deleteResource(dossierFolder.getCompanyId(), DossierFolder.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, dossierFolder.getDossierFolderId());
}
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:5,代码来源:DossierFolderLocalServiceImpl.java
注:本文中的com.liferay.portal.model.ResourceConstants类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论