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
(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=
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]
<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.
# baseURI: http://example.org/octet
# imports: http://topbraid.org/swa
# prefix: octet
@prefix adminguide: <http://server.topbraidlive.org/doc/adminguide#> .
@prefix afn: <http://jena.hpl.hp.com/ARQ/function#> .
@prefix arg: <http://spinrdf.org/arg#> .
@prefix cfg: <http://server.topbraidlive.org/web/2009/config#> .
@prefix charts: <http://uispin.org/charts#> .
@prefix composite: <http://www.topbraid.org/2007/05/composite.owl#> .
@prefix css: <http://uispin.org/css#> .
@prefix daml: <http://www.daml.org/2001/03/daml+oil#> .
@prefix dash: <http://datashapes.org/dash#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix default: <http://uispin.org/default#> .
@prefix email: <http://topbraid.org/email#> .
@prefix fn: <http://www.w3.org/2005/xpath-functions#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix html: <http://uispin.org/html#> .
@prefix imported: <http://topbraid.org/imported#> .
@prefix json: <http://topbraid.org/json#> .
@prefix let: <http://uispin.org/let#> .
@prefix letrs: <http://uispin.org/letrs#> .
@prefix list: <http://jena.hpl.hp.com/ARQ/list#> .
@prefix metadata: <http://topbraid.org/metadata#> .
@prefix octet: <http://example.org/octet#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix raci: <http://topbraid.org/raci#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
@prefix search: <http://topbraid.org/search#> .
@prefix search.spin: <http://topbraid.org/search.spin#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix skosapp: <http://evn.topbraidlive.org/uiplugins#> .
@prefix skostemplate: <http://topbraid.org/spin/skostemplates#> .
@prefix skosxl: <http://www.w3.org/2008/05/skos-xl#> .
@prefix sm: <http://topbraid.org/sparqlmotion#> .
@prefix smf: <http://topbraid.org/sparqlmotionfunctions#> .
@prefix sml: <http://topbraid.org/sparqlmotionlib#> .
@prefix solr: <http://topbraid.org/solr#> .
@prefix sp: <http://spinrdf.org/sp#> .
@prefix sparqlmotionlib-swp: <http://topbraid.org/sparqlmotionlib-swp#> .
@prefix sparqlmotionlib-tbc: <http://topbraid.org/sparqlmotionlib-tbc#> .
@prefix spell: <http://topbraid.org/spellcheckresults#> .
@prefix spif: <http://spinrdf.org/spif#> .
@prefix spin: <http://spinrdf.org/spin#> .
@prefix spl: <http://spinrdf.org/spl#> .
@prefix spl-dynamic-ranges: <http://spinrdf.org/spl-dynamic-ranges#> .
@prefix spr: <http://spinrdf.org/spr#> .
@prefix spra: <http://spinrdf.org/spra#> .
@prefix style: <http://uispin.org/style#> .
@prefix svg: <http://uispin.org/svg#> .
@prefix swa: <http://topbraid.org/swa#> .
@prefix swaclasses: <http://topbraid.org/swaclasses#> .
@prefix swaeditor: <http://topbraid.org/swaeditor#> .
@prefix swaowl: <http://topbraid.org/swaowl#> .
@prefix swauml: <http://topbraid.org/swauml#> .
@prefix swon: <http://uispin.org/swon#> .
@prefix sxml: <http://topbraid.org/sxml#> .
@prefix tables: <http://topbraid.org/tables#> .
@prefix task: <http://topbraid.org/task#> .
@prefix tasks: <http://topbraid.org/tasks#> .
@prefix tbl: <http://topbraidlive.org/functions#> .
@prefix tops: <http://www.topbraid.org/tops#> .
@prefix tosh: <http://topbraid.org/tosh#> .
@prefix ui: <http://uispin.org/ui#> .
@prefix uix: <http://topbraidlive.org/uix#> .
@prefix vs: <http://www.w3.org/2003/06/sw-vocab-status/ns#> .
@prefix wot: <http://xmlns.com/wot/0.1/> .
@prefix xlink: <http://www.w3.org/1999/xlink#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://example.org/octet>
rdf:type owl:Ontology ;
owl:imports <http://topbraid.org/swa> ;
owl:versionInfo "Created with TopBraid Composer" ;
.
octet:ResponseType
rdf:type ui:ResponseType ;
ui:mimeType "application/octet-stream" ;
rdfs:label "Response type" ;
.
octet:TestServices
rdf:type ui:Service ;
spin:constraint [
rdf:type spl:Argument ;
spl:predicate arg:who ;
spl:valueType xsd:string ;
] ;
ui:prototype """
<ui:group>Hello, {= ?who }!</ui:group>
"""^^ui:Literal ;
ui:responseType octet:ResponseType ;
rdfs:label "Test services" ;
rdfs:subClassOf ui:Services ;
.
arg:who
rdf:type rdf:Property ;
rdfs:subPropertyOf sp:arg ;
.