Commit 8038a9bf authored by Matija Obreza's avatar Matija Obreza

Merge branch 'ui-7-subsets-public-pages' into 'master'

Ui 7 subsets public pages

See merge request genesys-pgr/genesys-server!158
parents 955dbf76 cd98608b
......@@ -137,7 +137,7 @@ public class ApiExceptionHandler {
* @return the api error
*/
@ResponseStatus(code = HttpStatus.NOT_FOUND)
@ExceptionHandler(NotFoundElement.class)
@ExceptionHandler(value = { NotFoundElement.class, org.genesys2.server.exception.NotFoundElement.class })
@ResponseBody
public ApiError<Exception> handleNotFound(final Exception e, final HttpServletRequest request) {
LOG.warn("Element not found {} {}", request.getMethod(), request.getRequestURL(), e);
......
......@@ -15,7 +15,11 @@
*/
package org.genesys.catalog.api.v0;
import org.apache.commons.lang3.StringUtils;
import java.io.IOException;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
import org.genesys.catalog.api.FilteredPage;
import org.genesys.catalog.exceptions.NotFoundElement;
import org.genesys.catalog.model.dataset.AccessionIdentifier;
......@@ -32,15 +36,18 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import java.io.IOException;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
/**
* The Class DatasetController.
*
......@@ -70,6 +77,34 @@ public class DatasetController {
@Autowired
protected DescriptorService descriptorService;
/**
* My datasets.
*
* @param page the page
* @param pageSize the page size
* @param direction the direction
* @param sort the sort
* @param filterCode short filter code -- overrides filter in body
* @param filter the filter
* @return the page
* @throws IOException
*/
@PostMapping(value = "/list-mine")
public FilteredPage<Dataset> myDatasets(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
@RequestParam(name = "l", required = false, defaultValue = "50") final int pageSize,
@RequestParam(name = "d", required = false, defaultValue = "DESC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "lastModifiedDate") final String[] sort,
@RequestParam(name = "f", required = false) String filterCode,
@RequestBody(required = false) DatasetFilter filter) throws IOException {
if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, DatasetFilter.class);
} else {
filterCode = shortFilterService.getCode(filter);
}
return new FilteredPage<>(filterCode, filter, datasetService.listDatasetsForCurrentUser(filter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort)));
}
/**
* List datasets.
*
......@@ -86,9 +121,9 @@ public class DatasetController {
@RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort,
@RequestParam(name = "f", required = false) String filterCode,
@RequestBody DatasetFilter filter) throws IOException {
@RequestBody(required = false) DatasetFilter filter) throws IOException {
if (StringUtils.isNotBlank(filterCode)) {
if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, DatasetFilter.class);
} else {
filterCode = shortFilterService.getCode(filter);
......
......@@ -19,7 +19,6 @@ import java.io.IOException;
import java.util.List;
import java.util.UUID;
import org.apache.commons.lang3.StringUtils;
import org.genesys.blocks.model.JsonViews;
import org.genesys.catalog.api.FilteredPage;
import org.genesys.catalog.model.dataset.Dataset;
......@@ -78,6 +77,33 @@ public class DescriptorController {
return Descriptor.Category.values();
}
/**
* My descriptors.
*
* @param page the page
* @param pageSize the page size
* @param direction the direction
* @param sort the sort
* @param filter the descriptor filter
* @return the page
* @throws IOException
*/
@PostMapping(value = "/list-mine")
public FilteredPage<Descriptor> myDescriptors(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
@RequestParam(name = "l", required = false, defaultValue = "50") final int pageSize,
@RequestParam(name = "d", required = false, defaultValue = "DESC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "lastModifiedDate") final String[] sort,
@RequestParam(name = "f", required = false) String filterCode,
@RequestBody(required = false) DescriptorFilter filter) throws IOException {
if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, DescriptorFilter.class);
} else {
filterCode = shortFilterService.getCode(filter);
}
return new FilteredPage<>(filterCode, filter, descriptorService.listDescriptorsForCurrentUser(filter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort)));
}
/**
* List descriptors.
*
......@@ -95,9 +121,9 @@ public class DescriptorController {
@RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort,
@RequestParam(name = "f", required = false) String filterCode,
@RequestBody DescriptorFilter filter) throws IOException {
@RequestBody(required = false) DescriptorFilter filter) throws IOException {
if (StringUtils.isNotBlank(filterCode)) {
if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, DescriptorFilter.class);
} else {
filterCode = shortFilterService.getCode(filter);
......
......@@ -15,7 +15,14 @@
*/
package org.genesys.catalog.api.v0;
import org.apache.commons.lang3.StringUtils;
import java.io.IOException;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import org.genesys.blocks.model.JsonViews;
import org.genesys.catalog.api.FilteredPage;
import org.genesys.catalog.model.filters.DescriptorListFilter;
......@@ -33,19 +40,20 @@ import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.fasterxml.jackson.annotation.JsonView;
import io.swagger.annotations.Api;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
/**
* The Class DescriptorListController.
*
......@@ -165,6 +173,33 @@ public class DescriptorListController {
return descriptorList;
}
/**
* My descriptor lists.
*
* @param page the page
* @param pageSize the page size
* @param direction the direction
* @param sort the sort
* @param descriptorListFilter the descriptor list filter
* @return the page
* @throws IOException
*/
@PostMapping(value = "/list-mine")
public FilteredPage<DescriptorList> myDescriptorLists(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
@RequestParam(name = "l", required = false, defaultValue = "50") final int pageSize,
@RequestParam(name = "d", required = false, defaultValue = "DESC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "lastModifiedDate") final String[] sort,
@RequestParam(name = "f", required = false) String filterCode,
@RequestBody(required = false) DescriptorListFilter filter) throws IOException {
if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, DescriptorListFilter.class);
} else {
filterCode = shortFilterService.getCode(filter);
}
return new FilteredPage<>(filterCode, filter, descriptorListService.listDescriptorListsForCurrentUser(filter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort)));
}
/**
* List descriptor lists.
*
......@@ -182,9 +217,9 @@ public class DescriptorListController {
@RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort,
@RequestParam(name = "f", required = false) String filterCode,
@RequestBody DescriptorListFilter filter) throws IOException {
@RequestBody(required = false) DescriptorListFilter filter) throws IOException {
if (StringUtils.isNotBlank(filterCode)) {
if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, DescriptorListFilter.class);
} else {
filterCode = shortFilterService.getCode(filter);
......
......@@ -18,7 +18,6 @@ package org.genesys.catalog.api.v0;
import java.io.IOException;
import java.util.UUID;
import org.apache.commons.lang3.StringUtils;
import org.genesys.blocks.security.SecurityContextUtil;
import org.genesys.blocks.security.UserException;
import org.genesys.blocks.security.lockout.AccountLockoutManager;
......@@ -159,6 +158,7 @@ public class MeController {
* @param sort the sort
* @param partnerFilter the partner filter
* @return the page
* @deprecated Moved to PartnerController
*/
@PostMapping(value = "/partners")
public Page<Partner> myPartners(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
......@@ -180,6 +180,7 @@ public class MeController {
* @param filter the filter
* @return the page
* @throws IOException
* @deprecated Moved to DatasetController
*/
@PostMapping(value = "/datasets")
public FilteredPage<Dataset> myDatasets(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
......@@ -189,7 +190,7 @@ public class MeController {
@RequestParam(name = "f", required = false) String filterCode,
@RequestBody(required = false) DatasetFilter filter) throws IOException {
if (StringUtils.isNotBlank(filterCode)) {
if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, DatasetFilter.class);
} else {
filterCode = shortFilterService.getCode(filter);
......@@ -207,6 +208,7 @@ public class MeController {
* @param filter the descriptor filter
* @return the page
* @throws IOException
* @deprecated Moved to DescriptorController
*/
@PostMapping(value = "/descriptors")
public FilteredPage<Descriptor> myDescriptors(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
......@@ -216,7 +218,7 @@ public class MeController {
@RequestParam(name = "f", required = false) String filterCode,
@RequestBody(required = false) DescriptorFilter filter) throws IOException {
if (StringUtils.isNotBlank(filterCode)) {
if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, DescriptorFilter.class);
} else {
filterCode = shortFilterService.getCode(filter);
......@@ -234,6 +236,7 @@ public class MeController {
* @param descriptorListFilter the descriptor list filter
* @return the page
* @throws IOException
* @deprecated Moved to DescriptorListController
*/
@PostMapping(value = "/descriptorlists")
public FilteredPage<DescriptorList> myDescriptorLists(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
......@@ -243,7 +246,7 @@ public class MeController {
@RequestParam(name = "f", required = false) String filterCode,
@RequestBody(required = false) DescriptorListFilter filter) throws IOException {
if (StringUtils.isNotBlank(filterCode)) {
if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, DescriptorListFilter.class);
} else {
filterCode = shortFilterService.getCode(filter);
......
......@@ -18,7 +18,6 @@ package org.genesys.catalog.api.v0;
import java.io.IOException;
import java.util.UUID;
import org.apache.commons.lang3.StringUtils;
import org.genesys.catalog.api.FilteredPage;
import org.genesys.catalog.model.Partner;
import org.genesys.catalog.model.filters.PartnerFilter;
......@@ -26,6 +25,7 @@ import org.genesys.catalog.service.PartnerService;
import org.genesys.catalog.service.ShortFilterService;
import org.genesys2.server.api.ApiBaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.security.access.prepost.PreAuthorize;
......@@ -60,6 +60,26 @@ public class PartnerController {
@Autowired
protected ShortFilterService shortFilterService;
/**
* My partners.
*
* @param page the page
* @param pageSize the page size
* @param direction the direction
* @param sort the sort
* @param partnerFilter the partner filter
* @return the page
*/
@PostMapping(value = "/list-mine")
public Page<Partner> myPartners(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
@RequestParam(name = "l", required = false, defaultValue = "50") final int pageSize,
@RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "name") final String[] sort, @RequestBody final PartnerFilter partnerFilter) {
return partnerService.listPartnersForCurrentUser(partnerFilter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort));
}
/**
* List partners.
*
......@@ -77,9 +97,9 @@ public class PartnerController {
@RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort,
@RequestParam(name = "f", required = false) String filterCode,
@RequestBody PartnerFilter filter) throws IOException {
@RequestBody(required = false) PartnerFilter filter) throws IOException {
if (StringUtils.isNotBlank(filterCode)) {
if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, PartnerFilter.class);
} else {
filterCode = shortFilterService.getCode(filter);
......
......@@ -163,14 +163,22 @@ public class VocabularyController {
* @param sort the sort
* @param filter the controlled vocabulary filter
* @return the page
* @throws IOException
*/
@PostMapping(value = "/list")
public FilteredPage<ControlledVocabulary> list(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
@RequestParam(name = "l", required = false, defaultValue = "50") final int pageSize,
@RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort, @RequestBody final ControlledVocabularyFilter filter) {
return new FilteredPage<>(shortFilterService.getCode(filter), filter, vocabularyService.listVocabularies(filter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort)));
@RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort,
@RequestParam(name = "f", required = false) String filterCode,
@RequestBody(required = false) ControlledVocabularyFilter filter) throws IOException {
if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, ControlledVocabularyFilter.class);
} else {
filterCode = shortFilterService.getCode(filter);
}
return new FilteredPage<>(filterCode, filter, vocabularyService.listVocabularies(filter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort)));
}
/**
......
......@@ -21,6 +21,7 @@ package org.genesys.catalog.exceptions;
*
* @author Andrey Lugovskoy.
*/
// TODO Replace with org.genesys2.server.api.NotFoundElement
public class NotFoundElement extends InvalidApiUsageException {
private static final long serialVersionUID = 6621976491018091330L;
......
......@@ -16,14 +16,16 @@
package org.genesys2.server.api.v1;
import java.io.IOException;
import java.util.Set;
import java.util.UUID;
import org.genesys.catalog.api.FilteredPage;
import org.genesys.catalog.service.ShortFilterService;
import org.genesys2.server.model.impl.Subset;
import org.genesys2.server.service.SubsetService;
import org.genesys2.server.service.filter.SubsetFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.http.MediaType;
......@@ -40,15 +42,15 @@ import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* The Class SubsetRestController.
* The Class SubsetController.
*
* @author Maxym Borodenko
*/
@RestController("subsetApi1")
@PreAuthorize("isAuthenticated()")
@RequestMapping(SubsetRestController.API_BASE)
@RequestMapping(SubsetController.API_BASE)
@Api(tags = { "subset" })
public class SubsetRestController {
public class SubsetController {
/** The Constant API_BASE. */
public static final String API_BASE = "/api/v1/subset";
......@@ -56,6 +58,10 @@ public class SubsetRestController {
@Autowired
private SubsetService subsetService;
/** The short filter service. */
@Autowired
protected ShortFilterService shortFilterService;
/**
* Register the subset.
*
......@@ -90,14 +96,14 @@ public class SubsetRestController {
}
/**
* Delete subset.
* Remove subset.
*
* @param uuid the uuid
* @param version the version
* @return the subset
*/
@DeleteMapping(value = "/{UUID},{version}", produces = { MediaType.APPLICATION_JSON_VALUE })
public Subset delete(@PathVariable("UUID") final UUID uuid, @PathVariable("version") final int version) {
public Subset remove(@PathVariable("UUID") final UUID uuid, @PathVariable("version") final int version) {
return subsetService.delete(subsetService.get(uuid, version));
}
......@@ -110,13 +116,22 @@ public class SubsetRestController {
* @param sort the sort
* @param filter the filter
* @return the page
* @throws IOException
*/
@PostMapping(value = "/list", produces = { MediaType.APPLICATION_JSON_VALUE })
public Page<Subset> list(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
public FilteredPage<Subset> list(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
@RequestParam(name = "l", required = false, defaultValue = "50") final int pageSize,
@RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort, @RequestBody final SubsetFilter filter) {
return subsetService.list(filter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort));
@RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort,
@RequestParam(name = "f", required = false) String filterCode,
@RequestBody(required = false) SubsetFilter filter) throws IOException {
if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, SubsetFilter.class);
} else {
filterCode = shortFilterService.getCode(filter);
}
return new FilteredPage<>(filterCode, filter, subsetService.list(filter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort)));
}
/**
......
......@@ -37,7 +37,7 @@ import java.util.UUID;
import java.util.stream.Collectors;
import org.elasticsearch.common.collect.Lists;
import org.genesys2.server.api.v1.SubsetRestController;
import org.genesys2.server.api.v1.SubsetController;
import org.genesys2.server.model.genesys.Accession;
import org.genesys2.server.model.genesys.AccessionId;
import org.genesys2.server.model.genesys.Taxonomy2;
......@@ -137,7 +137,7 @@ public class SubsetRestControllerTest extends AbstractRestTest {
final String s = verboseMapper.writeValueAsString(setUpSubset());
/*@formatter:off*/
mockMvc.perform(post(SubsetRestController.API_BASE + "/create")
mockMvc.perform(post(SubsetController.API_BASE + "/create")
.contentType(MediaType.APPLICATION_JSON)
.content(s))
// .andDo(MockMvcResultHandlers.print())
......@@ -172,7 +172,7 @@ public class SubsetRestControllerTest extends AbstractRestTest {
final String s = verboseMapper.writeValueAsString(storedSubset);
/*@formatter:off*/
mockMvc.perform(post(SubsetRestController.API_BASE + "/update")
mockMvc.perform(post(SubsetController.API_BASE + "/update")
.contentType(MediaType.APPLICATION_JSON)
.content(s))
// .andDo(MockMvcResultHandlers.print())
......@@ -190,7 +190,7 @@ public class SubsetRestControllerTest extends AbstractRestTest {
final Subset subset = subsetService.create(setUpSubset());
/*@formatter:off*/
mockMvc.perform(get(SubsetRestController.API_BASE.concat("/{UUID}"), subset.getUuid())
mockMvc.perform(get(SubsetController.API_BASE.concat("/{UUID}"), subset.getUuid())
.contentType(MediaType.APPLICATION_JSON))
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
......@@ -204,7 +204,7 @@ public class SubsetRestControllerTest extends AbstractRestTest {
final Subset subset = subsetService.create(setUpSubset());
/*@formatter:off*/
mockMvc.perform(delete(SubsetRestController.API_BASE.concat("/{UUID},{version}"), subset.getUuid(), subset.getVersion())
mockMvc.perform(delete(SubsetController.API_BASE.concat("/{UUID},{version}"), subset.getUuid(), subset.getVersion())
.contentType(MediaType.APPLICATION_JSON))
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
......@@ -221,7 +221,7 @@ public class SubsetRestControllerTest extends AbstractRestTest {
subsetFilter.published = true;
/*@formatter:off*/
mockMvc.perform(post(SubsetRestController.API_BASE.concat("/list"))
mockMvc.perform(post(SubsetController.API_BASE.concat("/list"))
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(subsetFilter)))
// .andDo(MockMvcResultHandlers.print())
......@@ -240,7 +240,7 @@ public class SubsetRestControllerTest extends AbstractRestTest {
final Set<UUID> accessionsUuid = subset.getAccessionIds().stream().map(AccessionId::getUuid).collect(Collectors.toSet());
/*@formatter:off*/
mockMvc.perform(post(SubsetRestController.API_BASE.concat("/remove-accessions/{UUID},{version}"), subset.getUuid(), subset.getVersion())
mockMvc.perform(post(SubsetController.API_BASE.concat("/remove-accessions/{UUID},{version}"), subset.getUuid(), subset.getVersion())
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(accessionsUuid)))
// .andDo(MockMvcResultHandlers.print())
......@@ -261,7 +261,7 @@ public class SubsetRestControllerTest extends AbstractRestTest {
final Set<UUID> accessionsUuid = newAccessions.stream().map(AccessionId::getUuid).collect(Collectors.toSet());
/*@formatter:off*/
mockMvc.perform(post(SubsetRestController.API_BASE.concat("/add-accessions/{UUID},{version}"), subset.getUuid(), subset.getVersion())
mockMvc.perform(post(SubsetController.API_BASE.concat("/add-accessions/{UUID},{version}"), subset.getUuid(), subset.getVersion())
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(accessionsUuid)))
// .andDo(MockMvcResultHandlers.print())
......
......@@ -50,8 +50,9 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@Configuration
@PropertySource("classpath:/spring/spring.properties")
@EnableJpaRepositories(basePackages = { "org.genesys.blocks.persistence", "org.genesys.blocks.security.persistence","org.genesys.blocks.oauth.persistence", "org.genesys.filerepository.persistence", "org.genesys2.server.persistence.acl", "org.genesys2.server.persistence",
"org.genesys2.server.filerepository.persistence" }, repositoryImplementationPostfix = "CustomImpl", entityManagerFactoryRef = "entityManagerFactory", transactionManagerRef = "transactionManager")
@EnableJpaRepositories(basePackages = { "org.genesys.blocks.persistence", "org.genesys.blocks.security.persistence", "org.genesys.blocks.oauth.persistence",
"org.genesys.blocks.auditlog.persistence", "org.genesys2.server.persistence", "org.genesys2.server.persistence.acl",
"org.genesys.filerepository.persistence", "org.genesys.catalog.persistence" }, entityManagerFactoryRef = "entityManagerFactory", transactionManagerRef = "transactionManager", repositoryImplementationPostfix = "CustomImpl")
@EnableTransactionManagement
public class JpaDataConfig {
@Autowired
......@@ -80,7 +81,8 @@ public class JpaDataConfig {
bean.setDataSource(dataSource());
bean.setPersistenceUnitName("spring-jpa");
bean.setPackagesToScan("org.genesys.blocks.model", "org.genesys.blocks.security.model", "org.genesys.blocks.oauth.model", "org.genesys2.server.model", "org.genesys.filerepository.model");
bean.setPackagesToScan("org.genesys.blocks.model", "org.genesys.blocks.auditlog.model", "org.genesys.blocks.security.model",
"org.genesys.blocks.oauth.model", "org.genesys2.server.model", "org.genesys.filerepository.model", "org.genesys.catalog.model");
bean.setPersistenceProvider(new HibernatePersistenceProvider());
final HibernateJpaVendorAdapter jpaVendorAdapter = new HibernateJpaVendorAdapter();
......
......@@ -36,6 +36,8 @@ import org.genesys.blocks.security.service.CustomAclService;
import org.genesys.blocks.security.service.PasswordPolicy;
import org.genesys.blocks.security.service.impl.CustomAclServiceImpl;