public static FileEntry addTempFileEntry( long groupId, long userId, String folderName, String fileName, File file, String mimeType) throws PortalException { try (InputStream inputStream = new FileInputStream(file)) { return addTempFileEntry( groupId, userId, folderName, fileName, inputStream, mimeType); } catch (IOException ioe) { throw new PortalException(ioe); } }
protected String[] getIntraUris(long companyId, long userId) { try { String[] intraUris = ExpandoValueLocalServiceUtil.getData( companyId, User.class.getName(), ExpandoTableConstants.DEFAULT_TABLE_NAME, BookmarkConstants.EXPANDO_COLUMN_VGR_LABELED_URI, userId, new String[0]); return intraUris; } catch (PortalException e) { LOGGER.error(e.getMessage(), e); } catch (SystemException e) { LOGGER.error(e.getMessage(), e); } return new String[0]; }
protected PortalException translate(PortalException portalException) { if (portalException instanceof com.liferay.dynamic.data.mapping.exception. StorageFieldRequiredException) { return new StorageFieldRequiredException( portalException.getMessage(), portalException.getCause()); } return portalException; }
@Override public LinkedList<String> getInternalIdeaUsersToEmail(Idea idea) { LinkedList<String> toEmail = new LinkedList<String>(); // toEmail.add(idea.getIdeaPerson().getEmail()); try { toEmail = getUserGroupRoleByRoleAndGroup(idea, toEmail, IdeaServiceConstants.ROLE_NAME_COMMUNITY_INNOVATIONSSLUSSEN); toEmail = getUserGroupRoleByRoleAndGroup(idea, toEmail, IdeaServiceConstants.ROLE_NAME_COMMUNITY_IDEA_TRANSPORTER); } catch (PortalException e) { e.printStackTrace(); } catch (SystemException e) { e.printStackTrace(); } return toEmail; }
e.getCause() instanceof NoSuchFileEntryException) {
public static boolean usesScreennameOnTori( final com.liferay.portal.model.User liferayUser) { boolean result = false; try { if (liferayUser != null) { result = ExpandoValueLocalServiceUtil.getData( liferayUser.getCompanyId(), com.liferay.portal.model.User.class.getName(), "CUSTOM_FIELDS", SCREENNAME_EXPANDO_COLUMN_NAME, liferayUser.getUserId(), false); } } catch (PortalException e) { e.printStackTrace(); } catch (SystemException e) { e.printStackTrace(); } return result; }
@Override public String getURLEditWorkflowTask( long workflowTaskId, ServiceContext serviceContext) throws PortalException { try { PortletURL portletURL = PortalUtil.getControlPanelPortletURL( serviceContext.getRequest(), PortletKeys.MY_WORKFLOW_TASK, PortletRequest.RENDER_PHASE); portletURL.setParameter("mvcPath", "/edit_workflow_task.jsp"); portletURL.setParameter( "workflowTaskId", String.valueOf(workflowTaskId)); portletURL.setWindowState(WindowState.MAXIMIZED); return portletURL.toString(); } catch (WindowStateException wse) { throw new PortalException(wse); } }
@Override public boolean isUserPrioCouncilMember(long userId, long groupId) { boolean isUserPrioCouncilMember = false; boolean checkInheritedRoles = true; try { isUserPrioCouncilMember = userGroupRoleLocalService.hasUserGroupRole(userId, groupId, IdeaServiceConstants.ROLE_NAME_COMMUNITY_PRIO_COUNCIL, checkInheritedRoles); } catch (PortalException e) { LOGGER.error(e.getMessage(), e); } catch (SystemException e) { LOGGER.error(e.getMessage(), e); } return isUserPrioCouncilMember; }
portalException.getMessage(), portalException.getCause()); portalException.getMessage(), portalException.getCause()); portalException.getMessage(), portalException.getCause()); portalException.getMessage(), portalException.getCause()); portalException.getMessage(), portalException.getCause());
getSetting(columnName, companyId, groupId); } catch (PortalException e1) { e1.printStackTrace(); } catch (SystemException e1) { e1.printStackTrace(); getSetting(columnName, companyId, groupId); } catch (PortalException e2) { e2.printStackTrace(); } catch (SystemException e2) { e2.printStackTrace(); e.printStackTrace();
protected String getUniqueFileName( ThemeDisplay themeDisplay, String fileName, long folderId) throws PortalException { FileEntry fileEntry = fetchFileEntry( themeDisplay.getUserId(), themeDisplay.getScopeGroupId(), folderId, fileName); if (fileEntry == null) { return fileName; } int suffix = 1; for (int i = 0; i < _UNIQUE_FILE_NAME_TRIES; i++) { String curFileName = FileUtil.appendParentheticalSuffix( fileName, String.valueOf(suffix)); fileEntry = fetchFileEntry( themeDisplay.getUserId(), themeDisplay.getScopeGroupId(), folderId, curFileName); if (fileEntry == null) { return curFileName; } suffix++; } throw new PortalException( "Unable to get a unique file name for " + fileName); }
@Override public boolean isUserIdeaTransporter(long userId, long groupId) { boolean isUserIdeaTransporter = false; boolean checkInheritedRoles = true; try { isUserIdeaTransporter = userGroupRoleLocalService.hasUserGroupRole(userId, groupId, IdeaServiceConstants.ROLE_NAME_COMMUNITY_IDEA_TRANSPORTER, checkInheritedRoles); } catch (PortalException e) { LOGGER.error(e.getMessage(), e); } catch (SystemException e) { LOGGER.error(e.getMessage(), e); } return isUserIdeaTransporter; }
setSettingBoolean(data, columnName, companyId, groupId); } catch (PortalException e1) { e1.printStackTrace(); } catch (SystemException e1) { e1.printStackTrace(); setSettingBoolean(data, columnName, companyId, groupId); } catch (PortalException e2) { e2.printStackTrace(); } catch (SystemException e2) { e2.printStackTrace(); e.printStackTrace();
public ServiceWrapper<DDMTemplatePermissionSupport> getDDMTemplatePermissionSupportServiceWrapper( String resourceClassName) throws PortalException { ServiceWrapper<DDMTemplatePermissionSupport> ddmTemplatePermissionSupportServiceWrapper = _ddmTemplatePermissionSupportServiceTrackerMap.getService( resourceClassName); if (ddmTemplatePermissionSupportServiceWrapper == null) { throw new PortalException( "The model does not support DDMTemplate permission checking " + resourceClassName); } return ddmTemplatePermissionSupportServiceWrapper; }
@Override public boolean isUserInnovationsslussenEmployee(long userId, long groupId) { boolean isUserInnovationsslussenEmployee = false; boolean checkInheritedRoles = true; try { isUserInnovationsslussenEmployee = userGroupRoleLocalService.hasUserGroupRole(userId, groupId, IdeaServiceConstants.ROLE_NAME_COMMUNITY_INNOVATIONSSLUSSEN, checkInheritedRoles); } catch (PortalException e) { LOGGER.error(e.getMessage(), e); } catch (SystemException e) { LOGGER.error(e.getMessage(), e); } return isUserInnovationsslussenEmployee; }
setSetting(data, columnName, companyId, groupId); } catch (PortalException e1) { e1.printStackTrace(); } catch (SystemException e1) { e1.printStackTrace(); setSetting(data, columnName, companyId, groupId); } catch (PortalException e2) { e2.printStackTrace(); } catch (SystemException e2) { e2.printStackTrace(); e.printStackTrace();
public ServiceWrapper<DDMStructurePermissionSupport> getDDMStructurePermissionSupportServiceWrapper(String className) throws PortalException { ServiceWrapper<DDMStructurePermissionSupport> ddmStructurePermissionSupportServiceWrapper = _ddmStructurePermissionSupportServiceTrackerMap.getService( className); if (ddmStructurePermissionSupportServiceWrapper == null) { throw new PortalException( "The model does not support DDMStructure permission checking " + className); } return ddmStructurePermissionSupportServiceWrapper; }
/** * Like {@link SocialRelationService#getUserRequests(com.liferay.portal.model.User, boolean)} but where each * {@link SocialRequest} is mapped to a requesting {@link User} object for easy access to ditto. * * @param user the requested {@link User} * @param cachedResult whether a cached result is acceptable * @return a map of {@link SocialRequest}s mapped to the requesting {@link User} */ public Map<SocialRequest, User> getUserRequestsWithUser(User user, boolean cachedResult) { Map<SocialRequest, User> socialRequestUserMap = new HashMap<SocialRequest, User>(); try { List<SocialRequest> receiverUserRequests = socialRequestLocalService.getReceiverUserRequests( user.getUserId(), SocialRequestConstants.STATUS_PENDING, 0, getUserRequestsCount( user, SocialRequestConstants.STATUS_PENDING)); for (SocialRequest request : receiverUserRequests) { User requestingUser = userLocalService.getUserById(request.getUserId()); socialRequestUserMap.put(request, requestingUser); } } catch (SystemException e) { LOGGER.error(e.getMessage(), e); return null; } catch (PortalException e) { LOGGER.error(e.getMessage(), e); return null; } return socialRequestUserMap; }
getSettingBoolean(columnName, companyId, groupId); } catch (PortalException e1) { e1.printStackTrace(); } catch (SystemException e1) { e1.printStackTrace(); getSettingBoolean(columnName, companyId, groupId); } catch (PortalException e2) { e2.printStackTrace(); } catch (SystemException e2) { e2.printStackTrace(); e.printStackTrace();
protected String[] getDDMFieldsDisplayValues( Map<String, DDMFormField> ddmFormFieldsMap, Field ddmFieldsDisplayField) throws PortalException { try { List<String> fieldsDisplayValues = new ArrayList<>(); String[] values = splitFieldsDisplayValue(ddmFieldsDisplayField); for (String value : values) { String fieldName = StringUtil.extractFirst( value, DDMImpl.INSTANCE_SEPARATOR); if (ddmFormFieldsMap.containsKey(fieldName)) { fieldsDisplayValues.add(fieldName); } } return fieldsDisplayValues.toArray( new String[fieldsDisplayValues.size()]); } catch (Exception e) { throw new PortalException(e); } }