External References fetching now also include entities created by user. (Issue #168)
This commit is contained in:
parent
f45e41a625
commit
ebd53e9513
|
@ -2,6 +2,16 @@ package eu.eudat.data.dao.criteria;
|
|||
|
||||
import eu.eudat.data.entities.DataRepository;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class DataRepositoryCriteria extends Criteria<DataRepository> {
|
||||
|
||||
private UUID creationUserId;
|
||||
|
||||
public UUID getCreationUserId() {
|
||||
return creationUserId;
|
||||
}
|
||||
public void setCreationUserId(UUID creationUserId) {
|
||||
this.creationUserId = creationUserId;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,16 @@ package eu.eudat.data.dao.criteria;
|
|||
|
||||
import eu.eudat.data.entities.Registry;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class RegistryCriteria extends Criteria<Registry> {
|
||||
|
||||
private UUID creationUserId;
|
||||
|
||||
public UUID getCreationUserId() {
|
||||
return creationUserId;
|
||||
}
|
||||
public void setCreationUserId(UUID creationUserId) {
|
||||
this.creationUserId = creationUserId;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,16 @@ package eu.eudat.data.dao.criteria;
|
|||
|
||||
import eu.eudat.data.entities.Service;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class ServiceCriteria extends Criteria<Service> {
|
||||
|
||||
private UUID creationUserId;
|
||||
|
||||
public UUID getCreationUserId() {
|
||||
return creationUserId;
|
||||
}
|
||||
public void setCreationUserId(UUID creationUserId) {
|
||||
this.creationUserId = creationUserId;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,11 @@ public class DataRepositoryDaoImpl extends DatabaseAccess<DataRepository> implem
|
|||
public QueryableList<DataRepository> getWithCriteria(DataRepositoryCriteria criteria) {
|
||||
QueryableList<DataRepository> query = this.getDatabaseService().getQueryable(DataRepository.class);
|
||||
if (criteria.getLike() != null)
|
||||
query.where((builder, root) -> builder.equal(root.get("reference"), criteria.getLike()));
|
||||
query.where((builder, root) -> builder.or(
|
||||
builder.like(builder.upper(root.get("reference")), "%" + criteria.getLike().toUpperCase() + "%"),
|
||||
builder.equal(builder.upper(root.get("label")), "%" + criteria.getLike().toUpperCase() + "%")));
|
||||
if (criteria.getCreationUserId() != null)
|
||||
query.where((builder, root) -> builder.equal(root.get("creationUser").get("id"), criteria.getCreationUserId()));
|
||||
return query;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,12 @@ public class RegistryDaoImpl extends DatabaseAccess<Registry> implements Registr
|
|||
public QueryableList<Registry> getWithCriteria(RegistryCriteria criteria) {
|
||||
QueryableList<Registry> query = this.getDatabaseService().getQueryable(Registry.class);
|
||||
if (criteria.getLike() != null)
|
||||
query.where((builder, root) -> builder.equal(root.get("reference"), criteria.getLike()));
|
||||
if (criteria.getLike() != null)
|
||||
query.where((builder, root) -> builder.or(
|
||||
builder.like(builder.upper(root.get("reference")), "%" + criteria.getLike().toUpperCase() + "%"),
|
||||
builder.equal(builder.upper(root.get("label")), "%" + criteria.getLike().toUpperCase() + "%")));
|
||||
if (criteria.getCreationUserId() != null)
|
||||
query.where((builder, root) -> builder.equal(root.get("creationUser").get("id"), criteria.getCreationUserId()));
|
||||
return query;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,11 @@ public class ServiceDaoImpl extends DatabaseAccess<Service> implements ServiceDa
|
|||
public QueryableList<Service> getWithCriteria(ServiceCriteria criteria) {
|
||||
QueryableList<Service> query = this.getDatabaseService().getQueryable(Service.class);
|
||||
if (criteria.getLike() != null)
|
||||
query.where((builder, root) -> builder.equal(root.get("reference"), criteria.getLike()));
|
||||
query.where((builder, root) -> builder.or(
|
||||
builder.like(builder.upper(root.get("reference")), "%" + criteria.getLike().toUpperCase() + "%"),
|
||||
builder.equal(builder.upper(root.get("label")), "%" + criteria.getLike().toUpperCase() + "%")));
|
||||
if (criteria.getCreationUserId() != null)
|
||||
query.where((builder, root) -> builder.equal(root.get("creationUser").get("id"), criteria.getCreationUserId()));
|
||||
return query;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,12 +2,10 @@ package eu.eudat.controllers;
|
|||
|
||||
import eu.eudat.data.entities.DataRepository;
|
||||
import eu.eudat.logic.managers.DataRepositoryManager;
|
||||
import eu.eudat.logic.managers.ResearcherManager;
|
||||
import eu.eudat.logic.proxy.config.exceptions.HugeResultSet;
|
||||
import eu.eudat.logic.proxy.config.exceptions.NoURLFound;
|
||||
import eu.eudat.logic.services.ApiContext;
|
||||
import eu.eudat.models.data.datarepository.DataRepositoryModel;
|
||||
import eu.eudat.models.data.dmp.Researcher;
|
||||
import eu.eudat.models.data.helpers.responses.ResponseItem;
|
||||
import eu.eudat.models.data.security.Principal;
|
||||
import eu.eudat.types.ApiMessageCode;
|
||||
|
@ -18,7 +16,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@RestController
|
||||
|
@ -36,11 +33,11 @@ public class DataRepositories extends BaseController {
|
|||
|
||||
@RequestMapping(method = RequestMethod.GET, produces = "application/json")
|
||||
public @ResponseBody
|
||||
ResponseEntity<ResponseItem<List<Map<String, String>>>> listExternalDataRepositories(
|
||||
@RequestParam(value = "query", required = false) String query, @RequestParam(value = "type", required = false) String type
|
||||
ResponseEntity<ResponseItem<List<DataRepositoryModel>>> listExternalDataRepositories(
|
||||
@RequestParam(value = "query", required = false) String query, @RequestParam(value = "type", required = false) String type, Principal principal
|
||||
) throws HugeResultSet, NoURLFound {
|
||||
List<Map<String, String>> remoteRepos = this.getApiContext().getOperationsContext().getRemoteFetcher().getRepositories(query, type);
|
||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<Map<String, String>>>().status(ApiMessageCode.NO_MESSAGE).payload(remoteRepos));
|
||||
List<DataRepositoryModel> dataRepositoryModels = this.dataRepositoryManager.getDataRepositories(query, type, principal);
|
||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<DataRepositoryModel>>().status(ApiMessageCode.NO_MESSAGE).payload(dataRepositoryModels));
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
|
|
@ -9,7 +9,6 @@ import eu.eudat.models.data.helpers.responses.ResponseItem;
|
|||
import eu.eudat.models.data.registries.RegistryModel;
|
||||
import eu.eudat.models.data.security.Principal;
|
||||
import eu.eudat.types.ApiMessageCode;
|
||||
import org.apache.regexp.RE;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
@ -17,7 +16,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@RestController
|
||||
|
@ -35,10 +33,10 @@ public class Registries extends BaseController {
|
|||
|
||||
@RequestMapping(method = RequestMethod.GET, value = {"/external/registries"}, produces = "application/json")
|
||||
public @ResponseBody
|
||||
ResponseEntity<ResponseItem<List<Map<String, String>>>> listExternalRegistries(@RequestParam(value = "query", required = false) String query
|
||||
, @RequestParam(value = "type", required = false) String type) throws HugeResultSet, NoURLFound {
|
||||
List<Map<String, String>> remoteRepos = this.getApiContext().getOperationsContext().getRemoteFetcher().getRegistries(query, type);
|
||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<Map<String, String>>>().payload(remoteRepos).status(ApiMessageCode.NO_MESSAGE));
|
||||
ResponseEntity<ResponseItem<List<RegistryModel>>> listExternalRegistries(@RequestParam(value = "query", required = false) String query
|
||||
, @RequestParam(value = "type", required = false) String type, Principal principal) throws HugeResultSet, NoURLFound {
|
||||
List<RegistryModel> registryModels = this.registryManager.getRegistries(query, type, principal);
|
||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<RegistryModel>>().payload(registryModels).status(ApiMessageCode.NO_MESSAGE));
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
|
|
@ -16,7 +16,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@RestController
|
||||
|
@ -34,11 +33,11 @@ public class Services extends BaseController {
|
|||
|
||||
@RequestMapping(method = RequestMethod.GET, value = {"/external/services"}, produces = "application/json")
|
||||
public @ResponseBody
|
||||
ResponseEntity<ResponseItem<List<Map<String, String>>>> listExternalServices(
|
||||
@RequestParam(value = "query", required = false) String query, @RequestParam(value = "type", required = false) String type
|
||||
ResponseEntity<ResponseItem<List<ServiceModel>>> listExternalServices(
|
||||
@RequestParam(value = "query", required = false) String query, @RequestParam(value = "type", required = false) String type, Principal principal
|
||||
) throws HugeResultSet, NoURLFound {
|
||||
List<Map<String, String>> remoteRepos = this.getApiContext().getOperationsContext().getRemoteFetcher().getServices(query, type);
|
||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<Map<String, String>>>().payload(remoteRepos).status(ApiMessageCode.NO_MESSAGE));
|
||||
List<ServiceModel> serviceModels = this.serviceManager.getServices(query, type, principal);
|
||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<ServiceModel>>().payload(serviceModels).status(ApiMessageCode.NO_MESSAGE));
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
|
|
@ -1,11 +1,21 @@
|
|||
package eu.eudat.logic.managers;
|
||||
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import eu.eudat.data.dao.criteria.DataRepositoryCriteria;
|
||||
import eu.eudat.data.entities.DataRepository;
|
||||
import eu.eudat.logic.proxy.config.exceptions.HugeResultSet;
|
||||
import eu.eudat.logic.proxy.config.exceptions.NoURLFound;
|
||||
import eu.eudat.logic.services.ApiContext;
|
||||
import eu.eudat.models.data.datarepository.DataRepositoryModel;
|
||||
import eu.eudat.models.data.security.Principal;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Created by ikalyvas on 9/3/2018.
|
||||
*/
|
||||
|
@ -23,4 +33,19 @@ public class DataRepositoryManager {
|
|||
dataRepository.getCreationUser().setId(principal.getId());
|
||||
return apiContext.getOperationsContext().getDatabaseRepository().getDataRepositoryDao().createOrUpdate(dataRepository);
|
||||
}
|
||||
|
||||
public List<DataRepositoryModel> getDataRepositories(String query, String type, Principal principal) throws HugeResultSet, NoURLFound {
|
||||
List<Map<String, String>> remoteRepos = this.apiContext.getOperationsContext().getRemoteFetcher().getRepositories(query, type);
|
||||
|
||||
DataRepositoryCriteria criteria = new DataRepositoryCriteria();
|
||||
if (!query.isEmpty()) criteria.setLike(query);
|
||||
criteria.setCreationUserId(principal.getId());
|
||||
List<DataRepository> dataRepositoryList = (this.apiContext.getOperationsContext().getDatabaseRepository().getDataRepositoryDao().getWithCriteria(criteria)).toList();
|
||||
|
||||
List<DataRepositoryModel> dataRepositoryModels = dataRepositoryList.stream().map(item -> new DataRepositoryModel().fromDataModel(item)).collect(Collectors.toList());
|
||||
ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
dataRepositoryModels.addAll(remoteRepos.stream().map(item -> mapper.convertValue(item, DataRepositoryModel.class)).collect(Collectors.toList()));
|
||||
|
||||
return dataRepositoryModels;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -338,10 +338,11 @@ public class DatasetManager {
|
|||
UserInfo userInfo = apiContext.getOperationsContext().getBuilderFactory().getBuilder(UserInfoBuilder.class).id(principal.getId()).build();
|
||||
dataset.setCreator(userInfo);
|
||||
|
||||
createRegistriesIfTheyDontExist(apiContext.getOperationsContext().getDatabaseRepository().getRegistryDao(), dataset);
|
||||
createDataRepositoriesIfTheyDontExist(apiContext.getOperationsContext().getDatabaseRepository().getDataRepositoryDao(), dataset);
|
||||
createServicesIfTheyDontExist(dataset);
|
||||
createExternalDatasetsIfTheyDontExist(dataset);
|
||||
createRegistriesIfTheyDontExist(apiContext.getOperationsContext().getDatabaseRepository().getRegistryDao(), dataset);
|
||||
createServicesIfTheyDontExist(dataset);
|
||||
|
||||
Dataset dataset1 = apiContext.getOperationsContext().getDatabaseRepository().getDatasetDao().createOrUpdate(dataset);
|
||||
datasetWizardModel.setId(dataset1.getId());
|
||||
updateTags(apiContext.getOperationsContext().getDatasetRepository(), datasetWizardModel);
|
||||
|
@ -415,6 +416,7 @@ public class DatasetManager {
|
|||
datasetDataRepository.setDataset(dataset);
|
||||
dataset.getDatasetDataRepositories().add(datasetDataRepository);
|
||||
} else {
|
||||
datasetDataRepository.getDataRepository().setId(UUID.randomUUID());
|
||||
DataRepository dataRepository = dataRepositoryDao.createOrUpdate(datasetDataRepository.getDataRepository());
|
||||
datasetDataRepository.setDataset(dataset);
|
||||
datasetDataRepository.setDataRepository(dataRepository);
|
||||
|
|
|
@ -1,12 +1,21 @@
|
|||
package eu.eudat.logic.managers;
|
||||
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import eu.eudat.data.dao.criteria.RegistryCriteria;
|
||||
import eu.eudat.data.entities.Registry;
|
||||
import eu.eudat.logic.proxy.config.exceptions.HugeResultSet;
|
||||
import eu.eudat.logic.proxy.config.exceptions.NoURLFound;
|
||||
import eu.eudat.logic.services.ApiContext;
|
||||
import eu.eudat.models.data.registries.RegistryModel;
|
||||
import eu.eudat.models.data.security.Principal;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
public class RegistryManager {
|
||||
|
||||
|
@ -22,4 +31,19 @@ public class RegistryManager {
|
|||
registry.getCreationUser().setId(principal.getId());
|
||||
return apiContext.getOperationsContext().getDatabaseRepository().getRegistryDao().createOrUpdate(registry);
|
||||
}
|
||||
|
||||
public List<RegistryModel> getRegistries(String query, String type, Principal principal) throws HugeResultSet, NoURLFound {
|
||||
List<Map<String, String>> remoteRepos = this.apiContext.getOperationsContext().getRemoteFetcher().getRegistries(query, type);
|
||||
|
||||
RegistryCriteria criteria = new RegistryCriteria();
|
||||
if (!query.isEmpty()) criteria.setLike(query);
|
||||
criteria.setCreationUserId(principal.getId());
|
||||
List<Registry> registryList = (this.apiContext.getOperationsContext().getDatabaseRepository().getRegistryDao().getWithCriteria(criteria)).toList();
|
||||
|
||||
List<RegistryModel> registryModels = registryList.stream().map(item -> new RegistryModel().fromDataModel(item)).collect(Collectors.toList());
|
||||
ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
registryModels.addAll(remoteRepos.stream().map(item -> mapper.convertValue(item, RegistryModel.class)).collect(Collectors.toList()));
|
||||
|
||||
return registryModels;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,21 @@
|
|||
package eu.eudat.logic.managers;
|
||||
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import eu.eudat.data.dao.criteria.ServiceCriteria;
|
||||
import eu.eudat.data.entities.Service;
|
||||
import eu.eudat.logic.proxy.config.exceptions.HugeResultSet;
|
||||
import eu.eudat.logic.proxy.config.exceptions.NoURLFound;
|
||||
import eu.eudat.logic.services.ApiContext;
|
||||
import eu.eudat.models.data.security.Principal;
|
||||
import eu.eudat.models.data.services.ServiceModel;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Created by ikalyvas on 9/3/2018.
|
||||
*/
|
||||
|
@ -25,4 +34,19 @@ public class ServiceManager {
|
|||
service.getCreationUser().setId(principal.getId());
|
||||
return apiContext.getOperationsContext().getDatabaseRepository().getServiceDao().createOrUpdate(service);
|
||||
}
|
||||
|
||||
public List<ServiceModel> getServices(String query, String type, Principal principal) throws HugeResultSet, NoURLFound {
|
||||
List<Map<String, String>> remoteRepos = this.apiContext.getOperationsContext().getRemoteFetcher().getServices(query, type);
|
||||
|
||||
ServiceCriteria criteria = new ServiceCriteria();
|
||||
if (!query.isEmpty()) criteria.setLike(query);
|
||||
criteria.setCreationUserId(principal.getId());
|
||||
List<Service> serviceList = (this.apiContext.getOperationsContext().getDatabaseRepository().getServiceDao().getWithCriteria(criteria)).toList();
|
||||
|
||||
List<ServiceModel> serviceModels = serviceList.stream().map(item -> new ServiceModel().fromDataModel(item)).collect(Collectors.toList());
|
||||
ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
serviceModels.addAll(remoteRepos.stream().map(item -> mapper.convertValue(item, ServiceModel.class)).collect(Collectors.toList()));
|
||||
|
||||
return serviceModels;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package eu.eudat.models.data.datarepository;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import eu.eudat.data.entities.DataRepository;
|
||||
import eu.eudat.data.entities.UserInfo;
|
||||
import eu.eudat.models.DataModel;
|
||||
|
@ -11,12 +12,14 @@ import java.util.UUID;
|
|||
* Created by ikalyvas on 9/3/2018.
|
||||
*/
|
||||
public class DataRepositoryModel implements DataModel<DataRepository, DataRepositoryModel> {
|
||||
public UUID id;
|
||||
public String label;
|
||||
public String abbreviation;
|
||||
public String uri;
|
||||
public Date created;
|
||||
public Date modified;
|
||||
private UUID id;
|
||||
@JsonProperty("name")
|
||||
private String label;
|
||||
private String abbreviation;
|
||||
private String uri;
|
||||
private Date created;
|
||||
private Date modified;
|
||||
private String tag;
|
||||
|
||||
public UUID getId() {
|
||||
return id;
|
||||
|
@ -60,12 +63,20 @@ public class DataRepositoryModel implements DataModel<DataRepository, DataReposi
|
|||
this.modified = modified;
|
||||
}
|
||||
|
||||
public String getTag() {
|
||||
return tag;
|
||||
}
|
||||
public void setTag(String tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataRepositoryModel fromDataModel(DataRepository entity) {
|
||||
this.setAbbreviation(entity.getAbbreviation());
|
||||
this.setLabel(entity.getLabel());
|
||||
this.setUri(entity.getUri());
|
||||
this.setId(entity.getId());
|
||||
this.tag = "Internal";
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ public class DataRepository implements DataModel<eu.eudat.data.entities.DataRepo
|
|||
entity.setCreated(new Date());
|
||||
entity.setModified(new Date());
|
||||
entity.setStatus((short) 0);
|
||||
entity.setReference(this.reference);
|
||||
entity.setReference("dmpdata/" + this.label);
|
||||
return entity;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,18 +5,20 @@ import eu.eudat.data.entities.UserInfo;
|
|||
import eu.eudat.models.DataModel;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Created by ikalyvas on 9/3/2018.
|
||||
*/
|
||||
public class RegistryModel implements DataModel<Registry, RegistryModel> {
|
||||
public UUID id;
|
||||
public String label;
|
||||
public String abbreviation;
|
||||
public String uri;
|
||||
public Date created;
|
||||
public Date modified;
|
||||
private UUID id;
|
||||
private String label;
|
||||
private String abbreviation;
|
||||
private String uri;
|
||||
private Date created;
|
||||
private Date modified;
|
||||
private String tag;
|
||||
|
||||
public UUID getId() {
|
||||
return id;
|
||||
|
@ -60,6 +62,13 @@ public class RegistryModel implements DataModel<Registry, RegistryModel> {
|
|||
this.modified = modified;
|
||||
}
|
||||
|
||||
public String getTag() {
|
||||
return tag;
|
||||
}
|
||||
public void setTag(String tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RegistryModel fromDataModel(Registry entity) {
|
||||
this.id = entity.getId();
|
||||
|
@ -68,6 +77,7 @@ public class RegistryModel implements DataModel<Registry, RegistryModel> {
|
|||
this.label = entity.getLabel();
|
||||
this.modified = entity.getModified();
|
||||
this.uri = entity.getUri();
|
||||
this.tag = "Internal";
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,17 +11,17 @@ import java.util.UUID;
|
|||
* Created by ikalyvas on 9/3/2018.
|
||||
*/
|
||||
public class ServiceModel implements DataModel<Service, ServiceModel> {
|
||||
public UUID id;
|
||||
public String label;
|
||||
public String abbreviation;
|
||||
public String uri;
|
||||
public Date created;
|
||||
public Date modified;
|
||||
private UUID id;
|
||||
private String label;
|
||||
private String abbreviation;
|
||||
private String uri;
|
||||
private Date created;
|
||||
private Date modified;
|
||||
private String tag;
|
||||
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
@ -29,7 +29,6 @@ public class ServiceModel implements DataModel<Service, ServiceModel> {
|
|||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
@ -37,7 +36,6 @@ public class ServiceModel implements DataModel<Service, ServiceModel> {
|
|||
public String getAbbreviation() {
|
||||
return abbreviation;
|
||||
}
|
||||
|
||||
public void setAbbreviation(String abbreviation) {
|
||||
this.abbreviation = abbreviation;
|
||||
}
|
||||
|
@ -45,7 +43,6 @@ public class ServiceModel implements DataModel<Service, ServiceModel> {
|
|||
public String getUri() {
|
||||
return uri;
|
||||
}
|
||||
|
||||
public void setUri(String uri) {
|
||||
this.uri = uri;
|
||||
}
|
||||
|
@ -53,7 +50,6 @@ public class ServiceModel implements DataModel<Service, ServiceModel> {
|
|||
public Date getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public void setCreated(Date created) {
|
||||
this.created = created;
|
||||
}
|
||||
|
@ -61,11 +57,17 @@ public class ServiceModel implements DataModel<Service, ServiceModel> {
|
|||
public Date getModified() {
|
||||
return modified;
|
||||
}
|
||||
|
||||
public void setModified(Date modified) {
|
||||
this.modified = modified;
|
||||
}
|
||||
|
||||
public String getTag() {
|
||||
return tag;
|
||||
}
|
||||
public void setTag(String tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServiceModel fromDataModel(Service entity) {
|
||||
this.abbreviation = entity.getAbbreviation();
|
||||
|
@ -74,6 +76,7 @@ public class ServiceModel implements DataModel<Service, ServiceModel> {
|
|||
this.label = entity.getLabel();
|
||||
this.modified = entity.getModified();
|
||||
this.uri = entity.getUri();
|
||||
this.tag = "Internal";
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue