@Override public void prepareTableMeta(TableMeta meta, List<DataType> columns, ServerRequest request) { super.prepareTableMeta(meta, columns, request); TableMeta.LonLatColumns llc = new TableMeta.LonLatColumns(RA_COL, DEC_COL); // J2000 default meta.setLonLatColumnAttr(MetaConst.CATALOG_COORD_COLS, llc); meta.setCenterCoordColumns(llc); String title = request.getParam(ServerParams.REQUESTED_DATA_SET); title = (title == null) ? "LSST" : "LSST " + title; meta.setAttribute(MetaConst.CATALOG_OVERLAY_TYPE, title); meta.setAttribute(MetaConst.DATA_PRIMARY, "False"); setColumnTips(meta, request); }
protected void setColumnTips(TableMeta meta, ServerRequest request) { TableServerRequest req = new TableServerRequest("LSSTCatalogDD"); req.setPageSize(1000); req.setParam(CatalogRequest.CATALOG, request.getParam(ServerParams.REQUESTED_DATA_SET)); SearchManager sm = new SearchManager(); DataGroupPart dgp = new DataGroupPart(); try { dgp = sm.getDataGroup(req); } catch (Exception e) { } DataGroup dg = dgp.getData(); if (dg != null) { for (int i = 0; i < dg.size(); i++) { DataObject dObj = dg.get(i); String tipStr = ""; String descStr = (String) dObj.getDataElement("description"); if (!StringUtils.isEmpty(descStr) && !descStr.equalsIgnoreCase("null")) { tipStr += descStr; } String unitStr = (String) dObj.getDataElement("unit"); if (!StringUtils.isEmpty(unitStr) && !unitStr.equalsIgnoreCase("null")) { if (tipStr.length() > 0) { tipStr += " "; } tipStr += "(" + unitStr + ")"; } String nameStr = (String) dObj.getDataElement("name"); meta.setAttribute(makeAttribKey(DESC_TAG, nameStr.toLowerCase()), tipStr); } } }