Session Properties

I need to display different table data on 3 different machines. I would like to be able to do this respective to a specific IP address that is mapped to each machine. Is this something that is possible to do with session properties?

Are you asking, "Can I have the gateway detect the Perspective client's IP address and serve a specific view related to that IP address?".

If so, the answer is usually "No".

Yes, I was wanting to have the gateway detect the Perspective client's IP address and serve a specific view related to that IP address.

Add a label to a view and create a property binding on its text property to
session.props.address

Run the client on each machine and see if you get a unique IP address and check to see if it remains the same on power-cycle. (DHCP will give the next free address in the DHCP range so you'd need to use fixed IP addresses.) If you do get fixed IP addresses then there's a possibility of passing the address to the gateway to modify the view.

1 Like

I have done something like this before using the device identifier of the terminal where the session is running:

deviceIdentifier = self.session.props.device.identifier

This identifier then gets stored into a database table with the configuration parameters for the view. When the view is loaded it does a lookup into the database with it's own identifier from the session, grabs the correct configuration, and then populates the view. It works pretty well and sounds like it may work for your situation. Just note that this isn't technically tied to IP though.

2 Likes

Ok. Each machine IP address is tied to a unique workcenter_id also. So that may work.

That is stored in a persistent cookie in browsers, so cannot be relied upon.

2 Likes

You can absolutely do this at the COMPONENT level. Have the main View for the page be completely covered by an Embedded View, then set the path of that Embedded View based on the value of the client address.

2 Likes

So I would create an Embedded View, set the path property to the main page and then bind my script on the params property with an object that represents the ip address?

  1. Create a View with a Flex Layout.
  2. Place an Embedded View component into this new View.
  3. Set position.grow for the Embedded View to be 1.
  4. Bind EmbeddedView.props.path to the clientAddress prop found within the Session props.
  5. Now add a Map Transform to this binding where you list out the specific IP addresses and which Views they should direct to.
1 Like