[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nuxeo-checkins] CVS: NuxForum Article.py,1.3,1.4 Forum.py,1.4,1.5 Posti
From: |
Juan David Ibáñez Palomar |
Subject: |
[Nuxeo-checkins] CVS: NuxForum Article.py,1.3,1.4 Forum.py,1.4,1.5 Posting.py,1.2,1.3 |
Date: |
Mon, 06 May 2002 13:09:49 -0400 |
Update of /cvsroot/nuxeo/NuxForum
In directory subversions:/tmp/cvs-serv29559
Modified Files:
Article.py Forum.py Posting.py
Log Message:
Preliminar support for moderation (workflow), needed for the MI project.
Index: Article.py
===================================================================
RCS file: /cvsroot/nuxeo/NuxForum/Article.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** Article.py 3 May 2002 17:11:06 -0000 1.3
--- Article.py 6 May 2002 17:09:46 -0000 1.4
***************
*** 1,3 ****
! # Copyright (c) 2002 Nuxeo
#
# This program is free software; you can redistribute it and/or modify
--- 1,4 ----
! # Copyright (c) 2002 J.David Ibáñez
! # Nuxeo
#
# This program is free software; you can redistribute it and/or modify
***************
*** 51,55 ****
self.title = title
self.body = body
-
security = ClassSecurityInfo()
--- 52,55 ----
Index: Forum.py
===================================================================
RCS file: /cvsroot/nuxeo/NuxForum/Forum.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** Forum.py 3 May 2002 17:11:06 -0000 1.4
--- Forum.py 6 May 2002 17:09:46 -0000 1.5
***************
*** 14,18 ****
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
! # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
--- 14,18 ----
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
! # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
***************
*** 27,31 ****
# Zope modules
from Globals import InitializeClass
! from AccessControl import ClassSecurityInfo
# Third party Zope modules
--- 27,31 ----
# Zope modules
from Globals import InitializeClass
! from AccessControl import ClassSecurityInfo, getSecurityManager
# Third party Zope modules
***************
*** 85,92 ****
REQUEST=None, RESPONSE=None):
""" """
-
id = self.get_id()
! self.articles._setObject(id, Article(id, title, subject, body))
if REQUEST is not None:
--- 85,98 ----
REQUEST=None, RESPONSE=None):
""" """
id = self.get_id()
! # Add the new article
! articles = self.articles
! articles._setObject(id, Article(id, title, subject, body))
!
! # Workflow
! article = getattr(articles, id)
! if hasattr(self, 'wf_init'):
! self.wf_init(article)
if REQUEST is not None:
***************
*** 115,121 ****
def get_articles(self):
""" """
!
! articles = self.articles
! articles = [ getattr(articles, str(x)) for x in range(self.count) ]
articles.reverse()
--- 121,130 ----
def get_articles(self):
""" """
! manager = getSecurityManager()
! articles = []
! for x in range(self.count):
! article = getattr(self.articles, str(x))
! if manager.checkPermission('View', article):
! articles.append(article)
articles.reverse()
***************
*** 124,128 ****
-
## def get_max_deep(self, id):
## """Returns the deep.."""
--- 133,136 ----
***************
*** 141,144 ****
--- 149,165 ----
## return 5
+
+ ## def update(self):
+ ## """ """
+ ## for article in self.articles.objectValues():
+ ## self.update_posting(article)
+
+ ## return 'Ok'
+
+
+ ## def update_posting(self, posting):
+ ## posting.wf_init()
+ ## for x in posting.objectValues():
+ ## self.update_posting(x)
Index: Posting.py
===================================================================
RCS file: /cvsroot/nuxeo/NuxForum/Posting.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** Posting.py 3 May 2002 17:11:06 -0000 1.2
--- Posting.py 6 May 2002 17:09:46 -0000 1.3
***************
*** 1,3 ****
! # Copyright (c) 2002 Nuxeo
#
# This program is free software; you can redistribute it and/or modify
--- 1,4 ----
! # Copyright (c) 2002 J. David Ibáñez
! # Nuxeo
#
# This program is free software; you can redistribute it and/or modify
***************
*** 28,32 ****
from Globals import InitializeClass
from AccessControl import ClassSecurityInfo
- from Products.ZCatalog.CatalogPathAwareness import CatalogAware
# Products
--- 29,32 ----
***************
*** 35,38 ****
--- 35,39 ----
# Here
from Node import Node
+ from CatalogAware import CatalogAware
***************
*** 41,44 ****
--- 42,46 ----
security = ClassSecurityInfo()
+ # Web interface
security.declareProtected('View', 'get_subheader_data')
def get_subheader_data(self):
***************
*** 100,103 ****
--- 102,110 ----
self._setObject(id, Comment(id, title, body))
+ # Workflow
+ comment = getattr(self, id)
+ if hasattr(self, 'wf_init'):
+ self.wf_init(comment)
+
if REQUEST is not None:
RESPONSE.redirect(self.absolute_url())
***************
*** 110,113 ****
--- 117,133 ----
posting_actions_top = LocalPageTemplateFile('ui/Posting_actions_top',
globals())
+
+ # Workflow
+ _state = None
+
+ def setState(self, state):
+ self._state = state
+ self.reindex_object()
+
+ def wf_state(self):
+ """ """
+ return self._state
+
+
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Nuxeo-checkins] CVS: NuxForum Article.py,1.3,1.4 Forum.py,1.4,1.5 Posting.py,1.2,1.3,
Juan David Ibáñez Palomar <=
- Prev by Date:
[Nuxeo-checkins] CVS: NuxForum Article.py,1.2,1.3 Custom.py,1.1,1.2 Forum.py,1.3,1.4 Node.py,1.2,1.3 Posting.py,1.1.1.1,1.2
- Next by Date:
[Nuxeo-checkins] CVS: NuxForum CatalogAware.py,NONE,1.1
- Previous by thread:
[Nuxeo-checkins] CVS: NuxForum Article.py,1.2,1.3 Custom.py,1.1,1.2 Forum.py,1.3,1.4 Node.py,1.2,1.3 Posting.py,1.1.1.1,1.2
- Next by thread:
[Nuxeo-checkins] CVS: NuxForum CatalogAware.py,NONE,1.1
- Index(es):