Index: lib/style/common/templates/esaModNotification.tmpl
===================================================================
--- lib/style/common/templates/esaModNotification.tmpl	(revision 4009)
+++ lib/style/common/templates/esaModNotification.tmpl	(revision 4010)
@@ -2,7 +2,7 @@
 Ecological Society of America moderator notice:
 [% IF stage == 'mod_accept' %]
 
-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%].
+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%].
 
 [% ELSIF stage == 'mod_decline' %]		
 
@@ -26,8 +26,8 @@
 
 We are happy to inform you that the metadata entry for your article submission,
 [%dpTitle%], has been accepted.  This part of the submission process is now
-complete.  Your metadata entry can be cited in the future as <LSID>, and will be
-viewable online at [% servletPath %]?action=read&cfg=esa&docid=[%docid%] after publication.  Thank you for your cooperation.
+complete.  Your metadata entry can be cited in the future as a LSID (Life Science ID), and will be
+viewable online at @systemidserver@@servlet-path@?action=read&qformat=esa&docid=[%docid%] after publication.  Thank you for your cooperation.
 
 The Ecological Society of America
  		
Index: lib/style/common/templates/entryForm.tmpl
===================================================================
--- lib/style/common/templates/entryForm.tmpl	(revision 4009)
+++ lib/style/common/templates/entryForm.tmpl	(revision 4010)
@@ -1066,7 +1066,8 @@
            [% WHILE cnt < upCount %]
                 [% SET fileSum = "upload_${cnt}" %]
                 [% SET fileName = "uploadname_${cnt}" %]
-                [% SET fileType = "uploadtype_${cnt}" %]
+                [% SET fileType = "uploadtype_${cnt}" %] 
+                [% SET filePerm = "uploadperm_${cnt}" %]
                 [% IF fileSum %]
                     <input type="hidden" name="[%fileSum%]" value="[% $fileSum %]"> 
                     <input type="hidden" name="[%fileName%]" value="[% $fileName %]"> 
@@ -1106,6 +1107,7 @@
           <input type="radio" name="[% filePerm %]" value="private" [% perm_b %]> Private
 
           <input type="button" value="Delete" onclick="deleteFile(event, [%fileName%]);"/></div>[% END %]
+
         [% cnt = cnt + 1 %]
     [% END %]
     [% END %]</div></td>
