Community
Participate
Working Groups
I created a console command which returnType is set to 'date'. In the command implementation, I return a new Date() object. The result is a proper date string within extra brackets, e. g. (Fri Aug 02 2013 14:28:35 GMT+0200 (Central European Standard Time)). Possibly related to bug 414298.
The Shell page does not expect to receive a Date object as a result, similar to how it does not expect to receive an html string to be rendered. To display a date string as a result you should return the string to display, not the Date object. (If I've mis-understood the original request then please follow up).
I get why HTML is generally forbidden as explained in bug 414298, however I cannot understand why Date objects are forbidden. Following the Orion documentation on how to plugin into the shell: 'The Shell page currently uses GCLI as its underlying shell widget, and consequently has adopted its syntax for parameter specification.' The GCLI documentation specifies various return types which might be used. As it turns out, actually only strings are supported (and link markup I guess). Since the documentation leads to bogus assumptions on how the shell works, I think it should be updated. I've opened bug 414649 for the documentation update. Nevertheless, I don't see any advantage in refusing Date as a return type. Especially since this would force developers to localize dates on their own and not rely on the GCLI mechanisms. Grant, is there a specific reason for forbidding date objects I'm not familiar right now?
It's nothing against Date objects specifically. The doc in our "Service methods" section states that the return type must be a string, blob or file object. The reference to mimicking GCLI's syntax/types is regarding parameter types, not return values. Currently all plugged-in commands return string values as far as GCLI is concerned, and if a blob or file object is returned instead then the Shell page handles it. I can investigate what returning a Date object to be processed by GCLI would give.
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see: https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html