ThingWorx Model Definition in Composer > Visualization > Media > Media Entity Service Methods
Media Entity Service Methods
The following services can be used to construct the URL for retrieving dynamic content for media entities.
String GetProxyUrl(String targetUrl, [Boolean isAbsoluteUrl] )
At run time, the media entity combines the configured base URL and the url parameter to create the full target URL. For example:
MyProxy/Content/...trailing part of real url
To ensure that the URLs are properly formed and encoded for use in mashups, use the GetProxyUrl service method.
For single sign-on (SSO) authentication, enter a URL that supports OAuth.
The URL to content on the origin server. This must be reachable from the ThingWorx server.
If the content on the origin server is reachable from the client browser, you do not need to use a media entity. Instead, you can use the URL directly in a Image Widget or Link Widget.
This parameter is optional.
Set this parameter to true if the target URL is a full, absolute URL to the origin server. The targetUrl must start with the configured base URL.
Set this parameter to false if the target URL is relative to the configured base URL. The targetUrl is appended to the base URL to determine the actual target URL.
If this parameter is not provided, the default value is false (relative). Relative URLs are convenient to use from mashups since the configured base URL of the media entity can be unknown.
This parameter is false by default. When true, the provided redirect URL is followed.
These examples assume that the content is not reachable by the end-user's browser. If the URLs are reachable by the browser, use them in your mashup; there is no need to proxy the content through a media entity.
These examples use a new media entity called MyProxy.
The URL on the ThingWorx server where the content will be made available is Content URL.
The examples assume the ThingWorx server is on and the actual content is on
A Single Simple URL
Target URL:
This is what you are trying to surface.
Content URL:
This is the URL where ThingWorx will proxy the actual content.
Multiple Content URLs
Typically, a single origin server will serve content from many related URLs. Rather than setting up a media entity for each URL, you can use a single media entity to proxy many related origin URLs.
Target URLs:[image1.jpg, image2.jpg, image3.jpg. …]
Content URLs:
In this case, the media entity concatenates the base URL and url parameter and uses that for the actual target URL from which to proxy content.
Was this helpful?