Index: lib/style/common/templates/loginForm.tmpl
===================================================================
--- lib/style/common/templates/loginForm.tmpl	(revision 4009)
+++ lib/style/common/templates/loginForm.tmpl	(revision 4010)
@@ -1,4 +1,8 @@
-[% INCLUDE $templates.header %]
+[% IF cfg == 'nceas' %]
+  [% INCLUDE "nceasHeader.tmpl" %]
+[% ELSE %]
+  [% INCLUDE "genericHeader.tmpl" %]
+[% END %]
       <script language="JavaScript">
 function submitform(formObj) {
 
@@ -44,7 +48,7 @@
           
         
 				<p><span class="greenbold">Step 1: Create an Account</span> <br>
-		   			Create an account by registering with the <a href="[% cgiPrefix %]/ldapweb.cgi?cfg=[%cfg%]">KNB</a>.
+		   			Create an account by registering with the <a href="@cgi-prefix@/ldapweb.cgi?cfg=[%cfg%]">KNB</a>.
 
 					Many scientists will already have accounts in the KNB, especially those 
 					from institutions like NCEAS and LTER. If you already have an account 
@@ -61,7 +65,8 @@
 		[% END %]
 	  
       [% END %]
-<form method="post" action="[% cgiPrefix %]/register-dataset.cgi" onsubmit="return submitform(this);" >
+  <menu>
+<form method="post" action="@cgi-prefix@/register-dataset.cgi" onsubmit="return submitform(this);" >
     <input type="hidden" name="stage" value="login"> 
     <input type="hidden" name="username" value=""> 
     <input type="hidden" name="cfg" value="[%cfg%]"> 
@@ -123,10 +128,14 @@
       </tr>
     </table>
   </form>
+  </menu>
+  
+  Dont have an account yet? <a href="@cgi-prefix@/ldapweb.cgi?cfg=[%cfg%]">Create a new account</a>
+  <br />
+  Forgot your password? <a href="@cgi-prefix@/ldapweb.cgi?cfg=[%cfg%]&amp;stage=resetpass">Reset your password</a>
 
-  <p>  
-  Dont have an account yet? <a href="[% cgiPrefix %]/ldapweb.cgi?cfg=[%cfg%]">Create a new account</a>
-  <br />
-  Forgot your password? <a href="[% cgiPrefix %]/ldapweb.cgi?cfg=[%cfg%]&amp;stage=resetpass">Reset your password</a>
-  </p>
-[% INCLUDE $templtes.footer %]
+[% IF cfg == 'nceas' %]
+  [% INCLUDE "nceasFooter.tmpl" %]
+[% ELSE %]
+  [% INCLUDE "genericFooter.tmpl" %]
+[% END %]  
Index: lib/style/common/templates/nceasHeader.tmpl
===================================================================
--- lib/style/common/templates/nceasHeader.tmpl	(revision 4009)
+++ lib/style/common/templates/nceasHeader.tmpl	(revision 4010)
@@ -10,9 +10,7 @@
   <script language="Javascript" type="text/JavaScript"
     src="[% styleCommonPath %]/branding.js"></script>
   <script language="Javascript" type="text/javascript"
-    src="[% styleSkinsPath %]/nceas/navigation.js"></script>
-  <link rel="stylesheet" type="text/css"
-    href="[% styleSkinsPath %]/nceas/nceas.css">
+    src="@systemidserver@@style-skins-path@/nceas/navigation.js"></script>
 </head>
 <body id="Overview" onload="loginStatus('[% metacatUrl %]', '[% cgiPrefix %]');">
   <div id="main_wrapper">
Index: src/perl/ldapweb.cgi
===================================================================
--- src/perl/ldapweb.cgi	(revision 4009)
+++ src/perl/ldapweb.cgi	(revision 4010)
@@ -49,6 +49,10 @@
 my $TIMEOUT = 20;
 my $mainldapdownmessage = "The main ldap server " . $mainldapurl . " is down!";
 
+# 1.8.1 temporary baseUrl fix
+my $baseUrl = "@systemidserver@@servlet-path@";
+$baseUrl =~ s/metacat$//;
+
 # Get the CGI input variables
 my $query = new CGI;
 
@@ -105,6 +109,11 @@
 
 my $cfg = $query->param('cfg');
 
+# 1.8.1 temporary header/footer fixder =
+
+my $header = ($cfg eq 'nceas') ? 'nceasHeader.tmpl' : '@defaultHeader@';
+my $footer = ($cfg eq 'nceas') ? 'nceasFooter.tmpl' : '@defaultFooter@';
+
 # define the possible stages
 my %stages = (
               'initregister'      => \&handleInitRegister,
@@ -143,9 +152,10 @@
   my $templateVars = { stage => "register", cfg => $cfg };
   #$$templateVars{'orgList'} = \@orglist;
   $$templateVars{'orgList'} = \@orglist;
-  $template->process( "@defaultHeader@", $templateVars);
+  $$templateVars{'baseUrl'} = $baseUrl;
+  $template->process( $header, $templateVars);
   $template->process( "@register@", $templateVars);
-  $template->process( "@defaultFooter@", $templateVars);
+  $template->process( $footer, $templateVars);
 
   exit();
 }
@@ -178,9 +188,10 @@
                              allParams => $allParams,
                              errorMessage => $errorMessage };
         $$templateVars{'orgList'} = \@orglist;
-        $template->process( "@defaultHeader@", $templateVars);
+        $$templateVars{'baseUrl'} = $baseUrl;
+        $template->process( $header, $templateVars);
         $template->process( "@register@", $templateVars);
-        $template->process( "@defaultFooter@", $templateVars);
+        $template->process( $footer, $templateVars);
         exit(0);
     } else {
         my $o = $query->param('o');    
@@ -219,10 +230,11 @@
                            allParams => $allParams,
                            foundAccounts => $found };
       $$templateVars{'orgList'} = \@orglist;
-      $template->process( "@defaultHeader@", $templateVars);
+      $$templateVars{'baseUrl'} = $baseUrl;
+      $template->process( $header, $templateVars);
       $template->process( "@registerMatch@", $templateVars);
       $template->process( "@register@", $templateVars);
-      $template->process( "@defaultFooter@", $templateVars);
+      $template->process( $footer, $templateVars);
 
     # Otherwise, create a new user in the LDAP directory
     } else {
@@ -287,9 +299,10 @@
                              allParams => $allParams,
                              errorMessage => $errorMessage };
         $$templateVars{'orgList'} = \@orglist;
-        $template->process( "@defaultHeader@", $templateVars);
+        $$templateVars{'baseUrl'} = $baseUrl;
+        $template->process( $header, $templateVars);
         $template->process( "@defaultChangePass@", $templateVars);
-        $template->process( "@defaultFooter@", $templateVars);
+        $template->process( $footer, $templateVars);
         exit(0);
     }
 
