EVN: Customizing forms with Spin templates

32 views
Skip to first unread message

Adam Kimball

unread,
Oct 21, 2016, 8:39:47 AM10/21/16
to TopBraid Suite Users
Hi all,

I'm trying to customize an EVN form with data that comes from a Spin template.  Here is a simplified example of a template's body (hw-spin:ExactCodesForContentAssetTemplate)

SELECT ?exact_code
WHERE {
    ?asset content_asset_schema:level_1 ?concept .
    ?concept hwcv_sc:exact_code ?exact_code .
}
ORDER BY (?exact_code)

(?asset is a spin:constraint - arg)  - This is a very basic query in our system and it runs fast from the sparql endpoint or Composer

From within a class's ui:instanceView definition, I've added the following:


<swa:ObjectsEnum arg:label="Codes">
  <ui:call arg:asset="{=
?this }" ui:template="hw-spin:ExactCodesForContentAssetTemplate">
    <swa:ResultSetObjectsView arg:label="Exact Codes" arg:resultSet="{=
?rs }"/>
  </ui:call>
  ...
</swa:ObjectsEnum>

I actually have three such calls where each call is a rather simple template that utilizes the same argument and should execute very quickly.   I'm pretty certain that although my aim is good the whole business with swa:ResultSetObjectsView is not right....

Although this does seem to work, it is putting a huge load on my dev instance.  Something is spinning, even before I get to the point of rendering a form for the instance in question.  When this code is in the form, even bringing up the taxonomy is terrible, when its out everything zips along.  So something is clearly wrong.

Thanks to anyone who has read this far!
-Adam

Holger Knublauch

unread,
Oct 23, 2016, 8:08:18 PM10/23/16
to topbrai...@googlegroups.com
Hi Adam,

you may not be surprised if I say this is hard to diagnose without more information. You seem to be concerned about the performance and suspect something is wrong with the template or the swa:ResultSetObjectsView element. I see nothing wrong with the template, but I would like to confirm that ?this is in fact pre-bound correctly - to verify just add a line such as <div>This is {= ?this }</div> and re-run the form. If it's not pre-bound then the query may do some extra iterations, although OTOH you would see more results too. I assume the result rows are showing up as you intended, but it's just slow?

As an aside, swa:ResultSetObjectsView only works in view mode, and you would also see those values in edit mode. If you don't want this, surround the ui:call with <ui:if ui:condition="{= swa:isViewMode() }">...</ui:if>

Holger
--
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 topbrai...@googlegroups.com
---
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 topbraid-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adam Kimball

unread,
Oct 24, 2016, 11:57:03 AM10/24/16
to topbrai...@googlegroups.com

Holger,

 

Thanks again for your help.  And, you are correct, I'm not at all surprised that diagnosing performance issues is complicated.  It always is, no matter the language nor platform.

 

I inserted the div to echo the output of ?this but never made it to rendering.  This time, however, I received a non-responsive Javascript error for jquery.js which is probably indicative of the fact that it could be something a little tedious to work through on a mailing list, but I'm happy to try or reach out to support.

 

Let me know your thoughts,

 

-Adam

Reply all
Reply to author
Forward
0 new messages