diff --git a/dcd.pl b/dcd.pl index 86157ab7614a24baabbcf37ea566a74c241f063f..fa7eb4c38a5cd1eb3a04a45bba11bff1b167257d 100755 --- a/dcd.pl +++ b/dcd.pl @@ -159,7 +159,7 @@ sub register_url || $repo_url =~ m#https://(ojs3test\.univie\.ac\.at)/index\.php/wks/article/view/(\d+)$# || $repo_url =~ m#https://(wbagon\.univie\.ac\.at)/index\.php/(wbagon)/article/view/(\d+)$# || $repo_url =~ m#https://(rezenstfm\.univie\.ac\.at)/index\.php/(tfm)/article/view/(\d+)$# - || $repo_url =~ m#https://(journals\.univie\.ac\.at)/index\.php/(yis|kf|mp|oezg|rhy|wdr|aaj|lili)/article/view/(\d+)$# + || $repo_url =~ m#https://(journals\.univie\.ac\.at)/index\.php/(aaj|jeacs|kf|lili|mp|oezg|rhy|wdr|yis)/article/view/(\d+)$# || $repo_url =~ m#https://(yis\.univie\.ac\.at)/index\.php/(yis)/article/view/(\d+)$# || $repo_url =~ m#https://(chronotopos\.eu)/index\.php/(cts)/article/view/(\d+)$# || $repo_url =~ m#https://(viennalawreview\.com)/index\.php/(vlr)/article/view/(\d+)$# @@ -174,11 +174,16 @@ sub register_url my $pid; while (@parts) { $pid= pop (@parts); last if (defined($pid)) }; + my $journal= (@parts == 1) ? $parts[0] : undef; # ugly hack! + print __LINE__, " repo=[$repo] pid=[$pid] parts=[",join('|',@parts),"]\n"; usage ("unknown repo=[$repo]") unless (exists ($cnf->{repositories}->{$repo})); print __LINE__, " repo=[$repo]\n"; + # TODO: factor the code below out! + # call do_register($cnf->{repositories}->{$repo}, $journal, ...); + my $repo_cnf= $cnf->{repositories}->{$repo}; my $t_reg_cnf= $cnf->{doi_registries}->{$repo_cnf->{t_registry}}; @@ -195,10 +200,12 @@ sub register_url return undef; } - my ($pfx, $ns, $nr)= split_doi_string ($prod_doi_string, $repo_cnf->{id_separator}); + my $sep= $repo_cnf->{id_separator}; + $sep= '.' if ($journal eq 'jeacs'); + my ($pfx, $ns, $nr)= split_doi_string ($prod_doi_string, $sep); # print __LINE__, " prod_doi_string=[$prod_doi_string] pfx=[$pfx] ns=[$ns] nr=[$nr]\n"; - my $dc_xml= join ('/', $na_path, 'metadata', $ns, join ($repo_cnf->{id_separator}, $ns, $nr) .'.xml'); + my $dc_xml= join ('/', $na_path, 'metadata', $ns, join ($sep, $ns, $nr) .'.xml'); print __LINE__, " prod_doi_string=[$prod_doi_string] pfx=[$pfx] ns=[$ns] nr=[$nr] dc_xml=[$dc_xml]\n";