-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'matthias-ronge-issue_286' into 1.11.x
- Loading branch information
Showing
14 changed files
with
177 additions
and
18 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,7 +76,7 @@ | |
* | ||
* @author Matthias Ronge <[email protected]> | ||
*/ | ||
public class CreateNewspaperProcessesTask extends EmptyTask { | ||
public class CreateNewspaperProcessesTask extends EmptyTask implements INameableTask { | ||
|
||
/** | ||
* The field batchLabel is set in addToBatches() on the first function call | ||
|
@@ -451,6 +451,16 @@ private void flushLogisticsBatch(String processTitle) throws DAOException { | |
batchLabel = null; | ||
} | ||
|
||
/** | ||
* Returns the display name of the task to show to the user. | ||
* | ||
* @see de.sub.goobi.helper.tasks.INameableTask#getDisplayName() | ||
*/ | ||
@Override | ||
public String getDisplayName() { | ||
return Helper.getTranslation("CreateNewspaperProcessesTask"); | ||
} | ||
|
||
/** | ||
* The method saveFullBatch() sets the title for the allover batch and saves | ||
* it to hibernate. | ||
|
@@ -498,4 +508,5 @@ private String firstGroupFrom(String s) { | |
public CreateNewspaperProcessesTask clone() { | ||
return new CreateNewspaperProcessesTask(this); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,7 @@ | |
* | ||
* @author Matthias Ronge <[email protected]> | ||
*/ | ||
public class EmptyTask extends Thread implements Cloneable { | ||
public class EmptyTask extends Thread implements Cloneable, INameableTask { | ||
/** | ||
* The enum Actions lists the available instructions to the housekeeper what | ||
* to do with a terminated thread. These are: | ||
|
@@ -209,6 +209,16 @@ Behaviour getBehaviour() { | |
return behaviour; | ||
} | ||
|
||
/** | ||
* Returns the display name of the task to show to the user. | ||
* | ||
* @see de.sub.goobi.helper.tasks.INameableTask#getDisplayName() | ||
*/ | ||
@Override | ||
public String getDisplayName() { | ||
return Helper.getTranslation("EmptyTask"); | ||
} | ||
|
||
/** | ||
* The function getDurationDead() returns the duration the task is dead. If | ||
* a time of death has not yet been recorded, null is returned. | ||
|
@@ -457,7 +467,7 @@ public void setException(Throwable exception) { | |
*/ | ||
protected void setNameDetail(String detail) { | ||
StringBuilder composer = new StringBuilder(119); | ||
composer.append(Helper.getTranslation(getClass().getSimpleName())); | ||
composer.append(((INameableTask) this).getDisplayName()); | ||
if (detail != null) { | ||
composer.append(": "); | ||
composer.append(detail); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ | |
|
||
import de.sub.goobi.beans.Prozess; | ||
import de.sub.goobi.export.dms.ExportDms; | ||
import de.sub.goobi.helper.Helper; | ||
|
||
/** | ||
* The class ExportDmsTask accepts an {@link de.sub.goobi.export.dms.ExportDms} | ||
|
@@ -49,7 +50,7 @@ | |
* | ||
* @author Matthias Ronge <[email protected]> | ||
*/ | ||
public class ExportDmsTask extends EmptyTask { | ||
public class ExportDmsTask extends EmptyTask implements INameableTask { | ||
|
||
private final ExportDms exportDms; | ||
private final Prozess process; | ||
|
@@ -86,6 +87,16 @@ private ExportDmsTask(ExportDmsTask source) { | |
this.userHome = source.userHome; | ||
} | ||
|
||
/** | ||
* Returns the display name of the task to show to the user. | ||
* | ||
* @see de.sub.goobi.helper.tasks.INameableTask#getDisplayName() | ||
*/ | ||
@Override | ||
public String getDisplayName() { | ||
return Helper.getTranslation("ExportDmsTask"); | ||
} | ||
|
||
/** | ||
* If the task is started, it will execute this run() method which will | ||
* start the export on the ExportDms. This task instance is passed in | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,7 @@ | |
import de.sub.goobi.config.ConfigMain; | ||
import de.sub.goobi.export.dms.ExportDms; | ||
import de.sub.goobi.forms.LoginForm; | ||
import de.sub.goobi.helper.Helper; | ||
import de.sub.goobi.helper.exceptions.DAOException; | ||
import de.sub.goobi.helper.exceptions.SwapException; | ||
|
||
|
@@ -73,7 +74,7 @@ | |
* | ||
* @author Matthias Ronge <[email protected]> | ||
*/ | ||
public class ExportSerialBatchTask extends EmptyTask { | ||
public class ExportSerialBatchTask extends EmptyTask implements INameableTask { | ||
|
||
/** | ||
* The batch to export | ||
|
@@ -119,6 +120,16 @@ public ExportSerialBatchTask(Batch batch) { | |
initialiseRuleSets(batch.getProcesses()); | ||
} | ||
|
||
/** | ||
* Returns the display name of the task to show to the user. | ||
* | ||
* @see de.sub.goobi.helper.tasks.INameableTask#getDisplayName() | ||
*/ | ||
@Override | ||
public String getDisplayName() { | ||
return Helper.getTranslation("ExportSerialBatchTask"); | ||
} | ||
|
||
/** | ||
* Initialises the the rule sets of the processes to export that export | ||
* depends on. This cannot be done later because the therad doesn’t have | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** | ||
* This file is part of the Goobi Application - a Workflow tool for the support | ||
* of mass digitization. | ||
* | ||
* (c) 2015 Goobi. Digitalisieren im Verein e.V. <[email protected]> | ||
* | ||
* Visit the websites for more information. | ||
* - http://www.goobi.org/en/ | ||
* - https://github.com/goobi | ||
* | ||
* This program is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License as published by the Free Software | ||
* Foundation; either version 2 of the License, or (at your option) any later | ||
* version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
* Place, Suite 330, Boston, MA 02111-1307 USA | ||
* | ||
* Linking this library statically or dynamically with other modules is making a | ||
* combined work based on this library. Thus, the terms and conditions of the | ||
* GNU General Public License cover the whole combination. As a special | ||
* exception, the copyright holders of this library give you permission to link | ||
* this library with independent modules to produce an executable, regardless of | ||
* the license terms of these independent modules, and to copy and distribute | ||
* the resulting executable under terms of your choice, provided that you also | ||
* meet, for each linked independent module, the terms and conditions of the | ||
* license of that module. An independent module is a module which is not | ||
* derived from or based on this library. If you modify this library, you may | ||
* extend this exception to your version of the library, but you are not obliged | ||
* to do so. If you do not wish to do so, delete this exception statement from | ||
* your version. | ||
*/ | ||
package de.sub.goobi.helper.tasks; | ||
|
||
/** | ||
* A task implementing this interface provides its readable name by a method | ||
* caal. | ||
* | ||
* @author Matthias Ronge <[email protected]> | ||
*/ | ||
public interface INameableTask { | ||
|
||
/** | ||
* Returns the display name of the task to show to the user. | ||
*/ | ||
String getDisplayName(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.