Project

General

Profile

« Previous | Next » 

Revision 4010

Added by Jing Tao over 16 years ago

Merge METACAT_1_8_1 to cvs head.

View differences:

lib/style/common/templates/esaModNotification.tmpl
2 2
Ecological Society of America moderator notice:
3 3
[% IF stage == 'mod_accept' %]
4 4

  
5
You have accepted the metadata entry for [%contactName%]'s article, [%dpTitle%].  This part of the article's submission process is now complete.  You can see the metadata entry as it currently stands at [% servletPath %]?action=read&cfg=esa&docid=[%docid%].  Once published, the entry will be available at [% servletPath %]?action=read&cfg=esa&docid=[%docid%].
5
You have accepted the metadata entry for [%contactName%]'s article, [%dpTitle%].  This part of the article's submission process is now complete.  You can see the metadata entry as it currently stands at @systemidserver@@servlet-path@?action=read&qformat=esa&docid=[%docid%].  Once published, the entry will be available at @systemidserver@@servlet-path@?action=read&qformat=esa&docid=[%docid%].
6 6

  
7 7
[% ELSIF stage == 'mod_decline' %]		
8 8

  
......
26 26

  
27 27
We are happy to inform you that the metadata entry for your article submission,
28 28
[%dpTitle%], has been accepted.  This part of the submission process is now
29
complete.  Your metadata entry can be cited in the future as <LSID>, and will be
30
viewable online at [% servletPath %]?action=read&cfg=esa&docid=[%docid%] after publication.  Thank you for your cooperation.
29
complete.  Your metadata entry can be cited in the future as a LSID (Life Science ID), and will be
30
viewable online at @systemidserver@@servlet-path@?action=read&qformat=esa&docid=[%docid%] after publication.  Thank you for your cooperation.
31 31

  
32 32
The Ecological Society of America
33 33
 		
lib/style/common/templates/entryForm.tmpl
1066 1066
           [% WHILE cnt < upCount %]
1067 1067
                [% SET fileSum = "upload_${cnt}" %]
1068 1068
                [% SET fileName = "uploadname_${cnt}" %]
1069
                [% SET fileType = "uploadtype_${cnt}" %]
1069
                [% SET fileType = "uploadtype_${cnt}" %] 
1070
                [% SET filePerm = "uploadperm_${cnt}" %]
1070 1071
                [% IF fileSum %]
1071 1072
                    <input type="hidden" name="[%fileSum%]" value="[% $fileSum %]"> 
1072 1073
                    <input type="hidden" name="[%fileName%]" value="[% $fileName %]"> 
......
1106 1107
          <input type="radio" name="[% filePerm %]" value="private" [% perm_b %]> Private
1107 1108

  
1108 1109
          <input type="button" value="Delete" onclick="deleteFile(event, [%fileName%]);"/></div>[% END %]
1110

  
1109 1111
        [% cnt = cnt + 1 %]
1110 1112
    [% END %]
1111 1113
    [% END %]</div></td>
lib/style/common/templates/loginForm.tmpl
1
[% INCLUDE $templates.header %]
1
[% IF cfg == 'nceas' %]
2
  [% INCLUDE "nceasHeader.tmpl" %]
3
[% ELSE %]
4
  [% INCLUDE "genericHeader.tmpl" %]
5
[% END %]
2 6
      <script language="JavaScript">
