diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index be469dc888e..c03135b37bf 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -14,7 +14,7 @@ name: "CodeQL" on: push: pull_request: - branches: [ master ] + branches: [ main ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e4b88c595b8..d3f54021dee 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,10 +4,10 @@ name: CI # Controls when the action will run. on: - # Triggers the workflow on push and pull request events but only for pull_requests on the master branch + # Triggers the workflow on push and pull request events but only for pull_requests on the main branch push: pull_request: - branches: [ master ] + branches: [ main ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/Kitodo-API/src/main/java/org/kitodo/api/dataeditor/DataEditorInterface.java b/Kitodo-API/src/main/java/org/kitodo/api/dataeditor/DataEditorInterface.java index a6e9d24ba48..b9d17c9bf21 100644 --- a/Kitodo-API/src/main/java/org/kitodo/api/dataeditor/DataEditorInterface.java +++ b/Kitodo-API/src/main/java/org/kitodo/api/dataeditor/DataEditorInterface.java @@ -26,6 +26,7 @@ public interface DataEditorInterface { * The URI to the xml file to read. * @param xsltFileUri * The URI to the xsl file for transformation of old format goobi metadata files. + * @throws IOException if reading fails. */ void readData(URI xmlFileUri, URI xsltFileUri) throws IOException; diff --git a/Kitodo-API/src/main/java/org/kitodo/api/dataeditor/rulesetmanagement/MetadataViewWithValuesInterface.java b/Kitodo-API/src/main/java/org/kitodo/api/dataeditor/rulesetmanagement/MetadataViewWithValuesInterface.java index ef1d5c7e99a..ac2e65558ff 100644 --- a/Kitodo-API/src/main/java/org/kitodo/api/dataeditor/rulesetmanagement/MetadataViewWithValuesInterface.java +++ b/Kitodo-API/src/main/java/org/kitodo/api/dataeditor/rulesetmanagement/MetadataViewWithValuesInterface.java @@ -24,7 +24,7 @@ * for this key. If the key is a multiple choice, the values are grouped, hence * the list, otherwise the length of the list is always only one. Effectively, * the return type of - * {@link ComplexMetadataViewInterface#getSortedVisibleMetadatas(Collection, Collection)} + * {@link ComplexMetadataViewInterface#getSortedVisibleMetadata(Collection, Collection)} * is {@code List>>}. Since the key * must be repeatable if there is more than one value but the key is not a * multiple choice, a map would be an inappropriate choice at this point. diff --git a/Kitodo-API/src/main/java/org/kitodo/api/dataformat/MediaPartial.java b/Kitodo-API/src/main/java/org/kitodo/api/dataformat/MediaPartial.java index a6d825956c4..ccf472dc0e7 100644 --- a/Kitodo-API/src/main/java/org/kitodo/api/dataformat/MediaPartial.java +++ b/Kitodo-API/src/main/java/org/kitodo/api/dataformat/MediaPartial.java @@ -28,8 +28,7 @@ public class MediaPartial { * Constructs a media partial object. * * @param begin - * The begin as formatted time in form of - * {@link org.kitodo.production.helper.metadata.MediaPartialHelper#FORMATTED_TIME_PATTERN} + * The begin as formatted time. */ public MediaPartial(String begin) { this.begin = begin; @@ -39,11 +38,9 @@ public MediaPartial(String begin) { * Constructs a media partial object. * * @param begin - * The begin as formatted time in form of - * {@link org.kitodo.production.helper.metadata.MediaPartialHelper#FORMATTED_TIME_PATTERN} + * The begin as formatted time. * @param extent - * The extent as formatted time in form of - * {@link org.kitodo.production.helper.metadata.MediaPartialHelper#FORMATTED_TIME_PATTERN} + * The extent as formatted time. */ public MediaPartial(String begin, String extent) { this(begin); diff --git a/Kitodo-API/src/main/java/org/kitodo/api/filemanagement/FileManagementInterface.java b/Kitodo-API/src/main/java/org/kitodo/api/filemanagement/FileManagementInterface.java index 509d1ccd691..13ec50fa649 100644 --- a/Kitodo-API/src/main/java/org/kitodo/api/filemanagement/FileManagementInterface.java +++ b/Kitodo-API/src/main/java/org/kitodo/api/filemanagement/FileManagementInterface.java @@ -35,6 +35,7 @@ public interface FileManagementInterface { * @param file * if true it creates the file, if false it created directory * @return the URI of the new resource + * @throws IOException if file/folder could not be created */ URI create(URI parentFolderUri, String name, boolean file) throws IOException; @@ -44,6 +45,7 @@ public interface FileManagementInterface { * @param uri * the uri to write to * @return an writable OutputStream + * @throws IOException if uri could not be written */ OutputStream write(URI uri) throws IOException; @@ -53,6 +55,7 @@ public interface FileManagementInterface { * @param uri * the uri to write from * @return a readable InputStream + * @throws IOException if uri could not be read */ InputStream read(URI uri) throws IOException; @@ -63,6 +66,7 @@ public interface FileManagementInterface { * source file as uri * @param targetResource * destination file as uri + * @throws IOException if source could not be read or destination could not be written */ void copy(URI sourceResource, URI targetResource) throws IOException; @@ -72,6 +76,7 @@ public interface FileManagementInterface { * @param uri * the URI to delete * @return true if successful, false otherwise + * @throws IOException if uri could not be deleted */ boolean delete(URI uri) throws IOException; @@ -95,6 +100,7 @@ public interface FileManagementInterface { * @param newName * the new name of the resource * @return URI of renamed resource + * @throws IOException if uri could not be renamed */ URI rename(URI uri, String newName) throws IOException; @@ -114,6 +120,7 @@ public interface FileManagementInterface { * @param directory * URI to get size * @return size of directory as Long + * @throws IOException if getting the size of URI failed */ Long getSizeOfDirectory(URI directory) throws IOException; @@ -179,6 +186,7 @@ public interface FileManagementInterface { * @param processId * the id of the process * @return the URI to the process Location + * @throws IOException if the folder structure could not be created */ URI createProcessLocation(String processId) throws IOException; diff --git a/Kitodo-API/src/main/java/org/kitodo/config/OPACConfig.java b/Kitodo-API/src/main/java/org/kitodo/config/OPACConfig.java index 9510e1ca537..493d8e825b3 100644 --- a/Kitodo-API/src/main/java/org/kitodo/config/OPACConfig.java +++ b/Kitodo-API/src/main/java/org/kitodo/config/OPACConfig.java @@ -71,6 +71,7 @@ private OPACConfig() { * @param catalogName String identifying the catalog by title * @param parameter String identifying the parameter by name * @return value of parameter + * @throws ParameterNotFoundException if parameter was not found */ public static String getConfigValue(String catalogName, String parameter) throws ParameterNotFoundException { HierarchicalConfiguration opacConfiguration = getCatalog(catalogName); @@ -151,6 +152,7 @@ private static String getUrlConfigPart(String catalogName, String parameter) * Get host parameter of catalog configuration with name 'catalogName'. * @param catalogName name of catalog configuration * @return host value as String + * @throws MandatoryParameterMissingException if required parameter is missing */ public static String getHost(String catalogName) throws MandatoryParameterMissingException { return getUrlConfigPart(catalogName, HOST); @@ -160,6 +162,7 @@ public static String getHost(String catalogName) throws MandatoryParameterMissin * Get scheme parameter of catalog configuration with name 'catalogName'. * @param catalogName name of catalog configuration * @return scheme value as String + * @throws MandatoryParameterMissingException if required parameter is missing */ public static String getScheme(String catalogName) throws MandatoryParameterMissingException { return getUrlConfigPart(catalogName, SCHEME); @@ -169,6 +172,7 @@ public static String getScheme(String catalogName) throws MandatoryParameterMiss * Get path parameter of catalog configuration with name 'catalogName'. * @param catalogName name of catalog configuration * @return path value as String + * @throws MandatoryParameterMissingException if required parameter is missing */ public static String getPath(String catalogName) throws MandatoryParameterMissingException { return getUrlConfigPart(catalogName, PATH); @@ -178,6 +182,7 @@ public static String getPath(String catalogName) throws MandatoryParameterMissin * Get port parameter of catalog configuration with name 'catalogName'. * @param catalogName name of catalog configuration * @return port value as String + * @throws MandatoryParameterMissingException if required parameter is missing */ public static String getPort(String catalogName) throws MandatoryParameterMissingException { return getUrlConfigPart(catalogName, PORT); diff --git a/Kitodo-API/src/main/java/org/kitodo/config/enums/KitodoConfigFile.java b/Kitodo-API/src/main/java/org/kitodo/config/enums/KitodoConfigFile.java index ee200cd9903..d6beb5e9488 100644 --- a/Kitodo-API/src/main/java/org/kitodo/config/enums/KitodoConfigFile.java +++ b/Kitodo-API/src/main/java/org/kitodo/config/enums/KitodoConfigFile.java @@ -85,6 +85,7 @@ public String getAbsolutePath() { * @param name * of configuration file * @return File + * @throws FileNotFoundException if the configuration file is not found */ public static KitodoConfigFile getByName(String name) throws FileNotFoundException { for (KitodoConfigFile file : KitodoConfigFile.values()) { diff --git a/Kitodo-API/src/main/java/org/kitodo/exceptions/UnknownTreeNodeDataException.java b/Kitodo-API/src/main/java/org/kitodo/exceptions/UnknownTreeNodeDataException.java index f0093ae4611..868e0c62dc5 100644 --- a/Kitodo-API/src/main/java/org/kitodo/exceptions/UnknownTreeNodeDataException.java +++ b/Kitodo-API/src/main/java/org/kitodo/exceptions/UnknownTreeNodeDataException.java @@ -15,6 +15,7 @@ public class UnknownTreeNodeDataException extends RuntimeException { /** * Constructor with given parameter name for exception message. + * @param type String which describes the unexpected type */ public UnknownTreeNodeDataException(String type) { super("TreeNode contains data of unexpected type '" + type + "!"); diff --git a/Kitodo/src/main/resources/kitodo_config.properties b/Kitodo/src/main/resources/kitodo_config.properties index 9fe425ec510..eb22ba64d44 100644 --- a/Kitodo/src/main/resources/kitodo_config.properties +++ b/Kitodo/src/main/resources/kitodo_config.properties @@ -591,7 +591,7 @@ taskProcessPropertyColumns= # - the activeMQ.hostURL should use the ssl:// procotocol at least once # - you must provide the JKS keystore (file or URI) including the keystore password # - you must provide the JKS truststore (file or URI) including the truststore password -# See https://github.com/kitodo/kitodo-production/tree/master/docs/gettingstarted/use_secured_activemq.md for +# See https://github.com/kitodo/kitodo-production/tree/main/docs/gettingstarted/use_secured_activemq.md for # more information how to generate certificats and how to configure the ActiveMQ server side #activeMQ.useSSL = false #activeMQ.keyStore = /usr/local/kitodo/certs/activemq-client.ks @@ -600,7 +600,7 @@ taskProcessPropertyColumns= #activeMQ.trustStorePassword = # Define if an authentication and authorization should be used. If so a username and password must be provided -# See https://github.com/kitodo/kitodo-production/tree/master/docs/gettingstarted/use_secured_activemq.md for +# See https://github.com/kitodo/kitodo-production/tree/main/docs/gettingstarted/use_secured_activemq.md for # more information how to configure the authentification and authorization #activeMQ.useAuth = false #activeMQ.authUsername = diff --git a/docs/README.md b/docs/README.md index a13cb18f45b..32c27d47dfc 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ # Kitodo.Production Developer Documentation * Read the docs: -* GitHub: +* GitHub: This documentation is work in progress. Please consult the [javadoc](javadoc/README.md) or [contact the developer team](https://maillist.slub-dresden.de/cgi-bin/mailman/listinfo/kitodo-developer) if you have specific questions that are not covered here yet. diff --git a/docs/developer/gettingstarted/development-version.md b/docs/developer/gettingstarted/development-version.md index 57ea85a36da..82b482d5f41 100644 --- a/docs/developer/gettingstarted/development-version.md +++ b/docs/developer/gettingstarted/development-version.md @@ -45,11 +45,11 @@ sudo sed -i 's/securerandom.source=file:\/dev\/random/securerandom.source=file:\ ### Build development version and modules ``` -wget https://github.com/kitodo/kitodo-production/archive/master.zip -unzip master.zip && rm master.zip -(cd kitodo-production-master/ && mvn clean package '-P!development') -zip -j kitodo-3-modules.zip kitodo-production-master/Kitodo/modules/*.jar -mv kitodo-production-master/Kitodo/target/kitodo-3*.war kitodo-3.war +wget https://github.com/kitodo/kitodo-production/archive/main.zip +unzip main.zip && rm main.zip +(cd kitodo-production-main/ && mvn clean package '-P!development') +zip -j kitodo-3-modules.zip kitodo-production-main/Kitodo/modules/*.jar +mv kitodo-production-main/Kitodo/target/kitodo-3*.war kitodo-3.war ``` Note: If you want to build a release version, you may want to set the version in pom.xml files before packaging @@ -63,9 +63,9 @@ sudo mysql -e "create database kitodo;grant all privileges on kitodo.* to kitodo ### Generate SQL dump (flyway migration) ``` -cat kitodo-production-master/Kitodo/setup/schema.sql | mysql -u kitodo -D kitodo --password=kitodo -cat kitodo-production-master/Kitodo/setup/default.sql | mysql -u kitodo -D kitodo --password=kitodo -(cd kitodo-production-master/Kitodo-DataManagement && mvn flyway:baseline -Pflyway && mvn flyway:migrate -Pflyway) +cat kitodo-production-main/Kitodo/setup/schema.sql | mysql -u kitodo -D kitodo --password=kitodo +cat kitodo-production-main/Kitodo/setup/default.sql | mysql -u kitodo -D kitodo --password=kitodo +(cd kitodo-production-main/Kitodo-DataManagement && mvn flyway:baseline -Pflyway && mvn flyway:migrate -Pflyway) mysqldump -u kitodo --password=kitodo kitodo > kitodo-3.sql ``` @@ -73,11 +73,11 @@ mysqldump -u kitodo --password=kitodo kitodo > kitodo-3.sql ``` mkdir zip zip/config zip/debug zip/import zip/logs zip/messages zip/metadata zip/plugins zip/plugins/command zip/plugins/import zip/plugins/opac zip/plugins/step zip/plugins/validation zip/rulesets zip/scripts zip/swap zip/temp zip/users zip/xslt zip/diagrams -install -m 444 kitodo-production-master/Kitodo/src/main/resources/kitodo_*.xml zip/config/ -install -m 444 kitodo-production-master/Kitodo/src/main/resources/docket*.xsl zip/xslt/ -install -m 444 kitodo-production-master/Kitodo/rulesets/*.xml zip/rulesets/ -install -m 444 kitodo-production-master/Kitodo/diagrams/*.xml zip/diagrams/ -install -m 554 kitodo-production-master/Kitodo/scripts/*.sh zip/scripts/ +install -m 444 kitodo-production-main/Kitodo/src/main/resources/kitodo_*.xml zip/config/ +install -m 444 kitodo-production-main/Kitodo/src/main/resources/docket*.xsl zip/xslt/ +install -m 444 kitodo-production-main/Kitodo/rulesets/*.xml zip/rulesets/ +install -m 444 kitodo-production-main/Kitodo/diagrams/*.xml zip/diagrams/ +install -m 554 kitodo-production-main/Kitodo/scripts/*.sh zip/scripts/ chmod -w zip/config zip/import zip/messages zip/plugins zip/plugins/command zip/plugins/import zip/plugins/opac zip/plugins/step zip/plugins/validation zip/rulesets zip/scripts zip/xslt (cd zip && zip -r ../kitodo-3-config.zip *) ``` @@ -191,9 +191,9 @@ Menu System: ### Download sources ``` -rm -rf kitodo-production-master -wget https://github.com/kitodo/kitodo-production/archive/master.zip -unzip master.zip && rm master.zip +rm -rf kitodo-production-main +wget https://github.com/kitodo/kitodo-production/archive/main.zip +unzip main.zip && rm main.zip ``` ### Reset database @@ -201,26 +201,26 @@ unzip master.zip && rm master.zip ``` sudo mysql -e "drop database kitodo;" sudo mysql -e "create database kitodo;grant all privileges on kitodo.* to kitodo@localhost identified by 'kitodo';flush privileges;" -cat kitodo-production-master/Kitodo/setup/schema.sql | mysql -u kitodo -D kitodo --password=kitodo -cat kitodo-production-master/Kitodo/setup/default.sql | mysql -u kitodo -D kitodo --password=kitodo -(cd kitodo-production-master/Kitodo-DataManagement && mvn flyway:baseline -Pflyway && mvn flyway:migrate -Pflyway) +cat kitodo-production-main/Kitodo/setup/schema.sql | mysql -u kitodo -D kitodo --password=kitodo +cat kitodo-production-main/Kitodo/setup/default.sql | mysql -u kitodo -D kitodo --password=kitodo +(cd kitodo-production-main/Kitodo-DataManagement && mvn flyway:baseline -Pflyway && mvn flyway:migrate -Pflyway) ``` ### Rebuild and deploy war file ``` -(cd kitodo-production-master/ && mvn clean package '-P!development') +(cd kitodo-production-main/ && mvn clean package '-P!development') sudo rm -f /usr/local/kitodo/modules/* -sudo cp kitodo-production-master/Kitodo/modules/*.jar /usr/local/kitodo/modules +sudo cp kitodo-production-main/Kitodo/modules/*.jar /usr/local/kitodo/modules sudo chown -R tomcat8:tomcat8 /usr/local/kitodo/modules -mv kitodo-production-master/Kitodo/target/kitodo-3*.war kitodo-3.war +mv kitodo-production-main/Kitodo/target/kitodo-3*.war kitodo-3.war sudo chown tomcat8:tomcat8 kitodo-3.war sudo mv kitodo-3.war /var/lib/tomcat8/webapps/kitodo.war sleep 5 until curl -s GET "localhost:8080/kitodo/pages/login.jsf" | grep -q -o "KITODO.PRODUCTION" ; do sleep 1; done ``` -Note: If the update provides new example data, it has to be copied from kitodo-production-master/Kitodo/... to /usr/local/kitodo/... manually. +Note: If the update provides new example data, it has to be copied from kitodo-production-main/Kitodo/... to /usr/local/kitodo/... manually. ### Reset index diff --git a/docs/developer/guidelines/README.md b/docs/developer/guidelines/README.md index 9079dbd713b..ca13a26648f 100644 --- a/docs/developer/guidelines/README.md +++ b/docs/developer/guidelines/README.md @@ -22,4 +22,4 @@ * Unterscheidung bezieht sich auf die GitHub Projekte [Kitodo.ContentServer](https://github.com/kitodo/kitodo-contentserver), [Kitodo.Production](https://github.com/kitodo/kitodo-production) und [Kitodo.UGH](https://github.com/kitodo/kitodo-ugh) * **Branch 2.x**: ist die Weiterentwicklung der alten Goobi.Production Community Edition (Version 1.11.x) unter dem neuen Namen Kitodo.Production und wird als Version 2.x weiter geführt -* **Branch master**: die unter dem DFG Projekt geförderten Weiterentwicklung von Kitodo.Production findet hier statt und enthält auch die darauf basierenden betriebenen Entwicklungen +* **Branch main (ehemals master)**: die unter dem DFG Projekt geförderten Weiterentwicklung von Kitodo.Production findet hier statt und enthält auch die darauf basierenden betriebenen Entwicklungen diff --git a/docs/index.md b/docs/index.md index bbedebe6de1..a3dad0ba7fd 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,6 @@ # Kitodo.Production Developer Documentation * Read the docs: -* GitHub: +* GitHub: This documentation is work in progress. Please consult the [javadoc](developer/javadoc/README.md) or [contact the developer team](https://maillist.slub-dresden.de/cgi-bin/mailman/listinfo/kitodo-developer) if you have specific questions that are not covered here yet.