Examples of CategoryDTO


Examples of com.abiquo.server.core.appslibrary.CategoryDto

      license.setCustomerid("3bca6d1d-5fe2-42c5-82ea-a5276ea8c71c");
      return license;
   }

   public static CategoryDto categoryPost() {
      CategoryDto category = new CategoryDto();
      category.setName("category");
      category.setErasable(false);
      category.setDefaultCategory(false);
      return category;
   }
View Full Code Here

Examples of com.abiquo.server.core.appslibrary.CategoryDto

      category.setDefaultCategory(false);
      return category;
   }

   public static CategoryDto categoryPut() {
      CategoryDto category = categoryPost();
      category.setId(1);
      category.addLink(new RESTLink("edit", "http://localhost/api/config/categories/1"));
      return category;
   }
View Full Code Here

Examples of com.abiquo.server.core.appslibrary.CategoryDto

      return Iterables.getFirst(listCategories(filter), null);
   }

   @Override
   public Category getCategory(Integer categoryId) {
      CategoryDto result = context.getApi().getConfigApi().getCategory(categoryId);
      return wrap(context, Category.class, result);
   }
View Full Code Here

Examples of com.abiquo.server.core.appslibrary.CategoryDto

    *      > http://community.abiquo.com/display/ABI20/Category+Resource#
    *      CategoryResource- Retrieveacategory</a>
    */
   public Category getCategory() {
      Integer categoryId = target.getIdFromLink(ParentLinkName.CATEGORY);
      CategoryDto category = context.getApi().getConfigApi().getCategory(categoryId);
      return wrap(context, Category.class, category);
   }
View Full Code Here

Examples of cz.cvut.fel.wa2.interior.dto.CategoryDTO

    @POST
    @Path("/")
    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response createCategory(@Context UriInfo uriInfo, CategoryDTO categoryDTO) {
        CategoryDTO category = categoryService.create(uriInfo, categoryDTO);
        return Response.status(Response.Status.CREATED)
                .header("Location", category.getUri()).build();
    }
View Full Code Here

Examples of cz.cvut.fel.wa2.interior.dto.CategoryDTO

    @GET
    @Path("/{id:\\d+}")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response findCategory(@Context UriInfo uriInfo, @PathParam("id") Long id) {
        try {
            CategoryDTO category = categoryService.findById(uriInfo, id);
            return Response.status(Response.Status.OK).entity(category).build();
        } catch (NotExistingEntityException ex) {
            throw new NotFoundException(ex.getMessage());
        }
    }
View Full Code Here

Examples of cz.cvut.fel.wa2.interior.dto.CategoryDTO

    @Override
    public CategoryDTO create(UriInfo uriInfo, CategoryDTO categoryDTO) {
        Category category = new Category(categoryDTO.getName());
        categoryDAO.persist(category);
        return new CategoryDTO(category, uriInfo);
    }
View Full Code Here

Examples of cz.cvut.fel.wa2.interior.dto.CategoryDTO

        Category category = categoryDAO.findById(Category.class, id);
        if (category == null) {
            throw new NotExistingEntityException("Category with ID " + id + " does not exist.");
        }
       
        return new CategoryDTO(category, uriInfo);
    }
View Full Code Here

Examples of cz.cvut.fel.wa2.interior.dto.CategoryDTO

    public List<CategoryDTO> findAll(UriInfo uriInfo) {
        List<Category> categories = categoryDAO.findAll(Category.class, "name", true);

        List<CategoryDTO> categoryDTOs = new ArrayList<>();
        for (Category category : categories) {
            categoryDTOs.add(new CategoryDTO(category, uriInfo));
        }
        return categoryDTOs;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.