Package com.sparc.knappsack.models

Examples of com.sparc.knappsack.models.CategoryModel


        List<Category> categoryList = userService.getCategoriesForUser(user, userAgentInfo.getApplicationType(), SortOrder.ASCENDING);
        List<CategoryModel> categoryModelList = new ArrayList<CategoryModel>();

        for (Category category : categoryList) {
            CategoryModel categoryModel = categoryService.createCategoryModel(category, true);

            if (categoryModel != null) {
                categoryModelList.add(categoryModel);
            }
        }
View Full Code Here


        category.setName("Test Category");
        category.setDescription("Test Description");
        category.setOrganization(organization);
        category.setStorageConfiguration(organization.getStorageConfigurations().get(0));
        category.setIcon(icon);
        CategoryModel categoryModel = categoryService.createCategoryModel(category, true);
        assertTrue(categoryModel.getDescription().equals("Test Description"));
        assertTrue(categoryModel.getName().equals("Test Category"));
        assertTrue(categoryModel.getIcon() != null);
    }
View Full Code Here

        }
    }

    @Override
    public CategoryModel createCategoryModel(Category category, boolean includeIcon) {
        CategoryModel categoryModel = null;
        if (category != null) {
            categoryModel = new CategoryModel();
            categoryModel.setId(category.getId());
            categoryModel.setName(category.getName());
            categoryModel.setDescription(category.getDescription());
            if (includeIcon) {
                categoryModel.setIcon(appFileService.createImageModel(category.getIcon()));
            }
        }

        return categoryModel;
    }
View Full Code Here

TOP

Related Classes of com.sparc.knappsack.models.CategoryModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.