This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 246701 - CMDBfQueryBuilder - problem with mdrid for relationship queries
Summary: CMDBfQueryBuilder - problem with mdrid for relationship queries
Status: ASSIGNED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Cosmos (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Jimmy Mohsin CLA
QA Contact: Don Ebright CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-09 08:04 EDT by Srinivas Reddy CLA
Modified: 2012-01-03 13:48 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Srinivas Reddy CLA 2008-09-09 08:04:48 EDT
Build ID: COSMOS-1.0.0-200809031641

Steps To Reproduce:
1.Open COSMOSUI under IE or firefox browser
2.Go to "Sample Repository with Query", right click and select "Submit Query.."
3.Using CMDBf Query builder wizard, create Teacher-Student relationship query and the generated query will be shown as below :

<?xml version="1.0" encoding="UTF-8"?>
<s:query xmlns:s="http://cmdbf.org/schema/1-0-0/datamodel">
   <s:itemTemplate id="teacher" suppressFromResult="false" >
      <s:instanceIdConstraint >
         <s:instanceId>
         <s:mdrId>http://www.eclipse.org/cosmos/examplemdr/4</s:mdrId>         <s:localId>Staff01</s:localId>         </s:instanceId>
      </s:instanceIdConstraint>
   </s:itemTemplate>
   <s:itemTemplate id="student" suppressFromResult="false" >
      <s:recordConstraint >
         <s:recordType namespace="http://schemas.examplemdr.org/schema/ExampleMDR" localName="student" >
         </s:recordType>
      </s:recordConstraint>
   </s:itemTemplate>
   <s:relationshipTemplate id="teaches" suppressFromResult="false" >
      <s:sourceTemplate ref="teacher" >
      </s:sourceTemplate>
      <s:targetTemplate ref="student" >
      </s:targetTemplate>
   </s:relationshipTemplate>
</s:query>
4. By running above query, it shows all Student details but not the actual relationship data

By quick comparision of pre-canned query - Staff01 and above query it found that there is mis-match in below lines of query :

For pre-canned query, mdrid is shown as:
<s:mdrId>
org.eclipse.cosmos.samples.cmdbf.XMLRepository
</s:mdrId>

and for the query which CMDBf Query builder generated:
<s:mdrId>
http://www.eclipse.org/cosmos/examplemdr/4
</s:mdrId>


More information:
Comment 1 Martin D Simmonds CLA 2008-09-11 08:49:57 EDT
XMLRepositiory.java has org.eclipse.cosmos.samples.cmdbf.XMLRepository
 hard-coded as the MdrId.  So only an MDRid set to this value will work.   When the mdr was created, this is how we assigned the MDRid.  Now things are different, they are not hard-coded.  When the QueryBuilder picks up the MDRId, it picks it up from the BrokerDB.xml.  So a workaround to fix this problem is to change the BrokerDB.xml to have org.eclipse.cosmos.samples.cmdbf.XMLRepository
as the id (this is in the tns:group for the Sample Repository with Query)

This bug will be targeted for I14.

It will be simplest to insure the BrokerDb.xml gets generated with the correct MDRid, rather than modifying the MDR to start picking the http://www.eclipse.org/cosmos/examplemdr/4.