3 7
function submitform(formObj) {
4 8

  
......
44 48
          
45 49
        
46 50
				<p><span class="greenbold">Step 1: Create an Account</span> <br>
47
		   			Create an account by registering with the <a href="[% cgiPrefix %]/ldapweb.cgi?cfg=[%cfg%]">KNB</a>.
51
		   			Create an account by registering with the <a href="@cgi-prefix@/ldapweb.cgi?cfg=[%cfg%]">KNB</a>.
48 52

  
49 53
					Many scientists will already have accounts in the KNB, especially those 
50 54
					from institutions like NCEAS and LTER. If you already have an account 
......
61 65
		[% END %]
62 66
	  
63 67
      [% END %]
64
<form method="post" action="[% cgiPrefix %]/register-dataset.cgi" onsubmit="return submitform(this);" >
68
  <menu>
69
<form method="post" action="@cgi-prefix@/register-dataset.cgi" onsubmit="return submitform(this);" >
65 70
    <input type="hidden" name="stage" value="login"> 
66 71
    <input type="hidden" name="username" value=""> 
67 72
    <input type="hidden" name="cfg" value="[%cfg%]"> 
......
123 128
      </tr>
124 129
    </table>
125 130
  </form>
131
  </menu>
132
  
133
  Dont have an account yet? <a href="@cgi-prefix@/ldapweb.cgi?cfg=[%cfg%]">Create a new account</a>
134
  <br />
135
  Forgot your password? <a href="@cgi-prefix@/ldapweb.cgi?cfg=[%cfg%]&amp;stage=resetpass">Reset your password</a>
126 136

  
127
  <p>  
128
  Dont have an account yet? <a href="[% cgiPrefix %]/ldapweb.cgi?cfg=[%cfg%]">Create a new account</a>
129
  <br />
130
  Forgot your password? <a href="[% cgiPrefix %]/ldapweb.cgi?cfg=[%cfg%]&amp;stage=resetpass">Reset your password</a>
131
  </p>
132
[% INCLUDE $templtes.footer %]
137
[% IF cfg == 'nceas' %]
138
  [% INCLUDE "nceasFooter.tmpl" %]
139
[% ELSE %]
140
  [% INCLUDE "genericFooter.tmpl" %]
141
[% END %]  
lib/style/common/templates/nceasHeader.tmpl
10 10
  <script language="Javascript" type="text/JavaScript"
11 11
    src="[% styleCommonPath %]/branding.js"></script>
12 12
  <script language="Javascript" type="text/javascript"
13
    src="[% styleSkinsPath %]/nceas/navigation.js"></script>
14
  <link rel="stylesheet" type="text/css"
15
    href="[% styleSkinsPath %]/nceas/nceas.css">
13
    src="@systemidserver@@style-skins-path@/nceas/navigation.js"></script>
16 14
</head>
17 15
<body id="Overview" onload="loginStatus('[% metacatUrl %]', '[% cgiPrefix %]');">
18 16
  <div id="main_wrapper">
src/perl/ldapweb.cgi
49 49
my $TIMEOUT = 20;
50 50
my $mainldapdownmessage = "The main ldap server " . $mainldapurl . " is down!";
51 51

  
52
# 1.8.1 temporary baseUrl fix
53
my $baseUrl = "@systemidserver@@servlet-path@";
54
$baseUrl =~ s/metacat$//;
55

  
52 56
# Get the CGI input variables
53 57
my $query = new CGI;
54 58

  
......
105 109

  
106 110
my $cfg = $query->param('cfg');
107 111

  
112
# 1.8.1 temporary header/footer fixder =
113

  
114
my $header = ($cfg eq 'nceas') ? 'nceasHeader.tmpl' : '@defaultHeader@';
115
my $footer = ($cfg eq 'nceas') ? 'nceasFooter.tmpl' : '@defaultFooter@';
116

  
108 117
# define the possible stages
109 118
my %stages = (
110 119
              'initregister'      => \&handleInitRegister,
......
143 152
  my $templateVars = { stage => "register", cfg => $cfg };
144 153
  #$$templateVars{'orgList'} = \@orglist;
145 154
  $$templateVars{'orgList'} = \@orglist;
146
  $template->process( "@defaultHeader@", $templateVars);
155
  $$templateVars{'baseUrl'} = $baseUrl;
156
  $template->process( $header, $templateVars);
147 157
  $template->process( "@register@", $templateVars);
148
  $template->process( "@defaultFooter@", $templateVars);
158
  $template->process( $footer, $templateVars);
149 159

  
150 160
  exit();
151 161
}
......
178 188
                             allParams => $allParams,
179 189
                             errorMessage => $errorMessage };
180 190
        $$templateVars{'orgList'} = \@orglist;
181
        $template->process( "@defaultHeader@", $templateVars);
191
        $$templateVars{'baseUrl'} = $baseUrl;
192
        $template->process( $header, $templateVars);
182 193
        $template->process( "@register@", $templateVars);
183
        $template->process( "@defaultFooter@", $templateVars);
194
        $template->process( $footer, $templateVars);
184 195
        exit(0);
185 196
    } else {
186 197
        my $o = $query->param('o');    
......
219 230
                           allParams => $allParams,
220 231
                           foundAccounts => $found };
221 232
      $$templateVars{'orgList'} = \@orglist;
222
      $template->process( "@defaultHeader@", $templateVars);
233
      $$templateVars{'baseUrl'} = $baseUrl;
234
      $template->process( $header, $templateVars);
223 235
      $template->process( "@registerMatch@", $templateVars);
224 236
      $template->process( "@register@", $templateVars);
225
      $template->process( "@defaultFooter@", $templateVars);
237
      $template->process( $footer, $templateVars);
226 238

  
227 239
    # Otherwise, create a new user in the LDAP directory
228 240
    } else {
......
287 299
                             allParams => $allParams,
288 300
                             errorMessage => $errorMessage };
289 301
        $$templateVars{'orgList'} = \@orglist;
290
        $template->process( "@defaultHeader@", $templateVars);
302
        $$templateVars{'baseUrl'} = $baseUrl;
303
        $template->process( $header, $templateVars);
291 304
        $template->process( "@defaultChangePass@", $templateVars);
292
        $template->process( "@defaultFooter@", $templateVars);
305
        $template->process( $footer, $templateVars);
293 306
        exit(0);
294 307
    }
295 308

  
......
304 317

  
305 318
        my $dn = "uid=" . $query->param('uid') . "," . $config_dn->{$o};;
306 319
        if ($query->param('o') =~ "LTER") {
307
            $template->process( "@defaultHeader@");
320
            $template->process( $header);
308 321
            $template->process( "@registerLter@");
309
            $template->process( "@defaultFooter@");
322
            $template->process( $footer);
310 323
        } else {
311 324
            my $errorMessage = changePassword(
312 325
                    $dn, $query->param('userPassword'), 
......
317 330
                                     allParams => $allParams,
318 331
                                     errorMessage => $errorMessage };
319 332
                $$templateVars{'orgList'} = \@orglist;
320
                $template->process( "@defaultHeader@", $templateVars);
333
                $$templateVars{'baseUrl'} = $baseUrl;
334
                $template->process( $header, $templateVars);
321 335
                $template->process( "@defaultChangePass@", $templateVars);
322
                $template->process( "@defaultFooter@", $templateVars);
336
                $template->process( $footer, $templateVars);
323 337
                exit(0);
324 338
            } else {
325 339
                my $templateVars = { stage => "changepass",
326 340
                                     cfg => $cfg,
327 341
                                     allParams => $allParams };
328 342
                $$templateVars{'orgList'} = \@orglist;
329
                $template->process( "@defaultHeader@", $templateVars);
343
                $$templateVars{'baseUrl'} = $baseUrl;
344
                $template->process( $header, $templateVars);
330 345
                $template->process( "@changePassSuccess@", $templateVars);
331
                $template->process( "@defaultFooter@", $templateVars);
346
                $template->process( $footer, $templateVars);
332 347
                exit(0);
333 348
            }
