Code Monkey home page Code Monkey logo

alfresco-shell-tools-1's Introduction

Alfresco offers a rich remote API using its WebScripts technology which is based on the REST paradigm. This projects provides a set of scripts that makes it more easy to interact with the repository and its exposed resources.

Create or change users, create sites, manage group membership form the command line instead of the user interface.

Also great for automation: Create some hundreds of users from a table and automatically add to a set of groups? This becomes a one liner with the Alfresco shell tools.

Use cases

Reported use cases have been:

  • Backup User-Group relationships
  • Provision demo systems
  • Keep avatar pictures in sync with a 3rth party source
  • pregenerate >100k thumbnail images
  • Initial import of users and groups, along with user-group and group-subgroup assignements
  • Create a bunch of tenants for a multi-tenancy enabled Alfresco
  • Do repetitive maintenance tasks for multiple tenants in one go

How to start?

  1. check out the scripts or download a release tarball
  2. install required 3-rd party tools for json handling http://kmkeen.com/jshon/
  3. set environment variables
  4. install web-scripts from alfresco
  5. have fun

Environment Variables

Required environment variables:

  • ALFTOOLS_USER=<username>
  • ALFTOOLS_PASSWORD=<password>
  • ALFTOOLS_ENDPOINT='http://<host>.<domain>:<port>/alfresco'

Optional environment variables:

  • ALF_VERVBOSE=<true|false>

Commands

Note: 'x' means working, ' ' untested with 5.1, 'X' requires alfresco administrator privileges, '-' not working.

The available commands are:

[X]alfAddAuthorityToGroup.sh
[x]alfCreateCalendarEntry.sh
[X]alfCreateGroup.sh
[X]alfCreateSite.sh
[x]alfCreateTenant.sh
[x]alfCreateUser.sh
[x]alfDeleteAuthorityFromGroup.sh
[x]alfDeleteGroup.sh
[x]alfDelete.sh
[X]alfDeleteSite.sh
[x]alfDeleteUser.sh
[x]alfGetCompanyHomeNodeRef.sh
[x]alfGet.sh
[x]alfGetPermissions.sh
[x]alfGetThumbnail.sh
[x]alfGetUserHomeFolder.sh
[x]alfGetUser.sh
[x]alfListGroupMembers.sh
[x]alfListGroups.sh
[x]alfListTenants.sh
[x]alfListUsers.sh
[x]alfMetadata.sh
[x]alfMkdir.sh
[x]alfNodeRef2Path.sh
[x]alfPath2NodeRef.sh
[x]alfRename.sh
[x]alfResetAvatar.sh
[x]alfSearch.sh
[x]alfSetAvatar.sh
[x]alfSetPermissions.sh
[x]alfUpdateUser.sh
[x]alfUpload.sh

Note: alfCreateSite.sh alfDeleteSite.sh alfInviteUser.sh are not tested with Alfresco 4.x (pre-CSRF protection)

Use -h to get a detailed description of each command.

Example:

$ alfSearch.sh -h
usage: ./bin/alfSearch.sh [global options] [command specific options] arguments
  global options:
    -h   help       shows this help screen
    -v   verbose    displays information while executing

    -E   endpoint   Alfresco endpoint
    -S   share endpoint Alfresco share endpoint
    -U   user       Alfresco user id used in authentication
    -P   password   password used for authenticaiton

    -C   curl opts  any additional options pass to curl

  command options:
    -p property name    which property of each search result node should be printed to stdout.
                        Possible values are nodeRef(default), name, path, type, displayName, title,
                        description, modifiedOn, modifiedBy, modifiedByUser, size, mimetype, path
    -m [property|json]  output mode: 'property' (default) prints the value of the property given by -p.
                        Mode 'json' prints the whole result set as a json object.

  command arguments:
    SEARCHTERM       an Alfresco search term

  command explanation:
    the alfSearch.sh command issues a search against the Alfresco repository and prints
    each the nodeRef of each hit.

  usage examples:

    ./alfSearch.sh 'this is fun'
       --> executes a full text search for 'this is fun'
    ./alfSearch.sh 'TYPE:myns:mydoctype' | wc -l
       --> prints the number of documents of type myns:mydoctype

  side note about the Alfresco search and the implications of the various implementations

    If Alfresco uses the LUCENE search backend, the result list will not be stable. This is due
    to internal performance optimizations done by Alfresco and depends on cache filling levels and
    system load. As a result the search will return more results on subsequence executions.

    If Alfresco is configured to use the SOLR search backend, the result list will be 'eventual consistent'
    This simple means, the Alfresco content is indexed by a background job in an asynchronous manner and
    and therefore will not contain all content at any point in time.
    However, the result list is stable, taking into account what is indexed so far.

  the alfresco shell tools are created by
    [email protected] - http://www.ecm4u.de - http://www.ecm-market.de
    anybody jumps in?

alfresco-shell-tools-1's People

Contributors

fsckawk avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.