Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ Below are all validation rules ordered by their execution priority (every test i
|Test|Info,Warning|AST20|Disposal decisions|Provides information about the number of disposal decisions related to series, classes, files, records, and document descriptions, and tests whether the corresponding value in arkivuttrekk.xml (inneholderDokumenterSomSkalKasseres) is correct.|
|Test|Info,Warning|AST21|Disposals|Provides information about the number of disposals of series and document descriptions, and tests whether the corresponding value in arkivuttrekk.xml (omfatterDokumenterSomErKassert) is correct.|
|Test|Info,Warning|AST22|Personal name fields|Checks whether all name fields contain seemingly valid personal names. The regular expressions used for the purpose are "\^[\p{L}\s-'.]*$" and "\^[\p{L}\s-'.]+$" depending on whether the value can be blank or not. The validated fields are: saksansvarlig (M306), kontaktperson (M412), korrespondansepartNavn (M400), sakspartNavn (M302), moeteDeltakerNavn (M372), arkivertAv (M605), avskrevetAv (M618), tilknyttetAv (M621), merknadRegistrertAv (M612), kassertAv (M631), slettetAv (M614), gradertAv (M625), presedensGodkjentAv (M629), verifisertAv (M623), nedgradertAv (M627), opprettetAv (M601), avsluttetAv (M603).|
|Test|Info,Error|AST23|Document object file sizes|Tests whether the recorded file size in arkivstruktur.xml is exactly the same as the one of the referenced physical file on the system.|

**loependejournal:**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class Field {

public static final String INTERNAL_ID = "_id";
public static final String DETECTED_CHECKSUM = "_detected_checksum";
public static final String DETECTED_FILE_SIZE = "_detected_file_size";
public static final String DETECTED_FILE_TYPE = "_detected_type";
public static final String IS_VALID_FILE_TYPE = "_is_valid_type";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ public void endElement(String uri, String localName, String qName) throws SAXExc

String contentType = isValidPdfA ? PDFAValidator.VALID_FILE_TYPE : PDFAValidator.getFileType(document);

getItem().add(Field.DETECTED_FILE_SIZE, document.length());
getItem().add(Field.DETECTED_FILE_TYPE, contentType);
getItem().add(Field.DETECTED_CHECKSUM, checksum);
getItem().add(Field.IS_VALID_FILE_TYPE, isValidPdfA);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ uniqueFields.loependejournal.journalpost = systemid
uniqueFields.offentligjournal.journalpost = systemid

# Additional fields that should be introduced per itemDef
additionalFields.arkivstruktur.dokumentobjekt = _detected_checksum, _detected_type, _is_valid_type
additionalFields.arkivstruktur.dokumentobjekt = _detected_checksum, _detected_file_size, _detected_type, _is_valid_type
Original file line number Diff line number Diff line change
Expand Up @@ -2868,6 +2868,31 @@
</queries>
</test>

<test id="AST23">
<title>Document object file sizes</title>
<description>
Tests whether the document object file sizes specified in arkivstruktur.xml
match the ones with the physical files on the file system.
</description>
<group>arkivstruktur</group>
<queries>
<info>
<![CDATA[
SELECT COUNT(*) documents_with_mismatched_file_sizes
FROM arkivstruktur.dokumentobjekt
WHERE filstoerrelse <> _detected_file_size;
]]>
</info>
<errors>
<![CDATA[
SELECT referansedokumentfil document, filstoerrelse recorded_document_file_size, _detected_file_size detected_file_size
FROM arkivstruktur.dokumentobjekt
WHERE filstoerrelse <> _detected_file_size;
]]>
</errors>
</queries>
</test>

<!--
============================================================================================================
LOEPENDEJOURNAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2868,6 +2868,30 @@
</queries>
</test>

<test id="AST23">
<title>Document object file sizes</title>
<description>
Tests whether the document object file sizes specified in arkivstruktur.xml
match the ones with the physical files on the file system.
</description>
<group>arkivstruktur</group>
<queries>
<info>
<![CDATA[
SELECT COUNT(*) documents_with_mismatched_file_sizes
FROM arkivstruktur.dokumentobjekt
WHERE filstoerrelse <> _detected_file_size;
]]>
</info>
<errors>
<![CDATA[
SELECT referansedokumentfil document, filstoerrelse recorded_document_file_size, _detected_file_size detected_file_size
FROM arkivstruktur.dokumentobjekt
WHERE filstoerrelse <> _detected_file_size;
]]>
</errors>
</queries>
</test>
<!--
============================================================================================================
LOEPENDEJOURNAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2871,6 +2871,30 @@
</queries>
</test>

<test id="AST23">
<title>Document object file sizes</title>
<description>
Tests whether the document object file sizes specified in arkivstruktur.xml
match the ones with the physical files on the file system.
</description>
<group>arkivstruktur</group>
<queries>
<info>
<![CDATA[
SELECT COUNT(*) documents_with_mismatched_file_sizes
FROM arkivstruktur.dokumentobjekt
WHERE filstoerrelse <> _detected_file_size;
]]>
</info>
<errors>
<![CDATA[
SELECT referansedokumentfil document, filstoerrelse recorded_document_file_size, _detected_file_size detected_file_size
FROM arkivstruktur.dokumentobjekt
WHERE filstoerrelse <> _detected_file_size;
]]>
</errors>
</queries>
</test>
<!--
============================================================================================================
LOEPENDEJOURNAL
Expand Down