334 349
        }
......
339 354
                             allParams => $allParams,
340 355
                             errorMessage => $errorMessage };
341 356
        $$templateVars{'orgList'} = \@orglist;
342
        $template->process( "@defaultHeader@", $templateVars);
357
        $$templateVars{'baseUrl'} = $baseUrl;
358
        $template->process( $header, $templateVars);
343 359
        $template->process( "@defaultChangePass@", $templateVars);
344
        $template->process( "@defaultFooter@", $templateVars);
360
        $template->process( $footer, $templateVars);
345 361
        exit(0);
346 362
    }
347 363
}
......
360 376
                         allParams => $allParams,
361 377
                         errorMessage => $errorMessage };
362 378
    $$templateVars{'orgList'} = \@orglist;
363
    $template->process( "@defaultHeader@", $templateVars);
379
    $$templateVars{'baseUrl'} = $baseUrl;
380
    $template->process( $header, $templateVars);
364 381
    $template->process( "@defaultChangePass@", $templateVars);
365
    $template->process( "@defaultFooter@", $templateVars);
382
    $template->process( $footer, $templateVars);
366 383
    exit(0);
367 384
}
368 385

  
......
397 414
                             allParams => $allParams,
398 415
                             errorMessage => $errorMessage };
399 416
        $$templateVars{'orgList'} = \@orglist;
400
        $template->process( "@defaultHeader@", $templateVars);
417
        $$templateVars{'baseUrl'} = $baseUrl;
418
        $template->process( $header, $templateVars);
401 419
        $template->process( "@defaultResetPass@", $templateVars);
402
        $template->process( "@defaultFooter@", $templateVars);
420
        $template->process( $footer, $templateVars);
403 421
        exit(0);
404 422
    }
405 423

  
......
407 425
    my $o = $query->param('o');
408 426
    my $dn = "uid=" . $query->param('uid') . "," . $config_dn->{$o};
409 427
    if ($query->param('o') =~ "LTER") {
410
        $template->process( "@defaultHeader@");
428
        $template->process( $header);
411 429
        $template->process( "@registerLter@");
412
        $template->process( "@defaultFooter@");
430
        $template->process( $footer);
413 431
        exit(0);
414 432
    } else {
415 433
        my $errorMessage = "";
......
432 450
                                 allParams => $allParams,
433 451
                                 errorMessage => $errorMessage };
434 452
            $$templateVars{'orgList'} = \@orglist;
435
            $template->process( "@defaultHeader@", $templateVars);
453
            $$templateVars{'baseUrl'} = $baseUrl;
454
            $template->process( $header, $templateVars);
436 455
            $template->process( "@defaultResetPass@", $templateVars);
437
            $template->process( "@defaultFooter@", $templateVars);
456
            $template->process( $footer, $templateVars);
438 457
            exit(0);
439 458
        } else {
440 459
            my $errorMessage = sendPasswordNotification($query->param('uid'),
......
444 463
                                 allParams => $allParams,
445 464
                                 errorMessage => $errorMessage };
446 465
            $$templateVars{'orgList'} = \@orglist;
447
            $template->process( "@defaultHeader@", $templateVars);
466
            $$templateVars{'baseUrl'} = $baseUrl;
467
            $template->process( $header, $templateVars);
448 468
            $template->process( "@resetPassSuccess@", $templateVars);
449
            $template->process( "@defaultFooter@", $templateVars);
469
            $template->process( $footer, $templateVars);
450 470
            exit(0);
451 471
        }
452 472
    }
......
465 485
                         allParams => $allParams,
466 486
                         errorMessage => $errorMessage };
467 487
    $$templateVars{'orgList'} = \@orglist;
468
    $template->process( "@defaultHeader@", $templateVars);
488
    $$templateVars{'baseUrl'} = $baseUrl;
489
    $template->process( $header, $templateVars);
469 490
    $template->process( "@defaultResetPass@", $templateVars);
470
    $template->process( "@defaultFooter@", $templateVars);
491
    $template->process( $footer, $templateVars);
471 492
    exit(0);
472 493
}
473 494

  
......
749 770
    my $allParams = shift;
750 771

  
751 772
    if ($query->param('o') =~ "LTER") {
752
        $template->process( "@defaultHeader@");
773
        $template->process( $header);
753 774
        $template->process( "@registerLter@");
754
        $template->process( "@defaultFooter@");
775
        $template->process( $footer);
755 776
    } else {
756 777

  
757 778
        # Be sure the passwords match
......
762 783
                                 allParams => $allParams,
763 784
                                 errorMessage => $errorMessage };
764 785
            $$templateVars{'orgList'} = \@orglist;
765
            $template->process( "@defaultHeader@", $templateVars);
786
            $$templateVars{'baseUrl'} = $baseUrl;
787
            $template->process( $header, $templateVars);
766 788
            $template->process( "@registerFailed@", $templateVars);
