Last active
July 20, 2019 18:01
-
-
Save CesarCapillas/7a99e3a3e9cb8cde1f4a6f81709be67c to your computer and use it in GitHub Desktop.
Revisions
-
CesarCapillas renamed this gist
Jul 20, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
CesarCapillas created this gist
Jul 20, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ #!/bin/bash export http_proxy= MYHOST=https://alfrescohost MYSECR="admin:secret" if [[ $1 == "-h" ]]; then echo "Usage: cmis-browser.sh [PATH=] [ACTION=properties|parents|aspects" echo " cmis-browser.sh" echo " cmis-browser.sh Sites/swsdp/documentLibrary" exit 1 fi if [[ $2 == "" ]]; then ENCODED=`echo $1 | sed -s 's/ /%20/g'` curl -s -u $MYSECR -X GET $MYHOST/alfresco/api/-default-/public/cmis/versions/1.1/browser/root/$ENCODED | jq -r '.objects[].object.properties | "\(."cmis:objectId".value) [\(."cmis:objectTypeId".value)] --> \(."cmis:name".value)"' else if [[ $2 == "parents" ]]; then curl -s -u $MYSECR -X GET $MYHOST/alfresco/api/-default-/public/cmis/versions/1.1/browser/root/$1?cmisselector=$2 | jq -r '.[].object.properties | "\(."cmis:objectId".value) --> \(."cmis:name".value) [\(."cmis:objectTypeId".value)]"' elif [[ $2 == "properties" ]]; then curl -s -u $MYSECR -X GET $MYHOST/alfresco/api/-default-/public/cmis/versions/1.1/browser/root/$1?cmisselector=$2 | jq -r '.[] | "\(.id) --> \(.value)"' elif [[ $2 == "aspects" ]]; then curl -s -u $MYSECR -X GET $MYHOST/alfresco/api/-default-/public/cmis/versions/1.1/browser/root/$1?cmisselector=object | jq -r '.[].aspects.appliedAspects' else curl -s -u $MYSECR -X GET $MYHOST/alfresco/api/-default-/public/cmis/versions/1.1/browser/root/$1?cmisselector=$2 | jq '.' fi