Skip to content

Commit

Permalink
Fix checkstyle - Kitodo-Core
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-ronge committed Aug 30, 2024
1 parent 395b1b4 commit 28a6e69
Show file tree
Hide file tree
Showing 68 changed files with 114 additions and 133 deletions.
4 changes: 2 additions & 2 deletions Kitodo/src/main/java/org/kitodo/config/ConfigProject.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

package org.kitodo.config;

import de.unigoettingen.sub.search.opac.ConfigOpac;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
Expand All @@ -34,6 +32,8 @@
import org.kitodo.exceptions.DoctypeMissingException;
import org.kitodo.production.process.field.AdditionalField;

import de.unigoettingen.sub.search.opac.ConfigOpac;

public class ConfigProject {

private static final Logger logger = LogManager.getLogger(ConfigProject.class);
Expand Down
4 changes: 2 additions & 2 deletions Kitodo/src/main/java/org/kitodo/export/XsltHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;

import net.sf.saxon.TransformerFactoryImpl;

import org.apache.commons.io.FilenameUtils;
import org.kitodo.config.ConfigCore;
import org.kitodo.config.enums.ParameterCore;
import org.kitodo.data.database.beans.Process;

import net.sf.saxon.TransformerFactoryImpl;

public class XsltHelper {

private XsltHelper() {
Expand Down
17 changes: 17 additions & 0 deletions Kitodo/src/main/java/org/kitodo/production/dto/ProjectDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,14 @@ public void setHasProcesses(boolean hasProcesses) {
this.hasProcesses = hasProcesses;
}

/**
* Returns the start time of the project. {@link Date} is a specific instant
* in time, with millisecond precision. It is a freely configurable value,
* not the date the project object was created in the database. This can be,
* for example, the start of the funding period.
*
* @return the start time
*/
public Date getStartDate() {
try {
return StringUtils.isNotBlank(this.startDate) ? new SimpleDateFormat(BaseBean.DATE_FORMAT).parse(this.startDate)
Expand All @@ -298,6 +306,15 @@ public void setStartDate(Date startDate) {
this.startDate = Objects.nonNull(startDate) ? new SimpleDateFormat(BaseBean.DATE_FORMAT).format(startDate) : null;
}

/**
* Returns the project end time. {@link Date} is a specific instant in time,
* with millisecond precision. This is a freely configurable value,
* regardless of when the project was last actually worked on. For example,
* this can be the time at which the project must be completed in order to
* be billed. The timing can be used to monitor that the project is on time.
*
* @return the end time
*/
public Date getEndDate() {
try {
return StringUtils.isNotBlank(this.endDate) ? new SimpleDateFormat(BaseBean.DATE_FORMAT).parse(this.endDate) : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ public void setCreationTime(String creationDate) {
this.creationDate = creationDate;
}

/**
* Returns the creation time of the property. {@link Date} is a specific
* instant in time, with millisecond precision.
*
* @return the creation time
*/
public Date getCreationDate() {
try {
return StringUtils.isNotBlank(this.creationDate)
Expand Down
23 changes: 23 additions & 0 deletions Kitodo/src/main/java/org/kitodo/production/dto/TaskDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,13 @@ public void setCorrectionCommentStatus(Integer status) {
this.correctionCommentStatus = status;
}

/**
* Returns the time the task status was last changed. This references
* <i>any</i> activity on the task that involves a change in status.
* {@link Date} is a specific instant in time, with millisecond precision.
*
* @return the time the task status was last changed
*/
public Date getProcessingTime() {
try {
return StringUtils.isNotBlank(this.processingTime)
Expand All @@ -525,6 +532,11 @@ public void setProcessingTime(Date processingTime) {
: null;
}

/**
* Returns the time when the task was accepted for processing.
*
* @return the time when the task was accepted for processing
*/
public Date getProcessingBegin() {
try {
return StringUtils.isNotBlank(this.processingBegin)
Expand All @@ -535,12 +547,23 @@ public Date getProcessingBegin() {
}
}

/**
* Sets the time the task was accepted for processing.
*
* @param processingBegin
* time to set
*/
public void setProcessingBegin(Date processingBegin) {
this.processingBegin = Objects.nonNull(processingBegin)
? new SimpleDateFormat(BaseBean.DATE_FORMAT).format(processingBegin)
: null;
}

/**
* Returns the time when the task was completed.
*
* @return the time when the task was completed
*/
public Date getProcessingEnd() {
try {
return StringUtils.isNotBlank(this.processingEnd)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import javax.inject.Named;

import org.kitodo.data.database.beans.Comment;
import org.kitodo.data.database.exceptions.DAOException;
import org.kitodo.data.database.beans.Process;
import org.kitodo.data.database.beans.Task;
import org.kitodo.data.database.exceptions.DAOException;
import org.kitodo.production.helper.Helper;
import org.kitodo.production.services.ServiceManager;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import org.kitodo.data.database.enums.TaskStatus;
import org.kitodo.data.database.exceptions.DAOException;
import org.kitodo.data.exceptions.DataException;
import org.kitodo.data.database.beans.Task;
import org.kitodo.export.ExportDms;
import org.kitodo.export.TiffHeader;
import org.kitodo.production.enums.GenerationMode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.kitodo.data.database.exceptions.DAOException;
import org.kitodo.data.exceptions.DataException;
import org.kitodo.data.database.beans.Process;
import org.kitodo.data.database.beans.Project;
import org.kitodo.data.database.beans.Task;
import org.kitodo.data.database.exceptions.DAOException;
import org.kitodo.data.exceptions.DataException;
import org.kitodo.exceptions.ProjectDeletionException;
import org.kitodo.production.enums.ObjectType;
import org.kitodo.production.helper.Helper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.kitodo.data.database.beans.Client;
import org.kitodo.data.database.beans.User;
import org.kitodo.data.database.exceptions.DAOException;
import org.kitodo.data.exceptions.DataException;
import org.kitodo.production.controller.SessionClientController;
import org.kitodo.production.security.CustomLoginSuccessHandler;
import org.kitodo.production.services.ServiceManager;
import org.kitodo.production.services.security.SecurityAccessService;
import org.primefaces.PrimeFaces;

@Named("LoginForm")
@SessionScoped
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
import org.kitodo.data.database.enums.TaskStatus;
import org.kitodo.data.database.exceptions.DAOException;
import org.kitodo.data.exceptions.DataException;
import org.kitodo.data.database.beans.Process;
import org.kitodo.data.database.beans.Task;
import org.kitodo.exceptions.InvalidImagesException;
import org.kitodo.exceptions.MediaNotFoundException;
import org.kitodo.production.controller.SecurityAccessController;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import org.kitodo.data.database.beans.Process;
import org.kitodo.data.database.exceptions.DAOException;
import org.kitodo.data.exceptions.DataException;
import org.kitodo.data.database.beans.Process;
import org.kitodo.export.ExportDms;
import org.kitodo.production.enums.ChartMode;
import org.kitodo.production.enums.ObjectType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
import org.kitodo.data.database.enums.PreviewHoverMode;
import org.kitodo.data.database.exceptions.DAOException;
import org.kitodo.data.exceptions.DataException;
import org.kitodo.data.database.beans.Project;
import org.kitodo.data.database.beans.Template;
import org.kitodo.exceptions.ProjectDeletionException;
import org.kitodo.forms.FolderGenerator;
import org.kitodo.production.controller.SecurityAccessController;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.kitodo.data.database.beans.Process;
import org.kitodo.data.database.beans.Project;
import org.kitodo.data.database.beans.Task;
import org.kitodo.data.database.enums.TaskStatus;
import org.kitodo.data.database.exceptions.DAOException;
import org.kitodo.data.exceptions.DataException;
import org.kitodo.data.database.beans.Process;
import org.kitodo.data.database.beans.Project;
import org.kitodo.data.database.beans.Task;
import org.kitodo.production.enums.ObjectType;
import org.kitodo.production.helper.Helper;
import org.kitodo.production.services.ServiceManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
import org.kitodo.data.database.enums.TaskStatus;
import org.kitodo.data.database.exceptions.DAOException;
import org.kitodo.data.exceptions.DataException;
import org.kitodo.data.database.beans.Project;
import org.kitodo.production.enums.ObjectType;
import org.kitodo.production.filters.FilterMenu;
import org.kitodo.production.forms.dataeditor.GalleryViewMode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import org.kitodo.data.database.beans.Template;
import org.kitodo.data.database.exceptions.DAOException;
import org.kitodo.data.exceptions.DataException;
import org.kitodo.data.database.beans.Process;
import org.kitodo.exceptions.CommandException;
import org.kitodo.exceptions.InvalidMetadataValueException;
import org.kitodo.exceptions.NoSuchMetadataFieldException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.kitodo.data.database.beans.Project;
import org.kitodo.data.database.beans.Template;
import org.kitodo.data.database.exceptions.DAOException;
import org.kitodo.data.database.beans.Template;
import org.kitodo.production.enums.ObjectType;
import org.kitodo.production.helper.Helper;
import org.kitodo.production.services.ServiceManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import org.kitodo.data.database.beans.Process;
import org.kitodo.data.database.exceptions.DAOException;
import org.kitodo.data.exceptions.DataException;
import org.kitodo.data.database.beans.Process;
import org.kitodo.production.helper.Helper;
import org.kitodo.production.metadata.MetadataEditor;
import org.kitodo.production.services.ServiceManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import org.kitodo.data.database.beans.Process;
import org.kitodo.data.database.exceptions.DAOException;
import org.kitodo.data.exceptions.DataException;
import org.kitodo.data.database.beans.Process;
import org.kitodo.exceptions.InvalidMetadataValueException;
import org.kitodo.exceptions.NoSuchMetadataFieldException;
import org.kitodo.exceptions.UnknownTreeNodeDataException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.kitodo.api.dataformat.View;
import org.kitodo.config.ConfigCore;
import org.kitodo.config.enums.ParameterCore;
import org.kitodo.data.database.beans.User;
import org.kitodo.exceptions.InvalidImagesException;
import org.kitodo.exceptions.InvalidMetadataValueException;
import org.kitodo.exceptions.MediaNotFoundException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import java.util.Objects;
import java.util.Optional;
import java.util.ResourceBundle;
import java.util.regex.Pattern;

import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.kitodo.data.database.beans.Process;
import org.kitodo.data.database.beans.Process;
import org.kitodo.production.services.ServiceManager;
import org.kitodo.production.services.data.BeanQuery;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import static java.lang.Math.toIntExact;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
Expand All @@ -24,12 +23,9 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.hibernate.exception.SQLGrammarException;
import org.kitodo.config.ConfigMain;
import org.kitodo.data.database.beans.BaseBean;
import org.kitodo.data.database.exceptions.DAOException;
import org.kitodo.data.elasticsearch.exceptions.CustomResponseException;
import org.kitodo.data.exceptions.DataException;
import org.kitodo.data.database.beans.BaseBean;
import org.kitodo.exceptions.FilterException;
import org.kitodo.production.services.data.FilterService;
import org.kitodo.production.services.data.base.SearchDatabaseService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

package org.kitodo.production.process;

import de.unigoettingen.sub.search.opac.ConfigOpac;
import de.unigoettingen.sub.search.opac.ConfigOpacDoctype;

import java.io.IOException;
import java.net.URI;
import java.time.LocalDate;
Expand Down Expand Up @@ -67,6 +64,9 @@
import org.kitodo.production.services.dataformat.MetsService;
import org.kitodo.production.services.file.FileService;

import de.unigoettingen.sub.search.opac.ConfigOpac;
import de.unigoettingen.sub.search.opac.ConfigOpacDoctype;

/**
* A generator for newspaper processes.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

package org.kitodo.production.process;

import de.unigoettingen.sub.search.opac.ConfigOpac;
import de.unigoettingen.sub.search.opac.ConfigOpacDoctype;

import java.io.FileNotFoundException;
import java.text.MessageFormat;
import java.util.List;
Expand All @@ -25,6 +22,9 @@
import org.kitodo.production.helper.Helper;
import org.kitodo.production.services.data.ImportService;

import de.unigoettingen.sub.search.opac.ConfigOpac;
import de.unigoettingen.sub.search.opac.ConfigOpacDoctype;

public class TiffHeaderGenerator extends Generator {

private static final String ERROR_READ = "errorReading";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.kitodo.data.database.exceptions.DAOException;
import org.kitodo.data.exceptions.DataException;
import org.kitodo.production.controller.SessionClientController;
import org.kitodo.production.services.ServiceManager;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.DefaultRedirectStrategy;
import org.springframework.security.web.RedirectStrategy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

package org.kitodo.production.services.command;

import io.reactivex.Flowable;
import io.reactivex.schedulers.Schedulers;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
Expand All @@ -24,6 +21,9 @@
import org.kitodo.api.command.CommandResult;
import org.kitodo.serviceloader.KitodoServiceLoader;

import io.reactivex.Flowable;
import io.reactivex.schedulers.Schedulers;

public class CommandService {
private final CommandInterface commandModule;
private final ArrayList<CommandResult> finishedCommandResults = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,14 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.kitodo.data.database.beans.BaseBean;
import org.kitodo.data.database.beans.Filter;
import org.kitodo.data.database.beans.Project;
import org.kitodo.data.database.beans.User;
import org.kitodo.data.database.enums.TaskStatus;
import org.kitodo.data.database.exceptions.DAOException;
import org.kitodo.data.database.persistence.FilterDAO;
import org.kitodo.data.exceptions.DataException;
import org.kitodo.data.database.beans.BaseBean;
import org.kitodo.data.database.beans.Project;
import org.kitodo.production.enums.FilterString;
import org.kitodo.production.helper.Helper;
import org.kitodo.production.services.ServiceManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
import org.kitodo.data.database.enums.TaskStatus;
import org.kitodo.data.database.exceptions.DAOException;
import org.kitodo.data.exceptions.DataException;
import org.kitodo.data.database.beans.Process;
import org.kitodo.exceptions.CatalogException;
import org.kitodo.exceptions.CommandException;
import org.kitodo.exceptions.ConfigException;
Expand Down
Loading

0 comments on commit 28a6e69

Please sign in to comment.