767 789
            $template->process( "@register@", $templateVars);
768
            $template->process( "@defaultFooter@", $templateVars);
790
            $template->process( $footer, $templateVars);
769 791
            exit(0);
770 792
        }
771 793

  
......
823 845
                                 allParams => $allParams,
824 846
                                 errorMessage => $result->error };
825 847
            $$templateVars{'orgList'} = \@orglist;
826
            $template->process( "@defaultHeader@", $templateVars);
848
            $$templateVars{'baseUrl'} = $baseUrl;
849
            $template->process( $header, $templateVars);
827 850
            $template->process( "@registerFailed@", $templateVars);
828 851
            $templateVars    = { stage => "register",
829 852
                                 cfg => $cfg,
830 853
                                 allParams => $allParams };
831 854
            $$templateVars{'orgList'} = \@orglist;
855
            $$templateVars{'baseUrl'} = $baseUrl;
832 856
            $template->process( "@register@", $templateVars);
833
            $template->process( "@defaultFooter@", $templateVars);
857
            $template->process( $footer, $templateVars);
834 858
        } else {
835 859
            my $templateVars    = { cfg => $cfg };
836
            $template->process( "@defaultHeader@", $templateVars);
860
            $$templateVars{'baseUrl'} = $baseUrl;
861
            $template->process( $header, $templateVars);
837 862
            $template->process( "@registerSuccess@", $templateVars);
838
            $template->process( "@defaultFooter@", $templateVars);
863
            $template->process( $footer, $templateVars);
839 864
        }
840 865

  
841 866
        $ldap->unbind;   # take down session
......
851 876
                       cfg => $cfg,
852 877
                       errorMessage => $errorMessage };
853 878
  $$templateVars{'orgList'} = \@orglist;
854
  $template->process( "@defaultHeader@", $templateVars);
855
  $template->process( "@defaultFooter@", $templateVars);
879
  $$templateVars{'baseUrl'} = $baseUrl;
880
  $template->process( $header, $templateVars);
881
  $template->process( $footer, $templateVars);
856 882
  exit(0);
857 883
}
858 884

  
......
913 939
                           allParams => $allParams,
914 940
                           foundAccounts => $found };
915 941
      $$templateVars{'orgList'} = \@orglist;
916
      $template->process( "@defaultHeader@", $templateVars);
942
      $$templateVars{'baseUrl'} = $baseUrl;
943
      $template->process( $header, $templateVars);
917 944
      $template->process( "@searchResults@", $templateVars);
918
      $template->process( "@defaultFooter@", $templateVars);
945
      $template->process( $footer, $templateVars);
919 946

  
920 947
    } else {
921 948
      $found = "No entries matched your criteria.  Please try again\n";
......
925 952
                           allParams => $allParams,
926 953
                           foundAccounts => $found };
927 954
      $$templateVars{'orgList'} = \@orglist;
928
      $template->process( "@defaultHeader@", $templateVars);
955
      $$templateVars{'baseUrl'} = $baseUrl;
956
      $template->process( $header, $templateVars);
929 957
      $template->process( "@searchResults@", $templateVars);
930
      $template->process( "@defaultFooter@", $templateVars);
958
      $template->process( $footer, $templateVars);
931 959

  
932 960
    }
933 961

  
......
1009 1037
    my $errorMessage = shift;
1010 1038
    my $templateVars = { cfg => $cfg,
1011 1039
                         errorMessage => $errorMessage };
1012
    $template->process( "@defaultHeader@", $templateVars);
1040
    $$templateVars{'baseUrl'} = $baseUrl;
1041
    $template->process( $header, $templateVars);
1013 1042
    $template->process( "@ldapMainServerFailure@", $templateVars);
1014
    $template->process( "@defaultFooter@", $templateVars);
1043
    $template->process( $footer, $templateVars);
1015 1044
    exit(0);   
1016 1045
   }
1017 1046
    
src/perl/register-dataset.cgi
179 179
if ($FORM::debug) {
180 180
    $debug = $FORM::debug;
181 181
}
182

  
183
# 1.8.1 temporary baseUrl fix
184
my $baseUrl = $metacatUrl;
185
$baseUrl =~ s/metacat$//;
186

  
182 187
my $lat = $config->get('lat');
183 188
my $lon = $config->get('lon');
184 189

  
......
213 218
$$templateVars{'orgabbrev'} = $orgabbrev;
214 219
$$templateVars{'orgurl'} = $orgurl;
215 220
$$templateVars{'orgfilter'} = $orgfilter;
221
$$templateVars{'baseUrl'} = $baseUrl;
216 222

  
217 223
debug("Registry: Initialized -- stage set: $FORM::stage");
218 224

  
......
234 240
    exit(0);
