Created
June 17, 2016 03:02
-
-
Save douglascrp/a12d314fc7e398648d374f0af1aff6ac to your computer and use it in GitHub Desktop.
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 characters
#!/bin/bash | |
# | |
# Criação de pasta com CURL | |
# | |
# Usage: cria_pasta_customizada.sh | |
# | |
# ./cria_pasta_customizada.sh novaPasta | |
# | |
ALFRESCO_SERVER=http://servidor:8080/alfresco | |
USERNAME="admin" | |
PASSWORD="senha" | |
#CURL_VERBOSE=-v | |
CURL_VERBOSE=-s | |
CURL_METHOD=POST | |
# tipo customizado de pasta | |
FOLDERTYPE="cont:pastaContrato" | |
NOMEPASTA=$1 | |
#obter o id da pasta onde se deseja criar a nova pasta | |
IDPASTAPAI="0ff86baa-7ae9-464a-8dd6-7f36c1d4d121" | |
CREATE_SERVICE_URL=${ALFRESCO_SERVER}/service/api/node/folder | |
echo "Criando pasta: ""${NOMEPASTA}"" em ${ALFRESCO_SERVER}" | |
curl -X ${CURL_METHOD} --user "${USERNAME}":"${PASSWORD}" \ | |
"${CREATE_SERVICE_URL}/workspace/SpacesStore/${IDPASTAPAI}" \ | |
-H "Content-Type: application/json" -d '{"name":"'"${NOMEPASTA}"'","type":"'"${FOLDERTYPE}"'"}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment