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

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

Implementada a documentação das classes do módulo de recursos humanos, mas faltam várias definições ainda que não estão na documentação

File size: 3.3 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 UnidadeCentroCusto
51    import Vencimentos
52    import Recisao
53    import Sefip
54    import EventoHistoricoFucional
55    import AdicionalTempoServico
56    import Dependente
57    import Empregados
58    import Sindicato
59    import Sindicatos
60    import Dependentes
61    import LogRh
62    import Sefips
63    import UnidadesCentroCusto
64    import AgenciaBancaria
65    import Banco
66    import Bancos
67    import PessoaFisica
68    import Pensionista
69    import RepresentanteLegal
70    import Empregado
71    import Fgts
72    import Afastamento
73    import Pensionistas
74
75    # initialize portal content
76    all_content_types, all_constructors, all_ftis = process_types(
77        listTypes(PROJECTNAME),
78        PROJECTNAME)
79
80    utils.ContentInit(
81        PROJECTNAME + ' Content',
82        content_types      = all_content_types,
83        permission         = DEFAULT_ADD_CONTENT_PERMISSION,
84        extra_constructors = all_constructors,
85        fti                = all_ftis,
86        ).initialize(context)
87
88    # give it some extra permissions to control them on a per class limit
89    for i in range(0,len(all_content_types)):
90        klassname=all_content_types[i].__name__
91        if not klassname in ADD_CONTENT_PERMISSIONS:
92            continue
93
94        context.registerClass(meta_type   = all_ftis[i]['meta_type'],
95                              constructors= (all_constructors[i],),
96                              permission  = ADD_CONTENT_PERMISSIONS[klassname])
97
98    # apply customization-policy, if theres any
99    if CustomizationPolicy and hasattr(CustomizationPolicy, 'register'):
100        CustomizationPolicy.register(context)
101        print 'Customization policy for ILSAALRecursosHumanos installed'
102
103    ##code-section custom-init-bottom #fill in your manual code here
104    ##/code-section custom-init-bottom
105
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.