version 1.300, 2008/12/10 13:37:03
|
version 1.302, 2009/02/02 15:08:58
|
Line 1
|
Line 1
|
"""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. |
"""Echo collection provides the classes for the ECHO content web-site. |
|
|
class ECHO_collection is the basis class for an ECHO collection. |
class ECHO_collection is the basis class for an ECHO collection. |
Line 40 from Globals import Persistent, package_
|
Line 40 from Globals import Persistent, package_
|
from Acquisition import Implicit |
from Acquisition import Implicit |
from Products.ZCatalog.CatalogPathAwareness import CatalogAware |
from Products.ZCatalog.CatalogPathAwareness import CatalogAware |
from Products.ZCTextIndex.ZCTextIndex import manage_addLexicon |
from Products.ZCTextIndex.ZCTextIndex import manage_addLexicon |
|
try: |
from Products.MetaDataProvider.MetaDataClient import MetaDataClient |
from Products.MetaDataProvider.MetaDataClient import MetaDataClient |
|
except: |
|
print "no metadataclient" |
import urllib |
import urllib |
import urllib2 |
import urllib2 |
import cgi |
import cgi |
Line 103 def setECHO_collectionInformation(self,t
|
Line 106 def setECHO_collectionInformation(self,t
|
self.weight=weight |
self.weight=weight |
|
|
import ECHO_resource |
import ECHO_resource |
|
from ECHO_resource import manage_addECHO_resource |
|
|
class ECHO_resource(ECHO_resource.ECHO_resource): |
class ECHO_resource(ECHO_resource.ECHO_resource): |
"""depricated use class in ECHO_resource.py""" |
"""depricated use class in ECHO_resource.py""" |
Line 718 class ECHO_collection(CatalogAware, Fold
|
Line 722 class ECHO_collection(CatalogAware, Fold
|
ret=None |
ret=None |
|
|
for name in zf.namelist(): |
for name in zf.namelist(): |
fn=tempfile.mkstemp()[1] |
ds,fn=tempfile.mkstemp() |
tf=file(fn,"w") |
tf=file(fn,"w") |
x=zf.read(name) |
x=zf.read(name) |
tf.write(x) |
tf.write(x) |
Line 729 class ECHO_collection(CatalogAware, Fold
|
Line 733 class ECHO_collection(CatalogAware, Fold
|
if not ret: |
if not ret: |
ret="" |
ret="" |
ret+="Cannot import: %s (Already existing?)<br>"%name |
ret+="Cannot import: %s (Already existing?)<br>"%name |
|
os.close(ds) |
os.remove(fn) |
os.remove(fn) |
|
|
|
zf.close() |
if ret: |
if ret: |
return """<html><body>%s</body></html>"""%ret |
return """<html><body>%s</body></html>"""%ret |
if RESPONSE: |
if RESPONSE: |
Line 2194 class ECHO_root(Folder,Persistent,Implic
|
Line 2200 class ECHO_root(Folder,Persistent,Implic
|
"""ret attribute if existing""" |
"""ret attribute if existing""" |
try: |
try: |
|
|
return getattr(found,field)#.decode('utf-8','ignore') |
|
|
return getattr(found,field)#.decode('ascii','ignore') |
|
|
|
|
|
|
except: |
except: |
logging.error("can't: decode: %s"%repr(field)) |
logging.error("can't: decode: %s"%repr(field)) |
logging.error(" %s %s"%(sys.exc_info()[0],sys.exc_info()[1])) |
logging.error(" %s %s"%(sys.exc_info()[0],sys.exc_info()[1])) |