Search in sources :

Example 11 with CatalogCategoryRestRep

use of com.emc.vipr.model.catalog.CatalogCategoryRestRep in project coprhd-controller by CoprHD.

the class CatalogApi method browseCatalog.

public static void browseCatalog(String sp1, String sp2, String sp3, String sp4, String sp5) {
    CatalogCategoryRestRep catalogCategory = CatalogCategoryUtils.getRootCategory();
    DataObjectRestRep result = findCategoryOrService(catalogCategory, sp1, sp2, sp3, sp4, sp5);
    if (result instanceof CatalogCategoryRestRep) {
        renderApi(newCategoryInfo((CatalogCategoryRestRep) result));
    } else if (result instanceof CatalogServiceRestRep) {
        renderApi(newServiceInfo((CatalogServiceRestRep) result));
    }
}
Also used : DataObjectRestRep(com.emc.storageos.model.DataObjectRestRep) CatalogServiceRestRep(com.emc.vipr.model.catalog.CatalogServiceRestRep) CatalogCategoryRestRep(com.emc.vipr.model.catalog.CatalogCategoryRestRep)

Example 12 with CatalogCategoryRestRep

use of com.emc.vipr.model.catalog.CatalogCategoryRestRep in project coprhd-controller by CoprHD.

the class CatalogApi method category.

public static void category(String categoryId) {
    CatalogCategoryRestRep category = CatalogCategoryUtils.getCatalogCategory(uri(categoryId));
    renderApi(newCategoryInfo(category));
}
Also used : CatalogCategoryRestRep(com.emc.vipr.model.catalog.CatalogCategoryRestRep)

Example 13 with CatalogCategoryRestRep

use of com.emc.vipr.model.catalog.CatalogCategoryRestRep in project coprhd-controller by CoprHD.

the class EditCatalog method moveDownCategory.

public static void moveDownCategory(String id) {
    CatalogCategoryRestRep catalogCategory = CatalogCategoryUtils.getCatalogCategory(uri(id));
    CatalogCategoryUtils.moveDownCategory(catalogCategory.getId());
    categories(catalogCategory.getCatalogCategory().getId().toString());
}
Also used : CatalogCategoryRestRep(com.emc.vipr.model.catalog.CatalogCategoryRestRep)

Example 14 with CatalogCategoryRestRep

use of com.emc.vipr.model.catalog.CatalogCategoryRestRep in project coprhd-controller by CoprHD.

the class EditCatalog method categories.

public static void categories(String id) {
    List<CatalogCategoryRestRep> catalogCategories = null;
    if (StringUtils.isNotBlank(id)) {
        CatalogCategoryRestRep parent = CatalogCategoryUtils.getCatalogCategory(uri(id));
        catalogCategories = CatalogCategoryUtils.getCatalogCategories(parent);
    }
    render(catalogCategories);
}
Also used : CatalogCategoryRestRep(com.emc.vipr.model.catalog.CatalogCategoryRestRep)

Example 15 with CatalogCategoryRestRep

use of com.emc.vipr.model.catalog.CatalogCategoryRestRep in project coprhd-controller by CoprHD.

the class EditCatalog method createService.

public static void createService(String parentId, String fromId) {
    CatalogCategoryRestRep parentCategory = CatalogCategoryUtils.getCatalogCategory(uri(parentId));
    ServiceForm service = new ServiceForm();
    service.owningCategoryId = getId(parentCategory);
    service.fromId = StringUtils.defaultIfBlank(fromId, service.owningCategoryId);
    edit(service);
}
Also used : CatalogCategoryRestRep(com.emc.vipr.model.catalog.CatalogCategoryRestRep)

Aggregations

CatalogCategoryRestRep (com.emc.vipr.model.catalog.CatalogCategoryRestRep)20 CatalogServiceRestRep (com.emc.vipr.model.catalog.CatalogServiceRestRep)6 DataObjectRestRep (com.emc.storageos.model.DataObjectRestRep)2 UriBuilder (javax.ws.rs.core.UriBuilder)2 CatalogCategoryList (com.emc.vipr.model.catalog.CatalogCategoryList)1 CategoryInfo (com.emc.vipr.model.catalog.CategoryInfo)1