use of org.kuali.kfs.sys.batch.BatchFile in project cu-kfs by CU-CommunityApps.
the class CuBatchFileLookupableHelperServiceImpl method getSearchResults.
@Override
public List<? extends BusinessObject> getSearchResults(Map<String, String> fieldValues) {
List<BatchFile> results = new ArrayList<BatchFile>();
IOFileFilter filter = FileFilterUtils.fileFileFilter();
String fileNamePattern = fieldValues.get("fileName");
IOFileFilter fileNameBasedFilter = getFileNameBasedFilter(fileNamePattern);
if (fileNameBasedFilter != null) {
filter = FileFilterUtils.andFileFilter(filter, fileNameBasedFilter);
}
String lastModifiedDate = fieldValues.get("lastModifiedDate");
IOFileFilter lastModifiedDateBasedFilter = getLastModifiedDateBasedFilter(lastModifiedDate);
if (lastModifiedDateBasedFilter != null) {
filter = FileFilterUtils.andFileFilter(filter, lastModifiedDateBasedFilter);
}
BatchFileFinder finder = new BatchFileFinder(results, filter);
List<File> selectedDirectories = getSelectedDirectories(getSelectedPaths());
if (selectedDirectories.isEmpty()) {
List<File> rootDirectories = retrieveRootDirectories();
finder.find(rootDirectories);
} else {
finder.find(selectedDirectories);
}
return results;
}
use of org.kuali.kfs.sys.batch.BatchFile in project cu-kfs by CU-CommunityApps.
the class CreateDoneKualiBatchFileAdminAction method createDone.
public ActionForward createDone(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
KualiBatchFileAdminForm fileAdminForm = (KualiBatchFileAdminForm) form;
String filePath = BatchFileUtils.resolvePathToAbsolutePath(fileAdminForm.getFilePath());
File file = new File(filePath).getAbsoluteFile();
BatchFile batchFile = new BatchFile();
batchFile.setFile(file);
if (!SpringContext.getBean(CreateDoneBatchFileAuthorizationService.class).canCreateDoneFile(batchFile, GlobalVariables.getUserSession().getPerson())) {
throw new RuntimeException("Error: not authorized to create a .done file");
}
String status = createDoneFile(filePath);
request.setAttribute("status", status);
return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
use of org.kuali.kfs.sys.batch.BatchFile in project cu-kfs by CU-CommunityApps.
the class CreateDoneBatchFileLookupableHelperServiceImpl method getCustomActionUrls.
@Override
public List<HtmlData> getCustomActionUrls(BusinessObject businessObject, List pkNames) {
List<HtmlData> links = new ArrayList<HtmlData>();
BatchFile batchFile = (BatchFile) businessObject;
if (canCreateDoneFile(batchFile)) {
links.add(getCreateDoneUrl(batchFile));
}
return links;
}
Aggregations