source: publico/ILSAALRecursosHumanos/trunk/__init__.py @ 1131

Última Alteração nesse arquivo desde 1131 foi 1131, incluída por jonesmadruga, 14 anos atrás

codigo gerado a partir do novo modelo

File size: 3.2 KB
Linha 
1#
2# Initialise the product's module. There are three ways to inject custom code
3# here:
4#
5#   - To set global configuration variables, create a file AppConfig.py. This
6#       will be imported in config.py, which in turn is imported in each
7#       generated class and in this file.
8#   - To perform custom initialisation after types have been registered, use
9#       the protected code section at the bottom of initialize().
10#   - To register a customisation policy, create a file CustomizationPolicy.py
11#       with a method register(context) to register the policy
12#
13
14from zLOG import LOG, INFO
15
16LOG('ILSAALRecursosHumanos',INFO, 'Installing Product')
17
18try:
19    import CustomizationPolicy
20except ImportError:
21    CustomizationPolicy=None
22
23from Globals import package_home
24from Products.CMFCore import utils, CMFCorePermissions, DirectoryView
25from Products.CMFPlone.PloneUtilities import ToolInit
26from Products.Archetypes.public import *
27from Products.Archetypes import listTypes
28from Products.Archetypes.utils import capitalize
29
30import os, os.path
31
32from Products.ILSAALRecursosHumanos.config import *
33
34DirectoryView.registerDirectory('skins', product_globals)
35DirectoryView.registerDirectory('skins/ILSAALRecursosHumanos',
36                                    product_globals)
37
38##code-section custom-init-head #fill in your manual code here
39##/code-section custom-init-head
40
41
42def initialize(context):
43    ##code-section custom-init-top #fill in your manual code here
44    ##/code-section custom-init-top
45
46    # imports packages and types for registration
47    import interfaces
48
49    import Ferias
50    import Vencimentos
51    import Recisao
52    import Sefip
53    import EventoHistoricoFucional
54    import AdicionalTempoServico
55    import Dependente
56    import Empregados
57    import Sindicato
58    import Sindicatos
59    import Dependentes
60    import LogRh
61    import Sefips
62    import PessoaFisica
63    import Pensionista
64    import RepresentanteLegal
65    import Empregado
66    import Fgts
67    import Afastamento
68    import Pensionistas
69    import ITitulo
70
71    # initialize portal content
72    all_content_types, all_constructors, all_ftis = process_types(
73        listTypes(PROJECTNAME),
74        PROJECTNAME)
75
76    utils.ContentInit(
77        PROJECTNAME + ' Content',
78        content_types      = all_content_types,
79        permission         = DEFAULT_ADD_CONTENT_PERMISSION,
80        extra_constructors = all_constructors,
81        fti                = all_ftis,
82        ).initialize(context)
83
84    # give it some extra permissions to control them on a per class limit
85    for i in range(0,len(all_content_types)):
86        klassname=all_content_types[i].__name__
87        if not klassname in ADD_CONTENT_PERMISSIONS:
88            continue
89
90        context.registerClass(meta_type   = all_ftis[i]['meta_type'],
91                              constructors= (all_constructors[i],),
92                              permission  = ADD_CONTENT_PERMISSIONS[klassname])
93
94    # apply customization-policy, if theres any
95    if CustomizationPolicy and hasattr(CustomizationPolicy, 'register'):
96        CustomizationPolicy.register(context)
97        print 'Customization policy for ILSAALRecursosHumanos installed'
98
99    ##code-section custom-init-bottom #fill in your manual code here
100    ##/code-section custom-init-bottom
101
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.