| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
from zLOG import LOG, INFO |
|---|
| 15 |
|
|---|
| 16 |
LOG('PloneXL8',INFO, 'Installing Product') |
|---|
| 17 |
|
|---|
| 18 |
try: |
|---|
| 19 |
import CustomizationPolicy |
|---|
| 20 |
except ImportError: |
|---|
| 21 |
CustomizationPolicy=None |
|---|
| 22 |
|
|---|
| 23 |
from Globals import package_home |
|---|
| 24 |
from Products.CMFCore import utils as cmfutils |
|---|
| 25 |
from Products.CMFCore import CMFCorePermissions |
|---|
| 26 |
from Products.CMFCore import DirectoryView |
|---|
| 27 |
from Products.CMFPlone.PloneUtilities import ToolInit |
|---|
| 28 |
from Products.Archetypes.public import * |
|---|
| 29 |
from Products.Archetypes import listTypes |
|---|
| 30 |
from Products.Archetypes.utils import capitalize |
|---|
| 31 |
|
|---|
| 32 |
import os, os.path |
|---|
| 33 |
|
|---|
| 34 |
from Products.PloneXL8.config import * |
|---|
| 35 |
|
|---|
| 36 |
DirectoryView.registerDirectory('skins', product_globals) |
|---|
| 37 |
DirectoryView.registerDirectory('skins/PloneXL8', |
|---|
| 38 |
product_globals) |
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
def initialize(context): |
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
import TranslationDoc |
|---|
| 51 |
import TranslationCenter |
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
all_content_types, all_constructors, all_ftis = process_types( |
|---|
| 55 |
listTypes(PROJECTNAME), |
|---|
| 56 |
PROJECTNAME) |
|---|
| 57 |
|
|---|
| 58 |
cmfutils.ContentInit( |
|---|
| 59 |
PROJECTNAME + ' Content', |
|---|
| 60 |
content_types = all_content_types, |
|---|
| 61 |
permission = DEFAULT_ADD_CONTENT_PERMISSION, |
|---|
| 62 |
extra_constructors = all_constructors, |
|---|
| 63 |
fti = all_ftis, |
|---|
| 64 |
).initialize(context) |
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 |
for i in range(0,len(all_content_types)): |
|---|
| 68 |
klassname=all_content_types[i].__name__ |
|---|
| 69 |
if not klassname in ADD_CONTENT_PERMISSIONS: |
|---|
| 70 |
continue |
|---|
| 71 |
|
|---|
| 72 |
context.registerClass(meta_type = all_ftis[i]['meta_type'], |
|---|
| 73 |
constructors= (all_constructors[i],), |
|---|
| 74 |
permission = ADD_CONTENT_PERMISSIONS[klassname]) |
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 |
if CustomizationPolicy and hasattr(CustomizationPolicy, 'register'): |
|---|
| 78 |
CustomizationPolicy.register(context) |
|---|
| 79 |
print 'Customization policy for PloneXL8 installed' |
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 |
|
|---|
| 83 |
|
|---|