Project

General

Profile

« Previous | Next » 

Revision 1989

Added studyExtent and samplingDescription fields to the registry to accomodate
Sandy's request for a temporalDescription field. This is a little more than
she wanted, but it was needed to satisfy EML minimum requirements.

View differences:

lib/style/common/templates/entryForm.tmpl
1288 1288
        <p>
1289 1289
          <input type="button" value="Add paragraph" id="addparabutton1"
1290 1290
                 onClick="addParagraph()">
1291
        </p><br>
1292
        <p class="label">Description of Study Extent</p>
1293
        <p>Describe the temporal, spatial and taxonomic extent of the study,
1294
        supplementing the information on coverage provided above.  For example,
1295
        if the temporal coverage of the data is 1990-2000, you might provide 
1296
        details about any years that were missed or the months in which sampling
1297
        occurred.</p>
1298
        <p>
1299
          <textarea rows="5" cols="80" name="studyExtentDescription">[% studyExtentDescription %]</textarea>
1300
        </p><br>
1301
        <p class="label">Sampling Description</p>
1302
        <p>Describe the sampling design of the study.  For example, you might 
1303
        describe the way in which treatments were assigned to sampling units.
1291 1304
        </p>
1305
        <p>
1306
          <textarea rows="5" cols="80" name="samplingDescription">[% samplingDescription %]</textarea>
1307
        </p>
1292 1308
      </td>
1293 1309
     </tbody>
1294 1310
   </table>
lib/style/common/templates/confirmData.tmpl
503 503
    <hr>
504 504
    <a name="Methods"></a>
505 505
    <p><b><font size="4" color="#0000ff">METHODS</font></b></p>
506
    <p><b><font size="-1">Method Title:</font></b>  [%methodTitle%]</p>
506
    <p><b><font size="-1">Method Title:</font></b> [%methodTitle%]</p>
507 507
    [% FOREACH para = methodPara %]
508
        <p><b><font size="-1">Paragraph:</font></b>  [%para%] </p>
508
        <p><b><font size="-1">Paragraph:</font></b> [%para%] </p>
509 509
    [% END %]
510
    <p><b><font size="-1">Study Extent:</font></b> [%studyExtentDescription%]</p>
511
    <p><b><font size="-1">Sampling Description:</font></b> [%samplingDescription%]</p>
510 512

  
511 513
<hr>
512 514
<a name="DataSetContactAddress"></a>
......
725 727
  [% FOREACH para = methodPara %]
726 728
      <input type="hidden" name="methodPara" value="[%para%]">
727 729
  [% END %]
730
  <input type="hidden" name="studyExtentDescription" value="[%studyExtentDescription%]">
731
  <input type="hidden" name="samplingDescription" value="[%samplingDescription%]">
728 732

  
729 733
<table cellspacing="0" border="0" cellpadding="9" width="800" bgcolor="#C6d6e7">
730 734
  <tr> 
src/perl/register-dataset.cgi
321 321
            
322 322
            $xmldoc =~ s/docid/$docid/;
323 323
    
324
            #my $testFile = "/tmp/test.xml";
325
            #open (TFILE,">$testFile") || die ("Cant open xml file...\n");
326
            #print TFILE $xmldoc;
327
            #close(TFILE);
324
            my $testFile = "/tmp/test.xml";
325
            open (TFILE,">$testFile") || die ("Cant open xml file...\n");
326
            print TFILE $xmldoc;
327
            close(TFILE);
328 328
    
329 329
            $notunique = insertMetadata($xmldoc, $docid);
330 330
            #  if (!$notunique) {
......
337 337

  
338 338
            # The id wasn't unique, so update our lastid file
339 339
            if ($notunique eq "NOT_UNIQUE") {
340
                debug( "Registry: Updating lastid (B1.1)");
340 341
                updateLastId($defaultScope);
341 342
            }
342 343
        }
......
448 449
  my $docid = shift;
449 450

  
450 451
  my $notunique = "SUCCESS";
452
  debug("Registry: Starting insert (D1)");
451 453
  my $response = $metacat->insert($docid, $xmldoc);
452 454
  if (! $response) {
455
    debug("Registry: Response gotten (D2)");
453 456
    my $errormsg = $metacat->getMessage();
457
    debug("Registry: Error is (D3): ".$errormsg);
454 458
    if ($errormsg =~ /is already in use/) {
455 459
      $notunique = "NOT_UNIQUE";
456 460
      #print "Accession number already used: $docid\n";
......
464 468
      $notunique = $errormsg;
465 469
    }
466 470
  }
471
  debug("Registry: Ending insert (D4)");
467 472

  
468 473
  return $notunique;
469 474
}
......
644 649
        unless hasContent($longDeg1);
645 650
    }
646 651

  
652
    push(@invalidParams, 
653
        "You must provide a method description if you provide a method title.")
654
        if (hasContent($FORM::methodTitle) && !(scalar(@FORM::methodPara) > 0));
655
    push(@invalidParams, 
656
        "You must provide a method description if you provide a study extent description.")
657
        if (hasContent($FORM::studyExtentDescription) && !(scalar(@FORM::methodPara) > 0));
658
    push(@invalidParams, 
659
        "You must provide both a study extent description and a sampling description, or neither.")
660
        unless (hasContent($FORM::studyExtentDescription) && hasContent($FORM::samplingDescription));
661

  
647 662
    push(@invalidParams, "Contact first name is missing.")
648 663
    unless (hasContent($FORM::origNamefirstContact) || 
649 664
        $FORM::useOrigAddress);
