Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MoDisco » Any possibility to filter certain Java files from discoverer?
Any possibility to filter certain Java files from discoverer? [message #501417] Wed, 02 December 2009 09:06 Go to next message
Jan Mauersberger is currently offline Jan MauersbergerFriend
Messages: 120
Registered: July 2009
Senior Member
I'm using the MoDisco J2SE5 discover to extract a EMF model from my Java
project. AFAIK The discoverer is automatically analyzing all Java
sources available in the project. In my scenario there are some source
files that are out of scope of the evaluation and it would make sense to
exclude them from the discoverer from the beginning (rather than
excluding the extracted classes later during model analysis).

Is there any way to define a list of files to exclude or to contribute
some exclude filter to MoDisco? I'm using the latest release 0.7.1.

Thanks in advance
Jan
Re: Any possibility to filter certain Java files from discoverer? [message #501492 is a reply to message #501417] Wed, 02 December 2009 14:51 Go to previous messageGo to next message
Fabien Giquel is currently offline Fabien GiquelFriend
Messages: 147
Registered: July 2009
Senior Member
Hi Jan,

until now there is no way for filtering some java files neither for 'J2SE5 discoverer' nor 'Java discoverer'.
We recently have worked on parameterizing the 'Java' discoverer (not the 'J2SE5' one). But we did not implement .java files filters.
So such a contribution would be welcome !

Here are some informations about Java discoverers implementation :

If you get the sources for the org.eclipse.gmt.modisco.java.features (0.7.0), you will notice that :
- A DiscoverJavaModelFromJavaProject class waits for a DiscoveryParametersBean parameter which allows to indicate which artefacts should be analysed (selected project + some .jar from classpath of the selected project + some projects referenced from the selected project...etc)
- Using the discoverer from the popup menu will open a window, implemented in JavaWizard class, which allows the end user to select the artefacts.

So if you wish to contribute for filtering .java files, it seems to me that it will now better fit in the 'Java' discoverer than the 'J2SE5' one, with two levels of achievment :
- Completing 'DiscoveryParametersBean' for storing .java files filters (might be java packages filters i think), and modifying the 'DiscoverJavaModelFromJavaProject' for getting this new parameter and giving it to the basic 'JavaReader' class (in options Map) which would actually apply the filter.
- Additionally (and optionnally) completing the JavaWizard to allow the end user to indicate the Java classes/packages filter to apply from the popup menu.

If you are interested, it would be great to receive such a contribution in a patch submitted in bugzilla.

Best regards,


----------------------------------------------------
Fabien GIQUEL
R&D Engineer
Mia-Software
rue Nina Simone
44000 NANTES
----------------------------------------------------
Re: Any possibility to filter certain Java files from discoverer? [message #501521 is a reply to message #501492] Wed, 02 December 2009 15:56 Go to previous messageGo to next message
Jan Mauersberger is currently offline Jan MauersbergerFriend
Messages: 120
Registered: July 2009
Senior Member
Fabien,

thanks for the quick reply and the valuable hints.
I will switch to the Java discoverer and and check the mentioned
possibilities. I'm using MoDisco currently in an evaluation phase but in
case it comes to an implementation we may contribute some results to the
MoDisco project.

Thanks Jan

> Hi Jan,
>
> until now there is no way for filtering some java files neither for
> 'J2SE5 discoverer' nor 'Java discoverer'. We recently have worked on
> parameterizing the 'Java' discoverer (not the 'J2SE5' one). But we did
> not implement .java files filters.
> So such a contribution would be welcome !
>
> Here are some informations about Java discoverers implementation :
> [...]
Re: Any possibility to filter certain Java files from discoverer? [message #502059 is a reply to message #501417] Sat, 05 December 2009 00:55 Go to previous messageGo to next message
Romain Dervaux is currently offline Romain DervauxFriend
Messages: 40
Registered: July 2009
Member
Hi, I developed the feature requested by Jan.
I added a entry field on the Java wizard which allows the user to enter the packages and types to exclude from analysis.

I made some screenshots.


On this first example, the user will filter org.eclipse.* packages and types.
http://img709.imageshack.us/img709/7523/92248284.png

Second image shows the resulting model.
http://img704.imageshack.us/img704/1482/63613268.png


On this second example, we filter the test package and the class org.eclipse.ClassInEclipsePackage.
http://img704.imageshack.us/img704/6167/19181036.png

Result :
http://img687.imageshack.us/img687/2706/34154973.png


Hope that's what you want.
Waiting for your comments.


PS : There is a problem with the SVN version of the Java Discoverer.
I get this exception :
java.lang.UnsupportedOperationException
	at java.util.AbstractMap.put(Unknown Source)
	at org.eclipse.gmt.modisco.java.actions.DiscoverJavaModelFromJavaProject.discoverElement(DiscoverJavaModelFromJavaProject.java:231)
	at org.eclipse.gmt.modisco.discoverersmanager.handlers.DiscovererHandler.discoverElement(DiscovererHandler.java:131)
	at org.eclipse.gmt.modisco.discoverersmanager.ui.actions.MenuListenerHandler$1.run(MenuListenerHandler.java:69)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)


That's because org.eclipse.gmt.modisco.discoverersmanager.ui.actions.MenuLi stenerHandler.widgetSelected(SelectionEvent) instantiates a Map via Collections.emptyMap(); but it is immutable, so we can't put parameters in it. Instantiating a classic HashMap solves the problem.
Re: Any possibility to filter certain Java files from discoverer? [message #502207 is a reply to message #502059] Mon, 07 December 2009 09:07 Go to previous messageGo to next message
Fabien Giquel is currently offline Fabien GiquelFriend
Messages: 147
Registered: July 2009
Senior Member
Hi Romain,

thanks for this work. I think it will fit our needs.
The next step is to submit it in a patch on org.eclipse.gmt.modisco.java.discoverer via bugzilla.

The 'UnsupportedOperationException' has been fixed on the SVN. Thanks for reporting it.

Regards,


----------------------------------------------------
Fabien GIQUEL
R&D Engineer
Mia-Software
rue Nina Simone
44000 NANTES
----------------------------------------------------
Re: Any possibility to filter certain Java files from discoverer? [message #502353 is a reply to message #501417] Mon, 07 December 2009 20:00 Go to previous messageGo to next message
Romain Dervaux is currently offline Romain DervauxFriend
Messages: 40
Registered: July 2009
Member
Bug created : https://bugs.eclipse.org/bugs/show_bug.cgi?id=297122
Re: Any possibility to filter certain Java files from discoverer? [message #502455 is a reply to message #502059] Tue, 08 December 2009 10:44 Go to previous messageGo to next message
Jan Mauersberger is currently offline Jan MauersbergerFriend
Messages: 120
Registered: July 2009
Senior Member
Romain,

thanks for this quick action! It's exactly what I did want. The 5th
December was my birthday so I assume you must be psychic :-)

Is this function only available in the wizard or also via API? We
currently trigger the discoverer also in our own operation.

Jan

> Hi, I developed the feature requested by Jan.
> I added a entry field on the Java wizard which allows the user to enter
> the packages and types to exclude from analysis.
>
> I made some screenshots.
Re: Any possibility to filter certain Java files from discoverer? [message #502459 is a reply to message #502455] Tue, 08 December 2009 11:41 Go to previous messageGo to next message
Romain Dervaux is currently offline Romain DervauxFriend
Messages: 40
Registered: July 2009
Member
Jan Mauersberger a écrit :
> Romain,
>
> thanks for this quick action! It's exactly what I did want. The 5th
> December was my birthday so I assume you must be psychic :-)
>
> Is this function only available in the wizard or also via API? We
> currently trigger the discoverer also in our own operation.
>
> Jan
>
>> Hi, I developed the feature requested by Jan.
>> I added a entry field on the Java wizard which allows the user to
>> enter the packages and types to exclude from analysis.
>>
>> I made some screenshots.

Happy birthday !

I followed Fabien's instructions. I used the DiscoveryParametersBean
object (which is then used by the JavaReader) to store the collection of
packages and types names.
So i suppose we can say it is API :)
Re: Any possibility to filter certain Java files from discoverer? [message #502939 is a reply to message #502459] Thu, 10 December 2009 11:28 Go to previous messageGo to next message
Jan Mauersberger is currently offline Jan MauersbergerFriend
Messages: 120
Registered: July 2009
Senior Member
Romain,

I assume I have to use the latest nightly builds to get the new feature,
right? However, I'm not able to install the features from either the
nightly update site nor any downloaded archived update site. The update
manager complains that the "org.eclipse.gmt.modisco.omg.kdm" is not
found either online or in the archived site.

Any idea? Do I have to download the source and build it for myself?
I would like to avoid that ;-)

Jan

> I followed Fabien's instructions. I used the DiscoveryParametersBean
> object (which is then used by the JavaReader) to store the collection of
> packages and types names.
> So i suppose we can say it is API :)
>
Re: Any possibility to filter certain Java files from discoverer? [message #503045 is a reply to message #501417] Thu, 10 December 2009 16:38 Go to previous messageGo to next message
Romain Dervaux is currently offline Romain DervauxFriend
Messages: 40
Registered: July 2009
Member
I don't have access to any update site due to restricted internet connection.

I downloaded the modeling edition of Galileo & the "SDK (Runtime, Source)" in "I200912090930 (2009/12/09)" in the "0.8.0 Integration Builds" section of this page : http://www.eclipse.org/gmt/modisco/downloads/

I extracted the zip of MoDisco in the Eclipse folder and i had the Java discoverer up & running with the filtering feature. Smile

[Updated on: Thu, 10 December 2009 16:39]

Report message to a moderator

Re: Any possibility to filter certain Java files from discoverer? [message #573864 is a reply to message #501417] Wed, 02 December 2009 14:51 Go to previous messageGo to next message
Fabien Giquel is currently offline Fabien GiquelFriend
Messages: 147
Registered: July 2009
Senior Member
Hi Jan,

until now there is no way for filtering some java files neither for 'J2SE5 discoverer' nor 'Java discoverer'.
We recently have worked on parameterizing the 'Java' discoverer (not the 'J2SE5' one). But we did not implement .java files filters.
So such a contribution would be welcome !

Here are some informations about Java discoverers implementation :

If you get the sources for the org.eclipse.gmt.modisco.java.features (0.7.0), you will notice that :
- A DiscoverJavaModelFromJavaProject class waits for a DiscoveryParametersBean parameter which allows to indicate which artefacts should be analysed (selected project + some .jar from classpath of the selected project + some projects referenced from the selected project...etc)
- Using the discoverer from the popup menu will open a window, implemented in JavaWizard class, which allows the end user to select the artefacts.

So if you wish to contribute for filtering .java files, it seems to me that it will now better fit in the 'Java' discoverer than the 'J2SE5' one, with two levels of achievment :
- Completing 'DiscoveryParametersBean' for storing .java files filters (might be java packages filters i think), and modifying the 'DiscoverJavaModelFromJavaProject' for getting this new parameter and giving it to the basic 'JavaReader' class (in options Map) which would actually apply the filter.
- Additionally (and optionnally) completing the JavaWizard to allow the end user to indicate the Java classes/packages filter to apply from the popup menu.

If you are interested, it would be great to receive such a contribution in a patch submitted in bugzilla.

Best regards,
--
----------------------------------------------------
Fabien GIQUEL
R&D Engineer
mailto:fgiquel@mia-software.com
Mia-Software
4, rue du Château de l'Eraudiere
44324 NANTES CEDEX 03
----------------------------------------------------


----------------------------------------------------
Fabien GIQUEL
R&D Engineer
Mia-Software
rue Nina Simone
44000 NANTES
----------------------------------------------------
Re: Any possibility to filter certain Java files from discoverer? [message #573893 is a reply to message #501492] Wed, 02 December 2009 15:56 Go to previous messageGo to next message
Jan Mauersberger is currently offline Jan MauersbergerFriend
Messages: 120
Registered: July 2009
Senior Member
Fabien,

thanks for the quick reply and the valuable hints.
I will switch to the Java discoverer and and check the mentioned
possibilities. I'm using MoDisco currently in an evaluation phase but in
case it comes to an implementation we may contribute some results to the
MoDisco project.

Thanks Jan

> Hi Jan,
>
> until now there is no way for filtering some java files neither for
> 'J2SE5 discoverer' nor 'Java discoverer'. We recently have worked on
> parameterizing the 'Java' discoverer (not the 'J2SE5' one). But we did
> not implement .java files filters.
> So such a contribution would be welcome !
>
> Here are some informations about Java discoverers implementation :
> [...]
Re: Any possibility to filter certain Java files from discoverer? [message #573903 is a reply to message #501417] Sat, 05 December 2009 00:56 Go to previous messageGo to next message
Romain Dervaux is currently offline Romain DervauxFriend
Messages: 40
Registered: July 2009
Member
Hi, I developed the feature requested by Jan.
I added a entry field on the Java wizard which allows the user to enter the packages and types to exclude from analysis.

I made some screenshots.


On this first example, the user will filter org.eclipse.* packages and types.
http://img709.imageshack.us/img709/7523/92248284.png

Second image shows the resulting model.
http://img704.imageshack.us/img704/1482/63613268.png


On this second example, we filter the test package and the class org.eclipse.ClassInEclipsePackage.
http://img704.imageshack.us/img704/6167/19181036.png

Result :
http://img687.imageshack.us/img687/2706/34154973.png


Hope that's what you want.
Waiting for your comments.


PS : There is a problem with the SVN version of the Java Discoverer.
I get this exception :
java.lang.UnsupportedOperationException
at java.util.AbstractMap.put(Unknown Source)
at org.eclipse.gmt.modisco.java.actions.DiscoverJavaModelFromJa vaProject.discoverElement(DiscoverJavaModelFromJavaProject.j ava:231)
at org.eclipse.gmt.modisco.discoverersmanager.handlers.Discover erHandler.discoverElement(DiscovererHandler.java:131)
at org.eclipse.gmt.modisco.discoverersmanager.ui.actions.MenuLi stenerHandler$1.run(MenuListenerHandler.java:69)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

That's because org.eclipse.gmt.modisco.discoverersmanager.ui.actions.MenuLi stenerHandler.widgetSelected(SelectionEvent) instantiates a Map via Collections.emptyMap(); but it is immutable, so we can't put parameters in it. Instantiating a classic HashMap solves the problem.
Re: Any possibility to filter certain Java files from discoverer? [message #573932 is a reply to message #573903] Mon, 07 December 2009 09:07 Go to previous messageGo to next message
Fabien Giquel is currently offline Fabien GiquelFriend
Messages: 147
Registered: July 2009
Senior Member
Hi Romain,

thanks for this work. I think it will fit our needs.
The next step is to submit it in a patch on org.eclipse.gmt.modisco.java.discoverer via bugzilla.

The 'UnsupportedOperationException' has been fixed on the SVN. Thanks for reporting it.

Regards,
--
----------------------------------------------------
Fabien GIQUEL
R&D Engineer
mailto:fgiquel@mia-software.com
Mia-Software
4, rue du Château de l'Eraudiere
44324 NANTES CEDEX 03
----------------------------------------------------


----------------------------------------------------
Fabien GIQUEL
R&D Engineer
Mia-Software
rue Nina Simone
44000 NANTES
----------------------------------------------------
Re: Any possibility to filter certain Java files from discoverer? [message #573950 is a reply to message #501417] Mon, 07 December 2009 20:00 Go to previous messageGo to next message
Romain Dervaux is currently offline Romain DervauxFriend
Messages: 40
Registered: July 2009
Member
Bug created : https://bugs.eclipse.org/bugs/show_bug.cgi?id=297122
Re: Any possibility to filter certain Java files from discoverer? [message #573981 is a reply to message #573903] Tue, 08 December 2009 10:44 Go to previous messageGo to next message
Jan Mauersberger is currently offline Jan MauersbergerFriend
Messages: 120
Registered: July 2009
Senior Member
Romain,

thanks for this quick action! It's exactly what I did want. The 5th
December was my birthday so I assume you must be psychic :-)

Is this function only available in the wizard or also via API? We
currently trigger the discoverer also in our own operation.

Jan

> Hi, I developed the feature requested by Jan.
> I added a entry field on the Java wizard which allows the user to enter
> the packages and types to exclude from analysis.
>
> I made some screenshots.
Re: Any possibility to filter certain Java files from discoverer? [message #574014 is a reply to message #502455] Tue, 08 December 2009 11:41 Go to previous messageGo to next message
Romain Dervaux is currently offline Romain DervauxFriend
Messages: 40
Registered: July 2009
Member
Jan Mauersberger a écrit :
> Romain,
>
> thanks for this quick action! It's exactly what I did want. The 5th
> December was my birthday so I assume you must be psychic :-)
>
> Is this function only available in the wizard or also via API? We
> currently trigger the discoverer also in our own operation.
>
> Jan
>
>> Hi, I developed the feature requested by Jan.
>> I added a entry field on the Java wizard which allows the user to
>> enter the packages and types to exclude from analysis.
>>
>> I made some screenshots.

Happy birthday !

I followed Fabien's instructions. I used the DiscoveryParametersBean
object (which is then used by the JavaReader) to store the collection of
packages and types names.
So i suppose we can say it is API :)
Re: Any possibility to filter certain Java files from discoverer? [message #574038 is a reply to message #502459] Thu, 10 December 2009 11:28 Go to previous messageGo to next message
Jan Mauersberger is currently offline Jan MauersbergerFriend
Messages: 120
Registered: July 2009
Senior Member
Romain,

I assume I have to use the latest nightly builds to get the new feature,
right? However, I'm not able to install the features from either the
nightly update site nor any downloaded archived update site. The update
manager complains that the "org.eclipse.gmt.modisco.omg.kdm" is not
found either online or in the archived site.

Any idea? Do I have to download the source and build it for myself?
I would like to avoid that ;-)

Jan

> I followed Fabien's instructions. I used the DiscoveryParametersBean
> object (which is then used by the JavaReader) to store the collection of
> packages and types names.
> So i suppose we can say it is API :)
>
Re: Any possibility to filter certain Java files from discoverer? [message #574063 is a reply to message #501417] Thu, 10 December 2009 16:39 Go to previous message
Romain Dervaux is currently offline Romain DervauxFriend
Messages: 40
Registered: July 2009
Member
I don't access to any update site due to restricted internet connection.

I downloaded the modeling edition of Galileo & the "SDK (Runtime, Source)" in "I200912090930 (2009/12/09)" in the "0.8.0 Integration Builds" section of this page : http://www.eclipse.org/gmt/modisco/downloads/

I extracted the zip of MoDisco in the Eclipse file and i had the Java discoverer up & running with the filtering feature.
Previous Topic:Any possibility to filter certain Java files from discoverer?
Next Topic:EclipseCon talk proposal
Goto Forum:
  


Current Time: Fri Mar 29 08:56:06 GMT 2024

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

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

Back to the top