-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSSTUDIO-2076 Bugfix: add a leading forward slash and replace backslashes in file-paths with forward slashes in DisplayInfo.forModel()
#2866
Conversation
…aths with forward slashes in DisplayInfo.forModel() so that filepaths are compared correctly in DisplayRuntimeInstance.trackCurrentModel().
We access displays in two different ways. In the control room, the Will this PR always add an initial '/'? Will it turn |
@kasemir: I will try to test this. |
@kasemir: Indeed, it doesn't work with OPIs loaded over HTTP. There seems to be an incongruity in the representation: on line 115 of phoebus/app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app/DisplayInfo.java Line 115 in efc8b66
the expression model.getUserData(DisplayModel.USER_DATA_INPUT_FILE) returns a file-path (i.e., not an URI) if an OPI is located in the filesystem, while it returns an URI if the OPI is retrieved over HTTP.
Furthermore, the function
|
I had approached this with a mindset based on display links in all the previous display tools. In the editor, you can enter a display name like "xxx". At runtime, the tool will then look for "xxx.edl", maybe along a search path. While editing the file, there is really no way to check/resolve the display name, have to simply accept whatever the user enters, because the file may be edited in a place where the linked display doesn't exist. |
That's a show stopper. Will break half our CSS setups. The ultimate solution of having true URLs everywhere might take longer. Still, the basic |
Don't forget https. |
Right, I meant literally check for starting with "http", which covers "http://" as well as "https://". OK, also a file named "http_is_part_of_my_name"... |
DisplayInfo.forModel()
DisplayInfo.forModel()
…ding '/' before replacing '\' with '/' and adding a leading '/'.
I have added checks for I am not sure about adding Do we support any other schemas? |
"examples:" is a good one!
|
It's probably better to include too many than too few schemas, so I added "ftp:" and "jar:" also. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please not ftp. It is history.
If it in principle can occur, why not add it? |
To discourage bad habits. |
But it is not my role to choose the protocol people use to host their OPIs. |
This PR adds a leading forward slash and replaces backslashes in file-paths with forward slashes in
DisplayInfo.forModel()
so that filepaths are compared correctly inDisplayRuntimeInstance.trackCurrentModel()
.A consequence of this is that running instances of OPIs are located when running "Execute Display" under Windows. (At the moment, they are not located, and new instances are created when running "Execute Display".)