Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/customer/www/ on line 37

Deprecated: assert(): Calling assert() with a string argument is deprecated in /home/customer/www/ on line 566
Installing GroupServer and E-Democracy -

E-Democracy Pages Wiki

Search Wiki




Installing GroupServer and E-Democracy


Revision as of 21:43, 14 April 2013 by Wbushey (Talk | contribs) (Created page with "== Set Hosts == == Requirements == * Debian based OS (Debian and Ubuntu both known to work) * python 2.7 * postfix * postgres * nginx * libxslt1-dev === Fix postgresql transac...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Set Hosts


  • Debian based OS (Debian and Ubuntu both known to work)
  • python 2.7
  • postfix
  • postgres
  • nginx
  • libxslt1-dev

Fix postgresql transactions limit

Set max_prepared_transactions = 10 in /etc/postgresql/<version>/main/postgresql.conf

Install Nginx

Create site config and enable it

Make sure var/instance/etc/zope.conf is correct (especially hostname)

Create dummy error pages

There is a difference between the error handling systems of the production server and our development environment that causes the development environment to redirect to a non-existant page whenever an error/missing page is encountered. This makes reading errors in the log file a lot harder, because it becomes an infinate loop of not found pages.

So, we create a dummy new_unexpected_error.html in the ZMI:

  1. Go to ZMI
  2. Go to groupserver/Content/initial_site
  3. Create page template new_unexpected_error.html
  4. Set Content-Type to text/html
  5. Leave Body as default, or customize if you wish

We also create a dummy new_not_found.html page in the ZMI. It won't display anything useful, but it will make reading the logs a lot easier:

  1. Go to ZMI
  2. Go to groupserver/Content/initial_site
  3. Create page template new_not_found.html
  4. Set Content-Type to text/html
  5. Leave Body as default, or customize if you wish

Make E-Democracy Homepage

  1. Go to ZMI
  2. Go to groupserver/Content/initial_site
  3. Create page template content_en
  4. Set the Content-Type to text/xml
  5. Place the following in it
  tal:define="site here/Scripts/get/division_object">
  <tal:block define="userRoles python:user.getRolesInContext(site)">
    <p tal:condition="python:'DivisionAdmin' in userRoles">
          <bold class="label">As an admin you may:</bold>:
            <a href="/startgroup.html"><strong>Start</strong> a Group</a>
            where people can join and post.
            <a href="/charter"><strong>Change</strong> the default charter</a> 
            which will appear in a group.
            <strong>View</strong> <a href="/stats.html">posting

            <strong><a href="/admin_join_add_csv.html">Upload new members in bulk</a>.</strong>

            <strong>Search</strong> for an existing <a href="/admin_search_people.html">forum member by e-mail</a>. Or <a href="">ZMI by e-mail</a> or <a href="">profile name</a> for incomplete accounts, "invited" members not on a forum, etc. Requires separate ZMI login.

    <div class="cols">
      <div class="rightColumn">

        <div id="latestPhotos">

          <h2>Latest Photos</h2>
          <div id="pics">
            <p>Loading the latest photos…</p>

          <p><a title="Next 20 photos and files on this site" href="s/index.html?s=&g=&a=&m=&t=0&p=0&f=1&r=0&i=0&l=20">More photos/files from 50+ forums…</a></p>

        <div id="latestTopics">

         <h2>Latest Topics</h2>
          <div class="gs-search search" id="gs-search-topic-site-home-search">
            <div class="gs-search-entry">
              <input type="text" class="textEntry"/>
            <p id="gs-search-topic-site-home-loading" class="gs-search-loading" style="display:none;">
              <img src="/++resource++anim/wait.gif"/> 
              Loading the topics
            <div id="gs-search-topic-site-home-latest" class="gs-search-results">
            <div id="gs-search-topic-site-home-toolbar" class="toolbar gs-search-toolbar">
              <span class="ui-widget-header ui-corner-all">
                <button id="gs-search-topic-site-home-toolbar-prev" class="gs-search-toolbar-previous">Newer</button>
                <button id="gs-search-topic-site-home-toolbar-next" class="gs-search-toolbar-next">Older</button>
          <div id="gs-search-topic-site-home-tasks">
            <p>Subscribe to a <b><a type="application/atom+xml" tal:define="title string:Posts in ${options/siteName};" href="/s/search.atom?t=0&f=0&p=1">web feed</a>,   <a title="Next 20 topics across site" href="/s/index.html?s=&g=&a=&t=1&p=0&f=0&r=0&i=10&l=20">list more topics</a></b> or <b><a title="Latest 100 topics on this site" href="/s/index.html?s=&g=&a=&m=&t=0&p=1&f=0&r=0&i=0&l=100">list individual posts</a></b> across all forums</p>
      <div class="leftColumn">

        <div id="greeting" tal:condition="python:user.has_role('Authenticated')">
          <div id="youLinks" tal:define="nn user/get_canonicalNickname">
            <div class="userimage photo">
              <a href="#"
                 tal:attributes="href string:/p/${nn}/image.html">
               <img src="#" alt="Change Image" tal:attributes="src user/get_image" tal:condition="user/get_image_path"/>
               <span tal:condition="python: user.get_image_path() == None">Upload a Profile Image</span>

          <h2 id="hi" tal:condition="python:'welcome' not in request.form.keys()">
            <span class="salutation">Welcome</span>,
            <span class="fn" tal:content="user/fn">eCampus Member</span>
          <ul class="groups"
              tal:define="groupsInfo python:modules['Products.GSContent'].GSGroupsInfoFactory()(context);
      GSGroupInfoFactory python:modules['Products.GSGroup.groupInfo'].GSGroupInfoFactory();
      memberGroups python:groupsInfo.get_member_groups_for_user(user, user);
      grps python:[GSGroupInfoFactory(g) for g in memberGroups]">

            <li><bold class="label">Your Forums:</bold></li><p></p>
            <tal:block repeat="group grps">
              <li><a class="group" href="#"
                  tal:attributes="href group/url"

          <p>Your invitation to join is powerful. <a href="">Share this site</a> with your friends on Facebook.</p>

          <ul id="youLinks" tal:define="nn user/get_canonicalNickname">
              <a href="#" tal:attributes="href string:/p/${nn}/email.html">Change email settings</a> 
              Get daily digests, go web-based, or change/add e-mail address.
              <a href="#" tal:attributes="href string:/p/${nn}/edit.html">Update your profile</a> 
              <a href="#" tal:attributes="href string:/p/${nn}/">View your public profile</a>, 
              <a href="#" tal:attributes="href string:/p/${nn}/edit.html">change it</a>,
              <a href="#" tal:attributes="href string:/p/${nn}/image.html">upload a photo</a>, or 
              <a href="#" tal:attributes="href string:/p/${nn}/password.html">change your password</a> 


            <li>What's Up at - For project updates, see our <a title="Project Blog" href="">blog</a>, follow us on <a title="Follow on Twitter" href="">Twitter</a> or <a title="Fan on Facebook" href="">Facebook</a>.</li>
            <li><a title="Projects Volunteer Group" href="">Volunteer</a> - Help with outreach, design, advertising, software development, fund raising, and new forums.</li>
          <b>Topics Recommended on Facebook</b>
          <iframe src="//" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:400px; height:300px;" allowTransparency="true"> </iframe>

        <span tal:condition="python:not(user.has_role('Authenticated'))" tal:replace="structure here/introduction"></span>

  1. Go back to initial_site
  2. Go to Properties tab
  3. Replace content in introduction property with the following:
<div class="introduction">

<h3> - Inspiring Inclusive Community Engagement Online</h3>

<a href=""><img alt="E-Dem Logo and People" src="" /></a>

<h3>A Video Tour of our Outreach</h3>

<p>Check out our <a href="">handouts</a> from our virtual booth or watch this video:</p>

<iframe width="400" height="300" src="" frameborder="0" allowfullscreen></iframe>

<h3>Join Local Community Forums, Global Online Communities</h3>

<li><a href="">Local Forums</a> Our 50+ local community forums online connect over 20,000 members:</li> 
<li><a href="">Twin Cities -</a> - Special outreach</li>
<li><a href="">United States</a></li>
<li><a href="">United Kingdom</a></li>
<li><a href="">New Zealand</a></li>
<li><a href=""> Projects</a> - Volunteer here</li>
<li><a href="">Global Communities of Practice</a> - Get involved with digital civic engagement and inclusion</li>
<li><a href="">Login</a> - Existing Members</li>

<P>New to E-Democracy? Get <a href="">our e-news</a>: 

<form enctype="multipart/form-data"  method="post" id="register.form"
  <input id="" name="" size="20" type="text" value="enter e-mail" />
  <input id="form.groupId" name="form.groupId" type="hidden" value="news" />
  <input id="form.came_from" name="form.came_from" type="hidden" value="" />
  <input type="submit" id="form.actions.register" name="form.actions.register" value="Register" />
</form><!--GroupSever Signup Form-->

... then <a href="">join some forums</a> or <a href="">get started</a> with some in-depth advice.</P>

<h3>Video - Let's Twin Cities</h3>

<iframe width="400" height="300" src="" frameborder="0" allowfullscreen></iframe>

<h3>More Pages</h3>

<li><a href="">Get Started</a> - How to details</li>
<li><a href="">Blog</a> - News and lessons</li>
<li><a href="">Inclusive Community Engagement Online</a> - Major grant-funded effort</li>
<li><a href="">Mobile</a> - Quick links</li>
<li><a href="">Support</a> - Get help</li>
<li><a href="">About E-Democracy</a> - <a href="">Contact us</a></li>

<h3>Help Us Reach 25,000 Participants!</h3>

<p><a href="">Your invitation</a> to join is powerful. <a href="">Share us via Facebook.</a> </p>

Share Site: <!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_counter addthis_pill_style"></a>
<script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script>
<script type="text/javascript" src=""></script>
<!-- AddThis Button END -->


<script charset="utf-8" src=""></script>
new TWTR.Widget({
  version: 2,
  type: 'profile',
  rpp: 4,
  interval: 30000,
  width: 400,
  height: 300,
  theme: {
    shell: {
      background: '#3DA7D1',
      color: '#616161'
    tweets: {
      background: '#fcfcfc',
      color: '#361a36',
      links: '#black'
  features: {
    scrollbar: false,
    loop: false,
    live: false,
    behavior: 'all'


<P><b>Topics Recommended on Facebook</b>
<iframe src="//" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:400px; height:300px;" allowTransparency="true"></iframe>

<p>Follow us on <a href="">Facebook</a>:</P>
 <iframe src=""
scrolling="no" frameborder="0" style="border:none; overflow:hidden;
width:300px; height:80px;" allowTransparency="true"></iframe>


Homepage JS and Metadata

  1. In /groupserver/Content/initial_site, create page tempate named javascript.xml
  2. Set Content-Type to text/xml
  3. Set body to:
<tal:block xmlns:tal="">
  <script src="/++resource++jquery-ui-1.8.9.custom.min.js" type="text/javascript"> </script>
  <script type="text/javascript">

    var GSHideRightCol = function () {
      jQuery('.rightColumn').fadeOut('slow', GSMakeLeftColNotACol);

    var GSMakeLeftColNotACol = function () {
      jQuery('.leftColumn').attr('class', 'not-leftColumn')

    var GSLoadTopicsOrNot = function(responseText, textStatus, XMLHttpRequest){
        if ( /.*topic-search-none.*/.test(responseText) ) {
            setTimeout("GSHideRightCol()", 1);

    var uri = "/s/search.ajax?mg=1&i=0&l=10";
     jQuery('#latestTopicsFill').load(uri, GSLoadTopicsOrNot)

  <script type="text/javascript" src="jquery.bxGallery.min.js"> </script>
  <script type="text/javascript">
    var add_gallery = function (responseText, textStatus, XMLHttpReques) {
      var opts = {thumbwidth: 72, thumbheight: 72, 
    jQuery(document).ready( function () {
      jQuery('#pics').load('/s/images.html?mg=1&t=0&f=1&l=5&m=image/jpeg&m=image/png', add_gallery);
  <script src="/++resource++gs-search-base-js-20121217.js" type="text/javascript" > </script>
  <script src="/++resource++gs-search-topic-site-homepage-20120606.js" type="text/javascript" > </script>

  1. Create page template 'metadata.xml'
  2. Set Content-Type to text/html
  3. Set Body to:
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="robots" content="noodp">

Make Digests Work

  1. Go to ZMI
  2. Go to /groupserver/Content/initial_site
  3. Create a page template named digest_news.txt
  4. Set Content-Type to text/html
  5. Set body to the following (plain text):
Hello World

  1. Create a page template named digest_news.xml
  2. Set Content-Type to text/xml
  3. Set body to the following:
<p>Hello World!</p>

Make /groups Work

  1. Go to ZMI
  2. Go to /groupserver/Content/groups
  3. (If needed) Create a pate template named content_en
  4. (If needed) Set Content-Type to text/xml
  5. Set body to the following:
<html xmlns:tal=""
    <title>Groups Homepage</title>
    <meta property="dc:created">2006-11-23</meta>
    <meta property="dc:publisher">OnlineGroups.Net</meta>
    <meta property="dc:rightsHolder">OnlineGroups.Net</meta>
    <meta property="dc:creator">Michael JasonSmith</meta>
    <meta property="dc:description">
      A list of all groups on
    <meta property="dc:licence"/>
    <!--Uncomment the following and add your name, if you make-->
    <!--  any modifications-->
    <!--<meta property="dc:contributor"></meta>-->
    <section tal:define="site here/Scripts/get/division_object;
      siteName python:modules['Products.XWFCore.XWFUtils'].getOption(here, 'siteName') or site.title_or_id();
      userAuthenticated python:user.has_role('Authenticated');
      userAnonymous python:user.has_role('Anonymous');
      isSiteAdmin python:'DivisionAdmin' in user.getRolesInContext(site);
      collatedGroups python:here.collate_groups(site, user);
      groupsObj python:collatedGroups[0];
      groups python:collatedGroups[1];
      userGroups python:collatedGroups[2];
      nonUserGroups python:collatedGroups[3]; 
      joinableGroups python:collatedGroups[4];
      otherGroups python:collatedGroups[5]">

      <h><span class="site" tal:content="siteName"/></h>
      <p tal:condition="userAuthenticated">
        This page shows the online groups that are currently visible to you.
        <a class="helpLink" href="/help/manual/#groupserver-managing-groups" 
          title="Managing Groups Help">[?]</a>
      <p tal:condition="not:userAuthenticated">
        This page shows all the online groups (Issues Forums, etc.) that are visible to anyone. Generally, they are listed by country first and state second.  For each state, the city and neighborhood forums are listed. 
        <span tal:condition="python:len(groups)==0">This site may contain
          online groups that are visible only to logged in members;</span>
        <a tal:attributes="title string:Please login to ${siteName}"
          href="/login.html?came_from=/groups">Login</a> to see the forums
        of which you are member or <a tal:attributes="title string:Register for ${siteName}"
          href="/request_registration.html?came_from=/groups">register</a> and to join one or more forums. 
      <p class="adminTasks" tal:condition="isSiteAdmin" >
        As a site administrator you can
        <a title="Start a group"  href="/admindivision/start_a_group/">Start
          a group.</a>
      <section id="your-groups" tal:condition="userGroups">
        <h>Your Forums</h>
        <p>You belong to the following forums.</p>
          <li tal:repeat="group userGroups">
            <a class="group" tal:content="group/title_or_id"
              tal:attributes="title string:${group/title_or_id} Homepage;
              href string:/groups/${group/getId}"/>:
              tal:define="member_count python:here.Scripts.get.group_member_count(group)">
              <span tal:replace="member_count"/>
              <span tal:replace="python:member_count == 1 and 'member' or 'members'"/>.
            <a tal:attributes="title string:Leave ${group/title_or_id};
              href string:/groups/leave.html?groupId=${group/getId}">(leave)</a>

      <section tal:define="categories python:here.group_categories(groups);
        categoryNames python:here.sort_category_keys(categories.keys())"
        tal:condition="python:userAnonymous or (joinableGroups or otherGroups)">
        <h tal:condition="not:userAnonymous">Other Forums</h>
        <p tal:condition="not:userAnonymous">
          You are not a member of the following forums, but you may
          view them, and possibly join some.
        <section tal:repeat="categoryName categoryNames">
            tal:define="category python:categories[categoryName];
            fora python:filter(lambda f: f not in userGroups, category);
            sortedFora python:here.sort_groups_by_title(fora);" 
            <h tal:content="categoryName">Category Name</h>
              <tal:block tal:repeat="forum sortedFora">

                <!-- Next tal added by Tim Erickson to hide groups without categoryName  -->
                <tal:block condition="python:categoryName">

                <li tal:condition="python:forum not in userGroups"
                  tal:define="member_count python:here.Scripts.get.group_member_count(forum);
                  realLifeGroup python:forum.getProperty('real_life_group','');
                  description python:forum.getProperty('description', '')">
                  <span class="group" 
                    tal:attributes="href forum/getId"

                  <tal:block tal:condition="description"> 
                    <!-- for eDem -->
                    <span class="realLifeGroup" tal:content="description"/>;
                  <span tal:replace="member_count"/>
                  <span tal:replace="python:member_count == 1 and 'member' or 'members'"/>.
                  <a href="#" title="Join this forum"
                    tal:condition="python:userAuthenticated and (forum in joinableGroups)"
                    tal:attributes="href string:/groups/${forum/getId}/join.html;
                    title string:Join ${forum/title_or_id}">(Join this forum.)</a>
                  <a href="#" title="Register, and join this forum"
                    tal:condition="python:(not userAuthenticated) and (forum in joinableGroups)"
                    tal:attributes="href string:request_registration.html?form.groupId=${forum/getId}">(register and join)</a>
                  <tal:block tal:define="joinability python:here.Scripts.get.group_joinability(site.getId(), forum.getId())"
                    tal:condition="python:joinability == 'invite'">
                    <!--(Only invited members can join this forum.)-->


  1. In /groupserver/Content/initial_site/groups, create Script (Python) named collate_groups
  2. Set Parameter List to: site, user
  3. Set Body to:
group_membership = user.getGroups() or []
group_membership_ids = map(lambda x: x.split('_member')[0], group_membership)

userAuthenticated = user.has_role('Authenticated')
userAnonymous = user.has_role('Anonymous')
groupsObj = context.Scripts.get.groups_object()
groups = filter(lambda x: getattr(x, 'is_group', 0),
                context.Scripts.get.object_values(groupsObj, 'Folder'))

userGroups = (not userAnonymous) and filter(lambda x: x.getId() in group_membership_ids, groups) or []
nonUserGroups = filter(lambda x: x.getId() not in userGroups, groups)
joinableGroups = []
otherGroups = []
for group_object in nonUserGroups:
    if group_object.getProperty('join_condition', 'anyone') == 'anyone':
return groupsObj, groups, userGroups, nonUserGroups, joinableGroups, otherGroups

  1. In /groupserver/Content/initial_site/groups, create Script (Python) named group_categories
  2. Set Parameter List to: groups=None
  3. Set Body to:
# Get all group-categories in a site

if groups == None:
    groupsObj = context.Scripts.get.groups_object()
    groups = filter(lambda x: getattr(x, 'is_group', 0),
                context.Scripts.get.object_values(groupsObj, 'Folder'))
categories = {}

for group in groups:
    category = group.getProperty('category',  'Uncategorised')
    categories[category] = categories.get(category, []) + [group]

#assert categories
return categories

  1. In /groupserver/Content/initial_site/groups, create Script (Python) named sort_category_keys
  2. Set Parameter List to: keys
  3. Set Body to:
def alpha_sort(a, b):
    alpha = a.lower()
    beta = b.lower()
    if alpha < beta:
        retval = -1
    elif alpha == beta:
        retval = 0
        retval = 1
    return retval
retval = keys
return retval

  1. In /groupserver/Content/initial_site/groups, create Script (Python) named sort_groups_by_title
  2. Set Parameter List to: groups
  3. Set Body to:
def alpha_sort(a, b):
    alpha = a.title_or_id().lower()
    beta = b.title_or_id().lower()
    if alpha < beta:
        retval = -1
    elif alpha == beta:
        retval = 0
        retval = 1
    return retval
retval = groups
return retval

  1. In /groupserver/Content/initial_site/groups, create page template named groups_intro.xml
  2. Set Content-Type to text/html
  3. Set Body to:
<p>Select by place for community <a href="">Issues Forums</a> or join the Online Communities and Project online groups that we host below.</p> 
<p>No <a href="">Issues Forum</a> in your community? <a href="">Contact Us</a> to propose one.</p>

Set up XSLT

  1. Go to Properties tab of /groupserver/Content/initial_site/groups/content_en
  2. Set transform_paths to: Presentation/Tofu/XHTML2/xslt/
  3. Save
  4. Set property named 'transform_html' to 'xhtml2-transform_body-content-only (xslt)'. Leave the other transform properties as 'do not use transform'
  5. Save

Set category properties

  1. In /groupserver/Content/initial_site/groups, go to Properties tab
  2. Create a property named 'categories' of type lines
  3. Once saved, enter a couple of categoires ('Test', 'Empty')
  4. For each group that current exists
    1. Go into the group's folder
    2. View the group's Properties
    3. Create a property named 'category' of type 'string', with a vlue equal to one of the categories entered above

Home - Mobile - Forums - Wiki - Blog - About - Help - Contact - People - Donate - Rules - Archives