On 12/07/2018 10:22, [email protected] wrote:

Thanks Holger

very helpful...



    On 11/07/2018 22:56, [email protected] <javascript:>
    wrote:
    I want to set up some common metadata that a suite of services
    implemented in SWP can access.

    I have a superclass of services, and in the header I can use a
    named graph to persist information - because AFAICT it appears
    that named graphs are the only mechanism for sharing context
    outside nested elements?

    Is there another way - perhaps to tap into what is obviously
    available for parameters passed to the SWP which are available
    anywhere ?

    Maybe http://uispin.org/ui.html#setContext
    <http://uispin.org/ui.html#setContext> or
    http://uispin.org/ui.html#param <http://uispin.org/ui.html#param>

AFAICT setContext is scoped to nested elements, so wont be available to the code in ui:prototypes of subclasses?

Ok I now hopefully understand better what you meant. You want to set values in the ui:headIncludes of parent elements and currently use named graphs (such as ui:tempGraph) to store those. Right, ui:setContext would not be useful. Named graphs are the only thing I can think of, e.g. use ui:setGlobalVar which uses a temp graph to hold its values as convenience layer. Query those in subclasses using ui:globalVarValue.

   ui:param is useful - it is possible to programmatically inject values into this within an SWP to carry context?

No, it just exposes the HTTP servlet arguments, which are read-only.


    Secondly - is there any way to access metadata that identifies
    the SWP service being called? I need to do this in a header, or
    some other way to have the superclass access this information and
    pass it in a standard way to activity loggers in each specialised
    service,
     ?thisNode and ?thisParent dont seem to work.

    ui:param("_viewClass") should give you the physical starting point
    assuming the service is called using _viewClass=...


thats great - NB this isnt mentioned in the "get metadata" part :-(

BTW - still trying to get my head around why sometimes a viewClass is used and sometimes an instance of such a class - both seem to co-exist in EDG - but whats the reason for using instances - and do they just behave like their parent classes? and what if there are multiple?

The engine always executes instances. Even with _viewClass, a temp instance is created for the duration of the call.


the properties of an instance do not shed much light on why they exist.  You previously pointed to classView as a way to invoke a service. the docs leave me no wiser:

"
|_view| The URI of a specific view to display (instance of |ui:Element|). |_viewClass| The URI or qname of a user-defined view class (subclass of |ui:Elements|) to display. All other arguments that match the declared arguments of the view class will be passed into the view, e.g. |uispin?_viewClass=ex:MyView&name=Test| will be comparable to |<ex:MyView arg:name="Test" />|."

is this explained in more detail elsewhere?

What do you want to know?



    I don't see any other standard way of finding the root entry
    point. You could modify you root services so that they set some
    context variable using ui:setContext, and the elements downstream
    can query that value using ui:contextValue().

is there some implicit nesting  going on that would make a setContext visible to subclasses?

No, see above.

Holger




    Finally - it seems if i subclass a service then the
    headerIncludes from the parent is still run - which is what I
    want - but is there any guarantee or way to force it to be
    included first?

    Yes, inherited headIncludes will be executed first.

cool.


    Holger


-- 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 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 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