Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SLUB_SIP_Builder
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Digital Preservation
SLUB_SIP_Builder
Commits
249d74b1
Commit
249d74b1
authored
6 years ago
by
Jens Steidl
Browse files
Options
Downloads
Patches
Plain Diff
- added error message for PPNs without record data
parent
25a1cdb9
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/slubsipbuilder.pl
+5
-4
5 additions, 4 deletions
bin/slubsipbuilder.pl
with
5 additions
and
4 deletions
bin/slubsipbuilder.pl
+
5
−
4
View file @
249d74b1
...
@@ -31,6 +31,7 @@ use File::Basename;
...
@@ -31,6 +31,7 @@ use File::Basename;
use
File::
Copy
qw(cp)
;
use
File::
Copy
qw(cp)
;
use
File::
Find
;
use
File::
Find
;
use
File::
Path
;
use
File::
Path
;
use
Path::
Tiny
;
use
Getopt::
Long
;
use
Getopt::
Long
;
use
LWP::
UserAgent
;
# to get MARC data
use
LWP::
UserAgent
;
# to get MARC data
use
MARC::
Record
;
use
MARC::
Record
;
...
@@ -81,7 +82,7 @@ if ((!defined $ppn) && (!defined $noppn)) { confess("you need to specify a PPN
...
@@ -81,7 +82,7 @@ if ((!defined $ppn) && (!defined $noppn)) { confess("you need to specify a PPN
if
(
!
defined
$output
)
{
confess
("
you need to specify an output path, where the SIP will be stored
");
}
if
(
!
defined
$output
)
{
confess
("
you need to specify an output path, where the SIP will be stored
");
}
if
(
!
defined
$external_conservation_flag
)
{
$external_conservation_flag
=
"
false
";
}
else
{
$external_conservation_flag
=
"
true
";
}
if
(
!
defined
$external_conservation_flag
)
{
$external_conservation_flag
=
"
false
";
}
else
{
$external_conservation_flag
=
"
true
";
}
if
(
!
-
d
$directory
)
{
confess
("
you need to specify an IE directory, which needs to be archived, $!
");
}
if
(
!
-
d
$directory
)
{
confess
("
you need to specify an IE directory, which needs to be archived, $!
");
}
if
(
$directory
!~
m#^/#
)
{
$directory
=
abs_path
(
$directory
);
}
$directory
=
abs_path
(
$directory
);
if
(
$external_id
!~
m#^[a-z0-9]+$#
)
{
confess
("
you need to specify a valid external ID (^[a-z0-9]+
\$
)
");
}
if
(
$external_id
!~
m#^[a-z0-9]+$#
)
{
confess
("
you need to specify a valid external ID (^[a-z0-9]+
\$
)
");
}
if
(
$external_workflow
!~
m#^[a-z0-9]+$#
)
{
confess
("
you need to specify a valid external workflow (^[a-z0-9]+
\$
)
");
}
if
(
$external_workflow
!~
m#^[a-z0-9]+$#
)
{
confess
("
you need to specify a valid external workflow (^[a-z0-9]+
\$
)
");
}
if
(
!
$external_value_descr
)
{
confess
("
you need to specify an external value description (reason for archiving)
");
}
if
(
!
$external_value_descr
)
{
confess
("
you need to specify an external value description (reason for archiving)
");
}
...
@@ -238,9 +239,9 @@ sub get_mods_from ($$$$) { # $mods = ($url, $ppn, $searchkey, $recordschema)
...
@@ -238,9 +239,9 @@ sub get_mods_from ($$$$) { # $mods = ($url, $ppn, $searchkey, $recordschema)
say
"
write DEBUG_
${ppn}
_response.xml
";
say
"
write DEBUG_
${ppn}
_response.xml
";
write_file
("
DEBUG_
${ppn}
_response.xml
",
$record
->
decoded_content
);
write_file
("
DEBUG_
${ppn}
_response.xml
",
$record
->
decoded_content
);
}
}
my
$
marcblob
=
$parser
->
parse_string
(
my
$
recordData
=
$xp
->
findnodes_as_string
('
/*[local-name()="searchRetrieveResponse"]/*[local-name()="records"]/*[local-name()="record"]/*[local-name()="recordData"]/*
');
$xp
->
findnodes_as_string
('
/*[local-name()="searchRetrieveResponse"]/*[local-name()="records"]/*[local-name()="record"]/*[local-name()="recordData"]/*
')
if
(
!
$recordData
)
{
die
("
ERROR: Did not get any <recordData/> for PPN '
$ppn
' using '
$sru
'
");
}
);
my
$marcblob
=
$parser
->
parse_string
(
$recordData
);
my
$marcblob_patched
=
patch_marc_response
(
$marcblob
);
my
$marcblob_patched
=
patch_marc_response
(
$marcblob
);
if
(
$with_debug
)
{
if
(
$with_debug
)
{
say
"
write DEBUG_
${ppn}
_marc_unpatched.xml
";
say
"
write DEBUG_
${ppn}
_marc_unpatched.xml
";
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment