Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » evl validation not working with gmf mindmap example(I have used the evl validation and followed the same procedure on Live validation and quick-fixes in GMF-based editors with EVL for mindmap project example but it is not working)
evl validation not working with gmf mindmap example [message #523416] Fri, 26 March 2010 11:37 Go to next message
sowmya Mising name is currently offline sowmya Mising nameFriend
Messages: 51
Registered: July 2009
Member
Hi

I applied the procedure under Live validation and quick-fixes in GMF-based editors with EVL ( http://www.eclipse.org/gmt/epsilon/doc/articles/evl-gmf-inte gration/ ) . with the gmf example project : mindmap project to validate the elements on the editor.

But the evl file validation does not happen. Can anybody please provide some help.


The elements in the mindmap example are Topic ,Resource , so on.

So I have modified the evl file as below :


*******************************************************
context Resource {

constraint HasName {

check : self.name.isDefined()

message : 'Unnamed ' + self.eClass().name + ' not allowed'

}

}

context Topic {

critique NameStartsWithCapital {

guard : self.satisfies('HasName')

check : self.name.firstToUpperCase() = self.name

message : 'Folder ' + self.name +
' should start with an upper-case letter'

fix {

title : 'Rename to ' + self.name.firstToUpperCase()

do {
self.name := self.name.firstToUpperCase();
}
}

}

}

*******************************************************



Additional details :


I am using eclipse 3.5 and jdk 1.6

mindmap example location as below:

cvs repository location --
host name : dev.eclipse.org
cvspath : /cvsroot/modeling
username :anonymous
password :

under head -> gmf-> examples -> check out the following :
org.eclipse.gmf.examples.mindmap
org.eclipse.gmf.examples.mindmap.diagram
org.eclipse.gmf.examples.mindmap.edit


After checking out :
To this I applied the procedure under 'Live validation and quick-fixes in GMF-based editors with EVL ' ( http://www.eclipse.org/gmt/epsilon/doc/articles/evl-gmf-inte gration/ ) .

I have made the manifest file changes to the manifest file in the org.eclipse.gmf.examples.mindmap.diagram package and created a new package contaning evl file under the 'src' in the org.eclipse.gmf.examples.mindmap.diagram package.

All the extension point changes also done to the org.eclipse.gmf.examples.mindmap.diagram package plugin file.

then launch a eclipse application runtime and create diagram file in general project. And I am trying to validate this diagram file.


Re: evl validation not working with gmf mindmap example [message #523421 is a reply to message #523416] Fri, 26 March 2010 07:32 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi,

Is validation turned on in the mindmap editor? If not, could you please
turn it on and give it another go?

> TIP: If you have not implemented your editor using EuGENia, before
you > start please make sure that you have turned on validation in your
> .gmfgen model. The flags you need to set to true are the Validation
> Enabled and Validation Decorators in the Gen Diagram.

Cheers,
Dimitris

sowmya wrote:
> Hi
> I applied the procedure under Live validation and quick-fixes in
> GMF-based editors with EVL
> ( http://www.eclipse.org/gmt/epsilon/doc/articles/evl-gmf-inte gration/ )
> . with the gmf example project : mindmap project to validate the
> elements on the editor.
> But the evl file validation does not happen. Can anybody please provide
> some help.
>
> The elements in the mindmap example are Topic ,Resource , so on.
>
> So I have modified the evl file as below :
>
>
> *******************************************************
> context Resource {
>
> constraint HasName {
>
> check : self.name.isDefined()
>
> message : 'Unnamed ' + self.eClass().name + ' not allowed'
>
> }
>
> }
>
> context Topic {
>
> critique NameStartsWithCapital {
>
> guard : self.satisfies('HasName')
>
> check : self.name.firstToUpperCase() = self.name
>
> message : 'Folder ' + self.name +
> ' should start with an upper-case letter'
>
> fix {
>
> title : 'Rename to ' + self.name.firstToUpperCase()
>
> do {
> self.name := self.name.firstToUpperCase();
> }
> }
>
> }
>
> }
>
> *******************************************************
>
>
>
> Additional details :
>
>
> I am using eclipse 3.5 and jdk 1.6
>
> mindmap example location as below:
>
> cvs repository location --
> host name : dev.eclipse.org
> cvspath : /cvsroot/modeling
> username :anonymous
> password :
> under head -> gmf-> examples -> check out the following :
> org.eclipse.gmf.examples.mindmap
> org.eclipse.gmf.examples.mindmap.diagram
> org.eclipse.gmf.examples.mindmap.edit
>
>
> After checking out : To this I applied the procedure under 'Live
> validation and quick-fixes in GMF-based editors with EVL '
> ( http://www.eclipse.org/gmt/epsilon/doc/articles/evl-gmf-inte gration/ ) .
> I have made the manifest file changes to the manifest file in the
> org.eclipse.gmf.examples.mindmap.diagram package and created a new
> package contaning evl file under the 'src' in the
> org.eclipse.gmf.examples.mindmap.diagram package.
>
> All the extension point changes also done to the
> org.eclipse.gmf.examples.mindmap.diagram package plugin file.
>
> then launch a eclipse application runtime and create diagram file in
> general project. And I am trying to validate this diagram file.
>
>
>


--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
Re: evl validation not working with gmf mindmap example [message #523681 is a reply to message #523421] Sun, 28 March 2010 16:26 Go to previous messageGo to next message
sowmya Mising name is currently offline sowmya Mising nameFriend
Messages: 51
Registered: July 2009
Member
Hi


Both the flags - Enabled and Validation Decorators have been turned on in the .gmfgen project. But when i click on the validate option under Diagram menu, there are no validation errors.

It isnot an editor created using EuGENia

I have aother question :

2> If an element is referring to an external file (audio/video/text) and the file is in another folder in the same project folder. I want to check if the referred file is present in that location or has been deleted. Is it possible to perform this type of validation also.

Regards
Sowmya
Re: evl validation not working with gmf m indmap example [message #523686 is a reply to message #523681] Sun, 28 March 2010 17:01 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi,

Please see comments below

sowmya <sowmyaraj53@gmail.com> wrote:
> Hi
>
>
> Both the flags - Enabled and Validation Decorators have been turned
> on in the .gmfgen project. But when i click on the validate option
> under Diagram menu, there are no validation errors.
>
> It isnot an editor created using EuGENia
>

Could you please send me your code at dskolovos gmail com so that I can
have a look?

> I have aother question :
>
> 2> If an element is referring to an external file (audio/video/text)
> and the file is in another folder in the same project folder. I want
> to check if the referred file is present in that location or has been
> deleted. Is it possible to perform this type of validation also.
>

This is possible but you'll need to implement a custom tool in java and
call it from EVL as per
http://eclipse.org/gmt/epsilon/doc/articles/call-java-from-e psilon/

> Regards Sowmya
>

Cheers,
Dimitris
Re: evl validation not working with gmf m indmap example [message #523916 is a reply to message #523686] Mon, 29 March 2010 19:38 Go to previous messageGo to next message
sowmya Mising name is currently offline sowmya Mising nameFriend
Messages: 51
Registered: July 2009
Member
Hi
I have mailed the project to gmail id. Please let me know if my mail has not reached by any chance.

And thanks for the reply on call java . I will explore it further.

Regards
Sowmya
Re: evl validation not working with gmf m indmap example [message #523931 is a reply to message #523916] Mon, 29 March 2010 21:27 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Sowmya,

The reason why the EVL constraints are not evaluated is that the wrong
namespace URI is specified in the constraint binding (it should be
http://www.example.org/mindmap instead of mindmap). Once the namespace
URI is set to http://www.example.org/mindmap, the constraints are
evaluated.

Note that there are a few errors in samplevalid.evl including a leftover
constraint on the Sync class from the filesystem example and a call to
satisfies("HasName") which produces an error as no HasName constraint
has been specified for Resource. Once you fix these it should all run fine.

Cheers,
Dimitris


sowmya wrote:
> Hi I have mailed the project to gmail id. Please let me know if my
> mail has not reached by any chance.
>
> And thanks for the reply on call java . I will explore it further.
>
> Regards
> Sowmya
Re: evl validation not working with gmf m indmap example [message #524271 is a reply to message #523931] Wed, 31 March 2010 11:35 Go to previous message
sowmya Mising name is currently offline sowmya Mising nameFriend
Messages: 51
Registered: July 2009
Member
Hi

Thanks a lot for the help on evl . It is working fine now.

I just have a doubt on copy paste of elements .Copy paste of elements does not work.

We had managed to solve this problem in gmf 2.2.0 by changing
resource type to XMI and
user uuid = true

But with the release of gmf 2.2.2 the copy paste does not work again.It would be really helpful if anybody could provide some suggestions on how to get this problem resolved or what could be changes that would have affected this feature or suggest any other eclipse feature/plugin that could help achieve copy paste of elements.

I am aware that this is not the gmf forum but if anybody has found some solution or workaround then it would be really helpful if u could share it.


Regards
Sowmya
Re: evl validation not working with gmf mindmap example [message #587769 is a reply to message #523416] Fri, 26 March 2010 12:08 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi,

Is validation turned on in the mindmap editor? If not, could you please
turn it on and give it another go?

> TIP: If you have not implemented your editor using EuGENia, before
you > start please make sure that you have turned on validation in your
> .gmfgen model. The flags you need to set to true are the Validation
> Enabled and Validation Decorators in the Gen Diagram.

Cheers,
Dimitris

sowmya wrote:
> Hi
> I applied the procedure under Live validation and quick-fixes in
> GMF-based editors with EVL
> ( http://www.eclipse.org/gmt/epsilon/doc/articles/evl-gmf-inte gration/ )
> . with the gmf example project : mindmap project to validate the
> elements on the editor.
> But the evl file validation does not happen. Can anybody please provide
> some help.
>
> The elements in the mindmap example are Topic ,Resource , so on.
>
> So I have modified the evl file as below :
>
>
> *******************************************************
> context Resource {
>
> constraint HasName {
>
> check : self.name.isDefined()
>
> message : 'Unnamed ' + self.eClass().name + ' not allowed'
>
> }
>
> }
>
> context Topic {
>
> critique NameStartsWithCapital {
>
> guard : self.satisfies('HasName')
>
> check : self.name.firstToUpperCase() = self.name
>
> message : 'Folder ' + self.name +
> ' should start with an upper-case letter'
>
> fix {
>
> title : 'Rename to ' + self.name.firstToUpperCase()
>
> do {
> self.name := self.name.firstToUpperCase();
> }
> }
>
> }
>
> }
>
> *******************************************************
>
>
>
> Additional details :
>
>
> I am using eclipse 3.5 and jdk 1.6
>
> mindmap example location as below:
>
> cvs repository location --
> host name : dev.eclipse.org
> cvspath : /cvsroot/modeling
> username :anonymous
> password :
> under head -> gmf-> examples -> check out the following :
> org.eclipse.gmf.examples.mindmap
> org.eclipse.gmf.examples.mindmap.diagram
> org.eclipse.gmf.examples.mindmap.edit
>
>
> After checking out : To this I applied the procedure under 'Live
> validation and quick-fixes in GMF-based editors with EVL '
> ( http://www.eclipse.org/gmt/epsilon/doc/articles/evl-gmf-inte gration/ ) .
> I have made the manifest file changes to the manifest file in the
> org.eclipse.gmf.examples.mindmap.diagram package and created a new
> package contaning evl file under the 'src' in the
> org.eclipse.gmf.examples.mindmap.diagram package.
>
> All the extension point changes also done to the
> org.eclipse.gmf.examples.mindmap.diagram package plugin file.
>
> then launch a eclipse application runtime and create diagram file in
> general project. And I am trying to validate this diagram file.
>
>
>


--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
Re: evl validation not working with gmf mindmap example [message #587841 is a reply to message #587769] Sun, 28 March 2010 16:26 Go to previous message
sowmya Mising name is currently offline sowmya Mising nameFriend
Messages: 51
Registered: July 2009
Member
Hi


Both the flags - Enabled and Validation Decorators have been turned on in the .gmfgen project. But when i click on the validate option under Diagram menu, there are no validation errors.

It isnot an editor created using EuGENia

I have aother question :

2> If an element is referring to an external file (audio/video/text) and the file is in another folder in the same project folder. I want to check if the referred file is present in that location or has been deleted. Is it possible to perform this type of validation also.

Regards
Sowmya
Re: evl validation not working with gmf m indmap example [message #587847 is a reply to message #587841] Sun, 28 March 2010 17:01 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi,

Please see comments below

sowmya <sowmyaraj53@gmail.com> wrote:
> Hi
>
>
> Both the flags - Enabled and Validation Decorators have been turned
> on in the .gmfgen project. But when i click on the validate option
> under Diagram menu, there are no validation errors.
>
> It isnot an editor created using EuGENia
>

Could you please send me your code at dskolovos gmail com so that I can
have a look?

> I have aother question :
>
> 2> If an element is referring to an external file (audio/video/text)
> and the file is in another folder in the same project folder. I want
> to check if the referred file is present in that location or has been
> deleted. Is it possible to perform this type of validation also.
>

This is possible but you'll need to implement a custom tool in java and
call it from EVL as per
http://eclipse.org/gmt/epsilon/doc/articles/call-java-from-e psilon/

> Regards Sowmya
>

Cheers,
Dimitris
Re: evl validation not working with gmf m indmap example [message #587933 is a reply to message #523686] Mon, 29 March 2010 19:38 Go to previous message
sowmya Mising name is currently offline sowmya Mising nameFriend
Messages: 51
Registered: July 2009
Member
Hi
I have mailed the project to gmail id. Please let me know if my mail has not reached by any chance.

And thanks for the reply on call java . I will explore it further.

Regards
Sowmya
Re: evl validation not working with gmf m indmap example [message #587941 is a reply to message #587933] Mon, 29 March 2010 21:27 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Sowmya,

The reason why the EVL constraints are not evaluated is that the wrong
namespace URI is specified in the constraint binding (it should be
http://www.example.org/mindmap instead of mindmap). Once the namespace
URI is set to http://www.example.org/mindmap, the constraints are
evaluated.

Note that there are a few errors in samplevalid.evl including a leftover
constraint on the Sync class from the filesystem example and a call to
satisfies("HasName") which produces an error as no HasName constraint
has been specified for Resource. Once you fix these it should all run fine.

Cheers,
Dimitris


sowmya wrote:
> Hi I have mailed the project to gmail id. Please let me know if my
> mail has not reached by any chance.
>
> And thanks for the reply on call java . I will explore it further.
>
> Regards
> Sowmya
Re: evl validation not working with gmf m indmap example [message #588067 is a reply to message #523931] Wed, 31 March 2010 11:35 Go to previous message
sowmya Mising name is currently offline sowmya Mising nameFriend
Messages: 51
Registered: July 2009
Member
Hi

Thanks a lot for the help on evl . It is working fine now.

I just have a doubt on copy paste of elements .Copy paste of elements does not work.

We had managed to solve this problem in gmf 2.2.0 by changing
resource type to XMI and
user uuid = true

But with the release of gmf 2.2.2 the copy paste does not work again.It would be really helpful if anybody could provide some suggestions on how to get this problem resolved or what could be changes that would have affected this feature or suggest any other eclipse feature/plugin that could help achieve copy paste of elements.

I am aware that this is not the gmf forum but if anybody has found some solution or workaround then it would be really helpful if u could share it.


Regards
Sowmya
Previous Topic:[Eugenia] FixGenModel leaves empty model, how to track down problem?
Next Topic:How to load two dependent models, change names in referenced types, and keep models consistent?
Goto Forum:
  


Current Time: Sun Dec 21 19:27:17 GMT 2014

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

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