Search in sources :

Example 1 with CategoryDef

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);
}
Also used : BreadCrumb(models.BreadCrumb) CategoryDef(controllers.catalog.ServiceCatalog.CategoryDef) URI(java.net.URI)

Aggregations

CategoryDef (controllers.catalog.ServiceCatalog.CategoryDef)1 URI (java.net.URI)1 BreadCrumb (models.BreadCrumb)1