protected void moveEntries(ActionRequest actionRequest) throws Exception { long newFolderId = ParamUtil.getLong(actionRequest, "newFolderId"); ServiceContext serviceContext = ServiceContextFactory.getInstance(DLFileEntry.class.getName(), actionRequest); long[] folderIds = ParamUtil.getLongValues(actionRequest, "rowIdsFolder"); for (long folderId : folderIds) { _dlAppService.moveFolder(folderId, newFolderId, serviceContext); } long[] fileEntryIds = ParamUtil.getLongValues(actionRequest, "rowIdsFileEntry"); for (long fileEntryId : fileEntryIds) { _dlAppService.moveFileEntry(fileEntryId, newFolderId, serviceContext); } long[] fileShortcutIds = ParamUtil.getLongValues(actionRequest, "rowIdsDLFileShortcut"); for (long fileShortcutId : fileShortcutIds) { if (fileShortcutId == 0) { continue; } FileShortcut fileShortcut = _dlAppService.getFileShortcut(fileShortcutId); _dlAppService.updateFileShortcut( fileShortcutId, newFolderId, fileShortcut.getToFileEntryId(), serviceContext); } }
@Override public IGViewFileVersionDisplayContext getIGViewFileVersionDisplayContext( IGViewFileVersionDisplayContext parentIGViewFileVersionDisplayContext, HttpServletRequest request, HttpServletResponse response, FileShortcut fileShortcut) { try { long fileEntryId = fileShortcut.getToFileEntryId(); FileEntry fileEntry = _dlAppService.getFileEntry(fileEntryId); FileVersion fileVersion = fileEntry.getFileVersion(); return getIGViewFileVersionDisplayContext( parentIGViewFileVersionDisplayContext, request, response, fileVersion); } catch (PortalException pe) { throw new SystemException( "Unable to build GoogleDocsDLViewFileVersionDisplayContext " + "for shortcut " + fileShortcut.getPrimaryKey(), pe); } }