use of controllers.catalog.ServiceCatalog.CategoryDef in project coprhd-controller by CoprHD.
the class Services method addBreadCrumbToRenderArgs.
private static void addBreadCrumbToRenderArgs(CatalogServiceRestRep service, String backUrlInput) {
List<BreadCrumb> breadcrumbs = ServiceCatalog.createBreadCrumbs(Models.currentAdminTenant(), service);
renderArgs.put("breadcrumbs", breadcrumbs);
String backUrl;
if (StringUtils.isEmpty(backUrlInput)) {
backUrl = request.params.get("return");
if (StringUtils.isBlank(backUrl)) {
String path = "";
URI categoryId = service.getCatalogCategory().getId();
if (categoryId != null) {
Map<String, CategoryDef> catalog = ServiceCatalog.getCatalog(Models.currentAdminTenant());
CategoryDef category = catalog.get(categoryId.toString());
path = (category != null) ? category.path : path;
}
backUrl = Common.reverseRoute(ServiceCatalog.class, "view") + "#" + path;
}
} else {
backUrl = backUrlInput;
}
renderArgs.put("backUrl", backUrl);
}
Aggregations