version 1.45, 2006/10/04 07:18:23
|
version 1.47, 2006/10/05 06:38:13
|
Line 1
|
Line 1
|
"""CDLI extensions of the filearchive""" |
"""CDLI extensions of the filearchive""" |
from Products.versionedFile.versionedFile import * |
from Products.versionedFile.versionedFile import * |
|
from Products.versionedFile.extVersionedFile import * |
from Products.ZCatalog.CatalogPathAwareness import CatalogAware |
from Products.ZCatalog.CatalogPathAwareness import CatalogAware |
from tempfile import mkstemp,mkdtemp |
from tempfile import mkstemp,mkdtemp |
import os.path |
import os.path |
Line 312 class uploadATFThread(Thread):
|
Line 313 class uploadATFThread(Thread):
|
#if not than add filename to the list of newfiles |
#if not than add filename to the list of newfiles |
|
|
data=file(os.path.join(dir,fn)).read() |
data=file(os.path.join(dir,fn)).read() |
status,msg=checkFile(fn,data,dir) |
#status,msg=checkFile(fn,data,dir) |
|
status=True |
|
msg="" |
if not status: # error |
if not status: # error |
errors.append((fn,msg)) |
errors.append((fn,msg)) |
else: |
else: |
Line 561 class BasketObject_old(Folder):
|
Line 563 class BasketObject_old(Folder):
|
for object in self.contents: |
for object in self.contents: |
|
|
if (procedure=="downloadAll") or (object.lockedBy=='') or (object.lockedBy==self.REQUEST['AUTHENTICATED_USER']): |
if (procedure=="downloadAll") or (object.lockedBy=='') or (object.lockedBy==self.REQUEST['AUTHENTICATED_USER']): |
ret+=object.getLastVersion().data |
ret+=object.getLastVersion().getData() |
|
|
if lock and object.lockedBy=='': |
if lock and object.lockedBy=='': |
object.lockedBy=self.REQUEST['AUTHENTICATED_USER'] |
object.lockedBy=self.REQUEST['AUTHENTICATED_USER'] |
Line 1237 def manage_addCDLIBasketVersion(self,use
|
Line 1239 def manage_addCDLIBasketVersion(self,use
|
else: |
else: |
return ob |
return ob |
|
|
class CDLIFileObject(CatalogAware,versionedFileObject): |
class CDLIFileObject(CatalogAware,extVersionedFileObject): |
"""CDLI file object""" |
"""CDLI file object""" |
|
|
meta_type="CDLI File Object" |
meta_type="CDLI File Object" |
Line 1296 class CDLIFileObject(CatalogAware,versio
|
Line 1298 class CDLIFileObject(CatalogAware,versio
|
def getDesignation(self): |
def getDesignation(self): |
"""get the designation out of the file""" |
"""get the designation out of the file""" |
try: |
try: |
txt=re.match("&[Pp](\d*)\s*=([^\r\n]*)",self.data[0:]) |
txt=re.match("&[Pp](\d*)\s*=([^\r\n]*)",self.getData()[0:]) |
except: |
except: |
txt=self.data[0:] |
txt=self.getData()[0:] |
|
|
return "ERROR" |
return "ERROR" |
try: |
try: |
Line 1342 def manage_addCDLIFileObject(self,id,vC=
|
Line 1344 def manage_addCDLIFileObject(self,id,vC=
|
if REQUEST is not None: |
if REQUEST is not None: |
REQUEST['RESPONSE'].redirect(self.absolute_url()+'/manage_main') |
REQUEST['RESPONSE'].redirect(self.absolute_url()+'/manage_main') |
|
|
class CDLIFile(versionedFile,CatalogAware): |
class CDLIFile(extVersionedFile,CatalogAware): |
"""CDLI file""" |
"""CDLI file""" |
|
|
meta_type="CDLI file" |
meta_type="CDLI file" |
Line 1551 def splitatf(fh,dir=None,ext=None):
|
Line 1553 def splitatf(fh,dir=None,ext=None):
|
return ret,len(os.listdir(dir)) |
return ret,len(os.listdir(dir)) |
|
|
|
|
class CDLIFileFolder(versionedFileFolder): |
class CDLIFileFolder(extVersionedFileFolder): |
"""CDLI File Folder""" |
"""CDLI File Folder""" |
|
|
security=ClassSecurityInfo() |
security=ClassSecurityInfo() |
Line 1815 class CDLIRoot(Folder):
|
Line 1817 class CDLIRoot(Folder):
|
|
|
if un and un !="": |
if un and un !="": |
ret.append((f[0],un)) |
ret.append((f[0],un)) |
print ret |
|
return ret |
return ret |
|
|
def getChangesByAuthor(self,author,n=100): |
def getChangesByAuthor(self,author,n=100): |
Line 1939 class CDLIRoot(Folder):
|
Line 1941 class CDLIRoot(Folder):
|
# tmp[key]=self._v_uploadATF[threadName].returnValue[key][0:] |
# tmp[key]=self._v_uploadATF[threadName].returnValue[key][0:] |
# else: |
# else: |
# tmp[key]=self._v_uploadATF[threadName].returnValue[key] |
# tmp[key]=self._v_uploadATF[threadName].returnValue[key] |
# print repr(tmp[key]),repr(key) |
# repr(tmp[key]),repr(key) |
# |
# |
# # |
# # |
#tmp=self.cdli_main.tmpStore2[threadName] |
#tmp=self.cdli_main.tmpStore2[threadName] |