install.stx 6.31 KB
Newer Older
Sebastien Robin's avatar
Sebastien Robin committed
1 2 3 4 5 6 7 8 9 10 11 12 13
Setting up Synchronization

  Installing packages

    First install zope and all products you might need (CPS...)
    Then install products ERP5Type, CMFActivity, ERP5SyncML.
    available with the nexedi cvs.
    And also CMFWiki, psyco, available from zope and python. You will
    also need xml for python.

    If you want the synchronization working with CPS, you will need
    need the ERP5CPS products, available on the nexedi cvs.

14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
  Install Site instances

    If you want to do synchronization, you should have at least two Site
    instances (it can actually be either ERP5 Site or CPS Site). One of them
    has to be a master and all other have to be clients.

    Any modification made on any Site will be sent to the master, and the master
    send back each modification to each client. Like this, all Sites (master and 
    clients) are informed about modifications.

    Let's say we have one zope running on our local box. We will create for
    example two CPS Sites, the fist one wich will be the master with the id 
    'cps', and the second one wich will be the client with the id 'cps_client'.

    If you want to make sure that your box is installed correctly, you should
    go on one object of your site and then addto the url the method 'asXML' like
    this ::

      http://localhost:9673/cps/workspaces/members/seb/gggggggggggggg/asXML

    If everything is fine, you should have no errors and you should see the
    xml corresponding to your object.

37 38
  Installing the synchronization tool

39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
    Go to the zope management interface and then go to your Site and add a 
    ERP5SyncML Tool.

  Configuration for synchronization by http

    The particular thing with the synchronization by http is that we need
    to use active objects. Active Object allows to differ a method call.
    We need it in order to differ html request, active object allows to
    send all html request to a queue.

    Don't worry, it is really simple to use. First, you have to add inside
    your site a 'CMFActivity Tool'. There is nothing to configure. Then, 
    only thing needed is to modify the script 'zope_tic_loop' located inside 
    your CMFActivity product. You have to modify the user name, the user
    password, the ip where your zope is running and the id of your site.

    For example, my script looks like this ::

      #!/bin/bash
      while true; do
      wget -O /tmp/zope_distribute.out http://seb:password@localhost:9673/cps/portal_activities/distribute?node_count:int=1
      wget -O /tmp/zope_tic.out http://seb:password@localhost:9673/cps/portal_activities/tic?processing_node:int=1
      wget -O /tmp/zope_distribute.out http://seb:password@localhost:9673/cps_client/portal_activities/distribute?node_count:int=1
      wget -O /tmp/zope_tic.out http://seb:password@localhost:9673/cps_client/portal_activities/tic?processing_node:int=1
      sleep 5
      done

    This allows to run all html requests each time there is a new one. It is
    a nice idea to run the script like this ::
    
      nohup ./zope_tic_loop &

    The last thing to do is to configure you synchronization tool. I do have on
    my server side ::

      id : Repository
      Publication Url : http://localhost:9673/cps
      Destination Path : /cps/portal_repository
      Query : objectValues (it will be completed automatically)
      XML Mapping : asXML

    I do have on my client side ::

      id : Repository
      Publication Url : http://localhost:9673/cps_client
      Destination Path : /cps/portal_repository
      Query : objectValues (it will be completed automatically)
      XML Mapping : asXML



  Configuration for synchronization by email

92
    Actually you need to add a 'CMFMailin Tool', there is nothing to configure.
93 94 95 96
    Then you have to make sure you get the right mail_received.py. The
    mail_received script has to be modified in order to use SubSync or PubSync.
    SubSync is used if we are on the client side, PubSync is used if we are on
    the master side.
Sebastien Robin's avatar
Sebastien Robin committed
97

98
    You can find the mail_received inside the ERP5SyncML/skins/ folder. You can
Sebastien Robin's avatar
Sebastien Robin committed
99 100 101 102
    just make a copy inside your ZODB. For that, you should go to your cps site,
    inside portal_skins and then select the "custom" folder. Then add a script
    python called "mail_received". Then set the parameter list to "theMail", and
    then paste the content of ERP5CPS/skins/mail_received.py .
Sebastien Robin's avatar
Sebastien Robin committed
103 104


Sebastien Robin's avatar
Sebastien Robin committed
105 106
    Inside the synchronization tool (cps_site/portal_synchrozations), 
    the publication should looks like this ::
Sebastien Robin's avatar
Sebastien Robin committed
107 108

      id : Repository
109
      Publication Url : mailto:cps_server@localhost
Sebastien Robin's avatar
Sebastien Robin committed
110 111 112 113 114 115 116
      Destination Path : /cps/portal_repository
      Query : objectValues (it will be completed automatically)
      XML Mapping : asXML

    Inside the synchronization tool, the subscription should looks like this ::

      id : Repository
117 118
      Publication Url : mailto:cps_server@localhost
      Subscription Url : mailto:cps_client@localhost
Sebastien Robin's avatar
Sebastien Robin committed
119 120 121 122
      Destination Path : /cps_client/portal_repository
      Query : objectValues (it will be completed automatically)
      XML Mapping : asXML

Sebastien Robin's avatar
Sebastien Robin committed
123 124 125 126
    If you want to synchronize, you should have at least 2 instances of cmf sites. One of
    them should act as a server, and all over as client. On the server you have to setup
    publications and on client you have to setup subscriptions.

Sebastien Robin's avatar
Sebastien Robin committed
127 128 129 130 131 132
  Configure your mail server

    You should set some aliases so that your mail server will directly sends
    mail to zope, for example in /etc/aliases :

    seb_syncml: "|/home/seb/erp5/CMFMailIn/sendMailToZope.py http://seb:password@localhost:9673/nexedi.org/portal_mailin/"
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147

    This is really important that the master and all clients can send mails each others.
    On each box I set a local postfix server and I also use fetchmail every 20 secondes in
    order to do a synchronization not too long. A nice way to do is to create a specific
    user, for example I do have on my box an user 'seb_syncml'. This user have on his 
    home directory an file .fetchmailrc like this ::

      set daemon 20
      set syslog
      defaults user "seb_syncml"
              pass "password"
              smtpname "seb_syncml@localhost"
        fetchall
      poll localhost proto imap port 11143

148 149 150 151 152 153
  Starting synchronization

    The synchronization starts only from a client, so you should go on one of the client
    instance. Then you have to go on the portal_synchronizations and select one of the
    subscriptions and hit 'Sync'.