diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php
index 28a1d412..15400ead 100755
--- a/application/default/controllers/DataController.php
+++ b/application/default/controllers/DataController.php
@@ -1263,8 +1263,74 @@ class DataController extends Zend_Controller_Action
print "
";
}
- }
-
+ }
+ /*
+ * 转换元数据为WORD DOC格式
+ */
+ public function docAction()
+ {
+ $this->_helper->layout->disableLayout();
+ $this->_helper->viewRenderer->setNoRender();
+ $ua = $_SERVER["HTTP_USER_AGENT"];
+ $uuid=$this->_request->getParam('uuid');
+ if (!empty($uuid))
+ {
+ $sql="select x.data,m.title,m.description,g.id from xml x left join metadata m on m.id=x.id left join geonetworkmetadata g on g.uuid=m.uuid where m.uuid=".$this->db->quote($uuid);
+ $row=$this->db->fetchRow($sql);
+ }
+
+ $dom = new DOMDocument();
+ $dom->loadXML($row['data']);
+ //提前对表格进行预处理
+ $abs=$this->parseTable($this->view->escape($row["description"]));
+ //处理外部链接
+ $abs=preg_replace('/\[\s*(http:\/\/.+?)\s+(.*?)\]/m','$2',$abs);
+ $abs=str_replace(array("\r\n", "\n", "\r"),'
',$abs); + $abs=str_replace("'","'",$abs);//not needed? + $id = $row['id']; + $xslt = new XSLTProcessor(); + $xslt->registerPHPFunctions(); + $xslt->setParameter('', 'id', $id); + $xslt->setParameter('', 'abstract', $abs); + $XSL = new DOMDocument(); + $XSL->load( '../data/doc.xsl', LIBXML_NOCDATA); + $xslt->importStylesheet($XSL); + $content=' +
'; + $content.='