@@ -304,9 +317,9 @@
 
         my $dn = "uid=" . $query->param('uid') . "," . $config_dn->{$o};;
         if ($query->param('o') =~ "LTER") {
-            $template->process( "@defaultHeader@");
+            $template->process( $header);
             $template->process( "@registerLter@");
-            $template->process( "@defaultFooter@");
+            $template->process( $footer);
         } else {
             my $errorMessage = changePassword(
                     $dn, $query->param('userPassword'), 
@@ -317,9 +330,10 @@
                                      allParams => $allParams,
                                      errorMessage => $errorMessage };
                 $$templateVars{'orgList'} = \@orglist;
-                $template->process( "@defaultHeader@", $templateVars);
+                $$templateVars{'baseUrl'} = $baseUrl;
+                $template->process( $header, $templateVars);
                 $template->process( "@defaultChangePass@", $templateVars);
-                $template->process( "@defaultFooter@", $templateVars);
+                $template->process( $footer, $templateVars);
                 exit(0);
             } else {
                 my $templateVars = { stage => "changepass",
@@ -326,9 +340,10 @@
                                      cfg => $cfg,
                                      allParams => $allParams };
                 $$templateVars{'orgList'} = \@orglist;
-                $template->process( "@defaultHeader@", $templateVars);
+                $$templateVars{'baseUrl'} = $baseUrl;
+                $template->process( $header, $templateVars);
                 $template->process( "@changePassSuccess@", $templateVars);
-                $template->process( "@defaultFooter@", $templateVars);
+                $template->process( $footer, $templateVars);
                 exit(0);
             }
         }
@@ -339,9 +354,10 @@
                              allParams => $allParams,
                              errorMessage => $errorMessage };
         $$templateVars{'orgList'} = \@orglist;
-        $template->process( "@defaultHeader@", $templateVars);
+        $$templateVars{'baseUrl'} = $baseUrl;
+        $template->process( $header, $templateVars);
         $template->process( "@defaultChangePass@", $templateVars);
-        $template->process( "@defaultFooter@", $templateVars);
+        $template->process( $footer, $templateVars);
         exit(0);
     }
 }
@@ -360,9 +376,10 @@
                          allParams => $allParams,
                          errorMessage => $errorMessage };
     $$templateVars{'orgList'} = \@orglist;
-    $template->process( "@defaultHeader@", $templateVars);
+    $$templateVars{'baseUrl'} = $baseUrl;
+    $template->process( $header, $templateVars);
     $template->process( "@defaultChangePass@", $templateVars);
-    $template->process( "@defaultFooter@", $templateVars);
+    $template->process( $footer, $templateVars);
     exit(0);
 }
 
@@ -397,9 +414,10 @@
                              allParams => $allParams,
                              errorMessage => $errorMessage };
         $$templateVars{'orgList'} = \@orglist;
-        $template->process( "@defaultHeader@", $templateVars);
+        $$templateVars{'baseUrl'} = $baseUrl;
+        $template->process( $header, $templateVars);
         $template->process( "@defaultResetPass@", $templateVars);
-        $template->process( "@defaultFooter@", $templateVars);
+        $template->process( $footer, $templateVars);
         exit(0);
     }
 
@@ -407,9 +425,9 @@
     my $o = $query->param('o');
     my $dn = "uid=" . $query->param('uid') . "," . $config_dn->{$o};
     if ($query->param('o') =~ "LTER") {
-        $template->process( "@defaultHeader@");
+        $template->process( $header);
         $template->process( "@registerLter@");
-        $template->process( "@defaultFooter@");
+        $template->process( $footer);
         exit(0);
     } else {
         my $errorMessage = "";
@@ -432,9 +450,10 @@
                                  allParams => $allParams,
                                  errorMessage => $errorMessage };
             $$templateVars{'orgList'} = \@orglist;
-            $template->process( "@defaultHeader@", $templateVars);
+            $$templateVars{'baseUrl'} = $baseUrl;
+            $template->process( $header, $templateVars);
             $template->process( "@defaultResetPass@", $templateVars);
-            $template->process( "@defaultFooter@", $templateVars);
+            $template->process( $footer, $templateVars);
             exit(0);
         } else {
             my $errorMessage = sendPasswordNotification($query->param('uid'),
@@ -444,9 +463,10 @@
                                  allParams => $allParams,
                                  errorMessage => $errorMessage };
             $$templateVars{'orgList'} = \@orglist;
-            $template->process( "@defaultHeader@", $templateVars);
+            $$templateVars{'baseUrl'} = $baseUrl;
+            $template->process( $header, $templateVars);
             $template->process( "@resetPassSuccess@", $templateVars);
-            $template->process( "@defaultFooter@", $templateVars);
+            $template->process( $footer, $templateVars);
             exit(0);
         }
     }
