+ # a service sets urn:AGL:widget:provided-api
+ grep "urn:AGL:widget:provided-api" config.xml
+ if [ $? -eq 0 ] ; then
+ # we are a service, now determine the scope ...
+ grep "urn:AGL:permission::partner:scope-platform" config.xml
+ if [ $? -eq 0 ];then
+ export SERVICE_PLATFORM=1
+ else
+ export SERVICE_USER=1
+ fi
+ else
+ # we are an application
+ export APPLICATION_USER=1
+ # no other type known (yet)
+ fi
+ # the file naming convention is servicename.wgt
+ # but some didnt respect it
+ export WGTSERVICENAME=$(grep 'id=.*' config.xml | sed 's,^.*id=,id=,' | cut -d= -f2 | cut -d'"' -f2)
+ if [ -z "$WGTSERVICENAME" ];then
+ echo "WARN: failed to find name in config.xml, fallback to filename"
+ export WGTSERVICENAME="$WGTNAME"
+ else
+ echo "DEBUG: detected service name as $WGTSERVICENAME"
+ fi