Eclipseplugins
RunCommonPaProgram.java
1 package com.proalpha.pds.paconnector;
2 
3 import java.io.File;
4 import java.util.Hashtable;
5 
6 import org.eclipse.core.resources.IFolder;
7 import org.eclipse.core.runtime.Path;
8 
9 import com.proalpha.pds.exception.ProALPHANotAvailableException;
10 
11 public class RunCommonPaProgram extends RunProgramInPa {
12 
14  super(paProject);
15  }
16 
17  public void startCompiler(Boolean isSilent) {
18  String programName = "d__cmp00.w";
19 
20  if (isSilent) {
21  runProgram(programName, "Silent=yes", "", "");
22  } else {
23  runProgram(programName);
24  }
25  }
26 
27  public void startCompilerOpt(String inputfile, Boolean checkSourcecode) {
28 
29  this.setStartParameter("Lastprocedure", inputfile);
30 
31  if (checkSourcecode)
32  this.setStartParameter("CompCheckSourceCode", checkSourcecode.toString());
33 
34  runProgram("d__cmp00.w", "", "", "");
35  }
36 
37  public void startDBExplorer() {
38  runProgram("deidb_00.w");
39  }
40 
41  public void startProALPHAMainMenu() {
42  runProgram("b__pa_10.dyn");
43  }
44 
45  public void startRepositoryClasses(String fileName) {
46  runProgram("drpcls10.dyn", fileName, "", "");
47  }
48 
49  public void startMenuDesigner(String fileName) {
50  runProgram("dbpmen10.dyn", fileName, "", "");
51  }
52 
53  public void startAbTools() {
54  runProgram("d_tuib00.w");
55  }
56 
57  public void startShowPersistenProcedure() {
58  runExternalProcedurePersistent("protools/_ppmgr.w");
59  }
60 
61  public void runProgram(String programName) {
62  runProgram(programName, "", "", "");
63  }
64 
65  public void runProgram(String programName, String parameterString, String attributeList, String options) {
66  runSupportProcedure("ds_oea08.p", programName, parameterString, attributeList, options);
67  }
68 
69  public void refreshChache() {
70  runSupportProcedure("ds_oea09.p");
71  }
72 
73  public String scanObjects(String csvCheckList) {
74  return runSupportProcedure("ds_oea34.p", csvCheckList);
75  }
76 
77  public String getInstanceObj(String fileName) {
78  return runSupportProcedure("ds_oea48.p", fileName, "DRC_Instance_Obj");
79  }
80 
81  public File createMissingTriggersXMLFile() {
82  String path = runSupportProcedure("ds_oea30.p");
83  return new File(path);
84  }
85 
86  public void openPDOInRepository(String pdoName) {
87  runSupportProcedure("ds_oea01.p", pdoName);
88 
89  }
90 
91  public boolean isQueueServerAvailable() {
92  return runSupportProcedure("ds_oea33.p").equals("yes");
93  }
94 
95  // set a startparameter in the pA Session. Not all Params can be set.
96  public void setStartParameter(String parameterName, String parameterValue) {
97  runSupportProcedure("ds_oea62.p", parameterName, parameterValue);
98  }
99 
100  // calls every program in the pA Session
101  public String callPersistentProgProcedure(String programm, String procedurename, String... parameter) {
102  String fullpath;
103 
104  // get path informations of program
105  if (programm.contains("/")) {
106  fullpath = programm;
107  } else {
108  fullpath = this.callFunctionInService("adm/method/proc/dmcdev00.p", "pa_cDevelObjectRelativePath",
109  programm);
110  }
111  // Call the procedure and return the result
112  return this.callFunctionInService(fullpath, procedurename, parameter);
113  }
114 
123  protected IFolder getFolderInProjectFS(String folder) {
124 
125  return this.paProject.getOeProject().getProject().getFolder(new Path(folder).lastSegment());
126  }
127 
138  protected String getRecordField(String tableName, Hashtable<String, String> selection, String fieldName) {
139 
140  return recordField(tableName, selection, fieldName);
141 
142  }
143 
144 }
String getRecordField(String tableName, Hashtable< String, String > selection, String fieldName)
String runExternalProcedurePersistent(String procedure, String... parameters)
String runSupportProcedure(String supportProcedure, String... parameters)
String callFunctionInService(String service, String functionName, String... parameters)
String recordField(String tableName, Hashtable< String, String > selection, String fieldName)