235 241
}
236 242

  
243
# FIXME: temporary 1.8.1 fix to prevent missing upload directory from causing errors
244
if (not -W $tmpdir) {
245
    debug("Registry Error: Can't write files to $tmpdir, disabling file uploads");
246
    #push(@errorMessages, "Unable to write files to temporary folder. Email sysadmin.");
247
    $hasUpload = 'false';
248
}
249

  
237 250
# Process the form based on stage parameter. 
238 251
if ($FORM::stage =~ "loginform") {
239 252
    print "Content-type: text/html\n\n";
......
1038 1051
    my $fileNum = shift;
1039 1052
    my $fileHash = param("upload_$fileNum");
1040 1053
    my $fileName = param("uploadname_$fileNum");
1054
    my $filePerm = param("uploadperm_$fileNum");
1041 1055
    my $contentType = param("uploadtype_$fileNum");
1042 1056
    my $cleanName = $fileName;
1043 1057

  
......
1086 1100
                      'fileName'    => $cleanName,
1087 1101
                      'fileSize'    => $fileSize,
1088 1102
                      'fileHash'    => $fileHash,
1103
                      'filePerm'    => $filePerm,
1089 1104
                      'contentType' => $contentType,
1090 1105
                      'url'         => $uploadUrl,
1091 1106
                      'entityType'  => $entityType,
......
1115 1130
    # file is in Metacat, generate the pertinent EML elements
1116 1131
    my $contentType = uploadInfo($fileName)->{'Content-Type'};
1117 1132

  
1133
    # occasionally CGI.pm doesn't get the file info.  In this case,
1134
    # use a default MIME type of text/plain.  Seems fixed in the newer CGI.pm:
1135
    # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=313141
1136
    if (!$contentType) {
1137
        $contentType = 'text/plain';
1138
    }
1139

  
1118 1140
    my %dataInfo = ( 'fileName'    => $fileName,
1119 1141
                     'fileHash'    => $fileHash,
1120 1142
                     'contentType' => $contentType,
......
1175 1197
    my $response = $metacat->upload($docid, $data);
1176 1198
    if (!$response) {
1177 1199
        my $uploadMsg = $metacat->getMessage();
1200
        push(@errorMessages, "Failed to upload file. Error was: $uploadMsg\n");
1178 1201
        debug("Registry: Upload -- Error is: $uploadMsg");
1179 1202
    } else {
1180 1203
        debug("Registry: Upload -- Success! New docid $docid");
......
1287 1310
                  $roleName = $defaultRole;
1288 1311
                }
1289 1312

  
1290
                #debug("XXXXX role name: " . $roleName);
1291 1313
                push (@{$orig{$roleName}}, [$first, $last, $origRole]);
1292 1314
            }
1293 1315
        }
......
1364 1386
    my $skinAccess = allowElement($username, 'all');
1365 1387

  
1366 1388
    my $accessList = "";
1389
    # form name => EML permission; roles akin to Apache model
1390
    my %accessRoles = (
1391
        'public'  => 'allow',
1392
        'private' => 'deny',
1393
    );
1367 1394

  
1368 1395
    while ( my ($docid, $data) = each(%entityObjects) ) {
1396
        my $defaultAccess = $accessRoles{$data->{'filePerm'}};
1369 1397
        my $accessStub = qq|<additionalMetadata>
1370 1398
            <describes>$data->{'distribid'}</describes>
1371 1399
                <access authSystem="knb" order="denyFirst">
1372 1400
                    $skinAccess
1373 1401
                    $userAccess 
1374
                    <deny>
1402
                    <$defaultAccess>
1375 1403
                        <principal>public</principal>
1376 1404
                        <permission>read</permission>
1377
                    </deny>
1405
                    </$defaultAccess>
1378 1406
                </access>
1379 1407
      </additionalMetadata>
1380 1408
    |;
......
1411 1439
        foreach my $x (@$a_ref) {
1412 1440
            my ($kw, $kwType) = @$x;
1413 1441
            $kwElem .= "<keyword ";
1414
            if (hasContent($kwType) && $kwType != "None") {
1442
            if (hasContent($kwType) && $kwType ne "None") {
1415 1443
                 $kwElem.= "keywordType=\"".lc($kwType)."\"";
1416 1444
            }
1417 1445
            $kwElem .= ">$kw</keyword>\n";
......
2172 2200
                    $aoCount++;
2173 2201
                }
2174 2202
            }
2203
            $$templateVars{'origEmail'} = findValue($node, '../electronicMailAddress');
2204
            $$templateVars{'origNameOrg'} = findValue($node, '../organizationName');
2175 2205
        }
2176 2206

  
2177 2207
    $results = $doc->findnodes('//dataset/creator/organizationName');
......
2236 2266
                    $$templateVars{"origNamefirst$aoCount"} =  findValue($tempNode, './givenName');
2237 2267
                    $$templateVars{"origNamelast$aoCount"} =  findValue($tempNode, './surName');
2238 2268
                    $$templateVars{"origRole$aoCount"} = findValue($tempNode, '../role');
2239
                    $aoCount++;           
2269
                    $aoCount++;
2240 2270
                }
2241 2271
            }
2242 2272
     }
......
2287 2317

  
2288 2318
    my $count = 1;
2289 2319
    foreach $node ($results->get_nodelist) {
2290
	$tempResult = $node->findnodes('./keyword');
2291
	if ($tempResult->size() > 1) {
2292
	    errMoreThanOne("keyword");
2293
	} else {
2294
	    foreach $tempNode ($tempResult->get_nodelist) {
2295
		$$templateVars{"keyword$count"} = $tempNode->textContent();
2296
		if ($tempNode->hasAttributes()) {
2297
		    my @attlist = $tempNode->attributes();
2298
                    my $tmp = $attlist[0]->value;  #convert the first letter to upper case
2299
		    $tmp =~ s/\b(\w)/\U$1/g;
2300
		    $$templateVars{"kwType$count"} = $tmp;
2301
		}  
2302
	    }
2303
	}
2304
	$$templateVars{"kwTh$count"} = findValue($node, "keywordThesaurus");
2305
        $count++;
2320
        $tempResult = $node->findnodes('./keyword');
2321
        foreach $tempNode ($tempResult->get_nodelist) {
2322
            $$templateVars{"keyword$count"} = $tempNode->textContent();
2323
            $$templateVars{"kwTh$count"} = findValue($node, "keywordThesaurus");
2324

  
2325
            if ($tempNode->hasAttributes()) {
2326
                my @attlist = $tempNode->attributes();
2327
                my $tmp = $attlist[0]->value;  #convert the first letter to upper case
2328
                $tmp =~ s/\b(\w)/\U$1/g;
2329
                $$templateVars{"kwType$count"} = $tmp;
2330
            }
2331
            $count++;
2332
        }
2306 2333
    }
