I have a screen set up so that it passes the production line in as a parameter. This parameter is then used in an image tag to create the link to the image:
[default]{1}/SKU
1 = {view.params.Name}
I then have a transform that does the following
concat({view.params.dir},{value},{view.params.filetype})
{view.params.dir} = /system/images/products
{value} = current SKU tag lookup
{filetype} = .png
I tried removing the expression transform and creating a script transform
def transform(self, value, quality, timestamp):
"""
Transform the incoming value and return a result.
Arguments:
self: A reference to the component this binding is configured on.
value: The incoming value from the binding or the previous transform.
quality: The quality code of the incoming value.
timestamp: The timestamp of the incoming value as a java.util.Date
"""
import system.file
return system.file.fileExists(self.view.params.dir + str(value) + self.view.params.filetype)
this returns false. I also tried
return system.file.fileExists(self.session.props.gateway.address +"/main" + self.view.params.dir + str(value) + self.view.params.filetype)
This also returns false even though I can browse to that file.
The desired end result is if the value.png doesn’t exist then I’ll return a default 404.png image instead.