Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "COSMOS Design 214153"
(→Design) |
(→Design) |
||
Line 74: | Line 74: | ||
=Design= | =Design= | ||
+ | ==Query Templates== | ||
Note that the above CDMBf query has a hard coded localId set to "http://mycomputer". If we use some form of macro language we can create a more dynamic query as follows: | Note that the above CDMBf query has a hard coded localId set to "http://mycomputer". If we use some form of macro language we can create a more dynamic query as follows: | ||
Line 93: | Line 94: | ||
<pre> | <pre> | ||
− | http://localhost:8080/COSMOSUI/json?service=org.eclipse.comos.dr.service.handler.query& | + | http://localhost:8080/COSMOSUI/json?service=org.eclipse.comos.dr.service.handler.query&templateId=mytemplate&localId=http://my.computer&mdr=http://localhost:8080/myMDR |
</pre> | </pre> | ||
− | Note that the | + | Note that the templateId variable signifies the query template file that is defined above. |
− | + | ==CMDBf Query Service== | |
+ | A service is required that will execute the following steps: | ||
+ | |||
+ | #Read in the input parameters from a request | ||
+ | #Process the query template file | ||
+ | #Submit the query template file to the mdr | ||
+ | #Generate a JSON structure based on the cmdbf graph response received. | ||
+ | |||
+ | As stated in the previous section a request will be received by this service. The request will contain the following parameters. | ||
+ | *templateId - an id that identifies the template file to process | ||
+ | *MDR - the epr to the MDR | ||
+ | *<input parameters> - parameters used to construct the query | ||
+ | *formatter - id that identifies the component that will be used to format the XML graph structure to JSON | ||
+ | |||
+ | The following shows the various components to the query service and highlights configuration components. | ||
+ | |||
+ | [[Image:Queryserviceflow.gif]] | ||
Design note: Should cosmos make use of an opensource macro language processor or make up its own. Apache has a template engine called "Velocity" http://velocity.apache.org/engine/index.html that can be used. However ip approval is required. If this is an issue we can add extension points to "plug-in" a template engine and by default COSMOS can provide a simple template engine that defines simple parameter substitution. | Design note: Should cosmos make use of an opensource macro language processor or make up its own. Apache has a template engine called "Velocity" http://velocity.apache.org/engine/index.html that can be used. However ip approval is required. If this is an issue we can add extension points to "plug-in" a template engine and by default COSMOS can provide a simple template engine that defines simple parameter substitution. | ||
[[Category:COSMOS_Bugzilla_Designs]] | [[Category:COSMOS_Bugzilla_Designs]] |
Revision as of 13:38, 8 January 2008
Back to Data Reporting Design
Contents
Change History
Name: | Date: | Revised Sections: |
---|---|---|
Sheldon Lee-Loy | 01/08/2008 |
|
Workload Estimation
Process | Sizing | Names of people doing the work |
---|---|---|
Design | 0.2 | Sheldon Lee-Loy |
Code | ||
Test | ||
Documentation | ||
Build and infrastructure | ||
Code review, etc.* | ||
TOTAL |
'* - includes other committer work (e.g. check-in, contribution tracking)
Requirement
The COSMOS UI should provide the ability to create custom query user interfaces. These interfaces can be in the form of a dialog box or wizard.
A strategy is needed to determine how exploiters can contribute their own customized query user interfaces to the COSMOS ui. Note that these query user interfaces can be initiated by selecting a menu item, selecting a node, etc.
These customized user interfaces will be dojo widgets that are binded using query objects.
It should be possible to create "CMDBf query templates" that uses some form of macro language to define input parameters for the query. For example, consider the following CDMBf query:
<registerResponse xmlns="http://cmdbf.org/schema/1-0-0/datamodel"> <instanceResponse> <instanceId> <mdrId>http://testSystem.com/DiscoveryMdr</mdrId> <localId>http://my.computer</localId> </instanceId> <accepted> </accepted> </instanceResponse> </registerResponse>
Design
Query Templates
Note that the above CDMBf query has a hard coded localId set to "http://mycomputer". If we use some form of macro language we can create a more dynamic query as follows:
<registerResponse xmlns="http://cmdbf.org/schema/1-0-0/datamodel"> <instanceResponse> <instanceId> <mdrId>http://testSystem.com/DiscoveryMdr</mdrId> <localId>$localId</localId> </instanceId> <accepted> </accepted> </instanceResponse> </registerResponse>
The above query defines a $localId input parameter that a user interface can bind to.
The value of the $localId parameter can be provided by the user interface via a data feed. The following url can be used to execute the data feed:
http://localhost:8080/COSMOSUI/json?service=org.eclipse.comos.dr.service.handler.query&templateId=mytemplate&localId=http://my.computer&mdr=http://localhost:8080/myMDR
Note that the templateId variable signifies the query template file that is defined above.
CMDBf Query Service
A service is required that will execute the following steps:
- Read in the input parameters from a request
- Process the query template file
- Submit the query template file to the mdr
- Generate a JSON structure based on the cmdbf graph response received.
As stated in the previous section a request will be received by this service. The request will contain the following parameters.
- templateId - an id that identifies the template file to process
- MDR - the epr to the MDR
- <input parameters> - parameters used to construct the query
- formatter - id that identifies the component that will be used to format the XML graph structure to JSON
The following shows the various components to the query service and highlights configuration components.
Design note: Should cosmos make use of an opensource macro language processor or make up its own. Apache has a template engine called "Velocity" http://velocity.apache.org/engine/index.html that can be used. However ip approval is required. If this is an issue we can add extension points to "plug-in" a template engine and by default COSMOS can provide a simple template engine that defines simple parameter substitution.