2307 2334
    $$templateVars{'keyCount'} = $count;
2308 2335
    if($count > 0 ){
......
2523 2550
            dontOccur($node, "../positionName|../onlineURL|../userId", 
2524 2551
              "positionName, onlineURL, userId in contact tag");
2525 2552
            dontOccur($node, "./saluation", "saluation in contact tag");                
2526
        
2553

  
2527 2554
            $tempResult = $node->findnodes('../address|../phone|../electronicmailAddress|../organizationName');
2528 2555
            if ($tempResult->size > 0) {
2529 2556
                $$templateVars{'origNamefirstContact'} = findValue($node, 'givenName');
2530 2557
                $$templateVars{'origNamelastContact'} = findValue($node, 'surName');
2531
    
2558

  
2532 2559
                my $tempResult2 = $node->findnodes('../address');
2533 2560
                if ($tempResult2->size > 1) {
2534 2561
                    errMoreThanOne("address");
......
2541 2568
                        $$templateVars{'origCountryContact'} = findValue($tempNode2, 'country');
2542 2569
                    }
2543 2570
                }
2544
            
2571

  
2545 2572
                my $tempResult3 = $node->findnodes('../phone');
2546 2573
                if ($tempResult3->size > 2) {
2547 2574
                    errMoreThanN("phone");
......
2566 2593
                $$templateVars{'origNamelastContact'} = findValue($node, 'surName');
2567 2594
                $$templateVars{'origNameOrgContact'} = findValue($node, '../organizationName');
2568 2595
            }
2596
            $$templateVars{'origEmail'} = findValue($node, '../electronicMailAddress');
2597
            $$templateVars{'origNameOrg'} = findValue($node, '../organizationName');
2598

  
2569 2599
        }
2570 2600
    }
2571 2601
    
......
2678 2708
   
2679 2709
    ########################################################
2680 2710

  
2681

  
2682 2711
    dontOccur($doc, "./dataTable", "dataTable");
2683 2712
    dontOccur($doc, "./spatialRaster", "spatialRaster");
2684 2713
    dontOccur($doc, "./spatialVector", "spatialVector");
2685 2714
    dontOccur($doc, "./storedProcedure", "storedProcedure");
2686 2715
    dontOccur($doc, "./view", "view");
2716

  
2687 2717
    dontOccur($doc, "./otherEntity", "otherEntity");
2688 2718
    dontOccur($doc, "./references", "references");
2689 2719
    
......
2984 3014
		$htmldoc .= "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\">";
2985 3015
		$htmldoc .= "<html><head><title>Dataset Description: ".$docid."</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"></head>";
2986 3016
		$htmldoc .= "<frameset rows=\"150,*\" cols=\"*\" frameborder=\"NO\" border=\"0\" framespacing=\"0\">";
2987
		$htmldoc .= "<frame src=\"@systemidserver@@style-skins-path@/".$FORM::cfg."/header.html\" marginwidth=\"40\" name=\"topFrame\" scrolling=\"NO\" noresize>";
3017
		$htmldoc .= "<frame src=\"@systemidserver@@style-skins-path@/".$FORM::cfg."/header.jsp\" marginwidth=\"40\" name=\"topFrame\" scrolling=\"NO\" noresize>";
2988 3018
		$htmldoc .= "<frameset cols=\"200,*\" frameborder=\"NO\" border=\"0\" framespacing=\"0\">";
2989 3019
        	$htmldoc .= "<body></body><frame src=\"@cgi-prefix@/register-dataset.cgi?cfg=".$FORM::cfg."&stage=review_frame&docid=".$docid."\" name=\"rightFrame\" scrolling=\"NO\" noresize></frame>";
2990 3020
        	$htmldoc .= "<frame src=\"@systemidserver@@servlet-path@?action=read&qformat=".$FORM::cfg."&docid=".$docid."&insertTemplate=0\" name=\"mainFrame\">";
