Skip to content

Commit

Permalink
Merge branch 'release/1.1.7.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
sbearcsiro committed Jun 29, 2021
2 parents 92b125b + a07bbd7 commit b5f1d97
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ plugins {
}


version "1.1.7"
version "1.1.7.1"

group "au.org.ala"

Expand Down
29 changes: 15 additions & 14 deletions grails-app/services/au/org/ala/images/ImageService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,24 @@ class ImageService {
"type"
]

// missing \p{Unassigned}\p{Surrogate]\p{Control} from regex as Unicode character classes unsupported in PG.
final EXPORT_DATASET_SQL = '''
SELECT
i.image_identifier as "imageID",
NULLIF(regexp_replace(i.original_filename, '[\\\\p{Cc}\\\\p{Cn}\\\\p{Cs}\\\\p{Cf}]', '', 'g'), '') AS "identifier",
NULLIF(regexp_replace(i.audience, '[\\\\p{Cc}\\\\p{Cn}\\\\p{Cs}\\\\p{Cf}]', '', 'g'), '') AS "audience",
NULLIF(regexp_replace(i.contributor, '[\\\\p{Cc}\\\\p{Cn}\\\\p{Cs}\\\\p{Cf}]', '', 'g'), '') AS "contributor",
NULLIF(regexp_replace(i.created, '[\\\\p{Cc}\\\\p{Cn}\\\\p{Cs}\\\\p{Cf}]', '', 'g'), '') AS "created",
NULLIF(regexp_replace(i.creator, '[\\\\p{Cc}\\\\p{Cn}\\\\p{Cs}\\\\p{Cf}]', '', 'g'), '') AS "creator",
NULLIF(regexp_replace(i.description, '[\\\\p{Cc}\\\\p{Cn}\\\\p{Cs}\\\\p{Cf}]', '', 'g'), '') AS "description",
NULLIF(regexp_replace(i.mime_type, '[\\\\p{Cc}\\\\p{Cn}\\\\p{Cs}\\\\p{Cf}]', '', 'g'), '') AS "format",
NULLIF(regexp_replace(i.license, '[\\\\p{Cc}\\\\p{Cn}\\\\p{Cs}\\\\p{Cf}]', '', 'g'), '') AS "license",
NULLIF(regexp_replace(i.publisher, '[\\\\p{Cc}\\\\p{Cn}\\\\p{Cs}\\\\p{Cf}]', '', 'g'), '') AS "publisher",
NULLIF(regexp_replace(i.dc_references, '[\\\\p{Cc}\\\\p{Cn}\\\\p{Cs}\\\\p{Cf}]', '', 'g'), '') AS "references",
NULLIF(regexp_replace(i.rights_holder, '[\\\\p{Cc}\\\\p{Cn}\\\\p{Cs}\\\\p{Cf}]', '', 'g'), '') AS "rightsHolder",
NULLIF(regexp_replace(i.source, '[\\\\p{Cc}\\\\p{Cn}\\\\p{Cs}\\\\p{Cf}]', '', 'g'), '') AS "source",
NULLIF(regexp_replace(i.title, '[\\\\p{Cc}\\\\p{Cn}\\\\p{Cs}\\\\p{Cf}]', '', 'g'), '') AS "title",
NULLIF(regexp_replace(i.type, '[\\\\p{Cc}\\\\p{Cn}\\\\p{Cs}\\\\p{Cf}]', '', 'g'), '') AS "type"
NULLIF(regexp_replace(i.original_filename, '[\\x00-\\x1F\\x7F-\\x9F]', '', 'g'), '') AS "identifier",
NULLIF(regexp_replace(i.audience, '[\\x00-\\x1F\\x7F-\\x9F]', '', 'g'), '') AS "audience",
NULLIF(regexp_replace(i.contributor, '[\\x00-\\x1F\\x7F-\\x9F]', '', 'g'), '') AS "contributor",
NULLIF(regexp_replace(i.created, '[\\x00-\\x1F\\x7F-\\x9F]', '', 'g'), '') AS "created",
NULLIF(regexp_replace(i.creator, '[\\x00-\\x1F\\x7F-\\x9F]', '', 'g'), '') AS "creator",
NULLIF(regexp_replace(i.description, '[\\x00-\\x1F\\x7F-\\x9F]', '', 'g'), '') AS "description",
NULLIF(regexp_replace(i.mime_type, '[\\x00-\\x1F\\x7F-\\x9F]', '', 'g'), '') AS "format",
NULLIF(regexp_replace(i.license, '[\\x00-\\x1F\\x7F-\\x9F]', '', 'g'), '') AS "license",
NULLIF(regexp_replace(i.publisher, '[\\x00-\\x1F\\x7F-\\x9F]', '', 'g'), '') AS "publisher",
NULLIF(regexp_replace(i.dc_references, '[\\x00-\\x1F\\x7F-\\x9F]', '', 'g'), '') AS "references",
NULLIF(regexp_replace(i.rights_holder, '[\\x00-\\x1F\\x7F-\\x9F]', '', 'g'), '') AS "rightsHolder",
NULLIF(regexp_replace(i.source, '[\\x00-\\x1F\\x7F-\\x9F]', '', 'g'), '') AS "source",
NULLIF(regexp_replace(i.title, '[\\x00-\\x1F\\x7F-\\x9F]', '', 'g'), '') AS "title",
NULLIF(regexp_replace(i.type, '[\\x00-\\x1F\\x7F-\\x9F]', '', 'g'), '') AS "type"
FROM image i
WHERE data_resource_uid = ?
'''
Expand Down

0 comments on commit b5f1d97

Please sign in to comment.