@@ -465,9 +485,10 @@
                          allParams => $allParams,
                          errorMessage => $errorMessage };
     $$templateVars{'orgList'} = \@orglist;
-    $template->process( "@defaultHeader@", $templateVars);
+    $$templateVars{'baseUrl'} = $baseUrl;
+    $template->process( $header, $templateVars);
     $template->process( "@defaultResetPass@", $templateVars);
-    $template->process( "@defaultFooter@", $templateVars);
+    $template->process( $footer, $templateVars);
     exit(0);
 }
 
@@ -749,9 +770,9 @@
     my $allParams = shift;
 
     if ($query->param('o') =~ "LTER") {
-        $template->process( "@defaultHeader@");
+        $template->process( $header);
         $template->process( "@registerLter@");
-        $template->process( "@defaultFooter@");
+        $template->process( $footer);
     } else {
 
         # Be sure the passwords match
@@ -762,10 +783,11 @@
                                  allParams => $allParams,
                                  errorMessage => $errorMessage };
             $$templateVars{'orgList'} = \@orglist;
-            $template->process( "@defaultHeader@", $templateVars);
+            $$templateVars{'baseUrl'} = $baseUrl;
+            $template->process( $header, $templateVars);
             $template->process( "@registerFailed@", $templateVars);
             $template->process( "@register@", $templateVars);
-            $template->process( "@defaultFooter@", $templateVars);
+            $template->process( $footer, $templateVars);
             exit(0);
         }
 
@@ -823,19 +845,22 @@
                                  allParams => $allParams,
                                  errorMessage => $result->error };
             $$templateVars{'orgList'} = \@orglist;
-            $template->process( "@defaultHeader@", $templateVars);
+            $$templateVars{'baseUrl'} = $baseUrl;
+            $template->process( $header, $templateVars);
             $template->process( "@registerFailed@", $templateVars);
             $templateVars    = { stage => "register",
                                  cfg => $cfg,
                                  allParams => $allParams };
             $$templateVars{'orgList'} = \@orglist;
+            $$templateVars{'baseUrl'} = $baseUrl;
             $template->process( "@register@", $templateVars);
-            $template->process( "@defaultFooter@", $templateVars);
+            $template->process( $footer, $templateVars);
         } else {
             my $templateVars    = { cfg => $cfg };
-            $template->process( "@defaultHeader@", $templateVars);
+            $$templateVars{'baseUrl'} = $baseUrl;
+            $template->process( $header, $templateVars);
             $template->process( "@registerSuccess@", $templateVars);
-            $template->process( "@defaultFooter@", $templateVars);
+            $template->process( $footer, $templateVars);
         }
 
         $ldap->unbind;   # take down session
@@ -851,8 +876,9 @@
                        cfg => $cfg,
                        errorMessage => $errorMessage };
   $$templateVars{'orgList'} = \@orglist;
-  $template->process( "@defaultHeader@", $templateVars);
-  $template->process( "@defaultFooter@", $templateVars);
+  $$templateVars{'baseUrl'} = $baseUrl;
+  $template->process( $header, $templateVars);
+  $template->process( $footer, $templateVars);
   exit(0);
 }
 
@@ -913,9 +939,10 @@
                            allParams => $allParams,
                            foundAccounts => $found };
       $$templateVars{'orgList'} = \@orglist;
-      $template->process( "@defaultHeader@", $templateVars);
+      $$templateVars{'baseUrl'} = $baseUrl;
+      $template->process( $header, $templateVars);
       $template->process( "@searchResults@", $templateVars);
-      $template->process( "@defaultFooter@", $templateVars);
+      $template->process( $footer, $templateVars);
 
     } else {
       $found = "No entries matched your criteria.  Please try again\n";
@@ -925,9 +952,10 @@
                            allParams => $allParams,
                            foundAccounts => $found };
       $$templateVars{'orgList'} = \@orglist;
-      $template->process( "@defaultHeader@", $templateVars);
+      $$templateVars{'baseUrl'} = $baseUrl;
+      $template->process( $header, $templateVars);
       $template->process( "@searchResults@", $templateVars);
-      $template->process( "@defaultFooter@", $templateVars);
+      $template->process( $footer, $templateVars);
 
     }
 
@@ -1009,9 +1037,10 @@
     my $errorMessage = shift;
     my $templateVars = { cfg => $cfg,
                          errorMessage => $errorMessage };