......
3566 3596
#
3567 3597
################################################################################
3568 3598
sub mod_sendNotification {
3569
	my $title = shift;
3570
	my $contactEmailAddress = shift;
3571
	my $contactName = shift;
3572
	my $subject = shift;
3599
    my $title = shift;
3600
    my $contactEmailAddress = shift;
3601
    my $contactName = shift;
3602
    my $subject = shift;
3573 3603

  
3574
	debug($subject);
3604
    debug($subject);
3575 3605
    # send notification to the user and the moderator
3576
	my $templateVars = { 'stage' => $FORM::stage };
3577
	$$templateVars{'recipient'} = $recipient;
3578
	$$templateVars{'sender'} = $sender;
3579
	my ($x, $y, $z) = split(/\./, $FORM::docid);
3580
        my $docidWithoutRev = $x.".".$y;
3581
	$$templateVars{'docid'} = $docidWithoutRev;
3582
	$$templateVars{'comment'} = $FORM::review;
3583
	$$templateVars{'contactName'} = $contactName;
3584
	$$templateVars{'dpTitle'} = $title;
3606
    my $templateVars = { 'stage' => $FORM::stage };
3607
    $$templateVars{'recipient'} = $recipient;
3608
    $$templateVars{'sender'} = $sender;
3609
    # form doesn't handle edit without revision; append
3610
    #my ($x, $y, $z) = split(/\./, $FORM::docid);
3611
    #my $docidWithoutRev = $x.".".$y;
3612
    #$$templateVars{'docid'} = $docidWithoutRev;
3613
    $$templateVars{'docid'} = $FORM::docid;
3614
    $$templateVars{'comment'} = $FORM::review;
3615
    $$templateVars{'contactName'} = $contactName;
3616
    $$templateVars{'dpTitle'} = $title;
3585 3617

  
3586
	$$templateVars{'recipient_status'} = 'moderator';
3587
	sendNotification($mailhost, $sender, $recipient, $subject, 
3588
							$modEmailNotificationTemplate, $templateVars);
3589
	if($contactEmailAddress ne ''){
3590
		# send notification to contact email address specified in cfg   
3591
		$$templateVars{'recipient'} = $contactEmailAddress;
3592
		$$templateVars{'recipient_status'} = 'user';
3593
		sendNotification($mailhost, $sender, $contactEmailAddress, 
3594
				$subject, $modEmailNotificationTemplate, $templateVars);
3595
	}
3618
    $$templateVars{'recipient_status'} = 'moderator';
3619
    sendNotification($mailhost, $sender, $recipient, $subject, 
3620
                            $modEmailNotificationTemplate, $templateVars);
3621
    if($contactEmailAddress ne ''){
3622
        # send notification to contact email address specified in cfg   
3623
        $$templateVars{'recipient'} = $contactEmailAddress;
3624
        $$templateVars{'recipient_status'} = 'user';
3625
        sendNotification($mailhost, $sender, $contactEmailAddress, 
3626
                $subject, $modEmailNotificationTemplate, $templateVars);
3627
    }
3596 3628
}
3597 3629

  
3598 3630
################################################################################
......
3665 3697
################################################################################
3666 3698
sub toConfirmData{
3667 3699
    # Check if any invalid parameters
3668
 
3700

  
3669 3701
    my $invalidParams;
3670 3702
    if (! $error) {
3671
    	$invalidParams = validateParameters(0);
3672
    	if (scalar(@$invalidParams)) {
3673
        	$$templateVars{'status'} = 'failure';
3674
        	$$templateVars{'invalidParams'} = $invalidParams;
3675
        	$error = 1;
3676
    	}
3703
        $invalidParams = validateParameters(0);
3704
        if (scalar(@$invalidParams)) {
3705
            $$templateVars{'status'} = 'failure';
3706
            $$templateVars{'invalidParams'} = $invalidParams;
3707
            $error = 1;
3708
        }
3677 3709
    }
3678 3710

  
3679 3711
    $$templateVars{'providerGivenName'} = normalizeCD($FORM::providerGivenName);
......
3777 3809
            $$templateVars{"kwType".$keyCount} = normalizeCD($keywordTypeArray->[$i]);
3778 3810
            $$templateVars{"kwTh".$keyCount} = normalizeCD($keywordThArray->[$i]);
3779 3811
            $keyCount++;
3780
	}    
3781
    }    
3812
        }
3813
    }
3782 3814
    $$templateVars{'keyCount'} = $keyCount;
3783
    
3815

  
3784 3816
    $$templateVars{'addComments'} = normalizeCD($FORM::addComments);
3785 3817
    $$templateVars{'useConstraints'} = $FORM::useConstraints;
3786 3818
    if($FORM::useConstraints eq "other"){
......
3820 3852
    my $taxonNameArray = \@FORM::taxonName;
3821 3853
    my $taxonCount = 1;
3822 3854

  
3823
    for(my $i = 0; $i <= $#$taxonNameArray; $i++){
3855
    for (my $i = 0; $i <= $#$taxonNameArray; $i++) {
3824 3856
        if (hasContent($taxonRankArray->[$i]) && hasContent($taxonNameArray->[$i])) {
3825 3857
            debug("Registry processing keyword: trv = ".$taxonRankArray->[$i]
3826 3858
                    ." trn = ".$taxonNameArray->[$i]);
3827 3859
            $$templateVars{"taxonRankName".$taxonCount} = normalizeCD($taxonRankArray->[$i]);
3828 3860
            $$templateVars{"taxonRankValue".$taxonCount} = normalizeCD($taxonNameArray->[$i]);
3829 3861
            $taxonCount++;
3830
	}    
3862
        }
3831 3863
    }
3832 3864

  
3833 3865
    $$templateVars{'taxaCount'} = $taxonCount-1;
......
3844 3876
                $$templateVars{"upload_$upNum"} = param("upload_$upNum");
3845 3877
                $$templateVars{"uploadname_$upNum"} = param("uploadname_$upNum");
3846 3878
                $$templateVars{"uploadtype_$upNum"} = param("uploadtype_$upNum");
3879
                $$templateVars{"uploadperm_$upNum"} = param("uploadperm_$upNum");
3847 3880
            }
3848 3881
        }
3849 3882
    }
......
3862 3895
            $$templateVars{"upload_$totalFileNum"} = $fileInfo->{'fileHash'};
