appease (mostly) pyflakes by dropping some dead code, pending further collapse...

appease (mostly) pyflakes by dropping some dead code, pending further collapse of the PortalGenerator class into ERP5Generator

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34665 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a0587e04
......@@ -1355,44 +1355,10 @@ class PortalGenerator:
p.manage_addProduct['CMFCore'].manage_addCC(
id='cookie_authentication')
def setupMembersFolder(self, p):
PortalFolder.manage_addPortalFolder(p, 'Members')
p.Members.manage_addProduct['OFSP'].manage_addDTMLMethod(
'index_html', 'Member list', '<dtml-return roster>')
def setupRoles(self, p):
# Set up the suggested roles.
p.__ac_roles__ = ('Member', 'Reviewer',)
def setupPermissions(self, p):
# Set up some suggested role to permission mappings.
mp = p.manage_permission
mp(AccessFuturePortalContent, ['Reviewer','Manager',], 1)
mp(AddPortalContent, ['Owner','Manager',], 1)
mp(AddPortalFolders, ['Owner','Manager',], 1)
mp(ListPortalMembers, ['Member','Manager',], 1)
mp(ListUndoableChanges, ['Member','Manager',], 1)
mp(ReplyToItem, ['Member','Manager',], 1)
mp(ReviewPortalContent, ['Reviewer','Manager',], 1)
mp(SetOwnPassword, ['Member','Manager',], 1)
mp(SetOwnProperties, ['Member','Manager',], 1)
# Add some other permissions mappings that may be helpful.
mp(DeleteObjects, ['Owner','Manager',], 1)
mp(FTPAccess, ['Owner','Manager',], 1)
mp(ManageProperties, ['Owner','Manager',], 1)
mp(UndoChanges, ['Owner','Manager',], 1)
mp(ViewManagementScreens, ['Owner','Manager',], 1)
def setupTypes(self, p, initial_types=factory_type_information):
tool = getToolByName(p, 'portal_types', None)
if tool is None:
return
for t in initial_types:
fti = FactoryTypeInformation(**t)
tool._setObject(t['id'], fti)
def setupMimetypes(self, p):
p.manage_addProduct[ 'CMFCore' ].manage_addRegistry()
reg = p.content_type_registry
......@@ -1417,38 +1383,6 @@ class PortalGenerator:
reg.getPredicate( 'file' ).edit( major="application", minor="" )
reg.assignTypeName( 'file', 'File' )
def setup(self, p, create_userfolder):
from Products.CMFTopic import Topic
self.setupTools(p)
self.setupMailHost(p)
if int(create_userfolder) != 0:
self.setupUserFolder(p)
self.setupCookieAuth(p)
self.setupMembersFolder(p)
self.setupRoles(p)
self.setupPermissions(p)
self.setupDefaultSkins(p)
# SkinnedFolders are only for customization;
# they aren't a default type.
default_types = tuple( filter( lambda x: x['id'] != 'Skinned Folder'
, factory_type_information ) )
self.setupTypes(p, default_types )
self.setupTypes(p, PortalFolder.factory_type_information)
self.setupTypes(p, Topic.factory_type_information)
self.setupMimetypes(p)
self.setupWorkflow(p)
def create(self, parent, id, create_userfolder):
id = str(id)
portal = self.klass(id=id)
parent._setObject(id, portal)
# Return the fully wrapped object.
p = parent.this()._getOb(id)
self.setup(p, create_userfolder)
return p
def setupDefaultProperties(self, p, title, description,
email_from_address, email_from_name,
validate_email, default_charset=''):
......@@ -1951,10 +1885,6 @@ class ERP5Generator(PortalGenerator):
self.setupPermissions(p)
self.setupDefaultSkins(p)
# Finish setup
if not p.hasObject('Members'):
self.setupMembersFolder(p)
# ERP5 Design Choice is that all content should be user defined
# Content is disseminated through business templates
self.setupPortalTypes(p)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment