Răsfoiți Sursa

Add trim of XML from pub importers and some in-line comments

spficklin 12 ani în urmă
părinte
comite
c54ed5d667

+ 1 - 1
tripal_pub/includes/importers/AGL.inc

@@ -407,7 +407,7 @@ function tripal_pub_AGL_parse_pubxml($pub_xml) {
   
   // read the XML and iterate through it.
   $xml = new XMLReader();
-  $xml->xml($pub_xml);
+  $xml->xml(trim($pub_xml));
   while ($xml->read()) {    
     $element = $xml->name; 
 

+ 1 - 1
tripal_pub/includes/importers/PMID.inc

@@ -286,7 +286,7 @@ function tripal_pub_PMID_parse_pubxml($pub_xml) {
   
   // read the XML and iterate through it.
   $xml = new XMLReader();
-  $xml->xml($pub_xml);
+  $xml->xml(trim($pub_xml));
   while ($xml->read()) {    
     $element = $xml->name;    
     if ($xml->nodeType == XMLReader::ELEMENT) {

+ 6 - 0
tripal_pub/tripal_pub.module

@@ -834,6 +834,12 @@ function tripal_pub_mail($key, &$message, $params) {
  * 
  */
 function tripal_pub_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
+  // we want the publications to always have a URL of http://[base url]/pub/[pub id]
+  // where [pub id] is the Chado publication ID.  This will allow for easy linking
+  // into the publication without needing to know the node.  Of course if you know the
+  // node that will still work too (e.g. http://[base url]/node/[node id]
+  // so the nodeapi function ensures that the URL path is set after insert or update
+  // of the node and when the node is loaded if it hasn't yet been set.
   if ($node->type == 'chado_pub') {
     switch ($op) {
       case 'presave':