-    $template->process( "@defaultHeader@", $templateVars);
+    $$templateVars{'baseUrl'} = $baseUrl;
+    $template->process( $header, $templateVars);
     $template->process( "@ldapMainServerFailure@", $templateVars);
-    $template->process( "@defaultFooter@", $templateVars);
+    $template->process( $footer, $templateVars);
     exit(0);   
    }
     
Index: src/perl/register-dataset.cgi
===================================================================
--- src/perl/register-dataset.cgi	(revision 4009)
+++ src/perl/register-dataset.cgi	(revision 4010)
@@ -179,6 +179,11 @@
 if ($FORM::debug) {
     $debug = $FORM::debug;
 }
+
+# 1.8.1 temporary baseUrl fix
+my $baseUrl = $metacatUrl;
+$baseUrl =~ s/metacat$//;
+
 my $lat = $config->get('lat');
 my $lon = $config->get('lon');
 
@@ -213,6 +218,7 @@
 $$templateVars{'orgabbrev'} = $orgabbrev;
 $$templateVars{'orgurl'} = $orgurl;
 $$templateVars{'orgfilter'} = $orgfilter;
+$$templateVars{'baseUrl'} = $baseUrl;
 
 debug("Registry: Initialized -- stage set: $FORM::stage");
 
@@ -234,6 +240,13 @@
     exit(0);
 }
 
+# FIXME: temporary 1.8.1 fix to prevent missing upload directory from causing errors
+if (not -W $tmpdir) {
+    debug("Registry Error: Can't write files to $tmpdir, disabling file uploads");
+    #push(@errorMessages, "Unable to write files to temporary folder. Email sysadmin.");
+    $hasUpload = 'false';
+}
+
 # Process the form based on stage parameter. 
 if ($FORM::stage =~ "loginform") {
     print "Content-type: text/html\n\n";
@@ -1038,6 +1051,7 @@
     my $fileNum = shift;
     my $fileHash = param("upload_$fileNum");
     my $fileName = param("uploadname_$fileNum");
+    my $filePerm = param("uploadperm_$fileNum");
     my $contentType = param("uploadtype_$fileNum");
     my $cleanName = $fileName;
 
@@ -1086,6 +1100,7 @@
                       'fileName'    => $cleanName,
                       'fileSize'    => $fileSize,
                       'fileHash'    => $fileHash,
+                      'filePerm'    => $filePerm,
                       'contentType' => $contentType,
                       'url'         => $uploadUrl,
                       'entityType'  => $entityType,
@@ -1115,6 +1130,13 @@
     # file is in Metacat, generate the pertinent EML elements
     my $contentType = uploadInfo($fileName)->{'Content-Type'};
 
+    # occasionally CGI.pm doesn't get the file info.  In this case,
+    # use a default MIME type of text/plain.  Seems fixed in the newer CGI.pm:
+    # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=313141
+    if (!$contentType) {
+        $contentType = 'text/plain';
+    }
+
     my %dataInfo = ( 'fileName'    => $fileName,
                      'fileHash'    => $fileHash,
                      'contentType' => $contentType,
@@ -1175,6 +1197,7 @@
     my $response = $metacat->upload($docid, $data);
     if (!$response) {
         my $uploadMsg = $metacat->getMessage();
+        push(@errorMessages, "Failed to upload file. Error was: $uploadMsg\n");
         debug("Registry: Upload -- Error is: $uploadMsg");
     } else {
         debug("Registry: Upload -- Success! New docid $docid");
@@ -1287,7 +1310,6 @@
                   $roleName = $defaultRole;
                 }
 
-                #debug("XXXXX role name: " . $roleName);
                 push (@{$orig{$roleName}}, [$first, $last, $origRole]);
             }
         }
@@ -1364,17 +1386,23 @@
     my $skinAccess = allowElement($username, 'all');
 
     my $accessList = "";
+    # form name => EML permission; roles akin to Apache model
+    my %accessRoles = (
+        'public'  => 'allow',
+        'private' => 'deny',
+    );
 
     while ( my ($docid, $data) = each(%entityObjects) ) {
+        my $defaultAccess = $accessRoles{$data->{'filePerm'}};
         my $accessStub = qq|<additionalMetadata>
             <describes>$data->{'distribid'}</describes>
                 <access authSystem="knb" order="denyFirst">
                     $skinAccess
                     $userAccess 
-                    <deny>
+                    <$defaultAccess>
                         <principal>public</principal>
                         <permission>read</permission>
-                    </deny>
+                    </$defaultAccess>
                 </access>
       </additionalMetadata>
     |;
@@ -1411,7 +1439,7 @@
         foreach my $x (@$a_ref) {
             my ($kw, $kwType) = @$x;
             $kwElem .= "<keyword ";
-            if (hasContent($kwType) && $kwType != "None") {
+            if (hasContent($kwType) && $kwType ne "None") {
                  $kwElem.= "keywordType=\"".lc($kwType)."\"";
             }
             $kwElem .= ">$kw</keyword>\n";
@@ -2172,6 +2200,8 @@
                     $aoCount++;
                 }
             }
+            $$templateVars{'origEmail'} = findValue($node, '../electronicMailAddress');
+            $$templateVars{'origNameOrg'} = findValue($node, '../organizationName');
         }
 
     $results = $doc->findnodes('//dataset/creator/organizationName');
