version 1.1, 2009/05/15 13:13:31
|
version 1.5, 2011/07/19 12:43:26
|
Line 32 from DownloadBasket import DownloadBaske
|
Line 32 from DownloadBasket import DownloadBaske
|
from types import * |
from types import * |
import pickle |
import pickle |
import tempfile |
import tempfile |
|
from cdli_files import CDLIFile |
|
from cdli_files import splitatf,checkFile |
from cdli_helpers import * |
from cdli_helpers import * |
|
|
class BasketContent(SimpleItem): |
class BasketContent(SimpleItem): |
"""classe fuer den Inhalt eines Baskets""" |
"""classe fuer den Inhalt eines Baskets""" |
|
|
Line 134 class uploadATFfinallyThread(Thread):
|
Line 136 class uploadATFfinallyThread(Thread):
|
|
|
self.result="" |
self.result="" |
#find context within ZODB |
#find context within ZODB |
from Zope import DB |
from Zope2 import DB |
conn = DB.open() |
conn = DB.open() |
root = conn.root() |
root = conn.root() |
app = root['Application'] |
app = root['Application'] |
Line 308 class uploadATFThread(Thread):
|
Line 310 class uploadATFThread(Thread):
|
idTmp=self.idTmp |
idTmp=self.idTmp |
self.result="" |
self.result="" |
#find context within ZODB |
#find context within ZODB |
from Zope import DB |
from Zope2 import DB |
conn = DB.open() |
conn = DB.open() |
root = conn.root() |
root = conn.root() |
app = root['Application'] |
app = root['Application'] |
Line 347 class uploadATFThread(Thread):
|
Line 349 class uploadATFThread(Thread):
|
|
|
#make sure that id is a string and not an integer |
#make sure that id is a string and not an integer |
basketId=str(basketId) |
basketId=str(basketId) |
|
logging.info("basketID:"+basketId) |
#TODO: make this configurable, at the moment, rootFolder for cdli has to be cdliRoot |
#TODO: make this configurable, at the moment, rootFolder for cdli has to be cdliRoot |
ctx2=ctx.cdliRoot |
ctx2=ctx.cdliRoot |
|
|
#get temporary file for staging the downloaded and splitted files |
#get temporary file for staging the downloaded and splitted files |
dir=tempfile.mkdtemp() |
dir=tempfile.mkdtemp() |
|
|
|
logging.info("tmpfFile:"+str(dir)) |
changed=[] # changed files |
changed=[] # changed files |
errors=[] # files with errors |
errors=[] # files with errors |
lockerrors=[] # files with errors |
lockerrors=[] # files with errors |
Line 363 class uploadATFThread(Thread):
|
Line 365 class uploadATFThread(Thread):
|
psNotInCatalog=[] # files not in the catalog |
psNotInCatalog=[] # files not in the catalog |
|
|
#split the uploadedd atf file |
#split the uploadedd atf file |
|
logging.info("start splitting") |
basketNameFromFile, numberOfFiles=splitatf(upload,dir,ext=self) |
basketNameFromFile, numberOfFiles=splitatf(upload,dir,ext=self) |
|
|
#find basketId if not set |
#find basketId if not set |
Line 572 class CDLIBasketContainer(OrderedFolder)
|
Line 575 class CDLIBasketContainer(OrderedFolder)
|
|
|
security.declareProtected('manage','uploadBasket_html') |
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'): |
def uploadBasket_html(self,basketId='0'): |
"""upload an atf file, html form""" |
"""upload an atf file, html form""" |
|
|