Hi William,
As Holger said, the best way to handle this is by setting the serverURL in the
configuration.
Besides using smf:configParam to read the value of the setting, it can also be
done using ui:createLink. That is a control element that creates an URL and
assigns it to the variable ?link for further use. Its ui:absolute attribute
must be set to true to get an absolute URL including the server base URL. For
example:
<ui:createLink ui:absolute="true" ui:viewClass="ex:someService"
arg:graphURI="{= ?guri }">
<swon:Value arg:name="url" arg:value="{= ?link }"/>
</ui:createLink>
This might assign the following value to the variable ?link:
http://localhost:8083/tbl/swp?_viewClass=ex:someService&graphURI=urn:x-evn-master:test
Another example that calls the GraphQL service instead of an SWP service:
<ui:createLink ui:absolute="true" ui:servlet="graphql/{= ?graphId }"
arg:query="{= ?graphqlQuery }">
...
</ui:createLink>
This would set ?link to something like:
http://localhost:8083/tbl/graphql/test?query=...
See https://uispin.org/ui.html#createLink for more information.
Richard
> On 23 Oct 2019, at 23:06, William Ramos <[email protected]> wrote:
>
> Hi, community;
>
> I have a SWON service where I'm generating a value as a URL which should be
> based on the server where the SWON service is running.
>
> The company where I work has three different servers/domains:
> dev.company.com
> test.company.com
> prod.company.com
>
> So, for example if I'm running the SWON service on test.company.com it should
> generate the URL like this:
> url:"https://test.company.com?someService;graphURI..."
> ... if running the service on dev.company.com it should look generate it like
> this:
> url:"https://dev.company.com?someService;graphURI..."
>
> The SWON code that I have looks like this:
> <swon:Value arg:name="url"
> arg:value="https://test.company.com?someService;graphURI={= ?guri }"/>
> ...with the domain/server hardcoded, so I'm wondering if there's a built in
> function/mechanism to achieve this.
>
> Thanks in advance.
>
> --
> 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].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/topbraid-users/b73bfb67-7903-434d-a5a5-a795d5473b91%40googlegroups.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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/topbraid-users/7A1CBA70-A49A-497E-980F-0DA1D8DC9CED%40topquadrant.com.