[Libreoffice-commits] .: Branch 'newbranch' - liboextensioncenter/am.liboextensioncenter
Andreas Mantke
andreasma at kemper.freedesktop.org
Tue Apr 19 10:54:26 PDT 2011
liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/__init__.py | 73 +++++++++-
liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/__init__.pyc |binary
liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/permissions.py | 2
liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/permissions.pyc |binary
liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/setuphandlers.py | 4
liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/setuphandlers.pyc |binary
liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/validators.py | 2
liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/validators.pyc |binary
8 files changed, 76 insertions(+), 5 deletions(-)
New commits:
commit 48b725d51ee892137b994f01e6d1af0f7ae0ee5b
Author: Andreas Mantke <maand at gmx.de>
Date: Tue Apr 19 19:54:17 2011 +0200
change to liboextensioncenter
diff --git a/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/__init__.py b/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/__init__.py
index 51e7de6..d97f80e 100644
--- a/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/__init__.py
+++ b/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/__init__.py
@@ -1,4 +1,75 @@
# -*- extra stuff goes here -*-
+
+from Products.CMFCore.utils import ContentInit
+from Products.CMFCore.DirectoryView import registerDirectory
+
+from Products.Archetypes.atapi import listTypes, process_types
+
+from am.liboextensioncenter import config
+from am.liboextensioncenter import permissions as psc_permissions
+from Products.CMFCore import permissions
+
+from Products.validation import validation
+from am.liboextensioncenter import validators
+validation.register(validators.ProjectIdValidator('isNonConflictingProjectId'))
+validation.register(validators.ProjectContactValidator('isValidContact'))
+
+registerDirectory(config.SKINS_DIR, config.GLOBALS)
def initialize(context):
- """Initializer called when used as a Zope 2 product."""
+ # Kick content registration and sys.modules mangling
+ from am.liboextensioncenter import content
+
+ allTypes = listTypes(config.PROJECTNAME)
+
+ # Register Archetypes content with the machinery
+ content_types, constructors, ftis = process_types(
+ allTypes, config.PROJECTNAME)
+
+ center_content_types = []
+ center_constructors = []
+
+ project_content_types = []
+ project_constructors = []
+
+ member_content_types = []
+ member_constructors = []
+
+ for i in range(len(allTypes)):
+ aType = allTypes[i]
+ if aType['klass'].meta_type in ('liboextensioncenter',):
+ center_content_types.append(content_types[i])
+ center_constructors.append(constructors[i])
+ elif aType['klass'].meta_type in ('PSCProject',):
+ project_content_types.append(content_types[i])
+ project_constructors.append(constructors[i])
+ else:
+ member_content_types.append(content_types[i])
+ member_constructors.append(constructors[i])
+
+ # software center itself
+ ContentInit(
+ config.PROJECTNAME + ' Center',
+ content_types = tuple(center_content_types),
+ permission = psc_permissions.AddSoftwareCenter,
+ extra_constructors = tuple(center_constructors),
+ fti = ftis,
+ ).initialize(context)
+
+ # projects
+ ContentInit(
+ config.PROJECTNAME + ' Project',
+ content_types = tuple(project_content_types),
+ permission = psc_permissions.AddProject,
+ extra_constructors = tuple(project_constructors),
+ fti = ftis,
+ ).initialize(context)
+
+ # regular content
+ ContentInit(
+ config.PROJECTNAME + ' Project Content',
+ content_types = tuple(member_content_types),
+ permission = permissions.AddPortalContent,
+ extra_constructors = tuple(member_constructors),
+ fti = ftis,
+ ).initialize(context)
diff --git a/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/__init__.pyc b/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/__init__.pyc
index 1c0a5f9..4044a36 100644
Binary files a/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/__init__.pyc and b/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/__init__.pyc differ
diff --git a/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/permissions.py b/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/permissions.py
index c519cfa..4f3757e 100755
--- a/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/permissions.py
+++ b/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/permissions.py
@@ -3,7 +3,7 @@ $Id: permissions.py 65992 2008-06-01 00:40:45Z rossp $
"""
from Products.CMFCore.permissions import setDefaultRoles
-AddExtensionCenter = "liboextensioncenter: Add Extension Center"
+AddSoftwareCenter = "liboextensioncenter: Add Extension Center"
AddProject = 'liboextensioncenter: Add Project'
AddReviewComment = 'liboextension: Add Review Comment'
ApproveProject = 'liboextensioncenter: Approve Project'
diff --git a/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/permissions.pyc b/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/permissions.pyc
index 1611958..14fdaab 100644
Binary files a/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/permissions.pyc and b/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/permissions.pyc differ
diff --git a/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/setuphandlers.py b/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/setuphandlers.py
index dc4783f..3b46dfe 100755
--- a/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/setuphandlers.py
+++ b/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/setuphandlers.py
@@ -21,8 +21,8 @@ from OFS.Image import File
from zExceptions import Unauthorized
from Products.Archetypes.atapi import *
from Products.CMFCore.utils import getToolByName
-from Products.liboextensioncenter import config
-from Products.liboextensioncenter.content.downloadablefile import PSCFile, PSCFileSchema
+from am.liboextensioncenter import config
+from am.liboextensioncenter.content.downloadablefile import PSCFile, PSCFileSchema
from ZODB.POSException import ConflictError
NAME = re.compile('Name: (.*)')
diff --git a/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/setuphandlers.pyc b/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/setuphandlers.pyc
index 8cf0cdb..1a12432 100644
Binary files a/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/setuphandlers.pyc and b/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/setuphandlers.pyc differ
diff --git a/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/validators.py b/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/validators.py
index 3010144..e164c8d 100755
--- a/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/validators.py
+++ b/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/validators.py
@@ -18,7 +18,7 @@ from zope.interface import implements
from Products.validation.interfaces.IValidator import IValidator
from zope.component import adapts
from Products.Archetypes.interfaces import IObjectPreValidation
-from Products.liboextensioncenter.interfaces import IProjectContent
+from am.liboextensioncenter.interfaces import IProjectContent
from zope.i18nmessageid import MessageFactory
diff --git a/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/validators.pyc b/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/validators.pyc
index aaa511c..dad829f 100644
Binary files a/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/validators.pyc and b/liboextensioncenter/am.liboextensioncenter/am/liboextensioncenter/validators.pyc differ
More information about the Libreoffice-commits
mailing list