Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » Invalid Model Path(Invalid Model Path)
Invalid Model Path [message #710444] Thu, 04 August 2011 22:44 Go to next message
Kamesh Sampath is currently offline Kamesh Sampath
Messages: 213
Registered: July 2009
Senior Member
Hello,

I have an xml model like this,
<person id="101">
<name/>
<address/>
</person>

I am trying to model the same, my Person Model class looks like the one below,

public class Person implements IModelElement{

        /*
	 * id
	 */

	@Label( standard = "Id" )
	@NoDuplicates
	@XmlBinding( path = "@id" )
	@Whitespace( trim = true )
	ValueProperty PROP_ID = new ValueProperty( TYPE, "Id" );

	Value<String> getId();

	void setId( String id );

       .....

}



When I run my application i see the following statements in the log as

ERROR : Invalid model path "#/Id" evaluated on com.x.model.IPerson.

Can any one let me know how to rectify this error, or i have missed something.
Re: Invalid Model Path [message #710980 is a reply to message #710444] Fri, 05 August 2011 12:48 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 937
Registered: July 2009
Senior Member
The is caused by a bug that was fixed in 0.3.1 stream. The issue is that @NoDuplicates annotation is only defined when the element is a child of a list property. You get an error like the one you've posted if you instantiate that element in any other context.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=351766

If you need to use the element with @NoDuplicates property in a list as well as in another context, you can download 0.3.1 stream builds from this location:

https://hudson.eclipse.org/hudson/job/sapphire-0.3.x/lastSuccessfulBuild/artifact/build/

- Konstantin
Re: Invalid Model Path [message #711279 is a reply to message #710980] Fri, 05 August 2011 20:44 Go to previous messageGo to next message
Kamesh Sampath is currently offline Kamesh Sampath
Messages: 213
Registered: July 2009
Senior Member
First of all thanks for creating such a wonderful framework, its really awesome. I have some thoughts or ideas to share,

1. Can't we not add a model generating tool for generating the Sapphire Model ? e.g. XSD --> EMF --> Model2Model tools --> Sapphire Model ?
2. Extending new Java Class Wizard to create a IModel Element class with properties added
Re: Invalid Model Path [message #711774 is a reply to message #711279] Sat, 06 August 2011 12:26 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 937
Registered: July 2009
Senior Member
> 1. Can't we not add a model generating tool for generating the Sapphire Model ?
> e.g. XSD --> EMF --> Model2Model tools --> Sapphire Model ?

This gets asked periodically. I am not a big fan of XSD to model automatic generation. There is too much noise in the XSD that is indistinguishable from semantic information, so an automated tool is very unlikely to produce a model that's any good. Refactoring an automatically generated model into good form can take as much work as writing one from scratch.

> 2. Extending new Java Class Wizard to create a IModel Element class with properties added

I can see a "new Sapphire Model Element Interface" wizard being useful. Go ahead an open an enhancement request so that we can track it.

- Konstantin
Re: Invalid Model Path [message #711775 is a reply to message #711774] Sat, 06 August 2011 12:28 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 937
Registered: July 2009
Senior Member
Forgot to mention... Sapphire SDK does include code completions to make writing Sapphire models easier. Just type "sf" followed by ctrl+space.

- Konstantin
Re: Invalid Model Path [message #711800 is a reply to message #711775] Sat, 06 August 2011 13:05 Go to previous messageGo to next message
Kamesh Sampath is currently offline Kamesh Sampath
Messages: 213
Registered: July 2009
Senior Member
Thanks Konstantin, i am right now using that sf+ctrl+space and finding it useful. But we need to tweak the templates to include the Binding + JavaNamespace stuff. I guess its on cards for 0.4.0
Re: Invalid Model Path [message #711838 is a reply to message #711800] Sat, 06 August 2011 13:57 Go to previous messageGo to next message
Kamesh Sampath is currently offline Kamesh Sampath
Messages: 213
Registered: July 2009
Senior Member
I have opened a bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=354075 for this improvement
Re: Invalid Model Path [message #712033 is a reply to message #711800] Sat, 06 August 2011 20:07 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 937
Registered: July 2009
Senior Member
> i am right now using that sf+ctrl+space and finding it useful. But we
> need to tweak the templates to include the Binding + JavaNamespace stuff.

The XML binding annotations aren't included in the template because XML binding isn't the only scenario. What is "JavaNamespace"?

- Konstantin
Re: Invalid Model Path [message #712039 is a reply to message #712033] Sat, 06 August 2011 20:12 Go to previous messageGo to next message
Kamesh Sampath is currently offline Kamesh Sampath
Messages: 213
Registered: July 2009
Senior Member
Sorry I misspelled i was suppose to say JavaName for using Java Classes Smile.

Quote:

The XML binding annotations aren't included in the template because XML binding isn't the only scenario. What is "JavaNamespace"?

- Konstantin

Do you have any blog/wiki/article which explains which could explain various annotations and scenarios where that could be added/used

~Kamesh
Re: Invalid Model Path [message #713601 is a reply to message #712039] Mon, 08 August 2011 12:30 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 937
Registered: July 2009
Senior Member
> Do you have any blog/wiki/article which explains which could explain various
> annotations and scenarios where that could be added/used

All the available docs are in Sapphire Developer Guide in Eclipse help once you install Sapphire SDK. They are also mirrored on the web (same content):

http://www.eclipse.org/sapphire/documentation/latest/index.html

The docs aren't complete yet, but are getting better. If a feature is fairly new, you can get a pretty good intro to it by reading the enhancements doc that is included in every release.

http://www.eclipse.org/sapphire/documentation/latest/releases/0.3/enhancements.html
http://www.eclipse.org/sapphire/documentation/latest/releases/0.2/enhancements.html

In addition to the docs and probably the best ways to learn Sapphire is the samples project. In particular, take a look at the gallery sample, which tries to show many/most of Sapphire features in one place.

- Konstantin
Re: Invalid Model Path [message #713734 is a reply to message #713601] Mon, 08 August 2011 19:17 Go to previous message
Kamesh Sampath is currently offline Kamesh Sampath
Messages: 213
Registered: July 2009
Senior Member
Thats right and I have been using the Samples project to find out each and every feature that i might need and honestly they are very useful Smile

~Kamesh
Previous Topic:Underlying Control
Next Topic:Good idea, but ...
Goto Forum:
  


Current Time: Sat Aug 02 00:52:55 EDT 2014

Powered by FUDForum. Page generated in 0.08151 seconds