oslc-op / sysml-oslc-server

Sample code to demonstrate how to use Lyo Designer to create an OSLC server for the SysML v2 REST API.
Apache License 2.0
10 stars 2 forks source link

toString methods should return something that's more readable #7

Open jamsden opened 4 years ago

jamsden commented 4 years ago

Project should be its title for example.

jadelkhoury commented 4 years ago

Just to get started, I have now changed toString() to be "identifier (shortTitle)". Identifier is always there. ShortTitle is somethere there. So at least we have something to show to start with.

BUT, I just realised that unless we create and store Links (a reified resource) instead of URIs, it will not be possible to display the label, instead of hte URI. Alternatively, I need to do a GET on each property of a resource, in order to be able to display it.

Is it worth it?

jamsden commented 4 years ago

Jad, I would prefer title | identifier, never both - that is prefer title if it exists, otherwise use identifier. This keep the UI logical and clean unless the information isn't available.

jadelkhoury commented 4 years ago

Sure. It can be easily changed now that I have a system in place. I guess you mean “shortTitle” instead of title. And also note that shortTitle doesn’t exist in the source. I had to add it from another property.

jadelkhoury commented 4 years ago

So, I can now show something other than the URIs on the query page.

Once we have more relevant content (currently only identifier seems to have a value), I will update the toString() to be shortTitle.

jadelkhoury commented 4 years ago

I happened to just push a change to master. Based on what's being deployed, let's see what more we need to do on this issue.

jamsden commented 4 years ago

You can code for shortTitle and if its not there use identifier.

jadelkhoury commented 4 years ago

That's what I did already. https://aide.md.kth.se/sysml_oslc_server/services/projects/585a5a94-61a0-4a60-9731-c2be32b06f89/commits/7cbc0568-1f44-4725-ace0-e7d4e1c046c6/service3/sysmlClasss/query