Topic
2 replies Latest Post - ‏2013-12-24T23:47:57Z by Jrules80
Jrules80
Jrules80
78 Posts
ACCEPTED ANSWER

Pinned topic SOMA (dp:set-file) script:Disable file upload if the file already exists

‏2013-12-24T21:38:59Z |

Hello,

Using SOMA when I upload a file to DP, I want to disable file overwrite if it already exists in the local:/ file structure. Here is the SOMA I have to upload a file to DP:

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<dp:request domain="BA" xmlns:dp="http://www.datapower.com/schemas/management">
<dp:set-file name="local:\Dummy\CustomMsg.xsl">
                     PHhzbDpzdHlsZXNoZWV0IHhtbG5zOnhzbD0iaHR0cDovL3d3dy53My5vcm ==
</dp:set-file> 
</dp:request>
</env:Body>
</env:Envelope> 

Where can I mention here to set overwrite= false? Is the following code valid?

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<dp:request domain="BA" xmlns:dp="http://www.datapower.com/schemas/management">
<dp:set-file name="local:\Dummy\CustomMsg.xsl"  overwrite-files="false">
                     PHhzbDpzdHlsZXNoZWV0IHhtbG5zOnhzbD0iaHR0cDovL3d3dy53My5vcm ==
</dp:set-file> 
</dp:request>
</env:Body>
</env:Envelope> 
Updated on 2013-12-24T23:49:08Z at 2013-12-24T23:49:08Z by Jrules80
  • HermannSW
    HermannSW
    2817 Posts
    ACCEPTED ANSWER

    Re: SOMA (dp:set-file) script:Disable file upload if the file already exists

    ‏2013-12-24T23:40:47Z  in response to Jrules80

    Hi,

    you cannot guess or wish SOMA command options, you have to look up the available features in "store:///xml*.xsd" files.

    "set-file" command is defined in "xml-mgmt-ops.xsd":


    As you can see  @name  is the only available attribute.

    I know that defining "override" behavior is possible in WebGUI file upload dialog.

    With SOMA you will have to do two step approach, "get-filestore" first and then depending on non-presence of file, "set-file" then.


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

    • Jrules80
      Jrules80
      78 Posts
      ACCEPTED ANSWER

      Re: SOMA (dp:set-file) script:Disable file upload if the file already exists

      ‏2013-12-24T23:47:57Z  in response to HermannSW

      Thanks Hermann! I have learned a new thing today  --- "xml-mgmt-ops.xsd" :)

      I have changed my approach. This question had to do with a user GUI that I developing to execute some of the redundant DataPower admin tasks using SOMA.