as I found it quite hard to scrape together how I might get certain informations uploaded to biserver that have formerly been accessible in the file system I wanted to share what I was able to get running.
The following is a bash script that I use in similar form. I share this in a works for me fashion, happy if somebody can make use of it but no warranties given.
#!/bin/bash
read -s -p "User: " user
read -s -p "Passwort: " pw
#user=Admin
#pw=password
url="http://localhost:8080/pentaho"
bihome=~/biserver-ce/
hideFile () {
cmd="<stringKeyStringValueDtoes><stringKeyStringValueDto><key>_PERM_HIDDEN</key><value>true</value></stringKeyStringValueDto></stringKeyStringValueDtoes>"
sendRest $1 metadata $cmd
}
upload () {
$bihome/import-export.sh -i -u $user -p $pw -url $url -utf-8 -o true -r false -m false -f "$1" -fp "$2"
}
uploadMondrian () {
$bihome/import-export.sh -i -u $user -p $pw -url $url -res DATASOURCE -ds ANALYSIS -f "Projectile Reporting" -fp "$1" -a_ds "$2" -utf-8 -o true -r false -m false -a_xmla true
}
sendRest () {
unset http_proxy
curl -X PUT -u ${user}:${pw} -H "Content-Type: application/xml; charset=utf-8" -d "$3" "${url}/api/repo/files/${1}/${2}"
}
# create some folders in the "Browse Files" area in biserver
# read up on repositoryFileAclDto for details on the rights settings
sendRest :public:Foldername createDir
sendRest :public:Foldername acl "<repositoryFileAclDto><aces><modifiable>true</modifiable><permissions>0</permissions><recipient>ceo</recipient><recipientType>1</recipientType></aces><entriesInheriting>false</entriesInheriting><owner>admin</owner><ownerType>0</ownerType></repositoryFileAclDto>"
# Upload Reports into right location in "Browse Files" area
upload /public/Foldername1/Foldername2 pathtoreport/Reportname.prpt
# Upload cde stuff and hide the two files the users don't have to see
upload /public/Foldername pathtocdefiles/cdefile.wcdf
upload /public/Foldername pathtocdefiles/cdefile.cda
upload /public/Foldername pathtocdefiles/cdefile.cdfde
hideFile :public:Foldername:cdefile.cda
hideFile :public:Foldername:cdefile.cdfde
# upload mondrian definition file and provide the datasource it will get its data from
uploadMondrian pathtomondrian/mondriandefinitionfile.xml datasource
The following is a bash script that I use in similar form. I share this in a works for me fashion, happy if somebody can make use of it but no warranties given.
#!/bin/bash
read -s -p "User: " user
read -s -p "Passwort: " pw
#user=Admin
#pw=password
url="http://localhost:8080/pentaho"
bihome=~/biserver-ce/
hideFile () {
cmd="<stringKeyStringValueDtoes><stringKeyStringValueDto><key>_PERM_HIDDEN</key><value>true</value></stringKeyStringValueDto></stringKeyStringValueDtoes>"
sendRest $1 metadata $cmd
}
upload () {
$bihome/import-export.sh -i -u $user -p $pw -url $url -utf-8 -o true -r false -m false -f "$1" -fp "$2"
}
uploadMondrian () {
$bihome/import-export.sh -i -u $user -p $pw -url $url -res DATASOURCE -ds ANALYSIS -f "Projectile Reporting" -fp "$1" -a_ds "$2" -utf-8 -o true -r false -m false -a_xmla true
}
sendRest () {
unset http_proxy
curl -X PUT -u ${user}:${pw} -H "Content-Type: application/xml; charset=utf-8" -d "$3" "${url}/api/repo/files/${1}/${2}"
}
# create some folders in the "Browse Files" area in biserver
# read up on repositoryFileAclDto for details on the rights settings
sendRest :public:Foldername createDir
sendRest :public:Foldername acl "<repositoryFileAclDto><aces><modifiable>true</modifiable><permissions>0</permissions><recipient>ceo</recipient><recipientType>1</recipientType></aces><entriesInheriting>false</entriesInheriting><owner>admin</owner><ownerType>0</ownerType></repositoryFileAclDto>"
# Upload Reports into right location in "Browse Files" area
upload /public/Foldername1/Foldername2 pathtoreport/Reportname.prpt
# Upload cde stuff and hide the two files the users don't have to see
upload /public/Foldername pathtocdefiles/cdefile.wcdf
upload /public/Foldername pathtocdefiles/cdefile.cda
upload /public/Foldername pathtocdefiles/cdefile.cdfde
hideFile :public:Foldername:cdefile.cda
hideFile :public:Foldername:cdefile.cdfde
# upload mondrian definition file and provide the datasource it will get its data from
uploadMondrian pathtomondrian/mondriandefinitionfile.xml datasource