Search in sources :

Example 1 with KualiBatchFileAdminForm

use of org.kuali.kfs.sys.web.struts.KualiBatchFileAdminForm 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);
}
Also used : CreateDoneBatchFile(edu.cornell.kfs.sys.batch.CreateDoneBatchFile) BatchFile(org.kuali.kfs.sys.batch.BatchFile) KualiBatchFileAdminForm(org.kuali.kfs.sys.web.struts.KualiBatchFileAdminForm) CreateDoneBatchFile(edu.cornell.kfs.sys.batch.CreateDoneBatchFile) File(java.io.File) BatchFile(org.kuali.kfs.sys.batch.BatchFile)

Aggregations

CreateDoneBatchFile (edu.cornell.kfs.sys.batch.CreateDoneBatchFile)1 File (java.io.File)1 BatchFile (org.kuali.kfs.sys.batch.BatchFile)1 KualiBatchFileAdminForm (org.kuali.kfs.sys.web.struts.KualiBatchFileAdminForm)1