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.

  Installing the synchronization tool

    Actually you need to add a 'CMFMailin Tool', there is nothing to configure.
    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.

    You can find the mail_received inside the ERP5SyncML/skins/ folder. You can
    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 .

    And finally you should add the ERP5SyncML Tool.

    Inside the synchronization tool (cps_site/portal_synchrozations), 
    the publication should looks like this ::

      id : Repository
      Publication Url : cps_server@localhost
      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
      Publication Url : cps_server@localhost
      Subscription Url : cps_client@localhost
      Destination Path : /cps_client/portal_repository
      Query : objectValues (it will be completed automatically)
      XML Mapping : asXML

    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.

  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/"

    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

  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'.