@@ -2236,7 +2266,7 @@
                     $$templateVars{"origNamefirst$aoCount"} =  findValue($tempNode, './givenName');
                     $$templateVars{"origNamelast$aoCount"} =  findValue($tempNode, './surName');
                     $$templateVars{"origRole$aoCount"} = findValue($tempNode, '../role');
-                    $aoCount++;           
+                    $aoCount++;
                 }
             }
      }
@@ -2287,22 +2317,19 @@
 
     my $count = 1;
     foreach $node ($results->get_nodelist) {
-	$tempResult = $node->findnodes('./keyword');
-	if ($tempResult->size() > 1) {
-	    errMoreThanOne("keyword");
-	} else {
-	    foreach $tempNode ($tempResult->get_nodelist) {
-		$$templateVars{"keyword$count"} = $tempNode->textContent();
-		if ($tempNode->hasAttributes()) {
-		    my @attlist = $tempNode->attributes();
-                    my $tmp = $attlist[0]->value;  #convert the first letter to upper case
-		    $tmp =~ s/\b(\w)/\U$1/g;
-		    $$templateVars{"kwType$count"} = $tmp;
-		}  
-	    }
-	}
-	$$templateVars{"kwTh$count"} = findValue($node, "keywordThesaurus");
-        $count++;
+        $tempResult = $node->findnodes('./keyword');
+        foreach $tempNode ($tempResult->get_nodelist) {
+            $$templateVars{"keyword$count"} = $tempNode->textContent();
+            $$templateVars{"kwTh$count"} = findValue($node, "keywordThesaurus");
+
+            if ($tempNode->hasAttributes()) {
+                my @attlist = $tempNode->attributes();
+                my $tmp = $attlist[0]->value;  #convert the first letter to upper case
+                $tmp =~ s/\b(\w)/\U$1/g;
+                $$templateVars{"kwType$count"} = $tmp;
+            }
+            $count++;
+        }
     }
     $$templateVars{'keyCount'} = $count;
     if($count > 0 ){
@@ -2523,12 +2550,12 @@
             dontOccur($node, "../positionName|../onlineURL|../userId", 
               "positionName, onlineURL, userId in contact tag");
             dontOccur($node, "./saluation", "saluation in contact tag");                
-        
+
             $tempResult = $node->findnodes('../address|../phone|../electronicmailAddress|../organizationName');
             if ($tempResult->size > 0) {
                 $$templateVars{'origNamefirstContact'} = findValue($node, 'givenName');
                 $$templateVars{'origNamelastContact'} = findValue($node, 'surName');
-    
+
                 my $tempResult2 = $node->findnodes('../address');
                 if ($tempResult2->size > 1) {
                     errMoreThanOne("address");
@@ -2541,7 +2568,7 @@
                         $$templateVars{'origCountryContact'} = findValue($tempNode2, 'country');
                     }
                 }
-            
+
                 my $tempResult3 = $node->findnodes('../phone');
                 if ($tempResult3->size > 2) {
                     errMoreThanN("phone");
@@ -2566,6 +2593,9 @@
                 $$templateVars{'origNamelastContact'} = findValue($node, 'surName');
                 $$templateVars{'origNameOrgContact'} = findValue($node, '../organizationName');
             }
+            $$templateVars{'origEmail'} = findValue($node, '../electronicMailAddress');
+            $$templateVars{'origNameOrg'} = findValue($node, '../organizationName');
+
         }
     }
     
@@ -2678,12 +2708,12 @@
    
     ########################################################
 
-
     dontOccur($doc, "./dataTable", "dataTable");
     dontOccur($doc, "./spatialRaster", "spatialRaster");
     dontOccur($doc, "./spatialVector", "spatialVector");
     dontOccur($doc, "./storedProcedure", "storedProcedure");
     dontOccur($doc, "./view", "view");
