--- ECHO_content/ECHO_collection.py 2008/12/10 13:37:03 1.300
+++ ECHO_content/ECHO_collection.py 2009/05/06 07:53:46 1.307
@@ -1,4 +1,4 @@
-"""New version of the product started February, 8th. Without scientific classification, use content-type for further classification."""
+"""New version of the produc started February, 8th. Without scientific classification, use content-type for further classification."""
"""Echo collection provides the classes for the ECHO content web-site.
class ECHO_collection is the basis class for an ECHO collection.
@@ -40,7 +40,10 @@ from Globals import Persistent, package_
from Acquisition import Implicit
from Products.ZCatalog.CatalogPathAwareness import CatalogAware
from Products.ZCTextIndex.ZCTextIndex import manage_addLexicon
-from Products.MetaDataProvider.MetaDataClient import MetaDataClient
+try:
+ from Products.MetaDataProvider.MetaDataClient import MetaDataClient
+except:
+ print "no metadataclient"
import urllib
import urllib2
import cgi
@@ -103,6 +106,7 @@ def setECHO_collectionInformation(self,t
self.weight=weight
import ECHO_resource
+from ECHO_resource import manage_addECHO_resource
class ECHO_resource(ECHO_resource.ECHO_resource):
"""depricated use class in ECHO_resource.py"""
@@ -376,7 +380,7 @@ class ECHO_fullText(ZopePageTemplate,ECH
try:
dom=xml.dom.minidom.parseString(self())
except:
- dom=xml.dom.minidom.parseString(self().encode('latin-1'))
+ dom=xml.dom.minidom.parseString(self.utf8ify(self()))
pages=dom.getElementsByTagName('page')
return pages[int(nr)-1].toxml()
@@ -718,7 +722,7 @@ class ECHO_collection(CatalogAware, Fold
ret=None
for name in zf.namelist():
- fn=tempfile.mkstemp()[1]
+ ds,fn=tempfile.mkstemp()
tf=file(fn,"w")
x=zf.read(name)
tf.write(x)
@@ -729,8 +733,11 @@ class ECHO_collection(CatalogAware, Fold
if not ret:
ret=""
ret+="Cannot import: %s (Already existing?)
"%name
+ os.close(ds)
os.remove(fn)
-
+
+ zf.close()
+
if ret:
return """