More methods definitions for CategoriesApi
parent
39a5da0c04
commit
6388ca7c62
|
|
@ -18,8 +18,23 @@
|
||||||
*/
|
*/
|
||||||
package org.libreccm.api.admin.categorization;
|
package org.libreccm.api.admin.categorization;
|
||||||
|
|
||||||
|
import org.libreccm.api.admin.categorization.dto.CategoryData;
|
||||||
|
import org.libreccm.api.dto.ListView;
|
||||||
|
import org.libreccm.core.CoreConstants;
|
||||||
|
import org.libreccm.security.AuthorizationRequired;
|
||||||
|
import org.libreccm.security.RequiresPrivilege;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.transaction.Transactional;
|
||||||
|
import javax.ws.rs.Consumes;
|
||||||
|
import javax.ws.rs.DELETE;
|
||||||
|
import javax.ws.rs.GET;
|
||||||
|
import javax.ws.rs.POST;
|
||||||
|
import javax.ws.rs.PUT;
|
||||||
import javax.ws.rs.Path;
|
import javax.ws.rs.Path;
|
||||||
|
import javax.ws.rs.PathParam;
|
||||||
|
import javax.ws.rs.Produces;
|
||||||
|
import javax.ws.rs.core.MediaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -28,64 +43,161 @@ import javax.ws.rs.Path;
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
@Path("/categories")
|
@Path("/categories")
|
||||||
public class CategoriesApi {
|
public class CategoriesApi {
|
||||||
|
|
||||||
// GET (sub-)categories for path @Path("/{domain-identifier}/{path}
|
@GET
|
||||||
|
@Path("/{domainIdentifier}/{path:^[\\w\\-/]+$}")
|
||||||
// POST add (sub-) category @Path("/{domain-identifier}/{path}
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
@AuthorizationRequired
|
||||||
// GET categoryById @Path("/ID-{categoryId}")
|
@RequiresPrivilege(CoreConstants.PRIVILEGE_ADMIN)
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
// GET categoryByUuid @Path("UUID-{categoryId}")
|
public ListView<CategoryData> getCategories(
|
||||||
|
@PathParam("domainIdentifier") final String domainIdentifierParam,
|
||||||
// GET category @Path("/{domain-identifier}/{path}
|
@PathParam("path") final String categoryPathTokens
|
||||||
|
) {
|
||||||
// PUT update category @Path("/{domain-identifier}/{path}
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
// PUT update category by id @Path("/ID-{categoryId}")
|
|
||||||
|
@POST
|
||||||
// PUT update category by uuid @Path("/UUID-{categoryUuid}")
|
@Path("/{domainIdentifier}/{path:^[\\w\\-/]+$}")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
// delete only for empty categories!!!
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
// delete category @Path("/{domain-identifier}/{path}
|
@AuthorizationRequired
|
||||||
|
@RequiresPrivilege(CoreConstants.PRIVILEGE_ADMIN)
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public ListView<CategoryData> addNewSubCategory(
|
||||||
|
@PathParam("domainIdentifier") final String domainIdentifierParam,
|
||||||
|
@PathParam("path") final String categoryPathTokens,
|
||||||
|
final CategoryData categoryData
|
||||||
|
) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/{domainIdentifier}/{path:^[\\w\\-/]+$}")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
@AuthorizationRequired
|
||||||
|
@RequiresPrivilege(CoreConstants.PRIVILEGE_ADMIN)
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public CategoryData getCategory(
|
||||||
|
@PathParam("domainIdentifier") final String domainIdentifierParam,
|
||||||
|
@PathParam("path") final String categoryPathTokens
|
||||||
|
) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/ID-{categoryId}")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
@AuthorizationRequired
|
||||||
|
@RequiresPrivilege(CoreConstants.PRIVILEGE_ADMIN)
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public CategoryData getCategory(
|
||||||
|
@PathParam("categoryId") final long categoryId
|
||||||
|
) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/UUID-{categoryId}")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
@AuthorizationRequired
|
||||||
|
@RequiresPrivilege(CoreConstants.PRIVILEGE_ADMIN)
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public CategoryData getCategory(
|
||||||
|
@PathParam("categoryId") final String categoryUuid
|
||||||
|
) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PUT
|
||||||
|
@Path("/{domainIdentifier}/{path:^[\\w\\-/]+$}")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
|
@AuthorizationRequired
|
||||||
|
@RequiresPrivilege(CoreConstants.PRIVILEGE_ADMIN)
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public CategoryData updateCategory(
|
||||||
|
@PathParam("domainIdentifier") final String domainIdentifierParam,
|
||||||
|
@PathParam("path") final String categoryPathTokens,
|
||||||
|
final CategoryData categoryData
|
||||||
|
) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PUT
|
||||||
|
@Path("/ID-{categoryId}")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
|
@AuthorizationRequired
|
||||||
|
@RequiresPrivilege(CoreConstants.PRIVILEGE_ADMIN)
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public CategoryData updateCategory(
|
||||||
|
@PathParam("catgoryId") final long categoryIdParam,
|
||||||
|
final CategoryData categoryData
|
||||||
|
) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PUT
|
||||||
|
@Path("/UUID-{categoryUuid}")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
|
@AuthorizationRequired
|
||||||
|
@RequiresPrivilege(CoreConstants.PRIVILEGE_ADMIN)
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public CategoryData updateCategory(
|
||||||
|
@PathParam("catgoryUid") final String categoryIdParam,
|
||||||
|
final CategoryData categoryData
|
||||||
|
) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@DELETE
|
||||||
|
@Path("/{domainIdentifier}/{path:^[\\w\\-/]+$}")
|
||||||
|
@AuthorizationRequired
|
||||||
|
@RequiresPrivilege(CoreConstants.PRIVILEGE_ADMIN)
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public CategoryData deleteCategory(
|
||||||
|
@PathParam("domainIdentifier") final String domainIdentifierParam,
|
||||||
|
@PathParam("path") final String categoryPathTokens
|
||||||
|
) {
|
||||||
|
// Delete only empty categories!!!
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
// delete update category by id @Path("/ID-{categoryId}")
|
// delete update category by id @Path("/ID-{categoryId}")
|
||||||
|
@DELETE
|
||||||
|
@Path("/ID-{categoryId}")
|
||||||
|
@AuthorizationRequired
|
||||||
|
@RequiresPrivilege(CoreConstants.PRIVILEGE_ADMIN)
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public CategoryData deleteCategory(
|
||||||
|
@PathParam("categoryId") final long categoryIdParam
|
||||||
|
) {
|
||||||
|
// Delete only empty categories!!!
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
// delete update category by uuid @Path("/UUID-{categoryId}")
|
@DELETE
|
||||||
|
@Path("/UUID-{categoryUuid}")
|
||||||
|
@AuthorizationRequired
|
||||||
|
@RequiresPrivilege(CoreConstants.PRIVILEGE_ADMIN)
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public CategoryData deleteCategory(
|
||||||
|
@PathParam("categoryId") final String categoryUuidParam
|
||||||
|
) {
|
||||||
|
// Delete only empty categories!!!
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
// GET object in category @Path("/{domain-identifier}/{path}/objects
|
// GET object in category @Path("/{domain-identifier}/{path}/objects
|
||||||
|
|
||||||
// GET object in category @Path("/ID-{categoryId}
|
// GET object in category @Path("/ID-{categoryId}
|
||||||
|
|
||||||
// GET object in category @Path("/UUID-{categoryUuid}
|
// GET object in category @Path("/UUID-{categoryUuid}
|
||||||
|
|
||||||
// PUT object in category @Path("/{domain-identifier}/{path}/objects/{objectIdentifier}
|
// PUT object in category @Path("/{domain-identifier}/{path}/objects/{objectIdentifier}
|
||||||
|
|
||||||
// PUT object in category @Path("/ID-{categoryId}/{objectIdentifier}
|
// PUT object in category @Path("/ID-{categoryId}/{objectIdentifier}
|
||||||
|
|
||||||
// PUT object in category @Path("/UUID-{categoryUuid}/{objectIdentifier}
|
// PUT object in category @Path("/UUID-{categoryUuid}/{objectIdentifier}
|
||||||
|
|
||||||
// DELETE object in category @Path("/{domain-identifier}/{path}/objects/{objectIdentifier}
|
// DELETE object in category @Path("/{domain-identifier}/{path}/objects/{objectIdentifier}
|
||||||
|
|
||||||
// DELETE object in category @Path("/ID-{categoryId}/{objectIdentifier}
|
// DELETE object in category @Path("/ID-{categoryId}/{objectIdentifier}
|
||||||
|
|
||||||
// DELETE object in category @Path("/UUID-{categoryUuid}/{objectIdentifier}
|
// DELETE object in category @Path("/UUID-{categoryUuid}/{objectIdentifier}
|
||||||
|
|
||||||
// GET subcategory in category @Path("/{domain-identifier}/{path}/subcategories
|
|
||||||
|
|
||||||
// GET subcategory in category @Path("/ID-{categoryId}
|
|
||||||
|
|
||||||
// GET subcategory in category @Path("/UUID-{categoryUuid}
|
|
||||||
|
|
||||||
// PUT subcategory in category @Path("/{domain-identifier}/{path}/subcategories/{subcategoryIdentifier}
|
|
||||||
|
|
||||||
// PUT subcategory in category @Path("/ID-{categoryId}/{subcategoryIdentifier}
|
|
||||||
|
|
||||||
// PUT subcategory in category @Path("/UUID-{categoryUuid}/{subcategoryIdentifier}
|
|
||||||
|
|
||||||
// DELETE subcategory in category @Path("/{domain-identifier}/{path}/subcategories/{subcategoryIdentifier}
|
|
||||||
|
|
||||||
// DELETE subcategory in category @Path("/ID-{categoryId}/{subcategoryIdentifier}
|
|
||||||
|
|
||||||
// DELETE subcategory in category @Path("/UUID-{categoryUuid}/{subcategoryIdentifier}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue