We have no clean way of setting the download file name or extension right now (apart from an undocumented hack), but I have just extended ui:setResponseHeader for 5.4 so that you could do

<ui:setResponseHeader ui:headerName="Content-Disposition" ui:headerValue="inline; filename=..." />

Anyway, I hope your users can live with this little gap for the time being.

Cheers,
Holger


On 30/05/2017 0:06, Ilya Ushakov wrote:
Hi Holger,
Seems everything works. Thank you.
One additional question:
Is it possible to put default extension of downloaded file (for example .txt) un swp?

On Monday, May 29, 2017 at 2:38:45 PM UTC+2, Holger Knublauch wrote:

    I guess going through ui:instanceView will by default assume HTML
    in the servlet, and then also wrap it into a <div>. But from my
    test the attached solution seems to work. Call it using

    http://localhost:8083/tbl/swp?_viewClass=octet:TestServices&who=World
    <http://localhost:8083/tbl/swp?_viewClass=octet:TestServices&who=World>

    (Produces a direct file download, no <div>)

    To simulate the situation of the instanceView, just use another
    argument (instead of who above) which will have the value of
    _resource, and get to the business logic from there.

    HTH
    Holger



    On 29/05/2017 21:35, Ilya Ushakov wrote:
    Hi Holger,
    Thank you for your reply.
    I tried to add ui:responseType with my own instance (which has
    ui:mimeType = application/octet-stream) in skos:Concept where i
    defined logic in ui:instanceView property of skos:Concept.
    In ui:instanceView i call my own subclass of ui:Element.
    ui:responseType there as well. But, alas, no any impact.
    If i add application/octet-stream to _format parameter of
    request, the result is automatically downloaded but the content
    is wrapped by <div> element.
    Here is example of link
    
http://192.168.99.100:8888/evn/tbl/swp?_resource=http%3A%2F%2Fwww.ontologies.thomson.com%2FKNS137PR%23Concept_9f132aca-2b2c-11b2-80cb-d7e28d5ba670&_matchIds=ExportToIntented&_withImports=true&_snippet=true&_format=text&_base=urn%3Ax-evn-master%3Amini_kns&metadataList=
    
<http://192.168.99.100:8888/evn/tbl/swp?_resource=http%3A%2F%2Fwww.ontologies.thomson.com%2FKNS137PR%23Concept_9f132aca-2b2c-11b2-80cb-d7e28d5ba670&_matchIds=ExportToIntented&_withImports=true&_snippet=true&_format=text&_base=urn%3Ax-evn-master%3Amini_kns&metadataList=>


     example of result see in an attachment.
    What is the nature of this <div>?
    What must I do that this <div> didn't appear?




    On Saturday, May 27, 2017 at 12:11:39 AM UTC+2, Holger Knublauch
    wrote:

        The mime type can be set via the ui:responseType property at
        the SWP service. There are several pre-defined instances of
        ui:ResponseType, but you can define your own. Example:

        ui:HTML
          rdf:type ui:ResponseType ;
          ui:mimeType "text/html" ;
          rdfs:comment "The HTML response type." ;
          rdfs:label "HTML" .

        Holger



        On 26/05/2017 20:59, Ilya Ushakov wrote:
        I need to create report based on swp technology which would
        be save as file and not just opens in new browser's tab . To
        achieve this in, for example, sparqlmotion, you can use
        sml:mimeType property of sml:ReturnText and put there
        something like "text/csv". But, alas, sparqlmotion is not
        suitable technology for our requirements.
        Is it possible to put mimetype in swp?
-- You received this message because you are subscribed to the
        Google Group "TopBraid Suite Users", the topics of which
        include the TopBraid Suite family of products and its base
        technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
        To post to this group, send email to [email protected]
        ---
        You received this message because you are subscribed to the
        Google Groups "TopBraid Suite Users" group.
        To unsubscribe from this group and stop receiving emails
        from it, send an email to [email protected].
        For more options, visit https://groups.google.com/d/optout
        <https://groups.google.com/d/optout>.

-- You received this message because you are subscribed to the
    Google Group "TopBraid Suite Users", the topics of which include
    the TopBraid Suite family of products and its base technologies
    such as SPARQLMotion, SPARQL Web Pages and SPIN.
    To post to this group, send email to [email protected]
    <javascript:>
    ---
    You received this message because you are subscribed to the
    Google Groups "TopBraid Suite Users" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to [email protected] <javascript:>.
    For more options, visit https://groups.google.com/d/optout
    <https://groups.google.com/d/optout>.

--
You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include the TopBraid Suite family of products and its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to [email protected]
---
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Group "TopBraid 
Suite Users", the topics of which include the TopBraid Suite family of products and 
its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to [email protected]
--- You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to