Prepared API for domains and categories
parent
ecd984f560
commit
7f10899d45
|
|
@ -18,6 +18,8 @@ import javax.ws.rs.core.Application;
|
||||||
import org.libreccm.api.CorsFilter;
|
import org.libreccm.api.CorsFilter;
|
||||||
import org.libreccm.api.DefaultResponseHeaders;
|
import org.libreccm.api.DefaultResponseHeaders;
|
||||||
import org.libreccm.api.PreflightRequestFilter;
|
import org.libreccm.api.PreflightRequestFilter;
|
||||||
|
import org.libreccm.api.admin.categorization.CategoriesApi;
|
||||||
|
import org.libreccm.api.admin.categorization.DomainsApi;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -29,19 +31,21 @@ public class AdminApi extends Application {
|
||||||
@Override
|
@Override
|
||||||
public Set<Class<?>> getClasses() {
|
public Set<Class<?>> getClasses() {
|
||||||
final Set<Class<?>> classes = new HashSet<>();
|
final Set<Class<?>> classes = new HashSet<>();
|
||||||
|
|
||||||
classes.add(CorsFilter.class);
|
classes.add(CorsFilter.class);
|
||||||
classes.add(DefaultResponseHeaders.class);
|
classes.add(DefaultResponseHeaders.class);
|
||||||
classes.add(PreflightRequestFilter.class);
|
classes.add(PreflightRequestFilter.class);
|
||||||
|
|
||||||
|
// Categorization API
|
||||||
|
classes.add(DomainsApi.class);
|
||||||
|
classes.add(CategoriesApi.class);
|
||||||
|
|
||||||
|
// Security API
|
||||||
classes.add(GroupsApi.class);
|
classes.add(GroupsApi.class);
|
||||||
classes.add(RolesApi.class);
|
classes.add(RolesApi.class);
|
||||||
classes.add(UsersApi.class);
|
classes.add(UsersApi.class);
|
||||||
|
|
||||||
|
|
||||||
return classes;
|
return classes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,91 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2020 LibreCCM Foundation.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
package org.libreccm.api.admin.categorization;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Path("/categories")
|
||||||
|
public class CategoriesApi {
|
||||||
|
|
||||||
|
// GET (sub-)categories for path @Path("/{domain-identifier}/{path}
|
||||||
|
|
||||||
|
// POST add (sub-) category @Path("/{domain-identifier}/{path}
|
||||||
|
|
||||||
|
// GET categoryById @Path("/ID-{categoryId}")
|
||||||
|
|
||||||
|
// GET categoryByUuid @Path("UUID-{categoryId}")
|
||||||
|
|
||||||
|
// GET category @Path("/{domain-identifier}/{path}
|
||||||
|
|
||||||
|
// PUT update category @Path("/{domain-identifier}/{path}
|
||||||
|
|
||||||
|
// PUT update category by id @Path("/ID-{categoryId}")
|
||||||
|
|
||||||
|
// PUT update category by uuid @Path("/UUID-{categoryUuid}")
|
||||||
|
|
||||||
|
// delete only for empty categories!!!
|
||||||
|
// delete category @Path("/{domain-identifier}/{path}
|
||||||
|
|
||||||
|
// delete update category by id @Path("/ID-{categoryId}")
|
||||||
|
|
||||||
|
// delete update category by uuid @Path("/UUID-{categoryId}")
|
||||||
|
|
||||||
|
|
||||||
|
// GET object in category @Path("/{domain-identifier}/{path}/objects
|
||||||
|
|
||||||
|
// GET object in category @Path("/ID-{categoryId}
|
||||||
|
|
||||||
|
// GET object in category @Path("/UUID-{categoryUuid}
|
||||||
|
|
||||||
|
// PUT object in category @Path("/{domain-identifier}/{path}/objects/{objectIdentifier}
|
||||||
|
|
||||||
|
// PUT object in category @Path("/ID-{categoryId}/{objectIdentifier}
|
||||||
|
|
||||||
|
// PUT object in category @Path("/UUID-{categoryUuid}/{objectIdentifier}
|
||||||
|
|
||||||
|
// DELETE object in category @Path("/{domain-identifier}/{path}/objects/{objectIdentifier}
|
||||||
|
|
||||||
|
// DELETE object in category @Path("/ID-{categoryId}/{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}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2020 LibreCCM Foundation.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
package org.libreccm.api.admin.categorization;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Path("/domains")
|
||||||
|
public class DomainsApi {
|
||||||
|
|
||||||
|
// GET Domains @Path("/")
|
||||||
|
|
||||||
|
// GET Domain @Path("/domain-identifier")
|
||||||
|
|
||||||
|
// POST @Path("/") create new
|
||||||
|
|
||||||
|
// PUT Domain @Path("/domain-identifier")
|
||||||
|
|
||||||
|
|
||||||
|
// DELETE Domain @Path("/domain-identifier")
|
||||||
|
|
||||||
|
// GET owners @Path("/domain-identifier/owners")
|
||||||
|
|
||||||
|
// PUT Add owner @Path("/domain-identifier/owners/owner-identifier")
|
||||||
|
|
||||||
|
// DELETE Remove owner @Path("/domain-identifier/owners/owner-identifier")
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue