[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [emf-dev] Tip for using the new 'galileo' flag for Eclipse EMF/MDTPlan Queries

Thanks, Christian.


I’ve applied similar changes to the draft plans for BPMN2 and IMM. Note that I’ve moved my theme designations from the short description field to the whiteboard field; this is more desirable, I think, because the resulting plan won’t show the theme redundantly as part of the description for each plan item.


Unfortunately, though, couldn’t get my plan items to render properly, even with your changes to url-encode.xsl (note that I think your snippets include an extra comma character). Any ideas? Were other changes perhaps required?




Kenn Hussey
Program Manager, Modeling and Design Solutions

[Embarcadero Technologies Logo]

Embarcadero Technologies, Inc. | www.embarcadero.com 
82 Peter Street, Second Floor | TorontoON  M5V 2G5
Mobile: 613-301-9105


From: emf-dev-bounces@xxxxxxxxxxx [mailto:emf-dev-bounces@xxxxxxxxxxx] On Behalf Of Christian W. Damus
Sent: Wednesday, September 24, 2008 9:59 PM
To: MDT developers; Eclipse Modelling Framework
Cc: d_a_carver@xxxxxxxxx
Subject: [emf-dev] Tip for using the new 'galileo' flag for Eclipse EMF/MDTPlan Queries


Hi, all,


As soon as I learned that Denis had bestowed on us a new 'galileo' flag (bug 247191 [1]), naturally I ran off to bugzilla immediately to apply it to my Plan Queries for OCL.


Well, I had some trouble getting queries to work that search for 'galileo+' (for committed or proposed items).  The 'galileo-' flag for deferred items was not a problem.  I did overcome, though ... read on.


The problem wasn't in testing queries in a browser.  Just paste this into your browser to see that it works:



The problem was in trying to get Dave Carver's XSL transformation (see his excellent blog posting [2]) to execute the query.  Naturally, the ampersands need to be escaped as & in the XML.  That's OK.  The problem was in encoding the '+' modifier on the flag.  On my first attempt, doing this in the XML didn't return any results:


The problem was, that the ingenious url-encode.xsl helper stylesheet re-encoded the '%' symbol.  Just adding the '%' to the 'safe' variable declaration in the url-encode.xsl file fixed that:


  <xsl:variable name="safe">%,+,[]&amp;=?/!'()*-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~</xsl:variable>


The next problem was that the square brackets ('[' and ']') in my search condition for the theme-in-summary scheme wouldn't work after making this change, because the HTTP request sent by the XSLT ended up converting them to the square brackets, which aren't valid characters in a URL query string.  At least, I think that's what happened.  I definitely got an error from the XSLT processor saying that the '[' was invalid.


The solution to this was to remove the '[' and ']' characters from the 'safe' variable, so that finally I had:


  <xsl:variable name="safe">%,+,&amp;=?/!'()*-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~</xsl:variable>


and the HTML resulting from my queries is now just what I need.


Questions for Dave C.:


  • Do you anticipate any problems that these changes to the 'safe' variable might cause?
  • Is any of this applicable to the plan-rendering script that the Eclipse website uses?  Or, is it only relevant to your XSL?  Will my queries work with Eclipse's renderer?  (I can't test it because OCL is not yet recognized as a Project)
  • Would you feel comfortable sharing these changes to the 'safe' variable with the rest of the Eclipse projects?


For a complete example of using the 'galileo' flag in your plan.xml, see my OCL plan file in CVS:



Thanks, Dave, for this extremely helpful tooling that you developed!









Christian W. Damus

Senior Software Developer, Zeligsoft Inc.

Component Lead, Eclipse MDT OCL and EMF-QTV




JPEG image