Alfresco Zimlet – updates and fixes

I’ve made an updated version of open-sourced Alfresco Zimlet.

New features and fixes:

  • SSO ticket based authentication support (‘alfresco_ticket’ and ‘alfresco_url’ cookies)
  • localization support (english and hungarian properties included)
  • works with Alfresco 4.x and Zimbra 7.x
  • bugfixes…

See README file for installation…

Alfresco side webscript installation steps:

1. Import web script package (ZIP) at Alfresco Explorer:
1-import_web_script_package

2. Update web scripts:
2-update_web_scripts

3. Verify installation with a simple request (update URL and PASSWORD with yours):

$curl --user "admin":"password" http://192.168.252.135:8080/alfresco/service/easy/tree
{"children": [{"title": "User managed definitions", "isDocument": false, "path": "\/Company Home\/Data Dictionary", "label": "Data Dictionary"}, {"title": "The guest root space", "isDocument": false, "path": "\/Company Home\/Guest Home", "label": "Guest Home"}, {"title": "Imap Attachments", "isDocument": false, "path": "\/Company Home\/Imap Attachments", "label": "Imap Attachments"}, {"title": "Site Collaboration Spaces", "isDocument": false, "path": "\/Company Home\/Sites", "label": "Sites"}, {"title": "User Homes", "isDocument": false, "path": "\/Company Home\/User Homes", "label": "User Homes"}]}

Download Zimlet: org.alfresco.zimbra.zip


Alfresco Zimlet provides integration between two leading open source solutions, Alfresco Enterprise Content Management and Zimbra Collaboration Suite.

It was built on top of open technologies such as Alfresco Webscript, Zimbra Zimlet and YUI library.

It allows the end user to save incoming email attachments to the Alfresco ECM Server. The user is provided with the ability to select multiple Alfresco documents and attach them to outgoing emails. Links are provided for downloading Alfresco Documents when composing emails from within Zimbra.

Alfresco Documents and features are surfaced as shortcut links within the Zimbra application. Widgets are provided for ease-of-use in Alfresco space selection and repository navigation. A simple installation and setup is provided.

Original sources: http://code.google.com/p/alfresco-zimlet/
Original developer: Yong Qu

Discussion Thread on Zimbra Community Forum: http://www.zimbra.com/forums/zimlets/21315-alfresco-zimlet-beta.html

Zimbra briefcase export tool

Simple shell script to retrieve all user accounts from Zimbra, and recursively download Briefcase contents into user-named subfolders.

Script requires https url of zimbra server with active admin account/password.

#!/bin/bash
#
# Zimbra Briefcases export tool by LouiSe@louise.hu
#
# Usage (run on Zimbra server):
#  ./zimbra-briefcase-export.sh "https://myzimbra.com:7071" "admin@myzimbra.com" "mypassword"
#

ZIMBRA_HOST=$1
ACCOUNT_LIST=/tmp/zimbra_accounts.txt
ACCOUNT_ADMIN=$2
ACCOUNT_PASSWORD=$3
OUTPUT_DIR=briefcases
BRIEFCASE_DIR=Briefcase
PACKAGE_EXTENSION=tgz

mkdir ${OUTPUT_DIR}

echo "Retrieving all accounts from Zimbra into file '${ACCOUNT_LIST}'..."
su - -c "zmprov -l gaa >${ACCOUNT_LIST}" zimbra

echo "Processing all accounts on Zimbra host '${ZIMBRA_HOST}'"
while read USERNAME
do
    echo "Downloading Briefcase for account '${USERNAME}' into file '${USERNAME}.zip' and uncompressing..."
    curl -k --user "${ACCOUNT_ADMIN}:${ACCOUNT_PASSWORD}" "${ZIMBRA_HOST}/home/${USERNAME}/Briefcase?fmt=${PACKAGE_EXTENSION}" -o ${OUTPUT_DIR}/${USERNAME}.${PACKAGE_EXTENSION}
    cd ${OUTPUT_DIR}
    tar xzf ${USERNAME}.${PACKAGE_EXTENSION}
    mv ${BRIEFCASE_DIR} ${USERNAME}
    rm ${USERNAME}.${PACKAGE_EXTENSION}
    cd ..
done < ${ACCOUNT_LIST}
echo "Done."

