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

  1. log into oms-mtd as root
  2. cd to /home/dev/oms-mtd
  3. 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 named name, the corresponding endpoint is named dev-name.
  4. 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 the dev path has to be called devpath, if path is the name given to the path for the production endpoint.
  5. run mvn package
  6. stop and restart the server using stop.pl and start.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.