Alfresco uploader with Curl

Let see a simple shell script example to upload content to Alfresco repository using RESTful API.

Requires Curl package to be installed on your system. Just set ALFRESCO_SERVER, USERNAME and PASSWORD variables in script before start it…

# Alfresco upload script with CURL by
# Usage:    
# ./ /tmp/some.pdf someSite documentLibrary someDir


FILENAME=`basename $1`
MIMETYPE=`file --brief --mime-type $1`

echo "Uploading: ${FILENAME} ($MIMETYPE) to ${ALFRESCO_SERVER}"

    --user "${USERNAME}":"${PASSWORD}" \
    -F filedata=@$1 -F siteid="$2" -F containerid="$3" \
    -F uploaddirectory="$4" \ -F filename="${FILENAME}" \
    -F contenttype=${CONTENTTYPE} "${UPLOAD_SERVICE_URL}" \
    | grep 'description' | cut -d ':' -f 2 | tr -d '\"'


$./ ~/Desktop/advanced-workflow-article.pdf demo documentLibrary someDir
Uploading: advanced-workflow-article.pdf (application/pdf) to http://localhost:8080/alfresco
 File uploaded successfully

ExtAlf – Alfresco by ExtJS

ExtAlf demo in Safari

I’m working on a new ExtJS wrapper (ExtAlf) – inspired by Opsoro – for Alfresco document and workflow management functions (by webscripts), like foldertree, document properties, preview, etc. This is not an Opsoro or FlexSpaces alternative, rather than a developer toolkit or a simple SDK what supports embedding Alfresco backend functionality into Web2.0/AJAX portals and frontends.

Link: Collaborative Editor

ExtAlf in Aptana

Planned features:

  • – folder tree panel with actions (show folder contents, create new folder, move folder)
  • – document grid panel with actions (preview, download, show properties, delete, rename, move to other folder, upload new document)
  • – property grid with editing fields
  • – content preview with document transformation
  • – task list and management (close, create, forward)
  • – user interface localization
  • – limit root nodeRef to browse (just like Customer Portal engines)
  • – simple search
  • – simple discussion forum
  • – different grids to show document in a folder with custom properties
  • – integrated document editor for plain text, html and form contents

Search dialog and results with auto-preview:
ExtAlf Search

Login dialog:

ExtAlf Login window

Floating panels on UI:
ExtAlf Demo2 - floating panels

Continue reading ExtAlf – Alfresco by ExtJS