+
     dontOccur($doc, "./otherEntity", "otherEntity");
     dontOccur($doc, "./references", "references");
     
@@ -2984,7 +3014,7 @@
 		$htmldoc .= "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\">";
 		$htmldoc .= "<html><head><title>Dataset Description: ".$docid."</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"></head>";
 		$htmldoc .= "<frameset rows=\"150,*\" cols=\"*\" frameborder=\"NO\" border=\"0\" framespacing=\"0\">";
-		$htmldoc .= "<frame src=\"@systemidserver@@style-skins-path@/".$FORM::cfg."/header.html\" marginwidth=\"40\" name=\"topFrame\" scrolling=\"NO\" noresize>";
+		$htmldoc .= "<frame src=\"@systemidserver@@style-skins-path@/".$FORM::cfg."/header.jsp\" marginwidth=\"40\" name=\"topFrame\" scrolling=\"NO\" noresize>";
 		$htmldoc .= "<frameset cols=\"200,*\" frameborder=\"NO\" border=\"0\" framespacing=\"0\">";
         	$htmldoc .= "<body></body><frame src=\"@cgi-prefix@/register-dataset.cgi?cfg=".$FORM::cfg."&stage=review_frame&docid=".$docid."\" name=\"rightFrame\" scrolling=\"NO\" noresize></frame>";
         	$htmldoc .= "<frame src=\"@systemidserver@@servlet-path@?action=read&qformat=".$FORM::cfg."&docid=".$docid."&insertTemplate=0\" name=\"mainFrame\">";
@@ -3566,33 +3596,35 @@
 #
 ################################################################################
 sub mod_sendNotification {
-	my $title = shift;
-	my $contactEmailAddress = shift;
-	my $contactName = shift;
-	my $subject = shift;
+    my $title = shift;
+    my $contactEmailAddress = shift;
+    my $contactName = shift;
+    my $subject = shift;
 
-	debug($subject);
+    debug($subject);
     # send notification to the user and the moderator
-	my $templateVars = { 'stage' => $FORM::stage };
-	$$templateVars{'recipient'} = $recipient;
-	$$templateVars{'sender'} = $sender;
-	my ($x, $y, $z) = split(/\./, $FORM::docid);
-        my $docidWithoutRev = $x.".".$y;
-	$$templateVars{'docid'} = $docidWithoutRev;
-	$$templateVars{'comment'} = $FORM::review;
-	$$templateVars{'contactName'} = $contactName;
-	$$templateVars{'dpTitle'} = $title;
+    my $templateVars = { 'stage' => $FORM::stage };
+    $$templateVars{'recipient'} = $recipient;
+    $$templateVars{'sender'} = $sender;
+    # form doesn't handle edit without revision; append
+    #my ($x, $y, $z) = split(/\./, $FORM::docid);
+    #my $docidWithoutRev = $x.".".$y;
+    #$$templateVars{'docid'} = $docidWithoutRev;
+    $$templateVars{'docid'} = $FORM::docid;
+    $$templateVars{'comment'} = $FORM::review;
+    $$templateVars{'contactName'} = $contactName;
+    $$templateVars{'dpTitle'} = $title;
 
-	$$templateVars{'recipient_status'} = 'moderator';
-	sendNotification($mailhost, $sender, $recipient, $subject, 
-							$modEmailNotificationTemplate, $templateVars);
-	if($contactEmailAddress ne ''){
-		# send notification to contact email address specified in cfg   
-		$$templateVars{'recipient'} = $contactEmailAddress;
-		$$templateVars{'recipient_status'} = 'user';
-		sendNotification($mailhost, $sender, $contactEmailAddress, 
-				$subject, $modEmailNotificationTemplate, $templateVars);
-	}
+    $$templateVars{'recipient_status'} = 'moderator';
+    sendNotification($mailhost, $sender, $recipient, $subject, 
+                            $modEmailNotificationTemplate, $templateVars);
+    if($contactEmailAddress ne ''){
+        # send notification to contact email address specified in cfg   
+        $$templateVars{'recipient'} = $contactEmailAddress;
+        $$templateVars{'recipient_status'} = 'user';
+        sendNotification($mailhost, $sender, $contactEmailAddress, 
+                $subject, $modEmailNotificationTemplate, $templateVars);
+    }
 }
 
 ################################################################################
