@Path(value="shops/{shopId}/categories")
@RolesAllowed(value={"sf","products_read"})
public final class CategoryResource
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private CategoryService |
categoryService |
private java.lang.String |
shopId |
private ShopRequestContextService |
shopService |
Constructor and Description |
---|
CategoryResource(ShopRequestContextService shopService,
CategoryService service) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
createCategory(GUID categoryId,
java.util.Locale locale,
CategoryTemplate categoryTemplate) |
javax.ws.rs.core.Response |
deleteCategory(GUID categoryId) |
javax.ws.rs.core.Response |
get(GUID categoryId,
java.util.Locale locale,
boolean includeInvisible) |
javax.ws.rs.core.Response |
getRootCategories(java.util.Locale locale,
GUID productId,
boolean includeInvisible,
boolean followChildLinks) |
javax.ws.rs.core.Response |
getSubcategoriesSequence(GUID parentCategoryId) |
javax.ws.rs.core.Response |
saveCategory(GUID categoryId,
java.util.Locale locale,
Category category) |
javax.ws.rs.core.Response |
setSubcategoriesSequence(GUID parentCategoryId,
java.util.List<java.lang.String> sequence) |
private final ShopRequestContextService shopService
private final CategoryService categoryService
@PathParam(value="shopId") private java.lang.String shopId
@Inject public CategoryResource(ShopRequestContextService shopService, CategoryService service)
@GET @Produces(value="application/vnd.epages.v1+json, application/json") public javax.ws.rs.core.Response getRootCategories(@QueryParam(value="locale") java.util.Locale locale, @QueryParam(value="productId") GUID productId, @QueryParam(value="includeInvisible") boolean includeInvisible, @QueryParam(value="followChildLinks") boolean followChildLinks)
@GET @Path(value="{categoryId}") @Produces(value="application/vnd.epages.v1+json, application/json") public javax.ws.rs.core.Response get(@PathParam(value="categoryId") GUID categoryId, @QueryParam(value="locale") java.util.Locale locale, @QueryParam(value="includeInvisible") boolean includeInvisible)
@GET @Path(value="{categoryId}/sequence") @Produces(value="application/vnd.epages.v1+json, application/json") @RolesAllowed(value="products_read") public javax.ws.rs.core.Response getSubcategoriesSequence(@PathParam(value="categoryId") GUID parentCategoryId)
@PUT @Path(value="{categoryId}/sequence") @Produces(value="application/vnd.epages.v1+json, application/json") @Consumes(value="application/json") @RolesAllowed(value="products_write") public javax.ws.rs.core.Response setSubcategoriesSequence(@PathParam(value="categoryId") GUID parentCategoryId, @NotNull java.util.List<java.lang.String> sequence)
@POST @Path(value="{categoryId}") @Produces(value="application/vnd.epages.v1+json, application/json") @RolesAllowed(value="products_write") public javax.ws.rs.core.Response createCategory(@PathParam(value="categoryId") GUID categoryId, @QueryParam(value="locale") java.util.Locale locale, @NotNull CategoryTemplate categoryTemplate)
@PUT @Path(value="{categoryId}") @Produces(value="application/vnd.epages.v1+json, application/json") @Consumes(value="application/json") @RolesAllowed(value="products_write") public javax.ws.rs.core.Response saveCategory(@PathParam(value="categoryId") GUID categoryId, @QueryParam(value="locale") java.util.Locale locale, @NotNull Category category)
@DELETE @Path(value="{categoryId}") @Produces(value="application/vnd.epages.v1+json, application/json") @RolesAllowed(value="products_write") public javax.ws.rs.core.Response deleteCategory(@PathParam(value="categoryId") GUID categoryId)