Just like a Zimbra to Alfresco (User Homes) document library migration tool...

Alfresco with Zimbra LDAP

So, i’ve done with a working LDAP configuration to sync users and groups from Zimbra (see below), but one thing missing yet…

The Alfresco synchronizer service reads from LDAP and writes all users and all groups into repository, but does not reproduce nested group hierarchy.

Retrieve Zimbra LDAP root password:

zmlocalconfig -s zimbra_ldap_password

Let see the configuration in extension/subsystems/Authentication/ldap/ldap1/ldap-authentication.properties:

...

# The URL to connect to the LDAP server 
ldap.authentication.java.naming.provider.url=ldap://zimbra.XXX.hu:389

# The authentication mechanism to use for password validation
ldap.authentication.java.naming.security.authentication=simple

...

# This flag enables use of this LDAP subsystem for user and group
# synchronization. It may be that this subsytem should only be used for 
# authentication, in which case this flag should be set to false.
ldap.synchronization.active=true

# The authentication mechanism to use for synchronization
ldap.synchronization.java.naming.security.authentication=simple

# The default principal to use (only used for LDAP sync)
ldap.synchronization.java.naming.security.principal=uid\=zimbra,cn\=admins,cn\=zimbra

# The password for the default principal (only used for LDAP sync)
ldap.synchronization.java.naming.security.credentials=ZIMBRA_LDAP_PASSWORD

# The query to select all objects that represent the groups to import.
ldap.synchronization.groupQuery=(objectclass\=zimbraDistributionList)

# The query to select objects that represent the groups to import that have changed since a certain time.
ldap.synchronization.groupDifferentialQuery=(&(objectclass\=zimbraDistributionList)(!(modifyTimestamp< \={0})))


# The query to select all objects that represent the users to import.
ldap.synchronization.personQuery=(objectClass\=organizationalPerson)

# The query to select objects that represent the users to import that have changed since a certain time.
ldap.synchronization.personDifferentialQuery=(&(objectclass\=organizationalPerson)(!(modifyTimestamp<\={0})))


# The group search base restricts the LDAP group query to a sub section of tree on the LDAP server.
ldap.synchronization.groupSearchBase=ou\=people,dc\=XXX,dc\=hu

# The user search base restricts the LDAP user query to a sub section of tree on the LDAP server.
ldap.synchronization.userSearchBase=ou\=people,dc\=XXX,dc\=hu


# The name of the operational attribute recording the last update time for a group or user.
ldap.synchronization.modifyTimestampAttributeName=modifyTimestamp

# The timestamp format. Unfortunately, this varies between directory servers.
ldap.synchronization.timestampFormat=yyyyMMddHHmmss'Z'


# The attribute name on people objects found in LDAP to use as the uid in Alfresco
ldap.synchronization.userIdAttributeName=mail

# The attribute on person objects in LDAP to map to the first name property in Alfresco
ldap.synchronization.userFirstNameAttributeName=displayName

# The attribute on person objects in LDAP to map to the last name property in Alfresco
ldap.synchronization.userLastNameAttributeName=

# The attribute on person objects in LDAP to map to the email property in Alfresco
ldap.synchronization.userEmailAttributeName=mail

# The attribute on person objects in LDAP to map to the organizational id  property in Alfresco
ldap.synchronization.userOrganizationalIdAttributeName=cn

# The default home folder provider to use for people created via LDAP import
ldap.synchronization.defaultHomeFolderProvider=userHomesHomeFolderProvider


# The attribute on LDAP group objects to map to the authority name property in Alfresco
ldap.synchronization.groupIdAttributeName=mail

# The attribute on LDAP group objects to map to the authority display name property in Alfresco (v3.3+)
ldap.synchronization.groupDisplayNameAttributeName=mail

# The group type in LDAP
ldap.synchronization.groupType=zimbraDistributionList

# The person type in LDAP
ldap.synchronization.personType=organizationalPerson

# The attribute in LDAP on group objects that defines the DN for its members
ldap.synchronization.groupMemberAttributeName=zimbraMailForwardingAddress

# If true progress estimation is enabled. When enabled, the user query has to be run twice in order to count entries.
ldap.synchronization.enableProgressEstimation=true

Hint: Zimbra and LDAP posts at wajatimur.wordpress.com blog