version 1.47.2.49, 2006/01/30 14:53:03
|
version 1.47.2.54, 2006/07/14 09:14:17
|
Line 270 class MPIWGRoot(ZSQLExtendFolder):
|
Line 270 class MPIWGRoot(ZSQLExtendFolder):
|
folders=['MPIWGProject','Folder','ECHO_Navigation'] |
folders=['MPIWGProject','Folder','ECHO_Navigation'] |
meta_type='MPIWGRoot' |
meta_type='MPIWGRoot' |
|
|
|
def decode(self,str): |
|
"""decoder""" |
|
if not str: |
|
return "" |
|
if type(str) is StringType: |
|
try: |
|
return str.decode('utf-8') |
|
except: |
|
return str.decode('latin-1') |
|
else: |
|
|
|
return str |
|
|
def versionHeaderEN(self): |
def versionHeaderEN(self): |
"""version header text""" |
"""version header text""" |
|
|
Line 634 class MPIWGRoot(ZSQLExtendFolder):
|
Line 647 class MPIWGRoot(ZSQLExtendFolder):
|
"""test""" |
"""test""" |
return self.getProjectsByFieldContent('xdata_09',['biology'])[0].absolute_url |
return self.getProjectsByFieldContent('xdata_09',['biology'])[0].absolute_url |
|
|
def getContexts(self,childs=None,parents=None,depth=None,date=None): |
def getContexts(self,childs=None,parents=None,depth=None,date=None,onlyActive=True): |
"""childs alle childs, alle parents""" |
"""childs alle childs, alle parents""" |
ret=[] |
ret=[] |
|
|
Line 649 class MPIWGRoot(ZSQLExtendFolder):
|
Line 662 class MPIWGRoot(ZSQLExtendFolder):
|
if childs: |
if childs: |
for project in self.getProjectFields('xdata_05',sort='int',date=date): |
for project in self.getProjectFields('xdata_05',sort='int',date=date): |
searchStr=childs+"(\..*)" |
searchStr=childs+"(\..*)" |
|
|
|
if (onlyActive and project[0].isActiveProject()) or (not onlyActive): |
if re.match(searchStr,project[1]): |
if re.match(searchStr,project[1]): |
|
|
if depth: |
if depth: |
Line 765 class MPIWGRoot(ZSQLExtendFolder):
|
Line 780 class MPIWGRoot(ZSQLExtendFolder):
|
|
|
RESPONSE.setHeader('Content-type', 'text/html') |
RESPONSE.setHeader('Content-type', 'text/html') |
RESPONSE.write("<html><body>\n") |
RESPONSE.write("<html><body>\n") |
|
RESPONSE.write("Update Institutsbibliography\n") |
|
ret=self.upDateSQL('personalwww.xml') |
|
RESPONSE.write("done Insitutsbibliography:%s\n"%ret) |
url="http://itgroup.mpiwg-berlin.mpg.de:8050/FMPro?-db=personal-www&-format=-dso_xml&-lay=sql_export&-max=20000&-findall" |
url="http://itgroup.mpiwg-berlin.mpg.de:8050/FMPro?-db=personal-www&-format=-dso_xml&-lay=sql_export&-max=20000&-findall" |
dom = NonvalidatingReader.parseUri(url) |
dom = NonvalidatingReader.parseUri(url) |
#fh=urllib.urlopen(url) |
#fh=urllib.urlopen(url) |
#dom=xml.dom.minidom.parse(fh) |
#dom=xml.dom.minidom.parse(fh) |
|
|
RESPONSE.write("got_xml_File\n") |
RESPONSE.write("got_xml_File\n") |
|
|
|
|
Line 852 class MPIWGRoot(ZSQLExtendFolder):
|
Line 871 class MPIWGRoot(ZSQLExtendFolder):
|
|
|
done= obj.updateDBEntry(DBid=id,publish_the_data=publish_the_data, |
done= obj.updateDBEntry(DBid=id,publish_the_data=publish_the_data, |
date_from=date_from, |
date_from=date_from, |
date_to=date_to,stay_at_mpiwg=stay_at_mpiwg,position=position) |
date_to=date_to,stay_at_mpiwg=stay_at_mpiwg,position=position,abteilung=abteilung) |
if not done and (publish_the_data=='yes'): |
if not done and (publish_the_data=='yes'): |
|
|
ret=obj.createNewDBEntry(publish_the_data,id,name, |
ret=obj.createNewDBEntry(publish_the_data,id,name, |
Line 962 class MPIWGRoot(ZSQLExtendFolder):
|
Line 981 class MPIWGRoot(ZSQLExtendFolder):
|
ret.sort() |
ret.sort() |
return ret |
return ret |
def printAllMembers(self): |
def printAllMembers(self): |
"""prin""" |
"""print""" |
members=self.getAllMembers() |
members=self.getAllMembers() |
ret="" |
ret="" |
for x in members: |
for x in members: |
Line 978 class MPIWGRoot(ZSQLExtendFolder):
|
Line 997 class MPIWGRoot(ZSQLExtendFolder):
|
return entry |
return entry |
|
|
|
|
def getTree(self,date=None): |
def getTree(self,date=None,onlyActive=None): |
"""generate Tree from project list""" |
"""generate Tree from project list""" |
|
|
returnList=[] |
returnList=[] |
Line 992 class MPIWGRoot(ZSQLExtendFolder):
|
Line 1011 class MPIWGRoot(ZSQLExtendFolder):
|
#title=project[0].WEB_title |
#title=project[0].WEB_title |
title=[project[0].getContent('WEB_title')] |
title=[project[0].getContent('WEB_title')] |
#print title |
#print title |
if idNr[0]!="x": |
|
returnList.append((depth,nr,title,project[0])) |
|
|
|
|
if idNr[0]=="x": # kompatibilitŠt mit alter Konvention, x vor der Nummer macht project inactive |
|
project[0].setActiveFlag(False) |
|
|
|
if onlyActive and project[0].isActiveProject(): #nur active projekte |
|
returnList.append((depth,nr,title,project[0])) |
|
elif not onlyActive: |
|
returnList.append((depth,nr,title,project[0])) |
return returnList |
return returnList |
|
|
def formatElementsAsList(self,elements): |
def formatElementsAsList(self,elements): |
Line 1041 class MPIWGRoot(ZSQLExtendFolder):
|
Line 1065 class MPIWGRoot(ZSQLExtendFolder):
|
ret+="""<li>\n""" |
ret+="""<li>\n""" |
|
|
if actualDepth==1: |
if actualDepth==1: |
departmentName={'1':'Department I','2':'Department II','3':'Department III', '4':'Ind. Research Group','5':'Ind. Research Group','6':'Research Network'} |
departmentName={'1':'Department I','2':'Department II','3':'Department III', '4':'Ind. Research Group','5':'Ind. Research Group','6':'Ind. Research Group','7':'Research Network'} |
department=element[3].getContent('xdata_05') |
department=element[3].getContent('xdata_05') |
ret+="""<a href="#top"><img src="../grafik/totop.gif" vspace="10" border="0"></a><br><a name="dept%s"></a>%s: """%(department,departmentName[department]) |
ret+="""<a href="#top"><img src="../grafik/totop.gif" vspace="10" border="0"></a><br><a name="dept%s"></a>%s: """%(department,departmentName[department]) |
|
|
Line 1111 class MPIWGRoot(ZSQLExtendFolder):
|
Line 1135 class MPIWGRoot(ZSQLExtendFolder):
|
|
|
|
|
for idNr in form.keys(): |
for idNr in form.keys(): |
|
|
|
splitted=idNr.split('_') |
|
|
|
if len(splitted)==1: # name des Feldes = idNr, dann Aendere id_nr |
if not (fields[int(idNr)][3].xdata_05==form[idNr]): |
if not (fields[int(idNr)][3].xdata_05==form[idNr]): |
fields[int(idNr)][3].xdata_05=form[idNr] |
fields[int(idNr)][3].xdata_05=form[idNr] |
fields[int(idNr)][3].copyObjectToArchive() |
fields[int(idNr)][3].copyObjectToArchive() |
|
|
|
if form.has_key(idNr+'_active'): # active flag is set |
|
|
|
fields[int(splitted[0])][3].setActiveFlag(True) |
|
else: |
|
|
|
fields[int(splitted[0])][3].setActiveFlag(False) |
|
|
if RESPONSE is not None: |
if RESPONSE is not None: |
RESPONSE.redirect('showTree') |
RESPONSE.redirect('showTree') |
Line 1268 class MPIWGRoot(ZSQLExtendFolder):
|
Line 1302 class MPIWGRoot(ZSQLExtendFolder):
|
if splittedNew[0]=='': |
if splittedNew[0]=='': |
del splittedNew[0] |
del splittedNew[0] |
search=string.join(splittedNew,' AND ') |
search=string.join(splittedNew,' AND ') |
|
|
if not search=='': |
if not search=='': |
proj=self.MembersCatalog({'title':search}) |
proj=self.MembersCatalog({'title':search}) |
|
|
Line 1615 class MPIWGProject(CatalogAware,Folder):
|
Line 1650 class MPIWGProject(CatalogAware,Folder):
|
if RESPONSE: |
if RESPONSE: |
RESPONSE.redirect('manageImages') |
RESPONSE.redirect('manageImages') |
|
|
|
|
|
def hasChildren(self,date=None,onlyActive=True): |
|
"""check if project has children""" |
|
ct=self.getContexts(childs=self.getContent('xdata_05'), |
|
depth=1,date=date,onlyActive=onlyActive) |
|
|
|
if ct and len(ct)>0: |
|
return True |
|
else: |
|
return False |
|
|
def addImage(self,fileHd,caption,RESPONSE=None,filename=None): |
def addImage(self,fileHd,caption,RESPONSE=None,filename=None): |
"""add an MPIWG_Project_image""" |
"""add an MPIWG_Project_image""" |
|
|
Line 1772 class MPIWGProject(CatalogAware,Folder):
|
Line 1818 class MPIWGProject(CatalogAware,Folder):
|
self.creationTime=time.strftime("%Y%m%d%H%M%S",time.localtime())[0:] |
self.creationTime=time.strftime("%Y%m%d%H%M%S",time.localtime())[0:] |
self.id=id |
self.id=id |
self.title=id |
self.title=id |
|
self.isActiveFlag=True #Flag is true is the project is still active, False if accomplished |
|
|
if argv: |
if argv: |
for arg in definedFields: |
for arg in definedFields: |
try: |
try: |
Line 1792 class MPIWGProject(CatalogAware,Folder):
|
Line 1840 class MPIWGProject(CatalogAware,Folder):
|
) |
) |
|
|
|
|
|
def isActiveProject(self): |
|
"""check if the project is still active, default is true, set to false is the project is accomplished""" |
|
return getattr(self,'isActiveFlag',True) |
|
|
|
def setActiveFlag(self,status=True): |
|
"""set the active flag""" |
|
self.isActiveFlag=status |
|
|
def checkDate(self,date): |
def checkDate(self,date): |
"""teste ob zum Zeitpunkt date eine andere version existierte""" |
"""teste ob zum Zeitpunkt date eine andere version existierte""" |
|
|
Line 2061 class MPIWGProject(CatalogAware,Folder):
|
Line 2117 class MPIWGProject(CatalogAware,Folder):
|
|
|
setattr(self,x,[self.REQUEST[x].decode('utf-8')]) |
setattr(self,x,[self.REQUEST[x].decode('utf-8')]) |
|
|
|
if self.REQUEST.has_key('active'): |
|
self.setActiveFlag(True) |
|
else: |
|
self.setActiveFlag(False) |
if fromEdit and (RESPONSE is not None): |
if fromEdit and (RESPONSE is not None): |
RESPONSE.redirect('./editMPIWGBasisEditor') |
RESPONSE.redirect('./editMPIWGBasisEditor') |
|
|