Spring support discussion
I thought I would start a thread to discuss the new spring support in the EAP.
Here's my first thoughts:
I love the autocompletion of property names and local references in the spring xml file. How about going even further with that by adding alt-insert support to do a batch property insert like adding getters/setters to a class? You could select all the properties of the bean you would like to add property setters for, then tab through each of the ref tags selecting the bean you would like to insert.
Please sign in to leave a comment.
Here's another one:
I love the checking of the types of the properties of a bean, however we use org.springframework.aop.framework.ProxyFactoryBean in many places. Each of these instances generates an error like this, "Bean must be of 'ClassName' type." Since the ProxyFactoryBean is part of the springframework, could you intelligently look inside the definition of beans of that type and look at the proxyInterfaces property to see what interfaces it supports?
Here's a question: what are file sets for?
Hello Evan,
It sound (a bit) like the "Insert...Dependency" feature:
http://www.jetbrains.net/jira/browse/IDEA-11095
I reported this today:
http://www.jetbrains.net/jira/browse/IDEA-11111
How do you think the editor should figure out the "produced type" of a given
bean factory?
Guys,
We're happy to have feature discussions here. But please make sure that
you submit a JIRA issue for each feature along with link to original
forum discussion. We don't want to loose all this stuff.
Where do you see "file sets" ? Isn't it a way to configure references that are not local similar to IdeaSpring's config sets ?
I can't find a way to configure that in jetbrains plugin :(
Yes I does sound quite similar. Is the difference that Insert...Dependency is done from the JavaClass itself, while the idea I was thinking of was from inside the spring xml file? Maybe the two are the same operation just performed in slightly different ways?
$ doesn't work either
Hello Vladimir,
Are you referring to PropertyPlaceholderConfigurer support?
http://www.jetbrains.net/jira/browse/IDEADEV-13522
Hello Maurice,
I was referring to the "Spring facet" configuration tab. I understand that
the set is used to resolve external references from a given context file.
But let me restate my question(s) in a better way:
-What is the use of defining multiple sets if there is no way to mark a
set as "current" or "active"?
-In the current implementation, what is the effect of adding a context file
to multiple sets?
That's a good question. I'm not sure if there is a generalizable solution since the configuration of each factorybean is different. A naive solution would be to special case the type checking for well known factory beans like the ones in the Spring and Hibernate libraries. Since IDEA already has support or planned support for both Spring and Hibernate, this wouldn't be out of the scope of current work I'd think.
Yes,
But the property file is unknown to Idea. it should taken care in the similar manner as DTDs for xml file (import external resource etc. )
]]>
<property name="location" value="$"/>
]]>
Taras,
Thanks as i was testing it with an old project i was not aware of the "Spring facet".
In the current implementation external references are not resolved on my test project. Does it work for you ?
Do we have somehere a graph with beans of a "file set" ?
Hello Maurice,
Yes, the "Add->Facet" functionality is very well hidden.
In addition, the "spring facet" leaf is added after all the other dependencies,
making it easy to overlook.
Yes, it does.
To be more explicit: using the facet configuration screen, I've added all
my context files to a single set.
I can navigate a bean reference (Ctrl-B, Ctrl-Click) to a definition of a
bean that is in a different context file than the current context file.
Yes, all context file editor have a second editor tab, labeled "Structure".
This graph view (yFiles?) seems to render every bean in the current set,
but I may be mistaken. It's also quite slow for me.
By the way, how did "config sets" work in your IdeaSpring plugin? What is
the effect of creating multiple config sets? What happens when files are
shared between sets? Why is it even possible to define multiple sets (if
there is no UI to select a 'current' set)?
Regards,
-tt
I see.
I suggest you add comments to IDEADEV-13522, asking to make this work if
a similar way to current resource key lookup for Java and JSP.
Well in IdeaSpring i should have talked about "Groups" instead of 'config sets" so you must see it as a way to group related config files together.
>> Do we have somehere a graph with beans of a "file set" ?
yes, it is very slow when it shows the full file set - also, the
structure tree for the Beans currently doesn't scroll :(
http://www.jetbrains.net/jira/browse/IDEA-11170
also, something similar to the "Autoscroll from/to source" would be
nice, ie. if I select a bean in the structure that it not only
highlights in the diagram but also makes sure it's in view (at lower
zoom levels).
http://www.jetbrains.net/jira/browse/IDEA-11171
a couple of other shortcomings:
"BeanPropertyInspection" the "datasource" property of
LocalSessionFactoryBean doesn't recognize JndiObjectFactoryBean ("Must
be of type DataSource"), same for the "jtaTransactionManager" property
http://www.jetbrains.net/jira/browse/IDEA-11172
same for sessionFactory and
"org.springframework.orm.hibernate3.LocalSessionFactoryBean"
Hi,
I'm trying to use the new spring facet thing.
And it seems adding a configuration file directly (not in a fileset) fails with a NullPointer Exception. Adding the same file in a fileset works ok
Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(1498,128),button=1,modifiers=Button1,clickCount=1] on dialog1
java.lang.NullPointerException
at com.intellij.spring.facet.SpringConfigurationTab$5.actionPerformed(SpringConfigurationTab.java:126)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:5501)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
at java.awt.Component.processEvent(Component.java:5266)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3968)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1778)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:110)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:120)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:114)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
at java.awt.Dialog$1.run(Dialog.java:525)
at java.awt.Dialog$2.run(Dialog.java:553)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Dialog.java:551)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:91)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:122)
at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:748)
at com.intellij.ide.actions.ShowSettingsUtilImpl.editConfigurable(ShowSettingsUtilImpl.java:36)
at com.intellij.openapi.roots.ui.configuration.ModulesConfigurator.showDialog(ModulesConfigurator.java:28)
at com.intellij.ide.actions.ShowModulePropertiesAction.actionPerformed(ShowModulePropertiesAction.java:10)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:5)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:64)
at com.intellij.ui.plaf.beg.BegMenuItemUI.a(BegMenuItemUI.java:51)
at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:34)
at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:4)
at java.awt.Component.processMouseEvent(Component.java:5501)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
at java.awt.Component.processEvent(Component.java:5266)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3968)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1778)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:110)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:120)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:114)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
is it just me, or does somebody else think the "injected" arrows in the
diagram should be drawn the other way around...?
right now I get arrows pointing to the bean that is injected, e.g.
myDao -
injected---> sessionFactory
which I would normally read as the "dao gets injected into the
factory", but of course it's the other way around, the shouldn't the
arrows look like
myDao <--
injected-- sessionFactorywhich would be more appropriate as "session factory gets injected into my dao"
...
O
Oliver,
I do ask you to select a component when you create an issue. It makes
issue tracking much more easier. And without it it's much more easier to
lost your feedback.
Filesets are at very early stage... Please wait for the next EAP.
From your description is does sound like its backwards.
Also, I'm finding that the graph is incredibly slow. It looks great, but with 81 beans, its too slow to zoom or drag around to be usable. :/
Hopefully that will improve before release!
If I would have to choose, I would prefer a "depends on" connection orientation:
"depender" -> (depends on) -> dependency
I think most spring visualiation tools follow this model:
http://www.samoht.com/wiki/wiki.pl?SpringViz
On 2007-01-23 11:07:42 -0600, Taras Tielkes <taras.tielkes@gmail.com> said:
agree, but then the label "injects" shouldn't be used
Hello Maurice,
Let's see if I understand this correctly...
In IdeaSpring, when I add various context files to various groups, the end
result (in terms of internal model) is just one big merged set, correct?
For instance, let's say I have context files A.xml, B.xml and C.xml. I add
them to groups like this:
Group 1
-A.xml
-B.xml
Group 2
-A.xml
-C.xml
If I understand things correctly, IdeaSpring will just merge this to one
set containing {A.xml, B.xml, C.xml}.
A consequence of this is that a bean in B.xml can refer to a bean in C.xml,
even though they are not in the same group.
Is this how IdeaSpring works?
Regards,
-tt
In article <5043899.1169235141099.JavaMail.itn@is.intellij.net>,
no_reply@jetbrains.com says...
How about AOP marking. For example, we get indicators for interfaces and
overridden class. how about for interfaces that have AOP interceptors
set up via configuration files.
Perhaps an 'A'. And when you click on it, you get a droplist where the
interceptors are listed in order.
Oh, and a graphical visualization of the beans.
--
-
David H. McCoy
-
It's planned
Already done.