add(new Image("wmstatus_icon", getUpOrDownArrowRef(report.getWmStatus()
.getStatus())));
add(new Image("rmstatus_icon", getUpOrDownArrowRef(report.getRmStatus()
.getStatus())));
ListModel crawlerStatusListModel = new ListModel(report.getCrawlerStatus());
add(new VisibilityAndSortToggler("crawler_toggler",
"crawler_status_showall", "crawler_status_hide", "crawler_status_sort",
"crawler_status_unsort", "crawler_status_more", crawlerStatusListModel));
add(new ListView<CrawlerStatus>("crawler_status_list",
crawlerStatusListModel) {
/*
* (non-Javadoc)
*
* @see
* org.apache.wicket.markup.html.list.ListView#populateItem(org.apache
* .wicket.markup.html.list.ListItem)
*/
@Override
protected void populateItem(ListItem<CrawlerStatus> statusItem) {
CrawlerStatus status = statusItem.getModelObject();
String statusString = status.getInfo().getCrawlerName() + " ("
+ status.getCrawlHost() + ":" + status.getInfo().getCrawlerPort()
+ ")";
statusItem.add(new Label("crawler_name_and_url", statusString));
statusItem.add(new Image("crawler_status_icon",
getUpOrDownArrowRef(status.getStatus())));
}
});
ListModel batchStubStatusListModel = new ListModel(
report.getBatchStubStatus());
add(new VisibilityAndSortToggler("batch_stub_toggler",
"batch_stub_showall", "batch_stub_hide", "batch_stub_sort",
"batch_stub_unsort", "batch_stub_more", batchStubStatusListModel));
add(new ListView<PCSDaemonStatus>("batch_stub_list",
batchStubStatusListModel) {
@Override
protected void populateItem(ListItem<PCSDaemonStatus> item) {
item.add(new Label("batch_stub_url", item.getModelObject().getUrlStr()));
item.add(new Image("batch_stub_status_icon", getUpOrDownArrowRef(item
.getModelObject().getStatus())));
}
});
List<JobHealthStatus> jobHealthStatusList = report.getJobHealthStatus();
add(new ListView<JobHealthStatus>("jobstatus_list", jobHealthStatusList) {
/*
* (non-Javadoc)
*
* @see
* org.apache.wicket.markup.html.list.ListView#populateItem(org.apache
* .wicket.markup.html.list.ListItem)
*/
@Override
protected void populateItem(final ListItem<JobHealthStatus> item) {
item.add(new Label("status_name", item.getModelObject().getStatus()));
Link<String> countLink = new Link<String>("jobstatus_count_link",
new Model<String>(item.getModelObject().getStatus())) {
@Override
public void onClick() {
PageParameters params = new PageParameters();
params.add("pageNum", "1");
params.add("status", getModelObject());
setResponsePage(instancesPage, params);
}
};
countLink.add(new Label("status_num_jobs", String.valueOf(item
.getModelObject().getNumPipelines())));
item.add(countLink);
}
});
List<Product> prodList = report.getLatestProductsIngested();
final FileManagerUtils fm = new FileManagerUtils(fmUrlStr);
add(new ListView<Product>("file_health_list", prodList) {
/*
* (non-Javadoc)
*
* @see
* org.apache.wicket.markup.html.list.ListView#populateItem(org.apache
* .wicket.markup.html.list.ListItem)
*/
@Override
protected void populateItem(ListItem<Product> item) {
final Product product = item.getModelObject();
product.setProductType(fm.safeGetProductTypeById(product
.getProductType().getProductTypeId()));
product.setProductReferences(fm.safeGetProductReferences(product));
final Metadata prodMet = fm.safeGetMetadata(product);
final String filePath = fm.getFilePath(product);
Link link = new Link("view_product_link") {
/*
* (non-Javadoc)
*
* @see org.apache.wicket.markup.html.link.Link#onClick()
*/
@Override
public void onClick() {
PageParameters params = new PageParameters();
params.add("id", product.getProductId());
setResponsePage(productBrowser, params);
}
};
link.add(new Label("file_path", filePath));
item.add(link);
item.add(new Label("file_ingest_datetime", prodMet.getMetadata("CAS."
+ CoreMetKeys.PRODUCT_RECEVIED_TIME)));
}
});
ListModel crawlerHealthListModel = new ListModel(
report.getCrawlerHealthStatus());
add(new VisibilityToggler("crawler_health_toggler",
"crawler_health_showall", "crawler_health_hide", "crawler_health_more",
crawlerHealthListModel));