source: publico/ILPortal/trunk/__init__.py @ 2547

Última Alteração nesse arquivo desde 2547 foi 2547, incluída por paulovieira, 13 anos atrás

correção na busca de conteudo das casas

File size: 4.0 KB
Linha 
1# -*- coding: utf-8 -*-
2#
3# File: ILPortal.py
4#
5# Copyright (c) 2006 by Interlegis
6# Generator: ArchGenXML Version 1.5.0 svn/devel
7#            http://plone.org/products/archgenxml
8#
9# GNU General Public License (GPL)
10#
11# This program is free software; you can redistribute it and/or
12# modify it under the terms of the GNU General Public License
13# as published by the Free Software Foundation; either version 2
14# of the License, or (at your option) any later version.
15#
16# This program is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with this program; if not, write to the Free Software
23# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24# 02110-1301, USA.
25#
26
27__author__ = """STC Interlegis <admin-stc@interlegis.gov.br>"""
28__docformat__ = 'plaintext'
29
30
31# There are three ways to inject custom code here:
32#
33#   - To set global configuration variables, create a file AppConfig.py.
34#       This will be imported in config.py, which in turn is imported in
35#       each generated class and in this file.
36#   - To perform custom initialisation after types have been registered,
37#       use the protected code section at the bottom of initialize().
38#   - To register a customisation policy, create a file CustomizationPolicy.py
39#       with a method register(context) to register the policy.
40
41from zLOG import LOG, INFO
42
43LOG('ILPortal',INFO, 'Installing Product')
44
45try:
46    import CustomizationPolicy
47except ImportError:
48    CustomizationPolicy = None
49
50from Globals import package_home
51from Products.CMFCore import utils as cmfutils
52from Products.CMFCore import CMFCorePermissions
53from Products.CMFCore import DirectoryView
54from Products.CMFPlone.PloneUtilities import ToolInit
55from Products.Archetypes.atapi import *
56from Products.Archetypes import listTypes
57from Products.Archetypes.utils import capitalize
58
59import os, os.path
60
61from Products.ILPortal.config import *
62
63DirectoryView.registerDirectory('skins', product_globals)
64DirectoryView.registerDirectory('skins/ILPortal',
65                                    product_globals)
66
67##code-section custom-init-head #fill in your manual code here
68from Products.ILPortal import Validators
69##/code-section custom-init-head
70
71
72def initialize(context):
73    ##code-section custom-init-top #fill in your manual code here
74    ##/code-section custom-init-top
75
76    # imports packages and types for registration
77
78    import MesaDiretora
79    import CasaLegislativa
80    import Parlamentar
81    import MembroMesaDiretora
82    import MemberFolder
83    import MelhoresPraticas
84    import VideoConferencia
85    import TextoPasta
86    import SolicitacaoFolder
87    import Solicitacao
88    import Resposta
89
90    # Initialize portal content
91    all_content_types, all_constructors, all_ftis = process_types(
92        listTypes(PROJECTNAME),
93        PROJECTNAME)
94
95    cmfutils.ContentInit(
96        PROJECTNAME + ' Content',
97        content_types      = all_content_types,
98        permission         = DEFAULT_ADD_CONTENT_PERMISSION,
99        extra_constructors = all_constructors,
100        fti                = all_ftis,
101        ).initialize(context)
102
103    # Give it some extra permissions to control them on a per class limit
104    for i in range(0,len(all_content_types)):
105        klassname=all_content_types[i].__name__
106        if not klassname in ADD_CONTENT_PERMISSIONS:
107            continue
108
109        context.registerClass(meta_type   = all_ftis[i]['meta_type'],
110                              constructors= (all_constructors[i],),
111                              permission  = ADD_CONTENT_PERMISSIONS[klassname])
112
113    # Apply customization-policy, if theres any
114    if CustomizationPolicy and hasattr(CustomizationPolicy, 'register'):
115        CustomizationPolicy.register(context)
116        print 'Customization policy for ILPortal installed'
117
118    ##code-section custom-init-bottom #fill in your manual code here
119    ##/code-section custom-init-bottom
120
Note: Veja TracBrowser para ajuda no uso do navegador do trac.
 

The contents and data of this website are published under license:
Creative Commons 4.0 Brasil - Atribuir Fonte - Compartilhar Igual.