Description of problem: When using a custom JCA type-mapping, RHQ fails to display the correct value when viewing the datasource configuration. When a custom type-mapping is selected (as defined in conf/standardjbosscmp-jdbc.xml) the RHQ UI displays Cloudscape as the type-mapping. This is wrong. Reviewing the *-ds.xml deployed in the JBoss AS instance type-mapping is set to the custom value of Oracle10g -- a user defined mapping. Version-Release number of selected component (if applicable): 4.2.0 How reproducible: Always Steps to Reproduce: 1. Add a custom/user-defined mapping to conf/standardjbosscmp-jdbc.xml (the Oracle9i type-mapping can be used as the base) to a JBoss AS 5 install 2. Configure DefaultDS in a JBoss AS 5 instance to use a type-mapping of Oracle10g (the custom mapping defined above) 3. Confirm the datasource is functioning 4. Add the AS instance which contains the modified DefaultDS to RHQ inventory 5. Navigate to the datasource resource's Configuration tab 6. Review DefaultDS' Configuration tab under Advanced / Metadata / Type Mapping Actual results: Type Mapping will display Cloudscape Expected results: Type Mapping should display Oracle10g Additional info: This is because the property Type Mapping (as defined in multiple places of the jboss-as-5 and jboss-as plug-ins) contain a hard-coded list of available mapping instead of reading them from conf/standardjbosscmp-jdbc.xml. If we can not dynamically determine the available type mappings, we should make this a text entry field allowing the value defined in the descriptor to be used or a custom value be entered.
Making the type mappings dynamic is beyond the scope of JON3.0 We should look to determine how much effort, and any backward compatibility issues for existing resources in inventory there might be, to solve this by turning the field into which accepts free form text. This change should also not impose any burden on users creating new Datasources, they shouldn't have to type this info in.
The reported problem does not affect JBoss AS4 plugin; Type Mapping property for that plugin is a text field. This BZ is applicable only to JBoss AS5 plugin. There are two instances where the Type Mapping occurs; Advanced -> Metadata -> Type Mapping and Advanced -> Type Mapping. The best solution to fix this issue is to dynamically generate the list of options from the conf file. However, as a downside the file would need to be scanned frequently to pick up changes made outside of RHQ. There is no support for this kind of functionality in RHQ right now. The second best solution is to have a set of predefined options and to allow users to add custom values to that list. However, the implementation is quiet complex because lack of support in the current domain and UI implementation (... and parsing of plugin descriptors). The third solution would be to transform the field into a text box. This is the only option available today. I updated the code to display a textbox for Type Mapping configuration. The field will be pre-populated by the plugin on a best effort case. Afterwards, the textbox will accept any value so the user can update to the desired value.
Now that the field is a regular text box and allows any value, we ideally should do validation of the value in the plugin's impl of updateResourceConfiguration() and set an error on the PropertySimple if it's not a valid type mapping name. We'd have to see if it's possible to retrieve the list of valid type mapping names from the profile service. If so, this would be a fairly easy change. If not, and we had to use JMX or manual XML file access, it could be more involved.
I added the list of default type mappings in the description of the property. The users can now just copy and paste any of the values that get distributed with AS5.
Created BZ 752431 to implement type mapping validation. This BZ is ready for testing. https://bugzilla.redhat.com/show_bug.cgi?id=752431
master commits: http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commit;h=43566de98d044de20f96107c54d881e9144cfd2f http://git.fedorahosted.org/git?p=rhq/rhq.git;a=commit;h=7d6daf24fd744c8c3e513efaaa03a35c9f554c61 release_jon3.x commits: http://git.fedorahosted.org/git?p=rhq/rhq.git;a=commit;h=9939b5e91e46a78542b25b1650d898e042eee4fe http://git.fedorahosted.org/git?p=rhq/rhq.git;a=commit;h=1a8507f7efb36e4b6d018b18b4785e570a3e9a1f
verified type mapping is a text box.
marking VERIFIED JON 3 bugs to CLOSED/CURRENTRELEASE
changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE