Change portal language
Stefan Bund [Thu, 22 Oct 2009 07:43:38 +0000 (09:43 +0200)]
src/koehsel.policy/koehsel/policy/profiles/default/portal_languages.xml [new file with mode: 0644]
src/koehsel.policy/koehsel/policy/setuphandlers.py

diff --git a/src/koehsel.policy/koehsel/policy/profiles/default/portal_languages.xml b/src/koehsel.policy/koehsel/policy/profiles/default/portal_languages.xml
new file mode 100644 (file)
index 0000000..08790bd
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<object>
+ <default_language value="de"/>
+ <use_path_negotiation value="False"/>
+ <use_cookie_negotiation value="False"/>
+ <use_request_negotiation value="False"/>
+ <use_cctld_negotiation value="False"/>
+ <use_content_negotiation value="False"/>
+ <use_combined_language_codes value="False"/>
+ <display_flags value="False"/>
+ <start_neutral value="False"/>
+ <use_subdomain_negotiation value="False"/>
+ <authenticated_users_only value="False"/>
+ <supported_langs>
+  <element value="de"/>
+ </supported_langs>
+</object>
index 71cd558..d175a1f 100644 (file)
@@ -16,9 +16,10 @@ specify additional factory arguments. After creation, the object is published if
     id = container.invokeFactory(id=id, type_name=type_name, **kw)
     ob = getattr(container,id)
     event.notify(ObjectInitializedEvent(ob))
-    ob.at_post_create_script()
-#    if hasattr(aq_base(ob), 'manage_afterPortalFactoryCreate'):
-#        ob.manage_afterPortalFactoryCreate()
+    if hasattr(aq_base(ob), 'at_post_create_script'):
+        ob.at_post_create_script()
+    if hasattr(aq_base(ob), 'manage_afterPortalFactoryCreate'):
+        ob.manage_afterPortalFactoryCreate()
     wf = getToolByName(container, 'portal_workflow')
     if wf.getInfoFor(ob,'review_state','') != 'published':
         wf.doActionFor(ob,'publish',comment='site setup')
@@ -70,7 +71,7 @@ def appInit(app):
 
         # Call 'contentSetup' as SITE_OWNER user with a valid REQUEST
         req = makerequest(app)
-        newSecurityManager(req.REQUEST, app.acl_users.getUser(SITE_OWNER).__of__(app.acl_users))
+        newSecurityManager(req.REQUEST, app.acl_users.getUserById(SITE_OWNER).__of__(app.acl_users))
         contentSetup(req)
         transaction.commit()
         newSecurityManager(None, AccessControl.User.system)