Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6.8.x release #1119

Merged
merged 20 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
e0231aa
some documentation update
sparkhi Apr 23, 2024
133c90c
Merge remote-tracking branch 'origin/master' into 6.8.x-release
sparkhi May 1, 2024
dabfa36
Merge remote-tracking branch 'origin/master' into 6.8.x-release
sparkhi May 1, 2024
5db70ab
Merge remote-tracking branch 'origin/master' into 6.8.x-release
sparkhi May 2, 2024
2ca6adc
Merge remote-tracking branch 'origin/master' into 6.8.x-release
sparkhi May 10, 2024
0f0bd76
Merge remote-tracking branch 'origin/master' into 6.8.x-release
sparkhi May 16, 2024
f51ed89
[maven-release-plugin] prepare release droid-6.8.0-RC1
sparkhi May 16, 2024
73686d4
[maven-release-plugin] prepare for next development iteration
sparkhi May 16, 2024
96c676f
Export dialog minimum size reduced and tooltip made multiline (#1110)
sparkhi May 23, 2024
738ba20
> not allowed in javadoc
sparkhi May 23, 2024
d45a9aa
[maven-release-plugin] prepare release droid-6.8.0-RC2
sparkhi May 23, 2024
1a61383
[maven-release-plugin] prepare for next development iteration
sparkhi May 23, 2024
d59529d
Improved the validation error messages on export template parsing (#1…
sparkhi Jun 14, 2024
2c3075c
Updated changelog
sparkhi Jun 14, 2024
693e7a5
[maven-release-plugin] prepare release droid-6.8.0-RC3
sparkhi Jun 14, 2024
e7cdb6c
[maven-release-plugin] prepare for next development iteration
sparkhi Jun 14, 2024
1b422f9
Updated to latest JRE, increased max memory and updated docs to refle…
Jun 24, 2024
41a7c89
Minor text correction
sparkhi Jun 26, 2024
66a929e
[maven-release-plugin] prepare release droid-6.8.0
sparkhi Jun 26, 2024
e21ee44
[maven-release-plugin] prepare for next development iteration
sparkhi Jun 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# DROID (Digital Record Object Identification)

[![CI](https://github.com/digital-preservation/droid/workflows/CI/badge.svg)](https://github.com/digital-preservation/droid/actions?query=workflow%3ACI)
[![Build status](https://ci.appveyor.com/api/projects/status/hrr6c3ckbghjvd7h/branch/master?svg=true)](https://ci.appveyor.com/project/dpreservation/droid/branch/master)
[![Coverage Status](https://coveralls.io/repos/github/digital-preservation/droid/badge.svg?branch=master)](https://coveralls.io/github/digital-preservation/droid?branch=master)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/uk.gov.nationalarchives/droid/badge.svg)](https://search.maven.org/search?q=g:uk.gov.nationalarchives)

Expand Down Expand Up @@ -111,17 +110,17 @@ Once the code is cloned into a folder (e.g. `droid`), executing `mvn clean insta

### Linux / OSX users

You will need JAVA 8 to 11 installed to run DROID.
You will need JAVA 8 to 17 installed to run DROID.

Unpack the archive `droid-binary-${VERSION}-bin-unix.zip`, then use the `droid.sh` script to run the application.
Unpack the archive `droid-binary-${VERSION}-bin.zip`, then use the `droid.sh` script to run the application.

### Windows users
Archive `droid-binary-${VERSION}-bin-win64-with-jre.zip`


You will need JAVA 8 to 11 installed to run DROID. For Windows users who might not be able to install JAVA, the provided bundle includes JAVA 11.
You will need JAVA 8 to 17 installed to run DROID. For Windows users who might not be able to install JAVA, the provided bundle includes JAVA 17.

Unpack the archive `droid-binary-${VERSION}-bin-win32-with-jre.zip`, then use the `droid.bat` script to run the application.
Unpack the archive `droid-binary-${VERSION}-bin-win64-with-jre.zip`, then use the `droid.bat` script to run the application.

## Signatures

Expand Down
2 changes: 1 addition & 1 deletion droid-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>droid-parent</artifactId>
<groupId>uk.gov.nationalarchives</groupId>
<version>6.8.0-SNAPSHOT</version>
<version>6.8.1-SNAPSHOT</version>
<relativePath>../droid-parent</relativePath>
</parent>

Expand Down
11 changes: 11 additions & 0 deletions droid-binary/bin/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
Version 6.8.0
* Feature: Export Templates - Ability to customise the Droid CSV export by defining templates
* #932 Improvement: Prompt for a new profile creation on closing the preferences dialog
* #938 Improvement: The Windows distributable now includes a 64 bit Java 17 JRE
* #1063 Improvement: Updated commons-httpclient dependecy used for signature download
* #561 Bugfix: On Windows, when a profile is closed, the associated profile folder is not deleted
* #1072 Bugfix: Empty columns are not populated with a blank when a file has more than one format identification
* #1011 Bugfix: Mismatch in the format name between GUI and API when identification method is 'Container'
* #1100 Bugfix: Cancelling the preferences dialog still makes changes to the preferences
* #1072 Bugfix: Fewer elements in data row when exporting profiles per file when some of them have more than one identification

Version 6.7.0
* #898 Improvement: Sigtool uses the version of java bundled with Droid on the Windows OS
* #938 Improvement: Internal API result includes whether there is an extension mismatch in identification
Expand Down
6 changes: 3 additions & 3 deletions droid-binary/bin/droid.bat
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ REM ---------------
REM This is the maximum memory DROID can use in megabytes.
REM Remove the "REM " from the line below and set the maximum memory after the "=".
REM Also configure this property using the environment variable: droidMemory.
REM SET droidMemory=512
REM SET droidMemory=1024



REM Assemble options
REM ================
REM Default to using 512 megabytes of memory if no other settings provided:
SET DROID_OPTIONS="-Xmx512m"
REM Default to using 1024 megabytes of memory if no other settings provided:
SET DROID_OPTIONS="-Xmx1024m"

IF "%droidMemory%"=="" GOTO UserDir
SET DROID_OPTIONS="-Xmx%droidMemory%m"
Expand Down
2 changes: 1 addition & 1 deletion droid-binary/bin/droid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ logLevel=""
# Max memory: droidMemory
# -----------------------
# The maximum memory for DROID to use in megabytes.
droidMemory="512m"
droidMemory="1024m"


# Run DROID:
Expand Down
8 changes: 4 additions & 4 deletions droid-binary/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>droid-parent</artifactId>
<groupId>uk.gov.nationalarchives</groupId>
<version>6.8.0-SNAPSHOT</version>
<version>6.8.1-SNAPSHOT</version>
<relativePath>../droid-parent</relativePath>
</parent>

Expand Down Expand Up @@ -34,7 +34,7 @@
</goals>
<configuration>
<!-- To update, retrieve link for 64 bit Windows jre from https://adoptium.net -->
<url>https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9.1/OpenJDK17U-jre_x64_windows_hotspot_17.0.9_9.zip</url>
<url>https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.11%2B9/OpenJDK17U-jre_x64_windows_hotspot_17.0.11_9.zip</url>
<unpack>false</unpack>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
Expand All @@ -55,9 +55,9 @@
<configuration>
<target>
<!-- Update binary from https://adoptopenjdk.net/releases.html -->
<unzip dest="${project.build.directory}/jre_tmp/" src="${project.build.directory}/OpenJDK17U-jre_x64_windows_hotspot_17.0.9_9.zip" />
<unzip dest="${project.build.directory}/jre_tmp/" src="${project.build.directory}/OpenJDK17U-jre_x64_windows_hotspot_17.0.11_9.zip" />
<move todir="${project.build.directory}/jre-windows/">
<fileset dir="${project.build.directory}/jre_tmp/jdk-17.0.9+9-jre/">
<fileset dir="${project.build.directory}/jre_tmp/jdk-17.0.11+9-jre/">
<include name="**/*" />
</fileset>
</move>
Expand Down
2 changes: 1 addition & 1 deletion droid-build-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>droid-parent</artifactId>
<groupId>uk.gov.nationalarchives</groupId>
<version>6.8.0-SNAPSHOT</version>
<version>6.8.1-SNAPSHOT</version>
<relativePath>../droid-parent</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion droid-command-line/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>droid-parent</artifactId>
<groupId>uk.gov.nationalarchives</groupId>
<version>6.8.0-SNAPSHOT</version>
<version>6.8.1-SNAPSHOT</version>
<relativePath>../droid-parent</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion droid-container/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>droid-parent</artifactId>
<groupId>uk.gov.nationalarchives</groupId>
<version>6.8.0-SNAPSHOT</version>
<version>6.8.1-SNAPSHOT</version>
<relativePath>../droid-parent</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion droid-core-interfaces/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>droid-parent</artifactId>
<groupId>uk.gov.nationalarchives</groupId>
<version>6.8.0-SNAPSHOT</version>
<version>6.8.1-SNAPSHOT</version>
<relativePath>../droid-parent</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion droid-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>droid-parent</artifactId>
<groupId>uk.gov.nationalarchives</groupId>
<version>6.8.0-SNAPSHOT</version>
<version>6.8.1-SNAPSHOT</version>
<relativePath>../droid-parent</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion droid-export-interfaces/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>droid-parent</artifactId>
<groupId>uk.gov.nationalarchives</groupId>
<version>6.8.0-SNAPSHOT</version>
<version>6.8.1-SNAPSHOT</version>
<relativePath>../droid-parent</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@

/**
* ExportTemplate interface.
* There is only one method which returns a map of integer -> ExportTemplateColumnDef
* There is only one method which returns a map of integer - ExportTemplateColumnDef
*/
public interface ExportTemplate {
/**
* Get the map of Integer -> ExportTemplateColumnDef representing column order.
* Get the map of Integer - ExportTemplateColumnDef representing column order.
* @return Map with keys as column order and values as column definition
*/
Map<Integer, ExportTemplateColumnDef> getColumnOrderMap() ;
Expand Down
2 changes: 1 addition & 1 deletion droid-export/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>droid-parent</artifactId>
<groupId>uk.gov.nationalarchives</groupId>
<version>6.8.0-SNAPSHOT</version>
<version>6.8.1-SNAPSHOT</version>
<relativePath>../droid-parent</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,25 @@ private Map<Integer, ExportTemplateColumnDef> parseExportTemplateV1(List<String>

if (token2.startsWith(DATA_COLUMN_PREFIX)) {
columnMap.put(i, createProfileNodeDef(header, token2));
} else if ((token2.isEmpty()) || (token2.startsWith(DOUBLE_QUOTES))) {
columnMap.put(i, createConstantStringDef(header, token2));
} else {
} else if (isExpressionForDataModification(token2)) {
columnMap.put(i, createDataModifierDef(header, token2));
} else {
columnMap.put(i, createConstantStringDef(header, token2));
}
}
return columnMap;
}

private boolean isExpressionForDataModification(String expressionParam) {
List<String> operations = Arrays.stream(
ExportTemplateColumnDef.DataModification.values()).map(v -> v.toString() + OPENING_BRACKET).
collect(Collectors.toList());
String expression = expressionParam.trim();

List<String> possibleOperations = operations.stream().filter(op -> expression.startsWith(op)).collect(Collectors.toList());
return possibleOperations.size() > 0;
}

private ExportTemplateColumnDef createDataModifierDef(String header, String param2) {

assertDataModifierSyntaxValid(param2);
Expand Down Expand Up @@ -168,10 +178,11 @@ private ExportTemplateColumnDef createConstantStringDef(String header, String pa
if (param2.isEmpty()) {
return new ConstantStringColumnDef("", header);
} else {
if (!param2.endsWith(DOUBLE_QUOTES)) {
throw new ExportTemplateParseException("The line with a constant value ('" + param2 + "') in template definition does not have closing quotes");
if (param2.startsWith(DOUBLE_QUOTES) && param2.endsWith(DOUBLE_QUOTES)) {
return new ConstantStringColumnDef(param2.substring(1, param2.length() - 1), header);
} else {
throw new ExportTemplateParseException("The line with a constant value ('" + param2 + "') is not fully enclosed in quotes");
}
return new ConstantStringColumnDef(param2.substring(1, param2.length() - 1), header);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public void should_treat_missing_value_as_empty_string_constant_in_export_templa
ExportTemplate template = builder.buildExportTemplate(tempFile.getAbsolutePath());
assertNotNull(template);
assertTrue(template.getColumnOrderMap().get(1) instanceof ConstantStringColumnDef);
assertEquals("", template.getColumnOrderMap().get(1).getDataValue());
assertTrue(template.getColumnOrderMap().get(2) instanceof DataModifierColumnDef);
assertEquals("FILE_PATH", template.getColumnOrderMap().get(2).getOriginalColumnName());
}
Expand Down Expand Up @@ -166,7 +167,37 @@ public void should_throw_an_exception_if_the_constant_string_value_does_not_have
Files.write(tempFile.toPath(), data, StandardOpenOption.WRITE);

ExportTemplateParseException ex = assertThrows(ExportTemplateParseException.class, () -> builder.buildExportTemplate(tempFile.getAbsolutePath()));
assertEquals("The line with a constant value ('\"English') in template definition does not have closing quotes", ex.getMessage());
assertEquals("The line with a constant value ('\"English') is not fully enclosed in quotes", ex.getMessage());
}

@Test
public void should_throw_an_exception_if_the_constant_string_value_does_not_have_opening_double_quotes() throws IOException {
ExportTemplateBuilder builder = new ExportTemplateBuilder();
File tempFile = temporaryFolder.newFile("export-task-test-default-encoding");
List<String> data = Arrays.asList(
"version 1.0",
"",
"Language: English\"",
"");
Files.write(tempFile.toPath(), data, StandardOpenOption.WRITE);

ExportTemplateParseException ex = assertThrows(ExportTemplateParseException.class, () -> builder.buildExportTemplate(tempFile.getAbsolutePath()));
assertEquals("The line with a constant value ('English\"') is not fully enclosed in quotes", ex.getMessage());
}

@Test
public void should_throw_an_exception_if_the_constant_string_value_does_not_have_fully_enclosing_quotes() throws IOException {
ExportTemplateBuilder builder = new ExportTemplateBuilder();
File tempFile = temporaryFolder.newFile("export-task-test-default-encoding");
List<String> data = Arrays.asList(
"version 1.0",
"",
"Language: En\"gli\"sh",
"");
Files.write(tempFile.toPath(), data, StandardOpenOption.WRITE);

ExportTemplateParseException ex = assertThrows(ExportTemplateParseException.class, () -> builder.buildExportTemplate(tempFile.getAbsolutePath()));
assertEquals("The line with a constant value ('En\"gli\"sh') is not fully enclosed in quotes", ex.getMessage());
}

@Test
Expand Down Expand Up @@ -196,7 +227,7 @@ public void should_throw_an_exception_when_the_operation_is_unknown() throws IOE
Files.write(tempFile.toPath(), data, StandardOpenOption.WRITE);

ExportTemplateParseException ex = assertThrows(ExportTemplateParseException.class, () -> builder.buildExportTemplate(tempFile.getAbsolutePath()));
assertEquals("Undefined operation 'Lower' encountered in export template", ex.getMessage());
assertEquals("The line with a constant value ('Lower($ID)') is not fully enclosed in quotes", ex.getMessage());
}

@Test
Expand Down Expand Up @@ -228,6 +259,21 @@ public void should_support_colon_in_the_constant_string_value() throws IOExcepti
assertEquals("http://www.knowingwhere.com", template.getColumnOrderMap().get(0).getDataValue());
}

@Test
public void should_support_constant_value_which_includes_operation_name() throws IOException {
ExportTemplateBuilder builder = new ExportTemplateBuilder();
File tempFile = temporaryFolder.newFile("export-task-test-default-encoding");
List<String> data = Arrays.asList(
"version 1.0",
" MyWebsite : \"LCASE($ID)\"",
"");
Files.write(tempFile.toPath(), data, StandardOpenOption.WRITE);

ExportTemplate template = builder.buildExportTemplate(tempFile.getAbsolutePath());
assertEquals("MyWebsite", template.getColumnOrderMap().get(0).getHeaderLabel());
assertEquals("LCASE($ID)", template.getColumnOrderMap().get(0).getDataValue());
}

@Test
public void should_throw_an_exception_when_an_operation_cannot_be_located() throws IOException {
ExportTemplateBuilder builder = new ExportTemplateBuilder();
Expand All @@ -239,7 +285,7 @@ public void should_throw_an_exception_when_an_operation_cannot_be_located() thro
Files.write(tempFile.toPath(), data, StandardOpenOption.WRITE);

ExportTemplateParseException ex = assertThrows(ExportTemplateParseException.class, () -> builder.buildExportTemplate(tempFile.getAbsolutePath()));
assertEquals("Invalid syntax in data modifier expression 'Crown Copyright (C)', expecting '$' after '('", ex.getMessage());
assertEquals("The line with a constant value ('Crown Copyright (C)') is not fully enclosed in quotes", ex.getMessage());
}

@Test
Expand All @@ -253,7 +299,7 @@ public void should_throw_an_exception_when_a_constant_is_not_enclosed_in_double_
Files.write(tempFile.toPath(), data, StandardOpenOption.WRITE);

ExportTemplateParseException ex = assertThrows(ExportTemplateParseException.class, () -> builder.buildExportTemplate(tempFile.getAbsolutePath()));
assertEquals("Invalid syntax in data modifier expression 'Crown Copyright', expecting exactly one occurrence of '('", ex.getMessage());
assertEquals("The line with a constant value ('Crown Copyright') is not fully enclosed in quotes", ex.getMessage());
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion droid-help/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>droid-parent</artifactId>
<groupId>uk.gov.nationalarchives</groupId>
<version>6.8.0-SNAPSHOT</version>
<version>6.8.1-SNAPSHOT</version>
<relativePath>../droid-parent</relativePath>
</parent>

Expand Down
Loading
Loading