@Override public FileEntry addTempFileEntry(long groupId, String folderName, String fileName, InputStream inputStream, String mimeType) throws PortalException { TimetrackerPortletPermission.check(getPermissionChecker(), groupId, TimetrackerActionKeys.IMPORT_TASK_RECORDS); return TempFileEntryUtil.addTempFileEntry(groupId, getUserId(), DigesterUtil.digestHex(Digester.SHA_256, folderName), fileName, inputStream, mimeType); }
@Override public void deleteTempFileEntry(long groupId, String folderName, String fileName) throws PortalException { TimetrackerPortletPermission.check(getPermissionChecker(), groupId, TimetrackerActionKeys.EXPORT_IMPORT_TASK_RECORDS); TempFileEntryUtil.deleteTempFileEntry(groupId, getUserId(), DigesterUtil.digestHex(Digester.SHA_256, folderName), fileName); }
@Override public String[] getTempFileNames(long groupId, String folderName) throws PortalException { TimetrackerPortletPermission.check(getPermissionChecker(), groupId, TimetrackerActionKeys.EXPORT_IMPORT_TASK_RECORDS); return TempFileEntryUtil.getTempFileNames(groupId, getUserId(), DigesterUtil.digestHex(Digester.SHA_256, folderName)); }
@Override public FileEntry addTempFileEntry(long groupId, String folderName, String fileName, InputStream inputStream, String mimeType) throws PortalException { ContactManagerPortletPermission.check(getPermissionChecker(), groupId, ContactManagerActionKeys.EXPORT_IMPORT_CONTACTS); return TempFileEntryUtil.addTempFileEntry(groupId, getUserId(), DigesterUtil.digestHex(Digester.SHA_256, folderName), fileName, inputStream, mimeType); }
@Override public void deleteTempFileEntry(long groupId, String folderName, String fileName) throws PortalException { ContactManagerPortletPermission.check(getPermissionChecker(), groupId, ContactManagerActionKeys.EXPORT_IMPORT_CONTACTS); TempFileEntryUtil.deleteTempFileEntry(groupId, getUserId(), DigesterUtil.digestHex(Digester.SHA_256, folderName), fileName); }
@Override public String[] getTempFileNames(long groupId, String folderName) throws PortalException { ContactManagerPortletPermission.check(getPermissionChecker(), groupId, ContactManagerActionKeys.EXPORT_IMPORT_CONTACTS); return TempFileEntryUtil.getTempFileNames(groupId, getUserId(), DigesterUtil.digestHex(Digester.SHA_256, folderName)); }
@Override public String[] getTempFileNames(long groupId, String folderName) throws PortalException { DataManagerPortletPermission.check(getPermissionChecker(), groupId, MeasurementActionKeys.EXPORT_IMPORT_MEASUREMENTS); return TempFileEntryUtil.getTempFileNames(groupId, getUserId(), DigesterUtil.digestHex(Digester.SHA_256, folderName)); }
/** * Factory method which creates new Buddy object from BuddyDetails * * @param buddyDetails BuddyDetails * @return User */ public static Buddy fromBuddyDetails(BuddyDetails buddyDetails) { // Create new buddy Buddy buddy = new Buddy(); // Map data to user details buddy.buddyId = buddyDetails.getBuddyId(); buddy.companyId = buddyDetails.getCompanyId(); buddy.fullName = buddyDetails.getFullName(); buddy.screenName = buddyDetails.getScreenName(); buddy.password = buddyDetails.getPassword(); // Add additional info from local service util if it's not set in buddy details if (buddyDetails.getBuddyId() != null) { try { User user = UserLocalServiceUtil.getUserById(buddyDetails.getBuddyId()); if (buddy.screenName == null) { buddy.screenName = user.getScreenName(); } if (buddy.companyId == null) { buddy.companyId = user.getCompanyId(); } if (buddy.fullName == null) { buddy.fullName = user.getFullName(); } buddy.male = user.getMale(); buddy.portraitId = user.getPortraitId(); buddy.portraitImageToken = HttpUtil.encodeURL(DigesterUtil.digest(user.getUserUuid())); buddy.portraitToken = WebServerServletTokenUtil.getToken(user.getPortraitId()); buddy.fullName = user.getFullName(); } catch (Exception e) { // Just log if (log.isDebugEnabled()) { log.debug(e); } } } // Relations if (buddyDetails.getPresenceDetails() != null) { buddy.presence = Presence.fromPresenceDetails(buddyDetails.getPresenceDetails()); } if (buddyDetails.getSettingsDetails() != null) { buddy.settings = Settings.fromSettingsDetails(buddyDetails.getSettingsDetails()); } return buddy; }