Several optimizations

Jens Pelzetter 2020-06-30 21:05:28 +02:00
parent 98b082ca94
commit 88675a786a
7 changed files with 30 additions and 10 deletions

View File

@ -21,6 +21,7 @@ import org.libreccm.api.PreflightRequestFilter;
import org.libreccm.api.admin.categorization.CategoriesApi; import org.libreccm.api.admin.categorization.CategoriesApi;
import org.libreccm.api.admin.categorization.DomainsApi; import org.libreccm.api.admin.categorization.DomainsApi;
import org.libreccm.api.admin.sites.SitesApi; import org.libreccm.api.admin.sites.SitesApi;
import org.libreccm.api.admin.web.CcmApplicationsApi;
import org.libreccm.configuration.Configuration; import org.libreccm.configuration.Configuration;
/** /**
@ -56,6 +57,9 @@ public class AdminApi extends Application {
// System Information API // System Information API
classes.add(SystemInformationApi.class); classes.add(SystemInformationApi.class);
// Web
classes.add(CcmApplicationsApi.class);
return classes; return classes;
} }

View File

@ -241,7 +241,7 @@ public class DomainsApi {
); );
} }
@GET @PUT
@Path("/{domainIdentifier}/owners/{ownerIdentifier}") @Path("/{domainIdentifier}/owners/{ownerIdentifier}")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
@AuthorizationRequired @AuthorizationRequired

View File

@ -39,7 +39,7 @@ public class CategoryId {
* Constructor for creating empty instances. * Constructor for creating empty instances.
*/ */
public CategoryId() { public CategoryId() {
// Nothing super();
} }
/** /**

View File

@ -35,6 +35,7 @@ import org.libreccm.web.CcmApplication;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject; import javax.inject.Inject;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import javax.ws.rs.BadRequestException; import javax.ws.rs.BadRequestException;
@ -56,6 +57,7 @@ import javax.ws.rs.core.UriInfo;
* *
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */
@RequestScoped
@Path("/sites") @Path("/sites")
public class SitesApi { public class SitesApi {

View File

@ -29,11 +29,11 @@ import org.libreccm.categorization.Category;
import org.libreccm.categorization.CategoryManager; import org.libreccm.categorization.CategoryManager;
import org.libreccm.security.Permission; import org.libreccm.security.Permission;
import javax.persistence.*;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
@ -43,6 +43,20 @@ import java.util.Objects;
import static org.libreccm.core.CoreConstants.CORE_XML_NS; import static org.libreccm.core.CoreConstants.CORE_XML_NS;
import static org.libreccm.core.CoreConstants.DB_SCHEMA; import static org.libreccm.core.CoreConstants.DB_SCHEMA;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;
/** /**
* Root class of all entities in LibreCCM which need categorisation and * Root class of all entities in LibreCCM which need categorisation and
* permission services. * permission services.

View File

@ -37,8 +37,8 @@ import javax.persistence.Table;
* Only applications which are different for each site should extend this class. * Only applications which are different for each site should extend this class.
* For example for the Admin application or the Content Center application * For example for the Admin application or the Content Center application
* provided by the ccm-cms module it makes no sense to make them site aware. * provided by the ccm-cms module it makes no sense to make them site aware.
* This applications are used to manage objects which are shared by all sites. * These applications are used to manage objects which are shared by all sites.
* Other applications like the Pages application provided by ccm-cms module are * Other applications like the Pages application provided by the ccm-cms module are
* of course site aware. The Pages application for example manages the page tree * of course site aware. The Pages application for example manages the page tree
* of one specific site. * of one specific site.
* *

View File

@ -80,8 +80,8 @@ import javax.persistence.Table;
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, @JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class,
resolver = ApplicationIdResolver.class, resolver = ApplicationIdResolver.class,
property = "uuid") property = "uuid")
public class CcmApplication extends Resource implements Serializable, public class CcmApplication
Exportable { extends Resource implements Serializable, Exportable {
private static final long serialVersionUID = 9205226362368890784L; private static final long serialVersionUID = 9205226362368890784L;