Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Sapphire » Is it possible to bind to JSON rather than XML?
Is it possible to bind to JSON rather than XML? [message #1009085] Thu, 14 February 2013 11:59 Go to next message
Louis Morgan is currently offline Louis MorganFriend
Messages: 2
Registered: February 2013
Junior Member
Hi,

We have some services that require JSON configuration files, and recently a lot of our users have had issues creating valid configuration files. We think a good solution would be to create a graphical editor for the JSON files, and I was wondering if it would be possible to use Sapphire for this?

I've used Sapphire briefly in the past (0.4 timeframe I think), so I appreciate that it is designed to edit XML files, but I wondered how feasible it would be to add JSON support, and whether anyone had done anything like this already?

Thanks and best wishes,

--Louis
Re: Is it possible to bind to JSON rather than XML? [message #1009320 is a reply to message #1009085] Thu, 14 February 2013 22:30 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
The need to build editors for JSON files has been coming up more and more recently. There is nothing in Sapphire today to enable this, but the framework has a resource layer upon which the model sits that allows it to bind to a variety of data sources. XML binding is just one such resource implementation.

The first requirement in developing JSON support is a source editor that exposes a live JSON object model to which a Sapphire model can bind. I recently inquired if such editor exists in WTP. Haven't heard back yet, but I haven't had time to research this further.

Note that implementing resources is not restricted to the framework itself. Adopters can do this too, if so inclined. If you are interested in tackling this problem, take a look at how XML support is implemented. A good place to start looking is XmlResource class.

- Konstantin
Re: Is it possible to bind to JSON rather than XML? [message #1011123 is a reply to message #1009320] Mon, 18 February 2013 22:27 Go to previous messageGo to next message
Louis Morgan is currently offline Louis MorganFriend
Messages: 2
Registered: February 2013
Junior Member
Thanks Konstantin, I'll hopefully get a chance to have a proper look at XmlResource later in the week. I had a very brief look last week and was a bit overwhelmed at first, but I'll hopefully spend some more time looking at it this week.

I had a quick look for JSON editors, there doesn't seem to be an editor in WTP from what I can see. There seems to be a popular third party editor on sourceforge (which I can't link to), but it doesn't seem ideal.
Re: Is it possible to bind to JSON rather than XML? [message #1011134 is a reply to message #1011123] Mon, 18 February 2013 22:56 Go to previous message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
WTP does have JavaScript support (JSDT). It would be worth investigating whether WTP's JavaScript editor would work for editing JSON files.

- Konstantin
Previous Topic:Time to wrap up 0.5.4 and 0.6.1 releases
Next Topic:Use EL for Sapphire Validation
Goto Forum:
  


Current Time: Fri Mar 29 09:23:57 GMT 2024

Powered by FUDForum. Page generated in 0.02094 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top