From tim at mail.se.linux.org  Wed Aug  1 18:25:52 2007
From: tim at mail.se.linux.org (tim@mail.se.linux.org)
Date: Wed Aug  1 18:25:53 2007
Subject: [commits] r96 - in selinux-site/trunk/selinux.theme/selinux/theme:
	. skins/selinuxtheme
Message-ID: <E1IGH1E-0004dL-6o@mail.se.linux.org>

Author: tim
Date: 2007-08-01 18:25:51 +0200 (Wed, 01 Aug 2007)
New Revision: 96

Modified:
   selinux-site/trunk/selinux.theme/selinux/theme/notifications.py
   selinux-site/trunk/selinux.theme/selinux/theme/setuphandlers.py
   selinux-site/trunk/selinux.theme/selinux/theme/skins/selinuxtheme/ploneCustom.css.dtml
   selinux-site/trunk/selinux.theme/selinux/theme/skins/selinuxtheme/selinux_index.pt
Log:
Make the site look better in Internet Explorer.


Modified: selinux-site/trunk/selinux.theme/selinux/theme/notifications.py
===================================================================
--- selinux-site/trunk/selinux.theme/selinux/theme/notifications.py	2007-07-31 08:15:23 UTC (rev 95)
+++ selinux-site/trunk/selinux.theme/selinux/theme/notifications.py	2007-08-01 16:25:51 UTC (rev 96)
@@ -5,7 +5,7 @@
 
 def irc_object_added(obj, event):
     workflow = getToolByName(obj, 'portal_workflow')
-    state = workflow.getInfoFor(obj, 'review_state')
+    state = workflow.getInfoFor(obj, 'review_state', None)
 
     # when an object is created it's first added to a temporary folder
     # that shouldn't trigger irc notification
@@ -14,7 +14,10 @@
         obj_type = utranslate('plone', obj.portal_type,
                          target_language='sv', context=obj)
         msg = "%s (%s), %s" % (obj.Title(), obj_type, obj.absolute_url())
-        server.say('webb', msg)
+        try:
+            server.say('webb', msg)
+        except:
+            pass
 
 def irc_object_published(obj, event):
     irc_object_added(obj, event)

Modified: selinux-site/trunk/selinux.theme/selinux/theme/setuphandlers.py
===================================================================
--- selinux-site/trunk/selinux.theme/selinux/theme/setuphandlers.py	2007-07-31 08:15:23 UTC (rev 95)
+++ selinux-site/trunk/selinux.theme/selinux/theme/setuphandlers.py	2007-08-01 16:25:51 UTC (rev 96)
@@ -29,11 +29,12 @@
     mship.setMembersFolderById('medlemmar')
 
     # Members folder is renamed to medlemmar
-    members = getattr(site, 'Members')
-    if members:
+    members = getattr(site, 'medlemmar', None)
+    if members is None:
         global_allow = portal_types['Large Plone Folder'].global_allow
         portal_types['Large Plone Folder'].global_allow = True
-        site.manage_renameObject('Members', 'medlemmar')
+        site.invokeFactory('Large Plone Folder', id='medlemmar',
+                           title='Medlemmar')
         portal_types['Large Plone Folder'].global_allow = global_allow
 
     # members should get their own folders

Modified: selinux-site/trunk/selinux.theme/selinux/theme/skins/selinuxtheme/ploneCustom.css.dtml
===================================================================
--- selinux-site/trunk/selinux.theme/selinux/theme/skins/selinuxtheme/ploneCustom.css.dtml	2007-07-31 08:15:23 UTC (rev 95)
+++ selinux-site/trunk/selinux.theme/selinux/theme/skins/selinuxtheme/ploneCustom.css.dtml	2007-08-01 16:25:51 UTC (rev 96)
@@ -13,11 +13,15 @@
 
 /* header */
 
+#portal-header {
+    margin: 0pt;
+}
+
 #portal-logo {
     background: url(&dtml-portal_url;/logo.jpg) no-repeat;
     display: block;