......
1168 1183
        for (my $i = 0; $i < scalar(@FORM::methodPara); $i++) {
1169 1184
            $methods .= "<para>$FORM::methodPara[$i]</para>\n";
1170 1185
        }
1171
        $methods .= "</section></description></methodStep></methods>\n";
1186
        $methods .= "</section></description></methodStep>\n";
1187
        if (hasContent($FORM::studyExtentDescription)) {
1188
            $methods .= "<sampling><studyExtent><description>\n";
1189
            $methods .= "<para>$FORM::studyExtentDescription</para>\n";
1190
            $methods .= "</description></studyExtent>\n";
1191
            $methods .= "<samplingDescription>\n";
1192
            $methods .= "<para>$FORM::samplingDescription</para>\n";
1193
            $methods .= "</samplingDescription>\n";
1194
            $methods .= "</sampling>\n";
1195
        }
1196
        $methods .= "</methods>\n";
1172 1197
        $doc .= $methods;
1173 1198
    }
1174 1199

  
......
1884 1909
        }
1885 1910
    }
1886 1911
    
1887
    $results = $doc->findnodes('//dataset/methods/methodStep/description/section');
1912
    $results = $doc->findnodes(
1913
            '//dataset/methods/methodStep/description/section');
1888 1914
    debug("Registry: Number methods: ".$results->size());
1889 1915
    if ($results->size() > 1) {
1890 1916
        errMoreThanN("methods/methodStep/description/section");    
1891 1917
    } else {
1892
        dontOccur($doc, "//methodStep/citation", "methodStep/citation");
1893
        dontOccur($doc, "//methodStep/protocol", "methodStep/protocol");
1894
        dontOccur($doc, "//methodStep/instrumentation", "methodStep/instrumentation");
1895
        dontOccur($doc, "//methodStep/software", "methodStep/software");
1896
        dontOccur($doc, "//methodStep/subStep", "methodStep/subStep");
1897
        dontOccur($doc, "//methodStep/dataSource", "methodStep/dataSource");
1898
        dontOccur($doc, "//methods/sampling", "methods/sampling");
1899
        dontOccur($doc, "//methods/qualityControl", "methods/qualityControl");
1900 1918

  
1901 1919
        my @methodPara;
1902 1920
        foreach $node ($results->get_nodelist) {
......
1920 1938
        }
1921 1939
    }
1922 1940

  
1941
    $results = $doc->findnodes(
1942
            '//dataset/methods/sampling/studyExtent/description/para');
1943
    if ($results->size() > 1) {
1944
        errMoreThanN("methods/sampling/studyExtent/description/para");    
1945
    } else {
1946
        foreach $node ($results->get_nodelist) {
1947
            my $studyExtentDescription = $node->textContent();
1948
            $$templateVars{'studyExtentDescription'} = $studyExtentDescription;
1949
        }
1950
    }
1951

  
1952
    $results = $doc->findnodes(
1953
            '//dataset/methods/sampling/samplingDescription/para');
1954
    if ($results->size() > 1) {
1955
        errMoreThanN("methods/sampling/samplingDescription/para");    
1956
    } else {
1957
        foreach $node ($results->get_nodelist) {
1958
            my $samplingDescription = $node->textContent();
1959
            $$templateVars{'samplingDescription'} = $samplingDescription;
1960
        }
1961
    }
1962

  
1963
    dontOccur($doc, "//methodStep/citation", "methodStep/citation");
1964
    dontOccur($doc, "//methodStep/protocol", "methodStep/protocol");
1965
    dontOccur($doc, "//methodStep/instrumentation", "methodStep/instrumentation");
1966
    dontOccur($doc, "//methodStep/software", "methodStep/software");
1967
    dontOccur($doc, "//methodStep/subStep", "methodStep/subStep");
1968
    dontOccur($doc, "//methodStep/dataSource", "methodStep/dataSource");
1969
    dontOccur($doc, "//methods/qualityControl", "methods/qualityControl");
1970

  
1971
    dontOccur($doc, "//methods/sampling/spatialSamplingUnits", "methods/sampling/spatialSamplingUnits");
1972
    dontOccur($doc, "//methods/sampling/citation", "methods/sampling/citation");
1923 1973
    dontOccur($doc, "./pubPlace", "pubPlace");
1924 1974
    dontOccur($doc, "./project", "project");
1925 1975
    
......
2303 2353

  
2304 2354
    $$templateVars{'methodTitle'} = $FORM::methodTitle;
2305 2355
    $$templateVars{'methodPara'} = \@FORM::methodPara;
2356
    $$templateVars{'studyExtentDescription'} = $FORM::studyExtentDescription;
2357
    $$templateVars{'samplingDescription'} = $FORM::samplingDescription;
2306 2358
    $$templateVars{'docid'} = $FORM::docid;
2307 2359

  
2308 2360
    $$templateVars{'section'} = "Confirm Data";
......
2490 2542
    $$templateVars{'taxaAuth'} = $FORM::taxaAuth;
2491 2543
    $$templateVars{'methodTitle'} = $FORM::methodTitle;
2492 2544
    $$templateVars{'methodPara'} = \@FORM::methodPara;
2545
    $$templateVars{'studyExtentDescription'} = $FORM::studyExtentDescription;
2546
    $$templateVars{'samplingDescription'} = $FORM::samplingDescription;
2493 2547
    $$templateVars{'docid'} = $FORM::docid;
2494 2548

  
2495 2549
    $$templateVars{'form'} = 're_entry';

Also available in: Unified diff