1 package com.proalpha.pds.paconnector.userexit;
5 import org.eclipse.core.resources.IFolder;
6 import org.eclipse.core.resources.IResource;
7 import org.eclipse.core.runtime.CoreException;
8 import org.eclipse.core.runtime.IStatus;
9 import org.eclipse.core.runtime.NullProgressMonitor;
10 import org.eclipse.core.runtime.Status;
12 import com.proalpha.pds.exception.ProALPHANotAvailableException;
13 import com.proalpha.pds.paconnector.Activator;
14 import com.proalpha.pds.paconnector.PaProject;
15 import com.proalpha.pds.paconnector.RunCommonPaProgram;
16 import com.proalpha.pds.paconnector.parameter.StartparameterReader;
18 class UserExitDelegateImpl
extends RunCommonPaProgram implements UserExitDelegate {
20 private final StartparameterReader startparameterReader;
22 protected UserExitDelegateImpl(PaProject paProject, StartparameterReader startparameterReader)
23 throws ProALPHANotAvailableException {
25 this.startparameterReader = startparameterReader;
29 public File extractBalpFileToXMLFile(String balpFile)
throws Exception {
31 IFolder workingDirectory = startparameterReader.getWorkingDirectory();
33 if (!workingDirectory.exists())
34 throw new Exception(
"WorkingDirectory " + workingDirectory.getName()
35 +
" does not exist. Check setting in proALPHA Start Config.");
40 workingDirectory.refreshLocal(IResource.DEPTH_INFINITE,
new NullProgressMonitor());
41 }
catch (CoreException e) {
42 IStatus status =
new Status(Status.WARNING, Activator.PLUGIN_ID, e.getMessage(), e);
43 Activator.getDefault().getLog().log(status);
46 return new File(pathToXMLFile);
50 public File extractUserExitToXMLFile(UserExitInclude userExitInclude) {
52 userExitInclude.getIncludeType(), userExitInclude.getSourceFileName(), userExitInclude.getSortCase());
53 return new File(pahtToXMLFile);
57 public UserExitInclude getEmptyUserExitInclude() {
58 return new UserExitIncludeImpl();
String runSupportProcedure(String supportProcedure, String... parameters)