Topic
  • 4 replies
  • Latest Post - ‏2015-04-09T21:16:08Z by HermannSW
skc5559
skc5559
17 Posts

Pinned topic How to get the name of Files under a datapower Directory

‏2013-05-02T05:21:22Z |

Hi,

I have a requirement wherein I need to get the names of file (not the content) present under a directory in datapower.

Could you please let me know if any XSL function or datapower extension function can do this?

As we know DP doesn't support XSL 2.0 so I can go for any EXSLT functions.

 

  • HermannSW
    HermannSW
    4741 Posts

    Re: How to get the name of Files under a datapower Directory

    ‏2013-05-02T10:07:18Z  

    Hi,

    this SOMA request gives you the complete "local:" filestore:

    $ cat get-filestore-local.xml
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
      <env:Body>
        <dp:request domain="default"
          xmlns:dp="http://www.datapower.com/schemas/management">
          <dp:get-filestore location="local:"/>
        </dp:request>
      </env:Body>
    </env:Envelope>
    $
     

    If you apply XPath expression "/*/*/*/*/location" on the response you will get all directory and file information.

     

    Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>

  • skc5559
    skc5559
    17 Posts

    Re: How to get the name of Files under a datapower Directory

    ‏2013-05-06T07:06:39Z  
    • HermannSW
    • ‏2013-05-02T10:07:18Z

    Hi,

    this SOMA request gives you the complete "local:" filestore:

    $ cat get-filestore-local.xml
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
      <env:Body>
        <dp:request domain="default"
          xmlns:dp="http://www.datapower.com/schemas/management">
          <dp:get-filestore location="local:"/>
        </dp:request>
      </env:Body>
    </env:Envelope>
    $
     

    If you apply XPath expression "/*/*/*/*/location" on the response you will get all directory and file information.

     

    Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>

    Thanx a ton Hermann !, It works and rocks !!!
  • Satish.K.M
    Satish.K.M
    5 Posts

    Re: How to get the name of Files under a datapower Directory

    ‏2015-04-09T19:08:58Z  
    • HermannSW
    • ‏2013-05-02T10:07:18Z

    Hi,

    this SOMA request gives you the complete "local:" filestore:

    $ cat get-filestore-local.xml
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
      <env:Body>
        <dp:request domain="default"
          xmlns:dp="http://www.datapower.com/schemas/management">
          <dp:get-filestore location="local:"/>
        </dp:request>
      </env:Body>
    </env:Envelope>
    $
     

    If you apply XPath expression "/*/*/*/*/location" on the response you will get all directory and file information.

     

    Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>

    Hello Hermann,

    Is it possible to use "get-filestore" functionality from an xsl like "dp:sql-execute" ?

    Thanks,

    Satish

  • HermannSW
    HermannSW
    4741 Posts

    Re: How to get the name of Files under a datapower Directory

    ‏2015-04-09T21:16:08Z  

    Hello Hermann,

    Is it possible to use "get-filestore" functionality from an xsl like "dp:sql-execute" ?

    Thanks,

    Satish

    Hi,

    there is no command for that in XSLT, but you can access the XML management interface from within XSLT:
    https://www.ibm.com/developerworks/community/blogs/HermannSW/entry/accessing_xml_management_interface_from_within_a_stylesheet38


    Hermann.