Changeset 3480
- Timestamp:
- Jun 13, 2007, 12:39:31 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/common-queries.xml
r3467 r3480 2580 2580 </query> 2581 2581 2582 <query id="SET_REMOVE_JOB_ON_JOBS" type="HQL"> 2583 <sql> 2584 UPDATE JobData j 2585 SET j.removeJobWhenFinished = false 2586 WHERE j.removeJobWhenFinished IS NULL 2587 </sql> 2588 <description> 2589 A HQL query that sets the deleteJobWhenFinished to false 2590 on all jobs with a null value. 2591 </description> 2592 </query> 2593 2582 2594 <query id="GET_INTERNAL_FILES_WITH_NO_LAST_UPDATE" type="HQL"> 2583 2595 <sql> -
trunk/src/core/net/sf/basedb/core/Install.java
r3467 r3480 102 102 method. 103 103 */ 104 public static final int NEW_SCHEMA_VERSION = 3 2;104 public static final int NEW_SCHEMA_VERSION = 33; 105 105 106 106 public static synchronized void createTables(boolean update, final ProgressReporter progress) -
trunk/src/core/net/sf/basedb/core/Job.java
r2981 r3480 35 35 import net.sf.basedb.core.plugin.Request; 36 36 import net.sf.basedb.core.plugin.Response; 37 import net.sf.basedb.core.plugin.Plugin.MainType; 37 38 38 39 import java.util.Collection; … … 131 132 jobData.setCreated(new Date()); 132 133 jobData.setSendMessage(true); 134 jobData.setRemoveJobWhenFinished(false); 133 135 return j; 134 136 } … … 379 381 checkPermission(Permission.WRITE); 380 382 getData().setSendMessage(sendMessage); 383 } 384 385 /** 386 If the job should be deleted after it's done successfully 387 */ 388 public boolean getRemoveJobWhenFinished() 389 { 390 return getData().getRemoveJobWhenFinished(); 391 } 392 393 /** 394 Set if the job should be deleted after it has finished successfully. 395 @throws PermissionDeniedException If the logged in user doesn't have 396 write permission 397 */ 398 public void setRemoveJobWhenFinished(boolean removeJobWhenFinished) 399 { 400 checkPermission(Permission.WRITE); 401 getData().setRemoveJobWhenFinished(removeJobWhenFinished); 381 402 } 382 403 … … 1208 1229 { 1209 1230 job.doneOk(response.getMessage()); 1231 PluginDefinition pd = null; 1232 boolean isImportOrExport = false; 1233 try 1234 { 1235 pd = job.getPluginDefinition(); 1236 MainType pluginMainType = pd.getMainType(); 1237 isImportOrExport = pluginMainType.equals(MainType.EXPORT) || (pluginMainType.equals(MainType.IMPORT)); 1238 } 1239 catch(PermissionDeniedException pex) 1240 { 1241 isImportOrExport = false; 1242 } 1243 job.setRemoved(job.getRemoveJobWhenFinished() && isImportOrExport); 1210 1244 } 1211 1245 dc.commit(); -
trunk/src/core/net/sf/basedb/core/Update.java
r3467 r3480 385 385 The update sets the <code>isDefault</code> value to false for all existing 386 386 groups and roles with a null value. 387 </td> 388 </tr> 389 390 <tr> 391 <td>33</td> 392 <td> 393 <ul> 394 <li>Added {@link net.sf.basedb.core.data.JobData#getDeleteJobWhenFinished()}. 395 </ul> 396 The update sets the <code>deleteJobWhenFinished</code> value to false for all existing jobs. 387 397 </td> 388 398 </tr> … … 558 568 schemaVersion = setSchemaVersionInTransaction(session, 32); 559 569 } 560 561 570 571 if (schemaVersion < 33) 572 { 573 if (progress != null) progress.display((int)(32*progress_factor), "--Updating schema version: " + schemaVersion + " -> 33..."); 574 schemaVersion = setSchemaVersionInTransaction(session, 33); 575 } 562 576 /* 563 if (schemaVersion < 3 3)564 { 565 if (progress != null) progress.display((int)(3 2*progress_factor), "--Updating schema version: " + schemaVersion + " -> 33...");566 schemaVersion = setSchemaVersionInTransaction(session, 3 3);577 if (schemaVersion < 34) 578 { 579 if (progress != null) progress.display((int)(33*progress_factor), "--Updating schema version: " + schemaVersion + " -> 34..."); 580 schemaVersion = setSchemaVersionInTransaction(session, 34); 567 581 - or - 568 schemaVersion = updateToSchemaVersion3 3(session);582 schemaVersion = updateToSchemaVersion34(session); 569 583 } 570 584 ... etc... … … 1514 1528 } 1515 1529 1530 if (schemaVersion < 33) 1531 { 1532 // Set delete_job to false for jobs with null value 1533 org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session, 1534 "SET_REMOVE_JOB_ON_JOBS"); 1535 /* 1536 UPDATE JobData j 1537 SET j.removeJobWhenFinished = false 1538 WHERE j.removeJobWhenFinished IS NULL 1539 */ 1540 HibernateUtil.executeUpdate(query); 1541 } 1542 1516 1543 // Commit the changes 1517 1544 HibernateUtil.commit(tx); -
trunk/src/core/net/sf/basedb/core/data/JobData.java
r2962 r3480 157 157 } 158 158 159 private boolean removeJobWhenFinished; 160 /** 161 If the core should delete the job when it's finished successfully. 162 @hibernate.property column="`remove_job`" type="boolean" not-null="true" 163 */ 164 public boolean getRemoveJobWhenFinished() 165 { 166 return removeJobWhenFinished; 167 } 168 public void setRemoveJobWhenFinished(boolean removeJobWhenFinished) 169 { 170 this.removeJobWhenFinished = removeJobWhenFinished; 171 } 172 159 173 private int status; 160 174 /** -
trunk/www/common/plugin/finish_job.jsp
r2978 r3480 65 65 PluginConfiguration pluginConfig = job.getPluginConfiguration(); // (PluginConfiguration)sc.getSessionSetting("plugin.configure.config"); 66 66 boolean sendMessage = Values.getBoolean(sc.getUserClientSetting("plugins.sendmessage"), true); 67 boolean removeJobWhenFinished = Values.getBoolean(sc.getUserClientSetting("plugins.removejob"), false); 67 68 %> 68 69 <base:page type="popup" title="Set job name and options"> … … 93 94 <td class="prompt">Plugin</td> 94 95 <td><%=HTML.encodeTags(plugin.getName())%></td> 95 </td>96 96 </tr> 97 97 <tr valign="top" id="configurations"> … … 107 107 </td> 108 108 </tr> 109 <tr valign= top>109 <tr valign="top"> 110 110 <td class="prompt">Job description</td> 111 111 <td nowrap> … … 125 125 </tr> 126 126 127 <tr> 128 <td class="prompt">Remove job</td> 129 <% 130 if (plugin.getMainType().equals(Plugin.MainType.EXPORT) || 131 plugin.getMainType().equals(Plugin.MainType.IMPORT)) 132 { 133 %> 134 <td> 135 <input type="checkbox" name="remove_job" value="1" <%=removeJobWhenFinished ? "checked" : "" %>> 136 <a href="javascript:document.forms['plugin'].remove_job.click();">Remove job when finished</a> 137 </td> 138 <% 139 } 140 else 141 { 142 %> 143 <td><i>- n/a -</i></td> 144 <% 145 } 146 %> 147 </tr> 148 127 149 </table> 128 150 <div align=right> <i><base:icon image="required.gif" /> = required information</i></div> -
trunk/www/common/plugin/index.jsp
r3438 r3480 475 475 job.setDescription(Values.getStringOrNull(request.getParameter("description"))); 476 476 job.setSendMessage(Values.getBoolean(request.getParameter("send_message"))); 477 job.setRemoveJobWhenFinished(Values.getBoolean(request.getParameter("remove_job"))); 477 478 dc.saveItem(job); 478 479 if (pluginResponse != null) pluginResponse.saveParameters(dc); -
trunk/www/my_base/user/preferences.jsp
r3220 r3480 431 431 </td> 432 432 </tr> 433 <tr> 434 <td class="prompt">Remove jobs</td> 435 <td> 436 <% 437 boolean removeJobWhenFinished = Values.getBoolean(sc.getUserClientSetting("plugins.removejob"), false); 438 %> 439 <input type="checkbox" name="removejob" value="1" <%=removeJobWhenFinished ? "checked" : "" %>> 440 <a href="javascript:document.forms['preferences'].removejob.click();">Remove import and export jobs when they are finished.</a> 441 </td> 442 </tr> 433 443 </table> 434 444 </t:tab> -
trunk/www/my_base/user/submit_user.jsp
r3190 r3480 131 131 132 132 sc.setUserClientSetting("plugins.sendmessage", Values.getString(request.getParameter("sendmessage"), "0")); 133 sc.setUserClientSetting("plugins.removejob", Values.getString(request.getParameter("removejob"), "0")); 133 134 String[] mostRecent = request.getParameterValues("enabled"); 134 135 sc.setUserClientSetting("menu.mostRecent",
Note: See TracChangeset
for help on using the changeset viewer.