-    width: 100%;
-    height: 128px;
+    height: 129px;
+    width: 60%;
 }
 
 body {

Modified: selinux-site/trunk/selinux.theme/selinux/theme/skins/selinuxtheme/selinux_index.pt
===================================================================
--- selinux-site/trunk/selinux.theme/selinux/theme/skins/selinuxtheme/selinux_index.pt	2007-07-31 08:15:23 UTC (rev 95)
+++ selinux-site/trunk/selinux.theme/selinux/theme/skins/selinuxtheme/selinux_index.pt	2007-08-01 16:25:51 UTC (rev 96)
@@ -79,16 +79,16 @@
     </p>
     </div>
 
-    <div style="float: left;width:30%;margin-top:0em; margin-left:2em">
+    <div style="float: left;width:30%;margin-top:0em;margin-left:2em">
         <table style="width:100%; background-color:#F4F6BF">
         <thead>
-          <th>M&aring;ndag</th>
-          <th>Tisdag</th>
-          <th>Onsdag</th>
-          <th>Torsdag</th>
-          <th>Fredag</th>
-          <th>L&ouml;rdag</th>
-          <th>S&ouml;ndag</th>
+          <th style="width:13%">M&aring;</th>
+          <th style="width:13%">Ti</th>
+          <th style="width:13%">On</th>
+          <th style="width:13%">To</th>
+          <th style="width:13%">Fr</th>
+          <th style="width:13%">L&ouml;</th>
+          <th style="width:13%">S&ouml;</th>
         </thead>
         <tbody>
           <tr>
@@ -165,7 +165,7 @@
         </div>
     </div>
 
-    <div style="float: left;width:30%;margin-top:0em; margin-left: 2em">
+    <div style="float: left;width:30%;margin-top:0em;margin-left:2em">
         <div style="text-align: center">
           <a href="#">Visa LUGs</a>
           <br/>
@@ -178,6 +178,7 @@
         </div>
         <div class="visualClear"> <!-- &nbsp; --> </div>
     </div>
+    <div class="visualClear"> <!-- &nbsp; --> </div>
 </div>
 
 </body>


From tim at mail.se.linux.org  Thu Aug  2 18:12:07 2007
From: tim at mail.se.linux.org (tim@mail.se.linux.org)
Date: Thu Aug  2 18:12:08 2007
Subject: [commits] r97 - selinux-site/trunk/buildout
Message-ID: <E1IGdHT-0000cd-Jk@mail.se.linux.org>

Author: tim
Date: 2007-08-02 18:12:07 +0200 (Thu, 02 Aug 2007)
New Revision: 97

Modified:
   selinux-site/trunk/buildout/base.cfg
   selinux-site/trunk/buildout/buildout.cfg
Log:
Changed the zope version to be installed to 2.10.4. Plone needs it. Also added a PIL egg so one doesn't have to install it in the system.


Modified: selinux-site/trunk/buildout/base.cfg
===================================================================
--- selinux-site/trunk/buildout/base.cfg	2007-08-01 16:25:51 UTC (rev 96)
+++ selinux-site/trunk/buildout/base.cfg	2007-08-02 16:12:07 UTC (rev 97)
@@ -46,9 +46,13 @@
 
 [zope2]
 recipe = plone.recipe.zope2install
-url = http://www.zope.org/Products/Zope/2.10.3/Zope-2.10.3-final.tgz
+url = http://www.zope.org/Products/Zope/2.10.4/Zope-2.10.4-final.tgz
 # svn = svn://svn.zope.org/repos/main/Zope/branches/2.10
 
+[PILwoTK]
+recipe = zc.recipe.egg
+find-links =
+    http://download.zope.org/distribution/
 
 [instance]
 recipe = plone.recipe.zope2instance

Modified: selinux-site/trunk/buildout/buildout.cfg
===================================================================
--- selinux-site/trunk/buildout/buildout.cfg	2007-08-01 16:25:51 UTC (rev 96)
+++ selinux-site/trunk/buildout/buildout.cfg	2007-08-02 16:12:07 UTC (rev 97)
@@ -7,6 +7,7 @@
 parts =
     zope2
     instance
+    PILwoTK
     zopepy
     createinstance
 


From tim at mail.se.linux.org  Thu Aug  2 21:20:14 2007
From: tim at mail.se.linux.org (tim@mail.se.linux.org)
Date: Thu Aug  2 21:20:15 2007
Subject: [commits] r98 - selinux-site/trunk
Message-ID: <E1IGgDW-00018m-BO@mail.se.linux.org>

Author: tim
Date: 2007-08-02 21:20:14 +0200 (Thu, 02 Aug 2007)
New Revision: 98

Added:
   selinux-site/trunk/README-en.txt
Log:
Added an english version of the README, contributed by Jerimiah.


Added: selinux-site/trunk/README-en.txt
===================================================================
--- selinux-site/trunk/README-en.txt	2007-08-02 16:12:07 UTC (rev 97)
+++ selinux-site/trunk/README-en.txt	2007-08-02 19:20:14 UTC (rev 98)
@@ -0,0 +1,26 @@
+Installation of the Swedish Linux User Group's site
+===================================================
+To install plone and the selinux site you need to have version
+2.4 of python and subversion installed. You can build the site
+this way;
+
+  $ cd <directory-where-I-want-my-site>
+  $ svn co https://svn.se.linux.org/selinux-site/trunk/buildout/ buildout
+  $ cd buildout
+  $ python bootstrap.py
+  $ ./bin/buildout
+
+Plone and the selinux site are now installed. To get it running do
+
+  $ ./bin/instance fg
+
+You can view the site in a browser at http://localhost:8080/selinux/
+
+
+Troubleshooting
+===============
+If you encounter a problem in step 4 (python bootstrap.py) and the error
+message states that you have an old version of setuptools, this should help:
+
+  $ wget http://peak.telecommunity.com/dist/ez_setup.py
+  $ sudo python ez_setup.py


From jens at mail.se.linux.org  Sun Aug  5 21:11:08 2007
From: jens at mail.se.linux.org (jens@mail.se.linux.org)
Date: Sun Aug  5 21:11:10 2007
Subject: [commits] r99 -
	selinux-site/trunk/selinux.theme/selinux/theme/skins/selinuxtheme
Message-ID: <E1IHlVM-0000oq-IS@mail.se.linux.org>

Author: jens
Date: 2007-08-05 21:11:07 +0200 (Sun, 05 Aug 2007)
New Revision: 99

Added:
   selinux-site/trunk/selinux.theme/selinux/theme/skins/selinuxtheme/favicon.ico
Log:
Alexanders favicon inlagd.


Added: selinux-site/trunk/selinux.theme/selinux/theme/skins/selinuxtheme/favicon.ico
===================================================================
(Binary files differ)


Property changes on: selinux-site/trunk/selinux.theme/selinux/theme/skins/selinuxtheme/favicon.ico
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream


From tim at mail.se.linux.org  Thu Aug  9 21:19:33 2007
From: tim at mail.se.linux.org (tim@mail.se.linux.org)
Date: Thu Aug  9 21:19:34 2007
Subject: [commits] r100 -
	selinux-site/trunk/selinux.theme/selinux/theme/skins/selinuxtheme
Message-ID: <E1IJDXh-00067W-3P@mail.se.linux.org>

Author: tim
Date: 2007-08-09 21:19:32 +0200 (Thu, 09 Aug 2007)
New Revision: 100

Added:
   selinux-site/trunk/selinux.theme/selinux/theme/skins/selinuxtheme/rss.png
Modified:
   selinux-site/trunk/selinux.theme/selinux/theme/skins/selinuxtheme/selinux_index.pt
Log:
Added a news rss icon and link to the right of "L?\195?\164gg till nyhet".


Added: selinux-site/trunk/selinux.theme/selinux/theme/skins/selinuxtheme/rss.png
===================================================================
(Binary files differ)


Property changes on: selinux-site/trunk/selinux.theme/selinux/theme/skins/selinuxtheme/rss.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: selinux-site/trunk/selinux.theme/selinux/theme/skins/selinuxtheme/selinux_index.pt
===================================================================
--- selinux-site/trunk/selinux.theme/selinux/theme/skins/selinuxtheme/selinux_index.pt	2007-08-05 19:11:07 UTC (rev 99)
+++ selinux-site/trunk/selinux.theme/selinux/theme/skins/selinuxtheme/selinux_index.pt	2007-08-09 19:19:32 UTC (rev 100)
@@ -46,10 +46,16 @@
     -->
     <div style="float:left; width:30%;margin-top:0em;">
     <p id="contributeNews">
-        <a href="/nyheter/createObject?type_name=News Item">
+        <a href="/nyheter/createObject?type_name=News Item" style="float: left">
             L&auml;gg till nyhet
         </a>
+        <a class="link-plain" href="#" style="float: right"
+           tal:attributes="href string:${portal_url}/nyheter/aggregator/RSS">
+            <img src="" title="RSS subscription feed for news items" alt="RSS"
+               tal:attributes="src string:${portal_url}/rss.png" />
+        </a>
     </p>
+    <div class="visualClear"> <!-- &nbsp; --> </div>
 
     <div class="newsbox" tal:repeat="newsitem frontpage/news">
         <h3 tal:content="newsitem/title" />


From tim at mail.se.linux.org  Sat Aug 18 00:55:36 2007
From: tim at mail.se.linux.org (tim@mail.se.linux.org)
Date: Sat Aug 18 00:55:38 2007
Subject: [commits] r101 - in selinux-site/trunk/selinux.theme/selinux/theme:
	. profiles/default profiles/default/structure
	profiles/default/structure/handelser
	profiles/default/structure/medlemmar
	profiles/default/structure/nyheter
Message-ID: <E1IMAjA-0005cD-Ps@mail.se.linux.org>

Author: tim
Date: 2007-08-18 00:55:36 +0200 (Sat, 18 Aug 2007)
New Revision: 101

Added:
   selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/
   selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/.objects
   selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/.properties
   selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/handelser/
   selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/handelser/.objects
   selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/handelser/.properties
   selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/medlemmar/
   selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/medlemmar/.objects
   selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/medlemmar/.properties
   selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/medlemmar/index_html.py
   selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/nyheter/
   selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/nyheter/.objects
   selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/nyheter/.properties
Modified:
   selinux-site/trunk/selinux.theme/selinux/theme/configure.zcml
   selinux-site/trunk/selinux.theme/selinux/theme/setuphandlers.py
Log:
Added default folder structure to the site. We will probably add more default folders. Currently we only have 'medlemmar', 'nyheter' and 'handelser'. So everytime one creates a site using buildout this structure is created automatically.


Modified: selinux-site/trunk/selinux.theme/selinux/theme/configure.zcml
===================================================================
--- selinux-site/trunk/selinux.theme/selinux/theme/configure.zcml	2007-08-09 19:19:32 UTC (rev 100)
+++ selinux-site/trunk/selinux.theme/selinux/theme/configure.zcml	2007-08-17 22:55:36 UTC (rev 101)
@@ -3,7 +3,7 @@
     xmlns:cmf="http://namespaces.zope.org/cmf"
     xmlns:browser="http://namespaces.zope.org/browser"
     xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
-    xmlns:five="http://namespaces.zope.org/five">
+    i18n_domain="plone">
 
   <!-- register the selinuxtheme layer directory -->
   <cmf:registerDirectory name="selinuxtheme"/>

Added: selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/.objects
===================================================================
--- selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/.objects	2007-08-09 19:19:32 UTC (rev 100)
+++ selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/.objects	2007-08-17 22:55:36 UTC (rev 101)
@@ -0,0 +1,3 @@
+medlemmar,Large Plone Folder
+nyheter,Large Plone Folder
+handelser,Large Plone Folder

Added: selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/.properties
===================================================================
--- selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/.properties	2007-08-09 19:19:32 UTC (rev 100)
+++ selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/.properties	2007-08-17 22:55:36 UTC (rev 101)
@@ -0,0 +1,3 @@
+[DEFAULT]
+description = 
+title = Svenska Linuxföreningen

Added: selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/handelser/.objects
===================================================================
--- selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/handelser/.objects	2007-08-09 19:19:32 UTC (rev 100)
+++ selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/handelser/.objects	2007-08-17 22:55:36 UTC (rev 101)
@@ -0,0 +1 @@
+aggregator,Topic

Added: selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/handelser/.properties
===================================================================
--- selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/handelser/.properties	2007-08-09 19:19:32 UTC (rev 100)
+++ selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/handelser/.properties	2007-08-17 22:55:36 UTC (rev 101)
@@ -0,0 +1,4 @@
+[DEFAULT]
+description = Händelser
+title = Händelser
+

Added: selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/medlemmar/.objects
===================================================================

Added: selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/medlemmar/.properties
===================================================================
--- selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/medlemmar/.properties	2007-08-09 19:19:32 UTC (rev 100)
+++ selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/medlemmar/.properties	2007-08-17 22:55:36 UTC (rev 101)
@@ -0,0 +1,3 @@
+[DEFAULT]
+description = Medlemmars hemkataloger
+title = Medlemmar

Added: selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/medlemmar/index_html.py
===================================================================
--- selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/medlemmar/index_html.py	2007-08-09 19:19:32 UTC (rev 100)
+++ selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/medlemmar/index_html.py	2007-08-17 22:55:36 UTC (rev 101)
@@ -0,0 +1,11 @@
+## Script (Python) "index_html"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=User Search
+##
+member_search=context.restrictedTraverse('member_search_form')
+return member_search()

Added: selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/nyheter/.objects
===================================================================
--- selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/nyheter/.objects	2007-08-09 19:19:32 UTC (rev 100)
+++ selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/nyheter/.objects	2007-08-17 22:55:36 UTC (rev 101)
@@ -0,0 +1 @@
+aggregator,Topic

Added: selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/nyheter/.properties
===================================================================
--- selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/nyheter/.properties	2007-08-09 19:19:32 UTC (rev 100)
+++ selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/structure/nyheter/.properties	2007-08-17 22:55:36 UTC (rev 101)
@@ -0,0 +1,4 @@
+[DEFAULT]
+description = Nyheter
+title = Nyheter
+

Modified: selinux-site/trunk/selinux.theme/selinux/theme/setuphandlers.py
===================================================================
--- selinux-site/trunk/selinux.theme/selinux/theme/setuphandlers.py	2007-08-09 19:19:32 UTC (rev 100)
+++ selinux-site/trunk/selinux.theme/selinux/theme/setuphandlers.py	2007-08-17 22:55:36 UTC (rev 101)
@@ -1,42 +1,132 @@
 from Products.CMFCore.utils import getToolByName
-from zope.component import getUtility, getMultiAdapter
-from plone.portlets.interfaces import IPortletManager
-from plone.portlets.interfaces import IPortletAssignmentMapping
+from Products.CMFPlone.utils import _createObjectByType
+from Products.ATContentTypes.lib import constraintypes
 
+
 def setupVarious(context):
-    setupFrontpage(context)
-    setupMemberFolder(context)
+    site = context.getSite()
+    setupFrontpage(site)
+    removePloneContent(site)
+    setupMemberFolder(site)
+    createNewsFolder(site)
+    createEventsFolder(site)
 
-def setupFrontpage(context):
-    site = context.getSite()
+def createEventsFolder(site):
+    wftool = getToolByName(site, 'portal_workflow')
+    existing = site.objectIds()
+
+    # Events topic
+    if 'handelser' not in existing:
+        events_title = 'Händelser'
+        events_desc = 'Händelser'
+
+        _createObjectByType('Large Plone Folder', site, id='handelser',
+                            title=events_title, description=events_desc)
+        _createObjectByType('Topic', site.events, id='aggregator',
+                            title=events_title, description=events_desc)
+        folder = site.handelser
+        folder.setConstrainTypesMode(constraintypes.ENABLED)
+        folder.setLocallyAllowedTypes(['Event'])
+        folder.setImmediatelyAddableTypes(['Event'])
+        folder.setDefaultPage('aggregator')
+        folder.unmarkCreationFlag()
+
+        if wftool.getInfoFor(folder, 'review_state') != 'published':
+            wftool.doActionFor(folder, 'publish')
+
+        topic = folder.aggregator
+        topic.unmarkCreationFlag()
+
+        type_crit = topic.addCriterion('Type','ATPortalTypeCriterion')
+        type_crit.setValue('Event')
+        sort_crit = topic.addCriterion('start','ATSortCriterion')
+        state_crit = topic.addCriterion('review_state', 'ATSimpleStringCriterion')
+        state_crit.setValue('published')
+        date_crit = topic.addCriterion('start', 'ATFriendlyDateCriteria')
+        # Set date reference to now
+        date_crit.setValue(0)
+        # Only take events in the future
+        date_crit.setDateRange('+') # This is irrelevant when the date is now
+        date_crit.setOperation('more')
+    else:
+        topic = site.handelser
+
+    if wftool.getInfoFor(topic, 'review_state') != 'published':
+        wftool.doActionFor(topic, 'publish')
+
+
+def createNewsFolder(site):
+    wftool = getToolByName(site, 'portal_workflow')
+    existing = site.objectIds()
+
+    # News topic
+    if 'nyheter' not in existing:
+        news_title = 'Nyheter'
+        news_desc = 'Nyheter'
+
+        _createObjectByType('Large Plone Folder', site, id='nyheter',
+                            title=news_title, description=news_desc)
+        _createObjectByType('Topic', site.nyheter, id='aggregator',
+                            title=news_title, description=news_desc)
+
+        folder = site.nyheter
+        folder.setConstrainTypesMode(constraintypes.ENABLED)
+        folder.setLocallyAllowedTypes(['News Item'])
+        folder.setImmediatelyAddableTypes(['News Item'])
+        folder.setDefaultPage('aggregator')
+        folder.unmarkCreationFlag()
+
+        if wftool.getInfoFor(folder, 'review_state') != 'published':
+            wftool.doActionFor(folder, 'publish')
+
+        topic = site.nyheter.aggregator
+        type_crit = topic.addCriterion('Type','ATPortalTypeCriterion')
+        type_crit.setValue('News Item')
+        sort_crit = topic.addCriterion('created','ATSortCriterion')
+        state_crit = topic.addCriterion('review_state', 'ATSimpleStringCriterion')
+        state_crit.setValue('published')
+        topic.setSortCriterion('effective', True)
+        topic.setLayout('folder_summary_view')
+        topic.unmarkCreationFlag()
+
+        if wftool.getInfoFor(topic, 'review_state') != 'published':
+            wftool.doActionFor(topic, 'publish')
+
+def setupFrontpage(site):
     if site.hasProperty('default_page'):
         site.manage_delProperties(ids=['default_page'])
 
-    left_column = getUtility(IPortletManager, name=u'plone.leftcolumn',
-                             context=site)
+    #left_column = getUtility(IPortletManager, name=u'plone.leftcolumn',
+    #                         context=site)
 
-    left = getMultiAdapter((site, left_column,), IPortletAssignmentMapping,
-                           context=site)
+    #left = getMultiAdapter((site, left_column,), IPortletAssignmentMapping,
+    #                       context=site)
 
-    keys = list(left.keys())
-    for key in keys:
-        del left[key]
+    #keys = list(left.keys())
+    #for key in keys:
+    #    del left[key]
 
-def setupMemberFolder(context):
-    site = context.getSite()
+        
+# until plone supports setting up the site without creating some initial
+# folders, we need to remove a few folders
+def removePloneContent(site):
+    for id in ('Members', 'news', 'events'):
+        if getattr(site, id, None):
+            site.manage_delObjects([id])
+        
+def setupMemberFolder(site):
     mship = getToolByName(site, 'portal_membership')
-    portal_types = getToolByName(site, 'portal_types')
+    workflow = getToolByName(site, 'portal_workflow')
+
+    # we call the members folder 'medlemmar'
     mship.setMembersFolderById('medlemmar')
 
-    # Members folder is renamed to medlemmar
-    members = getattr(site, 'medlemmar', None)
-    if members is None:
-        global_allow = portal_types['Large Plone Folder'].global_allow
-        portal_types['Large Plone Folder'].global_allow = True
-        site.invokeFactory('Large Plone Folder', id='medlemmar',
-                           title='Medlemmar')
-        portal_types['Large Plone Folder'].global_allow = global_allow
-
-    # members should get their own folders
+    # member folders should be created
     if not mship.getMemberareaCreationFlag():
         mship.setMemberareaCreationFlag()
+
+    # publish member folder
+    members = getattr(site, 'medlemmar', None)
+    if members is not None:
+        if workflow.getInfoFor(obj, 'review_state') != 'published':
+            workflow.doActionFor(obj, 'publish')


From tim at mail.se.linux.org  Sat Aug 18 01:11:36 2007
From: tim at mail.se.linux.org (tim@mail.se.linux.org)
Date: Sat Aug 18 01:11:36 2007
Subject: [commits] r102 - in selinux-site/trunk: . selinux.ircmessenger
	selinux.ircmessenger/selinux
	selinux.ircmessenger/selinux/ircmessenger
Message-ID: <E1IMAye-0005eu-1n@mail.se.linux.org>

Author: tim
Date: 2007-08-18 01:11:35 +0200 (Sat, 18 Aug 2007)
New Revision: 102

Added:
   selinux-site/trunk/selinux.ircmessenger/
   selinux-site/trunk/selinux.ircmessenger/README.txt
   selinux-site/trunk/selinux.ircmessenger/selinux/
   selinux-site/trunk/selinux.ircmessenger/selinux/__init__.py
   selinux-site/trunk/selinux.ircmessenger/selinux/ircmessenger/
   selinux-site/trunk/selinux.ircmessenger/selinux/ircmessenger/__init__.py
   selinux-site/trunk/selinux.ircmessenger/selinux/ircmessenger/configure.zcml
   selinux-site/trunk/selinux.ircmessenger/selinux/ircmessenger/notifications.py
   selinux-site/trunk/selinux.ircmessenger/setup.py
Log:
Refactored out the irc code from selinux.theme to its own package.


Added: selinux-site/trunk/selinux.ircmessenger/README.txt
===================================================================
--- selinux-site/trunk/selinux.ircmessenger/README.txt	2007-08-17 22:55:36 UTC (rev 101)
+++ selinux-site/trunk/selinux.ircmessenger/README.txt	2007-08-17 23:11:35 UTC (rev 102)
@@ -0,0 +1,3 @@
+This package provides a web <-> irc gateway. Using events the website
+can get updates to the IRC. Also, potentially stuff can be added to
+the website by issueing commands to an IRC bot.

Added: selinux-site/trunk/selinux.ircmessenger/selinux/__init__.py
===================================================================
--- selinux-site/trunk/selinux.ircmessenger/selinux/__init__.py	2007-08-17 22:55:36 UTC (rev 101)
+++ selinux-site/trunk/selinux.ircmessenger/selinux/__init__.py	2007-08-17 23:11:35 UTC (rev 102)
@@ -0,0 +1,5 @@
+try:
+    __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+    from pkgutil import extend_path
+    __path__ = extend_path(__path__, __name__)

Added: selinux-site/trunk/selinux.ircmessenger/selinux/ircmessenger/__init__.py
===================================================================

Added: selinux-site/trunk/selinux.ircmessenger/selinux/ircmessenger/configure.zcml
===================================================================
--- selinux-site/trunk/selinux.ircmessenger/selinux/ircmessenger/configure.zcml	2007-08-17 22:55:36 UTC (rev 101)
+++ selinux-site/trunk/selinux.ircmessenger/selinux/ircmessenger/configure.zcml	2007-08-17 23:11:35 UTC (rev 102)
@@ -0,0 +1,16 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope">
+
+  <subscriber
+      for="Products.CMFCore.interfaces.IContentish
+           zope.app.container.interfaces.IObjectAddedEvent"
+      handler=".notifications.irc_object_added"
+      />
+
+  <subscriber
+      for="Products.CMFCore.interfaces.IContentish
+           Products.CMFCore.interfaces.IActionSucceededEvent"
+      handler=".notifications.irc_object_published"
+      />
+
+</configure>

Added: selinux-site/trunk/selinux.ircmessenger/selinux/ircmessenger/notifications.py
===================================================================
--- selinux-site/trunk/selinux.ircmessenger/selinux/ircmessenger/notifications.py	2007-08-17 22:55:36 UTC (rev 101)
+++ selinux-site/trunk/selinux.ircmessenger/selinux/ircmessenger/notifications.py	2007-08-17 23:11:35 UTC (rev 102)
@@ -0,0 +1,23 @@
+from xmlrpclib import Server
+from Products.CMFCore.utils import getToolByName
+from zope.i18n import translate
+from Products.CMFPlone.i18nl10n import utranslate
+
+def irc_object_added(obj, event):
+    workflow = getToolByName(obj, 'portal_workflow')
+    state = workflow.getInfoFor(obj, 'review_state', None)
+
+    # when an object is created it's first added to a temporary folder
+    # that shouldn't trigger irc notification
+    if state == 'published' and obj.aq_parent.portal_type != 'TempFolder':
+        server = Server('http://localhost:7080')
+        obj_type = utranslate('plone', obj.portal_type,
+                         target_language='sv', context=obj)
+        msg = "%s (%s), %s" % (obj.Title(), obj_type, obj.absolute_url())
+        try:
+            server.say('webb', msg)
+        except:
+            pass
+
+def irc_object_published(obj, event):
+    irc_object_added(obj, event)

Added: selinux-site/trunk/selinux.ircmessenger/setup.py
===================================================================
--- selinux-site/trunk/selinux.ircmessenger/setup.py	2007-08-17 22:55:36 UTC (rev 101)
+++ selinux-site/trunk/selinux.ircmessenger/setup.py	2007-08-17 23:11:35 UTC (rev 102)
@@ -0,0 +1,35 @@
+from setuptools import setup, find_packages
+import sys, os
+
+version = '0.1'
+
+setup(name='selinux.ircmessenger',
+      version=version,
+      description="SeLinux Web to IRC gateway and back",
+      long_description="""\
+""",
+      # Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers
+      classifiers=[
+        "Framework :: Plone",
+        "Framework :: Zope2",
+        "License :: OSI Approved :: GNU General Public License (GPL)",
+        "Programming Language :: Python",
+        "Topic :: Software Development :: Libraries :: Python Modules",
+        ],
+      keywords='',
+      author='Tim Terlegard',
+      author_email='tim@se.linux.org',
+      url='http://svn.se.linux.org/svn/selinux.ircmessenger',
+      license='GPL',
+      packages=find_packages(exclude=['ez_setup']),
+      namespace_packages=['selinux'],
+      include_package_data=True,
+      zip_safe=False,
+      download_url='http://code.google.com/p/plone/downloads/list',
+      install_requires=[
+        'setuptools',
+      ],
+      entry_points="""
+      # -*- Entry points: -*-
+      """,
+      )


From tim at mail.se.linux.org  Thu Aug 23 00:30:53 2007
From: tim at mail.se.linux.org (tim@mail.se.linux.org)
Date: Thu Aug 23 00:30:55 2007
Subject: [commits] r103 - selinux-site/trunk/selinux.theme/selinux/theme
Message-ID: <E1INyiz-00056e-N1@mail.se.linux.org>

Author: tim
Date: 2007-08-23 00:30:52 +0200 (Thu, 23 Aug 2007)
New Revision: 103

Removed:
   selinux-site/trunk/selinux.theme/selinux/theme/notifications.py
Modified:
   selinux-site/trunk/selinux.theme/selinux/theme/configure.zcml
Log:
Code that handles irc stuff is moved to its own package.


Modified: selinux-site/trunk/selinux.theme/selinux/theme/configure.zcml
===================================================================
--- selinux-site/trunk/selinux.theme/selinux/theme/configure.zcml	2007-08-17 23:11:35 UTC (rev 102)
+++ selinux-site/trunk/selinux.theme/selinux/theme/configure.zcml	2007-08-22 22:30:52 UTC (rev 103)
@@ -37,16 +37,4 @@
       handler=".caching_subscribers.news_workflow_transition"
       />
 
-  <subscriber
-      for="Products.CMFCore.interfaces.IContentish
-           zope.app.container.interfaces.IObjectAddedEvent"
-      handler=".notifications.irc_object_added"
-      />
-
-  <subscriber
-      for="Products.CMFCore.interfaces.IContentish
-           Products.CMFCore.interfaces.IActionSucceededEvent"
-      handler=".notifications.irc_object_published"
-      />
-
 </configure>

Deleted: selinux-site/trunk/selinux.theme/selinux/theme/notifications.py
===================================================================
--- selinux-site/trunk/selinux.theme/selinux/theme/notifications.py	2007-08-17 23:11:35 UTC (rev 102)
+++ selinux-site/trunk/selinux.theme/selinux/theme/notifications.py	2007-08-22 22:30:52 UTC (rev 103)
@@ -1,23 +0,0 @@
-from xmlrpclib import Server
-from Products.CMFCore.utils import getToolByName
-from zope.i18n import translate
-from Products.CMFPlone.i18nl10n import utranslate
-
-def irc_object_added(obj, event):
-    workflow = getToolByName(obj, 'portal_workflow')
-    state = workflow.getInfoFor(obj, 'review_state', None)
-
-    # when an object is created it's first added to a temporary folder
-    # that shouldn't trigger irc notification
-    if state == 'published' and obj.aq_parent.portal_type != 'TempFolder':
-        server = Server('http://localhost:7080')
-        obj_type = utranslate('plone', obj.portal_type,
-                         target_language='sv', context=obj)
-        msg = "%s (%s), %s" % (obj.Title(), obj_type, obj.absolute_url())
-        try:
-            server.say('webb', msg)
-        except:
-            pass
-
-def irc_object_published(obj, event):
-    irc_object_added(obj, event)


From tim at mail.se.linux.org  Thu Aug 23 00:34:27 2007
From: tim at mail.se.linux.org (tim@mail.se.linux.org)
Date: Thu Aug 23 00:34:29 2007
Subject: [commits] r104 - in selinux-site/trunk/selinux.theme/selinux/theme:
	. profiles/default
Message-ID: <E1INymR-00057B-Kv@mail.se.linux.org>

Author: tim
Date: 2007-08-23 00:34:26 +0200 (Thu, 23 Aug 2007)
New Revision: 104

Modified:
   selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/import_steps.xml
   selinux-site/trunk/selinux.theme/selinux/theme/setuphandlers.py
Log:
Initial content (folders for news, events etc) is now created the right way. buildout works again.


Modified: selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/import_steps.xml
===================================================================
--- selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/import_steps.xml	2007-08-22 22:30:52 UTC (rev 103)
+++ selinux-site/trunk/selinux.theme/selinux/theme/profiles/default/import_steps.xml	2007-08-22 22:34:26 UTC (rev 104)
@@ -3,6 +3,7 @@
   <import-step id="selinuxtheme-various" version="20070531"
                handler="selinux.theme.setuphandlers.setupVarious"
                title="Setup SeLinux theme">
-    Add logo, styles and templates that defines the SeLinux site design.
+    <dependency step="content" />
+      Add logo, styles and templates that defines the SeLinux site design.
   </import-step>
 </import-steps>

Modified: selinux-site/trunk/selinux.theme/selinux/theme/setuphandlers.py
===================================================================
--- selinux-site/trunk/selinux.theme/selinux/theme/setuphandlers.py	2007-08-22 22:30:52 UTC (rev 103)
+++ selinux-site/trunk/selinux.theme/selinux/theme/setuphandlers.py	2007-08-22 22:34:26 UTC (rev 104)
@@ -16,14 +16,7 @@
     existing = site.objectIds()
 
     # Events topic
-    if 'handelser' not in existing:
-        events_title = 'Händelser'
-        events_desc = 'Händelser'
-
-        _createObjectByType('Large Plone Folder', site, id='handelser',
-                            title=events_title, description=events_desc)
-        _createObjectByType('Topic', site.events, id='aggregator',
-                            title=events_title, description=events_desc)
+    if 'handelser' in existing:
         folder = site.handelser
         folder.setConstrainTypesMode(constraintypes.ENABLED)
         folder.setLocallyAllowedTypes(['Event'])
@@ -48,11 +41,9 @@
         # Only take events in the future
         date_crit.setDateRange('+') # This is irrelevant when the date is now
         date_crit.setOperation('more')
-    else:
-        topic = site.handelser
 
-    if wftool.getInfoFor(topic, 'review_state') != 'published':
-        wftool.doActionFor(topic, 'publish')
+        if wftool.getInfoFor(topic, 'review_state') != 'published':
+            wftool.doActionFor(topic, 'publish')
 
 
 def createNewsFolder(site):
@@ -60,15 +51,7 @@
     existing = site.objectIds()
 
     # News topic
-    if 'nyheter' not in existing:
-        news_title = 'Nyheter'
-        news_desc = 'Nyheter'
-
-        _createObjectByType('Large Plone Folder', site, id='nyheter',
-                            title=news_title, description=news_desc)
-        _createObjectByType('Topic', site.nyheter, id='aggregator',
-                            title=news_title, description=news_desc)
-
+    if 'nyheter' in existing:
         folder = site.nyheter
         folder.setConstrainTypesMode(constraintypes.ENABLED)
         folder.setLocallyAllowedTypes(['News Item'])
@@ -86,7 +69,7 @@
         state_crit = topic.addCriterion('review_state', 'ATSimpleStringCriterion')
         state_crit.setValue('published')
         topic.setSortCriterion('effective', True)
-        topic.setLayout('folder_summary_view')
+        topic.manage_addProperty('layout', 'folder_summary_view', 'string')
         topic.unmarkCreationFlag()
 
         if wftool.getInfoFor(topic, 'review_state') != 'published':
@@ -128,5 +111,5 @@
     # publish member folder
     members = getattr(site, 'medlemmar', None)
     if members is not None:
-        if workflow.getInfoFor(obj, 'review_state') != 'published':
-            workflow.doActionFor(obj, 'publish')
+        if workflow.getInfoFor(members, 'review_state') != 'published':
+            workflow.doActionFor(members, 'publish')


From tim at mail.se.linux.org  Thu Aug 23 00:36:20 2007
From: tim at mail.se.linux.org (tim@mail.se.linux.org)
Date: Thu Aug 23 00:36:22 2007
Subject: [commits] r105 - selinux-site/trunk/SeLinux/Extensions
Message-ID: <E1INyoG-00057r-Jt@mail.se.linux.org>

Author: tim
Date: 2007-08-23 00:36:19 +0200 (Thu, 23 Aug 2007)
New Revision: 105

Modified:
   selinux-site/trunk/SeLinux/Extensions/install.py
Log:
The extension profile doesn't have to be run explicitly anymore, it's already run during site creation.


Modified: selinux-site/trunk/SeLinux/Extensions/install.py
===================================================================
--- selinux-site/trunk/SeLinux/Extensions/install.py	2007-08-22 22:34:26 UTC (rev 104)
+++ selinux-site/trunk/SeLinux/Extensions/install.py	2007-08-22 22:36:19 UTC (rev 105)
@@ -1,7 +1,2 @@
-from Products.GenericSetup.interfaces import ISetupTool
-from zope.component import getUtility
-
 def install(self, reinstall=False):
-    portal_setup = getUtility(ISetupTool) 
-    portal_setup.setImportContext('profile-selinux.theme:selinux') 
-    portal_setup.runAllImportSteps(purge_old=False) 
+    pass


From tim at mail.se.linux.org  Thu Aug 23 00:37:52 2007
From: tim at mail.se.linux.org (tim@mail.se.linux.org)
Date: Thu Aug 23 00:37:53 2007
Subject: [commits] r106 - selinux-site/trunk/buildout/bin
Message-ID: <E1INypk-00058G-0l@mail.se.linux.org>

Author: tim
Date: 2007-08-23 00:37:50 +0200 (Thu, 23 Aug 2007)
New Revision: 106

Modified:
   selinux-site/trunk/buildout/bin/createinstance.py
Log:
Create a site with the selinux.theme:selinux profile applied right away. We don't need to do it after the site creation anymore.


Modified: selinux-site/trunk/buildout/bin/createinstance.py
===================================================================
--- selinux-site/trunk/buildout/bin/createinstance.py	2007-08-22 22:36:19 UTC (rev 105)
+++ selinux-site/trunk/buildout/bin/createinstance.py	2007-08-22 22:37:50 UTC (rev 106)
@@ -29,7 +29,8 @@
 
     # actually add in Plone
     factory = app.manage_addProduct['CMFPlone']
-    factory.addPloneSite(site_name, create_userfolder=1)
+    factory.addPloneSite(site_name, create_userfolder=1,
+                         extension_ids=['selinux.theme:selinux'])
     out.append("Added Plone")
 
     # install selinux products


