Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [lyo-dev] JSP Generator Problem resourceshape

Hi Jan-Patrick,

 

Please see below!

 

regards

______________________________

Jad El-khoury, PhD

KTH Royal Institute of Technology

School of Industrial Engineering and Management, Mechatronics Division

Brinellvägen 83, SE-100 44 Stockholm, Sweden

Phone: +46(0)8 790 6877 Mobile: +46(0)70 773 93 45

jad@xxxxxx, www.kth.se

 

-----Original Message-----
From: lyo-dev-bounces@xxxxxxxxxxx <lyo-dev-bounces@xxxxxxxxxxx> On Behalf Of Jan-Patrick Osterloh
Sent: 07 November 2019 14:12
To: lyo-dev@xxxxxxxxxxx
Subject: [lyo-dev] JSP Generator Problem resourceshape

 

Hi everybody,

 

when I generate my project from scratch (I deleted all jsp files to get current versions of the files after I added more properties to my resources), then there is one problem in the resourceshape.jsp. It generates the following code in the "Describes" section:

 

79:                         <%for(URI next :

aResourceShape.getDescribes()) {%>

80:                             <li>

81:                                 <a href="">

82:                                     <%= next.toString().split("#")[1]%></a>

83:                             </li>

84:                         <%}%>

85:                     </ul>

 

My "Describes" are all "null", because I didnt set this property.

Side note: I can't set it because the editor just tells me "Please select a valid 'Class'", but I don't have anything in my project that is accepted as a valid class...

 

Jad: Here the editor is after a RDF Vocabulary Class. An OSLC shape describes such an rdf-Class. that’s what really defines the rdf:type. if you don’t define one, the generator takes the shape’s name as its type implicitly. So, it’s not wrong not to define the “describes” property in the model.

But, you can.  You define such classes under the Vocabularies section of you model. See attached picture!

You can’t see such a section? Then it is likely that you have an older model, before Vocabularies were introduced. If this is of interest, I can help you create it.

 

Nevertheless, if I then open any of the ResourceShapes in my model (.../services/resourceShapes/<ResourceShape>, I get an Exception:

 

An exception occurred processing JSP page /package/resourceshape.jsp at line 82 ...

java.lang.ArrayIndexOutOfBoundsException: 1

        at

org.apache.jsp.package.resourceshape_jsp._jspService(resourceshape_jsp.java:184)

        at

org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)

 

Jad: This is very strange, because you should not even be in this for-loop (line 79) if “aResourceShape.getDescribes()” is null/empty.

And I could not reproduce this problem for a similar model here.

Could you please check the size and content of “aResourceShape.getDescribes()”? Could you have somehow managed to fill it with some item which is not a “class”?

 

I have removed the for loop completely and this "fixes" the problem, but I think that might be better fixed in the generator template...

 

Best

Jan-Patrick

 

P.S. Is there an option to always regenerate the jsps? I just use them for "debugging", so from my point of view they could be updated...?

Jad: I’m with you on this one, because I also miss many bugs, since I don’t end up re-generating the jsp pages, which I use for debugging.

Earlier versions allowed regenerations of specific blocks within each jsps. But that was very inflexible. And there was a need to have full control over the jsp content.

That’s why we now put the whole file content between these “protected user-code” blocks.

 

My thoughts now: provide a check-box option on the adaptor that lets you (the modeller) decide whether to (a) surround the whole jsp-content within “protected user-code” or (b) no protected user-code, meaning all content in the jsp is re-generated.

What do you think? I created a issue on https://github.com/eclipse/lyo.designer/issues/128, so we can continue the dialog there.

 

--

Dipl. Inform. Jan-Patrick Osterloh

Senior Research Engineer

Human Centered Design Group

 

OFFIS e.V. - Institut für Informatik | Institute for Information Technology

             FuE Bereich Verkehr     | R&D Division Transportation

             Escherweg 2, 26121 Oldenburg - Germany

Room:        D107

Phone/Fax:   +49 441 97 22-524 / -502

E-Mail:      osterloh@xxxxxxxx

URL:         http://www.offis.de

 

Registergericht: Amtsgericht Oldenburg VR 1956

Vorstand: Prof. Dr.-Ing. Wolfgang H. Nebel (Vorsitzender),

          Prof. Dr. techn. Susanne Boll-Westermann,

          Prof. Dr.-Ing. Axel Hahn,

          Prof. Dr.-Ing. Andreas Hein,

          Prof. Dr. Sebastian Lehnhoff

 

Unsere Hinweise zum Datenschutz sind abrufbar unter:

https://www.offis.de/datentransparenz.html

 

_______________________________________________

lyo-dev mailing list

lyo-dev@xxxxxxxxxxx

To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/lyo-dev

Attachment: VocaClass.png
Description: VocaClass.png


Back to the top