--- cdli/cdli_basket.py 2009/06/21 11:12:00 1.2 +++ cdli/cdli_basket.py 2011/07/19 12:43:26 1.5 @@ -33,7 +33,9 @@ from types import * import pickle import tempfile from cdli_files import CDLIFile +from cdli_files import splitatf,checkFile from cdli_helpers import * + class BasketContent(SimpleItem): """classe fuer den Inhalt eines Baskets""" @@ -134,7 +136,7 @@ class uploadATFfinallyThread(Thread): self.result="" #find context within ZODB - from Zope import DB + from Zope2 import DB conn = DB.open() root = conn.root() app = root['Application'] @@ -308,7 +310,7 @@ class uploadATFThread(Thread): idTmp=self.idTmp self.result="" #find context within ZODB - from Zope import DB + from Zope2 import DB conn = DB.open() root = conn.root() app = root['Application'] @@ -347,14 +349,14 @@ class uploadATFThread(Thread): #make sure that id is a string and not an integer basketId=str(basketId) - + logging.info("basketID:"+basketId) #TODO: make this configurable, at the moment, rootFolder for cdli has to be cdliRoot ctx2=ctx.cdliRoot #get temporary file for staging the downloaded and splitted files dir=tempfile.mkdtemp() - + logging.info("tmpfFile:"+str(dir)) changed=[] # changed files errors=[] # files with errors lockerrors=[] # files with errors @@ -363,6 +365,7 @@ class uploadATFThread(Thread): psNotInCatalog=[] # files not in the catalog #split the uploadedd atf file + logging.info("start splitting") basketNameFromFile, numberOfFiles=splitatf(upload,dir,ext=self) #find basketId if not set @@ -571,6 +574,21 @@ class CDLIBasketContainer(OrderedFolder) None security.declareProtected('manage','uploadBasket_html') + + def uploadBasketAsync_html(self,basketId='0'): + """upload an atf file, html form, jetzt aufruf der nicht asyncronen version mit ticktes""" + + + basketId=str(basketId) + if not basketId=='0': + basketName=getattr(self.basketContainer,basketId).title + else: + basketName="" + + pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','uploadBasketAsync_html.zpt')).__of__(self) + return pt(basketId=basketId,basketName=basketName) + + def uploadBasket_html(self,basketId='0'): """upload an atf file, html form"""