@@ -3665,15 +3697,15 @@
 ################################################################################
 sub toConfirmData{
     # Check if any invalid parameters
- 
+
     my $invalidParams;
     if (! $error) {
-    	$invalidParams = validateParameters(0);
-    	if (scalar(@$invalidParams)) {
-        	$$templateVars{'status'} = 'failure';
-        	$$templateVars{'invalidParams'} = $invalidParams;
-        	$error = 1;
-    	}
+        $invalidParams = validateParameters(0);
+        if (scalar(@$invalidParams)) {
+            $$templateVars{'status'} = 'failure';
+            $$templateVars{'invalidParams'} = $invalidParams;
+            $error = 1;
+        }
     }
 
     $$templateVars{'providerGivenName'} = normalizeCD($FORM::providerGivenName);
@@ -3777,10 +3809,10 @@
             $$templateVars{"kwType".$keyCount} = normalizeCD($keywordTypeArray->[$i]);
             $$templateVars{"kwTh".$keyCount} = normalizeCD($keywordThArray->[$i]);
             $keyCount++;
-	}    
-    }    
+        }
+    }
     $$templateVars{'keyCount'} = $keyCount;
-    
+
     $$templateVars{'addComments'} = normalizeCD($FORM::addComments);
     $$templateVars{'useConstraints'} = $FORM::useConstraints;
     if($FORM::useConstraints eq "other"){
@@ -3820,7 +3852,7 @@
     my $taxonNameArray = \@FORM::taxonName;
     my $taxonCount = 1;
 
-    for(my $i = 0; $i <= $#$taxonNameArray; $i++){
+    for (my $i = 0; $i <= $#$taxonNameArray; $i++) {
         if (hasContent($taxonRankArray->[$i]) && hasContent($taxonNameArray->[$i])) {
             debug("Registry processing keyword: trv = ".$taxonRankArray->[$i]
                     ." trn = ".$taxonNameArray->[$i]);
@@ -3827,7 +3859,7 @@
             $$templateVars{"taxonRankName".$taxonCount} = normalizeCD($taxonRankArray->[$i]);
             $$templateVars{"taxonRankValue".$taxonCount} = normalizeCD($taxonNameArray->[$i]);
             $taxonCount++;
-	}    
+        }
     }
 
     $$templateVars{'taxaCount'} = $taxonCount-1;
@@ -3844,6 +3876,7 @@
                 $$templateVars{"upload_$upNum"} = param("upload_$upNum");
                 $$templateVars{"uploadname_$upNum"} = param("uploadname_$upNum");
                 $$templateVars{"uploadtype_$upNum"} = param("uploadtype_$upNum");
+                $$templateVars{"uploadperm_$upNum"} = param("uploadperm_$upNum");
             }
         }
     }
@@ -3862,6 +3895,7 @@
             $$templateVars{"upload_$totalFileNum"} = $fileInfo->{'fileHash'};
             $$templateVars{"uploadname_$totalFileNum"} = $fileInfo->{'fileName'};
             $$templateVars{"uploadtype_$totalFileNum"} = $fileInfo->{'contentType'};
+            $$templateVars{"uploadperm_$totalFileNum"} = param("uploadperm_$totalFileNum");
             $uploadCount++;
         }
     }
@@ -4105,6 +4139,7 @@
                     $$templateVars{"upload_$fileIndex"} = param($upload);
                     $$templateVars{"uploadname_$fileIndex"} = param("uploadname_$fileIndex");
                     $$templateVars{"uploadtype_$fileIndex"} = param("uploadtype_$fileIndex");
+                    $$templateVars{"uploadperm_$fileIndex"} = param("uploadperm_$fileIndex");
                     $uploadCount++;
                 }
             }
Index: src/edu/ucsb/nceas/metacat/DBTransform.java
===================================================================
--- src/edu/ucsb/nceas/metacat/DBTransform.java	(revision 4009)
+++ src/edu/ucsb/nceas/metacat/DBTransform.java	(revision 4010)
@@ -165,7 +165,7 @@
       }
       catch (Exception e)
       {
-        pw.println(xslSystemId + ": Error transforming document in " +
+    	  logMetacat.error(xslSystemId + ": Error transforming document in " +
                    "DBTransform.transformXMLDocument: " +
                    e.getMessage());
 
@@ -247,7 +247,7 @@
       }
       catch (Exception e)
       {
-        pw.println(xslSystemId + ": Error transforming document in " +
+    	  logMetacat.error(xslSystemId + ": Error transforming document in " +
                    "DBTransform.transformXMLDocument: " +
                    e.getMessage());
 
Index: build.properties
===================================================================
--- build.properties	(revision 4009)
+++ build.properties	(revision 4010)
@@ -113,7 +113,7 @@
 compile.optimize=true
 
 # paths to be indexed when document is inserted. these are the paths which will be searched often
-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
+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
 
 # Flag to install ecogird or not. Possible values are true or false
 install.ecogrid=false
