Perspective Session Design Questions

Hi everyone,

I have several questions on Perspective sessions that might be thought-provoking. We have an enterprise application with lots of difficult functionality that we can mostly implement, but requires the use of tricks or database that I’d like to avoid for future maintainability. Maybe someone can shed some insight into these problems:

  1. I’m using the stable Ignition 8.0.2. I’ve noticed something called “Session Params” appearing on the session property editor, but I cannot recall ever seeing this. It also doesn’t seem permanent - I closed my designer and re-opened it and it is gone now. We are using session.custom for everything. If session.params is actually supposed to be there, how do those get passed in? Session startup script?

  2. Is there any way a perspective application knows what the resolution/size of the device is, or what the device is? E.g. is this a mobile/tablet/desktop? I see session.props.device has some of this information, at least for device type.

  3. If (2) is not feasible, is there any other way? Currently, I have a root page at ("/") that opens up and depending on it’s three breakpoints (0-500, 500-768, 768-1920), it opens three views which on startup, override a session custom property (session.custom.isMobile/isTablet/isDesktop). This doesn’t seem like a good idea if the browser size changes mid-session, as the left nav menu won’t differentiate unless the root page is hit (see (4)).

  4. The reason for this (3), is the left-hand navigation menu needs to have its behavior change based on device type. For a desktop, it is always open unless the user closes it, and it pushes, but doesn’t cover (it could alternatively stay open permanently). For a tablet/mobile device, it needs to stay close unless requested, and covers rather than pushes. Essentially, depending on the device type, the menu behavior needs to change. Is there a better way to do this? Alternatively, is there a way to get the resolution of the device or size of the browser?

  5. Is there a way to get the current project name? Right now i’m using a session custom property to hold this information. This is for named queries and other scripts that require the project name.

  6. Our project has about 100 views and that number is rapidly going to increase. We have a header bar that needs to take in a page name (also a site name, and occasionally a parameter tag name, depending on the view). Using a mapping transform on a property binding to page.props.path is nice, but kind of infeasible here (I’m using it for the site name, as it is always the third item in the URL if /sites/ is the first item). I’m currently storing all urls and window names in a database and accessing them whenever the page is changed. Is there a more elegant solution here?

  7. We’d still like to screenshot from within the application for support ticketing. However, nothing I’ve done has worked. Selenium and Java Robot have 0 effect as the scripts seem to be containerized to JavaScript (I could be saying that wrong). If we cannot do this, can we upload image files to perspective? I don’t think system.file.openFile works in perspective, so uploading doesn’t seem feasible.

There is a thread here (Perspective Screenshot Capture) describing this, but i’m not sure what to do with html2canvas aside from making an ignition module that works with perspective to screenshot. Would we simply need to import it in java gradle and create a callable function that can take the screenshot and return the binary for it?

Cheers,
Roger