Tidy not mandatory for example REST scripts.

* Fixed doc too.

FEA: ItEr74S04BugFixing
This commit is contained in:
Manuel Rego Casasnovas 2011-06-19 16:40:31 +02:00
parent a50bd81335
commit b19cc48936
5 changed files with 28 additions and 10 deletions

View file

@ -2387,9 +2387,9 @@ created in project repository inside ``scripts/rest-clients`` directory.
.. NOTE:: .. NOTE::
Currently these scripts depends on Tidy to be installed in your Currently these scripts recommends Tidy to be installed in your system
system. You could install them in a Debian based distribution with the for a better output. You could install them in a Debian based distribution
following command as root:: with the following command as root::
apt-get install tidy apt-get install tidy

View file

@ -1,4 +1,4 @@
+ Check you have "tidy" available from the command line. + It's recommended to have "tidy" available in your system.
+ chmod u+x *.sh + chmod u+x *.sh

View file

@ -61,5 +61,11 @@ else
serviceURIWithParams="$baseServiceURL/resourceshours/$resourceCode/$startDate/$endDate/" serviceURIWithParams="$baseServiceURL/resourceshours/$resourceCode/$startDate/$endDate/"
fi fi
curl -sv -X GET $certificate --header "Authorization: Basic $authorization" \ result=`curl -sv -X GET $certificate --header "Authorization: Basic $authorization" \
$serviceURIWithParams | tidy -xml -i -q -utf8 $serviceURIWithParams`
if hash tidy &> /dev/null; then
echo $result | tidy -xml -i -q -utf8
else
echo $result
fi

View file

@ -20,5 +20,11 @@ fi
authorization=`echo -n "$loginName:$password" | base64` authorization=`echo -n "$loginName:$password" | base64`
curl -sv -X GET $certificate --header "Authorization: Basic $authorization" \ result=`curl -sv -X GET $certificate --header "Authorization: Basic $authorization" \
$baseServiceURL/$1 | tidy -xml -i -q -utf8 $baseServiceURL/$1`
if hash tidy &> /dev/null; then
echo $result | tidy -xml -i -q -utf8
else
echo $result
fi

View file

@ -27,7 +27,13 @@ fi
authorization=`echo -n "$loginName:$password" | base64` authorization=`echo -n "$loginName:$password" | base64`
curl -sv -X POST $certificate -d @$file \ result=`curl -sv -X POST $certificate -d @$file \
--header "Content-type: application/xml" \ --header "Content-type: application/xml" \
--header "Authorization: Basic $authorization" \ --header "Authorization: Basic $authorization" \
$baseServiceURL/$1 | tidy -xml -i -q -utf8 $baseServiceURL/$1`
if hash tidy &> /dev/null; then
echo $result | tidy -xml -i -q -utf8
else
echo $result
fi