3863 3896
            $$templateVars{"uploadname_$totalFileNum"} = $fileInfo->{'fileName'};
3864 3897
            $$templateVars{"uploadtype_$totalFileNum"} = $fileInfo->{'contentType'};
3898
            $$templateVars{"uploadperm_$totalFileNum"} = param("uploadperm_$totalFileNum");
3865 3899
            $uploadCount++;
3866 3900
        }
3867 3901
    }
......
4105 4139
                    $$templateVars{"upload_$fileIndex"} = param($upload);
4106 4140
                    $$templateVars{"uploadname_$fileIndex"} = param("uploadname_$fileIndex");
4107 4141
                    $$templateVars{"uploadtype_$fileIndex"} = param("uploadtype_$fileIndex");
4142
                    $$templateVars{"uploadperm_$fileIndex"} = param("uploadperm_$fileIndex");
4108 4143
                    $uploadCount++;
4109 4144
                }
4110 4145
            }
src/edu/ucsb/nceas/metacat/DBTransform.java
165 165
      }
166 166
      catch (Exception e)
167 167
      {
168
        pw.println(xslSystemId + ": Error transforming document in " +
168
    	  logMetacat.error(xslSystemId + ": Error transforming document in " +
169 169
                   "DBTransform.transformXMLDocument: " +
170 170
                   e.getMessage());
171 171

  
......
247 247
      }
248 248
      catch (Exception e)
249 249
      {
250
        pw.println(xslSystemId + ": Error transforming document in " +
250
    	  logMetacat.error(xslSystemId + ": Error transforming document in " +
251 251
                   "DBTransform.transformXMLDocument: " +
252 252
                   e.getMessage());
253 253

  
build.properties
113 113
compile.optimize=true
114 114

  
115 115
# paths to be indexed when document is inserted. these are the paths which will be searched often
116
indexPaths=organizationName,originator/individualName/surName,originator/individualName/givenName,originator/organizationName,creator/individualName/surName,creator/individualName/givenName,creator/organizationName,dataset/title,keyword,geographicCoverage/boundingCoordinates/northBoundingCoordinate,geographicCoverage/boundingCoordinates/southBoundingCoordinate,geographicCoverage/boundingCoordinates/westBoundingCoordinate,geographicCoverage/boundingCoordinates/eastBoundingCoordinate,eastBoundingCoordinate,title,entityName,individualName/surName,abstract/para,surName,givenName,para,geographicDescription,literalLayout,eastbc,northbc,westbc,southbc,dataset/access/allow/principal,entityName,taxonRankValue,dataset/dataTable/physical/distribution/online/url,dataset/spatialRaster/physical/distribution/online/url,@packageId,/reviewHistory/review/packageId,EcogridRegEntry/description,EcogridRegEntry/serviceName,EcogridRegEntry/endPoint,associatedParty/individualName/surName,associatedParty/organizationName,coverage/temporalCoverage/singleDateTime/alternativeTimeScale/timeScaleName,coverage/temporalCoverage/rangeOfDates/beginDate/alternativeTimeScale/timeScaleName,coverage/temporalCoverage/rangeOfDates/endDate/alternativeTimeScale/timeScaleName,placekey,idinfo/citation/citeinfo/title,idinfo/citation/citeinfo/origin,idinfo/keywords/theme/themekey,abstract,dataset/dataTable/physical/distribution/online/url/@function,dataset/spatialRaster/physical/distribution/online/url/@function
116
indexPaths=organizationName,originator/individualName/surName,originator/individualName/givenName,originator/organizationName,creator/individualName/surName,creator/individualName/givenName,creator/organizationName,dataset/title,keyword,geographicCoverage/boundingCoordinates/northBoundingCoordinate,geographicCoverage/boundingCoordinates/southBoundingCoordinate,geographicCoverage/boundingCoordinates/westBoundingCoordinate,geographicCoverage/boundingCoordinates/eastBoundingCoordinate,eastBoundingCoordinate,title,entityName,individualName/surName,abstract/para,surName,givenName,para,geographicDescription,literalLayout,eastbc,northbc,westbc,southbc,dataset/access/allow/principal,entityName,taxonRankValue,dataset/dataTable/physical/distribution/online/url,dataset/spatialRaster/physical/distribution/online/url,@packageId,/reviewHistory/review/packageId,EcogridRegEntry/description,EcogridRegEntry/serviceName,EcogridRegEntry/endPoint,associatedParty/individualName/surName,associatedParty/organizationName,coverage/temporalCoverage/singleDateTime/alternativeTimeScale/timeScaleName,coverage/temporalCoverage/rangeOfDates/beginDate/alternativeTimeScale/timeScaleName,coverage/temporalCoverage/rangeOfDates/endDate/alternativeTimeScale/timeScaleName,placekey,idinfo/citation/citeinfo/title,idinfo/citation/citeinfo/origin,idinfo/keywords/theme/themekey,abstract,dataset/dataTable/physical/distribution/online/url/@function,dataset/spatialRaster/physical/distribution/online/url/@function,taxonomicClassification/taxonRankValue,taxonomicClassification/taxonRankName,northBoundingCoordinate,southBoundingCoordinate,westBoundingCoordinate,eastBoundingCoordinate,additionalMetadata/moderatorComment
117 117

  
118 118
# Flag to install ecogird or not. Possible values are true or false
119 119
install.ecogrid=false

Also available in: Unified diff