Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 414299 - [Shell] Extra brackets in plugin object responses
Summary: [Shell] Extra brackets in plugin object responses
Status: RESOLVED WONTFIX
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Grant Gayed CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-02 08:32 EDT by Maciej Bendkowski CLA
Modified: 2015-05-05 16:17 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Bendkowski CLA 2013-08-02 08:32:47 EDT
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.
Comment 1 Grant Gayed CLA 2013-08-07 15:36:20 EDT
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).
Comment 2 Maciej Bendkowski CLA 2013-08-08 05:30:15 EDT
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?
Comment 3 Grant Gayed CLA 2013-08-08 15:39:25 EDT
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.
Comment 4 John Arthorne CLA 2015-05-05 16:17:56 EDT
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