Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rosettaExitStrategy
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Digital Preservation
rosettaExitStrategy
Commits
9fb88c5c
Commit
9fb88c5c
authored
3 years ago
by
Andreas Romeyke
Browse files
Options
Downloads
Patches
Plain Diff
- refactoring, use array-references instead arrays
- fixed filepaths
parent
0f9b9b0d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
perl/exit_strategy.pl
+12
-13
12 additions, 13 deletions
perl/exit_strategy.pl
with
12 additions
and
13 deletions
perl/exit_strategy.pl
+
12
−
13
View file @
9fb88c5c
...
@@ -285,12 +285,12 @@ sub check_if_db_conform ($$) {
...
@@ -285,12 +285,12 @@ sub check_if_db_conform ($$) {
return
$title
;
return
$title
;
}
}
sub
get_dcrecords
{
sub
get_dcrecords
_ref
{
my
$xp
=
shift
;
my
$xp
=
shift
;
my
$filename
=
shift
;
my
$filename
=
shift
;
my
@dcrecords
;
my
@dcrecords
;
my
$
dcnodes
=
$xp
->
find
(
$compiled_xpath_dcrecords
);
my
@
dcnodes
=
$xp
->
find
nodes
(
$compiled_xpath_dcrecords
);
foreach
my
$dcnode
(
$
dcnodes
->
get_nodelist
)
{
foreach
my
$dcnode
(
@
dcnodes
)
{
#my $ref = ref $dcnode; use Data::Printer; p( $ref);
#my $ref = ref $dcnode; use Data::Printer; p( $ref);
my
$key
=
$dcnode
->
getName
();
my
$key
=
$dcnode
->
getName
();
#my $value = $dcnode->findvalue($compiled_xpath_dot);
#my $value = $dcnode->findvalue($compiled_xpath_dot);
...
@@ -305,7 +305,7 @@ sub check_if_db_conform ($$) {
...
@@ -305,7 +305,7 @@ sub check_if_db_conform ($$) {
push
@dcrecords
,
\
@pair
;
push
@dcrecords
,
\
@pair
;
}
}
}
}
return
@dcrecords
;
return
\
@dcrecords
;
}
}
sub
get_repid
{
sub
get_repid
{
...
@@ -324,14 +324,13 @@ sub check_if_db_conform ($$) {
...
@@ -324,14 +324,13 @@ sub check_if_db_conform ($$) {
return
$repid
;
return
$repid
;
}
}
sub
get_files
{
sub
get_files
_ref
{
my
$xp
=
shift
;
my
$xp
=
shift
;
my
$filename
=
shift
;
my
$filename
=
shift
;
my
$repid
=
shift
;
my
$repid
=
shift
;
my
@files_nodes
=
$xp
->
findnodes
("
mets:mets/mets:fileSec/mets:fileGrp[
\@
ADMID='
$repid
']/mets:file/mets:FLocat/
\@
xlin:href
");
my
$files_nodes
=
$xp
->
find
("
mets:mets/mets:fileSec/mets:fileGrp[
\@
ADMID='
$repid
']/mets:file/mets:FLocat/
\@
xlin:href
");
my
@files
=
map
{
s#//#/#g
;
$_
}
map
{
$_
->
nodeValue
}
@files_nodes
;
my
@files
=
map
{
$_
->
nodeValue
}
$files_nodes
->
get_nodelist
();
return
\
@files
;
return
@files
;
}
}
sub
parse_iexml
($$)
{
sub
parse_iexml
($$)
{
...
@@ -354,7 +353,7 @@ sub check_if_db_conform ($$) {
...
@@ -354,7 +353,7 @@ sub check_if_db_conform ($$) {
my
$title
=
get_title
(
$xp
,
$filename
);
my
$title
=
get_title
(
$xp
,
$filename
);
############################################
############################################
# get dc-records
# get dc-records
my
@
dcrecords
=
get_dcrecords
(
$xp
,
$filename
);
my
$
dcrecords
_ref
=
get_dcrecords
_ref
(
$xp
,
$filename
);
############################################
############################################
# get right representation ID (has a dnx-section with <key id=label>LOCAL</key>)
# get right representation ID (has a dnx-section with <key id=label>LOCAL</key>)
my
$repid
=
get_repid
(
$xp
,
$filename
);
my
$repid
=
get_repid
(
$xp
,
$filename
);
...
@@ -367,13 +366,13 @@ sub check_if_db_conform ($$) {
...
@@ -367,13 +366,13 @@ sub check_if_db_conform ($$) {
}
}
############################################
############################################
# get all files of LOCAL representation
# get all files of LOCAL representation
my
@
files
=
get_files
(
$xp
,
$filename
,
$repid
);
my
$
files
_ref
=
get_files
_ref
(
$xp
,
$filename
,
$repid
);
my
%ret
;
my
%ret
;
$ret
{"
filename
"
}
=
$filename
;
$ret
{"
filename
"
}
=
$filename
;
$ret
{"
title
"}
=
$title
;
$ret
{"
title
"}
=
$title
;
$ret
{"
repid
"}
=
$repid
;
$ret
{"
repid
"}
=
$repid
;
$ret
{"
files
"}
=
\
@
files
;
$ret
{"
files
"}
=
$
files
_ref
;
$ret
{"
dcrecords
"}
=
\
@
dcrecords
;
$ret
{"
dcrecords
"}
=
$
dcrecords
_ref
;
return
\
%ret
;
return
\
%ret
;
}
}
}
}
...
...
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