Hi Ilya,
I think Holger’s point was that you need to use a different parameter name than
&_resource=… in the URL if you use ui:Service and &_viewClass=…
That’s because &_resource… is only used when your SWP snippets are attached
directly to instances (ui:resourceView) or classes (ui:instanceView). But
you’re not doing that. You’re defining a ui:Service, with the SWP snippet
attached to the service as ui:prototype. So you can’t use _resource.
In his example, Holger called the parameter &who=… but you should pick whatever
makes sense in your case, like &concept=…
In your SWP snippet, you have various options to get the value of that
parameter.
First, you can use ui:param("concept") to read the value. This is simple.
Second, you can declare an argument called “concept” (like you already did,
just don’t call it “resource”). Now the value passed in the URL as &concept=…
will be available as ?concept in the SWP snippet. I find this version a bit
cleaner.
Hope that helps,
Richard
> On 30 May 2017, at 14:18, Ilya Ushakov <[email protected]> wrote:
>
> Hi Holger,
> Thank you for your answer. When the new version of evn is expected?
> About mimeType.
> You did recommended me use ui:Service.
> When I try to get value of _resource param as
> ui:param("_resource"), it does not work at all. Always new tab is
> opening.
> RequestLink for this case looks like this:
> http://192.168.99.100:8888/evn/tbl/swp?_resource=http%3A%2F%2Fwww.ontologies.thomson.com%2FKNS137PR%23Concept_25c38181-29ff-11b2-8070-d32bf9e39c50&_viewClass=trevn:IntentedExport&_withImports=true&_snippet=true&projectGraph=urn%3Ax-evn-master%3Amini_kns&metadataList=
>
> When I pass value of resource uri as resource in link.
> in my ui:service i created spl:argument named resource and pass this in my
> ui:element implementing business logic as
> <trevn:displayIntentedReport arg:concept="{= IRI(?resource) }"
> arg:projectGraph="{= IRI(?projectGraph) }"/>
>
> I am not able to get all childs of this recource, query:
> SELECT ?child
> WHERE {
> BIND(smf:trace("INFO: resource {?1}", ?resource) AS ?dummy)
> ?child (skos:broader)* ?resource.
> }
>
> returns nothing despite BIND(smf:trace("INFO: resource {?1}", ?resource) AS
> ?dummy) writes to log
> <http://www.ontologies.thomson.com/AIN1PR#Concept_073769e8-2b29-11b2-809b-b6c43c3606a4>
>
> So, How can I get access to data from ui:elements.
>
> P. S.
> If i use old version where I used to ui:instanceView of skos:concept and
> determined current concept as ?this, everythin works fine
>
>
> On Tuesday, May 30, 2017 at 1:44:27 AM UTC+2, Holger Knublauch wrote:
> 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] <>
>>> ---
>>> 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
> <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.