Ctrl-click navigation with Spring custom namespaces

Hello

We're using Spring custom namespaces in our project. IDEA offers a great support for ctrl-click navigation within Spring configuration files. Unfortunately, this feature is not working for me in the case of our custom namespaces, while it works perfect for Spring Webflow custom namespaces.

For example, having a following definitions I can navigate with ctrl-click from ref="flowExecutor" to the definition of flowExecutor.

]]>

But, when using our custom namespace, I'm unable to navigate not from ref="amTestService" to the definition of the amTestService, nor from property name="simpleProperty" to the simpleProperty definition in SampleService.java

simpleStringValue The mechanism of Spring custom namespaces is working in runtime and custom namespace validation is enabled. Our xsd schema is ]]>

What I am doing wrong?

Thanks,
Boris Kirzner

8 comments
Comment actions Permalink

Are your custom beans actually parsed, which means, they are visible in
structure view, for example? Aren't there any warnings on their tags?

0
Comment actions Permalink

I don't see any warnings.
They do appear in structure view (see screenshots).
The beans also appear in "Dependency" view (see attached screenshot), but autowired dependencies are not shown ("Show autowired dependencies" option is enabled).

Our custom bean definition parser:

public class ServiceBeanDefinitionParser extends AbstractSingleBeanDefinitionParser {

private static final String CLASS = "class";

protected String getBeanClassName(Element element) {
return element.getAttribute(CLASS);
}

protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
AbstractBeanDefinition definition = builder.getBeanDefinition();
parserContext.getDelegate().parsePropertyElements(element, definition);
parserContext.getDelegate().parseQualifierElements(element, definition);
super.doParse(element, parserContext, builder);
}
}


Is there way to somehow trace the bean definition processing inside IDEA? Will the complete example in attachment help?

Thanks,
Boris Kirzner



Attachment(s):
am_namesapce.PNG
am_namesapce_structure1.PNG
am_namesapce_structure2.PNG
0
Comment actions Permalink

Boris, I think a complete example (attached here or in JIRA) will really help.

0
Comment actions Permalink

Hello
Attached is a minimalistic example.
It contains three projects:

  • amadesa-spring: contains custom schema, namespace handlers, bean definition parsers, etc.

  • amadesa-spring-test: contains test ensuring custom configuration is working

  • workspace: aggregation project for easier work


To see the problem:
1) Open workspace project in IDEA
2) Navigate to applicationContext-amadesa.xml file in amadesa-spring-test project
3) Enable custom namespaces validation
4) Try to Ctrl-click navigation on bean's properties (both ref navigation and source code navigations are not working)


Thanks,
Boris



Attachment(s):
IdeaCustomNamespacesNavigation.zip
0
Comment actions Permalink

Boris Kirzner wrote:

Hello
Attached is a minimalistic example.
It contains three projects:

  • amadesa-spring: contains custom schema, namespace handlers, bean definition parsers, etc.

  • amadesa-spring-test: contains test ensuring custom configuration is working

  • workspace: aggregation project for easier work


To see the problem:
1) Open workspace project in IDEA
2) Navigate to applicationContext-amadesa.xml file in amadesa-spring-test project
3) Enable custom namespaces validation
4) Try to Ctrl-click navigation on bean's properties (both ref navigation and source code navigations are not working)


Thanks,
Boris


OK, got it. Your property tag isn't something that is recognized as
Spring property tag by IntelliJ IDEA. In fact it's your implementation
detail. OTOH since your properties are from Spring namespace, their
recognition is possible. This can be implemented in Diana. You can
create a JIRA feature request for it.

0
Comment actions Permalink

Thanks for our answer, Peter.

Let me understand the feature limitations a bit more, since custom namespaces usability is a vital question for us.
Assuming we're taking am: Spring custom namespace as an example, there are three possible navigation directions:

  • Navigation from property of bean defined in am: namespace to bean id defined in am: namespace

  • Navigation from property of bean defined in am: namespace to standard Spring bean id

  • Navigation from standard Spring bean property to bean id defined in am: namespace


None of these are working for me in 7.0.3 for am: namespace, but all three are working for webflow: namespace. Does that mean that IDEA currently supports only "standard custom" Spring namespaces (i.e. those defined by Spring)?

Should any of the features above for for am: namespace in 7.0.3?

Thanks,
Boiris

0
Comment actions Permalink

Let me understand the feature limitations a bit more, since custom namespaces usability is a vital question for us.
Assuming we're taking am: Spring custom namespace as an example, there are three possible navigation directions:

  • Navigation from property of bean defined in am: namespace to bean id defined in am: namespace

  • Navigation from property of bean defined in am: namespace to standard Spring bean id

  • Navigation from standard Spring bean property to bean id defined in am: namespace

First two are not supported in general, the last one should work. Also
bean class is checked when bean is referenced in standard Spring contexts.

None of these are working for me in 7.0.3 for am: namespace, but all three are working for webflow: namespace. Does that mean that IDEA currently supports only "standard custom" Spring namespaces (i.e. those defined by Spring)?

In fact 7.0.3 doesn't have any webflow support, so the fact that
something is working means that it's custom namespace handler support,
the custom handlers are run and do what they are supposed to do.

0
Comment actions Permalink

Thank you Peter.

Opened feature request:

0

Please sign in to leave a comment.