OMS - CMSROMA/MTDDB GitHub Wiki
OMS development
OMS is the tool chosen to monitor the construction.
A virtual machine oms-mtd.cern.ch
has been setup as the source of information for the OMS. The data provided by the latter can be visualised pointing a browser to https://vocms0184.cern.ch/mtd/test/no_controller (need a tunnel).
How to create data for the OMS web interface
- log into
oms-mtd
as root - cd to
/home/dev/oms-mtd
- create an endpoint editing a file like
db2json
Until we permanently decommission the test database, for each endpoint a corresponding endpoint must be created to access data in the INT2R DB. If the production endpoint is namedname
, the corresponding endpoint is nameddev-name
. - run
createEndpoint.py --subsystem mtd --attributes [db2json] --paths [path] --identifying [id]
where[path]
is a string that identify the endpoint (e.g.parts
in the example) and[id]
is the primary key of the corresponding table (e.g.[barcode]
in the example).[db2json]
is the endpoint description file. Note that paths must not contain non-alphabetic characters, so thedev
path has to be calleddevpath
, ifpath
is the name given to the path for the production endpoint. - run
mvn package
- stop and restart the server using
stop.pl
andstart.sh
The above procedure generates and compiles the java code needed for creating the pages displayed by OMS. All the information needed is in db2json
which describes the content of the data.
The example db2json
is as follows
{
"db" : {
"table" : "CMS_MTD_TMING_VIEW.PARTSVIEW"
},
"attributes" : [ {
"api" : {
"attribute" : "barcode",
"units" : "",
"description" : "barcode uniquely identifying the part",
"type" : "String",
"searchable" : true,
"sortable" : true,
"identifying" : false
},
"db" : {
"column" : "BARCODE",
"type" : "VARCHAR2"
}
}, {
"api" : {
"attribute" : "batch",
"units" : "",
"description" : "batch number",
"type" : "String",
"searchable" : true,
"sortable" : true,
"identifying" : false
},
"db" : {
"column" : "BATCH_NUMBER",
"type" : "VARCHAR2"
}
}, {
"api" : {
"attribute" : "type",
"units" : "",
"description" : "kind of part",
"type" : "String",
"searchable" : true,
"sortable" : true,
"identifying" : false
},
"db" : {
"column" : "DISPLAY_NAME",
"type" : "VARCHAR2"
}
}, {
"api" : {
"attribute" : "location",
"units" : "",
"description" : "current location of a part",
"type" : "String",
"searchable" : true,
"sortable" : true,
"identifying" : false
},
"db" : {
"column" : "LOCATION_NAME",
"type" : "VARCHAR2"
}
}, {
"api" : {
"attribute" : "producer",
"units" : "",
"description" : "part producer",
"type" : "String",
"searchable" : true,
"sortable" : true,
"identifying" : false
},
"db" : {
"column" : "MANUFACTURER_NAME",
"type" : "VARCHAR2"
}
}, {
"api" : {
"attribute" : "pdata",
"units" : "",
"description" : "data associated to the part by the produced",
"type" : "String",
"searchable" : true,
"sortable" : true,
"identifying" : false
},
"db" : {
"column" : "BATCH_INGOT_DATA",
"type" : "VARCHAR2"
}
}, {
"api" : {
"attribute" : "operator_comment",
"units" : "",
"description" : "Comments collected during visual inspection",
"type" : "String",
"searchable" : true,
"sortable" : true,
"identifying" : false
},
"db" : {
"column" : "OPERATORCOMMENT",
"type" : "VARCHAR2"
}
} ]
}
For the test endpoints, the beginning of the corresponding dev-endpoint file is
{
"db" : {
"table" : "CMS_MTD_TMING_VIEW.PARTSVIEW@int2r"
},
In this file, PARTSVIEW
is an Oracle view defined by the owner CMS_MTD_TMING_VIEW
. The structure of the view is the same as for the table shown in OMS. You may need to create the appropriate views.
Editing the look of the page
To edit the OMS page you need to authenticate yourself, then you can use the three dots menu to access Edit page
. Then you can edit the individual portlets (panels) clicking on the pencil.