NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/citation/trunk/Citation/__init__.py

Revision 11 (checked in by cbc, 17 years ago)

Initial import of Citation content type

Line 
1 # -*- coding: utf-8 -*-
2 #
3 # File: Citation.py
4 #
5 # Copyright (c) 2007 by Chris Calloway & Veda Williams
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__ = """Chris Calloway & Veda Williams <cbc@unc.edu>"""
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
41 from zLOG import LOG, INFO, DEBUG
42
43 LOG('Citation', DEBUG, 'Installing Product')
44
45 try:
46     import CustomizationPolicy
47 except ImportError:
48     CustomizationPolicy = None
49
50 from Globals import package_home
51 from Products.CMFCore import utils as cmfutils
52 from Products.CMFCore import CMFCorePermissions
53 from Products.CMFCore import DirectoryView
54 from Products.CMFPlone.PloneUtilities import ToolInit
55 from Products.Archetypes.atapi import *
56 from Products.Archetypes import listTypes
57 from Products.Archetypes.utils import capitalize
58
59 import os, os.path
60
61 from Products.Citation.config import *
62
63 DirectoryView.registerDirectory('skins', product_globals)
64 DirectoryView.registerDirectory('skins/Citation',
65                                     product_globals)
66
67 ##code-section custom-init-head #fill in your manual code here
68 ##/code-section custom-init-head
69
70
71 def initialize(context):
72     ##code-section custom-init-top #fill in your manual code here
73     ##/code-section custom-init-top
74
75     # imports packages and types for registration
76
77     import Citation
78
79     # Initialize portal content
80     content_types, constructors, ftis = process_types(
81         listTypes(PROJECTNAME),
82         PROJECTNAME)
83
84     cmfutils.ContentInit(
85         PROJECTNAME + ' Content',
86         content_types      = content_types,
87         permission         = DEFAULT_ADD_CONTENT_PERMISSION,
88         extra_constructors = constructors,
89         fti                = ftis,
90         ).initialize(context)
91
92     # Apply customization-policy, if theres any
93     if CustomizationPolicy and hasattr(CustomizationPolicy, 'register'):
94         CustomizationPolicy.register(context)
95         print 'Customization policy for Citation installed'
96
97     ##code-section custom-init-bottom #fill in your manual code here
98     ##/code-section custom-init-bottom
99
Note: See TracBrowser for help on using the browser.