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::
Currently these scripts depends on Tidy to be installed in your
system. You could install them in a Debian based distribution with the
following command as root::
Currently these scripts recommends Tidy to be installed in your system
for a better output. You could install them in a Debian based distribution
with the following command as root::
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

View file

@ -61,5 +61,11 @@ else
serviceURIWithParams="$baseServiceURL/resourceshours/$resourceCode/$startDate/$endDate/"
fi
curl -sv -X GET $certificate --header "Authorization: Basic $authorization" \
$serviceURIWithParams | tidy -xml -i -q -utf8
result=`curl -sv -X GET $certificate --header "Authorization: Basic $authorization" \
$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`
curl -sv -X GET $certificate --header "Authorization: Basic $authorization" \
$baseServiceURL/$1 | tidy -xml -i -q -utf8
result=`curl -sv -X GET $certificate --header "Authorization: Basic $authorization" \
$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`
curl -sv -X POST $certificate -d @$file \
result=`curl -sv -X POST $certificate -d @$file \
--header "Content-type: application/xml" \
--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