Changeset 5480
- Timestamp:
- Nov 8, 2010, 10:56:02 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/PluginResponse.java
r5405 r5480 58 58 private String message; 59 59 private boolean dryRun; 60 private String suggestedJobName; 60 61 private List<? extends Throwable> errorList; 61 62 private String nextCommand; … … 92 93 93 94 /** 95 Get the job name that was suggested by the job. 96 97 @return A job name or null if no name has been suggested 98 @since 2.17 99 */ 100 public String getSuggestedJobName() 101 { 102 return suggestedJobName; 103 } 104 105 /** 94 106 Get the return message from the plugin. 95 107 */ … … 312 324 PluginResponse.this.dryRun = dryRun; 313 325 } 326 327 @Override 328 public void setSuggestedJobName(String jobName) 329 { 330 PluginResponse.this.suggestedJobName = jobName; 331 } 314 332 // ------------------------------------------- 315 333 } -
trunk/src/core/net/sf/basedb/core/plugin/Response.java
r5405 r5480 143 143 144 144 /** 145 A plug-in may call this method on it's job configuration phase 146 to suggest a name for the job. Otherwise a default name will be 147 generated by the core. 148 @param jobName 149 @since 2.17 150 */ 151 public void setSuggestedJobName(String jobName); 152 153 /** 145 154 This will end the job execution or configuration and report it as a 146 155 failure. If in a configuration sequence the client application may try -
trunk/src/plugins/core/net/sf/basedb/plugins/ReporterFlatFileImporter.java
r5451 r5480 388 388 storeValue(job, request, reporterIsUsedErrorParameter); 389 389 390 File importFile = (File)job.getValue(fileParameter.getName()); 391 if (reporterListContext) 392 { 393 ReporterList reporterList = (ReporterList)job.getValue("reporterList"); 394 response.setSuggestedJobName("Import reporters to list '" + reporterList.getName() 395 + "' from '" + importFile.getName() + "'"); 396 } 397 else 398 { 399 response.setSuggestedJobName("Import reporters from '" + importFile.getName() + "'"); 400 } 390 401 response.setDone("Job configuration complete", Job.ExecutionTime.SHORT); 391 402 } -
trunk/src/plugins/core/net/sf/basedb/plugins/executor/ExternalProgramExecutor.java
r5405 r5480 1372 1372 {} 1373 1373 1374 1375 @Override 1376 public void setSuggestedJobName(String jobName) 1377 {} 1378 1374 1379 @Override 1375 1380 public void setError(String message, List<? extends Throwable> errorList) -
trunk/www/common/plugin/index.jsp
r5437 r5480 61 61 import="net.sf.basedb.core.Include" 62 62 import="net.sf.basedb.core.SimpleProgressReporter" 63 import="net.sf.basedb.core.StringUtil" 63 64 import="net.sf.basedb.core.query.Hql" 64 65 import="net.sf.basedb.core.query.Expressions" … … 484 485 if (job != null) 485 486 { 487 String suggestedJobName = pluginResponse.getSuggestedJobName(); 488 if (suggestedJobName != null) job.setName(StringUtil.trimString(suggestedJobName, Job.MAX_NAME_LENGTH)); 486 489 sc.setSessionSetting("plugin.configure.response", pluginResponse); 487 490 forward = "finish_job.jsp";
Note: See TracChangeset
for help on using the changeset viewer.