Mercurial > hg > MPIWGWeb
comparison MPIWGRoot.py @ 9:5db416602e85
new MPIWGDepartment class.
author | casties |
---|---|
date | Fri, 15 Feb 2013 20:51:34 +0100 |
parents | ddf6c1a27a4b |
children | c711fe75d0ac |
comparison
equal
deleted
inserted
replaced
8:0a7691055ea3 | 9:5db416602e85 |
---|---|
276 # take only the last num elements | 276 # take only the last num elements |
277 features = features[-num:] | 277 features = features[-num:] |
278 # return pure list of objects | 278 # return pure list of objects |
279 return [f[1] for f in features] | 279 return [f[1] for f in features] |
280 | 280 |
281 def getDepartments(self): | |
282 """returns a list of the Departments""" | |
283 dir = getattr(self, 'departments', None) | |
284 if dir is None: | |
285 return [] | |
286 | |
287 depts = dir.objectItems(['MPIWGDepartment']) | |
288 depts.sort(sortWeight) | |
289 # return pure list of objects | |
290 return [f[1] for f in depts] | |
281 | 291 |
282 def getMPIWGRoot(self): | 292 def getMPIWGRoot(self): |
283 """returns the MPIWG root""" | 293 """returns the MPIWG root""" |
284 return self | 294 return self |
285 | 295 |
286 def MPIWGrootURL(self): | 296 def MPIWGrootURL(self): |
287 """returns the URL to the root""" | 297 """returns the URL to the root""" |
288 return self.absolute_url() | 298 return self.absolute_url() |
289 | 299 |
290 def upDateSQL(self,fileName): | |
291 """updates SQL databases using fm.jar""" | |
292 fmJarPath=os.path.join(package_home(globals()), 'updateSQL/fm.jar') | |
293 xmlPath=os.path.join(package_home(globals()), "updateSQL/%s"%fileName) | |
294 logger("MPIWG Web",logging.INFO,"java -classpath %s -Djava.awt.headless=true Convert %s"%(fmJarPath,xmlPath)) | |
295 ret=os.popen("java -classpath %s -Djava.awt.headless=true Convert %s"%(fmJarPath,xmlPath),"r").read() | |
296 logger("MPIWG Web",logging.INFO,"result convert: %s"%ret) | |
297 return 1 | |
298 | |
299 def patchProjects(self,RESPONSE): | 300 def patchProjects(self,RESPONSE): |
300 """patch""" | 301 """patch""" |
301 projects=self.ZopeFind(self.projects,obj_metatypes=['MPIWGProject']) | 302 projects=self.ZopeFind(self.projects,obj_metatypes=['MPIWGProject']) |
302 for project in projects: | 303 for project in projects: |
303 tmp=project[1].WEB_project_description[0].replace("/CD/projects/","")[0:] | 304 tmp=project[1].WEB_project_description[0].replace("/CD/projects/","")[0:] |