rmp-common-library/src/main/java/org/gcube/resourcemanagement/support/server/gcube/queries/xquery/resources/GenericResource.xq

16 lines
583 B
Plaintext

for $profiles in collection('/db/Profiles/GenericResource')//Resource
let $scopes := string-join( $profiles/Scopes//Scope/text(), ';')
let $subtype := $profiles//Resource/Profile/SecondaryType/text()
<RES_SUBTYPE ISdefault =''/>
return
<Resource>
{$profiles//Resource/ID}
<Type>{$profiles//Resource/Type/text()}</Type>
<SubType>{$subtype}</SubType>
<Scopes>{$scopes}</Scopes>
<Name>{$profiles//Resource/Profile/Name/text()}</Name>
<Description>{$profiles//Resource/Profile/Description/text()}</Description>
</Resource>