Changeset 4435


Ignore:
Timestamp:
02/05/14 09:55:59 (10 years ago)
Author:
andmor
Message:

Revised xquery escaping technique.
sloot.xquery now needs a wrapping <query> element around the xquery text.

Location:
cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/interface
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/interface/getSchemaMetadata.dpml

    r4367 r4435  
    133133                                <argument name="operator">
    134134                                    <literal type="xml">
    135                                         <config>
    136                                             <header name="httpResponse:/header/Cache-Control">{$cache-control}</header>
    137                                             <header name="mime">{$schema-mime}</header>
    138                                             <header name="HTTP_CACHE_EXPIRES_DELTA_SECONDS">0</header>
    139                                         </config>
     135                                        <query>
     136                                            <config>
     137                                                <header name="httpResponse:/header/Cache-Control">{$cache-control}</header>
     138                                                <header name="mime">{$schema-mime}</header>
     139                                                <header name="HTTP_CACHE_EXPIRES_DELTA_SECONDS">0</header>
     140                                            </config>
     141                                        </query>
    140142                                    </literal>
    141143                                </argument>
  • cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/interface/getUser.dpml

    r3951 r4435  
    2626                                                <argument name="operator">
    2727                                                        <literal type="xml">
    28                                                                 <ids>
    29                                                                         <id>{$userID}</id>
    30                                                                 </ids>
     28                                                                <query>
     29                                                                        <ids>
     30                                                                                <id>{$userID}</id>
     31                                                                        </ids>
     32                                                                </query>
    3133                                                        </literal>
    3234                                                </argument>
  • cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/interface/pagedUserSchemas.dpml

    r3875 r4435  
    2626                        <argument name="operator">
    2727                            <literal type="xml">
    28                                 <ids>
    29                                     <id>{$userID}</id>
    30                                 </ids>
     28                                <query>
     29                                    <ids>
     30                                        <id>{$userID}</id>
     31                                    </ids>
     32                                </query>
    3133                            </literal>
    3234                        </argument>
  • cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/interface/postSchemaAccess.dpml

    r4370 r4435  
    11<?xml version="1.0" encoding="UTF-8"?>
    2 <sequence debug="true">
     2<sequence debug="false">
    33    <log>
    44        <level>INFO</level>
     
    2424    <!-- Obtain IDs authorized to update the schema -->   
    2525    <request assignment="authorized-update-IDs">
    26         <identifier>active:xquery</identifier>
     26        <identifier>active:sloot.xquery</identifier>
    2727        <argument name="operator">
    28             <literal type="string">
    29                <!--Code for active:xquery-->
    30                 declare variable $authorizedIDs external;
    31                 element ids {
    32                     for $id in $authorizedIDs/ids/id
    33                         return if (contains($id/@actions, 'u'))
    34                                 then $id
    35                                 else ()
    36                 }
    37                
    38                 <!-- Code for active:sloot.xquery -->
    39                 <!--<ids>
    40                     {
    41                     for $id in $authorizedIDs/ids/id
     28            <literal type="xml">
     29                <query>
     30                    <ids>
     31                        {
     32                        for $id in $authorizedIDs/ids/id
    4233                        return  if (contains($id/@actions, 'u'))
    43                                 then $id
    44                                 else ()
    45                     }
    46                 </ids>-->
     34                        then $id
     35                        else ()
     36                        }
     37                    </ids>
     38                </query>
    4739            </literal>
    4840        </argument>
     
    121113                            <argument name="operator">
    122114                                <literal type="xml">
    123                                     <ids>
    124                                         {
    125                                         for $user in $postedAuthorizedUsers/*
     115                                    <query>
     116                                        <ids>
     117                                            {
     118                                            for $user in $postedAuthorizedUsers/*
    126119                                            return  if (name($user) eq 'all')
    127                                                     then <id actions="{data($user/actions)}">ALL</id>
    128                                                     else (<id actions="{data($user/actions)}"
    129                                                         role="{data($user/role)}">{string($user/ref)}</id>)
    130                                         }
    131                                     </ids>
     120                                            then <id actions="{data($user/actions)}">ALL</id>
     121                                            else (<id actions="{data($user/actions)}"
     122                                                role="{data($user/role)}">{string($user/ref)}</id>)
     123                                            }
     124                                        </ids>
     125                                    </query>
    132126                                </literal>
    133127                            </argument>
     
    153147                </else>
    154148            </if>
    155                
    156            
    157            
    158            
    159            
    160             <!--<request>
    161                 <identifier>active:org.isocat.schemacat.access.data.schema.authorizedIDs</identifier>
    162                 <verb>SINK</verb>
    163                 <argument name="schemaID">arg:schemaID</argument>
    164                 <argument name="authorizedUsers">
    165                     <literal type="xml">
    166                         <ids>
    167                             <id role="owner" actions="rud">u1</id>
    168                            <!-\- <id role="user" actions="ru">u0</id>-\->
    169                             <!-\-<id actions="r">ALL</id>-\->
    170                         </ids>
    171                     </literal>
    172                 </argument>
    173             </request>-->
    174149        </then>
    175150        <else>
  • cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/interface/postUser.dpml

    r4075 r4435  
    2626                                                <argument name="operator">
    2727                                                        <literal type="xml">
    28                                                                 <ids>
    29                                                                         <id>{$userID}</id>
    30                                                                 </ids>
     28                                                                <query>
     29                                                                        <ids>
     30                                                                                <id>{$userID}</id>
     31                                                                        </ids>
     32                                                                </query>
    3133                                                        </literal>
    3234                                                </argument>
  • cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/interface/schemaAuthorizedIDs.dpml

    r4369 r4435  
    4141        <argument name="operator">
    4242            <literal type="xml">
    43                 <!--Code for active:xquery-->
    44                 <!--declare namespace sc = "http://www.isocat.org/ns/schemacat";
    45                 declare variable $schemaMetadata external;
    46                
    47                 element ids {
    48                 for $user in $schemaMetadata/sc:schema/sc:access/*
    49                     return  if (name($user) eq 'sc:all' and contains($user/@actions,'r'))
    50                             then element id {
    51                                 attribute actions{$user/@actions},
    52                                 'ALL'
    53                             }
    54                             else ( element id {
    55                                         attribute actions{$user/@actions},
    56                                         attribute role{$user/@role},
    57                                         string($user/@ref)
    58                                     }
    59                             )
    60                 }-->
    61                     <ids xmlns:sc="http://www.isocat.org/ns/schemacat">{
     43                <query  xmlns:sc="http://www.isocat.org/ns/schemacat">
     44                    <ids>{
    6245                        for $user in $schemaMetadata/sc:schema/sc:access/*
    63                             return if (name($user) eq 'sc:all' and contains($user/@actions ,'r'))
    64                                         then <id actions="{data($user/@actions)}">ALL</id>
    65                                         else <id actions="{data($user/@actions)}"
    66                                                  role="{data($user/@role)}">{string($user/@ref)}</id>
     46                        return if (name($user) eq 'sc:all' and contains($user/@actions ,'r'))
     47                        then <id actions="{data($user/@actions)}">ALL</id>
     48                        else <id actions="{data($user/@actions)}"
     49                            role="{data($user/@role)}">{string($user/@ref)}</id>
    6750                        }
    6851                    </ids>
     52                </query>
    6953            </literal>
    7054        </argument>
  • cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/interface/schemaFile.dpml

    r3951 r4435  
    199199                                <argument name="operator">
    200200                                    <literal type="xml">
    201                                         <config>
    202                                             <header name="httpResponse:/header/Cache-Control">{$cache-control}</header>
    203                                             <header name="mime">{$schema-mime}</header>
    204                                             <header name="httpResponse:/header/Content-Disposition">{$content-disposition}</header>
    205                                             <header name="HTTP_CACHE_EXPIRES_DELTA_SECONDS">0</header>
    206                                         </config>
     201                                        <query>
     202                                            <config>
     203                                                <header name="httpResponse:/header/Cache-Control">{$cache-control}</header>
     204                                                <header name="mime">{$schema-mime}</header>
     205                                                <header name="httpResponse:/header/Content-Disposition">{$content-disposition}</header>
     206                                                <header name="HTTP_CACHE_EXPIRES_DELTA_SECONDS">0</header>
     207                                            </config>
     208                                        </query>
    207209                                    </literal>
    208210                                </argument>
  • cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/interface/userSchemas.dpml

    r3875 r4435  
    2626                                                <argument name="operator">
    2727                                                        <literal type="xml">
    28                                                                 <ids>
    29                                                                         <id>{$userID}</id>
    30                                                                 </ids>
     28                                                                <query>
     29                                                                        <ids>
     30                                                                                <id>{$userID}</id>
     31                                                                        </ids>
     32                                                                </query>
    3133                                                        </literal>
    3234                                                </argument>
Note: See TracChangeset for help on using the changeset viewer.