History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-22180
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Peter Gromov
Reporter: Taras Tielkes
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

schema annotations not working

Created: 01 Oct 07 22:49   Updated: 06 Dec 07 18:50
Component/s: J2EE.Spring
Fix Version/s: Selena 7.0.2

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: 1. Java Archive File myns.jar (3 kb)


Build: 7,312
Fixed in build: 7,506


 Description  « Hide
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">

  <bean class="org.springframework.jdbc.datasource.DataSourceTransactionManager" id="txManName"/>
  
  <tx:advice transaction-manager="|"/>
  
</beans>

Tested using spring 2.1m4.
Caret location marked with "|". Invoke completion.
Expected: "txManName" (because of IDEADEV-20604)
Observed: "transactionManager" (because of IDEADEV-21440)

Should namespace implementations provided by IDEA take advantage of annotations, or is a code solution like com.intellij.spring.model.xml.aop.AdviceBeanConverter preferred?



 All   Comments   Work Log   Change History      Sort Order:
Taras Tielkes - 01 Oct 07 22:55
In another case I also failed to get annotation-driven bean name completion working with another third-party namespace.
The relevant attribute declaration looked like:
<xsd:element name="someElement">                                
  <xsd:complexType>                                            
    <xsd:attribute name="flag" type="xsd:boolean"/>         
    <xsd:attribute name="tx" type="txRefType" use="required"/>
  </xsd:complexType>                                           
</xsd:element>                                                 

<xsd:simpleType name="txRefType">                                                              
  <xsd:annotation>                                                                             
    <xsd:appinfo>                                                                              
      <tool:annotation kind="ref">                                                             
        <tool:expected-type type="org.springframework.transaction.PlatformTransactionManager"/>
      </tool:annotation>                                                                       
    </xsd:appinfo>                                                                             
  </xsd:annotation>                                                                            
  <xsd:union memberTypes="xsd:string"/>                                                        
</xsd:simpleType>

Taras Tielkes - 03 Oct 07 15:24
Peter, I filed this JIRA issue before the email discussion "Adding support for additional namespaces".

1) So for <tx:advice> problem from JIRA description I guess be solution would be to create something like a 'AnnotatedTypeBeanConverter' and annotate com.intellij.spring.model.xml.tx.AnnotationDriven#getTransactionManager and com.intellij.spring.model.xml.tx.Advice#getTransactionManager?

Such a solution would really help implementing support for "jms" schema from spring 2.5 which I think has 7 or 8 of such "specific typed bean reference" attributes.

2) For second problem with schema annotation from custom namespace (mentioned in comment above), I'll attach a ready-to-run jar file with the custom namespace. That will save you some time with reproducing the problem.


Taras Tielkes - 03 Oct 07 16:30
Attached JAR file containing a trivial dummy namespace handler.
For attribute "transaction-manager" an annotation is present, but IDEA does not offer expected completion.

Peter Gromov - 08 Oct 07 23:23
Second problem is fixed now

Taras Tielkes - 09 Oct 07 00:33
Thanks, that should improve completion for some specific third-party namespaces I've been working with. Will test with next EAP.

For first problem there's a trivial patch attached to IDEADEV-17510.


Taras Tielkes - 16 Oct 07 17:30
Peter fixed part 1 of this issue, and for remaining transaction-manager problem these is a dedicated issue: IDEADEV-17510

So this one can be closed.