From 5057ea82ce8e1497a526f0997b35cfdd7a58ddba Mon Sep 17 00:00:00 2001 From: Milan D Date: Sun, 8 Dec 2019 03:58:12 +0100 Subject: [PATCH 001/134] Personalisation Endpoint Working Patch for Personalisation Endpoint; Requires additional testing & possibly more comments/renaming --- .classpath | 146 ++--- bin/JOOQGeneration/reqbaz_generation_info.xml | 4 +- bin/JOOQGeneration/run.sh | 2 +- .../V3__add_personalisation_table.sql | 25 + src/i18n/Translation_de.properties | 2 + src/i18n/Translation_en.properties | 2 + .../acis/bazaar/service/BazaarService.java | 1 + .../service/PersonalisationDataResource.java | 181 +++++++ .../acis/bazaar/service/dal/DALFacade.java | 15 + .../bazaar/service/dal/DALFacadeImpl.java | 12 + .../dal/entities/PersonalisationData.java | 140 +++++ .../service/dal/entities/PrivilegeEnum.java | 1 + .../acis/bazaar/service/dal/jooq/Keys.java | 16 + .../acis/bazaar/service/dal/jooq/Reqbaz.java | 16 +- .../acis/bazaar/service/dal/jooq/Tables.java | 12 + .../dal/jooq/tables/PersonalisationData.java | 167 ++++++ .../dal/jooq/tables/SchemaVersion.java | 164 ++++++ .../bazaar/service/dal/jooq/tables/User.java | 4 +- .../records/PersonalisationDataRecord.java | 380 +++++++++++++ .../tables/records/SchemaVersionRecord.java | 503 ++++++++++++++++++ .../PersonalisationDataRepository.java | 11 + .../PersonalisationDataRepositoryImpl.java | 56 ++ .../PersonalisationDataTransformer.java | 103 ++++ 23 files changed, 1885 insertions(+), 78 deletions(-) mode change 100644 => 100755 bin/JOOQGeneration/run.sh create mode 100644 etc/migrations/V3__add_personalisation_table.sql create mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java create mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java create mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/PersonalisationData.java create mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/SchemaVersion.java create mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/PersonalisationDataRecord.java create mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/SchemaVersionRecord.java create mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepository.java create mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepositoryImpl.java create mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java diff --git a/.classpath b/.classpath index 9a59b4ce..cb862606 100755 --- a/.classpath +++ b/.classpath @@ -4,78 +4,80 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bin/JOOQGeneration/reqbaz_generation_info.xml b/bin/JOOQGeneration/reqbaz_generation_info.xml index 163696d7..63ea411c 100644 --- a/bin/JOOQGeneration/reqbaz_generation_info.xml +++ b/bin/JOOQGeneration/reqbaz_generation_info.xml @@ -11,7 +11,7 @@ - org.jooq.util.DefaultGenerator + org.jooq.util.JavaGenerator - ..\..\src\main + ../../src/main \ No newline at end of file diff --git a/bin/JOOQGeneration/run.sh b/bin/JOOQGeneration/run.sh old mode 100644 new mode 100755 index 9527aedc..01bb562d --- a/bin/JOOQGeneration/run.sh +++ b/bin/JOOQGeneration/run.sh @@ -1 +1 @@ -java -classpath ../../service/jooq-3.9.1.jar:../../service/jooq-meta-3.9.1.jar:../../service/jooq-codegen-3.9.1.jar:../../service/mysql-connector-java-5.1.6.jar:. org.jooq.util.GenerationTool /reqbaz_generation_info.xml +java -classpath ../../service/jooq-3.9.1.jar:../../service/jooq-meta-3.9.1.jar:../../service/jooq-codegen-3.9.1.jar:../../service/mysql-connector-java-6.0.5.jar:. org.jooq.util.GenerationTool /reqbaz_generation_info.xml diff --git a/etc/migrations/V3__add_personalisation_table.sql b/etc/migrations/V3__add_personalisation_table.sql new file mode 100644 index 00000000..deb522c4 --- /dev/null +++ b/etc/migrations/V3__add_personalisation_table.sql @@ -0,0 +1,25 @@ +CREATE TABLE IF NOT EXISTS reqbaz.personalisation_data ( + id INT NOT NULL AUTO_INCREMENT, + creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + last_updated_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + identifier VARCHAR(50) NOT NULL, + user_id INT NOT NULL, + version INT NOT NULL, + setting TEXT, + CONSTRAINT personalisation_pk PRIMARY KEY (id), + CONSTRAINT personalisation_key UNIQUE KEY (identifier,user_id,version), + CONSTRAINT personalisation_user FOREIGN KEY personalisation_user (user_id) REFERENCES user (id) +); + +REPLACE INTO reqbaz.privilege +(id, name) +VALUES +(27, 'Read_PERSONALISATION_DATA'), +(28, 'Create_PERSONALISATION_DATA'); + + +REPLACE INTO reqbaz.role_privilege_map +(id, role_id, privilege_id) +VALUES +(31, 2, 27), +(32, 2, 28); \ No newline at end of file diff --git a/src/i18n/Translation_de.properties b/src/i18n/Translation_de.properties index caddab3b..ff9e3207 100644 --- a/src/i18n/Translation_de.properties +++ b/src/i18n/Translation_de.properties @@ -40,6 +40,8 @@ error.authorization.comment.create=Nur Projektmitglieder können Kommentare erst error.authorization.comment.modify=Nur der Ersteller eines Kommentars kann ein Kommentar verändern. error.authorization.attachment.create=Nur Projektmitglieder können Anhänge erstellen. error.authorization.attachment.modify=Nur der Ersteller von einem Anhang kann einen Anhang verändern. +error.authorization.personalisationData.read=Nur angemeldete Benutzer können ihre Daten lesen. +error.authorization.personalisationData.create=Nur angemeldete Benutzer können ihre Daten schreiben. error.unknown_exception=%s Fehler in %s\: %s Fehlercode\: %d category.uncategorized.Name=Standard category.uncategorized.Description=Anforderungen welche zu keiner Projektkomponente gehört. diff --git a/src/i18n/Translation_en.properties b/src/i18n/Translation_en.properties index ffb99a1f..97e80a49 100644 --- a/src/i18n/Translation_en.properties +++ b/src/i18n/Translation_en.properties @@ -40,6 +40,8 @@ error.authorization.comment.create=Only project members can create comments. error.authorization.comment.modify=Only the creator can modify comments. error.authorization.attachment.create=Only project members can create attachments. error.authorization.attachment.modify=Only the creator can modify attachments. +error.authorization.personalisationData.read=Only logged in users can read their personal data. +error.authorization.personalisationData.create=Only logged in users can write their personal data. error.unknown_exception=%s Error in %s\: %s ExceptionCode\: %d. category.uncategorized.Name=Default category.uncategorized.Description=Requirements which do not belong to any category. diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/BazaarService.java b/src/main/de/rwth/dbis/acis/bazaar/service/BazaarService.java index a128836e..b1d1c622 100755 --- a/src/main/de/rwth/dbis/acis/bazaar/service/BazaarService.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/BazaarService.java @@ -104,6 +104,7 @@ protected void initResources() { getResourceConfig().register(CommentsResource.class); getResourceConfig().register(AttachmentsResource.class); getResourceConfig().register(UsersResource.class); + getResourceConfig().register(PersonalisationDataResource.class); } public BazaarService() throws Exception { diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java b/src/main/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java new file mode 100644 index 00000000..7021cbb3 --- /dev/null +++ b/src/main/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java @@ -0,0 +1,181 @@ +package de.rwth.dbis.acis.bazaar.service; + +import de.rwth.dbis.acis.bazaar.service.dal.DALFacade; +import de.rwth.dbis.acis.bazaar.service.dal.entities.PersonalisationData; +import de.rwth.dbis.acis.bazaar.service.dal.entities.PrivilegeEnum; +import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; +import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; +import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; +import de.rwth.dbis.acis.bazaar.service.exception.ExceptionLocation; +import de.rwth.dbis.acis.bazaar.service.internalization.Localization; +import de.rwth.dbis.acis.bazaar.service.security.AuthorizationManager; +import i5.las2peer.api.Context; +import i5.las2peer.logging.NodeObserver; +import i5.las2peer.logging.L2pLogger; +import i5.las2peer.security.UserAgent; +import io.swagger.annotations.*; +import jodd.vtor.Vtor; + +import javax.ws.rs.*; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import java.net.HttpURLConnection; +import java.util.*; + + +@Api(value = "personalisation", description = "Personalisation Data resource") +@SwaggerDefinition( + info = @Info( + title = "Requirements Bazaar", + version = "0.6", + description = "Requirements Bazaar project", + termsOfService = "http://requirements-bazaar.org", + contact = @Contact( + name = "Requirements Bazaar Dev Team", + url = "http://requirements-bazaar.org", + email = "info@requirements-bazaar.org" + ), + license = @License( + name = "Apache2", + url = "http://requirements-bazaar.org/license" + ) + ), + schemes = SwaggerDefinition.Scheme.HTTPS +) +@Path("/personalisation") +public class PersonalisationDataResource { + + private final L2pLogger logger = L2pLogger.getInstance(AttachmentsResource.class.getName()); + private BazaarService bazaarService; + + public PersonalisationDataResource() throws Exception { + bazaarService = (BazaarService) Context.getCurrent().getService(); + } + + + + /** + * This method allows to retrieve a certain stored personalisationData value. + * + * @param key The plugins identifier + * @param version The plugins identifier + * @return Response with attachment as a JSON object. + */ + @GET + @Path("/{key}/{version}") + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "This method allows to retrieve a certain personalisationData value") + @ApiResponses(value = { + @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns a certain personalisationData", response = PersonalisationData.class), + @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), + @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), + @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") + }) + public Response getPersonalisationData(@PathParam("key") String key, @PathParam("version") int version) { + DALFacade dalFacade = null; + try { + UserAgent agent = (UserAgent) Context.getCurrent().getMainAgent(); + long userId = agent.getId(); + String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); + if (registrarErrors != null) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); + } + dalFacade = bazaarService.getDBConnection(); + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PERSONALISATION_DATA, dalFacade); + if (!authorized) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.personalisationData.read")); + } + PersonalisationData data = dalFacade.getPersonalisationData(internalUserId, key, version); + return Response.ok(data.toJSON()).build(); + } catch (BazaarException bex) { + if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { + return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { + return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else { + logger.warning(bex.getMessage()); + L2pLogger.logEvent(NodeObserver.Event.SERVICE_ERROR, Context.getCurrent().getMainAgent(), "Get personalisationData " + key+" version:"+version ); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } + } catch (Exception ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + logger.warning(bex.getMessage()); + L2pLogger.logEvent(NodeObserver.Event.SERVICE_ERROR, Context.getCurrent().getMainAgent(), "Get personalisationData " + key+" version:"+version ); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } finally { + bazaarService.closeDBConnection(dalFacade); + } + } + + /** + * This method allows to save a personalisationData + * + * @param data as JSON object + * @return Response with the created attachment as JSON object. + */ + @PUT + @Path("/") + @Consumes(MediaType.APPLICATION_JSON) + //@Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "This method allows to save a personalisationData item") + @ApiResponses(value = { + @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Success"), + @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), + @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), + @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") + }) + public Response setPersonalisationData(@ApiParam(value = "PersonalisationData as JSON", required = true) PersonalisationData data) { + DALFacade dalFacade = null; + try { + UserAgent agent = (UserAgent) Context.getCurrent().getMainAgent(); + long userId = agent.getId(); + + String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); + if (registrarErrors != null) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); + } + + dalFacade = bazaarService.getDBConnection(); + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + + + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Create_PERSONALISATION_DATA, dalFacade); + if (!authorized) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.comment.create")); + } + + PersonalisationData fullData = PersonalisationData.getBuilder().key(data.getKey()).userId(internalUserId).version(data.getVersion()).value(data.getValue()).build(); + + + Vtor vtor = bazaarService.getValidators(); + vtor.useProfiles("create"); + vtor.validate(data); + if (vtor.hasViolations()) { + ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); + } + dalFacade.setPersonalisationData(fullData); + + + return Response.status(Response.Status.OK).build(); + } catch (BazaarException bex) { + if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { + return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else { + logger.warning(bex.getMessage()); + L2pLogger.logEvent(NodeObserver.Event.SERVICE_ERROR, Context.getCurrent().getMainAgent(), "Create comment"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } + } catch (Exception ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + logger.warning(bex.getMessage()); + L2pLogger.logEvent(NodeObserver.Event.SERVICE_ERROR, Context.getCurrent().getMainAgent(), "Create comment"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } finally { + bazaarService.closeDBConnection(dalFacade); + } + } + + +} \ No newline at end of file diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java index 6a13f804..89ea6ee6 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java @@ -564,4 +564,19 @@ public interface DALFacade { void addUserToRole(int userId, String roleName, String context) throws BazaarException; //endregion + + + + /** + * Receives the PersonalisationData for a given userid, key and version + * @param userId which owns the personalisationData. + * @param key which identifies the personalisationData. + * @param version of the key's plugin + */ + PersonalisationData getPersonalisationData(int userId, String key, int version) throws BazaarException; + /** + * Creates a new record or alters the existing record to save a given personalisationData + * @param personalisationData which holds the data to be saved + */ + void setPersonalisationData(PersonalisationData personalisationData) throws BazaarException; } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index 3328b088..700ac460 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -61,6 +61,7 @@ public class DALFacadeImpl implements DALFacade { private VoteRepository voteRepository; private RoleRepository roleRepository; private PrivilegeRepository privilegeRepository; + private PersonalisationDataRepository personalisationDataRepository; public DALFacadeImpl(DataSource dataSource, SQLDialect dialect) { dslContext = DSL.using(dataSource, dialect); @@ -606,4 +607,15 @@ public void addUserToRole(int userId, String roleName, String context) throws Ba roleRepository = (roleRepository != null) ? roleRepository : new RoleRepositoryImpl(dslContext); roleRepository.addUserToRole(userId, roleName, context); } + @Override + public PersonalisationData getPersonalisationData(int userId, String key, int version) throws BazaarException { + personalisationDataRepository = (personalisationDataRepository != null) ? personalisationDataRepository : new PersonalisationDataRepositoryImpl(dslContext); + return personalisationDataRepository.findByKey(userId,version,key); + } + @Override + public void setPersonalisationData(PersonalisationData personalisationData) throws BazaarException { + personalisationDataRepository = (personalisationDataRepository != null) ? personalisationDataRepository : new PersonalisationDataRepositoryImpl(dslContext); + personalisationDataRepository.insertOrUpdate(personalisationData); + + } } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java new file mode 100644 index 00000000..1d649196 --- /dev/null +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java @@ -0,0 +1,140 @@ +/* + * + * Copyright (c) 2014, RWTH Aachen University. + * For a list of contributors see the AUTHORS file at the top-level directory + * of this distribution. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * / + */ + +package de.rwth.dbis.acis.bazaar.service.dal.entities; + + +import com.fasterxml.jackson.annotation.JsonFormat; +import jodd.vtor.constraint.MaxLength; +import jodd.vtor.constraint.Min; +import jodd.vtor.constraint.NotBlank; +import jodd.vtor.constraint.NotNull; + +import javax.validation.constraints.Null; + +/** + * @author Milan Deruelle + * @since 26/11/2019 + */ +public class PersonalisationData extends EntityBase { + + + private int id; + + + @NotBlank(profiles = {"*"}) + @NotNull(profiles = {"create"}) + @MaxLength(value = 50, profiles = {"*"}) + private String key; + + @Min(value = 0, profiles = {"create"}) + private int version; + + private int userId; + + @NotBlank(profiles = {"*"}) + @NotNull(profiles = {"create"}) + @MaxLength(value = 10000, profiles = {"*"}) + private String value; + + public PersonalisationData(){ + + } + + private PersonalisationData(Builder builder) { + id = builder.id; + key = builder.key; + version = builder.version; + userId = builder.userId; + value = builder.value; + } + + public int getId() { + return id; + } + + public String getKey() { + return key; + } + public void setKey() { + this.key = key; + } + + public int getVersion() { + return version; + } + public void setVersion() { + this.version = version; + } + + public int getUserId() { + return userId; + } + public void setUserId() { + this.userId = userId; + } + + public String getValue(){ + return value; + } + public void setValue() { + this.value = value; + } + + public static Builder getBuilder() { + return new Builder(); + } + + public static class Builder { + private int id; + private String key; + private int version; + private int userId; + private String value; + + public Builder id(int id) { + this.id = id; + return this; + } + + public Builder key(String key) { + this.key = key; + return this; + } + + public Builder version(int version) { + this.version = version; + return this; + } + + public Builder userId(int userId) { + this.userId = userId; + return this; + } + public Builder value(String value) { + this.value = value; + return this; + } + + public PersonalisationData build() { + return new PersonalisationData(this); + } + } +} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java index 68e4b9ae..0493a646 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java @@ -54,4 +54,5 @@ public enum PrivilegeEnum { Create_FOLLOW, Delete_FOLLOW, Create_DEVELOP, Delete_DEVELOP, + Read_PERSONALISATION_DATA, Create_PERSONALISATION_DATA //Create covers "PUT" Operation } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Keys.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Keys.java index b8d58f5f..7e283710 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Keys.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Keys.java @@ -8,6 +8,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Category; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.CategoryFollowerMap; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.PersonalisationData; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Privilege; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Project; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.ProjectFollowerMap; @@ -18,6 +19,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Role; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RolePrivilegeMap; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RoleRoleMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.SchemaVersion; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.UserRoleMap; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Vote; @@ -25,6 +27,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CategoryFollowerMapRecord; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CategoryRecord; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CommentRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.PersonalisationDataRecord; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.PrivilegeRecord; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.ProjectFollowerMapRecord; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.ProjectRecord; @@ -35,6 +38,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RolePrivilegeMapRecord; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RoleRecord; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RoleRoleMapRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.SchemaVersionRecord; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.UserRecord; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.UserRoleMapRecord; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.VoteRecord; @@ -69,6 +73,7 @@ public class Keys { public static final Identity IDENTITY_CATEGORY = Identities0.IDENTITY_CATEGORY; public static final Identity IDENTITY_CATEGORY_FOLLOWER_MAP = Identities0.IDENTITY_CATEGORY_FOLLOWER_MAP; public static final Identity IDENTITY_COMMENT = Identities0.IDENTITY_COMMENT; + public static final Identity IDENTITY_PERSONALISATION_DATA = Identities0.IDENTITY_PERSONALISATION_DATA; public static final Identity IDENTITY_PRIVILEGE = Identities0.IDENTITY_PRIVILEGE; public static final Identity IDENTITY_PROJECT = Identities0.IDENTITY_PROJECT; public static final Identity IDENTITY_PROJECT_FOLLOWER_MAP = Identities0.IDENTITY_PROJECT_FOLLOWER_MAP; @@ -91,6 +96,8 @@ public class Keys { public static final UniqueKey KEY_CATEGORY_PRIMARY = UniqueKeys0.KEY_CATEGORY_PRIMARY; public static final UniqueKey KEY_CATEGORY_FOLLOWER_MAP_PRIMARY = UniqueKeys0.KEY_CATEGORY_FOLLOWER_MAP_PRIMARY; public static final UniqueKey KEY_COMMENT_PRIMARY = UniqueKeys0.KEY_COMMENT_PRIMARY; + public static final UniqueKey KEY_PERSONALISATION_DATA_PRIMARY = UniqueKeys0.KEY_PERSONALISATION_DATA_PRIMARY; + public static final UniqueKey KEY_PERSONALISATION_DATA_PERSONALISATION_KEY = UniqueKeys0.KEY_PERSONALISATION_DATA_PERSONALISATION_KEY; public static final UniqueKey KEY_PRIVILEGE_PRIMARY = UniqueKeys0.KEY_PRIVILEGE_PRIMARY; public static final UniqueKey KEY_PROJECT_PRIMARY = UniqueKeys0.KEY_PROJECT_PRIMARY; public static final UniqueKey KEY_PROJECT_FOLLOWER_MAP_PRIMARY = UniqueKeys0.KEY_PROJECT_FOLLOWER_MAP_PRIMARY; @@ -102,7 +109,9 @@ public class Keys { public static final UniqueKey KEY_ROLE_ROLE_IDX_1 = UniqueKeys0.KEY_ROLE_ROLE_IDX_1; public static final UniqueKey KEY_ROLE_PRIVILEGE_MAP_PRIMARY = UniqueKeys0.KEY_ROLE_PRIVILEGE_MAP_PRIMARY; public static final UniqueKey KEY_ROLE_ROLE_MAP_PRIMARY = UniqueKeys0.KEY_ROLE_ROLE_MAP_PRIMARY; + public static final UniqueKey KEY_SCHEMA_VERSION_PRIMARY = UniqueKeys0.KEY_SCHEMA_VERSION_PRIMARY; public static final UniqueKey KEY_USER_PRIMARY = UniqueKeys0.KEY_USER_PRIMARY; + public static final UniqueKey KEY_USER_LAS2PEER_IDX = UniqueKeys0.KEY_USER_LAS2PEER_IDX; public static final UniqueKey KEY_USER_ROLE_MAP_PRIMARY = UniqueKeys0.KEY_USER_ROLE_MAP_PRIMARY; public static final UniqueKey KEY_VOTE_PRIMARY = UniqueKeys0.KEY_VOTE_PRIMARY; @@ -119,6 +128,7 @@ public class Keys { public static final ForeignKey COMMENT_REQUIREMENT = ForeignKeys0.COMMENT_REQUIREMENT; public static final ForeignKey COMMENT_USER = ForeignKeys0.COMMENT_USER; public static final ForeignKey REPLY_COMMENT = ForeignKeys0.REPLY_COMMENT; + public static final ForeignKey PERSONALISATION_USER = ForeignKeys0.PERSONALISATION_USER; public static final ForeignKey PROJECT_USER = ForeignKeys0.PROJECT_USER; public static final ForeignKey PROJECT_CATEGORY = ForeignKeys0.PROJECT_CATEGORY; public static final ForeignKey PROJECT_FOLLOWER_MAP_PROJECT = ForeignKeys0.PROJECT_FOLLOWER_MAP_PROJECT; @@ -150,6 +160,7 @@ private static class Identities0 extends AbstractKeys { public static Identity IDENTITY_CATEGORY = createIdentity(Category.CATEGORY, Category.CATEGORY.ID); public static Identity IDENTITY_CATEGORY_FOLLOWER_MAP = createIdentity(CategoryFollowerMap.CATEGORY_FOLLOWER_MAP, CategoryFollowerMap.CATEGORY_FOLLOWER_MAP.ID); public static Identity IDENTITY_COMMENT = createIdentity(Comment.COMMENT, Comment.COMMENT.ID); + public static Identity IDENTITY_PERSONALISATION_DATA = createIdentity(PersonalisationData.PERSONALISATION_DATA, PersonalisationData.PERSONALISATION_DATA.ID); public static Identity IDENTITY_PRIVILEGE = createIdentity(Privilege.PRIVILEGE, Privilege.PRIVILEGE.ID); public static Identity IDENTITY_PROJECT = createIdentity(Project.PROJECT, Project.PROJECT.ID); public static Identity IDENTITY_PROJECT_FOLLOWER_MAP = createIdentity(ProjectFollowerMap.PROJECT_FOLLOWER_MAP, ProjectFollowerMap.PROJECT_FOLLOWER_MAP.ID); @@ -170,6 +181,8 @@ private static class UniqueKeys0 extends AbstractKeys { public static final UniqueKey KEY_CATEGORY_PRIMARY = createUniqueKey(Category.CATEGORY, "KEY_category_PRIMARY", Category.CATEGORY.ID); public static final UniqueKey KEY_CATEGORY_FOLLOWER_MAP_PRIMARY = createUniqueKey(CategoryFollowerMap.CATEGORY_FOLLOWER_MAP, "KEY_category_follower_map_PRIMARY", CategoryFollowerMap.CATEGORY_FOLLOWER_MAP.ID); public static final UniqueKey KEY_COMMENT_PRIMARY = createUniqueKey(Comment.COMMENT, "KEY_comment_PRIMARY", Comment.COMMENT.ID); + public static final UniqueKey KEY_PERSONALISATION_DATA_PRIMARY = createUniqueKey(PersonalisationData.PERSONALISATION_DATA, "KEY_personalisation_data_PRIMARY", PersonalisationData.PERSONALISATION_DATA.ID); + public static final UniqueKey KEY_PERSONALISATION_DATA_PERSONALISATION_KEY = createUniqueKey(PersonalisationData.PERSONALISATION_DATA, "KEY_personalisation_data_personalisation_key", PersonalisationData.PERSONALISATION_DATA.IDENTIFIER, PersonalisationData.PERSONALISATION_DATA.USER_ID, PersonalisationData.PERSONALISATION_DATA.VERSION); public static final UniqueKey KEY_PRIVILEGE_PRIMARY = createUniqueKey(Privilege.PRIVILEGE, "KEY_privilege_PRIMARY", Privilege.PRIVILEGE.ID); public static final UniqueKey KEY_PROJECT_PRIMARY = createUniqueKey(Project.PROJECT, "KEY_project_PRIMARY", Project.PROJECT.ID); public static final UniqueKey KEY_PROJECT_FOLLOWER_MAP_PRIMARY = createUniqueKey(ProjectFollowerMap.PROJECT_FOLLOWER_MAP, "KEY_project_follower_map_PRIMARY", ProjectFollowerMap.PROJECT_FOLLOWER_MAP.ID); @@ -181,7 +194,9 @@ private static class UniqueKeys0 extends AbstractKeys { public static final UniqueKey KEY_ROLE_ROLE_IDX_1 = createUniqueKey(Role.ROLE, "KEY_role_role_idx_1", Role.ROLE.NAME); public static final UniqueKey KEY_ROLE_PRIVILEGE_MAP_PRIMARY = createUniqueKey(RolePrivilegeMap.ROLE_PRIVILEGE_MAP, "KEY_role_privilege_map_PRIMARY", RolePrivilegeMap.ROLE_PRIVILEGE_MAP.ID); public static final UniqueKey KEY_ROLE_ROLE_MAP_PRIMARY = createUniqueKey(RoleRoleMap.ROLE_ROLE_MAP, "KEY_role_role_map_PRIMARY", RoleRoleMap.ROLE_ROLE_MAP.ID); + public static final UniqueKey KEY_SCHEMA_VERSION_PRIMARY = createUniqueKey(SchemaVersion.SCHEMA_VERSION, "KEY_schema_version_PRIMARY", SchemaVersion.SCHEMA_VERSION.INSTALLED_RANK); public static final UniqueKey KEY_USER_PRIMARY = createUniqueKey(User.USER, "KEY_user_PRIMARY", User.USER.ID); + public static final UniqueKey KEY_USER_LAS2PEER_IDX = createUniqueKey(User.USER, "KEY_user_las2peer_idx", User.USER.LAS2PEER_ID); public static final UniqueKey KEY_USER_ROLE_MAP_PRIMARY = createUniqueKey(UserRoleMap.USER_ROLE_MAP, "KEY_user_role_map_PRIMARY", UserRoleMap.USER_ROLE_MAP.ID); public static final UniqueKey KEY_VOTE_PRIMARY = createUniqueKey(Vote.VOTE, "KEY_vote_PRIMARY", Vote.VOTE.ID); } @@ -196,6 +211,7 @@ private static class ForeignKeys0 extends AbstractKeys { public static final ForeignKey COMMENT_REQUIREMENT = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_REQUIREMENT_PRIMARY, Comment.COMMENT, "comment_requirement", Comment.COMMENT.REQUIREMENT_ID); public static final ForeignKey COMMENT_USER = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_USER_PRIMARY, Comment.COMMENT, "comment_user", Comment.COMMENT.USER_ID); public static final ForeignKey REPLY_COMMENT = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_COMMENT_PRIMARY, Comment.COMMENT, "reply_comment", Comment.COMMENT.REPLY_TO_COMMENT_ID); + public static final ForeignKey PERSONALISATION_USER = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_USER_PRIMARY, PersonalisationData.PERSONALISATION_DATA, "personalisation_user", PersonalisationData.PERSONALISATION_DATA.USER_ID); public static final ForeignKey PROJECT_USER = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_USER_PRIMARY, Project.PROJECT, "project_user", Project.PROJECT.LEADER_ID); public static final ForeignKey PROJECT_CATEGORY = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_CATEGORY_PRIMARY, Project.PROJECT, "project_category", Project.PROJECT.DEFAULT_CATEGORY_ID); public static final ForeignKey PROJECT_FOLLOWER_MAP_PROJECT = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_PROJECT_PRIMARY, ProjectFollowerMap.PROJECT_FOLLOWER_MAP, "project_follower_map_project", ProjectFollowerMap.PROJECT_FOLLOWER_MAP.PROJECT_ID); diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Reqbaz.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Reqbaz.java index 7003ce4c..1548f9e0 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Reqbaz.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Reqbaz.java @@ -8,6 +8,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Category; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.CategoryFollowerMap; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.PersonalisationData; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Privilege; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Project; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.ProjectFollowerMap; @@ -18,6 +19,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Role; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RolePrivilegeMap; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RoleRoleMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.SchemaVersion; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.UserRoleMap; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Vote; @@ -46,7 +48,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Reqbaz extends SchemaImpl { - private static final long serialVersionUID = -786831443; + private static final long serialVersionUID = 1110546097; /** * The reference instance of reqbaz @@ -73,6 +75,11 @@ public class Reqbaz extends SchemaImpl { */ public final Comment COMMENT = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment.COMMENT; + /** + * The table reqbaz.personalisation_data. + */ + public final PersonalisationData PERSONALISATION_DATA = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.PersonalisationData.PERSONALISATION_DATA; + /** * The table reqbaz.privilege. */ @@ -123,6 +130,11 @@ public class Reqbaz extends SchemaImpl { */ public final RoleRoleMap ROLE_ROLE_MAP = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RoleRoleMap.ROLE_ROLE_MAP; + /** + * The table reqbaz.schema_version. + */ + public final SchemaVersion SCHEMA_VERSION = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.SchemaVersion.SCHEMA_VERSION; + /** * The table reqbaz.user. */ @@ -167,6 +179,7 @@ private final List> getTables0() { Category.CATEGORY, CategoryFollowerMap.CATEGORY_FOLLOWER_MAP, Comment.COMMENT, + PersonalisationData.PERSONALISATION_DATA, Privilege.PRIVILEGE, Project.PROJECT, ProjectFollowerMap.PROJECT_FOLLOWER_MAP, @@ -177,6 +190,7 @@ private final List> getTables0() { Role.ROLE, RolePrivilegeMap.ROLE_PRIVILEGE_MAP, RoleRoleMap.ROLE_ROLE_MAP, + SchemaVersion.SCHEMA_VERSION, User.USER, UserRoleMap.USER_ROLE_MAP, Vote.VOTE); diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Tables.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Tables.java index 6f508db0..eaa3ae2f 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Tables.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Tables.java @@ -8,6 +8,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Category; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.CategoryFollowerMap; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.PersonalisationData; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Privilege; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Project; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.ProjectFollowerMap; @@ -18,6 +19,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Role; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RolePrivilegeMap; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RoleRoleMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.SchemaVersion; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.UserRoleMap; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Vote; @@ -58,6 +60,11 @@ public class Tables { */ public static final Comment COMMENT = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment.COMMENT; + /** + * The table reqbaz.personalisation_data. + */ + public static final PersonalisationData PERSONALISATION_DATA = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.PersonalisationData.PERSONALISATION_DATA; + /** * The table reqbaz.privilege. */ @@ -108,6 +115,11 @@ public class Tables { */ public static final RoleRoleMap ROLE_ROLE_MAP = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RoleRoleMap.ROLE_ROLE_MAP; + /** + * The table reqbaz.schema_version. + */ + public static final SchemaVersion SCHEMA_VERSION = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.SchemaVersion.SCHEMA_VERSION; + /** * The table reqbaz.user. */ diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/PersonalisationData.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/PersonalisationData.java new file mode 100644 index 00000000..2a898995 --- /dev/null +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/PersonalisationData.java @@ -0,0 +1,167 @@ +/* + * This file is generated by jOOQ. +*/ +package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; + + +import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.PersonalisationDataRecord; + +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.List; + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class PersonalisationData extends TableImpl { + + private static final long serialVersionUID = -191812551; + + /** + * The reference instance of reqbaz.personalisation_data + */ + public static final PersonalisationData PERSONALISATION_DATA = new PersonalisationData(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return PersonalisationDataRecord.class; + } + + /** + * The column reqbaz.personalisation_data.id. + */ + public final TableField ID = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column reqbaz.personalisation_data.creation_date. + */ + public final TableField CREATION_DATE = createField("creation_date", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.inline("CURRENT_TIMESTAMP", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); + + /** + * The column reqbaz.personalisation_data.last_updated_date. + */ + public final TableField LAST_UPDATED_DATE = createField("last_updated_date", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.inline("CURRENT_TIMESTAMP", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); + + /** + * The column reqbaz.personalisation_data.identifier. + */ + public final TableField IDENTIFIER = createField("identifier", org.jooq.impl.SQLDataType.VARCHAR.length(50).nullable(false), this, ""); + + /** + * The column reqbaz.personalisation_data.user_id. + */ + public final TableField USER_ID = createField("user_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column reqbaz.personalisation_data.version. + */ + public final TableField VERSION = createField("version", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column reqbaz.personalisation_data.setting. + */ + public final TableField SETTING = createField("setting", org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * Create a reqbaz.personalisation_data table reference + */ + public PersonalisationData() { + this("personalisation_data", null); + } + + /** + * Create an aliased reqbaz.personalisation_data table reference + */ + public PersonalisationData(String alias) { + this(alias, PERSONALISATION_DATA); + } + + private PersonalisationData(String alias, Table aliased) { + this(alias, aliased, null); + } + + private PersonalisationData(String alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, ""); + } + + /** + * {@inheritDoc} + */ + @Override + public Schema getSchema() { + return Reqbaz.REQBAZ; + } + + /** + * {@inheritDoc} + */ + @Override + public Identity getIdentity() { + return Keys.IDENTITY_PERSONALISATION_DATA; + } + + /** + * {@inheritDoc} + */ + @Override + public UniqueKey getPrimaryKey() { + return Keys.KEY_PERSONALISATION_DATA_PRIMARY; + } + + /** + * {@inheritDoc} + */ + @Override + public List> getKeys() { + return Arrays.>asList(Keys.KEY_PERSONALISATION_DATA_PRIMARY, Keys.KEY_PERSONALISATION_DATA_PERSONALISATION_KEY); + } + + /** + * {@inheritDoc} + */ + @Override + public List> getReferences() { + return Arrays.>asList(Keys.PERSONALISATION_USER); + } + + /** + * {@inheritDoc} + */ + @Override + public PersonalisationData as(String alias) { + return new PersonalisationData(alias, this); + } + + /** + * Rename this table + */ + @Override + public PersonalisationData rename(String name) { + return new PersonalisationData(name, null); + } +} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/SchemaVersion.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/SchemaVersion.java new file mode 100644 index 00000000..eb14a391 --- /dev/null +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/SchemaVersion.java @@ -0,0 +1,164 @@ +/* + * This file is generated by jOOQ. +*/ +package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; + + +import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.SchemaVersionRecord; + +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.List; + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class SchemaVersion extends TableImpl { + + private static final long serialVersionUID = -1750837905; + + /** + * The reference instance of reqbaz.schema_version + */ + public static final SchemaVersion SCHEMA_VERSION = new SchemaVersion(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return SchemaVersionRecord.class; + } + + /** + * The column reqbaz.schema_version.installed_rank. + */ + public final TableField INSTALLED_RANK = createField("installed_rank", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column reqbaz.schema_version.version. + */ + public final TableField VERSION = createField("version", org.jooq.impl.SQLDataType.VARCHAR.length(50), this, ""); + + /** + * The column reqbaz.schema_version.description. + */ + public final TableField DESCRIPTION = createField("description", org.jooq.impl.SQLDataType.VARCHAR.length(200).nullable(false), this, ""); + + /** + * The column reqbaz.schema_version.type. + */ + public final TableField TYPE = createField("type", org.jooq.impl.SQLDataType.VARCHAR.length(20).nullable(false), this, ""); + + /** + * The column reqbaz.schema_version.script. + */ + public final TableField SCRIPT = createField("script", org.jooq.impl.SQLDataType.VARCHAR.length(1000).nullable(false), this, ""); + + /** + * The column reqbaz.schema_version.checksum. + */ + public final TableField CHECKSUM = createField("checksum", org.jooq.impl.SQLDataType.INTEGER, this, ""); + + /** + * The column reqbaz.schema_version.installed_by. + */ + public final TableField INSTALLED_BY = createField("installed_by", org.jooq.impl.SQLDataType.VARCHAR.length(100).nullable(false), this, ""); + + /** + * The column reqbaz.schema_version.installed_on. + */ + public final TableField INSTALLED_ON = createField("installed_on", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.inline("CURRENT_TIMESTAMP", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); + + /** + * The column reqbaz.schema_version.execution_time. + */ + public final TableField EXECUTION_TIME = createField("execution_time", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column reqbaz.schema_version.success. + */ + public final TableField SUCCESS = createField("success", org.jooq.impl.SQLDataType.TINYINT.nullable(false), this, ""); + + /** + * Create a reqbaz.schema_version table reference + */ + public SchemaVersion() { + this("schema_version", null); + } + + /** + * Create an aliased reqbaz.schema_version table reference + */ + public SchemaVersion(String alias) { + this(alias, SCHEMA_VERSION); + } + + private SchemaVersion(String alias, Table aliased) { + this(alias, aliased, null); + } + + private SchemaVersion(String alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, ""); + } + + /** + * {@inheritDoc} + */ + @Override + public Schema getSchema() { + return Reqbaz.REQBAZ; + } + + /** + * {@inheritDoc} + */ + @Override + public UniqueKey getPrimaryKey() { + return Keys.KEY_SCHEMA_VERSION_PRIMARY; + } + + /** + * {@inheritDoc} + */ + @Override + public List> getKeys() { + return Arrays.>asList(Keys.KEY_SCHEMA_VERSION_PRIMARY); + } + + /** + * {@inheritDoc} + */ + @Override + public SchemaVersion as(String alias) { + return new SchemaVersion(alias, this); + } + + /** + * Rename this table + */ + @Override + public SchemaVersion rename(String name) { + return new SchemaVersion(name, null); + } +} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/User.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/User.java index 7b8a702d..28a65b0f 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/User.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/User.java @@ -36,7 +36,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class User extends TableImpl { - private static final long serialVersionUID = 1533641223; + private static final long serialVersionUID = 928764549; /** * The reference instance of reqbaz.user @@ -167,7 +167,7 @@ public UniqueKey getPrimaryKey() { */ @Override public List> getKeys() { - return Arrays.>asList(Keys.KEY_USER_PRIMARY); + return Arrays.>asList(Keys.KEY_USER_PRIMARY, Keys.KEY_USER_LAS2PEER_IDX); } /** diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/PersonalisationDataRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/PersonalisationDataRecord.java new file mode 100644 index 00000000..f9512ac4 --- /dev/null +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/PersonalisationDataRecord.java @@ -0,0 +1,380 @@ +/* + * This file is generated by jOOQ. +*/ +package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; + + +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.PersonalisationData; + +import java.sql.Timestamp; + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record7; +import org.jooq.Row7; +import org.jooq.impl.UpdatableRecordImpl; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class PersonalisationDataRecord extends UpdatableRecordImpl implements Record7 { + + private static final long serialVersionUID = 1698925945; + + /** + * Setter for reqbaz.personalisation_data.id. + */ + public void setId(Integer value) { + set(0, value); + } + + /** + * Getter for reqbaz.personalisation_data.id. + */ + public Integer getId() { + return (Integer) get(0); + } + + /** + * Setter for reqbaz.personalisation_data.creation_date. + */ + public void setCreationDate(Timestamp value) { + set(1, value); + } + + /** + * Getter for reqbaz.personalisation_data.creation_date. + */ + public Timestamp getCreationDate() { + return (Timestamp) get(1); + } + + /** + * Setter for reqbaz.personalisation_data.last_updated_date. + */ + public void setLastUpdatedDate(Timestamp value) { + set(2, value); + } + + /** + * Getter for reqbaz.personalisation_data.last_updated_date. + */ + public Timestamp getLastUpdatedDate() { + return (Timestamp) get(2); + } + + /** + * Setter for reqbaz.personalisation_data.identifier. + */ + public void setIdentifier(String value) { + set(3, value); + } + + /** + * Getter for reqbaz.personalisation_data.identifier. + */ + public String getIdentifier() { + return (String) get(3); + } + + /** + * Setter for reqbaz.personalisation_data.user_id. + */ + public void setUserId(Integer value) { + set(4, value); + } + + /** + * Getter for reqbaz.personalisation_data.user_id. + */ + public Integer getUserId() { + return (Integer) get(4); + } + + /** + * Setter for reqbaz.personalisation_data.version. + */ + public void setVersion(Integer value) { + set(5, value); + } + + /** + * Getter for reqbaz.personalisation_data.version. + */ + public Integer getVersion() { + return (Integer) get(5); + } + + /** + * Setter for reqbaz.personalisation_data.setting. + */ + public void setSetting(String value) { + set(6, value); + } + + /** + * Getter for reqbaz.personalisation_data.setting. + */ + public String getSetting() { + return (String) get(6); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record7 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Row7 valuesRow() { + return (Row7) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Field field1() { + return PersonalisationData.PERSONALISATION_DATA.ID; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field2() { + return PersonalisationData.PERSONALISATION_DATA.CREATION_DATE; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field3() { + return PersonalisationData.PERSONALISATION_DATA.LAST_UPDATED_DATE; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field4() { + return PersonalisationData.PERSONALISATION_DATA.IDENTIFIER; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field5() { + return PersonalisationData.PERSONALISATION_DATA.USER_ID; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field6() { + return PersonalisationData.PERSONALISATION_DATA.VERSION; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field7() { + return PersonalisationData.PERSONALISATION_DATA.SETTING; + } + + /** + * {@inheritDoc} + */ + @Override + public Integer value1() { + return getId(); + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp value2() { + return getCreationDate(); + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp value3() { + return getLastUpdatedDate(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value4() { + return getIdentifier(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer value5() { + return getUserId(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer value6() { + return getVersion(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value7() { + return getSetting(); + } + + /** + * {@inheritDoc} + */ + @Override + public PersonalisationDataRecord value1(Integer value) { + setId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PersonalisationDataRecord value2(Timestamp value) { + setCreationDate(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PersonalisationDataRecord value3(Timestamp value) { + setLastUpdatedDate(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PersonalisationDataRecord value4(String value) { + setIdentifier(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PersonalisationDataRecord value5(Integer value) { + setUserId(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PersonalisationDataRecord value6(Integer value) { + setVersion(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PersonalisationDataRecord value7(String value) { + setSetting(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PersonalisationDataRecord values(Integer value1, Timestamp value2, Timestamp value3, String value4, Integer value5, Integer value6, String value7) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached PersonalisationDataRecord + */ + public PersonalisationDataRecord() { + super(PersonalisationData.PERSONALISATION_DATA); + } + + /** + * Create a detached, initialised PersonalisationDataRecord + */ + public PersonalisationDataRecord(Integer id, Timestamp creationDate, Timestamp lastUpdatedDate, String identifier, Integer userId, Integer version, String setting) { + super(PersonalisationData.PERSONALISATION_DATA); + + set(0, id); + set(1, creationDate); + set(2, lastUpdatedDate); + set(3, identifier); + set(4, userId); + set(5, version); + set(6, setting); + } +} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/SchemaVersionRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/SchemaVersionRecord.java new file mode 100644 index 00000000..084baf9c --- /dev/null +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/SchemaVersionRecord.java @@ -0,0 +1,503 @@ +/* + * This file is generated by jOOQ. +*/ +package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; + + +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.SchemaVersion; + +import java.sql.Timestamp; + +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record10; +import org.jooq.Row10; +import org.jooq.impl.UpdatableRecordImpl; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class SchemaVersionRecord extends UpdatableRecordImpl implements Record10 { + + private static final long serialVersionUID = -1022760374; + + /** + * Setter for reqbaz.schema_version.installed_rank. + */ + public void setInstalledRank(Integer value) { + set(0, value); + } + + /** + * Getter for reqbaz.schema_version.installed_rank. + */ + public Integer getInstalledRank() { + return (Integer) get(0); + } + + /** + * Setter for reqbaz.schema_version.version. + */ + public void setVersion(String value) { + set(1, value); + } + + /** + * Getter for reqbaz.schema_version.version. + */ + public String getVersion() { + return (String) get(1); + } + + /** + * Setter for reqbaz.schema_version.description. + */ + public void setDescription(String value) { + set(2, value); + } + + /** + * Getter for reqbaz.schema_version.description. + */ + public String getDescription() { + return (String) get(2); + } + + /** + * Setter for reqbaz.schema_version.type. + */ + public void setType(String value) { + set(3, value); + } + + /** + * Getter for reqbaz.schema_version.type. + */ + public String getType() { + return (String) get(3); + } + + /** + * Setter for reqbaz.schema_version.script. + */ + public void setScript(String value) { + set(4, value); + } + + /** + * Getter for reqbaz.schema_version.script. + */ + public String getScript() { + return (String) get(4); + } + + /** + * Setter for reqbaz.schema_version.checksum. + */ + public void setChecksum(Integer value) { + set(5, value); + } + + /** + * Getter for reqbaz.schema_version.checksum. + */ + public Integer getChecksum() { + return (Integer) get(5); + } + + /** + * Setter for reqbaz.schema_version.installed_by. + */ + public void setInstalledBy(String value) { + set(6, value); + } + + /** + * Getter for reqbaz.schema_version.installed_by. + */ + public String getInstalledBy() { + return (String) get(6); + } + + /** + * Setter for reqbaz.schema_version.installed_on. + */ + public void setInstalledOn(Timestamp value) { + set(7, value); + } + + /** + * Getter for reqbaz.schema_version.installed_on. + */ + public Timestamp getInstalledOn() { + return (Timestamp) get(7); + } + + /** + * Setter for reqbaz.schema_version.execution_time. + */ + public void setExecutionTime(Integer value) { + set(8, value); + } + + /** + * Getter for reqbaz.schema_version.execution_time. + */ + public Integer getExecutionTime() { + return (Integer) get(8); + } + + /** + * Setter for reqbaz.schema_version.success. + */ + public void setSuccess(Byte value) { + set(9, value); + } + + /** + * Getter for reqbaz.schema_version.success. + */ + public Byte getSuccess() { + return (Byte) get(9); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record10 type implementation + // ------------------------------------------------------------------------- + + /** + * {@inheritDoc} + */ + @Override + public Row10 fieldsRow() { + return (Row10) super.fieldsRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Row10 valuesRow() { + return (Row10) super.valuesRow(); + } + + /** + * {@inheritDoc} + */ + @Override + public Field field1() { + return SchemaVersion.SCHEMA_VERSION.INSTALLED_RANK; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field2() { + return SchemaVersion.SCHEMA_VERSION.VERSION; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field3() { + return SchemaVersion.SCHEMA_VERSION.DESCRIPTION; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field4() { + return SchemaVersion.SCHEMA_VERSION.TYPE; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field5() { + return SchemaVersion.SCHEMA_VERSION.SCRIPT; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field6() { + return SchemaVersion.SCHEMA_VERSION.CHECKSUM; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field7() { + return SchemaVersion.SCHEMA_VERSION.INSTALLED_BY; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field8() { + return SchemaVersion.SCHEMA_VERSION.INSTALLED_ON; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field9() { + return SchemaVersion.SCHEMA_VERSION.EXECUTION_TIME; + } + + /** + * {@inheritDoc} + */ + @Override + public Field field10() { + return SchemaVersion.SCHEMA_VERSION.SUCCESS; + } + + /** + * {@inheritDoc} + */ + @Override + public Integer value1() { + return getInstalledRank(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value2() { + return getVersion(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value3() { + return getDescription(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value4() { + return getType(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value5() { + return getScript(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer value6() { + return getChecksum(); + } + + /** + * {@inheritDoc} + */ + @Override + public String value7() { + return getInstalledBy(); + } + + /** + * {@inheritDoc} + */ + @Override + public Timestamp value8() { + return getInstalledOn(); + } + + /** + * {@inheritDoc} + */ + @Override + public Integer value9() { + return getExecutionTime(); + } + + /** + * {@inheritDoc} + */ + @Override + public Byte value10() { + return getSuccess(); + } + + /** + * {@inheritDoc} + */ + @Override + public SchemaVersionRecord value1(Integer value) { + setInstalledRank(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SchemaVersionRecord value2(String value) { + setVersion(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SchemaVersionRecord value3(String value) { + setDescription(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SchemaVersionRecord value4(String value) { + setType(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SchemaVersionRecord value5(String value) { + setScript(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SchemaVersionRecord value6(Integer value) { + setChecksum(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SchemaVersionRecord value7(String value) { + setInstalledBy(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SchemaVersionRecord value8(Timestamp value) { + setInstalledOn(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SchemaVersionRecord value9(Integer value) { + setExecutionTime(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SchemaVersionRecord value10(Byte value) { + setSuccess(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SchemaVersionRecord values(Integer value1, String value2, String value3, String value4, String value5, Integer value6, String value7, Timestamp value8, Integer value9, Byte value10) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached SchemaVersionRecord + */ + public SchemaVersionRecord() { + super(SchemaVersion.SCHEMA_VERSION); + } + + /** + * Create a detached, initialised SchemaVersionRecord + */ + public SchemaVersionRecord(Integer installedRank, String version, String description, String type, String script, Integer checksum, String installedBy, Timestamp installedOn, Integer executionTime, Byte success) { + super(SchemaVersion.SCHEMA_VERSION); + + set(0, installedRank); + set(1, version); + set(2, description); + set(3, type); + set(4, script); + set(5, checksum); + set(6, installedBy); + set(7, installedOn); + set(8, executionTime); + set(9, success); + } +} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepository.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepository.java new file mode 100644 index 00000000..84c630bb --- /dev/null +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepository.java @@ -0,0 +1,11 @@ +package de.rwth.dbis.acis.bazaar.service.dal.repositories; +import de.rwth.dbis.acis.bazaar.service.dal.entities.PersonalisationData; +import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; + +public interface PersonalisationDataRepository extends Repository { + + PersonalisationData findByKey(int userId, int version, String key) throws BazaarException; + void insertOrUpdate(PersonalisationData data) throws BazaarException; + + +} \ No newline at end of file diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepositoryImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepositoryImpl.java new file mode 100644 index 00000000..07ca709d --- /dev/null +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepositoryImpl.java @@ -0,0 +1,56 @@ +package de.rwth.dbis.acis.bazaar.service.dal.repositories; + +import de.rwth.dbis.acis.bazaar.service.dal.entities.PersonalisationData; + + +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.PersonalisationDataRecord; +import de.rwth.dbis.acis.bazaar.service.dal.transform.PersonalisationDataTransformer; +import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; +import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; +import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; +import de.rwth.dbis.acis.bazaar.service.exception.ExceptionLocation; +import org.jooq.DSLContext; +import org.jooq.Record; +import org.jooq.exception.DataAccessException; + + +import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.*; + +public class PersonalisationDataRepositoryImpl extends RepositoryImpl implements PersonalisationDataRepository { + + + public PersonalisationDataRepositoryImpl(DSLContext jooq) { + super(jooq, new PersonalisationDataTransformer()); + } + + + @Override + public PersonalisationData findByKey(int userId, int version, String key) throws BazaarException{ + PersonalisationData data = null; + try { + Record record = jooq.select().from(PERSONALISATION_DATA) + .where(PERSONALISATION_DATA.USER_ID.eq(userId)) + .and(PERSONALISATION_DATA.VERSION.eq(version)) + .and(PERSONALISATION_DATA.IDENTIFIER.eq(key)) + .fetchOne(); + PersonalisationDataRecord personalisationDataRecord = record.into(PersonalisationDataRecord.class); + data = transformer.getEntityFromTableRecord(personalisationDataRecord); + } catch (DataAccessException e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } catch (NullPointerException e) { + ExceptionHandler.getInstance().convertAndThrowException( + new Exception("No " + transformer.getRecordClass() + " found with userId: " + userId + " version: "+version + " key: "+key), + ExceptionLocation.REPOSITORY, ErrorCode.NOT_FOUND); + } + return data; + } + @Override + public void insertOrUpdate(PersonalisationData data) throws BazaarException{ + jooq.insertInto(PERSONALISATION_DATA, PERSONALISATION_DATA.IDENTIFIER, PERSONALISATION_DATA.USER_ID, PERSONALISATION_DATA.VERSION, PERSONALISATION_DATA.SETTING) + .values(data.getKey(), data.getUserId(), data.getVersion(), data.getValue()) + .onDuplicateKeyUpdate() + .set(PERSONALISATION_DATA.SETTING, data.getValue()) + .execute(); + } + +} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java new file mode 100644 index 00000000..f8326dc8 --- /dev/null +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java @@ -0,0 +1,103 @@ +/* + * + * Copyright (c) 2014, RWTH Aachen University. + * For a list of contributors see the AUTHORS file at the top-level directory + * of this distribution. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * / + */ + +package de.rwth.dbis.acis.bazaar.service.dal.transform; + +import de.rwth.dbis.acis.bazaar.service.dal.entities.PersonalisationData; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Vote; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.PersonalisationDataRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.VoteRecord; +import org.jooq.*; + +import java.util.*; + +import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.PERSONALISATION_DATA; +import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.VOTE; + +/** + * @author Adam Gavronek + * @since 6/23/2014 + */ +public class PersonalisationDataTransformer implements Transformer { + @Override + public PersonalisationDataRecord createRecord(PersonalisationData entity) { + PersonalisationDataRecord record = new PersonalisationDataRecord(); + record.setVersion(entity.getVersion()); + record.setUserId(entity.getUserId()); + record.setIdentifier(entity.getKey()); + record.setSetting(entity.getValue()); + record.setUserId(entity.getUserId()); + return record; + } + + @Override + public PersonalisationData getEntityFromTableRecord(PersonalisationDataRecord record) { + return PersonalisationData.getBuilder() + .id(record.getId()) + .userId(record.getUserId()) + .version(record.getVersion()) + .userId(record.getUserId()) + .value(record.getSetting()) + .build(); + } + + @Override + public Table getTable() { + return PERSONALISATION_DATA; + } + + @Override + public TableField getTableId() { + return PERSONALISATION_DATA.ID; + } + + @Override + public Class getRecordClass() { + return PersonalisationDataRecord.class; + } + + @Override + public Map getUpdateMap(final PersonalisationData entity) { + return new HashMap() {{ + put(PERSONALISATION_DATA.SETTING, entity.getValue()); + //put(PERSONALISATION_DATA.LAST_UPDATED_DATE, time); + }}; + } + + @Override + public Collection> getSortFields(List sorts){ + /* if (sorts.isEmpty()) { + return Collections.singletonList(VOTE.ID.asc()); + } */ + return null; + } + + @Override + public Condition getSearchCondition(String search) throws Exception { + throw new Exception("Search is not supported!"); + } + + @Override + public Collection getFilterConditions(Map filters) throws Exception { + //return new ArrayList<>(); + throw new Exception("Filtering is not supported!"); + } +} From f3edbe9cf7458816357bf261fb108984e8e5d735 Mon Sep 17 00:00:00 2001 From: Milan D Date: Wed, 25 Dec 2019 01:19:11 +0100 Subject: [PATCH 002/134] =?UTF-8?q?Project=20Endpoint=20Filters=20for=20?= =?UTF-8?q?=E2=80=9EAll=E2=80=9C,=20=E2=80=9EOwn=E2=80=9C=20and=20?= =?UTF-8?q?=E2=80=9EFollowing=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../acis/bazaar/service/ProjectsResource.java | 20 +++++++++++---- .../repositories/ProjectRepositoryImpl.java | 3 ++- .../dal/transform/ProjectTransformer.java | 25 ++++++++++++++++++- 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java b/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java index 41872c71..e317d278 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java @@ -77,9 +77,10 @@ public Response getProjects( @ApiParam(value = "Page number", required = false) @DefaultValue("0") @QueryParam("page") int page, @ApiParam(value = "Elements of project by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage, @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, - @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date,last_activity,requirement,follower") @DefaultValue("name") @QueryParam("sort") List sort) { + @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date,last_activity,requirement,follower") @DefaultValue("name") @QueryParam("sort") List sort, + @ApiParam(value = "Filter", required = false, allowMultiple = true, allowableValues = "all, own, following") @QueryParam("filters") List filters) { - DALFacade dalFacade = null; + DALFacade dalFacade = null; try { String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); if (registrarErrors != null) { @@ -101,14 +102,23 @@ public Response getProjects( Pageable.SortField sortField = new Pageable.SortField(sortOption, direction); sortList.add(sortField); } - PageInfo pageInfo = new PageInfo(page, perPage, new HashMap<>(), sortList, search); + + dalFacade = bazaarService.getDBConnection(); + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + + HashMap filterMap = new HashMap<>(); + for(String filterOption : filters) { + filterMap.put(filterOption,internalUserId.toString()); + } + PageInfo pageInfo = new PageInfo(page, perPage, filterMap, sortList, search); + + Vtor vtor = bazaarService.getValidators(); vtor.validate(pageInfo); if (vtor.hasViolations()) { ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); } - dalFacade = bazaarService.getDBConnection(); - Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + PaginationResult projectsResult; if (agent.getLoginName().equals("anonymous")) { // return only public projects diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java index c0d3e97e..27cdef3b 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java @@ -297,7 +297,8 @@ public PaginationResult findAllPublicAndAuthorized(PageInfo pageable, i // .leftOuterJoin(AUTHORIZATIONS).on(AUTHORIZATIONS.PROJECT_ID.equal(PROJECTS.ID)) // .join(USERS).on(AUTHORIZATIONS.USER_ID.equal(USERS.ID)) // .where(PROJECTS.VISIBILITY.eq(Project.ProjectVisibility.PUBLIC.asChar()) - .where(PROJECT.VISIBILITY.isTrue().or(leaderUser.ID.equal(userId)) + .where(transformer.getFilterConditions(pageable.getFilters())) + .and(PROJECT.VISIBILITY.isTrue().or(leaderUser.ID.equal(userId)) .and(transformer.getSearchCondition(pageable.getSearch()))) .orderBy(transformer.getSortFields(pageable.getSorts())) .limit(pageable.getPageSize()) diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java index d639299b..d1fc7d8b 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java @@ -30,6 +30,8 @@ import java.util.*; + + import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.REQUIREMENT; import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.PROJECT; import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.PROJECT_FOLLOWER_MAP; @@ -200,7 +202,28 @@ public Condition getSearchCondition(String search) throws Exception { @Override public Collection getFilterConditions(Map filters) throws Exception { - return new ArrayList<>(); + List conditions = new ArrayList<>(); + for (Map.Entry filterEntry : filters.entrySet()) { + if(filterEntry.getKey().equals("all")){ + conditions.add( + DSL.trueCondition() + ); + }else + if (filterEntry.getKey().equals("own")) { + conditions.add( + PROJECT.LEADER_ID.eq(Integer.parseInt(filterEntry.getValue())) + ); + }else if(filterEntry.getKey().equals("following")){ + conditions.add( + PROJECT.ID.in( + DSL.select(PROJECT_FOLLOWER_MAP.PROJECT_ID) + .from(PROJECT_FOLLOWER_MAP) + .where(PROJECT_FOLLOWER_MAP.USER_ID.eq(Integer.parseInt(filterEntry.getValue()))) + ) + ); + } + } + return conditions; } private Project cleanEntry(Project project) { From 3cec64a596bcb8b19bf2fcd2fdc163473df169f8 Mon Sep 17 00:00:00 2001 From: Milan D Date: Sun, 19 Jan 2020 14:13:04 +0100 Subject: [PATCH 003/134] Projects endpoint support ids MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enables to filter projects against a list of ids using &ids[]=1&ids[]=2… Combinalble with all other parameters/filters --- .../acis/bazaar/service/ProjectsResource.java | 5 +++-- .../bazaar/service/dal/helpers/PageInfo.java | 16 +++++++++++++--- .../bazaar/service/dal/helpers/Pageable.java | 2 ++ .../dal/repositories/ProjectRepositoryImpl.java | 14 +++++++++----- 4 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java b/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java index e317d278..d03f2bc8 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java @@ -78,7 +78,8 @@ public Response getProjects( @ApiParam(value = "Elements of project by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage, @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date,last_activity,requirement,follower") @DefaultValue("name") @QueryParam("sort") List sort, - @ApiParam(value = "Filter", required = false, allowMultiple = true, allowableValues = "all, own, following") @QueryParam("filters") List filters) { + @ApiParam(value = "Filter", required = false, allowMultiple = true, allowableValues = "all, own, following") @QueryParam("filters") List filters, + @ApiParam(value = "Ids", required = false, allowMultiple = true) @QueryParam("ids") List ids) { DALFacade dalFacade = null; try { @@ -110,7 +111,7 @@ public Response getProjects( for(String filterOption : filters) { filterMap.put(filterOption,internalUserId.toString()); } - PageInfo pageInfo = new PageInfo(page, perPage, filterMap, sortList, search); + PageInfo pageInfo = new PageInfo(page, perPage, filterMap, sortList, search, ids); Vtor vtor = bazaarService.getValidators(); diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java index fcd0e0c0..da4d1ac4 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java @@ -39,21 +39,26 @@ public class PageInfo implements Pageable { private final Map filters; private final List sorts; private final String search; + private final List ids; public PageInfo(int pageNumber, int pageSize) { - this(pageNumber, pageSize, new HashMap<>(), new ArrayList<>(), null); + this(pageNumber, pageSize, new HashMap<>(), new ArrayList<>(), null, null); } public PageInfo(int pageNumber, int pageSize, Map filters) { - this(pageNumber, pageSize, filters, new ArrayList<>(), null); + this(pageNumber, pageSize, filters, new ArrayList<>(), null,null); + } + public PageInfo(int pageNumber, int pageSize, Map filters, List sorts, String search){ + this(pageNumber, pageSize, filters, sorts, search,null); } - public PageInfo(int pageNumber, int pageSize, Map filters, List sorts, String search) { + public PageInfo(int pageNumber, int pageSize, Map filters, List sorts, String search, List ids) { this.pageNumber = pageNumber; this.pageSize = pageSize; this.filters = filters; this.sorts = sorts; this.search = search != null ? search : ""; + this.ids = ids; } @Override @@ -81,6 +86,11 @@ public List getSorts() { return sorts; } + @Override + public List getIds() { + return ids; + } + @Override public String getSearch() {return search;} } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java index a7d66eb2..6c68f2bd 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java @@ -40,6 +40,8 @@ public interface Pageable { String getSearch(); + List getIds(); + class SortField { String field; SortDirection sortDirection; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java index 27cdef3b..0160884d 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java @@ -41,9 +41,7 @@ import java.util.List; import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.*; -import static org.jooq.impl.DSL.max; -import static org.jooq.impl.DSL.select; -import static org.jooq.impl.DSL.table; +import static org.jooq.impl.DSL.*; /** * @author Adam Gavronek @@ -223,6 +221,7 @@ public PaginationResult findAllPublic(Pageable pageable, int userId) th .leftOuterJoin(LAST_ACTIVITY).on(PROJECT.ID.eq(LAST_ACTIVITY.field(PROJECT.ID))) .where(PROJECT.VISIBILITY.isTrue()) .and(transformer.getSearchCondition(pageable.getSearch())) + .and((pageable.getIds().size() > 0)?PROJECT.ID.in(pageable.getIds()):trueCondition()) //If list of ids parsed, add in condition .orderBy(transformer.getSortFields(pageable.getSorts())) .limit(pageable.getPageSize()) .offset(pageable.getOffset()) @@ -298,8 +297,13 @@ public PaginationResult findAllPublicAndAuthorized(PageInfo pageable, i // .join(USERS).on(AUTHORIZATIONS.USER_ID.equal(USERS.ID)) // .where(PROJECTS.VISIBILITY.eq(Project.ProjectVisibility.PUBLIC.asChar()) .where(transformer.getFilterConditions(pageable.getFilters())) - .and(PROJECT.VISIBILITY.isTrue().or(leaderUser.ID.equal(userId)) - .and(transformer.getSearchCondition(pageable.getSearch()))) + .and( + (pageable.getIds().size() > 0)?(PROJECT.ID.in(pageable.getIds())):trueCondition() + .and( + PROJECT.VISIBILITY.isTrue().or(leaderUser.ID.equal(userId)) + ).and( + transformer.getSearchCondition(pageable.getSearch())) + ) .orderBy(transformer.getSortFields(pageable.getSorts())) .limit(pageable.getPageSize()) .offset(pageable.getOffset()) From ec86e19922e4be57f88c57e4133e075fe32da98c Mon Sep 17 00:00:00 2001 From: Milan D Date: Wed, 22 Jan 2020 18:02:39 +0100 Subject: [PATCH 004/134] EntityOverview endpoint, basis for personalized get requirements/categories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [TESTED] Modifaction of transformers to support personalized filteroptions [UNTESTED] findAll functions for requirements & categories [TESTED] listRequirementIds & listCategoryIds & listProjectIds functions returning only lists if id’s [TESTED] getEntitiesForUser function in DALFacade combining listRequirementIds & listCategoryIds & listProjectIds into new Entity „EntityOverview“ [TESTED] /users/me/entities endpoint, returning EntityOverview for /me/ TODOS: Write DALFacade & Resource function/endpoints for getAll functions REFACTORING/POSSIBLE PROBLEMS: - Too much logic inside DALFacade? Move one level up? - Rewrite PageInfo to support „getPersonalisedFilters(int userid)“ instead of parsing id through hash-map - Change name of users-endpoint? --- .../acis/bazaar/service/ProjectsResource.java | 2 +- .../acis/bazaar/service/UsersResource.java | 89 ++++++++++++++- .../acis/bazaar/service/dal/DALFacade.java | 8 ++ .../bazaar/service/dal/DALFacadeImpl.java | 24 ++++ .../service/dal/entities/EntityOverview.java | 108 ++++++++++++++++++ .../dal/repositories/CategoryRepository.java | 5 + .../repositories/CategoryRepositoryImpl.java | 90 +++++++++++++++ .../dal/repositories/ProjectRepository.java | 8 +- .../repositories/ProjectRepositoryImpl.java | 23 +++- .../repositories/RequirementRepository.java | 7 ++ .../RequirementRepositoryImpl.java | 79 +++++++++++++ .../dal/transform/CategoryTransformer.java | 26 ++++- .../dal/transform/ProjectTransformer.java | 5 +- .../dal/transform/RequirementTransformer.java | 32 ++++++ 14 files changed, 499 insertions(+), 7 deletions(-) create mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java b/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java index d03f2bc8..f9d9d839 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java @@ -78,7 +78,7 @@ public Response getProjects( @ApiParam(value = "Elements of project by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage, @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date,last_activity,requirement,follower") @DefaultValue("name") @QueryParam("sort") List sort, - @ApiParam(value = "Filter", required = false, allowMultiple = true, allowableValues = "all, own, following") @QueryParam("filters") List filters, + @ApiParam(value = "Filter", required = false, allowMultiple = true, allowableValues = "all, created, following") @QueryParam("filters") List filters, @ApiParam(value = "Ids", required = false, allowMultiple = true) @QueryParam("ids") List ids) { DALFacade dalFacade = null; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/UsersResource.java b/src/main/de/rwth/dbis/acis/bazaar/service/UsersResource.java index 530b1c00..028f349d 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/UsersResource.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/UsersResource.java @@ -2,7 +2,10 @@ import de.rwth.dbis.acis.bazaar.service.dal.DALFacade; import de.rwth.dbis.acis.bazaar.service.dal.entities.Activity; +import de.rwth.dbis.acis.bazaar.service.dal.entities.EntityOverview; import de.rwth.dbis.acis.bazaar.service.dal.entities.User; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; @@ -15,11 +18,11 @@ import jodd.vtor.Vtor; import javax.ws.rs.*; +import javax.ws.rs.client.Entity; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.net.HttpURLConnection; -import java.util.Date; -import java.util.EnumSet; +import java.util.*; @Api(value = "users", description = "Users resource") @@ -215,4 +218,86 @@ public Response updateUser(@PathParam("userId") int userId, bazaarService.closeDBConnection(dalFacade); } } + /** + * This method returns the list of projects on the server. + * + * @param search search string + * @param sort sort order + * @return Response with list of all projects + */ + @GET + @Path("/me/entities") + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "This method allows to receive an overview of entities related to the user") + @ApiResponses(value = { + @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns the updated user", response = EntityOverview.class), + @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), + @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), + @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") + }) + public Response getEntityOverview( + @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, + @ApiParam(value = "Types of entities to include", required = true, allowMultiple = true, allowableValues = "projects,categories,requirements") @QueryParam("include") List include, + @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date,last_activity,requirement,follower") @DefaultValue("date") @QueryParam("sort") List sort, + @ApiParam(value = "Filter", required = false, allowMultiple = true, allowableValues = "created, following, developing") @DefaultValue("created") @QueryParam("filters") List filters){ + //Possibly allow filtertype "all"? + DALFacade dalFacade = null; + try { + String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); + if (registrarErrors != null) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); + } + UserAgent agent = (UserAgent) Context.getCurrent().getMainAgent(); + long userId = agent.getId(); + List sortList = new ArrayList<>(); + for (String sortOption : sort) { + Pageable.SortDirection direction = Pageable.SortDirection.DEFAULT; + if (sortOption.startsWith("+") || sortOption.startsWith(" ")) { // " " is needed because jersey does not pass "+" + direction = Pageable.SortDirection.ASC; + sortOption = sortOption.substring(1); + + } else if (sortOption.startsWith("-")) { + direction = Pageable.SortDirection.DESC; + sortOption = sortOption.substring(1); + } + Pageable.SortField sortField = new Pageable.SortField(sortOption, direction); + sortList.add(sortField); + } + + dalFacade = bazaarService.getDBConnection(); + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + + HashMap filterMap = new HashMap<>(); + for(String filterOption : filters) { + filterMap.put(filterOption,internalUserId.toString()); + } + PageInfo pageInfo = new PageInfo(0, 0, filterMap, sortList, search); + + + EntityOverview result = dalFacade.getEntitiesForUser(include, pageInfo, internalUserId); + + bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE, NodeObserver.Event.SERVICE_CUSTOM_MESSAGE_3, + 0, Activity.DataType.USER, internalUserId); + + + Response.ResponseBuilder responseBuilder = Response.ok(); + responseBuilder = responseBuilder.entity(result.toJSON()); + //responseBuilder = bazaarService.xHeaderFields(responseBuilder, result); + + return responseBuilder.build(); + } catch (BazaarException bex) { + logger.warning(bex.getMessage()); + L2pLogger.logEvent(NodeObserver.Event.SERVICE_ERROR, Context.getCurrent().getMainAgent(), "Get entityOverview failed"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } catch (Exception ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + logger.warning(bex.getMessage()); + L2pLogger.logEvent(NodeObserver.Event.SERVICE_ERROR, Context.getCurrent().getMainAgent(), "Get entityOverview failed"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } finally { + bazaarService.closeDBConnection(dalFacade); + } + } + + } \ No newline at end of file diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java index 89ea6ee6..e2d0f7b3 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java @@ -579,4 +579,12 @@ public interface DALFacade { * @param personalisationData which holds the data to be saved */ void setPersonalisationData(PersonalisationData personalisationData) throws BazaarException; + + /** + * Creates an Entity-Overview for a given user + * @param includes List of entities to include values: [projects, categories, requirements] + * @param pageable Used for search-term, filters and sorting + * @param userId userId for privilege-check + */ + EntityOverview getEntitiesForUser(List includes, Pageable pageable, int userId) throws BazaarException; } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index 700ac460..d1468f32 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -618,4 +618,28 @@ public void setPersonalisationData(PersonalisationData personalisationData) thro personalisationDataRepository.insertOrUpdate(personalisationData); } + + @Override + public EntityOverview getEntitiesForUser(List includes, Pageable pageable, int userId) throws BazaarException { + //categoryRepository = (categoryRepository != null) ? categoryRepository : new CategoryRepositoryImpl(dslContext); + EntityOverview.Builder result = EntityOverview.getBuilder(); + for(String include : includes) { + if(include.equals("projects")){ + projectRepository = (projectRepository != null) ? projectRepository : new ProjectRepositoryImpl(dslContext); + result.projects(projectRepository.listProjectIds(pageable, userId)); + } else + if(include.equals("requirements")){ + requirementRepository = (requirementRepository != null) ? requirementRepository : new RequirementRepositoryImpl(dslContext); + result.requirements(requirementRepository.listRequirementIds(pageable, userId)); + }else + if(include.equals("categories")){ + categoryRepository = (categoryRepository != null) ? categoryRepository : new CategoryRepositoryImpl(dslContext); + result.categories(categoryRepository.listCategoryIds(pageable, userId)); + } + + } + return result.build(); + + } + } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java new file mode 100644 index 00000000..d7b2ea8d --- /dev/null +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java @@ -0,0 +1,108 @@ +/* + * + * Copyright (c) 2014, RWTH Aachen University. + * For a list of contributors see the AUTHORS file at the top-level directory + * of this distribution. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * / + */ + +package de.rwth.dbis.acis.bazaar.service.dal.entities; + + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.util.List; + +/** + * @author Milan Deruelle + * @since 22/01/2020 + */ +public class EntityOverview { + + private List projects; + private List categories; + private List requirements; + private List comments; + + public EntityOverview() { + } + + public EntityOverview(Builder builder) { + this.projects = builder.projects; + this.categories = builder.categories; + this.requirements = builder.requirements; + this.comments = builder.comments; + } + + + public List getProjects() { + return projects; + } + + public List getCategories() { + return categories; + } + + public List getRequirements() { + return requirements; + } + + public List getComments() { + return comments; + } + + + public static Builder getBuilder() { + return new Builder(); + } + + public String toJSON() throws JsonProcessingException { + return new ObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL).writeValueAsString(this); + } + + public static class Builder { + private List projects; + private List categories; + private List requirements; + private List comments; + + + public Builder projects(List projects) { + this.projects = projects; + return this; + } + + public Builder categories(List categories) { + this.categories = categories; + return this; + } + + public Builder requirements(List requirements) { + this.requirements = requirements; + return this; + } + + public Builder comments(List comments) { + this.comments = comments; + return this; + } + + public EntityOverview build() { + return new EntityOverview(this); + } + } +} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java index 97303852..3ae19a25 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java @@ -27,6 +27,7 @@ import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import java.sql.Timestamp; +import java.util.List; /** * @author Adam Gavronek @@ -40,6 +41,10 @@ public interface CategoryRepository extends Repository { PaginationResult findByRequirementId(int requirementId, Pageable pageable, int userId) throws BazaarException; + PaginationResult findAll(Pageable pageable, int userId) throws BazaarException; + + List listCategoryIds(Pageable pageable, int userId) throws BazaarException; + boolean belongsToPublicProject(int id) throws BazaarException; Statistic getStatisticsForCategory(int userId, int categoryId, Timestamp timestamp) throws BazaarException; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java index 84235ddc..3f60940a 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java @@ -233,6 +233,96 @@ public PaginationResult findByProjectId(int projectId, Pageable pageab return result; } + @Override + public PaginationResult findAll(Pageable pageable, int userId) throws BazaarException { + PaginationResult result = null; + List categories; + try { + categories = new ArrayList<>(); + de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); + + Field idCount = jooq.selectCount() + .from(CATEGORY) + .where(transformer.getFilterConditions(pageable.getFilters())) + .and(transformer.getSearchCondition(pageable.getSearch())) + .asField("idCount"); + + Field requirementCount = jooq.select(DSL.count()) + .from(REQUIREMENT) + .leftJoin(REQUIREMENT_CATEGORY_MAP).on(REQUIREMENT.ID.equal(REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID)) + .where(REQUIREMENT_CATEGORY_MAP.CATEGORY_ID.equal(CATEGORY.ID)) + .asField("requirementCount"); + + Field followerCount = jooq.select(DSL.count()) + .from(CATEGORY_FOLLOWER_MAP) + .where(CATEGORY_FOLLOWER_MAP.CATEGORY_ID.equal(CATEGORY.ID)) + .asField("followerCount"); + + Field isFollower = DSL.select(DSL.count()) + .from(CATEGORY_FOLLOWER_MAP) + .where(CATEGORY_FOLLOWER_MAP.CATEGORY_ID.equal(CATEGORY.ID).and(CATEGORY_FOLLOWER_MAP.USER_ID.equal(userId))) + .asField("isFollower"); + + List queryResults = jooq.select(CATEGORY.fields()) + .select(idCount) + .select(requirementCount) + .select(followerCount) + .select(isFollower) + .select(leaderUser.fields()) + .from(CATEGORY) + .leftOuterJoin(leaderUser).on(leaderUser.ID.equal(CATEGORY.LEADER_ID)) + .leftOuterJoin(LAST_ACTIVITY).on(CATEGORY.ID.eq(LAST_ACTIVITY.field(CATEGORY.ID))) + .where(transformer.getFilterConditions(pageable.getFilters())) + .and(transformer.getSearchCondition(pageable.getSearch())) + .orderBy(transformer.getSortFields(pageable.getSorts())) + .limit(pageable.getPageSize()) + .offset(pageable.getOffset()) + .fetch(); + + for (Record queryResult : queryResults) { + CategoryRecord categoryRecord = queryResult.into(CATEGORY); + Category category = transformer.getEntityFromTableRecord(categoryRecord); + UserTransformer userTransformer = new UserTransformer(); + UserRecord userRecord = queryResult.into(leaderUser); + category.setLeader(userTransformer.getEntityFromTableRecord(userRecord)); + category.setNumberOfRequirements((Integer) queryResult.getValue(requirementCount)); + category.setNumberOfFollowers((Integer) queryResult.getValue(followerCount)); + if (userId != 1) { + category.setFollower((Integer) queryResult.getValue(isFollower) == 0 ? false : true); + } + categories.add(category); + } + int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); + result = new PaginationResult<>(total, pageable, categories); + } catch (Exception e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } + return result; + } + + + @Override + public List listCategoryIds(Pageable pageable, int userId) throws BazaarException { + List categoryIds = new ArrayList<>(); + try { + categoryIds = jooq.select() + .from(CATEGORY) + .where(transformer.getFilterConditions(pageable.getFilters())) + .and(transformer.getSearchCondition(pageable.getSearch())) + .orderBy(transformer.getSortFields(pageable.getSorts())) + // .limit(pageable.getPageSize()) + // .offset(pageable.getOffset()) + .fetch(CATEGORY.ID); + + } catch (Exception e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } + return categoryIds; + } + + + + @Override public PaginationResult findByRequirementId(int requirementId, Pageable pageable, int userId) throws BazaarException { PaginationResult result = null; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java index 95608cea..0970a7dc 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java @@ -28,6 +28,7 @@ import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import java.sql.Timestamp; +import java.util.List; /** * @author Adam Gavronek @@ -39,11 +40,16 @@ public interface ProjectRepository extends Repository { PaginationResult findAllPublic(Pageable pageable, int userId) throws BazaarException; - PaginationResult findAllPublicAndAuthorized(PageInfo pageable, int userId) throws BazaarException; + PaginationResult findAllPublicAndAuthorized(Pageable pageable, int userId) throws BazaarException; boolean belongsToPublicProject(int id) throws BazaarException; Statistic getStatisticsForVisibleProjects(int userId, Timestamp timestamp) throws BazaarException; Statistic getStatisticsForProject(int userId, int projectId, Timestamp timestamp) throws BazaarException; + + List listProjectIds(Pageable pageable, int userId) throws BazaarException; + + + } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java index 0160884d..25b306b0 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java @@ -250,7 +250,7 @@ public PaginationResult findAllPublic(Pageable pageable, int userId) th } @Override - public PaginationResult findAllPublicAndAuthorized(PageInfo pageable, int userId) throws BazaarException { + public PaginationResult findAllPublicAndAuthorized(Pageable pageable, int userId) throws BazaarException { PaginationResult result = null; List projects; try { @@ -331,6 +331,27 @@ public PaginationResult findAllPublicAndAuthorized(PageInfo pageable, i return result; } + @Override + public List listProjectIds(Pageable pageable, int userId) throws BazaarException { + List projectIds = new ArrayList<>(); + try { + projectIds = jooq.select() + .from(PROJECT) + .where(transformer.getFilterConditions(pageable.getFilters())) + .and(PROJECT.VISIBILITY.isTrue().or(PROJECT.LEADER_ID.equal(userId)) + .and(transformer.getSearchCondition(pageable.getSearch()))) + .orderBy(transformer.getSortFields(pageable.getSorts())) + // .limit(pageable.getPageSize()) + // .offset(pageable.getOffset()) + .fetch(PROJECT.ID); + + } catch (Exception e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } + return projectIds; + } + + @Override public boolean belongsToPublicProject(int id) throws BazaarException { try { diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java index 6241a6cb..a890da40 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java @@ -27,6 +27,7 @@ import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import java.sql.Timestamp; +import java.util.List; public interface RequirementRepository extends Repository { @@ -34,6 +35,10 @@ public interface RequirementRepository extends Repository { PaginationResult findAllByCategory(int categoryId, Pageable pageable, int userId) throws BazaarException; + PaginationResult findAll(Pageable pageable, int userId) throws BazaarException; + + List listRequirementIds(Pageable pageable, int userId) throws BazaarException; + boolean belongsToPublicProject(int id) throws BazaarException; Requirement findById(int id, int userId) throws Exception; @@ -43,4 +48,6 @@ public interface RequirementRepository extends Repository { void setLeadDeveloper(int id, Integer userId) throws BazaarException; Statistic getStatisticsForRequirement(int userId, int requirementId, Timestamp timestamp) throws BazaarException; + + } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java index acd01987..4ca525a2 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java @@ -82,6 +82,85 @@ public RequirementRepositoryImpl(DSLContext jooq) { super(jooq, new RequirementTransformer()); } + @Override + public List listRequirementIds(Pageable pageable, int userId) throws BazaarException { + List requirementIds = new ArrayList<>(); + try { + requirementIds = jooq.select() + .from(REQUIREMENT) + .where(transformer.getFilterConditions(pageable.getFilters())) + .and(transformer.getSearchCondition(pageable.getSearch())) + .orderBy(transformer.getSortFields(pageable.getSorts())) + // .limit(pageable.getPageSize()) + // .offset(pageable.getOffset()) + .fetch(REQUIREMENT.ID); + + } catch (Exception e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } + return requirementIds; + } + + @Override + public PaginationResult findAll(Pageable pageable, int userId) throws BazaarException { + PaginationResult result = null; + List requirements; + try { + requirements = new ArrayList<>(); + + Field idCount = jooq.selectCount() + .from(REQUIREMENT) + .where(transformer.getFilterConditions(pageable.getFilters())) + .and(transformer.getSearchCondition(pageable.getSearch())) + .asField("idCount"); + + Field voteCount = jooq.select(DSL.count(DSL.nullif(VOTE.IS_UPVOTE, 0))) + .from(VOTE) + .where(VOTE.REQUIREMENT_ID.equal(REQUIREMENT.ID)) + .asField("voteCount"); + + Field commentCount = DSL.select(DSL.count()) + .from(COMMENT) + .where(COMMENT.REQUIREMENT_ID.equal(REQUIREMENT.ID)) + .asField("commentCount"); + + Field followerCount = DSL.select(DSL.count()) + .from(REQUIREMENT_FOLLOWER_MAP) + .where(REQUIREMENT_FOLLOWER_MAP.REQUIREMENT_ID.equal(REQUIREMENT.ID)) + .asField("followerCount"); + + List queryResults = jooq.select(REQUIREMENT.fields()) + .select(idCount) + .select(voteCount) + .select(commentCount) + .select(followerCount) + .from(REQUIREMENT) + .leftOuterJoin(LAST_ACTIVITY).on(REQUIREMENT.ID.eq(LAST_ACTIVITY.field(REQUIREMENT.ID))) + .where(transformer.getFilterConditions(pageable.getFilters())) + .and(transformer.getSearchCondition(pageable.getSearch())) + // .and(REQUIREMENT.PROJECT_ID.eq(projectId)) TODO ? Add check if project visible or leader == user + .groupBy(REQUIREMENT.ID) + .orderBy(transformer.getSortFields(pageable.getSorts())) + .limit(pageable.getPageSize()) + .offset(pageable.getOffset()) + .fetch(); + + for (Record queryResult : queryResults) { + RequirementRecord requirementRecord = queryResult.into(REQUIREMENT); + Requirement requirement = transformer.getEntityFromTableRecord(requirementRecord); + requirements.add(findById(requirement.getId(), userId)); // TODO: Remove the getId call and create the objects themself here + } + int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); + result = new PaginationResult<>(total, pageable, requirements); + } catch (DataAccessException e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } catch (Exception e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } + return result; + + } + @Override public PaginationResult findAllByProject(int projectId, Pageable pageable, int userId) throws BazaarException { PaginationResult result = null; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java index ad11ddc4..006be164 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java @@ -34,6 +34,7 @@ import java.util.*; import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.CATEGORY; +import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.CATEGORY_FOLLOWER_MAP; /** * @author Adam Gavronek @@ -197,7 +198,30 @@ public Condition getSearchCondition(String search) throws Exception { @Override public Collection getFilterConditions(Map filters) throws Exception { - return new ArrayList<>(); + List conditions = new ArrayList<>(); + for (Map.Entry filterEntry : filters.entrySet()) { + + + if (filterEntry.getKey().equals("created")) { + conditions.add( + CATEGORY.LEADER_ID.eq(Integer.parseInt(filterEntry.getValue())) + ); + }else + + if(filterEntry.getKey().equals("following")){ + conditions.add( + CATEGORY.ID.in( + DSL.select(CATEGORY_FOLLOWER_MAP.CATEGORY_ID) + .from(CATEGORY_FOLLOWER_MAP) + .where(CATEGORY_FOLLOWER_MAP.USER_ID.eq(Integer.parseInt(filterEntry.getValue()))) + ) + ); + } + else{ + conditions.add(DSL.falseCondition()); + } + } + return conditions; } private Category cleanEntry(Category category) { diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java index d1fc7d8b..905f76e4 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java @@ -209,7 +209,7 @@ public Collection getFilterConditions(Map f DSL.trueCondition() ); }else - if (filterEntry.getKey().equals("own")) { + if (filterEntry.getKey().equals("created")) { conditions.add( PROJECT.LEADER_ID.eq(Integer.parseInt(filterEntry.getValue())) ); @@ -222,6 +222,9 @@ public Collection getFilterConditions(Map f ) ); } + else{ + conditions.add(DSL.falseCondition()); + } } return conditions; } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java index 7b3e53c2..7a1927ae 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java @@ -232,6 +232,38 @@ public Collection getFilterConditions(Map f if (filterEntry.getValue().equals("open")) { conditions.add(REQUIREMENT.REALIZED.isNull()); } + }else + + if (filterEntry.getKey().equals("created")) { + conditions.add( + REQUIREMENT.CREATOR_ID.eq(Integer.parseInt(filterEntry.getValue())) + ); + }else + + if(filterEntry.getKey().equals("following")){ + conditions.add( + REQUIREMENT.ID.in( + DSL.select(REQUIREMENT_FOLLOWER_MAP.REQUIREMENT_ID) + .from(REQUIREMENT_FOLLOWER_MAP) + .where(REQUIREMENT_FOLLOWER_MAP.USER_ID.eq(Integer.parseInt(filterEntry.getValue()))) + ) + ); + }else + + if(filterEntry.getKey().equals("developing")){ + conditions.add( + REQUIREMENT.ID.in( + DSL.select(REQUIREMENT_DEVELOPER_MAP.REQUIREMENT_ID) + .from(REQUIREMENT_DEVELOPER_MAP) + .where(REQUIREMENT_DEVELOPER_MAP.USER_ID.eq(Integer.parseInt(filterEntry.getValue()))) + ).or( + REQUIREMENT.LEAD_DEVELOPER_ID.eq(Integer.parseInt(filterEntry.getValue())) + ) + ); + }else{ + conditions.add( + DSL.falseCondition() + ); } } return conditions; From ea2700838427fac20858ea3f1f7789567169e5be Mon Sep 17 00:00:00 2001 From: Milan D Date: Fri, 24 Jan 2020 14:19:28 +0100 Subject: [PATCH 005/134] Regenerating DAL using JOOQ, updating JOOQ-Script to new lib-location --- bin/JOOQGeneration/run.bat | 2 +- bin/JOOQGeneration/run.sh | 2 +- .../service/dal/jooq/DefaultCatalog.java | 25 +++--- .../acis/bazaar/service/dal/jooq/Keys.java | 71 ++++++++++++--- .../acis/bazaar/service/dal/jooq/Reqbaz.java | 88 ++++++++++++------- .../acis/bazaar/service/dal/jooq/Tables.java | 34 +++++-- .../service/dal/jooq/tables/Attachment.java | 28 +++--- .../service/dal/jooq/tables/Category.java | 28 +++--- .../dal/jooq/tables/CategoryFollowerMap.java | 28 +++--- .../service/dal/jooq/tables/Comment.java | 28 +++--- .../service/dal/jooq/tables/Privilege.java | 27 +++--- .../service/dal/jooq/tables/Project.java | 28 +++--- .../dal/jooq/tables/ProjectFollowerMap.java | 28 +++--- .../service/dal/jooq/tables/Requirement.java | 28 +++--- .../jooq/tables/RequirementCategoryMap.java | 28 +++--- .../jooq/tables/RequirementDeveloperMap.java | 28 +++--- .../jooq/tables/RequirementFollowerMap.java | 28 +++--- .../bazaar/service/dal/jooq/tables/Role.java | 27 +++--- .../dal/jooq/tables/RolePrivilegeMap.java | 28 +++--- .../service/dal/jooq/tables/RoleRoleMap.java | 28 +++--- .../dal/jooq/tables/SchemaVersion.java | 26 +++--- .../bazaar/service/dal/jooq/tables/User.java | 31 ++++--- .../service/dal/jooq/tables/UserRoleMap.java | 28 +++--- .../bazaar/service/dal/jooq/tables/Vote.java | 28 +++--- .../jooq/tables/records/AttachmentRecord.java | 22 ++--- .../jooq/tables/records/CategoryRecord.java | 22 ++--- .../jooq/tables/records/CommentRecord.java | 22 ++--- .../jooq/tables/records/PrivilegeRecord.java | 19 ++-- .../jooq/tables/records/ProjectRecord.java | 22 ++--- .../tables/records/RequirementRecord.java | 22 ++--- .../records/RolePrivilegeMapRecord.java | 19 ++-- .../dal/jooq/tables/records/RoleRecord.java | 19 ++-- .../tables/records/RoleRoleMapRecord.java | 19 ++-- .../tables/records/SchemaVersionRecord.java | 22 ++--- .../dal/jooq/tables/records/UserRecord.java | 22 ++--- .../tables/records/UserRoleMapRecord.java | 19 ++-- .../dal/jooq/tables/records/VoteRecord.java | 22 ++--- 37 files changed, 622 insertions(+), 374 deletions(-) diff --git a/bin/JOOQGeneration/run.bat b/bin/JOOQGeneration/run.bat index fe58ffc6..0e6e5b8f 100644 --- a/bin/JOOQGeneration/run.bat +++ b/bin/JOOQGeneration/run.bat @@ -1 +1 @@ -java -classpath ../../service/jooq-3.9.1.jar;../../service/jooq-meta-3.9.1.jar;../../service/jooq-codegen-3.9.1.jar;../../service/mysql-connector-java-6.0.5.jar;. org.jooq.util.GenerationTool /reqbaz_generation_info.xml +java -classpath ../../lib/jooq-3.9.1.jar;../../lib/jooq-meta-3.9.1.jar;../../lib/jooq-codegen-3.9.1.jar;../../lib/mysql-connector-java-6.0.5.jar;. org.jooq.util.GenerationTool /reqbaz_generation_info.xml diff --git a/bin/JOOQGeneration/run.sh b/bin/JOOQGeneration/run.sh index 01bb562d..91a07687 100755 --- a/bin/JOOQGeneration/run.sh +++ b/bin/JOOQGeneration/run.sh @@ -1 +1 @@ -java -classpath ../../service/jooq-3.9.1.jar:../../service/jooq-meta-3.9.1.jar:../../service/jooq-codegen-3.9.1.jar:../../service/mysql-connector-java-6.0.5.jar:. org.jooq.util.GenerationTool /reqbaz_generation_info.xml +java -classpath ../../lib/jooq-3.9.1.jar:../../lib/jooq-meta-3.9.1.jar:../../lib/jooq-codegen-3.9.1.jar:../../lib/mysql-connector-java-6.0.5.jar:. org.jooq.util.GenerationTool /reqbaz_generation_info.xml diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/DefaultCatalog.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/DefaultCatalog.java index 37fa34c8..8494890d 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/DefaultCatalog.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/DefaultCatalog.java @@ -1,29 +1,30 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq; -import org.jooq.Schema; -import org.jooq.impl.CatalogImpl; - -import javax.annotation.Generated; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Schema; +import org.jooq.impl.CatalogImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class DefaultCatalog extends CatalogImpl { private static final long serialVersionUID = 617773064; @@ -54,6 +55,6 @@ public final List getSchemas() { private final List getSchemas0() { return Arrays.asList( - Reqbaz.REQBAZ); + Reqbaz.REQBAZ); } } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Keys.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Keys.java index db732abd..0b079402 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Keys.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Keys.java @@ -1,31 +1,68 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.*; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.*; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Attachment; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Category; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.CategoryFollowerMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.PersonalisationData; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Privilege; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Project; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.ProjectFollowerMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Requirement; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementCategoryMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementDeveloperMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementFollowerMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Role; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RolePrivilegeMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RoleRoleMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.SchemaVersion; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.UserRoleMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Vote; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.AttachmentRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CategoryFollowerMapRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CategoryRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CommentRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.PersonalisationDataRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.PrivilegeRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.ProjectFollowerMapRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.ProjectRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementCategoryMapRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementDeveloperMapRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementFollowerMapRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RolePrivilegeMapRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RoleRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RoleRoleMapRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.SchemaVersionRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.UserRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.UserRoleMapRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.VoteRecord; + +import javax.annotation.Generated; + import org.jooq.ForeignKey; import org.jooq.Identity; import org.jooq.UniqueKey; import org.jooq.impl.AbstractKeys; -import javax.annotation.Generated; - /** - * A class modelling foreign key relationships between tables of the reqbaz + * A class modelling foreign key relationships between tables of the reqbaz * schema */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Keys { // ------------------------------------------------------------------------- @@ -36,6 +73,7 @@ public class Keys { public static final Identity IDENTITY_CATEGORY = Identities0.IDENTITY_CATEGORY; public static final Identity IDENTITY_CATEGORY_FOLLOWER_MAP = Identities0.IDENTITY_CATEGORY_FOLLOWER_MAP; public static final Identity IDENTITY_COMMENT = Identities0.IDENTITY_COMMENT; + public static final Identity IDENTITY_PERSONALISATION_DATA = Identities0.IDENTITY_PERSONALISATION_DATA; public static final Identity IDENTITY_PRIVILEGE = Identities0.IDENTITY_PRIVILEGE; public static final Identity IDENTITY_PROJECT = Identities0.IDENTITY_PROJECT; public static final Identity IDENTITY_PROJECT_FOLLOWER_MAP = Identities0.IDENTITY_PROJECT_FOLLOWER_MAP; @@ -58,6 +96,8 @@ public class Keys { public static final UniqueKey KEY_CATEGORY_PRIMARY = UniqueKeys0.KEY_CATEGORY_PRIMARY; public static final UniqueKey KEY_CATEGORY_FOLLOWER_MAP_PRIMARY = UniqueKeys0.KEY_CATEGORY_FOLLOWER_MAP_PRIMARY; public static final UniqueKey KEY_COMMENT_PRIMARY = UniqueKeys0.KEY_COMMENT_PRIMARY; + public static final UniqueKey KEY_PERSONALISATION_DATA_PRIMARY = UniqueKeys0.KEY_PERSONALISATION_DATA_PRIMARY; + public static final UniqueKey KEY_PERSONALISATION_DATA_PERSONALISATION_KEY = UniqueKeys0.KEY_PERSONALISATION_DATA_PERSONALISATION_KEY; public static final UniqueKey KEY_PRIVILEGE_PRIMARY = UniqueKeys0.KEY_PRIVILEGE_PRIMARY; public static final UniqueKey KEY_PROJECT_PRIMARY = UniqueKeys0.KEY_PROJECT_PRIMARY; public static final UniqueKey KEY_PROJECT_FOLLOWER_MAP_PRIMARY = UniqueKeys0.KEY_PROJECT_FOLLOWER_MAP_PRIMARY; @@ -71,7 +111,6 @@ public class Keys { public static final UniqueKey KEY_ROLE_ROLE_MAP_PRIMARY = UniqueKeys0.KEY_ROLE_ROLE_MAP_PRIMARY; public static final UniqueKey KEY_SCHEMA_VERSION_PRIMARY = UniqueKeys0.KEY_SCHEMA_VERSION_PRIMARY; public static final UniqueKey KEY_USER_PRIMARY = UniqueKeys0.KEY_USER_PRIMARY; - public static final UniqueKey KEY_USER_LAS2PEER_IDX = UniqueKeys0.KEY_USER_LAS2PEER_IDX; public static final UniqueKey KEY_USER_ROLE_MAP_PRIMARY = UniqueKeys0.KEY_USER_ROLE_MAP_PRIMARY; public static final UniqueKey KEY_VOTE_PRIMARY = UniqueKeys0.KEY_VOTE_PRIMARY; @@ -88,6 +127,7 @@ public class Keys { public static final ForeignKey COMMENT_REQUIREMENT = ForeignKeys0.COMMENT_REQUIREMENT; public static final ForeignKey COMMENT_USER = ForeignKeys0.COMMENT_USER; public static final ForeignKey REPLY_COMMENT = ForeignKeys0.REPLY_COMMENT; + public static final ForeignKey PERSONALISATION_USER = ForeignKeys0.PERSONALISATION_USER; public static final ForeignKey PROJECT_USER = ForeignKeys0.PROJECT_USER; public static final ForeignKey PROJECT_CATEGORY = ForeignKeys0.PROJECT_CATEGORY; public static final ForeignKey PROJECT_FOLLOWER_MAP_PROJECT = ForeignKeys0.PROJECT_FOLLOWER_MAP_PROJECT; @@ -119,6 +159,7 @@ private static class Identities0 extends AbstractKeys { public static Identity IDENTITY_CATEGORY = createIdentity(Category.CATEGORY, Category.CATEGORY.ID); public static Identity IDENTITY_CATEGORY_FOLLOWER_MAP = createIdentity(CategoryFollowerMap.CATEGORY_FOLLOWER_MAP, CategoryFollowerMap.CATEGORY_FOLLOWER_MAP.ID); public static Identity IDENTITY_COMMENT = createIdentity(Comment.COMMENT, Comment.COMMENT.ID); + public static Identity IDENTITY_PERSONALISATION_DATA = createIdentity(PersonalisationData.PERSONALISATION_DATA, PersonalisationData.PERSONALISATION_DATA.ID); public static Identity IDENTITY_PRIVILEGE = createIdentity(Privilege.PRIVILEGE, Privilege.PRIVILEGE.ID); public static Identity IDENTITY_PROJECT = createIdentity(Project.PROJECT, Project.PROJECT.ID); public static Identity IDENTITY_PROJECT_FOLLOWER_MAP = createIdentity(ProjectFollowerMap.PROJECT_FOLLOWER_MAP, ProjectFollowerMap.PROJECT_FOLLOWER_MAP.ID); @@ -139,6 +180,8 @@ private static class UniqueKeys0 extends AbstractKeys { public static final UniqueKey KEY_CATEGORY_PRIMARY = createUniqueKey(Category.CATEGORY, "KEY_category_PRIMARY", Category.CATEGORY.ID); public static final UniqueKey KEY_CATEGORY_FOLLOWER_MAP_PRIMARY = createUniqueKey(CategoryFollowerMap.CATEGORY_FOLLOWER_MAP, "KEY_category_follower_map_PRIMARY", CategoryFollowerMap.CATEGORY_FOLLOWER_MAP.ID); public static final UniqueKey KEY_COMMENT_PRIMARY = createUniqueKey(Comment.COMMENT, "KEY_comment_PRIMARY", Comment.COMMENT.ID); + public static final UniqueKey KEY_PERSONALISATION_DATA_PRIMARY = createUniqueKey(PersonalisationData.PERSONALISATION_DATA, "KEY_personalisation_data_PRIMARY", PersonalisationData.PERSONALISATION_DATA.ID); + public static final UniqueKey KEY_PERSONALISATION_DATA_PERSONALISATION_KEY = createUniqueKey(PersonalisationData.PERSONALISATION_DATA, "KEY_personalisation_data_personalisation_key", PersonalisationData.PERSONALISATION_DATA.IDENTIFIER, PersonalisationData.PERSONALISATION_DATA.USER_ID, PersonalisationData.PERSONALISATION_DATA.VERSION); public static final UniqueKey KEY_PRIVILEGE_PRIMARY = createUniqueKey(Privilege.PRIVILEGE, "KEY_privilege_PRIMARY", Privilege.PRIVILEGE.ID); public static final UniqueKey KEY_PROJECT_PRIMARY = createUniqueKey(Project.PROJECT, "KEY_project_PRIMARY", Project.PROJECT.ID); public static final UniqueKey KEY_PROJECT_FOLLOWER_MAP_PRIMARY = createUniqueKey(ProjectFollowerMap.PROJECT_FOLLOWER_MAP, "KEY_project_follower_map_PRIMARY", ProjectFollowerMap.PROJECT_FOLLOWER_MAP.ID); @@ -152,7 +195,6 @@ private static class UniqueKeys0 extends AbstractKeys { public static final UniqueKey KEY_ROLE_ROLE_MAP_PRIMARY = createUniqueKey(RoleRoleMap.ROLE_ROLE_MAP, "KEY_role_role_map_PRIMARY", RoleRoleMap.ROLE_ROLE_MAP.ID); public static final UniqueKey KEY_SCHEMA_VERSION_PRIMARY = createUniqueKey(SchemaVersion.SCHEMA_VERSION, "KEY_schema_version_PRIMARY", SchemaVersion.SCHEMA_VERSION.INSTALLED_RANK); public static final UniqueKey KEY_USER_PRIMARY = createUniqueKey(User.USER, "KEY_user_PRIMARY", User.USER.ID); - public static final UniqueKey KEY_USER_LAS2PEER_IDX = createUniqueKey(User.USER, "KEY_user_las2peer_idx", User.USER.LAS2PEER_ID); public static final UniqueKey KEY_USER_ROLE_MAP_PRIMARY = createUniqueKey(UserRoleMap.USER_ROLE_MAP, "KEY_user_role_map_PRIMARY", UserRoleMap.USER_ROLE_MAP.ID); public static final UniqueKey KEY_VOTE_PRIMARY = createUniqueKey(Vote.VOTE, "KEY_vote_PRIMARY", Vote.VOTE.ID); } @@ -167,6 +209,7 @@ private static class ForeignKeys0 extends AbstractKeys { public static final ForeignKey COMMENT_REQUIREMENT = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_REQUIREMENT_PRIMARY, Comment.COMMENT, "comment_requirement", Comment.COMMENT.REQUIREMENT_ID); public static final ForeignKey COMMENT_USER = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_USER_PRIMARY, Comment.COMMENT, "comment_user", Comment.COMMENT.USER_ID); public static final ForeignKey REPLY_COMMENT = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_COMMENT_PRIMARY, Comment.COMMENT, "reply_comment", Comment.COMMENT.REPLY_TO_COMMENT_ID); + public static final ForeignKey PERSONALISATION_USER = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_USER_PRIMARY, PersonalisationData.PERSONALISATION_DATA, "personalisation_user", PersonalisationData.PERSONALISATION_DATA.USER_ID); public static final ForeignKey PROJECT_USER = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_USER_PRIMARY, Project.PROJECT, "project_user", Project.PROJECT.LEADER_ID); public static final ForeignKey PROJECT_CATEGORY = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_CATEGORY_PRIMARY, Project.PROJECT, "project_category", Project.PROJECT.DEFAULT_CATEGORY_ID); public static final ForeignKey PROJECT_FOLLOWER_MAP_PROJECT = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_PROJECT_PRIMARY, ProjectFollowerMap.PROJECT_FOLLOWER_MAP, "project_follower_map_project", ProjectFollowerMap.PROJECT_FOLLOWER_MAP.PROJECT_ID); diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Reqbaz.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Reqbaz.java index 5ee813d6..1548f9e0 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Reqbaz.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Reqbaz.java @@ -1,34 +1,54 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.*; -import org.jooq.Catalog; -import org.jooq.Table; -import org.jooq.impl.SchemaImpl; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Attachment; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Category; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.CategoryFollowerMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.PersonalisationData; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Privilege; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Project; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.ProjectFollowerMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Requirement; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementCategoryMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementDeveloperMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementFollowerMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Role; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RolePrivilegeMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RoleRoleMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.SchemaVersion; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.UserRoleMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Vote; -import javax.annotation.Generated; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Catalog; +import org.jooq.Table; +import org.jooq.impl.SchemaImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Reqbaz extends SchemaImpl { - private static final long serialVersionUID = 1551044375; + private static final long serialVersionUID = 1110546097; /** * The reference instance of reqbaz @@ -55,6 +75,11 @@ public class Reqbaz extends SchemaImpl { */ public final Comment COMMENT = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment.COMMENT; + /** + * The table reqbaz.personalisation_data. + */ + public final PersonalisationData PERSONALISATION_DATA = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.PersonalisationData.PERSONALISATION_DATA; + /** * The table reqbaz.privilege. */ @@ -150,23 +175,24 @@ public final List> getTables() { private final List> getTables0() { return Arrays.>asList( - Attachment.ATTACHMENT, - Category.CATEGORY, - CategoryFollowerMap.CATEGORY_FOLLOWER_MAP, - Comment.COMMENT, - Privilege.PRIVILEGE, - Project.PROJECT, - ProjectFollowerMap.PROJECT_FOLLOWER_MAP, - Requirement.REQUIREMENT, - RequirementCategoryMap.REQUIREMENT_CATEGORY_MAP, - RequirementDeveloperMap.REQUIREMENT_DEVELOPER_MAP, - RequirementFollowerMap.REQUIREMENT_FOLLOWER_MAP, - Role.ROLE, - RolePrivilegeMap.ROLE_PRIVILEGE_MAP, - RoleRoleMap.ROLE_ROLE_MAP, - SchemaVersion.SCHEMA_VERSION, - User.USER, - UserRoleMap.USER_ROLE_MAP, - Vote.VOTE); + Attachment.ATTACHMENT, + Category.CATEGORY, + CategoryFollowerMap.CATEGORY_FOLLOWER_MAP, + Comment.COMMENT, + PersonalisationData.PERSONALISATION_DATA, + Privilege.PRIVILEGE, + Project.PROJECT, + ProjectFollowerMap.PROJECT_FOLLOWER_MAP, + Requirement.REQUIREMENT, + RequirementCategoryMap.REQUIREMENT_CATEGORY_MAP, + RequirementDeveloperMap.REQUIREMENT_DEVELOPER_MAP, + RequirementFollowerMap.REQUIREMENT_FOLLOWER_MAP, + Role.ROLE, + RolePrivilegeMap.ROLE_PRIVILEGE_MAP, + RoleRoleMap.ROLE_ROLE_MAP, + SchemaVersion.SCHEMA_VERSION, + User.USER, + UserRoleMap.USER_ROLE_MAP, + Vote.VOTE); } } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Tables.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Tables.java index c17346e3..d521875e 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Tables.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Tables.java @@ -1,10 +1,28 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.*; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Attachment; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Category; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.CategoryFollowerMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.PersonalisationData; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Privilege; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Project; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.ProjectFollowerMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Requirement; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementCategoryMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementDeveloperMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementFollowerMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Role; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RolePrivilegeMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RoleRoleMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.SchemaVersion; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.UserRoleMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Vote; import javax.annotation.Generated; @@ -13,13 +31,13 @@ * Convenience access to all tables in reqbaz */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Tables { /** diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Attachment.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Attachment.java index dfcf5e42..fb833226 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Attachment.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Attachment.java @@ -1,32 +1,40 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.AttachmentRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Attachment extends TableImpl { private static final long serialVersionUID = -1603866374; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Category.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Category.java index 3b914e86..3e10abea 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Category.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Category.java @@ -1,32 +1,40 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CategoryRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Category extends TableImpl { private static final long serialVersionUID = 1856403820; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/CategoryFollowerMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/CategoryFollowerMap.java index 6b2ae008..8e63380f 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/CategoryFollowerMap.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/CategoryFollowerMap.java @@ -1,32 +1,40 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CategoryFollowerMapRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class CategoryFollowerMap extends TableImpl { private static final long serialVersionUID = -1568253073; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Comment.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Comment.java index 5cd00d29..f34eab0f 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Comment.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Comment.java @@ -1,32 +1,40 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CommentRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Comment extends TableImpl { private static final long serialVersionUID = -348339124; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Privilege.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Privilege.java index ccdb2a8c..830dc74d 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Privilege.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Privilege.java @@ -1,31 +1,38 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.PrivilegeRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Privilege extends TableImpl { private static final long serialVersionUID = 799298701; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Project.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Project.java index d688c1a8..b9364e2d 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Project.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Project.java @@ -1,32 +1,40 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.ProjectRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Project extends TableImpl { private static final long serialVersionUID = 1235446294; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/ProjectFollowerMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/ProjectFollowerMap.java index 14a67863..d3512fed 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/ProjectFollowerMap.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/ProjectFollowerMap.java @@ -1,32 +1,40 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.ProjectFollowerMapRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class ProjectFollowerMap extends TableImpl { private static final long serialVersionUID = -1701261507; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Requirement.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Requirement.java index adf3908b..ad8ddd67 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Requirement.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Requirement.java @@ -1,32 +1,40 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Requirement extends TableImpl { private static final long serialVersionUID = 507661299; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementCategoryMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementCategoryMap.java index 78b805da..8ff46047 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementCategoryMap.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementCategoryMap.java @@ -1,31 +1,39 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementCategoryMapRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class RequirementCategoryMap extends TableImpl { private static final long serialVersionUID = -1083456567; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementDeveloperMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementDeveloperMap.java index c1f9721a..1f848ac4 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementDeveloperMap.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementDeveloperMap.java @@ -1,32 +1,40 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementDeveloperMapRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class RequirementDeveloperMap extends TableImpl { private static final long serialVersionUID = 559012393; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementFollowerMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementFollowerMap.java index a46897dd..f93695d0 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementFollowerMap.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementFollowerMap.java @@ -1,32 +1,40 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementFollowerMapRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class RequirementFollowerMap extends TableImpl { private static final long serialVersionUID = -1236442855; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Role.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Role.java index be7c541e..520f5af1 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Role.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Role.java @@ -1,31 +1,38 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RoleRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Role extends TableImpl { private static final long serialVersionUID = 2020251099; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RolePrivilegeMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RolePrivilegeMap.java index af859b3c..05cbab45 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RolePrivilegeMap.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RolePrivilegeMap.java @@ -1,31 +1,39 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RolePrivilegeMapRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class RolePrivilegeMap extends TableImpl { private static final long serialVersionUID = 288946433; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RoleRoleMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RoleRoleMap.java index 10f6961a..38f5b038 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RoleRoleMap.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RoleRoleMap.java @@ -1,31 +1,39 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RoleRoleMapRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class RoleRoleMap extends TableImpl { private static final long serialVersionUID = 308433545; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/SchemaVersion.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/SchemaVersion.java index cd056048..eb14a391 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/SchemaVersion.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/SchemaVersion.java @@ -1,32 +1,38 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.SchemaVersionRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class SchemaVersion extends TableImpl { private static final long serialVersionUID = -1750837905; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/User.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/User.java index 9216ae31..e11ef45e 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/User.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/User.java @@ -1,35 +1,42 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.UserRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class User extends TableImpl { - private static final long serialVersionUID = 1439298886; + private static final long serialVersionUID = 952606792; /** * The reference instance of reqbaz.user @@ -160,7 +167,7 @@ public UniqueKey getPrimaryKey() { */ @Override public List> getKeys() { - return Arrays.>asList(Keys.KEY_USER_PRIMARY, Keys.KEY_USER_LAS2PEER_IDX); + return Arrays.>asList(Keys.KEY_USER_PRIMARY); } /** diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/UserRoleMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/UserRoleMap.java index d071b095..3bcdd532 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/UserRoleMap.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/UserRoleMap.java @@ -1,31 +1,39 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.UserRoleMapRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class UserRoleMap extends TableImpl { private static final long serialVersionUID = 902266899; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Vote.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Vote.java index eaa6610e..bfb5a536 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Vote.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Vote.java @@ -1,32 +1,40 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.VoteRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Vote extends TableImpl { private static final long serialVersionUID = 1104351894; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/AttachmentRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/AttachmentRecord.java index 028a2ee6..2dd804ff 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/AttachmentRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/AttachmentRecord.java @@ -1,31 +1,33 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Attachment; + +import java.sql.Timestamp; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record10; import org.jooq.Row10; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; -import java.sql.Timestamp; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class AttachmentRecord extends UpdatableRecordImpl implements Record10 { private static final long serialVersionUID = 888863633; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CategoryRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CategoryRecord.java index ca63da4b..05516d2d 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CategoryRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CategoryRecord.java @@ -1,31 +1,33 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Category; + +import java.sql.Timestamp; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record7; import org.jooq.Row7; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; -import java.sql.Timestamp; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class CategoryRecord extends UpdatableRecordImpl implements Record7 { private static final long serialVersionUID = 1461191440; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CommentRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CommentRecord.java index 4c9d11cb..b1df5177 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CommentRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CommentRecord.java @@ -1,31 +1,33 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment; + +import java.sql.Timestamp; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record7; import org.jooq.Row7; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; -import java.sql.Timestamp; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class CommentRecord extends UpdatableRecordImpl implements Record7 { private static final long serialVersionUID = 191217760; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/PrivilegeRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/PrivilegeRecord.java index 4db24236..699fad6f 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/PrivilegeRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/PrivilegeRecord.java @@ -1,30 +1,31 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Privilege; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record2; import org.jooq.Row2; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class PrivilegeRecord extends UpdatableRecordImpl implements Record2 { private static final long serialVersionUID = -324005622; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/ProjectRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/ProjectRecord.java index a27513b8..677b63f3 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/ProjectRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/ProjectRecord.java @@ -1,31 +1,33 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Project; + +import java.sql.Timestamp; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record8; import org.jooq.Row8; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; -import java.sql.Timestamp; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class ProjectRecord extends UpdatableRecordImpl implements Record8 { private static final long serialVersionUID = 416723320; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementRecord.java index 4b877b60..d72b12d9 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementRecord.java @@ -1,31 +1,33 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Requirement; + +import java.sql.Timestamp; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record9; import org.jooq.Row9; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; -import java.sql.Timestamp; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class RequirementRecord extends UpdatableRecordImpl implements Record9 { private static final long serialVersionUID = 340315030; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RolePrivilegeMapRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RolePrivilegeMapRecord.java index a2bbf83a..e7c955a4 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RolePrivilegeMapRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RolePrivilegeMapRecord.java @@ -1,30 +1,31 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RolePrivilegeMap; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record3; import org.jooq.Row3; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class RolePrivilegeMapRecord extends UpdatableRecordImpl implements Record3 { private static final long serialVersionUID = -308748188; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRecord.java index 82f2fd50..ace8164d 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRecord.java @@ -1,30 +1,31 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Role; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record2; import org.jooq.Row2; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class RoleRecord extends UpdatableRecordImpl implements Record2 { private static final long serialVersionUID = 854316714; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRoleMapRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRoleMapRecord.java index 791d8544..e745b767 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRoleMapRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRoleMapRecord.java @@ -1,30 +1,31 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RoleRoleMap; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record3; import org.jooq.Row3; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class RoleRoleMapRecord extends UpdatableRecordImpl implements Record3 { private static final long serialVersionUID = 1477419030; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/SchemaVersionRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/SchemaVersionRecord.java index b7c77d44..084baf9c 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/SchemaVersionRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/SchemaVersionRecord.java @@ -1,31 +1,33 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.SchemaVersion; + +import java.sql.Timestamp; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record10; import org.jooq.Row10; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; -import java.sql.Timestamp; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class SchemaVersionRecord extends UpdatableRecordImpl implements Record10 { private static final long serialVersionUID = -1022760374; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRecord.java index a8385d87..ecb57837 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRecord.java @@ -1,31 +1,33 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User; + +import java.sql.Timestamp; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record13; import org.jooq.Row13; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; -import java.sql.Timestamp; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class UserRecord extends UpdatableRecordImpl implements Record13 { private static final long serialVersionUID = 131097065; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRoleMapRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRoleMapRecord.java index a1bcd3f7..fd82a8dd 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRoleMapRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRoleMapRecord.java @@ -1,30 +1,31 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.UserRoleMap; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record4; import org.jooq.Row4; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class UserRoleMapRecord extends UpdatableRecordImpl implements Record4 { private static final long serialVersionUID = -247032073; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/VoteRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/VoteRecord.java index 6fb983e9..b6fd6a3d 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/VoteRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/VoteRecord.java @@ -1,31 +1,33 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Vote; + +import java.sql.Timestamp; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record5; import org.jooq.Row5; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; -import java.sql.Timestamp; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class VoteRecord extends UpdatableRecordImpl implements Record5 { private static final long serialVersionUID = 1481873125; From e976aedae20ffbc11237bf3799456a4b6e45f935 Mon Sep 17 00:00:00 2001 From: Milan D Date: Thu, 23 Jan 2020 22:40:10 +0100 Subject: [PATCH 006/134] Update PersonalisationDataResource to l2p 0.8 --- .../service/PersonalisationDataResource.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java b/src/main/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java index 7021cbb3..cb6bdf62 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java @@ -10,9 +10,9 @@ import de.rwth.dbis.acis.bazaar.service.internalization.Localization; import de.rwth.dbis.acis.bazaar.service.security.AuthorizationManager; import i5.las2peer.api.Context; -import i5.las2peer.logging.NodeObserver; +import i5.las2peer.api.logging.MonitoringEvent; +import i5.las2peer.api.security.Agent; import i5.las2peer.logging.L2pLogger; -import i5.las2peer.security.UserAgent; import io.swagger.annotations.*; import jodd.vtor.Vtor; @@ -45,7 +45,7 @@ @Path("/personalisation") public class PersonalisationDataResource { - private final L2pLogger logger = L2pLogger.getInstance(AttachmentsResource.class.getName()); + private final L2pLogger logger = L2pLogger.getInstance(PersonalisationDataResource.class.getName()); private BazaarService bazaarService; public PersonalisationDataResource() throws Exception { @@ -74,8 +74,8 @@ public PersonalisationDataResource() throws Exception { public Response getPersonalisationData(@PathParam("key") String key, @PathParam("version") int version) { DALFacade dalFacade = null; try { - UserAgent agent = (UserAgent) Context.getCurrent().getMainAgent(); - long userId = agent.getId(); + Agent agent = Context.getCurrent().getMainAgent(); + String userId = agent.getIdentifier(); String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); if (registrarErrors != null) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); @@ -96,13 +96,13 @@ public Response getPersonalisationData(@PathParam("key") String key, @PathParam( return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } else { logger.warning(bex.getMessage()); - L2pLogger.logEvent(NodeObserver.Event.SERVICE_ERROR, Context.getCurrent().getMainAgent(), "Get personalisationData " + key+" version:"+version ); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get personalisationData " + key+" version:"+version ); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } } catch (Exception ex) { BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); logger.warning(bex.getMessage()); - L2pLogger.logEvent(NodeObserver.Event.SERVICE_ERROR, Context.getCurrent().getMainAgent(), "Get personalisationData " + key+" version:"+version ); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get personalisationData " + key+" version:"+version ); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } finally { bazaarService.closeDBConnection(dalFacade); @@ -129,8 +129,8 @@ public Response getPersonalisationData(@PathParam("key") String key, @PathParam( public Response setPersonalisationData(@ApiParam(value = "PersonalisationData as JSON", required = true) PersonalisationData data) { DALFacade dalFacade = null; try { - UserAgent agent = (UserAgent) Context.getCurrent().getMainAgent(); - long userId = agent.getId(); + Agent agent = Context.getCurrent().getMainAgent(); + String userId = agent.getIdentifier(); String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); if (registrarErrors != null) { @@ -164,13 +164,13 @@ public Response setPersonalisationData(@ApiParam(value = "PersonalisationData as return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } else { logger.warning(bex.getMessage()); - L2pLogger.logEvent(NodeObserver.Event.SERVICE_ERROR, Context.getCurrent().getMainAgent(), "Create comment"); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Set personalisationData"); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } } catch (Exception ex) { BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); logger.warning(bex.getMessage()); - L2pLogger.logEvent(NodeObserver.Event.SERVICE_ERROR, Context.getCurrent().getMainAgent(), "Create comment"); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Set personalisationData"); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } finally { bazaarService.closeDBConnection(dalFacade); From f27f59f291e3ffe63356023474f2e4f40e7ad05b Mon Sep 17 00:00:00 2001 From: Milan D Date: Wed, 25 Dec 2019 01:19:11 +0100 Subject: [PATCH 007/134] =?UTF-8?q?Project=20Endpoint=20Filters=20for=20?= =?UTF-8?q?=E2=80=9EAll=E2=80=9C,=20=E2=80=9EOwn=E2=80=9C=20and=20?= =?UTF-8?q?=E2=80=9EFollowing=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../acis/bazaar/service/ProjectsResource.java | 20 ++++++++++---- .../repositories/ProjectRepositoryImpl.java | 3 ++- .../dal/transform/ProjectTransformer.java | 27 ++++++++++++++++++- 3 files changed, 43 insertions(+), 7 deletions(-) diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java b/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java index 3a4ba9f0..ad47140e 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java @@ -78,9 +78,10 @@ public Response getProjects( @ApiParam(value = "Page number", required = false) @DefaultValue("0") @QueryParam("page") int page, @ApiParam(value = "Elements of project by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage, @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, - @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date,last_activity,requirement,follower") @DefaultValue("name") @QueryParam("sort") List sort) { + @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date,last_activity,requirement,follower") @DefaultValue("name") @QueryParam("sort") List sort, + @ApiParam(value = "Filter", required = false, allowMultiple = true, allowableValues = "all, own, following") @QueryParam("filters") List filters) { - DALFacade dalFacade = null; + DALFacade dalFacade = null; try { String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); if (registrarErrors != null) { @@ -102,14 +103,23 @@ public Response getProjects( Pageable.SortField sortField = new Pageable.SortField(sortOption, direction); sortList.add(sortField); } - PageInfo pageInfo = new PageInfo(page, perPage, new HashMap<>(), sortList, search); + + dalFacade = bazaarService.getDBConnection(); + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + + HashMap filterMap = new HashMap<>(); + for(String filterOption : filters) { + filterMap.put(filterOption,internalUserId.toString()); + } + PageInfo pageInfo = new PageInfo(page, perPage, filterMap, sortList, search); + + Vtor vtor = bazaarService.getValidators(); vtor.validate(pageInfo); if (vtor.hasViolations()) { ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); } - dalFacade = bazaarService.getDBConnection(); - Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + PaginationResult projectsResult; if (agent instanceof AnonymousAgent) { // return only public projects diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java index 6d5ebd20..930250ce 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java @@ -265,7 +265,8 @@ public PaginationResult findAllPublicAndAuthorized(PageInfo pageable, i // .leftOuterJoin(AUTHORIZATIONS).on(AUTHORIZATIONS.PROJECT_ID.equal(PROJECTS.ID)) // .join(USERS).on(AUTHORIZATIONS.USER_ID.equal(USERS.ID)) // .where(PROJECTS.VISIBILITY.eq(Project.ProjectVisibility.PUBLIC.asChar()) - .where(PROJECT.VISIBILITY.isTrue().or(leaderUser.ID.equal(userId)) + .where(transformer.getFilterConditions(pageable.getFilters())) + .and(PROJECT.VISIBILITY.isTrue().or(leaderUser.ID.equal(userId)) .and(transformer.getSearchCondition(pageable.getSearch()))) .orderBy(transformer.getSortFields(pageable.getSorts())) .limit(pageable.getPageSize()) diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java index e2725898..bd38183c 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java @@ -30,6 +30,10 @@ import java.util.*; + + +import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.REQUIREMENT; +import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.PROJECT; import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.*; public class ProjectTransformer implements Transformer { @@ -198,7 +202,28 @@ public Condition getSearchCondition(String search) throws Exception { @Override public Collection getFilterConditions(Map filters) throws Exception { - return new ArrayList<>(); + List conditions = new ArrayList<>(); + for (Map.Entry filterEntry : filters.entrySet()) { + if(filterEntry.getKey().equals("all")){ + conditions.add( + DSL.trueCondition() + ); + }else + if (filterEntry.getKey().equals("own")) { + conditions.add( + PROJECT.LEADER_ID.eq(Integer.parseInt(filterEntry.getValue())) + ); + }else if(filterEntry.getKey().equals("following")){ + conditions.add( + PROJECT.ID.in( + DSL.select(PROJECT_FOLLOWER_MAP.PROJECT_ID) + .from(PROJECT_FOLLOWER_MAP) + .where(PROJECT_FOLLOWER_MAP.USER_ID.eq(Integer.parseInt(filterEntry.getValue()))) + ) + ); + } + } + return conditions; } private Project cleanEntry(Project project) { From dc695c2dbfd6c53271d97332dbda9bde135b57de Mon Sep 17 00:00:00 2001 From: Milan D Date: Sun, 19 Jan 2020 14:13:04 +0100 Subject: [PATCH 008/134] Projects endpoint support ids MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enables to filter projects against a list of ids using &ids[]=1&ids[]=2… Combinalble with all other parameters/filters --- .../acis/bazaar/service/ProjectsResource.java | 5 +++-- .../bazaar/service/dal/helpers/PageInfo.java | 18 +++++++++++++----- .../bazaar/service/dal/helpers/Pageable.java | 2 ++ .../repositories/ProjectRepositoryImpl.java | 10 ++++++++-- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java b/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java index ad47140e..27a92bf6 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java @@ -79,7 +79,8 @@ public Response getProjects( @ApiParam(value = "Elements of project by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage, @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date,last_activity,requirement,follower") @DefaultValue("name") @QueryParam("sort") List sort, - @ApiParam(value = "Filter", required = false, allowMultiple = true, allowableValues = "all, own, following") @QueryParam("filters") List filters) { + @ApiParam(value = "Filter", required = false, allowMultiple = true, allowableValues = "all, own, following") @QueryParam("filters") List filters, + @ApiParam(value = "Ids", required = false, allowMultiple = true) @QueryParam("ids") List ids) { DALFacade dalFacade = null; try { @@ -111,7 +112,7 @@ public Response getProjects( for(String filterOption : filters) { filterMap.put(filterOption,internalUserId.toString()); } - PageInfo pageInfo = new PageInfo(page, perPage, filterMap, sortList, search); + PageInfo pageInfo = new PageInfo(page, perPage, filterMap, sortList, search, ids); Vtor vtor = bazaarService.getValidators(); diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java index 1fa917b1..da4d1ac4 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java @@ -39,21 +39,26 @@ public class PageInfo implements Pageable { private final Map filters; private final List sorts; private final String search; + private final List ids; public PageInfo(int pageNumber, int pageSize) { - this(pageNumber, pageSize, new HashMap<>(), new ArrayList<>(), null); + this(pageNumber, pageSize, new HashMap<>(), new ArrayList<>(), null, null); } public PageInfo(int pageNumber, int pageSize, Map filters) { - this(pageNumber, pageSize, filters, new ArrayList<>(), null); + this(pageNumber, pageSize, filters, new ArrayList<>(), null,null); + } + public PageInfo(int pageNumber, int pageSize, Map filters, List sorts, String search){ + this(pageNumber, pageSize, filters, sorts, search,null); } - public PageInfo(int pageNumber, int pageSize, Map filters, List sorts, String search) { + public PageInfo(int pageNumber, int pageSize, Map filters, List sorts, String search, List ids) { this.pageNumber = pageNumber; this.pageSize = pageSize; this.filters = filters; this.sorts = sorts; this.search = search != null ? search : ""; + this.ids = ids; } @Override @@ -82,7 +87,10 @@ public List getSorts() { } @Override - public String getSearch() { - return search; + public List getIds() { + return ids; } + + @Override + public String getSearch() {return search;} } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java index a7d66eb2..6c68f2bd 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java @@ -40,6 +40,8 @@ public interface Pageable { String getSearch(); + List getIds(); + class SortField { String field; SortDirection sortDirection; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java index 930250ce..b1de7dd0 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java @@ -206,6 +206,7 @@ public PaginationResult findAllPublic(Pageable pageable, int userId) th .leftOuterJoin(LAST_ACTIVITY).on(PROJECT.ID.eq(LAST_ACTIVITY.field(PROJECT.ID))) .where(PROJECT.VISIBILITY.isTrue()) .and(transformer.getSearchCondition(pageable.getSearch())) + .and((pageable.getIds().size() > 0)?PROJECT.ID.in(pageable.getIds()):trueCondition()) //If list of ids parsed, add in condition .orderBy(transformer.getSortFields(pageable.getSorts())) .limit(pageable.getPageSize()) .offset(pageable.getOffset()) @@ -266,8 +267,13 @@ public PaginationResult findAllPublicAndAuthorized(PageInfo pageable, i // .join(USERS).on(AUTHORIZATIONS.USER_ID.equal(USERS.ID)) // .where(PROJECTS.VISIBILITY.eq(Project.ProjectVisibility.PUBLIC.asChar()) .where(transformer.getFilterConditions(pageable.getFilters())) - .and(PROJECT.VISIBILITY.isTrue().or(leaderUser.ID.equal(userId)) - .and(transformer.getSearchCondition(pageable.getSearch()))) + .and( + (pageable.getIds().size() > 0)?(PROJECT.ID.in(pageable.getIds())):trueCondition() + .and( + PROJECT.VISIBILITY.isTrue().or(leaderUser.ID.equal(userId)) + ).and( + transformer.getSearchCondition(pageable.getSearch())) + ) .orderBy(transformer.getSortFields(pageable.getSorts())) .limit(pageable.getPageSize()) .offset(pageable.getOffset()) From 6f416c404e8422eb8de8914d08bea5f37f7072a8 Mon Sep 17 00:00:00 2001 From: Milan D Date: Fri, 24 Jan 2020 15:18:54 +0100 Subject: [PATCH 009/134] Regenerating DAL using JOOQ, updating JOOQ-Script to new lib-location --- bin/JOOQGeneration/run.bat | 2 +- bin/JOOQGeneration/run.sh | 2 +- .../service/dal/jooq/DefaultCatalog.java | 25 +++--- .../acis/bazaar/service/dal/jooq/Keys.java | 71 ++++++++++++--- .../acis/bazaar/service/dal/jooq/Reqbaz.java | 88 ++++++++++++------- .../acis/bazaar/service/dal/jooq/Tables.java | 39 ++++++-- .../service/dal/jooq/tables/Attachment.java | 28 +++--- .../service/dal/jooq/tables/Category.java | 28 +++--- .../dal/jooq/tables/CategoryFollowerMap.java | 28 +++--- .../service/dal/jooq/tables/Comment.java | 28 +++--- .../service/dal/jooq/tables/Privilege.java | 27 +++--- .../service/dal/jooq/tables/Project.java | 28 +++--- .../dal/jooq/tables/ProjectFollowerMap.java | 28 +++--- .../service/dal/jooq/tables/Requirement.java | 28 +++--- .../jooq/tables/RequirementCategoryMap.java | 28 +++--- .../jooq/tables/RequirementDeveloperMap.java | 28 +++--- .../jooq/tables/RequirementFollowerMap.java | 28 +++--- .../bazaar/service/dal/jooq/tables/Role.java | 27 +++--- .../dal/jooq/tables/RolePrivilegeMap.java | 28 +++--- .../service/dal/jooq/tables/RoleRoleMap.java | 28 +++--- .../dal/jooq/tables/SchemaVersion.java | 26 +++--- .../bazaar/service/dal/jooq/tables/User.java | 31 ++++--- .../service/dal/jooq/tables/UserRoleMap.java | 28 +++--- .../bazaar/service/dal/jooq/tables/Vote.java | 28 +++--- .../jooq/tables/records/AttachmentRecord.java | 22 ++--- .../jooq/tables/records/CategoryRecord.java | 22 ++--- .../jooq/tables/records/CommentRecord.java | 22 ++--- .../jooq/tables/records/PrivilegeRecord.java | 19 ++-- .../jooq/tables/records/ProjectRecord.java | 22 ++--- .../tables/records/RequirementRecord.java | 22 ++--- .../records/RolePrivilegeMapRecord.java | 19 ++-- .../dal/jooq/tables/records/RoleRecord.java | 19 ++-- .../tables/records/RoleRoleMapRecord.java | 19 ++-- .../tables/records/SchemaVersionRecord.java | 22 ++--- .../dal/jooq/tables/records/UserRecord.java | 22 ++--- .../tables/records/UserRoleMapRecord.java | 19 ++-- .../dal/jooq/tables/records/VoteRecord.java | 22 ++--- 37 files changed, 627 insertions(+), 374 deletions(-) diff --git a/bin/JOOQGeneration/run.bat b/bin/JOOQGeneration/run.bat index fe58ffc6..0e6e5b8f 100644 --- a/bin/JOOQGeneration/run.bat +++ b/bin/JOOQGeneration/run.bat @@ -1 +1 @@ -java -classpath ../../service/jooq-3.9.1.jar;../../service/jooq-meta-3.9.1.jar;../../service/jooq-codegen-3.9.1.jar;../../service/mysql-connector-java-6.0.5.jar;. org.jooq.util.GenerationTool /reqbaz_generation_info.xml +java -classpath ../../lib/jooq-3.9.1.jar;../../lib/jooq-meta-3.9.1.jar;../../lib/jooq-codegen-3.9.1.jar;../../lib/mysql-connector-java-6.0.5.jar;. org.jooq.util.GenerationTool /reqbaz_generation_info.xml diff --git a/bin/JOOQGeneration/run.sh b/bin/JOOQGeneration/run.sh index 01bb562d..91a07687 100755 --- a/bin/JOOQGeneration/run.sh +++ b/bin/JOOQGeneration/run.sh @@ -1 +1 @@ -java -classpath ../../service/jooq-3.9.1.jar:../../service/jooq-meta-3.9.1.jar:../../service/jooq-codegen-3.9.1.jar:../../service/mysql-connector-java-6.0.5.jar:. org.jooq.util.GenerationTool /reqbaz_generation_info.xml +java -classpath ../../lib/jooq-3.9.1.jar:../../lib/jooq-meta-3.9.1.jar:../../lib/jooq-codegen-3.9.1.jar:../../lib/mysql-connector-java-6.0.5.jar:. org.jooq.util.GenerationTool /reqbaz_generation_info.xml diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/DefaultCatalog.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/DefaultCatalog.java index 37fa34c8..8494890d 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/DefaultCatalog.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/DefaultCatalog.java @@ -1,29 +1,30 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq; -import org.jooq.Schema; -import org.jooq.impl.CatalogImpl; - -import javax.annotation.Generated; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Schema; +import org.jooq.impl.CatalogImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class DefaultCatalog extends CatalogImpl { private static final long serialVersionUID = 617773064; @@ -54,6 +55,6 @@ public final List getSchemas() { private final List getSchemas0() { return Arrays.asList( - Reqbaz.REQBAZ); + Reqbaz.REQBAZ); } } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Keys.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Keys.java index db732abd..0b079402 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Keys.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Keys.java @@ -1,31 +1,68 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.*; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.*; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Attachment; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Category; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.CategoryFollowerMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.PersonalisationData; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Privilege; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Project; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.ProjectFollowerMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Requirement; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementCategoryMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementDeveloperMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementFollowerMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Role; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RolePrivilegeMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RoleRoleMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.SchemaVersion; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.UserRoleMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Vote; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.AttachmentRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CategoryFollowerMapRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CategoryRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CommentRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.PersonalisationDataRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.PrivilegeRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.ProjectFollowerMapRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.ProjectRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementCategoryMapRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementDeveloperMapRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementFollowerMapRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RolePrivilegeMapRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RoleRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RoleRoleMapRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.SchemaVersionRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.UserRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.UserRoleMapRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.VoteRecord; + +import javax.annotation.Generated; + import org.jooq.ForeignKey; import org.jooq.Identity; import org.jooq.UniqueKey; import org.jooq.impl.AbstractKeys; -import javax.annotation.Generated; - /** - * A class modelling foreign key relationships between tables of the reqbaz + * A class modelling foreign key relationships between tables of the reqbaz * schema */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Keys { // ------------------------------------------------------------------------- @@ -36,6 +73,7 @@ public class Keys { public static final Identity IDENTITY_CATEGORY = Identities0.IDENTITY_CATEGORY; public static final Identity IDENTITY_CATEGORY_FOLLOWER_MAP = Identities0.IDENTITY_CATEGORY_FOLLOWER_MAP; public static final Identity IDENTITY_COMMENT = Identities0.IDENTITY_COMMENT; + public static final Identity IDENTITY_PERSONALISATION_DATA = Identities0.IDENTITY_PERSONALISATION_DATA; public static final Identity IDENTITY_PRIVILEGE = Identities0.IDENTITY_PRIVILEGE; public static final Identity IDENTITY_PROJECT = Identities0.IDENTITY_PROJECT; public static final Identity IDENTITY_PROJECT_FOLLOWER_MAP = Identities0.IDENTITY_PROJECT_FOLLOWER_MAP; @@ -58,6 +96,8 @@ public class Keys { public static final UniqueKey KEY_CATEGORY_PRIMARY = UniqueKeys0.KEY_CATEGORY_PRIMARY; public static final UniqueKey KEY_CATEGORY_FOLLOWER_MAP_PRIMARY = UniqueKeys0.KEY_CATEGORY_FOLLOWER_MAP_PRIMARY; public static final UniqueKey KEY_COMMENT_PRIMARY = UniqueKeys0.KEY_COMMENT_PRIMARY; + public static final UniqueKey KEY_PERSONALISATION_DATA_PRIMARY = UniqueKeys0.KEY_PERSONALISATION_DATA_PRIMARY; + public static final UniqueKey KEY_PERSONALISATION_DATA_PERSONALISATION_KEY = UniqueKeys0.KEY_PERSONALISATION_DATA_PERSONALISATION_KEY; public static final UniqueKey KEY_PRIVILEGE_PRIMARY = UniqueKeys0.KEY_PRIVILEGE_PRIMARY; public static final UniqueKey KEY_PROJECT_PRIMARY = UniqueKeys0.KEY_PROJECT_PRIMARY; public static final UniqueKey KEY_PROJECT_FOLLOWER_MAP_PRIMARY = UniqueKeys0.KEY_PROJECT_FOLLOWER_MAP_PRIMARY; @@ -71,7 +111,6 @@ public class Keys { public static final UniqueKey KEY_ROLE_ROLE_MAP_PRIMARY = UniqueKeys0.KEY_ROLE_ROLE_MAP_PRIMARY; public static final UniqueKey KEY_SCHEMA_VERSION_PRIMARY = UniqueKeys0.KEY_SCHEMA_VERSION_PRIMARY; public static final UniqueKey KEY_USER_PRIMARY = UniqueKeys0.KEY_USER_PRIMARY; - public static final UniqueKey KEY_USER_LAS2PEER_IDX = UniqueKeys0.KEY_USER_LAS2PEER_IDX; public static final UniqueKey KEY_USER_ROLE_MAP_PRIMARY = UniqueKeys0.KEY_USER_ROLE_MAP_PRIMARY; public static final UniqueKey KEY_VOTE_PRIMARY = UniqueKeys0.KEY_VOTE_PRIMARY; @@ -88,6 +127,7 @@ public class Keys { public static final ForeignKey COMMENT_REQUIREMENT = ForeignKeys0.COMMENT_REQUIREMENT; public static final ForeignKey COMMENT_USER = ForeignKeys0.COMMENT_USER; public static final ForeignKey REPLY_COMMENT = ForeignKeys0.REPLY_COMMENT; + public static final ForeignKey PERSONALISATION_USER = ForeignKeys0.PERSONALISATION_USER; public static final ForeignKey PROJECT_USER = ForeignKeys0.PROJECT_USER; public static final ForeignKey PROJECT_CATEGORY = ForeignKeys0.PROJECT_CATEGORY; public static final ForeignKey PROJECT_FOLLOWER_MAP_PROJECT = ForeignKeys0.PROJECT_FOLLOWER_MAP_PROJECT; @@ -119,6 +159,7 @@ private static class Identities0 extends AbstractKeys { public static Identity IDENTITY_CATEGORY = createIdentity(Category.CATEGORY, Category.CATEGORY.ID); public static Identity IDENTITY_CATEGORY_FOLLOWER_MAP = createIdentity(CategoryFollowerMap.CATEGORY_FOLLOWER_MAP, CategoryFollowerMap.CATEGORY_FOLLOWER_MAP.ID); public static Identity IDENTITY_COMMENT = createIdentity(Comment.COMMENT, Comment.COMMENT.ID); + public static Identity IDENTITY_PERSONALISATION_DATA = createIdentity(PersonalisationData.PERSONALISATION_DATA, PersonalisationData.PERSONALISATION_DATA.ID); public static Identity IDENTITY_PRIVILEGE = createIdentity(Privilege.PRIVILEGE, Privilege.PRIVILEGE.ID); public static Identity IDENTITY_PROJECT = createIdentity(Project.PROJECT, Project.PROJECT.ID); public static Identity IDENTITY_PROJECT_FOLLOWER_MAP = createIdentity(ProjectFollowerMap.PROJECT_FOLLOWER_MAP, ProjectFollowerMap.PROJECT_FOLLOWER_MAP.ID); @@ -139,6 +180,8 @@ private static class UniqueKeys0 extends AbstractKeys { public static final UniqueKey KEY_CATEGORY_PRIMARY = createUniqueKey(Category.CATEGORY, "KEY_category_PRIMARY", Category.CATEGORY.ID); public static final UniqueKey KEY_CATEGORY_FOLLOWER_MAP_PRIMARY = createUniqueKey(CategoryFollowerMap.CATEGORY_FOLLOWER_MAP, "KEY_category_follower_map_PRIMARY", CategoryFollowerMap.CATEGORY_FOLLOWER_MAP.ID); public static final UniqueKey KEY_COMMENT_PRIMARY = createUniqueKey(Comment.COMMENT, "KEY_comment_PRIMARY", Comment.COMMENT.ID); + public static final UniqueKey KEY_PERSONALISATION_DATA_PRIMARY = createUniqueKey(PersonalisationData.PERSONALISATION_DATA, "KEY_personalisation_data_PRIMARY", PersonalisationData.PERSONALISATION_DATA.ID); + public static final UniqueKey KEY_PERSONALISATION_DATA_PERSONALISATION_KEY = createUniqueKey(PersonalisationData.PERSONALISATION_DATA, "KEY_personalisation_data_personalisation_key", PersonalisationData.PERSONALISATION_DATA.IDENTIFIER, PersonalisationData.PERSONALISATION_DATA.USER_ID, PersonalisationData.PERSONALISATION_DATA.VERSION); public static final UniqueKey KEY_PRIVILEGE_PRIMARY = createUniqueKey(Privilege.PRIVILEGE, "KEY_privilege_PRIMARY", Privilege.PRIVILEGE.ID); public static final UniqueKey KEY_PROJECT_PRIMARY = createUniqueKey(Project.PROJECT, "KEY_project_PRIMARY", Project.PROJECT.ID); public static final UniqueKey KEY_PROJECT_FOLLOWER_MAP_PRIMARY = createUniqueKey(ProjectFollowerMap.PROJECT_FOLLOWER_MAP, "KEY_project_follower_map_PRIMARY", ProjectFollowerMap.PROJECT_FOLLOWER_MAP.ID); @@ -152,7 +195,6 @@ private static class UniqueKeys0 extends AbstractKeys { public static final UniqueKey KEY_ROLE_ROLE_MAP_PRIMARY = createUniqueKey(RoleRoleMap.ROLE_ROLE_MAP, "KEY_role_role_map_PRIMARY", RoleRoleMap.ROLE_ROLE_MAP.ID); public static final UniqueKey KEY_SCHEMA_VERSION_PRIMARY = createUniqueKey(SchemaVersion.SCHEMA_VERSION, "KEY_schema_version_PRIMARY", SchemaVersion.SCHEMA_VERSION.INSTALLED_RANK); public static final UniqueKey KEY_USER_PRIMARY = createUniqueKey(User.USER, "KEY_user_PRIMARY", User.USER.ID); - public static final UniqueKey KEY_USER_LAS2PEER_IDX = createUniqueKey(User.USER, "KEY_user_las2peer_idx", User.USER.LAS2PEER_ID); public static final UniqueKey KEY_USER_ROLE_MAP_PRIMARY = createUniqueKey(UserRoleMap.USER_ROLE_MAP, "KEY_user_role_map_PRIMARY", UserRoleMap.USER_ROLE_MAP.ID); public static final UniqueKey KEY_VOTE_PRIMARY = createUniqueKey(Vote.VOTE, "KEY_vote_PRIMARY", Vote.VOTE.ID); } @@ -167,6 +209,7 @@ private static class ForeignKeys0 extends AbstractKeys { public static final ForeignKey COMMENT_REQUIREMENT = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_REQUIREMENT_PRIMARY, Comment.COMMENT, "comment_requirement", Comment.COMMENT.REQUIREMENT_ID); public static final ForeignKey COMMENT_USER = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_USER_PRIMARY, Comment.COMMENT, "comment_user", Comment.COMMENT.USER_ID); public static final ForeignKey REPLY_COMMENT = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_COMMENT_PRIMARY, Comment.COMMENT, "reply_comment", Comment.COMMENT.REPLY_TO_COMMENT_ID); + public static final ForeignKey PERSONALISATION_USER = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_USER_PRIMARY, PersonalisationData.PERSONALISATION_DATA, "personalisation_user", PersonalisationData.PERSONALISATION_DATA.USER_ID); public static final ForeignKey PROJECT_USER = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_USER_PRIMARY, Project.PROJECT, "project_user", Project.PROJECT.LEADER_ID); public static final ForeignKey PROJECT_CATEGORY = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_CATEGORY_PRIMARY, Project.PROJECT, "project_category", Project.PROJECT.DEFAULT_CATEGORY_ID); public static final ForeignKey PROJECT_FOLLOWER_MAP_PROJECT = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_PROJECT_PRIMARY, ProjectFollowerMap.PROJECT_FOLLOWER_MAP, "project_follower_map_project", ProjectFollowerMap.PROJECT_FOLLOWER_MAP.PROJECT_ID); diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Reqbaz.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Reqbaz.java index 5ee813d6..1548f9e0 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Reqbaz.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Reqbaz.java @@ -1,34 +1,54 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.*; -import org.jooq.Catalog; -import org.jooq.Table; -import org.jooq.impl.SchemaImpl; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Attachment; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Category; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.CategoryFollowerMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.PersonalisationData; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Privilege; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Project; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.ProjectFollowerMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Requirement; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementCategoryMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementDeveloperMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementFollowerMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Role; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RolePrivilegeMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RoleRoleMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.SchemaVersion; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.UserRoleMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Vote; -import javax.annotation.Generated; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Catalog; +import org.jooq.Table; +import org.jooq.impl.SchemaImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Reqbaz extends SchemaImpl { - private static final long serialVersionUID = 1551044375; + private static final long serialVersionUID = 1110546097; /** * The reference instance of reqbaz @@ -55,6 +75,11 @@ public class Reqbaz extends SchemaImpl { */ public final Comment COMMENT = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment.COMMENT; + /** + * The table reqbaz.personalisation_data. + */ + public final PersonalisationData PERSONALISATION_DATA = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.PersonalisationData.PERSONALISATION_DATA; + /** * The table reqbaz.privilege. */ @@ -150,23 +175,24 @@ public final List> getTables() { private final List> getTables0() { return Arrays.>asList( - Attachment.ATTACHMENT, - Category.CATEGORY, - CategoryFollowerMap.CATEGORY_FOLLOWER_MAP, - Comment.COMMENT, - Privilege.PRIVILEGE, - Project.PROJECT, - ProjectFollowerMap.PROJECT_FOLLOWER_MAP, - Requirement.REQUIREMENT, - RequirementCategoryMap.REQUIREMENT_CATEGORY_MAP, - RequirementDeveloperMap.REQUIREMENT_DEVELOPER_MAP, - RequirementFollowerMap.REQUIREMENT_FOLLOWER_MAP, - Role.ROLE, - RolePrivilegeMap.ROLE_PRIVILEGE_MAP, - RoleRoleMap.ROLE_ROLE_MAP, - SchemaVersion.SCHEMA_VERSION, - User.USER, - UserRoleMap.USER_ROLE_MAP, - Vote.VOTE); + Attachment.ATTACHMENT, + Category.CATEGORY, + CategoryFollowerMap.CATEGORY_FOLLOWER_MAP, + Comment.COMMENT, + PersonalisationData.PERSONALISATION_DATA, + Privilege.PRIVILEGE, + Project.PROJECT, + ProjectFollowerMap.PROJECT_FOLLOWER_MAP, + Requirement.REQUIREMENT, + RequirementCategoryMap.REQUIREMENT_CATEGORY_MAP, + RequirementDeveloperMap.REQUIREMENT_DEVELOPER_MAP, + RequirementFollowerMap.REQUIREMENT_FOLLOWER_MAP, + Role.ROLE, + RolePrivilegeMap.ROLE_PRIVILEGE_MAP, + RoleRoleMap.ROLE_ROLE_MAP, + SchemaVersion.SCHEMA_VERSION, + User.USER, + UserRoleMap.USER_ROLE_MAP, + Vote.VOTE); } } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Tables.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Tables.java index c17346e3..eaa3ae2f 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Tables.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Tables.java @@ -1,10 +1,28 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.*; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Attachment; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Category; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.CategoryFollowerMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.PersonalisationData; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Privilege; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Project; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.ProjectFollowerMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Requirement; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementCategoryMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementDeveloperMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementFollowerMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Role; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RolePrivilegeMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RoleRoleMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.SchemaVersion; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.UserRoleMap; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Vote; import javax.annotation.Generated; @@ -13,13 +31,13 @@ * Convenience access to all tables in reqbaz */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Tables { /** @@ -42,6 +60,11 @@ public class Tables { */ public static final Comment COMMENT = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment.COMMENT; + /** + * The table reqbaz.personalisation_data. + */ + public static final PersonalisationData PERSONALISATION_DATA = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.PersonalisationData.PERSONALISATION_DATA; + /** * The table reqbaz.privilege. */ diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Attachment.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Attachment.java index dfcf5e42..fb833226 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Attachment.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Attachment.java @@ -1,32 +1,40 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.AttachmentRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Attachment extends TableImpl { private static final long serialVersionUID = -1603866374; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Category.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Category.java index 3b914e86..3e10abea 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Category.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Category.java @@ -1,32 +1,40 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CategoryRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Category extends TableImpl { private static final long serialVersionUID = 1856403820; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/CategoryFollowerMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/CategoryFollowerMap.java index 6b2ae008..8e63380f 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/CategoryFollowerMap.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/CategoryFollowerMap.java @@ -1,32 +1,40 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CategoryFollowerMapRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class CategoryFollowerMap extends TableImpl { private static final long serialVersionUID = -1568253073; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Comment.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Comment.java index 5cd00d29..f34eab0f 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Comment.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Comment.java @@ -1,32 +1,40 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CommentRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Comment extends TableImpl { private static final long serialVersionUID = -348339124; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Privilege.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Privilege.java index ccdb2a8c..830dc74d 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Privilege.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Privilege.java @@ -1,31 +1,38 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.PrivilegeRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Privilege extends TableImpl { private static final long serialVersionUID = 799298701; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Project.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Project.java index d688c1a8..b9364e2d 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Project.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Project.java @@ -1,32 +1,40 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.ProjectRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Project extends TableImpl { private static final long serialVersionUID = 1235446294; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/ProjectFollowerMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/ProjectFollowerMap.java index 14a67863..d3512fed 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/ProjectFollowerMap.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/ProjectFollowerMap.java @@ -1,32 +1,40 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.ProjectFollowerMapRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class ProjectFollowerMap extends TableImpl { private static final long serialVersionUID = -1701261507; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Requirement.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Requirement.java index adf3908b..ad8ddd67 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Requirement.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Requirement.java @@ -1,32 +1,40 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Requirement extends TableImpl { private static final long serialVersionUID = 507661299; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementCategoryMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementCategoryMap.java index 78b805da..8ff46047 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementCategoryMap.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementCategoryMap.java @@ -1,31 +1,39 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementCategoryMapRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class RequirementCategoryMap extends TableImpl { private static final long serialVersionUID = -1083456567; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementDeveloperMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementDeveloperMap.java index c1f9721a..1f848ac4 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementDeveloperMap.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementDeveloperMap.java @@ -1,32 +1,40 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementDeveloperMapRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class RequirementDeveloperMap extends TableImpl { private static final long serialVersionUID = 559012393; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementFollowerMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementFollowerMap.java index a46897dd..f93695d0 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementFollowerMap.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementFollowerMap.java @@ -1,32 +1,40 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementFollowerMapRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class RequirementFollowerMap extends TableImpl { private static final long serialVersionUID = -1236442855; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Role.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Role.java index be7c541e..520f5af1 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Role.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Role.java @@ -1,31 +1,38 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RoleRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Role extends TableImpl { private static final long serialVersionUID = 2020251099; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RolePrivilegeMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RolePrivilegeMap.java index af859b3c..05cbab45 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RolePrivilegeMap.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RolePrivilegeMap.java @@ -1,31 +1,39 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RolePrivilegeMapRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class RolePrivilegeMap extends TableImpl { private static final long serialVersionUID = 288946433; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RoleRoleMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RoleRoleMap.java index 10f6961a..38f5b038 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RoleRoleMap.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RoleRoleMap.java @@ -1,31 +1,39 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RoleRoleMapRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class RoleRoleMap extends TableImpl { private static final long serialVersionUID = 308433545; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/SchemaVersion.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/SchemaVersion.java index cd056048..eb14a391 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/SchemaVersion.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/SchemaVersion.java @@ -1,32 +1,38 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.SchemaVersionRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class SchemaVersion extends TableImpl { private static final long serialVersionUID = -1750837905; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/User.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/User.java index 9216ae31..e11ef45e 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/User.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/User.java @@ -1,35 +1,42 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.UserRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class User extends TableImpl { - private static final long serialVersionUID = 1439298886; + private static final long serialVersionUID = 952606792; /** * The reference instance of reqbaz.user @@ -160,7 +167,7 @@ public UniqueKey getPrimaryKey() { */ @Override public List> getKeys() { - return Arrays.>asList(Keys.KEY_USER_PRIMARY, Keys.KEY_USER_LAS2PEER_IDX); + return Arrays.>asList(Keys.KEY_USER_PRIMARY); } /** diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/UserRoleMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/UserRoleMap.java index d071b095..3bcdd532 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/UserRoleMap.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/UserRoleMap.java @@ -1,31 +1,39 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.UserRoleMapRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class UserRoleMap extends TableImpl { private static final long serialVersionUID = 902266899; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Vote.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Vote.java index eaa6610e..bfb5a536 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Vote.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Vote.java @@ -1,32 +1,40 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.VoteRecord; -import org.jooq.*; -import org.jooq.impl.TableImpl; -import javax.annotation.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Vote extends TableImpl { private static final long serialVersionUID = 1104351894; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/AttachmentRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/AttachmentRecord.java index 028a2ee6..2dd804ff 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/AttachmentRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/AttachmentRecord.java @@ -1,31 +1,33 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Attachment; + +import java.sql.Timestamp; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record10; import org.jooq.Row10; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; -import java.sql.Timestamp; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class AttachmentRecord extends UpdatableRecordImpl implements Record10 { private static final long serialVersionUID = 888863633; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CategoryRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CategoryRecord.java index ca63da4b..05516d2d 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CategoryRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CategoryRecord.java @@ -1,31 +1,33 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Category; + +import java.sql.Timestamp; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record7; import org.jooq.Row7; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; -import java.sql.Timestamp; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class CategoryRecord extends UpdatableRecordImpl implements Record7 { private static final long serialVersionUID = 1461191440; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CommentRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CommentRecord.java index 4c9d11cb..b1df5177 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CommentRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CommentRecord.java @@ -1,31 +1,33 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment; + +import java.sql.Timestamp; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record7; import org.jooq.Row7; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; -import java.sql.Timestamp; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class CommentRecord extends UpdatableRecordImpl implements Record7 { private static final long serialVersionUID = 191217760; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/PrivilegeRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/PrivilegeRecord.java index 4db24236..699fad6f 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/PrivilegeRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/PrivilegeRecord.java @@ -1,30 +1,31 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Privilege; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record2; import org.jooq.Row2; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class PrivilegeRecord extends UpdatableRecordImpl implements Record2 { private static final long serialVersionUID = -324005622; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/ProjectRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/ProjectRecord.java index a27513b8..677b63f3 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/ProjectRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/ProjectRecord.java @@ -1,31 +1,33 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Project; + +import java.sql.Timestamp; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record8; import org.jooq.Row8; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; -import java.sql.Timestamp; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class ProjectRecord extends UpdatableRecordImpl implements Record8 { private static final long serialVersionUID = 416723320; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementRecord.java index 4b877b60..d72b12d9 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementRecord.java @@ -1,31 +1,33 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Requirement; + +import java.sql.Timestamp; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record9; import org.jooq.Row9; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; -import java.sql.Timestamp; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class RequirementRecord extends UpdatableRecordImpl implements Record9 { private static final long serialVersionUID = 340315030; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RolePrivilegeMapRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RolePrivilegeMapRecord.java index a2bbf83a..e7c955a4 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RolePrivilegeMapRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RolePrivilegeMapRecord.java @@ -1,30 +1,31 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RolePrivilegeMap; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record3; import org.jooq.Row3; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class RolePrivilegeMapRecord extends UpdatableRecordImpl implements Record3 { private static final long serialVersionUID = -308748188; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRecord.java index 82f2fd50..ace8164d 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRecord.java @@ -1,30 +1,31 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Role; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record2; import org.jooq.Row2; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class RoleRecord extends UpdatableRecordImpl implements Record2 { private static final long serialVersionUID = 854316714; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRoleMapRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRoleMapRecord.java index 791d8544..e745b767 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRoleMapRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRoleMapRecord.java @@ -1,30 +1,31 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RoleRoleMap; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record3; import org.jooq.Row3; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class RoleRoleMapRecord extends UpdatableRecordImpl implements Record3 { private static final long serialVersionUID = 1477419030; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/SchemaVersionRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/SchemaVersionRecord.java index b7c77d44..084baf9c 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/SchemaVersionRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/SchemaVersionRecord.java @@ -1,31 +1,33 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.SchemaVersion; + +import java.sql.Timestamp; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record10; import org.jooq.Row10; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; -import java.sql.Timestamp; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class SchemaVersionRecord extends UpdatableRecordImpl implements Record10 { private static final long serialVersionUID = -1022760374; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRecord.java index a8385d87..ecb57837 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRecord.java @@ -1,31 +1,33 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User; + +import java.sql.Timestamp; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record13; import org.jooq.Row13; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; -import java.sql.Timestamp; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class UserRecord extends UpdatableRecordImpl implements Record13 { private static final long serialVersionUID = 131097065; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRoleMapRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRoleMapRecord.java index a1bcd3f7..fd82a8dd 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRoleMapRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRoleMapRecord.java @@ -1,30 +1,31 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.UserRoleMap; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record4; import org.jooq.Row4; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class UserRoleMapRecord extends UpdatableRecordImpl implements Record4 { private static final long serialVersionUID = -247032073; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/VoteRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/VoteRecord.java index 6fb983e9..b6fd6a3d 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/VoteRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/VoteRecord.java @@ -1,31 +1,33 @@ /* * This file is generated by jOOQ. - */ +*/ package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Vote; + +import java.sql.Timestamp; + +import javax.annotation.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record5; import org.jooq.Row5; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.Generated; -import java.sql.Timestamp; - /** * This class is generated by jOOQ. */ @Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" + value = { + "http://www.jooq.org", + "jOOQ version:3.9.1" + }, + comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class VoteRecord extends UpdatableRecordImpl implements Record5 { private static final long serialVersionUID = 1481873125; From 182d5091bb16b6168e0a0dfbf453f61ac147021f Mon Sep 17 00:00:00 2001 From: Milan D Date: Thu, 23 Jan 2020 22:40:10 +0100 Subject: [PATCH 010/134] Update PersonalisationDataResource to l2p 0.8 --- .../service/PersonalisationDataResource.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java b/src/main/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java index 7021cbb3..cb6bdf62 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java @@ -10,9 +10,9 @@ import de.rwth.dbis.acis.bazaar.service.internalization.Localization; import de.rwth.dbis.acis.bazaar.service.security.AuthorizationManager; import i5.las2peer.api.Context; -import i5.las2peer.logging.NodeObserver; +import i5.las2peer.api.logging.MonitoringEvent; +import i5.las2peer.api.security.Agent; import i5.las2peer.logging.L2pLogger; -import i5.las2peer.security.UserAgent; import io.swagger.annotations.*; import jodd.vtor.Vtor; @@ -45,7 +45,7 @@ @Path("/personalisation") public class PersonalisationDataResource { - private final L2pLogger logger = L2pLogger.getInstance(AttachmentsResource.class.getName()); + private final L2pLogger logger = L2pLogger.getInstance(PersonalisationDataResource.class.getName()); private BazaarService bazaarService; public PersonalisationDataResource() throws Exception { @@ -74,8 +74,8 @@ public PersonalisationDataResource() throws Exception { public Response getPersonalisationData(@PathParam("key") String key, @PathParam("version") int version) { DALFacade dalFacade = null; try { - UserAgent agent = (UserAgent) Context.getCurrent().getMainAgent(); - long userId = agent.getId(); + Agent agent = Context.getCurrent().getMainAgent(); + String userId = agent.getIdentifier(); String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); if (registrarErrors != null) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); @@ -96,13 +96,13 @@ public Response getPersonalisationData(@PathParam("key") String key, @PathParam( return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } else { logger.warning(bex.getMessage()); - L2pLogger.logEvent(NodeObserver.Event.SERVICE_ERROR, Context.getCurrent().getMainAgent(), "Get personalisationData " + key+" version:"+version ); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get personalisationData " + key+" version:"+version ); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } } catch (Exception ex) { BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); logger.warning(bex.getMessage()); - L2pLogger.logEvent(NodeObserver.Event.SERVICE_ERROR, Context.getCurrent().getMainAgent(), "Get personalisationData " + key+" version:"+version ); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get personalisationData " + key+" version:"+version ); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } finally { bazaarService.closeDBConnection(dalFacade); @@ -129,8 +129,8 @@ public Response getPersonalisationData(@PathParam("key") String key, @PathParam( public Response setPersonalisationData(@ApiParam(value = "PersonalisationData as JSON", required = true) PersonalisationData data) { DALFacade dalFacade = null; try { - UserAgent agent = (UserAgent) Context.getCurrent().getMainAgent(); - long userId = agent.getId(); + Agent agent = Context.getCurrent().getMainAgent(); + String userId = agent.getIdentifier(); String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); if (registrarErrors != null) { @@ -164,13 +164,13 @@ public Response setPersonalisationData(@ApiParam(value = "PersonalisationData as return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } else { logger.warning(bex.getMessage()); - L2pLogger.logEvent(NodeObserver.Event.SERVICE_ERROR, Context.getCurrent().getMainAgent(), "Create comment"); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Set personalisationData"); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } } catch (Exception ex) { BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); logger.warning(bex.getMessage()); - L2pLogger.logEvent(NodeObserver.Event.SERVICE_ERROR, Context.getCurrent().getMainAgent(), "Create comment"); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Set personalisationData"); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } finally { bazaarService.closeDBConnection(dalFacade); From 81c80752b8afa4cb2b4c287ee712766cdec7f408 Mon Sep 17 00:00:00 2001 From: Milan D Date: Wed, 25 Dec 2019 01:19:11 +0100 Subject: [PATCH 011/134] =?UTF-8?q?Project=20Endpoint=20Filters=20for=20?= =?UTF-8?q?=E2=80=9EAll=E2=80=9C,=20=E2=80=9EOwn=E2=80=9C=20and=20?= =?UTF-8?q?=E2=80=9EFollowing=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../acis/bazaar/service/ProjectsResource.java | 20 ++++++++++---- .../repositories/ProjectRepositoryImpl.java | 3 ++- .../dal/transform/ProjectTransformer.java | 27 ++++++++++++++++++- 3 files changed, 43 insertions(+), 7 deletions(-) diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java b/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java index 3a4ba9f0..ad47140e 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java @@ -78,9 +78,10 @@ public Response getProjects( @ApiParam(value = "Page number", required = false) @DefaultValue("0") @QueryParam("page") int page, @ApiParam(value = "Elements of project by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage, @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, - @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date,last_activity,requirement,follower") @DefaultValue("name") @QueryParam("sort") List sort) { + @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date,last_activity,requirement,follower") @DefaultValue("name") @QueryParam("sort") List sort, + @ApiParam(value = "Filter", required = false, allowMultiple = true, allowableValues = "all, own, following") @QueryParam("filters") List filters) { - DALFacade dalFacade = null; + DALFacade dalFacade = null; try { String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); if (registrarErrors != null) { @@ -102,14 +103,23 @@ public Response getProjects( Pageable.SortField sortField = new Pageable.SortField(sortOption, direction); sortList.add(sortField); } - PageInfo pageInfo = new PageInfo(page, perPage, new HashMap<>(), sortList, search); + + dalFacade = bazaarService.getDBConnection(); + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + + HashMap filterMap = new HashMap<>(); + for(String filterOption : filters) { + filterMap.put(filterOption,internalUserId.toString()); + } + PageInfo pageInfo = new PageInfo(page, perPage, filterMap, sortList, search); + + Vtor vtor = bazaarService.getValidators(); vtor.validate(pageInfo); if (vtor.hasViolations()) { ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); } - dalFacade = bazaarService.getDBConnection(); - Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + PaginationResult projectsResult; if (agent instanceof AnonymousAgent) { // return only public projects diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java index 6d5ebd20..930250ce 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java @@ -265,7 +265,8 @@ public PaginationResult findAllPublicAndAuthorized(PageInfo pageable, i // .leftOuterJoin(AUTHORIZATIONS).on(AUTHORIZATIONS.PROJECT_ID.equal(PROJECTS.ID)) // .join(USERS).on(AUTHORIZATIONS.USER_ID.equal(USERS.ID)) // .where(PROJECTS.VISIBILITY.eq(Project.ProjectVisibility.PUBLIC.asChar()) - .where(PROJECT.VISIBILITY.isTrue().or(leaderUser.ID.equal(userId)) + .where(transformer.getFilterConditions(pageable.getFilters())) + .and(PROJECT.VISIBILITY.isTrue().or(leaderUser.ID.equal(userId)) .and(transformer.getSearchCondition(pageable.getSearch()))) .orderBy(transformer.getSortFields(pageable.getSorts())) .limit(pageable.getPageSize()) diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java index e2725898..bd38183c 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java @@ -30,6 +30,10 @@ import java.util.*; + + +import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.REQUIREMENT; +import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.PROJECT; import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.*; public class ProjectTransformer implements Transformer { @@ -198,7 +202,28 @@ public Condition getSearchCondition(String search) throws Exception { @Override public Collection getFilterConditions(Map filters) throws Exception { - return new ArrayList<>(); + List conditions = new ArrayList<>(); + for (Map.Entry filterEntry : filters.entrySet()) { + if(filterEntry.getKey().equals("all")){ + conditions.add( + DSL.trueCondition() + ); + }else + if (filterEntry.getKey().equals("own")) { + conditions.add( + PROJECT.LEADER_ID.eq(Integer.parseInt(filterEntry.getValue())) + ); + }else if(filterEntry.getKey().equals("following")){ + conditions.add( + PROJECT.ID.in( + DSL.select(PROJECT_FOLLOWER_MAP.PROJECT_ID) + .from(PROJECT_FOLLOWER_MAP) + .where(PROJECT_FOLLOWER_MAP.USER_ID.eq(Integer.parseInt(filterEntry.getValue()))) + ) + ); + } + } + return conditions; } private Project cleanEntry(Project project) { From d88ff192f2077037ee909ec2e0fe02d515d6c8e8 Mon Sep 17 00:00:00 2001 From: Milan D Date: Sun, 19 Jan 2020 14:13:04 +0100 Subject: [PATCH 012/134] Projects endpoint support ids MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enables to filter projects against a list of ids using &ids[]=1&ids[]=2… Combinalble with all other parameters/filters --- .../acis/bazaar/service/ProjectsResource.java | 5 +++-- .../bazaar/service/dal/helpers/PageInfo.java | 18 +++++++++++++----- .../bazaar/service/dal/helpers/Pageable.java | 2 ++ .../repositories/ProjectRepositoryImpl.java | 10 ++++++++-- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java b/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java index ad47140e..27a92bf6 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java @@ -79,7 +79,8 @@ public Response getProjects( @ApiParam(value = "Elements of project by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage, @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date,last_activity,requirement,follower") @DefaultValue("name") @QueryParam("sort") List sort, - @ApiParam(value = "Filter", required = false, allowMultiple = true, allowableValues = "all, own, following") @QueryParam("filters") List filters) { + @ApiParam(value = "Filter", required = false, allowMultiple = true, allowableValues = "all, own, following") @QueryParam("filters") List filters, + @ApiParam(value = "Ids", required = false, allowMultiple = true) @QueryParam("ids") List ids) { DALFacade dalFacade = null; try { @@ -111,7 +112,7 @@ public Response getProjects( for(String filterOption : filters) { filterMap.put(filterOption,internalUserId.toString()); } - PageInfo pageInfo = new PageInfo(page, perPage, filterMap, sortList, search); + PageInfo pageInfo = new PageInfo(page, perPage, filterMap, sortList, search, ids); Vtor vtor = bazaarService.getValidators(); diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java index 1fa917b1..da4d1ac4 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java @@ -39,21 +39,26 @@ public class PageInfo implements Pageable { private final Map filters; private final List sorts; private final String search; + private final List ids; public PageInfo(int pageNumber, int pageSize) { - this(pageNumber, pageSize, new HashMap<>(), new ArrayList<>(), null); + this(pageNumber, pageSize, new HashMap<>(), new ArrayList<>(), null, null); } public PageInfo(int pageNumber, int pageSize, Map filters) { - this(pageNumber, pageSize, filters, new ArrayList<>(), null); + this(pageNumber, pageSize, filters, new ArrayList<>(), null,null); + } + public PageInfo(int pageNumber, int pageSize, Map filters, List sorts, String search){ + this(pageNumber, pageSize, filters, sorts, search,null); } - public PageInfo(int pageNumber, int pageSize, Map filters, List sorts, String search) { + public PageInfo(int pageNumber, int pageSize, Map filters, List sorts, String search, List ids) { this.pageNumber = pageNumber; this.pageSize = pageSize; this.filters = filters; this.sorts = sorts; this.search = search != null ? search : ""; + this.ids = ids; } @Override @@ -82,7 +87,10 @@ public List getSorts() { } @Override - public String getSearch() { - return search; + public List getIds() { + return ids; } + + @Override + public String getSearch() {return search;} } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java index a7d66eb2..6c68f2bd 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java @@ -40,6 +40,8 @@ public interface Pageable { String getSearch(); + List getIds(); + class SortField { String field; SortDirection sortDirection; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java index 930250ce..b1de7dd0 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java @@ -206,6 +206,7 @@ public PaginationResult findAllPublic(Pageable pageable, int userId) th .leftOuterJoin(LAST_ACTIVITY).on(PROJECT.ID.eq(LAST_ACTIVITY.field(PROJECT.ID))) .where(PROJECT.VISIBILITY.isTrue()) .and(transformer.getSearchCondition(pageable.getSearch())) + .and((pageable.getIds().size() > 0)?PROJECT.ID.in(pageable.getIds()):trueCondition()) //If list of ids parsed, add in condition .orderBy(transformer.getSortFields(pageable.getSorts())) .limit(pageable.getPageSize()) .offset(pageable.getOffset()) @@ -266,8 +267,13 @@ public PaginationResult findAllPublicAndAuthorized(PageInfo pageable, i // .join(USERS).on(AUTHORIZATIONS.USER_ID.equal(USERS.ID)) // .where(PROJECTS.VISIBILITY.eq(Project.ProjectVisibility.PUBLIC.asChar()) .where(transformer.getFilterConditions(pageable.getFilters())) - .and(PROJECT.VISIBILITY.isTrue().or(leaderUser.ID.equal(userId)) - .and(transformer.getSearchCondition(pageable.getSearch()))) + .and( + (pageable.getIds().size() > 0)?(PROJECT.ID.in(pageable.getIds())):trueCondition() + .and( + PROJECT.VISIBILITY.isTrue().or(leaderUser.ID.equal(userId)) + ).and( + transformer.getSearchCondition(pageable.getSearch())) + ) .orderBy(transformer.getSortFields(pageable.getSorts())) .limit(pageable.getPageSize()) .offset(pageable.getOffset()) From 81212f472dc6b0ad15f67b36b87b74ce90f4ec10 Mon Sep 17 00:00:00 2001 From: Milan D Date: Wed, 22 Jan 2020 18:02:39 +0100 Subject: [PATCH 013/134] EntityOverview endpoint, basis for personalized get requirements/categories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [TESTED] Modifaction of transformers to support personalized filteroptions [UNTESTED] findAll functions for requirements & categories [TESTED] listRequirementIds & listCategoryIds & listProjectIds functions returning only lists if id’s [TESTED] getEntitiesForUser function in DALFacade combining listRequirementIds & listCategoryIds & listProjectIds into new Entity „EntityOverview“ [TESTED] /users/me/entities endpoint, returning EntityOverview for /me/ TODOS: Write DALFacade & Resource function/endpoints for getAll functions REFACTORING/POSSIBLE PROBLEMS: - Too much logic inside DALFacade? Move one level up? - Rewrite PageInfo to support „getPersonalisedFilters(int userid)“ instead of parsing id through hash-map - Change name of users-endpoint? --- .../acis/bazaar/service/ProjectsResource.java | 2 +- .../acis/bazaar/service/UsersResource.java | 89 ++++++++++++++- .../acis/bazaar/service/dal/DALFacade.java | 8 ++ .../bazaar/service/dal/DALFacadeImpl.java | 24 ++++ .../service/dal/entities/EntityOverview.java | 108 ++++++++++++++++++ .../dal/repositories/CategoryRepository.java | 5 + .../repositories/CategoryRepositoryImpl.java | 90 +++++++++++++++ .../dal/repositories/ProjectRepository.java | 8 +- .../repositories/ProjectRepositoryImpl.java | 23 +++- .../repositories/RequirementRepository.java | 7 ++ .../RequirementRepositoryImpl.java | 79 +++++++++++++ .../dal/transform/CategoryTransformer.java | 26 ++++- .../dal/transform/ProjectTransformer.java | 5 +- .../dal/transform/RequirementTransformer.java | 32 ++++++ 14 files changed, 499 insertions(+), 7 deletions(-) create mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java b/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java index 27a92bf6..a34adb78 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java @@ -79,7 +79,7 @@ public Response getProjects( @ApiParam(value = "Elements of project by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage, @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date,last_activity,requirement,follower") @DefaultValue("name") @QueryParam("sort") List sort, - @ApiParam(value = "Filter", required = false, allowMultiple = true, allowableValues = "all, own, following") @QueryParam("filters") List filters, + @ApiParam(value = "Filter", required = false, allowMultiple = true, allowableValues = "all, created, following") @QueryParam("filters") List filters, @ApiParam(value = "Ids", required = false, allowMultiple = true) @QueryParam("ids") List ids) { DALFacade dalFacade = null; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/UsersResource.java b/src/main/de/rwth/dbis/acis/bazaar/service/UsersResource.java index 484f66fc..0347b761 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/UsersResource.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/UsersResource.java @@ -2,7 +2,10 @@ import de.rwth.dbis.acis.bazaar.service.dal.DALFacade; import de.rwth.dbis.acis.bazaar.service.dal.entities.Activity; +import de.rwth.dbis.acis.bazaar.service.dal.entities.EntityOverview; import de.rwth.dbis.acis.bazaar.service.dal.entities.User; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; @@ -15,11 +18,11 @@ import jodd.vtor.Vtor; import javax.ws.rs.*; +import javax.ws.rs.client.Entity; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.net.HttpURLConnection; -import java.util.Date; -import java.util.EnumSet; +import java.util.*; @Api(value = "users", description = "Users resource") @@ -215,4 +218,86 @@ public Response updateUser(@PathParam("userId") int userId, bazaarService.closeDBConnection(dalFacade); } } + /** + * This method returns the list of projects on the server. + * + * @param search search string + * @param sort sort order + * @return Response with list of all projects + */ + @GET + @Path("/me/entities") + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "This method allows to receive an overview of entities related to the user") + @ApiResponses(value = { + @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns the updated user", response = EntityOverview.class), + @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), + @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), + @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") + }) + public Response getEntityOverview( + @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, + @ApiParam(value = "Types of entities to include", required = true, allowMultiple = true, allowableValues = "projects,categories,requirements") @QueryParam("include") List include, + @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date,last_activity,requirement,follower") @DefaultValue("date") @QueryParam("sort") List sort, + @ApiParam(value = "Filter", required = false, allowMultiple = true, allowableValues = "created, following, developing") @DefaultValue("created") @QueryParam("filters") List filters){ + //Possibly allow filtertype "all"? + DALFacade dalFacade = null; + try { + String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); + if (registrarErrors != null) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); + } + UserAgent agent = (UserAgent) Context.getCurrent().getMainAgent(); + long userId = agent.getId(); + List sortList = new ArrayList<>(); + for (String sortOption : sort) { + Pageable.SortDirection direction = Pageable.SortDirection.DEFAULT; + if (sortOption.startsWith("+") || sortOption.startsWith(" ")) { // " " is needed because jersey does not pass "+" + direction = Pageable.SortDirection.ASC; + sortOption = sortOption.substring(1); + + } else if (sortOption.startsWith("-")) { + direction = Pageable.SortDirection.DESC; + sortOption = sortOption.substring(1); + } + Pageable.SortField sortField = new Pageable.SortField(sortOption, direction); + sortList.add(sortField); + } + + dalFacade = bazaarService.getDBConnection(); + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + + HashMap filterMap = new HashMap<>(); + for(String filterOption : filters) { + filterMap.put(filterOption,internalUserId.toString()); + } + PageInfo pageInfo = new PageInfo(0, 0, filterMap, sortList, search); + + + EntityOverview result = dalFacade.getEntitiesForUser(include, pageInfo, internalUserId); + + bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE, NodeObserver.Event.SERVICE_CUSTOM_MESSAGE_3, + 0, Activity.DataType.USER, internalUserId); + + + Response.ResponseBuilder responseBuilder = Response.ok(); + responseBuilder = responseBuilder.entity(result.toJSON()); + //responseBuilder = bazaarService.xHeaderFields(responseBuilder, result); + + return responseBuilder.build(); + } catch (BazaarException bex) { + logger.warning(bex.getMessage()); + L2pLogger.logEvent(NodeObserver.Event.SERVICE_ERROR, Context.getCurrent().getMainAgent(), "Get entityOverview failed"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } catch (Exception ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + logger.warning(bex.getMessage()); + L2pLogger.logEvent(NodeObserver.Event.SERVICE_ERROR, Context.getCurrent().getMainAgent(), "Get entityOverview failed"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } finally { + bazaarService.closeDBConnection(dalFacade); + } + } + + } \ No newline at end of file diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java index af302831..ac7199b8 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java @@ -579,4 +579,12 @@ public interface DALFacade { * @param personalisationData which holds the data to be saved */ void setPersonalisationData(PersonalisationData personalisationData) throws BazaarException; + + /** + * Creates an Entity-Overview for a given user + * @param includes List of entities to include values: [projects, categories, requirements] + * @param pageable Used for search-term, filters and sorting + * @param userId userId for privilege-check + */ + EntityOverview getEntitiesForUser(List includes, Pageable pageable, int userId) throws BazaarException; } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index b29a1157..0d661726 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -633,4 +633,28 @@ public void setPersonalisationData(PersonalisationData personalisationData) thro personalisationDataRepository.insertOrUpdate(personalisationData); } + + @Override + public EntityOverview getEntitiesForUser(List includes, Pageable pageable, int userId) throws BazaarException { + //categoryRepository = (categoryRepository != null) ? categoryRepository : new CategoryRepositoryImpl(dslContext); + EntityOverview.Builder result = EntityOverview.getBuilder(); + for(String include : includes) { + if(include.equals("projects")){ + projectRepository = (projectRepository != null) ? projectRepository : new ProjectRepositoryImpl(dslContext); + result.projects(projectRepository.listProjectIds(pageable, userId)); + } else + if(include.equals("requirements")){ + requirementRepository = (requirementRepository != null) ? requirementRepository : new RequirementRepositoryImpl(dslContext); + result.requirements(requirementRepository.listRequirementIds(pageable, userId)); + }else + if(include.equals("categories")){ + categoryRepository = (categoryRepository != null) ? categoryRepository : new CategoryRepositoryImpl(dslContext); + result.categories(categoryRepository.listCategoryIds(pageable, userId)); + } + + } + return result.build(); + + } + } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java new file mode 100644 index 00000000..d7b2ea8d --- /dev/null +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java @@ -0,0 +1,108 @@ +/* + * + * Copyright (c) 2014, RWTH Aachen University. + * For a list of contributors see the AUTHORS file at the top-level directory + * of this distribution. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * / + */ + +package de.rwth.dbis.acis.bazaar.service.dal.entities; + + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.util.List; + +/** + * @author Milan Deruelle + * @since 22/01/2020 + */ +public class EntityOverview { + + private List projects; + private List categories; + private List requirements; + private List comments; + + public EntityOverview() { + } + + public EntityOverview(Builder builder) { + this.projects = builder.projects; + this.categories = builder.categories; + this.requirements = builder.requirements; + this.comments = builder.comments; + } + + + public List getProjects() { + return projects; + } + + public List getCategories() { + return categories; + } + + public List getRequirements() { + return requirements; + } + + public List getComments() { + return comments; + } + + + public static Builder getBuilder() { + return new Builder(); + } + + public String toJSON() throws JsonProcessingException { + return new ObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL).writeValueAsString(this); + } + + public static class Builder { + private List projects; + private List categories; + private List requirements; + private List comments; + + + public Builder projects(List projects) { + this.projects = projects; + return this; + } + + public Builder categories(List categories) { + this.categories = categories; + return this; + } + + public Builder requirements(List requirements) { + this.requirements = requirements; + return this; + } + + public Builder comments(List comments) { + this.comments = comments; + return this; + } + + public EntityOverview build() { + return new EntityOverview(this); + } + } +} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java index 97303852..3ae19a25 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java @@ -27,6 +27,7 @@ import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import java.sql.Timestamp; +import java.util.List; /** * @author Adam Gavronek @@ -40,6 +41,10 @@ public interface CategoryRepository extends Repository { PaginationResult findByRequirementId(int requirementId, Pageable pageable, int userId) throws BazaarException; + PaginationResult findAll(Pageable pageable, int userId) throws BazaarException; + + List listCategoryIds(Pageable pageable, int userId) throws BazaarException; + boolean belongsToPublicProject(int id) throws BazaarException; Statistic getStatisticsForCategory(int userId, int categoryId, Timestamp timestamp) throws BazaarException; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java index 59ea7488..44b10662 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java @@ -220,6 +220,96 @@ public PaginationResult findByProjectId(int projectId, Pageable pageab return result; } + @Override + public PaginationResult findAll(Pageable pageable, int userId) throws BazaarException { + PaginationResult result = null; + List categories; + try { + categories = new ArrayList<>(); + de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); + + Field idCount = jooq.selectCount() + .from(CATEGORY) + .where(transformer.getFilterConditions(pageable.getFilters())) + .and(transformer.getSearchCondition(pageable.getSearch())) + .asField("idCount"); + + Field requirementCount = jooq.select(DSL.count()) + .from(REQUIREMENT) + .leftJoin(REQUIREMENT_CATEGORY_MAP).on(REQUIREMENT.ID.equal(REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID)) + .where(REQUIREMENT_CATEGORY_MAP.CATEGORY_ID.equal(CATEGORY.ID)) + .asField("requirementCount"); + + Field followerCount = jooq.select(DSL.count()) + .from(CATEGORY_FOLLOWER_MAP) + .where(CATEGORY_FOLLOWER_MAP.CATEGORY_ID.equal(CATEGORY.ID)) + .asField("followerCount"); + + Field isFollower = DSL.select(DSL.count()) + .from(CATEGORY_FOLLOWER_MAP) + .where(CATEGORY_FOLLOWER_MAP.CATEGORY_ID.equal(CATEGORY.ID).and(CATEGORY_FOLLOWER_MAP.USER_ID.equal(userId))) + .asField("isFollower"); + + List queryResults = jooq.select(CATEGORY.fields()) + .select(idCount) + .select(requirementCount) + .select(followerCount) + .select(isFollower) + .select(leaderUser.fields()) + .from(CATEGORY) + .leftOuterJoin(leaderUser).on(leaderUser.ID.equal(CATEGORY.LEADER_ID)) + .leftOuterJoin(LAST_ACTIVITY).on(CATEGORY.ID.eq(LAST_ACTIVITY.field(CATEGORY.ID))) + .where(transformer.getFilterConditions(pageable.getFilters())) + .and(transformer.getSearchCondition(pageable.getSearch())) + .orderBy(transformer.getSortFields(pageable.getSorts())) + .limit(pageable.getPageSize()) + .offset(pageable.getOffset()) + .fetch(); + + for (Record queryResult : queryResults) { + CategoryRecord categoryRecord = queryResult.into(CATEGORY); + Category category = transformer.getEntityFromTableRecord(categoryRecord); + UserTransformer userTransformer = new UserTransformer(); + UserRecord userRecord = queryResult.into(leaderUser); + category.setLeader(userTransformer.getEntityFromTableRecord(userRecord)); + category.setNumberOfRequirements((Integer) queryResult.getValue(requirementCount)); + category.setNumberOfFollowers((Integer) queryResult.getValue(followerCount)); + if (userId != 1) { + category.setFollower((Integer) queryResult.getValue(isFollower) == 0 ? false : true); + } + categories.add(category); + } + int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); + result = new PaginationResult<>(total, pageable, categories); + } catch (Exception e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } + return result; + } + + + @Override + public List listCategoryIds(Pageable pageable, int userId) throws BazaarException { + List categoryIds = new ArrayList<>(); + try { + categoryIds = jooq.select() + .from(CATEGORY) + .where(transformer.getFilterConditions(pageable.getFilters())) + .and(transformer.getSearchCondition(pageable.getSearch())) + .orderBy(transformer.getSortFields(pageable.getSorts())) + // .limit(pageable.getPageSize()) + // .offset(pageable.getOffset()) + .fetch(CATEGORY.ID); + + } catch (Exception e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } + return categoryIds; + } + + + + @Override public PaginationResult findByRequirementId(int requirementId, Pageable pageable, int userId) throws BazaarException { PaginationResult result = null; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java index 95608cea..0970a7dc 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java @@ -28,6 +28,7 @@ import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import java.sql.Timestamp; +import java.util.List; /** * @author Adam Gavronek @@ -39,11 +40,16 @@ public interface ProjectRepository extends Repository { PaginationResult findAllPublic(Pageable pageable, int userId) throws BazaarException; - PaginationResult findAllPublicAndAuthorized(PageInfo pageable, int userId) throws BazaarException; + PaginationResult findAllPublicAndAuthorized(Pageable pageable, int userId) throws BazaarException; boolean belongsToPublicProject(int id) throws BazaarException; Statistic getStatisticsForVisibleProjects(int userId, Timestamp timestamp) throws BazaarException; Statistic getStatisticsForProject(int userId, int projectId, Timestamp timestamp) throws BazaarException; + + List listProjectIds(Pageable pageable, int userId) throws BazaarException; + + + } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java index b1de7dd0..0225942c 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java @@ -235,7 +235,7 @@ public PaginationResult findAllPublic(Pageable pageable, int userId) th } @Override - public PaginationResult findAllPublicAndAuthorized(PageInfo pageable, int userId) throws BazaarException { + public PaginationResult findAllPublicAndAuthorized(Pageable pageable, int userId) throws BazaarException { PaginationResult result = null; List projects; try { @@ -301,6 +301,27 @@ public PaginationResult findAllPublicAndAuthorized(PageInfo pageable, i return result; } + @Override + public List listProjectIds(Pageable pageable, int userId) throws BazaarException { + List projectIds = new ArrayList<>(); + try { + projectIds = jooq.select() + .from(PROJECT) + .where(transformer.getFilterConditions(pageable.getFilters())) + .and(PROJECT.VISIBILITY.isTrue().or(PROJECT.LEADER_ID.equal(userId)) + .and(transformer.getSearchCondition(pageable.getSearch()))) + .orderBy(transformer.getSortFields(pageable.getSorts())) + // .limit(pageable.getPageSize()) + // .offset(pageable.getOffset()) + .fetch(PROJECT.ID); + + } catch (Exception e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } + return projectIds; + } + + @Override public boolean belongsToPublicProject(int id) throws BazaarException { try { diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java index 6241a6cb..a890da40 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java @@ -27,6 +27,7 @@ import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import java.sql.Timestamp; +import java.util.List; public interface RequirementRepository extends Repository { @@ -34,6 +35,10 @@ public interface RequirementRepository extends Repository { PaginationResult findAllByCategory(int categoryId, Pageable pageable, int userId) throws BazaarException; + PaginationResult findAll(Pageable pageable, int userId) throws BazaarException; + + List listRequirementIds(Pageable pageable, int userId) throws BazaarException; + boolean belongsToPublicProject(int id) throws BazaarException; Requirement findById(int id, int userId) throws Exception; @@ -43,4 +48,6 @@ public interface RequirementRepository extends Repository { void setLeadDeveloper(int id, Integer userId) throws BazaarException; Statistic getStatisticsForRequirement(int userId, int requirementId, Timestamp timestamp) throws BazaarException; + + } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java index a9e1e00a..3314ec7d 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java @@ -106,6 +106,85 @@ public RequirementRepositoryImpl(DSLContext jooq) { super(jooq, new RequirementTransformer()); } + @Override + public List listRequirementIds(Pageable pageable, int userId) throws BazaarException { + List requirementIds = new ArrayList<>(); + try { + requirementIds = jooq.select() + .from(REQUIREMENT) + .where(transformer.getFilterConditions(pageable.getFilters())) + .and(transformer.getSearchCondition(pageable.getSearch())) + .orderBy(transformer.getSortFields(pageable.getSorts())) + // .limit(pageable.getPageSize()) + // .offset(pageable.getOffset()) + .fetch(REQUIREMENT.ID); + + } catch (Exception e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } + return requirementIds; + } + + @Override + public PaginationResult findAll(Pageable pageable, int userId) throws BazaarException { + PaginationResult result = null; + List requirements; + try { + requirements = new ArrayList<>(); + + Field idCount = jooq.selectCount() + .from(REQUIREMENT) + .where(transformer.getFilterConditions(pageable.getFilters())) + .and(transformer.getSearchCondition(pageable.getSearch())) + .asField("idCount"); + + Field voteCount = jooq.select(DSL.count(DSL.nullif(VOTE.IS_UPVOTE, 0))) + .from(VOTE) + .where(VOTE.REQUIREMENT_ID.equal(REQUIREMENT.ID)) + .asField("voteCount"); + + Field commentCount = DSL.select(DSL.count()) + .from(COMMENT) + .where(COMMENT.REQUIREMENT_ID.equal(REQUIREMENT.ID)) + .asField("commentCount"); + + Field followerCount = DSL.select(DSL.count()) + .from(REQUIREMENT_FOLLOWER_MAP) + .where(REQUIREMENT_FOLLOWER_MAP.REQUIREMENT_ID.equal(REQUIREMENT.ID)) + .asField("followerCount"); + + List queryResults = jooq.select(REQUIREMENT.fields()) + .select(idCount) + .select(voteCount) + .select(commentCount) + .select(followerCount) + .from(REQUIREMENT) + .leftOuterJoin(LAST_ACTIVITY).on(REQUIREMENT.ID.eq(LAST_ACTIVITY.field(REQUIREMENT.ID))) + .where(transformer.getFilterConditions(pageable.getFilters())) + .and(transformer.getSearchCondition(pageable.getSearch())) + // .and(REQUIREMENT.PROJECT_ID.eq(projectId)) TODO ? Add check if project visible or leader == user + .groupBy(REQUIREMENT.ID) + .orderBy(transformer.getSortFields(pageable.getSorts())) + .limit(pageable.getPageSize()) + .offset(pageable.getOffset()) + .fetch(); + + for (Record queryResult : queryResults) { + RequirementRecord requirementRecord = queryResult.into(REQUIREMENT); + Requirement requirement = transformer.getEntityFromTableRecord(requirementRecord); + requirements.add(findById(requirement.getId(), userId)); // TODO: Remove the getId call and create the objects themself here + } + int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); + result = new PaginationResult<>(total, pageable, requirements); + } catch (DataAccessException e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } catch (Exception e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } + return result; + + } + @Override public PaginationResult findAllByProject(int projectId, Pageable pageable, int userId) throws BazaarException { PaginationResult result = null; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java index 19a71849..8152b686 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java @@ -30,6 +30,7 @@ import java.util.*; import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.CATEGORY; +import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.CATEGORY_FOLLOWER_MAP; /** * @author Adam Gavronek @@ -180,7 +181,30 @@ public Condition getSearchCondition(String search) throws Exception { @Override public Collection getFilterConditions(Map filters) throws Exception { - return new ArrayList<>(); + List conditions = new ArrayList<>(); + for (Map.Entry filterEntry : filters.entrySet()) { + + + if (filterEntry.getKey().equals("created")) { + conditions.add( + CATEGORY.LEADER_ID.eq(Integer.parseInt(filterEntry.getValue())) + ); + }else + + if(filterEntry.getKey().equals("following")){ + conditions.add( + CATEGORY.ID.in( + DSL.select(CATEGORY_FOLLOWER_MAP.CATEGORY_ID) + .from(CATEGORY_FOLLOWER_MAP) + .where(CATEGORY_FOLLOWER_MAP.USER_ID.eq(Integer.parseInt(filterEntry.getValue()))) + ) + ); + } + else{ + conditions.add(DSL.falseCondition()); + } + } + return conditions; } private Category cleanEntry(Category category) { diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java index bd38183c..61ed0b6a 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java @@ -209,7 +209,7 @@ public Collection getFilterConditions(Map f DSL.trueCondition() ); }else - if (filterEntry.getKey().equals("own")) { + if (filterEntry.getKey().equals("created")) { conditions.add( PROJECT.LEADER_ID.eq(Integer.parseInt(filterEntry.getValue())) ); @@ -222,6 +222,9 @@ public Collection getFilterConditions(Map f ) ); } + else{ + conditions.add(DSL.falseCondition()); + } } return conditions; } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java index 1da52672..43b27727 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java @@ -214,6 +214,38 @@ public Collection getFilterConditions(Map f if (filterEntry.getValue().equals("open")) { conditions.add(REQUIREMENT.REALIZED.isNull()); } + }else + + if (filterEntry.getKey().equals("created")) { + conditions.add( + REQUIREMENT.CREATOR_ID.eq(Integer.parseInt(filterEntry.getValue())) + ); + }else + + if(filterEntry.getKey().equals("following")){ + conditions.add( + REQUIREMENT.ID.in( + DSL.select(REQUIREMENT_FOLLOWER_MAP.REQUIREMENT_ID) + .from(REQUIREMENT_FOLLOWER_MAP) + .where(REQUIREMENT_FOLLOWER_MAP.USER_ID.eq(Integer.parseInt(filterEntry.getValue()))) + ) + ); + }else + + if(filterEntry.getKey().equals("developing")){ + conditions.add( + REQUIREMENT.ID.in( + DSL.select(REQUIREMENT_DEVELOPER_MAP.REQUIREMENT_ID) + .from(REQUIREMENT_DEVELOPER_MAP) + .where(REQUIREMENT_DEVELOPER_MAP.USER_ID.eq(Integer.parseInt(filterEntry.getValue()))) + ).or( + REQUIREMENT.LEAD_DEVELOPER_ID.eq(Integer.parseInt(filterEntry.getValue())) + ) + ); + }else{ + conditions.add( + DSL.falseCondition() + ); } } return conditions; From f7eb9cacb251c8edbaab636aae8e0b8d3945a6e2 Mon Sep 17 00:00:00 2001 From: Milan D Date: Wed, 22 Jan 2020 18:02:39 +0100 Subject: [PATCH 014/134] EntityOverview endpoint, basis for personalized get requirements/categories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [TESTED] Modifaction of transformers to support personalized filteroptions [UNTESTED] findAll functions for requirements & categories [TESTED] listRequirementIds & listCategoryIds & listProjectIds functions returning only lists if id’s [TESTED] getEntitiesForUser function in DALFacade combining listRequirementIds & listCategoryIds & listProjectIds into new Entity „EntityOverview“ [TESTED] /users/me/entities endpoint, returning EntityOverview for /me/ TODOS: Write DALFacade & Resource function/endpoints for getAll functions REFACTORING/POSSIBLE PROBLEMS: - Too much logic inside DALFacade? Move one level up? - Rewrite PageInfo to support „getPersonalisedFilters(int userid)“ instead of parsing id through hash-map - Change name of users-endpoint? --- .../acis/bazaar/service/UsersResource.java | 2 +- .../repositories/CategoryRepositoryImpl.java | 90 +++++++++++++++++++ 2 files changed, 91 insertions(+), 1 deletion(-) diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/UsersResource.java b/src/main/de/rwth/dbis/acis/bazaar/service/UsersResource.java index 0347b761..ffd3709c 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/UsersResource.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/UsersResource.java @@ -300,4 +300,4 @@ public Response getEntityOverview( } -} \ No newline at end of file +} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java index 44b10662..c604882b 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java @@ -310,6 +310,96 @@ public List listCategoryIds(Pageable pageable, int userId) throws Bazaa + @Override + public PaginationResult findAll(Pageable pageable, int userId) throws BazaarException { + PaginationResult result = null; + List categories; + try { + categories = new ArrayList<>(); + de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); + + Field idCount = jooq.selectCount() + .from(CATEGORY) + .where(transformer.getFilterConditions(pageable.getFilters())) + .and(transformer.getSearchCondition(pageable.getSearch())) + .asField("idCount"); + + Field requirementCount = jooq.select(DSL.count()) + .from(REQUIREMENT) + .leftJoin(REQUIREMENT_CATEGORY_MAP).on(REQUIREMENT.ID.equal(REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID)) + .where(REQUIREMENT_CATEGORY_MAP.CATEGORY_ID.equal(CATEGORY.ID)) + .asField("requirementCount"); + + Field followerCount = jooq.select(DSL.count()) + .from(CATEGORY_FOLLOWER_MAP) + .where(CATEGORY_FOLLOWER_MAP.CATEGORY_ID.equal(CATEGORY.ID)) + .asField("followerCount"); + + Field isFollower = DSL.select(DSL.count()) + .from(CATEGORY_FOLLOWER_MAP) + .where(CATEGORY_FOLLOWER_MAP.CATEGORY_ID.equal(CATEGORY.ID).and(CATEGORY_FOLLOWER_MAP.USER_ID.equal(userId))) + .asField("isFollower"); + + List queryResults = jooq.select(CATEGORY.fields()) + .select(idCount) + .select(requirementCount) + .select(followerCount) + .select(isFollower) + .select(leaderUser.fields()) + .from(CATEGORY) + .leftOuterJoin(leaderUser).on(leaderUser.ID.equal(CATEGORY.LEADER_ID)) + .leftOuterJoin(LAST_ACTIVITY).on(CATEGORY.ID.eq(LAST_ACTIVITY.field(CATEGORY.ID))) + .where(transformer.getFilterConditions(pageable.getFilters())) + .and(transformer.getSearchCondition(pageable.getSearch())) + .orderBy(transformer.getSortFields(pageable.getSorts())) + .limit(pageable.getPageSize()) + .offset(pageable.getOffset()) + .fetch(); + + for (Record queryResult : queryResults) { + CategoryRecord categoryRecord = queryResult.into(CATEGORY); + Category category = transformer.getEntityFromTableRecord(categoryRecord); + UserTransformer userTransformer = new UserTransformer(); + UserRecord userRecord = queryResult.into(leaderUser); + category.setLeader(userTransformer.getEntityFromTableRecord(userRecord)); + category.setNumberOfRequirements((Integer) queryResult.getValue(requirementCount)); + category.setNumberOfFollowers((Integer) queryResult.getValue(followerCount)); + if (userId != 1) { + category.setFollower((Integer) queryResult.getValue(isFollower) == 0 ? false : true); + } + categories.add(category); + } + int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); + result = new PaginationResult<>(total, pageable, categories); + } catch (Exception e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } + return result; + } + + + @Override + public List listCategoryIds(Pageable pageable, int userId) throws BazaarException { + List categoryIds = new ArrayList<>(); + try { + categoryIds = jooq.select() + .from(CATEGORY) + .where(transformer.getFilterConditions(pageable.getFilters())) + .and(transformer.getSearchCondition(pageable.getSearch())) + .orderBy(transformer.getSortFields(pageable.getSorts())) + // .limit(pageable.getPageSize()) + // .offset(pageable.getOffset()) + .fetch(CATEGORY.ID); + + } catch (Exception e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } + return categoryIds; + } + + + + @Override public PaginationResult findByRequirementId(int requirementId, Pageable pageable, int userId) throws BazaarException { PaginationResult result = null; From 4d892ac495601e79c22f31b7bdc96b237521e786 Mon Sep 17 00:00:00 2001 From: Milan D Date: Fri, 24 Jan 2020 18:15:13 +0100 Subject: [PATCH 015/134] Update to l2p 0.8 --- .../rwth/dbis/acis/bazaar/service/UsersResource.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/UsersResource.java b/src/main/de/rwth/dbis/acis/bazaar/service/UsersResource.java index ffd3709c..e1f2e0b8 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/UsersResource.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/UsersResource.java @@ -247,8 +247,8 @@ public Response getEntityOverview( if (registrarErrors != null) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); } - UserAgent agent = (UserAgent) Context.getCurrent().getMainAgent(); - long userId = agent.getId(); + Agent agent = Context.getCurrent().getMainAgent(); + String userId = agent.getIdentifier(); List sortList = new ArrayList<>(); for (String sortOption : sort) { Pageable.SortDirection direction = Pageable.SortDirection.DEFAULT; @@ -275,8 +275,8 @@ public Response getEntityOverview( EntityOverview result = dalFacade.getEntitiesForUser(include, pageInfo, internalUserId); - - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE, NodeObserver.Event.SERVICE_CUSTOM_MESSAGE_3, + // Wrong SERVICE_CUSTOM_MESSAGE_3 ? + bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, 0, Activity.DataType.USER, internalUserId); @@ -287,12 +287,12 @@ public Response getEntityOverview( return responseBuilder.build(); } catch (BazaarException bex) { logger.warning(bex.getMessage()); - L2pLogger.logEvent(NodeObserver.Event.SERVICE_ERROR, Context.getCurrent().getMainAgent(), "Get entityOverview failed"); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get entityOverview failed" ); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } catch (Exception ex) { BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); logger.warning(bex.getMessage()); - L2pLogger.logEvent(NodeObserver.Event.SERVICE_ERROR, Context.getCurrent().getMainAgent(), "Get entityOverview failed"); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get entityOverview failed" ); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } finally { bazaarService.closeDBConnection(dalFacade); From fa2530f9964829590a13fdb3f8a5b1c00067150b Mon Sep 17 00:00:00 2001 From: Milan D Date: Fri, 24 Jan 2020 18:54:24 +0100 Subject: [PATCH 016/134] Merge Errors fixed --- .../repositories/CategoryRepositoryImpl.java | 90 ------------------- .../dal/transform/CategoryTransformer.java | 1 + 2 files changed, 1 insertion(+), 90 deletions(-) diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java index c604882b..44b10662 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java @@ -310,96 +310,6 @@ public List listCategoryIds(Pageable pageable, int userId) throws Bazaa - @Override - public PaginationResult findAll(Pageable pageable, int userId) throws BazaarException { - PaginationResult result = null; - List categories; - try { - categories = new ArrayList<>(); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); - - Field idCount = jooq.selectCount() - .from(CATEGORY) - .where(transformer.getFilterConditions(pageable.getFilters())) - .and(transformer.getSearchCondition(pageable.getSearch())) - .asField("idCount"); - - Field requirementCount = jooq.select(DSL.count()) - .from(REQUIREMENT) - .leftJoin(REQUIREMENT_CATEGORY_MAP).on(REQUIREMENT.ID.equal(REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID)) - .where(REQUIREMENT_CATEGORY_MAP.CATEGORY_ID.equal(CATEGORY.ID)) - .asField("requirementCount"); - - Field followerCount = jooq.select(DSL.count()) - .from(CATEGORY_FOLLOWER_MAP) - .where(CATEGORY_FOLLOWER_MAP.CATEGORY_ID.equal(CATEGORY.ID)) - .asField("followerCount"); - - Field isFollower = DSL.select(DSL.count()) - .from(CATEGORY_FOLLOWER_MAP) - .where(CATEGORY_FOLLOWER_MAP.CATEGORY_ID.equal(CATEGORY.ID).and(CATEGORY_FOLLOWER_MAP.USER_ID.equal(userId))) - .asField("isFollower"); - - List queryResults = jooq.select(CATEGORY.fields()) - .select(idCount) - .select(requirementCount) - .select(followerCount) - .select(isFollower) - .select(leaderUser.fields()) - .from(CATEGORY) - .leftOuterJoin(leaderUser).on(leaderUser.ID.equal(CATEGORY.LEADER_ID)) - .leftOuterJoin(LAST_ACTIVITY).on(CATEGORY.ID.eq(LAST_ACTIVITY.field(CATEGORY.ID))) - .where(transformer.getFilterConditions(pageable.getFilters())) - .and(transformer.getSearchCondition(pageable.getSearch())) - .orderBy(transformer.getSortFields(pageable.getSorts())) - .limit(pageable.getPageSize()) - .offset(pageable.getOffset()) - .fetch(); - - for (Record queryResult : queryResults) { - CategoryRecord categoryRecord = queryResult.into(CATEGORY); - Category category = transformer.getEntityFromTableRecord(categoryRecord); - UserTransformer userTransformer = new UserTransformer(); - UserRecord userRecord = queryResult.into(leaderUser); - category.setLeader(userTransformer.getEntityFromTableRecord(userRecord)); - category.setNumberOfRequirements((Integer) queryResult.getValue(requirementCount)); - category.setNumberOfFollowers((Integer) queryResult.getValue(followerCount)); - if (userId != 1) { - category.setFollower((Integer) queryResult.getValue(isFollower) == 0 ? false : true); - } - categories.add(category); - } - int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); - result = new PaginationResult<>(total, pageable, categories); - } catch (Exception e) { - ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); - } - return result; - } - - - @Override - public List listCategoryIds(Pageable pageable, int userId) throws BazaarException { - List categoryIds = new ArrayList<>(); - try { - categoryIds = jooq.select() - .from(CATEGORY) - .where(transformer.getFilterConditions(pageable.getFilters())) - .and(transformer.getSearchCondition(pageable.getSearch())) - .orderBy(transformer.getSortFields(pageable.getSorts())) - // .limit(pageable.getPageSize()) - // .offset(pageable.getOffset()) - .fetch(CATEGORY.ID); - - } catch (Exception e) { - ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); - } - return categoryIds; - } - - - - @Override public PaginationResult findByRequirementId(int requirementId, Pageable pageable, int userId) throws BazaarException { PaginationResult result = null; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java index 8152b686..70fb85e2 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java @@ -26,6 +26,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CategoryRecord; import de.rwth.dbis.acis.bazaar.service.dal.repositories.CategoryRepositoryImpl; import org.jooq.*; +import org.jooq.impl.DSL; import java.util.*; From decb90c845b92e830eff77987657f9dda881d616 Mon Sep 17 00:00:00 2001 From: Milan D Date: Fri, 24 Jan 2020 21:02:34 +0100 Subject: [PATCH 017/134] Minor corrections per martins comments --- .../de/rwth/dbis/acis/bazaar/service/UsersResource.java | 7 ++++--- .../rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java | 7 ++++--- .../acis/bazaar/service/dal/entities/EntityOverview.java | 8 ++++++++ .../service/dal/repositories/CategoryRepository.java | 2 +- .../service/dal/repositories/CategoryRepositoryImpl.java | 2 +- .../service/dal/repositories/ProjectRepository.java | 2 +- .../service/dal/repositories/ProjectRepositoryImpl.java | 2 +- .../service/dal/repositories/RequirementRepository.java | 2 +- .../dal/repositories/RequirementRepositoryImpl.java | 2 +- 9 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/UsersResource.java b/src/main/de/rwth/dbis/acis/bazaar/service/UsersResource.java index e1f2e0b8..da4143a1 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/UsersResource.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/UsersResource.java @@ -219,11 +219,13 @@ public Response updateUser(@PathParam("userId") int userId, } } /** - * This method returns the list of projects on the server. + * This method returns an entityOverview for the logged in user * * @param search search string + * @param include which entities to include in the overview //TODO Add Comments/Attachments * @param sort sort order - * @return Response with list of all projects + * @param filters set of entities that should be returned + * @return Response as EntityOverview including the entities selected in include */ @GET @Path("/me/entities") @@ -282,7 +284,6 @@ public Response getEntityOverview( Response.ResponseBuilder responseBuilder = Response.ok(); responseBuilder = responseBuilder.entity(result.toJSON()); - //responseBuilder = bazaarService.xHeaderFields(responseBuilder, result); return responseBuilder.build(); } catch (BazaarException bex) { diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index 0d661726..a8a1b9b6 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -641,16 +641,17 @@ public EntityOverview getEntitiesForUser(List includes, Pageable pageabl for(String include : includes) { if(include.equals("projects")){ projectRepository = (projectRepository != null) ? projectRepository : new ProjectRepositoryImpl(dslContext); - result.projects(projectRepository.listProjectIds(pageable, userId)); + result.projects(projectRepository.listAllProjectIds(pageable, userId)); } else if(include.equals("requirements")){ requirementRepository = (requirementRepository != null) ? requirementRepository : new RequirementRepositoryImpl(dslContext); - result.requirements(requirementRepository.listRequirementIds(pageable, userId)); + result.requirements(requirementRepository.listAllRequirementIds(pageable, userId)); }else if(include.equals("categories")){ categoryRepository = (categoryRepository != null) ? categoryRepository : new CategoryRepositoryImpl(dslContext); - result.categories(categoryRepository.listCategoryIds(pageable, userId)); + result.categories(categoryRepository.listAllCategoryIds(pageable, userId)); } + //TODO Add Comments/Attachments } return result.build(); diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java index d7b2ea8d..816a7fac 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java @@ -37,6 +37,7 @@ public class EntityOverview { private List categories; private List requirements; private List comments; + private List attachments; public EntityOverview() { } @@ -46,6 +47,8 @@ public EntityOverview(Builder builder) { this.categories = builder.categories; this.requirements = builder.requirements; this.comments = builder.comments; + this.attachments = builder.attachments; + } @@ -79,6 +82,7 @@ public static class Builder { private List categories; private List requirements; private List comments; + private List attachments; public Builder projects(List projects) { @@ -95,6 +99,10 @@ public Builder requirements(List requirements) { this.requirements = requirements; return this; } + public Builder attachments(List attachments) { + this.attachments = attachments; + return this; + } public Builder comments(List comments) { this.comments = comments; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java index 3ae19a25..b47be9b9 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java @@ -43,7 +43,7 @@ public interface CategoryRepository extends Repository { PaginationResult findAll(Pageable pageable, int userId) throws BazaarException; - List listCategoryIds(Pageable pageable, int userId) throws BazaarException; + List listAllCategoryIds(Pageable pageable, int userId) throws BazaarException; boolean belongsToPublicProject(int id) throws BazaarException; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java index 44b10662..7a3d20af 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java @@ -289,7 +289,7 @@ public PaginationResult findAll(Pageable pageable, int userId) throws @Override - public List listCategoryIds(Pageable pageable, int userId) throws BazaarException { + public List listAllCategoryIds(Pageable pageable, int userId) throws BazaarException { List categoryIds = new ArrayList<>(); try { categoryIds = jooq.select() diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java index 0970a7dc..723a7b95 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java @@ -48,7 +48,7 @@ public interface ProjectRepository extends Repository { Statistic getStatisticsForProject(int userId, int projectId, Timestamp timestamp) throws BazaarException; - List listProjectIds(Pageable pageable, int userId) throws BazaarException; + List listAllProjectIds(Pageable pageable, int userId) throws BazaarException; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java index 0225942c..850b5ab0 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java @@ -302,7 +302,7 @@ public PaginationResult findAllPublicAndAuthorized(Pageable pageable, i } @Override - public List listProjectIds(Pageable pageable, int userId) throws BazaarException { + public List listAllProjectIds(Pageable pageable, int userId) throws BazaarException { List projectIds = new ArrayList<>(); try { projectIds = jooq.select() diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java index a890da40..19b82ca8 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java @@ -37,7 +37,7 @@ public interface RequirementRepository extends Repository { PaginationResult findAll(Pageable pageable, int userId) throws BazaarException; - List listRequirementIds(Pageable pageable, int userId) throws BazaarException; + List listAllRequirementIds(Pageable pageable, int userId) throws BazaarException; boolean belongsToPublicProject(int id) throws BazaarException; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java index 3314ec7d..02c94d5d 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java @@ -107,7 +107,7 @@ public RequirementRepositoryImpl(DSLContext jooq) { } @Override - public List listRequirementIds(Pageable pageable, int userId) throws BazaarException { + public List listAllRequirementIds(Pageable pageable, int userId) throws BazaarException { List requirementIds = new ArrayList<>(); try { requirementIds = jooq.select() From ab2f3e7733db24bf0ba9b64a81544651dd2101c1 Mon Sep 17 00:00:00 2001 From: Martin Hug Date: Sat, 25 Jan 2020 13:55:45 +0100 Subject: [PATCH 018/134] Increase service number to 0.9.0. Use las2peer-Activity-Tracker 0.8.0. --- etc/ant_configuration/service.properties | 2 +- etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties | 2 +- src/main/de/rwth/dbis/acis/bazaar/service/BazaarService.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/ant_configuration/service.properties b/etc/ant_configuration/service.properties index 9146bacc..97880fde 100755 --- a/etc/ant_configuration/service.properties +++ b/etc/ant_configuration/service.properties @@ -1,4 +1,4 @@ -service.version=0.8.0 +service.version=0.9.0 service.name=de.rwth.dbis.acis.bazaar.service service.path=de/rwth/dbis/acis/bazaar/service service.class=BazaarService diff --git a/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties b/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties index 67ea03e9..a8636ff4 100644 --- a/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties +++ b/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties @@ -5,7 +5,7 @@ lang=en country=us baseURL=http://localhost:8080/bazaar/ frontendBaseURL=http://localhost:5000/ -activityTrackerService=de.rwth.dbis.acis.activitytracker.service.ActivityTrackerService@0.4.1 +activityTrackerService=de.rwth.dbis.acis.activitytracker.service.ActivityTrackerService@0.8.0 activityOrigin=https://requirements-bazaar.org smtpServer= emailFromAddress= diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/BazaarService.java b/src/main/de/rwth/dbis/acis/bazaar/service/BazaarService.java index 53cef947..278d7019 100755 --- a/src/main/de/rwth/dbis/acis/bazaar/service/BazaarService.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/BazaarService.java @@ -175,7 +175,7 @@ public BazaarService() throws Exception { @SwaggerDefinition( info = @Info( title = "Requirements Bazaar", - version = "0.8.0", + version = "0.9.0", description = "Requirements Bazaar project", termsOfService = "http://requirements-bazaar.org", contact = @Contact( From 6ae0110fcbbba1c2c925eb6567d3e647764290ef Mon Sep 17 00:00:00 2001 From: Milan D Date: Tue, 4 Feb 2020 14:13:50 +0100 Subject: [PATCH 019/134] Endpoints for Comment (Replies) and Requirements --- src/i18n/Translation_de.properties | 1 + src/i18n/Translation_en.properties | 1 + .../acis/bazaar/service/CommentsResource.java | 129 ++++++++++++++++ .../bazaar/service/RequirementsResource.java | 125 ++++++++++++++++ .../acis/bazaar/service/dal/DALFacade.java | 21 +++ .../bazaar/service/dal/DALFacadeImpl.java | 17 +++ .../bazaar/service/dal/entities/Comment.java | 36 +++++ .../service/dal/entities/EntityContext.java | 112 ++++++++++++++ .../service/dal/entities/Requirement.java | 13 ++ .../dal/repositories/CommentRepository.java | 5 + .../repositories/CommentRepositoryImpl.java | 140 +++++++++++++++++- .../repositories/RequirementRepository.java | 1 + .../RequirementRepositoryImpl.java | 54 ++++--- .../dal/transform/CommentTransformer.java | 109 +++++++++++++- 14 files changed, 736 insertions(+), 28 deletions(-) create mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java diff --git a/src/i18n/Translation_de.properties b/src/i18n/Translation_de.properties index b2470e56..57caa992 100644 --- a/src/i18n/Translation_de.properties +++ b/src/i18n/Translation_de.properties @@ -27,6 +27,7 @@ error.authorization.category.read=Nur Projektmitarbeiter können Projektkomponen error.authorization.category.create=Nur Administratoren können Projektkomponenten erstellen. error.authorization.category.modify=Nur Administratoren können Projektkomponenten verändern. error.authorization.category.delete=Die Projektkomoponente mit id {0} kann nicht gelöscht werden, da sie die Standardkomponente des Projects ist. +error.authorization.requirements.read=Nur eingeloggte Mitglieder können Requirements lesen. error.authorization.requirement.create=Nur Projektmitglieder könnnen Anforderungen erstellen. error.authorization.requirement.delete=Nur der Ersteller einer Anforderung kann eine Anforderung löschen. error.authorization.develop.create=Nur Projektmitglieder können sich als Entwickler eintragen. diff --git a/src/i18n/Translation_en.properties b/src/i18n/Translation_en.properties index c08fbf7e..674d9c7f 100644 --- a/src/i18n/Translation_en.properties +++ b/src/i18n/Translation_en.properties @@ -27,6 +27,7 @@ error.authorization.category.read=Only project members can see categories. error.authorization.category.create=Only admins can create categories. error.authorization.category.modify=Only admins can modify categories. error.authorization.category.delete=This category item with id {0} cannot be deleted, because it is the default category for the project. +error.authorization.requirements.read=Only logged in users can read requirements. error.authorization.requirement.create=Only project members can create requirements. error.authorization.requirement.delete=Only the creator can delete requirements. error.authorization.develop.create=Only project members can register to develop a requirement. diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/CommentsResource.java b/src/main/de/rwth/dbis/acis/bazaar/service/CommentsResource.java index 70c02f47..640c0af5 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/CommentsResource.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/CommentsResource.java @@ -3,6 +3,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.DALFacade; import de.rwth.dbis.acis.bazaar.service.dal.entities.*; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; @@ -13,6 +14,7 @@ import i5.las2peer.api.Context; import i5.las2peer.api.logging.MonitoringEvent; import i5.las2peer.api.security.Agent; +import i5.las2peer.api.security.AnonymousAgent; import i5.las2peer.logging.L2pLogger; import io.swagger.annotations.*; import jodd.vtor.Vtor; @@ -54,6 +56,133 @@ public CommentsResource() throws Exception { bazaarService = (BazaarService) Context.getCurrent().getService(); } + + + + + /** + * This method returns the list of comments on the server. + * + * @param page page number + * @param perPage number of comments by page + * @param includeContext include context of project (project, categories, requirement) + * @param search search string + * @param sort sort order + * @return Response with list of all requirements + */ + @GET + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "This method returns the list of comments on the server.") + @ApiResponses(value = { + @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "List of comments", response = Comment.class, responseContainer = "List"), + @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), + @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") + }) + public Response getAllComments( + @ApiParam(value = "Page number", required = false) @DefaultValue("0") @QueryParam("page") int page, + @ApiParam(value = "Elements of comments by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage, + @ApiParam(value = "Include context of comment", required = false) @DefaultValue("false") @QueryParam("includeContext") boolean includeContext, + @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, + @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date") @DefaultValue("name") @QueryParam("sort") List sort, + @ApiParam(value = "Filter", required = true, allowMultiple = false, allowableValues = "created, following, replies") @QueryParam("filters") List filters) + { + + DALFacade dalFacade = null; + try { + String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); + if (registrarErrors != null) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); + } + Agent agent = Context.getCurrent().getMainAgent(); + String userId = agent.getIdentifier(); + List sortList = new ArrayList<>(); + for (String sortOption : sort) { + Pageable.SortDirection direction = Pageable.SortDirection.DEFAULT; + if (sortOption.startsWith("+") || sortOption.startsWith(" ")) { // " " is needed because jersey does not pass "+" + direction = Pageable.SortDirection.ASC; + sortOption = sortOption.substring(1); + + } else if (sortOption.startsWith("-")) { + direction = Pageable.SortDirection.DESC; + sortOption = sortOption.substring(1); + } + Pageable.SortField sortField = new Pageable.SortField(sortOption, direction); + sortList.add(sortField); + } + + dalFacade = bazaarService.getDBConnection(); + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + + HashMap filterMap = new HashMap<>(); + for(String filterOption : filters) { + filterMap.put(filterOption,internalUserId.toString()); + } + PageInfo pageInfo = new PageInfo(page, perPage, filterMap, sortList, search); + + + Vtor vtor = bazaarService.getValidators(); + vtor.validate(pageInfo); + if (vtor.hasViolations()) { + ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); + } + + PaginationResult commentResult = null; + + //Might want to change this to allow anonymous agents to get all public requirements? + if (agent instanceof AnonymousAgent) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.comments.read")); + } else { + commentResult = dalFacade.listAllComments(pageInfo, includeContext); + } + bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, + 0, Activity.DataType.COMMENT, internalUserId); + + Map> parameter = new HashMap<>(); + parameter.put("page", new ArrayList() {{ + add(String.valueOf(page)); + }}); + parameter.put("per_page", new ArrayList() {{ + add(String.valueOf(perPage)); + }}); + parameter.put("includeContext", new ArrayList() {{ + add(String.valueOf(includeContext)); + }}); + if (search != null) { + parameter.put("search", new ArrayList() {{ + add(String.valueOf(search)); + }}); + } + + parameter.put("sort", sort); + parameter.put("filters", filters); + + Response.ResponseBuilder responseBuilder = Response.ok(); + responseBuilder = responseBuilder.entity(commentResult.toJSON()); + responseBuilder = bazaarService.paginationLinks(responseBuilder, commentResult, "comments", parameter); + responseBuilder = bazaarService.xHeaderFields(responseBuilder, commentResult); + + return responseBuilder.build(); + } catch (BazaarException bex) { + if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { + return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { + return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else { + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get all comments"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } + } catch (Exception ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get all comments"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } finally { + bazaarService.closeDBConnection(dalFacade); + } + } + + /** * This method returns the list of comments for a specific requirement. * diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java b/src/main/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java index ffb282eb..aab10591 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java @@ -14,6 +14,7 @@ import i5.las2peer.api.Context; import i5.las2peer.api.logging.MonitoringEvent; import i5.las2peer.api.security.Agent; +import i5.las2peer.api.security.AnonymousAgent; import i5.las2peer.logging.L2pLogger; import io.swagger.annotations.*; import jodd.vtor.Violation; @@ -56,6 +57,125 @@ public RequirementsResource() throws Exception { bazaarService = (BazaarService) Context.getCurrent().getService(); } + + /** + * This method returns the list of requirements on the server. + * + * @param page page number + * @param perPage number of requirements by page + * @param search search string + * @param sort sort order + * @return Response with list of all requirements + */ + @GET + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "This method returns the list of requirements on the server.") + @ApiResponses(value = { + @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "List of requirements", response = Requirement.class, responseContainer = "List"), + @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), + @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") + }) + public Response getRequirements( + @ApiParam(value = "Page number", required = false) @DefaultValue("0") @QueryParam("page") int page, + @ApiParam(value = "Elements of requirements by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage, + @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, + @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date,last_activity,requirement,follower") @DefaultValue("name") @QueryParam("sort") List sort, + @ApiParam(value = "Filter", required = true, allowMultiple = true, allowableValues = "created, following") @QueryParam("filters") List filters) { + + DALFacade dalFacade = null; + try { + String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); + if (registrarErrors != null) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); + } + Agent agent = Context.getCurrent().getMainAgent(); + String userId = agent.getIdentifier(); + List sortList = new ArrayList<>(); + for (String sortOption : sort) { + Pageable.SortDirection direction = Pageable.SortDirection.DEFAULT; + if (sortOption.startsWith("+") || sortOption.startsWith(" ")) { // " " is needed because jersey does not pass "+" + direction = Pageable.SortDirection.ASC; + sortOption = sortOption.substring(1); + + } else if (sortOption.startsWith("-")) { + direction = Pageable.SortDirection.DESC; + sortOption = sortOption.substring(1); + } + Pageable.SortField sortField = new Pageable.SortField(sortOption, direction); + sortList.add(sortField); + } + + dalFacade = bazaarService.getDBConnection(); + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + + HashMap filterMap = new HashMap<>(); + for(String filterOption : filters) { + filterMap.put(filterOption,internalUserId.toString()); + } + PageInfo pageInfo = new PageInfo(page, perPage, filterMap, sortList, search); + + + Vtor vtor = bazaarService.getValidators(); + vtor.validate(pageInfo); + if (vtor.hasViolations()) { + ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); + } + + PaginationResult requirementsResult = null; + + //Might want to change this to allow anonymous agents to get all public requirements? + if (agent instanceof AnonymousAgent) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.requirements.read")); + } else { + requirementsResult = dalFacade.listAllRequirements(pageInfo, internalUserId); + } + bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, + 0, Activity.DataType.REQUIREMENT, internalUserId); + + Map> parameter = new HashMap<>(); + parameter.put("page", new ArrayList() {{ + add(String.valueOf(page)); + }}); + parameter.put("per_page", new ArrayList() {{ + add(String.valueOf(perPage)); + }}); + if (search != null) { + parameter.put("search", new ArrayList() {{ + add(String.valueOf(search)); + }}); + } + parameter.put("sort", sort); + + Response.ResponseBuilder responseBuilder = Response.ok(); + responseBuilder = responseBuilder.entity(requirementsResult.toJSON()); + responseBuilder = bazaarService.paginationLinks(responseBuilder, requirementsResult, "requirements", parameter); + responseBuilder = bazaarService.xHeaderFields(responseBuilder, requirementsResult); + + return responseBuilder.build(); + } catch (BazaarException bex) { + if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { + return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { + return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else { + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get all requirements"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } + } catch (Exception ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get all requirements"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } finally { + bazaarService.closeDBConnection(dalFacade); + } + } + + + + + /** * This method returns the list of requirements for a specific project. * @@ -272,6 +392,11 @@ public Response getRequirementsForCategory(int categoryId, int page, int perPage } } + + + + + /** * This method returns a specific requirement. * diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java index ac7199b8..ad9a0c84 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java @@ -248,6 +248,13 @@ public interface DALFacade { */ PaginationResult listRequirementsByCategory(int categoryId, Pageable pageable, int userId) throws BazaarException; + /** + * @param pageable pagination information + * @param userId + * @return the requirements filtered by pageable + */ + PaginationResult listAllRequirements(Pageable pageable, int userId) throws BazaarException; + /** * @param requirementId the identifier of the requirement should be returned * @return the requirement identified by the given id and all of its assets: comments,attachments,followers,developers,creator @@ -444,6 +451,20 @@ public interface DALFacade { */ PaginationResult listCommentsByRequirementId(int requirementId, Pageable pageable) throws BazaarException; + /** + * @param pageable pagination information + * @param includeContext include context of comment + * @return the set of comments + */ + PaginationResult listAllComments(Pageable pageable, boolean includeContext) throws BazaarException; + + /** + * @param userId the identifier of user we are looking at + * @param pageable pagination information + * @return the answers for a given user + */ + PaginationResult listAllAnswers(Pageable pageable, int userId) throws BazaarException; + /** * @param commentId * @return the comment for a given id diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index a8a1b9b6..b79cde9a 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -264,6 +264,12 @@ public PaginationResult listRequirementsByCategory(int categoryId, return requirementRepository.findAllByCategory(categoryId, pageable, userId); } + @Override + public PaginationResult listAllRequirements( Pageable pageable, int userId) throws BazaarException { + requirementRepository = (requirementRepository != null) ? requirementRepository : new RequirementRepositoryImpl(dslContext); + return requirementRepository.findAll(pageable, userId); + } + @Override public Requirement getRequirementById(int requirementId, int userId) throws Exception { requirementRepository = (requirementRepository != null) ? requirementRepository : new RequirementRepositoryImpl(dslContext); @@ -470,6 +476,17 @@ public PaginationResult listCommentsByRequirementId(int requirementId, return commentRepository.findAllByRequirementId(requirementId, pageable); } + @Override + public PaginationResult listAllComments(Pageable pageable, boolean includeContext) throws BazaarException { + commentRepository = (commentRepository != null) ? commentRepository : new CommentRepositoryImpl(dslContext); + return commentRepository.findAllComments(pageable, includeContext); + } + @Override + public PaginationResult listAllAnswers(Pageable pageable, int userId) throws BazaarException { + commentRepository = (commentRepository != null) ? commentRepository : new CommentRepositoryImpl(dslContext); + return commentRepository.findAllAnswers(pageable, userId); + } + @Override public Comment getCommentById(int commentId) throws Exception { commentRepository = (commentRepository != null) ? commentRepository : new CommentRepositoryImpl(dslContext); diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java index 74813768..0437fb81 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java @@ -53,6 +53,9 @@ public class Comment extends EntityBase { @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") private Date lastUpdatedDate; + private EntityContext context; + + public Comment() { } @@ -64,6 +67,7 @@ public Comment(Builder builder) { this.creator = builder.creator; this.creationDate = builder.creationDate; this.lastUpdatedDate = builder.lastUpdatedDate; + this.context = builder.context; } public int getId() { @@ -98,10 +102,18 @@ public User getCreator() { return creator; } + public EntityContext getContext() { + return context; + } + public void setCreator(User creator) { this.creator = creator; } + public void setContext(EntityContext context) { + this.context = context; + } + public static Builder getBuilder(String message) { return new Builder(message); } @@ -114,6 +126,10 @@ public static class Builder { Date creationDate; Date lastUpdatedDate; User creator; + EntityContext context; + /* private Project project; + private Category category; + private Requirement requirement; */ public Builder(String message) { @@ -149,11 +165,31 @@ public Builder requirementId(int requirementId) { this.requirementId = requirementId; return this; } +/* + public Builder requirement(Requirement requirement) { + this.requirement = requirement; + return this; + } + + public Builder project(Project project) { + this.project = project; + return this; + } + + public Builder category(Category category) { + this.requirementId = requirementId; + return this; + } */ + public Builder creator(User creator) { this.creator = creator; return this; } + public Builder context(EntityContext context) { + this.context = context; + return this; + } public Comment build() { return new Comment(this); diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java new file mode 100644 index 00000000..eac7dcb2 --- /dev/null +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java @@ -0,0 +1,112 @@ +/* + * + * Copyright (c) 2014, RWTH Aachen University. + * For a list of contributors see the AUTHORS file at the top-level directory + * of this distribution. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * / + */ + +package de.rwth.dbis.acis.bazaar.service.dal.entities; + + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.util.List; + +/** + * @author Milan Deruelle + * @since 30/01/2020 + */ +public class EntityContext { + private User user; + private Project project; + private Category category; + private Requirement requirement; + private Comment comment; + + public EntityContext() { + } + + public EntityContext(Builder builder) { + this.user = builder.user; + this.project = builder.project; + this.category = builder.category; + this.requirement = builder.requirement; + this.comment = builder.comment; + } + + + public Project getProject() { return project; } + + public Category getCategory() { + return category; + } + + public Requirement getRequirement() { + return requirement; + } + + public Comment getComment() { + return comment; + } + + + public static Builder getBuilder() { + return new Builder(); + } + + public String toJSON() throws JsonProcessingException { + return new ObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL).writeValueAsString(this); + } + + public static class Builder { + private User user; + private Project project; + private Category category; + private Requirement requirement; + private Comment comment; + + + public Builder project(Project project) { + this.project = project; + return this; + } + + public Builder category(Category category) { + this.category = category; + return this; + } + + public Builder requirements(Requirement requirement) { + this.requirement = requirement; + return this; + } + public Builder attachments(User user) { + this.user = user; + return this; + } + + public Builder comment(Comment comment) { + this.comment = comment; + return this; + } + + public EntityContext build() { + return new EntityContext(this); + } + } +} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java index c0b64fe0..23fbc771 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java @@ -60,6 +60,8 @@ public class Requirement extends EntityBase { private Boolean isDeveloper; private Boolean isContributor; + private EntityContext context; + public Requirement() { } @@ -79,6 +81,7 @@ protected Requirement(Builder builder) { this.isFollower = builder.isFollower; this.isDeveloper = builder.isDeveloper; this.isContributor = builder.isContributor; + this.context = builder.context; } /** @@ -218,6 +221,11 @@ public Boolean isContributor() { return isContributor; } + public EntityContext getContext() { return context; } + public void setContext(EntityContext context){ + this.context = context; + } + public static class Builder { private int id; private String description; @@ -234,6 +242,7 @@ public static class Builder { private Boolean isFollower; private Boolean isDeveloper; private Boolean isContributor; + private EntityContext context; public Builder(String name) { this.name = name; @@ -325,5 +334,9 @@ public Requirement.Builder isContributor(Boolean isContributor) { this.isContributor = isContributor; return this; } + public Builder context(EntityContext context){ + this.context = context; + return this; + } } } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java index ac164d23..c477198c 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java @@ -25,12 +25,17 @@ import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; +import java.util.List; + /** * @author Adam Gavronek * @since 6/22/2014 */ public interface CommentRepository extends Repository { PaginationResult findAllByRequirementId(int requirementId, Pageable pageable) throws BazaarException; + PaginationResult findAllComments(Pageable pageable, boolean includeContext) throws BazaarException; + PaginationResult findAllAnswers(Pageable pageable, int userId) throws BazaarException; boolean belongsToPublicProject(int id) throws BazaarException; } + diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java index dae0d33d..42cf1329 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java @@ -21,13 +21,15 @@ package de.rwth.dbis.acis.bazaar.service.dal.repositories; import de.rwth.dbis.acis.bazaar.service.dal.entities.Comment; +import de.rwth.dbis.acis.bazaar.service.dal.entities.EntityContext; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Category; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Requirement; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CommentRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.UserRecord; -import de.rwth.dbis.acis.bazaar.service.dal.transform.CommentTransformer; -import de.rwth.dbis.acis.bazaar.service.dal.transform.UserTransformer; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.*; +import de.rwth.dbis.acis.bazaar.service.dal.transform.*; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; @@ -35,6 +37,7 @@ import org.jooq.DSLContext; import org.jooq.Field; import org.jooq.Record; +import org.jooq.Require; import org.jooq.exception.DataAccessException; import java.util.ArrayList; @@ -51,6 +54,119 @@ public CommentRepositoryImpl(DSLContext jooq) { super(jooq, new CommentTransformer()); } + + + @Override + public PaginationResult findAllAnswers(Pageable pageable, int userId) throws BazaarException { + PaginationResult result = null; + List comments; + try { + comments = new ArrayList<>(); + de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User creatorUser = USER.as("creatorUser"); + de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment SUB_COMMENTS = COMMENT.as("sub_comments"); + + Field idCount = jooq.selectCount() + .from(COMMENT) + .where( + // transformer.getFilterConditions(pageable.getFilters())) + // .and( + transformer.getSearchCondition(pageable.getSearch()) + ) + .asField("idCount"); + + + List queryResults = jooq.select(COMMENT.fields()) + .select(creatorUser.fields()).select(idCount) + .from(COMMENT) + .leftSemiJoin(SUB_COMMENTS).on(( + COMMENT.REPLY_TO_COMMENT_ID.eq(SUB_COMMENTS.REPLY_TO_COMMENT_ID) //Refering same thread/base-comment + .and( + COMMENT.CREATION_DATE.greaterThan(SUB_COMMENTS.CREATION_DATE) //replies have greater timestamp than the users comment + ).and( + SUB_COMMENTS.USER_ID.eq(userId) //Comments the user wrote + )).or( + COMMENT.REPLY_TO_COMMENT_ID.eq(SUB_COMMENTS.ID).and(SUB_COMMENTS.USER_ID.eq(userId)) + ) + ) + .join(creatorUser).on(creatorUser.ID.equal(COMMENT.USER_ID)) + .where(COMMENT.USER_ID.notEqual(userId)) //Hide "own" answers + .orderBy(transformer.getSortFields(pageable.getSorts())) + .limit(pageable.getPageSize()) + .offset(pageable.getOffset()) + .fetch(); + + Comment entry = null; + for (Record record : queryResults) { + if (entry == null || transformer.getEntityFromTableRecord(record.into(CommentRecord.class)).getId() != entry.getId()) { + entry = convertToCommentWithUser(record, creatorUser); + comments.add(entry); + } + } + int total = (queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount"))); + result = new PaginationResult<>(total, pageable, comments); + } catch (Exception e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } + + return result; + } + + + @Override + public PaginationResult findAllComments(Pageable pageable, boolean includeContext) throws BazaarException { + PaginationResult result = null; + List comments; + try { + comments = new ArrayList<>(); + de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User creatorUser = USER.as("creatorUser"); + de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Requirement requirement = REQUIREMENT.as("requirement"); + de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Category category = CATEGORY.as("category"); + de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Project project = PROJECT.as("project"); + + Field idCount = jooq.selectCount() + .from(COMMENT) + .where( + transformer.getFilterConditions(pageable.getFilters())) + .and( + transformer.getSearchCondition(pageable.getSearch()) + ) + .asField("idCount"); + + + List queryResults = jooq.select(COMMENT.fields()) + .select(creatorUser.fields()).select(idCount).select(requirement.fields()).select(project.fields()).select(category.fields()) + .from(COMMENT) + .leftOuterJoin(requirement).on(COMMENT.REQUIREMENT_ID.eq(requirement.ID)) + .leftOuterJoin(PROJECT).on(requirement.PROJECT_ID.eq(project.ID)) + .leftOuterJoin(REQUIREMENT_CATEGORY_MAP).on(REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID.eq(COMMENT.REQUIREMENT_ID)) + .leftOuterJoin(category).on(category.ID.eq(REQUIREMENT_CATEGORY_MAP.CATEGORY_ID)) + .join(creatorUser).on(creatorUser.ID.equal(COMMENT.USER_ID)) + .where(transformer.getFilterConditions(pageable.getFilters())) + .orderBy(transformer.getSortFields(pageable.getSorts())) + .limit(pageable.getPageSize()) + .offset(pageable.getOffset()) + .fetch(); + + Comment entry = null; + for (Record record : queryResults) { + if (entry == null || transformer.getEntityFromTableRecord(record.into(CommentRecord.class)).getId() != entry.getId()) { + entry = convertToCommentWithUser(record, creatorUser); + if(includeContext) { + entry.setContext(convertToContext(record)); + } + comments.add(entry); + } + } + int total = (queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount"))); + result = new PaginationResult<>(total, pageable, comments); + } catch (Exception e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } + + return result; + } + + @Override public PaginationResult findAllByRequirementId(int requirementId, Pageable pageable) throws BazaarException { PaginationResult result = null; @@ -99,6 +215,22 @@ public PaginationResult f return result; } + private EntityContext convertToContext(Record record){ + ProjectRecord projectRecord = record.into(ProjectRecord.class); + RequirementRecord requirementRecord = record.into(RequirementRecord.class); + CategoryRecord categoryRecord = record.into(CategoryRecord.class); + + ProjectTransformer projectTransformer = new ProjectTransformer(); + RequirementTransformer requirementTransformer = new RequirementTransformer(); + CategoryTransformer categoryTransformer = new CategoryTransformer(); + + de.rwth.dbis.acis.bazaar.service.dal.entities.Project contextProject = projectTransformer.getEntityFromTableRecord(projectRecord); + de.rwth.dbis.acis.bazaar.service.dal.entities.Requirement contextRequirement = requirementTransformer.getEntityFromTableRecord(requirementRecord); + de.rwth.dbis.acis.bazaar.service.dal.entities.Category contextCategory = categoryTransformer.getEntityFromTableRecord(categoryRecord); + + return EntityContext.getBuilder().project(contextProject).requirements(contextRequirement).category(contextCategory).build(); + } + private Comment convertToCommentWithUser(Record record, de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User creatorUser) { CommentRecord commentRecord = record.into(CommentRecord.class); Comment entry = transformer.getEntityFromTableRecord(commentRecord); diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java index 19b82ca8..59a61c72 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java @@ -42,6 +42,7 @@ public interface RequirementRepository extends Repository { boolean belongsToPublicProject(int id) throws BazaarException; Requirement findById(int id, int userId) throws Exception; + Requirement findById(int id, int userId, boolean includeContext) throws Exception; void setRealized(int id, Timestamp realized) throws BazaarException; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java index 02c94d5d..0d76e321 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java @@ -21,12 +21,17 @@ package de.rwth.dbis.acis.bazaar.service.dal.repositories; import de.rwth.dbis.acis.bazaar.service.dal.entities.Category; +import de.rwth.dbis.acis.bazaar.service.dal.entities.EntityContext; import de.rwth.dbis.acis.bazaar.service.dal.entities.Requirement; import de.rwth.dbis.acis.bazaar.service.dal.entities.Statistic; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; import de.rwth.dbis.acis.bazaar.service.dal.helpers.UserVote; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CategoryRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.ProjectRecord; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementRecord; +import de.rwth.dbis.acis.bazaar.service.dal.transform.CategoryTransformer; +import de.rwth.dbis.acis.bazaar.service.dal.transform.ProjectTransformer; import de.rwth.dbis.acis.bazaar.service.dal.transform.RequirementTransformer; import de.rwth.dbis.acis.bazaar.service.dal.transform.UserTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; @@ -136,33 +141,27 @@ public PaginationResult findAll(Pageable pageable, int userId) thro .from(REQUIREMENT) .where(transformer.getFilterConditions(pageable.getFilters())) .and(transformer.getSearchCondition(pageable.getSearch())) + //.and(REQUIREMENT.PROJECT_ID.eq(projectId)) .asField("idCount"); - Field voteCount = jooq.select(DSL.count(DSL.nullif(VOTE.IS_UPVOTE, 0))) - .from(VOTE) - .where(VOTE.REQUIREMENT_ID.equal(REQUIREMENT.ID)) - .asField("voteCount"); - - Field commentCount = DSL.select(DSL.count()) - .from(COMMENT) - .where(COMMENT.REQUIREMENT_ID.equal(REQUIREMENT.ID)) - .asField("commentCount"); - Field followerCount = DSL.select(DSL.count()) - .from(REQUIREMENT_FOLLOWER_MAP) - .where(REQUIREMENT_FOLLOWER_MAP.REQUIREMENT_ID.equal(REQUIREMENT.ID)) - .asField("followerCount"); + Condition isAuthorizedCondition = REQUIREMENT.PROJECT_ID.in( + DSL.select(PROJECT.ID) + .from(PROJECT) + .where(PROJECT.ID.eq(REQUIREMENT.PROJECT_ID)) + .and(PROJECT.VISIBILITY.isTrue().or(PROJECT.LEADER_ID.eq(userId))) + ); List queryResults = jooq.select(REQUIREMENT.fields()) .select(idCount) - .select(voteCount) - .select(commentCount) - .select(followerCount) + .select(VOTE_COUNT) + .select(COMMENT_COUNT) + .select(FOLLOWER_COUNT) .from(REQUIREMENT) .leftOuterJoin(LAST_ACTIVITY).on(REQUIREMENT.ID.eq(LAST_ACTIVITY.field(REQUIREMENT.ID))) .where(transformer.getFilterConditions(pageable.getFilters())) .and(transformer.getSearchCondition(pageable.getSearch())) - // .and(REQUIREMENT.PROJECT_ID.eq(projectId)) TODO ? Add check if project visible or leader == user + .and(isAuthorizedCondition) .groupBy(REQUIREMENT.ID) .orderBy(transformer.getSortFields(pageable.getSorts())) .limit(pageable.getPageSize()) @@ -172,7 +171,7 @@ public PaginationResult findAll(Pageable pageable, int userId) thro for (Record queryResult : queryResults) { RequirementRecord requirementRecord = queryResult.into(REQUIREMENT); Requirement requirement = transformer.getEntityFromTableRecord(requirementRecord); - requirements.add(findById(requirement.getId(), userId)); // TODO: Remove the getId call and create the objects themself here + requirements.add(findById(requirement.getId(), userId, true)); // TODO: Remove the getId call and create the objects themself here } int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); result = new PaginationResult<>(total, pageable, requirements); @@ -182,7 +181,6 @@ public PaginationResult findAll(Pageable pageable, int userId) thro ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); } return result; - } @Override @@ -320,9 +318,12 @@ public boolean belongsToPublicProject(int id) throws BazaarException { } return false; } - @Override public Requirement findById(int id, int userId) throws Exception { + return findById(id, userId, false); + } + @Override + public Requirement findById(int id, int userId, boolean includeContext) throws Exception { Requirement requirement = null; try { de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User creatorUser = USER.as("creatorUser"); @@ -369,11 +370,13 @@ public Requirement findById(int id, int userId) throws Exception { .select(creatorUser.fields()) .select(leadDeveloperUser.fields()) .select(CATEGORY.fields()) + .select(PROJECT.fields()) .from(REQUIREMENT) .join(creatorUser).on(creatorUser.ID.equal(REQUIREMENT.CREATOR_ID)) .leftOuterJoin(leadDeveloperUser).on(leadDeveloperUser.ID.equal(REQUIREMENT.LEAD_DEVELOPER_ID)) .leftOuterJoin(REQUIREMENT_CATEGORY_MAP).on(REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID.equal(REQUIREMENT.ID)) .leftOuterJoin(CATEGORY).on(CATEGORY.ID.equal(REQUIREMENT_CATEGORY_MAP.CATEGORY_ID)) + .leftOuterJoin(PROJECT).on(PROJECT.ID.equal(REQUIREMENT.PROJECT_ID)) .where(transformer.getTableId().equal(id)) .fetch(); @@ -420,6 +423,8 @@ public Requirement findById(int id, int userId) throws Exception { builder.downVotes(voteQueryResult.get(0).getValue("downVotes", Integer.class)); builder.userVoted(transformToUserVoted(voteQueryResult.get(0).getValue("userVoted", Integer.class))); + + requirement = builder.build(); //Filling up categories @@ -448,6 +453,15 @@ public Requirement findById(int id, int userId) throws Exception { requirement.setContributor(queryResult.getValues(isContributor).get(0).equals(new BigDecimal(0)) ? false : true); } + if(includeContext){ + ProjectRecord projectRecord = queryResult.get(0).into(ProjectRecord.class); + ProjectTransformer projectTransformer = new ProjectTransformer(); + de.rwth.dbis.acis.bazaar.service.dal.entities.Project contextProject = projectTransformer.getEntityFromTableRecord(projectRecord); + + EntityContext context = EntityContext.getBuilder().project(contextProject).build(); + requirement.setContext(context); + } + } catch (BazaarException be) { ExceptionHandler.getInstance().convertAndThrowException(be); } catch (Exception e) { diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java index 4407a679..1e78a047 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java @@ -24,12 +24,14 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.Comment; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CommentRecord; +import de.rwth.dbis.acis.bazaar.service.dal.repositories.ProjectRepositoryImpl; import org.jooq.*; +import org.jooq.impl.DSL; import java.sql.Timestamp; import java.util.*; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.COMMENT; +import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.*; /** * @author Adam Gavronek @@ -92,17 +94,116 @@ public Collection> getSortFields(List if (sorts.isEmpty()) { return Collections.singletonList(COMMENT.CREATION_DATE.asc()); } - return null; + + + List> sortFields = new ArrayList<>(); + for (Pageable.SortField sort : sorts) { + switch (sort.getField()) { + case "date": + switch (sort.getSortDirection()) { + case ASC: + sortFields.add(COMMENT.CREATION_DATE.asc()); + break; + case DESC: + sortFields.add(COMMENT.CREATION_DATE.desc()); + break; + default: + sortFields.add(COMMENT.CREATION_DATE.desc()); + break; + } + break; + case "last_activity": + switch (sort.getSortDirection()) { + case ASC: + sortFields.add(COMMENT.LAST_UPDATED_DATE.asc()); + break; + case DESC: + sortFields.add(COMMENT.LAST_UPDATED_DATE.desc()); + break; + default: + sortFields.add(COMMENT.LAST_UPDATED_DATE.desc()); + break; + } + break; + } + } + return sortFields; } @Override public Condition getSearchCondition(String search) throws Exception { - throw new Exception("Search is not supported!"); + //throw new Exception("Search is not supported!"); + if(search != "") return COMMENT.MESSAGE.likeIgnoreCase("%" + search + "%"); + return DSL.trueCondition(); } @Override public Collection getFilterConditions(Map filters) throws Exception { - return new ArrayList<>(); + List conditions = new ArrayList<>(); + + for (Map.Entry filterEntry : filters.entrySet()) { + + if (filterEntry.getKey().equals("created")) { + conditions.add( + COMMENT.USER_ID.eq(Integer.parseInt(filterEntry.getValue())) + ); + }else + + if(filterEntry.getKey().equals("following")){ + conditions.add( + COMMENT.REQUIREMENT_ID.in( + DSL.select(REQUIREMENT_FOLLOWER_MAP.REQUIREMENT_ID) + .from(REQUIREMENT_FOLLOWER_MAP) + .where(REQUIREMENT_FOLLOWER_MAP.USER_ID.eq(Integer.parseInt(filterEntry.getValue()))) + ) + ); + + }else + if(filterEntry.getKey().equals("replies")) { + de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment SUB_COMMENTS = COMMENT.as("sub_comments"); + de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment IN_COMMENTS = COMMENT.as("in_comments"); + conditions.add( + COMMENT.ID.in( + DSL.select(IN_COMMENTS.ID) + .from(IN_COMMENTS) + .leftSemiJoin(SUB_COMMENTS).on( + ( + IN_COMMENTS.REPLY_TO_COMMENT_ID.eq(SUB_COMMENTS.REPLY_TO_COMMENT_ID) //Refering same thread/base-comment + .and( + IN_COMMENTS.CREATION_DATE.greaterThan(SUB_COMMENTS.CREATION_DATE) //replies have greater timestamp than the users comment + ).and( + SUB_COMMENTS.USER_ID.eq(Integer.parseInt(filterEntry.getValue())) //Comments the user wrote + ) + ).or( + IN_COMMENTS.REPLY_TO_COMMENT_ID.eq(SUB_COMMENTS.ID).and(SUB_COMMENTS.USER_ID.eq(Integer.parseInt(filterEntry.getValue()))) //User is Thread-Owner + ) + ).where(IN_COMMENTS.USER_ID.notEqual(Integer.parseInt(filterEntry.getValue()))) // Remove Users "Own" Comments + ) + ); + } + +/* + if(filterEntry.getKey().equals("developing")){ + conditions.add( + COMMENT.REQUIREMENT_ID.in( + DSL.select(REQUIREMENT_DEVELOPER_MAP.REQUIREMENT_ID) + .from(REQUIREMENT_DEVELOPER_MAP) + .where(REQUIREMENT_DEVELOPER_MAP.USER_ID.eq(Integer.parseInt(filterEntry.getValue()))) + .or(REQUIREMENT.LEAD_DEVELOPER_ID.eq(Integer.parseInt(filterEntry.getValue()))) + ) + ); + + + }else + */ + else{ + + conditions.add( + DSL.falseCondition() + ); + } + } + return conditions; } private Comment cleanEntity(Comment comment) { From 6df0491efd788a175f570a1f9029f5efdb391e88 Mon Sep 17 00:00:00 2001 From: Milan D Date: Thu, 13 Feb 2020 21:22:10 +0100 Subject: [PATCH 020/134] Switch from error code 404 to 204 for no entry found --- .../dbis/acis/bazaar/service/PersonalisationDataResource.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java b/src/main/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java index cb6bdf62..172d5a06 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java @@ -68,7 +68,7 @@ public PersonalisationDataResource() throws Exception { @ApiResponses(value = { @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns a certain personalisationData", response = PersonalisationData.class), @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), - @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), + @ApiResponse(code = HttpURLConnection.HTTP_NO_CONTENT, message = "Not found"), @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") }) public Response getPersonalisationData(@PathParam("key") String key, @PathParam("version") int version) { @@ -93,7 +93,7 @@ public Response getPersonalisationData(@PathParam("key") String key, @PathParam( if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { - return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + return Response.status(Response.Status.NO_CONTENT).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } else { logger.warning(bex.getMessage()); Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get personalisationData " + key+" version:"+version ); From bef3616e807ab0eb8cc120123b7163d88b9b7eff Mon Sep 17 00:00:00 2001 From: Milan D Date: Sun, 23 Feb 2020 00:06:15 +0100 Subject: [PATCH 021/134] selectable Embeds, Comment out monitoring causing errors, personalisationEndpoint conforms with RESTful --- .../acis/bazaar/service/CommentsResource.java | 21 +++--- .../service/PersonalisationDataResource.java | 14 ++-- .../bazaar/service/RequirementsResource.java | 10 +-- .../acis/bazaar/service/dal/DALFacade.java | 2 +- .../bazaar/service/dal/DALFacadeImpl.java | 4 +- .../bazaar/service/dal/entities/Comment.java | 2 + .../service/dal/entities/EntityContext.java | 18 ++--- .../service/dal/entities/Requirement.java | 1 + .../dal/helpers/EntityContextFactory.java | 68 +++++++++++++++++++ .../bazaar/service/dal/helpers/PageInfo.java | 16 ++++- .../bazaar/service/dal/helpers/Pageable.java | 2 + .../dal/repositories/CommentRepository.java | 2 +- .../repositories/CommentRepositoryImpl.java | 26 +------ .../repositories/RequirementRepository.java | 2 +- .../RequirementRepositoryImpl.java | 16 ++--- .../dal/transform/CommentTransformer.java | 13 ++++ 16 files changed, 145 insertions(+), 72 deletions(-) create mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/CommentsResource.java b/src/main/de/rwth/dbis/acis/bazaar/service/CommentsResource.java index 640c0af5..721f1223 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/CommentsResource.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/CommentsResource.java @@ -65,7 +65,7 @@ public CommentsResource() throws Exception { * * @param page page number * @param perPage number of comments by page - * @param includeContext include context of project (project, categories, requirement) + * @param embedParents embed context/parents of comment (project, requirement) * @param search search string * @param sort sort order * @return Response with list of all requirements @@ -81,10 +81,10 @@ public CommentsResource() throws Exception { public Response getAllComments( @ApiParam(value = "Page number", required = false) @DefaultValue("0") @QueryParam("page") int page, @ApiParam(value = "Elements of comments by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage, - @ApiParam(value = "Include context of comment", required = false) @DefaultValue("false") @QueryParam("includeContext") boolean includeContext, @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date") @DefaultValue("name") @QueryParam("sort") List sort, - @ApiParam(value = "Filter", required = true, allowMultiple = false, allowableValues = "created, following, replies") @QueryParam("filters") List filters) + @ApiParam(value = "Filter", required = true, allowMultiple = false, allowableValues = "created, following, replies") @QueryParam("filters") List filters, + @ApiParam(value = "Embed parents", required = true, allowMultiple = true, allowableValues = "project, requirement") @QueryParam("embedParents") List embedParents) { DALFacade dalFacade = null; @@ -117,7 +117,7 @@ public Response getAllComments( for(String filterOption : filters) { filterMap.put(filterOption,internalUserId.toString()); } - PageInfo pageInfo = new PageInfo(page, perPage, filterMap, sortList, search); + PageInfo pageInfo = new PageInfo(page, perPage, filterMap, sortList, search, null, embedParents); Vtor vtor = bazaarService.getValidators(); @@ -132,10 +132,12 @@ public Response getAllComments( if (agent instanceof AnonymousAgent) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.comments.read")); } else { - commentResult = dalFacade.listAllComments(pageInfo, includeContext); + commentResult = dalFacade.listAllComments(pageInfo); } - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, - 0, Activity.DataType.COMMENT, internalUserId); + + //TODO Results in "No CommentRecord found with id: 0" + //bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, + // 0, Activity.DataType.COMMENT, internalUserId); Map> parameter = new HashMap<>(); parameter.put("page", new ArrayList() {{ @@ -144,15 +146,12 @@ public Response getAllComments( parameter.put("per_page", new ArrayList() {{ add(String.valueOf(perPage)); }}); - parameter.put("includeContext", new ArrayList() {{ - add(String.valueOf(includeContext)); - }}); if (search != null) { parameter.put("search", new ArrayList() {{ add(String.valueOf(search)); }}); } - + parameter.put("embedParents", embedParents); parameter.put("sort", sort); parameter.put("filters", filters); diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java b/src/main/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java index 172d5a06..65b97e6c 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java @@ -62,7 +62,7 @@ public PersonalisationDataResource() throws Exception { * @return Response with attachment as a JSON object. */ @GET - @Path("/{key}/{version}") + @Path("/{key}-{version}/") @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "This method allows to retrieve a certain personalisationData value") @ApiResponses(value = { @@ -116,17 +116,17 @@ public Response getPersonalisationData(@PathParam("key") String key, @PathParam( * @return Response with the created attachment as JSON object. */ @PUT - @Path("/") + @Path("/{key}-{version}/") @Consumes(MediaType.APPLICATION_JSON) //@Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "This method allows to save a personalisationData item") @ApiResponses(value = { - @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Success"), + @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Success", response = PersonalisationData.class), @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") }) - public Response setPersonalisationData(@ApiParam(value = "PersonalisationData as JSON", required = true) PersonalisationData data) { + public Response setPersonalisationData(@PathParam("key") String key, @PathParam("version") int version, @ApiParam(value = "PersonalisationData as JSON", required = true) PersonalisationData data) { DALFacade dalFacade = null; try { Agent agent = Context.getCurrent().getMainAgent(); @@ -146,19 +146,19 @@ public Response setPersonalisationData(@ApiParam(value = "PersonalisationData as ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.comment.create")); } - PersonalisationData fullData = PersonalisationData.getBuilder().key(data.getKey()).userId(internalUserId).version(data.getVersion()).value(data.getValue()).build(); + PersonalisationData fullData = PersonalisationData.getBuilder().key(key).userId(internalUserId).version(version).value(data.getValue()).build(); Vtor vtor = bazaarService.getValidators(); vtor.useProfiles("create"); - vtor.validate(data); + vtor.validate(fullData); if (vtor.hasViolations()) { ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); } dalFacade.setPersonalisationData(fullData); - return Response.status(Response.Status.OK).build(); + return Response.ok(fullData.toJSON()).build(); } catch (BazaarException bex) { if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java b/src/main/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java index aab10591..b86fe884 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java @@ -80,7 +80,8 @@ public Response getRequirements( @ApiParam(value = "Elements of requirements by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage, @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date,last_activity,requirement,follower") @DefaultValue("name") @QueryParam("sort") List sort, - @ApiParam(value = "Filter", required = true, allowMultiple = true, allowableValues = "created, following") @QueryParam("filters") List filters) { + @ApiParam(value = "Filter", required = true, allowMultiple = true, allowableValues = "created, following") @QueryParam("filters") List filters, + @ApiParam(value = "Embed parents", required = true, allowMultiple = true, allowableValues = "project") @QueryParam("embedParents") List embedParents) { DALFacade dalFacade = null; try { @@ -112,7 +113,7 @@ public Response getRequirements( for(String filterOption : filters) { filterMap.put(filterOption,internalUserId.toString()); } - PageInfo pageInfo = new PageInfo(page, perPage, filterMap, sortList, search); + PageInfo pageInfo = new PageInfo(page, perPage, filterMap, sortList, search, null, embedParents); Vtor vtor = bazaarService.getValidators(); @@ -129,8 +130,9 @@ public Response getRequirements( } else { requirementsResult = dalFacade.listAllRequirements(pageInfo, internalUserId); } - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, - 0, Activity.DataType.REQUIREMENT, internalUserId); + //TODO NotificationDispatcher tries to find Requirement with id 0 as additional Object, need to implement logic for multiple + //bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, + // 0, Activity.DataType.REQUIREMENT, internalUserId); Map> parameter = new HashMap<>(); parameter.put("page", new ArrayList() {{ diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java index ad9a0c84..ddf4c952 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java @@ -456,7 +456,7 @@ public interface DALFacade { * @param includeContext include context of comment * @return the set of comments */ - PaginationResult listAllComments(Pageable pageable, boolean includeContext) throws BazaarException; + PaginationResult listAllComments(Pageable pageable) throws BazaarException; /** * @param userId the identifier of user we are looking at diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index b79cde9a..ef462206 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -477,9 +477,9 @@ public PaginationResult listCommentsByRequirementId(int requirementId, } @Override - public PaginationResult listAllComments(Pageable pageable, boolean includeContext) throws BazaarException { + public PaginationResult listAllComments(Pageable pageable) throws BazaarException { commentRepository = (commentRepository != null) ? commentRepository : new CommentRepositoryImpl(dslContext); - return commentRepository.findAllComments(pageable, includeContext); + return commentRepository.findAllComments(pageable); } @Override public PaginationResult listAllAnswers(Pageable pageable, int userId) throws BazaarException { diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java index 0437fb81..d90fdc52 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; import jodd.vtor.constraint.Min; import jodd.vtor.constraint.NotBlank; import jodd.vtor.constraint.NotNull; @@ -53,6 +54,7 @@ public class Comment extends EntityBase { @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") private Date lastUpdatedDate; + @JsonProperty("_context") private EntityContext context; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java index eac7dcb2..d3dc26a0 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java @@ -34,7 +34,7 @@ public class EntityContext { private User user; private Project project; - private Category category; + private Category[] categories; private Requirement requirement; private Comment comment; @@ -44,7 +44,7 @@ public EntityContext() { public EntityContext(Builder builder) { this.user = builder.user; this.project = builder.project; - this.category = builder.category; + this.categories = builder.categories; this.requirement = builder.requirement; this.comment = builder.comment; } @@ -52,8 +52,8 @@ public EntityContext(Builder builder) { public Project getProject() { return project; } - public Category getCategory() { - return category; + public Category[] getCategory() { + return categories; } public Requirement getRequirement() { @@ -76,7 +76,7 @@ public String toJSON() throws JsonProcessingException { public static class Builder { private User user; private Project project; - private Category category; + private Category[] categories; private Requirement requirement; private Comment comment; @@ -86,16 +86,16 @@ public Builder project(Project project) { return this; } - public Builder category(Category category) { - this.category = category; + public Builder category(Category[] categories) { + this.categories = categories; return this; } - public Builder requirements(Requirement requirement) { + public Builder requirement(Requirement requirement) { this.requirement = requirement; return this; } - public Builder attachments(User user) { + public Builder attachment(User user) { this.user = user; return this; } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java index 23fbc771..fa767dec 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java @@ -60,6 +60,7 @@ public class Requirement extends EntityBase { private Boolean isDeveloper; private Boolean isContributor; + @JsonProperty("_context") private EntityContext context; public Requirement() { diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java new file mode 100644 index 00000000..0b773d3a --- /dev/null +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java @@ -0,0 +1,68 @@ +package de.rwth.dbis.acis.bazaar.service.dal.helpers; + + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Category; +import de.rwth.dbis.acis.bazaar.service.dal.entities.EntityContext; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Requirement; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CategoryRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.ProjectRecord; +import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementRecord; +import de.rwth.dbis.acis.bazaar.service.dal.repositories.UserRepositoryImpl; +import de.rwth.dbis.acis.bazaar.service.dal.transform.CategoryTransformer; +import de.rwth.dbis.acis.bazaar.service.dal.transform.ProjectTransformer; +import de.rwth.dbis.acis.bazaar.service.dal.transform.RequirementTransformer; +import org.jooq.Record; +import org.jooq.Require; +import org.jooq.Result; + +import java.util.List; + +public class EntityContextFactory{ + private static ProjectTransformer projectTransformer; + private static CategoryTransformer categoryTransformer; + private static RequirementTransformer requirementTransformer; + + + public static EntityContext create(List embed, Record record){ + EntityContext.Builder contextBuilder = EntityContext.getBuilder(); + if(embed != null) { + for (String entry : embed) { + if (entry.equalsIgnoreCase("project")) { + contextBuilder.project(transformToProject(record)); + + } else if (entry.equalsIgnoreCase("category")) { + //TODO Need to handle multiple Categories + //context.category(transformToCategory(record)); + + } else if (entry.equalsIgnoreCase("requirement")) { + contextBuilder.requirement(transformToRequirement(record)); + } + } + } + return contextBuilder.build(); + } + + private static Project transformToProject(Record record){ + projectTransformer = (projectTransformer != null) ? projectTransformer : new ProjectTransformer(); + ProjectRecord projectRecord = record.into(ProjectRecord.class); + return projectTransformer.getEntityFromTableRecord(projectRecord); + } + private static Category transformToCategory(Record record){ + categoryTransformer = (categoryTransformer != null) ? categoryTransformer : new CategoryTransformer(); + CategoryRecord categoryRecord = record.into(CategoryRecord.class); + return categoryTransformer.getEntityFromTableRecord(categoryRecord); + } + private static Requirement transformToRequirement(Record record){ + requirementTransformer = (requirementTransformer != null) ? requirementTransformer : new RequirementTransformer(); + RequirementRecord requirementRecord= record.into(RequirementRecord.class); + return requirementTransformer.getEntityFromTableRecord(requirementRecord); + } + + + + +} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java index da4d1ac4..5757a50a 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java @@ -40,25 +40,32 @@ public class PageInfo implements Pageable { private final List sorts; private final String search; private final List ids; + private final List embed; public PageInfo(int pageNumber, int pageSize) { this(pageNumber, pageSize, new HashMap<>(), new ArrayList<>(), null, null); } + public PageInfo(int pageNumber, int pageSize, Map filters) { - this(pageNumber, pageSize, filters, new ArrayList<>(), null,null); + this(pageNumber, pageSize, filters, new ArrayList<>(), null); } public PageInfo(int pageNumber, int pageSize, Map filters, List sorts, String search){ this(pageNumber, pageSize, filters, sorts, search,null); } + public PageInfo(int pageNumber, int pageSize, Map filters, List sorts, String search, List ids){ + this(pageNumber, pageSize, filters, sorts, search,ids, null); + } + - public PageInfo(int pageNumber, int pageSize, Map filters, List sorts, String search, List ids) { + public PageInfo(int pageNumber, int pageSize, Map filters, List sorts, String search, List ids, List embed) { this.pageNumber = pageNumber; this.pageSize = pageSize; this.filters = filters; this.sorts = sorts; this.search = search != null ? search : ""; this.ids = ids; + this.embed = embed; } @Override @@ -91,6 +98,11 @@ public List getIds() { return ids; } + @Override + public List getEmbed() { + return embed; + } + @Override public String getSearch() {return search;} } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java index 6c68f2bd..f2cba5e2 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java @@ -42,6 +42,8 @@ public interface Pageable { List getIds(); + List getEmbed(); + class SortField { String field; SortDirection sortDirection; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java index c477198c..5a7e740c 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java @@ -33,7 +33,7 @@ */ public interface CommentRepository extends Repository { PaginationResult findAllByRequirementId(int requirementId, Pageable pageable) throws BazaarException; - PaginationResult findAllComments(Pageable pageable, boolean includeContext) throws BazaarException; + PaginationResult findAllComments(Pageable pageable) throws BazaarException; PaginationResult findAllAnswers(Pageable pageable, int userId) throws BazaarException; boolean belongsToPublicProject(int id) throws BazaarException; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java index 42cf1329..57b18ea2 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java @@ -21,12 +21,9 @@ package de.rwth.dbis.acis.bazaar.service.dal.repositories; import de.rwth.dbis.acis.bazaar.service.dal.entities.Comment; -import de.rwth.dbis.acis.bazaar.service.dal.entities.EntityContext; -import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.EntityContextFactory; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Category; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Requirement; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User; import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.*; import de.rwth.dbis.acis.bazaar.service.dal.transform.*; @@ -113,7 +110,7 @@ public PaginationResult findAllAnswers(Pageable pageable, int userId) t @Override - public PaginationResult findAllComments(Pageable pageable, boolean includeContext) throws BazaarException { + public PaginationResult findAllComments(Pageable pageable) throws BazaarException { PaginationResult result = null; List comments; try { @@ -151,9 +148,7 @@ public PaginationResult findAllComments(Pageable pageable, boolean incl for (Record record : queryResults) { if (entry == null || transformer.getEntityFromTableRecord(record.into(CommentRecord.class)).getId() != entry.getId()) { entry = convertToCommentWithUser(record, creatorUser); - if(includeContext) { - entry.setContext(convertToContext(record)); - } + entry.setContext(EntityContextFactory.create(pageable.getEmbed(), record)); comments.add(entry); } } @@ -215,21 +210,6 @@ public PaginationResult f return result; } - private EntityContext convertToContext(Record record){ - ProjectRecord projectRecord = record.into(ProjectRecord.class); - RequirementRecord requirementRecord = record.into(RequirementRecord.class); - CategoryRecord categoryRecord = record.into(CategoryRecord.class); - - ProjectTransformer projectTransformer = new ProjectTransformer(); - RequirementTransformer requirementTransformer = new RequirementTransformer(); - CategoryTransformer categoryTransformer = new CategoryTransformer(); - - de.rwth.dbis.acis.bazaar.service.dal.entities.Project contextProject = projectTransformer.getEntityFromTableRecord(projectRecord); - de.rwth.dbis.acis.bazaar.service.dal.entities.Requirement contextRequirement = requirementTransformer.getEntityFromTableRecord(requirementRecord); - de.rwth.dbis.acis.bazaar.service.dal.entities.Category contextCategory = categoryTransformer.getEntityFromTableRecord(categoryRecord); - - return EntityContext.getBuilder().project(contextProject).requirements(contextRequirement).category(contextCategory).build(); - } private Comment convertToCommentWithUser(Record record, de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User creatorUser) { CommentRecord commentRecord = record.into(CommentRecord.class); diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java index 59a61c72..6d0df499 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java @@ -42,7 +42,7 @@ public interface RequirementRepository extends Repository { boolean belongsToPublicProject(int id) throws BazaarException; Requirement findById(int id, int userId) throws Exception; - Requirement findById(int id, int userId, boolean includeContext) throws Exception; + Requirement findById(int id, int userId, List embed) throws Exception; void setRealized(int id, Timestamp realized) throws BazaarException; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java index 0d76e321..7eb6abfc 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java @@ -24,6 +24,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.EntityContext; import de.rwth.dbis.acis.bazaar.service.dal.entities.Requirement; import de.rwth.dbis.acis.bazaar.service.dal.entities.Statistic; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.EntityContextFactory; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; import de.rwth.dbis.acis.bazaar.service.dal.helpers.UserVote; @@ -171,7 +172,7 @@ public PaginationResult findAll(Pageable pageable, int userId) thro for (Record queryResult : queryResults) { RequirementRecord requirementRecord = queryResult.into(REQUIREMENT); Requirement requirement = transformer.getEntityFromTableRecord(requirementRecord); - requirements.add(findById(requirement.getId(), userId, true)); // TODO: Remove the getId call and create the objects themself here + requirements.add(findById(requirement.getId(), userId, pageable.getEmbed())); // TODO: Remove the getId call and create the objects themself here } int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); result = new PaginationResult<>(total, pageable, requirements); @@ -320,10 +321,10 @@ public boolean belongsToPublicProject(int id) throws BazaarException { } @Override public Requirement findById(int id, int userId) throws Exception { - return findById(id, userId, false); + return findById(id, userId, null); } @Override - public Requirement findById(int id, int userId, boolean includeContext) throws Exception { + public Requirement findById(int id, int userId, List embed) throws Exception { Requirement requirement = null; try { de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User creatorUser = USER.as("creatorUser"); @@ -453,14 +454,7 @@ public Requirement findById(int id, int userId, boolean includeContext) throws E requirement.setContributor(queryResult.getValues(isContributor).get(0).equals(new BigDecimal(0)) ? false : true); } - if(includeContext){ - ProjectRecord projectRecord = queryResult.get(0).into(ProjectRecord.class); - ProjectTransformer projectTransformer = new ProjectTransformer(); - de.rwth.dbis.acis.bazaar.service.dal.entities.Project contextProject = projectTransformer.getEntityFromTableRecord(projectRecord); - - EntityContext context = EntityContext.getBuilder().project(contextProject).build(); - requirement.setContext(context); - } + requirement.setContext(EntityContextFactory.create(embed, queryResult.get(0))); } catch (BazaarException be) { ExceptionHandler.getInstance().convertAndThrowException(be); diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java index 1e78a047..a1f29597 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java @@ -155,6 +155,19 @@ public Collection getFilterConditions(Map f DSL.select(REQUIREMENT_FOLLOWER_MAP.REQUIREMENT_ID) .from(REQUIREMENT_FOLLOWER_MAP) .where(REQUIREMENT_FOLLOWER_MAP.USER_ID.eq(Integer.parseInt(filterEntry.getValue()))) + .union( + DSL.select(REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID) + .from(REQUIREMENT_CATEGORY_MAP) + .join(CATEGORY_FOLLOWER_MAP) + .on(REQUIREMENT_CATEGORY_MAP.CATEGORY_ID.eq(CATEGORY_FOLLOWER_MAP.CATEGORY_ID) + .and(CATEGORY_FOLLOWER_MAP.USER_ID.eq(Integer.parseInt(filterEntry.getValue())))) + ).union( + DSL.select(REQUIREMENT.ID) + .from(REQUIREMENT) + .join(PROJECT_FOLLOWER_MAP) + .on(REQUIREMENT.PROJECT_ID.eq(PROJECT_FOLLOWER_MAP.PROJECT_ID) + .and(PROJECT_FOLLOWER_MAP.USER_ID.eq(Integer.parseInt(filterEntry.getValue())))) + ) ) ); From 464592b3feaafa69749584cc9681b3f79abb1565 Mon Sep 17 00:00:00 2001 From: Milan D Date: Sun, 23 Feb 2020 01:40:10 +0100 Subject: [PATCH 022/134] Add Setting to Enable/Disable Personalisation --- .../V4__add_personalisation_settings.sql | 2 + .../bazaar/service/dal/entities/User.java | 13 ++++ .../bazaar/service/dal/jooq/tables/User.java | 7 ++- .../dal/jooq/tables/records/UserRecord.java | 63 +++++++++++++++---- .../dal/transform/UserTransformer.java | 7 +++ 5 files changed, 80 insertions(+), 12 deletions(-) create mode 100644 etc/migrations/V4__add_personalisation_settings.sql diff --git a/etc/migrations/V4__add_personalisation_settings.sql b/etc/migrations/V4__add_personalisation_settings.sql new file mode 100644 index 00000000..3c703823 --- /dev/null +++ b/etc/migrations/V4__add_personalisation_settings.sql @@ -0,0 +1,2 @@ +ALTER TABLE reqbaz.user +ADD personalization_enabled tinyint(1) DEFAULT '1'; \ No newline at end of file diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java index fe763b78..80fff81e 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java @@ -61,6 +61,8 @@ public class User extends EntityBase { private Boolean emailFollowSubscription; + private Boolean personalizationEnabled; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") private Date creationDate; @@ -87,6 +89,7 @@ public User(Builder builder) { this.creationDate = builder.creationDate; this.lastUpdatedDate = builder.lastUpdatedDate; this.lastLoginDate = builder.lastLoginDate; + this.personalizationEnabled = builder.personalizationEnabled; } public int getId() { @@ -130,6 +133,8 @@ public Boolean isEmailFollowSubscription() { return emailFollowSubscription; } + public Boolean isPersonalizationEnabled(){ return personalizationEnabled; } + public Date getCreationDate() { return creationDate; } @@ -150,6 +155,8 @@ public boolean getAdmin() { return admin; } + + public static class Builder { private int id; private String firstName; @@ -161,10 +168,12 @@ public static class Builder { private String profileImage; private Boolean emailLeadSubscription; private Boolean emailFollowSubscription; + private Boolean personalizationEnabled; private Date creationDate; private Date lastUpdatedDate; private Date lastLoginDate; + public Builder(String eMail) { this.eMail = eMail; } @@ -233,6 +242,10 @@ public Builder lastLoginDate(Date lastLoginDate) { this.lastLoginDate = lastLoginDate; return this; } + public Builder personalizationEnabled(Boolean personalizationEnabled){ + this.personalizationEnabled = personalizationEnabled; + return this; + } public User build() { return new User(this); diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/User.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/User.java index e11ef45e..7c64b01f 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/User.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/User.java @@ -36,7 +36,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class User extends TableImpl { - private static final long serialVersionUID = 952606792; + private static final long serialVersionUID = 1645407206; /** * The reference instance of reqbaz.user @@ -116,6 +116,11 @@ public Class getRecordType() { */ public final TableField LAST_LOGIN_DATE = createField("last_login_date", org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); + /** + * The column reqbaz.user.personalization_enabled. + */ + public final TableField PERSONALIZATION_ENABLED = createField("personalization_enabled", org.jooq.impl.SQLDataType.TINYINT.defaultValue(org.jooq.impl.DSL.inline("1", org.jooq.impl.SQLDataType.TINYINT)), this, ""); + /** * Create a reqbaz.user table reference */ diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRecord.java index ecb57837..03119d16 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRecord.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRecord.java @@ -12,8 +12,8 @@ import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record13; -import org.jooq.Row13; +import org.jooq.Record14; +import org.jooq.Row14; import org.jooq.impl.UpdatableRecordImpl; @@ -28,9 +28,9 @@ comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class UserRecord extends UpdatableRecordImpl implements Record13 { +public class UserRecord extends UpdatableRecordImpl implements Record14 { - private static final long serialVersionUID = 131097065; + private static final long serialVersionUID = 1368312286; /** * Setter for reqbaz.user.id. @@ -214,6 +214,20 @@ public Timestamp getLastLoginDate() { return (Timestamp) get(12); } + /** + * Setter for reqbaz.user.personalization_enabled. + */ + public void setPersonalizationEnabled(Byte value) { + set(13, value); + } + + /** + * Getter for reqbaz.user.personalization_enabled. + */ + public Byte getPersonalizationEnabled() { + return (Byte) get(13); + } + // ------------------------------------------------------------------------- // Primary key information // ------------------------------------------------------------------------- @@ -227,23 +241,23 @@ public Record1 key() { } // ------------------------------------------------------------------------- - // Record13 type implementation + // Record14 type implementation // ------------------------------------------------------------------------- /** * {@inheritDoc} */ @Override - public Row13 fieldsRow() { - return (Row13) super.fieldsRow(); + public Row14 fieldsRow() { + return (Row14) super.fieldsRow(); } /** * {@inheritDoc} */ @Override - public Row13 valuesRow() { - return (Row13) super.valuesRow(); + public Row14 valuesRow() { + return (Row14) super.valuesRow(); } /** @@ -350,6 +364,14 @@ public Field field13() { return User.USER.LAST_LOGIN_DATE; } + /** + * {@inheritDoc} + */ + @Override + public Field field14() { + return User.USER.PERSONALIZATION_ENABLED; + } + /** * {@inheritDoc} */ @@ -454,6 +476,14 @@ public Timestamp value13() { return getLastLoginDate(); } + /** + * {@inheritDoc} + */ + @Override + public Byte value14() { + return getPersonalizationEnabled(); + } + /** * {@inheritDoc} */ @@ -575,7 +605,16 @@ public UserRecord value13(Timestamp value) { * {@inheritDoc} */ @Override - public UserRecord values(Integer value1, String value2, String value3, String value4, Boolean value5, String value6, String value7, String value8, Byte value9, Byte value10, Timestamp value11, Timestamp value12, Timestamp value13) { + public UserRecord value14(Byte value) { + setPersonalizationEnabled(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public UserRecord values(Integer value1, String value2, String value3, String value4, Boolean value5, String value6, String value7, String value8, Byte value9, Byte value10, Timestamp value11, Timestamp value12, Timestamp value13, Byte value14) { value1(value1); value2(value2); value3(value3); @@ -589,6 +628,7 @@ public UserRecord values(Integer value1, String value2, String value3, String va value11(value11); value12(value12); value13(value13); + value14(value14); return this; } @@ -606,7 +646,7 @@ public UserRecord() { /** * Create a detached, initialised UserRecord */ - public UserRecord(Integer id, String firstName, String lastName, String email, Boolean admin, String las2peerId, String userName, String profileImage, Byte emailLeadSubscription, Byte emailFollowSubscription, Timestamp creationDate, Timestamp lastUpdatedDate, Timestamp lastLoginDate) { + public UserRecord(Integer id, String firstName, String lastName, String email, Boolean admin, String las2peerId, String userName, String profileImage, Byte emailLeadSubscription, Byte emailFollowSubscription, Timestamp creationDate, Timestamp lastUpdatedDate, Timestamp lastLoginDate, Byte personalizationEnabled) { super(User.USER); set(0, id); @@ -622,5 +662,6 @@ public UserRecord(Integer id, String firstName, String lastName, String email, B set(10, creationDate); set(11, lastUpdatedDate); set(12, lastLoginDate); + set(13, personalizationEnabled); } } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java index b941bded..2c1ccc93 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java @@ -42,7 +42,9 @@ public UserRecord createRecord(User entity) { record.setProfileImage(entity.getProfileImage()); record.setEmailLeadSubscription((byte) (entity.isEmailLeadSubscription() ? 1 : 0)); record.setEmailFollowSubscription((byte) (entity.isEmailFollowSubscription() ? 1 : 0)); + record.setPersonalizationEnabled((byte) (entity.isPersonalizationEnabled() ? 1:0)); record.setCreationDate(new java.sql.Timestamp(Calendar.getInstance().getTime().getTime())); + return record; } @@ -61,6 +63,7 @@ public User getEntityFromTableRecord(UserRecord record) { .creationDate(record.getCreationDate()) .lastUpdatedDate(record.getLastUpdatedDate()) .lastLoginDate(record.getLastLoginDate()) + .personalizationEnabled(record.getPersonalizationEnabled() != 0) .build(); } @@ -75,6 +78,7 @@ public User getEntityFromQueryResult(de.rwth.dbis.acis.bazaar.service.dal.jooq.t .profileImage(queryResult.getValues(user.PROFILE_IMAGE).get(0)) .emailLeadSubscription(queryResult.getValues(user.EMAIL_LEAD_SUBSCRIPTION).get(0) != 0) .emailFollowSubscription(queryResult.getValues(user.EMAIL_FOLLOW_SUBSCRIPTION).get(0) != 0) + .personalizationEnabled(queryResult.getValues(user.PERSONALIZATION_ENABLED).get(0) != 0) .build(); } @@ -117,6 +121,9 @@ public Map getUpdateMap(final User entity) { if (entity.isEmailFollowSubscription() != null) { put(USER.EMAIL_FOLLOW_SUBSCRIPTION, entity.isEmailFollowSubscription()); } + if (entity.isPersonalizationEnabled() != null) { + put(USER.PERSONALIZATION_ENABLED, entity.isPersonalizationEnabled()); + } }}; if (!updateMap.isEmpty()) { updateMap.put(USER.LAST_UPDATED_DATE, new java.sql.Timestamp(Calendar.getInstance().getTime().getTime())); From 4c9db6efcabe50ad76ff690bc076cdca8133d370 Mon Sep 17 00:00:00 2001 From: Thore Date: Fri, 27 Nov 2020 17:48:08 +0100 Subject: [PATCH 023/134] Readjust for upgrade to las2peer 1.0.0 --- .gitignore | 1 + build.xml | 70 ++++++++++++++---------- etc/ant_configuration/service.properties | 2 +- etc/ivy/ivy.xml | 24 ++++---- etc/ivy/ivysettings.xml | 8 ++- 5 files changed, 60 insertions(+), 45 deletions(-) diff --git a/.gitignore b/.gitignore index 9278c1d8..544a6aae 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ etc/ivy/ivy.jar restMapping.xml /out /output/ +/servicebundle # IntelliJ .idea/ diff --git a/build.xml b/build.xml index a33adf53..d513f513 100755 --- a/build.xml +++ b/build.xml @@ -1,7 +1,8 @@ - + + @@ -30,23 +31,23 @@ + - + - - + - + @@ -55,7 +56,7 @@ - @@ -70,18 +71,18 @@ - + + - - + - + @@ -146,32 +147,33 @@ #!/bin/bash - # this script is autogenerated by 'ant startscripts' - # it starts a LAS2peer node providing the service '${service.name}.${service.class}' of this project - # pls execute it from the root folder of your deployment, e. g. ./bin/start_network.sh +# this script is autogenerated by 'ant startscripts' +# it starts a LAS2peer node providing the service '${service.name}.${service.class}' of this project +# pls execute it from the root folder of your deployment, e. g. ./bin/start_network.sh - java -cp "lib/*" i5.las2peer.tools.L2pNodeLauncher -p 9011 uploadStartupDirectory --service-directory service startService\(\'${service.name}.${service.class}@${service.version}\',\'${service.passphrase}\'\) startWebConnector interactive +java -cp "lib/*" i5.las2peer.tools.L2pNodeLauncher -p 9011 uploadStartupDirectory --service-directory service startService\(\'${service.name}.${service.class}@${service.version}\',\'${service.passphrase}\'\) startWebConnector interactive :: this script is autogenerated by 'ant - startscripts' - :: it starts a LAS2peer node providing the service '${service.name}.${service.class}' of this project - :: pls execute it from the bin folder of your deployment by double-clicking on it +startscripts' +:: it starts a LAS2peer node providing the service '${service.name}.${service.class}' of this project +:: pls execute it from the bin folder of your deployment by double-clicking on it - %~d0 - cd %~p0 - cd .. - set BASE=%CD% - set CLASSPATH="%BASE%/lib/*;" +%~d0 +cd %~p0 +cd .. +set BASE=%CD% +set CLASSPATH="%BASE%/lib/*;" - java -cp %CLASSPATH% i5.las2peer.tools.L2pNodeLauncher -p 9011 uploadStartupDirectory --service-directory service startService('${service.name}.${service.class}@${service.version}','${service.passphrase}') startWebConnector interactive +java -cp %CLASSPATH% i5.las2peer.tools.L2pNodeLauncher -p 9011 uploadStartupDirectory --service-directory service startService('${service.name}.${service.class}@${service.version}','${service.passphrase}') startWebConnector interactive - pause +pause + @@ -180,15 +182,24 @@ - - - + + + + + + + + + + + - + + @@ -269,6 +280,7 @@ + @@ -284,7 +296,7 @@ - + diff --git a/etc/ant_configuration/service.properties b/etc/ant_configuration/service.properties index 97880fde..a1cfad75 100755 --- a/etc/ant_configuration/service.properties +++ b/etc/ant_configuration/service.properties @@ -3,4 +3,4 @@ service.name=de.rwth.dbis.acis.bazaar.service service.path=de/rwth/dbis/acis/bazaar/service service.class=BazaarService service.passphrase=Passphrase -service.dependencies=commons-codec;version="1.9",commons-dbcp2;version="2.0",commons-io;version="2.4",commons-logging;version="1.2",commons-pool2;version="2.2",emoji-java;version="3.1.3",gson;version="2.3",httpclient;version="4.5.1",httpcore;version="4.4.3",jodd-bean;version="3.6.1",jodd-core;version="3.6.1",jodd-vtor;version="3.6.1",jooq;version="3.9.1",jooq-codegen;version="3.9.1",jooq-meta;version="3.9.1",json;version="20140107",mysql-connector-java;version="6.0.5" +service.dependencies=commons-codec;version="1.9",commons-dbcp2;version="2.8",commons-io;version="2.8",commons-logging;version="1.2",commons-pool2;version="2.9",emoji-java;version="3.1.3",gson;version="2.8",httpclient;version="4.5.1",httpcore;version="4.4.3",jodd-bean;version="3.6.1",jodd-core;version="3.6.1",jodd-vtor;version="3.6.1",jooq;version="3.9.1",jooq-codegen;version="3.9.1",jooq-meta;version="3.9.1",json;version="20140107",mysql-connector-java;version="8.0.22" diff --git a/etc/ivy/ivy.xml b/etc/ivy/ivy.xml index 33c81a82..5d05c07b 100755 --- a/etc/ivy/ivy.xml +++ b/etc/ivy/ivy.xml @@ -11,20 +11,20 @@ - + - + - - - - - - - - - - + + + + + + + + + + diff --git a/etc/ivy/ivysettings.xml b/etc/ivy/ivysettings.xml index 042d228b..f1b28a65 100755 --- a/etc/ivy/ivysettings.xml +++ b/etc/ivy/ivysettings.xml @@ -3,8 +3,10 @@ - - + + - + \ No newline at end of file From 32635264a43d4729324c0627b295763ad435d290 Mon Sep 17 00:00:00 2001 From: Thore Date: Mon, 30 Nov 2020 14:28:30 +0100 Subject: [PATCH 024/134] Fix build issues --- CHANGELOG.md | 17 +++++++++++++++++ build.xml | 4 ++-- etc/ivy/ivy.xml | 32 +++++++++++++++++--------------- 3 files changed, 36 insertions(+), 17 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..89ca9c49 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,17 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +Releases prior to v0.7.2 are only documented on the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releases) + +## [Unreleased] + +### Changed + +- Updated all dependencies, most notably las2peer 1.0.0 [#68](https://github.com/rwth-acis/RequirementsBazaar/pull/68) + +## [0.7.2] - 2017-10-25 + +See GH Releases diff --git a/build.xml b/build.xml index d513f513..38b279db 100755 --- a/build.xml +++ b/build.xml @@ -1,5 +1,4 @@ - + @@ -81,6 +80,7 @@ + diff --git a/etc/ivy/ivy.xml b/etc/ivy/ivy.xml index 5d05c07b..9033c09e 100755 --- a/etc/ivy/ivy.xml +++ b/etc/ivy/ivy.xml @@ -1,7 +1,7 @@ - + - + @@ -12,19 +12,21 @@ + + - - - - - - - - - - - - - + + + + + + + + + + + + + From a58cc322f54cfd2e6c65ab6f6ca64a778c4adfdb Mon Sep 17 00:00:00 2001 From: Thore Date: Tue, 1 Dec 2020 17:46:08 +0100 Subject: [PATCH 025/134] Remove deprecated mysql driver initialization --- src/main/de/rwth/dbis/acis/bazaar/service/BazaarService.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/BazaarService.java b/src/main/de/rwth/dbis/acis/bazaar/service/BazaarService.java index 278d7019..e56d073c 100755 --- a/src/main/de/rwth/dbis/acis/bazaar/service/BazaarService.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/BazaarService.java @@ -115,8 +115,6 @@ public BazaarService() throws Exception { Locale locale = new Locale(lang, country); Localization.getInstance().setResourceBundle(ResourceBundle.getBundle("i18n.Translation", locale)); - Class.forName("com.mysql.jdbc.Driver").newInstance(); - dataSource = setupDataSource(dbUrl, dbUserName, dbPassword); functionRegistrar = new ArrayList<>(); From 2762863a9002684caa6200d8bf91d1fb1a09b973 Mon Sep 17 00:00:00 2001 From: Thore Date: Tue, 1 Dec 2020 17:46:31 +0100 Subject: [PATCH 026/134] Fix test imports, test cases are still broken --- .../acis/bazaar/service/security/AnonymUserRightsTest.java | 4 ++-- .../dbis/acis/bazaar/service/security/SysAdminRightsTest.java | 4 ++-- .../de/rwth/dbis/acis/bazaar/service/update/UpdateTest.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/de/rwth/dbis/acis/bazaar/service/security/AnonymUserRightsTest.java b/src/test/de/rwth/dbis/acis/bazaar/service/security/AnonymUserRightsTest.java index 7c35099e..023e5f5b 100644 --- a/src/test/de/rwth/dbis/acis/bazaar/service/security/AnonymUserRightsTest.java +++ b/src/test/de/rwth/dbis/acis/bazaar/service/security/AnonymUserRightsTest.java @@ -26,8 +26,8 @@ import de.rwth.dbis.acis.bazaar.service.TestBase; import de.rwth.dbis.acis.bazaar.service.dal.entities.*; import i5.las2peer.testing.MockAgentFactory; -import i5.las2peer.webConnector.client.ClientResponse; -import i5.las2peer.webConnector.client.MiniClient; +import i5.las2peer.connectors.webConnector.client.ClientResponse; +import i5.las2peer.connectors.webConnector.client.MiniClient; import org.junit.*; diff --git a/src/test/de/rwth/dbis/acis/bazaar/service/security/SysAdminRightsTest.java b/src/test/de/rwth/dbis/acis/bazaar/service/security/SysAdminRightsTest.java index 6441016d..978112da 100644 --- a/src/test/de/rwth/dbis/acis/bazaar/service/security/SysAdminRightsTest.java +++ b/src/test/de/rwth/dbis/acis/bazaar/service/security/SysAdminRightsTest.java @@ -28,8 +28,8 @@ import de.rwth.dbis.acis.bazaar.service.TestBase; import de.rwth.dbis.acis.bazaar.service.dal.entities.*; import i5.las2peer.testing.MockAgentFactory; -import i5.las2peer.webConnector.client.ClientResponse; -import i5.las2peer.webConnector.client.MiniClient; +import i5.las2peer.connectors.webConnector.client.ClientResponse; +import i5.las2peer.connectors.webConnector.client.MiniClient; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; diff --git a/src/test/de/rwth/dbis/acis/bazaar/service/update/UpdateTest.java b/src/test/de/rwth/dbis/acis/bazaar/service/update/UpdateTest.java index ba68f6aa..de7557e0 100644 --- a/src/test/de/rwth/dbis/acis/bazaar/service/update/UpdateTest.java +++ b/src/test/de/rwth/dbis/acis/bazaar/service/update/UpdateTest.java @@ -26,8 +26,8 @@ import de.rwth.dbis.acis.bazaar.service.TestBase; import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; import i5.las2peer.testing.MockAgentFactory; -import i5.las2peer.webConnector.client.ClientResponse; -import i5.las2peer.webConnector.client.MiniClient; +import i5.las2peer.connectors.webConnector.client.ClientResponse; +import i5.las2peer.connectors.webConnector.client.MiniClient; import org.junit.BeforeClass; import org.junit.Test; From e795d3fbedc61a624dfd86b5906c8ff29b44231a Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 5 Dec 2020 15:23:27 +0100 Subject: [PATCH 027/134] Fix database user creation error --- build.xml | 2 +- etc/ivy/ivy.xml | 4 ++-- src/main/de/rwth/dbis/acis/bazaar/service/BazaarService.java | 4 ++-- .../de/rwth/dbis/acis/bazaar/service/dal/entities/User.java | 2 +- .../acis/bazaar/service/dal/transform/UserTransformer.java | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build.xml b/build.xml index 38b279db..eeda92d3 100755 --- a/build.xml +++ b/build.xml @@ -316,7 +316,7 @@ pause fork="true"> + value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5433"/> diff --git a/etc/ivy/ivy.xml b/etc/ivy/ivy.xml index 9033c09e..9144cced 100755 --- a/etc/ivy/ivy.xml +++ b/etc/ivy/ivy.xml @@ -15,8 +15,8 @@ - - + + diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/BazaarService.java b/src/main/de/rwth/dbis/acis/bazaar/service/BazaarService.java index e56d073c..92058856 100755 --- a/src/main/de/rwth/dbis/acis/bazaar/service/BazaarService.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/BazaarService.java @@ -348,9 +348,9 @@ private void registerUserAtFirstLogin() throws Exception { Integer userIdByLAS2PeerId = dalFacade.getUserIdByLAS2PeerId(agent.getIdentifier()); if (userIdByLAS2PeerId == null) { // create user - User.Builder userBuilder = User.geBuilder(email); + User.Builder userBuilder = User.getBuilder(email); User user = userBuilder.admin(false).las2peerId(agent.getIdentifier()).userName(loginName).profileImage(profileImage) - .emailLeadSubscription(true).emailFollowSubscription(true).build(); + .emailLeadSubscription(true).emailFollowSubscription(true).personalizationEnabled(false).build(); user = dalFacade.createUser(user); int userId = user.getId(); this.getNotificationDispatcher().dispatchNotification(user.getCreationDate(), Activity.ActivityAction.CREATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_55, diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java index 80fff81e..47331a0a 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java @@ -147,7 +147,7 @@ public Date getLastLoginDate() { return lastLoginDate; } - public static Builder geBuilder(String eMail) { + public static Builder getBuilder(String eMail) { return new Builder(eMail); } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java index 2c1ccc93..b466e2b9 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java @@ -50,7 +50,7 @@ public UserRecord createRecord(User entity) { @Override public User getEntityFromTableRecord(UserRecord record) { - return User.geBuilder(record.getEmail()) + return User.getBuilder(record.getEmail()) .id(record.getId()) .admin(record.getAdmin()) .firstName(record.getFirstName()) @@ -68,7 +68,7 @@ public User getEntityFromTableRecord(UserRecord record) { } public User getEntityFromQueryResult(de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User user, Result queryResult) { - return User.geBuilder(queryResult.getValues(user.EMAIL).get(0)) + return User.getBuilder(queryResult.getValues(user.EMAIL).get(0)) .id(queryResult.getValues(user.ID).get(0)) .admin(queryResult.getValues(user.ADMIN).get(0)) .firstName(queryResult.getValues(user.FIRST_NAME).get(0)) From 134cb8799b9ef2d4f08cd975edb24e8c1c6af8c5 Mon Sep 17 00:00:00 2001 From: Thore Date: Sun, 3 Jan 2021 17:54:41 +0100 Subject: [PATCH 028/134] First step of gradle migration without jooq import fixes --- .classpath | 26 - .gitattributes | 6 + .gitignore | 5 + .project | 15 - gradle.properties | 14 + gradle/wrapper/gradle-wrapper.properties | 5 + gradlew | 185 +++++ gradlew.bat | 89 +++ requirement_bazaar/build.gradle | 155 ++++ ...is.bazaar.service.BazaarService.properties | 13 + .../src}/i18n/Translation_de.properties | 0 .../src}/i18n/Translation_en.properties | 0 .../bazaar/service/AttachmentsResource.java | 7 +- .../acis/bazaar/service/BazaarFunction.java | 0 .../service/BazaarFunctionRegistrar.java | 0 .../acis/bazaar/service/BazaarService.java | 3 +- .../acis/bazaar/service/CategoryResource.java | 15 +- .../acis/bazaar/service/CommentsResource.java | 0 .../service/PersonalisationDataResource.java | 0 .../acis/bazaar/service/ProjectsResource.java | 20 +- .../bazaar/service/RequirementsResource.java | 0 .../acis/bazaar/service/UsersResource.java | 9 +- .../acis/bazaar/service/dal/DALFacade.java | 0 .../bazaar/service/dal/DALFacadeImpl.java | 14 +- .../bazaar/service/dal/entities/Activity.java | 9 +- .../service/dal/entities/Attachment.java | 21 +- .../bazaar/service/dal/entities/Category.java | 21 +- .../dal/entities/CategoryContributors.java | 0 .../dal/entities/CategoryFollower.java | 0 .../bazaar/service/dal/entities/Comment.java | 21 +- .../bazaar/service/dal/entities/Email.java | 9 +- .../service/dal/entities/EntityBase.java | 0 .../service/dal/entities/EntityContext.java | 0 .../service/dal/entities/EntityOverview.java | 0 .../service/dal/entities/IdentifiedById.java | 0 .../dal/entities/PersonalisationData.java | 0 .../service/dal/entities/Privilege.java | 0 .../service/dal/entities/PrivilegeEnum.java | 0 .../bazaar/service/dal/entities/Project.java | 21 +- .../dal/entities/ProjectContributors.java | 0 .../service/dal/entities/ProjectFollower.java | 0 .../service/dal/entities/Requirement.java | 31 +- .../dal/entities/RequirementCategory.java | 0 .../dal/entities/RequirementContributors.java | 0 .../dal/entities/RequirementDeveloper.java | 0 .../dal/entities/RequirementFollower.java | 0 .../bazaar/service/dal/entities/Role.java | 0 .../service/dal/entities/Statistic.java | 0 .../bazaar/service/dal/entities/User.java | 31 +- .../bazaar/service/dal/entities/Vote.java | 0 .../service/dal/helpers/CreationStatus.java | 0 .../dal/helpers/EntityContextFactory.java | 6 +- .../bazaar/service/dal/helpers/PageInfo.java | 0 .../bazaar/service/dal/helpers/Pageable.java | 0 .../service/dal/helpers/PaginationResult.java | 0 .../bazaar/service/dal/helpers/UserVote.java | 0 .../repositories/AttachmentRepository.java | 0 .../AttachmentRepositoryImpl.java | 10 +- .../CategoryFollowerRepository.java | 0 .../CategoryFollowerRepositoryImpl.java | 4 +- .../dal/repositories/CategoryRepository.java | 3 +- .../repositories/CategoryRepositoryImpl.java | 18 +- .../dal/repositories/CommentRepository.java | 0 .../repositories/CommentRepositoryImpl.java | 26 +- .../PersonalisationDataRepository.java | 0 .../PersonalisationDataRepositoryImpl.java | 4 +- .../dal/repositories/PrivilegeRepository.java | 0 .../repositories/PrivilegeRepositoryImpl.java | 4 +- .../ProjectFollowerRepository.java | 0 .../ProjectFollowerRepositoryImpl.java | 4 +- .../dal/repositories/ProjectRepository.java | 5 +- .../repositories/ProjectRepositoryImpl.java | 18 +- .../service/dal/repositories/Repository.java | 0 .../dal/repositories/RepositoryImpl.java | 1 + .../RequirementCategoryRepository.java | 0 .../RequirementCategoryRepositoryImpl.java | 4 +- .../RequirementDeveloperRepository.java | 0 .../RequirementDeveloperRepositoryImpl.java | 4 +- .../RequirementFollowerRepository.java | 0 .../RequirementFollowerRepositoryImpl.java | 4 +- .../repositories/RequirementRepository.java | 5 +- .../RequirementRepositoryImpl.java | 26 +- .../dal/repositories/RoleRepository.java | 0 .../dal/repositories/RoleRepositoryImpl.java | 18 +- .../dal/repositories/UserRepository.java | 0 .../dal/repositories/UserRepositoryImpl.java | 43 +- .../dal/repositories/VoteRepository.java | 0 .../dal/repositories/VoteRepositoryImpl.java | 4 +- .../dal/transform/AttachmentTransformer.java | 7 +- .../CategoryFollowerTransformer.java | 4 +- .../dal/transform/CategoryTransformer.java | 9 +- .../dal/transform/CommentTransformer.java | 11 +- .../PersonalisationDataTransformer.java | 8 +- .../dal/transform/PrivilegeEnumConverter.java | 0 .../dal/transform/PrivilegeTransformer.java | 6 +- .../transform/ProjectFollowerTransformer.java | 4 +- .../dal/transform/ProjectTransformer.java | 11 +- .../RequirementCategoryTransformer.java | 4 +- .../RequirementDeveloperTransformer.java | 4 +- .../RequirementFollowerTransformer.java | 4 +- .../dal/transform/RequirementTransformer.java | 7 +- .../dal/transform/RoleTransformer.java | 4 +- .../service/dal/transform/Transformer.java | 1 + .../dal/transform/UserTransformer.java | 7 +- .../dal/transform/VoteTransformer.java | 4 +- .../service/exception/BazaarException.java | 0 .../bazaar/service/exception/ErrorCode.java | 0 .../service/exception/ExceptionHandler.java | 0 .../service/exception/ExceptionLocation.java | 0 .../service/internalization/Localization.java | 0 .../notification/ActivityDispatcher.java | 3 +- .../service/notification/EmailDispatcher.java | 9 +- .../notification/NotificationDispatcher.java | 3 +- .../NotificationDispatcherImp.java | 3 +- .../security/AuthorizationManager.java | 0 .../bazaar/service/BazaarRequestParams.java | 0 .../dbis/acis/bazaar/service/TestBase.java | 0 .../bazaar/service/dal/DALFacadeMockImpl.java | 0 .../bazaar/service/dal/DALFacadeTest.java | 0 .../bazaar/service/dal/RepositoryTest.java | 0 .../dbis/acis/bazaar/service/dal/reqbaz.db | Bin .../security/AnonymUserRightsTest.java | 0 .../service/security/SpecialRightsTest.java | 0 .../service/security/SysAdminRightsTest.java | 0 .../bazaar/service/update/UpdateTest.java | 0 settings.gradle | 11 + .../service/dal/jooq/DefaultCatalog.java | 60 -- .../acis/bazaar/service/dal/jooq/Keys.java | 235 ------ .../acis/bazaar/service/dal/jooq/Reqbaz.java | 198 ------ .../acis/bazaar/service/dal/jooq/Tables.java | 137 ---- .../service/dal/jooq/tables/Attachment.java | 182 ----- .../service/dal/jooq/tables/Category.java | 167 ----- .../dal/jooq/tables/CategoryFollowerMap.java | 152 ---- .../service/dal/jooq/tables/Comment.java | 167 ----- .../dal/jooq/tables/PersonalisationData.java | 167 ----- .../service/dal/jooq/tables/Privilege.java | 132 ---- .../service/dal/jooq/tables/Project.java | 172 ----- .../dal/jooq/tables/ProjectFollowerMap.java | 152 ---- .../service/dal/jooq/tables/Requirement.java | 177 ----- .../jooq/tables/RequirementCategoryMap.java | 146 ---- .../jooq/tables/RequirementDeveloperMap.java | 152 ---- .../jooq/tables/RequirementFollowerMap.java | 152 ---- .../bazaar/service/dal/jooq/tables/Role.java | 132 ---- .../dal/jooq/tables/RolePrivilegeMap.java | 146 ---- .../service/dal/jooq/tables/RoleRoleMap.java | 146 ---- .../dal/jooq/tables/SchemaVersion.java | 164 ----- .../bazaar/service/dal/jooq/tables/User.java | 193 ----- .../service/dal/jooq/tables/UserRoleMap.java | 151 ---- .../bazaar/service/dal/jooq/tables/Vote.java | 157 ----- .../jooq/tables/records/AttachmentRecord.java | 503 ------------- .../records/CategoryFollowerMapRecord.java | 257 ------- .../jooq/tables/records/CategoryRecord.java | 380 ---------- .../jooq/tables/records/CommentRecord.java | 380 ---------- .../records/PersonalisationDataRecord.java | 380 ---------- .../jooq/tables/records/PrivilegeRecord.java | 173 ----- .../records/ProjectFollowerMapRecord.java | 257 ------- .../jooq/tables/records/ProjectRecord.java | 421 ----------- .../records/RequirementCategoryMapRecord.java | 214 ------ .../RequirementDeveloperMapRecord.java | 257 ------- .../records/RequirementFollowerMapRecord.java | 257 ------- .../tables/records/RequirementRecord.java | 462 ------------ .../records/RolePrivilegeMapRecord.java | 214 ------ .../dal/jooq/tables/records/RoleRecord.java | 173 ----- .../tables/records/RoleRoleMapRecord.java | 214 ------ .../tables/records/SchemaVersionRecord.java | 503 ------------- .../dal/jooq/tables/records/UserRecord.java | 667 ------------------ .../tables/records/UserRoleMapRecord.java | 255 ------- .../dal/jooq/tables/records/VoteRecord.java | 298 -------- 168 files changed, 780 insertions(+), 10202 deletions(-) delete mode 100755 .classpath create mode 100644 .gitattributes delete mode 100755 .project create mode 100644 gradle.properties create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100755 gradlew create mode 100644 gradlew.bat create mode 100644 requirement_bazaar/build.gradle create mode 100644 requirement_bazaar/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties rename {src => requirement_bazaar/src}/i18n/Translation_de.properties (100%) rename {src => requirement_bazaar/src}/i18n/Translation_en.properties (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/AttachmentsResource.java (98%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/BazaarFunction.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/BazaarFunctionRegistrar.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/BazaarService.java (99%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/CategoryResource.java (98%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/CommentsResource.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java (97%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/UsersResource.java (97%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java (98%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java (95%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java (91%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java (91%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryContributors.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryFollower.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java (91%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java (92%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityBase.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/IdentifiedById.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/Privilege.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java (92%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectContributors.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectFollower.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java (92%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementCategory.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementContributors.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementDeveloper.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementFollower.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/Statistic.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java (89%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/entities/Vote.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/helpers/CreationStatus.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java (92%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/helpers/PaginationResult.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/helpers/UserVote.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepository.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepositoryImpl.java (93%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepository.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepositoryImpl.java (94%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java (95%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java (97%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java (90%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepository.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepositoryImpl.java (94%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepository.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepositoryImpl.java (93%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepository.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepositoryImpl.java (94%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java (90%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java (97%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/Repository.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java (99%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepository.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepositoryImpl.java (92%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepository.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepositoryImpl.java (95%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepository.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepositoryImpl.java (95%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java (92%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java (96%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java (88%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepository.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java (93%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepository.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java (96%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java (94%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryFollowerTransformer.java (92%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java (96%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java (95%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java (91%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeEnumConverter.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java (92%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectFollowerTransformer.java (92%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java (95%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java (94%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java (94%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java (94%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java (97%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java (94%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/transform/Transformer.java (99%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java (96%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java (95%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/exception/BazaarException.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/exception/ErrorCode.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/exception/ExceptionLocation.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/internalization/Localization.java (100%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java (98%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java (97%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcher.java (79%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java (97%) rename {src/main => requirement_bazaar/src/main/java}/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java (100%) rename {src => requirement_bazaar/src}/test/de/rwth/dbis/acis/bazaar/service/BazaarRequestParams.java (100%) rename {src => requirement_bazaar/src}/test/de/rwth/dbis/acis/bazaar/service/TestBase.java (100%) rename {src => requirement_bazaar/src}/test/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeMockImpl.java (100%) rename {src => requirement_bazaar/src}/test/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java (100%) rename {src => requirement_bazaar/src}/test/de/rwth/dbis/acis/bazaar/service/dal/RepositoryTest.java (100%) rename {src => requirement_bazaar/src}/test/de/rwth/dbis/acis/bazaar/service/dal/reqbaz.db (100%) rename {src => requirement_bazaar/src}/test/de/rwth/dbis/acis/bazaar/service/security/AnonymUserRightsTest.java (100%) rename {src => requirement_bazaar/src}/test/de/rwth/dbis/acis/bazaar/service/security/SpecialRightsTest.java (100%) rename {src => requirement_bazaar/src}/test/de/rwth/dbis/acis/bazaar/service/security/SysAdminRightsTest.java (100%) rename {src => requirement_bazaar/src}/test/de/rwth/dbis/acis/bazaar/service/update/UpdateTest.java (100%) create mode 100644 settings.gradle delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/DefaultCatalog.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Keys.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Reqbaz.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Tables.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Attachment.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Category.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/CategoryFollowerMap.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Comment.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/PersonalisationData.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Privilege.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Project.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/ProjectFollowerMap.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Requirement.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementCategoryMap.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementDeveloperMap.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementFollowerMap.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Role.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RolePrivilegeMap.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RoleRoleMap.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/SchemaVersion.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/User.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/UserRoleMap.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Vote.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/AttachmentRecord.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CategoryFollowerMapRecord.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CategoryRecord.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CommentRecord.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/PersonalisationDataRecord.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/PrivilegeRecord.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/ProjectFollowerMapRecord.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/ProjectRecord.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementCategoryMapRecord.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementDeveloperMapRecord.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementFollowerMapRecord.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementRecord.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RolePrivilegeMapRecord.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRecord.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRoleMapRecord.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/SchemaVersionRecord.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRecord.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRoleMapRecord.java delete mode 100644 src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/VoteRecord.java diff --git a/.classpath b/.classpath deleted file mode 100755 index 1641ef18..00000000 --- a/.classpath +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..00a51aff --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +# +# https://help.github.com/articles/dealing-with-line-endings/ +# +# These are explicitly windows files and should use crlf +*.bat text eol=crlf + diff --git a/.gitignore b/.gitignore index 544a6aae..1f419757 100644 --- a/.gitignore +++ b/.gitignore @@ -63,3 +63,8 @@ Temporary Items .apdisk # End of https://www.gitignore.io/api/macos +# Ignore Gradle project-specific cache directory +.gradle + +# Ignore Gradle build output directory +build diff --git a/.project b/.project deleted file mode 100755 index 762f646b..00000000 --- a/.project +++ /dev/null @@ -1,15 +0,0 @@ - - - Requirement Bazaar - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.jdt.core.javanature - - diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000..f09a69b7 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,14 @@ +org.gradle.parallel=true + +service.version=1.0.1 +service.name=RequirementsBazaar + +jooq.version=3.14.4 +mysql.version=8.0.22 + +db.port=3306 +db.hostname=localhost +db.user=root +db.password=rootpw +db.name=reqbaz + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..be52383e --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100755 index 00000000..4f906e0c --- /dev/null +++ b/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 00000000..107acd32 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/requirement_bazaar/build.gradle b/requirement_bazaar/build.gradle new file mode 100644 index 00000000..5d061a05 --- /dev/null +++ b/requirement_bazaar/build.gradle @@ -0,0 +1,155 @@ +/* + * This file was generated by the Gradle 'init' task. + * + * This generated file contains a sample Java application project to get you started. + * For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle + * User Manual available at https://docs.gradle.org/6.7/userguide/building_java_projects.html + */ +buildscript { + configurations["classpath"].resolutionStrategy.eachDependency { + if (requested.group == "org.jooq") { + useVersion("${project.property('jooq.version')}") + } + } +} + +plugins { + // Apply the application plugin to add support for building a CLI application in Java. + id 'java' + id 'application' + id 'idea' + id "org.flywaydb.flyway" version "7.3.2" + id "nu.studer.jooq" version "5.2" +} + +group = 'de.rwth.dbis.acis.bazaar.service' +archivesBaseName = group +version = "0.8.1" +mainClassName = "de.rwth.dbis.acis.bazaar.service.BazaarService" +sourceCompatibility = 14 + +repositories { + // Use JCenter for resolving dependencies. + jcenter() + + // DBIS Archiva + maven { + url "https://archiva.dbis.rwth-aachen.de:9911/repository/internal/" + } +} + +dependencies { + // Use JUnit test framework. + testImplementation 'junit:junit:4.13' + + // las2peer bundle which is not necessary in the runtime path + // compileOnly will be moved into the lib dir afterwards + compileOnly "i5:las2peer-bundle:${project.property('core.version')}" + compileOnly "mysql:mysql-connector-java:${project.property('mysql.version')}" + + // This is for the jooq generation only + jooqGenerator "mysql:mysql-connector-java:${project.property('mysql.version')}" + jooqGenerator "org.jooq:jooq-codegen:${project.property('jooq.version')}" + + // These dependencies are used by the application. + implementation "org.flywaydb:flyway-core:7.3.2" + implementation 'com.google.code.gson:gson:2.8.6' + implementation 'org.apache.commons:commons-pool2:2.9.0' + implementation 'org.apache.commons:commons-dbcp2:2.8.0' + implementation "org.jooq:jooq:${project.property('jooq.version')}" + implementation "org.jooq:jooq-meta:${project.property('jooq.version')}" + implementation 'org.apache.httpcomponents:httpclient:4.5.13' + implementation 'commons-io:commons-io:2.8.0' + implementation 'org.jodd:jodd-vtor:3.6.1' + implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.8.9' + implementation 'com.vdurmont:emoji-java:5.1.1' +} + +configurations { + // This ensures las2peer is available in the tests, but won't be bundled + testCompile.extendsFrom compileOnly +} + +jar { + manifest { + attributes "Main-Class": "de.rwth.dbis.acis.bazaar.service.BazaarService" + attributes "Library-Version": "${project.property('core.version')}" + attributes "Library-SymbolicName": "${project.property('service.name')}" + // attribute "Import-Library": "${service.dependencies}" + } + + from { (configurations.runtimeClasspath).collect { it.isDirectory() ? it : zipTree(it) } } { + // Exclude signatures to be able to natively bundle mqtt + exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA' + } +} + +// These two tasks restore the build and runtime environment used +// in the ant environment +task copyJar(type: Copy) { + from jar // here it automatically reads jar file produced from jar task + into '../service' +} + +// Maybe there is a more idiomatic way to separate out las2peer +task copyToLib(type: Copy) { + from configurations.compileOnly + into "../lib" +} + +build.dependsOn copyJar +build.dependsOn copyToLib + +// Flyway and jooq configuration for database management +jooq { + version = "${project.property('jooq.version')}" + configurations { + main { // name of the jOOQ configuration + generationTool { + logging = org.jooq.meta.jaxb.Logging.WARN + jdbc { + driver = 'com.mysql.cj.jdbc.Driver' + url = "jdbc:mysql://${project.property('db.hostname')}:${project.property('db.port')}/${project.property('db.name')}" + user = "${project.property('db.user')}" + password = "${project.property('db.password')}" + } + generator { + name = 'org.jooq.codegen.DefaultGenerator' + database { + name = 'org.jooq.meta.mysql.MySQLDatabase' + inputSchema = "${project.property('db.name')}" + forcedTypes { + forcedType { + name = 'BOOLEAN' + includeExpression = ".*\\.admin" + } + } + } + generate { + deprecated = false + records = true + immutablePojos = false + fluentSetters = true + } + target { + packageName = 'de.rwth.dbis.acis.bazaar.dal.jooq' + directory = 'build/generated/jooq/main' + } + strategy.name = 'org.jooq.codegen.DefaultGeneratorStrategy' + } + } + } + } +} + +flyway { + url = "jdbc:mysql://${project.property('db.hostname')}:${project.property('db.port')}/${project.property('db.name')}" + user = "${project.property('db.user')}" + password = "${project.property('db.password')}" + schemas = ['reqbaz'] + // Flyway now uses 'flyway_schema_history' to retain compatibility override this + table = 'schema_version' + locations = ["filesystem:$project.projectDir/../etc/migrations"] +} + +generateJooq.dependsOn flywayMigrate diff --git a/requirement_bazaar/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties b/requirement_bazaar/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties new file mode 100644 index 00000000..4420b357 --- /dev/null +++ b/requirement_bazaar/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties @@ -0,0 +1,13 @@ +dbUserName=root +dbPassword=rootpw +dbUrl=jdbc:mysql://localhost:3306/reqbaz +lang=en +country=us +baseURL=http://localhost:8080/bazaar/ +frontendBaseURL=http://localhost:5000/ +activityTrackerService=de.rwth.dbis.acis.activitytracker.service.ActivityTrackerService@0.8.0 +activityOrigin=https://requirements-bazaar.org +smtpServer= +emailFromAddress= +emailSummaryTimePeriodInMinutes= +monitor= \ No newline at end of file diff --git a/src/i18n/Translation_de.properties b/requirement_bazaar/src/i18n/Translation_de.properties similarity index 100% rename from src/i18n/Translation_de.properties rename to requirement_bazaar/src/i18n/Translation_de.properties diff --git a/src/i18n/Translation_en.properties b/requirement_bazaar/src/i18n/Translation_en.properties similarity index 100% rename from src/i18n/Translation_en.properties rename to requirement_bazaar/src/i18n/Translation_en.properties diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/AttachmentsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/AttachmentsResource.java similarity index 98% rename from src/main/de/rwth/dbis/acis/bazaar/service/AttachmentsResource.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/AttachmentsResource.java index 41689dc1..de8161c9 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/AttachmentsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/AttachmentsResource.java @@ -21,6 +21,7 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.net.HttpURLConnection; +import java.time.LocalDateTime; import java.util.*; @@ -79,7 +80,7 @@ public Response getAttachmentsForRequirement(int requirementId, int page, int pe Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); Project project = dalFacade.getProjectById(requirement.getProjectId(), internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_44, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_44, requirement.getId(), Activity.DataType.REQUIREMENT, internalUserId); if (dalFacade.isRequirementPublic(requirementId)) { boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_COMMENT, String.valueOf(project.getId()), dalFacade); @@ -157,7 +158,7 @@ public Response getAttachment(@PathParam("attachmentId") int attachmentId) { Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Attachment attachment = dalFacade.getAttachmentById(attachmentId); Requirement requirement = dalFacade.getRequirementById(attachment.getRequirementId(), internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_49, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_49, attachment.getId(), Activity.DataType.ATTACHMENT, internalUserId); if (dalFacade.isProjectPublic(requirement.getProjectId())) { boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_ATTACHMENT, String.valueOf(requirement.getProjectId()), dalFacade); @@ -285,7 +286,7 @@ public Response deleteAttachment(@PathParam("attachmentId") int attachmentId) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.attachment.modify")); } Attachment deletedAttachment = dalFacade.deleteAttachmentById(attachmentId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.DELETE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_52, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.DELETE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_52, deletedAttachment.getId(), Activity.DataType.ATTACHMENT, internalUserId); return Response.ok(deletedAttachment.toJSON()).build(); } catch (BazaarException bex) { diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/BazaarFunction.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarFunction.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/BazaarFunction.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarFunction.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/BazaarFunctionRegistrar.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarFunctionRegistrar.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/BazaarFunctionRegistrar.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarFunctionRegistrar.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/BazaarService.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java similarity index 99% rename from src/main/de/rwth/dbis/acis/bazaar/service/BazaarService.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java index 92058856..656aea71 100755 --- a/src/main/de/rwth/dbis/acis/bazaar/service/BazaarService.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java @@ -62,6 +62,7 @@ import javax.xml.bind.DatatypeConverter; import java.net.HttpURLConnection; import java.net.URISyntaxException; +import java.time.LocalDateTime; import java.util.*; @@ -247,7 +248,7 @@ public Response getStatistics( Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Calendar sinceCal = since == null ? null : DatatypeConverter.parseDateTime(since); Statistic platformStatistics = dalFacade.getStatisticsForAllProjects(internalUserId, sinceCal); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_2, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_2, 0, Activity.DataType.STATISTIC, internalUserId); return Response.ok(platformStatistics.toJSON()).build(); } catch (BazaarException bex) { diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/CategoryResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java similarity index 98% rename from src/main/de/rwth/dbis/acis/bazaar/service/CategoryResource.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java index bcefdfc2..1f7d6534 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/CategoryResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java @@ -24,6 +24,7 @@ import javax.xml.bind.DatatypeConverter; import java.net.HttpURLConnection; import java.text.MessageFormat; +import java.time.LocalDateTime; import java.util.*; @@ -113,7 +114,7 @@ public Response getCategoriesForProject(int projectId, int page, int perPage, St } } PaginationResult categoriesResult = dalFacade.listCategoriesByProjectId(projectId, pageInfo, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_13, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_13, projectId, Activity.DataType.PROJECT, internalUserId); Map> parameter = new HashMap<>(); parameter.put("page", new ArrayList() {{ @@ -183,7 +184,7 @@ public Response getCategory(@PathParam("categoryId") int categoryId) { dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Category categoryToReturn = dalFacade.getCategoryById(categoryId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_15, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_15, categoryId, Activity.DataType.CATEGORY, internalUserId); if (dalFacade.isCategoryPublic(categoryId)) { boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_CATEGORY, String.valueOf(categoryId), dalFacade); @@ -444,7 +445,7 @@ public Response followCategory(@PathParam("categoryId") int categoryId) { } dalFacade.followCategory(internalUserId, categoryId); Category category = dalFacade.getCategoryById(categoryId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.FOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_19, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.FOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_19, category.getId(), Activity.DataType.CATEGORY, internalUserId); return Response.status(Response.Status.CREATED).entity(category.toJSON()).build(); } catch (BazaarException bex) { @@ -500,7 +501,7 @@ public Response unfollowCategory(@PathParam("categoryId") int categoryId) { } dalFacade.unFollowCategory(internalUserId, categoryId); Category category = dalFacade.getCategoryById(categoryId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.UNFOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_20, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UNFOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_20, category.getId(), Activity.DataType.CATEGORY, internalUserId); return Response.ok(category.toJSON()).build(); } catch (BazaarException bex) { @@ -556,7 +557,7 @@ public Response getStatisticsForCategory( Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Category category = dalFacade.getCategoryById(categoryId, internalUserId); Statistic categoryStatistics = dalFacade.getStatisticsForCategory(internalUserId, categoryId, sinceCal); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_21, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_21, categoryId, Activity.DataType.CATEGORY, internalUserId); return Response.ok(categoryStatistics.toJSON()).build(); } catch (BazaarException bex) { @@ -608,7 +609,7 @@ public Response getContributorsForCategory(@PathParam("categoryId") int category Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Category category = dalFacade.getCategoryById(categoryId, internalUserId); CategoryContributors categoryContributors = dalFacade.listContributorsForCategory(categoryId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_22, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_22, categoryId, Activity.DataType.CATEGORY, internalUserId); return Response.ok(categoryContributors.toJSON()).build(); } catch (BazaarException bex) { @@ -670,7 +671,7 @@ public Response getFollowersForCategory(@PathParam("categoryId") int categoryId, Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Category category = dalFacade.getCategoryById(categoryId, internalUserId); PaginationResult categoryFollowers = dalFacade.listFollowersForCategory(categoryId, pageInfo); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_23, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_23, categoryId, Activity.DataType.CATEGORY, internalUserId); Map> parameter = new HashMap<>(); parameter.put("page", new ArrayList() {{ diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/CommentsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CommentsResource.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/CommentsResource.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CommentsResource.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java similarity index 97% rename from src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java index a34adb78..35315b03 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java @@ -24,6 +24,8 @@ import javax.ws.rs.core.Response; import javax.xml.bind.DatatypeConverter; import java.net.HttpURLConnection; +import java.time.LocalDate; +import java.time.LocalDateTime; import java.util.*; @Api(value = "projects", description = "Projects resource") @@ -129,7 +131,7 @@ public Response getProjects( // return public projects and the ones the user belongs to projectsResult = dalFacade.listPublicAndAuthorizedProjects(pageInfo, internalUserId); } - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, 0, Activity.DataType.PROJECT, internalUserId); Map> parameter = new HashMap<>(); @@ -205,7 +207,7 @@ public Response getProject(@PathParam("projectId") int projectId) { } } Project projectToReturn = dalFacade.getProjectById(projectId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_4, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_4, projectId, Activity.DataType.PROJECT, internalUserId); return Response.ok(projectToReturn.toJSON()).build(); } catch (BazaarException bex) { @@ -265,7 +267,7 @@ public Response createProject(@ApiParam(value = "Project entity", required = tru } projectToCreate.setLeader(dalFacade.getUserById(internalUserId)); Project createdProject = dalFacade.createProject(projectToCreate, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.CREATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_5, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.CREATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_5, createdProject.getId(), Activity.DataType.PROJECT, internalUserId); return Response.status(Response.Status.CREATED).entity(createdProject.toJSON()).build(); } catch (BazaarException bex) { @@ -329,7 +331,7 @@ public Response updateProject(@PathParam("projectId") int projectId, ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, "Id does not match"); } Project updatedProject = dalFacade.modifyProject(projectToUpdate); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_6, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_6, updatedProject.getId(), Activity.DataType.PROJECT, internalUserId); return Response.ok(updatedProject.toJSON()).build(); } catch (BazaarException bex) { @@ -385,7 +387,7 @@ public Response followProject(@PathParam("projectId") int projectId) { } dalFacade.followProject(internalUserId, projectId); Project project = dalFacade.getProjectById(projectId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.FOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_8, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.FOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_8, projectId, Activity.DataType.PROJECT, internalUserId); return Response.status(Response.Status.CREATED).entity(project.toJSON()).build(); } catch (BazaarException bex) { @@ -441,7 +443,7 @@ public Response unfollowProject(@PathParam("projectId") int projectId) { } dalFacade.unFollowProject(internalUserId, projectId); Project project = dalFacade.getProjectById(projectId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.UNFOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_9, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UNFOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_9, projectId, Activity.DataType.PROJECT, internalUserId); return Response.ok(project.toJSON()).build(); } catch (BazaarException bex) { @@ -496,7 +498,7 @@ public Response getStatisticsForProject( Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Calendar sinceCal = since == null ? null : DatatypeConverter.parseDateTime(since); Statistic projectStatistics = dalFacade.getStatisticsForProject(internalUserId, projectId, sinceCal); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_10, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_10, projectId, Activity.DataType.PROJECT, internalUserId); return Response.ok(projectStatistics.toJSON()).build(); } catch (BazaarException bex) { @@ -547,7 +549,7 @@ public Response getContributorsForProject(@PathParam("projectId") int projectId) dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); ProjectContributors projectContributors = dalFacade.listContributorsForProject(projectId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_11, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_11, projectId, Activity.DataType.PROJECT, internalUserId); return Response.ok(projectContributors.toJSON()).build(); } catch (BazaarException bex) { @@ -608,7 +610,7 @@ public Response getFollowersForProject(@PathParam("projectId") int projectId, dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); PaginationResult projectFollowers = dalFacade.listFollowersForProject(projectId, pageInfo); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_12, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_12, projectId, Activity.DataType.PROJECT, internalUserId); Map> parameter = new HashMap<>(); diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/UsersResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/UsersResource.java similarity index 97% rename from src/main/de/rwth/dbis/acis/bazaar/service/UsersResource.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/UsersResource.java index da4143a1..9d130aed 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/UsersResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/UsersResource.java @@ -22,6 +22,7 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.net.HttpURLConnection; +import java.time.LocalDateTime; import java.util.*; @@ -81,7 +82,7 @@ public Response getUser(@PathParam("userId") int userId) { } dalFacade = bazaarService.getDBConnection(); User user = dalFacade.getUserById(userId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_53, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_53, userId, Activity.DataType.USER, userId); return Response.ok(user.toJSON()).build(); @@ -132,7 +133,7 @@ public Response getActiveUser() { dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); User user = dalFacade.getUserById(internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_54, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_54, internalUserId, Activity.DataType.USER, internalUserId); return Response.ok(user.toJSON()).build(); @@ -196,7 +197,7 @@ public Response updateUser(@PathParam("userId") int userId, "UserId is not identical with user sending this request."); } User updatedUser = dalFacade.modifyUser(userToUpdate); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_56, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_56, userId, Activity.DataType.USER, internalUserId); return Response.ok(updatedUser.toJSON()).build(); } catch (BazaarException bex) { @@ -278,7 +279,7 @@ public Response getEntityOverview( EntityOverview result = dalFacade.getEntitiesForUser(include, pageInfo, internalUserId); // Wrong SERVICE_CUSTOM_MESSAGE_3 ? - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, 0, Activity.DataType.USER, internalUserId); diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java similarity index 98% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index ef462206..b4c89220 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -38,6 +38,7 @@ import javax.sql.DataSource; import java.sql.Timestamp; +import java.time.LocalDateTime; import java.util.Calendar; import java.util.HashMap; import java.util.List; @@ -87,7 +88,8 @@ public DSLContext getDslContext() { @Override public void close() { - dslContext.close(); + // No longer necessary, jooq claims gc will take care of it + // dslContext.close(); } @Override @@ -230,14 +232,14 @@ public boolean isProjectPublic(int projectId) throws BazaarException { public Statistic getStatisticsForAllProjects(int userId, Calendar since) throws BazaarException { projectRepository = (projectRepository != null) ? projectRepository : new ProjectRepositoryImpl(dslContext); Timestamp timestamp = since == null ? new java.sql.Timestamp(0) : new java.sql.Timestamp(since.getTimeInMillis()); - return projectRepository.getStatisticsForVisibleProjects(userId, timestamp); + return projectRepository.getStatisticsForVisibleProjects(userId, timestamp.toLocalDateTime()); } @Override public Statistic getStatisticsForProject(int userId, int projectId, Calendar since) throws BazaarException { projectRepository = (projectRepository != null) ? projectRepository : new ProjectRepositoryImpl(dslContext); Timestamp timestamp = since == null ? new java.sql.Timestamp(0) : new java.sql.Timestamp(since.getTimeInMillis()); - return projectRepository.getStatisticsForProject(userId, projectId, timestamp); + return projectRepository.getStatisticsForProject(userId, projectId, timestamp.toLocalDateTime()); } @Override @@ -332,7 +334,7 @@ public Requirement deleteRequirementById(int requirementId, int userId) throws E @Override public Requirement setRequirementToRealized(int requirementId, int userId) throws Exception { requirementRepository = (requirementRepository != null) ? requirementRepository : new RequirementRepositoryImpl(dslContext); - requirementRepository.setRealized(requirementId, new java.sql.Timestamp(Calendar.getInstance().getTime().getTime())); + requirementRepository.setRealized(requirementId, LocalDateTime.now()); return getRequirementById(requirementId, userId); } @@ -367,7 +369,7 @@ public boolean isRequirementPublic(int requirementId) throws BazaarException { public Statistic getStatisticsForRequirement(int userId, int requirementId, Calendar since) throws BazaarException { requirementRepository = (requirementRepository != null) ? requirementRepository : new RequirementRepositoryImpl(dslContext); Timestamp timestamp = since == null ? new java.sql.Timestamp(0) : new java.sql.Timestamp(since.getTimeInMillis()); - return requirementRepository.getStatisticsForRequirement(userId, requirementId, timestamp); + return requirementRepository.getStatisticsForRequirement(userId, requirementId, timestamp.toLocalDateTime()); } @Override @@ -434,7 +436,7 @@ public boolean isCategoryPublic(int categoryId) throws BazaarException { public Statistic getStatisticsForCategory(int userId, int categoryId, Calendar since) throws BazaarException { categoryRepository = (categoryRepository != null) ? categoryRepository : new CategoryRepositoryImpl(dslContext); Timestamp timestamp = since == null ? new java.sql.Timestamp(0) : new java.sql.Timestamp(since.getTimeInMillis()); - return categoryRepository.getStatisticsForCategory(userId, categoryId, timestamp); + return categoryRepository.getStatisticsForCategory(userId, categoryId, timestamp.toLocalDateTime()); } @Override diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java similarity index 95% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java index a678e2b8..ddaa33b2 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnore; +import java.time.LocalDateTime; import java.util.Date; public class Activity extends EntityBase { @@ -11,7 +12,7 @@ public class Activity extends EntityBase { private final transient int id; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") - private final Date creationDate; + private final LocalDateTime creationDate; private final ActivityAction activityAction; private final String dataUrl; private final DataType dataType; @@ -47,7 +48,7 @@ public int getId() { return id; } - public Date getCreationDate() { + public LocalDateTime getCreationDate() { return creationDate; } @@ -118,7 +119,7 @@ public enum ActivityAction { public static class Builder { protected int id; - protected Date creationDate; + protected LocalDateTime creationDate; protected ActivityAction activityAction; protected String dataUrl; protected DataType dataType; @@ -129,7 +130,7 @@ public static class Builder { protected String origin; protected AdditionalObject additionalObject; - public Builder creationDate(Date creationDate) { + public Builder creationDate(LocalDateTime creationDate) { this.creationDate = creationDate; return this; } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java similarity index 91% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java index 64aafb5b..2486025b 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java @@ -26,6 +26,7 @@ import jodd.vtor.constraint.NotBlank; import jodd.vtor.constraint.NotNull; +import java.time.LocalDateTime; import java.util.Date; public class Attachment extends EntityBase { @@ -59,11 +60,11 @@ public class Attachment extends EntityBase { private User creator; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") - private Date creationDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + private LocalDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") - private Date lastUpdatedDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + private LocalDateTime lastUpdatedDate; public Attachment() { } @@ -121,11 +122,11 @@ public String getFileUrl() { return fileUrl; } - public Date getCreationDate() { + public LocalDateTime getCreationDate() { return creationDate; } - public Date getLastUpdatedDate() { + public LocalDateTime getLastUpdatedDate() { return lastUpdatedDate; } @@ -149,8 +150,8 @@ public static class Builder { private String mimeType; private String identifier; private String fileUrl; - private Date creationDate; - private Date lastUpdatedDate; + private LocalDateTime creationDate; + private LocalDateTime lastUpdatedDate; User creator; public Builder id(int id) { @@ -188,12 +189,12 @@ public Builder fileUrl(String fileUrl) { return this; } - public Builder creationDate(Date creationDate) { + public Builder creationDate(LocalDateTime creationDate) { this.creationDate = creationDate; return this; } - public Builder lastUpdatedDate(Date lastUpdatedDate) { + public Builder lastUpdatedDate(LocalDateTime lastUpdatedDate) { this.lastUpdatedDate = lastUpdatedDate; return this; } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java similarity index 91% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java index 638d6fd7..bf900709 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java @@ -28,6 +28,7 @@ import jodd.vtor.constraint.NotBlank; import jodd.vtor.constraint.NotNull; +import java.time.LocalDateTime; import java.util.Date; /** @@ -52,11 +53,11 @@ public class Category extends EntityBase { private User leader; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") - private Date creationDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + private LocalDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") - private Date lastUpdatedDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + private LocalDateTime lastUpdatedDate; private Integer numberOfRequirements; private Integer numberOfFollowers; @@ -99,11 +100,11 @@ public int getProjectId() { return projectId; } - public Date getCreationDate() { + public LocalDateTime getCreationDate() { return creationDate; } - public Date getLastUpdatedDate() { + public LocalDateTime getLastUpdatedDate() { return lastUpdatedDate; } @@ -162,8 +163,8 @@ public static class Builder { private int id; private String description; private String name; - private Date creationDate; - private Date lastUpdatedDate; + private LocalDateTime creationDate; + private LocalDateTime lastUpdatedDate; private int projectId; private Boolean isFollower; @@ -196,12 +197,12 @@ public Builder projectId(int projectId) { return this; } - public Builder creationDate(Date creationDate) { + public Builder creationDate(LocalDateTime creationDate) { this.creationDate = creationDate; return this; } - public Builder lastUpdatedDate(Date lastUpdatedDate) { + public Builder lastUpdatedDate(LocalDateTime lastUpdatedDate) { this.lastUpdatedDate = lastUpdatedDate; return this; } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryContributors.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryContributors.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryContributors.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryContributors.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryFollower.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryFollower.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryFollower.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryFollower.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java similarity index 91% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java index d90fdc52..801ef19b 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java @@ -27,6 +27,7 @@ import jodd.vtor.constraint.NotBlank; import jodd.vtor.constraint.NotNull; +import java.time.LocalDateTime; import java.util.Date; /** @@ -48,11 +49,11 @@ public class Comment extends EntityBase { private User creator; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") - private Date creationDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + private LocalDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") - private Date lastUpdatedDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + private LocalDateTime lastUpdatedDate; @JsonProperty("_context") private EntityContext context; @@ -92,11 +93,11 @@ public Integer getReplyToComment() { return replyToComment; } - public Date getCreationDate() { + public LocalDateTime getCreationDate() { return creationDate; } - public Date getLastUpdatedDate() { + public LocalDateTime getLastUpdatedDate() { return lastUpdatedDate; } @@ -125,8 +126,8 @@ public static class Builder { private String message; private int requirementId; private Integer replyToComment; - Date creationDate; - Date lastUpdatedDate; + LocalDateTime creationDate; + LocalDateTime lastUpdatedDate; User creator; EntityContext context; /* private Project project; @@ -153,12 +154,12 @@ public Builder replyToComment(Integer replyToComment) { return this; } - public Builder creationDate(Date creationDate) { + public Builder creationDate(LocalDateTime creationDate) { this.creationDate = creationDate; return this; } - public Builder lastUpdatedDate(Date lastUpdatedDate) { + public Builder lastUpdatedDate(LocalDateTime lastUpdatedDate) { this.lastUpdatedDate = lastUpdatedDate; return this; } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java similarity index 92% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java index 5731eaba..7f61dddf 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java @@ -1,6 +1,7 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; +import java.time.LocalDateTime; import java.util.Date; import java.util.Set; @@ -14,7 +15,7 @@ public class Email extends EntityBase { private final String message; private final String closing; private final String footer; - private final Date creationDate; + private final LocalDateTime creationDate; protected Email(Builder builder) { id = builder.id; @@ -55,7 +56,7 @@ public String getFooter() { return footer; } - public Date getCreationDate() { + public LocalDateTime getCreationDate() { return creationDate; } @@ -76,7 +77,7 @@ public static class Builder { private String message; private String closing; private String footer; - private Date creationDate; + private LocalDateTime creationDate; public Builder() { @@ -122,7 +123,7 @@ public Builder footer(String footer) { return this; } - public Builder creationDate(Date creationDate) { + public Builder creationDate(LocalDateTime creationDate) { this.creationDate = creationDate; return this; } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityBase.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityBase.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityBase.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityBase.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/IdentifiedById.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/IdentifiedById.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/IdentifiedById.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/IdentifiedById.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Privilege.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Privilege.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Privilege.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Privilege.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java similarity index 92% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java index a792942b..1e441f78 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java @@ -26,6 +26,7 @@ import jodd.vtor.constraint.NotBlank; import jodd.vtor.constraint.NotNull; +import java.time.LocalDateTime; import java.util.Date; /** @@ -51,11 +52,11 @@ public class Project extends EntityBase { private User leader; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") - private Date creationDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + private LocalDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") - private Date lastUpdatedDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + private LocalDateTime lastUpdatedDate; private Integer numberOfCategories; private Integer numberOfRequirements; @@ -96,11 +97,11 @@ public int getId() { return id; } - public Date getCreationDate() { + public LocalDateTime getCreationDate() { return creationDate; } - public Date getLastUpdatedDate() { + public LocalDateTime getLastUpdatedDate() { return lastUpdatedDate; } @@ -180,8 +181,8 @@ public static class Builder { private String name; private Boolean visibility; private User leader; - private Date creationDate; - private Date lastUpdatedDate; + private LocalDateTime creationDate; + private LocalDateTime lastUpdatedDate; private Integer defaultCategoryId; private Boolean isFollower; @@ -219,12 +220,12 @@ public Builder isFollower(Boolean isFollower) { return this; } - public Builder creationDate(Date creationDate) { + public Builder creationDate(LocalDateTime creationDate) { this.creationDate = creationDate; return this; } - public Builder lastUpdatedDate(Date lastUpdatedDate) { + public Builder lastUpdatedDate(LocalDateTime lastUpdatedDate) { this.lastUpdatedDate = lastUpdatedDate; return this; } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectContributors.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectContributors.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectContributors.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectContributors.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectFollower.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectFollower.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectFollower.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectFollower.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java similarity index 92% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java index fa767dec..f044ebba 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java @@ -6,6 +6,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.helpers.UserVote; import jodd.vtor.constraint.*; +import java.time.LocalDateTime; import java.util.Date; import java.util.List; @@ -25,8 +26,8 @@ public class Requirement extends EntityBase { @NotNull(profiles = {"create"}) private String description; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") - private Date realized; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + private LocalDateTime realized; @Min(value = 0, profiles = {"create"}) private int projectId; @@ -42,11 +43,11 @@ public class Requirement extends EntityBase { // But the API still allows to create a requirement with attachments at the same time. private List attachments; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") - private Date creationDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + private LocalDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") - private Date lastUpdatedDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + private LocalDateTime lastUpdatedDate; private Integer numberOfComments; private Integer numberOfAttachments; @@ -95,15 +96,15 @@ public static Builder getBuilder(String name) { return new Builder(name); } - public Date getRealized() { + public LocalDateTime getRealized() { return realized; } - public Date getCreationDate() { + public LocalDateTime getCreationDate() { return creationDate; } - public Date getLastUpdatedDate() { + public LocalDateTime getLastUpdatedDate() { return lastUpdatedDate; } @@ -231,10 +232,10 @@ public static class Builder { private int id; private String description; private String name; - private Date realized; + private LocalDateTime realized; private int projectId; - private Date creationDate; - private Date lastUpdatedDate; + private LocalDateTime creationDate; + private LocalDateTime lastUpdatedDate; private int upVotes; private int downVotes; private UserVote userVoted; @@ -281,17 +282,17 @@ public Builder projectId(int projectId) { return this; } - public Builder realized(Date realized) { + public Builder realized(LocalDateTime realized) { this.realized = realized; return this; } - public Builder creationDate(Date creationDate) { + public Builder creationDate(LocalDateTime creationDate) { this.creationDate = creationDate; return this; } - public Builder lastUpdatedDate(Date lastUpdatedDate) { + public Builder lastUpdatedDate(LocalDateTime lastUpdatedDate) { this.lastUpdatedDate = lastUpdatedDate; return this; } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementCategory.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementCategory.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementCategory.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementCategory.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementContributors.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementContributors.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementContributors.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementContributors.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementDeveloper.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementDeveloper.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementDeveloper.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementDeveloper.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementFollower.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementFollower.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementFollower.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementFollower.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Statistic.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Statistic.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Statistic.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Statistic.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java similarity index 89% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java index 47331a0a..4e9bd5b0 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java @@ -28,6 +28,7 @@ import jodd.vtor.constraint.NotBlank; import jodd.vtor.constraint.NotNull; +import java.time.LocalDateTime; import java.util.Date; public class User extends EntityBase { @@ -63,14 +64,14 @@ public class User extends EntityBase { private Boolean personalizationEnabled; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") - private Date creationDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + private LocalDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") - private Date lastUpdatedDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + private LocalDateTime lastUpdatedDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") - private Date lastLoginDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + private LocalDateTime lastLoginDate; public User() { } @@ -135,15 +136,15 @@ public Boolean isEmailFollowSubscription() { public Boolean isPersonalizationEnabled(){ return personalizationEnabled; } - public Date getCreationDate() { + public LocalDateTime getCreationDate() { return creationDate; } - public Date getLastUpdatedDate() { + public LocalDateTime getLastUpdatedDate() { return lastUpdatedDate; } - public Date getLastLoginDate() { + public LocalDateTime getLastLoginDate() { return lastLoginDate; } @@ -169,9 +170,9 @@ public static class Builder { private Boolean emailLeadSubscription; private Boolean emailFollowSubscription; private Boolean personalizationEnabled; - private Date creationDate; - private Date lastUpdatedDate; - private Date lastLoginDate; + private LocalDateTime creationDate; + private LocalDateTime lastUpdatedDate; + private LocalDateTime lastLoginDate; public Builder(String eMail) { @@ -228,17 +229,17 @@ public Builder emailFollowSubscription(Boolean emailFollowSubscription) { return this; } - public Builder creationDate(Date creationDate) { + public Builder creationDate(LocalDateTime creationDate) { this.creationDate = creationDate; return this; } - public Builder lastUpdatedDate(Date lastUpdatedDate) { + public Builder lastUpdatedDate(LocalDateTime lastUpdatedDate) { this.lastUpdatedDate = lastUpdatedDate; return this; } - public Builder lastLoginDate(Date lastLoginDate) { + public Builder lastLoginDate(LocalDateTime lastLoginDate) { this.lastLoginDate = lastLoginDate; return this; } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Vote.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Vote.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Vote.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Vote.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/CreationStatus.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/CreationStatus.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/CreationStatus.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/CreationStatus.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java similarity index 92% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java index 0b773d3a..cea5fdc8 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java @@ -8,9 +8,9 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.EntityContext; import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; import de.rwth.dbis.acis.bazaar.service.dal.entities.Requirement; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CategoryRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.ProjectRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CategoryRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.ProjectRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementRecord; import de.rwth.dbis.acis.bazaar.service.dal.repositories.UserRepositoryImpl; import de.rwth.dbis.acis.bazaar.service.dal.transform.CategoryTransformer; import de.rwth.dbis.acis.bazaar.service.dal.transform.ProjectTransformer; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/PaginationResult.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PaginationResult.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/PaginationResult.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PaginationResult.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/UserVote.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/UserVote.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/helpers/UserVote.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/UserVote.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepository.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepository.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepository.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepositoryImpl.java similarity index 93% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepositoryImpl.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepositoryImpl.java index 276a149c..8fdfe658 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepositoryImpl.java @@ -23,8 +23,8 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.Attachment; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.AttachmentRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.UserRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.AttachmentRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.UserRecord; import de.rwth.dbis.acis.bazaar.service.dal.transform.AttachmentTransformer; import de.rwth.dbis.acis.bazaar.service.dal.transform.UserTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; @@ -39,7 +39,7 @@ import java.util.ArrayList; import java.util.List; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.*; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; /** * @author Adam Gavronek @@ -58,7 +58,7 @@ public AttachmentRepositoryImpl(DSLContext jooq) { public Attachment findById(int id) throws Exception { Attachment attachment = null; try { - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User creatorUser = USER.as("creatorUser"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User creatorUser = USER.as("creatorUser"); Record record = jooq.selectFrom(ATTACHMENT .join(creatorUser).on(creatorUser.ID.equal(ATTACHMENT.USER_ID))) .where(transformer.getTableId().equal(id)) @@ -84,7 +84,7 @@ public PaginationResult findAllByRequirementId(int requirementId, Pa List attachments; try { attachments = new ArrayList<>(); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User creatorUser = USER.as("creatorUser"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User creatorUser = USER.as("creatorUser"); Field idCount = jooq.selectCount() .from(ATTACHMENT) diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepository.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepository.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepository.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepositoryImpl.java similarity index 94% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepositoryImpl.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepositoryImpl.java index 416778ae..5aecc70f 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepositoryImpl.java @@ -2,7 +2,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.CategoryFollower; import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreationStatus; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CategoryFollowerMapRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CategoryFollowerMapRecord; import de.rwth.dbis.acis.bazaar.service.dal.transform.CategoryFollowerTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; @@ -11,7 +11,7 @@ import org.jooq.DSLContext; import org.jooq.exception.DataAccessException; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.CATEGORY_FOLLOWER_MAP; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.CATEGORY_FOLLOWER_MAP; public class CategoryFollowerRepositoryImpl extends RepositoryImpl implements CategoryFollowerRepository { diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java similarity index 95% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java index b47be9b9..4aa516f7 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java @@ -27,6 +27,7 @@ import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import java.sql.Timestamp; +import java.time.LocalDateTime; import java.util.List; /** @@ -47,5 +48,5 @@ public interface CategoryRepository extends Repository { boolean belongsToPublicProject(int id) throws BazaarException; - Statistic getStatisticsForCategory(int userId, int categoryId, Timestamp timestamp) throws BazaarException; + Statistic getStatisticsForCategory(int userId, int categoryId, LocalDateTime timestamp) throws BazaarException; } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java similarity index 97% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java index 7a3d20af..872ab0f5 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java @@ -24,8 +24,8 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.Statistic; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CategoryRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.UserRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CategoryRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.UserRecord; import de.rwth.dbis.acis.bazaar.service.dal.transform.CategoryTransformer; import de.rwth.dbis.acis.bazaar.service.dal.transform.UserTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; @@ -33,14 +33,16 @@ import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionLocation; import org.jooq.*; +import org.jooq.Record; import org.jooq.exception.DataAccessException; import org.jooq.impl.DSL; import java.sql.Timestamp; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.*; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; import static org.jooq.impl.DSL.*; public class CategoryRepositoryImpl extends RepositoryImpl implements CategoryRepository { @@ -113,7 +115,7 @@ public CategoryRepositoryImpl(DSLContext jooq) { public Category findById(int id, int userId) throws BazaarException { Category category = null; try { - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); Field isFollower = DSL.select(DSL.count()) .from(CATEGORY_FOLLOWER_MAP) @@ -170,7 +172,7 @@ public PaginationResult findByProjectId(int projectId, Pageable pageab List categories; try { categories = new ArrayList<>(); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); Field idCount = jooq.selectCount() .from(CATEGORY) @@ -226,7 +228,7 @@ public PaginationResult findAll(Pageable pageable, int userId) throws List categories; try { categories = new ArrayList<>(); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); Field idCount = jooq.selectCount() .from(CATEGORY) @@ -316,7 +318,7 @@ public PaginationResult findByRequirementId(int requirementId, Pageabl List categories; try { categories = new ArrayList<>(); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); Field idCount = jooq.selectCount() .from(CATEGORY) @@ -382,7 +384,7 @@ public boolean belongsToPublicProject(int id) throws BazaarException { } @Override - public Statistic getStatisticsForCategory(int userId, int categoryId, Timestamp timestamp) throws BazaarException { + public Statistic getStatisticsForCategory(int userId, int categoryId, LocalDateTime timestamp) throws BazaarException { Statistic result = null; try { // If you want to change something here, please know what you are doing! Its SQL and even worse JOOQ :-| diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java similarity index 90% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java index 57b18ea2..34c370b9 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java @@ -24,8 +24,8 @@ import de.rwth.dbis.acis.bazaar.service.dal.helpers.EntityContextFactory; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.*; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.User; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.*; import de.rwth.dbis.acis.bazaar.service.dal.transform.*; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; @@ -40,7 +40,7 @@ import java.util.ArrayList; import java.util.List; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.*; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; public class CommentRepositoryImpl extends RepositoryImpl implements CommentRepository { @@ -59,8 +59,8 @@ public PaginationResult findAllAnswers(Pageable pageable, int userId) t List comments; try { comments = new ArrayList<>(); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User creatorUser = USER.as("creatorUser"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment SUB_COMMENTS = COMMENT.as("sub_comments"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User creatorUser = USER.as("creatorUser"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.Comment SUB_COMMENTS = COMMENT.as("sub_comments"); Field idCount = jooq.selectCount() .from(COMMENT) @@ -115,10 +115,10 @@ public PaginationResult findAllComments(Pageable pageable) throws Bazaa List comments; try { comments = new ArrayList<>(); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User creatorUser = USER.as("creatorUser"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Requirement requirement = REQUIREMENT.as("requirement"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Category category = CATEGORY.as("category"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Project project = PROJECT.as("project"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User creatorUser = USER.as("creatorUser"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.Requirement requirement = REQUIREMENT.as("requirement"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.Category category = CATEGORY.as("category"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.Project project = PROJECT.as("project"); Field idCount = jooq.selectCount() .from(COMMENT) @@ -168,8 +168,8 @@ public PaginationResult f List comments; try { comments = new ArrayList<>(); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User creatorUser = USER.as("creatorUser"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment childComment = COMMENT.as("childComment"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User creatorUser = USER.as("creatorUser"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.Comment childComment = COMMENT.as("childComment"); User childCommentCreatorUser = USER.as("childCommentCreatorUser"); Field idCount = jooq.selectCount() @@ -211,7 +211,7 @@ public PaginationResult f } - private Comment convertToCommentWithUser(Record record, de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User creatorUser) { + private Comment convertToCommentWithUser(Record record, de.rwth.dbis.acis.bazaar.dal.jooq.tables.User creatorUser) { CommentRecord commentRecord = record.into(CommentRecord.class); Comment entry = transformer.getEntityFromTableRecord(commentRecord); UserTransformer userTransformer = new UserTransformer(); @@ -220,7 +220,7 @@ private Comment convertToCommentWithUser(Record record, de.rwth.dbis.acis.bazaar return entry; } - private Comment convertToCommentWithUser(Record record, de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment comment, de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User creatorUser) { + private Comment convertToCommentWithUser(Record record, de.rwth.dbis.acis.bazaar.dal.jooq.tables.Comment comment, de.rwth.dbis.acis.bazaar.dal.jooq.tables.User creatorUser) { CommentRecord commentRecord = record.into(comment); Comment entry = transformer.getEntityFromTableRecord(commentRecord); UserTransformer userTransformer = new UserTransformer(); diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepository.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepository.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepository.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepositoryImpl.java similarity index 94% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepositoryImpl.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepositoryImpl.java index 07ca709d..887f0403 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepositoryImpl.java @@ -3,7 +3,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.PersonalisationData; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.PersonalisationDataRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.PersonalisationDataRecord; import de.rwth.dbis.acis.bazaar.service.dal.transform.PersonalisationDataTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; @@ -14,7 +14,7 @@ import org.jooq.exception.DataAccessException; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.*; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; public class PersonalisationDataRepositoryImpl extends RepositoryImpl implements PersonalisationDataRepository { diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepository.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepository.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepository.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepositoryImpl.java similarity index 93% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepositoryImpl.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepositoryImpl.java index 779983aa..d1441533 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepositoryImpl.java @@ -21,7 +21,7 @@ package de.rwth.dbis.acis.bazaar.service.dal.repositories; import de.rwth.dbis.acis.bazaar.service.dal.entities.Privilege; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.PrivilegeRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.PrivilegeRecord; import de.rwth.dbis.acis.bazaar.service.dal.transform.PrivilegeTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; @@ -29,7 +29,7 @@ import de.rwth.dbis.acis.bazaar.service.exception.ExceptionLocation; import org.jooq.DSLContext; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.PRIVILEGE; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.PRIVILEGE; /** * @author Adam Gavronek diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepository.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepository.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepository.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepositoryImpl.java similarity index 94% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepositoryImpl.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepositoryImpl.java index cf44aab6..4d1cb4a9 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepositoryImpl.java @@ -2,7 +2,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.ProjectFollower; import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreationStatus; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.ProjectFollowerMapRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.ProjectFollowerMapRecord; import de.rwth.dbis.acis.bazaar.service.dal.transform.ProjectFollowerTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; @@ -11,7 +11,7 @@ import org.jooq.DSLContext; import org.jooq.exception.DataAccessException; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.PROJECT_FOLLOWER_MAP; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.PROJECT_FOLLOWER_MAP; public class ProjectFollowerRepositoryImpl extends RepositoryImpl implements ProjectFollowerRepository { diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java similarity index 90% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java index 723a7b95..f6bdb6db 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java @@ -28,6 +28,7 @@ import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import java.sql.Timestamp; +import java.time.LocalDateTime; import java.util.List; /** @@ -44,9 +45,9 @@ public interface ProjectRepository extends Repository { boolean belongsToPublicProject(int id) throws BazaarException; - Statistic getStatisticsForVisibleProjects(int userId, Timestamp timestamp) throws BazaarException; + Statistic getStatisticsForVisibleProjects(int userId, LocalDateTime timestamp) throws BazaarException; - Statistic getStatisticsForProject(int userId, int projectId, Timestamp timestamp) throws BazaarException; + Statistic getStatisticsForProject(int userId, int projectId, LocalDateTime timestamp) throws BazaarException; List listAllProjectIds(Pageable pageable, int userId) throws BazaarException; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java similarity index 97% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java index 850b5ab0..d0259d78 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java @@ -25,8 +25,8 @@ import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.ProjectRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.UserRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.ProjectRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.UserRecord; import de.rwth.dbis.acis.bazaar.service.dal.transform.ProjectTransformer; import de.rwth.dbis.acis.bazaar.service.dal.transform.UserTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; @@ -34,13 +34,15 @@ import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionLocation; import org.jooq.*; +import org.jooq.Record; import org.jooq.exception.DataAccessException; import org.jooq.impl.DSL; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.*; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; import static org.jooq.impl.DSL.*; /** @@ -121,7 +123,7 @@ public ProjectRepositoryImpl(DSLContext jooq) { public Project findById(int id, int userId) throws BazaarException { Project project = null; try { - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); Field isFollower = DSL.select(DSL.count()) .from(PROJECT_FOLLOWER_MAP) @@ -181,7 +183,7 @@ public PaginationResult findAllPublic(Pageable pageable, int userId) th List projects; try { projects = new ArrayList<>(); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); Field idCount = jooq.selectCount() .from(PROJECT) @@ -240,7 +242,7 @@ public PaginationResult findAllPublicAndAuthorized(Pageable pageable, i List projects; try { projects = new ArrayList<>(); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); Field idCount = jooq.selectCount() .from(PROJECT) @@ -338,7 +340,7 @@ public boolean belongsToPublicProject(int id) throws BazaarException { } @Override - public Statistic getStatisticsForVisibleProjects(int userId, java.sql.Timestamp timestamp) throws BazaarException { + public Statistic getStatisticsForVisibleProjects(int userId, LocalDateTime timestamp) throws BazaarException { Statistic result = null; try { // If you want to change something here, please know what you are doing! Its SQL and even worse JOOQ :-| @@ -396,7 +398,7 @@ public Statistic getStatisticsForVisibleProjects(int userId, java.sql.Timestamp } @Override - public Statistic getStatisticsForProject(int userId, int projectId, java.sql.Timestamp timestamp) throws BazaarException { + public Statistic getStatisticsForProject(int userId, int projectId, LocalDateTime timestamp) throws BazaarException { Statistic result = null; try { // If you want to change something here, please know what you are doing! Its SQL and even worse JOOQ :-| diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/Repository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/Repository.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/Repository.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/Repository.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java similarity index 99% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java index ec73409d..3a61c3d6 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java @@ -28,6 +28,7 @@ import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionLocation; import org.jooq.*; +import org.jooq.Record; import org.jooq.exception.DataAccessException; import java.util.ArrayList; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepository.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepository.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepository.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepositoryImpl.java similarity index 92% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepositoryImpl.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepositoryImpl.java index 3b94b683..7c212503 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepositoryImpl.java @@ -21,7 +21,7 @@ package de.rwth.dbis.acis.bazaar.service.dal.repositories; import de.rwth.dbis.acis.bazaar.service.dal.entities.RequirementCategory; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementCategoryMapRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementCategoryMapRecord; import de.rwth.dbis.acis.bazaar.service.dal.transform.RequirementCategoryTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; @@ -30,7 +30,7 @@ import org.jooq.DSLContext; import org.jooq.exception.DataAccessException; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.REQUIREMENT_CATEGORY_MAP; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.REQUIREMENT_CATEGORY_MAP; /** * @author Adam Gavronek diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepository.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepository.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepository.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepositoryImpl.java similarity index 95% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepositoryImpl.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepositoryImpl.java index 6d56606e..f88a7819 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepositoryImpl.java @@ -22,7 +22,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.RequirementDeveloper; import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreationStatus; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementDeveloperMapRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementDeveloperMapRecord; import de.rwth.dbis.acis.bazaar.service.dal.transform.RequirementDeveloperTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; @@ -31,7 +31,7 @@ import org.jooq.DSLContext; import org.jooq.exception.DataAccessException; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.REQUIREMENT_DEVELOPER_MAP; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.REQUIREMENT_DEVELOPER_MAP; /** * @author Adam Gavronek diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepository.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepository.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepository.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepositoryImpl.java similarity index 95% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepositoryImpl.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepositoryImpl.java index 99749390..352f2b67 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepositoryImpl.java @@ -22,7 +22,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.RequirementFollower; import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreationStatus; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementFollowerMapRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementFollowerMapRecord; import de.rwth.dbis.acis.bazaar.service.dal.transform.RequirementFollowerTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; @@ -31,7 +31,7 @@ import org.jooq.DSLContext; import org.jooq.exception.DataAccessException; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.REQUIREMENT_FOLLOWER_MAP; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.REQUIREMENT_FOLLOWER_MAP; /** * @author Adam Gavronek diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java similarity index 92% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java index 6d0df499..1fdff573 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java @@ -27,6 +27,7 @@ import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import java.sql.Timestamp; +import java.time.LocalDateTime; import java.util.List; public interface RequirementRepository extends Repository { @@ -44,11 +45,11 @@ public interface RequirementRepository extends Repository { Requirement findById(int id, int userId) throws Exception; Requirement findById(int id, int userId, List embed) throws Exception; - void setRealized(int id, Timestamp realized) throws BazaarException; + void setRealized(int id, LocalDateTime realized) throws BazaarException; void setLeadDeveloper(int id, Integer userId) throws BazaarException; - Statistic getStatisticsForRequirement(int userId, int requirementId, Timestamp timestamp) throws BazaarException; + Statistic getStatisticsForRequirement(int userId, int requirementId, LocalDateTime timestamp) throws BazaarException; } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java similarity index 96% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java index 7eb6abfc..9aed75c5 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java @@ -28,9 +28,9 @@ import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; import de.rwth.dbis.acis.bazaar.service.dal.helpers.UserVote; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CategoryRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.ProjectRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CategoryRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.ProjectRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementRecord; import de.rwth.dbis.acis.bazaar.service.dal.transform.CategoryTransformer; import de.rwth.dbis.acis.bazaar.service.dal.transform.ProjectTransformer; import de.rwth.dbis.acis.bazaar.service.dal.transform.RequirementTransformer; @@ -40,17 +40,19 @@ import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionLocation; import org.jooq.*; +import org.jooq.Record; import org.jooq.exception.DataAccessException; import org.jooq.impl.DSL; import java.math.BigDecimal; import java.sql.Timestamp; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Calendar; import java.util.List; import java.util.Map; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.*; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; import static org.jooq.impl.DSL.*; public class RequirementRepositoryImpl extends RepositoryImpl implements RequirementRepository { @@ -327,10 +329,10 @@ public Requirement findById(int id, int userId) throws Exception { public Requirement findById(int id, int userId, List embed) throws Exception { Requirement requirement = null; try { - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User creatorUser = USER.as("creatorUser"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User leadDeveloperUser = USER.as("leadDeveloperUser"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Vote vote = VOTE.as("vote"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Vote userVote = VOTE.as("userVote"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User creatorUser = USER.as("creatorUser"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User leadDeveloperUser = USER.as("leadDeveloperUser"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.Vote vote = VOTE.as("vote"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.Vote userVote = VOTE.as("userVote"); Field isFollower = DSL.select(DSL.count()) .from(REQUIREMENT_FOLLOWER_MAP) @@ -465,11 +467,11 @@ public Requirement findById(int id, int userId, List embed) throws Excep } @Override - public void setRealized(int id, Timestamp realized) throws BazaarException { + public void setRealized(int id, LocalDateTime realized) throws BazaarException { try { jooq.update(REQUIREMENT) .set(REQUIREMENT.REALIZED, realized) - .set(REQUIREMENT.LAST_UPDATED_DATE, new java.sql.Timestamp(Calendar.getInstance().getTime().getTime())) + .set(REQUIREMENT.LAST_UPDATED_DATE, LocalDateTime.now()) .where(REQUIREMENT.ID.eq(id)) .execute(); } catch (Exception e) { @@ -482,7 +484,7 @@ public void setLeadDeveloper(int id, Integer userId) throws BazaarException { try { jooq.update(REQUIREMENT) .set(REQUIREMENT.LEAD_DEVELOPER_ID, userId) - .set(REQUIREMENT.LAST_UPDATED_DATE, new java.sql.Timestamp(Calendar.getInstance().getTime().getTime())) + .set(REQUIREMENT.LAST_UPDATED_DATE, LocalDateTime.now()) .where(REQUIREMENT.ID.eq(id)) .execute(); } catch (Exception e) { @@ -491,7 +493,7 @@ public void setLeadDeveloper(int id, Integer userId) throws BazaarException { } @Override - public Statistic getStatisticsForRequirement(int userId, int requirementId, Timestamp timestamp) throws BazaarException { + public Statistic getStatisticsForRequirement(int userId, int requirementId, LocalDateTime timestamp) throws BazaarException { Statistic result = null; try { // If you want to change something here, please know what you are doing! Its SQL and even worse JOOQ :-| diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java similarity index 88% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java index ac9935bf..5d5c4ef3 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java @@ -22,8 +22,8 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.Privilege; import de.rwth.dbis.acis.bazaar.service.dal.entities.Role; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RoleRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.UserRoleMapRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RoleRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.UserRoleMapRecord; import de.rwth.dbis.acis.bazaar.service.dal.transform.PrivilegeEnumConverter; import de.rwth.dbis.acis.bazaar.service.dal.transform.RoleTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; @@ -38,7 +38,7 @@ import java.util.List; import java.util.Map; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.*; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; /** * @author Adam Gavronek @@ -54,8 +54,8 @@ public List listRolesOfUser(int userId, String context) throws BazaarExcep List roles = null; try { - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Role roleTable = ROLE.as("role"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Privilege privilegeTable = PRIVILEGE.as("privilege"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.Role roleTable = ROLE.as("role"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.Privilege privilegeTable = PRIVILEGE.as("privilege"); Result queryResult = jooq.selectFrom( USER_ROLE_MAP @@ -110,8 +110,8 @@ public List listParentsForRole(int roleId) throws BazaarException { List roles = null; try { - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Role roleTable = ROLE.as("role"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Privilege privilegeTable = PRIVILEGE.as("privilege"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.Role roleTable = ROLE.as("role"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.Privilege privilegeTable = PRIVILEGE.as("privilege"); Result queryResult = jooq.selectFrom( ROLE_ROLE_MAP @@ -131,8 +131,8 @@ public List listParentsForRole(int roleId) throws BazaarException { return roles; } - private void convertToRoles(List roles, de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Role roleTable, - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Privilege privilegeTable, Result queryResult) { + private void convertToRoles(List roles, de.rwth.dbis.acis.bazaar.dal.jooq.tables.Role roleTable, + de.rwth.dbis.acis.bazaar.dal.jooq.tables.Privilege privilegeTable, Result queryResult) { for (Map.Entry> entry : queryResult.intoGroups(roleTable.ID).entrySet()) { if (entry.getKey() == null) continue; Result records = entry.getValue(); diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepository.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepository.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepository.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java similarity index 93% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java index 25e00f85..11417b08 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java @@ -26,7 +26,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.User; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.UserRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.UserRecord; import de.rwth.dbis.acis.bazaar.service.dal.transform.UserTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; @@ -39,12 +39,13 @@ import org.jooq.Record; import org.jooq.Result; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Calendar; import java.util.List; import java.util.Map; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.*; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; /** * @author Adam Gavronek @@ -109,7 +110,7 @@ public void updateLas2peerId(int userId, String las2PeerId) throws BazaarExcepti @Override public void updateLastLoginDate(int userId) throws Exception { try { - jooq.update(USER).set(USER.LAST_LOGIN_DATE, new java.sql.Timestamp(Calendar.getInstance().getTime().getTime())) + jooq.update(USER).set(USER.LAST_LOGIN_DATE, LocalDateTime.now()) .where(USER.ID.equal(userId)) .execute(); } catch (Exception e) { @@ -121,11 +122,11 @@ public void updateLastLoginDate(int userId) throws Exception { public RequirementContributors findRequirementContributors(int requirementId) throws BazaarException { RequirementContributors contributors = null; try { - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User creator = USER.as("creator"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User leadDeveloper = USER.as("leadDeveloper"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User developer = USER.as("developer"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User commentCreator = USER.as("commentCreator"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User attachmentCreator = USER.as("attachmentCreator"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User creator = USER.as("creator"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User leadDeveloper = USER.as("leadDeveloper"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User developer = USER.as("developer"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User commentCreator = USER.as("commentCreator"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User attachmentCreator = USER.as("attachmentCreator"); Result queryResult = jooq.select(REQUIREMENT.fields()) .select(creator.fields()) @@ -204,12 +205,12 @@ public RequirementContributors findRequirementContributors(int requirementId) th public CategoryContributors findCategoryContributors(int categoryId) throws BazaarException { CategoryContributors contributors = null; try { - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User leader = USER.as("leader"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User requirementCreator = USER.as("requirementCreator"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User leadDeveloper = USER.as("leadDeveloper"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User developer = USER.as("developer"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User commentCreator = USER.as("commentCreator"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User attachmentCreator = USER.as("attachmentCreator"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User leader = USER.as("leader"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User requirementCreator = USER.as("requirementCreator"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User leadDeveloper = USER.as("leadDeveloper"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User developer = USER.as("developer"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User commentCreator = USER.as("commentCreator"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User attachmentCreator = USER.as("attachmentCreator"); Result queryResult = jooq.select(CATEGORY.fields()) .select(leader.fields()) @@ -309,13 +310,13 @@ public CategoryContributors findCategoryContributors(int categoryId) throws Baza public ProjectContributors findProjectContributors(int projectId) throws BazaarException { ProjectContributors contributors = null; try { - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User leader = USER.as("leader"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User categoryLeader = USER.as("categoryLeader"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User requirementCreator = USER.as("requirementCreator"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User leadDeveloper = USER.as("leadDeveloper"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User developer = USER.as("developer"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User commentCreator = USER.as("commentCreator"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User attachmentCreator = USER.as("attachmentCreator"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User leader = USER.as("leader"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User categoryLeader = USER.as("categoryLeader"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User requirementCreator = USER.as("requirementCreator"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User leadDeveloper = USER.as("leadDeveloper"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User developer = USER.as("developer"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User commentCreator = USER.as("commentCreator"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User attachmentCreator = USER.as("attachmentCreator"); Result queryResult = jooq.select(PROJECT.fields()) .select(leader.fields()) diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepository.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepository.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepository.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java similarity index 96% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java index 55a0cf5c..58fd40b5 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java @@ -22,7 +22,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.Vote; import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreationStatus; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.VoteRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.VoteRecord; import de.rwth.dbis.acis.bazaar.service.dal.transform.VoteTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; @@ -36,7 +36,7 @@ import java.util.Map; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.VOTE; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.VOTE; /** * @author Adam Gavronek diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java similarity index 94% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java index 12039e68..96ba77fc 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java @@ -23,13 +23,14 @@ import com.vdurmont.emoji.EmojiParser; import de.rwth.dbis.acis.bazaar.service.dal.entities.Attachment; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.AttachmentRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.AttachmentRecord; import org.jooq.*; import java.sql.Timestamp; +import java.time.LocalDateTime; import java.util.*; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.ATTACHMENT; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.ATTACHMENT; public class AttachmentTransformer implements Transformer { @@ -46,7 +47,7 @@ public AttachmentRecord createRecord(Attachment entity) { record.setMimeType(entity.getMimeType()); record.setIdentifier(entity.getIdentifier()); record.setFileUrl(entity.getFileUrl()); - record.setCreationDate(new Timestamp(Calendar.getInstance().getTime().getTime())); + record.setCreationDate(LocalDateTime.now()); return record; } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryFollowerTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryFollowerTransformer.java similarity index 92% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryFollowerTransformer.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryFollowerTransformer.java index 4315be8d..a8655ef6 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryFollowerTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryFollowerTransformer.java @@ -2,12 +2,12 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.CategoryFollower; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CategoryFollowerMapRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CategoryFollowerMapRecord; import org.jooq.*; import java.util.*; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.CATEGORY_FOLLOWER_MAP; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.CATEGORY_FOLLOWER_MAP; public class CategoryFollowerTransformer implements Transformer { @Override diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java similarity index 96% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java index 70fb85e2..17159045 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java @@ -23,15 +23,16 @@ import com.vdurmont.emoji.EmojiParser; import de.rwth.dbis.acis.bazaar.service.dal.entities.Category; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CategoryRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CategoryRecord; import de.rwth.dbis.acis.bazaar.service.dal.repositories.CategoryRepositoryImpl; import org.jooq.*; import org.jooq.impl.DSL; +import java.time.LocalDateTime; import java.util.*; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.CATEGORY; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.CATEGORY_FOLLOWER_MAP; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.CATEGORY; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.CATEGORY_FOLLOWER_MAP; /** * @author Adam Gavronek @@ -47,7 +48,7 @@ public CategoryRecord createRecord(Category entry) { record.setName(entry.getName()); record.setProjectId(entry.getProjectId()); record.setLeaderId(entry.getLeader().getId()); - record.setCreationDate(new java.sql.Timestamp(Calendar.getInstance().getTime().getTime())); + record.setCreationDate(LocalDateTime.now()); return record; } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java similarity index 95% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java index a1f29597..dcf091bb 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java @@ -23,15 +23,16 @@ import com.vdurmont.emoji.EmojiParser; import de.rwth.dbis.acis.bazaar.service.dal.entities.Comment; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CommentRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CommentRecord; import de.rwth.dbis.acis.bazaar.service.dal.repositories.ProjectRepositoryImpl; import org.jooq.*; import org.jooq.impl.DSL; import java.sql.Timestamp; +import java.time.LocalDateTime; import java.util.*; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.*; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; /** * @author Adam Gavronek @@ -47,7 +48,7 @@ public CommentRecord createRecord(Comment entity) { record.setMessage(entity.getMessage()); record.setRequirementId(entity.getRequirementId()); record.setReplyToCommentId(entity.getReplyToComment()); - record.setCreationDate(new Timestamp(Calendar.getInstance().getTime().getTime())); + record.setCreationDate(LocalDateTime.now()); return record; } @@ -173,8 +174,8 @@ public Collection getFilterConditions(Map f }else if(filterEntry.getKey().equals("replies")) { - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment SUB_COMMENTS = COMMENT.as("sub_comments"); - de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment IN_COMMENTS = COMMENT.as("in_comments"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.Comment SUB_COMMENTS = COMMENT.as("sub_comments"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.Comment IN_COMMENTS = COMMENT.as("in_comments"); conditions.add( COMMENT.ID.in( DSL.select(IN_COMMENTS.ID) diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java similarity index 91% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java index f8326dc8..bd742faf 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java @@ -23,14 +23,14 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.PersonalisationData; import de.rwth.dbis.acis.bazaar.service.dal.entities.Vote; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.PersonalisationDataRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.VoteRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.PersonalisationDataRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.VoteRecord; import org.jooq.*; import java.util.*; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.PERSONALISATION_DATA; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.VOTE; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.PERSONALISATION_DATA; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.VOTE; /** * @author Adam Gavronek diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeEnumConverter.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeEnumConverter.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeEnumConverter.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeEnumConverter.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java similarity index 92% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java index 5596213b..340b4cdb 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java @@ -22,13 +22,13 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.Privilege; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.PrivilegeRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.PrivilegeRecord; import org.jooq.*; import java.util.*; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.PRIVILEGE; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.ROLE; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.PRIVILEGE; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.ROLE; /** * @author Adam Gavronek diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectFollowerTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectFollowerTransformer.java similarity index 92% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectFollowerTransformer.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectFollowerTransformer.java index c0bb5a68..7a36635c 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectFollowerTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectFollowerTransformer.java @@ -2,12 +2,12 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.ProjectFollower; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.ProjectFollowerMapRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.ProjectFollowerMapRecord; import org.jooq.*; import java.util.*; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.PROJECT_FOLLOWER_MAP; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.PROJECT_FOLLOWER_MAP; public class ProjectFollowerTransformer implements Transformer { diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java similarity index 95% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java index 61ed0b6a..7215190d 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java @@ -23,18 +23,19 @@ import com.vdurmont.emoji.EmojiParser; import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.ProjectRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.ProjectRecord; import de.rwth.dbis.acis.bazaar.service.dal.repositories.ProjectRepositoryImpl; import org.jooq.*; import org.jooq.impl.DSL; +import java.time.LocalDateTime; import java.util.*; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.REQUIREMENT; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.PROJECT; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.*; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.REQUIREMENT; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.PROJECT; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; public class ProjectTransformer implements Transformer { @@ -48,7 +49,7 @@ public ProjectRecord createRecord(Project entry) { record.setLeaderId(entry.getLeader().getId()); record.setVisibility((byte) (entry.getVisibility() ? 1 : 0)); record.setDefaultCategoryId(entry.getDefaultCategoryId()); - record.setCreationDate(new java.sql.Timestamp(Calendar.getInstance().getTime().getTime())); + record.setCreationDate(LocalDateTime.now()); return record; } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java similarity index 94% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java index a30b9d46..b2731f93 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java @@ -22,12 +22,12 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.RequirementCategory; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementCategoryMapRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementCategoryMapRecord; import org.jooq.*; import java.util.*; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.REQUIREMENT_CATEGORY_MAP; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.REQUIREMENT_CATEGORY_MAP; /** * @author Adam Gavronek diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java similarity index 94% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java index c28ce74a..8f7f9590 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java @@ -22,12 +22,12 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.RequirementDeveloper; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementDeveloperMapRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementDeveloperMapRecord; import org.jooq.*; import java.util.*; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.REQUIREMENT_DEVELOPER_MAP; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.REQUIREMENT_DEVELOPER_MAP; /** * @author Adam Gavronek diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java similarity index 94% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java index 68057046..e9685281 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java @@ -22,12 +22,12 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.RequirementFollower; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementFollowerMapRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementFollowerMapRecord; import org.jooq.*; import java.util.*; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.REQUIREMENT_FOLLOWER_MAP; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.REQUIREMENT_FOLLOWER_MAP; /** * @author Adam Gavronek diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java similarity index 97% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java index 43b27727..62502ef6 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java @@ -23,14 +23,15 @@ import com.vdurmont.emoji.EmojiParser; import de.rwth.dbis.acis.bazaar.service.dal.entities.Requirement; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementRecord; import de.rwth.dbis.acis.bazaar.service.dal.repositories.RequirementRepositoryImpl; import org.jooq.*; import org.jooq.impl.DSL; +import java.time.LocalDateTime; import java.util.*; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.*; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; public class RequirementTransformer implements Transformer { @Override @@ -40,7 +41,7 @@ public RequirementRecord createRecord(Requirement entry) { RequirementRecord record = new RequirementRecord(); record.setDescription(entry.getDescription()); record.setName(entry.getName()); - record.setCreationDate(new java.sql.Timestamp(Calendar.getInstance().getTime().getTime())); + record.setCreationDate(LocalDateTime.now()); record.setCreatorId(entry.getCreator().getId()); record.setProjectId(entry.getProjectId()); return record; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java similarity index 94% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java index e10c160b..00a88883 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java @@ -22,12 +22,12 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.Role; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RoleRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RoleRecord; import org.jooq.*; import java.util.*; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.ROLE; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.ROLE; /** * @author Adam Gavronek diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/Transformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/Transformer.java similarity index 99% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/Transformer.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/Transformer.java index ddc1d08c..1016ac7d 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/Transformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/Transformer.java @@ -22,6 +22,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import org.jooq.*; +import org.jooq.Record; import java.util.Collection; import java.util.List; diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java similarity index 96% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java index b466e2b9..f07c0aa0 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java @@ -22,12 +22,13 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.User; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.UserRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.UserRecord; import org.jooq.*; +import org.jooq.Record; import java.util.*; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.USER; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.USER; public class UserTransformer implements Transformer { @Override @@ -67,7 +68,7 @@ public User getEntityFromTableRecord(UserRecord record) { .build(); } - public User getEntityFromQueryResult(de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User user, Result queryResult) { + public User getEntityFromQueryResult(de.rwth.dbis.acis.bazaar.dal.jooq.tables.User user, Result queryResult) { return User.getBuilder(queryResult.getValues(user.EMAIL).get(0)) .id(queryResult.getValues(user.ID).get(0)) .admin(queryResult.getValues(user.ADMIN).get(0)) diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java similarity index 95% rename from src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java index d2777ec7..87e3908a 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java @@ -22,12 +22,12 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.Vote; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.VoteRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.VoteRecord; import org.jooq.*; import java.util.*; -import static de.rwth.dbis.acis.bazaar.service.dal.jooq.Tables.VOTE; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.VOTE; /** * @author Adam Gavronek diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/exception/BazaarException.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/BazaarException.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/exception/BazaarException.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/BazaarException.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/exception/ErrorCode.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ErrorCode.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/exception/ErrorCode.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ErrorCode.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/exception/ExceptionLocation.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionLocation.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/exception/ExceptionLocation.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionLocation.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/internalization/Localization.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/internalization/Localization.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/internalization/Localization.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/internalization/Localization.java diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java similarity index 98% rename from src/main/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java index 30f0ef18..7a32f0b9 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java @@ -15,6 +15,7 @@ import i5.las2peer.logging.L2pLogger; import javax.ws.rs.core.Response; +import java.time.LocalDateTime; import java.util.Date; /** @@ -37,7 +38,7 @@ public ActivityDispatcher(BazaarService bazaarService, String activityTrackerSer this.frontendBaseURL = frontendBaseURL; } - public void sendActivityOverRMI(Date creationDate, Activity.ActivityAction activityAction, + public void sendActivityOverRMI(LocalDateTime creationDate, Activity.ActivityAction activityAction, int dataId, Activity.DataType dataType, int userId, Activity.AdditionalObject additionalObject) { DALFacade dalFacade; try { diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java similarity index 97% rename from src/main/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java index c7b7c2cb..2c6cc9b2 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java @@ -11,6 +11,7 @@ import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; +import java.time.LocalDateTime; import java.util.*; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -39,7 +40,7 @@ public EmailDispatcher(BazaarService bazaarService, String smtpServer, String em this.emailSummaryTimePeriodInMinutes = emailSummaryTimePeriodInMinutes; } - public void addEmailNotification(Date creationDate, Activity.ActivityAction activityAction, + public void addEmailNotification(LocalDateTime creationDate, Activity.ActivityAction activityAction, int dataId, Activity.DataType dataType, int userId, Activity.AdditionalObject additionalObject) { DALFacade dalFacade; try { @@ -88,7 +89,7 @@ public void addEmailNotification(Date creationDate, Activity.ActivityAction acti } } - private Email generateEmail(List recipients, Date creationDate, Activity.ActivityAction activityAction, + private Email generateEmail(List recipients, LocalDateTime creationDate, Activity.ActivityAction activityAction, int dataId, Activity.DataType dataType, Activity.AdditionalObject additionalObject) throws Exception { DALFacade dalFacade = bazaarService.getDBConnection(); String subject = new String(); @@ -243,7 +244,7 @@ public void emptyNotificationSummery() { emailBuilder.message(message); emailBuilder.closing(closing); emailBuilder.footer(footer); - emailBuilder.creationDate(new Date()); + emailBuilder.creationDate(LocalDateTime.now()); Email summary = emailBuilder.build(); sendEmail(summary); @@ -278,7 +279,7 @@ private void sendEmail(Email mail) { text = text.concat(mail.getFooter()); mailMessage.setText(text); mailMessage.setHeader("X-Mailer", "msgsend"); - mailMessage.setSentDate(mail.getCreationDate()); + mailMessage.setSentDate(java.sql.Timestamp.valueOf(mail.getCreationDate())); Transport.send(mailMessage); diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcher.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcher.java similarity index 79% rename from src/main/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcher.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcher.java index bfa3e1d4..ebd4db92 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcher.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcher.java @@ -4,13 +4,14 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.Activity; import i5.las2peer.api.logging.MonitoringEvent; +import java.time.LocalDateTime; import java.util.Date; /** * Created by martin on 15.02.2016. */ public interface NotificationDispatcher extends Runnable { - void dispatchNotification(Date creationDate, Activity.ActivityAction activityAction, final MonitoringEvent mobSOSEvent, + void dispatchNotification(LocalDateTime creationDate, Activity.ActivityAction activityAction, final MonitoringEvent mobSOSEvent, int dataId, Activity.DataType dataType, int userId); void setBazaarService(BazaarService service); diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java similarity index 97% rename from src/main/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java index 9863dc61..9e60dc8b 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java @@ -13,6 +13,7 @@ import i5.las2peer.api.logging.MonitoringEvent; import i5.las2peer.logging.L2pLogger; +import java.time.LocalDateTime; import java.util.Date; import java.util.TimerTask; @@ -40,7 +41,7 @@ public void setEmailDispatcher(EmailDispatcher emailDispatcher) { } @Override - public void dispatchNotification(final Date creationDate, final Activity.ActivityAction activityAction, final MonitoringEvent mobSOSEvent, + public void dispatchNotification(final LocalDateTime creationDate, final Activity.ActivityAction activityAction, final MonitoringEvent mobSOSEvent, final int dataId, final Activity.DataType dataType, final int userId) { // Filters to generate JSON elements diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java similarity index 100% rename from src/main/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java diff --git a/src/test/de/rwth/dbis/acis/bazaar/service/BazaarRequestParams.java b/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/BazaarRequestParams.java similarity index 100% rename from src/test/de/rwth/dbis/acis/bazaar/service/BazaarRequestParams.java rename to requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/BazaarRequestParams.java diff --git a/src/test/de/rwth/dbis/acis/bazaar/service/TestBase.java b/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/TestBase.java similarity index 100% rename from src/test/de/rwth/dbis/acis/bazaar/service/TestBase.java rename to requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/TestBase.java diff --git a/src/test/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeMockImpl.java b/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeMockImpl.java similarity index 100% rename from src/test/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeMockImpl.java rename to requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeMockImpl.java diff --git a/src/test/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java b/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java similarity index 100% rename from src/test/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java rename to requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java diff --git a/src/test/de/rwth/dbis/acis/bazaar/service/dal/RepositoryTest.java b/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/dal/RepositoryTest.java similarity index 100% rename from src/test/de/rwth/dbis/acis/bazaar/service/dal/RepositoryTest.java rename to requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/dal/RepositoryTest.java diff --git a/src/test/de/rwth/dbis/acis/bazaar/service/dal/reqbaz.db b/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/dal/reqbaz.db similarity index 100% rename from src/test/de/rwth/dbis/acis/bazaar/service/dal/reqbaz.db rename to requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/dal/reqbaz.db diff --git a/src/test/de/rwth/dbis/acis/bazaar/service/security/AnonymUserRightsTest.java b/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/security/AnonymUserRightsTest.java similarity index 100% rename from src/test/de/rwth/dbis/acis/bazaar/service/security/AnonymUserRightsTest.java rename to requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/security/AnonymUserRightsTest.java diff --git a/src/test/de/rwth/dbis/acis/bazaar/service/security/SpecialRightsTest.java b/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/security/SpecialRightsTest.java similarity index 100% rename from src/test/de/rwth/dbis/acis/bazaar/service/security/SpecialRightsTest.java rename to requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/security/SpecialRightsTest.java diff --git a/src/test/de/rwth/dbis/acis/bazaar/service/security/SysAdminRightsTest.java b/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/security/SysAdminRightsTest.java similarity index 100% rename from src/test/de/rwth/dbis/acis/bazaar/service/security/SysAdminRightsTest.java rename to requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/security/SysAdminRightsTest.java diff --git a/src/test/de/rwth/dbis/acis/bazaar/service/update/UpdateTest.java b/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/update/UpdateTest.java similarity index 100% rename from src/test/de/rwth/dbis/acis/bazaar/service/update/UpdateTest.java rename to requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/update/UpdateTest.java diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 00000000..f07b0d00 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,11 @@ +/* + * This file was generated by the Gradle 'init' task. + * + * The settings file is used to specify which projects to include in your build. + * + * Detailed information about configuring a multi-project build in Gradle can be found + * in the user manual at https://docs.gradle.org/6.7/userguide/multi_project_builds.html + */ + +rootProject.name = 'Requirement Bazaar' +include('requirement_bazaar') diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/DefaultCatalog.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/DefaultCatalog.java deleted file mode 100644 index 8494890d..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/DefaultCatalog.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq; - - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Generated; - -import org.jooq.Schema; -import org.jooq.impl.CatalogImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class DefaultCatalog extends CatalogImpl { - - private static final long serialVersionUID = 617773064; - - /** - * The reference instance of - */ - public static final DefaultCatalog DEFAULT_CATALOG = new DefaultCatalog(); - - /** - * The schema reqbaz. - */ - public final Reqbaz REQBAZ = de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz.REQBAZ; - - /** - * No further instances allowed - */ - private DefaultCatalog() { - super(""); - } - - @Override - public final List getSchemas() { - List result = new ArrayList(); - result.addAll(getSchemas0()); - return result; - } - - private final List getSchemas0() { - return Arrays.asList( - Reqbaz.REQBAZ); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Keys.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Keys.java deleted file mode 100644 index 0b079402..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Keys.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Attachment; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Category; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.CategoryFollowerMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.PersonalisationData; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Privilege; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Project; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.ProjectFollowerMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Requirement; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementCategoryMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementDeveloperMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementFollowerMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Role; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RolePrivilegeMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RoleRoleMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.SchemaVersion; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.UserRoleMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Vote; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.AttachmentRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CategoryFollowerMapRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CategoryRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CommentRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.PersonalisationDataRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.PrivilegeRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.ProjectFollowerMapRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.ProjectRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementCategoryMapRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementDeveloperMapRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementFollowerMapRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RolePrivilegeMapRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RoleRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RoleRoleMapRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.SchemaVersionRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.UserRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.UserRoleMapRecord; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.VoteRecord; - -import javax.annotation.Generated; - -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.UniqueKey; -import org.jooq.impl.AbstractKeys; - - -/** - * A class modelling foreign key relationships between tables of the reqbaz - * schema - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class Keys { - - // ------------------------------------------------------------------------- - // IDENTITY definitions - // ------------------------------------------------------------------------- - - public static final Identity IDENTITY_ATTACHMENT = Identities0.IDENTITY_ATTACHMENT; - public static final Identity IDENTITY_CATEGORY = Identities0.IDENTITY_CATEGORY; - public static final Identity IDENTITY_CATEGORY_FOLLOWER_MAP = Identities0.IDENTITY_CATEGORY_FOLLOWER_MAP; - public static final Identity IDENTITY_COMMENT = Identities0.IDENTITY_COMMENT; - public static final Identity IDENTITY_PERSONALISATION_DATA = Identities0.IDENTITY_PERSONALISATION_DATA; - public static final Identity IDENTITY_PRIVILEGE = Identities0.IDENTITY_PRIVILEGE; - public static final Identity IDENTITY_PROJECT = Identities0.IDENTITY_PROJECT; - public static final Identity IDENTITY_PROJECT_FOLLOWER_MAP = Identities0.IDENTITY_PROJECT_FOLLOWER_MAP; - public static final Identity IDENTITY_REQUIREMENT = Identities0.IDENTITY_REQUIREMENT; - public static final Identity IDENTITY_REQUIREMENT_CATEGORY_MAP = Identities0.IDENTITY_REQUIREMENT_CATEGORY_MAP; - public static final Identity IDENTITY_REQUIREMENT_DEVELOPER_MAP = Identities0.IDENTITY_REQUIREMENT_DEVELOPER_MAP; - public static final Identity IDENTITY_REQUIREMENT_FOLLOWER_MAP = Identities0.IDENTITY_REQUIREMENT_FOLLOWER_MAP; - public static final Identity IDENTITY_ROLE = Identities0.IDENTITY_ROLE; - public static final Identity IDENTITY_ROLE_PRIVILEGE_MAP = Identities0.IDENTITY_ROLE_PRIVILEGE_MAP; - public static final Identity IDENTITY_ROLE_ROLE_MAP = Identities0.IDENTITY_ROLE_ROLE_MAP; - public static final Identity IDENTITY_USER = Identities0.IDENTITY_USER; - public static final Identity IDENTITY_USER_ROLE_MAP = Identities0.IDENTITY_USER_ROLE_MAP; - public static final Identity IDENTITY_VOTE = Identities0.IDENTITY_VOTE; - - // ------------------------------------------------------------------------- - // UNIQUE and PRIMARY KEY definitions - // ------------------------------------------------------------------------- - - public static final UniqueKey KEY_ATTACHMENT_PRIMARY = UniqueKeys0.KEY_ATTACHMENT_PRIMARY; - public static final UniqueKey KEY_CATEGORY_PRIMARY = UniqueKeys0.KEY_CATEGORY_PRIMARY; - public static final UniqueKey KEY_CATEGORY_FOLLOWER_MAP_PRIMARY = UniqueKeys0.KEY_CATEGORY_FOLLOWER_MAP_PRIMARY; - public static final UniqueKey KEY_COMMENT_PRIMARY = UniqueKeys0.KEY_COMMENT_PRIMARY; - public static final UniqueKey KEY_PERSONALISATION_DATA_PRIMARY = UniqueKeys0.KEY_PERSONALISATION_DATA_PRIMARY; - public static final UniqueKey KEY_PERSONALISATION_DATA_PERSONALISATION_KEY = UniqueKeys0.KEY_PERSONALISATION_DATA_PERSONALISATION_KEY; - public static final UniqueKey KEY_PRIVILEGE_PRIMARY = UniqueKeys0.KEY_PRIVILEGE_PRIMARY; - public static final UniqueKey KEY_PROJECT_PRIMARY = UniqueKeys0.KEY_PROJECT_PRIMARY; - public static final UniqueKey KEY_PROJECT_FOLLOWER_MAP_PRIMARY = UniqueKeys0.KEY_PROJECT_FOLLOWER_MAP_PRIMARY; - public static final UniqueKey KEY_REQUIREMENT_PRIMARY = UniqueKeys0.KEY_REQUIREMENT_PRIMARY; - public static final UniqueKey KEY_REQUIREMENT_CATEGORY_MAP_PRIMARY = UniqueKeys0.KEY_REQUIREMENT_CATEGORY_MAP_PRIMARY; - public static final UniqueKey KEY_REQUIREMENT_DEVELOPER_MAP_PRIMARY = UniqueKeys0.KEY_REQUIREMENT_DEVELOPER_MAP_PRIMARY; - public static final UniqueKey KEY_REQUIREMENT_FOLLOWER_MAP_PRIMARY = UniqueKeys0.KEY_REQUIREMENT_FOLLOWER_MAP_PRIMARY; - public static final UniqueKey KEY_ROLE_PRIMARY = UniqueKeys0.KEY_ROLE_PRIMARY; - public static final UniqueKey KEY_ROLE_ROLE_IDX_1 = UniqueKeys0.KEY_ROLE_ROLE_IDX_1; - public static final UniqueKey KEY_ROLE_PRIVILEGE_MAP_PRIMARY = UniqueKeys0.KEY_ROLE_PRIVILEGE_MAP_PRIMARY; - public static final UniqueKey KEY_ROLE_ROLE_MAP_PRIMARY = UniqueKeys0.KEY_ROLE_ROLE_MAP_PRIMARY; - public static final UniqueKey KEY_SCHEMA_VERSION_PRIMARY = UniqueKeys0.KEY_SCHEMA_VERSION_PRIMARY; - public static final UniqueKey KEY_USER_PRIMARY = UniqueKeys0.KEY_USER_PRIMARY; - public static final UniqueKey KEY_USER_ROLE_MAP_PRIMARY = UniqueKeys0.KEY_USER_ROLE_MAP_PRIMARY; - public static final UniqueKey KEY_VOTE_PRIMARY = UniqueKeys0.KEY_VOTE_PRIMARY; - - // ------------------------------------------------------------------------- - // FOREIGN KEY definitions - // ------------------------------------------------------------------------- - - public static final ForeignKey ATTACHMENT_REQUIREMENT = ForeignKeys0.ATTACHMENT_REQUIREMENT; - public static final ForeignKey ATTACHMENT_USER = ForeignKeys0.ATTACHMENT_USER; - public static final ForeignKey CATEGORY_PROJECT = ForeignKeys0.CATEGORY_PROJECT; - public static final ForeignKey CATEGORY_USER = ForeignKeys0.CATEGORY_USER; - public static final ForeignKey CATEGORY_FOLLOWER_MAP_CATEGORY = ForeignKeys0.CATEGORY_FOLLOWER_MAP_CATEGORY; - public static final ForeignKey CATEGORY_FOLLOWER_MAP_USER = ForeignKeys0.CATEGORY_FOLLOWER_MAP_USER; - public static final ForeignKey COMMENT_REQUIREMENT = ForeignKeys0.COMMENT_REQUIREMENT; - public static final ForeignKey COMMENT_USER = ForeignKeys0.COMMENT_USER; - public static final ForeignKey REPLY_COMMENT = ForeignKeys0.REPLY_COMMENT; - public static final ForeignKey PERSONALISATION_USER = ForeignKeys0.PERSONALISATION_USER; - public static final ForeignKey PROJECT_USER = ForeignKeys0.PROJECT_USER; - public static final ForeignKey PROJECT_CATEGORY = ForeignKeys0.PROJECT_CATEGORY; - public static final ForeignKey PROJECT_FOLLOWER_MAP_PROJECT = ForeignKeys0.PROJECT_FOLLOWER_MAP_PROJECT; - public static final ForeignKey PROJECT_FOLLOWER_MAP_USER = ForeignKeys0.PROJECT_FOLLOWER_MAP_USER; - public static final ForeignKey LEAD_DEVELOPER = ForeignKeys0.LEAD_DEVELOPER; - public static final ForeignKey CREATOR = ForeignKeys0.CREATOR; - public static final ForeignKey REQUIREMENT_PROJECT = ForeignKeys0.REQUIREMENT_PROJECT; - public static final ForeignKey REQUIREMENT_CATEGORY_MAP_CATEGORY = ForeignKeys0.REQUIREMENT_CATEGORY_MAP_CATEGORY; - public static final ForeignKey REQUIREMENT_CATEGORY_MAP_REQUIREMENT = ForeignKeys0.REQUIREMENT_CATEGORY_MAP_REQUIREMENT; - public static final ForeignKey REQUIREMENT_DEVELOPER_MAP_REQUIREMENT = ForeignKeys0.REQUIREMENT_DEVELOPER_MAP_REQUIREMENT; - public static final ForeignKey REQUIREMENT_DEVELOPER_MAP_USER = ForeignKeys0.REQUIREMENT_DEVELOPER_MAP_USER; - public static final ForeignKey REQUIREMENT_FOLLOWER_MAP_REQUIREMENT = ForeignKeys0.REQUIREMENT_FOLLOWER_MAP_REQUIREMENT; - public static final ForeignKey REQUIREMENT_FOLLOWER_MAP_USER = ForeignKeys0.REQUIREMENT_FOLLOWER_MAP_USER; - public static final ForeignKey ROLE_PRIVILEGE_MAP_ROLE = ForeignKeys0.ROLE_PRIVILEGE_MAP_ROLE; - public static final ForeignKey ROLE_PRIVILEGE_MAP_PRIVILEGE = ForeignKeys0.ROLE_PRIVILEGE_MAP_PRIVILEGE; - public static final ForeignKey ROLE_ROLE_MAP_CHILD = ForeignKeys0.ROLE_ROLE_MAP_CHILD; - public static final ForeignKey ROLE_ROLE_MAP_PARENT = ForeignKeys0.ROLE_ROLE_MAP_PARENT; - public static final ForeignKey USER_ROLE_MAP_ROLE = ForeignKeys0.USER_ROLE_MAP_ROLE; - public static final ForeignKey USER_ROLE_MAP_USER = ForeignKeys0.USER_ROLE_MAP_USER; - public static final ForeignKey VOTE_REQUIREMENT = ForeignKeys0.VOTE_REQUIREMENT; - public static final ForeignKey VOTE_USER = ForeignKeys0.VOTE_USER; - - // ------------------------------------------------------------------------- - // [#1459] distribute members to avoid static initialisers > 64kb - // ------------------------------------------------------------------------- - - private static class Identities0 extends AbstractKeys { - public static Identity IDENTITY_ATTACHMENT = createIdentity(Attachment.ATTACHMENT, Attachment.ATTACHMENT.ID); - public static Identity IDENTITY_CATEGORY = createIdentity(Category.CATEGORY, Category.CATEGORY.ID); - public static Identity IDENTITY_CATEGORY_FOLLOWER_MAP = createIdentity(CategoryFollowerMap.CATEGORY_FOLLOWER_MAP, CategoryFollowerMap.CATEGORY_FOLLOWER_MAP.ID); - public static Identity IDENTITY_COMMENT = createIdentity(Comment.COMMENT, Comment.COMMENT.ID); - public static Identity IDENTITY_PERSONALISATION_DATA = createIdentity(PersonalisationData.PERSONALISATION_DATA, PersonalisationData.PERSONALISATION_DATA.ID); - public static Identity IDENTITY_PRIVILEGE = createIdentity(Privilege.PRIVILEGE, Privilege.PRIVILEGE.ID); - public static Identity IDENTITY_PROJECT = createIdentity(Project.PROJECT, Project.PROJECT.ID); - public static Identity IDENTITY_PROJECT_FOLLOWER_MAP = createIdentity(ProjectFollowerMap.PROJECT_FOLLOWER_MAP, ProjectFollowerMap.PROJECT_FOLLOWER_MAP.ID); - public static Identity IDENTITY_REQUIREMENT = createIdentity(Requirement.REQUIREMENT, Requirement.REQUIREMENT.ID); - public static Identity IDENTITY_REQUIREMENT_CATEGORY_MAP = createIdentity(RequirementCategoryMap.REQUIREMENT_CATEGORY_MAP, RequirementCategoryMap.REQUIREMENT_CATEGORY_MAP.ID); - public static Identity IDENTITY_REQUIREMENT_DEVELOPER_MAP = createIdentity(RequirementDeveloperMap.REQUIREMENT_DEVELOPER_MAP, RequirementDeveloperMap.REQUIREMENT_DEVELOPER_MAP.ID); - public static Identity IDENTITY_REQUIREMENT_FOLLOWER_MAP = createIdentity(RequirementFollowerMap.REQUIREMENT_FOLLOWER_MAP, RequirementFollowerMap.REQUIREMENT_FOLLOWER_MAP.ID); - public static Identity IDENTITY_ROLE = createIdentity(Role.ROLE, Role.ROLE.ID); - public static Identity IDENTITY_ROLE_PRIVILEGE_MAP = createIdentity(RolePrivilegeMap.ROLE_PRIVILEGE_MAP, RolePrivilegeMap.ROLE_PRIVILEGE_MAP.ID); - public static Identity IDENTITY_ROLE_ROLE_MAP = createIdentity(RoleRoleMap.ROLE_ROLE_MAP, RoleRoleMap.ROLE_ROLE_MAP.ID); - public static Identity IDENTITY_USER = createIdentity(User.USER, User.USER.ID); - public static Identity IDENTITY_USER_ROLE_MAP = createIdentity(UserRoleMap.USER_ROLE_MAP, UserRoleMap.USER_ROLE_MAP.ID); - public static Identity IDENTITY_VOTE = createIdentity(Vote.VOTE, Vote.VOTE.ID); - } - - private static class UniqueKeys0 extends AbstractKeys { - public static final UniqueKey KEY_ATTACHMENT_PRIMARY = createUniqueKey(Attachment.ATTACHMENT, "KEY_attachment_PRIMARY", Attachment.ATTACHMENT.ID); - public static final UniqueKey KEY_CATEGORY_PRIMARY = createUniqueKey(Category.CATEGORY, "KEY_category_PRIMARY", Category.CATEGORY.ID); - public static final UniqueKey KEY_CATEGORY_FOLLOWER_MAP_PRIMARY = createUniqueKey(CategoryFollowerMap.CATEGORY_FOLLOWER_MAP, "KEY_category_follower_map_PRIMARY", CategoryFollowerMap.CATEGORY_FOLLOWER_MAP.ID); - public static final UniqueKey KEY_COMMENT_PRIMARY = createUniqueKey(Comment.COMMENT, "KEY_comment_PRIMARY", Comment.COMMENT.ID); - public static final UniqueKey KEY_PERSONALISATION_DATA_PRIMARY = createUniqueKey(PersonalisationData.PERSONALISATION_DATA, "KEY_personalisation_data_PRIMARY", PersonalisationData.PERSONALISATION_DATA.ID); - public static final UniqueKey KEY_PERSONALISATION_DATA_PERSONALISATION_KEY = createUniqueKey(PersonalisationData.PERSONALISATION_DATA, "KEY_personalisation_data_personalisation_key", PersonalisationData.PERSONALISATION_DATA.IDENTIFIER, PersonalisationData.PERSONALISATION_DATA.USER_ID, PersonalisationData.PERSONALISATION_DATA.VERSION); - public static final UniqueKey KEY_PRIVILEGE_PRIMARY = createUniqueKey(Privilege.PRIVILEGE, "KEY_privilege_PRIMARY", Privilege.PRIVILEGE.ID); - public static final UniqueKey KEY_PROJECT_PRIMARY = createUniqueKey(Project.PROJECT, "KEY_project_PRIMARY", Project.PROJECT.ID); - public static final UniqueKey KEY_PROJECT_FOLLOWER_MAP_PRIMARY = createUniqueKey(ProjectFollowerMap.PROJECT_FOLLOWER_MAP, "KEY_project_follower_map_PRIMARY", ProjectFollowerMap.PROJECT_FOLLOWER_MAP.ID); - public static final UniqueKey KEY_REQUIREMENT_PRIMARY = createUniqueKey(Requirement.REQUIREMENT, "KEY_requirement_PRIMARY", Requirement.REQUIREMENT.ID); - public static final UniqueKey KEY_REQUIREMENT_CATEGORY_MAP_PRIMARY = createUniqueKey(RequirementCategoryMap.REQUIREMENT_CATEGORY_MAP, "KEY_requirement_category_map_PRIMARY", RequirementCategoryMap.REQUIREMENT_CATEGORY_MAP.ID); - public static final UniqueKey KEY_REQUIREMENT_DEVELOPER_MAP_PRIMARY = createUniqueKey(RequirementDeveloperMap.REQUIREMENT_DEVELOPER_MAP, "KEY_requirement_developer_map_PRIMARY", RequirementDeveloperMap.REQUIREMENT_DEVELOPER_MAP.ID); - public static final UniqueKey KEY_REQUIREMENT_FOLLOWER_MAP_PRIMARY = createUniqueKey(RequirementFollowerMap.REQUIREMENT_FOLLOWER_MAP, "KEY_requirement_follower_map_PRIMARY", RequirementFollowerMap.REQUIREMENT_FOLLOWER_MAP.ID); - public static final UniqueKey KEY_ROLE_PRIMARY = createUniqueKey(Role.ROLE, "KEY_role_PRIMARY", Role.ROLE.ID); - public static final UniqueKey KEY_ROLE_ROLE_IDX_1 = createUniqueKey(Role.ROLE, "KEY_role_role_idx_1", Role.ROLE.NAME); - public static final UniqueKey KEY_ROLE_PRIVILEGE_MAP_PRIMARY = createUniqueKey(RolePrivilegeMap.ROLE_PRIVILEGE_MAP, "KEY_role_privilege_map_PRIMARY", RolePrivilegeMap.ROLE_PRIVILEGE_MAP.ID); - public static final UniqueKey KEY_ROLE_ROLE_MAP_PRIMARY = createUniqueKey(RoleRoleMap.ROLE_ROLE_MAP, "KEY_role_role_map_PRIMARY", RoleRoleMap.ROLE_ROLE_MAP.ID); - public static final UniqueKey KEY_SCHEMA_VERSION_PRIMARY = createUniqueKey(SchemaVersion.SCHEMA_VERSION, "KEY_schema_version_PRIMARY", SchemaVersion.SCHEMA_VERSION.INSTALLED_RANK); - public static final UniqueKey KEY_USER_PRIMARY = createUniqueKey(User.USER, "KEY_user_PRIMARY", User.USER.ID); - public static final UniqueKey KEY_USER_ROLE_MAP_PRIMARY = createUniqueKey(UserRoleMap.USER_ROLE_MAP, "KEY_user_role_map_PRIMARY", UserRoleMap.USER_ROLE_MAP.ID); - public static final UniqueKey KEY_VOTE_PRIMARY = createUniqueKey(Vote.VOTE, "KEY_vote_PRIMARY", Vote.VOTE.ID); - } - - private static class ForeignKeys0 extends AbstractKeys { - public static final ForeignKey ATTACHMENT_REQUIREMENT = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_REQUIREMENT_PRIMARY, Attachment.ATTACHMENT, "attachment_requirement", Attachment.ATTACHMENT.REQUIREMENT_ID); - public static final ForeignKey ATTACHMENT_USER = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_USER_PRIMARY, Attachment.ATTACHMENT, "attachment_user", Attachment.ATTACHMENT.USER_ID); - public static final ForeignKey CATEGORY_PROJECT = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_PROJECT_PRIMARY, Category.CATEGORY, "category_project", Category.CATEGORY.PROJECT_ID); - public static final ForeignKey CATEGORY_USER = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_USER_PRIMARY, Category.CATEGORY, "category_user", Category.CATEGORY.LEADER_ID); - public static final ForeignKey CATEGORY_FOLLOWER_MAP_CATEGORY = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_CATEGORY_PRIMARY, CategoryFollowerMap.CATEGORY_FOLLOWER_MAP, "category_follower_map_category", CategoryFollowerMap.CATEGORY_FOLLOWER_MAP.CATEGORY_ID); - public static final ForeignKey CATEGORY_FOLLOWER_MAP_USER = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_USER_PRIMARY, CategoryFollowerMap.CATEGORY_FOLLOWER_MAP, "category_follower_map_user", CategoryFollowerMap.CATEGORY_FOLLOWER_MAP.USER_ID); - public static final ForeignKey COMMENT_REQUIREMENT = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_REQUIREMENT_PRIMARY, Comment.COMMENT, "comment_requirement", Comment.COMMENT.REQUIREMENT_ID); - public static final ForeignKey COMMENT_USER = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_USER_PRIMARY, Comment.COMMENT, "comment_user", Comment.COMMENT.USER_ID); - public static final ForeignKey REPLY_COMMENT = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_COMMENT_PRIMARY, Comment.COMMENT, "reply_comment", Comment.COMMENT.REPLY_TO_COMMENT_ID); - public static final ForeignKey PERSONALISATION_USER = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_USER_PRIMARY, PersonalisationData.PERSONALISATION_DATA, "personalisation_user", PersonalisationData.PERSONALISATION_DATA.USER_ID); - public static final ForeignKey PROJECT_USER = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_USER_PRIMARY, Project.PROJECT, "project_user", Project.PROJECT.LEADER_ID); - public static final ForeignKey PROJECT_CATEGORY = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_CATEGORY_PRIMARY, Project.PROJECT, "project_category", Project.PROJECT.DEFAULT_CATEGORY_ID); - public static final ForeignKey PROJECT_FOLLOWER_MAP_PROJECT = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_PROJECT_PRIMARY, ProjectFollowerMap.PROJECT_FOLLOWER_MAP, "project_follower_map_project", ProjectFollowerMap.PROJECT_FOLLOWER_MAP.PROJECT_ID); - public static final ForeignKey PROJECT_FOLLOWER_MAP_USER = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_USER_PRIMARY, ProjectFollowerMap.PROJECT_FOLLOWER_MAP, "project_follower_map_user", ProjectFollowerMap.PROJECT_FOLLOWER_MAP.USER_ID); - public static final ForeignKey LEAD_DEVELOPER = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_USER_PRIMARY, Requirement.REQUIREMENT, "lead_developer", Requirement.REQUIREMENT.LEAD_DEVELOPER_ID); - public static final ForeignKey CREATOR = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_USER_PRIMARY, Requirement.REQUIREMENT, "creator", Requirement.REQUIREMENT.CREATOR_ID); - public static final ForeignKey REQUIREMENT_PROJECT = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_PROJECT_PRIMARY, Requirement.REQUIREMENT, "requirement_project", Requirement.REQUIREMENT.PROJECT_ID); - public static final ForeignKey REQUIREMENT_CATEGORY_MAP_CATEGORY = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_CATEGORY_PRIMARY, RequirementCategoryMap.REQUIREMENT_CATEGORY_MAP, "requirement_category_map_category", RequirementCategoryMap.REQUIREMENT_CATEGORY_MAP.CATEGORY_ID); - public static final ForeignKey REQUIREMENT_CATEGORY_MAP_REQUIREMENT = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_REQUIREMENT_PRIMARY, RequirementCategoryMap.REQUIREMENT_CATEGORY_MAP, "requirement_category_map_requirement", RequirementCategoryMap.REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID); - public static final ForeignKey REQUIREMENT_DEVELOPER_MAP_REQUIREMENT = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_REQUIREMENT_PRIMARY, RequirementDeveloperMap.REQUIREMENT_DEVELOPER_MAP, "requirement_developer_map_requirement", RequirementDeveloperMap.REQUIREMENT_DEVELOPER_MAP.REQUIREMENT_ID); - public static final ForeignKey REQUIREMENT_DEVELOPER_MAP_USER = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_USER_PRIMARY, RequirementDeveloperMap.REQUIREMENT_DEVELOPER_MAP, "requirement_developer_map_user", RequirementDeveloperMap.REQUIREMENT_DEVELOPER_MAP.USER_ID); - public static final ForeignKey REQUIREMENT_FOLLOWER_MAP_REQUIREMENT = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_REQUIREMENT_PRIMARY, RequirementFollowerMap.REQUIREMENT_FOLLOWER_MAP, "requirement_follower_map_requirement", RequirementFollowerMap.REQUIREMENT_FOLLOWER_MAP.REQUIREMENT_ID); - public static final ForeignKey REQUIREMENT_FOLLOWER_MAP_USER = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_USER_PRIMARY, RequirementFollowerMap.REQUIREMENT_FOLLOWER_MAP, "requirement_follower_map_user", RequirementFollowerMap.REQUIREMENT_FOLLOWER_MAP.USER_ID); - public static final ForeignKey ROLE_PRIVILEGE_MAP_ROLE = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_ROLE_PRIMARY, RolePrivilegeMap.ROLE_PRIVILEGE_MAP, "role_privilege_map_role", RolePrivilegeMap.ROLE_PRIVILEGE_MAP.ROLE_ID); - public static final ForeignKey ROLE_PRIVILEGE_MAP_PRIVILEGE = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_PRIVILEGE_PRIMARY, RolePrivilegeMap.ROLE_PRIVILEGE_MAP, "role_privilege_map_privilege", RolePrivilegeMap.ROLE_PRIVILEGE_MAP.PRIVILEGE_ID); - public static final ForeignKey ROLE_ROLE_MAP_CHILD = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_ROLE_PRIMARY, RoleRoleMap.ROLE_ROLE_MAP, "role_role_map_child", RoleRoleMap.ROLE_ROLE_MAP.CHILD_ID); - public static final ForeignKey ROLE_ROLE_MAP_PARENT = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_ROLE_PRIMARY, RoleRoleMap.ROLE_ROLE_MAP, "role_role_map_parent", RoleRoleMap.ROLE_ROLE_MAP.PARENT_ID); - public static final ForeignKey USER_ROLE_MAP_ROLE = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_ROLE_PRIMARY, UserRoleMap.USER_ROLE_MAP, "user_role_map_role", UserRoleMap.USER_ROLE_MAP.ROLE_ID); - public static final ForeignKey USER_ROLE_MAP_USER = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_USER_PRIMARY, UserRoleMap.USER_ROLE_MAP, "user_role_map_user", UserRoleMap.USER_ROLE_MAP.USER_ID); - public static final ForeignKey VOTE_REQUIREMENT = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_REQUIREMENT_PRIMARY, Vote.VOTE, "vote_requirement", Vote.VOTE.REQUIREMENT_ID); - public static final ForeignKey VOTE_USER = createForeignKey(de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys.KEY_USER_PRIMARY, Vote.VOTE, "vote_user", Vote.VOTE.USER_ID); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Reqbaz.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Reqbaz.java deleted file mode 100644 index 1548f9e0..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Reqbaz.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Attachment; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Category; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.CategoryFollowerMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.PersonalisationData; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Privilege; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Project; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.ProjectFollowerMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Requirement; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementCategoryMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementDeveloperMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementFollowerMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Role; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RolePrivilegeMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RoleRoleMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.SchemaVersion; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.UserRoleMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Vote; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Generated; - -import org.jooq.Catalog; -import org.jooq.Table; -import org.jooq.impl.SchemaImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class Reqbaz extends SchemaImpl { - - private static final long serialVersionUID = 1110546097; - - /** - * The reference instance of reqbaz - */ - public static final Reqbaz REQBAZ = new Reqbaz(); - - /** - * The table reqbaz.attachment. - */ - public final Attachment ATTACHMENT = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Attachment.ATTACHMENT; - - /** - * The table reqbaz.category. - */ - public final Category CATEGORY = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Category.CATEGORY; - - /** - * The table reqbaz.category_follower_map. - */ - public final CategoryFollowerMap CATEGORY_FOLLOWER_MAP = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.CategoryFollowerMap.CATEGORY_FOLLOWER_MAP; - - /** - * The table reqbaz.comment. - */ - public final Comment COMMENT = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment.COMMENT; - - /** - * The table reqbaz.personalisation_data. - */ - public final PersonalisationData PERSONALISATION_DATA = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.PersonalisationData.PERSONALISATION_DATA; - - /** - * The table reqbaz.privilege. - */ - public final Privilege PRIVILEGE = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Privilege.PRIVILEGE; - - /** - * The table reqbaz.project. - */ - public final Project PROJECT = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Project.PROJECT; - - /** - * The table reqbaz.project_follower_map. - */ - public final ProjectFollowerMap PROJECT_FOLLOWER_MAP = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.ProjectFollowerMap.PROJECT_FOLLOWER_MAP; - - /** - * The table reqbaz.requirement. - */ - public final Requirement REQUIREMENT = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Requirement.REQUIREMENT; - - /** - * The table reqbaz.requirement_category_map. - */ - public final RequirementCategoryMap REQUIREMENT_CATEGORY_MAP = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementCategoryMap.REQUIREMENT_CATEGORY_MAP; - - /** - * The table reqbaz.requirement_developer_map. - */ - public final RequirementDeveloperMap REQUIREMENT_DEVELOPER_MAP = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementDeveloperMap.REQUIREMENT_DEVELOPER_MAP; - - /** - * The table reqbaz.requirement_follower_map. - */ - public final RequirementFollowerMap REQUIREMENT_FOLLOWER_MAP = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementFollowerMap.REQUIREMENT_FOLLOWER_MAP; - - /** - * The table reqbaz.role. - */ - public final Role ROLE = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Role.ROLE; - - /** - * The table reqbaz.role_privilege_map. - */ - public final RolePrivilegeMap ROLE_PRIVILEGE_MAP = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RolePrivilegeMap.ROLE_PRIVILEGE_MAP; - - /** - * The table reqbaz.role_role_map. - */ - public final RoleRoleMap ROLE_ROLE_MAP = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RoleRoleMap.ROLE_ROLE_MAP; - - /** - * The table reqbaz.schema_version. - */ - public final SchemaVersion SCHEMA_VERSION = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.SchemaVersion.SCHEMA_VERSION; - - /** - * The table reqbaz.user. - */ - public final User USER = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User.USER; - - /** - * The table reqbaz.user_role_map. - */ - public final UserRoleMap USER_ROLE_MAP = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.UserRoleMap.USER_ROLE_MAP; - - /** - * The table reqbaz.vote. - */ - public final Vote VOTE = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Vote.VOTE; - - /** - * No further instances allowed - */ - private Reqbaz() { - super("reqbaz", null); - } - - - /** - * {@inheritDoc} - */ - @Override - public Catalog getCatalog() { - return DefaultCatalog.DEFAULT_CATALOG; - } - - @Override - public final List> getTables() { - List result = new ArrayList(); - result.addAll(getTables0()); - return result; - } - - private final List> getTables0() { - return Arrays.>asList( - Attachment.ATTACHMENT, - Category.CATEGORY, - CategoryFollowerMap.CATEGORY_FOLLOWER_MAP, - Comment.COMMENT, - PersonalisationData.PERSONALISATION_DATA, - Privilege.PRIVILEGE, - Project.PROJECT, - ProjectFollowerMap.PROJECT_FOLLOWER_MAP, - Requirement.REQUIREMENT, - RequirementCategoryMap.REQUIREMENT_CATEGORY_MAP, - RequirementDeveloperMap.REQUIREMENT_DEVELOPER_MAP, - RequirementFollowerMap.REQUIREMENT_FOLLOWER_MAP, - Role.ROLE, - RolePrivilegeMap.ROLE_PRIVILEGE_MAP, - RoleRoleMap.ROLE_ROLE_MAP, - SchemaVersion.SCHEMA_VERSION, - User.USER, - UserRoleMap.USER_ROLE_MAP, - Vote.VOTE); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Tables.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Tables.java deleted file mode 100644 index eaa3ae2f..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/Tables.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Attachment; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Category; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.CategoryFollowerMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.PersonalisationData; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Privilege; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Project; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.ProjectFollowerMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Requirement; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementCategoryMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementDeveloperMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementFollowerMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Role; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RolePrivilegeMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RoleRoleMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.SchemaVersion; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.UserRoleMap; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Vote; - -import javax.annotation.Generated; - - -/** - * Convenience access to all tables in reqbaz - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class Tables { - - /** - * The table reqbaz.attachment. - */ - public static final Attachment ATTACHMENT = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Attachment.ATTACHMENT; - - /** - * The table reqbaz.category. - */ - public static final Category CATEGORY = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Category.CATEGORY; - - /** - * The table reqbaz.category_follower_map. - */ - public static final CategoryFollowerMap CATEGORY_FOLLOWER_MAP = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.CategoryFollowerMap.CATEGORY_FOLLOWER_MAP; - - /** - * The table reqbaz.comment. - */ - public static final Comment COMMENT = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment.COMMENT; - - /** - * The table reqbaz.personalisation_data. - */ - public static final PersonalisationData PERSONALISATION_DATA = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.PersonalisationData.PERSONALISATION_DATA; - - /** - * The table reqbaz.privilege. - */ - public static final Privilege PRIVILEGE = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Privilege.PRIVILEGE; - - /** - * The table reqbaz.project. - */ - public static final Project PROJECT = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Project.PROJECT; - - /** - * The table reqbaz.project_follower_map. - */ - public static final ProjectFollowerMap PROJECT_FOLLOWER_MAP = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.ProjectFollowerMap.PROJECT_FOLLOWER_MAP; - - /** - * The table reqbaz.requirement. - */ - public static final Requirement REQUIREMENT = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Requirement.REQUIREMENT; - - /** - * The table reqbaz.requirement_category_map. - */ - public static final RequirementCategoryMap REQUIREMENT_CATEGORY_MAP = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementCategoryMap.REQUIREMENT_CATEGORY_MAP; - - /** - * The table reqbaz.requirement_developer_map. - */ - public static final RequirementDeveloperMap REQUIREMENT_DEVELOPER_MAP = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementDeveloperMap.REQUIREMENT_DEVELOPER_MAP; - - /** - * The table reqbaz.requirement_follower_map. - */ - public static final RequirementFollowerMap REQUIREMENT_FOLLOWER_MAP = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementFollowerMap.REQUIREMENT_FOLLOWER_MAP; - - /** - * The table reqbaz.role. - */ - public static final Role ROLE = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Role.ROLE; - - /** - * The table reqbaz.role_privilege_map. - */ - public static final RolePrivilegeMap ROLE_PRIVILEGE_MAP = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RolePrivilegeMap.ROLE_PRIVILEGE_MAP; - - /** - * The table reqbaz.role_role_map. - */ - public static final RoleRoleMap ROLE_ROLE_MAP = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RoleRoleMap.ROLE_ROLE_MAP; - - /** - * The table reqbaz.schema_version. - */ - public static final SchemaVersion SCHEMA_VERSION = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.SchemaVersion.SCHEMA_VERSION; - - /** - * The table reqbaz.user. - */ - public static final User USER = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User.USER; - - /** - * The table reqbaz.user_role_map. - */ - public static final UserRoleMap USER_ROLE_MAP = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.UserRoleMap.USER_ROLE_MAP; - - /** - * The table reqbaz.vote. - */ - public static final Vote VOTE = de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Vote.VOTE; -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Attachment.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Attachment.java deleted file mode 100644 index fb833226..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Attachment.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.AttachmentRecord; - -import java.sql.Timestamp; -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class Attachment extends TableImpl { - - private static final long serialVersionUID = -1603866374; - - /** - * The reference instance of reqbaz.attachment - */ - public static final Attachment ATTACHMENT = new Attachment(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return AttachmentRecord.class; - } - - /** - * The column reqbaz.attachment.id. - */ - public final TableField ID = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.attachment.creation_date. - */ - public final TableField CREATION_DATE = createField("creation_date", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.inline("CURRENT_TIMESTAMP", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - - /** - * The column reqbaz.attachment.last_updated_date. - */ - public final TableField LAST_UPDATED_DATE = createField("last_updated_date", org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); - - /** - * The column reqbaz.attachment.requirement_id. - */ - public final TableField REQUIREMENT_ID = createField("requirement_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.attachment.user_id. - */ - public final TableField USER_ID = createField("user_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.attachment.name. - */ - public final TableField NAME = createField("name", org.jooq.impl.SQLDataType.VARCHAR.length(255).nullable(false), this, ""); - - /** - * The column reqbaz.attachment.description. - */ - public final TableField DESCRIPTION = createField("description", org.jooq.impl.SQLDataType.CLOB, this, ""); - - /** - * The column reqbaz.attachment.mime_type. - */ - public final TableField MIME_TYPE = createField("mime_type", org.jooq.impl.SQLDataType.VARCHAR.length(255).nullable(false), this, ""); - - /** - * The column reqbaz.attachment.identifier. - */ - public final TableField IDENTIFIER = createField("identifier", org.jooq.impl.SQLDataType.VARCHAR.length(900).nullable(false), this, ""); - - /** - * The column reqbaz.attachment.file_url. - */ - public final TableField FILE_URL = createField("file_url", org.jooq.impl.SQLDataType.VARCHAR.length(1000).nullable(false), this, ""); - - /** - * Create a reqbaz.attachment table reference - */ - public Attachment() { - this("attachment", null); - } - - /** - * Create an aliased reqbaz.attachment table reference - */ - public Attachment(String alias) { - this(alias, ATTACHMENT); - } - - private Attachment(String alias, Table aliased) { - this(alias, aliased, null); - } - - private Attachment(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Reqbaz.REQBAZ; - } - - /** - * {@inheritDoc} - */ - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ATTACHMENT; - } - - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() { - return Keys.KEY_ATTACHMENT_PRIMARY; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.KEY_ATTACHMENT_PRIMARY); - } - - /** - * {@inheritDoc} - */ - @Override - public List> getReferences() { - return Arrays.>asList(Keys.ATTACHMENT_REQUIREMENT, Keys.ATTACHMENT_USER); - } - - /** - * {@inheritDoc} - */ - @Override - public Attachment as(String alias) { - return new Attachment(alias, this); - } - - /** - * Rename this table - */ - @Override - public Attachment rename(String name) { - return new Attachment(name, null); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Category.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Category.java deleted file mode 100644 index 3e10abea..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Category.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CategoryRecord; - -import java.sql.Timestamp; -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class Category extends TableImpl { - - private static final long serialVersionUID = 1856403820; - - /** - * The reference instance of reqbaz.category - */ - public static final Category CATEGORY = new Category(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return CategoryRecord.class; - } - - /** - * The column reqbaz.category.id. - */ - public final TableField ID = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.category.name. - */ - public final TableField NAME = createField("name", org.jooq.impl.SQLDataType.VARCHAR.length(255).nullable(false), this, ""); - - /** - * The column reqbaz.category.description. - */ - public final TableField DESCRIPTION = createField("description", org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); - - /** - * The column reqbaz.category.creation_date. - */ - public final TableField CREATION_DATE = createField("creation_date", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.inline("CURRENT_TIMESTAMP", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - - /** - * The column reqbaz.category.last_updated_date. - */ - public final TableField LAST_UPDATED_DATE = createField("last_updated_date", org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); - - /** - * The column reqbaz.category.project_id. - */ - public final TableField PROJECT_ID = createField("project_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.category.leader_id. - */ - public final TableField LEADER_ID = createField("leader_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * Create a reqbaz.category table reference - */ - public Category() { - this("category", null); - } - - /** - * Create an aliased reqbaz.category table reference - */ - public Category(String alias) { - this(alias, CATEGORY); - } - - private Category(String alias, Table aliased) { - this(alias, aliased, null); - } - - private Category(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Reqbaz.REQBAZ; - } - - /** - * {@inheritDoc} - */ - @Override - public Identity getIdentity() { - return Keys.IDENTITY_CATEGORY; - } - - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() { - return Keys.KEY_CATEGORY_PRIMARY; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.KEY_CATEGORY_PRIMARY); - } - - /** - * {@inheritDoc} - */ - @Override - public List> getReferences() { - return Arrays.>asList(Keys.CATEGORY_PROJECT, Keys.CATEGORY_USER); - } - - /** - * {@inheritDoc} - */ - @Override - public Category as(String alias) { - return new Category(alias, this); - } - - /** - * Rename this table - */ - @Override - public Category rename(String name) { - return new Category(name, null); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/CategoryFollowerMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/CategoryFollowerMap.java deleted file mode 100644 index 8e63380f..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/CategoryFollowerMap.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CategoryFollowerMapRecord; - -import java.sql.Timestamp; -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class CategoryFollowerMap extends TableImpl { - - private static final long serialVersionUID = -1568253073; - - /** - * The reference instance of reqbaz.category_follower_map - */ - public static final CategoryFollowerMap CATEGORY_FOLLOWER_MAP = new CategoryFollowerMap(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return CategoryFollowerMapRecord.class; - } - - /** - * The column reqbaz.category_follower_map.id. - */ - public final TableField ID = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.category_follower_map.category_id. - */ - public final TableField CATEGORY_ID = createField("category_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.category_follower_map.user_id. - */ - public final TableField USER_ID = createField("user_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.category_follower_map.creation_date. - */ - public final TableField CREATION_DATE = createField("creation_date", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.inline("CURRENT_TIMESTAMP", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - - /** - * Create a reqbaz.category_follower_map table reference - */ - public CategoryFollowerMap() { - this("category_follower_map", null); - } - - /** - * Create an aliased reqbaz.category_follower_map table reference - */ - public CategoryFollowerMap(String alias) { - this(alias, CATEGORY_FOLLOWER_MAP); - } - - private CategoryFollowerMap(String alias, Table aliased) { - this(alias, aliased, null); - } - - private CategoryFollowerMap(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Reqbaz.REQBAZ; - } - - /** - * {@inheritDoc} - */ - @Override - public Identity getIdentity() { - return Keys.IDENTITY_CATEGORY_FOLLOWER_MAP; - } - - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() { - return Keys.KEY_CATEGORY_FOLLOWER_MAP_PRIMARY; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.KEY_CATEGORY_FOLLOWER_MAP_PRIMARY); - } - - /** - * {@inheritDoc} - */ - @Override - public List> getReferences() { - return Arrays.>asList(Keys.CATEGORY_FOLLOWER_MAP_CATEGORY, Keys.CATEGORY_FOLLOWER_MAP_USER); - } - - /** - * {@inheritDoc} - */ - @Override - public CategoryFollowerMap as(String alias) { - return new CategoryFollowerMap(alias, this); - } - - /** - * Rename this table - */ - @Override - public CategoryFollowerMap rename(String name) { - return new CategoryFollowerMap(name, null); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Comment.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Comment.java deleted file mode 100644 index f34eab0f..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Comment.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.CommentRecord; - -import java.sql.Timestamp; -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class Comment extends TableImpl { - - private static final long serialVersionUID = -348339124; - - /** - * The reference instance of reqbaz.comment - */ - public static final Comment COMMENT = new Comment(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return CommentRecord.class; - } - - /** - * The column reqbaz.comment.id. - */ - public final TableField ID = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.comment.message. - */ - public final TableField MESSAGE = createField("message", org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); - - /** - * The column reqbaz.comment.creation_date. - */ - public final TableField CREATION_DATE = createField("creation_date", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.inline("CURRENT_TIMESTAMP", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - - /** - * The column reqbaz.comment.last_updated_date. - */ - public final TableField LAST_UPDATED_DATE = createField("last_updated_date", org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); - - /** - * The column reqbaz.comment.requirement_id. - */ - public final TableField REQUIREMENT_ID = createField("requirement_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.comment.user_id. - */ - public final TableField USER_ID = createField("user_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.comment.reply_to_comment_id. - */ - public final TableField REPLY_TO_COMMENT_ID = createField("reply_to_comment_id", org.jooq.impl.SQLDataType.INTEGER, this, ""); - - /** - * Create a reqbaz.comment table reference - */ - public Comment() { - this("comment", null); - } - - /** - * Create an aliased reqbaz.comment table reference - */ - public Comment(String alias) { - this(alias, COMMENT); - } - - private Comment(String alias, Table aliased) { - this(alias, aliased, null); - } - - private Comment(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Reqbaz.REQBAZ; - } - - /** - * {@inheritDoc} - */ - @Override - public Identity getIdentity() { - return Keys.IDENTITY_COMMENT; - } - - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() { - return Keys.KEY_COMMENT_PRIMARY; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.KEY_COMMENT_PRIMARY); - } - - /** - * {@inheritDoc} - */ - @Override - public List> getReferences() { - return Arrays.>asList(Keys.COMMENT_REQUIREMENT, Keys.COMMENT_USER, Keys.REPLY_COMMENT); - } - - /** - * {@inheritDoc} - */ - @Override - public Comment as(String alias) { - return new Comment(alias, this); - } - - /** - * Rename this table - */ - @Override - public Comment rename(String name) { - return new Comment(name, null); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/PersonalisationData.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/PersonalisationData.java deleted file mode 100644 index 2a898995..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/PersonalisationData.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.PersonalisationDataRecord; - -import java.sql.Timestamp; -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class PersonalisationData extends TableImpl { - - private static final long serialVersionUID = -191812551; - - /** - * The reference instance of reqbaz.personalisation_data - */ - public static final PersonalisationData PERSONALISATION_DATA = new PersonalisationData(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return PersonalisationDataRecord.class; - } - - /** - * The column reqbaz.personalisation_data.id. - */ - public final TableField ID = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.personalisation_data.creation_date. - */ - public final TableField CREATION_DATE = createField("creation_date", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.inline("CURRENT_TIMESTAMP", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - - /** - * The column reqbaz.personalisation_data.last_updated_date. - */ - public final TableField LAST_UPDATED_DATE = createField("last_updated_date", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.inline("CURRENT_TIMESTAMP", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - - /** - * The column reqbaz.personalisation_data.identifier. - */ - public final TableField IDENTIFIER = createField("identifier", org.jooq.impl.SQLDataType.VARCHAR.length(50).nullable(false), this, ""); - - /** - * The column reqbaz.personalisation_data.user_id. - */ - public final TableField USER_ID = createField("user_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.personalisation_data.version. - */ - public final TableField VERSION = createField("version", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.personalisation_data.setting. - */ - public final TableField SETTING = createField("setting", org.jooq.impl.SQLDataType.CLOB, this, ""); - - /** - * Create a reqbaz.personalisation_data table reference - */ - public PersonalisationData() { - this("personalisation_data", null); - } - - /** - * Create an aliased reqbaz.personalisation_data table reference - */ - public PersonalisationData(String alias) { - this(alias, PERSONALISATION_DATA); - } - - private PersonalisationData(String alias, Table aliased) { - this(alias, aliased, null); - } - - private PersonalisationData(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Reqbaz.REQBAZ; - } - - /** - * {@inheritDoc} - */ - @Override - public Identity getIdentity() { - return Keys.IDENTITY_PERSONALISATION_DATA; - } - - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() { - return Keys.KEY_PERSONALISATION_DATA_PRIMARY; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.KEY_PERSONALISATION_DATA_PRIMARY, Keys.KEY_PERSONALISATION_DATA_PERSONALISATION_KEY); - } - - /** - * {@inheritDoc} - */ - @Override - public List> getReferences() { - return Arrays.>asList(Keys.PERSONALISATION_USER); - } - - /** - * {@inheritDoc} - */ - @Override - public PersonalisationData as(String alias) { - return new PersonalisationData(alias, this); - } - - /** - * Rename this table - */ - @Override - public PersonalisationData rename(String name) { - return new PersonalisationData(name, null); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Privilege.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Privilege.java deleted file mode 100644 index 830dc74d..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Privilege.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.PrivilegeRecord; - -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.Identity; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class Privilege extends TableImpl { - - private static final long serialVersionUID = 799298701; - - /** - * The reference instance of reqbaz.privilege - */ - public static final Privilege PRIVILEGE = new Privilege(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return PrivilegeRecord.class; - } - - /** - * The column reqbaz.privilege.id. - */ - public final TableField ID = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.privilege.name. - */ - public final TableField NAME = createField("name", org.jooq.impl.SQLDataType.VARCHAR.length(100).nullable(false), this, ""); - - /** - * Create a reqbaz.privilege table reference - */ - public Privilege() { - this("privilege", null); - } - - /** - * Create an aliased reqbaz.privilege table reference - */ - public Privilege(String alias) { - this(alias, PRIVILEGE); - } - - private Privilege(String alias, Table aliased) { - this(alias, aliased, null); - } - - private Privilege(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Reqbaz.REQBAZ; - } - - /** - * {@inheritDoc} - */ - @Override - public Identity getIdentity() { - return Keys.IDENTITY_PRIVILEGE; - } - - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() { - return Keys.KEY_PRIVILEGE_PRIMARY; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.KEY_PRIVILEGE_PRIMARY); - } - - /** - * {@inheritDoc} - */ - @Override - public Privilege as(String alias) { - return new Privilege(alias, this); - } - - /** - * Rename this table - */ - @Override - public Privilege rename(String name) { - return new Privilege(name, null); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Project.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Project.java deleted file mode 100644 index b9364e2d..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Project.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.ProjectRecord; - -import java.sql.Timestamp; -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class Project extends TableImpl { - - private static final long serialVersionUID = 1235446294; - - /** - * The reference instance of reqbaz.project - */ - public static final Project PROJECT = new Project(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return ProjectRecord.class; - } - - /** - * The column reqbaz.project.id. - */ - public final TableField ID = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.project.name. - */ - public final TableField NAME = createField("name", org.jooq.impl.SQLDataType.VARCHAR.length(255).nullable(false), this, ""); - - /** - * The column reqbaz.project.description. - */ - public final TableField DESCRIPTION = createField("description", org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); - - /** - * The column reqbaz.project.visibility. - */ - public final TableField VISIBILITY = createField("visibility", org.jooq.impl.SQLDataType.TINYINT.nullable(false), this, ""); - - /** - * The column reqbaz.project.creation_date. - */ - public final TableField CREATION_DATE = createField("creation_date", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.inline("CURRENT_TIMESTAMP", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - - /** - * The column reqbaz.project.last_updated_date. - */ - public final TableField LAST_UPDATED_DATE = createField("last_updated_date", org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); - - /** - * The column reqbaz.project.leader_id. - */ - public final TableField LEADER_ID = createField("leader_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.project.default_category_id. - */ - public final TableField DEFAULT_CATEGORY_ID = createField("default_category_id", org.jooq.impl.SQLDataType.INTEGER, this, ""); - - /** - * Create a reqbaz.project table reference - */ - public Project() { - this("project", null); - } - - /** - * Create an aliased reqbaz.project table reference - */ - public Project(String alias) { - this(alias, PROJECT); - } - - private Project(String alias, Table aliased) { - this(alias, aliased, null); - } - - private Project(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Reqbaz.REQBAZ; - } - - /** - * {@inheritDoc} - */ - @Override - public Identity getIdentity() { - return Keys.IDENTITY_PROJECT; - } - - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() { - return Keys.KEY_PROJECT_PRIMARY; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.KEY_PROJECT_PRIMARY); - } - - /** - * {@inheritDoc} - */ - @Override - public List> getReferences() { - return Arrays.>asList(Keys.PROJECT_USER, Keys.PROJECT_CATEGORY); - } - - /** - * {@inheritDoc} - */ - @Override - public Project as(String alias) { - return new Project(alias, this); - } - - /** - * Rename this table - */ - @Override - public Project rename(String name) { - return new Project(name, null); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/ProjectFollowerMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/ProjectFollowerMap.java deleted file mode 100644 index d3512fed..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/ProjectFollowerMap.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.ProjectFollowerMapRecord; - -import java.sql.Timestamp; -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class ProjectFollowerMap extends TableImpl { - - private static final long serialVersionUID = -1701261507; - - /** - * The reference instance of reqbaz.project_follower_map - */ - public static final ProjectFollowerMap PROJECT_FOLLOWER_MAP = new ProjectFollowerMap(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return ProjectFollowerMapRecord.class; - } - - /** - * The column reqbaz.project_follower_map.id. - */ - public final TableField ID = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.project_follower_map.project_id. - */ - public final TableField PROJECT_ID = createField("project_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.project_follower_map.user_id. - */ - public final TableField USER_ID = createField("user_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.project_follower_map.creation_date. - */ - public final TableField CREATION_DATE = createField("creation_date", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.inline("CURRENT_TIMESTAMP", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - - /** - * Create a reqbaz.project_follower_map table reference - */ - public ProjectFollowerMap() { - this("project_follower_map", null); - } - - /** - * Create an aliased reqbaz.project_follower_map table reference - */ - public ProjectFollowerMap(String alias) { - this(alias, PROJECT_FOLLOWER_MAP); - } - - private ProjectFollowerMap(String alias, Table aliased) { - this(alias, aliased, null); - } - - private ProjectFollowerMap(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Reqbaz.REQBAZ; - } - - /** - * {@inheritDoc} - */ - @Override - public Identity getIdentity() { - return Keys.IDENTITY_PROJECT_FOLLOWER_MAP; - } - - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() { - return Keys.KEY_PROJECT_FOLLOWER_MAP_PRIMARY; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.KEY_PROJECT_FOLLOWER_MAP_PRIMARY); - } - - /** - * {@inheritDoc} - */ - @Override - public List> getReferences() { - return Arrays.>asList(Keys.PROJECT_FOLLOWER_MAP_PROJECT, Keys.PROJECT_FOLLOWER_MAP_USER); - } - - /** - * {@inheritDoc} - */ - @Override - public ProjectFollowerMap as(String alias) { - return new ProjectFollowerMap(alias, this); - } - - /** - * Rename this table - */ - @Override - public ProjectFollowerMap rename(String name) { - return new ProjectFollowerMap(name, null); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Requirement.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Requirement.java deleted file mode 100644 index ad8ddd67..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Requirement.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementRecord; - -import java.sql.Timestamp; -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class Requirement extends TableImpl { - - private static final long serialVersionUID = 507661299; - - /** - * The reference instance of reqbaz.requirement - */ - public static final Requirement REQUIREMENT = new Requirement(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return RequirementRecord.class; - } - - /** - * The column reqbaz.requirement.id. - */ - public final TableField ID = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.requirement.name. - */ - public final TableField NAME = createField("name", org.jooq.impl.SQLDataType.VARCHAR.length(255).nullable(false), this, ""); - - /** - * The column reqbaz.requirement.description. - */ - public final TableField DESCRIPTION = createField("description", org.jooq.impl.SQLDataType.CLOB, this, ""); - - /** - * The column reqbaz.requirement.realized. - */ - public final TableField REALIZED = createField("realized", org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); - - /** - * The column reqbaz.requirement.creation_date. - */ - public final TableField CREATION_DATE = createField("creation_date", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.inline("CURRENT_TIMESTAMP", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - - /** - * The column reqbaz.requirement.last_updated_date. - */ - public final TableField LAST_UPDATED_DATE = createField("last_updated_date", org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); - - /** - * The column reqbaz.requirement.lead_developer_id. - */ - public final TableField LEAD_DEVELOPER_ID = createField("lead_developer_id", org.jooq.impl.SQLDataType.INTEGER, this, ""); - - /** - * The column reqbaz.requirement.creator_id. - */ - public final TableField CREATOR_ID = createField("creator_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.requirement.project_id. - */ - public final TableField PROJECT_ID = createField("project_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * Create a reqbaz.requirement table reference - */ - public Requirement() { - this("requirement", null); - } - - /** - * Create an aliased reqbaz.requirement table reference - */ - public Requirement(String alias) { - this(alias, REQUIREMENT); - } - - private Requirement(String alias, Table aliased) { - this(alias, aliased, null); - } - - private Requirement(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Reqbaz.REQBAZ; - } - - /** - * {@inheritDoc} - */ - @Override - public Identity getIdentity() { - return Keys.IDENTITY_REQUIREMENT; - } - - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() { - return Keys.KEY_REQUIREMENT_PRIMARY; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.KEY_REQUIREMENT_PRIMARY); - } - - /** - * {@inheritDoc} - */ - @Override - public List> getReferences() { - return Arrays.>asList(Keys.LEAD_DEVELOPER, Keys.CREATOR, Keys.REQUIREMENT_PROJECT); - } - - /** - * {@inheritDoc} - */ - @Override - public Requirement as(String alias) { - return new Requirement(alias, this); - } - - /** - * Rename this table - */ - @Override - public Requirement rename(String name) { - return new Requirement(name, null); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementCategoryMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementCategoryMap.java deleted file mode 100644 index 8ff46047..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementCategoryMap.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementCategoryMapRecord; - -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class RequirementCategoryMap extends TableImpl { - - private static final long serialVersionUID = -1083456567; - - /** - * The reference instance of reqbaz.requirement_category_map - */ - public static final RequirementCategoryMap REQUIREMENT_CATEGORY_MAP = new RequirementCategoryMap(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return RequirementCategoryMapRecord.class; - } - - /** - * The column reqbaz.requirement_category_map.id. - */ - public final TableField ID = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.requirement_category_map.category_id. - */ - public final TableField CATEGORY_ID = createField("category_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.requirement_category_map.requirement_id. - */ - public final TableField REQUIREMENT_ID = createField("requirement_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * Create a reqbaz.requirement_category_map table reference - */ - public RequirementCategoryMap() { - this("requirement_category_map", null); - } - - /** - * Create an aliased reqbaz.requirement_category_map table reference - */ - public RequirementCategoryMap(String alias) { - this(alias, REQUIREMENT_CATEGORY_MAP); - } - - private RequirementCategoryMap(String alias, Table aliased) { - this(alias, aliased, null); - } - - private RequirementCategoryMap(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Reqbaz.REQBAZ; - } - - /** - * {@inheritDoc} - */ - @Override - public Identity getIdentity() { - return Keys.IDENTITY_REQUIREMENT_CATEGORY_MAP; - } - - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() { - return Keys.KEY_REQUIREMENT_CATEGORY_MAP_PRIMARY; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.KEY_REQUIREMENT_CATEGORY_MAP_PRIMARY); - } - - /** - * {@inheritDoc} - */ - @Override - public List> getReferences() { - return Arrays.>asList(Keys.REQUIREMENT_CATEGORY_MAP_CATEGORY, Keys.REQUIREMENT_CATEGORY_MAP_REQUIREMENT); - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementCategoryMap as(String alias) { - return new RequirementCategoryMap(alias, this); - } - - /** - * Rename this table - */ - @Override - public RequirementCategoryMap rename(String name) { - return new RequirementCategoryMap(name, null); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementDeveloperMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementDeveloperMap.java deleted file mode 100644 index 1f848ac4..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementDeveloperMap.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementDeveloperMapRecord; - -import java.sql.Timestamp; -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class RequirementDeveloperMap extends TableImpl { - - private static final long serialVersionUID = 559012393; - - /** - * The reference instance of reqbaz.requirement_developer_map - */ - public static final RequirementDeveloperMap REQUIREMENT_DEVELOPER_MAP = new RequirementDeveloperMap(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return RequirementDeveloperMapRecord.class; - } - - /** - * The column reqbaz.requirement_developer_map.id. - */ - public final TableField ID = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.requirement_developer_map.requirement_id. - */ - public final TableField REQUIREMENT_ID = createField("requirement_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.requirement_developer_map.user_id. - */ - public final TableField USER_ID = createField("user_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.requirement_developer_map.creation_date. - */ - public final TableField CREATION_DATE = createField("creation_date", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.inline("CURRENT_TIMESTAMP", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - - /** - * Create a reqbaz.requirement_developer_map table reference - */ - public RequirementDeveloperMap() { - this("requirement_developer_map", null); - } - - /** - * Create an aliased reqbaz.requirement_developer_map table reference - */ - public RequirementDeveloperMap(String alias) { - this(alias, REQUIREMENT_DEVELOPER_MAP); - } - - private RequirementDeveloperMap(String alias, Table aliased) { - this(alias, aliased, null); - } - - private RequirementDeveloperMap(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Reqbaz.REQBAZ; - } - - /** - * {@inheritDoc} - */ - @Override - public Identity getIdentity() { - return Keys.IDENTITY_REQUIREMENT_DEVELOPER_MAP; - } - - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() { - return Keys.KEY_REQUIREMENT_DEVELOPER_MAP_PRIMARY; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.KEY_REQUIREMENT_DEVELOPER_MAP_PRIMARY); - } - - /** - * {@inheritDoc} - */ - @Override - public List> getReferences() { - return Arrays.>asList(Keys.REQUIREMENT_DEVELOPER_MAP_REQUIREMENT, Keys.REQUIREMENT_DEVELOPER_MAP_USER); - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementDeveloperMap as(String alias) { - return new RequirementDeveloperMap(alias, this); - } - - /** - * Rename this table - */ - @Override - public RequirementDeveloperMap rename(String name) { - return new RequirementDeveloperMap(name, null); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementFollowerMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementFollowerMap.java deleted file mode 100644 index f93695d0..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RequirementFollowerMap.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementFollowerMapRecord; - -import java.sql.Timestamp; -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class RequirementFollowerMap extends TableImpl { - - private static final long serialVersionUID = -1236442855; - - /** - * The reference instance of reqbaz.requirement_follower_map - */ - public static final RequirementFollowerMap REQUIREMENT_FOLLOWER_MAP = new RequirementFollowerMap(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return RequirementFollowerMapRecord.class; - } - - /** - * The column reqbaz.requirement_follower_map.id. - */ - public final TableField ID = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.requirement_follower_map.requirement_id. - */ - public final TableField REQUIREMENT_ID = createField("requirement_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.requirement_follower_map.user_id. - */ - public final TableField USER_ID = createField("user_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.requirement_follower_map.creation_date. - */ - public final TableField CREATION_DATE = createField("creation_date", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.inline("CURRENT_TIMESTAMP", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - - /** - * Create a reqbaz.requirement_follower_map table reference - */ - public RequirementFollowerMap() { - this("requirement_follower_map", null); - } - - /** - * Create an aliased reqbaz.requirement_follower_map table reference - */ - public RequirementFollowerMap(String alias) { - this(alias, REQUIREMENT_FOLLOWER_MAP); - } - - private RequirementFollowerMap(String alias, Table aliased) { - this(alias, aliased, null); - } - - private RequirementFollowerMap(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Reqbaz.REQBAZ; - } - - /** - * {@inheritDoc} - */ - @Override - public Identity getIdentity() { - return Keys.IDENTITY_REQUIREMENT_FOLLOWER_MAP; - } - - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() { - return Keys.KEY_REQUIREMENT_FOLLOWER_MAP_PRIMARY; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.KEY_REQUIREMENT_FOLLOWER_MAP_PRIMARY); - } - - /** - * {@inheritDoc} - */ - @Override - public List> getReferences() { - return Arrays.>asList(Keys.REQUIREMENT_FOLLOWER_MAP_REQUIREMENT, Keys.REQUIREMENT_FOLLOWER_MAP_USER); - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementFollowerMap as(String alias) { - return new RequirementFollowerMap(alias, this); - } - - /** - * Rename this table - */ - @Override - public RequirementFollowerMap rename(String name) { - return new RequirementFollowerMap(name, null); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Role.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Role.java deleted file mode 100644 index 520f5af1..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Role.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RoleRecord; - -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.Identity; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class Role extends TableImpl { - - private static final long serialVersionUID = 2020251099; - - /** - * The reference instance of reqbaz.role - */ - public static final Role ROLE = new Role(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return RoleRecord.class; - } - - /** - * The column reqbaz.role.id. - */ - public final TableField ID = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.role.name. - */ - public final TableField NAME = createField("name", org.jooq.impl.SQLDataType.VARCHAR.length(50), this, ""); - - /** - * Create a reqbaz.role table reference - */ - public Role() { - this("role", null); - } - - /** - * Create an aliased reqbaz.role table reference - */ - public Role(String alias) { - this(alias, ROLE); - } - - private Role(String alias, Table aliased) { - this(alias, aliased, null); - } - - private Role(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Reqbaz.REQBAZ; - } - - /** - * {@inheritDoc} - */ - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ROLE; - } - - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() { - return Keys.KEY_ROLE_PRIMARY; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.KEY_ROLE_PRIMARY, Keys.KEY_ROLE_ROLE_IDX_1); - } - - /** - * {@inheritDoc} - */ - @Override - public Role as(String alias) { - return new Role(alias, this); - } - - /** - * Rename this table - */ - @Override - public Role rename(String name) { - return new Role(name, null); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RolePrivilegeMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RolePrivilegeMap.java deleted file mode 100644 index 05cbab45..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RolePrivilegeMap.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RolePrivilegeMapRecord; - -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class RolePrivilegeMap extends TableImpl { - - private static final long serialVersionUID = 288946433; - - /** - * The reference instance of reqbaz.role_privilege_map - */ - public static final RolePrivilegeMap ROLE_PRIVILEGE_MAP = new RolePrivilegeMap(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return RolePrivilegeMapRecord.class; - } - - /** - * The column reqbaz.role_privilege_map.id. - */ - public final TableField ID = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.role_privilege_map.role_id. - */ - public final TableField ROLE_ID = createField("role_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.role_privilege_map.privilege_id. - */ - public final TableField PRIVILEGE_ID = createField("privilege_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * Create a reqbaz.role_privilege_map table reference - */ - public RolePrivilegeMap() { - this("role_privilege_map", null); - } - - /** - * Create an aliased reqbaz.role_privilege_map table reference - */ - public RolePrivilegeMap(String alias) { - this(alias, ROLE_PRIVILEGE_MAP); - } - - private RolePrivilegeMap(String alias, Table aliased) { - this(alias, aliased, null); - } - - private RolePrivilegeMap(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Reqbaz.REQBAZ; - } - - /** - * {@inheritDoc} - */ - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ROLE_PRIVILEGE_MAP; - } - - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() { - return Keys.KEY_ROLE_PRIVILEGE_MAP_PRIMARY; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.KEY_ROLE_PRIVILEGE_MAP_PRIMARY); - } - - /** - * {@inheritDoc} - */ - @Override - public List> getReferences() { - return Arrays.>asList(Keys.ROLE_PRIVILEGE_MAP_ROLE, Keys.ROLE_PRIVILEGE_MAP_PRIVILEGE); - } - - /** - * {@inheritDoc} - */ - @Override - public RolePrivilegeMap as(String alias) { - return new RolePrivilegeMap(alias, this); - } - - /** - * Rename this table - */ - @Override - public RolePrivilegeMap rename(String name) { - return new RolePrivilegeMap(name, null); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RoleRoleMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RoleRoleMap.java deleted file mode 100644 index 38f5b038..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/RoleRoleMap.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RoleRoleMapRecord; - -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class RoleRoleMap extends TableImpl { - - private static final long serialVersionUID = 308433545; - - /** - * The reference instance of reqbaz.role_role_map - */ - public static final RoleRoleMap ROLE_ROLE_MAP = new RoleRoleMap(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return RoleRoleMapRecord.class; - } - - /** - * The column reqbaz.role_role_map.id. - */ - public final TableField ID = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.role_role_map.child_id. - */ - public final TableField CHILD_ID = createField("child_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.role_role_map.parent_id. - */ - public final TableField PARENT_ID = createField("parent_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * Create a reqbaz.role_role_map table reference - */ - public RoleRoleMap() { - this("role_role_map", null); - } - - /** - * Create an aliased reqbaz.role_role_map table reference - */ - public RoleRoleMap(String alias) { - this(alias, ROLE_ROLE_MAP); - } - - private RoleRoleMap(String alias, Table aliased) { - this(alias, aliased, null); - } - - private RoleRoleMap(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Reqbaz.REQBAZ; - } - - /** - * {@inheritDoc} - */ - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ROLE_ROLE_MAP; - } - - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() { - return Keys.KEY_ROLE_ROLE_MAP_PRIMARY; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.KEY_ROLE_ROLE_MAP_PRIMARY); - } - - /** - * {@inheritDoc} - */ - @Override - public List> getReferences() { - return Arrays.>asList(Keys.ROLE_ROLE_MAP_CHILD, Keys.ROLE_ROLE_MAP_PARENT); - } - - /** - * {@inheritDoc} - */ - @Override - public RoleRoleMap as(String alias) { - return new RoleRoleMap(alias, this); - } - - /** - * Rename this table - */ - @Override - public RoleRoleMap rename(String name) { - return new RoleRoleMap(name, null); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/SchemaVersion.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/SchemaVersion.java deleted file mode 100644 index eb14a391..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/SchemaVersion.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.SchemaVersionRecord; - -import java.sql.Timestamp; -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class SchemaVersion extends TableImpl { - - private static final long serialVersionUID = -1750837905; - - /** - * The reference instance of reqbaz.schema_version - */ - public static final SchemaVersion SCHEMA_VERSION = new SchemaVersion(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return SchemaVersionRecord.class; - } - - /** - * The column reqbaz.schema_version.installed_rank. - */ - public final TableField INSTALLED_RANK = createField("installed_rank", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.schema_version.version. - */ - public final TableField VERSION = createField("version", org.jooq.impl.SQLDataType.VARCHAR.length(50), this, ""); - - /** - * The column reqbaz.schema_version.description. - */ - public final TableField DESCRIPTION = createField("description", org.jooq.impl.SQLDataType.VARCHAR.length(200).nullable(false), this, ""); - - /** - * The column reqbaz.schema_version.type. - */ - public final TableField TYPE = createField("type", org.jooq.impl.SQLDataType.VARCHAR.length(20).nullable(false), this, ""); - - /** - * The column reqbaz.schema_version.script. - */ - public final TableField SCRIPT = createField("script", org.jooq.impl.SQLDataType.VARCHAR.length(1000).nullable(false), this, ""); - - /** - * The column reqbaz.schema_version.checksum. - */ - public final TableField CHECKSUM = createField("checksum", org.jooq.impl.SQLDataType.INTEGER, this, ""); - - /** - * The column reqbaz.schema_version.installed_by. - */ - public final TableField INSTALLED_BY = createField("installed_by", org.jooq.impl.SQLDataType.VARCHAR.length(100).nullable(false), this, ""); - - /** - * The column reqbaz.schema_version.installed_on. - */ - public final TableField INSTALLED_ON = createField("installed_on", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.inline("CURRENT_TIMESTAMP", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - - /** - * The column reqbaz.schema_version.execution_time. - */ - public final TableField EXECUTION_TIME = createField("execution_time", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.schema_version.success. - */ - public final TableField SUCCESS = createField("success", org.jooq.impl.SQLDataType.TINYINT.nullable(false), this, ""); - - /** - * Create a reqbaz.schema_version table reference - */ - public SchemaVersion() { - this("schema_version", null); - } - - /** - * Create an aliased reqbaz.schema_version table reference - */ - public SchemaVersion(String alias) { - this(alias, SCHEMA_VERSION); - } - - private SchemaVersion(String alias, Table aliased) { - this(alias, aliased, null); - } - - private SchemaVersion(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Reqbaz.REQBAZ; - } - - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() { - return Keys.KEY_SCHEMA_VERSION_PRIMARY; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.KEY_SCHEMA_VERSION_PRIMARY); - } - - /** - * {@inheritDoc} - */ - @Override - public SchemaVersion as(String alias) { - return new SchemaVersion(alias, this); - } - - /** - * Rename this table - */ - @Override - public SchemaVersion rename(String name) { - return new SchemaVersion(name, null); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/User.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/User.java deleted file mode 100644 index 7c64b01f..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/User.java +++ /dev/null @@ -1,193 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.UserRecord; - -import java.sql.Timestamp; -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.Identity; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class User extends TableImpl { - - private static final long serialVersionUID = 1645407206; - - /** - * The reference instance of reqbaz.user - */ - public static final User USER = new User(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return UserRecord.class; - } - - /** - * The column reqbaz.user.id. - */ - public final TableField ID = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.user.first_name. - */ - public final TableField FIRST_NAME = createField("first_name", org.jooq.impl.SQLDataType.VARCHAR.length(150), this, ""); - - /** - * The column reqbaz.user.last_name. - */ - public final TableField LAST_NAME = createField("last_name", org.jooq.impl.SQLDataType.VARCHAR.length(150), this, ""); - - /** - * The column reqbaz.user.email. - */ - public final TableField EMAIL = createField("email", org.jooq.impl.SQLDataType.VARCHAR.length(255).nullable(false), this, ""); - - /** - * The column reqbaz.user.admin. - */ - public final TableField ADMIN = createField("admin", org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); - - /** - * The column reqbaz.user.las2peer_id. - */ - public final TableField LAS2PEER_ID = createField("las2peer_id", org.jooq.impl.SQLDataType.VARCHAR.length(128), this, ""); - - /** - * The column reqbaz.user.user_name. - */ - public final TableField USER_NAME = createField("user_name", org.jooq.impl.SQLDataType.VARCHAR.length(255), this, ""); - - /** - * The column reqbaz.user.profile_image. - */ - public final TableField PROFILE_IMAGE = createField("profile_image", org.jooq.impl.SQLDataType.CLOB, this, ""); - - /** - * The column reqbaz.user.email_lead_subscription. - */ - public final TableField EMAIL_LEAD_SUBSCRIPTION = createField("email_lead_subscription", org.jooq.impl.SQLDataType.TINYINT.nullable(false).defaultValue(org.jooq.impl.DSL.inline("1", org.jooq.impl.SQLDataType.TINYINT)), this, ""); - - /** - * The column reqbaz.user.email_follow_subscription. - */ - public final TableField EMAIL_FOLLOW_SUBSCRIPTION = createField("email_follow_subscription", org.jooq.impl.SQLDataType.TINYINT.nullable(false).defaultValue(org.jooq.impl.DSL.inline("1", org.jooq.impl.SQLDataType.TINYINT)), this, ""); - - /** - * The column reqbaz.user.creation_date. - */ - public final TableField CREATION_DATE = createField("creation_date", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.inline("CURRENT_TIMESTAMP", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - - /** - * The column reqbaz.user.last_updated_date. - */ - public final TableField LAST_UPDATED_DATE = createField("last_updated_date", org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); - - /** - * The column reqbaz.user.last_login_date. - */ - public final TableField LAST_LOGIN_DATE = createField("last_login_date", org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); - - /** - * The column reqbaz.user.personalization_enabled. - */ - public final TableField PERSONALIZATION_ENABLED = createField("personalization_enabled", org.jooq.impl.SQLDataType.TINYINT.defaultValue(org.jooq.impl.DSL.inline("1", org.jooq.impl.SQLDataType.TINYINT)), this, ""); - - /** - * Create a reqbaz.user table reference - */ - public User() { - this("user", null); - } - - /** - * Create an aliased reqbaz.user table reference - */ - public User(String alias) { - this(alias, USER); - } - - private User(String alias, Table aliased) { - this(alias, aliased, null); - } - - private User(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Reqbaz.REQBAZ; - } - - /** - * {@inheritDoc} - */ - @Override - public Identity getIdentity() { - return Keys.IDENTITY_USER; - } - - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() { - return Keys.KEY_USER_PRIMARY; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.KEY_USER_PRIMARY); - } - - /** - * {@inheritDoc} - */ - @Override - public User as(String alias) { - return new User(alias, this); - } - - /** - * Rename this table - */ - @Override - public User rename(String name) { - return new User(name, null); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/UserRoleMap.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/UserRoleMap.java deleted file mode 100644 index 3bcdd532..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/UserRoleMap.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.UserRoleMapRecord; - -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class UserRoleMap extends TableImpl { - - private static final long serialVersionUID = 902266899; - - /** - * The reference instance of reqbaz.user_role_map - */ - public static final UserRoleMap USER_ROLE_MAP = new UserRoleMap(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return UserRoleMapRecord.class; - } - - /** - * The column reqbaz.user_role_map.id. - */ - public final TableField ID = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.user_role_map.role_id. - */ - public final TableField ROLE_ID = createField("role_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.user_role_map.user_id. - */ - public final TableField USER_ID = createField("user_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.user_role_map.context_info. - */ - public final TableField CONTEXT_INFO = createField("context_info", org.jooq.impl.SQLDataType.VARCHAR.length(255), this, ""); - - /** - * Create a reqbaz.user_role_map table reference - */ - public UserRoleMap() { - this("user_role_map", null); - } - - /** - * Create an aliased reqbaz.user_role_map table reference - */ - public UserRoleMap(String alias) { - this(alias, USER_ROLE_MAP); - } - - private UserRoleMap(String alias, Table aliased) { - this(alias, aliased, null); - } - - private UserRoleMap(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Reqbaz.REQBAZ; - } - - /** - * {@inheritDoc} - */ - @Override - public Identity getIdentity() { - return Keys.IDENTITY_USER_ROLE_MAP; - } - - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() { - return Keys.KEY_USER_ROLE_MAP_PRIMARY; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.KEY_USER_ROLE_MAP_PRIMARY); - } - - /** - * {@inheritDoc} - */ - @Override - public List> getReferences() { - return Arrays.>asList(Keys.USER_ROLE_MAP_ROLE, Keys.USER_ROLE_MAP_USER); - } - - /** - * {@inheritDoc} - */ - @Override - public UserRoleMap as(String alias) { - return new UserRoleMap(alias, this); - } - - /** - * Rename this table - */ - @Override - public UserRoleMap rename(String name) { - return new UserRoleMap(name, null); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Vote.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Vote.java deleted file mode 100644 index bfb5a536..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/Vote.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Keys; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.Reqbaz; -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.VoteRecord; - -import java.sql.Timestamp; -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class Vote extends TableImpl { - - private static final long serialVersionUID = 1104351894; - - /** - * The reference instance of reqbaz.vote - */ - public static final Vote VOTE = new Vote(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return VoteRecord.class; - } - - /** - * The column reqbaz.vote.id. - */ - public final TableField ID = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.vote.is_upvote. - */ - public final TableField IS_UPVOTE = createField("is_upvote", org.jooq.impl.SQLDataType.TINYINT.nullable(false), this, ""); - - /** - * The column reqbaz.vote.requirement_id. - */ - public final TableField REQUIREMENT_ID = createField("requirement_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.vote.user_id. - */ - public final TableField USER_ID = createField("user_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column reqbaz.vote.creation_date. - */ - public final TableField CREATION_DATE = createField("creation_date", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.inline("CURRENT_TIMESTAMP", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - - /** - * Create a reqbaz.vote table reference - */ - public Vote() { - this("vote", null); - } - - /** - * Create an aliased reqbaz.vote table reference - */ - public Vote(String alias) { - this(alias, VOTE); - } - - private Vote(String alias, Table aliased) { - this(alias, aliased, null); - } - - private Vote(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Reqbaz.REQBAZ; - } - - /** - * {@inheritDoc} - */ - @Override - public Identity getIdentity() { - return Keys.IDENTITY_VOTE; - } - - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() { - return Keys.KEY_VOTE_PRIMARY; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.KEY_VOTE_PRIMARY); - } - - /** - * {@inheritDoc} - */ - @Override - public List> getReferences() { - return Arrays.>asList(Keys.VOTE_REQUIREMENT, Keys.VOTE_USER); - } - - /** - * {@inheritDoc} - */ - @Override - public Vote as(String alias) { - return new Vote(alias, this); - } - - /** - * Rename this table - */ - @Override - public Vote rename(String name) { - return new Vote(name, null); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/AttachmentRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/AttachmentRecord.java deleted file mode 100644 index 2dd804ff..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/AttachmentRecord.java +++ /dev/null @@ -1,503 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Attachment; - -import java.sql.Timestamp; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record10; -import org.jooq.Row10; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class AttachmentRecord extends UpdatableRecordImpl implements Record10 { - - private static final long serialVersionUID = 888863633; - - /** - * Setter for reqbaz.attachment.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for reqbaz.attachment.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for reqbaz.attachment.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(1, value); - } - - /** - * Getter for reqbaz.attachment.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(1); - } - - /** - * Setter for reqbaz.attachment.last_updated_date. - */ - public void setLastUpdatedDate(Timestamp value) { - set(2, value); - } - - /** - * Getter for reqbaz.attachment.last_updated_date. - */ - public Timestamp getLastUpdatedDate() { - return (Timestamp) get(2); - } - - /** - * Setter for reqbaz.attachment.requirement_id. - */ - public void setRequirementId(Integer value) { - set(3, value); - } - - /** - * Getter for reqbaz.attachment.requirement_id. - */ - public Integer getRequirementId() { - return (Integer) get(3); - } - - /** - * Setter for reqbaz.attachment.user_id. - */ - public void setUserId(Integer value) { - set(4, value); - } - - /** - * Getter for reqbaz.attachment.user_id. - */ - public Integer getUserId() { - return (Integer) get(4); - } - - /** - * Setter for reqbaz.attachment.name. - */ - public void setName(String value) { - set(5, value); - } - - /** - * Getter for reqbaz.attachment.name. - */ - public String getName() { - return (String) get(5); - } - - /** - * Setter for reqbaz.attachment.description. - */ - public void setDescription(String value) { - set(6, value); - } - - /** - * Getter for reqbaz.attachment.description. - */ - public String getDescription() { - return (String) get(6); - } - - /** - * Setter for reqbaz.attachment.mime_type. - */ - public void setMimeType(String value) { - set(7, value); - } - - /** - * Getter for reqbaz.attachment.mime_type. - */ - public String getMimeType() { - return (String) get(7); - } - - /** - * Setter for reqbaz.attachment.identifier. - */ - public void setIdentifier(String value) { - set(8, value); - } - - /** - * Getter for reqbaz.attachment.identifier. - */ - public String getIdentifier() { - return (String) get(8); - } - - /** - * Setter for reqbaz.attachment.file_url. - */ - public void setFileUrl(String value) { - set(9, value); - } - - /** - * Getter for reqbaz.attachment.file_url. - */ - public String getFileUrl() { - return (String) get(9); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record10 type implementation - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Row10 fieldsRow() { - return (Row10) super.fieldsRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Row10 valuesRow() { - return (Row10) super.valuesRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Field field1() { - return Attachment.ATTACHMENT.ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field2() { - return Attachment.ATTACHMENT.CREATION_DATE; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field3() { - return Attachment.ATTACHMENT.LAST_UPDATED_DATE; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field4() { - return Attachment.ATTACHMENT.REQUIREMENT_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field5() { - return Attachment.ATTACHMENT.USER_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field6() { - return Attachment.ATTACHMENT.NAME; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field7() { - return Attachment.ATTACHMENT.DESCRIPTION; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field8() { - return Attachment.ATTACHMENT.MIME_TYPE; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field9() { - return Attachment.ATTACHMENT.IDENTIFIER; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field10() { - return Attachment.ATTACHMENT.FILE_URL; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value1() { - return getId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Timestamp value2() { - return getCreationDate(); - } - - /** - * {@inheritDoc} - */ - @Override - public Timestamp value3() { - return getLastUpdatedDate(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value4() { - return getRequirementId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value5() { - return getUserId(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value6() { - return getName(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value7() { - return getDescription(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value8() { - return getMimeType(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value9() { - return getIdentifier(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value10() { - return getFileUrl(); - } - - /** - * {@inheritDoc} - */ - @Override - public AttachmentRecord value1(Integer value) { - setId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AttachmentRecord value2(Timestamp value) { - setCreationDate(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AttachmentRecord value3(Timestamp value) { - setLastUpdatedDate(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AttachmentRecord value4(Integer value) { - setRequirementId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AttachmentRecord value5(Integer value) { - setUserId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AttachmentRecord value6(String value) { - setName(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AttachmentRecord value7(String value) { - setDescription(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AttachmentRecord value8(String value) { - setMimeType(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AttachmentRecord value9(String value) { - setIdentifier(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AttachmentRecord value10(String value) { - setFileUrl(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AttachmentRecord values(Integer value1, Timestamp value2, Timestamp value3, Integer value4, Integer value5, String value6, String value7, String value8, String value9, String value10) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - value10(value10); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached AttachmentRecord - */ - public AttachmentRecord() { - super(Attachment.ATTACHMENT); - } - - /** - * Create a detached, initialised AttachmentRecord - */ - public AttachmentRecord(Integer id, Timestamp creationDate, Timestamp lastUpdatedDate, Integer requirementId, Integer userId, String name, String description, String mimeType, String identifier, String fileUrl) { - super(Attachment.ATTACHMENT); - - set(0, id); - set(1, creationDate); - set(2, lastUpdatedDate); - set(3, requirementId); - set(4, userId); - set(5, name); - set(6, description); - set(7, mimeType); - set(8, identifier); - set(9, fileUrl); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CategoryFollowerMapRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CategoryFollowerMapRecord.java deleted file mode 100644 index d4c1bbea..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CategoryFollowerMapRecord.java +++ /dev/null @@ -1,257 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.CategoryFollowerMap; - -import java.sql.Timestamp; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record4; -import org.jooq.Row4; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class CategoryFollowerMapRecord extends UpdatableRecordImpl implements Record4 { - - private static final long serialVersionUID = 725392326; - - /** - * Setter for reqbaz.category_follower_map.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for reqbaz.category_follower_map.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for reqbaz.category_follower_map.category_id. - */ - public void setCategoryId(Integer value) { - set(1, value); - } - - /** - * Getter for reqbaz.category_follower_map.category_id. - */ - public Integer getCategoryId() { - return (Integer) get(1); - } - - /** - * Setter for reqbaz.category_follower_map.user_id. - */ - public void setUserId(Integer value) { - set(2, value); - } - - /** - * Getter for reqbaz.category_follower_map.user_id. - */ - public Integer getUserId() { - return (Integer) get(2); - } - - /** - * Setter for reqbaz.category_follower_map.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(3, value); - } - - /** - * Getter for reqbaz.category_follower_map.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(3); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Field field1() { - return CategoryFollowerMap.CATEGORY_FOLLOWER_MAP.ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field2() { - return CategoryFollowerMap.CATEGORY_FOLLOWER_MAP.CATEGORY_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field3() { - return CategoryFollowerMap.CATEGORY_FOLLOWER_MAP.USER_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field4() { - return CategoryFollowerMap.CATEGORY_FOLLOWER_MAP.CREATION_DATE; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value1() { - return getId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value2() { - return getCategoryId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value3() { - return getUserId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Timestamp value4() { - return getCreationDate(); - } - - /** - * {@inheritDoc} - */ - @Override - public CategoryFollowerMapRecord value1(Integer value) { - setId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CategoryFollowerMapRecord value2(Integer value) { - setCategoryId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CategoryFollowerMapRecord value3(Integer value) { - setUserId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CategoryFollowerMapRecord value4(Timestamp value) { - setCreationDate(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CategoryFollowerMapRecord values(Integer value1, Integer value2, Integer value3, Timestamp value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached CategoryFollowerMapRecord - */ - public CategoryFollowerMapRecord() { - super(CategoryFollowerMap.CATEGORY_FOLLOWER_MAP); - } - - /** - * Create a detached, initialised CategoryFollowerMapRecord - */ - public CategoryFollowerMapRecord(Integer id, Integer categoryId, Integer userId, Timestamp creationDate) { - super(CategoryFollowerMap.CATEGORY_FOLLOWER_MAP); - - set(0, id); - set(1, categoryId); - set(2, userId); - set(3, creationDate); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CategoryRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CategoryRecord.java deleted file mode 100644 index 05516d2d..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CategoryRecord.java +++ /dev/null @@ -1,380 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Category; - -import java.sql.Timestamp; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record7; -import org.jooq.Row7; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class CategoryRecord extends UpdatableRecordImpl implements Record7 { - - private static final long serialVersionUID = 1461191440; - - /** - * Setter for reqbaz.category.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for reqbaz.category.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for reqbaz.category.name. - */ - public void setName(String value) { - set(1, value); - } - - /** - * Getter for reqbaz.category.name. - */ - public String getName() { - return (String) get(1); - } - - /** - * Setter for reqbaz.category.description. - */ - public void setDescription(String value) { - set(2, value); - } - - /** - * Getter for reqbaz.category.description. - */ - public String getDescription() { - return (String) get(2); - } - - /** - * Setter for reqbaz.category.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(3, value); - } - - /** - * Getter for reqbaz.category.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(3); - } - - /** - * Setter for reqbaz.category.last_updated_date. - */ - public void setLastUpdatedDate(Timestamp value) { - set(4, value); - } - - /** - * Getter for reqbaz.category.last_updated_date. - */ - public Timestamp getLastUpdatedDate() { - return (Timestamp) get(4); - } - - /** - * Setter for reqbaz.category.project_id. - */ - public void setProjectId(Integer value) { - set(5, value); - } - - /** - * Getter for reqbaz.category.project_id. - */ - public Integer getProjectId() { - return (Integer) get(5); - } - - /** - * Setter for reqbaz.category.leader_id. - */ - public void setLeaderId(Integer value) { - set(6, value); - } - - /** - * Getter for reqbaz.category.leader_id. - */ - public Integer getLeaderId() { - return (Integer) get(6); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record7 type implementation - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Row7 fieldsRow() { - return (Row7) super.fieldsRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Row7 valuesRow() { - return (Row7) super.valuesRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Field field1() { - return Category.CATEGORY.ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field2() { - return Category.CATEGORY.NAME; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field3() { - return Category.CATEGORY.DESCRIPTION; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field4() { - return Category.CATEGORY.CREATION_DATE; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field5() { - return Category.CATEGORY.LAST_UPDATED_DATE; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field6() { - return Category.CATEGORY.PROJECT_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field7() { - return Category.CATEGORY.LEADER_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value1() { - return getId(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value2() { - return getName(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value3() { - return getDescription(); - } - - /** - * {@inheritDoc} - */ - @Override - public Timestamp value4() { - return getCreationDate(); - } - - /** - * {@inheritDoc} - */ - @Override - public Timestamp value5() { - return getLastUpdatedDate(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value6() { - return getProjectId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value7() { - return getLeaderId(); - } - - /** - * {@inheritDoc} - */ - @Override - public CategoryRecord value1(Integer value) { - setId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CategoryRecord value2(String value) { - setName(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CategoryRecord value3(String value) { - setDescription(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CategoryRecord value4(Timestamp value) { - setCreationDate(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CategoryRecord value5(Timestamp value) { - setLastUpdatedDate(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CategoryRecord value6(Integer value) { - setProjectId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CategoryRecord value7(Integer value) { - setLeaderId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CategoryRecord values(Integer value1, String value2, String value3, Timestamp value4, Timestamp value5, Integer value6, Integer value7) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached CategoryRecord - */ - public CategoryRecord() { - super(Category.CATEGORY); - } - - /** - * Create a detached, initialised CategoryRecord - */ - public CategoryRecord(Integer id, String name, String description, Timestamp creationDate, Timestamp lastUpdatedDate, Integer projectId, Integer leaderId) { - super(Category.CATEGORY); - - set(0, id); - set(1, name); - set(2, description); - set(3, creationDate); - set(4, lastUpdatedDate); - set(5, projectId); - set(6, leaderId); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CommentRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CommentRecord.java deleted file mode 100644 index b1df5177..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/CommentRecord.java +++ /dev/null @@ -1,380 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Comment; - -import java.sql.Timestamp; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record7; -import org.jooq.Row7; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class CommentRecord extends UpdatableRecordImpl implements Record7 { - - private static final long serialVersionUID = 191217760; - - /** - * Setter for reqbaz.comment.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for reqbaz.comment.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for reqbaz.comment.message. - */ - public void setMessage(String value) { - set(1, value); - } - - /** - * Getter for reqbaz.comment.message. - */ - public String getMessage() { - return (String) get(1); - } - - /** - * Setter for reqbaz.comment.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(2, value); - } - - /** - * Getter for reqbaz.comment.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(2); - } - - /** - * Setter for reqbaz.comment.last_updated_date. - */ - public void setLastUpdatedDate(Timestamp value) { - set(3, value); - } - - /** - * Getter for reqbaz.comment.last_updated_date. - */ - public Timestamp getLastUpdatedDate() { - return (Timestamp) get(3); - } - - /** - * Setter for reqbaz.comment.requirement_id. - */ - public void setRequirementId(Integer value) { - set(4, value); - } - - /** - * Getter for reqbaz.comment.requirement_id. - */ - public Integer getRequirementId() { - return (Integer) get(4); - } - - /** - * Setter for reqbaz.comment.user_id. - */ - public void setUserId(Integer value) { - set(5, value); - } - - /** - * Getter for reqbaz.comment.user_id. - */ - public Integer getUserId() { - return (Integer) get(5); - } - - /** - * Setter for reqbaz.comment.reply_to_comment_id. - */ - public void setReplyToCommentId(Integer value) { - set(6, value); - } - - /** - * Getter for reqbaz.comment.reply_to_comment_id. - */ - public Integer getReplyToCommentId() { - return (Integer) get(6); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record7 type implementation - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Row7 fieldsRow() { - return (Row7) super.fieldsRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Row7 valuesRow() { - return (Row7) super.valuesRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Field field1() { - return Comment.COMMENT.ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field2() { - return Comment.COMMENT.MESSAGE; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field3() { - return Comment.COMMENT.CREATION_DATE; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field4() { - return Comment.COMMENT.LAST_UPDATED_DATE; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field5() { - return Comment.COMMENT.REQUIREMENT_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field6() { - return Comment.COMMENT.USER_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field7() { - return Comment.COMMENT.REPLY_TO_COMMENT_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value1() { - return getId(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value2() { - return getMessage(); - } - - /** - * {@inheritDoc} - */ - @Override - public Timestamp value3() { - return getCreationDate(); - } - - /** - * {@inheritDoc} - */ - @Override - public Timestamp value4() { - return getLastUpdatedDate(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value5() { - return getRequirementId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value6() { - return getUserId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value7() { - return getReplyToCommentId(); - } - - /** - * {@inheritDoc} - */ - @Override - public CommentRecord value1(Integer value) { - setId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CommentRecord value2(String value) { - setMessage(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CommentRecord value3(Timestamp value) { - setCreationDate(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CommentRecord value4(Timestamp value) { - setLastUpdatedDate(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CommentRecord value5(Integer value) { - setRequirementId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CommentRecord value6(Integer value) { - setUserId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CommentRecord value7(Integer value) { - setReplyToCommentId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CommentRecord values(Integer value1, String value2, Timestamp value3, Timestamp value4, Integer value5, Integer value6, Integer value7) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached CommentRecord - */ - public CommentRecord() { - super(Comment.COMMENT); - } - - /** - * Create a detached, initialised CommentRecord - */ - public CommentRecord(Integer id, String message, Timestamp creationDate, Timestamp lastUpdatedDate, Integer requirementId, Integer userId, Integer replyToCommentId) { - super(Comment.COMMENT); - - set(0, id); - set(1, message); - set(2, creationDate); - set(3, lastUpdatedDate); - set(4, requirementId); - set(5, userId); - set(6, replyToCommentId); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/PersonalisationDataRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/PersonalisationDataRecord.java deleted file mode 100644 index f9512ac4..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/PersonalisationDataRecord.java +++ /dev/null @@ -1,380 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.PersonalisationData; - -import java.sql.Timestamp; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record7; -import org.jooq.Row7; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class PersonalisationDataRecord extends UpdatableRecordImpl implements Record7 { - - private static final long serialVersionUID = 1698925945; - - /** - * Setter for reqbaz.personalisation_data.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for reqbaz.personalisation_data.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for reqbaz.personalisation_data.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(1, value); - } - - /** - * Getter for reqbaz.personalisation_data.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(1); - } - - /** - * Setter for reqbaz.personalisation_data.last_updated_date. - */ - public void setLastUpdatedDate(Timestamp value) { - set(2, value); - } - - /** - * Getter for reqbaz.personalisation_data.last_updated_date. - */ - public Timestamp getLastUpdatedDate() { - return (Timestamp) get(2); - } - - /** - * Setter for reqbaz.personalisation_data.identifier. - */ - public void setIdentifier(String value) { - set(3, value); - } - - /** - * Getter for reqbaz.personalisation_data.identifier. - */ - public String getIdentifier() { - return (String) get(3); - } - - /** - * Setter for reqbaz.personalisation_data.user_id. - */ - public void setUserId(Integer value) { - set(4, value); - } - - /** - * Getter for reqbaz.personalisation_data.user_id. - */ - public Integer getUserId() { - return (Integer) get(4); - } - - /** - * Setter for reqbaz.personalisation_data.version. - */ - public void setVersion(Integer value) { - set(5, value); - } - - /** - * Getter for reqbaz.personalisation_data.version. - */ - public Integer getVersion() { - return (Integer) get(5); - } - - /** - * Setter for reqbaz.personalisation_data.setting. - */ - public void setSetting(String value) { - set(6, value); - } - - /** - * Getter for reqbaz.personalisation_data.setting. - */ - public String getSetting() { - return (String) get(6); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record7 type implementation - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Row7 fieldsRow() { - return (Row7) super.fieldsRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Row7 valuesRow() { - return (Row7) super.valuesRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Field field1() { - return PersonalisationData.PERSONALISATION_DATA.ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field2() { - return PersonalisationData.PERSONALISATION_DATA.CREATION_DATE; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field3() { - return PersonalisationData.PERSONALISATION_DATA.LAST_UPDATED_DATE; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field4() { - return PersonalisationData.PERSONALISATION_DATA.IDENTIFIER; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field5() { - return PersonalisationData.PERSONALISATION_DATA.USER_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field6() { - return PersonalisationData.PERSONALISATION_DATA.VERSION; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field7() { - return PersonalisationData.PERSONALISATION_DATA.SETTING; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value1() { - return getId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Timestamp value2() { - return getCreationDate(); - } - - /** - * {@inheritDoc} - */ - @Override - public Timestamp value3() { - return getLastUpdatedDate(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value4() { - return getIdentifier(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value5() { - return getUserId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value6() { - return getVersion(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value7() { - return getSetting(); - } - - /** - * {@inheritDoc} - */ - @Override - public PersonalisationDataRecord value1(Integer value) { - setId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PersonalisationDataRecord value2(Timestamp value) { - setCreationDate(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PersonalisationDataRecord value3(Timestamp value) { - setLastUpdatedDate(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PersonalisationDataRecord value4(String value) { - setIdentifier(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PersonalisationDataRecord value5(Integer value) { - setUserId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PersonalisationDataRecord value6(Integer value) { - setVersion(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PersonalisationDataRecord value7(String value) { - setSetting(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PersonalisationDataRecord values(Integer value1, Timestamp value2, Timestamp value3, String value4, Integer value5, Integer value6, String value7) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached PersonalisationDataRecord - */ - public PersonalisationDataRecord() { - super(PersonalisationData.PERSONALISATION_DATA); - } - - /** - * Create a detached, initialised PersonalisationDataRecord - */ - public PersonalisationDataRecord(Integer id, Timestamp creationDate, Timestamp lastUpdatedDate, String identifier, Integer userId, Integer version, String setting) { - super(PersonalisationData.PERSONALISATION_DATA); - - set(0, id); - set(1, creationDate); - set(2, lastUpdatedDate); - set(3, identifier); - set(4, userId); - set(5, version); - set(6, setting); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/PrivilegeRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/PrivilegeRecord.java deleted file mode 100644 index 699fad6f..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/PrivilegeRecord.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Privilege; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record2; -import org.jooq.Row2; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class PrivilegeRecord extends UpdatableRecordImpl implements Record2 { - - private static final long serialVersionUID = -324005622; - - /** - * Setter for reqbaz.privilege.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for reqbaz.privilege.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for reqbaz.privilege.name. - */ - public void setName(String value) { - set(1, value); - } - - /** - * Getter for reqbaz.privilege.name. - */ - public String getName() { - return (String) get(1); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Field field1() { - return Privilege.PRIVILEGE.ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field2() { - return Privilege.PRIVILEGE.NAME; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value1() { - return getId(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value2() { - return getName(); - } - - /** - * {@inheritDoc} - */ - @Override - public PrivilegeRecord value1(Integer value) { - setId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PrivilegeRecord value2(String value) { - setName(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PrivilegeRecord values(Integer value1, String value2) { - value1(value1); - value2(value2); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached PrivilegeRecord - */ - public PrivilegeRecord() { - super(Privilege.PRIVILEGE); - } - - /** - * Create a detached, initialised PrivilegeRecord - */ - public PrivilegeRecord(Integer id, String name) { - super(Privilege.PRIVILEGE); - - set(0, id); - set(1, name); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/ProjectFollowerMapRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/ProjectFollowerMapRecord.java deleted file mode 100644 index 8fa81dc4..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/ProjectFollowerMapRecord.java +++ /dev/null @@ -1,257 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.ProjectFollowerMap; - -import java.sql.Timestamp; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record4; -import org.jooq.Row4; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class ProjectFollowerMapRecord extends UpdatableRecordImpl implements Record4 { - - private static final long serialVersionUID = 327516215; - - /** - * Setter for reqbaz.project_follower_map.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for reqbaz.project_follower_map.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for reqbaz.project_follower_map.project_id. - */ - public void setProjectId(Integer value) { - set(1, value); - } - - /** - * Getter for reqbaz.project_follower_map.project_id. - */ - public Integer getProjectId() { - return (Integer) get(1); - } - - /** - * Setter for reqbaz.project_follower_map.user_id. - */ - public void setUserId(Integer value) { - set(2, value); - } - - /** - * Getter for reqbaz.project_follower_map.user_id. - */ - public Integer getUserId() { - return (Integer) get(2); - } - - /** - * Setter for reqbaz.project_follower_map.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(3, value); - } - - /** - * Getter for reqbaz.project_follower_map.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(3); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Field field1() { - return ProjectFollowerMap.PROJECT_FOLLOWER_MAP.ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field2() { - return ProjectFollowerMap.PROJECT_FOLLOWER_MAP.PROJECT_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field3() { - return ProjectFollowerMap.PROJECT_FOLLOWER_MAP.USER_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field4() { - return ProjectFollowerMap.PROJECT_FOLLOWER_MAP.CREATION_DATE; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value1() { - return getId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value2() { - return getProjectId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value3() { - return getUserId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Timestamp value4() { - return getCreationDate(); - } - - /** - * {@inheritDoc} - */ - @Override - public ProjectFollowerMapRecord value1(Integer value) { - setId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ProjectFollowerMapRecord value2(Integer value) { - setProjectId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ProjectFollowerMapRecord value3(Integer value) { - setUserId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ProjectFollowerMapRecord value4(Timestamp value) { - setCreationDate(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ProjectFollowerMapRecord values(Integer value1, Integer value2, Integer value3, Timestamp value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached ProjectFollowerMapRecord - */ - public ProjectFollowerMapRecord() { - super(ProjectFollowerMap.PROJECT_FOLLOWER_MAP); - } - - /** - * Create a detached, initialised ProjectFollowerMapRecord - */ - public ProjectFollowerMapRecord(Integer id, Integer projectId, Integer userId, Timestamp creationDate) { - super(ProjectFollowerMap.PROJECT_FOLLOWER_MAP); - - set(0, id); - set(1, projectId); - set(2, userId); - set(3, creationDate); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/ProjectRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/ProjectRecord.java deleted file mode 100644 index 677b63f3..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/ProjectRecord.java +++ /dev/null @@ -1,421 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Project; - -import java.sql.Timestamp; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record8; -import org.jooq.Row8; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class ProjectRecord extends UpdatableRecordImpl implements Record8 { - - private static final long serialVersionUID = 416723320; - - /** - * Setter for reqbaz.project.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for reqbaz.project.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for reqbaz.project.name. - */ - public void setName(String value) { - set(1, value); - } - - /** - * Getter for reqbaz.project.name. - */ - public String getName() { - return (String) get(1); - } - - /** - * Setter for reqbaz.project.description. - */ - public void setDescription(String value) { - set(2, value); - } - - /** - * Getter for reqbaz.project.description. - */ - public String getDescription() { - return (String) get(2); - } - - /** - * Setter for reqbaz.project.visibility. - */ - public void setVisibility(Byte value) { - set(3, value); - } - - /** - * Getter for reqbaz.project.visibility. - */ - public Byte getVisibility() { - return (Byte) get(3); - } - - /** - * Setter for reqbaz.project.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(4, value); - } - - /** - * Getter for reqbaz.project.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(4); - } - - /** - * Setter for reqbaz.project.last_updated_date. - */ - public void setLastUpdatedDate(Timestamp value) { - set(5, value); - } - - /** - * Getter for reqbaz.project.last_updated_date. - */ - public Timestamp getLastUpdatedDate() { - return (Timestamp) get(5); - } - - /** - * Setter for reqbaz.project.leader_id. - */ - public void setLeaderId(Integer value) { - set(6, value); - } - - /** - * Getter for reqbaz.project.leader_id. - */ - public Integer getLeaderId() { - return (Integer) get(6); - } - - /** - * Setter for reqbaz.project.default_category_id. - */ - public void setDefaultCategoryId(Integer value) { - set(7, value); - } - - /** - * Getter for reqbaz.project.default_category_id. - */ - public Integer getDefaultCategoryId() { - return (Integer) get(7); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Row8 valuesRow() { - return (Row8) super.valuesRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Field field1() { - return Project.PROJECT.ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field2() { - return Project.PROJECT.NAME; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field3() { - return Project.PROJECT.DESCRIPTION; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field4() { - return Project.PROJECT.VISIBILITY; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field5() { - return Project.PROJECT.CREATION_DATE; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field6() { - return Project.PROJECT.LAST_UPDATED_DATE; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field7() { - return Project.PROJECT.LEADER_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field8() { - return Project.PROJECT.DEFAULT_CATEGORY_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value1() { - return getId(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value2() { - return getName(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value3() { - return getDescription(); - } - - /** - * {@inheritDoc} - */ - @Override - public Byte value4() { - return getVisibility(); - } - - /** - * {@inheritDoc} - */ - @Override - public Timestamp value5() { - return getCreationDate(); - } - - /** - * {@inheritDoc} - */ - @Override - public Timestamp value6() { - return getLastUpdatedDate(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value7() { - return getLeaderId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value8() { - return getDefaultCategoryId(); - } - - /** - * {@inheritDoc} - */ - @Override - public ProjectRecord value1(Integer value) { - setId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ProjectRecord value2(String value) { - setName(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ProjectRecord value3(String value) { - setDescription(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ProjectRecord value4(Byte value) { - setVisibility(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ProjectRecord value5(Timestamp value) { - setCreationDate(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ProjectRecord value6(Timestamp value) { - setLastUpdatedDate(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ProjectRecord value7(Integer value) { - setLeaderId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ProjectRecord value8(Integer value) { - setDefaultCategoryId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ProjectRecord values(Integer value1, String value2, String value3, Byte value4, Timestamp value5, Timestamp value6, Integer value7, Integer value8) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached ProjectRecord - */ - public ProjectRecord() { - super(Project.PROJECT); - } - - /** - * Create a detached, initialised ProjectRecord - */ - public ProjectRecord(Integer id, String name, String description, Byte visibility, Timestamp creationDate, Timestamp lastUpdatedDate, Integer leaderId, Integer defaultCategoryId) { - super(Project.PROJECT); - - set(0, id); - set(1, name); - set(2, description); - set(3, visibility); - set(4, creationDate); - set(5, lastUpdatedDate); - set(6, leaderId); - set(7, defaultCategoryId); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementCategoryMapRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementCategoryMapRecord.java deleted file mode 100644 index 1919dadb..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementCategoryMapRecord.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementCategoryMap; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record3; -import org.jooq.Row3; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class RequirementCategoryMapRecord extends UpdatableRecordImpl implements Record3 { - - private static final long serialVersionUID = -1847480760; - - /** - * Setter for reqbaz.requirement_category_map.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for reqbaz.requirement_category_map.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for reqbaz.requirement_category_map.category_id. - */ - public void setCategoryId(Integer value) { - set(1, value); - } - - /** - * Getter for reqbaz.requirement_category_map.category_id. - */ - public Integer getCategoryId() { - return (Integer) get(1); - } - - /** - * Setter for reqbaz.requirement_category_map.requirement_id. - */ - public void setRequirementId(Integer value) { - set(2, value); - } - - /** - * Getter for reqbaz.requirement_category_map.requirement_id. - */ - public Integer getRequirementId() { - return (Integer) get(2); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Field field1() { - return RequirementCategoryMap.REQUIREMENT_CATEGORY_MAP.ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field2() { - return RequirementCategoryMap.REQUIREMENT_CATEGORY_MAP.CATEGORY_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field3() { - return RequirementCategoryMap.REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value1() { - return getId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value2() { - return getCategoryId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value3() { - return getRequirementId(); - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementCategoryMapRecord value1(Integer value) { - setId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementCategoryMapRecord value2(Integer value) { - setCategoryId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementCategoryMapRecord value3(Integer value) { - setRequirementId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementCategoryMapRecord values(Integer value1, Integer value2, Integer value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached RequirementCategoryMapRecord - */ - public RequirementCategoryMapRecord() { - super(RequirementCategoryMap.REQUIREMENT_CATEGORY_MAP); - } - - /** - * Create a detached, initialised RequirementCategoryMapRecord - */ - public RequirementCategoryMapRecord(Integer id, Integer categoryId, Integer requirementId) { - super(RequirementCategoryMap.REQUIREMENT_CATEGORY_MAP); - - set(0, id); - set(1, categoryId); - set(2, requirementId); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementDeveloperMapRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementDeveloperMapRecord.java deleted file mode 100644 index 4732385e..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementDeveloperMapRecord.java +++ /dev/null @@ -1,257 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementDeveloperMap; - -import java.sql.Timestamp; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record4; -import org.jooq.Row4; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class RequirementDeveloperMapRecord extends UpdatableRecordImpl implements Record4 { - - private static final long serialVersionUID = -738697457; - - /** - * Setter for reqbaz.requirement_developer_map.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for reqbaz.requirement_developer_map.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for reqbaz.requirement_developer_map.requirement_id. - */ - public void setRequirementId(Integer value) { - set(1, value); - } - - /** - * Getter for reqbaz.requirement_developer_map.requirement_id. - */ - public Integer getRequirementId() { - return (Integer) get(1); - } - - /** - * Setter for reqbaz.requirement_developer_map.user_id. - */ - public void setUserId(Integer value) { - set(2, value); - } - - /** - * Getter for reqbaz.requirement_developer_map.user_id. - */ - public Integer getUserId() { - return (Integer) get(2); - } - - /** - * Setter for reqbaz.requirement_developer_map.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(3, value); - } - - /** - * Getter for reqbaz.requirement_developer_map.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(3); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Field field1() { - return RequirementDeveloperMap.REQUIREMENT_DEVELOPER_MAP.ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field2() { - return RequirementDeveloperMap.REQUIREMENT_DEVELOPER_MAP.REQUIREMENT_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field3() { - return RequirementDeveloperMap.REQUIREMENT_DEVELOPER_MAP.USER_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field4() { - return RequirementDeveloperMap.REQUIREMENT_DEVELOPER_MAP.CREATION_DATE; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value1() { - return getId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value2() { - return getRequirementId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value3() { - return getUserId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Timestamp value4() { - return getCreationDate(); - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementDeveloperMapRecord value1(Integer value) { - setId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementDeveloperMapRecord value2(Integer value) { - setRequirementId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementDeveloperMapRecord value3(Integer value) { - setUserId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementDeveloperMapRecord value4(Timestamp value) { - setCreationDate(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementDeveloperMapRecord values(Integer value1, Integer value2, Integer value3, Timestamp value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached RequirementDeveloperMapRecord - */ - public RequirementDeveloperMapRecord() { - super(RequirementDeveloperMap.REQUIREMENT_DEVELOPER_MAP); - } - - /** - * Create a detached, initialised RequirementDeveloperMapRecord - */ - public RequirementDeveloperMapRecord(Integer id, Integer requirementId, Integer userId, Timestamp creationDate) { - super(RequirementDeveloperMap.REQUIREMENT_DEVELOPER_MAP); - - set(0, id); - set(1, requirementId); - set(2, userId); - set(3, creationDate); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementFollowerMapRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementFollowerMapRecord.java deleted file mode 100644 index 7063172d..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementFollowerMapRecord.java +++ /dev/null @@ -1,257 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RequirementFollowerMap; - -import java.sql.Timestamp; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record4; -import org.jooq.Row4; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class RequirementFollowerMapRecord extends UpdatableRecordImpl implements Record4 { - - private static final long serialVersionUID = -1293871707; - - /** - * Setter for reqbaz.requirement_follower_map.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for reqbaz.requirement_follower_map.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for reqbaz.requirement_follower_map.requirement_id. - */ - public void setRequirementId(Integer value) { - set(1, value); - } - - /** - * Getter for reqbaz.requirement_follower_map.requirement_id. - */ - public Integer getRequirementId() { - return (Integer) get(1); - } - - /** - * Setter for reqbaz.requirement_follower_map.user_id. - */ - public void setUserId(Integer value) { - set(2, value); - } - - /** - * Getter for reqbaz.requirement_follower_map.user_id. - */ - public Integer getUserId() { - return (Integer) get(2); - } - - /** - * Setter for reqbaz.requirement_follower_map.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(3, value); - } - - /** - * Getter for reqbaz.requirement_follower_map.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(3); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Field field1() { - return RequirementFollowerMap.REQUIREMENT_FOLLOWER_MAP.ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field2() { - return RequirementFollowerMap.REQUIREMENT_FOLLOWER_MAP.REQUIREMENT_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field3() { - return RequirementFollowerMap.REQUIREMENT_FOLLOWER_MAP.USER_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field4() { - return RequirementFollowerMap.REQUIREMENT_FOLLOWER_MAP.CREATION_DATE; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value1() { - return getId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value2() { - return getRequirementId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value3() { - return getUserId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Timestamp value4() { - return getCreationDate(); - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementFollowerMapRecord value1(Integer value) { - setId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementFollowerMapRecord value2(Integer value) { - setRequirementId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementFollowerMapRecord value3(Integer value) { - setUserId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementFollowerMapRecord value4(Timestamp value) { - setCreationDate(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementFollowerMapRecord values(Integer value1, Integer value2, Integer value3, Timestamp value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached RequirementFollowerMapRecord - */ - public RequirementFollowerMapRecord() { - super(RequirementFollowerMap.REQUIREMENT_FOLLOWER_MAP); - } - - /** - * Create a detached, initialised RequirementFollowerMapRecord - */ - public RequirementFollowerMapRecord(Integer id, Integer requirementId, Integer userId, Timestamp creationDate) { - super(RequirementFollowerMap.REQUIREMENT_FOLLOWER_MAP); - - set(0, id); - set(1, requirementId); - set(2, userId); - set(3, creationDate); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementRecord.java deleted file mode 100644 index d72b12d9..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RequirementRecord.java +++ /dev/null @@ -1,462 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Requirement; - -import java.sql.Timestamp; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record9; -import org.jooq.Row9; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class RequirementRecord extends UpdatableRecordImpl implements Record9 { - - private static final long serialVersionUID = 340315030; - - /** - * Setter for reqbaz.requirement.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for reqbaz.requirement.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for reqbaz.requirement.name. - */ - public void setName(String value) { - set(1, value); - } - - /** - * Getter for reqbaz.requirement.name. - */ - public String getName() { - return (String) get(1); - } - - /** - * Setter for reqbaz.requirement.description. - */ - public void setDescription(String value) { - set(2, value); - } - - /** - * Getter for reqbaz.requirement.description. - */ - public String getDescription() { - return (String) get(2); - } - - /** - * Setter for reqbaz.requirement.realized. - */ - public void setRealized(Timestamp value) { - set(3, value); - } - - /** - * Getter for reqbaz.requirement.realized. - */ - public Timestamp getRealized() { - return (Timestamp) get(3); - } - - /** - * Setter for reqbaz.requirement.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(4, value); - } - - /** - * Getter for reqbaz.requirement.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(4); - } - - /** - * Setter for reqbaz.requirement.last_updated_date. - */ - public void setLastUpdatedDate(Timestamp value) { - set(5, value); - } - - /** - * Getter for reqbaz.requirement.last_updated_date. - */ - public Timestamp getLastUpdatedDate() { - return (Timestamp) get(5); - } - - /** - * Setter for reqbaz.requirement.lead_developer_id. - */ - public void setLeadDeveloperId(Integer value) { - set(6, value); - } - - /** - * Getter for reqbaz.requirement.lead_developer_id. - */ - public Integer getLeadDeveloperId() { - return (Integer) get(6); - } - - /** - * Setter for reqbaz.requirement.creator_id. - */ - public void setCreatorId(Integer value) { - set(7, value); - } - - /** - * Getter for reqbaz.requirement.creator_id. - */ - public Integer getCreatorId() { - return (Integer) get(7); - } - - /** - * Setter for reqbaz.requirement.project_id. - */ - public void setProjectId(Integer value) { - set(8, value); - } - - /** - * Getter for reqbaz.requirement.project_id. - */ - public Integer getProjectId() { - return (Integer) get(8); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record9 type implementation - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Row9 fieldsRow() { - return (Row9) super.fieldsRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Row9 valuesRow() { - return (Row9) super.valuesRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Field field1() { - return Requirement.REQUIREMENT.ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field2() { - return Requirement.REQUIREMENT.NAME; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field3() { - return Requirement.REQUIREMENT.DESCRIPTION; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field4() { - return Requirement.REQUIREMENT.REALIZED; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field5() { - return Requirement.REQUIREMENT.CREATION_DATE; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field6() { - return Requirement.REQUIREMENT.LAST_UPDATED_DATE; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field7() { - return Requirement.REQUIREMENT.LEAD_DEVELOPER_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field8() { - return Requirement.REQUIREMENT.CREATOR_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field9() { - return Requirement.REQUIREMENT.PROJECT_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value1() { - return getId(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value2() { - return getName(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value3() { - return getDescription(); - } - - /** - * {@inheritDoc} - */ - @Override - public Timestamp value4() { - return getRealized(); - } - - /** - * {@inheritDoc} - */ - @Override - public Timestamp value5() { - return getCreationDate(); - } - - /** - * {@inheritDoc} - */ - @Override - public Timestamp value6() { - return getLastUpdatedDate(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value7() { - return getLeadDeveloperId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value8() { - return getCreatorId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value9() { - return getProjectId(); - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementRecord value1(Integer value) { - setId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementRecord value2(String value) { - setName(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementRecord value3(String value) { - setDescription(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementRecord value4(Timestamp value) { - setRealized(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementRecord value5(Timestamp value) { - setCreationDate(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementRecord value6(Timestamp value) { - setLastUpdatedDate(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementRecord value7(Integer value) { - setLeadDeveloperId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementRecord value8(Integer value) { - setCreatorId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementRecord value9(Integer value) { - setProjectId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RequirementRecord values(Integer value1, String value2, String value3, Timestamp value4, Timestamp value5, Timestamp value6, Integer value7, Integer value8, Integer value9) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached RequirementRecord - */ - public RequirementRecord() { - super(Requirement.REQUIREMENT); - } - - /** - * Create a detached, initialised RequirementRecord - */ - public RequirementRecord(Integer id, String name, String description, Timestamp realized, Timestamp creationDate, Timestamp lastUpdatedDate, Integer leadDeveloperId, Integer creatorId, Integer projectId) { - super(Requirement.REQUIREMENT); - - set(0, id); - set(1, name); - set(2, description); - set(3, realized); - set(4, creationDate); - set(5, lastUpdatedDate); - set(6, leadDeveloperId); - set(7, creatorId); - set(8, projectId); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RolePrivilegeMapRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RolePrivilegeMapRecord.java deleted file mode 100644 index e7c955a4..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RolePrivilegeMapRecord.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RolePrivilegeMap; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record3; -import org.jooq.Row3; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class RolePrivilegeMapRecord extends UpdatableRecordImpl implements Record3 { - - private static final long serialVersionUID = -308748188; - - /** - * Setter for reqbaz.role_privilege_map.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for reqbaz.role_privilege_map.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for reqbaz.role_privilege_map.role_id. - */ - public void setRoleId(Integer value) { - set(1, value); - } - - /** - * Getter for reqbaz.role_privilege_map.role_id. - */ - public Integer getRoleId() { - return (Integer) get(1); - } - - /** - * Setter for reqbaz.role_privilege_map.privilege_id. - */ - public void setPrivilegeId(Integer value) { - set(2, value); - } - - /** - * Getter for reqbaz.role_privilege_map.privilege_id. - */ - public Integer getPrivilegeId() { - return (Integer) get(2); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Field field1() { - return RolePrivilegeMap.ROLE_PRIVILEGE_MAP.ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field2() { - return RolePrivilegeMap.ROLE_PRIVILEGE_MAP.ROLE_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field3() { - return RolePrivilegeMap.ROLE_PRIVILEGE_MAP.PRIVILEGE_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value1() { - return getId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value2() { - return getRoleId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value3() { - return getPrivilegeId(); - } - - /** - * {@inheritDoc} - */ - @Override - public RolePrivilegeMapRecord value1(Integer value) { - setId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RolePrivilegeMapRecord value2(Integer value) { - setRoleId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RolePrivilegeMapRecord value3(Integer value) { - setPrivilegeId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RolePrivilegeMapRecord values(Integer value1, Integer value2, Integer value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached RolePrivilegeMapRecord - */ - public RolePrivilegeMapRecord() { - super(RolePrivilegeMap.ROLE_PRIVILEGE_MAP); - } - - /** - * Create a detached, initialised RolePrivilegeMapRecord - */ - public RolePrivilegeMapRecord(Integer id, Integer roleId, Integer privilegeId) { - super(RolePrivilegeMap.ROLE_PRIVILEGE_MAP); - - set(0, id); - set(1, roleId); - set(2, privilegeId); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRecord.java deleted file mode 100644 index ace8164d..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRecord.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Role; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record2; -import org.jooq.Row2; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class RoleRecord extends UpdatableRecordImpl implements Record2 { - - private static final long serialVersionUID = 854316714; - - /** - * Setter for reqbaz.role.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for reqbaz.role.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for reqbaz.role.name. - */ - public void setName(String value) { - set(1, value); - } - - /** - * Getter for reqbaz.role.name. - */ - public String getName() { - return (String) get(1); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Field field1() { - return Role.ROLE.ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field2() { - return Role.ROLE.NAME; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value1() { - return getId(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value2() { - return getName(); - } - - /** - * {@inheritDoc} - */ - @Override - public RoleRecord value1(Integer value) { - setId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RoleRecord value2(String value) { - setName(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RoleRecord values(Integer value1, String value2) { - value1(value1); - value2(value2); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached RoleRecord - */ - public RoleRecord() { - super(Role.ROLE); - } - - /** - * Create a detached, initialised RoleRecord - */ - public RoleRecord(Integer id, String name) { - super(Role.ROLE); - - set(0, id); - set(1, name); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRoleMapRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRoleMapRecord.java deleted file mode 100644 index e745b767..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/RoleRoleMapRecord.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.RoleRoleMap; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record3; -import org.jooq.Row3; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class RoleRoleMapRecord extends UpdatableRecordImpl implements Record3 { - - private static final long serialVersionUID = 1477419030; - - /** - * Setter for reqbaz.role_role_map.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for reqbaz.role_role_map.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for reqbaz.role_role_map.child_id. - */ - public void setChildId(Integer value) { - set(1, value); - } - - /** - * Getter for reqbaz.role_role_map.child_id. - */ - public Integer getChildId() { - return (Integer) get(1); - } - - /** - * Setter for reqbaz.role_role_map.parent_id. - */ - public void setParentId(Integer value) { - set(2, value); - } - - /** - * Getter for reqbaz.role_role_map.parent_id. - */ - public Integer getParentId() { - return (Integer) get(2); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Field field1() { - return RoleRoleMap.ROLE_ROLE_MAP.ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field2() { - return RoleRoleMap.ROLE_ROLE_MAP.CHILD_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field3() { - return RoleRoleMap.ROLE_ROLE_MAP.PARENT_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value1() { - return getId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value2() { - return getChildId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value3() { - return getParentId(); - } - - /** - * {@inheritDoc} - */ - @Override - public RoleRoleMapRecord value1(Integer value) { - setId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RoleRoleMapRecord value2(Integer value) { - setChildId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RoleRoleMapRecord value3(Integer value) { - setParentId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RoleRoleMapRecord values(Integer value1, Integer value2, Integer value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached RoleRoleMapRecord - */ - public RoleRoleMapRecord() { - super(RoleRoleMap.ROLE_ROLE_MAP); - } - - /** - * Create a detached, initialised RoleRoleMapRecord - */ - public RoleRoleMapRecord(Integer id, Integer childId, Integer parentId) { - super(RoleRoleMap.ROLE_ROLE_MAP); - - set(0, id); - set(1, childId); - set(2, parentId); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/SchemaVersionRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/SchemaVersionRecord.java deleted file mode 100644 index 084baf9c..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/SchemaVersionRecord.java +++ /dev/null @@ -1,503 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.SchemaVersion; - -import java.sql.Timestamp; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record10; -import org.jooq.Row10; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class SchemaVersionRecord extends UpdatableRecordImpl implements Record10 { - - private static final long serialVersionUID = -1022760374; - - /** - * Setter for reqbaz.schema_version.installed_rank. - */ - public void setInstalledRank(Integer value) { - set(0, value); - } - - /** - * Getter for reqbaz.schema_version.installed_rank. - */ - public Integer getInstalledRank() { - return (Integer) get(0); - } - - /** - * Setter for reqbaz.schema_version.version. - */ - public void setVersion(String value) { - set(1, value); - } - - /** - * Getter for reqbaz.schema_version.version. - */ - public String getVersion() { - return (String) get(1); - } - - /** - * Setter for reqbaz.schema_version.description. - */ - public void setDescription(String value) { - set(2, value); - } - - /** - * Getter for reqbaz.schema_version.description. - */ - public String getDescription() { - return (String) get(2); - } - - /** - * Setter for reqbaz.schema_version.type. - */ - public void setType(String value) { - set(3, value); - } - - /** - * Getter for reqbaz.schema_version.type. - */ - public String getType() { - return (String) get(3); - } - - /** - * Setter for reqbaz.schema_version.script. - */ - public void setScript(String value) { - set(4, value); - } - - /** - * Getter for reqbaz.schema_version.script. - */ - public String getScript() { - return (String) get(4); - } - - /** - * Setter for reqbaz.schema_version.checksum. - */ - public void setChecksum(Integer value) { - set(5, value); - } - - /** - * Getter for reqbaz.schema_version.checksum. - */ - public Integer getChecksum() { - return (Integer) get(5); - } - - /** - * Setter for reqbaz.schema_version.installed_by. - */ - public void setInstalledBy(String value) { - set(6, value); - } - - /** - * Getter for reqbaz.schema_version.installed_by. - */ - public String getInstalledBy() { - return (String) get(6); - } - - /** - * Setter for reqbaz.schema_version.installed_on. - */ - public void setInstalledOn(Timestamp value) { - set(7, value); - } - - /** - * Getter for reqbaz.schema_version.installed_on. - */ - public Timestamp getInstalledOn() { - return (Timestamp) get(7); - } - - /** - * Setter for reqbaz.schema_version.execution_time. - */ - public void setExecutionTime(Integer value) { - set(8, value); - } - - /** - * Getter for reqbaz.schema_version.execution_time. - */ - public Integer getExecutionTime() { - return (Integer) get(8); - } - - /** - * Setter for reqbaz.schema_version.success. - */ - public void setSuccess(Byte value) { - set(9, value); - } - - /** - * Getter for reqbaz.schema_version.success. - */ - public Byte getSuccess() { - return (Byte) get(9); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record10 type implementation - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Row10 fieldsRow() { - return (Row10) super.fieldsRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Row10 valuesRow() { - return (Row10) super.valuesRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Field field1() { - return SchemaVersion.SCHEMA_VERSION.INSTALLED_RANK; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field2() { - return SchemaVersion.SCHEMA_VERSION.VERSION; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field3() { - return SchemaVersion.SCHEMA_VERSION.DESCRIPTION; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field4() { - return SchemaVersion.SCHEMA_VERSION.TYPE; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field5() { - return SchemaVersion.SCHEMA_VERSION.SCRIPT; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field6() { - return SchemaVersion.SCHEMA_VERSION.CHECKSUM; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field7() { - return SchemaVersion.SCHEMA_VERSION.INSTALLED_BY; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field8() { - return SchemaVersion.SCHEMA_VERSION.INSTALLED_ON; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field9() { - return SchemaVersion.SCHEMA_VERSION.EXECUTION_TIME; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field10() { - return SchemaVersion.SCHEMA_VERSION.SUCCESS; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value1() { - return getInstalledRank(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value2() { - return getVersion(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value3() { - return getDescription(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value4() { - return getType(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value5() { - return getScript(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value6() { - return getChecksum(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value7() { - return getInstalledBy(); - } - - /** - * {@inheritDoc} - */ - @Override - public Timestamp value8() { - return getInstalledOn(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value9() { - return getExecutionTime(); - } - - /** - * {@inheritDoc} - */ - @Override - public Byte value10() { - return getSuccess(); - } - - /** - * {@inheritDoc} - */ - @Override - public SchemaVersionRecord value1(Integer value) { - setInstalledRank(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SchemaVersionRecord value2(String value) { - setVersion(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SchemaVersionRecord value3(String value) { - setDescription(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SchemaVersionRecord value4(String value) { - setType(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SchemaVersionRecord value5(String value) { - setScript(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SchemaVersionRecord value6(Integer value) { - setChecksum(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SchemaVersionRecord value7(String value) { - setInstalledBy(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SchemaVersionRecord value8(Timestamp value) { - setInstalledOn(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SchemaVersionRecord value9(Integer value) { - setExecutionTime(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SchemaVersionRecord value10(Byte value) { - setSuccess(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SchemaVersionRecord values(Integer value1, String value2, String value3, String value4, String value5, Integer value6, String value7, Timestamp value8, Integer value9, Byte value10) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - value10(value10); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached SchemaVersionRecord - */ - public SchemaVersionRecord() { - super(SchemaVersion.SCHEMA_VERSION); - } - - /** - * Create a detached, initialised SchemaVersionRecord - */ - public SchemaVersionRecord(Integer installedRank, String version, String description, String type, String script, Integer checksum, String installedBy, Timestamp installedOn, Integer executionTime, Byte success) { - super(SchemaVersion.SCHEMA_VERSION); - - set(0, installedRank); - set(1, version); - set(2, description); - set(3, type); - set(4, script); - set(5, checksum); - set(6, installedBy); - set(7, installedOn); - set(8, executionTime); - set(9, success); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRecord.java deleted file mode 100644 index 03119d16..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRecord.java +++ /dev/null @@ -1,667 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.User; - -import java.sql.Timestamp; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record14; -import org.jooq.Row14; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class UserRecord extends UpdatableRecordImpl implements Record14 { - - private static final long serialVersionUID = 1368312286; - - /** - * Setter for reqbaz.user.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for reqbaz.user.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for reqbaz.user.first_name. - */ - public void setFirstName(String value) { - set(1, value); - } - - /** - * Getter for reqbaz.user.first_name. - */ - public String getFirstName() { - return (String) get(1); - } - - /** - * Setter for reqbaz.user.last_name. - */ - public void setLastName(String value) { - set(2, value); - } - - /** - * Getter for reqbaz.user.last_name. - */ - public String getLastName() { - return (String) get(2); - } - - /** - * Setter for reqbaz.user.email. - */ - public void setEmail(String value) { - set(3, value); - } - - /** - * Getter for reqbaz.user.email. - */ - public String getEmail() { - return (String) get(3); - } - - /** - * Setter for reqbaz.user.admin. - */ - public void setAdmin(Boolean value) { - set(4, value); - } - - /** - * Getter for reqbaz.user.admin. - */ - public Boolean getAdmin() { - return (Boolean) get(4); - } - - /** - * Setter for reqbaz.user.las2peer_id. - */ - public void setLas2peerId(String value) { - set(5, value); - } - - /** - * Getter for reqbaz.user.las2peer_id. - */ - public String getLas2peerId() { - return (String) get(5); - } - - /** - * Setter for reqbaz.user.user_name. - */ - public void setUserName(String value) { - set(6, value); - } - - /** - * Getter for reqbaz.user.user_name. - */ - public String getUserName() { - return (String) get(6); - } - - /** - * Setter for reqbaz.user.profile_image. - */ - public void setProfileImage(String value) { - set(7, value); - } - - /** - * Getter for reqbaz.user.profile_image. - */ - public String getProfileImage() { - return (String) get(7); - } - - /** - * Setter for reqbaz.user.email_lead_subscription. - */ - public void setEmailLeadSubscription(Byte value) { - set(8, value); - } - - /** - * Getter for reqbaz.user.email_lead_subscription. - */ - public Byte getEmailLeadSubscription() { - return (Byte) get(8); - } - - /** - * Setter for reqbaz.user.email_follow_subscription. - */ - public void setEmailFollowSubscription(Byte value) { - set(9, value); - } - - /** - * Getter for reqbaz.user.email_follow_subscription. - */ - public Byte getEmailFollowSubscription() { - return (Byte) get(9); - } - - /** - * Setter for reqbaz.user.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(10, value); - } - - /** - * Getter for reqbaz.user.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(10); - } - - /** - * Setter for reqbaz.user.last_updated_date. - */ - public void setLastUpdatedDate(Timestamp value) { - set(11, value); - } - - /** - * Getter for reqbaz.user.last_updated_date. - */ - public Timestamp getLastUpdatedDate() { - return (Timestamp) get(11); - } - - /** - * Setter for reqbaz.user.last_login_date. - */ - public void setLastLoginDate(Timestamp value) { - set(12, value); - } - - /** - * Getter for reqbaz.user.last_login_date. - */ - public Timestamp getLastLoginDate() { - return (Timestamp) get(12); - } - - /** - * Setter for reqbaz.user.personalization_enabled. - */ - public void setPersonalizationEnabled(Byte value) { - set(13, value); - } - - /** - * Getter for reqbaz.user.personalization_enabled. - */ - public Byte getPersonalizationEnabled() { - return (Byte) get(13); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record14 type implementation - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Row14 fieldsRow() { - return (Row14) super.fieldsRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Row14 valuesRow() { - return (Row14) super.valuesRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Field field1() { - return User.USER.ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field2() { - return User.USER.FIRST_NAME; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field3() { - return User.USER.LAST_NAME; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field4() { - return User.USER.EMAIL; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field5() { - return User.USER.ADMIN; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field6() { - return User.USER.LAS2PEER_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field7() { - return User.USER.USER_NAME; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field8() { - return User.USER.PROFILE_IMAGE; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field9() { - return User.USER.EMAIL_LEAD_SUBSCRIPTION; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field10() { - return User.USER.EMAIL_FOLLOW_SUBSCRIPTION; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field11() { - return User.USER.CREATION_DATE; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field12() { - return User.USER.LAST_UPDATED_DATE; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field13() { - return User.USER.LAST_LOGIN_DATE; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field14() { - return User.USER.PERSONALIZATION_ENABLED; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value1() { - return getId(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value2() { - return getFirstName(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value3() { - return getLastName(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value4() { - return getEmail(); - } - - /** - * {@inheritDoc} - */ - @Override - public Boolean value5() { - return getAdmin(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value6() { - return getLas2peerId(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value7() { - return getUserName(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value8() { - return getProfileImage(); - } - - /** - * {@inheritDoc} - */ - @Override - public Byte value9() { - return getEmailLeadSubscription(); - } - - /** - * {@inheritDoc} - */ - @Override - public Byte value10() { - return getEmailFollowSubscription(); - } - - /** - * {@inheritDoc} - */ - @Override - public Timestamp value11() { - return getCreationDate(); - } - - /** - * {@inheritDoc} - */ - @Override - public Timestamp value12() { - return getLastUpdatedDate(); - } - - /** - * {@inheritDoc} - */ - @Override - public Timestamp value13() { - return getLastLoginDate(); - } - - /** - * {@inheritDoc} - */ - @Override - public Byte value14() { - return getPersonalizationEnabled(); - } - - /** - * {@inheritDoc} - */ - @Override - public UserRecord value1(Integer value) { - setId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UserRecord value2(String value) { - setFirstName(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UserRecord value3(String value) { - setLastName(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UserRecord value4(String value) { - setEmail(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UserRecord value5(Boolean value) { - setAdmin(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UserRecord value6(String value) { - setLas2peerId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UserRecord value7(String value) { - setUserName(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UserRecord value8(String value) { - setProfileImage(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UserRecord value9(Byte value) { - setEmailLeadSubscription(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UserRecord value10(Byte value) { - setEmailFollowSubscription(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UserRecord value11(Timestamp value) { - setCreationDate(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UserRecord value12(Timestamp value) { - setLastUpdatedDate(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UserRecord value13(Timestamp value) { - setLastLoginDate(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UserRecord value14(Byte value) { - setPersonalizationEnabled(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UserRecord values(Integer value1, String value2, String value3, String value4, Boolean value5, String value6, String value7, String value8, Byte value9, Byte value10, Timestamp value11, Timestamp value12, Timestamp value13, Byte value14) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - value10(value10); - value11(value11); - value12(value12); - value13(value13); - value14(value14); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached UserRecord - */ - public UserRecord() { - super(User.USER); - } - - /** - * Create a detached, initialised UserRecord - */ - public UserRecord(Integer id, String firstName, String lastName, String email, Boolean admin, String las2peerId, String userName, String profileImage, Byte emailLeadSubscription, Byte emailFollowSubscription, Timestamp creationDate, Timestamp lastUpdatedDate, Timestamp lastLoginDate, Byte personalizationEnabled) { - super(User.USER); - - set(0, id); - set(1, firstName); - set(2, lastName); - set(3, email); - set(4, admin); - set(5, las2peerId); - set(6, userName); - set(7, profileImage); - set(8, emailLeadSubscription); - set(9, emailFollowSubscription); - set(10, creationDate); - set(11, lastUpdatedDate); - set(12, lastLoginDate); - set(13, personalizationEnabled); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRoleMapRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRoleMapRecord.java deleted file mode 100644 index fd82a8dd..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/UserRoleMapRecord.java +++ /dev/null @@ -1,255 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.UserRoleMap; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record4; -import org.jooq.Row4; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class UserRoleMapRecord extends UpdatableRecordImpl implements Record4 { - - private static final long serialVersionUID = -247032073; - - /** - * Setter for reqbaz.user_role_map.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for reqbaz.user_role_map.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for reqbaz.user_role_map.role_id. - */ - public void setRoleId(Integer value) { - set(1, value); - } - - /** - * Getter for reqbaz.user_role_map.role_id. - */ - public Integer getRoleId() { - return (Integer) get(1); - } - - /** - * Setter for reqbaz.user_role_map.user_id. - */ - public void setUserId(Integer value) { - set(2, value); - } - - /** - * Getter for reqbaz.user_role_map.user_id. - */ - public Integer getUserId() { - return (Integer) get(2); - } - - /** - * Setter for reqbaz.user_role_map.context_info. - */ - public void setContextInfo(String value) { - set(3, value); - } - - /** - * Getter for reqbaz.user_role_map.context_info. - */ - public String getContextInfo() { - return (String) get(3); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Field field1() { - return UserRoleMap.USER_ROLE_MAP.ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field2() { - return UserRoleMap.USER_ROLE_MAP.ROLE_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field3() { - return UserRoleMap.USER_ROLE_MAP.USER_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field4() { - return UserRoleMap.USER_ROLE_MAP.CONTEXT_INFO; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value1() { - return getId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value2() { - return getRoleId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value3() { - return getUserId(); - } - - /** - * {@inheritDoc} - */ - @Override - public String value4() { - return getContextInfo(); - } - - /** - * {@inheritDoc} - */ - @Override - public UserRoleMapRecord value1(Integer value) { - setId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UserRoleMapRecord value2(Integer value) { - setRoleId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UserRoleMapRecord value3(Integer value) { - setUserId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UserRoleMapRecord value4(String value) { - setContextInfo(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UserRoleMapRecord values(Integer value1, Integer value2, Integer value3, String value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached UserRoleMapRecord - */ - public UserRoleMapRecord() { - super(UserRoleMap.USER_ROLE_MAP); - } - - /** - * Create a detached, initialised UserRoleMapRecord - */ - public UserRoleMapRecord(Integer id, Integer roleId, Integer userId, String contextInfo) { - super(UserRoleMap.USER_ROLE_MAP); - - set(0, id); - set(1, roleId); - set(2, userId); - set(3, contextInfo); - } -} diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/VoteRecord.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/VoteRecord.java deleted file mode 100644 index b6fd6a3d..00000000 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/jooq/tables/records/VoteRecord.java +++ /dev/null @@ -1,298 +0,0 @@ -/* - * This file is generated by jOOQ. -*/ -package de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records; - - -import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Vote; - -import java.sql.Timestamp; - -import javax.annotation.Generated; - -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record5; -import org.jooq.Row5; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.9.1" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class VoteRecord extends UpdatableRecordImpl implements Record5 { - - private static final long serialVersionUID = 1481873125; - - /** - * Setter for reqbaz.vote.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for reqbaz.vote.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for reqbaz.vote.is_upvote. - */ - public void setIsUpvote(Byte value) { - set(1, value); - } - - /** - * Getter for reqbaz.vote.is_upvote. - */ - public Byte getIsUpvote() { - return (Byte) get(1); - } - - /** - * Setter for reqbaz.vote.requirement_id. - */ - public void setRequirementId(Integer value) { - set(2, value); - } - - /** - * Getter for reqbaz.vote.requirement_id. - */ - public Integer getRequirementId() { - return (Integer) get(2); - } - - /** - * Setter for reqbaz.vote.user_id. - */ - public void setUserId(Integer value) { - set(3, value); - } - - /** - * Getter for reqbaz.vote.user_id. - */ - public Integer getUserId() { - return (Integer) get(3); - } - - /** - * Setter for reqbaz.vote.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(4, value); - } - - /** - * Getter for reqbaz.vote.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(4); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record5 type implementation - // ------------------------------------------------------------------------- - - /** - * {@inheritDoc} - */ - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Row5 valuesRow() { - return (Row5) super.valuesRow(); - } - - /** - * {@inheritDoc} - */ - @Override - public Field field1() { - return Vote.VOTE.ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field2() { - return Vote.VOTE.IS_UPVOTE; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field3() { - return Vote.VOTE.REQUIREMENT_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field4() { - return Vote.VOTE.USER_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public Field field5() { - return Vote.VOTE.CREATION_DATE; - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value1() { - return getId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Byte value2() { - return getIsUpvote(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value3() { - return getRequirementId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Integer value4() { - return getUserId(); - } - - /** - * {@inheritDoc} - */ - @Override - public Timestamp value5() { - return getCreationDate(); - } - - /** - * {@inheritDoc} - */ - @Override - public VoteRecord value1(Integer value) { - setId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public VoteRecord value2(Byte value) { - setIsUpvote(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public VoteRecord value3(Integer value) { - setRequirementId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public VoteRecord value4(Integer value) { - setUserId(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public VoteRecord value5(Timestamp value) { - setCreationDate(value); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public VoteRecord values(Integer value1, Byte value2, Integer value3, Integer value4, Timestamp value5) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached VoteRecord - */ - public VoteRecord() { - super(Vote.VOTE); - } - - /** - * Create a detached, initialised VoteRecord - */ - public VoteRecord(Integer id, Byte isUpvote, Integer requirementId, Integer userId, Timestamp creationDate) { - super(Vote.VOTE); - - set(0, id); - set(1, isUpvote); - set(2, requirementId); - set(3, userId); - set(4, creationDate); - } -} From 080464775a5479fd673f61958ca2af21e37e925f Mon Sep 17 00:00:00 2001 From: Thore Date: Fri, 15 Jan 2021 04:07:11 +0100 Subject: [PATCH 029/134] Upgrade las2peer to 1.1.0 --- .github/workflows/gradle.yml | 40 +++++++++++++++++ .gitignore | 2 + gradle.properties | 3 +- .../acis/bazaar/service/CommentsResource.java | 7 +-- .../bazaar/service/RequirementsResource.java | 43 ++++++++++--------- .../dal/transform/AttachmentTransformer.java | 2 +- .../dal/transform/CategoryTransformer.java | 2 +- .../dal/transform/CommentTransformer.java | 2 +- .../dal/transform/ProjectTransformer.java | 2 +- .../dal/transform/RequirementTransformer.java | 2 +- .../dal/transform/UserTransformer.java | 5 ++- 11 files changed, 78 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/gradle.yml diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 00000000..4378c05d --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,40 @@ +name: Gradle Build & Test +on: [pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + services: + mysql: + image: mysql:latest + ports: + - 3306 + env: + MYSQL_USER: reqbaz + MYSQL_PASSWORD: password + MYSQL_DATABASE: reqbaz + MYSQL_ROOT_PASSWORD: rootpw + options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 14 + uses: actions/setup-java@v1 + with: + java-version: 14 + - name: Verify MySQL connection + env: + PORT: ${{ job.services.mysql.ports[3306] }} + run: | + while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do + sleep 1 + done + - name: Set DB Port in config + env: + PORT: ${{ job.services.mysql.ports[3306] }} + run: sed -i "s/3306/$PORT/g" requirement_bazaar/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties && cat requirement_bazaar/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties + - name: Build with Gradle + env: + PORT: ${{ job.services.mysql.ports[3306] }} + run: ./gradlew clean build --info -Pdb.port=$PORT \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1f419757..72a67303 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,5 @@ Temporary Items # Ignore Gradle build output directory build + +.db_data \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index f09a69b7..4d89dd88 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,8 @@ org.gradle.parallel=true -service.version=1.0.1 +core.version=1.1.0 service.name=RequirementsBazaar +service.version=0.9.0 jooq.version=3.14.4 mysql.version=8.0.22 diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CommentsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CommentsResource.java index 721f1223..2623b317 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CommentsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CommentsResource.java @@ -23,6 +23,7 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.net.HttpURLConnection; +import java.time.LocalDateTime; import java.util.*; @@ -136,7 +137,7 @@ public Response getAllComments( } //TODO Results in "No CommentRecord found with id: 0" - //bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, + //bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, // 0, Activity.DataType.COMMENT, internalUserId); Map> parameter = new HashMap<>(); @@ -220,7 +221,7 @@ public Response getCommentsForRequirement(int requirementId, int page, int perPa } } PaginationResult commentsResult = dalFacade.listCommentsByRequirementId(requirementId, pageInfo); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_43, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_43, requirementId, Activity.DataType.REQUIREMENT, internalUserId); Map> parameter = new HashMap<>(); parameter.put("page", new ArrayList() {{ @@ -285,7 +286,7 @@ public Response getComment(@PathParam("commentId") int commentId) { Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Comment comment = dalFacade.getCommentById(commentId); Requirement requirement = dalFacade.getRequirementById(comment.getRequirementId(), internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_45, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_45, commentId, Activity.DataType.COMMENT, internalUserId); if (dalFacade.isProjectPublic(requirement.getProjectId())) { boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_COMMENT, String.valueOf(requirement.getProjectId()), dalFacade); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java index b86fe884..275f9cc9 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java @@ -25,6 +25,7 @@ import javax.ws.rs.core.Response; import javax.xml.bind.DatatypeConverter; import java.net.HttpURLConnection; +import java.time.LocalDateTime; import java.util.*; @Api(value = "requirements", description = "Requirements resource") @@ -131,7 +132,7 @@ public Response getRequirements( requirementsResult = dalFacade.listAllRequirements(pageInfo, internalUserId); } //TODO NotificationDispatcher tries to find Requirement with id 0 as additional Object, need to implement logic for multiple - //bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, + //bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, // 0, Activity.DataType.REQUIREMENT, internalUserId); Map> parameter = new HashMap<>(); @@ -239,7 +240,7 @@ public Response getRequirementsForProject(int projectId, int page, int perPage, } } PaginationResult requirementsResult = dalFacade.listRequirementsByProject(projectId, pageInfo, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_14, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_14, projectId, Activity.DataType.PROJECT, internalUserId); Map> parameter = new HashMap<>(); @@ -348,7 +349,7 @@ public Response getRequirementsForCategory(int categoryId, int page, int perPage } } PaginationResult requirementsResult = dalFacade.listRequirementsByCategory(categoryId, pageInfo, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_24, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_24, categoryId, Activity.DataType.CATEGORY, internalUserId); Map> parameter = new HashMap<>(); @@ -427,7 +428,7 @@ public Response getRequirement(@PathParam("requirementId") int requirementId) { dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_25, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_25, requirementId, Activity.DataType.REQUIREMENT, internalUserId); if (dalFacade.isRequirementPublic(requirementId)) { boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_REQUIREMENT, String.valueOf(requirement.getProjectId()), dalFacade); @@ -526,7 +527,7 @@ public Response createRequirement(@ApiParam(value = "Requirement entity", requir } } createdRequirement = dalFacade.getRequirementById(createdRequirement.getId(), internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.CREATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_26, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.CREATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_26, createdRequirement.getId(), Activity.DataType.REQUIREMENT, internalUserId); return Response.status(Response.Status.CREATED).entity(createdRequirement.toJSON()).build(); } catch (BazaarException bex) { @@ -591,7 +592,7 @@ public Response updateRequirement(@PathParam("requirementId") int requirementId, } dalFacade.followRequirement(internalUserId, requirementToUpdate.getId()); Requirement updatedRequirement = dalFacade.modifyRequirement(requirementToUpdate, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_27, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_27, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.ok(updatedRequirement.toJSON()).build(); } catch (BazaarException bex) { @@ -648,7 +649,7 @@ public Response deleteRequirement(@PathParam("requirementId") int requirementId) ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.requirement.delete")); } Requirement deletedRequirement = dalFacade.deleteRequirementById(requirementId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.DELETE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_28, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.DELETE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_28, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.ok(deletedRequirement.toJSON()).build(); } catch (BazaarException bex) { @@ -703,7 +704,7 @@ public Response leaddevelopRequirement(@PathParam("requirementId") int requireme ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.vote.create")); } Requirement requirement = dalFacade.setUserAsLeadDeveloper(requirementId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.LEADDEVELOP, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_29, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.LEADDEVELOP, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_29, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.status(Response.Status.CREATED).entity(requirement.toJSON()).build(); } catch (BazaarException bex) { @@ -762,7 +763,7 @@ public Response unleaddevelopRequirement(@PathParam("requirementId") int require ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, "You are not lead developer."); } requirement = dalFacade.deleteUserAsLeadDeveloper(requirementId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.UNLEADDEVELOP, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_30, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UNLEADDEVELOP, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_30, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.ok(requirement.toJSON()).build(); } catch (BazaarException bex) { @@ -819,7 +820,7 @@ public Response developRequirement(@PathParam("requirementId") int requirementId dalFacade.wantToDevelop(internalUserId, requirementId); dalFacade.followRequirement(internalUserId, requirementId); Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.DEVELOP, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_31, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.DEVELOP, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_31, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.status(Response.Status.CREATED).entity(requirement.toJSON()).build(); } catch (BazaarException bex) { @@ -875,7 +876,7 @@ public Response undevelopRequirement(@PathParam("requirementId") int requirement } dalFacade.notWantToDevelop(internalUserId, requirementId); Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.UNDEVELOP, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_32, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UNDEVELOP, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_32, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.ok(requirement.toJSON()).build(); } catch (BazaarException bex) { @@ -931,7 +932,7 @@ public Response followRequirement(@PathParam("requirementId") int requirementId) } dalFacade.followRequirement(internalUserId, requirementId); Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.FOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_33, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.FOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_33, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.status(Response.Status.CREATED).entity(requirement.toJSON()).build(); } catch (BazaarException bex) { @@ -987,7 +988,7 @@ public Response unfollowRequirement(@PathParam("requirementId") int requirementI } dalFacade.unFollowRequirement(internalUserId, requirementId); Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.UNFOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_34, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UNFOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_34, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.ok(requirement.toJSON()).build(); } catch (BazaarException bex) { @@ -1053,7 +1054,7 @@ public Response vote(@PathParam("requirementId") int requirementId, dalFacade.followRequirement(internalUserId, requirementId); } Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.VOTE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_35, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.VOTE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_35, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.status(Response.Status.CREATED).entity(requirement.toJSON()).build(); } catch (BazaarException bex) { @@ -1109,7 +1110,7 @@ public Response unvote(@PathParam("requirementId") int requirementId) { } dalFacade.unVote(internalUserId, requirementId); Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.UNVOTE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_36, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UNVOTE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_36, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.ok(requirement.toJSON()).build(); } catch (BazaarException bex) { @@ -1164,7 +1165,7 @@ public Response realize(@PathParam("requirementId") int requirementId) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.vote.create")); } Requirement requirement = dalFacade.setRequirementToRealized(requirementId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.REALIZE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_37, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.REALIZE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_37, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.status(Response.Status.CREATED).entity(requirement.toJSON()).build(); } catch (BazaarException bex) { @@ -1219,7 +1220,7 @@ public Response unrealize(@PathParam("requirementId") int requirementId) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.vote.delete")); } Requirement requirement = dalFacade.setRequirementToUnRealized(requirementId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.UNREALIZE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_38, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UNREALIZE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_38, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.ok(requirement.toJSON()).build(); } catch (BazaarException bex) { @@ -1274,7 +1275,7 @@ public Response getStatisticsForRequirement( Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Calendar sinceCal = since == null ? null : DatatypeConverter.parseDateTime(since); Statistic requirementStatistics = dalFacade.getStatisticsForRequirement(internalUserId, requirementId, sinceCal); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_39, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_39, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.ok(requirementStatistics.toJSON()).build(); } catch (BazaarException bex) { @@ -1335,7 +1336,7 @@ public Response getDevelopersForRequirement(@PathParam("requirementId") int requ dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); PaginationResult requirementDevelopers = dalFacade.listDevelopersForRequirement(requirementId, pageInfo); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_40, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_40, requirementId, Activity.DataType.REQUIREMENT, internalUserId); Map> parameter = new HashMap<>(); @@ -1400,7 +1401,7 @@ public Response getContributorsForRequirement(@PathParam("requirementId") int re dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); RequirementContributors requirementContributors = dalFacade.listContributorsForRequirement(requirementId); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_41, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_41, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.ok(requirementContributors.toJSON()).build(); } catch (BazaarException bex) { @@ -1461,7 +1462,7 @@ public Response getFollowersForRequirement(@PathParam("requirementId") int requi dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); PaginationResult requirementFollowers = dalFacade.listFollowersForRequirement(requirementId, pageInfo); - bazaarService.getNotificationDispatcher().dispatchNotification(new Date(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_42, + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_42, requirementId, Activity.DataType.REQUIREMENT, internalUserId); Map> parameter = new HashMap<>(); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java index 96ba77fc..ada24cff 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java @@ -86,7 +86,7 @@ public Map getUpdateMap(final Attachment entity) { HashMap updateMap = new HashMap() {{ }}; if (!updateMap.isEmpty()) { - updateMap.put(ATTACHMENT.LAST_UPDATED_DATE, new java.sql.Timestamp(Calendar.getInstance().getTime().getTime())); + updateMap.put(ATTACHMENT.LAST_UPDATED_DATE, LocalDateTime.now()); } return updateMap; } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java index 17159045..8b591810 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java @@ -92,7 +92,7 @@ public Map getUpdateMap(final Category entry) { } }}; if (!updateMap.isEmpty()) { - updateMap.put(CATEGORY.LAST_UPDATED_DATE, new java.sql.Timestamp(Calendar.getInstance().getTime().getTime())); + updateMap.put(CATEGORY.LAST_UPDATED_DATE, LocalDateTime.now()); } return updateMap; } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java index dcf091bb..79e97b96 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java @@ -85,7 +85,7 @@ public Map getUpdateMap(final Comment entity) { put(COMMENT.MESSAGE, entity.getMessage()); }}; if (!updateMap.isEmpty()) { - updateMap.put(COMMENT.LAST_UPDATED_DATE, new java.sql.Timestamp(Calendar.getInstance().getTime().getTime())); + updateMap.put(COMMENT.LAST_UPDATED_DATE, LocalDateTime.now()); } return updateMap; } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java index 7215190d..e08ba6f9 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java @@ -100,7 +100,7 @@ public Map getUpdateMap(final Project entry) { } }}; if (!updateMap.isEmpty()) { - updateMap.put(PROJECT.LAST_UPDATED_DATE, new java.sql.Timestamp(Calendar.getInstance().getTime().getTime())); + updateMap.put(PROJECT.LAST_UPDATED_DATE, LocalDateTime.now()); } return updateMap; } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java index 62502ef6..6553839e 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java @@ -89,7 +89,7 @@ public Map getUpdateMap(final Requirement entry) { } }}; if (!updateMap.isEmpty()) { - updateMap.put(REQUIREMENT.LAST_UPDATED_DATE, new java.sql.Timestamp(Calendar.getInstance().getTime().getTime())); + updateMap.put(REQUIREMENT.LAST_UPDATED_DATE, LocalDateTime.now()); } return updateMap; } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java index f07c0aa0..920bc1e0 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java @@ -26,6 +26,7 @@ import org.jooq.*; import org.jooq.Record; +import java.time.LocalDateTime; import java.util.*; import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.USER; @@ -44,7 +45,7 @@ public UserRecord createRecord(User entity) { record.setEmailLeadSubscription((byte) (entity.isEmailLeadSubscription() ? 1 : 0)); record.setEmailFollowSubscription((byte) (entity.isEmailFollowSubscription() ? 1 : 0)); record.setPersonalizationEnabled((byte) (entity.isPersonalizationEnabled() ? 1:0)); - record.setCreationDate(new java.sql.Timestamp(Calendar.getInstance().getTime().getTime())); + record.setCreationDate(LocalDateTime.now()); return record; } @@ -127,7 +128,7 @@ public Map getUpdateMap(final User entity) { } }}; if (!updateMap.isEmpty()) { - updateMap.put(USER.LAST_UPDATED_DATE, new java.sql.Timestamp(Calendar.getInstance().getTime().getTime())); + updateMap.put(USER.LAST_UPDATED_DATE, LocalDateTime.now()); } return updateMap; } From 5e7b2dfc1234f226c756abe76d9b9b58b75685fb Mon Sep 17 00:00:00 2001 From: Thore Date: Fri, 15 Jan 2021 04:22:33 +0100 Subject: [PATCH 030/134] Add gradle wrapper --- gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 59203 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 gradle/wrapper/gradle-wrapper.jar diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..e708b1c023ec8b20f512888fe07c5bd3ff77bb8f GIT binary patch literal 59203 zcma&O1CT9Y(k9%tZQHhO+qUh#ZQHhO+qmuS+qP|E@9xZO?0h@l{(r>DQ>P;GjjD{w zH}lENr;dU&FbEU?00aa80D$0M0RRB{U*7-#kbjS|qAG&4l5%47zyJ#WrfA#1$1Ctx zf&Z_d{GW=lf^w2#qRJ|CvSJUi(^E3iv~=^Z(zH}F)3Z%V3`@+rNB7gTVU{Bb~90p|f+0(v;nz01EG7yDMX9@S~__vVgv%rS$+?IH+oZ03D5zYrv|^ zC1J)SruYHmCki$jLBlTaE5&dFG9-kq3!^i>^UQL`%gn6)jz54$WDmeYdsBE9;PqZ_ zoGd=P4+|(-u4U1dbAVQrFWoNgNd;0nrghPFbQrJctO>nwDdI`Q^i0XJDUYm|T|RWc zZ3^Qgo_Qk$%Fvjj-G}1NB#ZJqIkh;kX%V{THPqOyiq)d)0+(r9o(qKlSp*hmK#iIY zA^)Vr$-Hz<#SF=0@tL@;dCQsm`V9s1vYNq}K1B)!XSK?=I1)tX+bUV52$YQu*0%fnWEukW>mxkz+%3-S!oguE8u#MGzST8_Dy^#U?fA@S#K$S@9msUiX!gd_ow>08w5)nX{-KxqMOo7d?k2&?Vf z&diGDtZr(0cwPe9z9FAUSD9KC)7(n^lMWuayCfxzy8EZsns%OEblHFSzP=cL6}?J| z0U$H!4S_TVjj<`6dy^2j`V`)mC;cB%* z8{>_%E1^FH!*{>4a7*C1v>~1*@TMcLK{7nEQ!_igZC}ikJ$*<$yHy>7)oy79A~#xE zWavoJOIOC$5b6*q*F_qN1>2#MY)AXVyr$6x4b=$x^*aqF*L?vmj>Mgv+|ITnw_BoW zO?jwHvNy^prH{9$rrik1#fhyU^MpFqF2fYEt(;4`Q&XWOGDH8k6M=%@fics4ajI;st# zCU^r1CK&|jzUhRMv;+W~6N;u<;#DI6cCw-otsc@IsN3MoSD^O`eNflIoR~l4*&-%RBYk@gb^|-JXs&~KuSEmMxB}xSb z@K76cXD=Y|=I&SNC2E+>Zg?R6E%DGCH5J1nU!A|@eX9oS(WPaMm==k2s_ueCqdZw| z&hqHp)47`c{BgwgvY2{xz%OIkY1xDwkw!<0veB#yF4ZKJyabhyyVS`gZepcFIk%e2 zTcrmt2@-8`7i-@5Nz>oQWFuMC_KlroCl(PLSodswHqJ3fn<;gxg9=}~3x_L3P`9Sn zChIf}8vCHvTriz~T2~FamRi?rh?>3bX1j}%bLH+uFX+p&+^aXbOK7clZxdU~6Uxgy z8R=obwO4dL%pmVo*Ktf=lH6hnlz_5k3cG;m8lgaPp~?eD!Yn2kf)tU6PF{kLyn|oI@eQ`F z3IF7~Blqg8-uwUuWZScRKn%c2_}dXB6Dx_&xR*n9M9LXasJhtZdr$vBY!rP{c@=)& z#!?L$2UrkvClwQO>U*fSMs67oSj2mxiJ$t;E|>q%Kh_GzzWWO&3;ufU%2z%ucBU8H z3WIwr$n)cfCXR&>tyB7BcSInK>=ByZA%;cVEJhcg<#6N{aZC4>K41XF>ZgjG`z_u& zGY?;Ad?-sgiOnI`oppF1o1Gurqbi*;#x2>+SSV6|1^G@ooVy@fg?wyf@0Y!UZ4!}nGuLeC^l)6pwkh|oRY`s1Pm$>zZ3u-83T|9 zGaKJIV3_x+u1>cRibsaJpJqhcm%?0-L;2 zitBrdRxNmb0OO2J%Y&Ym(6*`_P3&&5Bw157{o7LFguvxC$4&zTy#U=W*l&(Q2MNO} zfaUwYm{XtILD$3864IA_nn34oVa_g^FRuHL5wdUd)+W-p-iWCKe8m_cMHk+=? zeKX)M?Dt(|{r5t7IenkAXo%&EXIb-i^w+0CX0D=xApC=|Xy(`xy+QG^UyFe z+#J6h_&T5i#sV)hj3D4WN%z;2+jJcZxcI3*CHXGmOF3^)JD5j&wfX)e?-|V0GPuA+ zQFot%aEqGNJJHn$!_}#PaAvQ^{3-Ye7b}rWwrUmX53(|~i0v{}G_sI9uDch_brX&6 zWl5Ndj-AYg(W9CGfQf<6!YmY>Ey)+uYd_JNXH=>|`OH-CDCmcH(0%iD_aLlNHKH z7bcW-^5+QV$jK?R*)wZ>r9t}loM@XN&M-Pw=F#xn(;u3!(3SXXY^@=aoj70;_=QE9 zGghsG3ekq#N||u{4We_25U=y#T*S{4I{++Ku)> zQ!DZW;pVcn>b;&g2;YE#+V`v*Bl&Y-i@X6D*OpNA{G@JAXho&aOk(_j^weW{#3X5Y z%$q_wpb07EYPdmyH(1^09i$ca{O<}7) zRWncXdSPgBE%BM#by!E>tdnc$8RwUJg1*x($6$}ae$e9Knj8gvVZe#bLi!<+&BkFj zg@nOpDneyc+hU9P-;jmOSMN|*H#>^Ez#?;%C3hg_65leSUm;iz)UkW)jX#p)e&S&M z1|a?wDzV5NVnlhRBCd_;F87wp>6c<&nkgvC+!@KGiIqWY4l}=&1w7|r6{oBN8xyzh zG$b#2=RJp_iq6)#t5%yLkKx(0@D=C3w+oiXtSuaQ%I1WIb-eiE$d~!)b@|4XLy!CZ z9p=t=%3ad@Ep+<9003D2KZ5VyP~_n$=;~r&YUg5UZ0KVD&tR1DHy9x)qWtKJp#Kq# zP*8p#W(8JJ_*h_3W}FlvRam?<4Z+-H77^$Lvi+#vmhL9J zJ<1SV45xi;SrO2f=-OB(7#iNA5)x1uNC-yNxUw|!00vcW2PufRm>e~toH;M0Q85MQLWd?3O{i8H+5VkR@l9Dg-ma ze2fZ%>G(u5(k9EHj2L6!;(KZ8%8|*-1V|B#EagbF(rc+5iL_5;Eu)L4Z-V;0HfK4d z*{utLse_rvHZeQ>V5H=f78M3Ntg1BPxFCVD{HbNA6?9*^YIq;B-DJd{Ca2L#)qWP? zvX^NhFmX?CTWw&Ns}lgs;r3i+Bq@y}Ul+U%pzOS0Fcv9~aB(0!>GT0)NO?p=25LjN z2bh>6RhgqD7bQj#k-KOm@JLgMa6>%-ok1WpOe)FS^XOU{c?d5shG(lIn3GiVBxmg`u%-j=)^v&pX1JecJics3&jvPI)mDut52? z3jEA)DM%}BYbxxKrizVYwq?(P&19EXlwD9^-6J+4!}9{ywR9Gk42jjAURAF&EO|~N z)?s>$Da@ikI4|^z0e{r`J8zIs>SpM~Vn^{3fArRu;?+43>lD+^XtUcY1HidJwnR6+ z!;oG2=B6Z_=M%*{z-RaHc(n|1RTKQdNjjV!Pn9lFt^4w|AeN06*j}ZyhqZ^!-=cyGP_ShV1rGxkx8t zB;8`h!S{LD%ot``700d0@Grql(DTt4Awgmi+Yr0@#jbe=2#UkK%rv=OLqF)9D7D1j z!~McAwMYkeaL$~kI~90)5vBhBzWYc3Cj1WI0RS`z000R8-@ET0dA~*r(gSiCJmQMN&4%1D zyVNf0?}sBH8zNbBLn>~(W{d3%@kL_eQ6jEcR{l>C|JK z(R-fA!z|TTRG40|zv}7E@PqCAXP3n`;%|SCQ|ZS%ym$I{`}t3KPL&^l5`3>yah4*6 zifO#{VNz3)?ZL$be;NEaAk9b#{tV?V7 zP|wf5YA*1;s<)9A4~l3BHzG&HH`1xNr#%){4xZ!jq%o=7nN*wMuXlFV{HaiQLJ`5G zBhDi#D(m`Q1pLh@Tq+L;OwuC52RdW7b8}~60WCOK5iYMUad9}7aWBuILb({5=z~YF zt?*Jr5NG+WadM{mDL>GyiByCuR)hd zA=HM?J6l1Xv0Dl+LW@w$OTcEoOda^nFCw*Sy^I@$sSuneMl{4ys)|RY#9&NxW4S)9 zq|%83IpslTLoz~&vTo!Ga@?rj_kw{|k{nv+w&Ku?fyk4Ki4I?);M|5Axm)t+BaE)D zm(`AQ#k^DWrjbuXoJf2{Aj^KT zFb1zMSqxq|vceV+Mf-)$oPflsO$@*A0n0Z!R{&(xh8s}=;t(lIy zv$S8x>m;vQNHuRzoaOo?eiWFe{0;$s`Bc+Osz~}Van${u;g(su`3lJ^TEfo~nERfP z)?aFzpDgnLYiERsKPu|0tq4l2wT)Atr6Qb%m-AUn6HnCue*yWICp7TjW$@sO zm5rm4aTcPQ(rfi7a`xP7cKCFrJD}*&_~xgLyr^-bmsL}y;A5P|al8J3WUoBSjqu%v zxC;mK!g(7r6RRJ852Z~feoC&sD3(6}^5-uLK8o)9{8L_%%rItZK9C){UxB|;G>JbP zsRRtS4-3B*5c+K2kvmgZK8472%l>3cntWUOVHxB|{Ay~aOg5RN;{PJgeVD*H%ac+y!h#wi%o2bF2Ca8IyMyH{>4#{E_8u^@+l-+n=V}Sq?$O z{091@v%Bd*3pk0^2UtiF9Z+(a@wy6 zUdw8J*ze$K#=$48IBi1U%;hmhO>lu!uU;+RS}p&6@rQila7WftH->*A4=5W|Fmtze z)7E}jh@cbmr9iup^i%*(uF%LG&!+Fyl@LFA-}Ca#bxRfDJAiR2dt6644TaYw1Ma79 zt8&DYj31j^5WPNf5P&{)J?WlCe@<3u^78wnd(Ja4^a>{^Tw}W>|Cjt^If|7l^l)^Q zbz|7~CF(k_9~n|h;ysZ+jHzkXf(*O*@5m zLzUmbHp=x!Q|!9NVXyipZ3)^GuIG$k;D)EK!a5=8MFLI_lpf`HPKl=-Ww%z8H_0$j ztJ||IfFG1lE9nmQ0+jPQy zCBdKkjArH@K7jVcMNz);Q(Q^R{d5G?-kk;Uu_IXSyWB)~KGIizZL(^&qF;|1PI7!E zTP`%l)gpX|OFn&)M%txpQ2F!hdA~hX1Cm5)IrdljqzRg!f{mN%G~H1&oqe`5eJCIF zHdD7O;AX-{XEV(a`gBFJ9ews#CVS2y!&>Cm_dm3C8*n3MA*e67(WC?uP@8TXuMroq z{#w$%z@CBIkRM7?}Xib+>hRjy?%G!fiw8! z8(gB+8J~KOU}yO7UGm&1g_MDJ$IXS!`+*b*QW2x)9>K~Y*E&bYMnjl6h!{17_8d!%&9D`a7r&LKZjC<&XOvTRaKJ1 zUY@hl5^R&kZl3lU3njk`3dPzxj$2foOL26r(9zsVF3n_F#v)s5vv3@dgs|lP#eylq62{<-vczqP!RpVBTgI>@O6&sU>W|do17+#OzQ7o5A$ICH z?GqwqnK^n2%LR;$^oZM;)+>$X3s2n}2jZ7CdWIW0lnGK-b#EG01)P@aU`pg}th&J-TrU`tIpb5t((0eu|!u zQz+3ZiOQ^?RxxK4;zs=l8q!-n7X{@jSwK(iqNFiRColuEOg}!7cyZi`iBX4g1pNBj zAPzL?P^Ljhn;1$r8?bc=#n|Ed7wB&oHcw()&*k#SS#h}jO?ZB246EGItsz*;^&tzp zu^YJ0=lwsi`eP_pU8}6JA7MS;9pfD;DsSsLo~ogzMNP70@@;Fm8f0^;>$Z>~}GWRw!W5J3tNX*^2+1f3hz{~rIzJo z6W%J(H!g-eI_J1>0juX$X4Cl6i+3wbc~k146UIX&G22}WE>0ga#WLsn9tY(&29zBvH1$`iWtTe zG2jYl@P!P)eb<5DsR72BdI7-zP&cZNI{7q3e@?N8IKc4DE#UVr->|-ryuJXk^u^>4 z$3wE~=q390;XuOQP~TNoDR?#|NSPJ%sTMInA6*rJ%go|=YjGe!B>z6u$IhgQSwoV* zjy3F2#I>uK{42{&IqP59)Y(1*Z>>#W8rCf4_eVsH)`v!P#^;BgzKDR`ARGEZzkNX+ zJUQu=*-ol=Xqqt5=`=pA@BIn@6a9G8C{c&`i^(i+BxQO9?YZ3iu%$$da&Kb?2kCCo zo7t$UpSFWqmydXf@l3bVJ=%K?SSw)|?srhJ-1ZdFu*5QhL$~-IQS!K1s@XzAtv6*Y zl8@(5BlWYLt1yAWy?rMD&bwze8bC3-GfNH=p zynNFCdxyX?K&G(ZZ)afguQ2|r;XoV^=^(;Cku#qYn4Lus`UeKt6rAlFo_rU`|Rq z&G?~iWMBio<78of-2X(ZYHx~=U0Vz4btyXkctMKdc9UM!vYr~B-(>)(Hc|D zMzkN4!PBg%tZoh+=Gba!0++d193gbMk2&krfDgcbx0jI92cq?FFESVg0D$>F+bil} zY~$)|>1HZsX=5sAZ2WgPB5P=8X#TI+NQ(M~GqyVB53c6IdX=k>Wu@A0Svf5#?uHaF zsYn|koIi3$(%GZ2+G+7Fv^lHTb#5b8sAHSTnL^qWZLM<(1|9|QFw9pnRU{svj}_Al zL)b9>fN{QiA($8peNEJyy`(a{&uh-T4_kdZFIVsKKVM(?05}76EEz?#W za^fiZOAd14IJ4zLX-n7Lq0qlQ^lW8Cvz4UKkV9~P}>sq0?xD3vg+$4vLm~C(+ zM{-3Z#qnZ09bJ>}j?6ry^h+@PfaD7*jZxBEY4)UG&daWb??6)TP+|3#Z&?GL?1i+280CFsE|vIXQbm| zM}Pk!U`U5NsNbyKzkrul-DzwB{X?n3E6?TUHr{M&+R*2%yOiXdW-_2Yd6?38M9Vy^ z*lE%gA{wwoSR~vN0=no}tP2Ul5Gk5M(Xq`$nw#ndFk`tcpd5A=Idue`XZ!FS>Q zG^0w#>P4pPG+*NC9gLP4x2m=cKP}YuS!l^?sHSFftZy{4CoQrb_ z^20(NnG`wAhMI=eq)SsIE~&Gp9Ne0nD4%Xiu|0Fj1UFk?6avDqjdXz{O1nKao*46y zT8~iA%Exu=G#{x=KD;_C&M+Zx4+n`sHT>^>=-1YM;H<72k>$py1?F3#T1*ef9mLZw z5naLQr?n7K;2l+{_uIw*_1nsTn~I|kkCgrn;|G~##hM;9l7Jy$yJfmk+&}W@JeKcF zx@@Woiz8qdi|D%aH3XTx5*wDlbs?dC1_nrFpm^QbG@wM=i2?Zg;$VK!c^Dp8<}BTI zyRhAq@#%2pGV49*Y5_mV4+OICP|%I(dQ7x=6Ob}>EjnB_-_18*xrY?b%-yEDT(wrO z9RY2QT0`_OpGfMObKHV;QLVnrK%mc?$WAdIT`kJQT^n%GuzE7|9@k3ci5fYOh(287 zuIbg!GB3xLg$YN=n)^pHGB0jH+_iIiC=nUcD;G6LuJsjn2VI1cyZx=a?ShCsF==QK z;q~*m&}L<-cb+mDDXzvvrRsybcgQ;Vg21P(uLv5I+eGc7o7tc6`;OA9{soHFOz zT~2?>Ts}gprIX$wRBb4yE>ot<8+*Bv`qbSDv*VtRi|cyWS>)Fjs>fkNOH-+PX&4(~ z&)T8Zam2L6puQl?;5zg9h<}k4#|yH9czHw;1jw-pwBM*O2hUR6yvHATrI%^mvs9q_ z&ccT0>f#eDG<^WG^q@oVqlJrhxH)dcq2cty@l3~|5#UDdExyXUmLQ}f4#;6fI{f^t zDCsgIJ~0`af%YR%Ma5VQq-p21k`vaBu6WE?66+5=XUd%Ay%D$irN>5LhluRWt7 zov-=f>QbMk*G##&DTQyou$s7UqjjW@k6=!I@!k+S{pP8R(2=e@io;N8E`EOB;OGoI zw6Q+{X1_I{OO0HPpBz!X!@`5YQ2)t{+!?M_iH25X(d~-Zx~cXnS9z>u?+If|iNJbx zyFU2d1!ITX64D|lE0Z{dLRqL1Ajj=CCMfC4lD3&mYR_R_VZ>_7_~|<^o*%_&jevU+ zQ4|qzci=0}Jydw|LXLCrOl1_P6Xf@c0$ieK2^7@A9UbF{@V_0p%lqW|L?5k>bVM8|p5v&2g;~r>B8uo<4N+`B zH{J)h;SYiIVx@#jI&p-v3dwL5QNV1oxPr8J%ooezTnLW>i*3Isb49%5i!&ac_dEXv zvXmVUck^QHmyrF8>CGXijC_R-y(Qr{3Zt~EmW)-nC!tiH`wlw5D*W7Pip;T?&j%kX z6DkZX4&}iw>hE(boLyjOoupf6JpvBG8}jIh!!VhnD0>}KSMMo{1#uU6kiFcA04~|7 zVO8eI&x1`g4CZ<2cYUI(n#wz2MtVFHx47yE5eL~8bot~>EHbevSt}LLMQX?odD{Ux zJMnam{d)W4da{l7&y-JrgiU~qY3$~}_F#G7|MxT)e;G{U`In&?`j<5D->}cb{}{T(4DF0BOk-=1195KB-E*o@c?`>y#4=dMtYtSY=&L{!TAjFVcq0y@AH`vH! z$41+u!Ld&}F^COPgL(EE{0X7LY&%D7-(?!kjFF7=qw<;`V{nwWBq<)1QiGJgUc^Vz ztMUlq1bZqKn17|6x6iAHbWc~l1HcmAxr%$Puv!znW)!JiukwIrqQ00|H$Z)OmGG@= zv%A8*4cq}(?qn4rN6o`$Y))(MyXr8R<2S^J+v(wmFmtac!%VOfN?&(8Nr!T@kV`N; z*Q33V3t`^rN&aBiHet)18wy{*wi1=W!B%B-Q6}SCrUl$~Hl{@!95ydml@FK8P=u4s z4e*7gV2s=YxEvskw2Ju!2%{8h01rx-3`NCPc(O zH&J0VH5etNB2KY6k4R@2Wvl^Ck$MoR3=)|SEclT2ccJ!RI9Nuter7u9@;sWf-%um;GfI!=eEIQ2l2p_YWUd{|6EG ze{yO6;lMc>;2tPrsNdi@&1K6(1;|$xe8vLgiouj%QD%gYk`4p{Ktv9|j+!OF-P?@p z;}SV|oIK)iwlBs+`ROXkhd&NK zzo__r!B>tOXpBJMDcv!Mq54P+n4(@dijL^EpO1wdg~q+!DT3lB<>9AANSe!T1XgC=J^)IP0XEZ()_vpu!!3HQyJhwh?r`Ae%Yr~b% zO*NY9t9#qWa@GCPYOF9aron7thfWT`eujS4`t2uG6)~JRTI;f(ZuoRQwjZjp5Pg34 z)rp$)Kr?R+KdJ;IO;pM{$6|2y=k_siqvp%)2||cHTe|b5Ht8&A{wazGNca zX$Ol?H)E_R@SDi~4{d-|8nGFhZPW;Cts1;08TwUvLLv&_2$O6Vt=M)X;g%HUr$&06 zISZb(6)Q3%?;3r~*3~USIg=HcJhFtHhIV(siOwV&QkQe#J%H9&E21!C*d@ln3E@J* zVqRO^<)V^ky-R|%{(9`l-(JXq9J)1r$`uQ8a}$vr9E^nNiI*thK8=&UZ0dsFN_eSl z(q~lnD?EymWLsNa3|1{CRPW60>DSkY9YQ;$4o3W7Ms&@&lv9eH!tk~N&dhqX&>K@} zi1g~GqglxkZ5pEFkllJ)Ta1I^c&Bt6#r(QLQ02yHTaJB~- zCcE=5tmi`UA>@P=1LBfBiqk)HB4t8D?02;9eXj~kVPwv?m{5&!&TFYhu>3=_ zsGmYZ^mo*-j69-42y&Jj0cBLLEulNRZ9vXE)8~mt9C#;tZs;=#M=1*hebkS;7(aGf zcs7zH(I8Eui9UU4L--))yy`&d&$In&VA2?DAEss4LAPCLd>-$i?lpXvn!gu^JJ$(DoUlc6wE98VLZ*z`QGQov5l4Fm_h?V-;mHLYDVOwKz7>e4+%AzeO>P6v}ndPW| zM>m#6Tnp7K?0mbK=>gV}=@k*0Mr_PVAgGMu$j+pWxzq4MAa&jpCDU&-5eH27Iz>m^ zax1?*HhG%pJ((tkR(V(O(L%7v7L%!_X->IjS3H5kuXQT2!ow(;%FDE>16&3r){!ex zhf==oJ!}YU89C9@mfDq!P3S4yx$aGB?rbtVH?sHpg?J5C->!_FHM%Hl3#D4eplxzQ zRA+<@LD%LKSkTk2NyWCg7u=$%F#;SIL44~S_OGR}JqX}X+=bc@swpiClB`Zbz|f!4 z7Ysah7OkR8liXfI`}IIwtEoL}(URrGe;IM8%{>b1SsqXh)~w}P>yiFRaE>}rEnNkT z!HXZUtxUp1NmFm)Dm@-{FI^aRQqpSkz}ZSyKR%Y}YHNzBk)ZIp} zMtS=aMvkgWKm9&oTcU0?S|L~CDqA+sHpOxwnswF-fEG)cXCzUR?ps@tZa$=O)=L+5 zf%m58cq8g_o}3?Bhh+c!w4(7AjxwQ3>WnVi<{{38g7yFboo>q|+7qs<$8CPXUFAN< zG&}BHbbyQ5n|qqSr?U~GY{@GJ{(Jny{bMaOG{|IkUj7tj^9pa9|FB_<+KHLxSxR;@ zHpS$4V)PP+tx}22fWx(Ku9y+}Ap;VZqD0AZW4gCDTPCG=zgJmF{|x;(rvdM|2|9a}cex6xrMkERnkE;}jvU-kmzd%_J50$M`lIPCKf+^*zL=@LW`1SaEc%=m zQ+lT06Gw+wVwvQ9fZ~#qd430v2HndFsBa9WjD0P}K(rZYdAt^5WQIvb%D^Q|pkVE^ zte$&#~zmULFACGfS#g=2OLOnIf2Of-k!(BIHjs77nr!5Q1*I9 z1%?=~#Oss!rV~?-6Gm~BWJiA4mJ5TY&iPm_$)H1_rTltuU1F3I(qTQ^U$S>%$l z)Wx1}R?ij0idp@8w-p!Oz{&*W;v*IA;JFHA9%nUvVDy7Q8woheC#|8QuDZb-L_5@R zOqHwrh|mVL9b=+$nJxM`3eE{O$sCt$UK^2@L$R(r^-_+z?lOo+me-VW=Zw z-Bn>$4ovfWd%SPY`ab-u9{INc*k2h+yH%toDHIyqQ zO68=u`N}RIIs7lsn1D){)~%>ByF<>i@qFb<-axvu(Z+6t7v<^z&gm9McRB~BIaDn$ z#xSGT!rzgad8o>~kyj#h1?7g96tOcCJniQ+*#=b7wPio>|6a1Z?_(TS{)KrPe}(8j z!#&A=k(&Pj^F;r)CI=Z{LVu>uj!_W1q4b`N1}E(i%;BWjbEcnD=mv$FL$l?zS6bW!{$7j1GR5ocn94P2u{ z70tAAcpqtQo<@cXw~@i-@6B23;317|l~S>CB?hR5qJ%J3EFgyBdJd^fHZu7AzHF(BQ!tyAz^L0`X z23S4Fe{2X$W0$zu9gm%rg~A>ijaE#GlYlrF9$ds^QtaszE#4M(OLVP2O-;XdT(XIC zatwzF*)1c+t~c{L=fMG8Z=k5lv>U0;C{caN1NItnuSMp)6G3mbahu>E#sj&oy94KC zpH}8oEw{G@N3pvHhp{^-YaZeH;K+T_1AUv;IKD<=mv^&Ueegrb!yf`4VlRl$M?wsl zZyFol(2|_QM`e_2lYSABpKR{{NlxlDSYQNkS;J66aT#MSiTx~;tUmvs-b*CrR4w=f z8+0;*th6kfZ3|5!Icx3RV11sp=?`0Jy3Fs0N4GZQMN=8HmT6%x9@{Dza)k}UwL6JT zHRDh;%!XwXr6yuuy`4;Xsn0zlR$k%r%9abS1;_v?`HX_hI|+EibVnlyE@3aL5vhQq zlIG?tN^w@0(v9M*&L+{_+RQZw=o|&BRPGB>e5=ys7H`nc8nx)|-g;s7mRc7hg{GJC zAe^vCIJhajmm7C6g! zL&!WAQ~5d_5)00?w_*|*H>3$loHrvFbitw#WvLB!JASO?#5Ig5$Ys10n>e4|3d;tS zELJ0|R4n3Az(Fl3-r^QiV_C;)lQ1_CW{5bKS15U|E9?ZgLec@%kXr84>5jV2a5v=w z?pB1GPdxD$IQL4)G||B_lI+A=08MUFFR4MxfGOu07vfIm+j=z9tp~5i_6jb`tR>qV z$#`=BQ*jpCjm$F0+F)L%xRlnS%#&gro6PiRfu^l!EVan|r3y}AHJQOORGx4~ z&<)3=K-tx518DZyp%|!EqpU!+X3Et7n2AaC5(AtrkW>_57i}$eqs$rupubg0a1+WO zGHZKLN2L0D;ab%{_S1Plm|hx8R?O14*w*f&2&bB050n!R2by zw!@XOQx$SqZ5I<(Qu$V6g>o#A!JVwErWv#(Pjx=KeS0@hxr4?13zj#oWwPS(7Ro|v z>Mp@Kmxo79q|}!5qtX2-O@U&&@6s~!I&)1WQIl?lTnh6UdKT_1R640S4~f=_xoN3- zI+O)$R@RjV$F=>Ti7BlnG1-cFKCC(t|Qjm{SalS~V-tX#+2ekRhwmN zZr`8{QF6y~Z!D|{=1*2D-JUa<(1Z=;!Ei!KiRNH?o{p5o3crFF=_pX9O-YyJchr$~ zRC`+G+8kx~fD2k*ZIiiIGR<8r&M@3H?%JVOfE>)})7ScOd&?OjgAGT@WVNSCZ8N(p zuQG~76GE3%(%h1*vUXg$vH{ua0b`sQ4f0*y=u~lgyb^!#CcPJa2mkSEHGLsnO^kb$ zru5_l#nu=Y{rSMWiYx?nO{8I!gH+?wEj~UM?IrG}E|bRIBUM>UlY<`T1EHpRr36vv zBi&dG8oxS|J$!zoaq{+JpJy+O^W(nt*|#g32bd&K^w-t>!Vu9N!k9eA8r!Xc{utY> zg9aZ(D2E0gL#W0MdjwES-7~Wa8iubPrd?8-$C4BP?*wok&O8+ykOx{P=Izx+G~hM8 z*9?BYz!T8~dzcZr#ux8kS7u7r@A#DogBH8km8Ry4slyie^n|GrTbO|cLhpqgMdsjX zJ_LdmM#I&4LqqsOUIXK8gW;V0B(7^$y#h3h>J0k^WJfAMeYek%Y-Dcb_+0zPJez!GM zAmJ1u;*rK=FNM0Nf}Y!!P9c4)HIkMnq^b;JFd!S3?_Qi2G#LIQ)TF|iHl~WKK6JmK zbv7rPE6VkYr_%_BT}CK8h=?%pk@3cz(UrZ{@h40%XgThP*-Oeo`T0eq9 zA8BnWZKzCy5e&&_GEsU4*;_k}(8l_&al5K-V*BFM=O~;MgRkYsOs%9eOY6s6AtE*<7GQAR2ulC3RAJrG_P1iQK5Z~&B z&f8X<>yJV6)oDGIlS$Y*D^Rj(cszTy5c81a5IwBr`BtnC6_e`ArI8CaTX_%rx7;cn zR-0?J_LFg*?(#n~G8cXut(1nVF0Oka$A$1FGcERU<^ggx;p@CZc?3UB41RY+wLS`LWFNSs~YP zuw1@DNN3lTd|jDL7gjBsd9}wIw}4xT2+8dBQzI00m<@?c2L%>}QLfK5%r!a-iII`p zX@`VEUH)uj^$;7jVUYdADQ2k*!1O3WdfgF?OMtUXNpQ1}QINamBTKDuv19^{$`8A1 zeq%q*O0mi@(%sZU>Xdb0Ru96CFqk9-L3pzLVsMQ`Xpa~N6CR{9Rm2)A|CI21L(%GW zh&)Y$BNHa=FD+=mBw3{qTgw)j0b!Eahs!rZnpu)z!!E$*eXE~##yaXz`KE5(nQM`s zD!$vW9XH)iMxu9R>r$VlLk9oIR%HxpUiW=BK@4U)|1WNQ=mz9a z^!KkO=>GaJ!GBXm{KJj^;kh-MkUlEQ%lza`-G&}C5y1>La1sR6hT=d*NeCnuK%_LV zOXt$}iP6(YJKc9j-Fxq~*ItVUqljQ8?oaysB-EYtFQp9oxZ|5m0^Hq(qV!S+hq#g( z?|i*H2MIr^Kxgz+3vIljQ*Feejy6S4v~jKEPTF~Qhq!(ms5>NGtRgO5vfPPc4Z^AM zTj!`5xEreIN)vaNxa|q6qWdg>+T`Ol0Uz)ckXBXEGvPNEL3R8hB3=C5`@=SYgAju1 z!)UBr{2~=~xa{b8>x2@C7weRAEuatC)3pkRhT#pMPTpSbA|tan%U7NGMvzmF?c!V8 z=pEWxbdXbTAGtWTyI?Fml%lEr-^AE}w#l(<7OIw;ctw}imYax&vR4UYNJZK6P7ZOd zP87XfhnUHxCUHhM@b*NbTi#(-8|wcv%3BGNs#zRCVV(W?1Qj6^PPQa<{yaBwZ`+<`w|;rqUY_C z&AeyKwwf*q#OW-F()lir=T^<^wjK65Lif$puuU5+tk$;e_EJ;Lu+pH>=-8=PDhkBg z8cWt%@$Sc#C6F$Vd+0507;{OOyT7Hs%nKS88q-W!$f~9*WGBpHGgNp}=C*7!RiZ5s zn1L_DbKF@B8kwhDiLKRB@lsXVVLK|ph=w%_`#owlf@s@V(pa`GY$8h%;-#h@TsO|Y8V=n@*!Rog7<7Cid%apR|x zOjhHCyfbIt%+*PCveTEcuiDi%Wx;O;+K=W?OFUV%)%~6;gl?<0%)?snDDqIvkHF{ zyI02)+lI9ov42^hL>ZRrh*HhjF9B$A@=H94iaBESBF=eC_KT$8A@uB^6$~o?3Wm5t1OIaqF^~><2?4e3c&)@wKn9bD? zoeCs;H>b8DL^F&>Xw-xjZEUFFTv>JD^O#1E#)CMBaG4DX9bD(Wtc8Rzq}9soQ8`jf zeSnHOL}<+WVSKp4kkq&?SbETjq6yr@4%SAqOG=9E(3YeLG9dtV+8vmzq+6PFPk{L; z(&d++iu=^F%b+ea$i2UeTC{R*0Isk;vFK!no<;L+(`y`3&H-~VTdKROkdyowo1iqR zbVW(3`+(PQ2>TKY>N!jGmGo7oeoB8O|P_!Ic@ zZ^;3dnuXo;WJ?S+)%P>{Hcg!Jz#2SI(s&dY4QAy_vRlmOh)QHvs_7c&zkJCmJGVvV zX;Mtb>QE+xp`KyciG$Cn*0?AK%-a|=o!+7x&&yzHQOS>8=B*R=niSnta^Pxp1`=md z#;$pS$4WCT?mbiCYU?FcHGZ#)kHVJTTBt^%XE(Q};aaO=Zik0UgLcc0I(tUpt(>|& zcxB_|fxCF7>&~5eJ=Dpn&5Aj{A^cV^^}(7w#p;HG&Q)EaN~~EqrE1qKrMAc&WXIE;>@<&)5;gD2?={Xf@Mvn@OJKw=8Mgn z!JUFMwD+s==JpjhroT&d{$kQAy%+d`a*XxDEVxy3`NHzmITrE`o!;5ClXNPb4t*8P zzAivdr{j_v!=9!^?T3y?gzmqDWX6mkzhIzJ-3S{T5bcCFMr&RPDryMcdwbBuZbsgN zGrp@^i?rcfN7v0NKGzDPGE#4yszxu=I_`MI%Z|10nFjU-UjQXXA?k8Pk|OE<(?ae) zE%vG#eZAlj*E7_3dx#Zz4kMLj>H^;}33UAankJiDy5ZvEhrjr`!9eMD8COp}U*hP+ zF}KIYx@pkccIgyxFm#LNw~G&`;o&5)2`5aogs`1~7cMZQ7zj!%L4E`2yzlQN6REX20&O<9 zKV6fyr)TScJPPzNTC2gL+0x#=u>(({{D7j)c-%tvqls3#Y?Z1m zV5WUE)zdJ{$p>yX;^P!UcXP?UD~YM;IRa#Rs5~l+*$&nO(;Ers`G=0D!twR(0GF@c zHl9E5DQI}Oz74n zfKP>&$q0($T4y$6w(p=ERAFh+>n%iaeRA%!T%<^+pg?M)@ucY<&59$x9M#n+V&>}=nO9wCV{O~lg&v#+jcUj(tQ z`0u1YH)-`U$15a{pBkGyPL0THv1P|4e@pf@3IBZS4dVJPo#H>pWq%Lr0YS-SeWash z8R7=jb28KPMI|_lo#GEO|5B?N_e``H*23{~a!AmUJ+fb4HX-%QI@lSEUxKlGV7z7Q zSKw@-TR>@1RL%w{x}dW#k1NgW+q4yt2Xf1J62Bx*O^WG8OJ|FqI4&@d3_o8Id@*)4 zYrk=>@!wv~mh7YWv*bZhxqSmFh2Xq)o=m;%n$I?GSz49l1$xRpPu_^N(vZ>*>Z<04 z2+rP70oM=NDysd!@fQdM2OcyT?3T^Eb@lIC-UG=Bw{BjQ&P`KCv$AcJ;?`vdZ4){d z&gkoUK{$!$$K`3*O-jyM1~p-7T*qb)Ys>Myt^;#1&a%O@x8A+E>! zY8=eD`ZG)LVagDLBeHg>=atOG?Kr%h4B%E6m@J^C+U|y)XX@f z8oyJDW|9g=<#f<{JRr{y#~euMnv)`7j=%cHWLc}ngjq~7k**6%4u>Px&W%4D94(r* z+akunK}O0DC2A%Xo9jyF;DobX?!1I(7%}@7F>i%&nk*LMO)bMGg2N+1iqtg+r(70q zF5{Msgsm5GS7DT`kBsjMvOrkx&|EU!{{~gL4d2MWrAT=KBQ-^zQCUq{5PD1orxlIL zq;CvlWx#f1NWvh`hg011I%?T_s!e38l*lWVt|~z-PO4~~1g)SrJ|>*tXh=QfXT)%( z+ex+inPvD&O4Ur;JGz>$sUOnWdpSLcm1X%aQDw4{dB!cnj`^muI$CJ2%p&-kULVCE z>$eMR36kN$wCPR+OFDM3-U(VOrp9k3)lI&YVFqd;Kpz~K)@Fa&FRw}L(SoD z9B4a+hQzZT-BnVltst&=kq6Y(f^S4hIGNKYBgMxGJ^;2yrO}P3;r)(-I-CZ)26Y6? z&rzHI_1GCvGkgy-t1E;r^3Le30|%$ebDRu2+gdLG)r=A~Qz`}~&L@aGJ{}vVs_GE* zVUjFnzHiXfKQbpv&bR&}l2bzIjAooB)=-XNcYmrGmBh(&iu@o!^hn0^#}m2yZZUK8 zufVm7Gq0y`Mj;9b>`c?&PZkU0j4>IL=UL&-Lp3j&47B5pAW4JceG{!XCA)kT<%2nqCxj<)uy6XR_uws~>_MEKPOpAQ!H zkn>FKh)<9DwwS*|Y(q?$^N!6(51O0 z^JM~Ax{AI1Oj$fs-S5d4T7Z_i1?{%0SsIuQ&r8#(JA=2iLcTN+?>wOL532%&dMYkT z*T5xepC+V6zxhS@vNbMoi|i)=rpli@R9~P!39tWbSSb904ekv7D#quKbgFEMTb48P zuq(VJ+&L8aWU(_FCD$3^uD!YM%O^K(dvy~Wm2hUuh6bD|#(I39Xt>N1Y{ZqXL`Fg6 zKQ?T2htHN!(Bx;tV2bfTtIj7e)liN-29s1kew>v(D^@)#v;}C4-G=7x#;-dM4yRWm zyY`cS21ulzMK{PoaQ6xChEZ}o_#}X-o}<&0)$1#3we?+QeLt;aVCjeA)hn!}UaKt< zat1fHEx13y-rXNMvpUUmCVzocPmN~-Y4(YJvQ#db)4|%B!rBsgAe+*yor~}FrNH08 z3V!97S}D7d$zbSD{$z;@IYMxM6aHdypIuS*pr_U6;#Y!_?0i|&yU*@16l z*dcMqDQgfNBf}?quiu4e>H)yTVfsp#f+Du0@=Kc41QockXkCkvu>FBd6Q+@FL!(Yx z2`YuX#eMEiLEDhp+9uFqME_E^faV&~9qjBHJkIp~%$x^bN=N)K@kvSVEMdDuzA0sn z88CBG?`RX1@#hQNd`o^V{37)!w|nA)QfiYBE^m=yQKv-fQF+UCMcuEe1d4BH7$?>b zJl-r9@0^Ie=)guO1vOd=i$_4sz>y3x^R7n4ED!5oXL3@5**h(xr%Hv)_gILarO46q+MaDOF%ChaymKoI6JU5Pg;7#2n9-18|S1;AK+ zgsn6;k6-%!QD>D?cFy}8F;r@z8H9xN1jsOBw2vQONVqBVEbkiNUqgw~*!^##ht>w0 zUOykwH=$LwX2j&nLy=@{hr)2O&-wm-NyjW7n~Zs9UlH;P7iP3 zI}S(r0YFVYacnKH(+{*)Tbw)@;6>%=&Th=+Z6NHo_tR|JCI8TJiXv2N7ei7M^Q+RM z?9o`meH$5Yi;@9XaNR#jIK^&{N|DYNNbtdb)XW1Lv2k{E>;?F`#Pq|&_;gm~&~Zc9 zf+6ZE%{x4|{YdtE?a^gKyzr}dA>OxQv+pq|@IXL%WS0CiX!V zm$fCePA%lU{%pTKD7|5NJHeXg=I0jL@$tOF@K*MI$)f?om)D63K*M|r`gb9edD1~Y zc|w7N)Y%do7=0{RC|AziW7#am$)9jciRJ?IWl9PE{G3U+$%FcyKs_0Cgq`=K3@ttV z9g;M!3z~f_?P%y3-ph%vBMeS@p7P&Ea8M@97+%XEj*(1E6vHj==d zjsoviB>j^$_^OI_DEPvFkVo(BGRo%cJeD){6Uckei=~1}>sp299|IRjhXe)%?uP0I zF5+>?0#Ye}T^Y$u_rc4=lPcq4K^D(TZG-w30-YiEM=dcK+4#o*>lJ8&JLi+3UcpZk z!^?95S^C0ja^jwP`|{<+3cBVog$(mRdQmadS+Vh~z zS@|P}=|z3P6uS+&@QsMp0no9Od&27O&14zHXGAOEy zh~OKpymK5C%;LLb467@KgIiVwYbYd6wFxI{0-~MOGfTq$nBTB!{SrWmL9Hs}C&l&l#m?s*{tA?BHS4mVKHAVMqm63H<|c5n0~k)-kbg zXidai&9ZUy0~WFYYKT;oe~rytRk?)r8bptITsWj(@HLI;@=v5|XUnSls7$uaxFRL+ zRVMGuL3w}NbV1`^=Pw*0?>bm8+xfeY(1PikW*PB>>Tq(FR`91N0c2&>lL2sZo5=VD zQY{>7dh_TX98L2)n{2OV=T10~*YzX27i2Q7W86M4$?gZIXZaBq#sA*{PH8){|GUi;oM>e?ua7eF4WFuFYZSG| zze?srg|5Ti8Og{O zeFxuw9!U+zhyk?@w zjsA6(oKD=Ka;A>Ca)oPORxK+kxH#O@zhC!!XS4@=swnuMk>t+JmLmFiE^1aX3f<)D@`%K0FGK^gg1a1j>zi z2KhV>sjU7AX3F$SEqrXSC}fRx64GDoc%!u2Yag68Lw@w9v;xOONf@o)Lc|Uh3<21ctTYu-mFZuHk*+R{GjXHIGq3p)tFtQp%TYqD=j1&y)>@zxoxUJ!G@ zgI0XKmP6MNzw>nRxK$-Gbzs}dyfFzt>#5;f6oR27ql!%+{tr+(`(>%51|k`ML} zY4eE)Lxq|JMas(;JibNQds1bUB&r}ydMQXBY4x(^&fY_&LlQC)3hylc$~8&~|06-D z#T+%66rYbHX%^KuqJED_wuGB+=h`nWA!>1n0)3wZrBG3%`b^Ozv6__dNa@%V14|!D zQ?o$z5u0^8`giv%qE!BzZ!3j;BlDlJDk)h@9{nSQeEk!z9RGW) z${RSF3phEM*ce*>Xdp}585vj$|40=&S{S-GTiE?Op*vY&Lvr9}BO$XWy80IF+6@%n z5*2ueT_g@ofP#u5pxb7n*fv^Xtt7&?SRc{*2Ka-*!BuOpf}neHGCiHy$@Ka1^Dint z;DkmIL$-e)rj4o2WQV%Gy;Xg(_Bh#qeOsTM2f@KEe~4kJ8kNLQ+;(!j^bgJMcNhvklP5Z6I+9Fq@c&D~8Fb-4rmDT!MB5QC{Dsb;BharP*O;SF4& zc$wj-7Oep7#$WZN!1nznc@Vb<_Dn%ga-O#J(l=OGB`dy=Sy&$(5-n3zzu%d7E#^8`T@}V+5B;PP8J14#4cCPw-SQTdGa2gWL0*zKM z#DfSXs_iWOMt)0*+Y>Lkd=LlyoHjublNLefhKBv@JoC>P7N1_#> zv=mLWe96%EY;!ZGSQDbZWb#;tzqAGgx~uk+-$+2_8U`!ypbwXl z^2E-FkM1?lY@yt8=J3%QK+xaZ6ok=-y%=KXCD^0r!5vUneW>95PzCkOPO*t}p$;-> ze5j-BLT_;)cZQzR2CEsm@rU7GZfFtdp*a|g4wDr%8?2QkIGasRfDWT-Dvy*U{?IHT z*}wGnzdlSptl#ZF^sf)KT|BJs&kLG91^A6ls{CzFprZ6-Y!V0Xysh%9p%iMd7HLsS zN+^Un$tDV)T@i!v?3o0Fsx2qI(AX_$dDkBzQ@fRM%n zRXk6hb9Py#JXUs+7)w@eo;g%QQ95Yq!K_d=z{0dGS+pToEI6=Bo8+{k$7&Z zo4>PH(`ce8E-Ps&uv`NQ;U$%t;w~|@E3WVOCi~R4oj5wP?%<*1C%}Jq%a^q~T7u>K zML5AKfQDv6>PuT`{SrKHRAF+^&edg6+5R_#H?Lz3iGoWo#PCEd0DS;)2U({{X#zU^ zw_xv{4x7|t!S)>44J;KfA|DC?;uQ($l+5Vp7oeqf7{GBF9356nx|&B~gs+@N^gSdd zvb*>&W)|u#F{Z_b`f#GVtQ`pYv3#||N{xj1NgB<#=Odt6{eB%#9RLt5v zIi|0u70`#ai}9fJjKv7dE!9ZrOIX!3{$z_K5FBd-Kp-&e4(J$LD-)NMTp^_pB`RT; zftVVlK2g@+1Ahv2$D){@Y#cL#dUj9*&%#6 zd2m9{1NYp>)6=oAvqdCn5#cx{AJ%S8skUgMglu2*IAtd+z1>B&`MuEAS(D(<6X#Lj z?f4CFx$)M&$=7*>9v1ER4b6!SIz-m0e{o0BfkySREchp?WdVPpQCh!q$t>?rL!&Jg zd#heM;&~A}VEm8Dvy&P|J*eAV&w!&Nx6HFV&B8jJFVTmgLaswn!cx$&%JbTsloz!3 zMEz1d`k==`Ueub_JAy_&`!ogbwx27^ZXgFNAbx=g_I~5nO^r)}&myw~+yY*cJl4$I znNJ32M&K=0(2Dj_>@39`3=FX!v3nZHno_@q^!y}%(yw0PqOo=);6Y@&ylVe>nMOZ~ zd>j#QQSBn3oaWd;qy$&5(5H$Ayi)0haAYO6TH>FR?rhqHmNOO+(})NB zLI@B@v0)eq!ug`>G<@htRlp3n!EpU|n+G+AvXFrWSUsLMBfL*ZB`CRsIVHNTR&b?K zxBgsN0BjfB>UVcJ|x%=-zb%OV7lmZc& zxiupadZVF7)6QuhoY;;FK2b*qL0J-Rn-8!X4ZY$-ZSUXV5DFd7`T41c(#lAeLMoeT z4%g655v@7AqT!i@)Edt5JMbN(=Q-6{=L4iG8RA%}w;&pKmtWvI4?G9pVRp|RTw`g0 zD5c12B&A2&P6Ng~8WM2eIW=wxd?r7A*N+&!Be7PX3s|7~z=APxm=A?5 zt>xB4WG|*Td@VX{Rs)PV0|yK`oI3^xn(4c_j&vgxk_Y3o(-`_5o`V zRTghg6%l@(qodXN;dB#+OKJEEvhfcnc#BeO2|E(5df-!fKDZ!%9!^BJ_4)9P+9Dq5 zK1=(v?KmIp34r?z{NEWnLB3Px{XYwy-akun4F7xTRr2^zeYW{gcK9)>aJDdU5;w5@ zak=<+-PLH-|04pelTb%ULpuuuJC7DgyT@D|p{!V!0v3KpDnRjANN12q6SUR3mb9<- z>2r~IApQGhstZ!3*?5V z8#)hJ0TdZg0M-BK#nGFP>$i=qk82DO z7h;Ft!D5E15OgW)&%lej*?^1~2=*Z5$2VX>V{x8SC+{i10BbtUk9@I#Vi&hX)q
Q!LwySI{Bnv%Sm)yh{^sSVJ8&h_D-BJ_YZe5eCaAWU9b$O2c z$T|{vWVRtOL!xC0DTc(Qbe`ItNtt5hr<)VijD0{U;T#bUEp381_y`%ZIav?kuYG{iyYdEBPW=*xNSc;Rlt6~F4M`5G+VtOjc z*0qGzCb@gME5udTjJA-9O<&TWd~}ysBd(eVT1-H82-doyH9RST)|+Pb{o*;$j9Tjs zhU!IlsPsj8=(x3bAKJTopW3^6AKROHR^7wZ185wJGVhA~hEc|LP;k7NEz-@4p5o}F z`AD6naG3(n=NF9HTH81=F+Q|JOz$7wm9I<+#BSmB@o_cLt2GkW9|?7mM;r!JZp89l zbo!Hp8=n!XH1{GwaDU+k)pGp`C|cXkCU5%vcH)+v@0eK>%7gWxmuMu9YLlChA|_D@ zi#5zovN_!a-0?~pUV-Rj*1P)KwdU-LguR>YM&*Nen+ln8Q$?WFCJg%DY%K}2!!1FE zDv-A%Cbwo^p(lzac&_TZ-l#9kq`mhLcY3h9ZTUVCM(Ad&=EriQY5{jJv<5K&g|*Lk zgV%ILnf1%8V2B0E&;Sp4sYbYOvvMebLwYwzkRQ#F8GpTQq#uv=J`uaSJ34OWITeSGo6+-8Xw znCk*n{kdDEi)Hi&u^)~cs@iyCkFWB2SWZU|Uc%^43ZIZQ-vWNExCCtDWjqHs;;tWf$v{}0{p0Rvxkq``)*>+Akq%|Na zA`@~-Vfe|+(AIlqru+7Ceh4nsVmO9p9jc8}HX^W&ViBDXT+uXbT#R#idPn&L>+#b6 zflC-4C5-X;kUnR~L>PSLh*gvL68}RBsu#2l`s_9KjUWRhiqF`j)`y`2`YU(>3bdBj z?>iyjEhe-~$^I5!nn%B6Wh+I`FvLNvauve~eX<+Ipl&04 zT}};W&1a3%W?dJ2=N#0t?e+aK+%t}5q%jSLvp3jZ%?&F}nOOWr>+{GFIa%wO_2`et z=JzoRR~}iKuuR+azPI8;Gf9)z3kyA4EIOSl!sRR$DlW}0>&?GbgPojmjmnln;cTqCt=ADbE zZ8GAnoM+S1(5$i8^O4t`ue;vO4i}z0wz-QEIVe5_u03;}-!G1NyY8;h^}y;tzY}i5 zqQr#Ur3Fy8sSa$Q0ys+f`!`+>9WbvU_I`Sj;$4{S>O3?#inLHCrtLy~!s#WXV=oVP zeE93*Nc`PBi4q@%Ao$x4lw9vLHM!6mn3-b_cebF|n-2vt-zYVF_&sDE--J-P;2WHo z+@n2areE0o$LjvjlV2X7ZU@j+`{*8zq`JR3gKF#EW|#+{nMyo-a>nFFTg&vhyT=b} zDa8+v0(Dgx0yRL@ZXOYIlVSZ0|MFizy0VPW8;AfA5|pe!#j zX}Py^8fl5SyS4g1WSKKtnyP+_PoOwMMwu`(i@Z)diJp~U54*-miOchy7Z35eL>^M z4p<-aIxH4VUZgS783@H%M7P9hX>t{|RU7$n4T(brCG#h9e9p! z+o`i;EGGq3&pF;~5V~eBD}lC)>if$w%Vf}AFxGqO88|ApfHf&Bvu+xdG)@vuF}Yvk z)o;~k-%+0K0g+L`Wala!$=ZV|z$e%>f0%XoLib%)!R^RoS+{!#X?h-6uu zF&&KxORdZU&EwQFITIRLo(7TA3W}y6X{?Y%y2j0It!ekU#<)$qghZtpcS>L3uh`Uj z7GY;6f$9qKynP#oS3$$a{p^{D+0oJQ71`1?OAn_m8)UGZmj3l*ZI)`V-a>MKGGFG< z&^jg#Ok%(hhm>hSrZ5;Qga4u(?^i>GiW_j9%_7M>j(^|Om$#{k+^*ULnEgzW_1gCICtAD^WpC`A z{9&DXkG#01Xo)U$OC(L5Y$DQ|Q4C6CjUKk1UkPj$nXH##J{c8e#K|&{mA*;b$r0E4 zUNo0jthwA(c&N1l=PEe8Rw_8cEl|-eya9z&H3#n`B$t#+aJ03RFMzrV@gowbe8v(c zIFM60^0&lCFO10NU4w@|61xiZ4CVXeaKjd;d?sv52XM*lS8XiVjgWpRB;&U_C0g+`6B5V&w|O6B*_q zsATxL!M}+$He)1eOWECce#eS@2n^xhlB4<_Nn?yCVEQWDs(r`|@2GqLe<#(|&P0U? z$7V5IgpWf09uIf_RazRwC?qEqRaHyL?iiS05UiGesJy%^>-C{{ypTBI&B0-iUYhk> zIk<5xpsuV@g|z(AZD+C-;A!fTG=df1=<%nxy(a(IS+U{ME4ZbDEBtcD_3V=icT6*_ z)>|J?>&6%nvHhZERBtjK+s4xnut*@>GAmA5m*OTp$!^CHTr}vM4n(X1Q*;{e-Rd2BCF-u@1ZGm z!S8hJ6L=Gl4T_SDa7Xx|-{4mxveJg=ctf`BJ*fy!yF6Dz&?w(Q_6B}WQVtNI!BVBC zKfX<>7vd6C96}XAQmF-Jd?1Q4eTfRB3q7hCh0f!(JkdWT5<{iAE#dKy*Jxq&3a1@~ z8C||Dn2mFNyrUV|<-)C^_y7@8c2Fz+2jrae9deBDu;U}tJ{^xAdxCD248(k;dCJ%o z`y3sADe>U%suxwwv~8A1+R$VB=Q?%U?4joI$um;aH+eCrBqpn- z%79D_7rb;R-;-9RTrwi9dPlg8&@tfWhhZ(Vx&1PQ+6(huX`;M9x~LrW~~#3{j0Bh2kDU$}@!fFQej4VGkJv?M4rU^x!RU zEwhu$!CA_iDjFjrJa`aocySDX16?~;+wgav;}Zut6Mg%C4>}8FL?8)Kgwc(Qlj{@#2Pt0?G`$h7P#M+qoXtlV@d}%c&OzO+QYKK`kyXaK{U(O^2DyIXCZlNQjt0^8~8JzNGrIxhj}}M z&~QZlbx%t;MJ(Vux;2tgNKGlAqphLq%pd}JG9uoVHUo?|hN{pLQ6Em%r*+7t^<);X zm~6=qChlNAVXNN*Sow->*4;}T;l;D1I-5T{Bif@4_}=>l`tK;qqDdt5zvisCKhMAH z#r}`)7VW?LZqfdmXQ%zo5bJ00{Xb9^YKrk0Nf|oIW*K@(=`o2Vndz}ZDyk{!u}PVx zzd--+_WC*U{~DH3{?GI64IB+@On&@9X>EUAo&L+G{L^dozaI4C3G#2wr~hseW@K&g zKWs{uHu-9Je!3;4pE>eBltKUXb^*hG8I&413)$J&{D4N%7PcloU6bn%jPxJyQL?g* z9g+YFFEDiE`8rW^laCNzQmi7CTnPfwyg3VDHRAl>h=In6jeaVOP@!-CP60j3+#vpL zEYmh_oP0{-gTe7Or`L6x)6w?77QVi~jD8lWN@3RHcm80iV%M1A!+Y6iHM)05iC64tb$X2lV_%Txk@0l^hZqi^%Z?#- zE;LE0uFx)R08_S-#(wC=dS&}vj6P4>5ZWjhthP=*Hht&TdLtKDR;rXEX4*z0h74FA zMCINqrh3Vq;s%3MC1YL`{WjIAPkVL#3rj^9Pj9Ss7>7duy!9H0vYF%>1jh)EPqvlr6h%R%CxDsk| z!BACz7E%j?bm=pH6Eaw{+suniuY7C9Ut~1cWfOX9KW9=H><&kQlinPV3h9R>3nJvK z4L9(DRM=x;R&d#a@oFY7mB|m8h4692U5eYfcw|QKwqRsshN(q^v$4$)HgPpAJDJ`I zkqjq(8Cd!K!+wCd=d@w%~e$=gdUgD&wj$LQ1r>-E=O@c ze+Z$x{>6(JA-fNVr)X;*)40Eym1TtUZI1Pwwx1hUi+G1Jlk~vCYeXMNYtr)1?qwyg zsX_e*$h?380O00ou?0R@7-Fc59o$UvyVs4cUbujHUA>sH!}L54>`e` zHUx#Q+Hn&Og#YVOuo*niy*GU3rH;%f``nk#NN5-xrZ34NeH$l`4@t);4(+0|Z#I>Y z)~Kzs#exIAaf--65L0UHT_SvV8O2WYeD>Mq^Y6L!Xu8%vnpofG@w!}R7M28?i1*T&zp3X4^OMCY6(Dg<-! zXmcGQrRgHXGYre7GfTJ)rhl|rs%abKT_Nt24_Q``XH{88NVPW+`x4ZdrMuO0iZ0g` z%p}y};~T5gbb9SeL8BSc`SO#ixC$@QhXxZ=B}L`tP}&k?1oSPS=4%{UOHe0<_XWln zwbl5cn(j-qK`)vGHY5B5C|QZd5)W7c@{bNVXqJ!!n$^ufc?N9C-BF2QK1(kv++h!>$QbAjq)_b$$PcJdV+F7hz0Hu@ zqj+}m0qn{t^tD3DfBb~0B36|Q`bs*xs|$i^G4uNUEBl4g;op-;Wl~iThgga?+dL7s zUP(8lMO?g{GcYpDS{NM!UA8Hco?#}eNEioRBHy4`mq!Pd-9@-97|k$hpEX>xoX+dY zDr$wfm^P&}Wu{!%?)U_(%Mn79$(ywvu*kJ9r4u|MyYLI_67U7%6Gd_vb##Nerf@>& z8W11z$$~xEZt$dPG}+*IZky+os5Ju2eRi;1=rUEeIn>t-AzC_IGM-IXWK3^6QNU+2pe=MBn4I*R@A%-iLDCOHTE-O^wo$sL_h{dcPl=^muAQb`_BRm};=cy{qSkui;`WSsj9%c^+bIDQ z0`_?KX0<-=o!t{u(Ln)v>%VGL z0pC=GB7*AQ?N7N{ut*a%MH-tdtNmNC+Yf$|KS)BW(gQJ*z$d{+{j?(e&hgTy^2|AR9vx1Xre2fagGv0YXWqtNkg*v%40v?BJBt|f9wX5 z{QTlCM}b-0{mV?IG>TW_BdviUKhtosrBqdfq&Frdz>cF~yK{P@(w{Vr7z2qKFwLhc zQuogKO@~YwyS9%+d-zD7mJG~@?EFJLSn!a&mhE5$_4xBl&6QHMzL?CdzEnC~C3$X@ zvY!{_GR06ep5;<#cKCSJ%srxX=+pn?ywDwtJ2{TV;0DKBO2t++B(tIO4)Wh`rD13P z4fE$#%zkd=UzOB74gi=-*CuID&Z3zI^-`4U^S?dHxK8fP*;fE|a(KYMgMUo`THIS1f!*6dOI2 zFjC3O=-AL`6=9pp;`CYPTdVX z8(*?V&%QoipuH0>WKlL8A*zTKckD!paN@~hh zmXzm~qZhMGVdQGd=AG8&20HW0RGV8X{$9LldFZYm zE?}`Q3i?xJRz43S?VFMmqRyvWaS#(~Lempg9nTM$EFDP(Gzx#$r)W&lpFKqcAoJh-AxEw$-bjW>`_+gEi z2w`99#UbFZGiQjS8kj~@PGqpsPX`T{YOj`CaEqTFag;$jY z8_{Wzz>HXx&G*Dx<5skhpETxIdhKH?DtY@b9l8$l?UkM#J-Snmts7bd7xayKTFJ(u zyAT&@6cAYcs{PBfpqZa%sxhJ5nSZBPji?Zlf&}#L?t)vC4X5VLp%~fz2Sx<*oN<7` z?ge=k<=X7r<~F7Tvp9#HB{!mA!QWBOf%EiSJ6KIF8QZNjg&x~-%e*tflL(ji_S^sO ztmib1rp09uon}RcsFi#k)oLs@$?vs(i>5k3YN%$T(5Or(TZ5JW9mA6mIMD08=749$ z!d+l*iu{Il7^Yu}H;lgw=En1sJpCKPSqTCHy4(f&NPelr31^*l%KHq^QE>z>Ks_bH zjbD?({~8Din7IvZeJ>8Ey=e;I?thpzD=zE5UHeO|neioJwG;IyLk?xOz(yO&0DTU~ z^#)xcs|s>Flgmp;SmYJ4g(|HMu3v7#;c*Aa8iF#UZo7CvDq4>8#qLJ|YdZ!AsH%^_7N1IQjCro

K7UpUK$>l@ zw`1S}(D?mUXu_C{wupRS-jiX~w=Uqqhf|Vb3Cm9L=T+w91Cu^ z*&Ty%sN?x*h~mJc4g~k{xD4ZmF%FXZNC;oVDwLZ_WvrnzY|{v8hc1nmx4^}Z;yriXsAf+Lp+OFLbR!&Ox?xABwl zu8w&|5pCxmu#$?Cv2_-Vghl2LZ6m7}VLEfR5o2Ou$x02uA-%QB2$c(c1rH3R9hesc zfpn#oqpbKuVsdfV#cv@5pV4^f_!WS+F>SV6N0JQ9E!T90EX((_{bSSFv9ld%I0&}9 zH&Jd4MEX1e0iqDtq~h?DBrxQX1iI0lIs<|kB$Yrh&cpeK0-^K%=FBsCBT46@h#yi!AyDq1V(#V}^;{{V*@T4WJ&U-NTq43w=|K>z8%pr_nC>%C(Wa_l78Ufib$r8Od)IIN=u>417 z`Hl{9A$mI5A(;+-Q&$F&h-@;NR>Z<2U;Y21>>Z;s@0V@SbkMQQj%_;~+qTuQ?c|AV zcWm3XZQHhP&R%QWarS%mJ!9R^&!_)*s(v+VR@I#QrAT}`17Y+l<`b-nvmDNW`De%y zrwTZ9EJrj1AFA>B`1jYDow}~*dfPs}IZMO3=a{Fy#IOILc8F0;JS4x(k-NSpbN@qM z`@aE_e}5{!$v3+qVs7u?sOV(y@1Os*Fgu`fCW9=G@F_#VQ%xf$hj0~wnnP0$hFI+@ zkQj~v#V>xn)u??YutKsX>pxKCl^p!C-o?+9;!Nug^ z{rP!|+KsP5%uF;ZCa5F;O^9TGac=M|=V z_H(PfkV1rz4jl?gJ(ArXMyWT4y(86d3`$iI4^l9`vLdZkzpznSd5Ikfrs8qcSy&>z zTIZgWZGXw0n9ibQxYWE@gI0(3#KA-dAdPcsL_|hg2@~C!VZDM}5;v_Nykfq!*@*Zf zE_wVgx82GMDryKO{U{D>vSzSc%B~|cjDQrt5BN=Ugpsf8H8f1lR4SGo#hCuXPL;QQ z#~b?C4MoepT3X`qdW2dNn& zo8)K}%Lpu>0tQei+{>*VGErz|qjbK#9 zvtd8rcHplw%YyQCKR{kyo6fgg!)6tHUYT(L>B7er5)41iG`j$qe*kSh$fY!PehLcD zWeKZHn<492B34*JUQh=CY1R~jT9Jt=k=jCU2=SL&&y5QI2uAG2?L8qd2U(^AW#{(x zThSy=C#>k+QMo^7caQcpU?Qn}j-`s?1vXuzG#j8(A+RUAY})F@=r&F(8nI&HspAy4 z4>(M>hI9c7?DCW8rw6|23?qQMSq?*Vx?v30U%luBo)B-k2mkL)Ljk5xUha3pK>EEj z@(;tH|M@xkuN?gsz;*bygizwYR!6=(Xgcg^>WlGtRYCozY<rFX2E>kaZo)O<^J7a`MX8Pf`gBd4vrtD|qKn&B)C&wp0O-x*@-|m*0egT=-t@%dD zgP2D+#WPptnc;_ugD6%zN}Z+X4=c61XNLb7L1gWd8;NHrBXwJ7s0ce#lWnnFUMTR& z1_R9Fin4!d17d4jpKcfh?MKRxxQk$@)*hradH2$3)nyXep5Z;B z?yX+-Bd=TqO2!11?MDtG0n(*T^!CIiF@ZQymqq1wPM_X$Iu9-P=^}v7npvvPBu!d$ z7K?@CsA8H38+zjA@{;{kG)#AHME>Ix<711_iQ@WWMObXyVO)a&^qE1GqpP47Q|_AG zP`(AD&r!V^MXQ^e+*n5~Lp9!B+#y3#f8J^5!iC@3Y@P`;FoUH{G*pj*q7MVV)29+j z>BC`a|1@U_v%%o9VH_HsSnM`jZ-&CDvbiqDg)tQEnV>b%Ptm)T|1?TrpIl)Y$LnG_ zzKi5j2Fx^K^PG1=*?GhK;$(UCF-tM~^=Z*+Wp{FSuy7iHt9#4n(sUuHK??@v+6*|10Csdnyg9hAsC5_OrSL;jVkLlf zHXIPukLqbhs~-*oa^gqgvtpgTk_7GypwH><53riYYL*M=Q@F-yEPLqQ&1Sc zZB%w}T~RO|#jFjMWcKMZccxm-SL)s_ig?OC?y_~gLFj{n8D$J_Kw%{r0oB8?@dWzn zB528d-wUBQzrrSSLq?fR!K%59Zv9J4yCQhhDGwhptpA5O5U?Hjqt>8nOD zi{)0CI|&Gu%zunGI*XFZh(ix)q${jT8wnnzbBMPYVJc4HX*9d^mz|21$=R$J$(y7V zo0dxdbX3N#=F$zjstTf*t8vL)2*{XH!+<2IJ1VVFa67|{?LP&P41h$2i2;?N~RA30LV`BsUcj zfO9#Pg1$t}7zpv#&)8`mis3~o+P(DxOMgz-V*(?wWaxi?R=NhtW}<#^Z?(BhSwyar zG|A#Q7wh4OfK<|DAcl9THc-W4*>J4nTevsD%dkj`U~wSUCh15?_N@uMdF^Kw+{agk zJ`im^wDqj`Ev)W3k3stasP`88-M0ZBs7;B6{-tSm3>I@_e-QfT?7|n0D~0RRqDb^G zyHb=is;IwuQ&ITzL4KsP@Z`b$d%B0Wuhioo1CWttW8yhsER1ZUZzA{F*K=wmi-sb#Ju+j z-l@In^IKnb{bQG}Ps>+Vu_W#grNKNGto+yjA)?>0?~X`4I3T@5G1)RqGUZuP^NJCq&^HykuYtMDD8qq+l8RcZNJsvN(10{ zQ1$XcGt}QH-U^WU!-wRR1d--{B$%vY{JLWIV%P4-KQuxxDeJaF#{eu&&r!3Qu{w}0f--8^H|KwE>)ORrcR+2Qf zb})DRcH>k0zWK8@{RX}NYvTF;E~phK{+F;MkIP$)T$93Ba2R2TvKc>`D??#mv9wg$ zd~|-`Qx5LwwsZ2hb*Rt4S9dsF%Cny5<1fscy~)d;0m2r$f=83<->c~!GNyb!U)PA; zq^!`@@)UaG)Ew(9V?5ZBq#c%dCWZrplmuM`o~TyHjAIMh0*#1{B>K4po-dx$Tk-Cq z=WZDkP5x2W&Os`N8KiYHRH#UY*n|nvd(U>yO=MFI-2BEp?x@=N<~CbLJBf6P)}vLS?xJXYJ2^<3KJUdrwKnJnTp{ zjIi|R=L7rn9b*D#Xxr4*R<3T5AuOS+#U8hNlfo&^9JO{VbH!v9^JbK=TCGR-5EWR@ zN8T-_I|&@A}(hKeL4_*eb!1G8p~&_Im8|wc>Cdir+gg90n1dw?QaXcx6Op_W1r=axRw>4;rM*UOpT#Eb9xU1IiWo@h?|5uP zka>-XW0Ikp@dIe;MN8B01a7+5V@h3WN{J=HJ*pe0uwQ3S&MyWFni47X32Q7SyCTNQ z+sR!_9IZa5!>f&V$`q!%H8ci!a|RMx5}5MA_kr+bhtQy{-^)(hCVa@I!^TV4RBi zAFa!Nsi3y37I5EK;0cqu|9MRj<^r&h1lF}u0KpKQD^5Y+LvFEwM zLU@@v4_Na#Axy6tn3P%sD^5P#<7F;sd$f4a7LBMk zGU^RZHBcxSA%kCx*eH&wgA?Qwazm8>9SCSz_!;MqY-QX<1@p$*T8lc?@`ikEqJ>#w zcG``^CoFMAhdEXT9qt47g0IZkaU)4R7wkGs^Ax}usqJ5HfDYAV$!=6?>J6+Ha1I<5 z|6=9soU4>E))tW$<#>F ziZ$6>KJf0bPfbx_)7-}tMINlc=}|H+$uX)mhC6-Hz+XZxsKd^b?RFB6et}O#+>Wmw9Ec9) z{q}XFWp{3@qmyK*Jvzpyqv57LIR;hPXKsrh{G?&dRjF%Zt5&m20Ll?OyfUYC3WRn{cgQ?^V~UAv+5 z&_m#&nIwffgX1*Z2#5^Kl4DbE#NrD&Hi4|7SPqZ}(>_+JMz=s|k77aEL}<=0Zfb)a z%F(*L3zCA<=xO)2U3B|pcTqDbBoFp>QyAEU(jMu8(jLA61-H!ucI804+B!$E^cQQa z)_ERrW3g!B9iLb3nn3dlkvD7KsY?sRvls3QC0qPi>o<)GHx%4Xb$5a3GBTJ(k@`e@ z$RUa^%S15^1oLEmA=sayrP5;9qtf!Z1*?e$ORVPsXpL{jL<6E)0sj&swP3}NPmR%FM?O>SQgN5XfHE< zo(4#Cv11(%Nnw_{_Ro}r6=gKd{k?NebJ~<~Kv0r(r0qe4n3LFx$5%x(BKvrz$m?LG zjLIc;hbj0FMdb9aH9Lpsof#yG$(0sG2%RL;d(n>;#jb!R_+dad+K;Ccw!|RY?uS(a zj~?=&M!4C(5LnlH6k%aYvz@7?xRa^2gml%vn&eKl$R_lJ+e|xsNfXzr#xuh(>`}9g zLHSyiFwK^-p!;p$yt7$F|3*IfO3Mlu9e>Dpx8O`37?fA`cj`C0B-m9uRhJjs^mRp# zWB;Aj6|G^1V6`jg7#7V9UFvnB4((nIwG?k%c7h`?0tS8J3Bn0t#pb#SA}N-|45$-j z$R>%7cc2ebAClXc(&0UtHX<>pd)akR3Kx_cK+n<}FhzmTx!8e9^u2e4%x{>T6pQ`6 zO182bh$-W5A3^wos0SV_TgPmF4WUP-+D25KjbC{y_6W_9I2_vNKwU(^qSdn&>^=*t z&uvp*@c8#2*paD!ZMCi3;K{Na;I4Q35zw$YrW5U@Kk~)&rw;G?d7Q&c9|x<Hg|CNMsxovmfth*|E*GHezPTWa^Hd^F4!B3sF;)? z(NaPyAhocu1jUe(!5Cy|dh|W2=!@fNmuNOzxi^tE_jAtzNJ0JR-avc_H|ve#KO}#S z#a(8secu|^Tx553d4r@3#6^MHbH)vmiBpn0X^29xEv!Vuh1n(Sr5I0V&`jA2;WS|Y zbf0e}X|)wA-Pf5gBZ>r4YX3Mav1kKY(ulAJ0Q*jB)YhviHK)w!TJsi3^dMa$L@^{` z_De`fF4;M87vM3Ph9SzCoCi$#Fsd38u!^0#*sPful^p5oI(xGU?yeYjn;Hq1!wzFk zG&2w}W3`AX4bxoVm03y>ts{KaDf!}b&7$(P4KAMP=vK5?1In^-YYNtx1f#}+2QK@h zeSeAI@E6Z8a?)>sZ`fbq9_snl6LCu6g>o)rO;ijp3|$vig+4t} zylEo7$SEW<_U+qgVcaVhk+4k+C9THI5V10qV*dOV6pPtAI$)QN{!JRBKh-D zk2^{j@bZ}yqW?<#VVuI_27*cI-V~sJiqQv&m07+10XF+#ZnIJdr8t`9s_EE;T2V;B z4UnQUH9EdX%zwh-5&wflY#ve!IWt0UE-My3?L#^Bh%kcgP1q{&26eXLn zTkjJ*w+(|_>Pq0v8{%nX$QZbf)tbJaLY$03;MO=Ic-uqYUmUCuXD>J>o6BCRF=xa% z3R4SK9#t1!K4I_d>tZgE>&+kZ?Q}1qo4&h%U$GfY058s%*=!kac{0Z+4Hwm!)pFLR zJ+5*OpgWUrm0FPI2ib4NPJ+Sk07j(`diti^i#kh&f}i>P4~|d?RFb#!JN)~D@)beox}bw?4VCf^y*`2{4`-@%SFTry2h z>9VBc9#JxEs1+0i2^LR@B1J`B9Ac=#FW=(?2;5;#U$0E0UNag_!jY$&2diQk_n)bT zl5Me_SUvqUjwCqmVcyb`igygB_4YUB*m$h5oeKv3uIF0sk}~es!{D>4r%PC*F~FN3owq5e0|YeUTSG#Vq%&Gk7uwW z0lDo#_wvflqHeRm*}l?}o;EILszBt|EW*zNPmq#?4A+&i0xx^?9obLyY4xx=Y9&^G;xYXYPxG)DOpPg!i_Ccl#3L}6xAAZzNhPK1XaC_~ z!A|mlo?Be*8Nn=a+FhgpOj@G7yYs(Qk(8&|h@_>w8Y^r&5nCqe0V60rRz?b5%J;GYeBqSAjo|K692GxD4` zRZyM2FdI+-jK2}WAZTZ()w_)V{n5tEb@>+JYluDozCb$fA4H)$bzg(Ux{*hXurjO^ zwAxc+UXu=&JV*E59}h3kzQPG4M)X8E*}#_&}w*KEgtX)cU{vm9b$atHa;s>| z+L6&cn8xUL*OSjx4YGjf6{Eq+Q3{!ZyhrL&^6Vz@jGbI%cAM9GkmFlamTbcQGvOlL zmJ?(FI)c86=JEs|*;?h~o)88>12nXlpMR4@yh%qdwFNpct;vMlc=;{FSo*apJ;p}! zAX~t;3tb~VuP|ZW;z$=IHf->F@Ml)&-&Bnb{iQyE#;GZ@C$PzEf6~q}4D>9jic@mTO5x76ulDz@+XAcm35!VSu zT*Gs>;f0b2TNpjU_BjHZ&S6Sqk6V1370+!eppV2H+FY!q*n=GHQ!9Rn6MjY!Jc77A zG7Y!lFp8?TIHN!LXO?gCnsYM-gQxsm=Ek**VmZu7vnuufD7K~GIxfxbsQ@qv2T zPa`tvHB$fFCyZl>3oYg?_wW)C>^_iDOc^B7klnTOoytQH18WkOk)L2BSD0r%xgRSW zQS9elF^?O=_@|58zKLK;(f77l-Zzu}4{fXed2saq!5k#UZAoDBqYQS{sn@j@Vtp|$ zG%gnZ$U|9@u#w1@11Sjl8ze^Co=)7yS(}=;68a3~g;NDe_X^}yJj;~s8xq9ahQ5_r zxAlTMnep*)w1e(TG%tWsjo3RR;yVGPEO4V{Zp?=a_0R#=V^ioQu4YL=BO4r0$$XTX zZfnw#_$V}sDAIDrezGQ+h?q24St0QNug_?{s-pI(^jg`#JRxM1YBV;a@@JQvH8*>> zIJvku74E0NlXkYe_624>znU0J@L<-c=G#F3k4A_)*;ky!C(^uZfj%WB3-*{*B$?9+ zDm$WFp=0(xnt6`vDQV3Jl5f&R(Mp};;q8d3I%Kn>Kx=^;uSVCw0L=gw53%Bp==8Sw zxtx=cs!^-_+i{2OK`Q;913+AXc_&Z5$@z3<)So0CU3;JAv=H?@Zpi~riQ{z-zLtVL z!oF<}@IgJp)Iyz1zVJ42!SPHSkjYNS4%ulVVIXdRuiZ@5Mx8LJS}J#qD^Zi_xQ@>DKDr-_e#>5h3dtje*NcwH_h;i{Sx7}dkdpuW z(yUCjckQsagv*QGMSi9u1`Z|V^}Wjf7B@q%j2DQXyd0nOyqg%m{CK_lAoKlJ7#8M} z%IvR?Vh$6aDWK2W!=i?*<77q&B8O&3?zP(Cs@kapc)&p7En?J;t-TX9abGT#H?TW? ztO5(lPKRuC7fs}zwcUKbRh=7E8wzTsa#Z{a`WR}?UZ%!HohN}d&xJ=JQhpO1PI#>X zHkb>pW04pU%Bj_mf~U}1F1=wxdBZu1790>3Dm44bQ#F=T4V3&HlOLsGH)+AK$cHk6 zia$=$kog?)07HCL*PI6}DRhpM^*%I*kHM<#1Se+AQ!!xyhcy6j7`iDX7Z-2i73_n# zas*?7LkxS-XSqv;YBa zW_n*32D(HTYQ0$feV_Fru1ZxW0g&iwqixPX3=9t4o)o|kOo79V$?$uh?#8Q8e>4e)V6;_(x&ViUVxma+i25qea;d-oK7ouuDsB^ab{ zu1qjQ%`n56VtxBE#0qAzb7lph`Eb-}TYpXB!H-}3Ykqyp`otprp7{VEuW*^IR2n$Fb99*nAtqT&oOFIf z@w*6>YvOGw@Ja?Pp1=whZqydzx@9X4n^2!n83C5{C?G@|E?&$?p*g68)kNvUTJ)I6 z1Q|(#UuP6pj78GUxq11m-GSszc+)X{C2eo-?8ud9sB=3(D47v?`JAa{V(IF zPZQ_0AY*9M97>Jf<o%#O_%Wq}8>YM=q0|tGY+hlXcpE=Z4Od z`NT7Hu2hnvRoqOw@g1f=bv`+nba{GwA$Ak0INlqI1k<9!x_!sL()h?hEWoWrdU3w` zZ%%)VR+Bc@_v!C#koM1p-3v_^L6)_Ktj4HE>aUh%2XZE@JFMOn)J~c`_7VWNb9c-N z2b|SZMR4Z@E7j&q&9(6H3yjEu6HV7{2!1t0lgizD;mZ9$r(r7W5G$ky@w(T_dFnOD z*p#+z$@pKE+>o@%eT(2-p_C}wbQ5s(%Sn_{$HDN@MB+Ev?t@3dPy`%TZ!z}AThZSu zN<1i$siJhXFdjV zP*y|V<`V8t=h#XTRUR~5`c`Z9^-`*BZf?WAehGdg)E2Je)hqFa!k{V(u+(hTf^Yq& zoruUh2(^3pe)2{bvt4&4Y9CY3js)PUHtd4rVG57}uFJL)D(JfSIo^{P=7liFXG zq5yqgof0V8paQcP!gy+;^pp-DA5pj=gbMN0eW=-eY+N8~y+G>t+x}oa!5r>tW$xhI zPQSv=pi;~653Gvf6~*JcQ%t1xOrH2l3Zy@8AoJ+wz@daW@m7?%LXkr!bw9GY@ns3e zSfuWF_gkWnesv?s3I`@}NgE2xwgs&rj?kH-FEy82=O8`+szN ziHch`vvS`zNfap14!&#i9H@wF7}yIPm=UB%(o(}F{wsZ(wA0nJ2aD^@B41>>o-_U6 zUqD~vdo48S8~FTb^+%#zcbQiiYoDKYcj&$#^;Smmb+Ljp(L=1Kt_J!;0s%1|JK}Wi z;={~oL!foo5n8=}rs6MmUW~R&;SIJO3TL4Ky?kh+b2rT9B1Jl4>#Uh-Bec z`Hsp<==#UEW6pGPhNk8H!!DUQR~#F9jEMI6T*OWfN^Ze&X(4nV$wa8QUJ>oTkruH# zm~O<`J7Wxseo@FqaZMl#Y(mrFW9AHM9Kb|XBMqaZ2a)DvJgYipkDD_VUF_PKd~dT7 z#02}bBfPn9a!X!O#83=lbJSK#E}K&yx-HI#T6ua)6o0{|={*HFusCkHzs|Fn&|C3H zBck1cmfcWVUN&i>X$YU^Sn6k2H;r3zuXbJFz)r5~3$d$tUj(l1?o={MM){kjgqXRO zc5R*#{;V7AQh|G|)jLM@wGAK&rm2~@{Pewv#06pHbKn#wL0P6F1!^qw9g&cW3Z=9} zj)POhOlwsh@eF=>z?#sIs*C-Nl(yU!#DaiaxhEs#iJqQ8w%(?+6lU02MYSeDkr!B- zPjMv+on6OLXgGnAtl(ao>|X2Y8*Hb}GRW5}-IzXnoo-d0!m4Vy$GS!XOLy>3_+UGs z2D|YcQx@M#M|}TDOetGi{9lGo9m-=0-^+nKE^*?$^uHkxZh}I{#UTQd;X!L+W@jm( zDg@N4+lUqI92o_rNk{3P>1gxAL=&O;x)ZT=q1mk0kLlE$WeWuY_$0`0jY-Kkt zP*|m3AF}Ubd=`<>(Xg0har*_@x2YH}bn0Wk*OZz3*e5;Zc;2uBdnl8?&XjupbkOeNZsNh6pvsq_ydmJI+*z**{I{0K)-;p1~k8cpJXL$^t!-`E}=*4G^-E8>H!LjTPxSx zcF+cS`ommfKMhNSbas^@YbTpH1*RFrBuATUR zt{oFWSk^$xU&kbFQ;MCX22RAN5F6eq9UfR$ut`Jw--p2YX)A*J69m^!oYfj2y7NYcH6&r+0~_sH^c^nzeN1AU4Ga7=FlR{S|Mm~MpzY0$Z+p2W(a={b-pR9EO1Rs zB%KY|@wLcAA@)KXi!d2_BxrkhDn`DT1=Dec}V!okd{$+wK z4E{n8R*xKyci1(CnNdhf$Dp2(Jpof0-0%-38X=Dd9PQgT+w%Lshx9+loPS~MOm%ZT zt%2B2iL_KU_ita%N>xjB!#71_3=3c}o zgeW~^U_ZTJQ2!PqXulQd=3b=XOQhwATK$y(9$#1jOQ4}4?~l#&nek)H(04f(Sr=s| zWv7Lu1=%WGk4FSw^;;!8&YPM)pQDCY9DhU`hMty1@sq1=Tj7bFsOOBZOFlpR`W>-J$-(kezWJj;`?x-v>ev{*8V z8p|KXJPV$HyQr1A(9LVrM47u-XpcrIyO`yWvx1pVYc&?154aneRpLqgx)EMvRaa#|9?Wwqs2+W8n5~79G z(}iCiLk;?enn}ew`HzhG+tu+Ru@T+K5juvZN)wY;x6HjvqD!&!)$$;1VAh~7fg0K| zEha#aN=Yv|3^~YFH}cc38ovVb%L|g@9W6fo(JtT6$fa?zf@Ct88e}m?i)b*Jgc{fl zExfdvw-BYDmH6>(4QMt#p0;FUIQqkhD}aH?a7)_%JtA~soqj{ppP_82yi9kaxuK>~ ze_)Zt>1?q=ZH*kF{1iq9sr*tVuy=u>Zev}!gEZx@O6-fjyu9X00gpIl-fS_pzjpqJ z1yqBmf9NF!jaF<+YxgH6oXBdK)sH(>VZ)1siyA$P<#KDt;8NT*l_0{xit~5j1P)FN zI8hhYKhQ)i z37^aP13B~u65?sg+_@2Kr^iWHN=U;EDSZ@2W2!5ALhGNWXnFBY%7W?1 z=HI9JzQ-pLKZDYTv<0-lt|6c-RwhxZ)mU2Os{bsX_i^@*fKUj8*aDO5pks=qn3Dv6 zwggpKLuyRCTVPwmw1r}B#AS}?X7b837UlXwp~E2|PJw2SGVueL7){Y&z!jL!XN=0i zU^Eig`S2`{+gU$68aRdWx?BZ{sU_f=8sn~>s~M?GU~`fH5kCc; z8ICp+INM3(3{#k32RZdv6b9MQYdZXNuk7ed8;G?S2nT+NZBG=Tar^KFl2SvhW$bGW#kdWL-I)s_IqVnCDDM9fm8g;P;8 z7t4yZn3^*NQfx7SwmkzP$=fwdC}bafQSEF@pd&P8@H#`swGy_rz;Z?Ty5mkS%>m#% zp_!m9e<()sfKiY(nF<1zBz&&`ZlJf6QLvLhl`_``%RW&{+O>Xhp;lwSsyRqGf=RWd zpftiR`={2(siiPAS|p}@q=NhVc0ELprt%=fMXO3B)4ryC2LT(o=sLM7hJC!}T1@)E zA3^J$3&1*M6Xq>03FX`R&w*NkrZE?FwU+Muut;>qNhj@bX17ZJxnOlPSZ=Zeiz~T_ zOu#yc3t6ONHB;?|r4w+pI)~KGN;HOGC)txxiUN8#mexj+W(cz%9a4sx|IRG=}ia zuEBuba3AHsV2feqw-3MvuL`I+2|`Ud4~7ZkN=JZ;L20|Oxna5vx1qbIh#k2O4$RQF zo`tL()zxaqibg^GbB+BS5#U{@K;WWQj~GcB1zb}zJkPwH|5hZ9iH2308!>_;%msji zJHSL~s)YHBR=Koa1mLEOHos*`gp=s8KA-C zu0aE+W!#iJ*0xqKm3A`fUGy#O+X+5W36myS>Uh2!R*s$aCU^`K&KKLCCDkejX2p=5 z%o7-fl03x`gaSNyr?3_JLv?2RLS3F*8ub>Jd@^Cc17)v8vYEK4aqo?OS@W9mt%ITJ z9=S2%R8M){CugT@k~~0x`}Vl!svYqX=E)c_oU6o}#Hb^%G1l3BudxA{F*tbjG;W_>=xV73pKY53v%>I)@D36I_@&p$h|Aw zonQS`07z_F#@T-%@-Tb|)7;;anoD_WH>9ewFy(ZcEOM$#Y)8>qi7rCnsH9GO-_7zF zu*C87{Df1P4TEOsnzZ@H%&lvV(3V@;Q!%+OYRp`g05PjY^gL$^$-t0Y>H*CDDs?FZly*oZ&dxvsxaUWF!{em4{A>n@vpXg$dwvt@_rgmHF z-MER`ABa8R-t_H*kv>}CzOpz;!>p^^9ztHMsHL|SRnS<-y5Z*r(_}c4=fXF`l^-i}>e7v!qs_jv zqvWhX^F=2sDNWA9c@P0?lUlr6ecrTKM%pNQ^?*Lq?p-0~?_j50xV%^(+H>sMul#Tw zeciF*1=?a7cI(}352%>LO96pD+?9!fNyl^9v3^v&Y4L)mNGK0FN43&Xf8jUlxW1Bw zyiu2;qW-aGNhs=zbuoxnxiwZ3{PFZM#Kw)9H@(hgX23h(`Wm~m4&TvoZoYp{plb^> z_#?vXcxd>r7K+1HKJvhed>gtK`TAbJUazUWQY6T~t2af%#<+Veyr%7-#*A#@&*;@g58{i|E%6yC_InGXCOd{L0;$)z#?n7M`re zh!kO{6=>7I?*}czyF7_frt#)s1CFJ_XE&VrDA?Dp3XbvF{qsEJgb&OLSNz_5g?HpK z9)8rsr4JN!Af3G9!#Qn(6zaUDqLN(g2g8*M)Djap?WMK9NKlkC)E2|-g|#-rp%!Gz zAHd%`iq|81efi93m3yTBw3g0j#;Yb2X{mhRAI?&KDmbGqou(2xiRNb^sV}%%Wu0?< z?($L>(#BO*)^)rSgyNRni$i`R4v;GhlCZ8$@e^ROX(p=2_v6Y!%^As zu022)fHdv_-~Yu_H6WVPLpHQx!W%^6j)cBhS`O3QBW#x(eX54d&I22op(N59b*&$v zFiSRY6rOc^(dgSV1>a7-5C;(5S5MvKcM2Jm-LD9TGqDpP097%52V+0>Xqq!! zq4e3vj53SE6i8J`XcQB|MZPP8j;PAOnpGnllH6#Ku~vS42xP*Nz@~y%db7Xi8s09P z1)e%8ys6&M8D=Dt6&t`iKG_4X=!kgRQoh%Z`dc&mlOUqXk-k`jKv9@(a^2-Upw>?< zt5*^DV~6Zedbec4NVl($2T{&b)zA@b#dUyd>`2JC0=xa_fIm8{5um zr-!ApXZhC8@=vC2WyxO|!@0Km)h8ep*`^he92$@YwP>VcdoS5OC^s38e#7RPsg4j+ zbVGG}WRSET&ZfrcR(x~k8n1rTP%CnfUNKUonD$P?FtNFF#cn!wEIab-;jU=B1dHK@ z(;(yAQJ`O$sMn>h;pf^8{JISW%d+@v6@CnXh9n5TXGC}?FI9i-D0OMaIg&mAg=0Kn zNJ7oz5*ReJukD55fUsMuaP+H4tDN&V9zfqF@ zr=#ecUk9wu{0;!+gl;3Bw=Vn^)z$ahVhhw)io!na&9}LmWurLb0zubxK=UEnU*{5P z+SP}&*(iBKSO4{alBHaY^)5Q=mZ+2OwIooJ7*Q5XJ+2|q`9#f?6myq!&oz?klihLq z4C)$XP!BNS0G_Z1&TM>?Jk{S~{F3n83ioli=IO6f%wkvCl(RFFw~j0tb{GvXTx>*sB0McY0s&SNvj4+^h`9nJ_wM>F!Uc>X}9PifQekn0sKI2SAJP!a4h z5cyGTuCj3ZBM^&{dRelIlT^9zcfaAuL5Y~bl!ppSf`wZbK$z#6U~rdclk``e+!qhe z6Qspo*%<)eu6?C;Bp<^VuW6JI|Ncvyn+LlSl;Mp22Bl7ARQ0Xc24%29(ZrdsIPw&-=yHQ7_Vle|5h>AST0 zUGX2Zk34vp?U~IHT|;$U86T+UUHl_NE4m|}>E~6q``7hccCaT^#y+?wD##Q%HwPd8 zV3x4L4|qqu`B$4(LXqDJngNy-{&@aFBvVsywt@X^}iH7P%>bR?ciC$I^U-4Foa`YKI^qDyGK7k%E%c_P=yzAi`YnxGA%DeNd++j3*h^ z=rn>oBd0|~lZ<6YvmkKY*ZJlJ;Im0tqgWu&E92eqt;+NYdxx`eS(4Hw_Jb5|yVvBg z*tbdY^!AN;luEyN4VRhS@-_DC{({ziH{&Z}iGElSV~qvT>L-8G%+yEL zX#MFOhj{InyKG=mvW-<1B@c-}x$vA(nU?>S>0*eN#!SLzQ)Ex7fvQ)S4D<8|I#N$3 zT5Ei`Z?cxBODHX8(Xp73v`IsAYC@9b;t}z0wxVuQSY1J^GRwDPN@qbM-ZF48T$GZ< z8WU+;Pqo?{ghI-KZ-i*ydXu`Ep0Xw^McH_KE9J0S7G;x8Fe`DVG?j3Pv=0YzJ}yZR z%2=oqHiUjvuk0~Ca>Kol4CFi0_xQT~;_F?=u+!kIDl-9g`#ZNZ9HCy17Ga1v^Jv9# z{T4Kb1-AzUxq*MutfOWWZgD*HnFfyYg0&e9f(5tZ>krPF6{VikNeHoc{linPPt#Si z&*g>(c54V8rT_AX!J&bNm-!umPvOR}vDai#`CX___J#=zeB*{4<&2WpaDncZsOkp* zsg<%@@rbrMkR_ux9?LsQxzoBa1s%$BBn6vk#{&&zUwcfzeCBJUwFYSF$08qDsB;gWQN*g!p8pxjofWbqNSZOEKOaTx@+* zwdt5*Q47@EOZ~EZL9s?1o?A%9TJT=Ob_13yyugvPg*e&ZU(r6^k4=2+D-@n=Hv5vu zSXG|hM(>h9^zn=eQ=$6`JO&70&2|%V5Lsx>)(%#;pcOfu>*nk_3HB_BNaH$`jM<^S zcSftDU1?nL;jy)+sfonQN}(}gUW?d_ikr*3=^{G)=tjBtEPe>TO|0ddVB zTklrSHiW+!#26frPXQQ(YN8DG$PZo?(po(QUCCf_OJC`pw*uey00%gmH!`WJkrKXj2!#6?`T25mTu9OJp2L8z3! z=arrL$ZqxuE{%yV)14Kd>k}j7pxZ6#$Dz8$@WV5p8kTqN<-7W)Q7Gt2{KoOPK_tZ| zf2WG~O5@{qPI+W<4f_;reuFVdO^5`ADC1!JQE|N`s3cq@(0WB!n0uh@*c{=LAd;~} zyGK@hbF-Oo+!nN)@i*O(`@FA#u?o=~e{`4O#5}z&=UkU*50fOrzi11D^&FOqe>wii z?*k+2|EcUs;Gx{!@KBT~>PAwLrIDT7Th=Utu?~?np@t^gFs?zgX=D${RwOY^WGh-+ z+#4$066ISh8eYW#FXWp~S`<*%O^ZuItL1Tyqt8#tZ zY120E;^VG`!lZn&3sPd$RkdHpU#|w+bYV)pJC|SH9g%|5IkxVTQcBA4CL0}$&}ef@ zW^Vtj%M;;_1xxP9x#ex17&4N*{ksO*_4O}xYu(p*JkL#yr}@7b)t5X?%CY<+s5_MJ zuiqt+N_;A(_)%lumoyRFixWa-M7qK_9s6<1X?JDa9fP!+_6u~~M$5L=ipB=7(j#f< zZ34J%=bs549%~_mA(|={uZNs_0?o7;-LBP(ZRnkd{-^|2|=4vUTmtByHL8 zEph`(LSEzQj68a+`d$V<45J7cyv^#|^|%fD#si1Nx!4NW*`l*{->HEWNh6-|g>-=r zXmQ|-i}Ku$ndUeHQ^&ieT!Lf}vf6GaqW9$DJ2NWrqwPY%%4nip$@vK$nRp*_C-v<| zuKz~ZyN&<%!NS26&x?jhy+@awJipMQ-8(X4#Ae5??U<1QMt1l9R=w9fAnEF}NYu$2 z>6}Vkc zIb*A?G*z8^IvibmBKn_u^5&T_1oey0gZS2~obf(#xk=erZGTEdQnt3DMGM+0oPwss zj5zXD;(oWhB_T@~Ig#9@v)AKtXu3>Inmgf@A|-lD-1U>cNyl3h?ADD9)GG4}zUGPk zZzaXe!~Kf?<~@$G?Uql3t8jy9{2!doq4=J}j9ktTxss{p6!9UdjyDERlA*xZ!=Q)KDs5O)phz>Vq3BNGoM(H|=1*Q4$^2fTZw z(%nq1P|5Rt81}SYJpEEzMPl5VJsV5&4e)ZWKDyoZ>1EwpkHx-AQVQc8%JMz;{H~p{=FXV>jIxvm4X*qv52e?Y-f%DJ zxEA165GikEASQ^fH6K#d!Tpu2HP{sFs%E=e$gYd$aj$+xue6N+Wc(rAz~wUsk2`(b z8Kvmyz%bKQxpP}~baG-rwYcYCvkHOi zlkR<=>ZBTU*8RF_d#Bl@zZsRIhx<%~Z@Z=ik z>adw3!DK(8R|q$vy{FTxw%#xliD~6qXmY^7_9kthVPTF~Xy1CfBqbU~?1QmxmU=+k z(ggxvEuA;0e&+ci-zQR{-f7aO{O(Pz_OsEjLh_K>MbvoZ4nxtk5u{g@nPv)cgW_R} z9}EA4K4@z0?7ue}Z(o~R(X&FjejUI2g~08PH1E4w>9o{)S(?1>Z0XMvTb|;&EuyOE zGvWNpYX)Nv<8|a^;1>bh#&znEcl-r!T#pn= z4$?Yudha6F%4b>*8@=BdtXXY4N+`U4Dmx$}>HeVJk-QdTG@t!tVT#0(LeV0gvqyyw z2sEp^9eY0N`u10Tm4n8No&A=)IeEC|gnmEXoNSzu!1<4R<%-9kY_8~5Ej?zRegMn78wuMs#;i&eUA0Zk_RXQ3b&TT} z;SCI=7-FUB@*&;8|n>(_g^HGf3@QODE3LpmX~ELnymQm{Sx9xrKS zK29p~?v@R$0=v6Dr5aW>-!{+h@?Q58|Kz8{{W`%J+lDAdb&M5VHrX_mDY;1-JLnf)ezmPau$)1;=`-FU=-r-83tX=C`S#}GZufju zQ>sXNT0Ny=k@nc%cFnvA_i4SC)?_ORXHq8B4D%el1uPX`c~uG#S1M7C+*MMqLw78E zhY2dI8@+N^qrMI1+;TUda(vGqGSRyU{Fnm`aqrr7bz42c5xsOO-~oZpkzorD1g}Y<6rk&3>PsSGy}W?MtqFky@A(X# zIuNZK0cK?^=;PUAu>j0#HtjbHCV*6?jzA&OoE$*Jlga*}LF`SF?WLhv1O|zqC<>*> zYB;#lsYKx0&kH@BFpW8n*yDcc6?;_zaJs<-jPSkCsSX-!aV=P5kUgF@Nu<{a%#K*F z134Q{9|YX7X(v$62_cY3^G%t~rD>Q0z@)1|zs)vjJ6Jq9;7#Ki`w+eS**En?7;n&7 zu==V3T&eFboN3ZiMx3D8qYc;VjFUk_H-WWCau(VFXSQf~viH0L$gwD$UfFHqNcgN`x}M+YQ6RnN<+@t>JUp#)9YOkqst-Ga?{FsDpEeX0(5v{0J~SEbWiL zXC2}M4?UH@u&|;%0y`eb33ldo4~z-x8zY!oVmV=c+f$m?RfDC35mdQ2E>Pze7KWP- z>!Bh<&57I+O_^s}9Tg^k)h7{xx@0a0IA~GAOt2yy!X%Q$1rt~LbTB6@Du!_0%HV>N zlf)QI1&gvERKwso23mJ!Ou6ZS#zCS5W`gxE5T>C#E|{i<1D35C222I33?Njaz`On7 zi<+VWFP6D{e-{yiN#M|Jgk<44u1TiMI78S5W`Sdb5f+{zu34s{CfWN7a3Cf^@L%!& zN$?|!!9j2c)j$~+R6n#891w-z8(!oBpL2K=+%a$r2|~8-(vQj5_XT`<0Ksf;oP+tz z9CObS!0m)Tgg`K#xBM8B(|Z)Wb&DYL{WTYv`;A=q6~Nnx2+!lTIXtj8J7dZE!P_{z z#f8w6F}^!?^KE#+ZDv+xd5O&3EmomZzsv?>E-~ygGum45fk!SBN&|eo1rKw^?aZJ4 E2O(~oYXATM literal 0 HcmV?d00001 From 3afdc108cad6c2c1d65ed50232edf1b2abb31f76 Mon Sep 17 00:00:00 2001 From: Thore Date: Sun, 17 Jan 2021 04:10:21 +0100 Subject: [PATCH 031/134] Revert to java 8 until java 14 runtime issue is resolved --- .github/workflows/gradle.yml | 4 +- gradle.properties | 2 +- requirement_bazaar/build.gradle | 6 +- requirement_bazaar/log/las2peer.log.0 | 197 ++++++ requirement_bazaar/log/service.log.0 | 0 .../resources}/i18n/Translation_de.properties | 0 .../resources}/i18n/Translation_en.properties | 0 .../bazaar/service/BazaarRequestParams.java | 53 -- .../dbis/acis/bazaar/service/TestBase.java | 27 - .../bazaar/service/dal/DALFacadeMockImpl.java | 574 ----------------- .../bazaar/service/dal/DALFacadeTest.java | 607 ------------------ .../bazaar/service/dal/RepositoryTest.java | 184 ------ .../dbis/acis/bazaar/service/dal/reqbaz.db | Bin 18432 -> 0 bytes .../security/AnonymUserRightsTest.java | 275 -------- .../service/security/SpecialRightsTest.java | 29 - .../service/security/SysAdminRightsTest.java | 306 --------- .../bazaar/service/update/UpdateTest.java | 100 --- .../dbis/acis/bazaar/service/BazaarTest.java | 32 + .../dbis/acis/bazaar/service/TestBase.java | 88 +++ 19 files changed, 323 insertions(+), 2161 deletions(-) create mode 100644 requirement_bazaar/log/las2peer.log.0 create mode 100644 requirement_bazaar/log/service.log.0 rename requirement_bazaar/src/{ => main/resources}/i18n/Translation_de.properties (100%) rename requirement_bazaar/src/{ => main/resources}/i18n/Translation_en.properties (100%) delete mode 100644 requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/BazaarRequestParams.java delete mode 100644 requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/TestBase.java delete mode 100644 requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeMockImpl.java delete mode 100644 requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java delete mode 100644 requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/dal/RepositoryTest.java delete mode 100644 requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/dal/reqbaz.db delete mode 100644 requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/security/AnonymUserRightsTest.java delete mode 100644 requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/security/SpecialRightsTest.java delete mode 100644 requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/security/SysAdminRightsTest.java delete mode 100644 requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/update/UpdateTest.java create mode 100644 requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java create mode 100644 requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 4378c05d..1ee9780a 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -19,10 +19,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 14 + - name: Set up JDK uses: actions/setup-java@v1 with: - java-version: 14 + java-version: 1.8 - name: Verify MySQL connection env: PORT: ${{ job.services.mysql.ports[3306] }} diff --git a/gradle.properties b/gradle.properties index 4d89dd88..6b8b21b5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ org.gradle.parallel=true -core.version=1.1.0 +core.version=1.0.1 service.name=RequirementsBazaar service.version=0.9.0 diff --git a/requirement_bazaar/build.gradle b/requirement_bazaar/build.gradle index 5d061a05..433212ad 100644 --- a/requirement_bazaar/build.gradle +++ b/requirement_bazaar/build.gradle @@ -24,9 +24,9 @@ plugins { group = 'de.rwth.dbis.acis.bazaar.service' archivesBaseName = group -version = "0.8.1" +version = "${project.property('service.name')}" mainClassName = "de.rwth.dbis.acis.bazaar.service.BazaarService" -sourceCompatibility = 14 +sourceCompatibility = 1.8 repositories { // Use JCenter for resolving dependencies. @@ -60,7 +60,7 @@ dependencies { implementation "org.jooq:jooq-meta:${project.property('jooq.version')}" implementation 'org.apache.httpcomponents:httpclient:4.5.13' implementation 'commons-io:commons-io:2.8.0' - implementation 'org.jodd:jodd-vtor:3.6.1' + implementation 'org.jodd:jodd-vtor:5.3.0' implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.8.9' implementation 'com.vdurmont:emoji-java:5.1.1' } diff --git a/requirement_bazaar/log/las2peer.log.0 b/requirement_bazaar/log/las2peer.log.0 new file mode 100644 index 00000000..c411e8e8 --- /dev/null +++ b/requirement_bazaar/log/las2peer.log.0 @@ -0,0 +1,197 @@ +2021 Jan 17 03:52:08 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 17 03:52:08 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 17 03:52:09 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -2865038555733856225 (java.lang.Long) 286b15cf69815e8a4e0ae37845e662c2de9a7fd3f074d03080eabaaec253f369c02739009d7e0c63096660709746feb22cf8f63c3810b5f878d728690a248463 - - ServiceAgent +2021 Jan 17 03:52:09 FINER i5.las2peer.p2p.LocalNode: AGENT_LOAD_FAILED (-3000) i5.las2peer.p2p.LocalNode@5f781ec1 (i5.las2peer.p2p.LocalNode) 286b15cf69815e8a4e0ae37845e662c2de9a7fd3f074d03080eabaaec253f369c02739009d7e0c63096660709746feb22cf8f63c3810b5f878d728690a248463 - - i5.las2peer.api.security.AgentException: Exception in service constructor +2021 Jan 17 03:52:09 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -2865038555733856225 (java.lang.Long) - - - - +2021 Jan 17 03:55:29 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 17 03:55:29 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 17 03:55:29 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 8154462497441101399 (java.lang.Long) 0c895f915b064fe0caa23e0339668d4fc2b6cb7d2bdad916957590f1d6269559d24fa3342a852548ef1e5eba98038fbf4f14a9ac70e3246416227405fda2d53b - - ServiceAgent +2021 Jan 17 03:55:30 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 8154462497441101399 (java.lang.Long) 0c895f915b064fe0caa23e0339668d4fc2b6cb7d2bdad916957590f1d6269559d24fa3342a852548ef1e5eba98038fbf4f14a9ac70e3246416227405fda2d53b - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 17 03:55:30 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 8154462497441101399 (java.lang.Long) 0c895f915b064fe0caa23e0339668d4fc2b6cb7d2bdad916957590f1d6269559d24fa3342a852548ef1e5eba98038fbf4f14a9ac70e3246416227405fda2d53b - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 17 03:55:31 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:38423 +2021 Jan 17 03:55:31 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 8154462497441101399 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:38423 +2021 Jan 17 03:55:31 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 17 03:55:31 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 17 03:55:31 SEVERE i5.las2peer.connectors.webConnector.WebConnector: not found: Could not resolve /activities/version to a service name. +javax.ws.rs.NotFoundException: Could not resolve /activities/version to a service name. + at i5.las2peer.connectors.webConnector.WebConnectorRequestHandler.resolveServiceAndInvoke(WebConnectorRequestHandler.java:194) + at i5.las2peer.connectors.webConnector.WebConnectorRequestHandler.handle(WebConnectorRequestHandler.java:154) + at i5.las2peer.connectors.webConnector.WebConnectorRequestHandler.handleGET(WebConnectorRequestHandler.java:119) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:498) + at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) + at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) + at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) + at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160) + at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) + at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) + at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) + at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) + at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) + at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) + at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) + at org.glassfish.jersey.internal.Errors.process(Errors.java:315) + at org.glassfish.jersey.internal.Errors.process(Errors.java:297) + at org.glassfish.jersey.internal.Errors.process(Errors.java:267) + at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) + at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) + at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) + at org.glassfish.jersey.jdkhttp.JdkHttpHandlerContainer.handle(JdkHttpHandlerContainer.java:161) + at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79) + at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83) + at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:82) + at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:675) + at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79) + at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:647) + at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) + at java.lang.Thread.run(Thread.java:748) +2021 Jan 17 03:55:31 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_ERROR (-9100) 8154462497441101399 (java.lang.Long) - - - WebConnector: not found: Could not resolve /activities/version to a service name. +2021 Jan 17 03:55:31 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 17 03:55:31 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 8154462497441101399 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 17 03:55:31 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 8154462497441101399 (java.lang.Long) 0c895f915b064fe0caa23e0339668d4fc2b6cb7d2bdad916957590f1d6269559d24fa3342a852548ef1e5eba98038fbf4f14a9ac70e3246416227405fda2d53b - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 17 03:55:31 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 8154462497441101399 (java.lang.Long) - - - - +2021 Jan 17 03:55:39 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 17 03:55:39 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 17 03:55:40 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -5138140134614255441 (java.lang.Long) e094adeeb708e37c4c3a7c37a8a8f5f8c43389d153efbb9b316e45c5aa9fe43f88f8fd016701209b9c975d520472244bf5b19da2bb78119b9206f15d643a7ada - - ServiceAgent +2021 Jan 17 03:55:40 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -5138140134614255441 (java.lang.Long) e094adeeb708e37c4c3a7c37a8a8f5f8c43389d153efbb9b316e45c5aa9fe43f88f8fd016701209b9c975d520472244bf5b19da2bb78119b9206f15d643a7ada - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 17 03:55:40 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -5138140134614255441 (java.lang.Long) e094adeeb708e37c4c3a7c37a8a8f5f8c43389d153efbb9b316e45c5aa9fe43f88f8fd016701209b9c975d520472244bf5b19da2bb78119b9206f15d643a7ada - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 17 03:55:41 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:40887 +2021 Jan 17 03:55:41 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -5138140134614255441 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:40887 +2021 Jan 17 03:55:41 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 17 03:55:41 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 17 03:55:41 SEVERE i5.las2peer.connectors.webConnector.WebConnector: not found: Could not resolve /activities/version to a service name. +javax.ws.rs.NotFoundException: Could not resolve /activities/version to a service name. + at i5.las2peer.connectors.webConnector.WebConnectorRequestHandler.resolveServiceAndInvoke(WebConnectorRequestHandler.java:194) + at i5.las2peer.connectors.webConnector.WebConnectorRequestHandler.handle(WebConnectorRequestHandler.java:154) + at i5.las2peer.connectors.webConnector.WebConnectorRequestHandler.handleGET(WebConnectorRequestHandler.java:119) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:498) + at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) + at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) + at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) + at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160) + at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) + at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) + at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) + at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) + at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) + at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) + at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) + at org.glassfish.jersey.internal.Errors.process(Errors.java:315) + at org.glassfish.jersey.internal.Errors.process(Errors.java:297) + at org.glassfish.jersey.internal.Errors.process(Errors.java:267) + at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) + at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) + at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) + at org.glassfish.jersey.jdkhttp.JdkHttpHandlerContainer.handle(JdkHttpHandlerContainer.java:161) + at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79) + at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83) + at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:82) + at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:675) + at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79) + at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:647) + at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) + at java.lang.Thread.run(Thread.java:748) +2021 Jan 17 03:55:41 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_ERROR (-9100) -5138140134614255441 (java.lang.Long) - - - WebConnector: not found: Could not resolve /activities/version to a service name. +2021 Jan 17 03:55:41 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 17 03:55:41 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -5138140134614255441 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 17 03:55:41 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -5138140134614255441 (java.lang.Long) e094adeeb708e37c4c3a7c37a8a8f5f8c43389d153efbb9b316e45c5aa9fe43f88f8fd016701209b9c975d520472244bf5b19da2bb78119b9206f15d643a7ada - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 17 03:55:41 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -5138140134614255441 (java.lang.Long) - - - - +2021 Jan 17 03:57:56 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 17 03:57:56 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 17 03:57:56 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 5419993283417427128 (java.lang.Long) 9623a0d68303cde3b46c29fe3475f2fc9b61902579fbdc7932a1c4a4d01965fb78df37ff7df8c1c987f74d0daf6defba91d5472106e0f5c0cfff5df3bb811601 - - ServiceAgent +2021 Jan 17 03:57:57 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 5419993283417427128 (java.lang.Long) 9623a0d68303cde3b46c29fe3475f2fc9b61902579fbdc7932a1c4a4d01965fb78df37ff7df8c1c987f74d0daf6defba91d5472106e0f5c0cfff5df3bb811601 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 17 03:57:57 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 5419993283417427128 (java.lang.Long) 9623a0d68303cde3b46c29fe3475f2fc9b61902579fbdc7932a1c4a4d01965fb78df37ff7df8c1c987f74d0daf6defba91d5472106e0f5c0cfff5df3bb811601 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 17 03:57:58 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:35339 +2021 Jan 17 03:57:58 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 5419993283417427128 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:35339 +2021 Jan 17 03:57:58 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 17 03:57:58 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 17 03:57:58 SEVERE i5.las2peer.connectors.webConnector.WebConnector: not found: Could not resolve /activities/version to a service name. +javax.ws.rs.NotFoundException: Could not resolve /activities/version to a service name. + at i5.las2peer.connectors.webConnector.WebConnectorRequestHandler.resolveServiceAndInvoke(WebConnectorRequestHandler.java:194) + at i5.las2peer.connectors.webConnector.WebConnectorRequestHandler.handle(WebConnectorRequestHandler.java:154) + at i5.las2peer.connectors.webConnector.WebConnectorRequestHandler.handleGET(WebConnectorRequestHandler.java:119) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:498) + at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) + at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) + at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) + at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160) + at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) + at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) + at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) + at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) + at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) + at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) + at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) + at org.glassfish.jersey.internal.Errors.process(Errors.java:315) + at org.glassfish.jersey.internal.Errors.process(Errors.java:297) + at org.glassfish.jersey.internal.Errors.process(Errors.java:267) + at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) + at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) + at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) + at org.glassfish.jersey.jdkhttp.JdkHttpHandlerContainer.handle(JdkHttpHandlerContainer.java:161) + at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79) + at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83) + at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:82) + at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:675) + at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79) + at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:647) + at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) + at java.lang.Thread.run(Thread.java:748) +2021 Jan 17 03:57:58 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_ERROR (-9100) 5419993283417427128 (java.lang.Long) - - - WebConnector: not found: Could not resolve /activities/version to a service name. +2021 Jan 17 03:57:58 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 17 03:57:58 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 5419993283417427128 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 17 03:57:58 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 5419993283417427128 (java.lang.Long) 9623a0d68303cde3b46c29fe3475f2fc9b61902579fbdc7932a1c4a4d01965fb78df37ff7df8c1c987f74d0daf6defba91d5472106e0f5c0cfff5df3bb811601 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 17 03:57:58 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 5419993283417427128 (java.lang.Long) - - - - +2021 Jan 17 03:58:33 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 17 03:58:33 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 17 03:58:34 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -4273426718411292372 (java.lang.Long) 453ffa2339538b75533164f1c6f46ae4d3c1a967a0251681604335dd462c983ac43e4faf075c1fa0dbe10d41286968d3792512c2dea59d9911752c2f99675bb6 - - ServiceAgent +2021 Jan 17 03:58:35 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -4273426718411292372 (java.lang.Long) 453ffa2339538b75533164f1c6f46ae4d3c1a967a0251681604335dd462c983ac43e4faf075c1fa0dbe10d41286968d3792512c2dea59d9911752c2f99675bb6 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 17 03:58:35 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -4273426718411292372 (java.lang.Long) 453ffa2339538b75533164f1c6f46ae4d3c1a967a0251681604335dd462c983ac43e4faf075c1fa0dbe10d41286968d3792512c2dea59d9911752c2f99675bb6 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 17 03:58:35 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:34005 +2021 Jan 17 03:58:35 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -4273426718411292372 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:34005 +2021 Jan 17 03:58:35 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 17 03:58:35 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 17 03:58:35 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 17 03:58:35 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 17 03:58:35 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -4273426718411292372 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 17 03:58:35 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -4273426718411292372 (java.lang.Long) 453ffa2339538b75533164f1c6f46ae4d3c1a967a0251681604335dd462c983ac43e4faf075c1fa0dbe10d41286968d3792512c2dea59d9911752c2f99675bb6 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 17 03:58:35 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -4273426718411292372 (java.lang.Long) - - - - +2021 Jan 17 04:02:08 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 17 04:02:08 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 17 04:02:08 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -1807525047774611694 (java.lang.Long) 785feedd3f21d35dcdf8709bd226e58442eaff46a4765b98213440007b9d06d4602dd398de673226dce31660fffa779bc50866e27ec89ba9e51203452db75368 - - ServiceAgent +2021 Jan 17 04:02:09 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -1807525047774611694 (java.lang.Long) 785feedd3f21d35dcdf8709bd226e58442eaff46a4765b98213440007b9d06d4602dd398de673226dce31660fffa779bc50866e27ec89ba9e51203452db75368 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 17 04:02:09 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -1807525047774611694 (java.lang.Long) 785feedd3f21d35dcdf8709bd226e58442eaff46a4765b98213440007b9d06d4602dd398de673226dce31660fffa779bc50866e27ec89ba9e51203452db75368 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 17 04:02:10 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:33785 +2021 Jan 17 04:02:10 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -1807525047774611694 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:33785 +2021 Jan 17 04:02:10 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 17 04:02:10 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 17 04:02:10 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 17 04:02:10 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 17 04:02:10 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -1807525047774611694 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 17 04:02:10 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -1807525047774611694 (java.lang.Long) 785feedd3f21d35dcdf8709bd226e58442eaff46a4765b98213440007b9d06d4602dd398de673226dce31660fffa779bc50866e27ec89ba9e51203452db75368 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 17 04:02:10 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -1807525047774611694 (java.lang.Long) - - - - +2021 Jan 17 04:02:40 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 17 04:02:40 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 17 04:02:41 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -707842752454908406 (java.lang.Long) a8a219b94e6a30122e959785a434cea38001e6f96c7a89a5a26ac4d7b8ce037625cd2680099b2f14195ec43972d32fe326e15513ba01a8c7daf63407136aaee4 - - ServiceAgent +2021 Jan 17 04:02:42 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -707842752454908406 (java.lang.Long) a8a219b94e6a30122e959785a434cea38001e6f96c7a89a5a26ac4d7b8ce037625cd2680099b2f14195ec43972d32fe326e15513ba01a8c7daf63407136aaee4 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 17 04:02:42 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -707842752454908406 (java.lang.Long) a8a219b94e6a30122e959785a434cea38001e6f96c7a89a5a26ac4d7b8ce037625cd2680099b2f14195ec43972d32fe326e15513ba01a8c7daf63407136aaee4 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 17 04:02:42 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:36147 +2021 Jan 17 04:02:42 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -707842752454908406 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:36147 +2021 Jan 17 04:02:42 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 17 04:02:42 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 17 04:02:42 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 17 04:02:43 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 17 04:02:43 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -707842752454908406 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 17 04:02:43 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -707842752454908406 (java.lang.Long) a8a219b94e6a30122e959785a434cea38001e6f96c7a89a5a26ac4d7b8ce037625cd2680099b2f14195ec43972d32fe326e15513ba01a8c7daf63407136aaee4 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 17 04:02:43 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -707842752454908406 (java.lang.Long) - - - - diff --git a/requirement_bazaar/log/service.log.0 b/requirement_bazaar/log/service.log.0 new file mode 100644 index 00000000..e69de29b diff --git a/requirement_bazaar/src/i18n/Translation_de.properties b/requirement_bazaar/src/main/resources/i18n/Translation_de.properties similarity index 100% rename from requirement_bazaar/src/i18n/Translation_de.properties rename to requirement_bazaar/src/main/resources/i18n/Translation_de.properties diff --git a/requirement_bazaar/src/i18n/Translation_en.properties b/requirement_bazaar/src/main/resources/i18n/Translation_en.properties similarity index 100% rename from requirement_bazaar/src/i18n/Translation_en.properties rename to requirement_bazaar/src/main/resources/i18n/Translation_en.properties diff --git a/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/BazaarRequestParams.java b/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/BazaarRequestParams.java deleted file mode 100644 index 528a0170..00000000 --- a/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/BazaarRequestParams.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * - * Copyright (c) 2015, RWTH Aachen University. - * For a list of contributors see the AUTHORS file at the top-level directory - * of this distribution. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * / - */ - -package de.rwth.dbis.acis.bazaar.service; - -import java.util.HashMap; -import java.util.Map; - -/** - * @author Adam Gavronek - * @since 2/22/2015 - */ -public class BazaarRequestParams { - private Map queryParams; - private String contentParam; - - public Map getQueryParams() { - if (queryParams == null) - queryParams = new HashMap<>(); - return queryParams; - } - - public void setQueryParams(Map queryParams) { - this.queryParams = queryParams; - } - - public String getContentParam() { - if (contentParam == null) - return ""; - return contentParam; - } - - public void setContentParam(String contentParam) { - this.contentParam = contentParam; - } -} diff --git a/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/TestBase.java b/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/TestBase.java deleted file mode 100644 index 3726e2b5..00000000 --- a/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/TestBase.java +++ /dev/null @@ -1,27 +0,0 @@ - /* - * - * Copyright (c) 2014, RWTH Aachen University. - * For a list of contributors see the AUTHORS file at the top-level directory - * of this distribution. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * / - */ - -package de.rwth.dbis.acis.bazaar.service; - - -// TODO: update tests, see older revision -public abstract class TestBase { - -} diff --git a/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeMockImpl.java b/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeMockImpl.java deleted file mode 100644 index 2a7ef4b1..00000000 --- a/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeMockImpl.java +++ /dev/null @@ -1,574 +0,0 @@ -///* -// * -// * Copyright (c) 2014, RWTH Aachen University. -// * For a list of contributors see the AUTHORS file at the top-level directory -// * of this distribution. -// * -// * Licensed under the Apache License, Version 2.0 (the "License"); -// * you may not use this file except in compliance with the License. -// * You may obtain a copy of the License at -// * -// * http://www.apache.org/licenses/LICENSE-2.0 -// * -// * Unless required by applicable law or agreed to in writing, software -// * distributed under the License is distributed on an "AS IS" BASIS, -// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// * See the License for the specific language governing permissions and -// * limitations under the License. -// * / -// */ -// -//package de.rwth.dbis.acis.bazaar.service.dal; -// -//import de.rwth.dbis.acis.bazaar.service.dal.entities.*; -//import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; -//import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -//import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; -// -//import java.sql.Connection; -//import java.util.ArrayList; -//import java.util.Iterator; -//import java.util.List; -//import java.util.Random; -// -///** -// * @author Adam Gavronek -// * @since 6/14/2014 -// */ -//public class DALFacadeMockImpl implements DALFacade { -// -// //region Fields -// -// List userList = new ArrayList(); -// List projectList = new ArrayList(); -// List componentList = new ArrayList(); -// List requirementList = new ArrayList(); -// List commentList = new ArrayList(); -// List attachmentList = new ArrayList(); -// List voteList = new ArrayList(); -// List tagList = new ArrayList(); -// List developerList = new ArrayList(); -// List followerList = new ArrayList(); -// -// //endregion -// -// //region Private helper methods -// -// private int calcPaginationFrom(Pageable pageable){ -// -// return Math.max(0,pageable.getOffset() + pageable.getPageNumber()* pageable.getPageSize()); -// -// } -// private int calcPaginationTo(Pageable pageable, int listSize){ -// return Math.min(listSize,(pageable.getPageNumber()+1)*pageable.getPageSize()); -// } -// -// private List getCategories(int requirementId) { -// List components = new ArrayList(); -// -// for (RequirementCategory tag : tagList) { -// if (tag.getRequirementId() == requirementId) { -// for (Category component : componentList) { -// if (component.getId() == tag.getComponentId()) -// components.add(component); -// } -// -// } -// } -// return components; -// } -// -// private List getContributors(List attachments) { -// List users = new ArrayList(); -// List userIdList = new ArrayList(); -// -// for (Attachment attachment : attachments) { -// userIdList.add(attachment.getCreatorId()); -// } -// -// for (User user : userList) { -// if (userIdList.contains(user.getId())) -// users.add(user); -// } -// -// return users; -// } -// -// private List getFollowers(int requirementId) { -// List users = new ArrayList(); -// -// for (RequirementFollower follower : followerList) { -// if (follower.getRequirementId() == requirementId) { -// for (User user : userList) { -// if (user.getId() == follower.getUserId()) -// users.add(user); -// } -// -// } -// } -// return users; -// -// } -// -// private List getDevelopers(int requirementId) { -// List users = new ArrayList(); -// -// for (RequirementDeveloper developer : developerList) { -// if (developer.getRequirementId() == requirementId) { -// for (User user : userList) { -// if (user.getId() == developer.getUserId()) -// users.add(user); -// } -// -// } -// } -// return users; -// -// } -// -// private List getAttachments(int requirementId) { -// List attachments = new ArrayList(); -// -// for (Attachment attachment : attachmentList) { -// if (attachment.getRequirementId() == requirementId) -// attachments.add(attachment); -// } -// -// return attachments; -// } -// //endregion -// -// @Override -// public Connection getConnection() { -// return null; -// } -// -// @Override -// public int createUser(User user) { -// userList.add(user); -// return 0; -// } -// -// @Override -// public void modifyUser(User modifiedUser) { -// -// } -// -// @Override -// public User getUserById(int userId) { -//// return User.geBuilder("test@test.de") -//// .admin(false) -//// .firstName("Elek") -//// .lastName("Test") -//// .id(userId) -//// .userId(2222) -//// .build(); -// -// for (User user : userList) { -// if (user.getId() == userId) -// return user; -// } -// return null; -// } -// -// @Override -// public Integer getUserIdByLAS2PeerId(long las2PeerId) throws Exception { -// return null; -// } -// -// @Override -// public List listPublicProjects(Pageable pageable) { -// return projectList.subList(calcPaginationFrom(pageable),calcPaginationTo(pageable,projectList.size())); -//// return Arrays.asList( -//// Project.getBuilder("Proj1").description("Test project 1").id(1).visibility(Project.ProjectVisibility.PRIVATE).leaderId(1).build(), -//// Project.getBuilder("Proj2").description("Test project 2 + SEARCHSTR").visibility(Project.ProjectVisibility.PRIVATE).leaderId(1).id(2).build(), -//// Project.getBuilder("Proj3").description("Test project 3 + SEARCHSTR").visibility(Project.ProjectVisibility.PRIVATE).leaderId(1).id(2).build() -//// ); -// } -// -// @Override -// public List listPublicAndAuthorizedProjects(PageInfo pageable, long userId) throws BazaarException { -// return null; -// } -// -// @Override -// public List searchProjects(String searchTerm, Pageable pageable) { -// List toReturn = new ArrayList(); -// for (Project project : projectList) { -// if (project.getDescription().toUpperCase().contains(searchTerm.toUpperCase())) -// toReturn.add(project); -// } -// return toReturn.subList(calcPaginationFrom(pageable),calcPaginationTo(pageable,toReturn.size())); -// } -// -// @Override -// public Project getProjectById(int projectId) { -// -// for (Project project : projectList) { -// if (project.getId() == projectId) -// return project; -// } -// return null; -//// return Project.getBuilder("ProjById").description("Test project").id(projectId).visibility(Project.ProjectVisibility.PRIVATE).leaderId(1).build(); -// } -// -// @Override -// public int createProject(Project project) { -// projectList.add(project); -// return 0; -// } -// -// @Override -// public void modifyProject(Project modifiedProject) { -// -// } -// -// @Override -// public boolean isProjectPublic(int projectId) throws Exception { -// return false; -// } -// -// @Override -// public List listRequirements(Pageable pageable) { -// return requirementList.subList(calcPaginationFrom(pageable),calcPaginationTo(pageable,requirementList.size())); -// -//// return Arrays.asList( -//// Requirement.getBuilder("Req1").id(1).description("Requirement details 1").projectId(1).leadDeveloperId(1).creatorId(2).build(), -//// Requirement.getBuilder("Req2").id(2).description("Requirement details 2").projectId(1).leadDeveloperId(1).creatorId(2).build(), -//// Requirement.getBuilder("Req3").id(3).description("Requirement details 3").projectId(2).leadDeveloperId(1).creatorId(2).build() -//// ); -// } -// -// @Override -// public List listRequirementsByProject(int projectId, Pageable pageable) { -// List toReturn = new ArrayList(); -// for (Requirement req : requirementList) { -// if (req.getProjectId() == projectId) -// toReturn.add(req); -// } -// return toReturn.subList(calcPaginationFrom(pageable),calcPaginationTo(pageable,toReturn.size())); -// -//// return Arrays.asList( -//// Requirement.getBuilder("Req1").id(1).description("Requirement details 1").projectId(projectId).build(), -//// Requirement.getBuilder("Req2").id(2).description("Requirement details 2").projectId(projectId).build() -//// ); -// } -// -// @Override -// public List listRequirementsByComponent(int componentId, Pageable pageable) { -// List requirementIdList = new ArrayList(); -// for (RequirementCategory tag : tagList) { -// if (tag.getComponentId() == componentId) -// requirementIdList.add(tag.getRequirementId()); -// } -// -// List toReturn = new ArrayList(); -// for (Requirement req : requirementList) { -// if (requirementIdList.contains(req.getId())) -// toReturn.add(req); -// } -// return toReturn.subList(calcPaginationFrom(pageable),calcPaginationTo(pageable,toReturn.size())); -// } -// -// @Override -// public List searchRequirements(String searchTerm, Pageable pageable) { -// List toReturn = new ArrayList(); -// for (Requirement req : requirementList) { -// if (req.getDescription().toUpperCase().contains(searchTerm.toUpperCase())) -// toReturn.add(req); -// } -// return toReturn.subList(calcPaginationFrom(pageable),calcPaginationTo(pageable,toReturn.size())); -// } -// -// @Override -// public RequirementEx getRequirementById(int requirementId) { -// Requirement requirement = null; -// -// for (Requirement req : requirementList) { -// if (req.getId() == requirementId) -// requirement = req; -// } -// -// if (requirement != null) { -// List attachments = getAttachments(requirementId); -// List developers = getDevelopers(requirementId); -// List followers = getFollowers(requirementId); -// List contributors = getContributors(attachments); -// List components = getCategories(requirementId); -// -// return RequirementEx.getBuilder(requirement.getName()) -// .id(requirement.getId()) -// .description(requirement.getDescription()) -// .projectId(requirement.getProjectId()) -// .leadDeveloperId(requirement.getLeadDeveloperId()) -// .creatorId(requirement.getCreatorId()) -// .creator(getUserById(requirement.getCreatorId())) -// .leadDeveloper(getUserById(requirement.getLeadDeveloperId())) -// .developers(developers) -// .followers(followers) -// .contributors(contributors) -// .attachments(attachments) -// .components(components) -// .build(); -// } -// -// return null; -// } -// -// -// @Override -// public int createRequirement(Requirement requirement, int componentId) { -// requirementList.add(requirement); -// return 0; -// } -// -// @Override -// public void modifyRequirement(Requirement modifiedRequirement) { -// -// } -// -// @Override -// public void deleteRequirementById(int requirementId) { -// //Delete component tags -// Iterator tagIterator = tagList.iterator(); -// while (tagIterator.hasNext()) { -// RequirementCategory tag = tagIterator.next(); -// -// if (tag.getRequirementId() == requirementId) -// tagIterator.remove(); -// } -// -// //Delete followers -// Iterator followerIterator = followerList.iterator(); -// while (followerIterator.hasNext()) { -// RequirementFollower follower = followerIterator.next(); -// -// if (follower.getRequirementId() == requirementId) -// followerIterator.remove(); -// } -// -// //Delete developers -// Iterator developerIterator = developerList.iterator(); -// while (developerIterator.hasNext()) { -// RequirementDeveloper developer = developerIterator.next(); -// -// if (developer.getRequirementId() == requirementId) -// developerIterator.remove(); -// } -// //Delete attachments -// Iterator attachmentIterator = attachmentList.iterator(); -// while (attachmentIterator.hasNext()) { -// Attachment attachment = attachmentIterator.next(); -// -// if (attachment.getRequirementId() == requirementId) -// attachmentIterator.remove(); -// } -// -// //Delete comments -// Iterator commentIterator = commentList.iterator(); -// while (commentIterator.hasNext()) { -// Comment comment = commentIterator.next(); -// -// if (comment.getRequirementId() == requirementId) -// commentIterator.remove(); -// } -// -// //Delete votes -// Iterator voteIterator = voteList.iterator(); -// while (voteIterator.hasNext()) { -// Vote vote = voteIterator.next(); -// -// if (vote.getRequirementId() == requirementId) -// voteIterator.remove(); -// } -// -// //Delete requirement itself -// Iterator itr = requirementList.iterator(); -// while (itr.hasNext()) { -// Requirement requirement = itr.next(); -// -// if (requirement.getId() == requirementId) -// itr.remove(); -// } -// } -// -// @Override -// public List listComponentsByProjectId(int projectId, Pageable pageable) { -// Category.getBuilder("dd").projectId(2); -// List toReturn = new ArrayList(); -// for (Category component : componentList) { -// if (component.getProjectId() == projectId) -// toReturn.add(component); -// } -// return toReturn.subList(calcPaginationFrom(pageable),calcPaginationTo(pageable,toReturn.size())); -// } -// -// @Override -// public int createComponent(Category component) { -// componentList.add(component); -// return 0; -// } -// -// @Override -// public void modifyComponent(Category component) { -// -// } -// -// @Override -// public void deleteComponentById(int componentId) { -// Integer index = null; -// for (Category comp : componentList) { -// if (comp.getId() == componentId) -// index = componentList.indexOf(comp); -// } -// -// componentList.remove(index); -// } -// -// @Override -// public int createAttachment(Attachment attachment) { -// attachmentList.add(attachment); -// return 0; -// } -// -// @Override -// public void deleteAttachmentById(int attachmentId) { -// Integer index = null; -// for (Attachment attachment : attachmentList) { -// if (attachment.getId() == attachmentId) -// index = attachmentList.indexOf(attachment); -// } -// -// attachmentList.remove(index); -// } -// -// @Override -// public List listCommentsByRequirementId(int requirementId, Pageable pageable) { -// List toReturn = new ArrayList(); -// for (Comment comment : commentList) { -// if (comment.getRequirementId() == requirementId) -// toReturn.add(comment); -// } -// return toReturn.subList(calcPaginationFrom(pageable),calcPaginationTo(pageable,toReturn.size())); -// } -// -// @Override -// public int createComment(Comment comment) { -// commentList.add(comment); -// return 0; -// } -// -// @Override -// public void deleteCommentById(int commentId) { -// Iterator itr = commentList.iterator(); -// while (itr.hasNext()) { -// Comment comment = itr.next(); -// -// if (comment.getId() == commentId) -// itr.remove(); -// } -// } -// -// @Override -// public void follow(int userId, int requirementId) { -// RequirementFollower follower = RequirementFollower.getBuilder().id(new Random().nextInt()).userId(userId).requirementId(requirementId).build(); -// followerList.add(follower); -// } -// -// @Override -// public void unFollowRequirement(int userId, int requirementId) { -// Iterator itr = followerList.iterator(); -// while (itr.hasNext()) { -// RequirementFollower follower = itr.next(); -// -// if (follower.getUserId() == userId && follower.getRequirementId() == requirementId) -// itr.remove(); -// } -// } -// -// @Override -// public void wantToDevelop(int userId, int requirementId) { -// RequirementDeveloper developer = RequirementDeveloper.getBuilder().id(new Random().nextInt()).userId(userId).requirementId(requirementId).build(); -// -// developerList.add(developer); -// } -// -// @Override -// public void notWantToDevelop(int userId, int requirementId) { -// Iterator itr = developerList.iterator(); -// while (itr.hasNext()) { -// RequirementDeveloper developer = itr.next(); -// -// if (developer.getUserId() == userId && developer.getRequirementId() == requirementId) -// itr.remove(); -// } -// } -// -// -// -// @Override -// public void addComponentTag(int requirementId, int componentId) { -// RequirementCategory tag = RequirementCategory.getBuilder(componentId).requirementId(requirementId).id(new Random().nextInt()).build(); -// -// tagList.add(tag); -// } -// -// @Override -// public void deleteComponentTag(int requirementId, int componentId) { -// Iterator itr = tagList.iterator(); -// while (itr.hasNext()) { -// RequirementCategory tag = itr.next(); -// -// if (tag.getRequirementId() == requirementId && tag.getComponentId() == componentId) -// itr.remove(); -// } -// } -// -// @Override -// public void vote(int userId, int requirementId, boolean isUpVote) { -// Vote vote = Vote.getBuilder().id(new Random().nextInt()).requirementId(requirementId).userId(userId).isUpvote(isUpVote).build(); -// -// voteList.add(vote); -// } -// -// @Override -// public void unVote(int userId, int requirementId) { -// Iterator itr = voteList.iterator(); -// while (itr.hasNext()) { -// Vote vote = itr.next(); -// -// if (vote.getRequirementId() == requirementId && vote.getUserId() == userId) -// itr.remove(); -// } -// } -// -// @Override -// public boolean hasUserVotedForRequirement(int userId, int requirementId) { -// for (Vote vote : voteList) { -// if (vote.getRequirementId() == requirementId && vote.getUserId() == userId) -// return true; -// } -// return false; -// } -// -// @Override -// public List getRolesByUserId(int userId) throws BazaarException { -// return null; -// } -// -// @Override -// public List getParentsForRole(int roleId) throws BazaarException { -// return null; -// } -// -// @Override -// public void createPrivilegeIfNotExists(PrivilegeEnum privilege) throws BazaarException { -// -// } -// -// @Override -// public Category getComponentById(int componentId) throws Exception { -// // TODO Auto-generated method stub -// return null; -// } -//} diff --git a/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java b/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java deleted file mode 100644 index 0e82d60f..00000000 --- a/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java +++ /dev/null @@ -1,607 +0,0 @@ -///* -// * -// * Copyright (c) 2014, RWTH Aachen University. -// * For a list of contributors see the AUTHORS file at the top-level directory -// * of this distribution. -// * -// * Licensed under the Apache License, Version 2.0 (the "License"); -// * you may not use this file except in compliance with the License. -// * You may obtain a copy of the License at -// * -// * http://www.apache.org/licenses/LICENSE-2.0 -// * -// * Unless required by applicable law or agreed to in writing, software -// * distributed under the License is distributed on an "AS IS" BASIS, -// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// * See the License for the specific language governing permissions and -// * limitations under the License. -// * / -// */ -// -//package de.rwth.dbis.acis.bazaar.service.dal; -// -//import de.rwth.dbis.acis.bazaar.service.dal.entities.*; -//import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; -//import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.*; -//import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.*; -//import junit.framework.TestCase; -//import org.jooq.*; -//import org.jooq.impl.DefaultExecuteListener; -//import org.junit.BeforeClass; -// -//import java.net.URL; -//import java.sql.Connection; -//import java.sql.DriverManager; -//import java.sql.Timestamp; -//import java.util.List; -// -//import static de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Users.USERS; -//import static org.jooq.impl.DSL.count; -// -////TODO Pagination testing -//public class DALFacadeTest extends TestCase { -// -// public static final PageInfo ALL_IN_ONE_PAGE = new PageInfo(0, 100); -// -// DALFacade facade; -// private DALFacadeImpl dalImpl; -// DSLContext jooq; -// -// @BeforeClass -// public void setUp() throws Exception { -// Connection conn = null; -// -// String userName = "root"; -// String password = ""; -// URL db = DALFacadeTest.class.getResource("reqbaz.db"); -// String url = "jdbc:sqlite:" + db.getPath(); -// -// -// Class.forName("org.sqlite.JDBC").newInstance(); -// conn = DriverManager.getConnection(url, userName, password); -// -// -// -// dalImpl = new DALFacadeImpl(conn, SQLDialect.SQLITE); -// facade = dalImpl; -// jooq = dalImpl.getDslContext(); -// jooq.configuration().set(new ExecuteListenerProvider() { -// @Override -// public ExecuteListener provide() { -// return new DefaultExecuteListener() { -// @Override -// public void renderEnd(ExecuteContext ctx) { -// String sql = ctx.sql(); -// String replace = sql.replace("reqbaz.", "main."); -// ctx.sql(replace); -// } -// }; -// } -// }); -// -// jooq.execute("DELETE FROM main.Attachments"); -// jooq.execute("DELETE FROM main.Authorizations"); -// jooq.execute("DELETE FROM main.Comments"); -// jooq.execute("DELETE FROM main.Developers"); -// jooq.execute("DELETE FROM main.Followers"); -// jooq.execute("DELETE FROM main.Votes"); -// jooq.execute("DELETE FROM main.Tags"); -// jooq.execute("DELETE FROM main.Components"); -// jooq.execute("DELETE FROM main.Requirements"); -// jooq.execute("DELETE FROM main.Projects"); -// jooq.execute("DELETE FROM main.Users"); -// -// Field f = count(); -// -// User initUser = getInitUser(); -// if (jooq.selectCount().from(USERS).where(USERS.ID.equal(initUser.getId())).fetchOne(f) != 1) -// jooq.insertInto(USERS).set(new UsersRecord(initUser.getId(), initUser.getFirstName(), initUser.getLastName(), initUser.geteMail(), (byte) (initUser.getAdmin() ? 1 : 0), initUser.getLas2peerId(), initUser.getUserName())).execute(); -// -// if (jooq.selectCount().from(USERS).where(USERS.ID.equal(2)).fetchOne(f) != 1) -// jooq.insertInto(USERS).set(new UsersRecord(2, "Alma", "Barack", "test@test.hu", (byte) 1, 2222, "AlmBar")).execute(); -// -// if (jooq.selectCount().from(USERS).where(USERS.ID.equal(3)).fetchOne(f) != 1) -// jooq.insertInto(USERS).set(new UsersRecord(3, "Citrom", "Datolya", "test@test.hu", (byte) 0, 3333, "CitrDat")).execute(); -// -// if (jooq.selectCount().from(Projects.PROJECTS).where(Projects.PROJECTS.ID.equal(1)).fetchOne(f) != 1) -// jooq.insertInto(Projects.PROJECTS).set(new ProjectsRecord(1, "Project1", "ProjDesc1", "-", 1)).execute(); -// -// if (jooq.selectCount().from(Projects.PROJECTS).where(Projects.PROJECTS.ID.equal(2)).fetchOne(f) != 1) -// jooq.insertInto(Projects.PROJECTS).set(new ProjectsRecord(2, "Project2", "ProjDesc2", "+", 1)).execute(); -// -// if (jooq.selectCount().from(Requirements.REQUIREMENTS).where(Requirements.REQUIREMENTS.ID.equal(1)).fetchOne(f) != 1) -// jooq.insertInto(Requirements.REQUIREMENTS).set(new RequirementsRecord(1, "Req1", "ReqDesc1", Timestamp.valueOf("2005-04-06 09:01:10"), 1, 1, 1)).execute(); -// -// if (jooq.selectCount().from(Requirements.REQUIREMENTS).where(Requirements.REQUIREMENTS.ID.equal(2)).fetchOne(f) != 1) -// jooq.insertInto(Requirements.REQUIREMENTS).set(new RequirementsRecord(2, "Req2", "ReqDesc2", Timestamp.valueOf("2005-05-06 09:01:10"), 1, 1, 2)).execute(); -// -// if (jooq.selectCount().from(Requirements.REQUIREMENTS).where(Requirements.REQUIREMENTS.ID.equal(3)).fetchOne(f) != 1) -// jooq.insertInto(Requirements.REQUIREMENTS).set(new RequirementsRecord(3, "Req3", "ReqDesc3", Timestamp.valueOf("2005-06-06 09:01:10"), 1, 1, 1)).execute(); -// -// if (jooq.selectCount().from(Components.COMPONENTS).where(Components.COMPONENTS.ID.equal(1)).fetchOne(f) != 1) -// jooq.insertInto(Components.COMPONENTS).set(new ComponentsRecord(1, "Comp1", "CompDesc1", 2, 1)).execute(); -// -// if (jooq.selectCount().from(Tags.TAGS).where(Tags.TAGS.ID.equal(1)).fetchOne(f) != 1) -// jooq.insertInto(Tags.TAGS).set(new TagsRecord(1, 1, 2)).execute(); -// -// if (jooq.selectCount().from(Developers.DEVELOPERS).where(Developers.DEVELOPERS.ID.equal(1)).fetchOne(f) != 1) -// jooq.insertInto(Developers.DEVELOPERS).set(new DevelopersRecord(1, 2, 2)).execute(); -// -// if (jooq.selectCount().from(Developers.DEVELOPERS).where(Developers.DEVELOPERS.ID.equal(2)).fetchOne(f) != 1) -// jooq.insertInto(Developers.DEVELOPERS).set(new DevelopersRecord(2, 2, 3)).execute(); -// -// if (jooq.selectCount().from(Followers.FOLLOWERS).where(Followers.FOLLOWERS.ID.equal(1)).fetchOne(f) != 1) -// jooq.insertInto(Followers.FOLLOWERS).set(new FollowersRecord(1, 2, 2)).execute(); -// if (jooq.selectCount().from(Followers.FOLLOWERS).where(Followers.FOLLOWERS.ID.equal(2)).fetchOne(f) != 1) -// jooq.insertInto(Followers.FOLLOWERS).set(new FollowersRecord(2, 2, 3)).execute(); -// -// if (jooq.selectCount().from(Votes.VOTES).where(Votes.VOTES.ID.equal(1)).fetchOne(f) != 1) -// jooq.insertInto(Votes.VOTES).set(new VotesRecord(1, (byte) 1, 2, 1)).execute(); -// if (jooq.selectCount().from(Votes.VOTES).where(Votes.VOTES.ID.equal(2)).fetchOne(f) != 1) -// jooq.insertInto(Votes.VOTES).set(new VotesRecord(2, (byte) 0, 2, 3)).execute(); -// -// if (jooq.selectCount().from(Attachments.ATTACHMENTS).where(Attachments.ATTACHMENTS.ID.equal(1)).fetchOne(f) != 1) -// jooq.insertInto(Attachments.ATTACHMENTS).set(new AttachmentsRecord(1, Timestamp.valueOf("2005-04-06 09:01:10"), 2, 2, "StoryAttachment", "S", null, null, "RequirementStory", null, null, null)).execute(); -// -// -// if (jooq.selectCount().from(Comments.COMMENTS).where(Comments.COMMENTS.ID.equal(1)).fetchOne(f) != 1) -// jooq.insertInto(Comments.COMMENTS).set(new CommentsRecord(1, "Lorem ipsum dolor sit amet", Timestamp.valueOf("2005-04-06 09:01:10"), 2, 2)).execute(); -// if (jooq.selectCount().from(Comments.COMMENTS).where(Comments.COMMENTS.ID.equal(2)).fetchOne(f) != 1) -// jooq.insertInto(Comments.COMMENTS).set(new CommentsRecord(2, "Test message payload", Timestamp.valueOf("2005-04-06 10:01:10"), 2, 3)).execute(); -// -// -// } -// -// private User getInitUser() { -// return User.geBuilder("test@test.hu") -// .id(1) -// .firstName("Elek") -// .lastName("Test") -// .userName("TestElek") -// .admin(true) -// .las2peerId(1111) -// .build(); -// } -// -// public void testCreateUser() throws Exception { -// facade.createUser(User.geBuilder("unittest@test.hu").id(9).firstName("Max").lastName("Zimmermann").admin(false).las2peerId(9999).userName("MaxZim").build()); -// -// User user = facade.getUserById(9); -// -// assertEquals(9, user.getId()); -// assertEquals("unittest@test.hu", user.geteMail()); -// assertEquals("Max", user.getFirstName()); -// assertEquals("Zimmermann", user.getLastName()); -// assertEquals(false, user.isAdmin()); -// assertEquals(9999, user.getLas2peerId()); -// -// -// //Clean -// jooq.delete(USERS).where(USERS.ID.equal(9)).execute(); -// } -// -// public void testModifyUser() throws Exception { -// //TODO -// } -// -// public void testGetUserById() throws Exception { -// User user = facade.getUserById(1); -// -// assertEquals(1, user.getId()); -// assertEquals("test@test.hu", user.geteMail()); -// assertEquals("Elek", user.getFirstName()); -// assertEquals("Test", user.getLastName()); -// assertEquals(true, user.isAdmin()); -// assertEquals(1111, user.getLas2peerId()); -// } -// -// public void testListPublicProjects() throws Exception { -// List projects = facade.listPublicProjects(new PageInfo(0, 1)); -// -// assertNotNull(projects); -// assertEquals(1,projects.size()); -// -// for (Project project : projects) { -// assertEquals(Project.ProjectVisibility.PUBLIC,project.getVisibility()); -// } -// -// Project project = projects.get(0); -// -// assertEquals(2, project.getId()); -// assertEquals("Project2",project.getName()); -// assertEquals("ProjDesc2",project.getDescription()); -// assertEquals(1,project.getLeaderId()); -// assertEquals(Project.ProjectVisibility.PUBLIC, project.getVisibility()); -// } -// -// -// public void testSearchProjects() throws Exception { -// List projects = facade.searchProjects("2", ALL_IN_ONE_PAGE); -// -// assertNotNull(projects); -// assertEquals(1,projects.size()); -// -// Project project = projects.get(0); -// assertEquals(2, project.getId()); -// assertEquals("Project2",project.getName()); -// assertEquals("ProjDesc2",project.getDescription()); -// assertEquals(1,project.getLeaderId()); -// assertEquals(Project.ProjectVisibility.PUBLIC, project.getVisibility()); -// -// projects = facade.searchProjects("ProjD", new PageInfo(0, 100)); -// -// assertNotNull(projects); -// assertEquals(2,projects.size()); -// -// assertEquals(1, projects.get(0).getId()); -// assertEquals("Project1",projects.get(0).getName()); -// assertEquals("ProjDesc1",projects.get(0).getDescription()); -// assertEquals(1,projects.get(0).getLeaderId()); -// assertEquals(Project.ProjectVisibility.PRIVATE, projects.get(0).getVisibility()); -// -// assertEquals(2, projects.get(1).getId()); -// assertEquals("Project2",projects.get(1).getName()); -// assertEquals("ProjDesc2",projects.get(1).getDescription()); -// assertEquals(1,projects.get(1).getLeaderId()); -// assertEquals(Project.ProjectVisibility.PRIVATE, projects.get(1).getVisibility()); -// } -// -// public void testGetProjectById() throws Exception { -// Project project = facade.getProjectById(1); -// -// assertEquals(1, project.getId()); -// assertEquals("Project1",project.getName()); -// assertEquals("ProjDesc1",project.getDescription()); -// assertEquals(1,project.getLeaderId()); -// assertEquals(Project.ProjectVisibility.PRIVATE, project.getVisibility()); -// } -// -// public void testCreateProject() throws Exception { -// int createdProjId = 3; -// Project project = Project.getBuilder("Project3").description("ProjDesc3").leaderId(1).id(createdProjId).visibility(Project.ProjectVisibility.PUBLIC).build(); -// -// facade.createProject(project); -// -// Project projectById = facade.getProjectById(createdProjId); -// -// assertEquals(project.getId(), projectById.getId() ); -// assertEquals(project.getName(), projectById.getName() ); -// assertEquals(project.getDescription(),projectById.getDescription() ); -// assertEquals(project.getLeaderId(), projectById.getLeaderId() ); -// assertEquals(project.getVisibility(), projectById.getVisibility() ); -// -// //Clean -// jooq.delete(Projects.PROJECTS).where(Projects.PROJECTS.ID.equal(createdProjId)).execute(); -// } -// -// public void testModifyProject() throws Exception { -// //TODO -// } -// -// public void testListRequirements() throws Exception { -// List requirements = facade.listRequirements(ALL_IN_ONE_PAGE); -// -// assertNotNull(requirements); -// assertEquals(3, requirements.size()); -// -// Requirement requirement = requirements.get(2); -// -// assertEquals(1,requirement.getId()); -// assertEquals(1,requirement.getCreatorId()); -// assertEquals(1,requirement.getLeadDeveloperId()); -// assertEquals(1,requirement.getProjectId()); -// assertEquals("Req1",requirement.getName()); -// assertEquals("ReqDesc1",requirement.getDescription()); -// -// requirements = facade.listRequirements(new PageInfo(1, 2)); -// -// assertNotNull(requirements); -// assertEquals(1, requirements.size()); -// assertEquals(1,requirements.get(0).getId()); -// -// requirements = facade.listRequirements(new PageInfo(0, 1)); -// -// assertNotNull(requirements); -// assertEquals(1, requirements.size()); -// assertEquals(3,requirements.get(0).getId()); -// -// } -// -// public void testListRequirementsByProject() throws Exception { -// List requirements = facade.listRequirementsByProject(2, ALL_IN_ONE_PAGE); -// -// assertNotNull(requirements); -// assertEquals(1, requirements.size()); -// -// Requirement requirement2 = requirements.get(0); -// -// assertEquals(2,requirement2.getId()); -// assertEquals(1,requirement2.getCreatorId()); -// assertEquals(1,requirement2.getLeadDeveloperId()); -// assertEquals(2,requirement2.getProjectId()); -// assertEquals("Req2",requirement2.getName()); -// assertEquals("ReqDesc2",requirement2.getDescription()); -// -// -// } -// -// public void testListRequirementsByComponent() throws Exception { -// List requirements = facade.listRequirementsByComponent(1, ALL_IN_ONE_PAGE); -// -// assertNotNull(requirements); -// assertEquals(1, requirements.size()); -// -// Requirement requirement2 = requirements.get(0); -// -// assertEquals(2,requirement2.getId()); -// assertEquals(1,requirement2.getCreatorId()); -// assertEquals(1,requirement2.getLeadDeveloperId()); -// assertEquals(2,requirement2.getProjectId()); -// assertEquals("Req2",requirement2.getName()); -// assertEquals("ReqDesc2",requirement2.getDescription()); -// -// } -// -// public void testSearchRequirements() throws Exception { -// List requirements = facade.searchRequirements("desc2", ALL_IN_ONE_PAGE); -// -// assertNotNull(requirements); -// assertEquals(1, requirements.size()); -// -// Requirement requirement2 = requirements.get(0); -// -// assertEquals(2,requirement2.getId()); -// assertEquals(1,requirement2.getCreatorId()); -// assertEquals(1,requirement2.getLeadDeveloperId()); -// assertEquals(2,requirement2.getProjectId()); -// assertEquals("Req2",requirement2.getName()); -// assertEquals("ReqDesc2",requirement2.getDescription()); -// } -// -// public void testGetRequirementById() throws Exception { -// RequirementEx requirement = facade.getRequirementById(2); -// -// assertEquals(2, requirement.getId()); -// -// assertEquals(1, requirement.getCreatorId()); -// assertEquals(1,requirement.getCreator().getId()); -// assertEquals("Elek",requirement.getCreator().getFirstName()); -// -// assertEquals(1,requirement.getLeadDeveloperId()); -// assertEquals(1,requirement.getLeadDeveloper().getId()); -// assertEquals("Elek",requirement.getLeadDeveloper().getFirstName()); -// -// assertEquals(2,requirement.getProjectId()); -// assertEquals("Req2",requirement.getName()); -// assertEquals("ReqDesc2",requirement.getDescription()); -// -// List attachments = requirement.getAttachments(); -// assertNotNull(attachments); -// assertEquals(1, attachments.size()); -// assertEquals(2, attachments.get(0).getCreatorId()); -// -// List components = requirement.getCategories(); -// assertNotNull(components); -// assertEquals(1,components.size()); -// assertEquals(1, components.get(0).getId()); -// assertEquals("Comp1",components.get(0).getName()); -// -// List contributors = requirement.getContributors(); -// assertNotNull(contributors); -// assertEquals(1,contributors.size()); -// assertEquals(2,contributors.get(0).getId()); -// -// List developers = requirement.getDevelopers(); -// assertNotNull(developers); -// assertEquals(2,developers.size()); -// assertEquals(2,developers.get(0).getId()); -// assertEquals(3, developers.get(1).getId()); -// -// List followers = requirement.getFollowers(); -// assertNotNull(followers); -// assertEquals(2,followers.size()); -// assertEquals(2,followers.get(0).getId()); -// assertEquals(3,followers.get(1).getId()); -// -// } -// -// public void testCreateRequirement() throws Exception { -// int createdRequirementId = 9; -// try { -// Requirement requirement = Requirement.getBuilder("AddedReq1").id(createdRequirementId).description("Test addition").creatorId(2).leadDeveloperId(2).projectId(3).creationTime(Timestamp.valueOf("2005-04-06 09:01:10")).build(); -// -// facade.createRequirement(requirement, componentId); -// -// RequirementEx requirementById = facade.getRequirementById(createdRequirementId); -// -// assertEquals(requirement.getId(), requirementById.getId()); -// assertEquals(requirement.getName(), requirementById.getName()); -// assertEquals(requirement.getDescription(), requirementById.getDescription()); -// assertEquals(requirement.getCreatorId(), requirementById.getCreatorId()); -// assertEquals(requirement.getLeadDeveloperId(), requirementById.getLeadDeveloperId()); -// assertEquals(requirement.getProjectId(), requirementById.getProjectId()); -// } -// finally { -// jooq.delete(Requirements.REQUIREMENTS).where(Requirements.REQUIREMENTS.ID.equal(createdRequirementId)).execute(); -// } -// -// } -// -// public void testModifyRequirement() throws Exception { -// //TODO -// } -// -// public void testDeleteRequirementById() throws Exception { -// Requirement requirement = Requirement.getBuilder("AddedReq1").id(9).description("Test addition").creatorId(2).leadDeveloperId(2).projectId(3).build(); -// -// facade.createRequirement(requirement, componentId); -// -// facade.deleteRequirementById(9); -// -// try { -// RequirementEx requirementById = facade.getRequirementById(9); -// } -// catch (Exception ex){ -// assertEquals("No class de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementsRecord found with id: 9", ex.getMessage()); -// } -// } -// -// public void testListComponentsByProjectId() throws Exception { -// List components = facade.listComponentsByProjectId(2, ALL_IN_ONE_PAGE); -// -// assertNotNull(components); -// assertEquals(1,components.size()); -// assertEquals(1,components.get(0).getId()); -// } -// -// public void testCreateComponent() throws Exception { -// int createdComponentId = 9; -// Category testComp9 = Category.getBuilder("TestComp9").description("Very testing").id(createdComponentId).projectId(1).leaderId(1).build(); -// -// facade.createComponent(testComp9); -// -// List components = facade.listComponentsByProjectId(1, ALL_IN_ONE_PAGE); -// -// assertNotNull(components); -// assertEquals(1,components.size()); -// assertEquals(createdComponentId,components.get(0).getId()); -// -// //Clean -// jooq.delete(Components.COMPONENTS).where(Components.COMPONENTS.ID.equal(createdComponentId)).execute(); -// -// } -// -// public void testModifyComponent() throws Exception { -// //TODO -// } -// -// public void testDeleteComponentById() throws Exception { -// //TODO -// } -// -// public void testListCommentsByRequirementId() throws Exception { -// List comments = facade.listCommentsByRequirementId(2, ALL_IN_ONE_PAGE); -// -// assertNotNull(comments); -// assertEquals(2,comments.size()); -// assertTrue(comments.get(0).getId() == 1 || comments.get(0).getId() == 2); -// assertTrue(comments.get(1).getId() == 1 || comments.get(1).getId() == 2); -// } -// -// public void testCreateComment() throws Exception { -// int createdCommentId = 9; -// Comment testComment = Comment.getBuilder("TestComment").id(createdCommentId).creatorId(1).requirementId(1).build(); -// -// facade.createComment(testComment); -// -// List comments = facade.listCommentsByRequirementId(1, ALL_IN_ONE_PAGE); -// -// assertNotNull(comments); -// assertEquals(1,comments.size()); -// assertEquals(createdCommentId,comments.get(0).getId()); -// -// //CLEAN -// jooq.delete(Comments.COMMENTS).where(Comments.COMMENTS.ID.equal(createdCommentId)).execute(); -// } -// -// public void testDeleteCommentById() throws Exception { -// Comment testComment = Comment.getBuilder("TestComment").id(9).creatorId(1).requirementId(1).build(); -// -// facade.createComment(testComment); -// -// facade.deleteCommentById(9); -// -// List comments = facade.listCommentsByRequirementId(1, ALL_IN_ONE_PAGE); -// assertNotNull(comments); -// assertEquals(0, comments.size()); -// } -// -// public void testFollowUnFollow() throws Exception { -// facade.follow(2, 1); -// -// RequirementEx requirementById = facade.getRequirementById(1); -// List followers = requirementById.getFollowers(); -// -// assertNotNull(followers); -// assertEquals(1, followers.size()); -// assertEquals(2, followers.get(0).getId()); -// -// facade.unFollowRequirement(2, 1); -// -// requirementById = facade.getRequirementById(1); -// followers = requirementById.getFollowers(); -// -// assertEquals(0, followers.size()); -// } -// -// -// public void testWantToDevelopNotWant() throws Exception { -// facade.wantToDevelop(2, 1); -// -// RequirementEx requirementById = facade.getRequirementById(1); -// List developers = requirementById.getDevelopers(); -// -// assertNotNull(developers); -// assertEquals(1, developers.size()); -// assertEquals(2, developers.get(0).getId()); -// -// facade.notWantToDevelop(2, 1); -// -// requirementById = facade.getRequirementById(1); -// developers = requirementById.getDevelopers(); -// -// assertEquals(0, developers.size()); -// } -// -// -// public void testGiveAuthorizationAndRemove() throws Exception { -// -// boolean isAuthorized = facade.isAuthorized(2, 1); -// -// assertEquals(false, isAuthorized); -// -// facade.giveAuthorization(2,1); -// isAuthorized = facade.isAuthorized(2,1); -// -// assertEquals(true, isAuthorized); -// -// facade.removeAuthorization(2, 1); -// isAuthorized = facade.isAuthorized(2,1); -// -// assertEquals(false, isAuthorized); -// } -// -// -// public void testAddComponentTagAndRemove() throws Exception { -// facade.addComponentTag(1,1); -// -// List components = facade.getRequirementById(1).getCategories(); -// assertNotNull(components); -// assertEquals(1,components.size()); -// assertEquals(1, components.get(0).getId()); -// -// facade.deleteComponentTag(1,1); -// -// components = facade.getRequirementById(1).getCategories(); -// assertEquals(0,components.size()); -// } -// -// -// -// public void testVoteandUnvote() throws Exception { -// boolean hasUserVotedForRequirement = facade.hasUserVotedForRequirement(3, 1); -// -// assertEquals(false, hasUserVotedForRequirement); -// -// facade.vote(3,1,true); -// hasUserVotedForRequirement = facade.hasUserVotedForRequirement(3, 1); -// -// assertEquals(true, hasUserVotedForRequirement); -// -// facade.unVote(3,1); -// hasUserVotedForRequirement = facade.hasUserVotedForRequirement(3, 1); -// -// assertEquals(false, hasUserVotedForRequirement); -// } -// -//} \ No newline at end of file diff --git a/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/dal/RepositoryTest.java b/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/dal/RepositoryTest.java deleted file mode 100644 index c92d275c..00000000 --- a/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/dal/RepositoryTest.java +++ /dev/null @@ -1,184 +0,0 @@ -///* -// * -// * Copyright (c) 2014, RWTH Aachen University. -// * For a list of contributors see the AUTHORS file at the top-level directory -// * of this distribution. -// * -// * Licensed under the Apache License, Version 2.0 (the "License"); -// * you may not use this file except in compliance with the License. -// * You may obtain a copy of the License at -// * -// * http://www.apache.org/licenses/LICENSE-2.0 -// * -// * Unless required by applicable law or agreed to in writing, software -// * distributed under the License is distributed on an "AS IS" BASIS, -// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// * See the License for the specific language governing permissions and -// * limitations under the License. -// * / -// */ -// -//package de.rwth.dbis.acis.bazaar.service.dal; -// -//import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; -//import de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.ProjectsRecord; -//import de.rwth.dbis.acis.bazaar.service.dal.repositories.ProjectRepository; -//import de.rwth.dbis.acis.bazaar.service.dal.repositories.ProjectRepositoryImpl; -//import static de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.Projects.PROJECTS; -//import static org.junit.Assert.*; -// -//import org.jooq.DSLContext; -//import org.jooq.Result; -//import org.jooq.SQLDialect; -//import org.jooq.impl.DSL; -//import org.jooq.tools.jdbc.MockConnection; -//import org.jooq.tools.jdbc.MockDataProvider; -//import org.jooq.tools.jdbc.MockExecuteContext; -//import org.jooq.tools.jdbc.MockResult; -//import org.junit.BeforeClass; -//import org.junit.Test; -// -//import java.sql.Connection; -//import java.sql.SQLException; -//import java.util.ArrayList; -//import java.util.List; -// -///** -//* @author Adam Gavronek -//* @since 6/9/2014 -//*/ -//public class RepositoryTest { -// -// -// private static ProjectRepository repo; -// -// -// public static final int PROJECT_ID = 1; -// public static final String PROJECT_DESC = "blabla"; -// public static final String PROJECT_NAME = "projRec1"; -// -// private static final Integer PROJECT_ID2 = 2; -// private static final String PROJECT_DESC2 = "Lorem ipsum"; -// private static final String PROJECT_NAME2 = "testProject2"; -// private static MockedProjectDataProvider mockedProjectDataProvider; -// -// @BeforeClass -// public static void setUp(){ -// mockedProjectDataProvider = new MockedProjectDataProvider(); -// Connection connection = new MockConnection(mockedProjectDataProvider); -// DSLContext context = DSL.using(connection, SQLDialect.MYSQL); -// repo = new ProjectRepositoryImpl(context); -// } -// -// @Test -// public void testFindById() throws Exception { -// -// Project project = repo.findById(PROJECT_ID); -// -// assertEquals((long)PROJECT_ID,(long)project.getId()); -// assertEquals(PROJECT_DESC,project.getDescription()); -// assertEquals(PROJECT_NAME,project.getName()); -// } -// -// @Test -// public void testFindAll() throws Exception { -// List projects = repo.findAll(); -// -// assertNotNull(projects); -// assertEquals(2,projects.size()); -// Project project1 = projects.get(0); -// -// assertEquals((long)PROJECT_ID,(long)project1.getId()); -// assertEquals(PROJECT_DESC,project1.getDescription()); -// assertEquals(PROJECT_NAME,project1.getName()); -// -// Project project2 = projects.get(1); -// -// assertEquals((long)PROJECT_ID2,(long)project2.getId()); -// assertEquals(PROJECT_DESC2,project2.getDescription()); -// assertEquals(PROJECT_NAME2,project2.getName()); -// } -// -//// @Test -//// public void testDeleteAddFirst() throws Exception { -//// repo.delete(PROJECT_ID); -//// assertEquals((long)PROJECT_ID,(long)mockedProjectDataProvider.getDeletedIds().get(0)); -//// -//// -//// -//// Project project = repo.findById(PROJECT_ID); -//// assertNull(project); -//// -//// mockedProjectDataProvider.getDeletedIds().clear(); -//// } -// -// -// public static class MockedProjectDataProvider implements MockDataProvider { -// private List records; -// -// public List getDeletedIds() { -// return deletedIds; -// } -// -// private List deletedIds = new ArrayList(); -// private final DSLContext create; -// -// public MockedProjectDataProvider(){ -// create = DSL.using(SQLDialect.MYSQL); -// -// ProjectsRecord record1 = create.newRecord(PROJECTS); -// record1.setValue(PROJECTS.ID, PROJECT_ID); -// record1.setValue(PROJECTS.DESCRIPTION, PROJECT_DESC); -// record1.setValue(PROJECTS.NAME, PROJECT_NAME); -// -// ProjectsRecord record2 = create.newRecord(PROJECTS); -// record2.setValue(PROJECTS.ID, PROJECT_ID2); -// record2.setValue(PROJECTS.DESCRIPTION, PROJECT_DESC2); -// record2.setValue(PROJECTS.NAME, PROJECT_NAME2); -// -// records = new ArrayList(); -// records.add(record1); -// records.add(record2); -// } -// -// @Override -// public MockResult[] execute(MockExecuteContext ctx) throws SQLException { -// -// MockResult[] mock = new MockResult[1]; -// -// String sql = ctx.sql(); -// -// -// // DROP IS NOT SUPPORTED -// if (sql.toUpperCase().startsWith("DROP")) { -// throw new SQLException("Statement not supported: " + sql); -// } -// else if (sql.toUpperCase().startsWith("DELETE")){ -// Integer id = (Integer) ctx.bindings()[0]; -// deletedIds.add(id); -// -// } -// else if (sql.toUpperCase().startsWith("INSERT")){ -// -// } -// // IF SELECT + WHERE, so FindById and we return 1 record -// else if (sql.toUpperCase().startsWith("SELECT") && sql.toUpperCase().contains("WHERE")) -// { -// Result result = create.newResult(PROJECTS); -// Integer id = (Integer) ctx.bindings()[0]; -// if(!deletedIds.contains(id)) -// result.add(records.get(id-1)); -// mock[0] = new MockResult(1, result); -// } -// // IF SELECT ONLY: FindAll so we return more records -// else if (sql.toUpperCase().startsWith("SELECT")) { -// Result result = create.newResult(PROJECTS); -// result.add(records.get(0)); -// result.add(records.get(1)); -// mock[0] = new MockResult(1,result); -// } -// return mock; -// } -// } -//} -// diff --git a/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/dal/reqbaz.db b/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/dal/reqbaz.db deleted file mode 100644 index ba12a52a63d438c597251af0e37261c9bb2e2365..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18432 zcmeHPPjA~c6sKe*N}YOZ3lzdI6lGVWu+bJsT6hC?nwu$uF~`XqXFyH{V>7V^+j1q^ zTXXbWZ2Jzo?gQ*g?6%tuJM_HMF1zfq%Sc(W^c-8Up<-Qa3a~^y@;#D2ntFdo>FA4+ z#V9_roi<_kDbkRlpieMH2yOD;E&dA*ajyk8{HjFKvyz+W@gLe6&(%_YiZVA-|D^s- z{WZFo#kA~n?ND7e9zIk~7&&cG_j!wtK+UDkd$d!ZyiM&^%tF<~)xxuqi6_ctJETn? zan9WELq#|4-&ekW>d7oHM(WKr?JzfzRDrBW2F_;Em>FVs!gfJ zFLmrvCnlR&tVMC3IQ1rRvQP5)+_;^-fQIGP9jk412(uk5ijg{_PIl)~$up}(YhA*c zV|n@Q?OY&+3Nc;LEzIaQ%qP2C=nFvToqk2@Y%D@F$uDbPkyC5%I;Ju19aPNXXJrrX zEQBqGE9RbAG0VH=5sqZJI9qH46$5@B&=Dh_SMQ|xDZRl@x|o$~sSH1ZSuO76ArX)W ztONpb{;$L^%T7uJrXnEc|5R8cQ6jJs2#EQgLJtsnpw`r%(FapItx5NCVNXMX*(v4hB86J%y9X-~x9qYmiLAV8Qr@?p!$V(LRAax$6achos z-ei{|CcgiF=-47O5EIR~BG>_d4yAz@fKQ&&|DQHMQvXkV;z^=JU?mU`^Iui+NXe@| zDmyFD<;0!T1`SO&?%YvczVGRvUAygt+Joyl&^rM&k;Z9reM8Qv7ki$JdH;t2c%YLa z0cft}fL@AZCD2U+vZfpN?kO)b0nA;yBi1xHq<(5+5^A5G2yC&c0wVL1h>OsDba`Mh zKh)NH(KVg$te zPoWEhE|j0tUr|4?z=Z^ry5>TXvVnj>6P6VBLlEMAluzHhoRO87L9h zT9K?IhVYiI8+Y$2!}mNxc+YON?5{aerslTD$m#VYcx4mn+v9+aq_tS1cpVx3DLiJpM9?A3cc)Y3zy@b?mtJYkZeDM#d%g64X4y&GdJ~0N$`M3owQ4 z15BYO&zB+jrlUbFtsA#*E5p1u?p1Q`ir>3noCPJ(_=by+F?dD)O)i5n$`45Wg`ec{<`5Ws zd|fvTBiPserOl}8oo)fM)gvXcTP?TN>-M>L{OsVMWERSkyVoLSVvNbU$nJG0G2SMf z<}CPi0Y`DL=SlFfgEPxlW{JT60D*r2$)R!v diff --git a/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/security/AnonymUserRightsTest.java b/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/security/AnonymUserRightsTest.java deleted file mode 100644 index 023e5f5b..00000000 --- a/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/security/AnonymUserRightsTest.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * - * Copyright (c) 2015, RWTH Aachen University. - * For a list of contributors see the AUTHORS file at the top-level directory - * of this distribution. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * / - */ - -package de.rwth.dbis.acis.bazaar.service.security; - -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import de.rwth.dbis.acis.bazaar.service.BazaarRequestParams; -import de.rwth.dbis.acis.bazaar.service.TestBase; -import de.rwth.dbis.acis.bazaar.service.dal.entities.*; -import i5.las2peer.testing.MockAgentFactory; -import i5.las2peer.connectors.webConnector.client.ClientResponse; -import i5.las2peer.connectors.webConnector.client.MiniClient; - -import org.junit.*; - - -import java.io.UnsupportedEncodingException; -import java.util.HashMap; -import java.util.List; - -/** - * @author Adam Gavronek - * @since 2/22/2015 - */ -public class AnonymUserRightsTest extends TestBase { - - @BeforeClass - public static void startServer() throws Exception { - //testPass = "evespass"; - testAgent = MockAgentFactory.getAnonymous(); - TestBase.startServer(); - } - - @Override - protected void login(MiniClient c) throws UnsupportedEncodingException { - //super.login(c); - } - - - - @Test - public void test_getProjects() { - ClientResponse response = super.test_getProjects(new BazaarRequestParams()); - assertThat(response, is(notNullValue())); - List projectList = new Gson().fromJson(response.getResponse(), new TypeToken>() { - }.getType()); - assertThat(projectList, hasItem(Matchers.hasProperty("id", equalTo(1)))); - assertThat(projectList, not(hasItem(Matchers.hasProperty("id", equalTo(2))))); - } - - @Test - public void test_getPublicProject() { - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(1)); - }}); - ClientResponse response = super.test_getProject(params); - assertThat(response,is(notNullValue())); - Project project = new Gson().fromJson(response.getResponse(), Project.class); - assertThat(project.getId(), is(1)); - assertThat(project.getName(), is("PublicTestProject")); - } - - @Test - public void test_getPrivateProject(){ - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(2)); - }}); - ClientResponse response = super.test_getProject(params); - assertAccessDenied(response); - } - - @Test - public void test_createComponents( ){ - BazaarRequestParams params = new BazaarRequestParams(); - Category category = Category.getBuilder("TestCreateComponent").id(901).description("hello").projectId(1).build(); - params.setContentParam(new Gson().toJson(category)); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(1)); - }}); - ClientResponse response = super.test_createComponent(params); - assertAccessDenied(response); - } - - @Test - public void test_getPublicProjectComponents(){ - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(1)); - }}); - ClientResponse response = super.test_getComponents(params); - assertThat(response, is(notNullValue())); - List projectList = new Gson().fromJson(response.getResponse(), new TypeToken>() {}.getType()); - assertThat(projectList, hasItem(Matchers.hasProperty("id", equalTo(1)))); - assertThat(projectList, not(hasItem(Matchers.hasProperty("id", equalTo(2))))); - } - - @Test - public void test_getPrivateProjectComponents() { - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(2)); - }}); - ClientResponse response = super.test_getComponents(params); - assertAccessDenied(response); - } - - @Test - public void test_deleteComponent() { - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(2)); - put("componentId", String.valueOf(2)); - }}); - ClientResponse response = super.test_deleteComponent(params); - assertAccessDenied(response); - } - - @Test - public void test_createRequirementPublicProject( ){ - BazaarRequestParams params = new BazaarRequestParams(); - Requirement requirement = Requirement.getBuilder("TestCreateReq").id(901).description("hello").projectId(1).build(); - params.setContentParam(new Gson().toJson(requirement)); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(1)); - put("componentId", String.valueOf(1)); - }}); - ClientResponse response = super.test_createRequirement(params); - assertAccessDenied(response); - } - - @Test - public void test_getPublicRequirements() { - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(1)); - }}); - ClientResponse response = super.test_getRequirementsByProject(params); - assertThat(response, is(notNullValue())); - List projectList = new Gson().fromJson(response.getResponse(), new TypeToken>() {}.getType()); - assertThat(projectList, hasItem(Matchers.hasProperty("id", equalTo(1)))); - } - - @Test - public void test_getPrivateRequirements() { - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(2)); - }}); - ClientResponse response = super.test_getRequirementsByProject(params); - assertAccessDenied(response); - } - - @Test - public void test_getPublicRequirementsByComponent() { - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(1)); - put("componentId", String.valueOf(1)); - }}); - ClientResponse response = super.test_getRequirementsByComponent(params); - assertThat(response, is(notNullValue())); - List projectList = new Gson().fromJson(response.getResponse(), new TypeToken>() {}.getType()); - assertThat(projectList, hasItem(Matchers.hasProperty("id", equalTo(1)))); - } - - @Test - public void test_getPrivateRequirementsByComponent() { - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(2)); - put("componentId", String.valueOf(2)); - }}); - ClientResponse response = super.test_getRequirementsByComponent(params); - assertAccessDenied(response); - } - - @Test - public void test_getPublicRequirement() { - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(1)); - put("componentId", String.valueOf(1)); - put("requirementId", String.valueOf(1)); - }}); - ClientResponse response = super.test_getRequirement(params); - assertThat(response,is(notNullValue())); - RequirementEx requirementEx = new Gson().fromJson(response.getResponse(), RequirementEx.class); - assertThat(requirementEx.getId(), is(1)); - assertThat(requirementEx.getName(), is("PublicRequirement")); - } - - @Test - public void test_getPrivateRequirement() { - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(2)); - put("componentId", String.valueOf(2)); - put("requirementId", String.valueOf(2)); - }}); - ClientResponse response = super.test_getRequirement(params); - assertAccessDenied(response); - } - - @Test - public void test_deleteRequirement() { - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(1)); - put("componentId", String.valueOf(1)); - put("requirementId", String.valueOf(1)); - }}); - ClientResponse response = super.test_deleteRequirement(params); - assertAccessDenied(response); - } - - @Test - public void test_createComment( ){ - BazaarRequestParams params = new BazaarRequestParams(); - Comment comment = Comment.getBuilder("TestCommentText").id(901).requirementId(1).build(); - params.setContentParam(new Gson().toJson(comment)); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(1)); - put("componentId", String.valueOf(1)); - put("requirementId", String.valueOf(1)); - }}); - ClientResponse response = super.test_createComment(params); - assertAccessDenied(response); - } - - @Test - public void test_getPublicComments() { - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(1)); - put("componentId", String.valueOf(1)); - put("requirementId", String.valueOf(1)); - }}); - ClientResponse response = super.test_getComments(params); - assertThat(response, is(notNullValue())); - List comments = new Gson().fromJson(response.getResponse(), new TypeToken>() {}.getType()); - assertThat(comments, hasItem(Matchers.hasProperty("id", equalTo(1)))); - } - - @Test - public void test_getPrivateComments() { - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(2)); - put("componentId", String.valueOf(2)); - put("requirementId", String.valueOf(2)); - }}); - ClientResponse response = super.test_getComments(params); - assertAccessDenied(response); - } -} diff --git a/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/security/SpecialRightsTest.java b/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/security/SpecialRightsTest.java deleted file mode 100644 index 60fc2354..00000000 --- a/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/security/SpecialRightsTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * Copyright (c) 2015, RWTH Aachen University. - * For a list of contributors see the AUTHORS file at the top-level directory - * of this distribution. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * / - */ - -package de.rwth.dbis.acis.bazaar.service.security; - -/** - * @author Adam Gavronek - * @since 2/25/2015 - */ -public class SpecialRightsTest { - -} diff --git a/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/security/SysAdminRightsTest.java b/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/security/SysAdminRightsTest.java deleted file mode 100644 index 978112da..00000000 --- a/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/security/SysAdminRightsTest.java +++ /dev/null @@ -1,306 +0,0 @@ -/* - * - * Copyright (c) 2015, RWTH Aachen University. - * For a list of contributors see the AUTHORS file at the top-level directory - * of this distribution. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * / - */ - -package de.rwth.dbis.acis.bazaar.service.security; - -import com.google.gson.Gson; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import com.google.gson.reflect.TypeToken; -import de.rwth.dbis.acis.bazaar.service.BazaarRequestParams; -import de.rwth.dbis.acis.bazaar.service.TestBase; -import de.rwth.dbis.acis.bazaar.service.dal.entities.*; -import i5.las2peer.testing.MockAgentFactory; -import i5.las2peer.connectors.webConnector.client.ClientResponse; -import i5.las2peer.connectors.webConnector.client.MiniClient; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; - -import java.io.UnsupportedEncodingException; -import java.util.HashMap; -import java.util.List; - -/** - * @author Adam Gavronek - * @since 2/24/2015 - */ -public class SysAdminRightsTest extends TestBase { - @BeforeClass - public static void startServer() throws Exception { - testPass = "evespass"; - testAgent = MockAgentFactory.getEve(); - TestBase.startServer(); - } - - @Override - protected void login(MiniClient c) throws UnsupportedEncodingException { - super.login(c); - } - - @Test - public void test_getProjects() { - ClientResponse response = super.test_getProjects(new BazaarRequestParams()); - assertThat(response, is(notNullValue())); - List projectList = new Gson().fromJson(response.getResponse(), new TypeToken>() { - }.getType()); - assertThat(projectList, hasItem(Matchers.hasProperty("id", equalTo(1)))); - assertThat(projectList, hasItem(Matchers.hasProperty("id", equalTo(2)))); - } - - @Test - public void test_getPublicProject() { - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(1)); - }}); - ClientResponse response = super.test_getProject(params); - assertThat(response,is(notNullValue())); - Project project = new Gson().fromJson(response.getResponse(), Project.class); - assertThat(project.getId(), is(1)); - assertThat(project.getName(), is("PublicTestProject")); - } - - @Test - public void test_getPrivateProject(){ - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(2)); - }}); - ClientResponse response = super.test_getProject(params); - assertThat(response,is(notNullValue())); - Project project = new Gson().fromJson(response.getResponse(), Project.class); - assertThat(project.getId(), is(2)); - assertThat(project.getName(), is("PrivateTestProject")); - } - - @Test - @Ignore - public void test_createAndDeleteComponents( ){ - BazaarRequestParams params = new BazaarRequestParams(); - Category category = Category.getBuilder("TestCreateComponent").id(901).description("hello").projectId(1).build(); - params.setContentParam(new Gson().toJson(category)); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(1)); - }}); - ClientResponse response = super.test_createComponent(params); - assertThat(response,is(notNullValue())); - JsonObject userDataJson = new JsonParser().parse(response.getResponse()).getAsJsonObject(); - Integer insertedId= userDataJson.getAsJsonPrimitive("id").getAsInt(); - assertThat(insertedId,is(901)); - - //Delete it - - params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(2)); - put("componentId", String.valueOf(901)); - }}); - response = super.test_deleteComponent(params); - assertThat(response,is(notNullValue())); - userDataJson = new JsonParser().parse(response.getResponse()).getAsJsonObject(); - Boolean success = userDataJson.getAsJsonPrimitive("success").getAsBoolean(); - assertThat(success,is(true)); - } - - @Test - public void test_getPublicProjectComponents(){ - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(1)); - }}); - ClientResponse response = super.test_getComponents(params); - assertThat(response, is(notNullValue())); - List projectList = new Gson().fromJson(response.getResponse(), new TypeToken>() {}.getType()); - assertThat(projectList, hasSize(1)); - assertThat(projectList, hasItem(Matchers.hasProperty("id", equalTo(1)))); - } - - @Test - public void test_getPrivateProjectComponents() { - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(2)); - }}); - ClientResponse response = super.test_getComponents(params); - assertThat(response, is(notNullValue())); - List projectList = new Gson().fromJson(response.getResponse(), new TypeToken>() {}.getType()); - assertThat(projectList, hasSize(1)); - assertThat(projectList, hasItem(Matchers.hasProperty("id", equalTo(2)))); - } - - @Test - @Ignore - public void test_createRequirementPublicProject( ){ - BazaarRequestParams params = new BazaarRequestParams(); - Requirement requirement = Requirement.getBuilder("TestCreateReq").id(901).description("hello").projectId(1).build(); - params.setContentParam(new Gson().toJson(requirement)); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(1)); - put("componentId", String.valueOf(1)); - }}); - ClientResponse response = super.test_createRequirement(params); - assertAccessDenied(response); - } - - @Test - public void test_getPublicRequirements() { - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(1)); - }}); - ClientResponse response = super.test_getRequirementsByProject(params); - assertThat(response, is(notNullValue())); - List projectList = new Gson().fromJson(response.getResponse(), new TypeToken>() {}.getType()); - assertThat(projectList, hasItem(Matchers.hasProperty("id", equalTo(1)))); - assertThat(projectList, hasSize(1)); - } - - @Test - public void test_getPrivateRequirements() { - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(2)); - }}); - ClientResponse response = super.test_getRequirementsByProject(params); - assertThat(response, is(notNullValue())); - List projectList = new Gson().fromJson(response.getResponse(), new TypeToken>() {}.getType()); - assertThat(projectList, hasItem(Matchers.hasProperty("id", equalTo(2)))); - assertThat(projectList, hasSize(1)); - } - - @Test - public void test_getPublicRequirementsByComponent() { - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(1)); - put("componentId", String.valueOf(1)); - }}); - ClientResponse response = super.test_getRequirementsByComponent(params); - assertThat(response, is(notNullValue())); - List projectList = new Gson().fromJson(response.getResponse(), new TypeToken>() {}.getType()); - assertThat(projectList, hasItem(Matchers.hasProperty("id", equalTo(1)))); - assertThat(projectList, hasSize(1)); - } - - @Test - public void test_getPrivateRequirementsByComponent() { - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(2)); - put("componentId", String.valueOf(2)); - }}); - ClientResponse response = super.test_getRequirementsByComponent(params); - assertThat(response, is(notNullValue())); - List projectList = new Gson().fromJson(response.getResponse(), new TypeToken>() {}.getType()); - assertThat(projectList, hasItem(Matchers.hasProperty("id", equalTo(2)))); - assertThat(projectList, hasSize(1)); - } - - @Test - public void test_getPublicRequirement() { - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(1)); - put("componentId", String.valueOf(1)); - put("requirementId", String.valueOf(1)); - }}); - ClientResponse response = super.test_getRequirement(params); - assertThat(response,is(notNullValue())); - RequirementEx requirementEx = new Gson().fromJson(response.getResponse(), RequirementEx.class); - assertThat(requirementEx.getId(), is(1)); - assertThat(requirementEx.getName(), is("PublicRequirement")); - } - - @Test - public void test_getPrivateRequirement() { - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(2)); - put("componentId", String.valueOf(2)); - put("requirementId", String.valueOf(2)); - }}); - ClientResponse response = super.test_getRequirement(params); - assertThat(response,is(notNullValue())); - RequirementEx requirementEx = new Gson().fromJson(response.getResponse(), RequirementEx.class); - assertThat(requirementEx.getId(), is(2)); - assertThat(requirementEx.getName(), is("PrivateRequirement")); - } - - @Test - @Ignore - public void test_deleteRequirement() { - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(1)); - put("componentId", String.valueOf(1)); - put("requirementId", String.valueOf(1)); - }}); - ClientResponse response = super.test_deleteRequirement(params); - assertAccessDenied(response); - } - - @Test - @Ignore - public void test_createComment( ){ - BazaarRequestParams params = new BazaarRequestParams(); - Comment comment = Comment.getBuilder("TestCommentText").id(901).requirementId(1).build(); - params.setContentParam(new Gson().toJson(comment)); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(1)); - put("componentId", String.valueOf(1)); - put("requirementId", String.valueOf(1)); - }}); - ClientResponse response = super.test_createComment(params); - assertAccessDenied(response); - } - - @Test - public void test_getPublicComments() { - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(1)); - put("componentId", String.valueOf(1)); - put("requirementId", String.valueOf(1)); - }}); - ClientResponse response = super.test_getComments(params); - assertThat(response, is(notNullValue())); - List comments = new Gson().fromJson(response.getResponse(), new TypeToken>() {}.getType()); - assertThat(comments, hasSize(1)); - assertThat(comments, hasItem(Matchers.hasProperty("id", equalTo(1)))); - } - - @Test - public void test_getPrivateComments() { - BazaarRequestParams params = new BazaarRequestParams(); - params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(2)); - put("componentId", String.valueOf(2)); - put("requirementId", String.valueOf(2)); - }}); - ClientResponse response = super.test_getComments(params); - assertThat(response, is(notNullValue())); - List comments = new Gson().fromJson(response.getResponse(), new TypeToken>() { - }.getType()); - assertThat(comments, hasSize(1)); - assertThat(comments, hasItem(Matchers.hasProperty("id", equalTo(2)))); - } - -} diff --git a/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/update/UpdateTest.java b/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/update/UpdateTest.java deleted file mode 100644 index de7557e0..00000000 --- a/requirement_bazaar/src/test/de/rwth/dbis/acis/bazaar/service/update/UpdateTest.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * - * Copyright (c) 2015, RWTH Aachen University. - * For a list of contributors see the AUTHORS file at the top-level directory - * of this distribution. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * / - */ - -package de.rwth.dbis.acis.bazaar.service.update; - -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import de.rwth.dbis.acis.bazaar.service.BazaarRequestParams; -import de.rwth.dbis.acis.bazaar.service.TestBase; -import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; -import i5.las2peer.testing.MockAgentFactory; -import i5.las2peer.connectors.webConnector.client.ClientResponse; -import i5.las2peer.connectors.webConnector.client.MiniClient; -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.UnsupportedEncodingException; -import java.util.HashMap; -import java.util.List; - -/** - * @author Adam Gavronek - * @since 3/13/2015 - */ -public class UpdateTest extends TestBase { - @BeforeClass - public static void startServer() throws Exception { - //testPass = "evespass"; - testAgent = MockAgentFactory.getAnonymous(); - TestBase.startServer(); - } - - @Override - protected void login(MiniClient c) throws UnsupportedEncodingException { - //super.login(c); - } - - @Test - public void test_modifyProjects() { - ClientResponse response = super.test_getProjects(new BazaarRequestParams()); - Gson gson = new Gson(); - List projectList = gson.fromJson(response.getResponse(), new TypeToken>() { - }.getType()); - assertThat(projectList, not(empty())); - final Project project = projectList.get(0); - - String mod_title = "AAAAAAAAA"; - int mod_defaultComponentId = 99; - String mod_Desc = "MOD_DESC"; - Project.ProjectVisibility publicVisibility = Project.ProjectVisibility.PUBLIC; - int mod_leaderId = 88; - final Project modifiedProject = Project.getBuilder(mod_title) - .id(project.getId()) - .defaultComponentId(mod_defaultComponentId) - .description(mod_Desc) - .visibility(publicVisibility) - .leaderId(mod_leaderId) - .build(); - BazaarRequestParams mod_params = new BazaarRequestParams(); - mod_params.setContentParam(gson.toJson(modifiedProject)); - mod_params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(modifiedProject.getId())); - }}); - - ClientResponse modifyResponse = super.test_modifyProject(mod_params); - - BazaarRequestParams mod_test_params = new BazaarRequestParams(); - mod_test_params.setQueryParams(new HashMap() {{ - put("projectId", String.valueOf(project.getId())); - }}); - ClientResponse clientResponse = super.test_getProject(mod_test_params); - Project projectAfterModification = new Gson().fromJson(clientResponse.getResponse(), Project.class); - assertThat(projectAfterModification.getId(), is(project.getId())); - assertThat(projectAfterModification.getName(), is(mod_title)); - assertThat(projectAfterModification.getDefaultComponentId(), is(mod_defaultComponentId)); - assertThat(projectAfterModification.getDescription(), is(mod_Desc)); - assertThat(projectAfterModification.getVisibility(), is(publicVisibility)); - assertThat(projectAfterModification.getLeaderId(), is(mod_leaderId)); - - mod_params.setContentParam(gson.toJson(project)); - super.test_modifyProject(mod_params); - } -} diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java new file mode 100644 index 00000000..161ca8dd --- /dev/null +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -0,0 +1,32 @@ +package de.rwth.dbis.acis.bazaar.service; + +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import i5.las2peer.connectors.webConnector.client.ClientResponse; +import i5.las2peer.connectors.webConnector.client.MiniClient; +import org.junit.Assert; +import org.junit.Test; + +public class BazaarTest extends TestBase { + + /** + * Test to get the version from the version endpoint + */ + @Test + public void testGetVersion() { + try { + MiniClient client = getClient(); + + ClientResponse result = client.sendRequest("GET", mainPath + "version", ""); + JsonObject response = JsonParser.parseString(result.getResponse()).getAsJsonObject(); + + Assert.assertTrue(response.isJsonObject()); + Assert.assertEquals(response.get("version").getAsString(), BazaarService.class.getName() + "@" + testVersion); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(e.toString()); + } + } + +} diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java new file mode 100644 index 00000000..9c0e4728 --- /dev/null +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java @@ -0,0 +1,88 @@ +package de.rwth.dbis.acis.bazaar.service; + +import i5.las2peer.api.p2p.ServiceNameVersion; +import i5.las2peer.connectors.webConnector.WebConnector; +import i5.las2peer.connectors.webConnector.client.MiniClient; +import i5.las2peer.p2p.LocalNode; +import i5.las2peer.p2p.LocalNodeManager; +import i5.las2peer.security.UserAgentImpl; +import i5.las2peer.testing.MockAgentFactory; +import org.junit.After; +import org.junit.Before; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; + +/** + * Example Test Class demonstrating a basic JUnit test structure. + */ +public abstract class TestBase { + + private static final String testPass = "adamspass"; + static final String mainPath = "bazaar/"; + static final String testVersion = "1.0.0"; + private static LocalNode node; + private static WebConnector connector; + private static ByteArrayOutputStream logStream; + private static UserAgentImpl testAgent; + + /** + * Called before a test starts. + *

+ * Sets up the node, initializes connector and adds user agent that can be used throughout the test. + * + * @throws Exception + */ + @Before + public void startServer() throws Exception { + // start node + node = new LocalNodeManager().newNode(); + node.launch(); + + // add agent to node + testAgent = MockAgentFactory.getAdam(); + testAgent.unlock(testPass); // agents must be unlocked in order to be stored + node.storeAgent(testAgent); + + // start service + // during testing, the specified service version does not matter + node.startService(new ServiceNameVersion(BazaarService.class.getName(), testVersion), "a pass"); + + // start connector + connector = new WebConnector(true, 0, false, 0); // port 0 means use system defined port + logStream = new ByteArrayOutputStream(); + connector.setLogStream(new PrintStream(logStream)); + connector.start(node); + } + + /** + * Called after the test has finished. Shuts down the server and prints out the connector log file for reference. + * + * @throws Exception + */ + @After + public void shutDownServer() throws Exception { + if (connector != null) { + connector.stop(); + connector = null; + } + if (node != null) { + node.shutDown(); + node = null; + } + if (logStream != null) { + System.out.println("Connector-Log:"); + System.out.println("--------------"); + System.out.println(logStream.toString()); + logStream = null; + } + } + + MiniClient getClient() { + MiniClient client = new MiniClient(); + client.setConnectorEndpoint(connector.getHttpEndpoint()); + + client.setLogin(testAgent.getIdentifier(), testPass); + return client; + } +} From 656b19b5431900d069d8d948faf80e6c8a1002af Mon Sep 17 00:00:00 2001 From: Thore Date: Thu, 28 Jan 2021 02:14:18 +0100 Subject: [PATCH 032/134] Move migrations into resources path --- etc/{migrations => sample_data}/add_reqbaz_demo_data.sql | 0 etc/{migrations => sample_data}/add_reqbaz_demo_data_full.sql | 0 .../src/main/resources}/migrations/V1__create_reqbaz_schema.sql | 0 .../main/resources}/migrations/V2__user_las2peer_id_to_string.sql | 0 .../main/resources}/migrations/V3__add_personalisation_table.sql | 0 .../resources}/migrations/V4__add_personalisation_settings.sql | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename etc/{migrations => sample_data}/add_reqbaz_demo_data.sql (100%) rename etc/{migrations => sample_data}/add_reqbaz_demo_data_full.sql (100%) rename {etc => requirement_bazaar/src/main/resources}/migrations/V1__create_reqbaz_schema.sql (100%) rename {etc => requirement_bazaar/src/main/resources}/migrations/V2__user_las2peer_id_to_string.sql (100%) rename {etc => requirement_bazaar/src/main/resources}/migrations/V3__add_personalisation_table.sql (100%) rename {etc => requirement_bazaar/src/main/resources}/migrations/V4__add_personalisation_settings.sql (100%) diff --git a/etc/migrations/add_reqbaz_demo_data.sql b/etc/sample_data/add_reqbaz_demo_data.sql similarity index 100% rename from etc/migrations/add_reqbaz_demo_data.sql rename to etc/sample_data/add_reqbaz_demo_data.sql diff --git a/etc/migrations/add_reqbaz_demo_data_full.sql b/etc/sample_data/add_reqbaz_demo_data_full.sql similarity index 100% rename from etc/migrations/add_reqbaz_demo_data_full.sql rename to etc/sample_data/add_reqbaz_demo_data_full.sql diff --git a/etc/migrations/V1__create_reqbaz_schema.sql b/requirement_bazaar/src/main/resources/migrations/V1__create_reqbaz_schema.sql similarity index 100% rename from etc/migrations/V1__create_reqbaz_schema.sql rename to requirement_bazaar/src/main/resources/migrations/V1__create_reqbaz_schema.sql diff --git a/etc/migrations/V2__user_las2peer_id_to_string.sql b/requirement_bazaar/src/main/resources/migrations/V2__user_las2peer_id_to_string.sql similarity index 100% rename from etc/migrations/V2__user_las2peer_id_to_string.sql rename to requirement_bazaar/src/main/resources/migrations/V2__user_las2peer_id_to_string.sql diff --git a/etc/migrations/V3__add_personalisation_table.sql b/requirement_bazaar/src/main/resources/migrations/V3__add_personalisation_table.sql similarity index 100% rename from etc/migrations/V3__add_personalisation_table.sql rename to requirement_bazaar/src/main/resources/migrations/V3__add_personalisation_table.sql diff --git a/etc/migrations/V4__add_personalisation_settings.sql b/requirement_bazaar/src/main/resources/migrations/V4__add_personalisation_settings.sql similarity index 100% rename from etc/migrations/V4__add_personalisation_settings.sql rename to requirement_bazaar/src/main/resources/migrations/V4__add_personalisation_settings.sql From 0b7e027648b76e88699e93c2c1351a3c2cb8daf8 Mon Sep 17 00:00:00 2001 From: Thore Date: Thu, 28 Jan 2021 02:14:35 +0100 Subject: [PATCH 033/134] Back to java 14 --- gradle.properties | 3 +- requirement_bazaar/build.gradle | 6 +- requirement_bazaar/log/las2peer.log.0 | 441 ++++++++++++++++++ requirement_bazaar/log/service.log.0 | 27 ++ .../acis/bazaar/service/BazaarService.java | 3 +- .../acis/bazaar/service/CategoryResource.java | 4 +- .../acis/bazaar/service/ProjectsResource.java | 6 +- .../bazaar/service/dal/DALFacadeImpl.java | 26 +- .../bazaar/service/dal/entities/Project.java | 6 +- .../dbis/acis/bazaar/service/BazaarTest.java | 50 +- .../dbis/acis/bazaar/service/TestBase.java | 12 + 11 files changed, 555 insertions(+), 29 deletions(-) diff --git a/gradle.properties b/gradle.properties index 6b8b21b5..0b397fa2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ org.gradle.parallel=true -core.version=1.0.1 +core.version=1.1.0 service.name=RequirementsBazaar service.version=0.9.0 @@ -12,4 +12,3 @@ db.hostname=localhost db.user=root db.password=rootpw db.name=reqbaz - diff --git a/requirement_bazaar/build.gradle b/requirement_bazaar/build.gradle index 433212ad..a8fa7be0 100644 --- a/requirement_bazaar/build.gradle +++ b/requirement_bazaar/build.gradle @@ -26,7 +26,7 @@ group = 'de.rwth.dbis.acis.bazaar.service' archivesBaseName = group version = "${project.property('service.name')}" mainClassName = "de.rwth.dbis.acis.bazaar.service.BazaarService" -sourceCompatibility = 1.8 +sourceCompatibility = 14 repositories { // Use JCenter for resolving dependencies. @@ -50,8 +50,6 @@ dependencies { // This is for the jooq generation only jooqGenerator "mysql:mysql-connector-java:${project.property('mysql.version')}" jooqGenerator "org.jooq:jooq-codegen:${project.property('jooq.version')}" - - // These dependencies are used by the application. implementation "org.flywaydb:flyway-core:7.3.2" implementation 'com.google.code.gson:gson:2.8.6' implementation 'org.apache.commons:commons-pool2:2.9.0' @@ -149,7 +147,7 @@ flyway { schemas = ['reqbaz'] // Flyway now uses 'flyway_schema_history' to retain compatibility override this table = 'schema_version' - locations = ["filesystem:$project.projectDir/../etc/migrations"] + locations = ["filesystem:$project.projectDir/src/main/resources/migrations"] } generateJooq.dependsOn flywayMigrate diff --git a/requirement_bazaar/log/las2peer.log.0 b/requirement_bazaar/log/las2peer.log.0 index c411e8e8..5e7a2717 100644 --- a/requirement_bazaar/log/las2peer.log.0 +++ b/requirement_bazaar/log/las2peer.log.0 @@ -195,3 +195,444 @@ javax.ws.rs.NotFoundException: Could not resolve /activities/version to a servic 2021 Jan 17 04:02:43 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -707842752454908406 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped 2021 Jan 17 04:02:43 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -707842752454908406 (java.lang.Long) a8a219b94e6a30122e959785a434cea38001e6f96c7a89a5a26ac4d7b8ce037625cd2680099b2f14195ec43972d32fe326e15513ba01a8c7daf63407136aaee4 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 2021 Jan 17 04:02:43 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -707842752454908406 (java.lang.Long) - - - - +2021 Jan 24 16:24:10 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 24 16:24:10 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 24 16:24:10 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -3535148000172925747 (java.lang.Long) e5c665821ef713e7dbae64c8e15dcc372e70f63e54a55236c3ca1819a85c6f4a01c865716e3d50468cbe78f96a29e558240c0cd5b3dfcf3739e3507a9ef8f46f - - ServiceAgent +2021 Jan 24 16:24:11 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -3535148000172925747 (java.lang.Long) e5c665821ef713e7dbae64c8e15dcc372e70f63e54a55236c3ca1819a85c6f4a01c865716e3d50468cbe78f96a29e558240c0cd5b3dfcf3739e3507a9ef8f46f - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 24 16:24:11 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -3535148000172925747 (java.lang.Long) e5c665821ef713e7dbae64c8e15dcc372e70f63e54a55236c3ca1819a85c6f4a01c865716e3d50468cbe78f96a29e558240c0cd5b3dfcf3739e3507a9ef8f46f - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 16:24:11 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:46573 +2021 Jan 24 16:24:11 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -3535148000172925747 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:46573 +2021 Jan 24 16:24:11 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 24 16:24:11 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 24 16:24:11 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 24 16:24:11 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 24 16:24:11 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -3535148000172925747 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 24 16:24:11 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -3535148000172925747 (java.lang.Long) e5c665821ef713e7dbae64c8e15dcc372e70f63e54a55236c3ca1819a85c6f4a01c865716e3d50468cbe78f96a29e558240c0cd5b3dfcf3739e3507a9ef8f46f - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 16:24:11 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -3535148000172925747 (java.lang.Long) - - - - +2021 Jan 24 16:25:05 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 24 16:25:05 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 24 16:25:05 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 1730927054864188658 (java.lang.Long) ab0bc5c898ab3722a5b1d28c9ff970c25cde54b9cbe50b9b9d4248030116150f4c4f98a5d9208bb63f3be86e4bd741cb6c16a2dbeab62c1b54c153a375b6183f - - ServiceAgent +2021 Jan 24 16:25:06 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 1730927054864188658 (java.lang.Long) ab0bc5c898ab3722a5b1d28c9ff970c25cde54b9cbe50b9b9d4248030116150f4c4f98a5d9208bb63f3be86e4bd741cb6c16a2dbeab62c1b54c153a375b6183f - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 24 16:25:06 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 1730927054864188658 (java.lang.Long) ab0bc5c898ab3722a5b1d28c9ff970c25cde54b9cbe50b9b9d4248030116150f4c4f98a5d9208bb63f3be86e4bd741cb6c16a2dbeab62c1b54c153a375b6183f - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 16:25:07 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:43925 +2021 Jan 24 16:25:07 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 1730927054864188658 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:43925 +2021 Jan 24 16:25:07 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 24 16:25:07 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 24 16:25:07 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 24 16:25:07 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 24 16:25:07 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 1730927054864188658 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 24 16:25:07 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 1730927054864188658 (java.lang.Long) ab0bc5c898ab3722a5b1d28c9ff970c25cde54b9cbe50b9b9d4248030116150f4c4f98a5d9208bb63f3be86e4bd741cb6c16a2dbeab62c1b54c153a375b6183f - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 16:25:07 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 1730927054864188658 (java.lang.Long) - - - - +2021 Jan 24 16:31:12 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 24 16:31:12 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 24 16:31:13 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 2592049687788073295 (java.lang.Long) 39566f0ba4da3ade72582ca997dc0473ce96af72f0a8e254f51c4e710ee1d265dda4cfdd9714a3cc20139f39e014862a1aacd49891f9e5d452634d49f8ba8f8e - - ServiceAgent +2021 Jan 24 16:31:13 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 2592049687788073295 (java.lang.Long) 39566f0ba4da3ade72582ca997dc0473ce96af72f0a8e254f51c4e710ee1d265dda4cfdd9714a3cc20139f39e014862a1aacd49891f9e5d452634d49f8ba8f8e - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 24 16:31:13 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 2592049687788073295 (java.lang.Long) 39566f0ba4da3ade72582ca997dc0473ce96af72f0a8e254f51c4e710ee1d265dda4cfdd9714a3cc20139f39e014862a1aacd49891f9e5d452634d49f8ba8f8e - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 16:31:14 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:40691 +2021 Jan 24 16:31:14 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 2592049687788073295 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:40691 +2021 Jan 24 16:31:14 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 24 16:31:14 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 24 16:31:14 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 24 16:31:17 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! +2021 Jan 24 16:31:17 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_55 (7555) 2592049687788073295 (java.lang.Long) 39566f0ba4da3ade72582ca997dc0473ce96af72f0a8e254f51c4e710ee1d265dda4cfdd9714a3cc20139f39e014862a1aacd49891f9e5d452634d49f8ba8f8e - - {"user":{"id":2}} +2021 Jan 24 16:31:17 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_3 (7503) 2592049687788073295 (java.lang.Long) 39566f0ba4da3ade72582ca997dc0473ce96af72f0a8e254f51c4e710ee1d265dda4cfdd9714a3cc20139f39e014862a1aacd49891f9e5d452634d49f8ba8f8e - - {"user":{"id":2}} +2021 Jan 24 16:31:17 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 24 16:31:17 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 2592049687788073295 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 24 16:31:17 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 2592049687788073295 (java.lang.Long) 39566f0ba4da3ade72582ca997dc0473ce96af72f0a8e254f51c4e710ee1d265dda4cfdd9714a3cc20139f39e014862a1aacd49891f9e5d452634d49f8ba8f8e - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 16:31:17 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 2592049687788073295 (java.lang.Long) - - - - +2021 Jan 24 17:23:01 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 24 17:23:01 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 24 17:23:02 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -8335149968131132194 (java.lang.Long) 10f394b5c1942fe7135093d0fbff6d004c9ab232e0924cc09cc89c690275f012297f1c5c0cf976abb4fb76a5ea882d9e3a527e3c9eec551864139d77032f968e - - ServiceAgent +2021 Jan 24 17:23:02 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -8335149968131132194 (java.lang.Long) 10f394b5c1942fe7135093d0fbff6d004c9ab232e0924cc09cc89c690275f012297f1c5c0cf976abb4fb76a5ea882d9e3a527e3c9eec551864139d77032f968e - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 24 17:23:02 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -8335149968131132194 (java.lang.Long) 10f394b5c1942fe7135093d0fbff6d004c9ab232e0924cc09cc89c690275f012297f1c5c0cf976abb4fb76a5ea882d9e3a527e3c9eec551864139d77032f968e - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 17:23:03 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:38417 +2021 Jan 24 17:23:03 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -8335149968131132194 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:38417 +2021 Jan 24 17:23:03 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 24 17:23:03 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 24 17:23:03 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 24 17:23:04 FINER i5.las2peer.p2p.LocalNode: SERVICE_ERROR (-7500) -8335149968131132194 (java.lang.Long) 10f394b5c1942fe7135093d0fbff6d004c9ab232e0924cc09cc89c690275f012297f1c5c0cf976abb4fb76a5ea882d9e3a527e3c9eec551864139d77032f968e - - Create project +2021 Jan 24 17:23:04 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 24 17:23:04 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -8335149968131132194 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 24 17:23:04 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -8335149968131132194 (java.lang.Long) 10f394b5c1942fe7135093d0fbff6d004c9ab232e0924cc09cc89c690275f012297f1c5c0cf976abb4fb76a5ea882d9e3a527e3c9eec551864139d77032f968e - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 17:23:04 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -8335149968131132194 (java.lang.Long) - - - - +2021 Jan 24 17:25:26 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 24 17:25:26 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 24 17:25:26 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -8483227742122078455 (java.lang.Long) 296f75fdf619c9803a52ed6feb3c207323df89f38acae82e5a10947f8bef235467765fd58fe8b4893b647923184d87e974e02207bef184f3de2eedc23a980c20 - - ServiceAgent +2021 Jan 24 17:25:27 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -8483227742122078455 (java.lang.Long) 296f75fdf619c9803a52ed6feb3c207323df89f38acae82e5a10947f8bef235467765fd58fe8b4893b647923184d87e974e02207bef184f3de2eedc23a980c20 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 24 17:25:27 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -8483227742122078455 (java.lang.Long) 296f75fdf619c9803a52ed6feb3c207323df89f38acae82e5a10947f8bef235467765fd58fe8b4893b647923184d87e974e02207bef184f3de2eedc23a980c20 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 17:25:28 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:43235 +2021 Jan 24 17:25:28 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -8483227742122078455 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:43235 +2021 Jan 24 17:25:28 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 24 17:25:28 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 24 17:25:28 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 24 17:25:29 FINER i5.las2peer.p2p.LocalNode: SERVICE_ERROR (-7500) -8483227742122078455 (java.lang.Long) 296f75fdf619c9803a52ed6feb3c207323df89f38acae82e5a10947f8bef235467765fd58fe8b4893b647923184d87e974e02207bef184f3de2eedc23a980c20 - - Create project +2021 Jan 24 17:25:29 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 24 17:25:29 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -8483227742122078455 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 24 17:25:29 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -8483227742122078455 (java.lang.Long) 296f75fdf619c9803a52ed6feb3c207323df89f38acae82e5a10947f8bef235467765fd58fe8b4893b647923184d87e974e02207bef184f3de2eedc23a980c20 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 17:25:29 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -8483227742122078455 (java.lang.Long) - - - - +2021 Jan 24 17:36:28 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 24 17:36:28 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 24 17:36:28 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 3663258393979825028 (java.lang.Long) a066a2dfdd30f5afcff92907f5dd6452d8c5d017f6759c42e46b53eb90e65eeda530240bbbaa421e9bf0d9efc7f557265cec224d43a91483d9e4fed863a1c3f0 - - ServiceAgent +2021 Jan 24 17:36:29 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 3663258393979825028 (java.lang.Long) a066a2dfdd30f5afcff92907f5dd6452d8c5d017f6759c42e46b53eb90e65eeda530240bbbaa421e9bf0d9efc7f557265cec224d43a91483d9e4fed863a1c3f0 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 24 17:36:29 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 3663258393979825028 (java.lang.Long) a066a2dfdd30f5afcff92907f5dd6452d8c5d017f6759c42e46b53eb90e65eeda530240bbbaa421e9bf0d9efc7f557265cec224d43a91483d9e4fed863a1c3f0 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 17:36:29 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:37991 +2021 Jan 24 17:36:29 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 3663258393979825028 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:37991 +2021 Jan 24 17:36:30 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 24 17:36:30 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 24 17:36:30 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 24 17:42:04 FINER i5.las2peer.p2p.LocalNode: SERVICE_ERROR (-7500) 3663258393979825028 (java.lang.Long) a066a2dfdd30f5afcff92907f5dd6452d8c5d017f6759c42e46b53eb90e65eeda530240bbbaa421e9bf0d9efc7f557265cec224d43a91483d9e4fed863a1c3f0 - - Create project +2021 Jan 24 17:42:04 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 24 17:42:04 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 3663258393979825028 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 24 17:42:04 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 3663258393979825028 (java.lang.Long) a066a2dfdd30f5afcff92907f5dd6452d8c5d017f6759c42e46b53eb90e65eeda530240bbbaa421e9bf0d9efc7f557265cec224d43a91483d9e4fed863a1c3f0 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 17:42:04 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 3663258393979825028 (java.lang.Long) - - - - +2021 Jan 24 17:42:25 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 24 17:42:25 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 24 17:42:25 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 4834079535588350955 (java.lang.Long) 1749d64c855a27346490b8ec5b45c7a474ac082abec5f1568b29e2a3868224f6d245aef8b4b693a4156b999c6835d57384fb802de98a34542222d5ce29c253ab - - ServiceAgent +2021 Jan 24 17:42:26 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 4834079535588350955 (java.lang.Long) 1749d64c855a27346490b8ec5b45c7a474ac082abec5f1568b29e2a3868224f6d245aef8b4b693a4156b999c6835d57384fb802de98a34542222d5ce29c253ab - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 24 17:42:26 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 4834079535588350955 (java.lang.Long) 1749d64c855a27346490b8ec5b45c7a474ac082abec5f1568b29e2a3868224f6d245aef8b4b693a4156b999c6835d57384fb802de98a34542222d5ce29c253ab - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 17:42:27 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:46115 +2021 Jan 24 17:42:27 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 4834079535588350955 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:46115 +2021 Jan 24 17:42:27 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 24 17:42:27 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 24 17:42:27 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 24 17:44:29 FINER i5.las2peer.p2p.LocalNode: SERVICE_ERROR (-7500) 4834079535588350955 (java.lang.Long) 1749d64c855a27346490b8ec5b45c7a474ac082abec5f1568b29e2a3868224f6d245aef8b4b693a4156b999c6835d57384fb802de98a34542222d5ce29c253ab - - Create project +2021 Jan 24 17:44:29 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 24 17:44:29 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 4834079535588350955 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 24 17:44:29 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 4834079535588350955 (java.lang.Long) 1749d64c855a27346490b8ec5b45c7a474ac082abec5f1568b29e2a3868224f6d245aef8b4b693a4156b999c6835d57384fb802de98a34542222d5ce29c253ab - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 17:44:29 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 4834079535588350955 (java.lang.Long) - - - - +2021 Jan 24 17:44:35 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 24 17:44:35 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 24 17:44:35 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -141896451122989663 (java.lang.Long) c97e2aae315ffadffa71bf2890a112c9705dab2544d84059087e445363f828ef332436389bc402b771d13556213ee953b3197c742412a7f6934cf2c562ebdae5 - - ServiceAgent +2021 Jan 24 17:44:36 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -141896451122989663 (java.lang.Long) c97e2aae315ffadffa71bf2890a112c9705dab2544d84059087e445363f828ef332436389bc402b771d13556213ee953b3197c742412a7f6934cf2c562ebdae5 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 24 17:44:36 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -141896451122989663 (java.lang.Long) c97e2aae315ffadffa71bf2890a112c9705dab2544d84059087e445363f828ef332436389bc402b771d13556213ee953b3197c742412a7f6934cf2c562ebdae5 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 17:44:37 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:43045 +2021 Jan 24 17:44:37 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -141896451122989663 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:43045 +2021 Jan 24 17:44:37 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 24 17:44:37 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 24 17:44:37 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 24 17:45:38 FINER i5.las2peer.p2p.LocalNode: SERVICE_ERROR (-7500) -141896451122989663 (java.lang.Long) c97e2aae315ffadffa71bf2890a112c9705dab2544d84059087e445363f828ef332436389bc402b771d13556213ee953b3197c742412a7f6934cf2c562ebdae5 - - Create project +2021 Jan 24 17:45:48 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 24 17:45:48 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -141896451122989663 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 24 17:45:48 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -141896451122989663 (java.lang.Long) c97e2aae315ffadffa71bf2890a112c9705dab2544d84059087e445363f828ef332436389bc402b771d13556213ee953b3197c742412a7f6934cf2c562ebdae5 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 17:45:48 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -141896451122989663 (java.lang.Long) - - - - +2021 Jan 24 18:25:28 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 24 18:25:28 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 24 18:25:29 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 4379388327573918888 (java.lang.Long) cae10332bb9c9bbfc43e882d1a6a4e9cd08a3c6bbf19a19982090e47943ea8c620ab93ed6571736f7a0eb0fa81023183612bcebd3866cce9480f12e82bea3050 - - ServiceAgent +2021 Jan 24 18:25:29 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 4379388327573918888 (java.lang.Long) cae10332bb9c9bbfc43e882d1a6a4e9cd08a3c6bbf19a19982090e47943ea8c620ab93ed6571736f7a0eb0fa81023183612bcebd3866cce9480f12e82bea3050 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 24 18:25:29 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 4379388327573918888 (java.lang.Long) cae10332bb9c9bbfc43e882d1a6a4e9cd08a3c6bbf19a19982090e47943ea8c620ab93ed6571736f7a0eb0fa81023183612bcebd3866cce9480f12e82bea3050 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 18:25:30 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:43873 +2021 Jan 24 18:25:30 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 4379388327573918888 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:43873 +2021 Jan 24 18:25:30 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 24 18:25:30 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 24 18:25:30 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 24 18:25:31 FINER i5.las2peer.p2p.LocalNode: SERVICE_ERROR (-7500) 4379388327573918888 (java.lang.Long) cae10332bb9c9bbfc43e882d1a6a4e9cd08a3c6bbf19a19982090e47943ea8c620ab93ed6571736f7a0eb0fa81023183612bcebd3866cce9480f12e82bea3050 - - Create project +2021 Jan 24 18:25:31 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 24 18:25:31 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 4379388327573918888 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 24 18:25:31 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 4379388327573918888 (java.lang.Long) cae10332bb9c9bbfc43e882d1a6a4e9cd08a3c6bbf19a19982090e47943ea8c620ab93ed6571736f7a0eb0fa81023183612bcebd3866cce9480f12e82bea3050 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 18:25:31 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 4379388327573918888 (java.lang.Long) - - - - +2021 Jan 24 18:29:59 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 24 18:29:59 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 24 18:29:59 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 3710581509298365681 (java.lang.Long) ec00ffe74126c3feb5ff606afb657ec7ee0f88a2a19d8628b5d0e5990cd81915f4045e5baf00c3335e15c38607ec70a53d7065f7a9cc8723fdac86d04becf490 - - ServiceAgent +2021 Jan 24 18:30:00 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 3710581509298365681 (java.lang.Long) ec00ffe74126c3feb5ff606afb657ec7ee0f88a2a19d8628b5d0e5990cd81915f4045e5baf00c3335e15c38607ec70a53d7065f7a9cc8723fdac86d04becf490 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 24 18:30:00 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 3710581509298365681 (java.lang.Long) ec00ffe74126c3feb5ff606afb657ec7ee0f88a2a19d8628b5d0e5990cd81915f4045e5baf00c3335e15c38607ec70a53d7065f7a9cc8723fdac86d04becf490 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 18:30:00 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:35437 +2021 Jan 24 18:30:00 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 3710581509298365681 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:35437 +2021 Jan 24 18:30:00 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 24 18:30:00 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 24 18:30:00 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 24 18:30:42 FINER i5.las2peer.p2p.LocalNode: SERVICE_ERROR (-7500) 3710581509298365681 (java.lang.Long) ec00ffe74126c3feb5ff606afb657ec7ee0f88a2a19d8628b5d0e5990cd81915f4045e5baf00c3335e15c38607ec70a53d7065f7a9cc8723fdac86d04becf490 - - Create project +2021 Jan 24 18:31:48 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 24 18:31:48 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 3710581509298365681 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 24 18:31:48 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 3710581509298365681 (java.lang.Long) ec00ffe74126c3feb5ff606afb657ec7ee0f88a2a19d8628b5d0e5990cd81915f4045e5baf00c3335e15c38607ec70a53d7065f7a9cc8723fdac86d04becf490 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 18:31:48 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 3710581509298365681 (java.lang.Long) - - - - +2021 Jan 24 18:32:00 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 24 18:32:00 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 24 18:32:00 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 2732338442939902719 (java.lang.Long) 6900135dab5c6438d12e36cd41cf2d5841dcc1f817df4cdac5c34a7817e0dbbf14c8b24a2d7efa981bb1860ab84abc023a393da4a7471e27c31c6b3b08224310 - - ServiceAgent +2021 Jan 24 18:32:01 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 2732338442939902719 (java.lang.Long) 6900135dab5c6438d12e36cd41cf2d5841dcc1f817df4cdac5c34a7817e0dbbf14c8b24a2d7efa981bb1860ab84abc023a393da4a7471e27c31c6b3b08224310 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 24 18:32:01 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 2732338442939902719 (java.lang.Long) 6900135dab5c6438d12e36cd41cf2d5841dcc1f817df4cdac5c34a7817e0dbbf14c8b24a2d7efa981bb1860ab84abc023a393da4a7471e27c31c6b3b08224310 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 18:32:02 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:45551 +2021 Jan 24 18:32:02 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 2732338442939902719 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:45551 +2021 Jan 24 18:32:02 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 24 18:32:02 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 24 18:32:02 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 24 18:33:41 FINER i5.las2peer.p2p.LocalNode: SERVICE_ERROR (-7500) 2732338442939902719 (java.lang.Long) 6900135dab5c6438d12e36cd41cf2d5841dcc1f817df4cdac5c34a7817e0dbbf14c8b24a2d7efa981bb1860ab84abc023a393da4a7471e27c31c6b3b08224310 - - Create project +2021 Jan 24 18:34:17 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 24 18:34:17 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 2732338442939902719 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 24 18:34:17 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 2732338442939902719 (java.lang.Long) 6900135dab5c6438d12e36cd41cf2d5841dcc1f817df4cdac5c34a7817e0dbbf14c8b24a2d7efa981bb1860ab84abc023a393da4a7471e27c31c6b3b08224310 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 18:34:17 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 2732338442939902719 (java.lang.Long) - - - - +2021 Jan 24 18:43:59 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 24 18:43:59 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 24 18:43:59 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -9160309062668269239 (java.lang.Long) f08001f321a3018c57bfc815f65969abb97322140c109f3db3b3ce4bc47e34e1c2e457b2b2ed6ddb81cf55271b127493c7904bb8f0c91b62ee281061e937cae8 - - ServiceAgent +2021 Jan 24 18:44:00 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -9160309062668269239 (java.lang.Long) f08001f321a3018c57bfc815f65969abb97322140c109f3db3b3ce4bc47e34e1c2e457b2b2ed6ddb81cf55271b127493c7904bb8f0c91b62ee281061e937cae8 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 24 18:44:00 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -9160309062668269239 (java.lang.Long) f08001f321a3018c57bfc815f65969abb97322140c109f3db3b3ce4bc47e34e1c2e457b2b2ed6ddb81cf55271b127493c7904bb8f0c91b62ee281061e937cae8 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 18:44:01 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:38035 +2021 Jan 24 18:44:01 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -9160309062668269239 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:38035 +2021 Jan 24 18:44:01 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 24 18:44:01 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 24 18:44:01 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 24 20:28:22 FINER i5.las2peer.p2p.LocalNode: SERVICE_ERROR (-7500) -9160309062668269239 (java.lang.Long) f08001f321a3018c57bfc815f65969abb97322140c109f3db3b3ce4bc47e34e1c2e457b2b2ed6ddb81cf55271b127493c7904bb8f0c91b62ee281061e937cae8 - - Create project +2021 Jan 24 20:28:22 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 24 20:28:22 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -9160309062668269239 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 24 20:28:22 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -9160309062668269239 (java.lang.Long) f08001f321a3018c57bfc815f65969abb97322140c109f3db3b3ce4bc47e34e1c2e457b2b2ed6ddb81cf55271b127493c7904bb8f0c91b62ee281061e937cae8 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 20:28:22 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -9160309062668269239 (java.lang.Long) - - - - +2021 Jan 24 20:54:31 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 24 20:54:31 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 24 20:54:31 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 7702652481531784330 (java.lang.Long) 682d531cf63c6d998d2ce669b9e2129583bb915e8e1b2e1cb6a5efe4b93add79d8d00b10ba31ecc6111e89f060a95aac238bffac3bfd02573a4072806c7e5203 - - ServiceAgent +2021 Jan 24 20:54:32 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 7702652481531784330 (java.lang.Long) 682d531cf63c6d998d2ce669b9e2129583bb915e8e1b2e1cb6a5efe4b93add79d8d00b10ba31ecc6111e89f060a95aac238bffac3bfd02573a4072806c7e5203 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 24 20:54:32 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 7702652481531784330 (java.lang.Long) 682d531cf63c6d998d2ce669b9e2129583bb915e8e1b2e1cb6a5efe4b93add79d8d00b10ba31ecc6111e89f060a95aac238bffac3bfd02573a4072806c7e5203 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 20:54:32 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:39333 +2021 Jan 24 20:54:32 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 7702652481531784330 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:39333 +2021 Jan 24 20:54:32 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 24 20:54:32 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 24 20:54:32 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 24 20:59:14 FINER i5.las2peer.p2p.LocalNode: SERVICE_ERROR (-7500) 7702652481531784330 (java.lang.Long) 682d531cf63c6d998d2ce669b9e2129583bb915e8e1b2e1cb6a5efe4b93add79d8d00b10ba31ecc6111e89f060a95aac238bffac3bfd02573a4072806c7e5203 - - Create project +2021 Jan 24 20:59:14 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 24 20:59:14 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 7702652481531784330 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 24 20:59:14 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 7702652481531784330 (java.lang.Long) 682d531cf63c6d998d2ce669b9e2129583bb915e8e1b2e1cb6a5efe4b93add79d8d00b10ba31ecc6111e89f060a95aac238bffac3bfd02573a4072806c7e5203 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 20:59:14 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 7702652481531784330 (java.lang.Long) - - - - +2021 Jan 24 20:59:34 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 24 20:59:34 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 24 20:59:34 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -1138992984511192225 (java.lang.Long) 3f901cb7304e78676600f42a66bffcfb4a93227b8f3bf0526f45140432d68321f04d9316d381a67f49251e71747e3ab67a19d57d3fb1e0515238c8f9dd5037bd - - ServiceAgent +2021 Jan 24 20:59:35 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -1138992984511192225 (java.lang.Long) 3f901cb7304e78676600f42a66bffcfb4a93227b8f3bf0526f45140432d68321f04d9316d381a67f49251e71747e3ab67a19d57d3fb1e0515238c8f9dd5037bd - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 24 20:59:35 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -1138992984511192225 (java.lang.Long) 3f901cb7304e78676600f42a66bffcfb4a93227b8f3bf0526f45140432d68321f04d9316d381a67f49251e71747e3ab67a19d57d3fb1e0515238c8f9dd5037bd - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 20:59:35 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:37737 +2021 Jan 24 20:59:35 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -1138992984511192225 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:37737 +2021 Jan 24 20:59:35 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 24 20:59:35 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 24 20:59:35 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 24 21:05:40 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 24 21:05:40 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 24 21:05:41 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -5367634581475145353 (java.lang.Long) da6507e341d53c36311b54d4eacb69e9244f45f8d2e2bb04de4f40903d3e5d0e1862c0f6e264c103735e41db2d3a4633749ad794e49f492ee1a456cfc4569bbd - - ServiceAgent +2021 Jan 24 21:05:42 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -5367634581475145353 (java.lang.Long) da6507e341d53c36311b54d4eacb69e9244f45f8d2e2bb04de4f40903d3e5d0e1862c0f6e264c103735e41db2d3a4633749ad794e49f492ee1a456cfc4569bbd - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 24 21:05:42 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -5367634581475145353 (java.lang.Long) da6507e341d53c36311b54d4eacb69e9244f45f8d2e2bb04de4f40903d3e5d0e1862c0f6e264c103735e41db2d3a4633749ad794e49f492ee1a456cfc4569bbd - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 21:05:42 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:43337 +2021 Jan 24 21:05:42 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -5367634581475145353 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:43337 +2021 Jan 24 21:05:42 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 24 21:05:42 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 24 21:05:42 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 24 21:07:47 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! +2021 Jan 24 21:07:47 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_5 (7505) -5367634581475145353 (java.lang.Long) da6507e341d53c36311b54d4eacb69e9244f45f8d2e2bb04de4f40903d3e5d0e1862c0f6e264c103735e41db2d3a4633749ad794e49f492ee1a456cfc4569bbd - - {"project":{"id":1,"name":"Test Project"},"user":{"id":2}} +2021 Jan 24 21:07:48 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 24 21:07:48 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -5367634581475145353 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 24 21:07:48 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -5367634581475145353 (java.lang.Long) da6507e341d53c36311b54d4eacb69e9244f45f8d2e2bb04de4f40903d3e5d0e1862c0f6e264c103735e41db2d3a4633749ad794e49f492ee1a456cfc4569bbd - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 21:07:48 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -5367634581475145353 (java.lang.Long) - - - - +2021 Jan 24 21:15:45 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 24 21:15:45 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 24 21:15:46 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -9092528362610730871 (java.lang.Long) 2d3f5767ae227d97aa39d613b839919a8cfb1b4e2f458f0a164f4453e701aa38771bc33cdb9e88a612d4a42f273e6eb06edcad09c017366c45917d4d2c319337 - - ServiceAgent +2021 Jan 24 21:15:47 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -9092528362610730871 (java.lang.Long) 2d3f5767ae227d97aa39d613b839919a8cfb1b4e2f458f0a164f4453e701aa38771bc33cdb9e88a612d4a42f273e6eb06edcad09c017366c45917d4d2c319337 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 24 21:15:47 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -9092528362610730871 (java.lang.Long) 2d3f5767ae227d97aa39d613b839919a8cfb1b4e2f458f0a164f4453e701aa38771bc33cdb9e88a612d4a42f273e6eb06edcad09c017366c45917d4d2c319337 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 21:15:47 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:40027 +2021 Jan 24 21:15:47 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -9092528362610730871 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:40027 +2021 Jan 24 21:15:47 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 24 21:15:47 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 24 21:15:47 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 24 21:19:59 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! +2021 Jan 24 21:19:59 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_5 (7505) -9092528362610730871 (java.lang.Long) 2d3f5767ae227d97aa39d613b839919a8cfb1b4e2f458f0a164f4453e701aa38771bc33cdb9e88a612d4a42f273e6eb06edcad09c017366c45917d4d2c319337 - - {"project":{"id":2,"name":"Test Project"},"user":{"id":2}} +2021 Jan 24 21:21:27 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 24 21:21:27 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -9092528362610730871 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 24 21:21:27 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -9092528362610730871 (java.lang.Long) 2d3f5767ae227d97aa39d613b839919a8cfb1b4e2f458f0a164f4453e701aa38771bc33cdb9e88a612d4a42f273e6eb06edcad09c017366c45917d4d2c319337 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 21:21:27 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -9092528362610730871 (java.lang.Long) - - - - +2021 Jan 24 21:22:53 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 24 21:22:53 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 24 21:22:53 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 1343330722104043295 (java.lang.Long) 897eb314f53353aa2cbbed48ee39bb6b15d75eaf6f240113f49e40ea5b02473d53d4162a25de274bb7bee973b5fa07ce77fa96529440b0399f6d699723bb502e - - ServiceAgent +2021 Jan 24 21:22:54 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 1343330722104043295 (java.lang.Long) 897eb314f53353aa2cbbed48ee39bb6b15d75eaf6f240113f49e40ea5b02473d53d4162a25de274bb7bee973b5fa07ce77fa96529440b0399f6d699723bb502e - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 24 21:22:54 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 1343330722104043295 (java.lang.Long) 897eb314f53353aa2cbbed48ee39bb6b15d75eaf6f240113f49e40ea5b02473d53d4162a25de274bb7bee973b5fa07ce77fa96529440b0399f6d699723bb502e - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 21:22:55 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:34555 +2021 Jan 24 21:22:55 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 1343330722104043295 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:34555 +2021 Jan 24 21:22:55 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 24 21:22:55 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 24 21:22:55 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 24 21:22:58 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! +2021 Jan 24 21:22:58 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_5 (7505) 1343330722104043295 (java.lang.Long) 897eb314f53353aa2cbbed48ee39bb6b15d75eaf6f240113f49e40ea5b02473d53d4162a25de274bb7bee973b5fa07ce77fa96529440b0399f6d699723bb502e - - {"project":{"id":3,"name":"Test Project"},"user":{"id":2}} +2021 Jan 24 21:22:58 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 24 21:22:58 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 1343330722104043295 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 24 21:22:58 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 1343330722104043295 (java.lang.Long) 897eb314f53353aa2cbbed48ee39bb6b15d75eaf6f240113f49e40ea5b02473d53d4162a25de274bb7bee973b5fa07ce77fa96529440b0399f6d699723bb502e - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 21:22:58 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 1343330722104043295 (java.lang.Long) - - - - +2021 Jan 24 21:23:58 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 24 21:23:58 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 24 21:23:58 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -6964921055090057937 (java.lang.Long) 2ffee52822ddd07a14930011ea1c5b1c6f9902e5f6dda8b9d6ca0aa4f4e597a9aed69c50d01783c8dd42f1b81974627d82f8166da16ee1547867358478534540 - - ServiceAgent +2021 Jan 24 21:23:59 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -6964921055090057937 (java.lang.Long) 2ffee52822ddd07a14930011ea1c5b1c6f9902e5f6dda8b9d6ca0aa4f4e597a9aed69c50d01783c8dd42f1b81974627d82f8166da16ee1547867358478534540 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 24 21:23:59 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -6964921055090057937 (java.lang.Long) 2ffee52822ddd07a14930011ea1c5b1c6f9902e5f6dda8b9d6ca0aa4f4e597a9aed69c50d01783c8dd42f1b81974627d82f8166da16ee1547867358478534540 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 21:23:59 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:44833 +2021 Jan 24 21:23:59 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -6964921055090057937 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:44833 +2021 Jan 24 21:23:59 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 24 21:23:59 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 24 21:23:59 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 24 21:24:02 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! +2021 Jan 24 21:24:02 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_5 (7505) -6964921055090057937 (java.lang.Long) 2ffee52822ddd07a14930011ea1c5b1c6f9902e5f6dda8b9d6ca0aa4f4e597a9aed69c50d01783c8dd42f1b81974627d82f8166da16ee1547867358478534540 - - {"project":{"id":4,"name":"Test Project"},"user":{"id":2}} +2021 Jan 24 21:24:03 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 24 21:24:03 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -6964921055090057937 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 24 21:24:03 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -6964921055090057937 (java.lang.Long) 2ffee52822ddd07a14930011ea1c5b1c6f9902e5f6dda8b9d6ca0aa4f4e597a9aed69c50d01783c8dd42f1b81974627d82f8166da16ee1547867358478534540 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 21:24:03 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -6964921055090057937 (java.lang.Long) - - - - +2021 Jan 24 22:42:42 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 24 22:42:42 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 24 22:42:42 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -2345002620162797745 (java.lang.Long) e148fa14e2d5b98bb361d087136f7bf180fc18706d381b867463bc1b41f613ddcfac56387816d22ee13c09bec414954bc2c2a8d5d176ffdfb40b0be7e5ffd269 - - ServiceAgent +2021 Jan 24 22:42:43 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -2345002620162797745 (java.lang.Long) e148fa14e2d5b98bb361d087136f7bf180fc18706d381b867463bc1b41f613ddcfac56387816d22ee13c09bec414954bc2c2a8d5d176ffdfb40b0be7e5ffd269 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 24 22:42:43 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -2345002620162797745 (java.lang.Long) e148fa14e2d5b98bb361d087136f7bf180fc18706d381b867463bc1b41f613ddcfac56387816d22ee13c09bec414954bc2c2a8d5d176ffdfb40b0be7e5ffd269 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 22:42:43 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:44199 +2021 Jan 24 22:42:43 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -2345002620162797745 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:44199 +2021 Jan 24 22:42:43 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 24 22:42:43 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 24 22:42:43 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 24 22:42:44 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_3 (7503) -2345002620162797745 (java.lang.Long) e148fa14e2d5b98bb361d087136f7bf180fc18706d381b867463bc1b41f613ddcfac56387816d22ee13c09bec414954bc2c2a8d5d176ffdfb40b0be7e5ffd269 - - {"user":{"id":2}} +2021 Jan 24 22:42:44 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 24 22:42:44 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -2345002620162797745 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 24 22:42:44 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -2345002620162797745 (java.lang.Long) e148fa14e2d5b98bb361d087136f7bf180fc18706d381b867463bc1b41f613ddcfac56387816d22ee13c09bec414954bc2c2a8d5d176ffdfb40b0be7e5ffd269 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 22:42:44 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -2345002620162797745 (java.lang.Long) - - - - +2021 Jan 24 22:44:08 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 24 22:44:08 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 24 22:44:08 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -8218642141943480738 (java.lang.Long) 0cefdafae713e9d75ae6a928349843d200888f4f923b7c41789dffac1d4c9a8e95f4a84bdae6402e0631e991af2567e0fa40a9d5b55a694cb2b27b19333e38ee - - ServiceAgent +2021 Jan 24 22:44:09 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -8218642141943480738 (java.lang.Long) 0cefdafae713e9d75ae6a928349843d200888f4f923b7c41789dffac1d4c9a8e95f4a84bdae6402e0631e991af2567e0fa40a9d5b55a694cb2b27b19333e38ee - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 24 22:44:09 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -8218642141943480738 (java.lang.Long) 0cefdafae713e9d75ae6a928349843d200888f4f923b7c41789dffac1d4c9a8e95f4a84bdae6402e0631e991af2567e0fa40a9d5b55a694cb2b27b19333e38ee - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 22:44:09 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:40407 +2021 Jan 24 22:44:09 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -8218642141943480738 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:40407 +2021 Jan 24 22:44:09 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 24 22:44:09 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 24 22:44:09 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 24 22:44:10 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_3 (7503) -8218642141943480738 (java.lang.Long) 0cefdafae713e9d75ae6a928349843d200888f4f923b7c41789dffac1d4c9a8e95f4a84bdae6402e0631e991af2567e0fa40a9d5b55a694cb2b27b19333e38ee - - {"user":{"id":2}} +2021 Jan 24 22:44:10 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 24 22:44:10 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -8218642141943480738 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 24 22:44:10 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -8218642141943480738 (java.lang.Long) 0cefdafae713e9d75ae6a928349843d200888f4f923b7c41789dffac1d4c9a8e95f4a84bdae6402e0631e991af2567e0fa40a9d5b55a694cb2b27b19333e38ee - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 22:44:10 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -8218642141943480738 (java.lang.Long) - - - - +2021 Jan 24 22:45:38 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 24 22:45:38 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 24 22:45:38 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 1373571076507877271 (java.lang.Long) 49567caabf8c7bfaca91f24bf9bac6223a5b59d8b4459bff39c39c1a0b298dc3cc1980988c99e556b1c60e46eec92c938fa1970c0143307bcf6fa333754c7ac6 - - ServiceAgent +2021 Jan 24 22:45:39 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 1373571076507877271 (java.lang.Long) 49567caabf8c7bfaca91f24bf9bac6223a5b59d8b4459bff39c39c1a0b298dc3cc1980988c99e556b1c60e46eec92c938fa1970c0143307bcf6fa333754c7ac6 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 24 22:45:39 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 1373571076507877271 (java.lang.Long) 49567caabf8c7bfaca91f24bf9bac6223a5b59d8b4459bff39c39c1a0b298dc3cc1980988c99e556b1c60e46eec92c938fa1970c0143307bcf6fa333754c7ac6 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 22:45:39 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:34453 +2021 Jan 24 22:45:39 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 1373571076507877271 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:34453 +2021 Jan 24 22:45:39 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 24 22:45:39 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 24 22:45:39 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 24 22:45:43 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! +2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_5 (7505) 1373571076507877271 (java.lang.Long) 49567caabf8c7bfaca91f24bf9bac6223a5b59d8b4459bff39c39c1a0b298dc3cc1980988c99e556b1c60e46eec92c938fa1970c0143307bcf6fa333754c7ac6 - - {"project":{"id":5,"name":"Test Project"},"user":{"id":2}} +2021 Jan 24 22:45:43 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 1373571076507877271 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 1373571076507877271 (java.lang.Long) 49567caabf8c7bfaca91f24bf9bac6223a5b59d8b4459bff39c39c1a0b298dc3cc1980988c99e556b1c60e46eec92c938fa1970c0143307bcf6fa333754c7ac6 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 1373571076507877271 (java.lang.Long) - - - - +2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 7306620935816227524 (java.lang.Long) 5374713dae0d0d8e5325ccd4b6fbd535bc925b9960c522c60424a9d251743a4500583f16f5342dccca1c09f6ef7e99fed1be9059a2a65ff19b4d8e3b285b3e46 - - ServiceAgent +2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 7306620935816227524 (java.lang.Long) 5374713dae0d0d8e5325ccd4b6fbd535bc925b9960c522c60424a9d251743a4500583f16f5342dccca1c09f6ef7e99fed1be9059a2a65ff19b4d8e3b285b3e46 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 7306620935816227524 (java.lang.Long) 5374713dae0d0d8e5325ccd4b6fbd535bc925b9960c522c60424a9d251743a4500583f16f5342dccca1c09f6ef7e99fed1be9059a2a65ff19b4d8e3b285b3e46 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 22:45:43 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:46601 +2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 7306620935816227524 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:46601 +2021 Jan 24 22:45:43 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 24 22:45:43 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 24 22:45:43 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_3 (7503) 7306620935816227524 (java.lang.Long) 5374713dae0d0d8e5325ccd4b6fbd535bc925b9960c522c60424a9d251743a4500583f16f5342dccca1c09f6ef7e99fed1be9059a2a65ff19b4d8e3b285b3e46 - - {"user":{"id":2}} +2021 Jan 24 22:45:43 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 7306620935816227524 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 7306620935816227524 (java.lang.Long) 5374713dae0d0d8e5325ccd4b6fbd535bc925b9960c522c60424a9d251743a4500583f16f5342dccca1c09f6ef7e99fed1be9059a2a65ff19b4d8e3b285b3e46 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 7306620935816227524 (java.lang.Long) - - - - +2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 9088866528534090229 (java.lang.Long) c6e6e8fa7ad6b2d3cb37d39bd4f7cc1e3c88ef8b2187a46d4c4f0c688e9aaceb1a89e91ab224e85c9763b58670e04c89a0c328a88e0dcc2e8976ebd8aed801e1 - - ServiceAgent +2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 9088866528534090229 (java.lang.Long) c6e6e8fa7ad6b2d3cb37d39bd4f7cc1e3c88ef8b2187a46d4c4f0c688e9aaceb1a89e91ab224e85c9763b58670e04c89a0c328a88e0dcc2e8976ebd8aed801e1 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 9088866528534090229 (java.lang.Long) c6e6e8fa7ad6b2d3cb37d39bd4f7cc1e3c88ef8b2187a46d4c4f0c688e9aaceb1a89e91ab224e85c9763b58670e04c89a0c328a88e0dcc2e8976ebd8aed801e1 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 22:45:44 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:43785 +2021 Jan 24 22:45:44 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 9088866528534090229 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:43785 +2021 Jan 24 22:45:44 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 24 22:45:44 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 24 22:45:44 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 24 22:45:44 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped +2021 Jan 24 22:45:44 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 9088866528534090229 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 24 22:45:44 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 9088866528534090229 (java.lang.Long) c6e6e8fa7ad6b2d3cb37d39bd4f7cc1e3c88ef8b2187a46d4c4f0c688e9aaceb1a89e91ab224e85c9763b58670e04c89a0c328a88e0dcc2e8976ebd8aed801e1 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 24 22:45:44 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 9088866528534090229 (java.lang.Long) - - - - +2021 Jan 27 10:23:13 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 27 10:23:13 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 27 10:23:14 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 8683862140899858470 (java.lang.Long) 5ba184953599ab87e1dc62cc8f4c57849550d89c0065e135b1d314d301e593c0346ae386780f1b191ee62110fb4b5df7c739c79ce234b814ba7145f8043060ba - - ServiceAgent +2021 Jan 27 10:23:15 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 8683862140899858470 (java.lang.Long) 5ba184953599ab87e1dc62cc8f4c57849550d89c0065e135b1d314d301e593c0346ae386780f1b191ee62110fb4b5df7c739c79ce234b814ba7145f8043060ba - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 27 10:23:15 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 8683862140899858470 (java.lang.Long) 5ba184953599ab87e1dc62cc8f4c57849550d89c0065e135b1d314d301e593c0346ae386780f1b191ee62110fb4b5df7c739c79ce234b814ba7145f8043060ba - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 27 10:23:16 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 8683862140899858470 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:45305 +2021 Jan 27 10:23:17 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 27 10:23:17 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 27 10:23:17 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 27 10:23:20 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! +2021 Jan 27 10:23:20 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_55 (7555) 8683862140899858470 (java.lang.Long) 5ba184953599ab87e1dc62cc8f4c57849550d89c0065e135b1d314d301e593c0346ae386780f1b191ee62110fb4b5df7c739c79ce234b814ba7145f8043060ba - - {"user":{"id":2}} +2021 Jan 27 10:23:23 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! +2021 Jan 27 10:23:23 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_5 (7505) 8683862140899858470 (java.lang.Long) 5ba184953599ab87e1dc62cc8f4c57849550d89c0065e135b1d314d301e593c0346ae386780f1b191ee62110fb4b5df7c739c79ce234b814ba7145f8043060ba - - {"project":{"id":1,"name":"Test Project"},"user":{"id":2}} +2021 Jan 27 10:23:23 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 8683862140899858470 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 27 10:23:23 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 8683862140899858470 (java.lang.Long) 5ba184953599ab87e1dc62cc8f4c57849550d89c0065e135b1d314d301e593c0346ae386780f1b191ee62110fb4b5df7c739c79ce234b814ba7145f8043060ba - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 27 10:23:23 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 8683862140899858470 (java.lang.Long) - - - - +2021 Jan 27 10:23:23 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 27 10:23:23 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 27 10:23:23 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -7292386227814823786 (java.lang.Long) 1d29a1775fe24b54635a97981434623b593b8acb4c6b79a9d868ea28d6a848212011fee13064e252b471fda93195a5579839bdb99ac26c064c8ade06b04a4f3b - - ServiceAgent +2021 Jan 27 10:23:23 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -7292386227814823786 (java.lang.Long) 1d29a1775fe24b54635a97981434623b593b8acb4c6b79a9d868ea28d6a848212011fee13064e252b471fda93195a5579839bdb99ac26c064c8ade06b04a4f3b - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 27 10:23:23 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -7292386227814823786 (java.lang.Long) 1d29a1775fe24b54635a97981434623b593b8acb4c6b79a9d868ea28d6a848212011fee13064e252b471fda93195a5579839bdb99ac26c064c8ade06b04a4f3b - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 27 10:23:23 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -7292386227814823786 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:43881 +2021 Jan 27 10:23:23 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 27 10:23:23 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 27 10:23:23 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_3 (7503) -7292386227814823786 (java.lang.Long) 1d29a1775fe24b54635a97981434623b593b8acb4c6b79a9d868ea28d6a848212011fee13064e252b471fda93195a5579839bdb99ac26c064c8ade06b04a4f3b - - {"user":{"id":2}} +2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -7292386227814823786 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -7292386227814823786 (java.lang.Long) 1d29a1775fe24b54635a97981434623b593b8acb4c6b79a9d868ea28d6a848212011fee13064e252b471fda93195a5579839bdb99ac26c064c8ade06b04a4f3b - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -7292386227814823786 (java.lang.Long) - - - - +2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 811347393009207467 (java.lang.Long) 0dd42620e7dc95fe2d34652942d3eaa5ab093946decd936e60135bb408886bcb09dab407494a11a0b7408d2bed79febc9fac287d7a990e9368ac5bc2cb061e4e - - ServiceAgent +2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 811347393009207467 (java.lang.Long) 0dd42620e7dc95fe2d34652942d3eaa5ab093946decd936e60135bb408886bcb09dab407494a11a0b7408d2bed79febc9fac287d7a990e9368ac5bc2cb061e4e - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 811347393009207467 (java.lang.Long) 0dd42620e7dc95fe2d34652942d3eaa5ab093946decd936e60135bb408886bcb09dab407494a11a0b7408d2bed79febc9fac287d7a990e9368ac5bc2cb061e4e - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 811347393009207467 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:39157 +2021 Jan 27 10:23:24 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 27 10:23:24 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 27 10:23:24 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 811347393009207467 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 811347393009207467 (java.lang.Long) 0dd42620e7dc95fe2d34652942d3eaa5ab093946decd936e60135bb408886bcb09dab407494a11a0b7408d2bed79febc9fac287d7a990e9368ac5bc2cb061e4e - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 811347393009207467 (java.lang.Long) - - - - +2021 Jan 28 01:07:09 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 28 01:07:09 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 28 01:07:09 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -3497328785071790882 (java.lang.Long) 22884d69d6a83a992886e1d20f606abc333bb28b84902b55afbb98dd151eeed137f94025e26f21fb98d4c0d4152953365a21ba94c4977166dc61c7453917bd04 - - ServiceAgent +2021 Jan 28 01:07:10 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -3497328785071790882 (java.lang.Long) 22884d69d6a83a992886e1d20f606abc333bb28b84902b55afbb98dd151eeed137f94025e26f21fb98d4c0d4152953365a21ba94c4977166dc61c7453917bd04 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 28 01:07:10 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -3497328785071790882 (java.lang.Long) 22884d69d6a83a992886e1d20f606abc333bb28b84902b55afbb98dd151eeed137f94025e26f21fb98d4c0d4152953365a21ba94c4977166dc61c7453917bd04 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 28 01:07:11 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -3497328785071790882 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:35771 +2021 Jan 28 01:07:11 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 28 01:07:11 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 28 01:07:11 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 28 01:07:15 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! +2021 Jan 28 01:07:15 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_5 (7505) -3497328785071790882 (java.lang.Long) 22884d69d6a83a992886e1d20f606abc333bb28b84902b55afbb98dd151eeed137f94025e26f21fb98d4c0d4152953365a21ba94c4977166dc61c7453917bd04 - - {"project":{"id":2,"name":"Test Project"},"user":{"id":2}} +2021 Jan 28 01:07:15 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -3497328785071790882 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 28 01:07:15 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -3497328785071790882 (java.lang.Long) 22884d69d6a83a992886e1d20f606abc333bb28b84902b55afbb98dd151eeed137f94025e26f21fb98d4c0d4152953365a21ba94c4977166dc61c7453917bd04 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 28 01:07:15 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -3497328785071790882 (java.lang.Long) - - - - +2021 Jan 28 01:08:57 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 28 01:08:57 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 28 01:08:58 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 554353377921291446 (java.lang.Long) e8de7c44c6fa27bebeca654e900c6940d63ab83648ed13c1affb2addb1330b9d8ef6cf589b3d12beb200012fbb3761d4cb0d2eb4eb8cebde0176824c89e99c0a - - ServiceAgent +2021 Jan 28 01:08:59 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 554353377921291446 (java.lang.Long) e8de7c44c6fa27bebeca654e900c6940d63ab83648ed13c1affb2addb1330b9d8ef6cf589b3d12beb200012fbb3761d4cb0d2eb4eb8cebde0176824c89e99c0a - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 28 01:08:59 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 554353377921291446 (java.lang.Long) e8de7c44c6fa27bebeca654e900c6940d63ab83648ed13c1affb2addb1330b9d8ef6cf589b3d12beb200012fbb3761d4cb0d2eb4eb8cebde0176824c89e99c0a - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 28 01:08:59 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 554353377921291446 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:36339 +2021 Jan 28 01:08:59 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 28 01:08:59 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 28 01:08:59 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 28 01:09:03 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! +2021 Jan 28 01:09:03 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_5 (7505) 554353377921291446 (java.lang.Long) e8de7c44c6fa27bebeca654e900c6940d63ab83648ed13c1affb2addb1330b9d8ef6cf589b3d12beb200012fbb3761d4cb0d2eb4eb8cebde0176824c89e99c0a - - {"project":{"id":3,"name":"Test Project"},"user":{"id":2}} +2021 Jan 28 01:09:03 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 554353377921291446 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 28 01:09:03 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 554353377921291446 (java.lang.Long) e8de7c44c6fa27bebeca654e900c6940d63ab83648ed13c1affb2addb1330b9d8ef6cf589b3d12beb200012fbb3761d4cb0d2eb4eb8cebde0176824c89e99c0a - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 28 01:09:03 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 554353377921291446 (java.lang.Long) - - - - +2021 Jan 28 01:11:01 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 28 01:11:01 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 28 01:11:02 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 8985852743585839748 (java.lang.Long) 2aee5f3b117aedba11c50345661b282bb632bdd3f2dcee87dc60e30842295b4f934818bb700c2e9d29a6c4daed0365ff63320eb556d0796b51999827d6a420f2 - - ServiceAgent +2021 Jan 28 01:11:02 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 8985852743585839748 (java.lang.Long) 2aee5f3b117aedba11c50345661b282bb632bdd3f2dcee87dc60e30842295b4f934818bb700c2e9d29a6c4daed0365ff63320eb556d0796b51999827d6a420f2 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 28 01:11:02 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 8985852743585839748 (java.lang.Long) 2aee5f3b117aedba11c50345661b282bb632bdd3f2dcee87dc60e30842295b4f934818bb700c2e9d29a6c4daed0365ff63320eb556d0796b51999827d6a420f2 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 28 01:11:03 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 8985852743585839748 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:41211 +2021 Jan 28 01:11:03 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 28 01:11:03 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 28 01:11:03 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 28 01:11:07 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! +2021 Jan 28 01:11:07 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_5 (7505) 8985852743585839748 (java.lang.Long) 2aee5f3b117aedba11c50345661b282bb632bdd3f2dcee87dc60e30842295b4f934818bb700c2e9d29a6c4daed0365ff63320eb556d0796b51999827d6a420f2 - - {"project":{"id":4,"name":"Test Project"},"user":{"id":2}} +2021 Jan 28 01:11:07 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 8985852743585839748 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 28 01:11:07 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 8985852743585839748 (java.lang.Long) 2aee5f3b117aedba11c50345661b282bb632bdd3f2dcee87dc60e30842295b4f934818bb700c2e9d29a6c4daed0365ff63320eb556d0796b51999827d6a420f2 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 28 01:11:07 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 8985852743585839748 (java.lang.Long) - - - - +2021 Jan 28 01:57:47 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED +2021 Jan 28 01:57:47 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING +2021 Jan 28 01:57:47 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -4446408542952705538 (java.lang.Long) 7a0d159ea97a5afa179bb319a6305aaff5ffa33bb27685ea983d9cf2ef27155e18da3b77ce45c86327bc4512bc7b3f18c0b845f078e2b8c4eee05ef26520da43 - - ServiceAgent +2021 Jan 28 01:57:48 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -4446408542952705538 (java.lang.Long) 7a0d159ea97a5afa179bb319a6305aaff5ffa33bb27685ea983d9cf2ef27155e18da3b77ce45c86327bc4512bc7b3f18c0b845f078e2b8c4eee05ef26520da43 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} +2021 Jan 28 01:57:48 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -4446408542952705538 (java.lang.Long) 7a0d159ea97a5afa179bb319a6305aaff5ffa33bb27685ea983d9cf2ef27155e18da3b77ce45c86327bc4512bc7b3f18c0b845f078e2b8c4eee05ef26520da43 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 28 01:57:48 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -4446408542952705538 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:41675 +2021 Jan 28 01:57:48 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 +2021 Jan 28 01:57:48 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked +2021 Jan 28 01:57:48 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! +2021 Jan 28 01:57:52 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! +2021 Jan 28 01:57:52 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_5 (7505) -4446408542952705538 (java.lang.Long) 7a0d159ea97a5afa179bb319a6305aaff5ffa33bb27685ea983d9cf2ef27155e18da3b77ce45c86327bc4512bc7b3f18c0b845f078e2b8c4eee05ef26520da43 - - {"project":{"id":5,"name":"Test Project"},"user":{"id":2}} +2021 Jan 28 01:57:52 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -4446408542952705538 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped +2021 Jan 28 01:57:52 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -4446408542952705538 (java.lang.Long) 7a0d159ea97a5afa179bb319a6305aaff5ffa33bb27685ea983d9cf2ef27155e18da3b77ce45c86327bc4512bc7b3f18c0b845f078e2b8c4eee05ef26520da43 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 +2021 Jan 28 01:57:52 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -4446408542952705538 (java.lang.Long) - - - - diff --git a/requirement_bazaar/log/service.log.0 b/requirement_bazaar/log/service.log.0 index e69de29b..a602d0f6 100644 --- a/requirement_bazaar/log/service.log.0 +++ b/requirement_bazaar/log/service.log.0 @@ -0,0 +1,27 @@ +2021 Jan 24 16:31:17 FINER service: SERVICE_CUSTOM_MESSAGE_55 (7555) 2592049687788073295 (java.lang.Long) 39566f0ba4da3ade72582ca997dc0473ce96af72f0a8e254f51c4e710ee1d265dda4cfdd9714a3cc20139f39e014862a1aacd49891f9e5d452634d49f8ba8f8e - - {"user":{"id":2}} +2021 Jan 24 16:31:17 FINER service: SERVICE_CUSTOM_MESSAGE_3 (7503) 2592049687788073295 (java.lang.Long) 39566f0ba4da3ade72582ca997dc0473ce96af72f0a8e254f51c4e710ee1d265dda4cfdd9714a3cc20139f39e014862a1aacd49891f9e5d452634d49f8ba8f8e - - {"user":{"id":2}} +2021 Jan 24 17:23:04 FINER service: SERVICE_ERROR (-7500) -8335149968131132194 (java.lang.Long) 10f394b5c1942fe7135093d0fbff6d004c9ab232e0924cc09cc89c690275f012297f1c5c0cf976abb4fb76a5ea882d9e3a527e3c9eec551864139d77032f968e - - Create project +2021 Jan 24 17:25:29 FINER service: SERVICE_ERROR (-7500) -8483227742122078455 (java.lang.Long) 296f75fdf619c9803a52ed6feb3c207323df89f38acae82e5a10947f8bef235467765fd58fe8b4893b647923184d87e974e02207bef184f3de2eedc23a980c20 - - Create project +2021 Jan 24 17:42:04 FINER service: SERVICE_ERROR (-7500) 3663258393979825028 (java.lang.Long) a066a2dfdd30f5afcff92907f5dd6452d8c5d017f6759c42e46b53eb90e65eeda530240bbbaa421e9bf0d9efc7f557265cec224d43a91483d9e4fed863a1c3f0 - - Create project +2021 Jan 24 17:44:29 FINER service: SERVICE_ERROR (-7500) 4834079535588350955 (java.lang.Long) 1749d64c855a27346490b8ec5b45c7a474ac082abec5f1568b29e2a3868224f6d245aef8b4b693a4156b999c6835d57384fb802de98a34542222d5ce29c253ab - - Create project +2021 Jan 24 17:45:38 FINER service: SERVICE_ERROR (-7500) -141896451122989663 (java.lang.Long) c97e2aae315ffadffa71bf2890a112c9705dab2544d84059087e445363f828ef332436389bc402b771d13556213ee953b3197c742412a7f6934cf2c562ebdae5 - - Create project +2021 Jan 24 18:25:31 FINER service: SERVICE_ERROR (-7500) 4379388327573918888 (java.lang.Long) cae10332bb9c9bbfc43e882d1a6a4e9cd08a3c6bbf19a19982090e47943ea8c620ab93ed6571736f7a0eb0fa81023183612bcebd3866cce9480f12e82bea3050 - - Create project +2021 Jan 24 18:30:42 FINER service: SERVICE_ERROR (-7500) 3710581509298365681 (java.lang.Long) ec00ffe74126c3feb5ff606afb657ec7ee0f88a2a19d8628b5d0e5990cd81915f4045e5baf00c3335e15c38607ec70a53d7065f7a9cc8723fdac86d04becf490 - - Create project +2021 Jan 24 18:33:41 FINER service: SERVICE_ERROR (-7500) 2732338442939902719 (java.lang.Long) 6900135dab5c6438d12e36cd41cf2d5841dcc1f817df4cdac5c34a7817e0dbbf14c8b24a2d7efa981bb1860ab84abc023a393da4a7471e27c31c6b3b08224310 - - Create project +2021 Jan 24 20:28:22 FINER service: SERVICE_ERROR (-7500) -9160309062668269239 (java.lang.Long) f08001f321a3018c57bfc815f65969abb97322140c109f3db3b3ce4bc47e34e1c2e457b2b2ed6ddb81cf55271b127493c7904bb8f0c91b62ee281061e937cae8 - - Create project +2021 Jan 24 20:59:14 FINER service: SERVICE_ERROR (-7500) 7702652481531784330 (java.lang.Long) 682d531cf63c6d998d2ce669b9e2129583bb915e8e1b2e1cb6a5efe4b93add79d8d00b10ba31ecc6111e89f060a95aac238bffac3bfd02573a4072806c7e5203 - - Create project +2021 Jan 24 21:07:47 FINER service: SERVICE_CUSTOM_MESSAGE_5 (7505) -5367634581475145353 (java.lang.Long) da6507e341d53c36311b54d4eacb69e9244f45f8d2e2bb04de4f40903d3e5d0e1862c0f6e264c103735e41db2d3a4633749ad794e49f492ee1a456cfc4569bbd - - {"project":{"id":1,"name":"Test Project"},"user":{"id":2}} +2021 Jan 24 21:19:59 FINER service: SERVICE_CUSTOM_MESSAGE_5 (7505) -9092528362610730871 (java.lang.Long) 2d3f5767ae227d97aa39d613b839919a8cfb1b4e2f458f0a164f4453e701aa38771bc33cdb9e88a612d4a42f273e6eb06edcad09c017366c45917d4d2c319337 - - {"project":{"id":2,"name":"Test Project"},"user":{"id":2}} +2021 Jan 24 21:22:58 FINER service: SERVICE_CUSTOM_MESSAGE_5 (7505) 1343330722104043295 (java.lang.Long) 897eb314f53353aa2cbbed48ee39bb6b15d75eaf6f240113f49e40ea5b02473d53d4162a25de274bb7bee973b5fa07ce77fa96529440b0399f6d699723bb502e - - {"project":{"id":3,"name":"Test Project"},"user":{"id":2}} +2021 Jan 24 21:24:02 FINER service: SERVICE_CUSTOM_MESSAGE_5 (7505) -6964921055090057937 (java.lang.Long) 2ffee52822ddd07a14930011ea1c5b1c6f9902e5f6dda8b9d6ca0aa4f4e597a9aed69c50d01783c8dd42f1b81974627d82f8166da16ee1547867358478534540 - - {"project":{"id":4,"name":"Test Project"},"user":{"id":2}} +2021 Jan 24 22:42:44 FINER service: SERVICE_CUSTOM_MESSAGE_3 (7503) -2345002620162797745 (java.lang.Long) e148fa14e2d5b98bb361d087136f7bf180fc18706d381b867463bc1b41f613ddcfac56387816d22ee13c09bec414954bc2c2a8d5d176ffdfb40b0be7e5ffd269 - - {"user":{"id":2}} +2021 Jan 24 22:44:10 FINER service: SERVICE_CUSTOM_MESSAGE_3 (7503) -8218642141943480738 (java.lang.Long) 0cefdafae713e9d75ae6a928349843d200888f4f923b7c41789dffac1d4c9a8e95f4a84bdae6402e0631e991af2567e0fa40a9d5b55a694cb2b27b19333e38ee - - {"user":{"id":2}} +2021 Jan 24 22:45:43 FINER service: SERVICE_CUSTOM_MESSAGE_5 (7505) 1373571076507877271 (java.lang.Long) 49567caabf8c7bfaca91f24bf9bac6223a5b59d8b4459bff39c39c1a0b298dc3cc1980988c99e556b1c60e46eec92c938fa1970c0143307bcf6fa333754c7ac6 - - {"project":{"id":5,"name":"Test Project"},"user":{"id":2}} +2021 Jan 24 22:45:43 FINER service: SERVICE_CUSTOM_MESSAGE_3 (7503) 7306620935816227524 (java.lang.Long) 5374713dae0d0d8e5325ccd4b6fbd535bc925b9960c522c60424a9d251743a4500583f16f5342dccca1c09f6ef7e99fed1be9059a2a65ff19b4d8e3b285b3e46 - - {"user":{"id":2}} +2021 Jan 27 10:23:20 FINER service: SERVICE_CUSTOM_MESSAGE_55 (7555) 8683862140899858470 (java.lang.Long) 5ba184953599ab87e1dc62cc8f4c57849550d89c0065e135b1d314d301e593c0346ae386780f1b191ee62110fb4b5df7c739c79ce234b814ba7145f8043060ba - - {"user":{"id":2}} +2021 Jan 27 10:23:23 FINER service: SERVICE_CUSTOM_MESSAGE_5 (7505) 8683862140899858470 (java.lang.Long) 5ba184953599ab87e1dc62cc8f4c57849550d89c0065e135b1d314d301e593c0346ae386780f1b191ee62110fb4b5df7c739c79ce234b814ba7145f8043060ba - - {"project":{"id":1,"name":"Test Project"},"user":{"id":2}} +2021 Jan 27 10:23:24 FINER service: SERVICE_CUSTOM_MESSAGE_3 (7503) -7292386227814823786 (java.lang.Long) 1d29a1775fe24b54635a97981434623b593b8acb4c6b79a9d868ea28d6a848212011fee13064e252b471fda93195a5579839bdb99ac26c064c8ade06b04a4f3b - - {"user":{"id":2}} +2021 Jan 28 01:07:15 FINER service: SERVICE_CUSTOM_MESSAGE_5 (7505) -3497328785071790882 (java.lang.Long) 22884d69d6a83a992886e1d20f606abc333bb28b84902b55afbb98dd151eeed137f94025e26f21fb98d4c0d4152953365a21ba94c4977166dc61c7453917bd04 - - {"project":{"id":2,"name":"Test Project"},"user":{"id":2}} +2021 Jan 28 01:09:03 FINER service: SERVICE_CUSTOM_MESSAGE_5 (7505) 554353377921291446 (java.lang.Long) e8de7c44c6fa27bebeca654e900c6940d63ab83648ed13c1affb2addb1330b9d8ef6cf589b3d12beb200012fbb3761d4cb0d2eb4eb8cebde0176824c89e99c0a - - {"project":{"id":3,"name":"Test Project"},"user":{"id":2}} +2021 Jan 28 01:11:07 FINER service: SERVICE_CUSTOM_MESSAGE_5 (7505) 8985852743585839748 (java.lang.Long) 2aee5f3b117aedba11c50345661b282bb632bdd3f2dcee87dc60e30842295b4f934818bb700c2e9d29a6c4daed0365ff63320eb556d0796b51999827d6a420f2 - - {"project":{"id":4,"name":"Test Project"},"user":{"id":2}} +2021 Jan 28 01:57:52 FINER service: SERVICE_CUSTOM_MESSAGE_5 (7505) -4446408542952705538 (java.lang.Long) 7a0d159ea97a5afa179bb319a6305aaff5ffa33bb27685ea983d9cf2ef27155e18da3b77ce45c86327bc4512bc7b3f18c0b845f078e2b8c4eee05ef26520da43 - - {"project":{"id":5,"name":"Test Project"},"user":{"id":2}} diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java index 656aea71..55244f42 100755 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java @@ -371,7 +371,8 @@ private void registerUserAtFirstLogin() throws Exception { public static DataSource setupDataSource(String dbUrl, String dbUserName, String dbPassword) { BasicDataSource dataSource = new BasicDataSource(); - dataSource.setDriverClassName("com.mysql.jdbc.Driver"); + // Deprecated according to jooq + // dataSource.setDriverClassName("com.mysql.jdbc.Driver"); dataSource.setUrl(dbUrl + "?useSSL=false&serverTimezone=UTC"); dataSource.setUsername(dbUserName); dataSource.setPassword(dbPassword); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java index 1f7d6534..90f08b7c 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java @@ -225,7 +225,7 @@ public Response getCategory(@PathParam("categoryId") int categoryId) { * @return Response with the created project as a JSON object. */ @POST - @Path("/") + //@Path("/") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "This method allows to create a new category under a given a project.") @@ -737,4 +737,4 @@ public Response getRequirementsForCategory(@PathParam("categoryId") int category RequirementsResource requirementsResource = new RequirementsResource(); return requirementsResource.getRequirementsForCategory(categoryId, page, perPage, search, stateFilter, sort); } -} \ No newline at end of file +} diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java index 35315b03..3cd06a70 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java @@ -68,7 +68,7 @@ public ProjectsResource() throws Exception { * @return Response with list of all projects */ @GET - @Path("/") + //@Path("/") @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "This method returns the list of projects on the server.") @ApiResponses(value = { @@ -115,7 +115,7 @@ public Response getProjects( filterMap.put(filterOption,internalUserId.toString()); } PageInfo pageInfo = new PageInfo(page, perPage, filterMap, sortList, search, ids); - + Vtor vtor = bazaarService.getValidators(); vtor.validate(pageInfo); @@ -237,7 +237,7 @@ public Response getProject(@PathParam("projectId") int projectId) { * @return Response with the created project as a JSON object. */ @POST - @Path("/") + //@Path("/") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "This method allows to create a new project.") diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index b4c89220..ea9253eb 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -30,7 +30,6 @@ import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.internalization.Localization; import i5.las2peer.api.Context; -import i5.las2peer.api.security.Agent; import i5.las2peer.security.PassphraseAgentImpl; import org.jooq.DSLContext; import org.jooq.SQLDialect; @@ -658,20 +657,21 @@ public EntityOverview getEntitiesForUser(List includes, Pageable pageabl //categoryRepository = (categoryRepository != null) ? categoryRepository : new CategoryRepositoryImpl(dslContext); EntityOverview.Builder result = EntityOverview.getBuilder(); for(String include : includes) { - if(include.equals("projects")){ - projectRepository = (projectRepository != null) ? projectRepository : new ProjectRepositoryImpl(dslContext); - result.projects(projectRepository.listAllProjectIds(pageable, userId)); - } else - if(include.equals("requirements")){ - requirementRepository = (requirementRepository != null) ? requirementRepository : new RequirementRepositoryImpl(dslContext); - result.requirements(requirementRepository.listAllRequirementIds(pageable, userId)); - }else - if(include.equals("categories")){ - categoryRepository = (categoryRepository != null) ? categoryRepository : new CategoryRepositoryImpl(dslContext); - result.categories(categoryRepository.listAllCategoryIds(pageable, userId)); + switch (include) { + case "projects": + projectRepository = (projectRepository != null) ? projectRepository : new ProjectRepositoryImpl(dslContext); + result.projects(projectRepository.listAllProjectIds(pageable, userId)); + break; + case "requirements": + requirementRepository = (requirementRepository != null) ? requirementRepository : new RequirementRepositoryImpl(dslContext); + result.requirements(requirementRepository.listAllRequirementIds(pageable, userId)); + break; + case "categories": + categoryRepository = (categoryRepository != null) ? categoryRepository : new CategoryRepositoryImpl(dslContext); + result.categories(categoryRepository.listAllCategoryIds(pageable, userId)); + break; } //TODO Add Comments/Attachments - } return result.build(); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java index 1e441f78..7236bbd4 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java @@ -46,16 +46,16 @@ public class Project extends EntityBase { @NotNull(profiles = {"create"}) private String description; - private Boolean visibility; + private Boolean visibility = true; private Integer defaultCategoryId; private User leader; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone="Europe/Berlin") private LocalDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone="Europe/Berlin") private LocalDateTime lastUpdatedDate; private Integer numberOfCategories; diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index 161ca8dd..a3659d56 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -1,5 +1,6 @@ package de.rwth.dbis.acis.bazaar.service; +import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import i5.las2peer.connectors.webConnector.client.ClientResponse; @@ -7,6 +8,9 @@ import org.junit.Assert; import org.junit.Test; +import javax.ws.rs.core.MediaType; +import java.util.HashMap; + public class BazaarTest extends TestBase { /** @@ -19,7 +23,7 @@ public void testGetVersion() { ClientResponse result = client.sendRequest("GET", mainPath + "version", ""); JsonObject response = JsonParser.parseString(result.getResponse()).getAsJsonObject(); - + System.out.println(response.toString()); Assert.assertTrue(response.isJsonObject()); Assert.assertEquals(response.get("version").getAsString(), BazaarService.class.getName() + "@" + testVersion); @@ -28,5 +32,49 @@ public void testGetVersion() { Assert.fail(e.toString()); } } + /** + * Test to get a list of projects + */ + @Test + public void testGetProjects() { + try { + MiniClient client = getClient(); + + ClientResponse result = client.sendRequest("GET", mainPath + "projects", ""); + + Assert.assertEquals(200, result.getHttpCode()); + JsonElement response = JsonParser.parseString(result.getResponse()); + System.out.println(response.toString()); + Assert.assertTrue(response.isJsonArray()); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(e.toString()); + } + } + + /** + * Test to get a list of projects + */ + @Test + public void testCreateProject() { + try { + MiniClient client = getClient(); + + String testProject = "{\"name\": \"Test Project\", \"description\": \"A test Project\"}"; + ClientResponse result = client.sendRequest("POST", mainPath + "projects", testProject, + MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, new HashMap<>()); + System.out.println(result.toString()); + System.out.println("Result of 'testPost': " + result.getResponse().trim()); + Assert.assertEquals(201, result.getHttpCode()); + + JsonObject response = JsonParser.parseString(result.getResponse()).getAsJsonObject(); + Assert.assertTrue(response.isJsonObject()); + System.out.println(response.get("creationDate").toString()); + Assert.assertTrue(isValidISO8601(response.get("creationDate").toString())); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(e.toString()); + } + } } diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java index 9c0e4728..7b2a7603 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java @@ -12,6 +12,8 @@ import java.io.ByteArrayOutputStream; import java.io.PrintStream; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; /** * Example Test Class demonstrating a basic JUnit test structure. @@ -85,4 +87,14 @@ MiniClient getClient() { client.setLogin(testAgent.getIdentifier(), testPass); return client; } + + boolean isValidISO8601(String dateStr) { + DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS"); + try { + dateFormatter.parse(dateStr); + } catch (DateTimeParseException e) { + return false; + } + return true; + } } From 76cbf6450af44faa7d6d358efef8e1f8cb8fd783 Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 30 Jan 2021 18:26:57 +0100 Subject: [PATCH 034/134] Fix build output path --- requirement_bazaar/build.gradle | 3 +- requirement_bazaar/log/las2peer.log.0 | 638 -------------------------- requirement_bazaar/log/service.log.0 | 27 -- 3 files changed, 2 insertions(+), 666 deletions(-) delete mode 100644 requirement_bazaar/log/las2peer.log.0 delete mode 100644 requirement_bazaar/log/service.log.0 diff --git a/requirement_bazaar/build.gradle b/requirement_bazaar/build.gradle index a8fa7be0..ad1955be 100644 --- a/requirement_bazaar/build.gradle +++ b/requirement_bazaar/build.gradle @@ -23,8 +23,8 @@ plugins { } group = 'de.rwth.dbis.acis.bazaar.service' +version = "${project.property('service.version')}" archivesBaseName = group -version = "${project.property('service.name')}" mainClassName = "de.rwth.dbis.acis.bazaar.service.BazaarService" sourceCompatibility = 14 @@ -50,6 +50,7 @@ dependencies { // This is for the jooq generation only jooqGenerator "mysql:mysql-connector-java:${project.property('mysql.version')}" jooqGenerator "org.jooq:jooq-codegen:${project.property('jooq.version')}" + implementation "org.flywaydb:flyway-core:7.3.2" implementation 'com.google.code.gson:gson:2.8.6' implementation 'org.apache.commons:commons-pool2:2.9.0' diff --git a/requirement_bazaar/log/las2peer.log.0 b/requirement_bazaar/log/las2peer.log.0 deleted file mode 100644 index 5e7a2717..00000000 --- a/requirement_bazaar/log/las2peer.log.0 +++ /dev/null @@ -1,638 +0,0 @@ -2021 Jan 17 03:52:08 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 17 03:52:08 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 17 03:52:09 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -2865038555733856225 (java.lang.Long) 286b15cf69815e8a4e0ae37845e662c2de9a7fd3f074d03080eabaaec253f369c02739009d7e0c63096660709746feb22cf8f63c3810b5f878d728690a248463 - - ServiceAgent -2021 Jan 17 03:52:09 FINER i5.las2peer.p2p.LocalNode: AGENT_LOAD_FAILED (-3000) i5.las2peer.p2p.LocalNode@5f781ec1 (i5.las2peer.p2p.LocalNode) 286b15cf69815e8a4e0ae37845e662c2de9a7fd3f074d03080eabaaec253f369c02739009d7e0c63096660709746feb22cf8f63c3810b5f878d728690a248463 - - i5.las2peer.api.security.AgentException: Exception in service constructor -2021 Jan 17 03:52:09 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -2865038555733856225 (java.lang.Long) - - - - -2021 Jan 17 03:55:29 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 17 03:55:29 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 17 03:55:29 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 8154462497441101399 (java.lang.Long) 0c895f915b064fe0caa23e0339668d4fc2b6cb7d2bdad916957590f1d6269559d24fa3342a852548ef1e5eba98038fbf4f14a9ac70e3246416227405fda2d53b - - ServiceAgent -2021 Jan 17 03:55:30 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 8154462497441101399 (java.lang.Long) 0c895f915b064fe0caa23e0339668d4fc2b6cb7d2bdad916957590f1d6269559d24fa3342a852548ef1e5eba98038fbf4f14a9ac70e3246416227405fda2d53b - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 17 03:55:30 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 8154462497441101399 (java.lang.Long) 0c895f915b064fe0caa23e0339668d4fc2b6cb7d2bdad916957590f1d6269559d24fa3342a852548ef1e5eba98038fbf4f14a9ac70e3246416227405fda2d53b - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 17 03:55:31 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:38423 -2021 Jan 17 03:55:31 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 8154462497441101399 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:38423 -2021 Jan 17 03:55:31 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 17 03:55:31 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 17 03:55:31 SEVERE i5.las2peer.connectors.webConnector.WebConnector: not found: Could not resolve /activities/version to a service name. -javax.ws.rs.NotFoundException: Could not resolve /activities/version to a service name. - at i5.las2peer.connectors.webConnector.WebConnectorRequestHandler.resolveServiceAndInvoke(WebConnectorRequestHandler.java:194) - at i5.las2peer.connectors.webConnector.WebConnectorRequestHandler.handle(WebConnectorRequestHandler.java:154) - at i5.las2peer.connectors.webConnector.WebConnectorRequestHandler.handleGET(WebConnectorRequestHandler.java:119) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:498) - at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) - at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) - at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) - at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160) - at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) - at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) - at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) - at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) - at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) - at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) - at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) - at org.glassfish.jersey.internal.Errors.process(Errors.java:315) - at org.glassfish.jersey.internal.Errors.process(Errors.java:297) - at org.glassfish.jersey.internal.Errors.process(Errors.java:267) - at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) - at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) - at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) - at org.glassfish.jersey.jdkhttp.JdkHttpHandlerContainer.handle(JdkHttpHandlerContainer.java:161) - at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79) - at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83) - at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:82) - at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:675) - at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79) - at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:647) - at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) - at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) - at java.lang.Thread.run(Thread.java:748) -2021 Jan 17 03:55:31 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_ERROR (-9100) 8154462497441101399 (java.lang.Long) - - - WebConnector: not found: Could not resolve /activities/version to a service name. -2021 Jan 17 03:55:31 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 17 03:55:31 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 8154462497441101399 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 17 03:55:31 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 8154462497441101399 (java.lang.Long) 0c895f915b064fe0caa23e0339668d4fc2b6cb7d2bdad916957590f1d6269559d24fa3342a852548ef1e5eba98038fbf4f14a9ac70e3246416227405fda2d53b - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 17 03:55:31 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 8154462497441101399 (java.lang.Long) - - - - -2021 Jan 17 03:55:39 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 17 03:55:39 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 17 03:55:40 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -5138140134614255441 (java.lang.Long) e094adeeb708e37c4c3a7c37a8a8f5f8c43389d153efbb9b316e45c5aa9fe43f88f8fd016701209b9c975d520472244bf5b19da2bb78119b9206f15d643a7ada - - ServiceAgent -2021 Jan 17 03:55:40 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -5138140134614255441 (java.lang.Long) e094adeeb708e37c4c3a7c37a8a8f5f8c43389d153efbb9b316e45c5aa9fe43f88f8fd016701209b9c975d520472244bf5b19da2bb78119b9206f15d643a7ada - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 17 03:55:40 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -5138140134614255441 (java.lang.Long) e094adeeb708e37c4c3a7c37a8a8f5f8c43389d153efbb9b316e45c5aa9fe43f88f8fd016701209b9c975d520472244bf5b19da2bb78119b9206f15d643a7ada - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 17 03:55:41 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:40887 -2021 Jan 17 03:55:41 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -5138140134614255441 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:40887 -2021 Jan 17 03:55:41 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 17 03:55:41 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 17 03:55:41 SEVERE i5.las2peer.connectors.webConnector.WebConnector: not found: Could not resolve /activities/version to a service name. -javax.ws.rs.NotFoundException: Could not resolve /activities/version to a service name. - at i5.las2peer.connectors.webConnector.WebConnectorRequestHandler.resolveServiceAndInvoke(WebConnectorRequestHandler.java:194) - at i5.las2peer.connectors.webConnector.WebConnectorRequestHandler.handle(WebConnectorRequestHandler.java:154) - at i5.las2peer.connectors.webConnector.WebConnectorRequestHandler.handleGET(WebConnectorRequestHandler.java:119) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:498) - at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) - at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) - at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) - at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160) - at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) - at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) - at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) - at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) - at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) - at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) - at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) - at org.glassfish.jersey.internal.Errors.process(Errors.java:315) - at org.glassfish.jersey.internal.Errors.process(Errors.java:297) - at org.glassfish.jersey.internal.Errors.process(Errors.java:267) - at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) - at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) - at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) - at org.glassfish.jersey.jdkhttp.JdkHttpHandlerContainer.handle(JdkHttpHandlerContainer.java:161) - at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79) - at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83) - at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:82) - at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:675) - at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79) - at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:647) - at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) - at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) - at java.lang.Thread.run(Thread.java:748) -2021 Jan 17 03:55:41 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_ERROR (-9100) -5138140134614255441 (java.lang.Long) - - - WebConnector: not found: Could not resolve /activities/version to a service name. -2021 Jan 17 03:55:41 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 17 03:55:41 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -5138140134614255441 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 17 03:55:41 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -5138140134614255441 (java.lang.Long) e094adeeb708e37c4c3a7c37a8a8f5f8c43389d153efbb9b316e45c5aa9fe43f88f8fd016701209b9c975d520472244bf5b19da2bb78119b9206f15d643a7ada - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 17 03:55:41 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -5138140134614255441 (java.lang.Long) - - - - -2021 Jan 17 03:57:56 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 17 03:57:56 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 17 03:57:56 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 5419993283417427128 (java.lang.Long) 9623a0d68303cde3b46c29fe3475f2fc9b61902579fbdc7932a1c4a4d01965fb78df37ff7df8c1c987f74d0daf6defba91d5472106e0f5c0cfff5df3bb811601 - - ServiceAgent -2021 Jan 17 03:57:57 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 5419993283417427128 (java.lang.Long) 9623a0d68303cde3b46c29fe3475f2fc9b61902579fbdc7932a1c4a4d01965fb78df37ff7df8c1c987f74d0daf6defba91d5472106e0f5c0cfff5df3bb811601 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 17 03:57:57 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 5419993283417427128 (java.lang.Long) 9623a0d68303cde3b46c29fe3475f2fc9b61902579fbdc7932a1c4a4d01965fb78df37ff7df8c1c987f74d0daf6defba91d5472106e0f5c0cfff5df3bb811601 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 17 03:57:58 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:35339 -2021 Jan 17 03:57:58 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 5419993283417427128 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:35339 -2021 Jan 17 03:57:58 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 17 03:57:58 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 17 03:57:58 SEVERE i5.las2peer.connectors.webConnector.WebConnector: not found: Could not resolve /activities/version to a service name. -javax.ws.rs.NotFoundException: Could not resolve /activities/version to a service name. - at i5.las2peer.connectors.webConnector.WebConnectorRequestHandler.resolveServiceAndInvoke(WebConnectorRequestHandler.java:194) - at i5.las2peer.connectors.webConnector.WebConnectorRequestHandler.handle(WebConnectorRequestHandler.java:154) - at i5.las2peer.connectors.webConnector.WebConnectorRequestHandler.handleGET(WebConnectorRequestHandler.java:119) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:498) - at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) - at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) - at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) - at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160) - at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) - at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) - at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) - at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) - at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) - at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) - at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) - at org.glassfish.jersey.internal.Errors.process(Errors.java:315) - at org.glassfish.jersey.internal.Errors.process(Errors.java:297) - at org.glassfish.jersey.internal.Errors.process(Errors.java:267) - at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) - at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) - at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) - at org.glassfish.jersey.jdkhttp.JdkHttpHandlerContainer.handle(JdkHttpHandlerContainer.java:161) - at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79) - at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83) - at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:82) - at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:675) - at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79) - at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:647) - at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) - at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) - at java.lang.Thread.run(Thread.java:748) -2021 Jan 17 03:57:58 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_ERROR (-9100) 5419993283417427128 (java.lang.Long) - - - WebConnector: not found: Could not resolve /activities/version to a service name. -2021 Jan 17 03:57:58 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 17 03:57:58 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 5419993283417427128 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 17 03:57:58 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 5419993283417427128 (java.lang.Long) 9623a0d68303cde3b46c29fe3475f2fc9b61902579fbdc7932a1c4a4d01965fb78df37ff7df8c1c987f74d0daf6defba91d5472106e0f5c0cfff5df3bb811601 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 17 03:57:58 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 5419993283417427128 (java.lang.Long) - - - - -2021 Jan 17 03:58:33 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 17 03:58:33 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 17 03:58:34 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -4273426718411292372 (java.lang.Long) 453ffa2339538b75533164f1c6f46ae4d3c1a967a0251681604335dd462c983ac43e4faf075c1fa0dbe10d41286968d3792512c2dea59d9911752c2f99675bb6 - - ServiceAgent -2021 Jan 17 03:58:35 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -4273426718411292372 (java.lang.Long) 453ffa2339538b75533164f1c6f46ae4d3c1a967a0251681604335dd462c983ac43e4faf075c1fa0dbe10d41286968d3792512c2dea59d9911752c2f99675bb6 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 17 03:58:35 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -4273426718411292372 (java.lang.Long) 453ffa2339538b75533164f1c6f46ae4d3c1a967a0251681604335dd462c983ac43e4faf075c1fa0dbe10d41286968d3792512c2dea59d9911752c2f99675bb6 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 17 03:58:35 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:34005 -2021 Jan 17 03:58:35 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -4273426718411292372 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:34005 -2021 Jan 17 03:58:35 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 17 03:58:35 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 17 03:58:35 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 17 03:58:35 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 17 03:58:35 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -4273426718411292372 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 17 03:58:35 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -4273426718411292372 (java.lang.Long) 453ffa2339538b75533164f1c6f46ae4d3c1a967a0251681604335dd462c983ac43e4faf075c1fa0dbe10d41286968d3792512c2dea59d9911752c2f99675bb6 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 17 03:58:35 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -4273426718411292372 (java.lang.Long) - - - - -2021 Jan 17 04:02:08 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 17 04:02:08 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 17 04:02:08 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -1807525047774611694 (java.lang.Long) 785feedd3f21d35dcdf8709bd226e58442eaff46a4765b98213440007b9d06d4602dd398de673226dce31660fffa779bc50866e27ec89ba9e51203452db75368 - - ServiceAgent -2021 Jan 17 04:02:09 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -1807525047774611694 (java.lang.Long) 785feedd3f21d35dcdf8709bd226e58442eaff46a4765b98213440007b9d06d4602dd398de673226dce31660fffa779bc50866e27ec89ba9e51203452db75368 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 17 04:02:09 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -1807525047774611694 (java.lang.Long) 785feedd3f21d35dcdf8709bd226e58442eaff46a4765b98213440007b9d06d4602dd398de673226dce31660fffa779bc50866e27ec89ba9e51203452db75368 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 17 04:02:10 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:33785 -2021 Jan 17 04:02:10 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -1807525047774611694 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:33785 -2021 Jan 17 04:02:10 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 17 04:02:10 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 17 04:02:10 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 17 04:02:10 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 17 04:02:10 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -1807525047774611694 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 17 04:02:10 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -1807525047774611694 (java.lang.Long) 785feedd3f21d35dcdf8709bd226e58442eaff46a4765b98213440007b9d06d4602dd398de673226dce31660fffa779bc50866e27ec89ba9e51203452db75368 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 17 04:02:10 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -1807525047774611694 (java.lang.Long) - - - - -2021 Jan 17 04:02:40 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 17 04:02:40 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 17 04:02:41 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -707842752454908406 (java.lang.Long) a8a219b94e6a30122e959785a434cea38001e6f96c7a89a5a26ac4d7b8ce037625cd2680099b2f14195ec43972d32fe326e15513ba01a8c7daf63407136aaee4 - - ServiceAgent -2021 Jan 17 04:02:42 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -707842752454908406 (java.lang.Long) a8a219b94e6a30122e959785a434cea38001e6f96c7a89a5a26ac4d7b8ce037625cd2680099b2f14195ec43972d32fe326e15513ba01a8c7daf63407136aaee4 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 17 04:02:42 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -707842752454908406 (java.lang.Long) a8a219b94e6a30122e959785a434cea38001e6f96c7a89a5a26ac4d7b8ce037625cd2680099b2f14195ec43972d32fe326e15513ba01a8c7daf63407136aaee4 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 17 04:02:42 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:36147 -2021 Jan 17 04:02:42 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -707842752454908406 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:36147 -2021 Jan 17 04:02:42 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 17 04:02:42 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 17 04:02:42 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 17 04:02:43 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 17 04:02:43 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -707842752454908406 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 17 04:02:43 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -707842752454908406 (java.lang.Long) a8a219b94e6a30122e959785a434cea38001e6f96c7a89a5a26ac4d7b8ce037625cd2680099b2f14195ec43972d32fe326e15513ba01a8c7daf63407136aaee4 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 17 04:02:43 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -707842752454908406 (java.lang.Long) - - - - -2021 Jan 24 16:24:10 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 24 16:24:10 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 24 16:24:10 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -3535148000172925747 (java.lang.Long) e5c665821ef713e7dbae64c8e15dcc372e70f63e54a55236c3ca1819a85c6f4a01c865716e3d50468cbe78f96a29e558240c0cd5b3dfcf3739e3507a9ef8f46f - - ServiceAgent -2021 Jan 24 16:24:11 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -3535148000172925747 (java.lang.Long) e5c665821ef713e7dbae64c8e15dcc372e70f63e54a55236c3ca1819a85c6f4a01c865716e3d50468cbe78f96a29e558240c0cd5b3dfcf3739e3507a9ef8f46f - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 24 16:24:11 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -3535148000172925747 (java.lang.Long) e5c665821ef713e7dbae64c8e15dcc372e70f63e54a55236c3ca1819a85c6f4a01c865716e3d50468cbe78f96a29e558240c0cd5b3dfcf3739e3507a9ef8f46f - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 16:24:11 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:46573 -2021 Jan 24 16:24:11 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -3535148000172925747 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:46573 -2021 Jan 24 16:24:11 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 24 16:24:11 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 24 16:24:11 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 24 16:24:11 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 24 16:24:11 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -3535148000172925747 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 24 16:24:11 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -3535148000172925747 (java.lang.Long) e5c665821ef713e7dbae64c8e15dcc372e70f63e54a55236c3ca1819a85c6f4a01c865716e3d50468cbe78f96a29e558240c0cd5b3dfcf3739e3507a9ef8f46f - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 16:24:11 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -3535148000172925747 (java.lang.Long) - - - - -2021 Jan 24 16:25:05 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 24 16:25:05 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 24 16:25:05 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 1730927054864188658 (java.lang.Long) ab0bc5c898ab3722a5b1d28c9ff970c25cde54b9cbe50b9b9d4248030116150f4c4f98a5d9208bb63f3be86e4bd741cb6c16a2dbeab62c1b54c153a375b6183f - - ServiceAgent -2021 Jan 24 16:25:06 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 1730927054864188658 (java.lang.Long) ab0bc5c898ab3722a5b1d28c9ff970c25cde54b9cbe50b9b9d4248030116150f4c4f98a5d9208bb63f3be86e4bd741cb6c16a2dbeab62c1b54c153a375b6183f - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 24 16:25:06 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 1730927054864188658 (java.lang.Long) ab0bc5c898ab3722a5b1d28c9ff970c25cde54b9cbe50b9b9d4248030116150f4c4f98a5d9208bb63f3be86e4bd741cb6c16a2dbeab62c1b54c153a375b6183f - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 16:25:07 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:43925 -2021 Jan 24 16:25:07 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 1730927054864188658 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:43925 -2021 Jan 24 16:25:07 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 24 16:25:07 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 24 16:25:07 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 24 16:25:07 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 24 16:25:07 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 1730927054864188658 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 24 16:25:07 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 1730927054864188658 (java.lang.Long) ab0bc5c898ab3722a5b1d28c9ff970c25cde54b9cbe50b9b9d4248030116150f4c4f98a5d9208bb63f3be86e4bd741cb6c16a2dbeab62c1b54c153a375b6183f - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 16:25:07 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 1730927054864188658 (java.lang.Long) - - - - -2021 Jan 24 16:31:12 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 24 16:31:12 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 24 16:31:13 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 2592049687788073295 (java.lang.Long) 39566f0ba4da3ade72582ca997dc0473ce96af72f0a8e254f51c4e710ee1d265dda4cfdd9714a3cc20139f39e014862a1aacd49891f9e5d452634d49f8ba8f8e - - ServiceAgent -2021 Jan 24 16:31:13 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 2592049687788073295 (java.lang.Long) 39566f0ba4da3ade72582ca997dc0473ce96af72f0a8e254f51c4e710ee1d265dda4cfdd9714a3cc20139f39e014862a1aacd49891f9e5d452634d49f8ba8f8e - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 24 16:31:13 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 2592049687788073295 (java.lang.Long) 39566f0ba4da3ade72582ca997dc0473ce96af72f0a8e254f51c4e710ee1d265dda4cfdd9714a3cc20139f39e014862a1aacd49891f9e5d452634d49f8ba8f8e - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 16:31:14 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:40691 -2021 Jan 24 16:31:14 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 2592049687788073295 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:40691 -2021 Jan 24 16:31:14 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 24 16:31:14 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 24 16:31:14 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 24 16:31:17 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! -2021 Jan 24 16:31:17 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_55 (7555) 2592049687788073295 (java.lang.Long) 39566f0ba4da3ade72582ca997dc0473ce96af72f0a8e254f51c4e710ee1d265dda4cfdd9714a3cc20139f39e014862a1aacd49891f9e5d452634d49f8ba8f8e - - {"user":{"id":2}} -2021 Jan 24 16:31:17 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_3 (7503) 2592049687788073295 (java.lang.Long) 39566f0ba4da3ade72582ca997dc0473ce96af72f0a8e254f51c4e710ee1d265dda4cfdd9714a3cc20139f39e014862a1aacd49891f9e5d452634d49f8ba8f8e - - {"user":{"id":2}} -2021 Jan 24 16:31:17 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 24 16:31:17 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 2592049687788073295 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 24 16:31:17 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 2592049687788073295 (java.lang.Long) 39566f0ba4da3ade72582ca997dc0473ce96af72f0a8e254f51c4e710ee1d265dda4cfdd9714a3cc20139f39e014862a1aacd49891f9e5d452634d49f8ba8f8e - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 16:31:17 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 2592049687788073295 (java.lang.Long) - - - - -2021 Jan 24 17:23:01 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 24 17:23:01 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 24 17:23:02 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -8335149968131132194 (java.lang.Long) 10f394b5c1942fe7135093d0fbff6d004c9ab232e0924cc09cc89c690275f012297f1c5c0cf976abb4fb76a5ea882d9e3a527e3c9eec551864139d77032f968e - - ServiceAgent -2021 Jan 24 17:23:02 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -8335149968131132194 (java.lang.Long) 10f394b5c1942fe7135093d0fbff6d004c9ab232e0924cc09cc89c690275f012297f1c5c0cf976abb4fb76a5ea882d9e3a527e3c9eec551864139d77032f968e - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 24 17:23:02 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -8335149968131132194 (java.lang.Long) 10f394b5c1942fe7135093d0fbff6d004c9ab232e0924cc09cc89c690275f012297f1c5c0cf976abb4fb76a5ea882d9e3a527e3c9eec551864139d77032f968e - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 17:23:03 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:38417 -2021 Jan 24 17:23:03 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -8335149968131132194 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:38417 -2021 Jan 24 17:23:03 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 24 17:23:03 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 24 17:23:03 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 24 17:23:04 FINER i5.las2peer.p2p.LocalNode: SERVICE_ERROR (-7500) -8335149968131132194 (java.lang.Long) 10f394b5c1942fe7135093d0fbff6d004c9ab232e0924cc09cc89c690275f012297f1c5c0cf976abb4fb76a5ea882d9e3a527e3c9eec551864139d77032f968e - - Create project -2021 Jan 24 17:23:04 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 24 17:23:04 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -8335149968131132194 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 24 17:23:04 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -8335149968131132194 (java.lang.Long) 10f394b5c1942fe7135093d0fbff6d004c9ab232e0924cc09cc89c690275f012297f1c5c0cf976abb4fb76a5ea882d9e3a527e3c9eec551864139d77032f968e - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 17:23:04 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -8335149968131132194 (java.lang.Long) - - - - -2021 Jan 24 17:25:26 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 24 17:25:26 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 24 17:25:26 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -8483227742122078455 (java.lang.Long) 296f75fdf619c9803a52ed6feb3c207323df89f38acae82e5a10947f8bef235467765fd58fe8b4893b647923184d87e974e02207bef184f3de2eedc23a980c20 - - ServiceAgent -2021 Jan 24 17:25:27 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -8483227742122078455 (java.lang.Long) 296f75fdf619c9803a52ed6feb3c207323df89f38acae82e5a10947f8bef235467765fd58fe8b4893b647923184d87e974e02207bef184f3de2eedc23a980c20 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 24 17:25:27 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -8483227742122078455 (java.lang.Long) 296f75fdf619c9803a52ed6feb3c207323df89f38acae82e5a10947f8bef235467765fd58fe8b4893b647923184d87e974e02207bef184f3de2eedc23a980c20 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 17:25:28 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:43235 -2021 Jan 24 17:25:28 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -8483227742122078455 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:43235 -2021 Jan 24 17:25:28 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 24 17:25:28 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 24 17:25:28 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 24 17:25:29 FINER i5.las2peer.p2p.LocalNode: SERVICE_ERROR (-7500) -8483227742122078455 (java.lang.Long) 296f75fdf619c9803a52ed6feb3c207323df89f38acae82e5a10947f8bef235467765fd58fe8b4893b647923184d87e974e02207bef184f3de2eedc23a980c20 - - Create project -2021 Jan 24 17:25:29 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 24 17:25:29 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -8483227742122078455 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 24 17:25:29 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -8483227742122078455 (java.lang.Long) 296f75fdf619c9803a52ed6feb3c207323df89f38acae82e5a10947f8bef235467765fd58fe8b4893b647923184d87e974e02207bef184f3de2eedc23a980c20 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 17:25:29 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -8483227742122078455 (java.lang.Long) - - - - -2021 Jan 24 17:36:28 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 24 17:36:28 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 24 17:36:28 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 3663258393979825028 (java.lang.Long) a066a2dfdd30f5afcff92907f5dd6452d8c5d017f6759c42e46b53eb90e65eeda530240bbbaa421e9bf0d9efc7f557265cec224d43a91483d9e4fed863a1c3f0 - - ServiceAgent -2021 Jan 24 17:36:29 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 3663258393979825028 (java.lang.Long) a066a2dfdd30f5afcff92907f5dd6452d8c5d017f6759c42e46b53eb90e65eeda530240bbbaa421e9bf0d9efc7f557265cec224d43a91483d9e4fed863a1c3f0 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 24 17:36:29 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 3663258393979825028 (java.lang.Long) a066a2dfdd30f5afcff92907f5dd6452d8c5d017f6759c42e46b53eb90e65eeda530240bbbaa421e9bf0d9efc7f557265cec224d43a91483d9e4fed863a1c3f0 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 17:36:29 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:37991 -2021 Jan 24 17:36:29 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 3663258393979825028 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:37991 -2021 Jan 24 17:36:30 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 24 17:36:30 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 24 17:36:30 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 24 17:42:04 FINER i5.las2peer.p2p.LocalNode: SERVICE_ERROR (-7500) 3663258393979825028 (java.lang.Long) a066a2dfdd30f5afcff92907f5dd6452d8c5d017f6759c42e46b53eb90e65eeda530240bbbaa421e9bf0d9efc7f557265cec224d43a91483d9e4fed863a1c3f0 - - Create project -2021 Jan 24 17:42:04 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 24 17:42:04 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 3663258393979825028 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 24 17:42:04 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 3663258393979825028 (java.lang.Long) a066a2dfdd30f5afcff92907f5dd6452d8c5d017f6759c42e46b53eb90e65eeda530240bbbaa421e9bf0d9efc7f557265cec224d43a91483d9e4fed863a1c3f0 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 17:42:04 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 3663258393979825028 (java.lang.Long) - - - - -2021 Jan 24 17:42:25 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 24 17:42:25 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 24 17:42:25 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 4834079535588350955 (java.lang.Long) 1749d64c855a27346490b8ec5b45c7a474ac082abec5f1568b29e2a3868224f6d245aef8b4b693a4156b999c6835d57384fb802de98a34542222d5ce29c253ab - - ServiceAgent -2021 Jan 24 17:42:26 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 4834079535588350955 (java.lang.Long) 1749d64c855a27346490b8ec5b45c7a474ac082abec5f1568b29e2a3868224f6d245aef8b4b693a4156b999c6835d57384fb802de98a34542222d5ce29c253ab - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 24 17:42:26 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 4834079535588350955 (java.lang.Long) 1749d64c855a27346490b8ec5b45c7a474ac082abec5f1568b29e2a3868224f6d245aef8b4b693a4156b999c6835d57384fb802de98a34542222d5ce29c253ab - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 17:42:27 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:46115 -2021 Jan 24 17:42:27 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 4834079535588350955 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:46115 -2021 Jan 24 17:42:27 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 24 17:42:27 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 24 17:42:27 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 24 17:44:29 FINER i5.las2peer.p2p.LocalNode: SERVICE_ERROR (-7500) 4834079535588350955 (java.lang.Long) 1749d64c855a27346490b8ec5b45c7a474ac082abec5f1568b29e2a3868224f6d245aef8b4b693a4156b999c6835d57384fb802de98a34542222d5ce29c253ab - - Create project -2021 Jan 24 17:44:29 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 24 17:44:29 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 4834079535588350955 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 24 17:44:29 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 4834079535588350955 (java.lang.Long) 1749d64c855a27346490b8ec5b45c7a474ac082abec5f1568b29e2a3868224f6d245aef8b4b693a4156b999c6835d57384fb802de98a34542222d5ce29c253ab - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 17:44:29 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 4834079535588350955 (java.lang.Long) - - - - -2021 Jan 24 17:44:35 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 24 17:44:35 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 24 17:44:35 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -141896451122989663 (java.lang.Long) c97e2aae315ffadffa71bf2890a112c9705dab2544d84059087e445363f828ef332436389bc402b771d13556213ee953b3197c742412a7f6934cf2c562ebdae5 - - ServiceAgent -2021 Jan 24 17:44:36 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -141896451122989663 (java.lang.Long) c97e2aae315ffadffa71bf2890a112c9705dab2544d84059087e445363f828ef332436389bc402b771d13556213ee953b3197c742412a7f6934cf2c562ebdae5 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 24 17:44:36 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -141896451122989663 (java.lang.Long) c97e2aae315ffadffa71bf2890a112c9705dab2544d84059087e445363f828ef332436389bc402b771d13556213ee953b3197c742412a7f6934cf2c562ebdae5 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 17:44:37 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:43045 -2021 Jan 24 17:44:37 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -141896451122989663 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:43045 -2021 Jan 24 17:44:37 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 24 17:44:37 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 24 17:44:37 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 24 17:45:38 FINER i5.las2peer.p2p.LocalNode: SERVICE_ERROR (-7500) -141896451122989663 (java.lang.Long) c97e2aae315ffadffa71bf2890a112c9705dab2544d84059087e445363f828ef332436389bc402b771d13556213ee953b3197c742412a7f6934cf2c562ebdae5 - - Create project -2021 Jan 24 17:45:48 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 24 17:45:48 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -141896451122989663 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 24 17:45:48 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -141896451122989663 (java.lang.Long) c97e2aae315ffadffa71bf2890a112c9705dab2544d84059087e445363f828ef332436389bc402b771d13556213ee953b3197c742412a7f6934cf2c562ebdae5 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 17:45:48 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -141896451122989663 (java.lang.Long) - - - - -2021 Jan 24 18:25:28 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 24 18:25:28 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 24 18:25:29 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 4379388327573918888 (java.lang.Long) cae10332bb9c9bbfc43e882d1a6a4e9cd08a3c6bbf19a19982090e47943ea8c620ab93ed6571736f7a0eb0fa81023183612bcebd3866cce9480f12e82bea3050 - - ServiceAgent -2021 Jan 24 18:25:29 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 4379388327573918888 (java.lang.Long) cae10332bb9c9bbfc43e882d1a6a4e9cd08a3c6bbf19a19982090e47943ea8c620ab93ed6571736f7a0eb0fa81023183612bcebd3866cce9480f12e82bea3050 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 24 18:25:29 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 4379388327573918888 (java.lang.Long) cae10332bb9c9bbfc43e882d1a6a4e9cd08a3c6bbf19a19982090e47943ea8c620ab93ed6571736f7a0eb0fa81023183612bcebd3866cce9480f12e82bea3050 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 18:25:30 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:43873 -2021 Jan 24 18:25:30 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 4379388327573918888 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:43873 -2021 Jan 24 18:25:30 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 24 18:25:30 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 24 18:25:30 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 24 18:25:31 FINER i5.las2peer.p2p.LocalNode: SERVICE_ERROR (-7500) 4379388327573918888 (java.lang.Long) cae10332bb9c9bbfc43e882d1a6a4e9cd08a3c6bbf19a19982090e47943ea8c620ab93ed6571736f7a0eb0fa81023183612bcebd3866cce9480f12e82bea3050 - - Create project -2021 Jan 24 18:25:31 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 24 18:25:31 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 4379388327573918888 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 24 18:25:31 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 4379388327573918888 (java.lang.Long) cae10332bb9c9bbfc43e882d1a6a4e9cd08a3c6bbf19a19982090e47943ea8c620ab93ed6571736f7a0eb0fa81023183612bcebd3866cce9480f12e82bea3050 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 18:25:31 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 4379388327573918888 (java.lang.Long) - - - - -2021 Jan 24 18:29:59 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 24 18:29:59 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 24 18:29:59 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 3710581509298365681 (java.lang.Long) ec00ffe74126c3feb5ff606afb657ec7ee0f88a2a19d8628b5d0e5990cd81915f4045e5baf00c3335e15c38607ec70a53d7065f7a9cc8723fdac86d04becf490 - - ServiceAgent -2021 Jan 24 18:30:00 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 3710581509298365681 (java.lang.Long) ec00ffe74126c3feb5ff606afb657ec7ee0f88a2a19d8628b5d0e5990cd81915f4045e5baf00c3335e15c38607ec70a53d7065f7a9cc8723fdac86d04becf490 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 24 18:30:00 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 3710581509298365681 (java.lang.Long) ec00ffe74126c3feb5ff606afb657ec7ee0f88a2a19d8628b5d0e5990cd81915f4045e5baf00c3335e15c38607ec70a53d7065f7a9cc8723fdac86d04becf490 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 18:30:00 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:35437 -2021 Jan 24 18:30:00 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 3710581509298365681 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:35437 -2021 Jan 24 18:30:00 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 24 18:30:00 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 24 18:30:00 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 24 18:30:42 FINER i5.las2peer.p2p.LocalNode: SERVICE_ERROR (-7500) 3710581509298365681 (java.lang.Long) ec00ffe74126c3feb5ff606afb657ec7ee0f88a2a19d8628b5d0e5990cd81915f4045e5baf00c3335e15c38607ec70a53d7065f7a9cc8723fdac86d04becf490 - - Create project -2021 Jan 24 18:31:48 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 24 18:31:48 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 3710581509298365681 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 24 18:31:48 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 3710581509298365681 (java.lang.Long) ec00ffe74126c3feb5ff606afb657ec7ee0f88a2a19d8628b5d0e5990cd81915f4045e5baf00c3335e15c38607ec70a53d7065f7a9cc8723fdac86d04becf490 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 18:31:48 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 3710581509298365681 (java.lang.Long) - - - - -2021 Jan 24 18:32:00 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 24 18:32:00 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 24 18:32:00 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 2732338442939902719 (java.lang.Long) 6900135dab5c6438d12e36cd41cf2d5841dcc1f817df4cdac5c34a7817e0dbbf14c8b24a2d7efa981bb1860ab84abc023a393da4a7471e27c31c6b3b08224310 - - ServiceAgent -2021 Jan 24 18:32:01 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 2732338442939902719 (java.lang.Long) 6900135dab5c6438d12e36cd41cf2d5841dcc1f817df4cdac5c34a7817e0dbbf14c8b24a2d7efa981bb1860ab84abc023a393da4a7471e27c31c6b3b08224310 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 24 18:32:01 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 2732338442939902719 (java.lang.Long) 6900135dab5c6438d12e36cd41cf2d5841dcc1f817df4cdac5c34a7817e0dbbf14c8b24a2d7efa981bb1860ab84abc023a393da4a7471e27c31c6b3b08224310 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 18:32:02 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:45551 -2021 Jan 24 18:32:02 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 2732338442939902719 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:45551 -2021 Jan 24 18:32:02 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 24 18:32:02 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 24 18:32:02 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 24 18:33:41 FINER i5.las2peer.p2p.LocalNode: SERVICE_ERROR (-7500) 2732338442939902719 (java.lang.Long) 6900135dab5c6438d12e36cd41cf2d5841dcc1f817df4cdac5c34a7817e0dbbf14c8b24a2d7efa981bb1860ab84abc023a393da4a7471e27c31c6b3b08224310 - - Create project -2021 Jan 24 18:34:17 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 24 18:34:17 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 2732338442939902719 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 24 18:34:17 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 2732338442939902719 (java.lang.Long) 6900135dab5c6438d12e36cd41cf2d5841dcc1f817df4cdac5c34a7817e0dbbf14c8b24a2d7efa981bb1860ab84abc023a393da4a7471e27c31c6b3b08224310 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 18:34:17 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 2732338442939902719 (java.lang.Long) - - - - -2021 Jan 24 18:43:59 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 24 18:43:59 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 24 18:43:59 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -9160309062668269239 (java.lang.Long) f08001f321a3018c57bfc815f65969abb97322140c109f3db3b3ce4bc47e34e1c2e457b2b2ed6ddb81cf55271b127493c7904bb8f0c91b62ee281061e937cae8 - - ServiceAgent -2021 Jan 24 18:44:00 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -9160309062668269239 (java.lang.Long) f08001f321a3018c57bfc815f65969abb97322140c109f3db3b3ce4bc47e34e1c2e457b2b2ed6ddb81cf55271b127493c7904bb8f0c91b62ee281061e937cae8 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 24 18:44:00 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -9160309062668269239 (java.lang.Long) f08001f321a3018c57bfc815f65969abb97322140c109f3db3b3ce4bc47e34e1c2e457b2b2ed6ddb81cf55271b127493c7904bb8f0c91b62ee281061e937cae8 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 18:44:01 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:38035 -2021 Jan 24 18:44:01 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -9160309062668269239 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:38035 -2021 Jan 24 18:44:01 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 24 18:44:01 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 24 18:44:01 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 24 20:28:22 FINER i5.las2peer.p2p.LocalNode: SERVICE_ERROR (-7500) -9160309062668269239 (java.lang.Long) f08001f321a3018c57bfc815f65969abb97322140c109f3db3b3ce4bc47e34e1c2e457b2b2ed6ddb81cf55271b127493c7904bb8f0c91b62ee281061e937cae8 - - Create project -2021 Jan 24 20:28:22 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 24 20:28:22 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -9160309062668269239 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 24 20:28:22 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -9160309062668269239 (java.lang.Long) f08001f321a3018c57bfc815f65969abb97322140c109f3db3b3ce4bc47e34e1c2e457b2b2ed6ddb81cf55271b127493c7904bb8f0c91b62ee281061e937cae8 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 20:28:22 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -9160309062668269239 (java.lang.Long) - - - - -2021 Jan 24 20:54:31 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 24 20:54:31 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 24 20:54:31 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 7702652481531784330 (java.lang.Long) 682d531cf63c6d998d2ce669b9e2129583bb915e8e1b2e1cb6a5efe4b93add79d8d00b10ba31ecc6111e89f060a95aac238bffac3bfd02573a4072806c7e5203 - - ServiceAgent -2021 Jan 24 20:54:32 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 7702652481531784330 (java.lang.Long) 682d531cf63c6d998d2ce669b9e2129583bb915e8e1b2e1cb6a5efe4b93add79d8d00b10ba31ecc6111e89f060a95aac238bffac3bfd02573a4072806c7e5203 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 24 20:54:32 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 7702652481531784330 (java.lang.Long) 682d531cf63c6d998d2ce669b9e2129583bb915e8e1b2e1cb6a5efe4b93add79d8d00b10ba31ecc6111e89f060a95aac238bffac3bfd02573a4072806c7e5203 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 20:54:32 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:39333 -2021 Jan 24 20:54:32 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 7702652481531784330 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:39333 -2021 Jan 24 20:54:32 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 24 20:54:32 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 24 20:54:32 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 24 20:59:14 FINER i5.las2peer.p2p.LocalNode: SERVICE_ERROR (-7500) 7702652481531784330 (java.lang.Long) 682d531cf63c6d998d2ce669b9e2129583bb915e8e1b2e1cb6a5efe4b93add79d8d00b10ba31ecc6111e89f060a95aac238bffac3bfd02573a4072806c7e5203 - - Create project -2021 Jan 24 20:59:14 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 24 20:59:14 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 7702652481531784330 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 24 20:59:14 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 7702652481531784330 (java.lang.Long) 682d531cf63c6d998d2ce669b9e2129583bb915e8e1b2e1cb6a5efe4b93add79d8d00b10ba31ecc6111e89f060a95aac238bffac3bfd02573a4072806c7e5203 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 20:59:14 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 7702652481531784330 (java.lang.Long) - - - - -2021 Jan 24 20:59:34 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 24 20:59:34 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 24 20:59:34 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -1138992984511192225 (java.lang.Long) 3f901cb7304e78676600f42a66bffcfb4a93227b8f3bf0526f45140432d68321f04d9316d381a67f49251e71747e3ab67a19d57d3fb1e0515238c8f9dd5037bd - - ServiceAgent -2021 Jan 24 20:59:35 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -1138992984511192225 (java.lang.Long) 3f901cb7304e78676600f42a66bffcfb4a93227b8f3bf0526f45140432d68321f04d9316d381a67f49251e71747e3ab67a19d57d3fb1e0515238c8f9dd5037bd - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 24 20:59:35 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -1138992984511192225 (java.lang.Long) 3f901cb7304e78676600f42a66bffcfb4a93227b8f3bf0526f45140432d68321f04d9316d381a67f49251e71747e3ab67a19d57d3fb1e0515238c8f9dd5037bd - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 20:59:35 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:37737 -2021 Jan 24 20:59:35 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -1138992984511192225 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:37737 -2021 Jan 24 20:59:35 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 24 20:59:35 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 24 20:59:35 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 24 21:05:40 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 24 21:05:40 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 24 21:05:41 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -5367634581475145353 (java.lang.Long) da6507e341d53c36311b54d4eacb69e9244f45f8d2e2bb04de4f40903d3e5d0e1862c0f6e264c103735e41db2d3a4633749ad794e49f492ee1a456cfc4569bbd - - ServiceAgent -2021 Jan 24 21:05:42 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -5367634581475145353 (java.lang.Long) da6507e341d53c36311b54d4eacb69e9244f45f8d2e2bb04de4f40903d3e5d0e1862c0f6e264c103735e41db2d3a4633749ad794e49f492ee1a456cfc4569bbd - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 24 21:05:42 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -5367634581475145353 (java.lang.Long) da6507e341d53c36311b54d4eacb69e9244f45f8d2e2bb04de4f40903d3e5d0e1862c0f6e264c103735e41db2d3a4633749ad794e49f492ee1a456cfc4569bbd - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 21:05:42 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:43337 -2021 Jan 24 21:05:42 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -5367634581475145353 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:43337 -2021 Jan 24 21:05:42 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 24 21:05:42 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 24 21:05:42 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 24 21:07:47 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! -2021 Jan 24 21:07:47 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_5 (7505) -5367634581475145353 (java.lang.Long) da6507e341d53c36311b54d4eacb69e9244f45f8d2e2bb04de4f40903d3e5d0e1862c0f6e264c103735e41db2d3a4633749ad794e49f492ee1a456cfc4569bbd - - {"project":{"id":1,"name":"Test Project"},"user":{"id":2}} -2021 Jan 24 21:07:48 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 24 21:07:48 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -5367634581475145353 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 24 21:07:48 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -5367634581475145353 (java.lang.Long) da6507e341d53c36311b54d4eacb69e9244f45f8d2e2bb04de4f40903d3e5d0e1862c0f6e264c103735e41db2d3a4633749ad794e49f492ee1a456cfc4569bbd - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 21:07:48 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -5367634581475145353 (java.lang.Long) - - - - -2021 Jan 24 21:15:45 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 24 21:15:45 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 24 21:15:46 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -9092528362610730871 (java.lang.Long) 2d3f5767ae227d97aa39d613b839919a8cfb1b4e2f458f0a164f4453e701aa38771bc33cdb9e88a612d4a42f273e6eb06edcad09c017366c45917d4d2c319337 - - ServiceAgent -2021 Jan 24 21:15:47 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -9092528362610730871 (java.lang.Long) 2d3f5767ae227d97aa39d613b839919a8cfb1b4e2f458f0a164f4453e701aa38771bc33cdb9e88a612d4a42f273e6eb06edcad09c017366c45917d4d2c319337 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 24 21:15:47 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -9092528362610730871 (java.lang.Long) 2d3f5767ae227d97aa39d613b839919a8cfb1b4e2f458f0a164f4453e701aa38771bc33cdb9e88a612d4a42f273e6eb06edcad09c017366c45917d4d2c319337 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 21:15:47 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:40027 -2021 Jan 24 21:15:47 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -9092528362610730871 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:40027 -2021 Jan 24 21:15:47 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 24 21:15:47 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 24 21:15:47 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 24 21:19:59 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! -2021 Jan 24 21:19:59 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_5 (7505) -9092528362610730871 (java.lang.Long) 2d3f5767ae227d97aa39d613b839919a8cfb1b4e2f458f0a164f4453e701aa38771bc33cdb9e88a612d4a42f273e6eb06edcad09c017366c45917d4d2c319337 - - {"project":{"id":2,"name":"Test Project"},"user":{"id":2}} -2021 Jan 24 21:21:27 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 24 21:21:27 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -9092528362610730871 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 24 21:21:27 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -9092528362610730871 (java.lang.Long) 2d3f5767ae227d97aa39d613b839919a8cfb1b4e2f458f0a164f4453e701aa38771bc33cdb9e88a612d4a42f273e6eb06edcad09c017366c45917d4d2c319337 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 21:21:27 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -9092528362610730871 (java.lang.Long) - - - - -2021 Jan 24 21:22:53 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 24 21:22:53 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 24 21:22:53 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 1343330722104043295 (java.lang.Long) 897eb314f53353aa2cbbed48ee39bb6b15d75eaf6f240113f49e40ea5b02473d53d4162a25de274bb7bee973b5fa07ce77fa96529440b0399f6d699723bb502e - - ServiceAgent -2021 Jan 24 21:22:54 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 1343330722104043295 (java.lang.Long) 897eb314f53353aa2cbbed48ee39bb6b15d75eaf6f240113f49e40ea5b02473d53d4162a25de274bb7bee973b5fa07ce77fa96529440b0399f6d699723bb502e - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 24 21:22:54 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 1343330722104043295 (java.lang.Long) 897eb314f53353aa2cbbed48ee39bb6b15d75eaf6f240113f49e40ea5b02473d53d4162a25de274bb7bee973b5fa07ce77fa96529440b0399f6d699723bb502e - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 21:22:55 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:34555 -2021 Jan 24 21:22:55 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 1343330722104043295 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:34555 -2021 Jan 24 21:22:55 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 24 21:22:55 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 24 21:22:55 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 24 21:22:58 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! -2021 Jan 24 21:22:58 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_5 (7505) 1343330722104043295 (java.lang.Long) 897eb314f53353aa2cbbed48ee39bb6b15d75eaf6f240113f49e40ea5b02473d53d4162a25de274bb7bee973b5fa07ce77fa96529440b0399f6d699723bb502e - - {"project":{"id":3,"name":"Test Project"},"user":{"id":2}} -2021 Jan 24 21:22:58 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 24 21:22:58 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 1343330722104043295 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 24 21:22:58 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 1343330722104043295 (java.lang.Long) 897eb314f53353aa2cbbed48ee39bb6b15d75eaf6f240113f49e40ea5b02473d53d4162a25de274bb7bee973b5fa07ce77fa96529440b0399f6d699723bb502e - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 21:22:58 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 1343330722104043295 (java.lang.Long) - - - - -2021 Jan 24 21:23:58 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 24 21:23:58 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 24 21:23:58 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -6964921055090057937 (java.lang.Long) 2ffee52822ddd07a14930011ea1c5b1c6f9902e5f6dda8b9d6ca0aa4f4e597a9aed69c50d01783c8dd42f1b81974627d82f8166da16ee1547867358478534540 - - ServiceAgent -2021 Jan 24 21:23:59 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -6964921055090057937 (java.lang.Long) 2ffee52822ddd07a14930011ea1c5b1c6f9902e5f6dda8b9d6ca0aa4f4e597a9aed69c50d01783c8dd42f1b81974627d82f8166da16ee1547867358478534540 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 24 21:23:59 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -6964921055090057937 (java.lang.Long) 2ffee52822ddd07a14930011ea1c5b1c6f9902e5f6dda8b9d6ca0aa4f4e597a9aed69c50d01783c8dd42f1b81974627d82f8166da16ee1547867358478534540 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 21:23:59 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:44833 -2021 Jan 24 21:23:59 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -6964921055090057937 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:44833 -2021 Jan 24 21:23:59 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 24 21:23:59 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 24 21:23:59 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 24 21:24:02 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! -2021 Jan 24 21:24:02 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_5 (7505) -6964921055090057937 (java.lang.Long) 2ffee52822ddd07a14930011ea1c5b1c6f9902e5f6dda8b9d6ca0aa4f4e597a9aed69c50d01783c8dd42f1b81974627d82f8166da16ee1547867358478534540 - - {"project":{"id":4,"name":"Test Project"},"user":{"id":2}} -2021 Jan 24 21:24:03 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 24 21:24:03 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -6964921055090057937 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 24 21:24:03 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -6964921055090057937 (java.lang.Long) 2ffee52822ddd07a14930011ea1c5b1c6f9902e5f6dda8b9d6ca0aa4f4e597a9aed69c50d01783c8dd42f1b81974627d82f8166da16ee1547867358478534540 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 21:24:03 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -6964921055090057937 (java.lang.Long) - - - - -2021 Jan 24 22:42:42 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 24 22:42:42 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 24 22:42:42 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -2345002620162797745 (java.lang.Long) e148fa14e2d5b98bb361d087136f7bf180fc18706d381b867463bc1b41f613ddcfac56387816d22ee13c09bec414954bc2c2a8d5d176ffdfb40b0be7e5ffd269 - - ServiceAgent -2021 Jan 24 22:42:43 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -2345002620162797745 (java.lang.Long) e148fa14e2d5b98bb361d087136f7bf180fc18706d381b867463bc1b41f613ddcfac56387816d22ee13c09bec414954bc2c2a8d5d176ffdfb40b0be7e5ffd269 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 24 22:42:43 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -2345002620162797745 (java.lang.Long) e148fa14e2d5b98bb361d087136f7bf180fc18706d381b867463bc1b41f613ddcfac56387816d22ee13c09bec414954bc2c2a8d5d176ffdfb40b0be7e5ffd269 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 22:42:43 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:44199 -2021 Jan 24 22:42:43 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -2345002620162797745 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:44199 -2021 Jan 24 22:42:43 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 24 22:42:43 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 24 22:42:43 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 24 22:42:44 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_3 (7503) -2345002620162797745 (java.lang.Long) e148fa14e2d5b98bb361d087136f7bf180fc18706d381b867463bc1b41f613ddcfac56387816d22ee13c09bec414954bc2c2a8d5d176ffdfb40b0be7e5ffd269 - - {"user":{"id":2}} -2021 Jan 24 22:42:44 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 24 22:42:44 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -2345002620162797745 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 24 22:42:44 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -2345002620162797745 (java.lang.Long) e148fa14e2d5b98bb361d087136f7bf180fc18706d381b867463bc1b41f613ddcfac56387816d22ee13c09bec414954bc2c2a8d5d176ffdfb40b0be7e5ffd269 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 22:42:44 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -2345002620162797745 (java.lang.Long) - - - - -2021 Jan 24 22:44:08 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 24 22:44:08 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 24 22:44:08 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -8218642141943480738 (java.lang.Long) 0cefdafae713e9d75ae6a928349843d200888f4f923b7c41789dffac1d4c9a8e95f4a84bdae6402e0631e991af2567e0fa40a9d5b55a694cb2b27b19333e38ee - - ServiceAgent -2021 Jan 24 22:44:09 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -8218642141943480738 (java.lang.Long) 0cefdafae713e9d75ae6a928349843d200888f4f923b7c41789dffac1d4c9a8e95f4a84bdae6402e0631e991af2567e0fa40a9d5b55a694cb2b27b19333e38ee - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 24 22:44:09 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -8218642141943480738 (java.lang.Long) 0cefdafae713e9d75ae6a928349843d200888f4f923b7c41789dffac1d4c9a8e95f4a84bdae6402e0631e991af2567e0fa40a9d5b55a694cb2b27b19333e38ee - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 22:44:09 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:40407 -2021 Jan 24 22:44:09 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -8218642141943480738 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:40407 -2021 Jan 24 22:44:09 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 24 22:44:09 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 24 22:44:09 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 24 22:44:10 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_3 (7503) -8218642141943480738 (java.lang.Long) 0cefdafae713e9d75ae6a928349843d200888f4f923b7c41789dffac1d4c9a8e95f4a84bdae6402e0631e991af2567e0fa40a9d5b55a694cb2b27b19333e38ee - - {"user":{"id":2}} -2021 Jan 24 22:44:10 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 24 22:44:10 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -8218642141943480738 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 24 22:44:10 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -8218642141943480738 (java.lang.Long) 0cefdafae713e9d75ae6a928349843d200888f4f923b7c41789dffac1d4c9a8e95f4a84bdae6402e0631e991af2567e0fa40a9d5b55a694cb2b27b19333e38ee - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 22:44:10 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -8218642141943480738 (java.lang.Long) - - - - -2021 Jan 24 22:45:38 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 24 22:45:38 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 24 22:45:38 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 1373571076507877271 (java.lang.Long) 49567caabf8c7bfaca91f24bf9bac6223a5b59d8b4459bff39c39c1a0b298dc3cc1980988c99e556b1c60e46eec92c938fa1970c0143307bcf6fa333754c7ac6 - - ServiceAgent -2021 Jan 24 22:45:39 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 1373571076507877271 (java.lang.Long) 49567caabf8c7bfaca91f24bf9bac6223a5b59d8b4459bff39c39c1a0b298dc3cc1980988c99e556b1c60e46eec92c938fa1970c0143307bcf6fa333754c7ac6 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 24 22:45:39 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 1373571076507877271 (java.lang.Long) 49567caabf8c7bfaca91f24bf9bac6223a5b59d8b4459bff39c39c1a0b298dc3cc1980988c99e556b1c60e46eec92c938fa1970c0143307bcf6fa333754c7ac6 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 22:45:39 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:34453 -2021 Jan 24 22:45:39 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 1373571076507877271 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:34453 -2021 Jan 24 22:45:39 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 24 22:45:39 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 24 22:45:39 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 24 22:45:43 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! -2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_5 (7505) 1373571076507877271 (java.lang.Long) 49567caabf8c7bfaca91f24bf9bac6223a5b59d8b4459bff39c39c1a0b298dc3cc1980988c99e556b1c60e46eec92c938fa1970c0143307bcf6fa333754c7ac6 - - {"project":{"id":5,"name":"Test Project"},"user":{"id":2}} -2021 Jan 24 22:45:43 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 1373571076507877271 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 1373571076507877271 (java.lang.Long) 49567caabf8c7bfaca91f24bf9bac6223a5b59d8b4459bff39c39c1a0b298dc3cc1980988c99e556b1c60e46eec92c938fa1970c0143307bcf6fa333754c7ac6 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 1373571076507877271 (java.lang.Long) - - - - -2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 7306620935816227524 (java.lang.Long) 5374713dae0d0d8e5325ccd4b6fbd535bc925b9960c522c60424a9d251743a4500583f16f5342dccca1c09f6ef7e99fed1be9059a2a65ff19b4d8e3b285b3e46 - - ServiceAgent -2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 7306620935816227524 (java.lang.Long) 5374713dae0d0d8e5325ccd4b6fbd535bc925b9960c522c60424a9d251743a4500583f16f5342dccca1c09f6ef7e99fed1be9059a2a65ff19b4d8e3b285b3e46 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 7306620935816227524 (java.lang.Long) 5374713dae0d0d8e5325ccd4b6fbd535bc925b9960c522c60424a9d251743a4500583f16f5342dccca1c09f6ef7e99fed1be9059a2a65ff19b4d8e3b285b3e46 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 22:45:43 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:46601 -2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 7306620935816227524 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:46601 -2021 Jan 24 22:45:43 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 24 22:45:43 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 24 22:45:43 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_3 (7503) 7306620935816227524 (java.lang.Long) 5374713dae0d0d8e5325ccd4b6fbd535bc925b9960c522c60424a9d251743a4500583f16f5342dccca1c09f6ef7e99fed1be9059a2a65ff19b4d8e3b285b3e46 - - {"user":{"id":2}} -2021 Jan 24 22:45:43 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 7306620935816227524 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 7306620935816227524 (java.lang.Long) 5374713dae0d0d8e5325ccd4b6fbd535bc925b9960c522c60424a9d251743a4500583f16f5342dccca1c09f6ef7e99fed1be9059a2a65ff19b4d8e3b285b3e46 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 7306620935816227524 (java.lang.Long) - - - - -2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 9088866528534090229 (java.lang.Long) c6e6e8fa7ad6b2d3cb37d39bd4f7cc1e3c88ef8b2187a46d4c4f0c688e9aaceb1a89e91ab224e85c9763b58670e04c89a0c328a88e0dcc2e8976ebd8aed801e1 - - ServiceAgent -2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 9088866528534090229 (java.lang.Long) c6e6e8fa7ad6b2d3cb37d39bd4f7cc1e3c88ef8b2187a46d4c4f0c688e9aaceb1a89e91ab224e85c9763b58670e04c89a0c328a88e0dcc2e8976ebd8aed801e1 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 24 22:45:43 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 9088866528534090229 (java.lang.Long) c6e6e8fa7ad6b2d3cb37d39bd4f7cc1e3c88ef8b2187a46d4c4f0c688e9aaceb1a89e91ab224e85c9763b58670e04c89a0c328a88e0dcc2e8976ebd8aed801e1 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 22:45:44 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector in HTTP mode running at http://localhost:43785 -2021 Jan 24 22:45:44 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 9088866528534090229 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:43785 -2021 Jan 24 22:45:44 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 24 22:45:44 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 24 22:45:44 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 24 22:45:44 INFO i5.las2peer.connectors.webConnector.WebConnector: Web-Connector has been stopped -2021 Jan 24 22:45:44 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 9088866528534090229 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 24 22:45:44 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 9088866528534090229 (java.lang.Long) c6e6e8fa7ad6b2d3cb37d39bd4f7cc1e3c88ef8b2187a46d4c4f0c688e9aaceb1a89e91ab224e85c9763b58670e04c89a0c328a88e0dcc2e8976ebd8aed801e1 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 24 22:45:44 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 9088866528534090229 (java.lang.Long) - - - - -2021 Jan 27 10:23:13 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 27 10:23:13 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 27 10:23:14 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 8683862140899858470 (java.lang.Long) 5ba184953599ab87e1dc62cc8f4c57849550d89c0065e135b1d314d301e593c0346ae386780f1b191ee62110fb4b5df7c739c79ce234b814ba7145f8043060ba - - ServiceAgent -2021 Jan 27 10:23:15 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 8683862140899858470 (java.lang.Long) 5ba184953599ab87e1dc62cc8f4c57849550d89c0065e135b1d314d301e593c0346ae386780f1b191ee62110fb4b5df7c739c79ce234b814ba7145f8043060ba - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 27 10:23:15 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 8683862140899858470 (java.lang.Long) 5ba184953599ab87e1dc62cc8f4c57849550d89c0065e135b1d314d301e593c0346ae386780f1b191ee62110fb4b5df7c739c79ce234b814ba7145f8043060ba - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 27 10:23:16 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 8683862140899858470 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:45305 -2021 Jan 27 10:23:17 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 27 10:23:17 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 27 10:23:17 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 27 10:23:20 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! -2021 Jan 27 10:23:20 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_55 (7555) 8683862140899858470 (java.lang.Long) 5ba184953599ab87e1dc62cc8f4c57849550d89c0065e135b1d314d301e593c0346ae386780f1b191ee62110fb4b5df7c739c79ce234b814ba7145f8043060ba - - {"user":{"id":2}} -2021 Jan 27 10:23:23 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! -2021 Jan 27 10:23:23 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_5 (7505) 8683862140899858470 (java.lang.Long) 5ba184953599ab87e1dc62cc8f4c57849550d89c0065e135b1d314d301e593c0346ae386780f1b191ee62110fb4b5df7c739c79ce234b814ba7145f8043060ba - - {"project":{"id":1,"name":"Test Project"},"user":{"id":2}} -2021 Jan 27 10:23:23 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 8683862140899858470 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 27 10:23:23 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 8683862140899858470 (java.lang.Long) 5ba184953599ab87e1dc62cc8f4c57849550d89c0065e135b1d314d301e593c0346ae386780f1b191ee62110fb4b5df7c739c79ce234b814ba7145f8043060ba - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 27 10:23:23 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 8683862140899858470 (java.lang.Long) - - - - -2021 Jan 27 10:23:23 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 27 10:23:23 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 27 10:23:23 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -7292386227814823786 (java.lang.Long) 1d29a1775fe24b54635a97981434623b593b8acb4c6b79a9d868ea28d6a848212011fee13064e252b471fda93195a5579839bdb99ac26c064c8ade06b04a4f3b - - ServiceAgent -2021 Jan 27 10:23:23 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -7292386227814823786 (java.lang.Long) 1d29a1775fe24b54635a97981434623b593b8acb4c6b79a9d868ea28d6a848212011fee13064e252b471fda93195a5579839bdb99ac26c064c8ade06b04a4f3b - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 27 10:23:23 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -7292386227814823786 (java.lang.Long) 1d29a1775fe24b54635a97981434623b593b8acb4c6b79a9d868ea28d6a848212011fee13064e252b471fda93195a5579839bdb99ac26c064c8ade06b04a4f3b - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 27 10:23:23 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -7292386227814823786 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:43881 -2021 Jan 27 10:23:23 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 27 10:23:23 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 27 10:23:23 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_3 (7503) -7292386227814823786 (java.lang.Long) 1d29a1775fe24b54635a97981434623b593b8acb4c6b79a9d868ea28d6a848212011fee13064e252b471fda93195a5579839bdb99ac26c064c8ade06b04a4f3b - - {"user":{"id":2}} -2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -7292386227814823786 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -7292386227814823786 (java.lang.Long) 1d29a1775fe24b54635a97981434623b593b8acb4c6b79a9d868ea28d6a848212011fee13064e252b471fda93195a5579839bdb99ac26c064c8ade06b04a4f3b - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -7292386227814823786 (java.lang.Long) - - - - -2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 811347393009207467 (java.lang.Long) 0dd42620e7dc95fe2d34652942d3eaa5ab093946decd936e60135bb408886bcb09dab407494a11a0b7408d2bed79febc9fac287d7a990e9368ac5bc2cb061e4e - - ServiceAgent -2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 811347393009207467 (java.lang.Long) 0dd42620e7dc95fe2d34652942d3eaa5ab093946decd936e60135bb408886bcb09dab407494a11a0b7408d2bed79febc9fac287d7a990e9368ac5bc2cb061e4e - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 811347393009207467 (java.lang.Long) 0dd42620e7dc95fe2d34652942d3eaa5ab093946decd936e60135bb408886bcb09dab407494a11a0b7408d2bed79febc9fac287d7a990e9368ac5bc2cb061e4e - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 811347393009207467 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:39157 -2021 Jan 27 10:23:24 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 27 10:23:24 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 27 10:23:24 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 811347393009207467 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 811347393009207467 (java.lang.Long) 0dd42620e7dc95fe2d34652942d3eaa5ab093946decd936e60135bb408886bcb09dab407494a11a0b7408d2bed79febc9fac287d7a990e9368ac5bc2cb061e4e - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 27 10:23:24 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 811347393009207467 (java.lang.Long) - - - - -2021 Jan 28 01:07:09 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 28 01:07:09 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 28 01:07:09 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -3497328785071790882 (java.lang.Long) 22884d69d6a83a992886e1d20f606abc333bb28b84902b55afbb98dd151eeed137f94025e26f21fb98d4c0d4152953365a21ba94c4977166dc61c7453917bd04 - - ServiceAgent -2021 Jan 28 01:07:10 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -3497328785071790882 (java.lang.Long) 22884d69d6a83a992886e1d20f606abc333bb28b84902b55afbb98dd151eeed137f94025e26f21fb98d4c0d4152953365a21ba94c4977166dc61c7453917bd04 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 28 01:07:10 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -3497328785071790882 (java.lang.Long) 22884d69d6a83a992886e1d20f606abc333bb28b84902b55afbb98dd151eeed137f94025e26f21fb98d4c0d4152953365a21ba94c4977166dc61c7453917bd04 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 28 01:07:11 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -3497328785071790882 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:35771 -2021 Jan 28 01:07:11 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 28 01:07:11 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 28 01:07:11 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 28 01:07:15 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! -2021 Jan 28 01:07:15 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_5 (7505) -3497328785071790882 (java.lang.Long) 22884d69d6a83a992886e1d20f606abc333bb28b84902b55afbb98dd151eeed137f94025e26f21fb98d4c0d4152953365a21ba94c4977166dc61c7453917bd04 - - {"project":{"id":2,"name":"Test Project"},"user":{"id":2}} -2021 Jan 28 01:07:15 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -3497328785071790882 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 28 01:07:15 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -3497328785071790882 (java.lang.Long) 22884d69d6a83a992886e1d20f606abc333bb28b84902b55afbb98dd151eeed137f94025e26f21fb98d4c0d4152953365a21ba94c4977166dc61c7453917bd04 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 28 01:07:15 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -3497328785071790882 (java.lang.Long) - - - - -2021 Jan 28 01:08:57 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 28 01:08:57 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 28 01:08:58 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 554353377921291446 (java.lang.Long) e8de7c44c6fa27bebeca654e900c6940d63ab83648ed13c1affb2addb1330b9d8ef6cf589b3d12beb200012fbb3761d4cb0d2eb4eb8cebde0176824c89e99c0a - - ServiceAgent -2021 Jan 28 01:08:59 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 554353377921291446 (java.lang.Long) e8de7c44c6fa27bebeca654e900c6940d63ab83648ed13c1affb2addb1330b9d8ef6cf589b3d12beb200012fbb3761d4cb0d2eb4eb8cebde0176824c89e99c0a - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 28 01:08:59 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 554353377921291446 (java.lang.Long) e8de7c44c6fa27bebeca654e900c6940d63ab83648ed13c1affb2addb1330b9d8ef6cf589b3d12beb200012fbb3761d4cb0d2eb4eb8cebde0176824c89e99c0a - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 28 01:08:59 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 554353377921291446 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:36339 -2021 Jan 28 01:08:59 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 28 01:08:59 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 28 01:08:59 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 28 01:09:03 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! -2021 Jan 28 01:09:03 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_5 (7505) 554353377921291446 (java.lang.Long) e8de7c44c6fa27bebeca654e900c6940d63ab83648ed13c1affb2addb1330b9d8ef6cf589b3d12beb200012fbb3761d4cb0d2eb4eb8cebde0176824c89e99c0a - - {"project":{"id":3,"name":"Test Project"},"user":{"id":2}} -2021 Jan 28 01:09:03 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 554353377921291446 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 28 01:09:03 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 554353377921291446 (java.lang.Long) e8de7c44c6fa27bebeca654e900c6940d63ab83648ed13c1affb2addb1330b9d8ef6cf589b3d12beb200012fbb3761d4cb0d2eb4eb8cebde0176824c89e99c0a - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 28 01:09:03 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 554353377921291446 (java.lang.Long) - - - - -2021 Jan 28 01:11:01 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 28 01:11:01 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 28 01:11:02 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) 8985852743585839748 (java.lang.Long) 2aee5f3b117aedba11c50345661b282bb632bdd3f2dcee87dc60e30842295b4f934818bb700c2e9d29a6c4daed0365ff63320eb556d0796b51999827d6a420f2 - - ServiceAgent -2021 Jan 28 01:11:02 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) 8985852743585839748 (java.lang.Long) 2aee5f3b117aedba11c50345661b282bb632bdd3f2dcee87dc60e30842295b4f934818bb700c2e9d29a6c4daed0365ff63320eb556d0796b51999827d6a420f2 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 28 01:11:02 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) 8985852743585839748 (java.lang.Long) 2aee5f3b117aedba11c50345661b282bb632bdd3f2dcee87dc60e30842295b4f934818bb700c2e9d29a6c4daed0365ff63320eb556d0796b51999827d6a420f2 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 28 01:11:03 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 8985852743585839748 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:41211 -2021 Jan 28 01:11:03 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 28 01:11:03 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 28 01:11:03 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 28 01:11:07 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! -2021 Jan 28 01:11:07 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_5 (7505) 8985852743585839748 (java.lang.Long) 2aee5f3b117aedba11c50345661b282bb632bdd3f2dcee87dc60e30842295b4f934818bb700c2e9d29a6c4daed0365ff63320eb556d0796b51999827d6a420f2 - - {"project":{"id":4,"name":"Test Project"},"user":{"id":2}} -2021 Jan 28 01:11:07 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) 8985852743585839748 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 28 01:11:07 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) 8985852743585839748 (java.lang.Long) 2aee5f3b117aedba11c50345661b282bb632bdd3f2dcee87dc60e30842295b4f934818bb700c2e9d29a6c4daed0365ff63320eb556d0796b51999827d6a420f2 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 28 01:11:07 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) 8985852743585839748 (java.lang.Long) - - - - -2021 Jan 28 01:57:47 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - CONFIGURED -2021 Jan 28 01:57:47 FINER i5.las2peer.p2p.LocalNode: NODE_STATUS_CHANGE (300) - - - - RUNNING -2021 Jan 28 01:57:47 FINER i5.las2peer.p2p.LocalNode: AGENT_REGISTERED (3000) -4446408542952705538 (java.lang.Long) 7a0d159ea97a5afa179bb319a6305aaff5ffa33bb27685ea983d9cf2ef27155e18da3b77ce45c86327bc4512bc7b3f18c0b845f078e2b8c4eee05ef26520da43 - - ServiceAgent -2021 Jan 28 01:57:48 FINER i5.las2peer.p2p.LocalNode: SERVICE_ADD_TO_MONITORING (7300) -4446408542952705538 (java.lang.Long) 7a0d159ea97a5afa179bb319a6305aaff5ffa33bb27685ea983d9cf2ef27155e18da3b77ce45c86327bc4512bc7b3f18c0b845f078e2b8c4eee05ef26520da43 - - {"serviceName":"de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0","serviceAlias":"bazaar"} -2021 Jan 28 01:57:48 FINER i5.las2peer.p2p.LocalNode: SERVICE_STARTUP (7000) -4446408542952705538 (java.lang.Long) 7a0d159ea97a5afa179bb319a6305aaff5ffa33bb27685ea983d9cf2ef27155e18da3b77ce45c86327bc4512bc7b3f18c0b845f078e2b8c4eee05ef26520da43 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 28 01:57:48 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -4446408542952705538 (java.lang.Long) - - - WebConnector: Web-Connector in HTTP mode running at http://localhost:41675 -2021 Jan 28 01:57:48 INFO i5.las2peer.connectors.webConnector.util.AuthenticationManager: attempting login with id: 86109d17e62c60cf01fa1e4e968e8cdc69219d59a04587648f253d71d49a3af51eea113ac37be9501cb196126b56d24de638e0d3f3c8cf1991aab89e215a3cb9 -2021 Jan 28 01:57:48 FINE i5.las2peer.connectors.webConnector.util.AuthenticationManager: passphrase accepted. Agent unlocked -2021 Jan 28 01:57:48 FINER i5.las2peer.persistency.EnvelopeVersion: Could not get service class loader using default. java.lang.IllegalStateException: Not executed in a ServiceThread environment! -2021 Jan 28 01:57:52 INFO i5.las2peer.p2p.NodeServiceCache: Timeout while updating service cache. i5.las2peer.p2p.TimeoutException: No answer received! -2021 Jan 28 01:57:52 FINER i5.las2peer.p2p.LocalNode: SERVICE_CUSTOM_MESSAGE_5 (7505) -4446408542952705538 (java.lang.Long) 7a0d159ea97a5afa179bb319a6305aaff5ffa33bb27685ea983d9cf2ef27155e18da3b77ce45c86327bc4512bc7b3f18c0b845f078e2b8c4eee05ef26520da43 - - {"project":{"id":5,"name":"Test Project"},"user":{"id":2}} -2021 Jan 28 01:57:52 FINER i5.las2peer.p2p.LocalNode: CONNECTOR_MESSAGE (9000) -4446408542952705538 (java.lang.Long) - - - WebConnector: Web-Connector has been stopped -2021 Jan 28 01:57:52 FINER i5.las2peer.p2p.LocalNode: SERVICE_SHUTDOWN (7100) -4446408542952705538 (java.lang.Long) 7a0d159ea97a5afa179bb319a6305aaff5ffa33bb27685ea983d9cf2ef27155e18da3b77ce45c86327bc4512bc7b3f18c0b845f078e2b8c4eee05ef26520da43 - - de.rwth.dbis.acis.bazaar.service.BazaarService@1.0.0 -2021 Jan 28 01:57:52 FINER i5.las2peer.p2p.LocalNode: NODE_SHUTDOWN (200) -4446408542952705538 (java.lang.Long) - - - - diff --git a/requirement_bazaar/log/service.log.0 b/requirement_bazaar/log/service.log.0 deleted file mode 100644 index a602d0f6..00000000 --- a/requirement_bazaar/log/service.log.0 +++ /dev/null @@ -1,27 +0,0 @@ -2021 Jan 24 16:31:17 FINER service: SERVICE_CUSTOM_MESSAGE_55 (7555) 2592049687788073295 (java.lang.Long) 39566f0ba4da3ade72582ca997dc0473ce96af72f0a8e254f51c4e710ee1d265dda4cfdd9714a3cc20139f39e014862a1aacd49891f9e5d452634d49f8ba8f8e - - {"user":{"id":2}} -2021 Jan 24 16:31:17 FINER service: SERVICE_CUSTOM_MESSAGE_3 (7503) 2592049687788073295 (java.lang.Long) 39566f0ba4da3ade72582ca997dc0473ce96af72f0a8e254f51c4e710ee1d265dda4cfdd9714a3cc20139f39e014862a1aacd49891f9e5d452634d49f8ba8f8e - - {"user":{"id":2}} -2021 Jan 24 17:23:04 FINER service: SERVICE_ERROR (-7500) -8335149968131132194 (java.lang.Long) 10f394b5c1942fe7135093d0fbff6d004c9ab232e0924cc09cc89c690275f012297f1c5c0cf976abb4fb76a5ea882d9e3a527e3c9eec551864139d77032f968e - - Create project -2021 Jan 24 17:25:29 FINER service: SERVICE_ERROR (-7500) -8483227742122078455 (java.lang.Long) 296f75fdf619c9803a52ed6feb3c207323df89f38acae82e5a10947f8bef235467765fd58fe8b4893b647923184d87e974e02207bef184f3de2eedc23a980c20 - - Create project -2021 Jan 24 17:42:04 FINER service: SERVICE_ERROR (-7500) 3663258393979825028 (java.lang.Long) a066a2dfdd30f5afcff92907f5dd6452d8c5d017f6759c42e46b53eb90e65eeda530240bbbaa421e9bf0d9efc7f557265cec224d43a91483d9e4fed863a1c3f0 - - Create project -2021 Jan 24 17:44:29 FINER service: SERVICE_ERROR (-7500) 4834079535588350955 (java.lang.Long) 1749d64c855a27346490b8ec5b45c7a474ac082abec5f1568b29e2a3868224f6d245aef8b4b693a4156b999c6835d57384fb802de98a34542222d5ce29c253ab - - Create project -2021 Jan 24 17:45:38 FINER service: SERVICE_ERROR (-7500) -141896451122989663 (java.lang.Long) c97e2aae315ffadffa71bf2890a112c9705dab2544d84059087e445363f828ef332436389bc402b771d13556213ee953b3197c742412a7f6934cf2c562ebdae5 - - Create project -2021 Jan 24 18:25:31 FINER service: SERVICE_ERROR (-7500) 4379388327573918888 (java.lang.Long) cae10332bb9c9bbfc43e882d1a6a4e9cd08a3c6bbf19a19982090e47943ea8c620ab93ed6571736f7a0eb0fa81023183612bcebd3866cce9480f12e82bea3050 - - Create project -2021 Jan 24 18:30:42 FINER service: SERVICE_ERROR (-7500) 3710581509298365681 (java.lang.Long) ec00ffe74126c3feb5ff606afb657ec7ee0f88a2a19d8628b5d0e5990cd81915f4045e5baf00c3335e15c38607ec70a53d7065f7a9cc8723fdac86d04becf490 - - Create project -2021 Jan 24 18:33:41 FINER service: SERVICE_ERROR (-7500) 2732338442939902719 (java.lang.Long) 6900135dab5c6438d12e36cd41cf2d5841dcc1f817df4cdac5c34a7817e0dbbf14c8b24a2d7efa981bb1860ab84abc023a393da4a7471e27c31c6b3b08224310 - - Create project -2021 Jan 24 20:28:22 FINER service: SERVICE_ERROR (-7500) -9160309062668269239 (java.lang.Long) f08001f321a3018c57bfc815f65969abb97322140c109f3db3b3ce4bc47e34e1c2e457b2b2ed6ddb81cf55271b127493c7904bb8f0c91b62ee281061e937cae8 - - Create project -2021 Jan 24 20:59:14 FINER service: SERVICE_ERROR (-7500) 7702652481531784330 (java.lang.Long) 682d531cf63c6d998d2ce669b9e2129583bb915e8e1b2e1cb6a5efe4b93add79d8d00b10ba31ecc6111e89f060a95aac238bffac3bfd02573a4072806c7e5203 - - Create project -2021 Jan 24 21:07:47 FINER service: SERVICE_CUSTOM_MESSAGE_5 (7505) -5367634581475145353 (java.lang.Long) da6507e341d53c36311b54d4eacb69e9244f45f8d2e2bb04de4f40903d3e5d0e1862c0f6e264c103735e41db2d3a4633749ad794e49f492ee1a456cfc4569bbd - - {"project":{"id":1,"name":"Test Project"},"user":{"id":2}} -2021 Jan 24 21:19:59 FINER service: SERVICE_CUSTOM_MESSAGE_5 (7505) -9092528362610730871 (java.lang.Long) 2d3f5767ae227d97aa39d613b839919a8cfb1b4e2f458f0a164f4453e701aa38771bc33cdb9e88a612d4a42f273e6eb06edcad09c017366c45917d4d2c319337 - - {"project":{"id":2,"name":"Test Project"},"user":{"id":2}} -2021 Jan 24 21:22:58 FINER service: SERVICE_CUSTOM_MESSAGE_5 (7505) 1343330722104043295 (java.lang.Long) 897eb314f53353aa2cbbed48ee39bb6b15d75eaf6f240113f49e40ea5b02473d53d4162a25de274bb7bee973b5fa07ce77fa96529440b0399f6d699723bb502e - - {"project":{"id":3,"name":"Test Project"},"user":{"id":2}} -2021 Jan 24 21:24:02 FINER service: SERVICE_CUSTOM_MESSAGE_5 (7505) -6964921055090057937 (java.lang.Long) 2ffee52822ddd07a14930011ea1c5b1c6f9902e5f6dda8b9d6ca0aa4f4e597a9aed69c50d01783c8dd42f1b81974627d82f8166da16ee1547867358478534540 - - {"project":{"id":4,"name":"Test Project"},"user":{"id":2}} -2021 Jan 24 22:42:44 FINER service: SERVICE_CUSTOM_MESSAGE_3 (7503) -2345002620162797745 (java.lang.Long) e148fa14e2d5b98bb361d087136f7bf180fc18706d381b867463bc1b41f613ddcfac56387816d22ee13c09bec414954bc2c2a8d5d176ffdfb40b0be7e5ffd269 - - {"user":{"id":2}} -2021 Jan 24 22:44:10 FINER service: SERVICE_CUSTOM_MESSAGE_3 (7503) -8218642141943480738 (java.lang.Long) 0cefdafae713e9d75ae6a928349843d200888f4f923b7c41789dffac1d4c9a8e95f4a84bdae6402e0631e991af2567e0fa40a9d5b55a694cb2b27b19333e38ee - - {"user":{"id":2}} -2021 Jan 24 22:45:43 FINER service: SERVICE_CUSTOM_MESSAGE_5 (7505) 1373571076507877271 (java.lang.Long) 49567caabf8c7bfaca91f24bf9bac6223a5b59d8b4459bff39c39c1a0b298dc3cc1980988c99e556b1c60e46eec92c938fa1970c0143307bcf6fa333754c7ac6 - - {"project":{"id":5,"name":"Test Project"},"user":{"id":2}} -2021 Jan 24 22:45:43 FINER service: SERVICE_CUSTOM_MESSAGE_3 (7503) 7306620935816227524 (java.lang.Long) 5374713dae0d0d8e5325ccd4b6fbd535bc925b9960c522c60424a9d251743a4500583f16f5342dccca1c09f6ef7e99fed1be9059a2a65ff19b4d8e3b285b3e46 - - {"user":{"id":2}} -2021 Jan 27 10:23:20 FINER service: SERVICE_CUSTOM_MESSAGE_55 (7555) 8683862140899858470 (java.lang.Long) 5ba184953599ab87e1dc62cc8f4c57849550d89c0065e135b1d314d301e593c0346ae386780f1b191ee62110fb4b5df7c739c79ce234b814ba7145f8043060ba - - {"user":{"id":2}} -2021 Jan 27 10:23:23 FINER service: SERVICE_CUSTOM_MESSAGE_5 (7505) 8683862140899858470 (java.lang.Long) 5ba184953599ab87e1dc62cc8f4c57849550d89c0065e135b1d314d301e593c0346ae386780f1b191ee62110fb4b5df7c739c79ce234b814ba7145f8043060ba - - {"project":{"id":1,"name":"Test Project"},"user":{"id":2}} -2021 Jan 27 10:23:24 FINER service: SERVICE_CUSTOM_MESSAGE_3 (7503) -7292386227814823786 (java.lang.Long) 1d29a1775fe24b54635a97981434623b593b8acb4c6b79a9d868ea28d6a848212011fee13064e252b471fda93195a5579839bdb99ac26c064c8ade06b04a4f3b - - {"user":{"id":2}} -2021 Jan 28 01:07:15 FINER service: SERVICE_CUSTOM_MESSAGE_5 (7505) -3497328785071790882 (java.lang.Long) 22884d69d6a83a992886e1d20f606abc333bb28b84902b55afbb98dd151eeed137f94025e26f21fb98d4c0d4152953365a21ba94c4977166dc61c7453917bd04 - - {"project":{"id":2,"name":"Test Project"},"user":{"id":2}} -2021 Jan 28 01:09:03 FINER service: SERVICE_CUSTOM_MESSAGE_5 (7505) 554353377921291446 (java.lang.Long) e8de7c44c6fa27bebeca654e900c6940d63ab83648ed13c1affb2addb1330b9d8ef6cf589b3d12beb200012fbb3761d4cb0d2eb4eb8cebde0176824c89e99c0a - - {"project":{"id":3,"name":"Test Project"},"user":{"id":2}} -2021 Jan 28 01:11:07 FINER service: SERVICE_CUSTOM_MESSAGE_5 (7505) 8985852743585839748 (java.lang.Long) 2aee5f3b117aedba11c50345661b282bb632bdd3f2dcee87dc60e30842295b4f934818bb700c2e9d29a6c4daed0365ff63320eb556d0796b51999827d6a420f2 - - {"project":{"id":4,"name":"Test Project"},"user":{"id":2}} -2021 Jan 28 01:57:52 FINER service: SERVICE_CUSTOM_MESSAGE_5 (7505) -4446408542952705538 (java.lang.Long) 7a0d159ea97a5afa179bb319a6305aaff5ffa33bb27685ea983d9cf2ef27155e18da3b77ce45c86327bc4512bc7b3f18c0b845f078e2b8c4eee05ef26520da43 - - {"project":{"id":5,"name":"Test Project"},"user":{"id":2}} From 50ea1e30218878d603fee08c7fa81726be0f1a39 Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 30 Jan 2021 18:27:20 +0100 Subject: [PATCH 035/134] Fix date serialization issues introduced by localdatetime --- .../dbis/acis/bazaar/service/BazaarFunction.java | 1 - .../bazaar/service/BazaarFunctionRegistrar.java | 1 - .../acis/bazaar/service/CategoryResource.java | 2 +- .../acis/bazaar/service/ProjectsResource.java | 4 ++-- .../dbis/acis/bazaar/service/dal/DALFacade.java | 1 - .../acis/bazaar/service/dal/DALFacadeImpl.java | 1 - .../bazaar/service/dal/entities/Activity.java | 9 ++++++++- .../bazaar/service/dal/entities/Attachment.java | 12 ++++++++++-- .../bazaar/service/dal/entities/Category.java | 13 ++++++++++--- .../bazaar/service/dal/entities/Comment.java | 13 ++++++++++--- .../bazaar/service/dal/entities/EntityBase.java | 1 - .../service/dal/entities/EntityContext.java | 1 - .../service/dal/entities/EntityOverview.java | 1 - .../service/dal/entities/IdentifiedById.java | 1 - .../dal/entities/PersonalisationData.java | 1 - .../bazaar/service/dal/entities/Privilege.java | 1 - .../service/dal/entities/PrivilegeEnum.java | 1 - .../bazaar/service/dal/entities/Project.java | 13 ++++++++++--- .../bazaar/service/dal/entities/Requirement.java | 16 +++++++++++++--- .../dal/entities/RequirementCategory.java | 1 - .../dal/entities/RequirementDeveloper.java | 1 - .../dal/entities/RequirementFollower.java | 1 - .../acis/bazaar/service/dal/entities/Role.java | 1 - .../acis/bazaar/service/dal/entities/User.java | 16 +++++++++++++--- .../acis/bazaar/service/dal/entities/Vote.java | 1 - .../service/dal/helpers/CreationStatus.java | 1 - .../bazaar/service/dal/helpers/Pageable.java | 1 - .../bazaar/service/dal/helpers/UserVote.java | 2 -- .../repositories/AttachmentRepositoryImpl.java | 1 - .../dal/repositories/CategoryRepository.java | 1 - .../dal/repositories/CommentRepository.java | 2 -- .../dal/repositories/PrivilegeRepository.java | 1 - .../repositories/PrivilegeRepositoryImpl.java | 1 - .../dal/repositories/ProjectRepository.java | 1 - .../dal/repositories/ProjectRepositoryImpl.java | 1 - .../service/dal/repositories/Repository.java | 1 - .../service/dal/repositories/RepositoryImpl.java | 1 - .../RequirementCategoryRepository.java | 1 - .../RequirementCategoryRepositoryImpl.java | 1 - .../RequirementDeveloperRepository.java | 1 - .../RequirementDeveloperRepositoryImpl.java | 1 - .../RequirementFollowerRepository.java | 1 - .../RequirementFollowerRepositoryImpl.java | 1 - .../service/dal/repositories/RoleRepository.java | 1 - .../dal/repositories/RoleRepositoryImpl.java | 1 - .../service/dal/repositories/UserRepository.java | 1 - .../dal/repositories/UserRepositoryImpl.java | 1 - .../service/dal/repositories/VoteRepository.java | 1 - .../dal/repositories/VoteRepositoryImpl.java | 1 - .../dal/transform/CategoryTransformer.java | 1 - .../dal/transform/CommentTransformer.java | 1 - .../PersonalisationDataTransformer.java | 1 - .../dal/transform/PrivilegeTransformer.java | 2 -- .../RequirementCategoryTransformer.java | 1 - .../RequirementDeveloperTransformer.java | 1 - .../RequirementFollowerTransformer.java | 1 - .../service/dal/transform/RoleTransformer.java | 3 +-- .../service/dal/transform/Transformer.java | 1 - .../service/dal/transform/VoteTransformer.java | 1 - .../service/exception/BazaarException.java | 1 - .../acis/bazaar/service/exception/ErrorCode.java | 1 - .../service/exception/ExceptionHandler.java | 1 - .../service/exception/ExceptionLocation.java | 1 - .../service/internalization/Localization.java | 3 +-- .../service/security/AuthorizationManager.java | 1 - .../dbis/acis/bazaar/service/BazaarTest.java | 4 +++- .../rwth/dbis/acis/bazaar/service/TestBase.java | 3 ++- 67 files changed, 84 insertions(+), 84 deletions(-) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarFunction.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarFunction.java index 1f635169..a6fd44af 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarFunction.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarFunction.java @@ -21,7 +21,6 @@ package de.rwth.dbis.acis.bazaar.service; /** - * @author Adam Gavronek * @since 1/9/2015 */ public enum BazaarFunction { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarFunctionRegistrar.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarFunctionRegistrar.java index 28d48358..70d7e925 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarFunctionRegistrar.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarFunctionRegistrar.java @@ -23,7 +23,6 @@ import java.util.EnumSet; /** - * @author Adam Gavronek * @since 1/9/2015 */ public interface BazaarFunctionRegistrar { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java index 90f08b7c..78a27024 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java @@ -225,7 +225,7 @@ public Response getCategory(@PathParam("categoryId") int categoryId) { * @return Response with the created project as a JSON object. */ @POST - //@Path("/") + @Path("/") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "This method allows to create a new category under a given a project.") diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java index 3cd06a70..bac10215 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java @@ -68,7 +68,7 @@ public ProjectsResource() throws Exception { * @return Response with list of all projects */ @GET - //@Path("/") + @Path("/") @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "This method returns the list of projects on the server.") @ApiResponses(value = { @@ -237,7 +237,7 @@ public Response getProject(@PathParam("projectId") int projectId) { * @return Response with the created project as a JSON object. */ @POST - //@Path("/") + @Path("/") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "This method allows to create a new project.") diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java index ddf4c952..0d7c237b 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java @@ -453,7 +453,6 @@ public interface DALFacade { /** * @param pageable pagination information - * @param includeContext include context of comment * @return the set of comments */ PaginationResult listAllComments(Pageable pageable) throws BazaarException; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index ea9253eb..e7363b5f 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -43,7 +43,6 @@ import java.util.List; /** - * @author Adam Gavronek * @since 6/14/2014 */ public class DALFacadeImpl implements DALFacade { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java index ddaa33b2..a86337d7 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java @@ -3,6 +3,10 @@ import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import java.time.LocalDateTime; import java.util.Date; @@ -11,8 +15,11 @@ public class Activity extends EntityBase { private final transient int id; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) private final LocalDateTime creationDate; + private final ActivityAction activityAction; private final String dataUrl; private final DataType dataType; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java index 2486025b..aa7591fd 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java @@ -21,6 +21,10 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import jodd.vtor.constraint.MaxLength; import jodd.vtor.constraint.Min; import jodd.vtor.constraint.NotBlank; @@ -60,10 +64,14 @@ public class Attachment extends EntityBase { private User creator; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime lastUpdatedDate; public Attachment() { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java index bf900709..243a1088 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java @@ -23,6 +23,10 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import jodd.vtor.constraint.MaxLength; import jodd.vtor.constraint.Min; import jodd.vtor.constraint.NotBlank; @@ -32,7 +36,6 @@ import java.util.Date; /** - * @author Adam Gavronek * @since 6/9/2014 */ public class Category extends EntityBase { @@ -53,10 +56,14 @@ public class Category extends EntityBase { private User leader; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime lastUpdatedDate; private Integer numberOfRequirements; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java index 801ef19b..aced88ce 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java @@ -23,6 +23,10 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import jodd.vtor.constraint.Min; import jodd.vtor.constraint.NotBlank; import jodd.vtor.constraint.NotNull; @@ -31,7 +35,6 @@ import java.util.Date; /** - * @author Adam Gavronek * @since 6/11/2014 */ public class Comment extends EntityBase { @@ -49,10 +52,14 @@ public class Comment extends EntityBase { private User creator; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime lastUpdatedDate; @JsonProperty("_context") diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityBase.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityBase.java index f7027257..5a1c40b8 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityBase.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityBase.java @@ -25,7 +25,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; /** - * @author Adam Gavronek * @since 9/16/2014 */ public abstract class EntityBase implements IdentifiedById { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java index d3dc26a0..dda2dfaa 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java @@ -28,7 +28,6 @@ import java.util.List; /** - * @author Milan Deruelle * @since 30/01/2020 */ public class EntityContext { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java index 816a7fac..c862857e 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java @@ -28,7 +28,6 @@ import java.util.List; /** - * @author Milan Deruelle * @since 22/01/2020 */ public class EntityOverview { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/IdentifiedById.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/IdentifiedById.java index 70e65d51..077b68d9 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/IdentifiedById.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/IdentifiedById.java @@ -21,7 +21,6 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; /** - * @author Adam Gavronek * @since 6/9/2014 */ public interface IdentifiedById { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java index 1d649196..bce298ac 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java @@ -30,7 +30,6 @@ import javax.validation.constraints.Null; /** - * @author Milan Deruelle * @since 26/11/2019 */ public class PersonalisationData extends EntityBase { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Privilege.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Privilege.java index bf09ebc6..861bbc8d 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Privilege.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Privilege.java @@ -21,7 +21,6 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; /** - * @author Adam Gavronek * @since 2/17/2015 */ public class Privilege extends EntityBase { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java index 0493a646..c523e197 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java @@ -21,7 +21,6 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; /** - * @author Adam Gavronek * @since 2/17/2015 */ public enum PrivilegeEnum { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java index 7236bbd4..47105da6 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java @@ -22,6 +22,10 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import jodd.vtor.constraint.MaxLength; import jodd.vtor.constraint.NotBlank; import jodd.vtor.constraint.NotNull; @@ -30,7 +34,6 @@ import java.util.Date; /** - * @author Adam Gavronek * @since 6/9/2014 */ public class Project extends EntityBase { @@ -52,10 +55,14 @@ public class Project extends EntityBase { private User leader; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone="Europe/Berlin") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone="Europe/Berlin") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime lastUpdatedDate; private Integer numberOfCategories; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java index f044ebba..ebe4588d 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java @@ -3,6 +3,10 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import de.rwth.dbis.acis.bazaar.service.dal.helpers.UserVote; import jodd.vtor.constraint.*; @@ -26,7 +30,9 @@ public class Requirement extends EntityBase { @NotNull(profiles = {"create"}) private String description; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime realized; @Min(value = 0, profiles = {"create"}) @@ -43,10 +49,14 @@ public class Requirement extends EntityBase { // But the API still allows to create a requirement with attachments at the same time. private List attachments; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime lastUpdatedDate; private Integer numberOfComments; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementCategory.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementCategory.java index 3ec139d4..70339334 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementCategory.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementCategory.java @@ -21,7 +21,6 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; /** - * @author Adam Gavronek * @since 6/11/2014 */ public class RequirementCategory extends EntityBase { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementDeveloper.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementDeveloper.java index 19de9333..daa78d21 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementDeveloper.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementDeveloper.java @@ -21,7 +21,6 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; /** - * @author Adam Gavronek * @since 6/11/2014 */ public class RequirementDeveloper extends EntityBase { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementFollower.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementFollower.java index 0fc5f162..d938e1cf 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementFollower.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementFollower.java @@ -21,7 +21,6 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; /** - * @author Adam Gavronek * @since 6/11/2014 */ public class RequirementFollower extends EntityBase { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java index 1c97c8ce..7ff236a0 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java @@ -23,7 +23,6 @@ import java.util.List; /** - * @author Adam Gavronek * @since 2/17/2015 */ public class Role extends EntityBase { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java index 4e9bd5b0..8348e330 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java @@ -23,6 +23,10 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import jodd.vtor.constraint.MaxLength; import jodd.vtor.constraint.Min; import jodd.vtor.constraint.NotBlank; @@ -64,13 +68,19 @@ public class User extends EntityBase { private Boolean personalizationEnabled; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime lastUpdatedDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime lastLoginDate; public User() { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Vote.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Vote.java index f41a6b70..27c0b00a 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Vote.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Vote.java @@ -21,7 +21,6 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; /** - * @author Adam Gavronek * @since 6/11/2014 */ public class Vote extends EntityBase { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/CreationStatus.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/CreationStatus.java index 804ae8fe..c170f1fc 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/CreationStatus.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/CreationStatus.java @@ -21,7 +21,6 @@ package de.rwth.dbis.acis.bazaar.service.dal.helpers; /** - * @author Adam Gavronek * @since 2/27/2015 */ public enum CreationStatus { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java index f2cba5e2..0f59cd32 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java @@ -24,7 +24,6 @@ import java.util.Map; /** - * @author Adam Gavronek * @since 6/12/2014 */ public interface Pageable { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/UserVote.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/UserVote.java index 71313e21..5be4c2e2 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/UserVote.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/UserVote.java @@ -21,7 +21,6 @@ package de.rwth.dbis.acis.bazaar.service.dal.helpers; /** - * @author Adam Gavronek * @since 2/27/2015 */ public enum UserVote { @@ -29,4 +28,3 @@ public enum UserVote { DOWN_VOTE, NO_VOTE } - diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepositoryImpl.java index 8fdfe658..f0320801 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepositoryImpl.java @@ -42,7 +42,6 @@ import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; /** - * @author Adam Gavronek * @since 6/22/2014 */ public class AttachmentRepositoryImpl extends RepositoryImpl implements AttachmentRepository { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java index 4aa516f7..dd97a230 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java @@ -31,7 +31,6 @@ import java.util.List; /** - * @author Adam Gavronek * @since 6/9/2014 */ public interface CategoryRepository extends Repository { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java index 5a7e740c..e756d983 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java @@ -28,7 +28,6 @@ import java.util.List; /** - * @author Adam Gavronek * @since 6/22/2014 */ public interface CommentRepository extends Repository { @@ -38,4 +37,3 @@ public interface CommentRepository extends Repository { boolean belongsToPublicProject(int id) throws BazaarException; } - diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepository.java index 3fb277ad..6dd22152 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepository.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepository.java @@ -24,7 +24,6 @@ import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; /** - * @author Adam Gavronek * @since 2/18/2015 */ public interface PrivilegeRepository extends Repository { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepositoryImpl.java index d1441533..8095e192 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepositoryImpl.java @@ -32,7 +32,6 @@ import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.PRIVILEGE; /** - * @author Adam Gavronek * @since 2/18/2015 */ public class PrivilegeRepositoryImpl extends RepositoryImpl implements PrivilegeRepository { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java index f6bdb6db..1811bad9 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java @@ -32,7 +32,6 @@ import java.util.List; /** - * @author Adam Gavronek * @since 6/9/2014 */ public interface ProjectRepository extends Repository { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java index d0259d78..6685500e 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java @@ -46,7 +46,6 @@ import static org.jooq.impl.DSL.*; /** - * @author Adam Gavronek * @since 6/9/2014 */ public class ProjectRepositoryImpl extends RepositoryImpl implements ProjectRepository { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/Repository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/Repository.java index cc9439d9..6d2728bd 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/Repository.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/Repository.java @@ -29,7 +29,6 @@ /** * @param Type of the Entity, which should be added, deleted, updated, got using the repo. - * @author Adam Gavronek * @since 6/9/2014 */ public interface Repository { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java index 3a61c3d6..a40a3eac 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java @@ -36,7 +36,6 @@ import java.util.Map; /** - * @author Adam Gavronek * @since 6/9/2014 */ public class RepositoryImpl implements Repository { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepository.java index 5f2b4263..b958a858 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepository.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepository.java @@ -24,7 +24,6 @@ import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; /** - * @author Adam Gavronek * @since 6/22/2014 */ public interface RequirementCategoryRepository extends Repository { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepositoryImpl.java index 7c212503..af46a39c 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepositoryImpl.java @@ -33,7 +33,6 @@ import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.REQUIREMENT_CATEGORY_MAP; /** - * @author Adam Gavronek * @since 6/23/2014 */ public class RequirementCategoryRepositoryImpl extends RepositoryImpl implements RequirementCategoryRepository { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepository.java index 4b4cf161..886e347a 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepository.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepository.java @@ -25,7 +25,6 @@ import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; /** - * @author Adam Gavronek * @since 6/22/2014 */ public interface RequirementDeveloperRepository extends Repository { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepositoryImpl.java index f88a7819..4cb61217 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepositoryImpl.java @@ -34,7 +34,6 @@ import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.REQUIREMENT_DEVELOPER_MAP; /** - * @author Adam Gavronek * @since 6/23/2014 */ public class RequirementDeveloperRepositoryImpl extends RepositoryImpl implements RequirementDeveloperRepository { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepository.java index d0079ddd..5ca284a1 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepository.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepository.java @@ -25,7 +25,6 @@ import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; /** - * @author Adam Gavronek * @since 6/22/2014 */ public interface RequirementFollowerRepository extends Repository { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepositoryImpl.java index 352f2b67..692c5771 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepositoryImpl.java @@ -34,7 +34,6 @@ import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.REQUIREMENT_FOLLOWER_MAP; /** - * @author Adam Gavronek * @since 6/23/2014 */ public class RequirementFollowerRepositoryImpl extends RepositoryImpl implements RequirementFollowerRepository { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java index def0a233..47d02ba7 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java @@ -26,7 +26,6 @@ import java.util.List; /** - * @author Adam Gavronek * @since 2/17/2015 */ public interface RoleRepository extends Repository { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java index 5d5c4ef3..1b963789 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java @@ -41,7 +41,6 @@ import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; /** - * @author Adam Gavronek * @since 2/17/2015 */ public class RoleRepositoryImpl extends RepositoryImpl implements RoleRepository { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepository.java index a6dd699f..a414e1d4 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepository.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepository.java @@ -32,7 +32,6 @@ import java.util.List; /** - * @author Adam Gavronek * @since 6/22/2014 */ public interface UserRepository extends Repository { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java index 11417b08..68f578e6 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java @@ -48,7 +48,6 @@ import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; /** - * @author Adam Gavronek * @since 6/23/2014 */ public class UserRepositoryImpl extends RepositoryImpl implements UserRepository { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepository.java index e5b6bc21..bac8aac4 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepository.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepository.java @@ -25,7 +25,6 @@ import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; /** - * @author Adam Gavronek * @since 6/22/2014 */ public interface VoteRepository extends Repository { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java index 58fd40b5..7fbee6f7 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java @@ -39,7 +39,6 @@ import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.VOTE; /** - * @author Adam Gavronek * @since 6/23/2014 */ public class VoteRepositoryImpl extends RepositoryImpl implements VoteRepository { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java index 8b591810..2c63b2df 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java @@ -35,7 +35,6 @@ import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.CATEGORY_FOLLOWER_MAP; /** - * @author Adam Gavronek * @since 6/9/2014 */ public class CategoryTransformer implements Transformer { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java index 79e97b96..e8ff6917 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java @@ -35,7 +35,6 @@ import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; /** - * @author Adam Gavronek * @since 6/23/2014 */ public class CommentTransformer implements Transformer { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java index bd742faf..7ff5ad30 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java @@ -33,7 +33,6 @@ import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.VOTE; /** - * @author Adam Gavronek * @since 6/23/2014 */ public class PersonalisationDataTransformer implements Transformer { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java index 340b4cdb..db1fd33e 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java @@ -31,7 +31,6 @@ import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.ROLE; /** - * @author Adam Gavronek * @since 2/18/2015 */ public class PrivilegeTransformer implements Transformer { @@ -90,4 +89,3 @@ public Collection getFilterConditions(Map f return new ArrayList<>(); } } - diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java index b2731f93..d2214f48 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java @@ -30,7 +30,6 @@ import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.REQUIREMENT_CATEGORY_MAP; /** - * @author Adam Gavronek * @since 6/23/2014 */ public class RequirementCategoryTransformer implements Transformer { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java index 8f7f9590..e1c9a617 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java @@ -30,7 +30,6 @@ import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.REQUIREMENT_DEVELOPER_MAP; /** - * @author Adam Gavronek * @since 6/23/2014 */ public class RequirementDeveloperTransformer implements Transformer { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java index e9685281..2abd2af6 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java @@ -30,7 +30,6 @@ import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.REQUIREMENT_FOLLOWER_MAP; /** - * @author Adam Gavronek * @since 6/23/2014 */ public class RequirementFollowerTransformer implements Transformer { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java index 00a88883..0479175f 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java @@ -30,7 +30,6 @@ import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.ROLE; /** - * @author Adam Gavronek * @since 2/17/2015 */ public class RoleTransformer implements Transformer { @@ -89,4 +88,4 @@ public Condition getSearchCondition(String search) throws Exception { public Collection getFilterConditions(Map filters) throws Exception { return new ArrayList<>(); } -} \ No newline at end of file +} diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/Transformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/Transformer.java index 1016ac7d..17378618 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/Transformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/Transformer.java @@ -31,7 +31,6 @@ /** * @param type parameter for the entity * @param type parameter for the record - * @author Adam Gavronek * @since 6/9/2014 */ public interface Transformer { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java index 87e3908a..0122c02d 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java @@ -30,7 +30,6 @@ import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.VOTE; /** - * @author Adam Gavronek * @since 6/23/2014 */ public class VoteTransformer implements Transformer { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/BazaarException.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/BazaarException.java index ab491776..aed39e4d 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/BazaarException.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/BazaarException.java @@ -23,7 +23,6 @@ import de.rwth.dbis.acis.bazaar.service.internalization.Localization; /** - * @author Adam Gavronek * @since 10/6/2014 */ public class BazaarException extends Exception { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ErrorCode.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ErrorCode.java index fb67b634..b315f682 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ErrorCode.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ErrorCode.java @@ -21,7 +21,6 @@ package de.rwth.dbis.acis.bazaar.service.exception; /** - * @author Adam Gavronek * @since 10/6/2014 */ public enum ErrorCode { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java index 676b69bf..63b976f7 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java @@ -29,7 +29,6 @@ import java.util.List; /** - * @author Adam Gavronek * @since 10/6/2014 */ public enum ExceptionHandler { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionLocation.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionLocation.java index 49685079..77c19fd9 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionLocation.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionLocation.java @@ -21,7 +21,6 @@ package de.rwth.dbis.acis.bazaar.service.exception; /** - * @author Adam Gavronek * @since 10/6/2014 */ public enum ExceptionLocation { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/internalization/Localization.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/internalization/Localization.java index 73f43683..cfc7f513 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/internalization/Localization.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/internalization/Localization.java @@ -23,7 +23,6 @@ import java.util.ResourceBundle; /** - * @author Adam Gavronek * @since 3/12/2015 */ public class Localization { @@ -48,4 +47,4 @@ public static Localization getInstance() { } return instance; } -} \ No newline at end of file +} diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java index 3cd3c0b6..00e704eb 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java @@ -30,7 +30,6 @@ import java.util.List; /** - * @author Adam Gavronek * @since 2/17/2015 */ public class AuthorizationManager { diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index a3659d56..e55c4530 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -70,7 +70,9 @@ public void testCreateProject() { JsonObject response = JsonParser.parseString(result.getResponse()).getAsJsonObject(); Assert.assertTrue(response.isJsonObject()); System.out.println(response.get("creationDate").toString()); - Assert.assertTrue(isValidISO8601(response.get("creationDate").toString())); + + // gson doesn't remove the quotes + Assert.assertTrue(isValidISO8601(response.get("creationDate").toString().replace("\"", ""))); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.toString()); diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java index 7b2a7603..378dfad7 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java @@ -89,10 +89,11 @@ MiniClient getClient() { } boolean isValidISO8601(String dateStr) { - DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS"); + DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss"); try { dateFormatter.parse(dateStr); } catch (DateTimeParseException e) { + e.printStackTrace(); return false; } return true; From d8512819cb8ad092fe68e2691409e3acadd1268a Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 30 Jan 2021 18:27:38 +0100 Subject: [PATCH 036/134] Update gitignore --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 72a67303..5538276d 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,7 @@ /.las2peer /node-storage /startup -/log +log/ /lib etc/ivy/ivy.jar /service @@ -69,4 +69,4 @@ Temporary Items # Ignore Gradle build output directory build -.db_data \ No newline at end of file +.db_data From 958879d0417b9ad768a7ee66070b790c93879abb Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 30 Jan 2021 18:30:15 +0100 Subject: [PATCH 037/134] Let intellij optimize imports --- .../bazaar/service/PersonalisationDataResource.java | 4 ++-- .../dbis/acis/bazaar/service/ProjectsResource.java | 1 - .../rwth/dbis/acis/bazaar/service/UsersResource.java | 6 ++++-- .../acis/bazaar/service/dal/entities/Activity.java | 1 - .../acis/bazaar/service/dal/entities/Attachment.java | 1 - .../acis/bazaar/service/dal/entities/Category.java | 1 - .../acis/bazaar/service/dal/entities/Comment.java | 1 - .../dbis/acis/bazaar/service/dal/entities/Email.java | 1 - .../bazaar/service/dal/entities/EntityContext.java | 2 -- .../service/dal/entities/PersonalisationData.java | 3 --- .../acis/bazaar/service/dal/entities/Project.java | 1 - .../bazaar/service/dal/entities/Requirement.java | 1 - .../dbis/acis/bazaar/service/dal/entities/User.java | 1 - .../service/dal/helpers/EntityContextFactory.java | 12 +++--------- .../dal/repositories/AttachmentRepositoryImpl.java | 4 ++-- .../repositories/CategoryFollowerRepositoryImpl.java | 2 +- .../service/dal/repositories/CategoryRepository.java | 1 - .../dal/repositories/CategoryRepositoryImpl.java | 7 +++---- .../service/dal/repositories/CommentRepository.java | 2 -- .../dal/repositories/CommentRepositoryImpl.java | 9 +++++---- .../PersonalisationDataRepositoryImpl.java | 7 ++----- .../dal/repositories/PrivilegeRepositoryImpl.java | 2 +- .../repositories/ProjectFollowerRepositoryImpl.java | 2 +- .../service/dal/repositories/ProjectRepository.java | 2 -- .../dal/repositories/ProjectRepositoryImpl.java | 7 +++---- .../service/dal/repositories/RepositoryImpl.java | 2 +- .../RequirementCategoryRepositoryImpl.java | 2 +- .../RequirementDeveloperRepositoryImpl.java | 2 +- .../RequirementFollowerRepositoryImpl.java | 2 +- .../dal/repositories/RequirementRepository.java | 1 - .../dal/repositories/RequirementRepositoryImpl.java | 11 ++--------- .../service/dal/repositories/RoleRepositoryImpl.java | 4 ++-- .../service/dal/repositories/UserRepositoryImpl.java | 3 +-- .../service/dal/repositories/VoteRepositoryImpl.java | 2 +- .../service/dal/transform/AttachmentTransformer.java | 5 +---- .../dal/transform/CategoryFollowerTransformer.java | 2 +- .../service/dal/transform/CategoryTransformer.java | 2 +- .../service/dal/transform/CommentTransformer.java | 4 +--- .../transform/PersonalisationDataTransformer.java | 10 +++++----- .../service/dal/transform/PrivilegeTransformer.java | 2 +- .../dal/transform/ProjectFollowerTransformer.java | 2 +- .../service/dal/transform/ProjectTransformer.java | 6 +----- .../transform/RequirementCategoryTransformer.java | 2 +- .../transform/RequirementDeveloperTransformer.java | 2 +- .../transform/RequirementFollowerTransformer.java | 2 +- .../dal/transform/RequirementTransformer.java | 2 +- .../service/dal/transform/RoleTransformer.java | 2 +- .../bazaar/service/dal/transform/Transformer.java | 2 +- .../service/dal/transform/UserTransformer.java | 4 ++-- .../service/dal/transform/VoteTransformer.java | 2 +- .../service/notification/ActivityDispatcher.java | 1 - .../service/notification/NotificationDispatcher.java | 1 - .../notification/NotificationDispatcherImp.java | 1 - 53 files changed, 58 insertions(+), 106 deletions(-) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java index 65b97e6c..156ed280 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java @@ -20,7 +20,7 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.net.HttpURLConnection; -import java.util.*; +import java.util.EnumSet; @Api(value = "personalisation", description = "Personalisation Data resource") @@ -178,4 +178,4 @@ public Response setPersonalisationData(@PathParam("key") String key, @PathParam( } -} \ No newline at end of file +} diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java index bac10215..f4e100b3 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java @@ -24,7 +24,6 @@ import javax.ws.rs.core.Response; import javax.xml.bind.DatatypeConverter; import java.net.HttpURLConnection; -import java.time.LocalDate; import java.time.LocalDateTime; import java.util.*; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/UsersResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/UsersResource.java index 9d130aed..0d121c53 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/UsersResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/UsersResource.java @@ -18,12 +18,14 @@ import jodd.vtor.Vtor; import javax.ws.rs.*; -import javax.ws.rs.client.Entity; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.net.HttpURLConnection; import java.time.LocalDateTime; -import java.util.*; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.List; @Api(value = "users", description = "Users resource") diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java index a86337d7..e421e72b 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java @@ -9,7 +9,6 @@ import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import java.time.LocalDateTime; -import java.util.Date; public class Activity extends EntityBase { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java index aa7591fd..24efc437 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java @@ -31,7 +31,6 @@ import jodd.vtor.constraint.NotNull; import java.time.LocalDateTime; -import java.util.Date; public class Attachment extends EntityBase { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java index 243a1088..32f09c0f 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java @@ -33,7 +33,6 @@ import jodd.vtor.constraint.NotNull; import java.time.LocalDateTime; -import java.util.Date; /** * @since 6/9/2014 diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java index aced88ce..573aa43e 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java @@ -32,7 +32,6 @@ import jodd.vtor.constraint.NotNull; import java.time.LocalDateTime; -import java.util.Date; /** * @since 6/11/2014 diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java index 7f61dddf..71f2c033 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java @@ -2,7 +2,6 @@ import java.time.LocalDateTime; -import java.util.Date; import java.util.Set; public class Email extends EntityBase { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java index dda2dfaa..8591f1ba 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java @@ -25,8 +25,6 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.List; - /** * @since 30/01/2020 */ diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java index bce298ac..e1c666a2 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java @@ -21,14 +21,11 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; -import com.fasterxml.jackson.annotation.JsonFormat; import jodd.vtor.constraint.MaxLength; import jodd.vtor.constraint.Min; import jodd.vtor.constraint.NotBlank; import jodd.vtor.constraint.NotNull; -import javax.validation.constraints.Null; - /** * @since 26/11/2019 */ diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java index 47105da6..94995a43 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java @@ -31,7 +31,6 @@ import jodd.vtor.constraint.NotNull; import java.time.LocalDateTime; -import java.util.Date; /** * @since 6/9/2014 diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java index ebe4588d..24f716be 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java @@ -11,7 +11,6 @@ import jodd.vtor.constraint.*; import java.time.LocalDateTime; -import java.util.Date; import java.util.List; /** diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java index 8348e330..bf349c17 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java @@ -33,7 +33,6 @@ import jodd.vtor.constraint.NotNull; import java.time.LocalDateTime; -import java.util.Date; public class User extends EntityBase { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java index cea5fdc8..f064e966 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java @@ -1,23 +1,17 @@ package de.rwth.dbis.acis.bazaar.service.dal.helpers; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CategoryRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.ProjectRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Category; import de.rwth.dbis.acis.bazaar.service.dal.entities.EntityContext; import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; import de.rwth.dbis.acis.bazaar.service.dal.entities.Requirement; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CategoryRecord; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.ProjectRecord; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementRecord; -import de.rwth.dbis.acis.bazaar.service.dal.repositories.UserRepositoryImpl; import de.rwth.dbis.acis.bazaar.service.dal.transform.CategoryTransformer; import de.rwth.dbis.acis.bazaar.service.dal.transform.ProjectTransformer; import de.rwth.dbis.acis.bazaar.service.dal.transform.RequirementTransformer; import org.jooq.Record; -import org.jooq.Require; -import org.jooq.Result; import java.util.List; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepositoryImpl.java index f0320801..b4af8b59 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepositoryImpl.java @@ -20,11 +20,11 @@ package de.rwth.dbis.acis.bazaar.service.dal.repositories; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.AttachmentRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.UserRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Attachment; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.AttachmentRecord; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.UserRecord; import de.rwth.dbis.acis.bazaar.service.dal.transform.AttachmentTransformer; import de.rwth.dbis.acis.bazaar.service.dal.transform.UserTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepositoryImpl.java index 5aecc70f..15fdefdd 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepositoryImpl.java @@ -1,8 +1,8 @@ package de.rwth.dbis.acis.bazaar.service.dal.repositories; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CategoryFollowerMapRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.CategoryFollower; import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreationStatus; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CategoryFollowerMapRecord; import de.rwth.dbis.acis.bazaar.service.dal.transform.CategoryFollowerTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java index dd97a230..a49f266b 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java @@ -26,7 +26,6 @@ import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; -import java.sql.Timestamp; import java.time.LocalDateTime; import java.util.List; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java index 872ab0f5..44e920cd 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java @@ -20,24 +20,23 @@ package de.rwth.dbis.acis.bazaar.service.dal.repositories; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CategoryRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.UserRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Category; import de.rwth.dbis.acis.bazaar.service.dal.entities.Statistic; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CategoryRecord; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.UserRecord; import de.rwth.dbis.acis.bazaar.service.dal.transform.CategoryTransformer; import de.rwth.dbis.acis.bazaar.service.dal.transform.UserTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionLocation; -import org.jooq.*; import org.jooq.Record; +import org.jooq.*; import org.jooq.exception.DataAccessException; import org.jooq.impl.DSL; -import java.sql.Timestamp; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java index e756d983..d018c617 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java @@ -25,8 +25,6 @@ import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; -import java.util.List; - /** * @since 6/22/2014 */ diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java index 34c370b9..82335b8d 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java @@ -20,13 +20,15 @@ package de.rwth.dbis.acis.bazaar.service.dal.repositories; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.User; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CommentRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.UserRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Comment; import de.rwth.dbis.acis.bazaar.service.dal.helpers.EntityContextFactory; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.User; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.*; -import de.rwth.dbis.acis.bazaar.service.dal.transform.*; +import de.rwth.dbis.acis.bazaar.service.dal.transform.CommentTransformer; +import de.rwth.dbis.acis.bazaar.service.dal.transform.UserTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; @@ -34,7 +36,6 @@ import org.jooq.DSLContext; import org.jooq.Field; import org.jooq.Record; -import org.jooq.Require; import org.jooq.exception.DataAccessException; import java.util.ArrayList; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepositoryImpl.java index 887f0403..133a95d1 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepositoryImpl.java @@ -1,9 +1,7 @@ package de.rwth.dbis.acis.bazaar.service.dal.repositories; -import de.rwth.dbis.acis.bazaar.service.dal.entities.PersonalisationData; - - import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.PersonalisationDataRecord; +import de.rwth.dbis.acis.bazaar.service.dal.entities.PersonalisationData; import de.rwth.dbis.acis.bazaar.service.dal.transform.PersonalisationDataTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; @@ -13,8 +11,7 @@ import org.jooq.Record; import org.jooq.exception.DataAccessException; - -import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.PERSONALISATION_DATA; public class PersonalisationDataRepositoryImpl extends RepositoryImpl implements PersonalisationDataRepository { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepositoryImpl.java index 8095e192..31d95f99 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepositoryImpl.java @@ -20,8 +20,8 @@ package de.rwth.dbis.acis.bazaar.service.dal.repositories; -import de.rwth.dbis.acis.bazaar.service.dal.entities.Privilege; import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.PrivilegeRecord; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Privilege; import de.rwth.dbis.acis.bazaar.service.dal.transform.PrivilegeTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepositoryImpl.java index 4d1cb4a9..1946379c 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepositoryImpl.java @@ -1,8 +1,8 @@ package de.rwth.dbis.acis.bazaar.service.dal.repositories; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.ProjectFollowerMapRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.ProjectFollower; import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreationStatus; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.ProjectFollowerMapRecord; import de.rwth.dbis.acis.bazaar.service.dal.transform.ProjectFollowerTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java index 1811bad9..0bbda5a4 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java @@ -22,12 +22,10 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; import de.rwth.dbis.acis.bazaar.service.dal.entities.Statistic; -import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; -import java.sql.Timestamp; import java.time.LocalDateTime; import java.util.List; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java index 6685500e..40d1ad3b 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java @@ -20,21 +20,20 @@ package de.rwth.dbis.acis.bazaar.service.dal.repositories; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.ProjectRecord; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.UserRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; import de.rwth.dbis.acis.bazaar.service.dal.entities.Statistic; -import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.ProjectRecord; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.UserRecord; import de.rwth.dbis.acis.bazaar.service.dal.transform.ProjectTransformer; import de.rwth.dbis.acis.bazaar.service.dal.transform.UserTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionLocation; -import org.jooq.*; import org.jooq.Record; +import org.jooq.*; import org.jooq.exception.DataAccessException; import org.jooq.impl.DSL; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java index a40a3eac..9662886f 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java @@ -27,8 +27,8 @@ import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionLocation; -import org.jooq.*; import org.jooq.Record; +import org.jooq.*; import org.jooq.exception.DataAccessException; import java.util.ArrayList; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepositoryImpl.java index af46a39c..17d63aa4 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepositoryImpl.java @@ -20,8 +20,8 @@ package de.rwth.dbis.acis.bazaar.service.dal.repositories; -import de.rwth.dbis.acis.bazaar.service.dal.entities.RequirementCategory; import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementCategoryMapRecord; +import de.rwth.dbis.acis.bazaar.service.dal.entities.RequirementCategory; import de.rwth.dbis.acis.bazaar.service.dal.transform.RequirementCategoryTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepositoryImpl.java index 4cb61217..dda95d90 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepositoryImpl.java @@ -20,9 +20,9 @@ package de.rwth.dbis.acis.bazaar.service.dal.repositories; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementDeveloperMapRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.RequirementDeveloper; import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreationStatus; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementDeveloperMapRecord; import de.rwth.dbis.acis.bazaar.service.dal.transform.RequirementDeveloperTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepositoryImpl.java index 692c5771..c385c538 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepositoryImpl.java @@ -20,9 +20,9 @@ package de.rwth.dbis.acis.bazaar.service.dal.repositories; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementFollowerMapRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.RequirementFollower; import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreationStatus; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementFollowerMapRecord; import de.rwth.dbis.acis.bazaar.service.dal.transform.RequirementFollowerTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java index 1fdff573..b4932938 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java @@ -26,7 +26,6 @@ import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; -import java.sql.Timestamp; import java.time.LocalDateTime; import java.util.List; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java index 9aed75c5..c9549dff 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java @@ -20,35 +20,28 @@ package de.rwth.dbis.acis.bazaar.service.dal.repositories; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Category; -import de.rwth.dbis.acis.bazaar.service.dal.entities.EntityContext; import de.rwth.dbis.acis.bazaar.service.dal.entities.Requirement; import de.rwth.dbis.acis.bazaar.service.dal.entities.Statistic; import de.rwth.dbis.acis.bazaar.service.dal.helpers.EntityContextFactory; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; import de.rwth.dbis.acis.bazaar.service.dal.helpers.UserVote; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CategoryRecord; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.ProjectRecord; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementRecord; -import de.rwth.dbis.acis.bazaar.service.dal.transform.CategoryTransformer; -import de.rwth.dbis.acis.bazaar.service.dal.transform.ProjectTransformer; import de.rwth.dbis.acis.bazaar.service.dal.transform.RequirementTransformer; import de.rwth.dbis.acis.bazaar.service.dal.transform.UserTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionLocation; -import org.jooq.*; import org.jooq.Record; +import org.jooq.*; import org.jooq.exception.DataAccessException; import org.jooq.impl.DSL; import java.math.BigDecimal; -import java.sql.Timestamp; import java.time.LocalDateTime; import java.util.ArrayList; -import java.util.Calendar; import java.util.List; import java.util.Map; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java index 1b963789..2045a9d9 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java @@ -20,10 +20,10 @@ package de.rwth.dbis.acis.bazaar.service.dal.repositories; -import de.rwth.dbis.acis.bazaar.service.dal.entities.Privilege; -import de.rwth.dbis.acis.bazaar.service.dal.entities.Role; import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RoleRecord; import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.UserRoleMapRecord; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Privilege; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Role; import de.rwth.dbis.acis.bazaar.service.dal.transform.PrivilegeEnumConverter; import de.rwth.dbis.acis.bazaar.service.dal.transform.RoleTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java index 68f578e6..57657677 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java @@ -20,13 +20,13 @@ package de.rwth.dbis.acis.bazaar.service.dal.repositories; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.UserRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.CategoryContributors; import de.rwth.dbis.acis.bazaar.service.dal.entities.ProjectContributors; import de.rwth.dbis.acis.bazaar.service.dal.entities.RequirementContributors; import de.rwth.dbis.acis.bazaar.service.dal.entities.User; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.UserRecord; import de.rwth.dbis.acis.bazaar.service.dal.transform.UserTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; @@ -41,7 +41,6 @@ import java.time.LocalDateTime; import java.util.ArrayList; -import java.util.Calendar; import java.util.List; import java.util.Map; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java index 7fbee6f7..4dd8bb29 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java @@ -20,9 +20,9 @@ package de.rwth.dbis.acis.bazaar.service.dal.repositories; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.VoteRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Vote; import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreationStatus; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.VoteRecord; import de.rwth.dbis.acis.bazaar.service.dal.transform.VoteTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java index ada24cff..e34b6765 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java @@ -21,12 +21,11 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; import com.vdurmont.emoji.EmojiParser; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.AttachmentRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Attachment; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.AttachmentRecord; import org.jooq.*; -import java.sql.Timestamp; import java.time.LocalDateTime; import java.util.*; @@ -119,5 +118,3 @@ private Attachment cleanEntry(Attachment attachment) { return attachment; } } - - diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryFollowerTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryFollowerTransformer.java index a8655ef6..b82748ea 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryFollowerTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryFollowerTransformer.java @@ -1,8 +1,8 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CategoryFollowerMapRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.CategoryFollower; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CategoryFollowerMapRecord; import org.jooq.*; import java.util.*; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java index 2c63b2df..6ff11135 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java @@ -21,9 +21,9 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; import com.vdurmont.emoji.EmojiParser; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CategoryRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Category; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CategoryRecord; import de.rwth.dbis.acis.bazaar.service.dal.repositories.CategoryRepositoryImpl; import org.jooq.*; import org.jooq.impl.DSL; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java index e8ff6917..6736c08c 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java @@ -21,14 +21,12 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; import com.vdurmont.emoji.EmojiParser; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CommentRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Comment; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CommentRecord; -import de.rwth.dbis.acis.bazaar.service.dal.repositories.ProjectRepositoryImpl; import org.jooq.*; import org.jooq.impl.DSL; -import java.sql.Timestamp; import java.time.LocalDateTime; import java.util.*; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java index 7ff5ad30..b33b3753 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java @@ -20,17 +20,17 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.PersonalisationDataRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.PersonalisationData; -import de.rwth.dbis.acis.bazaar.service.dal.entities.Vote; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.PersonalisationDataRecord; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.VoteRecord; import org.jooq.*; -import java.util.*; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.PERSONALISATION_DATA; -import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.VOTE; /** * @since 6/23/2014 diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java index db1fd33e..1854c1b5 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java @@ -20,9 +20,9 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.PrivilegeRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Privilege; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.PrivilegeRecord; import org.jooq.*; import java.util.*; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectFollowerTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectFollowerTransformer.java index 7a36635c..2783f5a0 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectFollowerTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectFollowerTransformer.java @@ -1,8 +1,8 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.ProjectFollowerMapRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.ProjectFollower; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.ProjectFollowerMapRecord; import org.jooq.*; import java.util.*; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java index e08ba6f9..c08b9522 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java @@ -21,9 +21,9 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; import com.vdurmont.emoji.EmojiParser; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.ProjectRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.ProjectRecord; import de.rwth.dbis.acis.bazaar.service.dal.repositories.ProjectRepositoryImpl; import org.jooq.*; import org.jooq.impl.DSL; @@ -31,10 +31,6 @@ import java.time.LocalDateTime; import java.util.*; - - -import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.REQUIREMENT; -import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.PROJECT; import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; public class ProjectTransformer implements Transformer { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java index d2214f48..bf5253d5 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java @@ -20,9 +20,9 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementCategoryMapRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.RequirementCategory; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementCategoryMapRecord; import org.jooq.*; import java.util.*; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java index e1c9a617..fe1a6217 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java @@ -20,9 +20,9 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementDeveloperMapRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.RequirementDeveloper; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementDeveloperMapRecord; import org.jooq.*; import java.util.*; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java index 2abd2af6..3e318562 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java @@ -20,9 +20,9 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementFollowerMapRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.RequirementFollower; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementFollowerMapRecord; import org.jooq.*; import java.util.*; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java index 6553839e..9a9886e9 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java @@ -21,9 +21,9 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; import com.vdurmont.emoji.EmojiParser; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Requirement; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementRecord; import de.rwth.dbis.acis.bazaar.service.dal.repositories.RequirementRepositoryImpl; import org.jooq.*; import org.jooq.impl.DSL; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java index 0479175f..41ca9bd2 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java @@ -20,9 +20,9 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RoleRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Role; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RoleRecord; import org.jooq.*; import java.util.*; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/Transformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/Transformer.java index 17378618..83b83a09 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/Transformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/Transformer.java @@ -21,8 +21,8 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import org.jooq.*; import org.jooq.Record; +import org.jooq.*; import java.util.Collection; import java.util.List; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java index 920bc1e0..5da7abf6 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java @@ -20,11 +20,11 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.UserRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.User; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.UserRecord; -import org.jooq.*; import org.jooq.Record; +import org.jooq.*; import java.time.LocalDateTime; import java.util.*; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java index 0122c02d..e16a4b3b 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java @@ -20,9 +20,9 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.VoteRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Vote; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.VoteRecord; import org.jooq.*; import java.util.*; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java index 7a32f0b9..49f96a13 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java @@ -16,7 +16,6 @@ import javax.ws.rs.core.Response; import java.time.LocalDateTime; -import java.util.Date; /** * Created by martin on 15.02.2016. diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcher.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcher.java index ebd4db92..a84af4e8 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcher.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcher.java @@ -5,7 +5,6 @@ import i5.las2peer.api.logging.MonitoringEvent; import java.time.LocalDateTime; -import java.util.Date; /** * Created by martin on 15.02.2016. diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java index 9e60dc8b..85cf794d 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java @@ -14,7 +14,6 @@ import i5.las2peer.logging.L2pLogger; import java.time.LocalDateTime; -import java.util.Date; import java.util.TimerTask; /** From aa873f14d766b2979f7fc2d1a1037839d35f18e8 Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 30 Jan 2021 18:31:45 +0100 Subject: [PATCH 038/134] Udate gh actions to use java 14 --- .github/workflows/gradle.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 1ee9780a..1478a605 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -19,10 +19,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK + - name: Set up JDK 14 uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: 14 - name: Verify MySQL connection env: PORT: ${{ job.services.mysql.ports[3306] }} @@ -37,4 +37,4 @@ jobs: - name: Build with Gradle env: PORT: ${{ job.services.mysql.ports[3306] }} - run: ./gradlew clean build --info -Pdb.port=$PORT \ No newline at end of file + run: ./gradlew clean build --info -Pdb.port=$PORT From 9d797cf5a7fb652098ed463eed23abaf36671d5c Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 13 Feb 2021 18:11:17 +0100 Subject: [PATCH 039/134] Fix validation issues --- requirement_bazaar/build.gradle | 4 + .../bazaar/service/AttachmentsResource.java | 19 +- .../acis/bazaar/service/BazaarService.java | 25 +- .../acis/bazaar/service/CategoryResource.java | 39 +- .../acis/bazaar/service/CommentsResource.java | 32 +- .../service/PersonalisationDataResource.java | 13 +- .../acis/bazaar/service/ProjectsResource.java | 44 +- .../bazaar/service/RequirementsResource.java | 87 ++-- .../acis/bazaar/service/UsersResource.java | 16 +- .../bazaar/service/dal/DALFacadeImpl.java | 9 +- .../service/dal/entities/Attachment.java | 31 +- .../bazaar/service/dal/entities/Category.java | 20 +- .../bazaar/service/dal/entities/Comment.java | 13 +- .../service/dal/entities/EntityBase.java | 3 +- .../dal/entities/PersonalisationData.java | 32 +- .../bazaar/service/dal/entities/Project.java | 15 +- .../service/dal/entities/Requirement.java | 22 +- .../bazaar/service/dal/entities/User.java | 33 +- .../bazaar/service/dal/helpers/PageInfo.java | 5 +- .../service/exception/ExceptionHandler.java | 13 + .../migrations/V5__add_delete_constraints.sql | 14 + .../dbis/acis/bazaar/service/BazaarTest.java | 38 +- .../bazaar/service/dal/DALFacadeTest.java | 380 ++++++++++++++++++ 23 files changed, 635 insertions(+), 272 deletions(-) create mode 100644 requirement_bazaar/src/main/resources/migrations/V5__add_delete_constraints.sql create mode 100644 requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java diff --git a/requirement_bazaar/build.gradle b/requirement_bazaar/build.gradle index ad1955be..b5b976f5 100644 --- a/requirement_bazaar/build.gradle +++ b/requirement_bazaar/build.gradle @@ -46,6 +46,9 @@ dependencies { // compileOnly will be moved into the lib dir afterwards compileOnly "i5:las2peer-bundle:${project.property('core.version')}" compileOnly "mysql:mysql-connector-java:${project.property('mysql.version')}" + compileOnly 'org.hibernate:hibernate-validator:5.4.3.Final' + compileOnly 'org.glassfish:jakarta.el:3.0.3' + compileOnly 'javax.validation:validation-api:1.1.0.Final' // This is for the jooq generation only jooqGenerator "mysql:mysql-connector-java:${project.property('mysql.version')}" @@ -151,4 +154,5 @@ flyway { locations = ["filesystem:$project.projectDir/src/main/resources/migrations"] } +generateJooq.dependsOn flywayClean generateJooq.dependsOn flywayMigrate diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/AttachmentsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/AttachmentsResource.java index de8161c9..921d854d 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/AttachmentsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/AttachmentsResource.java @@ -15,8 +15,8 @@ import i5.las2peer.api.security.Agent; import i5.las2peer.logging.L2pLogger; import io.swagger.annotations.*; -import jodd.vtor.Vtor; +import javax.validation.ConstraintViolation; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; @@ -72,9 +72,9 @@ public Response getAttachmentsForRequirement(int requirementId, int page, int pe ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); } PageInfo pageInfo = new PageInfo(page, perPage); - Vtor vtor = bazaarService.getValidators(); - vtor.validate(pageInfo); - if (vtor.hasViolations()) ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); + Set> violations = bazaarService.validate(pageInfo); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + dalFacade = bazaarService.getDBConnection(); //Todo use requirement's projectId for security context, not the one sent from client Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); @@ -217,12 +217,9 @@ public Response createAttachment(@ApiParam(value = "Attachment entity as JSON", if (registrarErrors != null) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); } - Vtor vtor = bazaarService.getValidators(); - vtor.useProfiles("create"); - vtor.validate(attachmentToCreate); - if (vtor.hasViolations()) { - ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); - } + Set> violations = bazaarService.validate(attachmentToCreate); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Requirement requirement = dalFacade.getRequirementById(attachmentToCreate.getRequirementId(), internalUserId); @@ -308,4 +305,4 @@ public Response deleteAttachment(@PathParam("attachmentId") int attachmentId) { bazaarService.closeDBConnection(dalFacade); } } -} \ No newline at end of file +} diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java index 55244f42..95caf44e 100755 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java @@ -49,12 +49,15 @@ import i5.las2peer.restMapper.RESTService; import i5.las2peer.restMapper.annotations.ServicePath; import io.swagger.annotations.*; -import jodd.vtor.Vtor; import org.apache.commons.dbcp2.BasicDataSource; import org.apache.http.client.utils.URIBuilder; import org.jooq.SQLDialect; import javax.sql.DataSource; +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.Validator; +import javax.validation.ValidatorFactory; import javax.ws.rs.*; import javax.ws.rs.core.Link; import javax.ws.rs.core.MediaType; @@ -91,7 +94,7 @@ public class BazaarService extends RESTService { protected String emailFromAddress; protected String emailSummaryTimePeriodInMinutes; - private Vtor vtor; + private ValidatorFactory validatorFactory; private List functionRegistrar; private NotificationDispatcher notificationDispatcher; private DataSource dataSource; @@ -118,6 +121,8 @@ public BazaarService() throws Exception { dataSource = setupDataSource(dbUrl, dbUserName, dbPassword); + validatorFactory = Validation.buildDefaultValidatorFactory(); + functionRegistrar = new ArrayList<>(); functionRegistrar.add(functions -> { DALFacade dalFacade = null; @@ -133,12 +138,6 @@ public BazaarService() throws Exception { } }); - functionRegistrar.add(functions -> { - if (functions.contains(BazaarFunction.VALIDATION)) { - createValidators(); - } - }); - functionRegistrar.add(functions -> { if (functions.contains(BazaarFunction.USER_FIRST_LOGIN_HANDLING)) { registerUserAtFirstLogin(); @@ -312,12 +311,10 @@ public String notifyRegistrars(EnumSet functions) { return resultJSON; } - private void createValidators() { - vtor = new Vtor(); - } - - public Vtor getValidators() { - return vtor; + public Set> validate(Object entity) { + Validator validator = validatorFactory.getValidator(); + // Take Object for generic error handling + return validator.validate(entity); } public NotificationDispatcher getNotificationDispatcher() { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java index 78a27024..5233aab6 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java @@ -16,8 +16,8 @@ import i5.las2peer.api.security.Agent; import i5.las2peer.logging.L2pLogger; import io.swagger.annotations.*; -import jodd.vtor.Vtor; +import javax.validation.ConstraintViolation; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; @@ -92,11 +92,10 @@ public Response getCategoriesForProject(int projectId, int page, int perPage, St sortList.add(sortField); } PageInfo pageInfo = new PageInfo(page, perPage, new HashMap<>(), sortList, search); - Vtor vtor = bazaarService.getValidators(); - vtor.validate(pageInfo); - if (vtor.hasViolations()) { - ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); - } + // Take Object for generic error handling + Set> violations = bazaarService.validate(pageInfo); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); if (dalFacade.getProjectById(projectId, internalUserId) == null) { @@ -245,12 +244,10 @@ public Response createCategory(@ApiParam(value = "Category entity", required = t if (registrarErrors != null) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); } - Vtor vtor = bazaarService.getValidators(); - vtor.useProfiles("create"); - vtor.validate(categoryToCreate); - if (vtor.hasViolations()) { - ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); - } + // Take Object for generic error handling + Set> violations = bazaarService.validate(categoryToCreate); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Create_CATEGORY, String.valueOf(categoryToCreate.getProjectId()), dalFacade); @@ -309,11 +306,10 @@ public Response updateCategory(@PathParam("categoryId") int categoryId, } Agent agent = Context.getCurrent().getMainAgent(); String userId = agent.getIdentifier(); - Vtor vtor = bazaarService.getValidators(); - vtor.validate(categoryToUpdate); - if (vtor.hasViolations()) { - ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); - } + // Take Object for generic error handling + Set> violations = bazaarService.validate(categoryToUpdate); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_CATEGORY, dalFacade); @@ -662,11 +658,10 @@ public Response getFollowersForCategory(@PathParam("categoryId") int categoryId, ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); } PageInfo pageInfo = new PageInfo(page, perPage); - Vtor vtor = bazaarService.getValidators(); - vtor.validate(pageInfo); - if (vtor.hasViolations()) { - ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); - } + // Take Object for generic error handling + Set> violations = bazaarService.validate(pageInfo); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Category category = dalFacade.getCategoryById(categoryId, internalUserId); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CommentsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CommentsResource.java index 2623b317..9041ecb5 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CommentsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CommentsResource.java @@ -17,8 +17,8 @@ import i5.las2peer.api.security.AnonymousAgent; import i5.las2peer.logging.L2pLogger; import io.swagger.annotations.*; -import jodd.vtor.Vtor; +import javax.validation.ConstraintViolation; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; @@ -115,17 +115,14 @@ public Response getAllComments( Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); HashMap filterMap = new HashMap<>(); - for(String filterOption : filters) { - filterMap.put(filterOption,internalUserId.toString()); + for (String filterOption : filters) { + filterMap.put(filterOption, internalUserId.toString()); } PageInfo pageInfo = new PageInfo(page, perPage, filterMap, sortList, search, null, embedParents); - - Vtor vtor = bazaarService.getValidators(); - vtor.validate(pageInfo); - if (vtor.hasViolations()) { - ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); - } + // Take Object for generic error handling + Set> violations = bazaarService.validate(pageInfo); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); PaginationResult commentResult = null; @@ -201,9 +198,10 @@ public Response getCommentsForRequirement(int requirementId, int page, int perPa ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); } PageInfo pageInfo = new PageInfo(page, perPage); - Vtor vtor = bazaarService.getValidators(); - vtor.validate(pageInfo); - if (vtor.hasViolations()) ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); + // Take Object for generic error handling + Set> violations = bazaarService.validate(pageInfo); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + dalFacade = bazaarService.getDBConnection(); //Todo use requirement's projectId for security context, not the one sent from client Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); @@ -356,12 +354,10 @@ public Response createComment(@ApiParam(value = "Comment entity", required = tru ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.comment.create")); } commentToCreate.setCreator(dalFacade.getUserById(internalUserId)); - Vtor vtor = bazaarService.getValidators(); - vtor.useProfiles("create"); - vtor.validate(commentToCreate); - if (vtor.hasViolations()) { - ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); - } + // Take Object for generic error handling + Set> violations = bazaarService.validate(commentToCreate); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + dalFacade.followRequirement(internalUserId, requirement.getId()); Comment createdComment = dalFacade.createComment(commentToCreate); bazaarService.getNotificationDispatcher().dispatchNotification(createdComment.getCreationDate(), Activity.ActivityAction.CREATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_46, diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java index 156ed280..d6705529 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java @@ -14,13 +14,14 @@ import i5.las2peer.api.security.Agent; import i5.las2peer.logging.L2pLogger; import io.swagger.annotations.*; -import jodd.vtor.Vtor; +import javax.validation.ConstraintViolation; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.net.HttpURLConnection; import java.util.EnumSet; +import java.util.Set; @Api(value = "personalisation", description = "Personalisation Data resource") @@ -148,16 +149,12 @@ public Response setPersonalisationData(@PathParam("key") String key, @PathParam( PersonalisationData fullData = PersonalisationData.getBuilder().key(key).userId(internalUserId).version(version).value(data.getValue()).build(); + // Take Object for generic error handling + Set> violations = bazaarService.validate(fullData); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); - Vtor vtor = bazaarService.getValidators(); - vtor.useProfiles("create"); - vtor.validate(fullData); - if (vtor.hasViolations()) { - ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); - } dalFacade.setPersonalisationData(fullData); - return Response.ok(fullData.toJSON()).build(); } catch (BazaarException bex) { if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java index f4e100b3..51d0c037 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java @@ -17,8 +17,8 @@ import i5.las2peer.api.security.AnonymousAgent; import i5.las2peer.logging.L2pLogger; import io.swagger.annotations.*; -import jodd.vtor.Vtor; +import javax.validation.ConstraintViolation; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; @@ -110,17 +110,14 @@ public Response getProjects( Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); HashMap filterMap = new HashMap<>(); - for(String filterOption : filters) { - filterMap.put(filterOption,internalUserId.toString()); + for (String filterOption : filters) { + filterMap.put(filterOption, internalUserId.toString()); } PageInfo pageInfo = new PageInfo(page, perPage, filterMap, sortList, search, ids); - - Vtor vtor = bazaarService.getValidators(); - vtor.validate(pageInfo); - if (vtor.hasViolations()) { - ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); - } + // Take Object for generic error handling + Set> violations = bazaarService.validate(pageInfo); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); PaginationResult projectsResult; if (agent instanceof AnonymousAgent) { @@ -254,10 +251,11 @@ public Response createProject(@ApiParam(value = "Project entity", required = tru } Agent agent = Context.getCurrent().getMainAgent(); String userId = agent.getIdentifier(); - Vtor vtor = bazaarService.getValidators(); - vtor.useProfiles("create"); - vtor.validate(projectToCreate); - if (vtor.hasViolations()) ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); + + // Validate input + Set> violations = bazaarService.validate(projectToCreate); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Create_PROJECT, dalFacade); @@ -315,11 +313,11 @@ public Response updateProject(@PathParam("projectId") int projectId, } Agent agent = Context.getCurrent().getMainAgent(); String userId = agent.getIdentifier(); - Vtor vtor = bazaarService.getValidators(); - vtor.validate(projectToUpdate); - if (vtor.hasViolations()) { - ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); - } + + // Take Object for generic error handling + Set> violations = bazaarService.validate(projectToUpdate); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_PROJECT, dalFacade); @@ -601,11 +599,11 @@ public Response getFollowersForProject(@PathParam("projectId") int projectId, ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); } PageInfo pageInfo = new PageInfo(page, perPage); - Vtor vtor = bazaarService.getValidators(); - vtor.validate(pageInfo); - if (vtor.hasViolations()) { - ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); - } + + // Take Object for generic error handling + Set> violations = bazaarService.validate(pageInfo); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); PaginationResult projectFollowers = dalFacade.listFollowersForProject(projectId, pageInfo); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java index 275f9cc9..31b30ec7 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java @@ -17,9 +17,8 @@ import i5.las2peer.api.security.AnonymousAgent; import i5.las2peer.logging.L2pLogger; import io.swagger.annotations.*; -import jodd.vtor.Violation; -import jodd.vtor.Vtor; +import javax.validation.ConstraintViolation; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; @@ -111,17 +110,14 @@ public Response getRequirements( Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); HashMap filterMap = new HashMap<>(); - for(String filterOption : filters) { - filterMap.put(filterOption,internalUserId.toString()); + for (String filterOption : filters) { + filterMap.put(filterOption, internalUserId.toString()); } PageInfo pageInfo = new PageInfo(page, perPage, filterMap, sortList, search, null, embedParents); - - Vtor vtor = bazaarService.getValidators(); - vtor.validate(pageInfo); - if (vtor.hasViolations()) { - ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); - } + // Take Object for generic error handling + Set> violations = bazaarService.validate(pageInfo); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); PaginationResult requirementsResult = null; @@ -218,11 +214,10 @@ public Response getRequirementsForProject(int projectId, int page, int perPage, sortList.add(sortField); } PageInfo pageInfo = new PageInfo(page, perPage, filters, sortList, search); - Vtor vtor = bazaarService.getValidators(); - vtor.validate(pageInfo); - if (vtor.hasViolations()) { - ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); - } + // Take Object for generic error handling + Set> violations = bazaarService.validate(pageInfo); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); if (dalFacade.getProjectById(projectId, internalUserId) == null) { @@ -325,11 +320,10 @@ public Response getRequirementsForCategory(int categoryId, int page, int perPage sortList.add(sortField); } PageInfo pageInfo = new PageInfo(page, perPage, filters, sortList, search); - Vtor vtor = bazaarService.getValidators(); - vtor.validate(pageInfo); - if (vtor.hasViolations()) { - ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); - } + // Take Object for generic error handling + Set> violations = bazaarService.validate(pageInfo); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); if (dalFacade.getCategoryById(categoryId, internalUserId) == null) { @@ -492,13 +486,9 @@ public Response createRequirement(@ApiParam(value = "Requirement entity", requir Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); requirementToCreate.setCreator(dalFacade.getUserById(internalUserId)); - Vtor vtor = bazaarService.getValidators(); - vtor.useProfiles("create"); - vtor.validate(requirementToCreate); - if (vtor.hasViolations()) { - ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); - } - vtor.resetProfiles(); + // Take Object for generic error handling + Set> violations = bazaarService.validate(requirementToCreate); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); // check if all categories are in the same project for (Category category : requirementToCreate.getCategories()) { @@ -518,11 +508,10 @@ public Response createRequirement(@ApiParam(value = "Requirement entity", requir for (Attachment attachment : requirementToCreate.getAttachments()) { attachment.setCreator(dalFacade.getUserById(internalUserId)); attachment.setRequirementId(createdRequirement.getId()); - vtor.validate(attachment); - if (vtor.hasViolations()) { - ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); - } - vtor.resetProfiles(); + // Take Object for generic error handling + violations = bazaarService.validate(attachment); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + dalFacade.createAttachment(attachment); } } @@ -576,11 +565,10 @@ public Response updateRequirement(@PathParam("requirementId") int requirementId, } Agent agent = Context.getCurrent().getMainAgent(); String userId = agent.getIdentifier(); - Vtor vtor = bazaarService.getValidators(); - vtor.validate(requirementToUpdate); - if (vtor.hasViolations()) { - ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); - } + // Take Object for generic error handling + Set> violations = bazaarService.validate(requirementToUpdate); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_REQUIREMENT, dalFacade); @@ -1038,11 +1026,14 @@ public Response vote(@PathParam("requirementId") int requirementId, if (registrarErrors != null) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); } + + /* Not sure why this is necessary. Should be handled by swagger if (!(direction.equals("up") || direction.equals("down"))) { Vtor vtor = bazaarService.getValidators(); vtor.addViolation(new Violation("Direction can only be \"up\" or \"down\"", direction, direction)); ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); - } + }*/ + dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Create_VOTE, dalFacade); @@ -1328,11 +1319,10 @@ public Response getDevelopersForRequirement(@PathParam("requirementId") int requ ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); } PageInfo pageInfo = new PageInfo(page, perPage); - Vtor vtor = bazaarService.getValidators(); - vtor.validate(pageInfo); - if (vtor.hasViolations()) { - ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); - } + // Take Object for generic error handling + Set> violations = bazaarService.validate(pageInfo); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); PaginationResult requirementDevelopers = dalFacade.listDevelopersForRequirement(requirementId, pageInfo); @@ -1454,11 +1444,10 @@ public Response getFollowersForRequirement(@PathParam("requirementId") int requi ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); } PageInfo pageInfo = new PageInfo(page, perPage); - Vtor vtor = bazaarService.getValidators(); - vtor.validate(pageInfo); - if (vtor.hasViolations()) { - ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); - } + // Take Object for generic error handling + Set> violations = bazaarService.validate(pageInfo); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); PaginationResult requirementFollowers = dalFacade.listFollowersForRequirement(requirementId, pageInfo); @@ -1548,4 +1537,4 @@ public Response getAttachmentsForRequirement(@PathParam("requirementId") int req AttachmentsResource attachmentsResource = new AttachmentsResource(); return attachmentsResource.getAttachmentsForRequirement(requirementId, page, perPage); } -} \ No newline at end of file +} diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/UsersResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/UsersResource.java index 0d121c53..177eb597 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/UsersResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/UsersResource.java @@ -15,17 +15,14 @@ import i5.las2peer.api.security.Agent; import i5.las2peer.logging.L2pLogger; import io.swagger.annotations.*; -import jodd.vtor.Vtor; +import javax.validation.ConstraintViolation; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.net.HttpURLConnection; import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.List; +import java.util.*; @Api(value = "users", description = "Users resource") @@ -187,11 +184,10 @@ public Response updateUser(@PathParam("userId") int userId, } Agent agent = Context.getCurrent().getMainAgent(); - Vtor vtor = bazaarService.getValidators(); - vtor.validate(userToUpdate); - if (vtor.hasViolations()) { - ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); - } + // Take Object for generic error handling + Set> violations = bazaarService.validate(userToUpdate); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(agent.getIdentifier()); if (!internalUserId.equals(userId)) { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index e7363b5f..7c350ef6 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -203,14 +203,17 @@ public Project createProject(Project project, int userId) throws Exception { projectRepository = (projectRepository != null) ? projectRepository : new ProjectRepositoryImpl(dslContext); project.setDefaultCategoryId(null); Project newProject = projectRepository.add(project); - Category uncategorizedCategory = Category.getBuilder(Localization.getInstance().getResourceBundle().getString("category.uncategorized.Name")) - .description(Localization.getInstance().getResourceBundle().getString("category.uncategorized.Description")) + + String categoryName = Localization.getInstance().getResourceBundle().getString("category.uncategorized.Name"); + String categoryDescription = Localization.getInstance().getResourceBundle().getString("category.uncategorized.Description"); + Category uncategorizedCategory = Category.getBuilder(categoryName) + .description(categoryDescription) .projectId(newProject.getId()) .build(); uncategorizedCategory.setLeader(project.getLeader()); Category defaultCategory = createCategory(uncategorizedCategory, userId); newProject.setDefaultCategoryId(defaultCategory.getId()); - //TODO concurrency transaction -> https://www.jooq.org/doc/3.9/manual/sql-execution/transaction-management/ + // TODO: concurrency transaction -> https://www.jooq.org/doc/3.9/manual/sql-execution/transaction-management/ return projectRepository.update(newProject); } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java index 24efc437..8eb39236 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java @@ -25,45 +25,40 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; -import jodd.vtor.constraint.MaxLength; -import jodd.vtor.constraint.Min; -import jodd.vtor.constraint.NotBlank; -import jodd.vtor.constraint.NotNull; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; import java.time.LocalDateTime; public class Attachment extends EntityBase { private int id; - @NotNull(profiles = {"create"}) - @NotBlank(profiles = {"*"}) - @MaxLength(value = 50, profiles = {"*"}) + @NotNull + @Size(min = 1, max = 50) private String name; private String description; - @NotNull(profiles = {"create"}) - @NotBlank(profiles = {"*"}) - @MaxLength(value = 1000, profiles = {"*"}) + @NotNull + @Size(min = 1, max = 10) private String mimeType; - @NotNull(profiles = {"create"}) - @NotBlank(profiles = {"*"}) - @MaxLength(value = 1000, profiles = {"*"}) + @NotNull + @Size(min = 1, max = 10) private String identifier; - @NotNull(profiles = {"create"}) - @NotBlank(profiles = {"*"}) - @MaxLength(value = 1000, profiles = {"*"}) + @NotNull + @Size(min = 1, max = 10) private String fileUrl; - @Min(value = 0, profiles = {"create"}) + @Min(value = 0) private int requirementId; private User creator; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") @JsonSerialize(using = LocalDateTimeSerializer.class) @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime creationDate; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java index 32f09c0f..e59894b5 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java @@ -27,11 +27,10 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; -import jodd.vtor.constraint.MaxLength; -import jodd.vtor.constraint.Min; -import jodd.vtor.constraint.NotBlank; -import jodd.vtor.constraint.NotNull; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; import java.time.LocalDateTime; /** @@ -41,21 +40,20 @@ public class Category extends EntityBase { private int id; - @NotBlank(profiles = {"*"}) - @NotNull(profiles = {"create"}) - @MaxLength(value = 50, profiles = {"*"}) + @NotNull(message = "name can't be null") + @Size(min = 1, max = 50, message = "name must have between 1 and 50 characters") private String name; - @NotBlank(profiles = {"*"}) - @NotNull(profiles = {"create"}) + @NotNull + @Size(min = 1) private String description; - @Min(value = 0, profiles = {"create"}) + @Min(value = 0) private int projectId; private User leader; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") @JsonSerialize(using = LocalDateTimeSerializer.class) @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime creationDate; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java index 573aa43e..de9af63b 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java @@ -27,10 +27,9 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; -import jodd.vtor.constraint.Min; -import jodd.vtor.constraint.NotBlank; -import jodd.vtor.constraint.NotNull; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; import java.time.LocalDateTime; /** @@ -39,14 +38,14 @@ public class Comment extends EntityBase { private int id; - @NotBlank(profiles = {"*"}) - @NotNull(profiles = {"create"}) + + @NotNull private String message; - @Min(value = 0, profiles = {"create"}) + @Min(value = 0) private Integer replyToComment; - @Min(value = 0, profiles = {"create"}) + @Min(value = 0) private int requirementId; private User creator; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityBase.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityBase.java index 5a1c40b8..dabae8ab 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityBase.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityBase.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; /** * @since 9/16/2014 @@ -30,6 +31,6 @@ public abstract class EntityBase implements IdentifiedById { public String toJSON() throws JsonProcessingException { - return new ObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL).writeValueAsString(this); + return new ObjectMapper().registerModule(new JavaTimeModule()).setSerializationInclusion(JsonInclude.Include.NON_NULL).writeValueAsString(this); } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java index e1c666a2..fbd3697c 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java @@ -20,11 +20,9 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; - -import jodd.vtor.constraint.MaxLength; -import jodd.vtor.constraint.Min; -import jodd.vtor.constraint.NotBlank; -import jodd.vtor.constraint.NotNull; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; /** * @since 26/11/2019 @@ -32,25 +30,23 @@ public class PersonalisationData extends EntityBase { - private int id; + private int id; - @NotBlank(profiles = {"*"}) - @NotNull(profiles = {"create"}) - @MaxLength(value = 50, profiles = {"*"}) - private String key; + @NotNull + @Size(min = 1, max = 50, message = "Key must have between 1 and 50 characters") + private String key; - @Min(value = 0, profiles = {"create"}) - private int version; + @Min(value = 0) + private int version; - private int userId; + private int userId; - @NotBlank(profiles = {"*"}) - @NotNull(profiles = {"create"}) - @MaxLength(value = 10000, profiles = {"*"}) - private String value; + @NotNull + @Size(min = 1, max = 10000) + private String value; - public PersonalisationData(){ + public PersonalisationData() { } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java index 94995a43..a1aebc26 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java @@ -26,10 +26,9 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; -import jodd.vtor.constraint.MaxLength; -import jodd.vtor.constraint.NotBlank; -import jodd.vtor.constraint.NotNull; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; import java.time.LocalDateTime; /** @@ -39,13 +38,11 @@ public class Project extends EntityBase { private int id; - @NotBlank(profiles = {"*"}) - @NotNull(profiles = {"create"}) - @MaxLength(value = 50, profiles = {"*"}) + @NotNull(message = "name can not be null") + @Size(min = 1, max = 50, message = "name can't have more than 50 characters") private String name; - @NotBlank(profiles = {"*"}) - @NotNull(profiles = {"create"}) + @NotNull(message = "description can not be nul") private String description; private Boolean visibility = true; @@ -54,7 +51,7 @@ public class Project extends EntityBase { private User leader; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") @JsonSerialize(using = LocalDateTimeSerializer.class) @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime creationDate; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java index 24f716be..3a61a776 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java @@ -8,8 +8,10 @@ import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import de.rwth.dbis.acis.bazaar.service.dal.helpers.UserVote; -import jodd.vtor.constraint.*; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; import java.time.LocalDateTime; import java.util.List; @@ -20,35 +22,33 @@ public class Requirement extends EntityBase { private int id; - @NotBlank(profiles = {"*"}) - @NotNull(profiles = {"create"}) - @MaxLength(value = 50, profiles = {"*"}) + @Size(min = 1, max = 50, message = "name must be between 1 and 50 characters") private String name; - @NotBlank(profiles = {"*"}) - @NotNull(profiles = {"create"}) + @NotNull + @Size(min = 1, message = "Description can't be empty") private String description; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") @JsonSerialize(using = LocalDateTimeSerializer.class) @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime realized; - @Min(value = 0, profiles = {"create"}) + @Min(value = 0) private int projectId; private User creator; private User leadDeveloper; - @NotNull(profiles = {"create"}) - @Size(min = 1, profiles = {"create"}) + @NotNull + @Size(min = 1) private List categories; // This field is not filled because attachments should be not included in requirements response. // But the API still allows to create a requirement with attachments at the same time. private List attachments; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") @JsonSerialize(using = LocalDateTimeSerializer.class) @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime creationDate; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java index bf349c17..3b155b53 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java @@ -27,36 +27,33 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; -import jodd.vtor.constraint.MaxLength; -import jodd.vtor.constraint.Min; -import jodd.vtor.constraint.NotBlank; -import jodd.vtor.constraint.NotNull; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; import java.time.LocalDateTime; public class User extends EntityBase { private int id; - @NotBlank(profiles = {"*"}) - @NotNull(profiles = {"create"}) - @MaxLength(value = 1000, profiles = {"*"}) + @NotNull(message = "Username can't be null") + @Size(min = 1, max = 1000, message = "Username must have between 1 and 1000 characters") private String userName; - @MaxLength(value = 1000, profiles = {"*"}) + @Size(min = 1, max = 1000, message = "first name must have between 1 and 1000 characters") private String firstName; - @MaxLength(value = 1000, profiles = {"*"}) + @Size(min = 1, max = 1000, message = "last name must have between 1 and 1000 characters") private String lastName; - @NotBlank(profiles = {"*"}) - @NotNull(profiles = {"create"}) - @MaxLength(value = 1000, profiles = {"*"}) + @NotNull(message = "eMail can't be null") + @Size(min = 1, max = 1000, message = "eMail must have between 1 and 1000 characters") private transient String eMail; private Boolean admin; - @Min(value = 1, profiles = {"create"}) + @NotNull(message = "las2peerId can't be null") + @Size(min = 1, max = 1000, message = "las2peerId must have between 1 and 1000 characters") private String las2peerId; private String profileImage; @@ -67,7 +64,7 @@ public class User extends EntityBase { private Boolean personalizationEnabled; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") @JsonSerialize(using = LocalDateTimeSerializer.class) @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime creationDate; @@ -136,14 +133,16 @@ public String getProfileImage() { } public Boolean isEmailLeadSubscription() { - return emailLeadSubscription; + return emailLeadSubscription != null && emailLeadSubscription; } public Boolean isEmailFollowSubscription() { - return emailFollowSubscription; + return emailFollowSubscription != null && emailFollowSubscription; } - public Boolean isPersonalizationEnabled(){ return personalizationEnabled; } + public Boolean isPersonalizationEnabled() { + return personalizationEnabled != null && personalizationEnabled; + } public LocalDateTime getCreationDate() { return creationDate; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java index 5757a50a..334b5f5b 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java @@ -20,8 +20,7 @@ package de.rwth.dbis.acis.bazaar.service.dal.helpers; -import jodd.vtor.constraint.Min; - +import javax.validation.constraints.Min; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -64,7 +63,7 @@ public PageInfo(int pageNumber, int pageSize, Map filters, List< this.filters = filters; this.sorts = sorts; this.search = search != null ? search : ""; - this.ids = ids; + this.ids = ids != null ? ids : new ArrayList<>(); this.embed = embed; } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java index 63b976f7..c66deb58 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java @@ -26,7 +26,9 @@ import de.rwth.dbis.acis.bazaar.service.internalization.Localization; import jodd.vtor.Violation; +import javax.validation.ConstraintViolation; import java.util.List; +import java.util.Set; /** * @since 10/6/2014 @@ -80,6 +82,17 @@ public void handleViolations(List violations) throws BazaarException throw bazaarException; } + public void handleViolations(Set> violations) throws BazaarException { + BazaarException bazaarException = new BazaarException(ExceptionLocation.BAZAARSERVICE); + bazaarException.setErrorCode(ErrorCode.VALIDATION); + StringBuilder builder = new StringBuilder(); + for (ConstraintViolation violation : violations) { + builder.append(String.format(Localization.getInstance().getResourceBundle().getString("error.validation"), violation.getMessage(), violation.getInvalidValue())); + } + bazaarException.setMessage(builder.toString()); + throw bazaarException; + } + public void throwException(ExceptionLocation location, ErrorCode errorCode, String message) throws BazaarException { BazaarException bazaarException = new BazaarException(location); bazaarException.setErrorCode(errorCode); diff --git a/requirement_bazaar/src/main/resources/migrations/V5__add_delete_constraints.sql b/requirement_bazaar/src/main/resources/migrations/V5__add_delete_constraints.sql new file mode 100644 index 00000000..ad972185 --- /dev/null +++ b/requirement_bazaar/src/main/resources/migrations/V5__add_delete_constraints.sql @@ -0,0 +1,14 @@ +SET FOREIGN_KEY_CHECKS = 0; +ALTER TABLE reqbaz.category + DROP FOREIGN KEY `category_project`; + +ALTER TABLE reqbaz.category + ADD CONSTRAINT category_project FOREIGN KEY category_project (project_id) REFERENCES project (id) + ON DELETE CASCADE; + +ALTER TABLE reqbaz.project + DROP FOREIGN KEY `project_category`; + +ALTER TABLE reqbaz.project + ADD CONSTRAINT project_category FOREIGN KEY project_category (default_category_id) REFERENCES category (id) + ON DELETE CASCADE; diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index e55c4530..0c204072 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -32,25 +32,6 @@ public void testGetVersion() { Assert.fail(e.toString()); } } - /** - * Test to get a list of projects - */ - @Test - public void testGetProjects() { - try { - MiniClient client = getClient(); - - ClientResponse result = client.sendRequest("GET", mainPath + "projects", ""); - - Assert.assertEquals(200, result.getHttpCode()); - JsonElement response = JsonParser.parseString(result.getResponse()); - System.out.println(response.toString()); - Assert.assertTrue(response.isJsonArray()); - } catch (Exception e) { - e.printStackTrace(); - Assert.fail(e.toString()); - } - } /** * Test to get a list of projects @@ -79,4 +60,23 @@ public void testCreateProject() { } } + /** + * Test to get a list of projects + */ + @Test + public void testGetProjects() { + try { + MiniClient client = getClient(); + + ClientResponse result = client.sendRequest("GET", mainPath + "projects", ""); + + Assert.assertEquals(200, result.getHttpCode()); + JsonElement response = JsonParser.parseString(result.getResponse()); + System.out.println(response.toString()); + Assert.assertTrue(response.isJsonArray()); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(e.toString()); + } + } } diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java new file mode 100644 index 00000000..713ede04 --- /dev/null +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java @@ -0,0 +1,380 @@ +/* + * + * Copyright (c) 2014, RWTH Aachen University. + * For a list of contributors see the AUTHORS file at the top-level directory + * of this distribution. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * / + */ + +package de.rwth.dbis.acis.bazaar.service.dal; + +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.ProjectRecord; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; +import de.rwth.dbis.acis.bazaar.service.dal.entities.User; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; +import de.rwth.dbis.acis.bazaar.service.internalization.Localization; +import org.apache.commons.dbcp2.BasicDataSource; +import org.jooq.DSLContext; +import org.jooq.SQLDialect; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import javax.sql.DataSource; +import java.util.List; +import java.util.Locale; +import java.util.ResourceBundle; + +import static junit.framework.TestCase.*; + +//TODO Pagination testing +public class DALFacadeTest { + + public static final PageInfo ALL_IN_ONE_PAGE = new PageInfo(0, 100); + + DALFacade facade; + private DALFacadeImpl dalImpl; + DSLContext jooq; + private User initUser; + + private static DataSource setupDataSource(String dbUrl, String dbUserName, String dbPassword) { + BasicDataSource dataSource = new BasicDataSource(); + // Deprecated according to jooq + // dataSource.setDriverClassName("com.mysql.jdbc.Driver"); + dataSource.setUrl(dbUrl + "?useSSL=false&serverTimezone=UTC"); + dataSource.setUsername(dbUserName); + dataSource.setPassword(dbPassword); + dataSource.setValidationQuery("SELECT 1;"); + dataSource.setTestOnBorrow(true); // test each connection when borrowing from the pool with the validation query + dataSource.setMaxConnLifetimeMillis(1000 * 60 * 60); // max connection life time 1h. mysql drops connection after 8h. + return dataSource; + } + + @Before + public void setUp() throws Exception { + String url = "jdbc:mysql://localhost:3306/reqbaz"; + + DataSource dataSource = setupDataSource(url, "root", "rootpw"); + + dalImpl = new DALFacadeImpl(dataSource, SQLDialect.MYSQL); + facade = dalImpl; + jooq = dalImpl.getDslContext(); + + Locale locale = new Locale("en", "us"); + Localization.getInstance().setResourceBundle(ResourceBundle.getBundle("i18n.Translation", locale)); + + try { + initUser = facade.getUserById(facade.getUserIdByLAS2PeerId("1111")); + } catch (Exception e) { + initUser = User.getBuilder("test@test.hu") + .firstName("Elek") + .lastName("Test") + .userName("TestElek") + .admin(true) + .las2peerId("1111") + .build(); + + facade.createUser(initUser); + initUser = facade.getUserById(facade.getUserIdByLAS2PeerId("1111")); + } + } + + @Test + public void testCreateUser() { + try { + facade.createUser(User.getBuilder("unittest@test.hu").firstName("Max").lastName("Zimmermann").admin(false).las2peerId("9999").userName("MaxZim").personalizationEnabled(false).emailFollowSubscription(false).emailLeadSubscription(false).build()); + + Integer userId = facade.getUserIdByLAS2PeerId("9999"); + User user = facade.getUserById(userId); + + assertEquals("unittest@test.hu", user.getEMail()); + assertEquals("Max", user.getFirstName()); + assertEquals("Zimmermann", user.getLastName()); + assertFalse(user.isAdmin()); + assertEquals("9999", user.getLas2peerId()); + + jooq.delete(de.rwth.dbis.acis.bazaar.dal.jooq.tables.User.USER).where(de.rwth.dbis.acis.bazaar.dal.jooq.tables.User.USER.ID.eq(9)).execute(); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(e.toString()); + } + } + + @Test + public void testGetUserById() throws Exception { + Integer userId = facade.getUserIdByLAS2PeerId("1111"); + User user = facade.getUserById(userId); + + assertEquals("test@test.hu", user.getEMail()); + assertEquals("Elek", user.getFirstName()); + assertEquals("Test", user.getLastName()); + assertTrue(user.isAdmin()); + assertEquals("1111", user.getLas2peerId()); + } + + @Test + public void testCreateGetProject() throws Exception { + Project project = Project.getBuilder("Project3").description("ProjDesc3").id(1).leader(initUser).visibility(true).isFollower(false).build(); + + facade.createProject(project, initUser.getId()); + + // This can't work reliably without fetching by name + // Id is set by the database but never returned + ProjectRecord projectRecord = jooq.selectFrom(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Project.PROJECT).where(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Project.PROJECT.NAME.equal("Project3")).fetchOne(); + assertNotNull(projectRecord); + Integer projectID = projectRecord.getId(); // .get(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Project.PROJECT.ID); + + Project projectById = facade.getProjectById(projectID, initUser.getId()); + + assertEquals(project.getName(), projectById.getName() ); + assertEquals(project.getDescription(),projectById.getDescription() ); + assertEquals(project.getLeader().getId(), projectById.getLeader().getId()); + assertEquals(project.getVisibility(), projectById.getVisibility() ); + + // Now check if this can also be found as a public project + PaginationResult projectsPage = facade.listPublicProjects(new PageInfo(0, 1), initUser.getId()); + + List projects = projectsPage.getElements(); + + assertNotNull(projects); + // assertEquals(1,projects.size()); + + for (Project proj : projects) { + assertTrue(proj.getVisibility()); + } + + Project proj = projects.get(0); + + assertEquals(projectById.getId(), proj.getId() ); + assertEquals(projectById.getName(), proj.getName() ); + assertEquals(projectById.getDescription(),proj.getDescription() ); + assertEquals(projectById.getLeader().getId(), proj.getLeader().getId()); + assertEquals(projectById.getVisibility(), proj.getVisibility() ); + + + jooq.delete(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Project.PROJECT).where(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Project.PROJECT.ID.equal(project.getId())).execute(); + } + + @Test + public void testListPublicProjects() throws Exception { + + } + + /* Doesn't work, searching breaks + public void testModifyProject() throws Exception { + //TODO + } + + public void testListRequirements() throws Exception { + List requirements = facade.listRequirements(ALL_IN_ONE_PAGE); + + assertNotNull(requirements); + assertEquals(3, requirements.size()); + + Requirement requirement = requirements.get(2); + + assertEquals(1,requirement.getId()); + assertEquals(1,requirement.getCreator().getId()); + assertEquals(1,requirement.getLeadDeveloper().getId()); + assertEquals(1,requirement.getProjectId()); + assertEquals("Req1",requirement.getName()); + assertEquals("ReqDesc1",requirement.getDescription()); + + requirements = facade.listRequirements(new PageInfo(1, 2)); + + assertNotNull(requirements); + assertEquals(1, requirements.size()); + assertEquals(1,requirements.get(0).getId()); + + requirements = facade.listRequirements(new PageInfo(0, 1)); + + assertNotNull(requirements); + assertEquals(1, requirements.size()); + assertEquals(3,requirements.get(0).getId()); + } + + public void testListRequirementsByProject() throws Exception { + List requirements = (List) facade.listRequirementsByProject(2, ALL_IN_ONE_PAGE, 1); + + assertNotNull(requirements); + assertEquals(1, requirements.size()); + + Requirement requirement2 = requirements.get(0); + + assertEquals(2,requirement2.getId()); + assertEquals(1,requirement2.getCreator().getId()); + assertEquals(1,requirement2.getLeadDeveloper().getId()); + assertEquals(2,requirement2.getProjectId()); + assertEquals("Req2",requirement2.getName()); + assertEquals("ReqDesc2",requirement2.getDescription()); + + + } + + public void testGetRequirementById() throws Exception { + Requirement requirement = facade.getRequirementById(2, 1); + + assertEquals(2, requirement.getId()); + + assertEquals(initUser, requirement.getCreator()); + assertEquals(initUser,requirement.getCreator()); + assertEquals(initUser.getFirstName(),requirement.getCreator().getFirstName()); + + assertEquals(initUser,requirement.getLeadDeveloper()); + assertEquals(1,requirement.getLeadDeveloper().getId()); + assertEquals("Elek",requirement.getLeadDeveloper().getFirstName()); + + assertEquals(2,requirement.getProjectId()); + assertEquals("Req2",requirement.getName()); + assertEquals("ReqDesc2",requirement.getDescription()); + + List attachments = requirement.getAttachments(); + assertNotNull(attachments); + assertEquals(1, attachments.size()); + assertEquals(2, attachments.get(0).getCreator().getId()); + + List components = requirement.getCategories(); + assertNotNull(components); + assertEquals(1,components.size()); + assertEquals(1, components.get(0).getId()); + assertEquals("Comp1",components.get(0).getName()); + } + + public void testCreateRequirement() throws Exception { + int createdRequirementId = 9; + try { + Requirement requirement = Requirement.getBuilder("AddedReq1").id(createdRequirementId).description("Test addition").creator(initUser).leadDeveloper(initUser).projectId(3).build(); + + facade.createRequirement(requirement, initUser.getId()); + + Requirement requirementById = facade.getRequirementById(createdRequirementId, 1); + + assertEquals(requirement.getId(), requirementById.getId()); + assertEquals(requirement.getName(), requirementById.getName()); + assertEquals(requirement.getDescription(), requirementById.getDescription()); + assertEquals(requirement.getCreator(), requirementById.getCreator()); + assertEquals(requirement.getLeadDeveloper(), requirementById.getLeadDeveloper()); + assertEquals(requirement.getProjectId(), requirementById.getProjectId()); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(e.toString()); + } + } + + public void testModifyRequirement() throws Exception { + //TODO + } + + public void testDeleteRequirementById() throws Exception { + Requirement requirement = Requirement.getBuilder("AddedReq1").id(9).description("Test addition").creator(initUser).leadDeveloper(initUser).projectId(3).build(); + + facade.createRequirement(requirement, initUser.getId()); + + facade.deleteRequirementById(9, initUser.getId()); + + try { + Requirement requirementById = facade.getRequirementById(9, 1); + } + catch (Exception ex){ + assertEquals("No class de.rwth.dbis.acis.bazaar.service.dal.jooq.tables.records.RequirementsRecord found with id: 9", ex.getMessage()); + } + } + + public void testListComponentsByProjectId() throws Exception { + List components = (List) facade.listCategoriesByProjectId(2, ALL_IN_ONE_PAGE, 1); + + assertNotNull(components); + assertEquals(1,components.size()); + assertEquals(1,components.get(0).getId()); + } + + public void testCreateCategory() throws Exception { + int createdComponentId = 9; + Category testComp9 = Category.getBuilder("TestComp9").description("Very testing").id(createdComponentId).projectId(1).leader(initUser).build(); + + facade.createCategory(testComp9, initUser.getId()); + + List components = (List) facade.listCategoriesByProjectId(1, ALL_IN_ONE_PAGE, 1); + + assertNotNull(components); + assertEquals(1,components.size()); + assertEquals(createdComponentId,components.get(0).getId()); + + jooq.delete(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Category.CATEGORY).where(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Category.CATEGORY.ID.equal(createdComponentId)).execute(); + } + + public void testModifyComponent() throws Exception { + //TODO + } + + public void testDeleteComponentById() throws Exception { + //TODO + } + + public void testListCommentsByRequirementId() throws Exception { + List comments = facade.listCommentsByRequirementId(2, ALL_IN_ONE_PAGE).getElements(); + + assertNotNull(comments); + assertEquals(2,comments.size()); + assertTrue(comments.get(0).getId() == 1 || comments.get(0).getId() == 2); + assertTrue(comments.get(1).getId() == 1 || comments.get(1).getId() == 2); + } + + public void testCreateComment() throws Exception { + int createdCommentId = 9; + Comment testComment = Comment.getBuilder("TestComment").id(createdCommentId).creator(initUser).requirementId(1).build(); + + facade.createComment(testComment); + + List comments = facade.listCommentsByRequirementId(1, ALL_IN_ONE_PAGE).getElements(); + + assertNotNull(comments); + assertEquals(1,comments.size()); + assertEquals(createdCommentId,comments.get(0).getId()); + + jooq.delete(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Comment.COMMENT).where(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Comment.COMMENT.ID.equal(createdCommentId)).execute(); + } + + public void testDeleteCommentById() throws Exception { + Comment testComment = Comment.getBuilder("TestComment").id(9).creator(initUser).requirementId(1).build(); + + facade.createComment(testComment); + + facade.deleteCommentById(9); + + List comments = facade.listCommentsByRequirementId(1, ALL_IN_ONE_PAGE).getElements(); + assertNotNull(comments); + assertEquals(0, comments.size()); + } + + public void testVoteAndUnvote() throws Exception { + boolean hasUserVotedForRequirement = facade.hasUserVotedForRequirement(3, 1); + + assertFalse(hasUserVotedForRequirement); + + facade.vote(3,1,true); + hasUserVotedForRequirement = facade.hasUserVotedForRequirement(3, 1); + + assertTrue(hasUserVotedForRequirement); + + facade.unVote(3,1); + hasUserVotedForRequirement = facade.hasUserVotedForRequirement(3, 1); + + assertFalse(hasUserVotedForRequirement); + } + */ +} From 031587571046d03327d1e02b0befa97c7356264b Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 13 Feb 2021 19:09:54 +0100 Subject: [PATCH 040/134] Update gh actions to pin port --- .github/workflows/gradle.yml | 16 +++++++--------- ....acis.bazaar.service.BazaarService.properties | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 1478a605..fbf59891 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -9,7 +9,7 @@ jobs: mysql: image: mysql:latest ports: - - 3306 + - 3306:3306 env: MYSQL_USER: reqbaz MYSQL_PASSWORD: password @@ -24,17 +24,15 @@ jobs: with: java-version: 14 - name: Verify MySQL connection - env: - PORT: ${{ job.services.mysql.ports[3306] }} run: | - while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do + while ! mysqladmin ping -h"127.0.0.1" -P"3306" --silent; do sleep 1 done - - name: Set DB Port in config - env: - PORT: ${{ job.services.mysql.ports[3306] }} - run: sed -i "s/3306/$PORT/g" requirement_bazaar/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties && cat requirement_bazaar/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties + #- name: Set DB Port in config + # env: + # PORT: ${{ job.services.mysql.ports[3306] }} + # run: sed -i "s/3306/$PORT/g" requirement_bazaar/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties && cat requirement_bazaar/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties - name: Build with Gradle env: PORT: ${{ job.services.mysql.ports[3306] }} - run: ./gradlew clean build --info -Pdb.port=$PORT + run: ./gradlew clean build --info diff --git a/requirement_bazaar/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties b/requirement_bazaar/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties index 4420b357..4ce290bd 100644 --- a/requirement_bazaar/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties +++ b/requirement_bazaar/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties @@ -10,4 +10,4 @@ activityOrigin=https://requirements-bazaar.org smtpServer= emailFromAddress= emailSummaryTimePeriodInMinutes= -monitor= \ No newline at end of file +monitor='' From 84f7296aefa5b338daa416dc49576f8b18371b0a Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 13 Feb 2021 19:30:32 +0100 Subject: [PATCH 041/134] Simplify datetime serialization --- .../acis/bazaar/service/dal/entities/Activity.java | 6 ------ .../acis/bazaar/service/dal/entities/Attachment.java | 8 -------- .../acis/bazaar/service/dal/entities/Category.java | 8 -------- .../dbis/acis/bazaar/service/dal/entities/Comment.java | 8 -------- .../dbis/acis/bazaar/service/dal/entities/Project.java | 8 -------- .../acis/bazaar/service/dal/entities/Requirement.java | 10 ---------- .../dbis/acis/bazaar/service/dal/entities/User.java | 10 ---------- 7 files changed, 58 deletions(-) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java index e421e72b..85709114 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java @@ -3,10 +3,6 @@ import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; -import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import java.time.LocalDateTime; @@ -15,8 +11,6 @@ public class Activity extends EntityBase { private final transient int id; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") - @JsonSerialize(using = LocalDateTimeSerializer.class) - @JsonDeserialize(using = LocalDateTimeDeserializer.class) private final LocalDateTime creationDate; private final ActivityAction activityAction; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java index 8eb39236..e4a1b4bd 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java @@ -21,10 +21,6 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; -import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; @@ -59,13 +55,9 @@ public class Attachment extends EntityBase { private User creator; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") - @JsonSerialize(using = LocalDateTimeSerializer.class) - @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime creationDate; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") - @JsonSerialize(using = LocalDateTimeSerializer.class) - @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime lastUpdatedDate; public Attachment() { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java index e59894b5..fddf661f 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java @@ -23,10 +23,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; -import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; @@ -54,13 +50,9 @@ public class Category extends EntityBase { private User leader; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") - @JsonSerialize(using = LocalDateTimeSerializer.class) - @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime creationDate; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") - @JsonSerialize(using = LocalDateTimeSerializer.class) - @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime lastUpdatedDate; private Integer numberOfRequirements; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java index de9af63b..8982a3c2 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java @@ -23,10 +23,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; -import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; @@ -51,13 +47,9 @@ public class Comment extends EntityBase { private User creator; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") - @JsonSerialize(using = LocalDateTimeSerializer.class) - @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime creationDate; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") - @JsonSerialize(using = LocalDateTimeSerializer.class) - @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime lastUpdatedDate; @JsonProperty("_context") diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java index a1aebc26..994f4af9 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java @@ -22,10 +22,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; -import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; @@ -52,13 +48,9 @@ public class Project extends EntityBase { private User leader; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") - @JsonSerialize(using = LocalDateTimeSerializer.class) - @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime creationDate; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") - @JsonSerialize(using = LocalDateTimeSerializer.class) - @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime lastUpdatedDate; private Integer numberOfCategories; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java index 3a61a776..e879e9ba 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java @@ -3,10 +3,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; -import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import de.rwth.dbis.acis.bazaar.service.dal.helpers.UserVote; import javax.validation.constraints.Min; @@ -30,8 +26,6 @@ public class Requirement extends EntityBase { private String description; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") - @JsonSerialize(using = LocalDateTimeSerializer.class) - @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime realized; @Min(value = 0) @@ -49,13 +43,9 @@ public class Requirement extends EntityBase { private List attachments; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") - @JsonSerialize(using = LocalDateTimeSerializer.class) - @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime creationDate; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") - @JsonSerialize(using = LocalDateTimeSerializer.class) - @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime lastUpdatedDate; private Integer numberOfComments; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java index 3b155b53..51feac1d 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java @@ -23,10 +23,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; -import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; @@ -65,18 +61,12 @@ public class User extends EntityBase { private Boolean personalizationEnabled; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") - @JsonSerialize(using = LocalDateTimeSerializer.class) - @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime creationDate; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") - @JsonSerialize(using = LocalDateTimeSerializer.class) - @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime lastUpdatedDate; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") - @JsonSerialize(using = LocalDateTimeSerializer.class) - @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime lastLoginDate; public User() { From 1e73c189ae085293199ecd276c9ae9754cd22753 Mon Sep 17 00:00:00 2001 From: Thore Date: Wed, 17 Feb 2021 18:04:58 +0100 Subject: [PATCH 042/134] Implement validation grouping --- requirement_bazaar/build.gradle | 1 - .../acis/bazaar/service/AttachmentsResource.java | 2 +- .../dbis/acis/bazaar/service/BazaarService.java | 10 ++++++++-- .../dbis/acis/bazaar/service/CategoryResource.java | 2 +- .../dbis/acis/bazaar/service/CommentsResource.java | 2 +- .../bazaar/service/PersonalisationDataResource.java | 2 +- .../dbis/acis/bazaar/service/ProjectsResource.java | 2 +- .../acis/bazaar/service/RequirementsResource.java | 2 +- .../bazaar/service/dal/entities/Attachment.java | 9 +++++---- .../acis/bazaar/service/dal/entities/Category.java | 7 ++++--- .../acis/bazaar/service/dal/entities/Comment.java | 7 ++++--- .../acis/bazaar/service/dal/entities/Project.java | 5 +++-- .../bazaar/service/dal/entities/Requirement.java | 9 +++++---- .../service/dal/helpers/CreateValidation.java | 11 +++++++++++ .../bazaar/service/exception/ExceptionHandler.java | 13 ------------- .../service/notification/ActivityDispatcher.java | 4 +++- 16 files changed, 49 insertions(+), 39 deletions(-) create mode 100644 requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/CreateValidation.java diff --git a/requirement_bazaar/build.gradle b/requirement_bazaar/build.gradle index b5b976f5..bad61c72 100644 --- a/requirement_bazaar/build.gradle +++ b/requirement_bazaar/build.gradle @@ -62,7 +62,6 @@ dependencies { implementation "org.jooq:jooq-meta:${project.property('jooq.version')}" implementation 'org.apache.httpcomponents:httpclient:4.5.13' implementation 'commons-io:commons-io:2.8.0' - implementation 'org.jodd:jodd-vtor:5.3.0' implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.8.9' implementation 'com.vdurmont:emoji-java:5.1.1' } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/AttachmentsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/AttachmentsResource.java index 921d854d..aa0b434b 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/AttachmentsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/AttachmentsResource.java @@ -217,7 +217,7 @@ public Response createAttachment(@ApiParam(value = "Attachment entity as JSON", if (registrarErrors != null) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); } - Set> violations = bazaarService.validate(attachmentToCreate); + Set> violations = bazaarService.validateCreate(attachmentToCreate); if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); dalFacade = bazaarService.getDBConnection(); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java index 95caf44e..f32a2094 100755 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java @@ -27,6 +27,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.Activity; import de.rwth.dbis.acis.bazaar.service.dal.entities.Statistic; import de.rwth.dbis.acis.bazaar.service.dal.entities.User; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreateValidation; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; @@ -317,6 +318,12 @@ public Set> validate(Object entity) { return validator.validate(entity); } + public Set> validateCreate(Object entity) { + Validator validator = validatorFactory.getValidator(); + // Take Object for generic error handling + return validator.validate(entity, CreateValidation.class); + } + public NotificationDispatcher getNotificationDispatcher() { return notificationDispatcher; } @@ -351,8 +358,7 @@ private void registerUserAtFirstLogin() throws Exception { .emailLeadSubscription(true).emailFollowSubscription(true).personalizationEnabled(false).build(); user = dalFacade.createUser(user); int userId = user.getId(); - this.getNotificationDispatcher().dispatchNotification(user.getCreationDate(), Activity.ActivityAction.CREATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_55, - userId, Activity.DataType.USER, userId); + // this.getNotificationDispatcher().dispatchNotification(user.getCreationDate(), Activity.ActivityAction.CREATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_55, userId, Activity.DataType.USER, userId); dalFacade.addUserToRole(userId, "SystemAdmin", null); } else { // update lastLoginDate diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java index 5233aab6..84430ca7 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java @@ -245,7 +245,7 @@ public Response createCategory(@ApiParam(value = "Category entity", required = t ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); } // Take Object for generic error handling - Set> violations = bazaarService.validate(categoryToCreate); + Set> violations = bazaarService.validateCreate(categoryToCreate); if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); dalFacade = bazaarService.getDBConnection(); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CommentsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CommentsResource.java index 9041ecb5..8955eaf6 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CommentsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CommentsResource.java @@ -355,7 +355,7 @@ public Response createComment(@ApiParam(value = "Comment entity", required = tru } commentToCreate.setCreator(dalFacade.getUserById(internalUserId)); // Take Object for generic error handling - Set> violations = bazaarService.validate(commentToCreate); + Set> violations = bazaarService.validateCreate(commentToCreate); if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); dalFacade.followRequirement(internalUserId, requirement.getId()); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java index d6705529..c1359e76 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java @@ -150,7 +150,7 @@ public Response setPersonalisationData(@PathParam("key") String key, @PathParam( PersonalisationData fullData = PersonalisationData.getBuilder().key(key).userId(internalUserId).version(version).value(data.getValue()).build(); // Take Object for generic error handling - Set> violations = bazaarService.validate(fullData); + Set> violations = bazaarService.validateCreate(fullData); if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); dalFacade.setPersonalisationData(fullData); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java index 51d0c037..ea479d52 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java @@ -253,7 +253,7 @@ public Response createProject(@ApiParam(value = "Project entity", required = tru String userId = agent.getIdentifier(); // Validate input - Set> violations = bazaarService.validate(projectToCreate); + Set> violations = bazaarService.validateCreate(projectToCreate); if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); dalFacade = bazaarService.getDBConnection(); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java index 31b30ec7..5642e481 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java @@ -487,7 +487,7 @@ public Response createRequirement(@ApiParam(value = "Requirement entity", requir Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); requirementToCreate.setCreator(dalFacade.getUserById(internalUserId)); // Take Object for generic error handling - Set> violations = bazaarService.validate(requirementToCreate); + Set> violations = bazaarService.validateCreate(requirementToCreate); if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); // check if all categories are in the same project diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java index e4a1b4bd..4ab49828 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java @@ -21,6 +21,7 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; import com.fasterxml.jackson.annotation.JsonFormat; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreateValidation; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; @@ -31,21 +32,21 @@ public class Attachment extends EntityBase { private int id; - @NotNull + @NotNull(groups = CreateValidation.class) @Size(min = 1, max = 50) private String name; private String description; - @NotNull + @NotNull(groups = CreateValidation.class) @Size(min = 1, max = 10) private String mimeType; - @NotNull + @NotNull(groups = CreateValidation.class) @Size(min = 1, max = 10) private String identifier; - @NotNull + @NotNull(groups = CreateValidation.class) @Size(min = 1, max = 10) private String fileUrl; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java index fddf661f..416cbf0e 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreateValidation; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; @@ -36,15 +37,15 @@ public class Category extends EntityBase { private int id; - @NotNull(message = "name can't be null") + @NotNull(message = "name can't be null", groups = CreateValidation.class) @Size(min = 1, max = 50, message = "name must have between 1 and 50 characters") private String name; - @NotNull + @NotNull(groups = CreateValidation.class) @Size(min = 1) private String description; - @Min(value = 0) + @Min(value = 0, groups = CreateValidation.class) private int projectId; private User leader; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java index 8982a3c2..9d641c87 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreateValidation; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; @@ -35,13 +36,13 @@ public class Comment extends EntityBase { private int id; - @NotNull + @NotNull(groups = CreateValidation.class) private String message; - @Min(value = 0) + @Min(value = 0, groups = CreateValidation.class) private Integer replyToComment; - @Min(value = 0) + @Min(value = 0, groups = CreateValidation.class) private int requirementId; private User creator; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java index 994f4af9..731fe9a3 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreateValidation; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; @@ -34,11 +35,11 @@ public class Project extends EntityBase { private int id; - @NotNull(message = "name can not be null") + @NotNull(message = "name can not be null", groups = CreateValidation.class) @Size(min = 1, max = 50, message = "name can't have more than 50 characters") private String name; - @NotNull(message = "description can not be nul") + @NotNull(message = "description can not be nul", groups = CreateValidation.class) private String description; private Boolean visibility = true; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java index e879e9ba..384760cb 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreateValidation; import de.rwth.dbis.acis.bazaar.service.dal.helpers.UserVote; import javax.validation.constraints.Min; @@ -21,7 +22,7 @@ public class Requirement extends EntityBase { @Size(min = 1, max = 50, message = "name must be between 1 and 50 characters") private String name; - @NotNull + @NotNull(message = "description should not be null", groups = CreateValidation.class) @Size(min = 1, message = "Description can't be empty") private String description; @@ -34,8 +35,8 @@ public class Requirement extends EntityBase { private User creator; private User leadDeveloper; - @NotNull - @Size(min = 1) + @NotNull(message = "categories should not be null", groups = CreateValidation.class) + @Size(min = 1, groups = CreateValidation.class) private List categories; // This field is not filled because attachments should be not included in requirements response. @@ -45,7 +46,7 @@ public class Requirement extends EntityBase { @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") private LocalDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") private LocalDateTime lastUpdatedDate; private Integer numberOfComments; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/CreateValidation.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/CreateValidation.java new file mode 100644 index 00000000..f62624ab --- /dev/null +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/CreateValidation.java @@ -0,0 +1,11 @@ +package de.rwth.dbis.acis.bazaar.service.dal.helpers; + +import javax.validation.GroupSequence; +import javax.validation.groups.Default; + +/** + * Does nothing but acts as a group for hibernate validation + */ +@GroupSequence(Default.class) +public interface CreateValidation { +} diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java index c66deb58..354d1efb 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java @@ -24,10 +24,8 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import de.rwth.dbis.acis.bazaar.service.internalization.Localization; -import jodd.vtor.Violation; import javax.validation.ConstraintViolation; -import java.util.List; import java.util.Set; /** @@ -71,17 +69,6 @@ public String toJSON(BazaarException exception) { return null; } - public void handleViolations(List violations) throws BazaarException { - BazaarException bazaarException = new BazaarException(ExceptionLocation.BAZAARSERVICE); - bazaarException.setErrorCode(ErrorCode.VALIDATION); - StringBuilder builder = new StringBuilder(); - for (Violation violation : violations) { - builder.append(String.format(Localization.getInstance().getResourceBundle().getString("error.validation"), violation.getName(), violation.getInvalidValue(), violation.toString())); - } - bazaarException.setMessage(builder.toString()); - throw bazaarException; - } - public void handleViolations(Set> violations) throws BazaarException { BazaarException bazaarException = new BazaarException(ExceptionLocation.BAZAARSERVICE); bazaarException.setErrorCode(ErrorCode.VALIDATION); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java index 49f96a13..7517db61 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.ser.FilterProvider; import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter; import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import de.rwth.dbis.acis.bazaar.service.BazaarService; import de.rwth.dbis.acis.bazaar.service.dal.DALFacade; import de.rwth.dbis.acis.bazaar.service.dal.entities.*; @@ -120,7 +121,8 @@ public void sendActivityOverRMI(LocalDateTime creationDate, Activity.ActivityAct ObjectMapper mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - mapper.setFilters(filters); + mapper.registerModule(new JavaTimeModule()); + mapper.setFilterProvider(filters); Object result = Context.get().invoke(activityTrackerService, "createActivity", mapper.writeValueAsString(activity)); if (!(result).equals(Integer.toString(Response.Status.CREATED.getStatusCode()))) { From 743fb6073236fa36f7cd0966101bfa8ae73a70e5 Mon Sep 17 00:00:00 2001 From: Thore Date: Wed, 24 Feb 2021 15:50:42 +0100 Subject: [PATCH 043/134] Remove ant related config files --- bin/JOOQGeneration/reqbaz_generation_info.xml | 50 --- bin/JOOQGeneration/run.bat | 1 - bin/JOOQGeneration/run.sh | 1 - build.xml | 329 ------------------ etc/ant_configuration/service.properties | 6 - etc/ant_configuration/user.properties | 3 - etc/ivy/ivy.xml | 32 -- etc/ivy/ivysettings.xml | 12 - 8 files changed, 434 deletions(-) delete mode 100644 bin/JOOQGeneration/reqbaz_generation_info.xml delete mode 100644 bin/JOOQGeneration/run.bat delete mode 100755 bin/JOOQGeneration/run.sh delete mode 100755 build.xml delete mode 100755 etc/ant_configuration/service.properties delete mode 100755 etc/ant_configuration/user.properties delete mode 100755 etc/ivy/ivy.xml delete mode 100755 etc/ivy/ivysettings.xml diff --git a/bin/JOOQGeneration/reqbaz_generation_info.xml b/bin/JOOQGeneration/reqbaz_generation_info.xml deleted file mode 100644 index 7964a351..00000000 --- a/bin/JOOQGeneration/reqbaz_generation_info.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - com.mysql.jdbc.Driver - jdbc:mysql://localhost:3306/reqbaz - root - reqbaz - - - - - org.jooq.util.JavaGenerator - - - - org.jooq.util.mysql.MySQLDatabase - - - reqbaz - - - .* - - - - - - BOOLEAN - .*\.admin - - - - - - - de.rwth.dbis.acis.bazaar.service.dal.jooq - - - ../../src/main - - - diff --git a/bin/JOOQGeneration/run.bat b/bin/JOOQGeneration/run.bat deleted file mode 100644 index 0e6e5b8f..00000000 --- a/bin/JOOQGeneration/run.bat +++ /dev/null @@ -1 +0,0 @@ -java -classpath ../../lib/jooq-3.9.1.jar;../../lib/jooq-meta-3.9.1.jar;../../lib/jooq-codegen-3.9.1.jar;../../lib/mysql-connector-java-6.0.5.jar;. org.jooq.util.GenerationTool /reqbaz_generation_info.xml diff --git a/bin/JOOQGeneration/run.sh b/bin/JOOQGeneration/run.sh deleted file mode 100755 index 91a07687..00000000 --- a/bin/JOOQGeneration/run.sh +++ /dev/null @@ -1 +0,0 @@ -java -classpath ../../lib/jooq-3.9.1.jar:../../lib/jooq-meta-3.9.1.jar:../../lib/jooq-codegen-3.9.1.jar:../../lib/mysql-connector-java-6.0.5.jar:. org.jooq.util.GenerationTool /reqbaz_generation_info.xml diff --git a/build.xml b/build.xml deleted file mode 100755 index eeda92d3..00000000 --- a/build.xml +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #!/bin/bash - -# this script is autogenerated by 'ant startscripts' -# it starts a LAS2peer node providing the service '${service.name}.${service.class}' of this project -# pls execute it from the root folder of your deployment, e. g. ./bin/start_network.sh - -java -cp "lib/*" i5.las2peer.tools.L2pNodeLauncher -p 9011 uploadStartupDirectory --service-directory service startService\(\'${service.name}.${service.class}@${service.version}\',\'${service.passphrase}\'\) startWebConnector interactive - - :: this script is autogenerated by 'ant -startscripts' -:: it starts a LAS2peer node providing the service '${service.name}.${service.class}' of this project -:: pls execute it from the bin folder of your deployment by double-clicking on it - -%~d0 -cd %~p0 -cd .. -set BASE=%CD% -set CLASSPATH="%BASE%/lib/*;" - -java -cp %CLASSPATH% i5.las2peer.tools.L2pNodeLauncher -p 9011 uploadStartupDirectory --service-directory service startService('${service.name}.${service.class}@${service.version}','${service.passphrase}') startWebConnector interactive - -pause - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - agent-user-${las2peer_user.name}.xml;${las2peer_user.password} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/etc/ant_configuration/service.properties b/etc/ant_configuration/service.properties deleted file mode 100755 index a1cfad75..00000000 --- a/etc/ant_configuration/service.properties +++ /dev/null @@ -1,6 +0,0 @@ -service.version=0.9.0 -service.name=de.rwth.dbis.acis.bazaar.service -service.path=de/rwth/dbis/acis/bazaar/service -service.class=BazaarService -service.passphrase=Passphrase -service.dependencies=commons-codec;version="1.9",commons-dbcp2;version="2.8",commons-io;version="2.8",commons-logging;version="1.2",commons-pool2;version="2.9",emoji-java;version="3.1.3",gson;version="2.8",httpclient;version="4.5.1",httpcore;version="4.4.3",jodd-bean;version="3.6.1",jodd-core;version="3.6.1",jodd-vtor;version="3.6.1",jooq;version="3.9.1",jooq-codegen;version="3.9.1",jooq-meta;version="3.9.1",json;version="20140107",mysql-connector-java;version="8.0.22" diff --git a/etc/ant_configuration/user.properties b/etc/ant_configuration/user.properties deleted file mode 100755 index 1ba6e2ca..00000000 --- a/etc/ant_configuration/user.properties +++ /dev/null @@ -1,3 +0,0 @@ -las2peer_user.name=anonymous -las2peer_user.password=anonymous -las2peer_user.email=anonymous@mail.com \ No newline at end of file diff --git a/etc/ivy/ivy.xml b/etc/ivy/ivy.xml deleted file mode 100755 index 9144cced..00000000 --- a/etc/ivy/ivy.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/etc/ivy/ivysettings.xml b/etc/ivy/ivysettings.xml deleted file mode 100755 index f1b28a65..00000000 --- a/etc/ivy/ivysettings.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - \ No newline at end of file From bb4b62ec09dcf0faf78b832859c68f59103825e2 Mon Sep 17 00:00:00 2001 From: Thore Date: Wed, 24 Feb 2021 15:52:13 +0100 Subject: [PATCH 044/134] prepare releases and align with template project configuration --- .github/workflows/gradle.yml | 6 -- .github/workflows/release_rc.yaml | 63 ++++++++++++++++++++ gradle.properties | 5 +- requirement_bazaar/build.gradle | 96 ++++++++++++++++++++++++++++--- 4 files changed, 154 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/release_rc.yaml diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index fbf59891..9156ab47 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -28,11 +28,5 @@ jobs: while ! mysqladmin ping -h"127.0.0.1" -P"3306" --silent; do sleep 1 done - #- name: Set DB Port in config - # env: - # PORT: ${{ job.services.mysql.ports[3306] }} - # run: sed -i "s/3306/$PORT/g" requirement_bazaar/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties && cat requirement_bazaar/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties - name: Build with Gradle - env: - PORT: ${{ job.services.mysql.ports[3306] }} run: ./gradlew clean build --info diff --git a/.github/workflows/release_rc.yaml b/.github/workflows/release_rc.yaml new file mode 100644 index 00000000..f24cb273 --- /dev/null +++ b/.github/workflows/release_rc.yaml @@ -0,0 +1,63 @@ +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - 'v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+' + +name: Create Pre-Release + +jobs: + build: + name: Create Pre-Release + runs-on: ubuntu-latest + services: + mysql: + image: mysql:latest + ports: + - 3306:3306 + env: + MYSQL_USER: reqbaz + MYSQL_PASSWORD: password + MYSQL_DATABASE: reqbaz + MYSQL_ROOT_PASSWORD: rootpw + options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 + + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Get Version + id: get_version + uses: battila7/get-version-action@v2 + - name: Set up JDK 14 + uses: actions/setup-java@v1 + with: + java-version: 14 + - name: Verify MySQL connection + run: | + while ! mysqladmin ping -h"127.0.0.1" -P"3306" --silent; do + sleep 1 + done + - name: Build release bundle with Gradle + run: ./gradlew packageDistribution -x test + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: | + This is a pre-release. For changes please check the [Changelog](https://github.com/rwth-acis/RequirementsBazaar/blob/develop/CHANGELOG.md). + draft: false + prerelease: true + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./requirement_bazaar/build/dist/BazaarService.zip + asset_name: RequirementsBazaar-${{ steps.get_version.outputs.version }}.zip + asset_content_type: application/zip diff --git a/gradle.properties b/gradle.properties index 0b397fa2..00d413a3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,9 +1,12 @@ org.gradle.parallel=true +java.version=14 core.version=1.1.0 -service.name=RequirementsBazaar service.version=0.9.0 +service.name=de.rwth.dbis.acis.bazaar.service +service.class=BazaarService + jooq.version=3.14.4 mysql.version=8.0.22 diff --git a/requirement_bazaar/build.gradle b/requirement_bazaar/build.gradle index bad61c72..51b06b9a 100644 --- a/requirement_bazaar/build.gradle +++ b/requirement_bazaar/build.gradle @@ -22,11 +22,18 @@ plugins { id "nu.studer.jooq" version "5.2" } -group = 'de.rwth.dbis.acis.bazaar.service' -version = "${project.property('service.version')}" -archivesBaseName = group -mainClassName = "de.rwth.dbis.acis.bazaar.service.BazaarService" -sourceCompatibility = 14 +application { + // Define the main class for the application. + mainClass = "${project.property('service.name')}.${project.property('service.class')}" + + group = "${project.property('service.name')}" + archivesBaseName = group + + version = "${project.property('service.version')}" + mainClassName = "i5.las2peer.tools.L2pNodeLauncher" + sourceCompatibility = "${project.property('java.version')}" + targetCompatibility = "${project.property('java.version')}" +} repositories { // Use JCenter for resolving dependencies. @@ -73,14 +80,13 @@ configurations { jar { manifest { - attributes "Main-Class": "de.rwth.dbis.acis.bazaar.service.BazaarService" - attributes "Library-Version": "${project.property('core.version')}" + attributes "Main-Class": "${project.property('service.name')}.${project.property('service.class')}" + attributes "Library-Version": "${project.property('service.version')}" attributes "Library-SymbolicName": "${project.property('service.name')}" - // attribute "Import-Library": "${service.dependencies}" } from { (configurations.runtimeClasspath).collect { it.isDirectory() ? it : zipTree(it) } } { - // Exclude signatures to be able to natively bundle mqtt + // Exclude signatures to be able to natively bundle signed jars exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA' } } @@ -98,8 +104,31 @@ task copyToLib(type: Copy) { into "../lib" } +task startscripts { + new File("$rootDir/bin", "start_network.sh").text = """#!/bin/bash +# this script is autogenerated by 'gradle startscripts' +# it starts a las2peer node providing the service '${project.property('service.name')}.${project.property('service.class')}' of this project +# pls execute it from the root folder of your deployment, e. g. ./bin/start_network.sh +java -cp "lib/*" i5.las2peer.tools.L2pNodeLauncher --port 9011 --service-directory service uploadStartupDirectory startService\\(\\'${project.property('service.name')}.${project.property('service.class')}@${project.property('service.version')}\\'\\) startWebConnector interactive +""" + new File("$rootDir/bin", "start_network.bat").text = """:: this script is autogenerated by 'gradle startscripts' +:: it starts a las2peer node providing the service '${project.property('service.name')}.${project.property('service.class')}' of this project +:: pls execute it from the bin folder of your deployment by double-clicking on it +%~d0 +cd %~p0 +cd .. +set BASE=%CD% +set CLASSPATH="%BASE%/lib/*;" +java -cp %CLASSPATH% i5.las2peer.tools.L2pNodeLauncher --port 9011 --service-directory service uploadStartupDirectory startService('${project.property('service.name')}.${project.property('service.class')}@${project.property('service.version')}') startWebConnector interactive +pause +""" +} + +build.dependsOn javadoc build.dependsOn copyJar build.dependsOn copyToLib +build.dependsOn startscripts + // Flyway and jooq configuration for database management jooq { @@ -155,3 +184,52 @@ flyway { generateJooq.dependsOn flywayClean generateJooq.dependsOn flywayMigrate + +// Build export directory which can be shipped on request +task export (type: Copy, dependsOn: build) { + into "$buildDir/export" + + into("service") { + from jar + } + into("lib") { + from configurations.compileOnly + } + into("bin") { + from "../bin" + } + into("etc") { + from "../etc" + } + into("javadoc") { + from "$buildDir/docs/javadoc" + } + into("sql") { + from processResources + include "migrations/*.sql" + rename 'migrations/(.+)', '$1' + } +} + +task packageDistribution(type: Zip, dependsOn: export) { + archiveFileName = "${project.property('service.class')}.zip" + destinationDirectory = file("$buildDir/dist") + + from "$buildDir/export" +} + +// Cleanup +clean.doLast { + file("$rootDir/lib").deleteDir() + file("$rootDir/service").deleteDir() +} + +task cleanAll { + dependsOn "clean" + + doLast { + file("$rootDir/log").deleteDir() + file("$projectDir/log").deleteDir() + file("$rootDir/node-storage").deleteDir() + } +} From ad0b04ee0896b1c8598b5ebb12575dbeaaa9e88d Mon Sep 17 00:00:00 2001 From: Thore Date: Fri, 26 Feb 2021 16:30:44 +0100 Subject: [PATCH 045/134] Fix incorrect swagger annotation for requirements by category endpoint --- CHANGELOG.md | 22 ++++++++++++++++--- .../acis/bazaar/service/CategoryResource.java | 2 +- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89ca9c49..ee7377de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,32 @@ # Changelog + All notable changes to this project will be documented in this file. -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres +to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -Releases prior to v0.7.2 are only documented on the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releases) +Releases prior to v0.7.2 are only documented on +the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releases) ## [Unreleased] +### Added + +- Added new testcases [#73](https://github.com/rwth-acis/RequirementsBazaar/pull/73) + ### Changed - Updated all dependencies, most notably las2peer 1.0.0 [#68](https://github.com/rwth-acis/RequirementsBazaar/pull/68) +- Updated las2peer to 1.1.0 and thereby requiring Java + 14) [#73](https://github.com/rwth-acis/RequirementsBazaar/pull/73) +- Changed buildsystem to use gradle [#73](https://github.com/rwth-acis/RequirementsBazaar/pull/73) +- Automatically generate jooq code from migration files at build + time [#73](https://github.com/rwth-acis/RequirementsBazaar/pull/73) +- Replaced vtor with Java Bean Validation [#73](https://github.com/rwth-acis/RequirementsBazaar/pull/73) +- Fixed a bug in the swagger documentation where `GET /categories/{categoryId/requirements` was incorrectly annotated to + return a list of categories instead of a list of + requirements [#78](https://github.com/rwth-acis/RequirementsBazaar/pull/78) +- Revised and automated release process [#78](https://github.com/rwth-acis/RequirementsBazaar/pull/78) ## [0.7.2] - 2017-10-25 diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java index 84430ca7..48803dd5 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java @@ -718,7 +718,7 @@ public Response getFollowersForCategory(@PathParam("categoryId") int categoryId, @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "This method returns the list of requirements for a specific category.") @ApiResponses(value = { - @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns a list of requirements for a given project", response = Category.class, responseContainer = "List"), + @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns a list of requirements for a given project", response = Requirement.class, responseContainer = "List"), @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") From 44085708973fc65b9bfc454c99fded7edc0b3934 Mon Sep 17 00:00:00 2001 From: Thore Date: Fri, 26 Feb 2021 16:36:46 +0100 Subject: [PATCH 046/134] Update release flow to adhere to tagged version --- .github/workflows/release_rc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_rc.yaml b/.github/workflows/release_rc.yaml index f24cb273..3bd449da 100644 --- a/.github/workflows/release_rc.yaml +++ b/.github/workflows/release_rc.yaml @@ -38,7 +38,7 @@ jobs: sleep 1 done - name: Build release bundle with Gradle - run: ./gradlew packageDistribution -x test + run: ./gradlew packageDistribution -x test -Pservice.version=${{ steps.get_version.outputs.version-without-v }} - name: Create Release id: create_release uses: actions/create-release@v1 From dc9c2464f9d2b0bbef8ac801179676c333894ca5 Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 27 Feb 2021 12:51:48 +0100 Subject: [PATCH 047/134] Ensure javatimemodule is added to each objectmapper --- .../java/de/rwth/dbis/acis/bazaar/service/BazaarService.java | 3 ++- .../dbis/acis/bazaar/service/dal/entities/EntityContext.java | 3 ++- .../dbis/acis/bazaar/service/dal/entities/EntityOverview.java | 3 ++- .../rwth/dbis/acis/bazaar/service/dal/entities/Statistic.java | 3 ++- .../dbis/acis/bazaar/service/dal/helpers/PaginationResult.java | 3 ++- .../dbis/acis/bazaar/service/exception/ExceptionHandler.java | 3 ++- .../bazaar/service/notification/NotificationDispatcherImp.java | 2 ++ 7 files changed, 14 insertions(+), 6 deletions(-) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java index f32a2094..c0979266 100755 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import de.rwth.dbis.acis.bazaar.service.dal.DALFacade; import de.rwth.dbis.acis.bazaar.service.dal.DALFacadeImpl; import de.rwth.dbis.acis.bazaar.service.dal.entities.Activity; @@ -101,7 +102,7 @@ public class BazaarService extends RESTService { private DataSource dataSource; private final L2pLogger logger = L2pLogger.getInstance(BazaarService.class.getName()); - private static ObjectMapper mapper = new ObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL); + private static ObjectMapper mapper = new ObjectMapper().registerModule(new JavaTimeModule()).setSerializationInclusion(JsonInclude.Include.NON_NULL); @Override protected void initResources() { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java index 8591f1ba..94a2dbd6 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; /** * @since 30/01/2020 @@ -67,7 +68,7 @@ public static Builder getBuilder() { } public String toJSON() throws JsonProcessingException { - return new ObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL).writeValueAsString(this); + return new ObjectMapper().registerModule(new JavaTimeModule()).setSerializationInclusion(JsonInclude.Include.NON_NULL).writeValueAsString(this); } public static class Builder { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java index c862857e..e2d7da1e 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import java.util.List; @@ -73,7 +74,7 @@ public static Builder getBuilder() { } public String toJSON() throws JsonProcessingException { - return new ObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL).writeValueAsString(this); + return new ObjectMapper().registerModule(new JavaTimeModule()).setSerializationInclusion(JsonInclude.Include.NON_NULL).writeValueAsString(this); } public static class Builder { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Statistic.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Statistic.java index 44c6409b..ee1abc74 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Statistic.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Statistic.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; /** * Created by hugif on 26.12.2016. @@ -75,7 +76,7 @@ public void setNumberOfVotes(int numberOfVotes) { } public String toJSON() throws JsonProcessingException { - return new ObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL).writeValueAsString(this); + return new ObjectMapper().registerModule(new JavaTimeModule()).setSerializationInclusion(JsonInclude.Include.NON_NULL).writeValueAsString(this); } public static Builder getBuilder() { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PaginationResult.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PaginationResult.java index 7d0d26ac..d96e1faf 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PaginationResult.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PaginationResult.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import java.util.List; @@ -52,6 +53,6 @@ public int getNextPage() { } public String toJSON() throws JsonProcessingException { - return new ObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL).writeValueAsString(this.getElements()); + return new ObjectMapper().registerModule(new JavaTimeModule()).setSerializationInclusion(JsonInclude.Include.NON_NULL).writeValueAsString(this.getElements()); } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java index 354d1efb..bcbd0aa6 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import de.rwth.dbis.acis.bazaar.service.internalization.Localization; import javax.validation.ConstraintViolation; @@ -39,7 +40,7 @@ public static ExceptionHandler getInstance() { return INSTANCE; } - ObjectMapper mapper = new ObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL); + ObjectMapper mapper = new ObjectMapper().registerModule(new JavaTimeModule()).setSerializationInclusion(JsonInclude.Include.NON_NULL); public BazaarException convert(Exception ex, ExceptionLocation location, ErrorCode errorCode, String message) { BazaarException bazaarException = new BazaarException(location); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java index 85cf794d..a8eadda3 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.ser.FilterProvider; import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter; import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import de.rwth.dbis.acis.bazaar.service.BazaarService; import de.rwth.dbis.acis.bazaar.service.dal.DALFacade; import de.rwth.dbis.acis.bazaar.service.dal.entities.*; @@ -49,6 +50,7 @@ public void dispatchNotification(final LocalDateTime creationDate, final Activit "ActivityFilter", SimpleBeanPropertyFilter.filterOutAllExcept("id", "name")); mapper = new ObjectMapper(); + mapper.registerModule(new JavaTimeModule()); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); mapper.setFilters(filters); From f20dc5d9f6c2c1926707b4d69521441e2c04c5cd Mon Sep 17 00:00:00 2001 From: Thore Date: Mon, 1 Mar 2021 17:54:47 +0100 Subject: [PATCH 048/134] Fix attachment validation --- .../dbis/acis/bazaar/service/dal/entities/Attachment.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java index 4ab49828..645f3c6a 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java @@ -39,15 +39,15 @@ public class Attachment extends EntityBase { private String description; @NotNull(groups = CreateValidation.class) - @Size(min = 1, max = 10) + @Size(min = 1, max = 1000) private String mimeType; @NotNull(groups = CreateValidation.class) - @Size(min = 1, max = 10) + @Size(min = 1, max = 1000) private String identifier; @NotNull(groups = CreateValidation.class) - @Size(min = 1, max = 10) + @Size(min = 1, max = 1000) private String fileUrl; @Min(value = 0) From 330a2e2d37f39f106988057660c78f3552b1da2b Mon Sep 17 00:00:00 2001 From: Thore Date: Wed, 3 Mar 2021 13:05:16 +0100 Subject: [PATCH 049/134] Remove unsused sort parameter from category resource --- .../java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java index 48803dd5..2403e754 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java @@ -728,7 +728,7 @@ public Response getRequirementsForCategory(@PathParam("categoryId") int category @ApiParam(value = "Elements of requirements by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage, @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, @ApiParam(value = "State filter", required = false, allowableValues = "all,open,realized") @DefaultValue("all") @QueryParam("state") String stateFilter, - @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "date,last_activity,name,vote,comment,follower,realized") @DefaultValue("date") @QueryParam("sort") List sort) throws Exception { + @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "date,last_activity,name,vote,comment,follower") @DefaultValue("date") @QueryParam("sort") List sort) throws Exception { RequirementsResource requirementsResource = new RequirementsResource(); return requirementsResource.getRequirementsForCategory(categoryId, page, perPage, search, stateFilter, sort); } From 16201d20b91059f6b36a5405c97ca2deaca461c1 Mon Sep 17 00:00:00 2001 From: Thore Date: Wed, 3 Mar 2021 13:05:42 +0100 Subject: [PATCH 050/134] Now rc in service version for now Semver isn't fully supported yet --- .github/workflows/release_rc.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release_rc.yaml b/.github/workflows/release_rc.yaml index 3bd449da..41355b4f 100644 --- a/.github/workflows/release_rc.yaml +++ b/.github/workflows/release_rc.yaml @@ -2,7 +2,7 @@ on: push: # Sequence of patterns matched against refs/tags tags: - - 'v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+' + - 'v[0-9]+.[0-9]+.[0-9]+-rc\.[0-9]+' name: Create Pre-Release @@ -38,7 +38,7 @@ jobs: sleep 1 done - name: Build release bundle with Gradle - run: ./gradlew packageDistribution -x test -Pservice.version=${{ steps.get_version.outputs.version-without-v }} + run: ./gradlew packageDistribution -x test #-Pservice.version=${{ steps.get_version.outputs.version-without-v }} - name: Create Release id: create_release uses: actions/create-release@v1 From 700d794a6e0d983ed1b0d01230775a35c0e53c11 Mon Sep 17 00:00:00 2001 From: Thore Date: Thu, 4 Mar 2021 15:43:27 +0100 Subject: [PATCH 051/134] Split sortDirection out of sort api parameters --- CHANGELOG.md | 2 + .../bazaar/service/AttachmentsResource.java | 2 +- .../acis/bazaar/service/CategoryResource.java | 32 +++++------ .../acis/bazaar/service/CommentsResource.java | 14 ++--- .../service/PersonalisationDataResource.java | 2 +- .../acis/bazaar/service/ProjectsResource.java | 26 ++++----- .../bazaar/service/RequirementsResource.java | 53 +++++-------------- .../acis/bazaar/service/UsersResource.java | 16 ++---- .../bazaar/service/dal/helpers/Pageable.java | 13 ++++- 9 files changed, 60 insertions(+), 100 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee7377de..2c88ec83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas return a list of categories instead of a list of requirements [#78](https://github.com/rwth-acis/RequirementsBazaar/pull/78) - Revised and automated release process [#78](https://github.com/rwth-acis/RequirementsBazaar/pull/78) +- Split leading `+`/`-`from sort parameter in favour of a `sortDirection` (ASC/DESC) + parameter. [#82](https://github.com/rwth-acis/RequirementsBazaar/pull/82) ## [0.7.2] - 2017-10-25 diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/AttachmentsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/AttachmentsResource.java index aa0b434b..78ecf064 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/AttachmentsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/AttachmentsResource.java @@ -29,7 +29,7 @@ @SwaggerDefinition( info = @Info( title = "Requirements Bazaar", - version = "0.6", + version = "0.9.0", description = "Requirements Bazaar project", termsOfService = "http://requirements-bazaar.org", contact = @Contact( diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java index 2403e754..88f4ab05 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java @@ -32,7 +32,7 @@ @SwaggerDefinition( info = @Info( title = "Requirements Bazaar", - version = "0.6", + version = "0.9.0", description = "Requirements Bazaar project", termsOfService = "http://requirements-bazaar.org", contact = @Contact( @@ -61,14 +61,15 @@ public CategoryResource() throws Exception { /** * This method returns the list of categories under a given project. * - * @param projectId id of the project - * @param page page number - * @param perPage number of projects by page - * @param search search string - * @param sort sort order + * @param projectId id of the project + * @param page page number + * @param perPage number of projects by page + * @param search search string + * @param sort item to sort by + * @param sortDirection sort order * @return Response with categories as a JSON array. */ - public Response getCategoriesForProject(int projectId, int page, int perPage, String search, List sort) { + public Response getCategoriesForProject(int projectId, int page, int perPage, String search, List sort, String sortDirection) { DALFacade dalFacade = null; try { Agent agent = Context.getCurrent().getMainAgent(); @@ -79,16 +80,7 @@ public Response getCategoriesForProject(int projectId, int page, int perPage, St } List sortList = new ArrayList<>(); for (String sortOption : sort) { - Pageable.SortDirection direction = Pageable.SortDirection.DEFAULT; - if (sortOption.startsWith("+") || sortOption.startsWith(" ")) { // " " is needed because jersey does not pass "+" - direction = Pageable.SortDirection.ASC; - sortOption = sortOption.substring(1); - - } else if (sortOption.startsWith("-")) { - direction = Pageable.SortDirection.DESC; - sortOption = sortOption.substring(1); - } - Pageable.SortField sortField = new Pageable.SortField(sortOption, direction); + Pageable.SortField sortField = new Pageable.SortField(sortOption, sortDirection); sortList.add(sortField); } PageInfo pageInfo = new PageInfo(page, perPage, new HashMap<>(), sortList, search); @@ -728,8 +720,10 @@ public Response getRequirementsForCategory(@PathParam("categoryId") int category @ApiParam(value = "Elements of requirements by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage, @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, @ApiParam(value = "State filter", required = false, allowableValues = "all,open,realized") @DefaultValue("all") @QueryParam("state") String stateFilter, - @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "date,last_activity,name,vote,comment,follower") @DefaultValue("date") @QueryParam("sort") List sort) throws Exception { + @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "date,last_activity,name,vote,comment,follower") @DefaultValue("date") @QueryParam("sort") List sort, + @ApiParam(value = "SortDirection", allowableValues = "ASC,DESC") @DefaultValue("DESC") @QueryParam("sortDirection") String sortDirection + ) throws Exception { RequirementsResource requirementsResource = new RequirementsResource(); - return requirementsResource.getRequirementsForCategory(categoryId, page, perPage, search, stateFilter, sort); + return requirementsResource.getRequirementsForCategory(categoryId, page, perPage, search, stateFilter, sort, sortDirection); } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CommentsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CommentsResource.java index 8955eaf6..32b680e4 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CommentsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CommentsResource.java @@ -31,7 +31,7 @@ @SwaggerDefinition( info = @Info( title = "Requirements Bazaar", - version = "0.6", + version = "0.9.0", description = "Requirements Bazaar project", termsOfService = "http://requirements-bazaar.org", contact = @Contact( @@ -84,6 +84,7 @@ public Response getAllComments( @ApiParam(value = "Elements of comments by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage, @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date") @DefaultValue("name") @QueryParam("sort") List sort, + @ApiParam(value = "SortDirection", allowableValues = "ASC,DESC") @QueryParam("sortDirection") String sortDirection, @ApiParam(value = "Filter", required = true, allowMultiple = false, allowableValues = "created, following, replies") @QueryParam("filters") List filters, @ApiParam(value = "Embed parents", required = true, allowMultiple = true, allowableValues = "project, requirement") @QueryParam("embedParents") List embedParents) { @@ -98,16 +99,7 @@ public Response getAllComments( String userId = agent.getIdentifier(); List sortList = new ArrayList<>(); for (String sortOption : sort) { - Pageable.SortDirection direction = Pageable.SortDirection.DEFAULT; - if (sortOption.startsWith("+") || sortOption.startsWith(" ")) { // " " is needed because jersey does not pass "+" - direction = Pageable.SortDirection.ASC; - sortOption = sortOption.substring(1); - - } else if (sortOption.startsWith("-")) { - direction = Pageable.SortDirection.DESC; - sortOption = sortOption.substring(1); - } - Pageable.SortField sortField = new Pageable.SortField(sortOption, direction); + Pageable.SortField sortField = new Pageable.SortField(sortOption, sortDirection); sortList.add(sortField); } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java index c1359e76..ff2a0da4 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java @@ -28,7 +28,7 @@ @SwaggerDefinition( info = @Info( title = "Requirements Bazaar", - version = "0.6", + version = "0.9.0", description = "Requirements Bazaar project", termsOfService = "http://requirements-bazaar.org", contact = @Contact( diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java index ea479d52..dd64fe23 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java @@ -31,7 +31,7 @@ @SwaggerDefinition( info = @Info( title = "Requirements Bazaar", - version = "0.6", + version = "0.9.0", description = "Requirements Bazaar project", termsOfService = "http://requirements-bazaar.org", contact = @Contact( @@ -80,6 +80,7 @@ public Response getProjects( @ApiParam(value = "Elements of project by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage, @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date,last_activity,requirement,follower") @DefaultValue("name") @QueryParam("sort") List sort, + @ApiParam(value = "SortDirection", allowableValues = "ASC,DESC") @QueryParam("sortDirection") String sortDirection, @ApiParam(value = "Filter", required = false, allowMultiple = true, allowableValues = "all, created, following") @QueryParam("filters") List filters, @ApiParam(value = "Ids", required = false, allowMultiple = true) @QueryParam("ids") List ids) { @@ -93,16 +94,7 @@ public Response getProjects( String userId = agent.getIdentifier(); List sortList = new ArrayList<>(); for (String sortOption : sort) { - Pageable.SortDirection direction = Pageable.SortDirection.DEFAULT; - if (sortOption.startsWith("+") || sortOption.startsWith(" ")) { // " " is needed because jersey does not pass "+" - direction = Pageable.SortDirection.ASC; - sortOption = sortOption.substring(1); - - } else if (sortOption.startsWith("-")) { - direction = Pageable.SortDirection.DESC; - sortOption = sortOption.substring(1); - } - Pageable.SortField sortField = new Pageable.SortField(sortOption, direction); + Pageable.SortField sortField = new Pageable.SortField(sortOption, sortDirection); sortList.add(sortField); } @@ -669,9 +661,11 @@ public Response getCategoriesForProject( @ApiParam(value = "Page number", required = false) @DefaultValue("0") @QueryParam("page") int page, @ApiParam(value = "Elements of categories by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage, @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, - @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date,last_activity,requirement,follower") @DefaultValue("name") @QueryParam("sort") List sort) throws Exception { + @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date,last_activity,requirement,follower") @DefaultValue("name") @QueryParam("sort") List sort, + @ApiParam(value = "SortDirection", allowableValues = "ASC,DESC") @QueryParam("sortDirection") String sortDirection + ) throws Exception { CategoryResource categoryResource = new CategoryResource(); - return categoryResource.getCategoriesForProject(projectId, page, perPage, search, sort); + return categoryResource.getCategoriesForProject(projectId, page, perPage, search, sort, sortDirection); } /** @@ -700,8 +694,10 @@ public Response getRequirementsForProject(@PathParam("projectId") int projectId, @ApiParam(value = "Elements of requirements by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage, @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, @ApiParam(value = "State filter", required = false, allowableValues = "all,open,realized") @DefaultValue("all") @QueryParam("state") String stateFilter, - @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "date,last_activity,name,vote,comment,follower,realized") @DefaultValue("date") @QueryParam("sort") List sort) throws Exception { + @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "date,last_activity,name,vote,comment,follower,realized") @DefaultValue("date") @QueryParam("sort") List sort, + @ApiParam(value = "SortDirection", allowableValues = "ASC,DESC") @QueryParam("sortDirection") String sortDirection + ) throws Exception { RequirementsResource requirementsResource = new RequirementsResource(); - return requirementsResource.getRequirementsForProject(projectId, page, perPage, search, stateFilter, sort); + return requirementsResource.getRequirementsForProject(projectId, page, perPage, search, stateFilter, sort, sortDirection); } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java index 5642e481..b8d95524 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java @@ -31,7 +31,7 @@ @SwaggerDefinition( info = @Info( title = "Requirements Bazaar", - version = "0.6", + version = "0.9.0", description = "Requirements Bazaar project", termsOfService = "http://requirements-bazaar.org", contact = @Contact( @@ -80,6 +80,7 @@ public Response getRequirements( @ApiParam(value = "Elements of requirements by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage, @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date,last_activity,requirement,follower") @DefaultValue("name") @QueryParam("sort") List sort, + @ApiParam(value = "SortDirection", allowableValues = "ASC,DESC") @QueryParam("sortDirection") String sortDirection, @ApiParam(value = "Filter", required = true, allowMultiple = true, allowableValues = "created, following") @QueryParam("filters") List filters, @ApiParam(value = "Embed parents", required = true, allowMultiple = true, allowableValues = "project") @QueryParam("embedParents") List embedParents) { @@ -93,16 +94,7 @@ public Response getRequirements( String userId = agent.getIdentifier(); List sortList = new ArrayList<>(); for (String sortOption : sort) { - Pageable.SortDirection direction = Pageable.SortDirection.DEFAULT; - if (sortOption.startsWith("+") || sortOption.startsWith(" ")) { // " " is needed because jersey does not pass "+" - direction = Pageable.SortDirection.ASC; - sortOption = sortOption.substring(1); - - } else if (sortOption.startsWith("-")) { - direction = Pageable.SortDirection.DESC; - sortOption = sortOption.substring(1); - } - Pageable.SortField sortField = new Pageable.SortField(sortOption, direction); + Pageable.SortField sortField = new Pageable.SortField(sortOption, sortDirection); sortList.add(sortField); } @@ -186,7 +178,7 @@ public Response getRequirements( * @param sort sort order * @return Response with requirements as a JSON array. */ - public Response getRequirementsForProject(int projectId, int page, int perPage, String search, String stateFilter, List sort) { + public Response getRequirementsForProject(int projectId, int page, int perPage, String search, String stateFilter, List sort, String sortDirection) { DALFacade dalFacade = null; try { Agent agent = Context.getCurrent().getMainAgent(); @@ -201,16 +193,7 @@ public Response getRequirementsForProject(int projectId, int page, int perPage, } List sortList = new ArrayList<>(); for (String sortOption : sort) { - Pageable.SortDirection direction = Pageable.SortDirection.DEFAULT; - if (sortOption.startsWith("+") || sortOption.startsWith(" ")) { // " " is needed because jersey does not pass "+" - direction = Pageable.SortDirection.ASC; - sortOption = sortOption.substring(1); - - } else if (sortOption.startsWith("-")) { - direction = Pageable.SortDirection.DESC; - sortOption = sortOption.substring(1); - } - Pageable.SortField sortField = new Pageable.SortField(sortOption, direction); + Pageable.SortField sortField = new Pageable.SortField(sortOption, sortDirection); sortList.add(sortField); } PageInfo pageInfo = new PageInfo(page, perPage, filters, sortList, search); @@ -284,15 +267,16 @@ public Response getRequirementsForProject(int projectId, int page, int perPage, /** * This method returns the list of requirements for a specific category. * - * @param categoryId id of the category under a given project - * @param page page number - * @param perPage number of projects by page - * @param search search string - * @param stateFilter requirement state - * @param sort sort order + * @param categoryId id of the category under a given project + * @param page page number + * @param perPage number of projects by page + * @param search search string + * @param stateFilter requirement state + * @param sort parameter to sort by + * @param sortDirection orientation to sort by * @return Response with requirements as a JSON array. */ - public Response getRequirementsForCategory(int categoryId, int page, int perPage, String search, String stateFilter, List sort) { + public Response getRequirementsForCategory(int categoryId, int page, int perPage, String search, String stateFilter, List sort, String sortDirection) { DALFacade dalFacade = null; try { Agent agent = Context.getCurrent().getMainAgent(); @@ -307,16 +291,7 @@ public Response getRequirementsForCategory(int categoryId, int page, int perPage } List sortList = new ArrayList<>(); for (String sortOption : sort) { - Pageable.SortDirection direction = Pageable.SortDirection.DEFAULT; - if (sortOption.startsWith("+") || sortOption.startsWith(" ")) { // " " is needed because jersey does not pass "+" - direction = Pageable.SortDirection.ASC; - sortOption = sortOption.substring(1); - - } else if (sortOption.startsWith("-")) { - direction = Pageable.SortDirection.DESC; - sortOption = sortOption.substring(1); - } - Pageable.SortField sortField = new Pageable.SortField(sortOption, direction); + Pageable.SortField sortField = new Pageable.SortField(sortOption, sortDirection); sortList.add(sortField); } PageInfo pageInfo = new PageInfo(page, perPage, filters, sortList, search); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/UsersResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/UsersResource.java index 177eb597..b75340f7 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/UsersResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/UsersResource.java @@ -29,7 +29,7 @@ @SwaggerDefinition( info = @Info( title = "Requirements Bazaar", - version = "0.6", + version = "0.9.0", description = "Requirements Bazaar project", termsOfService = "http://requirements-bazaar.org", contact = @Contact( @@ -238,8 +238,9 @@ public Response updateUser(@PathParam("userId") int userId, }) public Response getEntityOverview( @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, - @ApiParam(value = "Types of entities to include", required = true, allowMultiple = true, allowableValues = "projects,categories,requirements") @QueryParam("include") List include, + @ApiParam(value = "Types of entities to include", required = true, allowMultiple = true, allowableValues = "projects,categories,requirements") @QueryParam("include") List include, @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date,last_activity,requirement,follower") @DefaultValue("date") @QueryParam("sort") List sort, + @ApiParam(value = "SortDirection", allowableValues = "ASC,DESC") @QueryParam("sortDirection") String sortDirection, @ApiParam(value = "Filter", required = false, allowMultiple = true, allowableValues = "created, following, developing") @DefaultValue("created") @QueryParam("filters") List filters){ //Possibly allow filtertype "all"? DALFacade dalFacade = null; @@ -252,16 +253,7 @@ public Response getEntityOverview( String userId = agent.getIdentifier(); List sortList = new ArrayList<>(); for (String sortOption : sort) { - Pageable.SortDirection direction = Pageable.SortDirection.DEFAULT; - if (sortOption.startsWith("+") || sortOption.startsWith(" ")) { // " " is needed because jersey does not pass "+" - direction = Pageable.SortDirection.ASC; - sortOption = sortOption.substring(1); - - } else if (sortOption.startsWith("-")) { - direction = Pageable.SortDirection.DESC; - sortOption = sortOption.substring(1); - } - Pageable.SortField sortField = new Pageable.SortField(sortOption, direction); + Pageable.SortField sortField = new Pageable.SortField(sortOption, sortDirection); sortList.add(sortField); } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java index 0f59cd32..858cc5d9 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java @@ -22,6 +22,7 @@ import java.util.List; import java.util.Map; +import java.util.Objects; /** * @since 6/12/2014 @@ -47,9 +48,17 @@ class SortField { String field; SortDirection sortDirection; - public SortField(String field, SortDirection sortDirection) { + public SortField(String field, String sortDirection) { this.field = field; - this.sortDirection = sortDirection; + + // Use Object.equals here for no extra null check (else should cover this) + if (Objects.equals(sortDirection, "ASC")) { + this.sortDirection = SortDirection.ASC; + } else if (Objects.equals(sortDirection, "DESC")) { + this.sortDirection = SortDirection.DESC; + } else { + this.sortDirection = SortDirection.DEFAULT; + } } public String getField() { From 44600cfc378b92e23abb18d1d58430f91e70f93c Mon Sep 17 00:00:00 2001 From: Thore Date: Thu, 4 Mar 2021 16:58:33 +0100 Subject: [PATCH 052/134] Handle natural sort for names --- CHANGELOG.md | 1 + .../bazaar/service/dal/transform/CategoryTransformer.java | 5 ++--- .../bazaar/service/dal/transform/ProjectTransformer.java | 5 ++--- .../bazaar/service/dal/transform/RequirementTransformer.java | 5 ++--- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c88ec83..dde3adf8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas - Revised and automated release process [#78](https://github.com/rwth-acis/RequirementsBazaar/pull/78) - Split leading `+`/`-`from sort parameter in favour of a `sortDirection` (ASC/DESC) parameter. [#82](https://github.com/rwth-acis/RequirementsBazaar/pull/82) +- Order by name now implies natural sorting [#82](https://github.com/rwth-acis/RequirementsBazaar/pull/82) ## [0.7.2] - 2017-10-25 diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java index 6ff11135..4f331565 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java @@ -106,13 +106,12 @@ public Collection> getSortFields(List switch (sort.getField()) { case "name": switch (sort.getSortDirection()) { - case ASC: - sortFields.add(CATEGORY.NAME.asc()); - break; case DESC: + sortFields.add(CATEGORY.NAME.length().desc()); sortFields.add(CATEGORY.NAME.desc()); break; default: + sortFields.add(CATEGORY.NAME.length().asc()); sortFields.add(CATEGORY.NAME.asc()); break; } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java index c08b9522..c2273615 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java @@ -111,13 +111,12 @@ public Collection> getSortFields(List switch (sort.getField()) { case "name": switch (sort.getSortDirection()) { - case ASC: - sortFields.add(PROJECT.NAME.asc()); - break; case DESC: + sortFields.add(PROJECT.NAME.length().desc()); sortFields.add(PROJECT.NAME.desc()); break; default: + sortFields.add(PROJECT.NAME.length().asc()); sortFields.add(PROJECT.NAME.asc()); break; } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java index 9a9886e9..12e8a58e 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java @@ -130,13 +130,12 @@ public Collection> getSortFields(List break; case "name": switch (sort.getSortDirection()) { - case ASC: - sortFields.add(REQUIREMENT.NAME.asc()); - break; case DESC: + sortFields.add(REQUIREMENT.NAME.length().desc()); sortFields.add(REQUIREMENT.NAME.desc()); break; default: + sortFields.add(REQUIREMENT.NAME.length().asc()); sortFields.add(REQUIREMENT.NAME.asc()); break; } From b82d2e0f21559600d5dd592ddc5048d424b2f7d1 Mon Sep 17 00:00:00 2001 From: Thore Date: Fri, 5 Mar 2021 14:48:31 +0100 Subject: [PATCH 053/134] Clarify changelog --- CHANGELOG.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dde3adf8..066fa03d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,17 +18,18 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas - Updated all dependencies, most notably las2peer 1.0.0 [#68](https://github.com/rwth-acis/RequirementsBazaar/pull/68) - Updated las2peer to 1.1.0 and thereby requiring Java - 14) [#73](https://github.com/rwth-acis/RequirementsBazaar/pull/73) + 14) [#73](https://github.com/rwth-acis/RequirementsBazaar/pull/73) - Changed buildsystem to use gradle [#73](https://github.com/rwth-acis/RequirementsBazaar/pull/73) - Automatically generate jooq code from migration files at build time [#73](https://github.com/rwth-acis/RequirementsBazaar/pull/73) -- Replaced vtor with Java Bean Validation [#73](https://github.com/rwth-acis/RequirementsBazaar/pull/73) +- Replaced vtor with Java Bean Validation (this implies changes to the API documentation as these annotations included) + [#73](https://github.com/rwth-acis/RequirementsBazaar/pull/73) - Fixed a bug in the swagger documentation where `GET /categories/{categoryId/requirements` was incorrectly annotated to return a list of categories instead of a list of requirements [#78](https://github.com/rwth-acis/RequirementsBazaar/pull/78) - Revised and automated release process [#78](https://github.com/rwth-acis/RequirementsBazaar/pull/78) -- Split leading `+`/`-`from sort parameter in favour of a `sortDirection` (ASC/DESC) - parameter. [#82](https://github.com/rwth-acis/RequirementsBazaar/pull/82) +- Split leading `+`/`-`from sort parameter in favour of a `sortDirection` (ASC/DESC) parameter. + [#82](https://github.com/rwth-acis/RequirementsBazaar/pull/82) - Order by name now implies natural sorting [#82](https://github.com/rwth-acis/RequirementsBazaar/pull/82) ## [0.7.2] - 2017-10-25 From e4a3abc622f693448a182d0ec5da5d95016e1b91 Mon Sep 17 00:00:00 2001 From: Thore Date: Fri, 5 Mar 2021 19:22:18 +0100 Subject: [PATCH 054/134] Remove realized search filter from projects --- .../java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java index dd64fe23..65aea550 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java @@ -694,7 +694,7 @@ public Response getRequirementsForProject(@PathParam("projectId") int projectId, @ApiParam(value = "Elements of requirements by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage, @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, @ApiParam(value = "State filter", required = false, allowableValues = "all,open,realized") @DefaultValue("all") @QueryParam("state") String stateFilter, - @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "date,last_activity,name,vote,comment,follower,realized") @DefaultValue("date") @QueryParam("sort") List sort, + @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "date,last_activity,name,vote,comment,follower") @DefaultValue("date") @QueryParam("sort") List sort, @ApiParam(value = "SortDirection", allowableValues = "ASC,DESC") @QueryParam("sortDirection") String sortDirection ) throws Exception { RequirementsResource requirementsResource = new RequirementsResource(); From 0c684b4f1b47171f314920a450f8a832219d9fe0 Mon Sep 17 00:00:00 2001 From: Thore Date: Fri, 5 Mar 2021 19:02:53 +0100 Subject: [PATCH 055/134] Cleanup dataclasses with autogeneration through lombok --- CHANGELOG.md | 2 + requirement_bazaar/build.gradle | 1 + requirement_bazaar/lombok.config | 2 + .../acis/bazaar/service/BazaarService.java | 13 +- .../service/PersonalisationDataResource.java | 2 +- .../bazaar/service/dal/DALFacadeImpl.java | 32 ++- .../bazaar/service/dal/entities/Activity.java | 164 +---------- .../service/dal/entities/Attachment.java | 151 +--------- .../bazaar/service/dal/entities/Category.java | 165 +---------- .../dal/entities/CategoryContributors.java | 91 +----- .../dal/entities/CategoryFollower.java | 62 +--- .../bazaar/service/dal/entities/Comment.java | 149 +--------- .../bazaar/service/dal/entities/Email.java | 118 +------- .../service/dal/entities/EntityContext.java | 74 +---- .../service/dal/entities/EntityOverview.java | 77 +---- .../dal/entities/PersonalisationData.java | 96 +------ .../service/dal/entities/Privilege.java | 52 +--- .../bazaar/service/dal/entities/Project.java | 191 +----------- .../dal/entities/ProjectContributors.java | 102 +------ .../service/dal/entities/ProjectFollower.java | 63 +--- .../service/dal/entities/Requirement.java | 271 +----------------- .../dal/entities/RequirementCategory.java | 60 +--- .../dal/entities/RequirementContributors.java | 90 +----- .../dal/entities/RequirementDeveloper.java | 62 +--- .../dal/entities/RequirementFollower.java | 62 +--- .../bazaar/service/dal/entities/Role.java | 61 +--- .../service/dal/entities/Statistic.java | 113 +------- .../bazaar/service/dal/entities/User.java | 170 +---------- .../bazaar/service/dal/entities/Vote.java | 74 +---- .../dal/helpers/EntityContextFactory.java | 2 +- .../repositories/CategoryRepositoryImpl.java | 13 +- .../repositories/ProjectRepositoryImpl.java | 13 +- .../RequirementRepositoryImpl.java | 14 +- .../dal/repositories/RoleRepositoryImpl.java | 5 +- .../dal/repositories/UserRepositoryImpl.java | 6 +- .../dal/transform/AttachmentTransformer.java | 2 +- .../CategoryFollowerTransformer.java | 2 +- .../dal/transform/CategoryTransformer.java | 3 +- .../dal/transform/CommentTransformer.java | 3 +- .../PersonalisationDataTransformer.java | 2 +- .../dal/transform/PrivilegeTransformer.java | 3 +- .../transform/ProjectFollowerTransformer.java | 2 +- .../dal/transform/ProjectTransformer.java | 3 +- .../RequirementCategoryTransformer.java | 3 +- .../RequirementDeveloperTransformer.java | 2 +- .../RequirementFollowerTransformer.java | 4 +- .../dal/transform/RequirementTransformer.java | 2 +- .../dal/transform/RoleTransformer.java | 3 +- .../dal/transform/UserTransformer.java | 6 +- .../dal/transform/VoteTransformer.java | 4 +- .../notification/ActivityDispatcher.java | 4 +- .../service/notification/EmailDispatcher.java | 38 +-- .../bazaar/service/dal/DALFacadeTest.java | 7 +- 53 files changed, 327 insertions(+), 2389 deletions(-) create mode 100644 requirement_bazaar/lombok.config diff --git a/CHANGELOG.md b/CHANGELOG.md index 066fa03d..dbdcf9aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,8 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas - Split leading `+`/`-`from sort parameter in favour of a `sortDirection` (ASC/DESC) parameter. [#82](https://github.com/rwth-acis/RequirementsBazaar/pull/82) - Order by name now implies natural sorting [#82](https://github.com/rwth-acis/RequirementsBazaar/pull/82) +- Remove static code from data classes and generate getter/setters and builder with lombok. This renames the `category` + attribute in `EntityContext` to `categories` [#83](https://github.com/rwth-acis/RequirementsBazaar/pull/82) ## [0.7.2] - 2017-10-25 diff --git a/requirement_bazaar/build.gradle b/requirement_bazaar/build.gradle index 51b06b9a..b022b96f 100644 --- a/requirement_bazaar/build.gradle +++ b/requirement_bazaar/build.gradle @@ -20,6 +20,7 @@ plugins { id 'idea' id "org.flywaydb.flyway" version "7.3.2" id "nu.studer.jooq" version "5.2" + id "io.freefair.lombok" version "5.3.0" } application { diff --git a/requirement_bazaar/lombok.config b/requirement_bazaar/lombok.config new file mode 100644 index 00000000..6aa51d71 --- /dev/null +++ b/requirement_bazaar/lombok.config @@ -0,0 +1,2 @@ +# This file is generated by the 'io.freefair.lombok' Gradle plugin +config.stopBubbling = true diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java index c0979266..9941879e 100755 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java @@ -354,9 +354,16 @@ private void registerUserAtFirstLogin() throws Exception { Integer userIdByLAS2PeerId = dalFacade.getUserIdByLAS2PeerId(agent.getIdentifier()); if (userIdByLAS2PeerId == null) { // create user - User.Builder userBuilder = User.getBuilder(email); - User user = userBuilder.admin(false).las2peerId(agent.getIdentifier()).userName(loginName).profileImage(profileImage) - .emailLeadSubscription(true).emailFollowSubscription(true).personalizationEnabled(false).build(); + User user = User.builder() + .eMail(email) + .admin(false) + .las2peerId(agent.getIdentifier()) + .userName(loginName) + .profileImage(profileImage) + .emailLeadSubscription(true) + .emailFollowSubscription(true) + .personalizationEnabled(false) + .build(); user = dalFacade.createUser(user); int userId = user.getId(); // this.getNotificationDispatcher().dispatchNotification(user.getCreationDate(), Activity.ActivityAction.CREATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_55, userId, Activity.DataType.USER, userId); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java index ff2a0da4..9f5c28f0 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java @@ -147,7 +147,7 @@ public Response setPersonalisationData(@PathParam("key") String key, @PathParam( ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.comment.create")); } - PersonalisationData fullData = PersonalisationData.getBuilder().key(key).userId(internalUserId).version(version).value(data.getValue()).build(); + PersonalisationData fullData = PersonalisationData.builder().key(key).userId(internalUserId).version(version).value(data.getValue()).build(); // Take Object for generic error handling Set> violations = bazaarService.validateCreate(fullData); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index 7c350ef6..c23b6fe6 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -206,7 +206,8 @@ public Project createProject(Project project, int userId) throws Exception { String categoryName = Localization.getInstance().getResourceBundle().getString("category.uncategorized.Name"); String categoryDescription = Localization.getInstance().getResourceBundle().getString("category.uncategorized.Description"); - Category uncategorizedCategory = Category.getBuilder(categoryName) + Category uncategorizedCategory = Category.builder() + .name(categoryName) .description(categoryDescription) .projectId(newProject.getId()) .build(); @@ -514,7 +515,7 @@ public Comment deleteCommentById(int commentId) throws Exception { @Override public CreationStatus followProject(int userId, int projectId) throws BazaarException { projectFollowerRepository = (projectFollowerRepository != null) ? projectFollowerRepository : new ProjectFollowerRepositoryImpl(dslContext); - return projectFollowerRepository.addOrUpdate(ProjectFollower.getBuilder() + return projectFollowerRepository.addOrUpdate(ProjectFollower.builder() .projectId(projectId) .userId(userId) .build() @@ -530,7 +531,7 @@ public void unFollowProject(int userId, int projectId) throws BazaarException { @Override public CreationStatus followCategory(int userId, int categoryId) throws BazaarException { categoryFollowerRepository = (categoryFollowerRepository != null) ? categoryFollowerRepository : new CategoryFollowerRepositoryImpl(dslContext); - return categoryFollowerRepository.addOrUpdate(CategoryFollower.getBuilder() + return categoryFollowerRepository.addOrUpdate(CategoryFollower.builder() .categoryId(categoryId) .userId(userId) .build() @@ -546,7 +547,7 @@ public void unFollowCategory(int userId, int categoryId) throws BazaarException @Override public CreationStatus followRequirement(int userId, int requirementId) throws BazaarException { requirementFollowerRepository = (requirementFollowerRepository != null) ? requirementFollowerRepository : new RequirementFollowerRepositoryImpl(dslContext); - return requirementFollowerRepository.addOrUpdate(RequirementFollower.getBuilder() + return requirementFollowerRepository.addOrUpdate(RequirementFollower.builder() .requirementId(requirementId) .userId(userId) .build() @@ -562,7 +563,7 @@ public void unFollowRequirement(int userId, int requirementId) throws BazaarExce @Override public CreationStatus wantToDevelop(int userId, int requirementId) throws BazaarException { developerRepository = (developerRepository != null) ? developerRepository : new RequirementDeveloperRepositoryImpl(dslContext); - return developerRepository.addOrUpdate(RequirementDeveloper.getBuilder() + return developerRepository.addOrUpdate(RequirementDeveloper.builder() .requirementId(requirementId) .userId(userId) .build() @@ -579,7 +580,8 @@ public void notWantToDevelop(int userId, int requirementId) throws BazaarExcepti @Override public void addCategoryTag(int requirementId, int categoryId) throws BazaarException { tagRepository = (tagRepository != null) ? tagRepository : new RequirementCategoryRepositoryImpl(dslContext); - tagRepository.add(RequirementCategory.getBuilder(categoryId) + tagRepository.add(RequirementCategory.builder() + .categoryId(categoryId) .requirementId(requirementId) .build() ); @@ -594,7 +596,7 @@ public void deleteCategoryTag(int requirementId, int categoryId) throws BazaarEx @Override public CreationStatus vote(int userId, int requirementId, boolean isUpVote) throws BazaarException { voteRepository = (voteRepository != null) ? voteRepository : new VoteRepositoryImpl(dslContext); - return voteRepository.addOrUpdate(Vote.getBuilder() + return voteRepository.addOrUpdate(Vote.builder() .requirementId(requirementId) .userId(userId) .isUpvote(isUpVote) @@ -632,7 +634,7 @@ public void createPrivilegeIfNotExists(PrivilegeEnum privilege) throws BazaarExc Privilege privilegeDb = privilegeRepository.findByName(new PrivilegeEnumConverter().to(privilege)); if (privilegeDb == null) { - privilegeRepository.add(Privilege.getBuilder(privilege).build()); + privilegeRepository.add(Privilege.builder().name(privilege).build()); } } @@ -657,21 +659,21 @@ public void setPersonalisationData(PersonalisationData personalisationData) thro @Override public EntityOverview getEntitiesForUser(List includes, Pageable pageable, int userId) throws BazaarException { //categoryRepository = (categoryRepository != null) ? categoryRepository : new CategoryRepositoryImpl(dslContext); - EntityOverview.Builder result = EntityOverview.getBuilder(); + EntityOverview.Builder result = EntityOverview.builder(); for(String include : includes) { switch (include) { - case "projects": + case "projects" -> { projectRepository = (projectRepository != null) ? projectRepository : new ProjectRepositoryImpl(dslContext); result.projects(projectRepository.listAllProjectIds(pageable, userId)); - break; - case "requirements": + } + case "requirements" -> { requirementRepository = (requirementRepository != null) ? requirementRepository : new RequirementRepositoryImpl(dslContext); result.requirements(requirementRepository.listAllRequirementIds(pageable, userId)); - break; - case "categories": + } + case "categories" -> { categoryRepository = (categoryRepository != null) ? categoryRepository : new CategoryRepositoryImpl(dslContext); result.categories(categoryRepository.listAllCategoryIds(pageable, userId)); - break; + } } //TODO Add Comments/Attachments } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java index 85709114..e2ca859e 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java @@ -3,9 +3,18 @@ import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NonNull; +import lombok.extern.jackson.Jacksonized; import java.time.LocalDateTime; +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") public class Activity extends EntityBase { private final transient int id; @@ -24,70 +33,12 @@ public class Activity extends EntityBase { private AdditionalObject additionalObject; - private Activity(Builder builder) { - this.id = builder.id; - this.creationDate = builder.creationDate; - this.activityAction = builder.activityAction; - this.dataUrl = builder.dataUrl; - this.dataType = builder.dataType; - this.dataFrontendUrl = builder.dataFrontendUrl; - this.parentDataUrl = builder.parentDataUrl; - this.parentDataType = builder.parentDataType; - this.userUrl = builder.userUrl; - this.origin = builder.origin; - this.additionalObject = builder.additionalObject; - } - - public static Builder getBuilder() { - return new Builder(); - } - @Override @JsonIgnore public int getId() { return id; } - public LocalDateTime getCreationDate() { - return creationDate; - } - - public ActivityAction getActivityAction() { - return activityAction; - } - - public String getDataUrl() { - return dataUrl; - } - - public DataType getDataType() { - return dataType; - } - - public String getDataFrontendUrl() { - return dataFrontendUrl; - } - - public String getParentDataUrl() { - return parentDataUrl; - } - - public DataType getParentDataType() { - return parentDataType; - } - - public String getUserUrl() { - return userUrl; - } - - public String getOrigin() { - return origin; - } - - public AdditionalObject getAdditionalObject() { - return additionalObject; - } - public enum DataType { STATISTIC, PROJECT, @@ -116,109 +67,22 @@ public enum ActivityAction { UNLEADDEVELOP } - public static class Builder { - - protected int id; - protected LocalDateTime creationDate; - protected ActivityAction activityAction; - protected String dataUrl; - protected DataType dataType; - protected String dataFrontendUrl; - protected String parentDataUrl; - protected DataType parentDataType; - protected String userUrl; - protected String origin; - protected AdditionalObject additionalObject; - - public Builder creationDate(LocalDateTime creationDate) { - this.creationDate = creationDate; - return this; - } - - public Builder activityAction(ActivityAction activityAction) { - this.activityAction = activityAction; - return this; - } - - public Builder dataUrl(String dataUrl) { - this.dataUrl = dataUrl; - return this; - } - - public Builder dataType(DataType dataType) { - this.dataType = dataType; - return this; - } - - public Builder dataFrontendUrl(String dataFrontendUrl) { - this.dataFrontendUrl = dataFrontendUrl; - return this; - } - - public Builder parentDataUrl(String parentDataUrl) { - this.parentDataUrl = parentDataUrl; - return this; - } - - public Builder parentDataType(DataType parentDataType) { - this.parentDataType = parentDataType; - return this; - } - - public Builder userUrl(String userUrl) { - this.userUrl = userUrl; - return this; - } - - public Builder origin(String origin) { - this.origin = origin; - return this; - } - - public Builder addititionalObject(AdditionalObject additionalObject) { - this.additionalObject = additionalObject; - return this; - } - - public Activity build() { - return new Activity(this); - } - } - + @Data public static class AdditionalObject { @JsonFilter("ActivityFilter") + @NonNull private Project project; @JsonFilter("ActivityFilter") + @NonNull private Category category; @JsonFilter("ActivityFilter") + @NonNull private Requirement requirement; @JsonFilter("ActivityFilter") + @NonNull private User user; - - public Project getProject() { - return project; - } - - public Category getCategory() { - return category; - } - - public Requirement getRequirement() { - return requirement; - } - - public User getUser() { - return user; - } - - public AdditionalObject(Project project, Category category, Requirement requirement, User user) { - this.project = project; - this.category = category; - this.requirement = requirement; - this.user = user; - } } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java index 645f3c6a..a46a0c68 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java @@ -22,12 +22,20 @@ import com.fasterxml.jackson.annotation.JsonFormat; import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreateValidation; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.time.LocalDateTime; +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") public class Attachment extends EntityBase { private int id; @@ -60,147 +68,4 @@ public class Attachment extends EntityBase { @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") private LocalDateTime lastUpdatedDate; - - public Attachment() { - } - - public Attachment(Builder builder) { - this.id = builder.id; - this.name = builder.name; - this.description = builder.description; - this.mimeType = builder.mimeType; - this.identifier = builder.identifier; - this.fileUrl = builder.fileUrl; - this.creationDate = builder.creationDate; - this.creator = builder.creator; - this.requirementId = builder.requirementId; - this.lastUpdatedDate = builder.lastUpdatedDate; - } - - public int getId() { - return id; - } - - public int getRequirementId() { - return requirementId; - } - - public void setRequirementId(int requirementId) { - this.requirementId = requirementId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getMimeType() { - return mimeType; - } - - public String getIdentifier() { - return identifier; - } - - public String getFileUrl() { - return fileUrl; - } - - public LocalDateTime getCreationDate() { - return creationDate; - } - - public LocalDateTime getLastUpdatedDate() { - return lastUpdatedDate; - } - - public User getCreator() { - return creator; - } - - public void setCreator(User creator) { - this.creator = creator; - } - - public static Builder getBuilder() { - return new Builder(); - } - - public static class Builder { - private int id; - private int requirementId; - private String name; - private String description; - private String mimeType; - private String identifier; - private String fileUrl; - private LocalDateTime creationDate; - private LocalDateTime lastUpdatedDate; - User creator; - - public Builder id(int id) { - this.id = id; - return this; - } - - public Builder requirementId(int requirementId) { - this.requirementId = requirementId; - return this; - } - - public Builder name(String name) { - this.name = name; - return this; - } - - public Builder description(String description) { - this.description = description; - return this; - } - - public Builder mimeType(String mimeType) { - this.mimeType = mimeType; - return this; - } - - public Builder identifier(String identifier) { - this.identifier = identifier; - return this; - } - - public Builder fileUrl(String fileUrl) { - this.fileUrl = fileUrl; - return this; - } - - public Builder creationDate(LocalDateTime creationDate) { - this.creationDate = creationDate; - return this; - } - - public Builder lastUpdatedDate(LocalDateTime lastUpdatedDate) { - this.lastUpdatedDate = lastUpdatedDate; - return this; - } - - public Builder creator(User creator) { - this.creator = creator; - return this; - } - - public Attachment build() { - return new Attachment(this); - } - } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java index 416cbf0e..8b80b8e3 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java @@ -24,6 +24,10 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreateValidation; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; @@ -33,6 +37,10 @@ /** * @since 6/9/2014 */ +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") public class Category extends EntityBase { private int id; @@ -60,165 +68,8 @@ public class Category extends EntityBase { private Integer numberOfFollowers; private Boolean isFollower; - public Category() { - } - - /** - * Private constructor, should be called from its builder only. - * - * @param builder - */ - private Category(Builder builder) { - this.id = builder.id; - this.name = builder.name; - this.description = builder.description; - this.projectId = builder.projectId; - this.leader = builder.leader; - this.creationDate = builder.creationDate; - this.lastUpdatedDate = builder.lastUpdatedDate; - this.isFollower = builder.isFollower; - } - - /** - * Builder to easily build Category objects - * - * @param name Name field will be initialized using the passed value - * @return a builder with name returned - */ - public static Builder getBuilder(String name) { - return new Builder(name); - } - - public int getId() { - return id; - } - - public int getProjectId() { - return projectId; - } - - public LocalDateTime getCreationDate() { - return creationDate; - } - - public LocalDateTime getLastUpdatedDate() { - return lastUpdatedDate; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public User getLeader() { - return leader; - } - - public void setLeader(User leader) { - this.leader = leader; - } - - public void setFollower(Boolean follower) { - isFollower = follower; - } - - public Integer getNumberOfRequirements() { - return numberOfRequirements; - } - - public void setNumberOfRequirements(Integer numberOfRequirements) { - this.numberOfRequirements = numberOfRequirements; - } - - public Integer getNumberOfFollowers() { - return numberOfFollowers; - } - - public void setNumberOfFollowers(Integer numberOfFollowers) { - this.numberOfFollowers = numberOfFollowers; - } - @JsonProperty("isFollower") public Boolean isFollower() { return isFollower; } - - public static class Builder { - - User leader; - private int id; - private String description; - private String name; - private LocalDateTime creationDate; - private LocalDateTime lastUpdatedDate; - private int projectId; - private Boolean isFollower; - - public Builder(String name) { - this.name = name; - } - - public Builder description(String description) { - this.description = description; - return this; - } - - public Builder id(int id) { - this.id = id; - return this; - } - - public Builder leader(User leader) { - this.leader = leader; - return this; - } - - public Builder isFollower(Boolean isFollower) { - this.isFollower = isFollower; - return this; - } - - public Builder projectId(int projectId) { - this.projectId = projectId; - return this; - } - - public Builder creationDate(LocalDateTime creationDate) { - this.creationDate = creationDate; - return this; - } - - public Builder lastUpdatedDate(LocalDateTime lastUpdatedDate) { - this.lastUpdatedDate = lastUpdatedDate; - return this; - } - - /** - * Call this to create a Category object with the values previously set in the builder. - * - * @return initialized Category object - */ - public Category build() { - Category created = new Category(this); - - String name = created.getName(); - - if (name == null || name.length() == 0) { - throw new IllegalStateException("name cannot be null or empty"); - } - - return created; - } - } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryContributors.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryContributors.java index 55646449..91a34dfd 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryContributors.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryContributors.java @@ -1,12 +1,20 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; import java.util.List; /** * Created by Martin on 15.06.2017. */ +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") public class CategoryContributors extends EntityBase { private final int id; @@ -18,92 +26,9 @@ public class CategoryContributors extends EntityBase { private List commentCreator; private List attachmentCreator; - protected CategoryContributors(Builder builder) { - this.id = builder.id; - this.leader = builder.leader; - this.requirementCreator = builder.requirementCreator; - this.leadDeveloper = builder.leadDeveloper; - this.developers = builder.developers; - this.commentCreator = builder.commentCreator; - this.attachmentCreator = builder.attachmentCreator; - } - - public static Builder getBuilder() { - return new Builder(); - } - @Override @JsonIgnore public int getId() { return id; } - - public User getLeader() { - return leader; - } - - public List getRequirementCreator() { - return requirementCreator; - } - - public List getLeadDeveloper() { - return leadDeveloper; - } - - public List getDevelopers() { - return developers; - } - - public List getCommentCreator() { - return commentCreator; - } - - public List getAttachmentCreator() { - return attachmentCreator; - } - - public static class Builder { - - private int id; - private User leader; - private List requirementCreator; - private List leadDeveloper; - private List developers; - private List commentCreator; - private List attachmentCreator; - - public Builder leader(User leader) { - this.leader = leader; - return this; - } - - public Builder requirementCreator(List requirementCreator) { - this.requirementCreator = requirementCreator; - return this; - } - - public Builder leadDeveloper(List leadDeveloper) { - this.leadDeveloper = leadDeveloper; - return this; - } - - public Builder developers(List developers) { - this.developers = developers; - return this; - } - - public Builder commentCreator(List commentCreator) { - this.commentCreator = commentCreator; - return this; - } - - public Builder attachmentCreator(List attachmentCreator) { - this.attachmentCreator = attachmentCreator; - return this; - } - - public CategoryContributors build() { - return new CategoryContributors(this); - } - } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryFollower.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryFollower.java index f388a881..eac84c31 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryFollower.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryFollower.java @@ -1,54 +1,16 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; + +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") public class CategoryFollower extends EntityBase { - private final int Id; - private final int CategoryId; - private final int UserId; - - private CategoryFollower(Builder builder) { - Id = builder.id; - CategoryId = builder.categoryId; - UserId = builder.userId; - } - - public int getId() { - return Id; - } - - public int getCategoryId() { - return CategoryId; - } - - public int getUserId() { - return UserId; - } - - public static Builder getBuilder() { - return new Builder(); - } - - public static class Builder { - int userId; - int categoryId; - int id; - - public Builder userId(int userId) { - this.userId = userId; - return this; - } - - public Builder categoryId(int categoryId) { - this.categoryId = categoryId; - return this; - } - - public Builder id(int id) { - this.id = id; - return this; - } - - public CategoryFollower build() { - return new CategoryFollower(this); - } - } + private final int id; + private final int categoryId; + private final int userId; } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java index 9d641c87..30629239 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java @@ -24,6 +24,10 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreateValidation; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; @@ -32,6 +36,10 @@ /** * @since 6/11/2014 */ +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") public class Comment extends EntityBase { private int id; @@ -55,145 +63,4 @@ public class Comment extends EntityBase { @JsonProperty("_context") private EntityContext context; - - - public Comment() { - } - - public Comment(Builder builder) { - this.id = builder.id; - this.message = builder.message; - this.replyToComment = builder.replyToComment; - this.requirementId = builder.requirementId; - this.creator = builder.creator; - this.creationDate = builder.creationDate; - this.lastUpdatedDate = builder.lastUpdatedDate; - this.context = builder.context; - } - - public int getId() { - return id; - } - - public int getRequirementId() { - return requirementId; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public Integer getReplyToComment() { - return replyToComment; - } - - public LocalDateTime getCreationDate() { - return creationDate; - } - - public LocalDateTime getLastUpdatedDate() { - return lastUpdatedDate; - } - - public User getCreator() { - return creator; - } - - public EntityContext getContext() { - return context; - } - - public void setCreator(User creator) { - this.creator = creator; - } - - public void setContext(EntityContext context) { - this.context = context; - } - - public static Builder getBuilder(String message) { - return new Builder(message); - } - - public static class Builder { - private int id; - private String message; - private int requirementId; - private Integer replyToComment; - LocalDateTime creationDate; - LocalDateTime lastUpdatedDate; - User creator; - EntityContext context; - /* private Project project; - private Category category; - private Requirement requirement; */ - - - public Builder(String message) { - message(message); - } - - public Builder id(int id) { - this.id = id; - return this; - } - - public Builder message(String message) { - this.message = message; - return this; - } - - public Builder replyToComment(Integer replyToComment) { - this.replyToComment = replyToComment; - return this; - } - - public Builder creationDate(LocalDateTime creationDate) { - this.creationDate = creationDate; - return this; - } - - public Builder lastUpdatedDate(LocalDateTime lastUpdatedDate) { - this.lastUpdatedDate = lastUpdatedDate; - return this; - } - - public Builder requirementId(int requirementId) { - this.requirementId = requirementId; - return this; - } -/* - public Builder requirement(Requirement requirement) { - this.requirement = requirement; - return this; - } - - public Builder project(Project project) { - this.project = project; - return this; - } - - public Builder category(Category category) { - this.requirementId = requirementId; - return this; - } */ - - - public Builder creator(User creator) { - this.creator = creator; - return this; - } - public Builder context(EntityContext context) { - this.context = context; - return this; - } - - public Comment build() { - return new Comment(this); - } - } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java index 71f2c033..aed55f8b 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java @@ -1,9 +1,18 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; + import java.time.LocalDateTime; import java.util.Set; +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder", toBuilder = true) public class Email extends EntityBase { private final transient int id; @@ -16,49 +25,6 @@ public class Email extends EntityBase { private final String footer; private final LocalDateTime creationDate; - protected Email(Builder builder) { - id = builder.id; - recipients = builder.recipients; - subject = builder.subject; - starting = builder.starting; - message = builder.message; - closing = builder.closing; - footer = builder.footer; - creationDate = builder.creationDate; - } - - public int getId() { - return id; - } - - public Set getRecipients() { - return recipients; - } - - public String getSubject() { - return subject; - } - - public String getStarting() { - return starting; - } - - public String getMessage() { - return message; - } - - public String getClosing() { - return closing; - } - - public String getFooter() { - return footer; - } - - public LocalDateTime getCreationDate() { - return creationDate; - } - public void removeRecipient(User user) { recipients.remove(user); } @@ -66,70 +32,4 @@ public void removeRecipient(User user) { public static Activity.Builder getBuilder() { return new Activity.Builder(); } - - public static class Builder { - - private int id; - private Set recipients; - private String subject; - private String starting; - private String message; - private String closing; - private String footer; - private LocalDateTime creationDate; - - public Builder() { - - } - - public Builder(Email email) { - this.recipients = email.recipients; - this.subject = email.subject; - this.starting = email.starting; - this.message = email.message; - this.closing = email.closing; - this.footer = email.footer; - this.creationDate = email.creationDate; - } - - public Builder recipients(Set recipients) { - this.recipients = recipients; - return this; - } - - public Builder subject(String subject) { - this.subject = subject; - return this; - } - - public Builder starting(String starting) { - this.starting = starting; - return this; - } - - public Builder message(String message) { - this.message = message; - return this; - } - - public Builder closing(String closing) { - this.closing = closing; - return this; - } - - public Builder footer(String footer) { - this.footer = footer; - return this; - } - - public Builder creationDate(LocalDateTime creationDate) { - this.creationDate = creationDate; - return this; - } - - public Email build() { - Email created = new Email(this); - return created; - } - } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java index 94a2dbd6..5c5b1a35 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java @@ -25,10 +25,16 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import lombok.Builder; +import lombok.Data; +import lombok.extern.jackson.Jacksonized; /** * @since 30/01/2020 */ +@Data +@Jacksonized +@Builder(builderClassName = "Builder") public class EntityContext { private User user; private Project project; @@ -36,75 +42,7 @@ public class EntityContext { private Requirement requirement; private Comment comment; - public EntityContext() { - } - - public EntityContext(Builder builder) { - this.user = builder.user; - this.project = builder.project; - this.categories = builder.categories; - this.requirement = builder.requirement; - this.comment = builder.comment; - } - - - public Project getProject() { return project; } - - public Category[] getCategory() { - return categories; - } - - public Requirement getRequirement() { - return requirement; - } - - public Comment getComment() { - return comment; - } - - - public static Builder getBuilder() { - return new Builder(); - } - public String toJSON() throws JsonProcessingException { return new ObjectMapper().registerModule(new JavaTimeModule()).setSerializationInclusion(JsonInclude.Include.NON_NULL).writeValueAsString(this); } - - public static class Builder { - private User user; - private Project project; - private Category[] categories; - private Requirement requirement; - private Comment comment; - - - public Builder project(Project project) { - this.project = project; - return this; - } - - public Builder category(Category[] categories) { - this.categories = categories; - return this; - } - - public Builder requirement(Requirement requirement) { - this.requirement = requirement; - return this; - } - public Builder attachment(User user) { - this.user = user; - return this; - } - - public Builder comment(Comment comment) { - this.comment = comment; - return this; - } - - public EntityContext build() { - return new EntityContext(this); - } - } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java index e2d7da1e..7e49d702 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java @@ -25,12 +25,18 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import lombok.Builder; +import lombok.Data; +import lombok.extern.jackson.Jacksonized; import java.util.List; /** * @since 22/01/2020 */ +@Data +@Jacksonized +@Builder(builderClassName = "Builder") public class EntityOverview { private List projects; @@ -39,78 +45,7 @@ public class EntityOverview { private List comments; private List attachments; - public EntityOverview() { - } - - public EntityOverview(Builder builder) { - this.projects = builder.projects; - this.categories = builder.categories; - this.requirements = builder.requirements; - this.comments = builder.comments; - this.attachments = builder.attachments; - - } - - - public List getProjects() { - return projects; - } - - public List getCategories() { - return categories; - } - - public List getRequirements() { - return requirements; - } - - public List getComments() { - return comments; - } - - - public static Builder getBuilder() { - return new Builder(); - } - public String toJSON() throws JsonProcessingException { return new ObjectMapper().registerModule(new JavaTimeModule()).setSerializationInclusion(JsonInclude.Include.NON_NULL).writeValueAsString(this); } - - public static class Builder { - private List projects; - private List categories; - private List requirements; - private List comments; - private List attachments; - - - public Builder projects(List projects) { - this.projects = projects; - return this; - } - - public Builder categories(List categories) { - this.categories = categories; - return this; - } - - public Builder requirements(List requirements) { - this.requirements = requirements; - return this; - } - public Builder attachments(List attachments) { - this.attachments = attachments; - return this; - } - - public Builder comments(List comments) { - this.comments = comments; - return this; - } - - public EntityOverview build() { - return new EntityOverview(this); - } - } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java index fbd3697c..1aa8833a 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java @@ -20,6 +20,11 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; + import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; @@ -27,12 +32,13 @@ /** * @since 26/11/2019 */ +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") public class PersonalisationData extends EntityBase { - - private int id; - @NotNull @Size(min = 1, max = 50, message = "Key must have between 1 and 50 characters") private String key; @@ -45,88 +51,4 @@ public class PersonalisationData extends EntityBase { @NotNull @Size(min = 1, max = 10000) private String value; - - public PersonalisationData() { - - } - - private PersonalisationData(Builder builder) { - id = builder.id; - key = builder.key; - version = builder.version; - userId = builder.userId; - value = builder.value; - } - - public int getId() { - return id; - } - - public String getKey() { - return key; - } - public void setKey() { - this.key = key; - } - - public int getVersion() { - return version; - } - public void setVersion() { - this.version = version; - } - - public int getUserId() { - return userId; - } - public void setUserId() { - this.userId = userId; - } - - public String getValue(){ - return value; - } - public void setValue() { - this.value = value; - } - - public static Builder getBuilder() { - return new Builder(); - } - - public static class Builder { - private int id; - private String key; - private int version; - private int userId; - private String value; - - public Builder id(int id) { - this.id = id; - return this; - } - - public Builder key(String key) { - this.key = key; - return this; - } - - public Builder version(int version) { - this.version = version; - return this; - } - - public Builder userId(int userId) { - this.userId = userId; - return this; - } - public Builder value(String value) { - this.value = value; - return this; - } - - public PersonalisationData build() { - return new PersonalisationData(this); - } - } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Privilege.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Privilege.java index 861bbc8d..0a81ba33 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Privilege.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Privilege.java @@ -20,53 +20,21 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; + /** * @since 2/17/2015 */ +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") public class Privilege extends EntityBase { - private final int Id; + private final int id; private final PrivilegeEnum name; - - private Privilege(Builder builder) { - Id = builder.id; - this.name = builder.name; - } - - @Override - public int getId() { - return Id; - } - - public PrivilegeEnum getName() { - return name; - } - - public static Builder getBuilder(PrivilegeEnum privilege) { - return new Builder(privilege); - } - - public static class Builder { - private int id; - private PrivilegeEnum name; - - public Builder(PrivilegeEnum privilege) { - this.name = privilege; - } - - public Builder id(int id) { - this.id = id; - return this; - } - - public Builder name(PrivilegeEnum name) { - this.name = name; - return this; - } - - public Privilege build() { - return new Privilege(this); - } - } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java index 731fe9a3..c3a1db08 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java @@ -23,6 +23,10 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreateValidation; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; @@ -31,6 +35,10 @@ /** * @since 6/9/2014 */ +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") public class Project extends EntityBase { private int id; @@ -39,9 +47,10 @@ public class Project extends EntityBase { @Size(min = 1, max = 50, message = "name can't have more than 50 characters") private String name; - @NotNull(message = "description can not be nul", groups = CreateValidation.class) + @NotNull(message = "description can not be null", groups = CreateValidation.class) private String description; + @lombok.Builder.Default private Boolean visibility = true; private Integer defaultCategoryId; @@ -59,188 +68,8 @@ public class Project extends EntityBase { private Integer numberOfFollowers; private Boolean isFollower; - public Project() { - } - - /** - * Private constructor, should be called from its builder only. - * - * @param builder - */ - private Project(Builder builder) { - this.id = builder.id; - this.name = builder.name; - this.description = builder.description; - this.visibility = builder.visibility; - this.defaultCategoryId = builder.defaultCategoryId; - this.leader = builder.leader; - this.isFollower = builder.isFollower; - this.creationDate = builder.creationDate; - this.lastUpdatedDate = builder.lastUpdatedDate; - } - - /** - * Builder to easily build Category objects - * - * @param name Name field will be initialized using the passed value - * @return a builder with name returned - */ - public static Builder getBuilder(String name) { - return new Builder(name); - } - - public int getId() { - return id; - } - - public LocalDateTime getCreationDate() { - return creationDate; - } - - public LocalDateTime getLastUpdatedDate() { - return lastUpdatedDate; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public User getLeader() { - return leader; - } - - public void setLeader(User leader) { - this.leader = leader; - } - - public Integer getDefaultCategoryId() { - return defaultCategoryId; - } - - public void setDefaultCategoryId(Integer defaultCategoryId) { - this.defaultCategoryId = defaultCategoryId; - } - - public Boolean getVisibility() { - return visibility; - } - - public Integer getNumberOfCategories() { - return numberOfCategories; - } - - public void setNumberOfCategories(Integer numberOfCategories) { - this.numberOfCategories = numberOfCategories; - } - - public Integer getNumberOfRequirements() { - return numberOfRequirements; - } - - public void setNumberOfRequirements(Integer numberOfRequirements) { - this.numberOfRequirements = numberOfRequirements; - } - - public Integer getNumberOfFollowers() { - return numberOfFollowers; - } - - public void setNumberOfFollowers(Integer numberOfFollowers) { - this.numberOfFollowers = numberOfFollowers; - } - - public void setFollower(Boolean isFollower) { - this.isFollower = isFollower; - } - @JsonProperty("isFollower") public Boolean isFollower() { return isFollower; } - - public static class Builder { - - private int id; - private String description; - private String name; - private Boolean visibility; - private User leader; - private LocalDateTime creationDate; - private LocalDateTime lastUpdatedDate; - private Integer defaultCategoryId; - private Boolean isFollower; - - public Builder(String name) { - this.name = name; - } - - public Builder description(String description) { - this.description = description; - return this; - } - - public Builder id(int id) { - this.id = id; - return this; - } - - public Builder visibility(Boolean visibility) { - this.visibility = visibility; - return this; - } - - public Builder leader(User leader) { - this.leader = leader; - return this; - } - - public Builder defaultCategoryId(Integer defaultCategoryId) { - this.defaultCategoryId = defaultCategoryId; - return this; - } - - public Builder isFollower(Boolean isFollower) { - this.isFollower = isFollower; - return this; - } - - public Builder creationDate(LocalDateTime creationDate) { - this.creationDate = creationDate; - return this; - } - - public Builder lastUpdatedDate(LocalDateTime lastUpdatedDate) { - this.lastUpdatedDate = lastUpdatedDate; - return this; - } - - /** - * Call this to create a Project object with the values previously set in the builder. - * - * @return initialized Project object - */ - public Project build() { - Project created = new Project(this); - - String name = created.getName(); - - if (name == null || name.length() == 0) { - throw new IllegalStateException("name cannot be null or empty"); - } - - return created; - } - } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectContributors.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectContributors.java index 68a3489b..8c574408 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectContributors.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectContributors.java @@ -1,12 +1,20 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; import java.util.List; /** * Created by Martin on 15.06.2017. */ +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") public class ProjectContributors extends EntityBase { private final int id; @@ -19,103 +27,9 @@ public class ProjectContributors extends EntityBase { private List commentCreator; private List attachmentCreator; - protected ProjectContributors(Builder builder) { - this.id = builder.id; - this.leader = builder.leader; - this.categoryLeader = builder.categoryLeader; - this.requirementCreator = builder.requirementCreator; - this.leadDeveloper = builder.leadDeveloper; - this.developers = builder.developers; - this.commentCreator = builder.commentCreator; - this.attachmentCreator = builder.attachmentCreator; - } - - public static Builder getBuilder() { - return new Builder(); - } - @Override @JsonIgnore public int getId() { return id; } - - public User getLeader() { - return leader; - } - - public List getCategoryLeader() { - return categoryLeader; - } - - public List getRequirementCreator() { - return requirementCreator; - } - - public List getLeadDeveloper() { - return leadDeveloper; - } - - public List getDevelopers() { - return developers; - } - - public List getCommentCreator() { - return commentCreator; - } - - public List getAttachmentCreator() { - return attachmentCreator; - } - - public static class Builder { - - private int id; - private User leader; - private List categoryLeader; - private List requirementCreator; - private List leadDeveloper; - private List developers; - private List commentCreator; - private List attachmentCreator; - - public Builder leader(User leader) { - this.leader = leader; - return this; - } - - public Builder categoryLeader(List categoryLeader) { - this.categoryLeader = categoryLeader; - return this; - } - - public Builder requirementCreator(List requirementCreator) { - this.requirementCreator = requirementCreator; - return this; - } - - public Builder leadDeveloper(List leadDeveloper) { - this.leadDeveloper = leadDeveloper; - return this; - } - - public Builder developers(List developers) { - this.developers = developers; - return this; - } - - public Builder commentCreator(List commentCreator) { - this.commentCreator = commentCreator; - return this; - } - - public Builder attachmentCreator(List attachmentCreator) { - this.attachmentCreator = attachmentCreator; - return this; - } - - public ProjectContributors build() { - return new ProjectContributors(this); - } - } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectFollower.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectFollower.java index d8afbb9a..7df040ca 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectFollower.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectFollower.java @@ -1,55 +1,16 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; + +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") public class ProjectFollower extends EntityBase { - private final int Id; - private final int ProjectId; - private final int UserId; - - private ProjectFollower(Builder builder) { - Id = builder.id; - ProjectId = builder.projectId; - UserId = builder.userId; - } - - public int getId() { - return Id; - } - - public int getProjectId() { - return ProjectId; - } - - public int getUserId() { - return UserId; - } - - public static Builder getBuilder() { - return new Builder(); - } - - public static class Builder { - int userId; - int projectId; - int id; - - public Builder userId(int userId) { - this.userId = userId; - return this; - } - - public Builder projectId(int projectId) { - this.projectId = projectId; - return this; - } - - public Builder id(int id) { - this.id = id; - return this; - } - - public ProjectFollower build() { - return new ProjectFollower(this); - } - } + private final int id; + private final int projectId; + private final int userId; } - diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java index 384760cb..651ddd77 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java @@ -5,6 +5,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreateValidation; import de.rwth.dbis.acis.bazaar.service.dal.helpers.UserVote; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; @@ -15,6 +19,10 @@ /** * Requirement entity */ +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") public class Requirement extends EntityBase { private int id; @@ -64,150 +72,6 @@ public class Requirement extends EntityBase { @JsonProperty("_context") private EntityContext context; - public Requirement() { - } - - protected Requirement(Builder builder) { - this.id = builder.id; - this.name = builder.name; - this.description = builder.description; - this.realized = builder.realized; - this.projectId = builder.projectId; - this.creator = builder.creator; - this.leadDeveloper = builder.leadDeveloper; - this.creationDate = builder.creationDate; - this.lastUpdatedDate = builder.lastUpdatedDate; - this.upVotes = builder.upVotes; - this.downVotes = builder.downVotes; - this.userVoted = builder.userVoted; - this.isFollower = builder.isFollower; - this.isDeveloper = builder.isDeveloper; - this.isContributor = builder.isContributor; - this.context = builder.context; - } - - /** - * Builder to easily build Requirement objects - * - * @param name Name field will be initialized using the passed value - * @return a builder with name returned - */ - public static Builder getBuilder(String name) { - return new Builder(name); - } - - public LocalDateTime getRealized() { - return realized; - } - - public LocalDateTime getCreationDate() { - return creationDate; - } - - public LocalDateTime getLastUpdatedDate() { - return lastUpdatedDate; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public List getCategories() { - return categories; - } - - public void setCategories(List categories) { - this.categories = categories; - } - - public List getAttachments() { - return attachments; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public int getId() { - return id; - } - - public int getProjectId() { - return projectId; - } - - public void setProjectId(int projectId) { - this.projectId = projectId; - } - - public User getCreator() { - return creator; - } - - public void setCreator(User creator) { - this.creator = creator; - } - - public User getLeadDeveloper() { - return leadDeveloper; - } - - public void setFollower(Boolean follower) { - isFollower = follower; - } - - public void setDeveloper(Boolean developer) { - isDeveloper = developer; - } - - public void setContributor(Boolean contributor) { - isContributor = contributor; - } - - public Integer getNumberOfComments() { - return numberOfComments; - } - - public void setNumberOfComments(Integer numberOfComments) { - this.numberOfComments = numberOfComments; - } - - public Integer getNumberOfAttachments() { - return numberOfAttachments; - } - - public void setNumberOfAttachments(Integer numberOfAttachments) { - this.numberOfAttachments = numberOfAttachments; - } - - public Integer getNumberOfFollowers() { - return numberOfFollowers; - } - - public void setNumberOfFollowers(Integer numberOfFollowers) { - this.numberOfFollowers = numberOfFollowers; - } - - public int getUpVotes() { - return upVotes; - } - - public int getDownVotes() { - return downVotes; - } - - public UserVote getUserVoted() { - return userVoted; - } - @JsonProperty("isFollower") public Boolean isFollower() { return isFollower; @@ -222,123 +86,4 @@ public Boolean isDeveloper() { public Boolean isContributor() { return isContributor; } - - public EntityContext getContext() { return context; } - public void setContext(EntityContext context){ - this.context = context; - } - - public static class Builder { - private int id; - private String description; - private String name; - private LocalDateTime realized; - private int projectId; - private LocalDateTime creationDate; - private LocalDateTime lastUpdatedDate; - private int upVotes; - private int downVotes; - private UserVote userVoted; - private User creator; - private User leadDeveloper; - private Boolean isFollower; - private Boolean isDeveloper; - private Boolean isContributor; - private EntityContext context; - - public Builder(String name) { - this.name = name; - } - - public Builder description(String description) { - this.description = description; - return this; - } - - public Builder id(int id) { - this.id = id; - return this; - } - - /** - * Call this to create a Requirement object with the values previously set in the builder. - * - * @return initialized Requirement object - */ - public Requirement build() { - Requirement created = new Requirement(this); - - String name = created.getName(); - - if (name == null || name.length() == 0) { - throw new IllegalStateException("name cannot be null or empty"); - } - - return created; - } - - public Builder projectId(int projectId) { - this.projectId = projectId; - return this; - } - - public Builder realized(LocalDateTime realized) { - this.realized = realized; - return this; - } - - public Builder creationDate(LocalDateTime creationDate) { - this.creationDate = creationDate; - return this; - } - - public Builder lastUpdatedDate(LocalDateTime lastUpdatedDate) { - this.lastUpdatedDate = lastUpdatedDate; - return this; - } - - public Builder upVotes(int upVotes) { - this.upVotes = upVotes; - return this; - } - - public Builder downVotes(int downVotes) { - this.downVotes = downVotes; - return this; - } - - public Builder userVoted(UserVote userVoted) { - this.userVoted = userVoted; - return this; - } - - public Requirement.Builder creator(User creator) { - this.creator = creator; - return this; - } - - public Requirement.Builder leadDeveloper(User leadDeveloper) { - this.leadDeveloper = leadDeveloper; - return this; - } - - public Requirement.Builder isFollower(Boolean isFollower) { - this.isFollower = isFollower; - return this; - } - - public Requirement.Builder isDeveloper(Boolean isDeveloper) { - this.isDeveloper = isDeveloper; - return this; - } - - public Requirement.Builder isContributor(Boolean isContributor) { - this.isContributor = isContributor; - return this; - } - public Builder context(EntityContext context){ - this.context = context; - return this; - } - } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementCategory.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementCategory.java index 70339334..4de6229a 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementCategory.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementCategory.java @@ -20,63 +20,21 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; + /** * @since 6/11/2014 */ +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") public class RequirementCategory extends EntityBase { private final int id; private final int categoryId; private final int requirementId; - - private RequirementCategory(Builder builder) { - this.id = builder.id; - this.categoryId = builder.categoryId; - this.requirementId = builder.requirementId; - } - - public int getId() { - return id; - } - - public int getCategoryId() { - return categoryId; - } - - public int getRequirementId() { - return requirementId; - } - - public static Builder getBuilder(int category_id) { - return new Builder(category_id); - } - - public static class Builder { - private int id; - private int categoryId; - private int requirementId; - - public Builder(int category_id) { - this.categoryId = category_id; - } - - public Builder id(int id) { - this.id = id; - return this; - } - - public Builder categoryId(int categoryId) { - this.categoryId = categoryId; - return this; - } - - public Builder requirementId(int requirementId) { - this.requirementId = requirementId; - return this; - } - - public RequirementCategory build() { - return new RequirementCategory(this); - } - } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementContributors.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementContributors.java index 8e7fbb6f..c07e0166 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementContributors.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementContributors.java @@ -1,6 +1,9 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; -import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; import java.util.List; @@ -9,6 +12,10 @@ /** * Created by Martin on 12.06.2017. */ +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") public class RequirementContributors extends EntityBase { private final int id; @@ -16,87 +23,6 @@ public class RequirementContributors extends EntityBase { private User creator; private User leadDeveloper; private List developers; - //private Link developersLink; // TODO: Skip after 10 elements and add HATEOAS link private List commentCreator; - //private Link commentCreatorLink; private List attachmentCreator; - //private Link attachmentCreatorLink; - - protected RequirementContributors(Builder builder) { - this.id = builder.id; - this.creator = builder.creator; - this.leadDeveloper = builder.leadDeveloper; - this.developers = builder.developers; - this.commentCreator = builder.commentCreator; - this.attachmentCreator = builder.attachmentCreator; - } - - public static Builder getBuilder() { - return new Builder(); - } - - @Override - @JsonIgnore - public int getId() { - return id; - } - - public User getCreator() { - return creator; - } - - public User getLeadDeveloper() { - return leadDeveloper; - } - - public List getDevelopers() { - return developers; - } - - public List getCommentCreator() { - return commentCreator; - } - - public List getAttachmentCreator() { - return attachmentCreator; - } - - public static class Builder { - - private int id; - private User creator; - private User leadDeveloper; - private List developers; - private List commentCreator; - private List attachmentCreator; - - public Builder creator(User creator) { - this.creator = creator; - return this; - } - - public Builder leadDeveloper(User leadDeveloper) { - this.leadDeveloper = leadDeveloper; - return this; - } - - public Builder developers(List developers) { - this.developers = developers; - return this; - } - - public Builder commentCreator(List commentCreator) { - this.commentCreator = commentCreator; - return this; - } - - public Builder attachmentCreator(List attachmentCreator) { - this.attachmentCreator = attachmentCreator; - return this; - } - - public RequirementContributors build() { - return new RequirementContributors(this); - } - } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementDeveloper.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementDeveloper.java index daa78d21..10e8bf36 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementDeveloper.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementDeveloper.java @@ -20,58 +20,20 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; + /** * @since 6/11/2014 */ +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") public class RequirementDeveloper extends EntityBase { - private final int Id; - private final int RequirementId; - private final int UserId; - - private RequirementDeveloper(Builder builder) { - Id = builder.id; - RequirementId = builder.requirementId; - UserId = builder.userId; - } - - public int getId() { - return Id; - } - - public int getRequirementId() { - return RequirementId; - } - - public int getUserId() { - return UserId; - } - - public static Builder getBuilder() { - return new Builder(); - } - - public static class Builder { - int userId; - int requirementId; - int id; - - public Builder userId(int userId) { - this.userId = userId; - return this; - } - - public Builder requirementId(int requirementId) { - this.requirementId = requirementId; - return this; - } - - public Builder id(int id) { - this.id = id; - return this; - } - - public RequirementDeveloper build() { - return new RequirementDeveloper(this); - } - } + private final int id; + private final int requirementId; + private final int userId; } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementFollower.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementFollower.java index d938e1cf..14e4210a 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementFollower.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementFollower.java @@ -20,58 +20,20 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; + /** * @since 6/11/2014 */ +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") public class RequirementFollower extends EntityBase { - private final int Id; - private final int RequirementId; - private final int UserId; - - private RequirementFollower(Builder builder) { - Id = builder.id; - RequirementId = builder.requirementId; - UserId = builder.userId; - } - - public int getId() { - return Id; - } - - public int getRequirementId() { - return RequirementId; - } - - public int getUserId() { - return UserId; - } - - public static Builder getBuilder() { - return new Builder(); - } - - public static class Builder { - int userId; - int requirementId; - int id; - - public Builder userId(int userId) { - this.userId = userId; - return this; - } - - public Builder requirementId(int requirementId) { - this.requirementId = requirementId; - return this; - } - - public Builder id(int id) { - this.id = id; - return this; - } - - public RequirementFollower build() { - return new RequirementFollower(this); - } - } + private final int id; + private final int requirementId; + private final int userId; } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java index 7ff236a0..0d038e3e 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java @@ -20,67 +20,26 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; + import java.util.List; /** * @since 2/17/2015 */ +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") public class Role extends EntityBase { - private final int Id; + private final int id; private final List privileges; private final String name; - - private Role(Builder builder) { - Id = builder.id; - this.privileges = builder.privileges; - - this.name = builder.name; - } - - @Override - public int getId() { - return Id; - } - - public List getPrivileges() { - return privileges; - } - - - public String getName() { - return name; - } - - public static Builder getBuilder(String name) { - return new Builder(name); - } - - public static class Builder { - private String name; - private int id; - private List privileges; - - - public Builder(String name) { - this.name = name; - } - - public Builder id(int id) { - this.id = id; - return this; - } - - public Builder privileges(List privileges) { - this.privileges = privileges; - return this; - } - - public Role build() { - return new Role(this); - } - } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Statistic.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Statistic.java index ee1abc74..0382e495 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Statistic.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Statistic.java @@ -4,10 +4,16 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import lombok.Builder; +import lombok.Data; +import lombok.extern.jackson.Jacksonized; /** * Created by hugif on 26.12.2016. */ +@Data +@Jacksonized +@Builder(builderClassName = "Builder") public class Statistic { private int numberOfProjects; @@ -17,114 +23,7 @@ public class Statistic { private int numberOfAttachments; private int numberOfVotes; - - protected Statistic(Builder builder) { - this.numberOfProjects = builder.numberOfProjects; - this.numberOfCategories = builder.numberOfCategories; - this.numberOfRequirements = builder.numberOfRequirements; - this.numberOfComments = builder.numberOfComments; - this.numberOfAttachments = builder.numberOfAttachments; - this.numberOfVotes = builder.numberOfVotes; - } - - public int getNumberOfProjects() { - return numberOfProjects; - } - - public void setNumberOfProjects(int numberOfProjects) { - this.numberOfProjects = numberOfProjects; - } - - public int getNumberOfCategories() { - return numberOfCategories; - } - - public void setNumberOfCategories(int numberOfCategories) { - this.numberOfCategories = numberOfCategories; - } - - public int getNumberOfRequirements() { - return numberOfRequirements; - } - - public void setNumberOfRequirements(int numberOfRequirements) { - this.numberOfRequirements = numberOfRequirements; - } - - public int getNumberOfComments() { - return numberOfComments; - } - - public void setNumberOfComments(int numberOfComments) { - this.numberOfComments = numberOfComments; - } - - public int getNumberOfAttachments() { - return numberOfAttachments; - } - - public void setNumberOfAttachments(int numberOfAttachments) { - this.numberOfAttachments = numberOfAttachments; - } - - public int getNumberOfVotes() { - return numberOfVotes; - } - - public void setNumberOfVotes(int numberOfVotes) { - this.numberOfVotes = numberOfVotes; - } - public String toJSON() throws JsonProcessingException { return new ObjectMapper().registerModule(new JavaTimeModule()).setSerializationInclusion(JsonInclude.Include.NON_NULL).writeValueAsString(this); } - - public static Builder getBuilder() { - return new Builder(); - } - - public static class Builder { - - protected int numberOfProjects; - protected int numberOfCategories; - protected int numberOfRequirements; - protected int numberOfComments; - protected int numberOfAttachments; - protected int numberOfVotes; - - public Builder numberOfProjects(int numberOfProjects) { - this.numberOfProjects = numberOfProjects; - return this; - } - - public Builder numberOfCategories(int numberOfCategories) { - this.numberOfCategories = numberOfCategories; - return this; - } - - public Builder numberOfRequirements(int numberOfRequirements) { - this.numberOfRequirements = numberOfRequirements; - return this; - } - - public Builder numberOfComments(int numberOfComments) { - this.numberOfComments = numberOfComments; - return this; - } - - public Builder numberOfAttachments(int numberOfAttachments) { - this.numberOfAttachments = numberOfAttachments; - return this; - } - - public Builder numberOfVotes(int numberOfVotes) { - this.numberOfVotes = numberOfVotes; - return this; - } - - public Statistic build() { - return new Statistic(this); - } - } - } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java index 51feac1d..e9bbfab5 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java @@ -23,11 +23,19 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.time.LocalDateTime; +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") public class User extends EntityBase { private int id; @@ -46,6 +54,7 @@ public class User extends EntityBase { @Size(min = 1, max = 1000, message = "eMail must have between 1 and 1000 characters") private transient String eMail; + @JsonIgnore private Boolean admin; @NotNull(message = "las2peerId can't be null") @@ -69,38 +78,6 @@ public class User extends EntityBase { @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") private LocalDateTime lastLoginDate; - public User() { - } - - public User(Builder builder) { - this.id = builder.id; - this.userName = builder.userName; - this.firstName = builder.firstName; - this.lastName = builder.lastName; - this.eMail = builder.eMail; - this.admin = builder.admin; - this.las2peerId = builder.las2peerId; - this.profileImage = builder.profileImage; - this.emailLeadSubscription = builder.emailLeadSubscription; - this.emailFollowSubscription = builder.emailFollowSubscription; - this.creationDate = builder.creationDate; - this.lastUpdatedDate = builder.lastUpdatedDate; - this.lastLoginDate = builder.lastLoginDate; - this.personalizationEnabled = builder.personalizationEnabled; - } - - public int getId() { - return id; - } - - public String getFirstName() { - return firstName; - } - - public String getLastName() { - return lastName; - } - @JsonIgnore public String getEMail() { return eMail; @@ -110,18 +87,6 @@ public Boolean isAdmin() { return admin; } - public String getLas2peerId() { - return las2peerId; - } - - public String getUserName() { - return userName; - } - - public String getProfileImage() { - return profileImage; - } - public Boolean isEmailLeadSubscription() { return emailLeadSubscription != null && emailLeadSubscription; } @@ -133,121 +98,4 @@ public Boolean isEmailFollowSubscription() { public Boolean isPersonalizationEnabled() { return personalizationEnabled != null && personalizationEnabled; } - - public LocalDateTime getCreationDate() { - return creationDate; - } - - public LocalDateTime getLastUpdatedDate() { - return lastUpdatedDate; - } - - public LocalDateTime getLastLoginDate() { - return lastLoginDate; - } - - public static Builder getBuilder(String eMail) { - return new Builder(eMail); - } - - public boolean getAdmin() { - return admin; - } - - - - public static class Builder { - private int id; - private String firstName; - private String lastName; - private String eMail; - private Boolean admin; - private String las2peerId; - private String userName; - private String profileImage; - private Boolean emailLeadSubscription; - private Boolean emailFollowSubscription; - private Boolean personalizationEnabled; - private LocalDateTime creationDate; - private LocalDateTime lastUpdatedDate; - private LocalDateTime lastLoginDate; - - - public Builder(String eMail) { - this.eMail = eMail; - } - - public Builder id(int id) { - this.id = id; - return this; - } - - public Builder firstName(String firstName) { - this.firstName = firstName; - return this; - } - - public Builder lastName(String lastName) { - this.lastName = lastName; - return this; - } - - public Builder eMail(String eMail) { - this.eMail = eMail; - return this; - } - - public Builder admin(Boolean admin) { - this.admin = admin; - return this; - } - - public Builder las2peerId(String userId) { - this.las2peerId = userId; - return this; - } - - public Builder userName(String userName) { - this.userName = userName; - return this; - } - - public Builder profileImage(String profileImage) { - this.profileImage = profileImage; - return this; - } - - public Builder emailLeadSubscription(Boolean emailLeadSubscription) { - this.emailLeadSubscription = emailLeadSubscription; - return this; - } - - public Builder emailFollowSubscription(Boolean emailFollowSubscription) { - this.emailFollowSubscription = emailFollowSubscription; - return this; - } - - public Builder creationDate(LocalDateTime creationDate) { - this.creationDate = creationDate; - return this; - } - - public Builder lastUpdatedDate(LocalDateTime lastUpdatedDate) { - this.lastUpdatedDate = lastUpdatedDate; - return this; - } - - public Builder lastLoginDate(LocalDateTime lastLoginDate) { - this.lastLoginDate = lastLoginDate; - return this; - } - public Builder personalizationEnabled(Boolean personalizationEnabled){ - this.personalizationEnabled = personalizationEnabled; - return this; - } - - public User build() { - return new User(this); - } - } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Vote.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Vote.java index 27c0b00a..95d43730 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Vote.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Vote.java @@ -20,71 +20,21 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; + /** * @since 6/11/2014 */ +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") public class Vote extends EntityBase { - - private final int Id; + private final int id; private final boolean isUpvote; - private final int RequirementId; - private final int UserId; - - private Vote(Builder builder) { - Id = builder.id; - this.isUpvote = builder.isUpvote; - RequirementId = builder.requirementId; - UserId = builder.userId; - } - - public int getId() { - return Id; - } - - public boolean isUpvote() { - return isUpvote; - } - - public int getRequirementId() { - return RequirementId; - } - - public int getUserId() { - return UserId; - } - - public static Builder getBuilder() { - return new Builder(); - } - - public static class Builder { - private int id; - private boolean isUpvote; - private int requirementId; - private int userId; - - public Builder id(int id) { - this.id = id; - return this; - } - - public Builder isUpvote(boolean isUpvote) { - this.isUpvote = isUpvote; - return this; - } - - public Builder requirementId(int requirementId) { - this.requirementId = requirementId; - return this; - } - - public Builder userId(int userId) { - this.userId = userId; - return this; - } - - public Vote build() { - return new Vote(this); - } - } + private final int requirementId; + private final int userId; } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java index f064e966..a8df9ff7 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java @@ -22,7 +22,7 @@ public class EntityContextFactory{ public static EntityContext create(List embed, Record record){ - EntityContext.Builder contextBuilder = EntityContext.getBuilder(); + EntityContext.Builder contextBuilder = EntityContext.builder(); if(embed != null) { for (String entry : embed) { if (entry.equalsIgnoreCase("project")) { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java index 44e920cd..066099b7 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java @@ -137,7 +137,8 @@ public Category findById(int id, int userId) throws BazaarException { ExceptionLocation.REPOSITORY, ErrorCode.NOT_FOUND); } - Category.Builder builder = Category.getBuilder(queryResult.getValues(CATEGORY.NAME).get(0)) + Category.Builder builder = Category.builder() + .name(queryResult.getValues(CATEGORY.NAME).get(0)) .description(queryResult.getValues(CATEGORY.DESCRIPTION).get(0)) .projectId(queryResult.getValues(CATEGORY.PROJECT_ID).get(0)) .id(queryResult.getValues(CATEGORY.ID).get(0)) @@ -154,7 +155,7 @@ public Category findById(int id, int userId) throws BazaarException { category.setNumberOfRequirements((Integer) queryResult.getValues(REQUIREMENT_COUNT).get(0)); category.setNumberOfFollowers((Integer) queryResult.getValues(FOLLOWER_COUNT).get(0)); if (userId != 1) { - category.setFollower((Integer) queryResult.getValues(isFollower).get(0) == 0 ? false : true); + category.setIsFollower(0 != (Integer) queryResult.getValues(isFollower).get(0)); } } catch (BazaarException be) { @@ -209,7 +210,7 @@ public PaginationResult findByProjectId(int projectId, Pageable pageab category.setNumberOfRequirements((Integer) queryResult.getValue(REQUIREMENT_COUNT)); category.setNumberOfFollowers((Integer) queryResult.getValue(FOLLOWER_COUNT)); if (userId != 1) { - category.setFollower((Integer) queryResult.getValue(isFollower) == 0 ? false : true); + category.setIsFollower(0 != (Integer) queryResult.getValue(isFollower)); } categories.add(category); } @@ -276,7 +277,7 @@ public PaginationResult findAll(Pageable pageable, int userId) throws category.setNumberOfRequirements((Integer) queryResult.getValue(requirementCount)); category.setNumberOfFollowers((Integer) queryResult.getValue(followerCount)); if (userId != 1) { - category.setFollower((Integer) queryResult.getValue(isFollower) == 0 ? false : true); + category.setIsFollower(0 != (Integer) queryResult.getValue(isFollower)); } categories.add(category); } @@ -354,7 +355,7 @@ public PaginationResult findByRequirementId(int requirementId, Pageabl category.setNumberOfRequirements((Integer) queryResult.getValue(REQUIREMENT_COUNT)); category.setNumberOfFollowers((Integer) queryResult.getValue(FOLLOWER_COUNT)); if (userId != 1) { - category.setFollower((Integer) queryResult.getValue(isFollower) == 0 ? false : true); + category.setIsFollower((Integer) queryResult.getValue(isFollower) != 0); } categories.add(category); } @@ -432,7 +433,7 @@ public Statistic getStatisticsForCategory(int userId, int categoryId, LocalDateT .where(CATEGORY.ID.eq(categoryId)) .fetchOne(); - result = Statistic.getBuilder() + result = Statistic.builder() .numberOfProjects((Integer) record1.get("numberOfProjects")) .numberOfCategories((Integer) record2.get("numberOfCategories")) .numberOfRequirements((Integer) record3.get("numberOfRequirements")) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java index 40d1ad3b..d7e04112 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java @@ -145,7 +145,8 @@ public Project findById(int id, int userId) throws BazaarException { ExceptionLocation.REPOSITORY, ErrorCode.NOT_FOUND); } - Project.Builder builder = Project.getBuilder(queryResult.getValues(PROJECT.NAME).get(0)) + Project.Builder builder = Project.builder() + .name(queryResult.getValues(PROJECT.NAME).get(0)) .description(queryResult.getValues(PROJECT.DESCRIPTION).get(0)) .id(queryResult.getValues(PROJECT.ID).get(0)) .defaultCategoryId(queryResult.getValues(PROJECT.DEFAULT_CATEGORY_ID).get(0)) @@ -164,7 +165,7 @@ public Project findById(int id, int userId) throws BazaarException { project.setNumberOfRequirements((Integer) queryResult.getValues(REQUIREMENT_COUNT).get(0)); project.setNumberOfFollowers((Integer) queryResult.getValues(FOLLOWER_COUNT).get(0)); if (userId != 1) { - project.setFollower((Integer) queryResult.getValues(isFollower).get(0) == 0 ? false : true); + project.setIsFollower(0 != (Integer) queryResult.getValues(isFollower).get(0)); } } catch (BazaarException be) { @@ -222,7 +223,7 @@ public PaginationResult findAllPublic(Pageable pageable, int userId) th project.setNumberOfRequirements((Integer) queryResult.getValue(REQUIREMENT_COUNT)); project.setNumberOfFollowers((Integer) queryResult.getValue(FOLLOWER_COUNT)); if (userId != 1) { - project.setFollower((Integer) queryResult.getValue(isFollower) == 0 ? false : true); + project.setIsFollower(0 != (Integer) queryResult.getValue(isFollower)); } projects.add(project); } @@ -289,7 +290,7 @@ public PaginationResult findAllPublicAndAuthorized(Pageable pageable, i project.setNumberOfRequirements((Integer) queryResult.getValue(REQUIREMENT_COUNT)); project.setNumberOfFollowers((Integer) queryResult.getValue(FOLLOWER_COUNT)); if (userId != 1) { - project.setFollower((Integer) queryResult.getValue(isFollower) == 0 ? false : true); + project.setIsFollower(0 != (Integer) queryResult.getValue(isFollower)); } projects.add(project); } @@ -380,7 +381,7 @@ public Statistic getStatisticsForVisibleProjects(int userId, LocalDateTime times .where(PROJECT.VISIBILITY.isTrue()) .fetchOne(); - result = Statistic.getBuilder() + result = Statistic.builder() .numberOfProjects((Integer) record1.get("numberOfProjects")) .numberOfCategories((Integer) record2.get("numberOfCategories")) .numberOfRequirements((Integer) record2.get("numberOfRequirements")) @@ -439,7 +440,7 @@ public Statistic getStatisticsForProject(int userId, int projectId, LocalDateTim .where(PROJECT.ID.eq(projectId)) .fetchOne(); - result = Statistic.getBuilder() + result = Statistic.builder() .numberOfProjects((Integer) record1.get("numberOfProjects")) .numberOfCategories((Integer) record2.get("numberOfCategories")) .numberOfRequirements((Integer) record2.get("numberOfRequirements")) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java index c9549dff..c4611cc9 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java @@ -44,6 +44,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; import static org.jooq.impl.DSL.*; @@ -383,7 +384,7 @@ public Requirement findById(int id, int userId, List embed) throws Excep } //Filling up Requirement fields - Requirement.Builder builder = Requirement.getBuilder(queryResult.getValues(REQUIREMENT.NAME).get(0)); + Requirement.Builder builder = Requirement.builder().name(queryResult.getValues(REQUIREMENT.NAME).get(0)); builder.id(queryResult.getValues(REQUIREMENT.ID).get(0)) .description(queryResult.getValues(REQUIREMENT.DESCRIPTION).get(0)) .realized(queryResult.getValues(REQUIREMENT.REALIZED).get(0)) @@ -430,7 +431,8 @@ public Requirement findById(int id, int userId, List embed) throws Excep if (entry.getKey() == null) continue; Result records = entry.getValue(); categories.add( - Category.getBuilder(records.getValues(CATEGORY.NAME).get(0)) + Category.builder() + .name(records.getValues(CATEGORY.NAME).get(0)) .projectId(records.getValues(CATEGORY.PROJECT_ID).get(0)) .id(records.getValues(CATEGORY.ID).get(0)) .description(records.getValues(CATEGORY.DESCRIPTION).get(0)) @@ -444,9 +446,9 @@ public Requirement findById(int id, int userId, List embed) throws Excep requirement.setNumberOfAttachments((Integer) queryResult.getValues(ATTACHMENT_COUNT).get(0)); requirement.setNumberOfFollowers((Integer) queryResult.getValues(FOLLOWER_COUNT).get(0)); if (userId != 1) { - requirement.setFollower((Integer) queryResult.getValues(isFollower).get(0) == 0 ? false : true); - requirement.setDeveloper((Integer) queryResult.getValues(isDeveloper).get(0) == 0 ? false : true); - requirement.setContributor(queryResult.getValues(isContributor).get(0).equals(new BigDecimal(0)) ? false : true); + requirement.setIsFollower(0 != (Integer) queryResult.getValues(isFollower).get(0)); + requirement.setIsDeveloper(0 != (Integer) queryResult.getValues(isDeveloper).get(0)); + requirement.setIsContributor(!Objects.equals(queryResult.getValues(isContributor).get(0), new BigDecimal(0))); } requirement.setContext(EntityContextFactory.create(embed, queryResult.get(0))); @@ -523,7 +525,7 @@ public Statistic getStatisticsForRequirement(int userId, int requirementId, Loca .and(REQUIREMENT.ID.eq(requirementId))) .fetchOne(); - result = Statistic.getBuilder() + result = Statistic.builder() .numberOfProjects((Integer) record1.get("numberOfProjects")) .numberOfCategories((Integer) record1.get("numberOfCategories")) .numberOfRequirements((Integer) record2.get("numberOfRequirements")) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java index 2045a9d9..a8f6db52 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java @@ -142,13 +142,14 @@ private void convertToRoles(List roles, de.rwth.dbis.acis.bazaar.dal.jooq. if (privilegeEntry.getKey() == null) continue; Result privileges = privilegeEntry.getValue(); - Privilege privilege = Privilege.getBuilder(new PrivilegeEnumConverter().from(privileges.getValues(privilegeTable.NAME).get(0))) + Privilege privilege = Privilege.builder().name(new PrivilegeEnumConverter().from(privileges.getValues(privilegeTable.NAME).get(0))) .id(privileges.getValues(privilegeTable.ID).get(0)) .build(); rolesToAddPrivileges.add(privilege); } - Role roleToAdd = Role.getBuilder(records.getValues(roleTable.NAME).get(0)) + Role roleToAdd = Role.builder() + .name(records.getValues(roleTable.NAME).get(0)) .id(records.getValues(roleTable.ID).get(0)) .privileges(rolesToAddPrivileges) .build(); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java index 57657677..a5099fe3 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java @@ -151,7 +151,7 @@ public RequirementContributors findRequirementContributors(int requirementId) th } UserTransformer userTransformer = new UserTransformer(); - RequirementContributors.Builder builder = new RequirementContributors.Builder(); + RequirementContributors.Builder builder = RequirementContributors.builder(); builder.creator( userTransformer.getEntityFromQueryResult(creator, queryResult) @@ -240,7 +240,7 @@ public CategoryContributors findCategoryContributors(int categoryId) throws Baza } UserTransformer userTransformer = new UserTransformer(); - CategoryContributors.Builder builder = new CategoryContributors.Builder(); + CategoryContributors.Builder builder = CategoryContributors.builder(); builder.leader( userTransformer.getEntityFromQueryResult(leader, queryResult) @@ -352,7 +352,7 @@ public ProjectContributors findProjectContributors(int projectId) throws BazaarE } UserTransformer userTransformer = new UserTransformer(); - ProjectContributors.Builder builder = new ProjectContributors.Builder(); + ProjectContributors.Builder builder = ProjectContributors.builder(); builder.leader( userTransformer.getEntityFromQueryResult(leader, queryResult) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java index e34b6765..d794eeee 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java @@ -52,7 +52,7 @@ public AttachmentRecord createRecord(Attachment entity) { @Override public Attachment getEntityFromTableRecord(AttachmentRecord record) { - return Attachment.getBuilder() + return Attachment.builder() .id(record.getId()) .requirementId(record.getRequirementId()) .name(record.getName()) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryFollowerTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryFollowerTransformer.java index b82748ea..31b69501 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryFollowerTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryFollowerTransformer.java @@ -20,7 +20,7 @@ public CategoryFollowerMapRecord createRecord(CategoryFollower entity) { @Override public CategoryFollower getEntityFromTableRecord(CategoryFollowerMapRecord record) { - return CategoryFollower.getBuilder() + return CategoryFollower.builder() .id(record.getId()) .userId(record.getUserId()) .categoryId(record.getCategoryId()) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java index 4f331565..e8947b6b 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java @@ -53,7 +53,8 @@ public CategoryRecord createRecord(Category entry) { @Override public Category getEntityFromTableRecord(CategoryRecord record) { - return Category.getBuilder(record.getName()) + return Category.builder() + .name(record.getName()) .description(record.getDescription()) .projectId(record.getProjectId()) .id(record.getId()) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java index 6736c08c..806ab5ff 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java @@ -51,7 +51,8 @@ public CommentRecord createRecord(Comment entity) { @Override public Comment getEntityFromTableRecord(CommentRecord record) { - return Comment.getBuilder(record.getMessage()) + return Comment.builder() + .message(record.getMessage()) .id(record.getId()) .requirementId(record.getRequirementId()) .replyToComment(record.getReplyToCommentId()) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java index b33b3753..921e5e24 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java @@ -49,7 +49,7 @@ public PersonalisationDataRecord createRecord(PersonalisationData entity) { @Override public PersonalisationData getEntityFromTableRecord(PersonalisationDataRecord record) { - return PersonalisationData.getBuilder() + return PersonalisationData.builder() .id(record.getId()) .userId(record.getUserId()) .version(record.getVersion()) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java index 1854c1b5..fb8d3f76 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java @@ -44,7 +44,8 @@ public PrivilegeRecord createRecord(Privilege entity) { @Override public Privilege getEntityFromTableRecord(PrivilegeRecord record) { - return Privilege.getBuilder(new PrivilegeEnumConverter().from(record.getName())) + return Privilege.builder() + .name(new PrivilegeEnumConverter().from(record.getName())) .id(record.getId()) .build(); } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectFollowerTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectFollowerTransformer.java index 2783f5a0..e3db2369 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectFollowerTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectFollowerTransformer.java @@ -21,7 +21,7 @@ public ProjectFollowerMapRecord createRecord(ProjectFollower entity) { @Override public ProjectFollower getEntityFromTableRecord(ProjectFollowerMapRecord record) { - return ProjectFollower.getBuilder() + return ProjectFollower.builder() .id(record.getId()) .userId(record.getUserId()) .projectId(record.getProjectId()) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java index c2273615..ee30d45c 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java @@ -51,7 +51,8 @@ public ProjectRecord createRecord(Project entry) { @Override public Project getEntityFromTableRecord(ProjectRecord record) { - return Project.getBuilder(record.getName()) + return Project.builder() + .name(record.getName()) .description(record.getDescription()) .id(record.getId()) .defaultCategoryId(record.getDefaultCategoryId()) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java index bf5253d5..2b1a3cfd 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java @@ -43,7 +43,8 @@ public RequirementCategoryMapRecord createRecord(RequirementCategory entity) { @Override public RequirementCategory getEntityFromTableRecord(RequirementCategoryMapRecord record) { - return RequirementCategory.getBuilder(record.getCategoryId()) + return RequirementCategory.builder() + .categoryId(record.getCategoryId()) .id(record.getId()) .requirementId(record.getRequirementId()) .build(); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java index fe1a6217..8213b3c8 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java @@ -43,7 +43,7 @@ public RequirementDeveloperMapRecord createRecord(RequirementDeveloper entity) { @Override public RequirementDeveloper getEntityFromTableRecord(RequirementDeveloperMapRecord record) { - return RequirementDeveloper.getBuilder() + return RequirementDeveloper.builder() .id(record.getId()) .userId(record.getUserId()) .requirementId(record.getRequirementId()) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java index 3e318562..1b8b65b8 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java @@ -43,7 +43,7 @@ public RequirementFollowerMapRecord createRecord(RequirementFollower entity) { @Override public RequirementFollower getEntityFromTableRecord(RequirementFollowerMapRecord record) { - return RequirementFollower.getBuilder() + return RequirementFollower.builder() .id(record.getId()) .userId(record.getUserId()) .requirementId(record.getRequirementId()) @@ -67,7 +67,7 @@ public Class getRecordClass() { @Override public Map getUpdateMap(final RequirementFollower entity) { - return new HashMap() {{ + return new HashMap<>() {{ put(REQUIREMENT_FOLLOWER_MAP.REQUIREMENT_ID, entity.getRequirementId()); put(REQUIREMENT_FOLLOWER_MAP.USER_ID, entity.getUserId()); }}; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java index 12e8a58e..bb43aa88 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java @@ -48,7 +48,7 @@ public RequirementRecord createRecord(Requirement entry) { } public Requirement.Builder mapToEntityBuilder(RequirementRecord record) { - return Requirement.getBuilder(record.getName()) + return Requirement.builder().name(record.getName()) .description(record.getDescription()) .id(record.getId()) .realized(record.getRealized()) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java index 41ca9bd2..7be8369f 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java @@ -44,7 +44,8 @@ public RoleRecord createRecord(Role entity) { @Override public Role getEntityFromTableRecord(RoleRecord record) { - return Role.getBuilder(record.getName()) + return Role.builder() + .name(record.getName()) .id(record.getId()) .build(); } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java index 5da7abf6..49f47ac6 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java @@ -52,7 +52,8 @@ public UserRecord createRecord(User entity) { @Override public User getEntityFromTableRecord(UserRecord record) { - return User.getBuilder(record.getEmail()) + return User.builder() + .eMail(record.getEmail()) .id(record.getId()) .admin(record.getAdmin()) .firstName(record.getFirstName()) @@ -70,7 +71,8 @@ public User getEntityFromTableRecord(UserRecord record) { } public User getEntityFromQueryResult(de.rwth.dbis.acis.bazaar.dal.jooq.tables.User user, Result queryResult) { - return User.getBuilder(queryResult.getValues(user.EMAIL).get(0)) + return User.builder() + .eMail(queryResult.getValues(user.EMAIL).get(0)) .id(queryResult.getValues(user.ID).get(0)) .admin(queryResult.getValues(user.ADMIN).get(0)) .firstName(queryResult.getValues(user.FIRST_NAME).get(0)) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java index e16a4b3b..fbc41a51 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java @@ -44,7 +44,7 @@ public VoteRecord createRecord(Vote entity) { @Override public Vote getEntityFromTableRecord(VoteRecord record) { - return Vote.getBuilder() + return Vote.builder() .id(record.getId()) .userId(record.getUserId()) .requirementId(record.getRequirementId()) @@ -69,7 +69,7 @@ public Class getRecordClass() { @Override public Map getUpdateMap(final Vote entity) { - return new HashMap() {{ + return new HashMap<>() {{ put(VOTE.IS_UPVOTE, entity.isUpvote()); put(VOTE.REQUIREMENT_ID, entity.getRequirementId()); put(VOTE.USER_ID, entity.getUserId()); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java index 7517db61..5c1016d2 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java @@ -44,7 +44,7 @@ public void sendActivityOverRMI(LocalDateTime creationDate, Activity.ActivityAct try { dalFacade = bazaarService.getDBConnection(); - Activity.Builder activityBuilder = Activity.getBuilder(); + Activity.Builder activityBuilder = Activity.builder(); activityBuilder = activityBuilder.creationDate(creationDate); activityBuilder = activityBuilder.activityAction(activityAction); @@ -111,7 +111,7 @@ public void sendActivityOverRMI(LocalDateTime creationDate, Activity.ActivityAct } activityBuilder = activityBuilder.userUrl(baseURL + "users" + "/" + String.valueOf(userId)); activityBuilder = activityBuilder.origin(activityOrigin); - activityBuilder = activityBuilder.addititionalObject(additionalObject); + activityBuilder = activityBuilder.additionalObject(additionalObject); Activity activity = activityBuilder.build(); FilterProvider filters = diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java index 2c6cc9b2..e3bd053d 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java @@ -22,14 +22,14 @@ public class EmailDispatcher { private final L2pLogger logger = L2pLogger.getInstance(EmailDispatcher.class.getName()); - private String smtpServer; - private String emailFromAddress; - private BazaarService bazaarService; - private String frontendBaseURL; - private String emailSummaryTimePeriodInMinutes; - private Map> notificationSummery; + private final String smtpServer; + private final String emailFromAddress; + private final BazaarService bazaarService; + private final String frontendBaseURL; + private final String emailSummaryTimePeriodInMinutes; + private final Map> notificationSummery; - private ExecutorService executorService = Executors.newCachedThreadPool(); + private final ExecutorService executorService = Executors.newCachedThreadPool(); public EmailDispatcher(BazaarService bazaarService, String smtpServer, String emailFromAddress, String frontendBaseURL, String emailSummaryTimePeriodInMinutes) throws Exception { this.smtpServer = smtpServer; @@ -75,7 +75,7 @@ public void addEmailNotification(LocalDateTime creationDate, Activity.ActivityAc notificationSummery.put(recipient.getId(), new ArrayList<>()); } else if (!emailSummaryTimePeriodInMinutes.isEmpty()) { //if user has notificationsummery, add this email to it and remove from recipient - notificationSummery.get(recipient.getId()).add(new Email.Builder(email).recipients(new HashSet<>(Arrays.asList(recipient))).build()); + notificationSummery.get(recipient.getId()).add(email.toBuilder().recipients(new HashSet<>(Arrays.asList(recipient))).build()); recipientsIterator.remove(); email.removeRecipient(recipient); } @@ -92,11 +92,11 @@ public void addEmailNotification(LocalDateTime creationDate, Activity.ActivityAc private Email generateEmail(List recipients, LocalDateTime creationDate, Activity.ActivityAction activityAction, int dataId, Activity.DataType dataType, Activity.AdditionalObject additionalObject) throws Exception { DALFacade dalFacade = bazaarService.getDBConnection(); - String subject = new String(); - String bodyText = new String(); + String subject = ""; + String bodyText = ""; String objectName; - String resourcePath = new String(); - String activity = new String(); + String resourcePath = ""; + String activity = ""; if (activityAction == Activity.ActivityAction.CREATE) { activity = Localization.getInstance().getResourceBundle().getString("email.bodyText.created"); subject = Localization.getInstance().getResourceBundle().getString("email.subject.New"); @@ -111,7 +111,7 @@ private Email generateEmail(List recipients, LocalDateTime creationDate, A if (dataType == Activity.DataType.PROJECT) { Project project = additionalObject.getProject(); objectName = project.getName(); - resourcePath = "projects" + "/" + String.valueOf(dataId); + resourcePath = "projects" + "/" + dataId; subject = subject.concat(" " + Localization.getInstance().getResourceBundle().getString("email.bodyText.project") + ": " + (objectName.length() > 40 ? objectName.substring(0, 39) : objectName)); bodyText = bodyText.concat(Localization.getInstance().getResourceBundle().getString("email.bodyText.user") + " " + additionalObject.getUser().getUserName()); bodyText = bodyText.concat(" " + activity); @@ -123,7 +123,7 @@ private Email generateEmail(List recipients, LocalDateTime creationDate, A } else if (dataType == Activity.DataType.CATEGORY) { Category category = additionalObject.getCategory(); objectName = category.getName(); - resourcePath = "projects" + "/" + category.getProjectId() + "/" + "categories" + "/" + String.valueOf(dataId); + resourcePath = "projects" + "/" + category.getProjectId() + "/" + "categories" + "/" + dataId; subject = subject.concat(" " + Localization.getInstance().getResourceBundle().getString("email.bodyText.category") + ": " + (objectName.length() > 40 ? objectName.substring(0, 39) : objectName)); bodyText = bodyText.concat(Localization.getInstance().getResourceBundle().getString("email.bodyText.user") + " " + additionalObject.getUser().getUserName()); bodyText = bodyText.concat(" " + activity); @@ -139,7 +139,7 @@ private Email generateEmail(List recipients, LocalDateTime creationDate, A Requirement requirement = additionalObject.getRequirement(); objectName = requirement.getName(); resourcePath = "projects" + "/" + requirement.getProjectId() + "/" + "categories" + "/" + - requirement.getCategories().get(0).getId() + "/" + "requirements" + "/" + String.valueOf(dataId); + requirement.getCategories().get(0).getId() + "/" + "requirements" + "/" + dataId; subject = subject.concat(" " + Localization.getInstance().getResourceBundle().getString("email.bodyText.requirement") + ": " + (objectName.length() > 40 ? objectName.substring(0, 39) : objectName)); bodyText = bodyText.concat(Localization.getInstance().getResourceBundle().getString("email.bodyText.user") + " " + additionalObject.getUser().getUserName()); bodyText = bodyText.concat(" " + activity); @@ -156,7 +156,7 @@ private Email generateEmail(List recipients, LocalDateTime creationDate, A Requirement requirement = additionalObject.getRequirement(); objectName = requirement.getName(); resourcePath = "projects" + "/" + requirement.getProjectId() + "/" + "categories" + "/" + - requirement.getCategories().get(0).getId() + "/" + "requirements" + "/" + String.valueOf(requirement.getId()); + requirement.getCategories().get(0).getId() + "/" + "requirements" + "/" + requirement.getId(); subject = subject.concat(" " + Localization.getInstance().getResourceBundle().getString("email.bodyText.comment") + " " + Localization.getInstance().getResourceBundle().getString("email.bodyText.for") + " " + Localization.getInstance().getResourceBundle().getString("email.bodyText.requirement") + ": " + (objectName.length() > 40 ? objectName.substring(0, 39) : objectName)); @@ -172,7 +172,7 @@ private Email generateEmail(List recipients, LocalDateTime creationDate, A Requirement requirement = additionalObject.getRequirement(); objectName = requirement.getName(); resourcePath = "projects" + "/" + requirement.getProjectId() + "/" + "categories" + "/" + - requirement.getCategories().get(0).getId() + "/" + "requirements" + "/" + String.valueOf(requirement.getId()); + requirement.getCategories().get(0).getId() + "/" + "requirements" + "/" + requirement.getId(); subject = subject.concat(" " + Localization.getInstance().getResourceBundle().getString("email.bodyText.attachment") + " " + Localization.getInstance().getResourceBundle().getString("email.bodyText.for") + " " + Localization.getInstance().getResourceBundle().getString("email.bodyText.requirement") + ": " + (objectName.length() > 40 ? objectName.substring(0, 39) : objectName)); @@ -192,7 +192,7 @@ private Email generateEmail(List recipients, LocalDateTime creationDate, A Localization.getInstance().getResourceBundle().getString("email.bodyText.bestWishes"); String footer = Localization.getInstance().getResourceBundle().getString("email.bodyText.footer"); - Email.Builder emailBuilder = new Email.Builder(); + Email.Builder emailBuilder = Email.builder(); emailBuilder.recipients(new HashSet<>(recipients)); emailBuilder.subject(subject); emailBuilder.starting(greeting + "\r\n\r\n" + news); @@ -237,7 +237,7 @@ public void emptyNotificationSummery() { notificationIterator.remove(); } - Email.Builder emailBuilder = new Email.Builder(); + Email.Builder emailBuilder = Email.builder(); emailBuilder.recipients(new HashSet<>(Arrays.asList(user))); emailBuilder.subject(subject); emailBuilder.starting(greeting); diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java index 713ede04..f8f85d8d 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java @@ -79,7 +79,8 @@ public void setUp() throws Exception { try { initUser = facade.getUserById(facade.getUserIdByLAS2PeerId("1111")); } catch (Exception e) { - initUser = User.getBuilder("test@test.hu") + initUser = User.builder() + .eMail("test@test.hu") .firstName("Elek") .lastName("Test") .userName("TestElek") @@ -95,7 +96,7 @@ public void setUp() throws Exception { @Test public void testCreateUser() { try { - facade.createUser(User.getBuilder("unittest@test.hu").firstName("Max").lastName("Zimmermann").admin(false).las2peerId("9999").userName("MaxZim").personalizationEnabled(false).emailFollowSubscription(false).emailLeadSubscription(false).build()); + facade.createUser(User.builder().eMail("unittest@test.hu").firstName("Max").lastName("Zimmermann").admin(false).las2peerId("9999").userName("MaxZim").personalizationEnabled(false).emailFollowSubscription(false).emailLeadSubscription(false).build()); Integer userId = facade.getUserIdByLAS2PeerId("9999"); User user = facade.getUserById(userId); @@ -128,7 +129,7 @@ public void testGetUserById() throws Exception { @Test public void testCreateGetProject() throws Exception { - Project project = Project.getBuilder("Project3").description("ProjDesc3").id(1).leader(initUser).visibility(true).isFollower(false).build(); + Project project = Project.builder().name("Project3").description("ProjDesc3").id(1).leader(initUser).visibility(true).isFollower(false).build(); facade.createProject(project, initUser.getId()); From aa2541450bca43ed8874db22cf9e5dc587f20fb0 Mon Sep 17 00:00:00 2001 From: Thore Date: Wed, 24 Mar 2021 23:42:48 +0100 Subject: [PATCH 056/134] Move resources into own package --- .../{ => resources}/AttachmentsResource.java | 0 .../{ => resources}/CategoryResource.java | 0 .../{ => resources}/CommentsResource.java | 0 .../PersonalisationDataResource.java | 0 .../{ => resources}/ProjectsResource.java | 33 +++++++++++++++++++ .../{ => resources}/RequirementsResource.java | 0 .../{ => resources}/UsersResource.java | 0 7 files changed, 33 insertions(+) rename requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/{ => resources}/AttachmentsResource.java (100%) rename requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/{ => resources}/CategoryResource.java (100%) rename requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/{ => resources}/CommentsResource.java (100%) rename requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/{ => resources}/PersonalisationDataResource.java (100%) rename requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/{ => resources}/ProjectsResource.java (94%) rename requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/{ => resources}/RequirementsResource.java (100%) rename requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/{ => resources}/UsersResource.java (100%) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/AttachmentsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/AttachmentsResource.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/AttachmentsResource.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/AttachmentsResource.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CategoryResource.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CategoryResource.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CategoryResource.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CommentsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/CommentsResource.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/PersonalisationDataResource.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/PersonalisationDataResource.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/PersonalisationDataResource.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java similarity index 94% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java index 65aea550..a1b2f763 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/ProjectsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java @@ -700,4 +700,37 @@ public Response getRequirementsForProject(@PathParam("projectId") int projectId, RequirementsResource requirementsResource = new RequirementsResource(); return requirementsResource.getRequirementsForProject(projectId, page, perPage, search, stateFilter, sort, sortDirection); } + + /** + * This method returns the list of feedbacks for a specific project. + * + * @param projectId id of the project to retrieve requirements for + * @param page page number + * @param perPage number of requirements by page + * @param search search string + * @param stateFilter requirement state + * @param sort sort order + * @return Response with requirements as a JSON array. + */ + @GET + @Path("/{projectId}/feedbacks") + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "This method returns the list of given feedbacks for a specific project.") + @ApiResponses(value = { + @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns a list of feedbacks for a given project", response = Feedback.class, responseContainer = "List"), + @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), + @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), + @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") + }) + public Response getFeedbacksForProject(@PathParam("projectId") int projectId, + @ApiParam(value = "Page number", required = false) @DefaultValue("0") @QueryParam("page") int page, + @ApiParam(value = "Elements of feedbacks by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage, + @ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, + @ApiParam(value = "State filter", required = false, allowableValues = "all,open") @DefaultValue("all") @QueryParam("state") String stateFilter, + @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "date") @DefaultValue("date") @QueryParam("sort") List sort, + @ApiParam(value = "SortDirection", allowableValues = "ASC,DESC") @QueryParam("sortDirection") String sortDirection + ) throws Exception { + FeedbackResource feedbackResource = new FeedbackResource(); + return feedbackResource.getFeedbackForProject(projectId, page, perPage); + } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/RequirementsResource.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/UsersResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/UsersResource.java rename to requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java From af52c44ed99401cc93649318f7d62b858512c5e1 Mon Sep 17 00:00:00 2001 From: Thore Date: Wed, 24 Mar 2021 23:44:29 +0100 Subject: [PATCH 057/134] remove custom emoji handling, unicode must suffice --- requirement_bazaar/build.gradle | 1 - .../dal/transform/AttachmentTransformer.java | 13 --- .../dal/transform/CategoryTransformer.java | 19 +---- .../dal/transform/CommentTransformer.java | 10 --- .../dal/transform/FeedbackTransformer.java | 79 +++++++++++++++++++ .../dal/transform/ProjectTransformer.java | 13 --- .../dal/transform/RequirementTransformer.java | 13 --- .../dal/transform/UserTransformer.java | 3 - 8 files changed, 82 insertions(+), 69 deletions(-) create mode 100644 requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/FeedbackTransformer.java diff --git a/requirement_bazaar/build.gradle b/requirement_bazaar/build.gradle index b022b96f..bbf90a3e 100644 --- a/requirement_bazaar/build.gradle +++ b/requirement_bazaar/build.gradle @@ -71,7 +71,6 @@ dependencies { implementation 'org.apache.httpcomponents:httpclient:4.5.13' implementation 'commons-io:commons-io:2.8.0' implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.8.9' - implementation 'com.vdurmont:emoji-java:5.1.1' } configurations { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java index d794eeee..d129ab1a 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java @@ -20,7 +20,6 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; -import com.vdurmont.emoji.EmojiParser; import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.AttachmentRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Attachment; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; @@ -35,8 +34,6 @@ public class AttachmentTransformer implements Transformer getFilterConditions(Map filters) throws Exception { return new ArrayList<>(); } - - private Attachment cleanEntry(Attachment attachment) { - if (attachment.getName() != null) { - attachment.setName(EmojiParser.parseToAliases(attachment.getName())); - } - if (attachment.getDescription() != null) { - attachment.setDescription(EmojiParser.parseToAliases(attachment.getDescription())); - } - return attachment; - } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java index e8947b6b..fbc9b4f7 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java @@ -20,7 +20,6 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; -import com.vdurmont.emoji.EmojiParser; import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CategoryRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Category; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; @@ -40,13 +39,11 @@ public class CategoryTransformer implements Transformer { @Override public CategoryRecord createRecord(Category entry) { - entry = this.cleanEntry(entry); - CategoryRecord record = new CategoryRecord(); record.setDescription(entry.getDescription()); record.setName(entry.getName()); record.setProjectId(entry.getProjectId()); - record.setLeaderId(entry.getLeader().getId()); + record.setLeaderId(entry.getCreator().getId()); record.setCreationDate(LocalDateTime.now()); return record; } @@ -87,8 +84,8 @@ public Map getUpdateMap(final Category entry) { if (entry.getName() != null) { put(CATEGORY.NAME, entry.getName()); } - if (entry.getLeader() != null) { - put(CATEGORY.LEADER_ID, entry.getLeader().getId()); + if (entry.getCreator() != null) { + put(CATEGORY.LEADER_ID, entry.getCreator().getId()); } }}; if (!updateMap.isEmpty()) { @@ -207,14 +204,4 @@ public Collection getFilterConditions(Map f } return conditions; } - - private Category cleanEntry(Category category) { - if (category.getName() != null) { - category.setName(EmojiParser.parseToAliases(category.getName())); - } - if (category.getDescription() != null) { - category.setDescription(EmojiParser.parseToAliases(category.getDescription())); - } - return category; - } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java index 806ab5ff..b1a9ff91 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java @@ -20,7 +20,6 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; -import com.vdurmont.emoji.EmojiParser; import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CommentRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Comment; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; @@ -38,8 +37,6 @@ public class CommentTransformer implements Transformer { @Override public CommentRecord createRecord(Comment entity) { - entity = this.cleanEntity(entity); - CommentRecord record = new CommentRecord(); record.setUserId(entity.getCreator().getId()); record.setMessage(entity.getMessage()); @@ -217,11 +214,4 @@ public Collection getFilterConditions(Map f } return conditions; } - - private Comment cleanEntity(Comment comment) { - if (comment.getMessage() != null) { - comment.setMessage(EmojiParser.parseToAliases(comment.getMessage())); - } - return comment; - } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/FeedbackTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/FeedbackTransformer.java new file mode 100644 index 00000000..2e3ff409 --- /dev/null +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/FeedbackTransformer.java @@ -0,0 +1,79 @@ +package de.rwth.dbis.acis.bazaar.service.dal.transform; + +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.FeedbackRecord; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Feedback; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; +import org.jooq.*; + +import java.time.LocalDateTime; +import java.util.*; + +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.FEEDBACK; + +public class FeedbackTransformer implements Transformer { + @Override + public FeedbackRecord createRecord(Feedback entity) { + FeedbackRecord record = new FeedbackRecord(); + record.setProjectId(entity.getProjectId()); + record.setFeedback(entity.getFeedback()); + record.setEmail(entity.getEMail()); + record.setRequirementId(entity.getRequirementId()); + record.setCreationDate(LocalDateTime.now()); + return record; + } + + @Override + public Feedback getEntityFromTableRecord(FeedbackRecord record) { + return Feedback.builder() + .id(record.getId()) + .creationDate(record.getCreationDate()) + .projectId(record.getProjectId()) + .eMail(record.getEmail()) + .feedback(record.getFeedback()) + .requirementId(record.getRequirementId()) + .build(); + } + + @Override + public Table getTable() { + return FEEDBACK; + } + + @Override + public TableField getTableId() { + return FEEDBACK.ID; + } + + @Override + public Class getRecordClass() { + return FeedbackRecord.class; + } + + @Override + public Map getUpdateMap(Feedback entity) { + HashMap updateMap = new HashMap<>() {{ + + if (entity.getRequirementId() != null) { + put(FEEDBACK.REQUIREMENT_ID, entity.getRequirementId()); + } + }}; + return updateMap; } + + @Override + public Collection> getSortFields(List sorts) { + if (sorts.isEmpty()) { + return Collections.singletonList(FEEDBACK.CREATION_DATE.desc()); + } + return null; + } + + @Override + public Condition getSearchCondition(String search) throws Exception { + throw new Exception("Search is not supported!"); + } + + @Override + public Collection getFilterConditions(Map filters) throws Exception { + return new ArrayList<>(); + } +} diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java index ee30d45c..9abbdd9d 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java @@ -20,7 +20,6 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; -import com.vdurmont.emoji.EmojiParser; import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.ProjectRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; @@ -37,8 +36,6 @@ public class ProjectTransformer implements Transformer { @Override public ProjectRecord createRecord(Project entry) { - entry = this.cleanEntry(entry); - ProjectRecord record = new ProjectRecord(); record.setDescription(entry.getDescription()); record.setName(entry.getName()); @@ -225,14 +222,4 @@ public Collection getFilterConditions(Map f } return conditions; } - - private Project cleanEntry(Project project) { - if (project.getName() != null) { - project.setName(EmojiParser.parseToAliases(project.getName())); - } - if (project.getDescription() != null) { - project.setDescription(EmojiParser.parseToAliases(project.getDescription())); - } - return project; - } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java index bb43aa88..854f2fe5 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java @@ -20,7 +20,6 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; -import com.vdurmont.emoji.EmojiParser; import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Requirement; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; @@ -36,8 +35,6 @@ public class RequirementTransformer implements Transformer { @Override public RequirementRecord createRecord(Requirement entry) { - entry = this.cleanEntity(entry); - RequirementRecord record = new RequirementRecord(); record.setDescription(entry.getDescription()); record.setName(entry.getName()); @@ -250,14 +247,4 @@ public Collection getFilterConditions(Map f } return conditions; } - - private Requirement cleanEntity(Requirement requirement) { - if (requirement.getName() != null) { - requirement.setName(EmojiParser.parseToAliases(requirement.getName())); - } - if (requirement.getDescription() != null) { - requirement.setDescription(EmojiParser.parseToAliases(requirement.getDescription())); - } - return requirement; - } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java index 49f47ac6..1cbdd1f8 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java @@ -36,7 +36,6 @@ public class UserTransformer implements Transformer { public UserRecord createRecord(User entity) { UserRecord record = new UserRecord(); record.setLas2peerId(entity.getLas2peerId()); - record.setAdmin(entity.getAdmin()); record.setEmail(entity.getEMail()); record.setFirstName(entity.getFirstName()); record.setLastName(entity.getLastName()); @@ -55,7 +54,6 @@ public User getEntityFromTableRecord(UserRecord record) { return User.builder() .eMail(record.getEmail()) .id(record.getId()) - .admin(record.getAdmin()) .firstName(record.getFirstName()) .lastName(record.getLastName()) .las2peerId(record.getLas2peerId()) @@ -74,7 +72,6 @@ public User getEntityFromQueryResult(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Us return User.builder() .eMail(queryResult.getValues(user.EMAIL).get(0)) .id(queryResult.getValues(user.ID).get(0)) - .admin(queryResult.getValues(user.ADMIN).get(0)) .firstName(queryResult.getValues(user.FIRST_NAME).get(0)) .lastName(queryResult.getValues(user.LAST_NAME).get(0)) .las2peerId(queryResult.getValues(user.LAS2PEER_ID).get(0)) From 54a8b71d58d7aa59b706a7cda0015f515eb5fe41 Mon Sep 17 00:00:00 2001 From: Thore Date: Wed, 24 Mar 2021 23:47:37 +0100 Subject: [PATCH 058/134] Implement feedback endpoint (permissions broken) --- .../bazaar/service/dal/entities/Feedback.java | 36 ++++ .../dal/repositories/FeedbackRepository.java | 13 ++ .../repositories/FeedbackRepositoryImpl.java | 86 +++++++++ .../service/resources/FeedbackResource.java | 179 ++++++++++++++++++ .../resources/i18n/Translation_de.properties | 3 +- .../resources/i18n/Translation_en.properties | 3 +- .../resources/migrations/V6__add_feedback.sql | 10 + .../migrations/V7__utf8mb4_conversion.sql | 19 ++ .../dbis/acis/bazaar/service/BazaarTest.java | 95 +++++++++- .../dbis/acis/bazaar/service/TestBase.java | 21 +- .../bazaar/service/dal/DALFacadeTest.java | 120 +++++------- .../bazaar/service/helpers/SetupData.java | 79 ++++++++ 12 files changed, 586 insertions(+), 78 deletions(-) create mode 100644 requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Feedback.java create mode 100644 requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/FeedbackRepository.java create mode 100644 requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/FeedbackRepositoryImpl.java create mode 100644 requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/FeedbackResource.java create mode 100644 requirement_bazaar/src/main/resources/migrations/V6__add_feedback.sql create mode 100644 requirement_bazaar/src/main/resources/migrations/V7__utf8mb4_conversion.sql create mode 100644 requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Feedback.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Feedback.java new file mode 100644 index 00000000..6a055bd9 --- /dev/null +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Feedback.java @@ -0,0 +1,36 @@ +package de.rwth.dbis.acis.bazaar.service.dal.entities; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreateValidation; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; +import java.time.LocalDateTime; + +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") +public class Feedback extends EntityBase { + private int id; + + @NotNull(message = "feedback needs an associated project", groups = CreateValidation.class) + @Min(value = 0, groups = CreateValidation.class) + private int projectId; + + @NotNull(message = "feedback can not be null", groups = CreateValidation.class) + private String feedback; + + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") + private LocalDateTime creationDate; + + @JsonProperty("email") + private String eMail; + + private Integer requirementId; +} diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/FeedbackRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/FeedbackRepository.java new file mode 100644 index 00000000..07e404f7 --- /dev/null +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/FeedbackRepository.java @@ -0,0 +1,13 @@ +package de.rwth.dbis.acis.bazaar.service.dal.repositories; + +import de.rwth.dbis.acis.bazaar.service.dal.entities.Feedback; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; +import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; + +public interface FeedbackRepository extends Repository { + + PaginationResult findAllByProject(int projectId, Pageable pageable) throws BazaarException; + + Feedback findById(int id) throws Exception; +} diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/FeedbackRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/FeedbackRepositoryImpl.java new file mode 100644 index 00000000..85ba6440 --- /dev/null +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/FeedbackRepositoryImpl.java @@ -0,0 +1,86 @@ +package de.rwth.dbis.acis.bazaar.service.dal.repositories; + +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.FeedbackRecord; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Feedback; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; +import de.rwth.dbis.acis.bazaar.service.dal.transform.FeedbackTransformer; +import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; +import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; +import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; +import de.rwth.dbis.acis.bazaar.service.exception.ExceptionLocation; +import org.jooq.DSLContext; +import org.jooq.Field; +import org.jooq.Record; +import org.jooq.exception.DataAccessException; + +import java.util.ArrayList; +import java.util.List; + +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.FEEDBACK; + +public class FeedbackRepositoryImpl extends RepositoryImpl implements FeedbackRepository { + + /** + * @param jooq DSLContext for JOOQ connection + */ + public FeedbackRepositoryImpl(DSLContext jooq) { + super(jooq, new FeedbackTransformer()); + } + + + @Override + public PaginationResult findAllByProject(int projectId, Pageable pageable) throws BazaarException { + PaginationResult result = null; + List feedbacks; + try { + feedbacks = new ArrayList<>(); + + Field idCount = jooq.selectCount() + .from(FEEDBACK) + .where(transformer.getFilterConditions(pageable.getFilters())) + //.and(transformer.getSearchCondition(pageable.getSearch())) + .and(FEEDBACK.PROJECT_ID.eq(projectId)) + .asField("idCount"); + + List queryResults = jooq.select(FEEDBACK.fields()) + .select(idCount) + .from(FEEDBACK) + .where(FEEDBACK.PROJECT_ID.eq(projectId)) + .limit(pageable.getPageSize()) + .offset(pageable.getOffset()) + .fetch(); + + for (Record queryResult : queryResults) { + FeedbackRecord feedbackRecord = queryResult.into(FEEDBACK); + Feedback feedback = transformer.getEntityFromTableRecord(feedbackRecord); + feedbacks.add(findById(feedback.getId())); // TODO: Remove the getId call and create the objects themself here + } + int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); + result = new PaginationResult<>(total, pageable, feedbacks); + } catch (DataAccessException e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } catch (Exception e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } + return result; + } + + public Feedback findById(int id) throws Exception { + Feedback returnFeedback = null; + try { + FeedbackRecord record = jooq.selectFrom(FEEDBACK) + .where(transformer.getTableId().equal(id)) + .fetchOne(); + returnFeedback = transformer.getEntityFromTableRecord(record); + } catch (DataAccessException e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } catch (NullPointerException e) { + ExceptionHandler.getInstance().convertAndThrowException( + new Exception("No " + transformer.getRecordClass() + " found with id: " + id), + ExceptionLocation.REPOSITORY, ErrorCode.NOT_FOUND); + } + return returnFeedback; + } + +} diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/FeedbackResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/FeedbackResource.java new file mode 100644 index 00000000..b821d1e7 --- /dev/null +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/FeedbackResource.java @@ -0,0 +1,179 @@ +package de.rwth.dbis.acis.bazaar.service.resources; + +import de.rwth.dbis.acis.bazaar.service.BazaarFunction; +import de.rwth.dbis.acis.bazaar.service.BazaarService; +import de.rwth.dbis.acis.bazaar.service.dal.DALFacade; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Activity; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Feedback; +import de.rwth.dbis.acis.bazaar.service.dal.entities.PrivilegeEnum; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; +import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; +import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; +import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; +import de.rwth.dbis.acis.bazaar.service.exception.ExceptionLocation; +import de.rwth.dbis.acis.bazaar.service.internalization.Localization; +import de.rwth.dbis.acis.bazaar.service.security.AuthorizationManager; +import i5.las2peer.api.Context; +import i5.las2peer.api.logging.MonitoringEvent; +import i5.las2peer.api.security.Agent; +import i5.las2peer.logging.L2pLogger; +import io.swagger.annotations.*; + +import javax.validation.ConstraintViolation; +import javax.ws.rs.Consumes; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import java.net.HttpURLConnection; +import java.time.LocalDateTime; +import java.util.*; + +@Api(value = "feedback") +@SwaggerDefinition( + info = @Info( + title = "Requirements Bazaar", + version = "0.9.0", + description = "Requirements Bazaar project", + termsOfService = "http://requirements-bazaar.org", + contact = @Contact( + name = "Requirements Bazaar Dev Team", + url = "http://requirements-bazaar.org", + email = "info@requirements-bazaar.org" + ), + license = @License( + name = "Apache2", + url = "http://requirements-bazaar.org/license" + ) + ), + schemes = SwaggerDefinition.Scheme.HTTPS +) +@Path("/feedback") +public class FeedbackResource { + + private BazaarService bazaarService; + + private final L2pLogger logger = L2pLogger.getInstance(CommentsResource.class.getName()); + + public FeedbackResource() throws Exception { + bazaarService = (BazaarService) Context.getCurrent().getService(); + } + + /** + * This method returns the list of feedback for a given project. + * + * @param projectId id of the project + * @param page page number + * @param perPage number of projects by page + * @return Response with comments as a JSON array. + */ + public Response getFeedbackForProject(int projectId, int page, int perPage) { + DALFacade dalFacade = null; + try { + Agent agent = Context.getCurrent().getMainAgent(); + String userId = agent.getIdentifier(); + String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); + if (registrarErrors != null) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); + } + PageInfo pageInfo = new PageInfo(page, perPage); + // Take Object for generic error handling + Set> violations = bazaarService.validate(pageInfo); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + + dalFacade = bazaarService.getDBConnection(); + //Todo use requirement's projectId for security context, not the one sent from client + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + + Project project = dalFacade.getProjectById(projectId, internalUserId); + + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_FEEDBACK, project.getId(), dalFacade); + if (!authorized) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.feedback.read")); + } + + PaginationResult feedbackResult = dalFacade.getFeedbackByProject(projectId, pageInfo); + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_43, + projectId, Activity.DataType.FEEDBACK, internalUserId); + Map> parameter = new HashMap<>(); + parameter.put("page", new ArrayList() {{ + add(String.valueOf(page)); + }}); + parameter.put("per_page", new ArrayList() {{ + add(String.valueOf(perPage)); + }}); + + Response.ResponseBuilder responseBuilder = Response.ok(); + responseBuilder = responseBuilder.entity(feedbackResult.toJSON()); + responseBuilder = bazaarService.paginationLinks(responseBuilder, feedbackResult, "project/" + String.valueOf(projectId) + "/feedbacks", parameter); + responseBuilder = bazaarService.xHeaderFields(responseBuilder, feedbackResult); + + return responseBuilder.build(); + } catch (BazaarException bex) { + if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { + return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { + return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else { + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get feedback for project " + projectId); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } + } catch (Exception ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get feedback for project " + projectId); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } finally { + bazaarService.closeDBConnection(dalFacade); + } + } + + /** + * This method allows to create a new comment. + * + * @param givenFeedback feedback as JSON object + * @return Response with the created comment as JSON object. + */ + @POST + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "This method allows to anonymously submit feedback.") + @ApiResponses(value = { + @ApiResponse(code = HttpURLConnection.HTTP_CREATED, message = "Returns the created comment", response = Feedback.class), + @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), + @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") + }) + public Response sendFeedback(@ApiParam(value = "Feedback entity", required = true) Feedback givenFeedback) { + DALFacade dalFacade = null; + try { + Agent agent = Context.getCurrent().getMainAgent(); + String userId = agent.getIdentifier(); + + dalFacade = bazaarService.getDBConnection(); + Set> violations = bazaarService.validateCreate(givenFeedback); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + + Feedback createdFeedback = dalFacade.createFeedback(givenFeedback); + return Response.status(Response.Status.CREATED).entity(createdFeedback.toJSON()).build(); + } catch (BazaarException bex) { + if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { + return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else { + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Create feedback"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } + } catch (Exception ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Create feedback"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } finally { + bazaarService.closeDBConnection(dalFacade); + } + } +} diff --git a/requirement_bazaar/src/main/resources/i18n/Translation_de.properties b/requirement_bazaar/src/main/resources/i18n/Translation_de.properties index 57caa992..e2288b8b 100644 --- a/requirement_bazaar/src/main/resources/i18n/Translation_de.properties +++ b/requirement_bazaar/src/main/resources/i18n/Translation_de.properties @@ -49,4 +49,5 @@ category.uncategorized.Description=Anforderungen welche zu keiner Projektkategor error.validation=Fehler bei der Validierung von %s festgestellt. Ihre Eingabe von %s erzeugt den Fehler\: %s. error.authorization.project.modify=Sie haben nicht das Recht dieses Projekt zu ändern. error.authorization.requirement.modify=Nur der Ersteller einer Anforderung kann eine Anforderung verändern. -error.resource.notfound=$s nicht gerunden. \ No newline at end of file +error.authorization.feedback.read=Nur Projektadmins können Feedback einsehen. +error.resource.notfound=$s nicht gefunden. diff --git a/requirement_bazaar/src/main/resources/i18n/Translation_en.properties b/requirement_bazaar/src/main/resources/i18n/Translation_en.properties index 674d9c7f..1debc732 100644 --- a/requirement_bazaar/src/main/resources/i18n/Translation_en.properties +++ b/requirement_bazaar/src/main/resources/i18n/Translation_en.properties @@ -43,6 +43,7 @@ error.authorization.attachment.create=Only project members can create attachment error.authorization.attachment.modify=Only the creator can modify attachments. error.authorization.personalisationData.read=Only logged in users can read their personal data. error.authorization.personalisationData.create=Only logged in users can write their personal data. +error.authorization.feedback.read=Only project admins can read feedback. error.unknown_exception=%s Error in %s\: %s ExceptionCode\: %d. category.uncategorized.Name=General Requirements category.uncategorized.Description=Requirements which do not belong to any category. @@ -76,4 +77,4 @@ email.subject.realized=Realized email.bodyText.news=Requirements Bazaar has news for an item you are following: email.bodyText.nextSummary=In case there is more activity on Requirements Bazaar, we will send you another notification in around %s minutes. email.bodyText.bestWishes=Best,\r\n Requirements Bazaar -email.bodyText.footer=This email was generated automatically by Requirements Bazaar.\r\nTo change your email notification settings, please log in and check your profile settings:\r\nhttps://requirements-bazaar.org \ No newline at end of file +email.bodyText.footer=This email was generated automatically by Requirements Bazaar.\r\nTo change your email notification settings, please log in and check your profile settings:\r\nhttps://requirements-bazaar.org diff --git a/requirement_bazaar/src/main/resources/migrations/V6__add_feedback.sql b/requirement_bazaar/src/main/resources/migrations/V6__add_feedback.sql new file mode 100644 index 00000000..c6afb9e0 --- /dev/null +++ b/requirement_bazaar/src/main/resources/migrations/V6__add_feedback.sql @@ -0,0 +1,10 @@ +CREATE TABLE IF NOT EXISTS reqbaz.feedback ( + id INT NOT NULL AUTO_INCREMENT, + project_id INT NOT NULL, + requirement_id INT, + creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + email VARCHAR(255), + feedback TEXT NOT NULL, + CONSTRAINT feedback_project FOREIGN KEY feedback_project (project_id) REFERENCES project (id) ON DELETE CASCADE, + CONSTRAINT feedback_pk PRIMARY KEY (id) +); diff --git a/requirement_bazaar/src/main/resources/migrations/V7__utf8mb4_conversion.sql b/requirement_bazaar/src/main/resources/migrations/V7__utf8mb4_conversion.sql new file mode 100644 index 00000000..df13e920 --- /dev/null +++ b/requirement_bazaar/src/main/resources/migrations/V7__utf8mb4_conversion.sql @@ -0,0 +1,19 @@ +alter table reqbaz.attachment convert to character set utf8mb4 collate utf8mb4_unicode_ci; +alter table reqbaz.category convert to character set utf8mb4 collate utf8mb4_unicode_ci; +alter table reqbaz.category_follower_map convert to character set utf8mb4 collate utf8mb4_unicode_ci; +alter table reqbaz.comment convert to character set utf8mb4 collate utf8mb4_unicode_ci; +alter table reqbaz.feedback convert to character set utf8mb4 collate utf8mb4_unicode_ci; +alter table reqbaz.personalisation_data convert to character set utf8mb4 collate utf8mb4_unicode_ci; +alter table reqbaz.privilege convert to character set utf8mb4 collate utf8mb4_unicode_ci; +alter table reqbaz.project convert to character set utf8mb4 collate utf8mb4_unicode_ci; +alter table reqbaz.project_follower_map convert to character set utf8mb4 collate utf8mb4_unicode_ci; +alter table reqbaz.requirement convert to character set utf8mb4 collate utf8mb4_unicode_ci; +alter table reqbaz.requirement_category_map convert to character set utf8mb4 collate utf8mb4_unicode_ci; +alter table reqbaz.requirement_developer_map convert to character set utf8mb4 collate utf8mb4_unicode_ci; +alter table reqbaz.requirement_follower_map convert to character set utf8mb4 collate utf8mb4_unicode_ci; +alter table reqbaz.role convert to character set utf8mb4 collate utf8mb4_unicode_ci; +alter table reqbaz.role_privilege_map convert to character set utf8mb4 collate utf8mb4_unicode_ci; +alter table reqbaz.role_role_map convert to character set utf8mb4 collate utf8mb4_unicode_ci; +alter table reqbaz.user convert to character set utf8mb4 collate utf8mb4_unicode_ci; +alter table reqbaz.user_role_map convert to character set utf8mb4 collate utf8mb4_unicode_ci; +alter table reqbaz.vote convert to character set utf8mb4 collate utf8mb4_unicode_ci; diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index 0c204072..b03b78bb 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -50,10 +50,10 @@ public void testCreateProject() { JsonObject response = JsonParser.parseString(result.getResponse()).getAsJsonObject(); Assert.assertTrue(response.isJsonObject()); - System.out.println(response.get("creationDate").toString()); // gson doesn't remove the quotes Assert.assertTrue(isValidISO8601(response.get("creationDate").toString().replace("\"", ""))); + } catch (Exception e) { e.printStackTrace(); Assert.fail(e.toString()); @@ -74,6 +74,99 @@ public void testGetProjects() { JsonElement response = JsonParser.parseString(result.getResponse()); System.out.println(response.toString()); Assert.assertTrue(response.isJsonArray()); + + // Now for a specific project + result = client.sendRequest("GET", mainPath + "projects/" + testProject.getId(), ""); + + Assert.assertEquals(200, result.getHttpCode()); + response = JsonParser.parseString(result.getResponse()); + System.out.println(response.toString()); + Assert.assertTrue(response.isJsonObject()); + + JsonObject jsonObject = JsonParser.parseString(result.getResponse()).getAsJsonObject(); + Assert.assertTrue(isValidISO8601(jsonObject.get("creationDate").toString().replace("\"", ""))); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(e.toString()); + } + } + + /** + * Test to create feedback for the reference project + */ + @Test + public void testCreateFeedback() { + try { + MiniClient client = getClient(); + + String testFeedback = String.format("{\"feedback\": \"Crashes all the time\", \"projectId\": %s}", testProject.getId()); + ClientResponse result = client.sendRequest("POST", mainPath + "feedback", testFeedback, + MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, new HashMap<>()); + System.out.println(result.toString()); + System.out.println("Result of 'testPost': " + result.getResponse().trim()); + Assert.assertEquals(201, result.getHttpCode()); + + JsonObject response = JsonParser.parseString(result.getResponse()).getAsJsonObject(); + Assert.assertTrue(response.isJsonObject()); + + // gson doesn't remove the quotes + Assert.assertTrue(isValidISO8601(response.get("creationDate").toString().replace("\"", ""))); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(e.toString()); + } + } + + /** + * Test to create feedback for the reference project + * but include an email in the request + */ + @Test + public void testCreateFeedbackWithMail() { + try { + MiniClient client = getClient(); + + String testFeedback = String.format("{\"feedback\": \"Crashes all the time\", \"projectId\": %s, \"email\": \"%s\"}", testProject.getId(), initUser.getEMail()); + ClientResponse result = client.sendRequest("POST", mainPath + "feedback", testFeedback, + MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, new HashMap<>()); + System.out.println(result.toString()); + System.out.println("Result of 'testPost': " + result.getResponse().trim()); + Assert.assertEquals(201, result.getHttpCode()); + + JsonObject response = JsonParser.parseString(result.getResponse()).getAsJsonObject(); + Assert.assertTrue(response.isJsonObject()); + + // gson doesn't remove the quotes + Assert.assertTrue(isValidISO8601(response.get("creationDate").toString().replace("\"", ""))); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(e.toString()); + } + } + + /** + * Test to not authorized on feedbacks + */ + @Test + public void testGetFeedbacks() { + try { + MiniClient client = getClient(); + MiniClient adminClient = getAdminClient(); + + String path = mainPath + "projects/" + testProject.getId() + "/feedbacks"; + ClientResponse result = client.sendRequest("GET", path, ""); + + System.out.println(result.getResponse()); + + Assert.assertEquals(401, result.getHttpCode()); + + result = adminClient.sendRequest("GET", path, ""); + + System.out.println(result.getResponse()); + + Assert.assertEquals(200, result.getHttpCode()); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.toString()); diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java index 378dfad7..d7ea22ea 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java @@ -1,5 +1,6 @@ package de.rwth.dbis.acis.bazaar.service; +import de.rwth.dbis.acis.bazaar.service.helpers.SetupData; import i5.las2peer.api.p2p.ServiceNameVersion; import i5.las2peer.connectors.webConnector.WebConnector; import i5.las2peer.connectors.webConnector.client.MiniClient; @@ -18,15 +19,19 @@ /** * Example Test Class demonstrating a basic JUnit test structure. */ -public abstract class TestBase { +public abstract class TestBase extends SetupData { private static final String testPass = "adamspass"; + private static final String adminPass = "evespass"; + static final String mainPath = "bazaar/"; static final String testVersion = "1.0.0"; private static LocalNode node; private static WebConnector connector; private static ByteArrayOutputStream logStream; private static UserAgentImpl testAgent; + private static UserAgentImpl adminAgent; + /** * Called before a test starts. @@ -46,6 +51,12 @@ public void startServer() throws Exception { testAgent.unlock(testPass); // agents must be unlocked in order to be stored node.storeAgent(testAgent); + // add agent to node + adminAgent = MockAgentFactory.getEve(); + adminAgent.unlock(adminPass); // agents must be unlocked in order to be stored + node.storeAgent(adminAgent); + + // start service // during testing, the specified service version does not matter node.startService(new ServiceNameVersion(BazaarService.class.getName(), testVersion), "a pass"); @@ -88,6 +99,14 @@ MiniClient getClient() { return client; } + MiniClient getAdminClient() { + MiniClient client = new MiniClient(); + client.setConnectorEndpoint(connector.getHttpEndpoint()); + + client.setLogin(adminAgent.getIdentifier(), adminPass); + return client; + } + boolean isValidISO8601(String dateStr) { DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss"); try { diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java index f8f85d8d..3bd0048d 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java @@ -21,82 +21,28 @@ package de.rwth.dbis.acis.bazaar.service.dal; import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.ProjectRecord; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Feedback; import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; import de.rwth.dbis.acis.bazaar.service.dal.entities.User; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; -import de.rwth.dbis.acis.bazaar.service.internalization.Localization; -import org.apache.commons.dbcp2.BasicDataSource; -import org.jooq.DSLContext; -import org.jooq.SQLDialect; +import de.rwth.dbis.acis.bazaar.service.helpers.SetupData; import org.junit.Assert; -import org.junit.Before; import org.junit.Test; -import javax.sql.DataSource; import java.util.List; -import java.util.Locale; -import java.util.ResourceBundle; import static junit.framework.TestCase.*; //TODO Pagination testing -public class DALFacadeTest { +public class DALFacadeTest extends SetupData { public static final PageInfo ALL_IN_ONE_PAGE = new PageInfo(0, 100); - DALFacade facade; - private DALFacadeImpl dalImpl; - DSLContext jooq; - private User initUser; - - private static DataSource setupDataSource(String dbUrl, String dbUserName, String dbPassword) { - BasicDataSource dataSource = new BasicDataSource(); - // Deprecated according to jooq - // dataSource.setDriverClassName("com.mysql.jdbc.Driver"); - dataSource.setUrl(dbUrl + "?useSSL=false&serverTimezone=UTC"); - dataSource.setUsername(dbUserName); - dataSource.setPassword(dbPassword); - dataSource.setValidationQuery("SELECT 1;"); - dataSource.setTestOnBorrow(true); // test each connection when borrowing from the pool with the validation query - dataSource.setMaxConnLifetimeMillis(1000 * 60 * 60); // max connection life time 1h. mysql drops connection after 8h. - return dataSource; - } - - @Before - public void setUp() throws Exception { - String url = "jdbc:mysql://localhost:3306/reqbaz"; - - DataSource dataSource = setupDataSource(url, "root", "rootpw"); - - dalImpl = new DALFacadeImpl(dataSource, SQLDialect.MYSQL); - facade = dalImpl; - jooq = dalImpl.getDslContext(); - - Locale locale = new Locale("en", "us"); - Localization.getInstance().setResourceBundle(ResourceBundle.getBundle("i18n.Translation", locale)); - - try { - initUser = facade.getUserById(facade.getUserIdByLAS2PeerId("1111")); - } catch (Exception e) { - initUser = User.builder() - .eMail("test@test.hu") - .firstName("Elek") - .lastName("Test") - .userName("TestElek") - .admin(true) - .las2peerId("1111") - .build(); - - facade.createUser(initUser); - initUser = facade.getUserById(facade.getUserIdByLAS2PeerId("1111")); - } - } - @Test public void testCreateUser() { try { - facade.createUser(User.builder().eMail("unittest@test.hu").firstName("Max").lastName("Zimmermann").admin(false).las2peerId("9999").userName("MaxZim").personalizationEnabled(false).emailFollowSubscription(false).emailLeadSubscription(false).build()); + facade.createUser(User.builder().eMail("unittest@test.hu").firstName("Max").lastName("Zimmermann").las2peerId("9999").userName("MaxZim").personalizationEnabled(false).emailFollowSubscription(false).emailLeadSubscription(false).build()); Integer userId = facade.getUserIdByLAS2PeerId("9999"); User user = facade.getUserById(userId); @@ -104,10 +50,9 @@ public void testCreateUser() { assertEquals("unittest@test.hu", user.getEMail()); assertEquals("Max", user.getFirstName()); assertEquals("Zimmermann", user.getLastName()); - assertFalse(user.isAdmin()); assertEquals("9999", user.getLas2peerId()); - jooq.delete(de.rwth.dbis.acis.bazaar.dal.jooq.tables.User.USER).where(de.rwth.dbis.acis.bazaar.dal.jooq.tables.User.USER.ID.eq(9)).execute(); + jooq.delete(de.rwth.dbis.acis.bazaar.dal.jooq.tables.User.USER).where(de.rwth.dbis.acis.bazaar.dal.jooq.tables.User.USER.ID.eq(userId)).execute(); } catch (Exception e) { e.printStackTrace(); @@ -117,34 +62,34 @@ public void testCreateUser() { @Test public void testGetUserById() throws Exception { - Integer userId = facade.getUserIdByLAS2PeerId("1111"); + Integer userId = facade.getUserIdByLAS2PeerId(eveId); User user = facade.getUserById(userId); assertEquals("test@test.hu", user.getEMail()); assertEquals("Elek", user.getFirstName()); assertEquals("Test", user.getLastName()); - assertTrue(user.isAdmin()); - assertEquals("1111", user.getLas2peerId()); + assertEquals(eveId, user.getLas2peerId()); } @Test public void testCreateGetProject() throws Exception { - Project project = Project.builder().name("Project3").description("ProjDesc3").id(1).leader(initUser).visibility(true).isFollower(false).build(); + Project project = Project.builder().name("Project3 \uD83D\uDC69\u200D\uD83D\uDC69\u200D\uD83D\uDC67\u200D\uD83D\uDC66").description("An \uD83D\uDE00awesome \uD83D\uDE03string with a few \uD83D\uDE09emojis!").id(1).leader(initUser).visibility(true).isFollower(false).build(); facade.createProject(project, initUser.getId()); // This can't work reliably without fetching by name // Id is set by the database but never returned - ProjectRecord projectRecord = jooq.selectFrom(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Project.PROJECT).where(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Project.PROJECT.NAME.equal("Project3")).fetchOne(); + ProjectRecord projectRecord = jooq.selectFrom(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Project.PROJECT).where(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Project.PROJECT.NAME.equal("Project3 \uD83D\uDC69\u200D\uD83D\uDC69\u200D\uD83D\uDC67\u200D\uD83D\uDC66")).fetchOne(); assertNotNull(projectRecord); Integer projectID = projectRecord.getId(); // .get(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Project.PROJECT.ID); Project projectById = facade.getProjectById(projectID, initUser.getId()); - assertEquals(project.getName(), projectById.getName() ); - assertEquals(project.getDescription(),projectById.getDescription() ); - assertEquals(project.getLeader().getId(), projectById.getLeader().getId()); - assertEquals(project.getVisibility(), projectById.getVisibility() ); + assertEquals(project.getName(), projectById.getName()); + assertEquals(project.getDescription(), projectById.getDescription()); + assertEquals("An 😀awesome 😃string with a few 😉emojis!", projectById.getDescription()); + assertEquals(project.getLeader().getId(), projectById.getLeader().getId()); + assertEquals(project.getVisibility(), projectById.getVisibility()); // Now check if this can also be found as a public project PaginationResult projectsPage = facade.listPublicProjects(new PageInfo(0, 1), initUser.getId()); @@ -160,11 +105,11 @@ public void testCreateGetProject() throws Exception { Project proj = projects.get(0); - assertEquals(projectById.getId(), proj.getId() ); - assertEquals(projectById.getName(), proj.getName() ); - assertEquals(projectById.getDescription(),proj.getDescription() ); - assertEquals(projectById.getLeader().getId(), proj.getLeader().getId()); - assertEquals(projectById.getVisibility(), proj.getVisibility() ); + assertEquals(projectById.getId(), proj.getId()); + assertEquals(projectById.getName(), proj.getName()); + assertEquals(projectById.getDescription(), proj.getDescription()); + assertEquals(projectById.getLeader().getId(), proj.getLeader().getId()); + assertEquals(projectById.getVisibility(), proj.getVisibility()); jooq.delete(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Project.PROJECT).where(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Project.PROJECT.ID.equal(project.getId())).execute(); @@ -175,6 +120,33 @@ public void testListPublicProjects() throws Exception { } + @Test + public void testFeedback() { + try { + Feedback createdFeedback = facade.createFeedback(Feedback.builder().projectId(testProject.getId()).feedback("Crashes all the time.").build()); + + assertNull(createdFeedback.getEMail()); + assertNotNull(createdFeedback.getCreationDate()); + assertEquals("Crashes all the time.", createdFeedback.getFeedback()); + assertEquals(testProject.getId(), createdFeedback.getProjectId()); + + Feedback createdFeedbackWithMail = facade.createFeedback(Feedback.builder().projectId(testProject.getId()).feedback("Crashes all the time.").eMail(initUser.getEMail()).build()); + assertEquals(initUser.getEMail(), createdFeedbackWithMail.getEMail()); + + PaginationResult feedbackPage = facade.getFeedbackByProject(testProject.getId(), new PageInfo(0, 20)); + + List feedbackByProject = feedbackPage.getElements(); + + assertNotNull(feedbackByProject); + assertEquals(2, feedbackByProject.size()); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(e.toString()); + } + + } + /* Doesn't work, searching breaks public void testModifyProject() throws Exception { //TODO diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java new file mode 100644 index 00000000..5a40ecd2 --- /dev/null +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java @@ -0,0 +1,79 @@ +package de.rwth.dbis.acis.bazaar.service.helpers; + +import de.rwth.dbis.acis.bazaar.service.dal.DALFacade; +import de.rwth.dbis.acis.bazaar.service.dal.DALFacadeImpl; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; +import de.rwth.dbis.acis.bazaar.service.dal.entities.User; +import de.rwth.dbis.acis.bazaar.service.internalization.Localization; +import org.apache.commons.dbcp2.BasicDataSource; +import org.jooq.DSLContext; +import org.jooq.SQLDialect; +import org.junit.After; +import org.junit.Before; + +import javax.sql.DataSource; +import java.util.Locale; +import java.util.ResourceBundle; + +public abstract class SetupData { + public DALFacade facade; + public DALFacadeImpl dalImpl; + public DSLContext jooq; + public User initUser; + public Project testProject; + public String eveId = "799dea0f00e126dc3493f362bddbddbc55bdfbb918fce3b12f68e1340a8ea7de7aaaa8a7af900b6ee7f849a524b18649d4ae80cb406959568f405a487f085ac7"; + + private static DataSource setupDataSource(String dbUrl, String dbUserName, String dbPassword) { + BasicDataSource dataSource = new BasicDataSource(); + // Deprecated according to jooq + // dataSource.setDriverClassName("com.mysql.jdbc.Driver"); + dataSource.setUrl(dbUrl + "?useSSL=false&serverTimezone=UTC"); + dataSource.setUsername(dbUserName); + dataSource.setPassword(dbPassword); + dataSource.setValidationQuery("SELECT 1;"); + dataSource.setTestOnBorrow(true); // test each connection when borrowing from the pool with the validation query + dataSource.setMaxConnLifetimeMillis(1000 * 60 * 60); // max connection life time 1h. mysql drops connection after 8h. + return dataSource; + } + + @Before + public void setUp() throws Exception { + String url = "jdbc:mysql://localhost:3306/reqbaz"; + + DataSource dataSource = setupDataSource(url, "root", "rootpw"); + + dalImpl = new DALFacadeImpl(dataSource, SQLDialect.MYSQL); + facade = dalImpl; + jooq = dalImpl.getDslContext(); + + Locale locale = new Locale("en", "us"); + Localization.getInstance().setResourceBundle(ResourceBundle.getBundle("i18n.Translation", locale)); + + try { + initUser = facade.getUserById(facade.getUserIdByLAS2PeerId(eveId)); + } catch (Exception e) { + initUser = User.builder() + .eMail("test@test.hu") + .firstName("Elek") + .lastName("Test") + .userName("TestElek") + .las2peerId(eveId) + .build(); + + facade.createUser(initUser); + initUser = facade.getUserById(facade.getUserIdByLAS2PeerId(eveId)); + facade.addUserToRole(initUser.getId(), "SystemAdmin", null); + } + try { + testProject = facade.getProjectById(0, initUser.getId()); + } catch (Exception e) { + testProject = Project.builder().name("ProjectTest").description("ProjDesc").leader(initUser).visibility(true).isFollower(false).build(); + testProject = facade.createProject(testProject, initUser.getId()); + } + } + + @After + public void tearDown() { + jooq.delete(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Project.PROJECT).where(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Project.PROJECT.ID.eq(testProject.getId())).execute(); + } +} From 53ccce33a01e97910ef667040b3432d5ac714db6 Mon Sep 17 00:00:00 2001 From: Thore Date: Wed, 24 Mar 2021 23:47:59 +0100 Subject: [PATCH 059/134] Rework permission management --- docs/Privileges.md | 48 ++++++++++++ .../acis/bazaar/service/BazaarService.java | 8 +- .../acis/bazaar/service/dal/DALFacade.java | 49 +++++++++--- .../bazaar/service/dal/DALFacadeImpl.java | 27 ++++++- .../bazaar/service/dal/entities/Activity.java | 3 +- .../bazaar/service/dal/entities/Category.java | 2 +- .../service/dal/entities/PrivilegeEnum.java | 5 +- .../bazaar/service/dal/entities/User.java | 9 +-- .../repositories/CategoryRepositoryImpl.java | 8 +- .../dal/repositories/RoleRepository.java | 4 +- .../dal/repositories/RoleRepositoryImpl.java | 4 +- .../resources/AttachmentsResource.java | 16 ++-- .../service/resources/CategoryResource.java | 18 +++-- .../service/resources/CommentsResource.java | 16 ++-- .../PersonalisationDataResource.java | 4 +- .../service/resources/ProjectsResource.java | 9 ++- .../resources/RequirementsResource.java | 35 +++++---- .../service/resources/UsersResource.java | 4 +- .../security/AuthorizationManager.java | 13 +--- .../migrations/V5__add_delete_constraints.sql | 1 + .../migrations/V8__new_privileges.sql | 75 +++++++++++++++++++ 21 files changed, 269 insertions(+), 89 deletions(-) create mode 100644 docs/Privileges.md create mode 100644 requirement_bazaar/src/main/resources/migrations/V8__new_privileges.sql diff --git a/docs/Privileges.md b/docs/Privileges.md new file mode 100644 index 00000000..85045ea7 --- /dev/null +++ b/docs/Privileges.md @@ -0,0 +1,48 @@ +# Privileges + +With Version 0.9 the privilege model has been extended and partially redesigned. + +## Roles +There are 6 roles, which inherit the privileges of the roles mentioned before. The `Project.*` roles are scoped to a specific project. + +1. Anonymous +2. Logged in user +3. Project Member (scoped) +4. Project Manager (scoped) +5. Project Admin (scoped) +6. System Administrator + +## Privilege Map +|name |name | +|--------------|---------------------------| +|Anonymous |Read_PUBLIC_ATTACHMENT | +|Anonymous |Read_PUBLIC_CATEGORY | +|Anonymous |Read_PUBLIC_COMMENT | +|Anonymous |Read_PUBLIC_PROJECT | +|Anonymous |Read_PUBLIC_REQUIREMENT | +|LoggedInUser |Create_ATTACHMENT | +|LoggedInUser |Create_COMMENT | +|LoggedInUser |Create_FOLLOW | +|LoggedInUser |Create_PERSONALISATION_DATA| +|LoggedInUser |Create_PROJECT | +|LoggedInUser |Create_REQUIREMENT | +|LoggedInUser |Create_VOTE | +|LoggedInUser |Delete_FOLLOW | +|LoggedInUser |Delete_VOTE | +|LoggedInUser |Read_PERSONALISATION_DATA | +|ProjectAdmin |Modify_CATEGORY | +|ProjectAdmin |Modify_PROJECT | +|ProjectManager|Create_CATEGORY | +|ProjectManager|Modify_ATTACHMENT | +|ProjectManager|Modify_COMMENT | +|ProjectManager|Modify_REQUIREMENT | +|ProjectManager|Promote_USER | +|ProjectManager|Read_FEEDBACK | +|ProjectMember |Create_DEVELOP | +|ProjectMember |Delete_DEVELOP | +|ProjectMember |Read_ATTACHMENT | +|ProjectMember |Read_CATEGORY | +|ProjectMember |Read_COMMENT | +|ProjectMember |Read_PROJECT | +|ProjectMember |Read_REQUIREMENT | +|ProjectMember |Realize_REQUIREMENT | diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java index 9941879e..2695dc7c 100755 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java @@ -39,6 +39,7 @@ import de.rwth.dbis.acis.bazaar.service.notification.EmailDispatcher; import de.rwth.dbis.acis.bazaar.service.notification.NotificationDispatcher; import de.rwth.dbis.acis.bazaar.service.notification.NotificationDispatcherImp; +import de.rwth.dbis.acis.bazaar.service.resources.*; import de.rwth.dbis.acis.bazaar.service.security.AuthorizationManager; import i5.las2peer.api.Context; import i5.las2peer.api.ManualDeployment; @@ -114,6 +115,7 @@ protected void initResources() { getResourceConfig().register(AttachmentsResource.class); getResourceConfig().register(UsersResource.class); getResourceConfig().register(PersonalisationDataResource.class); + getResourceConfig().register(FeedbackResource.class); } public BazaarService() throws Exception { @@ -356,7 +358,6 @@ private void registerUserAtFirstLogin() throws Exception { // create user User user = User.builder() .eMail(email) - .admin(false) .las2peerId(agent.getIdentifier()) .userName(loginName) .profileImage(profileImage) @@ -367,7 +368,7 @@ private void registerUserAtFirstLogin() throws Exception { user = dalFacade.createUser(user); int userId = user.getId(); // this.getNotificationDispatcher().dispatchNotification(user.getCreationDate(), Activity.ActivityAction.CREATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_55, userId, Activity.DataType.USER, userId); - dalFacade.addUserToRole(userId, "SystemAdmin", null); + dalFacade.addUserToRole(userId, "LoggedInUser", null); } else { // update lastLoginDate dalFacade.updateLastLoginDate(userIdByLAS2PeerId); @@ -384,7 +385,8 @@ public static DataSource setupDataSource(String dbUrl, String dbUserName, String BasicDataSource dataSource = new BasicDataSource(); // Deprecated according to jooq // dataSource.setDriverClassName("com.mysql.jdbc.Driver"); - dataSource.setUrl(dbUrl + "?useSSL=false&serverTimezone=UTC"); + dataSource.setUrl(dbUrl + "?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true" + + ""); dataSource.setUsername(dbUserName); dataSource.setPassword(dbPassword); dataSource.setValidationQuery("SELECT 1;"); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java index 0d7c237b..573f94ca 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java @@ -249,7 +249,7 @@ public interface DALFacade { PaginationResult listRequirementsByCategory(int categoryId, Pageable pageable, int userId) throws BazaarException; /** - * @param pageable pagination information + * @param pageable pagination information * @param userId * @return the requirements filtered by pageable */ @@ -452,14 +452,14 @@ public interface DALFacade { PaginationResult listCommentsByRequirementId(int requirementId, Pageable pageable) throws BazaarException; /** - * @param pageable pagination information + * @param pageable pagination information * @return the set of comments */ PaginationResult listAllComments(Pageable pageable) throws BazaarException; /** - * @param userId the identifier of user we are looking at - * @param pageable pagination information + * @param userId the identifier of user we are looking at + * @param pageable pagination information * @return the answers for a given user */ PaginationResult listAllAnswers(Pageable pageable, int userId) throws BazaarException; @@ -576,35 +576,66 @@ public interface DALFacade { * @param userId the identifier of the user * @return all the roles filled up with parents and permissions */ - List getRolesByUserId(int userId, String context) throws BazaarException; + List getRolesByUserId(int userId, Integer context) throws BazaarException; List getParentsForRole(int roleId) throws BazaarException; void createPrivilegeIfNotExists(PrivilegeEnum privilege) throws BazaarException; - void addUserToRole(int userId, String roleName, String context) throws BazaarException; + void addUserToRole(int userId, String roleName, Integer context) throws BazaarException; //endregion - /** * Receives the PersonalisationData for a given userid, key and version - * @param userId which owns the personalisationData. - * @param key which identifies the personalisationData. + * + * @param userId which owns the personalisationData. + * @param key which identifies the personalisationData. * @param version of the key's plugin */ PersonalisationData getPersonalisationData(int userId, String key, int version) throws BazaarException; + /** * Creates a new record or alters the existing record to save a given personalisationData + * * @param personalisationData which holds the data to be saved */ void setPersonalisationData(PersonalisationData personalisationData) throws BazaarException; /** * Creates an Entity-Overview for a given user + * * @param includes List of entities to include values: [projects, categories, requirements] * @param pageable Used for search-term, filters and sorting * @param userId userId for privilege-check */ EntityOverview getEntitiesForUser(List includes, Pageable pageable, int userId) throws BazaarException; + + /** + * Creates a new feedback item + * + * @param feedback the feedback to create (as submitted by the api) + * @return the created feedback item + * @throws BazaarException + */ + Feedback createFeedback(Feedback feedback) throws Exception; + + /** + * Returns the feedback for a project + * + * @param projectId Project to look for + * @param pageable a pageable + * @return Pageable with the feedback for this project + * @throws BazaarException + */ + PaginationResult getFeedbackByProject(int projectId, Pageable pageable) throws BazaarException; + + /** + * Allows to retrieve a single feedback item + * + * @param feedbackId ID of the feedback item + * @return the requested feedback item + * @throws Exception + */ + Feedback getFeedbackById(int feedbackId) throws Exception; } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index c23b6fe6..a0cc9891 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -64,6 +64,7 @@ public class DALFacadeImpl implements DALFacade { private RoleRepository roleRepository; private PrivilegeRepository privilegeRepository; private PersonalisationDataRepository personalisationDataRepository; + private FeedbackRepository feedbackRepository; public DALFacadeImpl(DataSource dataSource, SQLDialect dialect) { dslContext = DSL.using(dataSource, dialect); @@ -211,7 +212,7 @@ public Project createProject(Project project, int userId) throws Exception { .description(categoryDescription) .projectId(newProject.getId()) .build(); - uncategorizedCategory.setLeader(project.getLeader()); + uncategorizedCategory.setCreator(project.getLeader()); Category defaultCategory = createCategory(uncategorizedCategory, userId); newProject.setDefaultCategoryId(defaultCategory.getId()); // TODO: concurrency transaction -> https://www.jooq.org/doc/3.9/manual/sql-execution/transaction-management/ @@ -485,6 +486,7 @@ public PaginationResult listAllComments(Pageable pageable) throws Bazaa commentRepository = (commentRepository != null) ? commentRepository : new CommentRepositoryImpl(dslContext); return commentRepository.findAllComments(pageable); } + @Override public PaginationResult listAllAnswers(Pageable pageable, int userId) throws BazaarException { commentRepository = (commentRepository != null) ? commentRepository : new CommentRepositoryImpl(dslContext); @@ -617,7 +619,7 @@ public boolean hasUserVotedForRequirement(int userId, int requirementId) throws } @Override - public List getRolesByUserId(int userId, String context) throws BazaarException { + public List getRolesByUserId(int userId, Integer context) throws BazaarException { roleRepository = (roleRepository != null) ? roleRepository : new RoleRepositoryImpl(dslContext); return roleRepository.listRolesOfUser(userId, context); } @@ -640,15 +642,17 @@ public void createPrivilegeIfNotExists(PrivilegeEnum privilege) throws BazaarExc } @Override - public void addUserToRole(int userId, String roleName, String context) throws BazaarException { + public void addUserToRole(int userId, String roleName, Integer context) throws BazaarException { roleRepository = (roleRepository != null) ? roleRepository : new RoleRepositoryImpl(dslContext); roleRepository.addUserToRole(userId, roleName, context); } + @Override public PersonalisationData getPersonalisationData(int userId, String key, int version) throws BazaarException { personalisationDataRepository = (personalisationDataRepository != null) ? personalisationDataRepository : new PersonalisationDataRepositoryImpl(dslContext); return personalisationDataRepository.findByKey(userId,version,key); } + @Override public void setPersonalisationData(PersonalisationData personalisationData) throws BazaarException { personalisationDataRepository = (personalisationDataRepository != null) ? personalisationDataRepository : new PersonalisationDataRepositoryImpl(dslContext); @@ -678,7 +682,24 @@ public EntityOverview getEntitiesForUser(List includes, Pageable pageabl //TODO Add Comments/Attachments } return result.build(); + } + + @Override + public Feedback createFeedback(Feedback feedback) throws Exception { + feedbackRepository = (feedbackRepository != null) ? feedbackRepository : new FeedbackRepositoryImpl(dslContext); + Feedback newFeedback = feedbackRepository.add(feedback); + return feedbackRepository.findById(newFeedback.getId()); + } + @Override + public PaginationResult getFeedbackByProject(int projectId, Pageable pageable) throws BazaarException { + feedbackRepository = (feedbackRepository != null) ? feedbackRepository : new FeedbackRepositoryImpl(dslContext); + return feedbackRepository.findAllByProject(projectId, pageable); } + @Override + public Feedback getFeedbackById(int feedbackId) throws Exception { + feedbackRepository = (feedbackRepository != null) ? feedbackRepository : new FeedbackRepositoryImpl(dslContext); + return feedbackRepository.findById(feedbackId); + } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java index e2ca859e..016f1372 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java @@ -46,7 +46,8 @@ public enum DataType { REQUIREMENT, COMMENT, ATTACHMENT, - USER + USER, + FEEDBACK } public enum ActivityAction { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java index 8b80b8e3..0f04fc48 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java @@ -56,7 +56,7 @@ public class Category extends EntityBase { @Min(value = 0, groups = CreateValidation.class) private int projectId; - private User leader; + private User creator; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") private LocalDateTime creationDate; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java index c523e197..ed75afd9 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java @@ -38,6 +38,7 @@ public enum PrivilegeEnum { Read_REQUIREMENT, Read_PUBLIC_REQUIREMENT, Modify_REQUIREMENT, + Realize_REQUIREMENT, Create_COMMENT, Read_COMMENT, @@ -53,5 +54,7 @@ public enum PrivilegeEnum { Create_FOLLOW, Delete_FOLLOW, Create_DEVELOP, Delete_DEVELOP, - Read_PERSONALISATION_DATA, Create_PERSONALISATION_DATA //Create covers "PUT" Operation + Read_PERSONALISATION_DATA, Create_PERSONALISATION_DATA, //Create covers "PUT" Operation + + Read_FEEDBACK } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java index e9bbfab5..6f713a1a 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java @@ -54,9 +54,6 @@ public class User extends EntityBase { @Size(min = 1, max = 1000, message = "eMail must have between 1 and 1000 characters") private transient String eMail; - @JsonIgnore - private Boolean admin; - @NotNull(message = "las2peerId can't be null") @Size(min = 1, max = 1000, message = "las2peerId must have between 1 and 1000 characters") private String las2peerId; @@ -82,11 +79,7 @@ public class User extends EntityBase { public String getEMail() { return eMail; } - - public Boolean isAdmin() { - return admin; - } - + public Boolean isEmailLeadSubscription() { return emailLeadSubscription != null && emailLeadSubscription; } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java index 066099b7..ec2dcfb8 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java @@ -147,7 +147,7 @@ public Category findById(int id, int userId) throws BazaarException { UserTransformer userTransformer = new UserTransformer(); //Filling up LeadDeveloper - builder.leader(userTransformer.getEntityFromQueryResult(leaderUser, queryResult)); + builder.creator(userTransformer.getEntityFromQueryResult(leaderUser, queryResult)); category = builder.build(); @@ -206,7 +206,7 @@ public PaginationResult findByProjectId(int projectId, Pageable pageab Category category = transformer.getEntityFromTableRecord(categoryRecord); UserTransformer userTransformer = new UserTransformer(); UserRecord userRecord = queryResult.into(leaderUser); - category.setLeader(userTransformer.getEntityFromTableRecord(userRecord)); + category.setCreator(userTransformer.getEntityFromTableRecord(userRecord)); category.setNumberOfRequirements((Integer) queryResult.getValue(REQUIREMENT_COUNT)); category.setNumberOfFollowers((Integer) queryResult.getValue(FOLLOWER_COUNT)); if (userId != 1) { @@ -273,7 +273,7 @@ public PaginationResult findAll(Pageable pageable, int userId) throws Category category = transformer.getEntityFromTableRecord(categoryRecord); UserTransformer userTransformer = new UserTransformer(); UserRecord userRecord = queryResult.into(leaderUser); - category.setLeader(userTransformer.getEntityFromTableRecord(userRecord)); + category.setCreator(userTransformer.getEntityFromTableRecord(userRecord)); category.setNumberOfRequirements((Integer) queryResult.getValue(requirementCount)); category.setNumberOfFollowers((Integer) queryResult.getValue(followerCount)); if (userId != 1) { @@ -351,7 +351,7 @@ public PaginationResult findByRequirementId(int requirementId, Pageabl Category category = transformer.getEntityFromTableRecord(categoryRecord); UserTransformer userTransformer = new UserTransformer(); UserRecord userRecord = queryResult.into(leaderUser); - category.setLeader(userTransformer.getEntityFromTableRecord(userRecord)); + category.setCreator(userTransformer.getEntityFromTableRecord(userRecord)); category.setNumberOfRequirements((Integer) queryResult.getValue(REQUIREMENT_COUNT)); category.setNumberOfFollowers((Integer) queryResult.getValue(FOLLOWER_COUNT)); if (userId != 1) { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java index 47d02ba7..0b28d008 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java @@ -31,9 +31,9 @@ public interface RoleRepository extends Repository { List listParentsForRole(int roleId) throws BazaarException; - List listRolesOfUser(int userId, String context) throws BazaarException; + List listRolesOfUser(int userId, Integer context) throws BazaarException; - void addUserToRole(int userId, String roleName, String context) throws BazaarException; + void addUserToRole(int userId, String roleName, Integer context) throws BazaarException; Role findByRoleName(String roleName) throws BazaarException; } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java index a8f6db52..c294d2aa 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java @@ -49,7 +49,7 @@ public RoleRepositoryImpl(DSLContext jooq) { } @Override - public List listRolesOfUser(int userId, String context) throws BazaarException { + public List listRolesOfUser(int userId, Integer context) throws BazaarException { List roles = null; try { @@ -75,7 +75,7 @@ public List listRolesOfUser(int userId, String context) throws BazaarExcep } @Override - public void addUserToRole(int userId, String roleName, String context) throws BazaarException { + public void addUserToRole(int userId, String roleName, Integer context) throws BazaarException { Role role = findByRoleName(roleName); UserRoleMapRecord record = new UserRoleMapRecord(); record.setRoleId(role.getId()); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/AttachmentsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/AttachmentsResource.java index 78ecf064..09c12275 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/AttachmentsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/AttachmentsResource.java @@ -1,5 +1,7 @@ -package de.rwth.dbis.acis.bazaar.service; +package de.rwth.dbis.acis.bazaar.service.resources; +import de.rwth.dbis.acis.bazaar.service.BazaarFunction; +import de.rwth.dbis.acis.bazaar.service.BazaarService; import de.rwth.dbis.acis.bazaar.service.dal.DALFacade; import de.rwth.dbis.acis.bazaar.service.dal.entities.*; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; @@ -83,12 +85,12 @@ public Response getAttachmentsForRequirement(int requirementId, int page, int pe bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_44, requirement.getId(), Activity.DataType.REQUIREMENT, internalUserId); if (dalFacade.isRequirementPublic(requirementId)) { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_COMMENT, String.valueOf(project.getId()), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_COMMENT, project.getId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.anonymous")); } } else { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_COMMENT, String.valueOf(project.getId()), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_COMMENT, project.getId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.comment.read")); } @@ -161,12 +163,12 @@ public Response getAttachment(@PathParam("attachmentId") int attachmentId) { bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_49, attachment.getId(), Activity.DataType.ATTACHMENT, internalUserId); if (dalFacade.isProjectPublic(requirement.getProjectId())) { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_ATTACHMENT, String.valueOf(requirement.getProjectId()), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_ATTACHMENT, requirement.getProjectId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.anonymous")); } } else { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_ATTACHMENT, String.valueOf(requirement.getProjectId()), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_ATTACHMENT, requirement.getProjectId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.attachment.read")); } @@ -223,7 +225,7 @@ public Response createAttachment(@ApiParam(value = "Attachment entity as JSON", dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Requirement requirement = dalFacade.getRequirementById(attachmentToCreate.getRequirementId(), internalUserId); - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Create_ATTACHMENT, String.valueOf(requirement.getProjectId()), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Create_ATTACHMENT, requirement.getProjectId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.attachment.create")); } @@ -278,7 +280,7 @@ public Response deleteAttachment(@PathParam("attachmentId") int attachmentId) { dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Requirement requirement = dalFacade.getRequirementById(attachmentId, internalUserId); - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_ATTACHMENT, Arrays.asList(String.valueOf(attachmentId), String.valueOf(requirement.getProjectId())), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_ATTACHMENT, requirement.getProjectId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.attachment.modify")); } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CategoryResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CategoryResource.java index 88f4ab05..aaf19b90 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CategoryResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CategoryResource.java @@ -1,5 +1,7 @@ -package de.rwth.dbis.acis.bazaar.service; +package de.rwth.dbis.acis.bazaar.service.resources; +import de.rwth.dbis.acis.bazaar.service.BazaarFunction; +import de.rwth.dbis.acis.bazaar.service.BazaarService; import de.rwth.dbis.acis.bazaar.service.dal.DALFacade; import de.rwth.dbis.acis.bazaar.service.dal.entities.*; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; @@ -94,12 +96,12 @@ public Response getCategoriesForProject(int projectId, int page, int perPage, St ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.NOT_FOUND, String.format(Localization.getInstance().getResourceBundle().getString("error.resource.notfound"), "category")); } if (dalFacade.isProjectPublic(projectId)) { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_CATEGORY, String.valueOf(projectId), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_CATEGORY, projectId, dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.anonymous")); } } else { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_CATEGORY, String.valueOf(projectId), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_CATEGORY, projectId, dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.category.read")); } @@ -178,12 +180,12 @@ public Response getCategory(@PathParam("categoryId") int categoryId) { bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_15, categoryId, Activity.DataType.CATEGORY, internalUserId); if (dalFacade.isCategoryPublic(categoryId)) { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_CATEGORY, String.valueOf(categoryId), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_CATEGORY, categoryToReturn.getProjectId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.anonymous")); } } else { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_CATEGORY, String.valueOf(categoryId), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_CATEGORY, categoryToReturn.getProjectId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.category.read")); } @@ -242,11 +244,11 @@ public Response createCategory(@ApiParam(value = "Category entity", required = t dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Create_CATEGORY, String.valueOf(categoryToCreate.getProjectId()), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Create_CATEGORY, categoryToCreate.getProjectId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.category.create")); } - categoryToCreate.setLeader(dalFacade.getUserById(internalUserId)); + categoryToCreate.setCreator(dalFacade.getUserById(internalUserId)); Category createdCategory = dalFacade.createCategory(categoryToCreate, internalUserId); bazaarService.getNotificationDispatcher().dispatchNotification(createdCategory.getCreationDate(), Activity.ActivityAction.CREATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_16, createdCategory.getId(), Activity.DataType.CATEGORY, internalUserId); @@ -364,7 +366,7 @@ public Response deleteCategory(@PathParam("categoryId") int categoryId) { Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Category categoryToDelete = dalFacade.getCategoryById(categoryId, internalUserId); Project project = dalFacade.getProjectById(categoryToDelete.getProjectId(), internalUserId); - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_CATEGORY, String.valueOf(project.getId()), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_CATEGORY, project.getId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.category.modify")); } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java index 32b680e4..9d2455dd 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java @@ -1,5 +1,7 @@ -package de.rwth.dbis.acis.bazaar.service; +package de.rwth.dbis.acis.bazaar.service.resources; +import de.rwth.dbis.acis.bazaar.service.BazaarFunction; +import de.rwth.dbis.acis.bazaar.service.BazaarService; import de.rwth.dbis.acis.bazaar.service.dal.DALFacade; import de.rwth.dbis.acis.bazaar.service.dal.entities.*; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; @@ -200,12 +202,12 @@ public Response getCommentsForRequirement(int requirementId, int page, int perPa Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); Project project = dalFacade.getProjectById(requirement.getProjectId(), internalUserId); if (dalFacade.isRequirementPublic(requirementId)) { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_COMMENT, String.valueOf(project.getId()), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_COMMENT, project.getId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.anonymous")); } } else { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_COMMENT, String.valueOf(project.getId()), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_COMMENT, project.getId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.comment.read")); } @@ -279,12 +281,12 @@ public Response getComment(@PathParam("commentId") int commentId) { bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_45, commentId, Activity.DataType.COMMENT, internalUserId); if (dalFacade.isProjectPublic(requirement.getProjectId())) { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_COMMENT, String.valueOf(requirement.getProjectId()), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_COMMENT, requirement.getProjectId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.anonymous")); } } else { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_COMMENT, String.valueOf(requirement.getProjectId()), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_COMMENT, requirement.getProjectId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.comment.read")); } @@ -341,7 +343,7 @@ public Response createComment(@ApiParam(value = "Comment entity", required = tru dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Requirement requirement = dalFacade.getRequirementById(commentToCreate.getRequirementId(), internalUserId); - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Create_COMMENT, String.valueOf(requirement.getProjectId()), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Create_COMMENT, requirement.getProjectId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.comment.create")); } @@ -403,7 +405,7 @@ public Response deleteComment(@PathParam("commentId") int commentId) { Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Comment commentToDelete = dalFacade.getCommentById(commentId); Requirement requirement = dalFacade.getRequirementById(commentToDelete.getRequirementId(), internalUserId); - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_COMMENT, Arrays.asList(String.valueOf(commentId), String.valueOf(requirement.getProjectId())), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_COMMENT, requirement.getProjectId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.comment.modify")); } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/PersonalisationDataResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/PersonalisationDataResource.java index 9f5c28f0..b1b81085 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/PersonalisationDataResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/PersonalisationDataResource.java @@ -1,5 +1,7 @@ -package de.rwth.dbis.acis.bazaar.service; +package de.rwth.dbis.acis.bazaar.service.resources; +import de.rwth.dbis.acis.bazaar.service.BazaarFunction; +import de.rwth.dbis.acis.bazaar.service.BazaarService; import de.rwth.dbis.acis.bazaar.service.dal.DALFacade; import de.rwth.dbis.acis.bazaar.service.dal.entities.PersonalisationData; import de.rwth.dbis.acis.bazaar.service.dal.entities.PrivilegeEnum; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java index a1b2f763..07426c26 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java @@ -1,5 +1,7 @@ -package de.rwth.dbis.acis.bazaar.service; +package de.rwth.dbis.acis.bazaar.service.resources; +import de.rwth.dbis.acis.bazaar.service.BazaarFunction; +import de.rwth.dbis.acis.bazaar.service.BazaarService; import de.rwth.dbis.acis.bazaar.service.dal.DALFacade; import de.rwth.dbis.acis.bazaar.service.dal.entities.*; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; @@ -184,12 +186,12 @@ public Response getProject(@PathParam("projectId") int projectId) { dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); if (dalFacade.isProjectPublic(projectId)) { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_PROJECT, String.valueOf(projectId), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_PROJECT, projectId, dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.anonymous")); } } else { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PROJECT, String.valueOf(projectId), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PROJECT, projectId, dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.category.read")); } @@ -256,6 +258,7 @@ public Response createProject(@ApiParam(value = "Project entity", required = tru } projectToCreate.setLeader(dalFacade.getUserById(internalUserId)); Project createdProject = dalFacade.createProject(projectToCreate, internalUserId); + dalFacade.addUserToRole(internalUserId, "ProjectAdmin", createdProject.getId()); bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.CREATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_5, createdProject.getId(), Activity.DataType.PROJECT, internalUserId); return Response.status(Response.Status.CREATED).entity(createdProject.toJSON()).build(); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java index b8d95524..e20a8866 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java @@ -1,5 +1,7 @@ -package de.rwth.dbis.acis.bazaar.service; +package de.rwth.dbis.acis.bazaar.service.resources; +import de.rwth.dbis.acis.bazaar.service.BazaarFunction; +import de.rwth.dbis.acis.bazaar.service.BazaarService; import de.rwth.dbis.acis.bazaar.service.dal.DALFacade; import de.rwth.dbis.acis.bazaar.service.dal.entities.*; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; @@ -207,12 +209,12 @@ public Response getRequirementsForProject(int projectId, int page, int perPage, ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.NOT_FOUND, String.format(Localization.getInstance().getResourceBundle().getString("error.resource.notfound"), "resource")); } if (dalFacade.isProjectPublic(projectId)) { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_REQUIREMENT, String.valueOf(projectId), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_REQUIREMENT, projectId, dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.anonymous")); } } else { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_REQUIREMENT, String.valueOf(projectId), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_REQUIREMENT, projectId, dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.category.read")); } @@ -307,12 +309,12 @@ public Response getRequirementsForCategory(int categoryId, int page, int perPage Category category = dalFacade.getCategoryById(categoryId, internalUserId); Project project = dalFacade.getProjectById(category.getProjectId(), internalUserId); if (dalFacade.isCategoryPublic(categoryId)) { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_REQUIREMENT, String.valueOf(project.getId()), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_REQUIREMENT, project.getId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.anonymous")); } } else { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_REQUIREMENT, String.valueOf(project.getId()), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_REQUIREMENT, project.getId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.category.read")); } @@ -400,12 +402,12 @@ public Response getRequirement(@PathParam("requirementId") int requirementId) { bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_25, requirementId, Activity.DataType.REQUIREMENT, internalUserId); if (dalFacade.isRequirementPublic(requirementId)) { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_REQUIREMENT, String.valueOf(requirement.getProjectId()), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_REQUIREMENT, requirement.getProjectId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.anonymous")); } } else { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_REQUIREMENT, String.valueOf(requirement.getProjectId()), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_REQUIREMENT, requirement.getProjectId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.category.read")); } @@ -452,14 +454,18 @@ public Response createRequirement(@ApiParam(value = "Requirement entity", requir try { Agent agent = Context.getCurrent().getMainAgent(); String userId = agent.getIdentifier(); + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); if (registrarErrors != null) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); } - // TODO: check whether the current user may create a new requirement dalFacade = bazaarService.getDBConnection(); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Create_REQUIREMENT, requirementToCreate.getProjectId(), dalFacade); + if (!authorized) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.requirement.create")); + } - Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); requirementToCreate.setCreator(dalFacade.getUserById(internalUserId)); // Take Object for generic error handling Set> violations = bazaarService.validateCreate(requirementToCreate); @@ -472,10 +478,6 @@ public Response createRequirement(@ApiParam(value = "Requirement entity", requir ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.VALIDATION, "Category does not fit with project"); } } - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Create_REQUIREMENT, String.valueOf(requirementToCreate.getProjectId()), dalFacade); - if (!authorized) { - ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.requirement.create")); - } Requirement createdRequirement = dalFacade.createRequirement(requirementToCreate, internalUserId); // check if attachments are given @@ -607,7 +609,7 @@ public Response deleteRequirement(@PathParam("requirementId") int requirementId) Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Requirement requirementToDelete = dalFacade.getRequirementById(requirementId, internalUserId); Project project = dalFacade.getProjectById(requirementToDelete.getProjectId(), internalUserId); - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_REQUIREMENT, Arrays.asList(String.valueOf(project.getId()), String.valueOf(requirementId)), dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_REQUIREMENT, project.getId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.requirement.delete")); } @@ -1126,11 +1128,12 @@ public Response realize(@PathParam("requirementId") int requirementId) { } dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_REQUIREMENT, dalFacade); + Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Realize_REQUIREMENT, requirement.getProjectId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.vote.create")); } - Requirement requirement = dalFacade.setRequirementToRealized(requirementId, internalUserId); + requirement = dalFacade.setRequirementToRealized(requirementId, internalUserId); bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.REALIZE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_37, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.status(Response.Status.CREATED).entity(requirement.toJSON()).build(); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java index b75340f7..5c0c23f8 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java @@ -1,5 +1,7 @@ -package de.rwth.dbis.acis.bazaar.service; +package de.rwth.dbis.acis.bazaar.service.resources; +import de.rwth.dbis.acis.bazaar.service.BazaarFunction; +import de.rwth.dbis.acis.bazaar.service.BazaarService; import de.rwth.dbis.acis.bazaar.service.dal.DALFacade; import de.rwth.dbis.acis.bazaar.service.dal.entities.Activity; import de.rwth.dbis.acis.bazaar.service.dal.entities.EntityOverview; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java index 00e704eb..40c1b0fa 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java @@ -34,17 +34,6 @@ */ public class AuthorizationManager { - public boolean isAuthorized(int userId, PrivilegeEnum privilege, List contexts, DALFacade facade) throws BazaarException { - for (String context : contexts) { - List userRoles = facade.getRolesByUserId(userId, context); - boolean authorized = isAuthorized(userRoles, privilege, facade); - if (authorized) - return true; - } - - return false; - } - public boolean isAuthorized(int userId, PrivilegeEnum privilege, DALFacade facade) throws BazaarException { List userRoles = facade.getRolesByUserId(userId, null); @@ -52,7 +41,7 @@ public boolean isAuthorized(int userId, PrivilegeEnum privilege, DALFacade facad } - public boolean isAuthorized(int userId, PrivilegeEnum privilege, String context, DALFacade facade) throws BazaarException { + public boolean isAuthorized(int userId, PrivilegeEnum privilege, Integer context, DALFacade facade) throws BazaarException { List userRoles = facade.getRolesByUserId(userId, context); return isAuthorized(userRoles, privilege, facade); diff --git a/requirement_bazaar/src/main/resources/migrations/V5__add_delete_constraints.sql b/requirement_bazaar/src/main/resources/migrations/V5__add_delete_constraints.sql index ad972185..18245134 100644 --- a/requirement_bazaar/src/main/resources/migrations/V5__add_delete_constraints.sql +++ b/requirement_bazaar/src/main/resources/migrations/V5__add_delete_constraints.sql @@ -12,3 +12,4 @@ ALTER TABLE reqbaz.project ALTER TABLE reqbaz.project ADD CONSTRAINT project_category FOREIGN KEY project_category (default_category_id) REFERENCES category (id) ON DELETE CASCADE; +SET FOREIGN_KEY_CHECKS = 1; diff --git a/requirement_bazaar/src/main/resources/migrations/V8__new_privileges.sql b/requirement_bazaar/src/main/resources/migrations/V8__new_privileges.sql new file mode 100644 index 00000000..2043b288 --- /dev/null +++ b/requirement_bazaar/src/main/resources/migrations/V8__new_privileges.sql @@ -0,0 +1,75 @@ +REPLACE INTO reqbaz.privilege +(id, name) +VALUES +(29, 'Read_FEEDBACK'), +(31, 'Promote_USER'), +(32, 'Realize_REQUIREMENT'); + +REPLACE INTO reqbaz.role +(id, name) +VALUES +(5, 'ProjectManager'), +(6, 'ProjectMember'); + +TRUNCATE TABLE reqbaz.role_privilege_map; +# This ist quite difficult to read +# For more info see the privileges documentation +# or run this query: +# SELECT rpm.id, r.name, p.name, p.id FROM reqbaz.role_privilege_map rpm JOIN reqbaz.role AS r on r.id = rpm.role_id JOIN reqbaz.privilege AS p ON p.id = rpm.privilege_id order by r.name asc, p.name asc; +INSERT INTO reqbaz.role_privilege_map +(role_id, privilege_id) +VALUES +(1, 3), +(1, 7), +(1, 11), +(1, 15), +(1, 19), + +(2, 1), +(2, 9), +(2, 13), +(2, 17), +(2, 21), +(2, 22), +(2, 23), +(2, 24), +(2, 27), +(2, 28), + +(3, 4), +(3, 8), + +(5, 29), +(5, 31), +(5, 12), +(5, 16), +(5, 20), +(5, 5), + +(6, 2), +(6, 6), +(6, 25), +(6, 26), +(6, 18), +(6, 14), +(6, 10), +(6, 32); + +TRUNCATE TABLE reqbaz.role_role_map; +INSERT INTO reqbaz.role_role_map +(child_id, parent_id) +VALUES +(4, 3), +(3, 5), +(5, 6), +(6, 2), +(2, 1); + +ALTER TABLE reqbaz.user_role_map + MODIFY context_info INT; + +ALTER TABLE reqbaz.user_role_map + ADD CONSTRAINT role_project_context FOREIGN KEY role_project_context (context_info) REFERENCES project (id) + ON DELETE CASCADE; + +ALTER TABLE reqbaz.user DROP COLUMN admin; From 07c9fd22554bb3cc38045ef5db8e2663947d7407 Mon Sep 17 00:00:00 2001 From: Thore Date: Thu, 25 Mar 2021 15:53:03 +0100 Subject: [PATCH 060/134] Upgrade gradle to 6.8.3 --- gradle/wrapper/gradle-wrapper.properties | 2 +- requirement_bazaar/build.gradle | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index be52383e..442d9132 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/requirement_bazaar/build.gradle b/requirement_bazaar/build.gradle index bbf90a3e..e3ed57df 100644 --- a/requirement_bazaar/build.gradle +++ b/requirement_bazaar/build.gradle @@ -149,10 +149,6 @@ jooq { name = 'org.jooq.meta.mysql.MySQLDatabase' inputSchema = "${project.property('db.name')}" forcedTypes { - forcedType { - name = 'BOOLEAN' - includeExpression = ".*\\.admin" - } } } generate { From 0b2c4b499920cfd6519a25f9d0edeb64ca979d58 Mon Sep 17 00:00:00 2001 From: Thore Date: Thu, 25 Mar 2021 16:09:52 +0100 Subject: [PATCH 061/134] update dependencies --- CHANGELOG.md | 4 ++++ gradle.properties | 5 ++--- requirement_bazaar/build.gradle | 7 ++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbdcf9aa..31aeb570 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas ### Added - Added new testcases [#73](https://github.com/rwth-acis/RequirementsBazaar/pull/73) +- Added endpoints to provide anonymous feedback which can be read by project + admins [#85](https://github.com/rwth-acis/RequirementsBazaar/pull/85) ### Changed @@ -33,6 +35,8 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas - Order by name now implies natural sorting [#82](https://github.com/rwth-acis/RequirementsBazaar/pull/82) - Remove static code from data classes and generate getter/setters and builder with lombok. This renames the `category` attribute in `EntityContext` to `categories` [#83](https://github.com/rwth-acis/RequirementsBazaar/pull/82) +- Rework permission system as lined out + in [Privileges](docs/Privileges.md) [#85](https://github.com/rwth-acis/RequirementsBazaar/pull/85) ## [0.7.2] - 2017-10-25 diff --git a/gradle.properties b/gradle.properties index 00d413a3..cc11e065 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,14 +1,13 @@ org.gradle.parallel=true java.version=14 -core.version=1.1.0 +core.version=1.1.1 service.version=0.9.0 service.name=de.rwth.dbis.acis.bazaar.service service.class=BazaarService - jooq.version=3.14.4 -mysql.version=8.0.22 +mysql.version=8.0.23 db.port=3306 db.hostname=localhost diff --git a/requirement_bazaar/build.gradle b/requirement_bazaar/build.gradle index e3ed57df..4d996d69 100644 --- a/requirement_bazaar/build.gradle +++ b/requirement_bazaar/build.gradle @@ -18,9 +18,10 @@ plugins { id 'java' id 'application' id 'idea' - id "org.flywaydb.flyway" version "7.3.2" - id "nu.studer.jooq" version "5.2" + id "org.flywaydb.flyway" version "7.7.1" + id "nu.studer.jooq" version "5.2.1" id "io.freefair.lombok" version "5.3.0" + id 'com.github.ben-manes.versions' version '0.38.0' } application { @@ -62,7 +63,7 @@ dependencies { jooqGenerator "mysql:mysql-connector-java:${project.property('mysql.version')}" jooqGenerator "org.jooq:jooq-codegen:${project.property('jooq.version')}" - implementation "org.flywaydb:flyway-core:7.3.2" + implementation "org.flywaydb:flyway-core:7.7.1" implementation 'com.google.code.gson:gson:2.8.6' implementation 'org.apache.commons:commons-pool2:2.9.0' implementation 'org.apache.commons:commons-dbcp2:2.8.0' From c7f30c855b39f06f52ad415f3b0afb4929f1d33d Mon Sep 17 00:00:00 2001 From: Thore Date: Wed, 31 Mar 2021 18:57:14 +0200 Subject: [PATCH 062/134] Implement membership management --- docs/Privileges.md | 2 + .../acis/bazaar/service/BazaarService.java | 5 + .../acis/bazaar/service/dal/DALFacade.java | 8 + .../bazaar/service/dal/DALFacadeImpl.java | 13 +- .../service/dal/entities/Attachment.java | 9 +- .../bazaar/service/dal/entities/Category.java | 7 +- .../bazaar/service/dal/entities/Comment.java | 11 +- .../bazaar/service/dal/entities/Ownable.java | 8 + .../service/dal/entities/PrivilegeEnum.java | 4 +- .../bazaar/service/dal/entities/Project.java | 7 +- .../service/dal/entities/ProjectMember.java | 41 +++++ .../service/dal/entities/ProjectRole.java | 7 + .../service/dal/entities/Requirement.java | 7 +- .../bazaar/service/dal/entities/User.java | 17 +- .../dal/repositories/RoleRepository.java | 5 + .../dal/repositories/RoleRepositoryImpl.java | 53 ++++++- .../service/resources/ProjectsResource.java | 148 +++++++++++++++++- .../resources/RequirementsResource.java | 7 +- .../migrations/V8__new_privileges.sql | 86 +++++----- .../dbis/acis/bazaar/service/BazaarTest.java | 77 ++++++--- .../bazaar/service/dal/DALFacadeTest.java | 12 ++ 21 files changed, 453 insertions(+), 81 deletions(-) create mode 100644 requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Ownable.java create mode 100644 requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectMember.java create mode 100644 requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectRole.java diff --git a/docs/Privileges.md b/docs/Privileges.md index 85045ea7..cb041443 100644 --- a/docs/Privileges.md +++ b/docs/Privileges.md @@ -32,12 +32,14 @@ There are 6 roles, which inherit the privileges of the roles mentioned before. T |LoggedInUser |Read_PERSONALISATION_DATA | |ProjectAdmin |Modify_CATEGORY | |ProjectAdmin |Modify_PROJECT | +|ProjectAdmin |Modify_ADMIN_MEMBERS | |ProjectManager|Create_CATEGORY | |ProjectManager|Modify_ATTACHMENT | |ProjectManager|Modify_COMMENT | |ProjectManager|Modify_REQUIREMENT | |ProjectManager|Promote_USER | |ProjectManager|Read_FEEDBACK | +|ProjectManager|Modify_MEMBERS | |ProjectMember |Create_DEVELOP | |ProjectMember |Delete_DEVELOP | |ProjectMember |Read_ATTACHMENT | diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java index 2695dc7c..4a9f3ed9 100755 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java @@ -173,6 +173,11 @@ public BazaarService() throws Exception { notificationDispatcher.setBazaarService(this); } + public String getBaseURL() { + return baseURL; + } + + @Api(value = "/", description = "Bazaar service") @SwaggerDefinition( info = @Info( diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java index 573f94ca..c7eca371 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java @@ -638,4 +638,12 @@ public interface DALFacade { * @throws Exception */ Feedback getFeedbackById(int feedbackId) throws Exception; + + /** + * Get the members of a project and their according role + * + * @param projectId + * @return List of projectmembers in the project + */ + PaginationResult getProjectMembers(int projectId, Pageable pageable) throws BazaarException; } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index a0cc9891..7cc3ff00 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -216,6 +216,7 @@ public Project createProject(Project project, int userId) throws Exception { Category defaultCategory = createCategory(uncategorizedCategory, userId); newProject.setDefaultCategoryId(defaultCategory.getId()); // TODO: concurrency transaction -> https://www.jooq.org/doc/3.9/manual/sql-execution/transaction-management/ + addUserToRole(userId, "ProjectAdmin", newProject.getId()); return projectRepository.update(newProject); } @@ -270,7 +271,7 @@ public PaginationResult listRequirementsByCategory(int categoryId, } @Override - public PaginationResult listAllRequirements( Pageable pageable, int userId) throws BazaarException { + public PaginationResult listAllRequirements(Pageable pageable, int userId) throws BazaarException { requirementRepository = (requirementRepository != null) ? requirementRepository : new RequirementRepositoryImpl(dslContext); return requirementRepository.findAll(pageable, userId); } @@ -650,7 +651,7 @@ public void addUserToRole(int userId, String roleName, Integer context) throws B @Override public PersonalisationData getPersonalisationData(int userId, String key, int version) throws BazaarException { personalisationDataRepository = (personalisationDataRepository != null) ? personalisationDataRepository : new PersonalisationDataRepositoryImpl(dslContext); - return personalisationDataRepository.findByKey(userId,version,key); + return personalisationDataRepository.findByKey(userId, version, key); } @Override @@ -664,7 +665,7 @@ public void setPersonalisationData(PersonalisationData personalisationData) thro public EntityOverview getEntitiesForUser(List includes, Pageable pageable, int userId) throws BazaarException { //categoryRepository = (categoryRepository != null) ? categoryRepository : new CategoryRepositoryImpl(dslContext); EntityOverview.Builder result = EntityOverview.builder(); - for(String include : includes) { + for (String include : includes) { switch (include) { case "projects" -> { projectRepository = (projectRepository != null) ? projectRepository : new ProjectRepositoryImpl(dslContext); @@ -702,4 +703,10 @@ public Feedback getFeedbackById(int feedbackId) throws Exception { feedbackRepository = (feedbackRepository != null) ? feedbackRepository : new FeedbackRepositoryImpl(dslContext); return feedbackRepository.findById(feedbackId); } + + @Override + public PaginationResult getProjectMembers(int projectId, Pageable pageable) throws BazaarException { + roleRepository = (roleRepository != null) ? roleRepository : new RoleRepositoryImpl(dslContext); + return roleRepository.listProjectMembers(projectId, pageable); + } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java index a46a0c68..7cb43766 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java @@ -36,7 +36,7 @@ @Data @Jacksonized @Builder(builderClassName = "Builder") -public class Attachment extends EntityBase { +public class Attachment extends EntityBase implements Ownable { private int id; @@ -66,6 +66,11 @@ public class Attachment extends EntityBase { @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") private LocalDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") private LocalDateTime lastUpdatedDate; + + @Override + public boolean isOwner(User user) { + return creator == user; + } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java index 0f04fc48..afd7cfba 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java @@ -41,7 +41,7 @@ @Data @Jacksonized @Builder(builderClassName = "Builder") -public class Category extends EntityBase { +public class Category extends EntityBase implements Ownable { private int id; @@ -72,4 +72,9 @@ public class Category extends EntityBase { public Boolean isFollower() { return isFollower; } + + @Override + public boolean isOwner(User user) { + return creator == user; + } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java index 30629239..1e14ea73 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java @@ -40,7 +40,7 @@ @Data @Jacksonized @Builder(builderClassName = "Builder") -public class Comment extends EntityBase { +public class Comment extends EntityBase implements Ownable { private int id; @@ -55,12 +55,17 @@ public class Comment extends EntityBase { private User creator; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") private LocalDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") private LocalDateTime lastUpdatedDate; @JsonProperty("_context") private EntityContext context; + + @Override + public boolean isOwner(User user) { + return creator == user; + } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Ownable.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Ownable.java new file mode 100644 index 00000000..4c8df86a --- /dev/null +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Ownable.java @@ -0,0 +1,8 @@ +package de.rwth.dbis.acis.bazaar.service.dal.entities; + +import com.fasterxml.jackson.annotation.JsonIgnore; + +public interface Ownable { + @JsonIgnore + boolean isOwner(User user); +} diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java index ed75afd9..7cbc4f34 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java @@ -56,5 +56,7 @@ public enum PrivilegeEnum { Create_DEVELOP, Delete_DEVELOP, Read_PERSONALISATION_DATA, Create_PERSONALISATION_DATA, //Create covers "PUT" Operation - Read_FEEDBACK + Read_FEEDBACK, + Modify_MEMBERS, + Modify_ADMIN_MEMBERS, } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java index c3a1db08..f6e384c3 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java @@ -39,7 +39,7 @@ @Data @Jacksonized @Builder(builderClassName = "Builder") -public class Project extends EntityBase { +public class Project extends EntityBase implements Ownable { private int id; @@ -72,4 +72,9 @@ public class Project extends EntityBase { public Boolean isFollower() { return isFollower; } + + @Override + public boolean isOwner(User user) { + return leader.equals(user); + } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectMember.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectMember.java new file mode 100644 index 00000000..e10a19b3 --- /dev/null +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectMember.java @@ -0,0 +1,41 @@ +package de.rwth.dbis.acis.bazaar.service.dal.entities; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; + +import javax.validation.constraints.NotNull; + +/** + * Abstracts the project membership data + */ +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") +public class ProjectMember extends EntityBase { + + private int id; + + @NotNull + private int userId; + + @NotNull + private ProjectRole role; + + @JsonIgnore + private User user; + + @JsonGetter("userProfileImage") + public String getProfileImage() { + return user.getProfileImage(); + } + + @JsonGetter("userName") + public String getUserName() { + return user.getUserName(); + } +} diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectRole.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectRole.java new file mode 100644 index 00000000..b5add1ad --- /dev/null +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectRole.java @@ -0,0 +1,7 @@ +package de.rwth.dbis.acis.bazaar.service.dal.entities; + +public enum ProjectRole { + ProjectMember, + ProjectManager, + ProjectAdmin +} diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java index 651ddd77..9dca9b3e 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java @@ -23,7 +23,7 @@ @Data @Jacksonized @Builder(builderClassName = "Builder") -public class Requirement extends EntityBase { +public class Requirement extends EntityBase implements Ownable { private int id; @@ -86,4 +86,9 @@ public Boolean isDeveloper() { public Boolean isContributor() { return isContributor; } + + @Override + public boolean isOwner(User user) { + return creator == user; + } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java index 6f713a1a..fc8a2d6d 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java @@ -31,6 +31,7 @@ import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.time.LocalDateTime; +import java.util.Objects; @EqualsAndHashCode(callSuper = true) @Data @@ -79,7 +80,7 @@ public class User extends EntityBase { public String getEMail() { return eMail; } - + public Boolean isEmailLeadSubscription() { return emailLeadSubscription != null && emailLeadSubscription; } @@ -91,4 +92,18 @@ public Boolean isEmailFollowSubscription() { public Boolean isPersonalizationEnabled() { return personalizationEnabled != null && personalizationEnabled; } + + @Override + public boolean equals(Object o) { + if (o == this) return true; + if (!(o instanceof User)) return false; + User other = (User) o; + + return this.las2peerId.equals(other.las2peerId); + } + + @Override + public int hashCode() { + return Objects.hash(id, userName, firstName, lastName, eMail, las2peerId, profileImage, emailLeadSubscription, emailFollowSubscription, personalizationEnabled, creationDate, lastUpdatedDate, lastLoginDate); + } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java index 0b28d008..7f26bfad 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java @@ -20,7 +20,10 @@ package de.rwth.dbis.acis.bazaar.service.dal.repositories; +import de.rwth.dbis.acis.bazaar.service.dal.entities.ProjectMember; import de.rwth.dbis.acis.bazaar.service.dal.entities.Role; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import java.util.List; @@ -36,4 +39,6 @@ public interface RoleRepository extends Repository { void addUserToRole(int userId, String roleName, Integer context) throws BazaarException; Role findByRoleName(String roleName) throws BazaarException; + + PaginationResult listProjectMembers(int projectId, Pageable pageable) throws BazaarException; } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java index c294d2aa..2a885295 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java @@ -22,8 +22,9 @@ import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RoleRecord; import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.UserRoleMapRecord; -import de.rwth.dbis.acis.bazaar.service.dal.entities.Privilege; -import de.rwth.dbis.acis.bazaar.service.dal.entities.Role; +import de.rwth.dbis.acis.bazaar.service.dal.entities.*; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; import de.rwth.dbis.acis.bazaar.service.dal.transform.PrivilegeEnumConverter; import de.rwth.dbis.acis.bazaar.service.dal.transform.RoleTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; @@ -104,6 +105,54 @@ public Role findByRoleName(String roleName) throws BazaarException { return role; } + @Override + public PaginationResult listProjectMembers(int projectId, Pageable pageable) throws BazaarException { + PaginationResult result = null; + List projectMembers = null; + int total = 0; + + try { + de.rwth.dbis.acis.bazaar.dal.jooq.tables.Role roleTable = ROLE.as("role"); + de.rwth.dbis.acis.bazaar.dal.jooq.tables.User userTable = USER.as("user"); + + Result queryResult = jooq.selectFrom( + USER_ROLE_MAP + .join(roleTable).on(USER_ROLE_MAP.ROLE_ID.eq(roleTable.ID)) + .leftOuterJoin(USER).on(USER.ID.eq(USER_ROLE_MAP.USER_ID)) + ).where(USER_ROLE_MAP.CONTEXT_INFO.equal(projectId)).fetch(); + + if (queryResult != null && !queryResult.isEmpty()) { + total = queryResult.size(); + projectMembers = new ArrayList<>(); + for (Record entry : queryResult) { + User user = User.builder() + .eMail(entry.getValue(userTable.EMAIL)) + .id(entry.getValue(userTable.ID)) + .firstName(entry.getValue(userTable.FIRST_NAME)) + .lastName(entry.getValue(userTable.LAST_NAME)) + .las2peerId(entry.getValue(userTable.LAS2PEER_ID)) + .userName(entry.getValue(userTable.USER_NAME)) + .profileImage(entry.getValue(userTable.PROFILE_IMAGE)) + .emailLeadSubscription(entry.getValue(userTable.EMAIL_LEAD_SUBSCRIPTION) != 0) + .emailFollowSubscription(entry.getValue(userTable.EMAIL_FOLLOW_SUBSCRIPTION) != 0) + .personalizationEnabled(entry.getValue(userTable.PERSONALIZATION_ENABLED) != 0) + .build(); + ProjectMember member = ProjectMember.builder() + .id(entry.getValue(USER_ROLE_MAP.ID)) + .user(user) + .userId(user.getId()) + .role(ProjectRole.valueOf(entry.getValue(roleTable.NAME))) + .build(); + projectMembers.add(member); + } + + } + } catch (Exception e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } + return new PaginationResult<>(total, pageable, projectMembers); + } + @Override public List listParentsForRole(int roleId) throws BazaarException { List roles = null; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java index 07426c26..5ecfb825 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java @@ -86,7 +86,7 @@ public Response getProjects( @ApiParam(value = "Filter", required = false, allowMultiple = true, allowableValues = "all, created, following") @QueryParam("filters") List filters, @ApiParam(value = "Ids", required = false, allowMultiple = true) @QueryParam("ids") List ids) { - DALFacade dalFacade = null; + DALFacade dalFacade = null; try { String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); if (registrarErrors != null) { @@ -258,7 +258,6 @@ public Response createProject(@ApiParam(value = "Project entity", required = tru } projectToCreate.setLeader(dalFacade.getUserById(internalUserId)); Project createdProject = dalFacade.createProject(projectToCreate, internalUserId); - dalFacade.addUserToRole(internalUserId, "ProjectAdmin", createdProject.getId()); bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.CREATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_5, createdProject.getId(), Activity.DataType.PROJECT, internalUserId); return Response.status(Response.Status.CREATED).entity(createdProject.toJSON()).build(); @@ -736,4 +735,149 @@ public Response getFeedbacksForProject(@PathParam("projectId") int projectId, FeedbackResource feedbackResource = new FeedbackResource(); return feedbackResource.getFeedbackForProject(projectId, page, perPage); } + + /** + * Allows to update a certain project. + * + * @param projectId id of the project to update + * @param projectMember New or modified project member + * @return Response with the updated project as a JSON object. + */ + @PUT + @Path("/{projectId}/members") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "This method allows to modify the project members.") + @ApiResponses(value = { + @ApiResponse(code = HttpURLConnection.HTTP_NO_CONTENT, message = "Member modified"), + @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), + @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), + @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") + }) + public Response updateMembership(@PathParam("projectId") int projectId, + @ApiParam(value = "New or updated project member", required = true) ProjectMember projectMember) { + DALFacade dalFacade = null; + try { + String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); + if (registrarErrors != null) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); + } + Agent agent = Context.getCurrent().getMainAgent(); + String userId = agent.getIdentifier(); + + // Take Object for generic error handling + Set> violations = bazaarService.validate(projectMember); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + + dalFacade = bazaarService.getDBConnection(); + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + + // Only Admins should be able to create new admins. + // Differentiate here + PrivilegeEnum privilege = PrivilegeEnum.Modify_MEMBERS; + if (projectMember.getRole() == ProjectRole.ProjectAdmin) { + privilege = PrivilegeEnum.Modify_ADMIN_MEMBERS; + } + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, privilege, projectId, dalFacade); + if (!authorized) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.project.modify")); + } + + User member = dalFacade.getUserById(projectMember.getUserId()); + dalFacade.addUserToRole(member.getId(), projectMember.getRole().name(), projectId); + + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_6, projectId, Activity.DataType.PROJECT, internalUserId); + + return Response.noContent().build(); + } catch (BazaarException bex) { + if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { + return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { + return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else { + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Update project"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } + } catch (Exception ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Update project"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } finally { + bazaarService.closeDBConnection(dalFacade); + } + } + + /** + * Allows to update a certain project. + * + * @param projectId id of the project + * @return Response with a list of project members as a JSON object. + */ + @GET + @Path("/{projectId}/members") + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "This method allows to retrieve the project members.") + @ApiResponses(value = { + @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Members", responseContainer = "List", response = ProjectMember.class), + @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), + @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), + @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") + }) + public Response getMembers(@PathParam("projectId") int projectId, + @ApiParam(value = "Page number", required = false) @DefaultValue("0") @QueryParam("page") int page, + @ApiParam(value = "Elements of memebers by page", required = false) @DefaultValue("20") @QueryParam("per_page") int perPage) throws Exception { + + DALFacade dalFacade = null; + try { + String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); + if (registrarErrors != null) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); + } + Agent agent = Context.getCurrent().getMainAgent(); + String userId = agent.getIdentifier(); + + PageInfo pageInfo = new PageInfo(page, perPage); + + // Take Object for generic error handling + Set> violations = bazaarService.validate(pageInfo); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + + dalFacade = bazaarService.getDBConnection(); + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_PROJECT, projectId, dalFacade); + if (!authorized) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.project.modify")); + } + + PaginationResult members = dalFacade.getProjectMembers(projectId, pageInfo); + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_12, + projectId, Activity.DataType.PROJECT, internalUserId); + + Response.ResponseBuilder responseBuilder = Response.ok(); + responseBuilder = responseBuilder.entity(members.toJSON()); + responseBuilder = bazaarService.xHeaderFields(responseBuilder, members); + + return responseBuilder.build(); + } catch (BazaarException bex) { + if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { + return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { + return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else { + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Update project"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } + } catch (Exception ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Update project"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } finally { + bazaarService.closeDBConnection(dalFacade); + } + } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java index e20a8866..edb641ef 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java @@ -26,6 +26,7 @@ import javax.ws.rs.core.Response; import javax.xml.bind.DatatypeConverter; import java.net.HttpURLConnection; +import java.net.URI; import java.time.LocalDateTime; import java.util.*; @@ -988,7 +989,7 @@ public Response unfollowRequirement(@PathParam("requirementId") int requirementI @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "This method creates a vote for the given requirement in the name of the current user.") @ApiResponses(value = { - @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns the requirement", response = Requirement.class), + @ApiResponse(code = HttpURLConnection.HTTP_SEE_OTHER, message = "Returns the requirement", response = Requirement.class), @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") @@ -1024,7 +1025,7 @@ public Response vote(@PathParam("requirementId") int requirementId, Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.VOTE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_35, requirementId, Activity.DataType.REQUIREMENT, internalUserId); - return Response.status(Response.Status.CREATED).entity(requirement.toJSON()).build(); + return Response.status(Response.Status.SEE_OTHER).location(URI.create(bazaarService.getBaseURL() + "requirement/" + requirementId)).entity(requirement.toJSON()).build(); } catch (BazaarException bex) { if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); @@ -1080,7 +1081,7 @@ public Response unvote(@PathParam("requirementId") int requirementId) { Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UNVOTE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_36, requirementId, Activity.DataType.REQUIREMENT, internalUserId); - return Response.ok(requirement.toJSON()).build(); + return Response.status(Response.Status.SEE_OTHER).location(URI.create(bazaarService.getBaseURL() + "requirement/" + requirementId)).entity(requirement.toJSON()).build(); } catch (BazaarException bex) { if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); diff --git a/requirement_bazaar/src/main/resources/migrations/V8__new_privileges.sql b/requirement_bazaar/src/main/resources/migrations/V8__new_privileges.sql index 2043b288..a22f62ff 100644 --- a/requirement_bazaar/src/main/resources/migrations/V8__new_privileges.sql +++ b/requirement_bazaar/src/main/resources/migrations/V8__new_privileges.sql @@ -1,15 +1,16 @@ REPLACE INTO reqbaz.privilege -(id, name) -VALUES -(29, 'Read_FEEDBACK'), -(31, 'Promote_USER'), -(32, 'Realize_REQUIREMENT'); + (id, name) +VALUES (29, 'Read_FEEDBACK'), + (31, 'Promote_USER'), + (32, 'Realize_REQUIREMENT'), + (34, 'Modify_MEMBERS'), + (35, 'Modify_ADMIN_MEMBERS'); + REPLACE INTO reqbaz.role -(id, name) -VALUES -(5, 'ProjectManager'), -(6, 'ProjectMember'); + (id, name) +VALUES (5, 'ProjectManager'), + (6, 'ProjectMember'); TRUNCATE TABLE reqbaz.role_privilege_map; # This ist quite difficult to read @@ -17,43 +18,44 @@ TRUNCATE TABLE reqbaz.role_privilege_map; # or run this query: # SELECT rpm.id, r.name, p.name, p.id FROM reqbaz.role_privilege_map rpm JOIN reqbaz.role AS r on r.id = rpm.role_id JOIN reqbaz.privilege AS p ON p.id = rpm.privilege_id order by r.name asc, p.name asc; INSERT INTO reqbaz.role_privilege_map -(role_id, privilege_id) -VALUES -(1, 3), -(1, 7), -(1, 11), -(1, 15), -(1, 19), + (role_id, privilege_id) +VALUES (1, 3), + (1, 7), + (1, 11), + (1, 15), + (1, 19), -(2, 1), -(2, 9), -(2, 13), -(2, 17), -(2, 21), -(2, 22), -(2, 23), -(2, 24), -(2, 27), -(2, 28), + (2, 1), + (2, 9), + (2, 13), + (2, 17), + (2, 21), + (2, 22), + (2, 23), + (2, 24), + (2, 27), + (2, 28), -(3, 4), -(3, 8), + (3, 4), + (3, 8), + (3, 35), -(5, 29), -(5, 31), -(5, 12), -(5, 16), -(5, 20), -(5, 5), + (5, 29), + (5, 31), + (5, 12), + (5, 16), + (5, 20), + (5, 5), + (5, 34), -(6, 2), -(6, 6), -(6, 25), -(6, 26), -(6, 18), -(6, 14), -(6, 10), -(6, 32); + (6, 2), + (6, 6), + (6, 25), + (6, 26), + (6, 18), + (6, 14), + (6, 10), + (6, 32); TRUNCATE TABLE reqbaz.role_role_map; INSERT INTO reqbaz.role_role_map diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index b03b78bb..dd7397bd 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -11,6 +11,8 @@ import javax.ws.rs.core.MediaType; import java.util.HashMap; +import static org.junit.Assert.*; + public class BazaarTest extends TestBase { /** @@ -24,12 +26,12 @@ public void testGetVersion() { ClientResponse result = client.sendRequest("GET", mainPath + "version", ""); JsonObject response = JsonParser.parseString(result.getResponse()).getAsJsonObject(); System.out.println(response.toString()); - Assert.assertTrue(response.isJsonObject()); - Assert.assertEquals(response.get("version").getAsString(), BazaarService.class.getName() + "@" + testVersion); + assertTrue(response.isJsonObject()); + assertEquals(response.get("version").getAsString(), BazaarService.class.getName() + "@" + testVersion); } catch (Exception e) { e.printStackTrace(); - Assert.fail(e.toString()); + fail(e.toString()); } } @@ -46,13 +48,13 @@ public void testCreateProject() { MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, new HashMap<>()); System.out.println(result.toString()); System.out.println("Result of 'testPost': " + result.getResponse().trim()); - Assert.assertEquals(201, result.getHttpCode()); + assertEquals(201, result.getHttpCode()); JsonObject response = JsonParser.parseString(result.getResponse()).getAsJsonObject(); - Assert.assertTrue(response.isJsonObject()); + assertTrue(response.isJsonObject()); // gson doesn't remove the quotes - Assert.assertTrue(isValidISO8601(response.get("creationDate").toString().replace("\"", ""))); + assertTrue(isValidISO8601(response.get("creationDate").toString().replace("\"", ""))); } catch (Exception e) { e.printStackTrace(); @@ -70,24 +72,61 @@ public void testGetProjects() { ClientResponse result = client.sendRequest("GET", mainPath + "projects", ""); - Assert.assertEquals(200, result.getHttpCode()); + assertEquals(200, result.getHttpCode()); JsonElement response = JsonParser.parseString(result.getResponse()); System.out.println(response.toString()); - Assert.assertTrue(response.isJsonArray()); + assertTrue(response.isJsonArray()); // Now for a specific project result = client.sendRequest("GET", mainPath + "projects/" + testProject.getId(), ""); - Assert.assertEquals(200, result.getHttpCode()); + assertEquals(200, result.getHttpCode()); response = JsonParser.parseString(result.getResponse()); System.out.println(response.toString()); - Assert.assertTrue(response.isJsonObject()); + assertTrue(response.isJsonObject()); JsonObject jsonObject = JsonParser.parseString(result.getResponse()).getAsJsonObject(); - Assert.assertTrue(isValidISO8601(jsonObject.get("creationDate").toString().replace("\"", ""))); + assertTrue(isValidISO8601(jsonObject.get("creationDate").toString().replace("\"", ""))); } catch (Exception e) { e.printStackTrace(); - Assert.fail(e.toString()); + fail(e.toString()); + } + } + + /** + * Test to get a list of projects + */ + @Test + public void testMembers() { + try { + MiniClient client = getClient(); + MiniClient adminClient = getAdminClient(); + + String path = mainPath + "projects/" + testProject.getId() + "/members"; + ClientResponse result = client.sendRequest("GET", path, ""); + assertEquals(200, result.getHttpCode()); + + JsonElement response = JsonParser.parseString(result.getResponse()); + System.out.println(response.toString()); + assertTrue(response.isJsonArray()); + + // Now add user role + String testRequest = "{\"userId\": 3, \"role\": \"ProjectManager\"}"; + result = adminClient.sendRequest("PUT", path, testRequest, MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, new HashMap<>()); + assertEquals(204, result.getHttpCode()); + + result = client.sendRequest("GET", path, ""); + assertEquals(200, result.getHttpCode()); + + response = JsonParser.parseString(result.getResponse()); + System.out.println(response.toString()); + assertTrue(response.isJsonArray()); + + assertEquals(2, response.getAsJsonArray().size()); + + } catch (Exception e) { + e.printStackTrace(); + fail(e.toString()); } } @@ -104,17 +143,17 @@ public void testCreateFeedback() { MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, new HashMap<>()); System.out.println(result.toString()); System.out.println("Result of 'testPost': " + result.getResponse().trim()); - Assert.assertEquals(201, result.getHttpCode()); + assertEquals(201, result.getHttpCode()); JsonObject response = JsonParser.parseString(result.getResponse()).getAsJsonObject(); - Assert.assertTrue(response.isJsonObject()); + assertTrue(response.isJsonObject()); // gson doesn't remove the quotes - Assert.assertTrue(isValidISO8601(response.get("creationDate").toString().replace("\"", ""))); + assertTrue(isValidISO8601(response.get("creationDate").toString().replace("\"", ""))); } catch (Exception e) { e.printStackTrace(); - Assert.fail(e.toString()); + fail(e.toString()); } } @@ -132,7 +171,7 @@ public void testCreateFeedbackWithMail() { MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, new HashMap<>()); System.out.println(result.toString()); System.out.println("Result of 'testPost': " + result.getResponse().trim()); - Assert.assertEquals(201, result.getHttpCode()); + assertEquals(201, result.getHttpCode()); JsonObject response = JsonParser.parseString(result.getResponse()).getAsJsonObject(); Assert.assertTrue(response.isJsonObject()); @@ -160,13 +199,13 @@ public void testGetFeedbacks() { System.out.println(result.getResponse()); - Assert.assertEquals(401, result.getHttpCode()); + assertEquals(401, result.getHttpCode()); result = adminClient.sendRequest("GET", path, ""); System.out.println(result.getResponse()); - Assert.assertEquals(200, result.getHttpCode()); + assertEquals(200, result.getHttpCode()); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.toString()); diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java index 3bd0048d..a5a6c7b5 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java @@ -23,6 +23,7 @@ import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.ProjectRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Feedback; import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; +import de.rwth.dbis.acis.bazaar.service.dal.entities.ProjectMember; import de.rwth.dbis.acis.bazaar.service.dal.entities.User; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; @@ -90,6 +91,7 @@ public void testCreateGetProject() throws Exception { assertEquals("An 😀awesome 😃string with a few 😉emojis!", projectById.getDescription()); assertEquals(project.getLeader().getId(), projectById.getLeader().getId()); assertEquals(project.getVisibility(), projectById.getVisibility()); + assertTrue(projectById.isOwner(initUser)); // Now check if this can also be found as a public project PaginationResult projectsPage = facade.listPublicProjects(new PageInfo(0, 1), initUser.getId()); @@ -115,6 +117,16 @@ public void testCreateGetProject() throws Exception { jooq.delete(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Project.PROJECT).where(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Project.PROJECT.ID.equal(project.getId())).execute(); } + @Test + public void testGetProjectMembers() throws Exception { + PaginationResult membersPage = facade.getProjectMembers(testProject.getId(), new PageInfo(0, 100)); + + List members = membersPage.getElements(); + + assertNotNull(members); + assertEquals(1, members.size()); + } + @Test public void testListPublicProjects() throws Exception { From 9b15ede881d5e6efd2e2b62116eceef9c832c4f8 Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 3 Apr 2021 22:28:25 +0200 Subject: [PATCH 063/134] Delete permissions again --- .../acis/bazaar/service/dal/DALFacade.java | 9 +++ .../bazaar/service/dal/DALFacadeImpl.java | 6 ++ .../dal/repositories/RoleRepository.java | 2 + .../dal/repositories/RoleRepositoryImpl.java | 5 ++ .../service/resources/ProjectsResource.java | 62 +++++++++++++++++++ .../dbis/acis/bazaar/service/BazaarTest.java | 18 +++++- .../bazaar/service/helpers/SetupData.java | 1 + 7 files changed, 102 insertions(+), 1 deletion(-) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java index c7eca371..0ab022f2 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java @@ -646,4 +646,13 @@ public interface DALFacade { * @return List of projectmembers in the project */ PaginationResult getProjectMembers(int projectId, Pageable pageable) throws BazaarException; + + /** + * Allows to remove a role from a user + * + * @param userId + * @param context + * @throws BazaarException + */ + void removeUserFromProject(int userId, Integer context) throws BazaarException; } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index 7cc3ff00..670ad9c6 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -648,6 +648,12 @@ public void addUserToRole(int userId, String roleName, Integer context) throws B roleRepository.addUserToRole(userId, roleName, context); } + @Override + public void removeUserFromProject(int userId, Integer context) throws BazaarException { + roleRepository = (roleRepository != null) ? roleRepository : new RoleRepositoryImpl(dslContext); + roleRepository.removeUserFromRole(userId, context); + } + @Override public PersonalisationData getPersonalisationData(int userId, String key, int version) throws BazaarException { personalisationDataRepository = (personalisationDataRepository != null) ? personalisationDataRepository : new PersonalisationDataRepositoryImpl(dslContext); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java index 7f26bfad..47f8902e 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java @@ -41,4 +41,6 @@ public interface RoleRepository extends Repository { Role findByRoleName(String roleName) throws BazaarException; PaginationResult listProjectMembers(int projectId, Pageable pageable) throws BazaarException; + + void removeUserFromRole(int userId, Integer context) throws BazaarException; } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java index 2a885295..5eb53859 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java @@ -153,6 +153,11 @@ public PaginationResult listProjectMembers(int projectId, Pageabl return new PaginationResult<>(total, pageable, projectMembers); } + @Override + public void removeUserFromRole(int userId, Integer context) throws BazaarException { + jooq.deleteFrom(USER_ROLE_MAP).where(USER_ROLE_MAP.USER_ID.equal(userId).and(USER_ROLE_MAP.CONTEXT_INFO.eq(context))).execute(); + } + @Override public List listParentsForRole(int roleId) throws BazaarException { List roles = null; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java index 5ecfb825..db5f1bd1 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java @@ -880,4 +880,66 @@ public Response getMembers(@PathParam("projectId") int projectId, bazaarService.closeDBConnection(dalFacade); } } + + @DELETE + @Path("/{projectId}/members/{memberId}") + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "This method allows to remove a project member.") + @ApiResponses(value = { + @ApiResponse(code = HttpURLConnection.HTTP_NO_CONTENT, message = "Member removed"), + @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), + @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), + @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") + }) + public Response removeMember(@PathParam("projectId") int projectId, @PathParam("memberId") int memberId) { + DALFacade dalFacade = null; + try { + String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); + if (registrarErrors != null) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); + } + Agent agent = Context.getCurrent().getMainAgent(); + String userId = agent.getIdentifier(); + + dalFacade = bazaarService.getDBConnection(); + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + + // Get roles of the member to modify to prevent admins being removed by managers + List modifiedMemberRoles = dalFacade.getRolesByUserId(memberId, projectId); + + // Only Admins should be able to remove admins. + // Differentiate here by checking if a user is a project admin + PrivilegeEnum privilege = PrivilegeEnum.Modify_MEMBERS; + if (modifiedMemberRoles.stream().anyMatch(role -> role.getName().equals(ProjectRole.ProjectAdmin.name()))) { + privilege = PrivilegeEnum.Modify_ADMIN_MEMBERS; + } + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, privilege, projectId, dalFacade); + if (!authorized) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.project.modify")); + } + + dalFacade.removeUserFromProject(memberId, projectId); + + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_6, projectId, Activity.DataType.PROJECT, internalUserId); + + return Response.noContent().build(); + } catch (BazaarException bex) { + if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { + return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { + return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else { + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Update project"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } + } catch (Exception ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Update project"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } finally { + bazaarService.closeDBConnection(dalFacade); + } + } } diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index dd7397bd..b34e1150 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -111,7 +111,7 @@ public void testMembers() { assertTrue(response.isJsonArray()); // Now add user role - String testRequest = "{\"userId\": 3, \"role\": \"ProjectManager\"}"; + String testRequest = "{\"userId\": 3, \"role\": \"ProjectMember\"}"; result = adminClient.sendRequest("PUT", path, testRequest, MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, new HashMap<>()); assertEquals(204, result.getHttpCode()); @@ -124,6 +124,22 @@ public void testMembers() { assertEquals(2, response.getAsJsonArray().size()); + // And now delete again + String delPath = mainPath + "projects/" + testProject.getId() + "/members/" + 3; + result = client.sendRequest("DELETE", delPath, ""); + assertEquals(401, result.getHttpCode()); + result = adminClient.sendRequest("DELETE", delPath, ""); + assertEquals(204, result.getHttpCode()); + + result = client.sendRequest("GET", path, ""); + assertEquals(200, result.getHttpCode()); + + response = JsonParser.parseString(result.getResponse()); + System.out.println(response.toString()); + assertTrue(response.isJsonArray()); + + assertEquals(1, response.getAsJsonArray().size()); + } catch (Exception e) { e.printStackTrace(); fail(e.toString()); diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java index 5a40ecd2..9a13cf94 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java @@ -21,6 +21,7 @@ public abstract class SetupData { public DSLContext jooq; public User initUser; public Project testProject; + // las2peer id of eve (defined in the testing components of las2peer) public String eveId = "799dea0f00e126dc3493f362bddbddbc55bdfbb918fce3b12f68e1340a8ea7de7aaaa8a7af900b6ee7f849a524b18649d4ae80cb406959568f405a487f085ac7"; private static DataSource setupDataSource(String dbUrl, String dbUserName, String dbPassword) { From 2d62d0c64be320a57a3c0455c88a3a31b2f82dd1 Mon Sep 17 00:00:00 2001 From: Thore Date: Sun, 4 Apr 2021 13:47:01 +0200 Subject: [PATCH 064/134] Fix error when running all testcases --- .../dbis/acis/bazaar/service/BazaarTest.java | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index b34e1150..e8abb9ab 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -6,6 +6,7 @@ import i5.las2peer.connectors.webConnector.client.ClientResponse; import i5.las2peer.connectors.webConnector.client.MiniClient; import org.junit.Assert; +import org.junit.Before; import org.junit.Test; import javax.ws.rs.core.MediaType; @@ -15,6 +16,21 @@ public class BazaarTest extends TestBase { + private int adamId; + + @Before + public void adamSetup() { + MiniClient client = getClient(); + + ClientResponse result = client.sendRequest("GET", mainPath + "users/me", ""); + assertEquals(200, result.getHttpCode()); + + JsonObject response = JsonParser.parseString(result.getResponse()).getAsJsonObject(); + System.out.println(response.toString()); + assertTrue(response.isJsonObject()); + adamId = response.get("id").getAsInt(); + } + /** * Test to get the version from the version endpoint */ @@ -111,7 +127,7 @@ public void testMembers() { assertTrue(response.isJsonArray()); // Now add user role - String testRequest = "{\"userId\": 3, \"role\": \"ProjectMember\"}"; + String testRequest = String.format("{\"userId\": %s, \"role\": \"ProjectMember\"}", adamId); result = adminClient.sendRequest("PUT", path, testRequest, MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, new HashMap<>()); assertEquals(204, result.getHttpCode()); @@ -125,7 +141,7 @@ public void testMembers() { assertEquals(2, response.getAsJsonArray().size()); // And now delete again - String delPath = mainPath + "projects/" + testProject.getId() + "/members/" + 3; + String delPath = mainPath + "projects/" + testProject.getId() + "/members/" + adamId; result = client.sendRequest("DELETE", delPath, ""); assertEquals(401, result.getHttpCode()); result = adminClient.sendRequest("DELETE", delPath, ""); From c6f5dbc718a399379f013bc3ae821e198a6641a1 Mon Sep 17 00:00:00 2001 From: Thore Date: Tue, 6 Apr 2021 13:37:19 +0200 Subject: [PATCH 065/134] Prevent creation of empty comments --- .../de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java index 1e14ea73..19527a25 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java @@ -31,6 +31,7 @@ import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; import java.time.LocalDateTime; /** @@ -45,6 +46,7 @@ public class Comment extends EntityBase implements Ownable { private int id; @NotNull(groups = CreateValidation.class) + @Size(min = 1) private String message; @Min(value = 0, groups = CreateValidation.class) From 7e9a8ac622b43d8fc3aa572a9d4f232f9d7c7e7f Mon Sep 17 00:00:00 2001 From: Thore Date: Tue, 6 Apr 2021 16:31:52 +0200 Subject: [PATCH 066/134] Make users searchable --- docs/Privileges.md | 1 + .../acis/bazaar/service/dal/DALFacade.java | 46 ++++++---- .../bazaar/service/dal/DALFacadeImpl.java | 7 ++ .../service/dal/entities/PrivilegeEnum.java | 2 + .../dal/repositories/UserRepository.java | 9 ++ .../dal/repositories/UserRepositoryImpl.java | 23 +++++ .../dal/transform/UserTransformer.java | 2 +- .../service/resources/UsersResource.java | 89 ++++++++++++++++++- .../migrations/V8__new_privileges.sql | 4 +- 9 files changed, 163 insertions(+), 20 deletions(-) diff --git a/docs/Privileges.md b/docs/Privileges.md index cb041443..a9d404d4 100644 --- a/docs/Privileges.md +++ b/docs/Privileges.md @@ -30,6 +30,7 @@ There are 6 roles, which inherit the privileges of the roles mentioned before. T |LoggedInUser |Delete_FOLLOW | |LoggedInUser |Delete_VOTE | |LoggedInUser |Read_PERSONALISATION_DATA | +|LoggedInUser |Read_USERS | |ProjectAdmin |Modify_CATEGORY | |ProjectAdmin |Modify_PROJECT | |ProjectAdmin |Modify_ADMIN_MEMBERS | diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java index 0ab022f2..8e1aa49f 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java @@ -135,6 +135,15 @@ public interface DALFacade { * @return list of users to receive email notification */ List getRecipientListForRequirement(int requirementId) throws BazaarException; + + /** + * Search for users with a given search term + * + * @param pageInfo + * @return + */ + PaginationResult searchUsers(PageInfo pageInfo) throws BazaarException; + //endregion //region Project @@ -193,6 +202,23 @@ public interface DALFacade { Statistic getStatisticsForAllProjects(int userId, Calendar since) throws BazaarException; Statistic getStatisticsForProject(int userId, int projectId, Calendar since) throws BazaarException; + + /** + * Get the members of a project and their according role + * + * @param projectId + * @return List of projectmembers in the project + */ + PaginationResult getProjectMembers(int projectId, Pageable pageable) throws BazaarException; + + /** + * Allows to remove a role from a user + * + * @param userId + * @param context + * @throws BazaarException + */ + void removeUserFromProject(int userId, Integer context) throws BazaarException; //endregion //region ProjectFollower @@ -611,6 +637,8 @@ public interface DALFacade { */ EntityOverview getEntitiesForUser(List includes, Pageable pageable, int userId) throws BazaarException; + // region feedback + /** * Creates a new feedback item * @@ -638,21 +666,5 @@ public interface DALFacade { * @throws Exception */ Feedback getFeedbackById(int feedbackId) throws Exception; - - /** - * Get the members of a project and their according role - * - * @param projectId - * @return List of projectmembers in the project - */ - PaginationResult getProjectMembers(int projectId, Pageable pageable) throws BazaarException; - - /** - * Allows to remove a role from a user - * - * @param userId - * @param context - * @throws BazaarException - */ - void removeUserFromProject(int userId, Integer context) throws BazaarException; + // endregion feedback } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index 670ad9c6..dfc9381c 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -181,6 +181,13 @@ public List getRecipientListForRequirement(int requirementId) throws Bazaa return userRepository.getEmailReceiverForRequirement(requirementId); } + @Override + public PaginationResult searchUsers(PageInfo pageInfo) throws BazaarException { + userRepository = (userRepository != null) ? userRepository : new UserRepositoryImpl(dslContext); + List users = userRepository.search(pageInfo); + return new PaginationResult<>(users.size(), pageInfo, users); + } + @Override public PaginationResult listPublicProjects(Pageable pageable, int userId) throws BazaarException { projectRepository = (projectRepository != null) ? projectRepository : new ProjectRepositoryImpl(dslContext); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java index 7cbc4f34..17c0e3fe 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java @@ -59,4 +59,6 @@ public enum PrivilegeEnum { Read_FEEDBACK, Modify_MEMBERS, Modify_ADMIN_MEMBERS, + + Read_USERS, } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepository.java index a414e1d4..aaea1a5d 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepository.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepository.java @@ -59,4 +59,13 @@ public interface UserRepository extends Repository { List getEmailReceiverForCategory(int categoryId) throws BazaarException; List getEmailReceiverForRequirement(int requirementId) throws BazaarException; + + /** + * Search with custom search and order logic + * + * @param pageable + * @return + * @throws BazaarException + */ + List search(Pageable pageable) throws BazaarException; } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java index a5099fe3..d1c32a2c 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java @@ -651,4 +651,27 @@ public List getEmailReceiverForRequirement(int requirementId) throws Bazaa } return entries; } + + public List search(Pageable pageable) throws BazaarException { + List entries = null; + try { + entries = new ArrayList<>(); + List queryResults = jooq.selectFrom(transformer.getTable()) + .where(transformer.getSearchCondition(pageable.getSearch())) + .limit(pageable.getPageSize()) + .offset(pageable.getOffset()) + .fetchInto(transformer.getRecordClass()); + + for (UserRecord queryResult : queryResults) { + User entry = transformer.getEntityFromTableRecord(queryResult); + entries.add(entry); + } + } catch (BazaarException ex) { + ExceptionHandler.getInstance().convertAndThrowException(ex); + } catch (Exception e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } + + return entries; + } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java index 1cbdd1f8..8a838115 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java @@ -143,7 +143,7 @@ public Collection> getSortFields(List @Override public Condition getSearchCondition(String search) throws Exception { return USER.USER_NAME.likeIgnoreCase("%" + search + "%") - .or(USER.EMAIL.likeIgnoreCase("%" + search + "%")) + .or(USER.EMAIL.likeIgnoreCase(search)) .or(USER.FIRST_NAME.likeIgnoreCase("%" + search + "%")) .or(USER.LAST_NAME.likeIgnoreCase("%" + search + "%")); } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java index 5c0c23f8..2aa73908 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java @@ -5,13 +5,17 @@ import de.rwth.dbis.acis.bazaar.service.dal.DALFacade; import de.rwth.dbis.acis.bazaar.service.dal.entities.Activity; import de.rwth.dbis.acis.bazaar.service.dal.entities.EntityOverview; +import de.rwth.dbis.acis.bazaar.service.dal.entities.PrivilegeEnum; import de.rwth.dbis.acis.bazaar.service.dal.entities.User; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionLocation; +import de.rwth.dbis.acis.bazaar.service.internalization.Localization; +import de.rwth.dbis.acis.bazaar.service.security.AuthorizationManager; import i5.las2peer.api.Context; import i5.las2peer.api.logging.MonitoringEvent; import i5.las2peer.api.security.Agent; @@ -57,6 +61,89 @@ public UsersResource() throws Exception { bazaarService = (BazaarService) Context.getCurrent().getService(); } + /** + * This method allows to search for users. + * + * @return Response with user as a JSON object. + */ + @GET + @Path("/") + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "This method allows to search for users.") + @ApiResponses(value = { + @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "List of matching users", response = User.class, responseContainer = "List"), + @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), + @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") + }) + public Response searchUser(@ApiParam(value = "Search filter", required = false) @QueryParam("search") String search, + @ApiParam(value = "Page number", required = false) @DefaultValue("0") @QueryParam("page") int page, + @ApiParam(value = "Elements of comments by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage) { + DALFacade dalFacade = null; + try { + String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); + if (registrarErrors != null) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); + } + Agent agent = Context.getCurrent().getMainAgent(); + String userId = agent.getIdentifier(); + dalFacade = bazaarService.getDBConnection(); + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_USERS, dalFacade); + if (!authorized) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.anonymous")); + } + + PageInfo pageInfo = new PageInfo(page, perPage, new HashMap<>(), new ArrayList<>(), search); + + // Take Object for generic error handling + Set> violations = bazaarService.validate(pageInfo); + if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + + PaginationResult users = dalFacade.searchUsers(pageInfo); + + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_53, + internalUserId, Activity.DataType.USER, internalUserId); + + Map> parameter = new HashMap<>(); + parameter.put("page", new ArrayList() {{ + add(String.valueOf(page)); + }}); + parameter.put("per_page", new ArrayList() {{ + add(String.valueOf(perPage)); + }}); + if (search != null) { + parameter.put("search", new ArrayList() {{ + add(String.valueOf(search)); + }}); + } + + Response.ResponseBuilder responseBuilder = Response.ok(); + responseBuilder = responseBuilder.entity(users.toJSON()); + responseBuilder = bazaarService.paginationLinks(responseBuilder, users, "users", parameter); + responseBuilder = bazaarService.xHeaderFields(responseBuilder, users); + + return responseBuilder.build(); + } catch (BazaarException bex) { + if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { + return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { + return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else { + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Search users"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } + } catch (Exception ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Search users"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } finally { + bazaarService.closeDBConnection(dalFacade); + } + } + /** * This method allows to retrieve a certain user. * @@ -137,7 +224,7 @@ public Response getActiveUser() { bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_54, internalUserId, Activity.DataType.USER, internalUserId); - return Response.ok(user.toJSON()).build(); + return Response.ok(user.toPrivateJSON()).build(); } catch (BazaarException bex) { if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); diff --git a/requirement_bazaar/src/main/resources/migrations/V8__new_privileges.sql b/requirement_bazaar/src/main/resources/migrations/V8__new_privileges.sql index a22f62ff..fe1fe86e 100644 --- a/requirement_bazaar/src/main/resources/migrations/V8__new_privileges.sql +++ b/requirement_bazaar/src/main/resources/migrations/V8__new_privileges.sql @@ -4,7 +4,8 @@ VALUES (29, 'Read_FEEDBACK'), (31, 'Promote_USER'), (32, 'Realize_REQUIREMENT'), (34, 'Modify_MEMBERS'), - (35, 'Modify_ADMIN_MEMBERS'); + (35, 'Modify_ADMIN_MEMBERS'), + (36, 'Read_USERS'); REPLACE INTO reqbaz.role @@ -35,6 +36,7 @@ VALUES (1, 3), (2, 24), (2, 27), (2, 28), + (2, 36), (3, 4), (3, 8), From 15b1bdae07c388f55faad5ecfcc12bad83c50890 Mon Sep 17 00:00:00 2001 From: Thore Date: Tue, 6 Apr 2021 16:32:19 +0200 Subject: [PATCH 067/134] Reduce user properties returned on non /me endpoint --- .../service/dal/entities/EntityBase.java | 14 ++++- .../bazaar/service/dal/entities/User.java | 20 +++++-- .../service/dal/helpers/PaginationResult.java | 5 +- .../service/dal/helpers/SerializerViews.java | 8 +++ .../dbis/acis/bazaar/service/BazaarTest.java | 54 +++++++++++++++++++ 5 files changed, 95 insertions(+), 6 deletions(-) create mode 100644 requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/SerializerViews.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityBase.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityBase.java index dabae8ab..df72d589 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityBase.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityBase.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.SerializerViews; /** * @since 9/16/2014 @@ -31,6 +32,17 @@ public abstract class EntityBase implements IdentifiedById { public String toJSON() throws JsonProcessingException { - return new ObjectMapper().registerModule(new JavaTimeModule()).setSerializationInclusion(JsonInclude.Include.NON_NULL).writeValueAsString(this); + return new ObjectMapper().registerModule(new JavaTimeModule()) + .setSerializationInclusion(JsonInclude.Include.NON_NULL) + .writerWithView(SerializerViews.Public.class) + .writeValueAsString(this); + } + + public String toPrivateJSON() throws JsonProcessingException { + return new ObjectMapper() + .registerModule(new JavaTimeModule()) + .setSerializationInclusion(JsonInclude.Include.NON_NULL) + .writerWithView(SerializerViews.Private.class) + .writeValueAsString(this); } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java index fc8a2d6d..01e12131 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java @@ -22,7 +22,8 @@ import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonView; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.SerializerViews; import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; @@ -46,9 +47,11 @@ public class User extends EntityBase { private String userName; @Size(min = 1, max = 1000, message = "first name must have between 1 and 1000 characters") + @JsonView(SerializerViews.Private.class) private String firstName; @Size(min = 1, max = 1000, message = "last name must have between 1 and 1000 characters") + @JsonView(SerializerViews.Private.class) private String lastName; @NotNull(message = "eMail can't be null") @@ -61,34 +64,43 @@ public class User extends EntityBase { private String profileImage; + @JsonView(SerializerViews.Private.class) private Boolean emailLeadSubscription; + @JsonView(SerializerViews.Private.class) private Boolean emailFollowSubscription; + @JsonView(SerializerViews.Private.class) private Boolean personalizationEnabled; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") + @JsonView(SerializerViews.Private.class) private LocalDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") + @JsonView(SerializerViews.Private.class) private LocalDateTime lastUpdatedDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") + @JsonView(SerializerViews.Private.class) private LocalDateTime lastLoginDate; - @JsonIgnore + @JsonView(SerializerViews.Private.class) public String getEMail() { return eMail; } + @JsonView(SerializerViews.Private.class) public Boolean isEmailLeadSubscription() { return emailLeadSubscription != null && emailLeadSubscription; } + @JsonView(SerializerViews.Private.class) public Boolean isEmailFollowSubscription() { return emailFollowSubscription != null && emailFollowSubscription; } + @JsonView(SerializerViews.Private.class) public Boolean isPersonalizationEnabled() { return personalizationEnabled != null && personalizationEnabled; } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PaginationResult.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PaginationResult.java index d96e1faf..22dc545e 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PaginationResult.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PaginationResult.java @@ -53,6 +53,9 @@ public int getNextPage() { } public String toJSON() throws JsonProcessingException { - return new ObjectMapper().registerModule(new JavaTimeModule()).setSerializationInclusion(JsonInclude.Include.NON_NULL).writeValueAsString(this.getElements()); + return new ObjectMapper().registerModule(new JavaTimeModule()) + .setSerializationInclusion(JsonInclude.Include.NON_NULL) + .writerWithView(SerializerViews.Public.class) + .writeValueAsString(this.getElements()); } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/SerializerViews.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/SerializerViews.java new file mode 100644 index 00000000..f3b0a5f7 --- /dev/null +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/SerializerViews.java @@ -0,0 +1,8 @@ +package de.rwth.dbis.acis.bazaar.service.dal.helpers; + +public class SerializerViews { + public static class Public { + } + public static class Private extends Public { + } +} diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index e8abb9ab..a241ad83 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -243,4 +243,58 @@ public void testGetFeedbacks() { Assert.fail(e.toString()); } } + + /** + * Test to search for a user + */ + @Test + public void testSearchUser() { + try { + MiniClient client = getClient(); + + ClientResponse result = client.sendRequest("GET", mainPath + "users?search=elek", ""); + JsonElement response = JsonParser.parseString(result.getResponse()); + System.out.println(response.toString()); + assertEquals(200, result.getHttpCode()); + + assertTrue(response.isJsonArray()); + assertEquals(1, response.getAsJsonArray().size()); + + } catch (Exception e) { + e.printStackTrace(); + fail(e.toString()); + } + } + + /** + * Test to search for a user + */ + @Test + public void testUserJsonView() { + try { + MiniClient client = getClient(); + + ClientResponse result = client.sendRequest("GET", mainPath + "users/me", ""); + System.out.println(result.toString()); + assertEquals(200, result.getHttpCode()); + + JsonObject response = JsonParser.parseString(result.getResponse()).getAsJsonObject(); + assertTrue(response.isJsonObject()); + assertTrue(response.has("email")); + assertTrue(response.has("emailFollowSubscription")); + + result = client.sendRequest("GET", mainPath + "users/" + initUser.getId(), ""); + System.out.println(result.toString()); + assertEquals(200, result.getHttpCode()); + + response = JsonParser.parseString(result.getResponse()).getAsJsonObject(); + assertTrue(response.isJsonObject()); + assertFalse(response.has("email")); + assertFalse(response.has("emailFollowSubscription")); + + } catch (Exception e) { + e.printStackTrace(); + fail(e.toString()); + } + } } From ad0b4c14078c7bd041b259bc44b6cc55938489fa Mon Sep 17 00:00:00 2001 From: Thore Date: Tue, 6 Apr 2021 16:39:23 +0200 Subject: [PATCH 068/134] Update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31aeb570..522e1c99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas - Added new testcases [#73](https://github.com/rwth-acis/RequirementsBazaar/pull/73) - Added endpoints to provide anonymous feedback which can be read by project admins [#85](https://github.com/rwth-acis/RequirementsBazaar/pull/85) +- Added endpoint to search for users by name or email [#90](https://github.com/rwth-acis/RequirementsBazaar/pull/90) ### Changed @@ -37,6 +38,9 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas attribute in `EntityContext` to `categories` [#83](https://github.com/rwth-acis/RequirementsBazaar/pull/82) - Rework permission system as lined out in [Privileges](docs/Privileges.md) [#85](https://github.com/rwth-acis/RequirementsBazaar/pull/85) +- Category `leader` attribute has been renamed to `creator` [#85](https://github.com/rwth-acis/RequirementsBazaar/pull/85) +- Voting now returns a 303 response with reference to the modified object [#85](https://github.com/rwth-acis/RequirementsBazaar/pull/85) +- Restrict user attributes normally returned to id, username, profile image and las2peerid [#90](https://github.com/rwth-acis/RequirementsBazaar/pull/90) ## [0.7.2] - 2017-10-25 From 4ff6eeeea2ab7b21b58ffbf87c7917bc46822627 Mon Sep 17 00:00:00 2001 From: Thore Date: Wed, 7 Apr 2021 18:40:44 +0200 Subject: [PATCH 069/134] Allow a list of users to be added to a project --- .../service/resources/ProjectsResource.java | 41 +++++++++++-------- .../dbis/acis/bazaar/service/BazaarTest.java | 2 +- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java index db5f1bd1..f23b76db 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java @@ -28,6 +28,7 @@ import java.net.HttpURLConnection; import java.time.LocalDateTime; import java.util.*; +import java.util.concurrent.atomic.AtomicReference; @Api(value = "projects", description = "Projects resource") @SwaggerDefinition( @@ -739,8 +740,8 @@ public Response getFeedbacksForProject(@PathParam("projectId") int projectId, /** * Allows to update a certain project. * - * @param projectId id of the project to update - * @param projectMember New or modified project member + * @param projectId id of the project to update + * @param projectMembers New or modified project members * @return Response with the updated project as a JSON object. */ @PUT @@ -755,7 +756,7 @@ public Response getFeedbacksForProject(@PathParam("projectId") int projectId, @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") }) public Response updateMembership(@PathParam("projectId") int projectId, - @ApiParam(value = "New or updated project member", required = true) ProjectMember projectMember) { + @ApiParam(value = "New or updated project member", required = true) List projectMembers) { DALFacade dalFacade = null; try { String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); @@ -766,28 +767,32 @@ public Response updateMembership(@PathParam("projectId") int projectId, String userId = agent.getIdentifier(); // Take Object for generic error handling - Set> violations = bazaarService.validate(projectMember); + Set> violations = bazaarService.validate(projectMembers); if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); - // Only Admins should be able to create new admins. - // Differentiate here - PrivilegeEnum privilege = PrivilegeEnum.Modify_MEMBERS; - if (projectMember.getRole() == ProjectRole.ProjectAdmin) { - privilege = PrivilegeEnum.Modify_ADMIN_MEMBERS; - } - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, privilege, projectId, dalFacade); + AtomicReference privilege = new AtomicReference<>(PrivilegeEnum.Modify_MEMBERS); + projectMembers.forEach(projectMember -> { + // Only Admins should be able to create new admins. + // Differentiate here + if (projectMember.getRole() == ProjectRole.ProjectAdmin) { + privilege.set(PrivilegeEnum.Modify_ADMIN_MEMBERS); + } + }); + + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, privilege.get(), projectId, dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.project.modify")); } - User member = dalFacade.getUserById(projectMember.getUserId()); - dalFacade.addUserToRole(member.getId(), projectMember.getRole().name(), projectId); - - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_6, projectId, Activity.DataType.PROJECT, internalUserId); + for (ProjectMember projectMember : projectMembers) { + User member = dalFacade.getUserById(projectMember.getUserId()); + dalFacade.addUserToRole(member.getId(), projectMember.getRole().name(), projectId); + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_6, projectId, Activity.DataType.PROJECT, internalUserId); + } return Response.noContent().build(); } catch (BazaarException bex) { if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { @@ -847,7 +852,11 @@ public Response getMembers(@PathParam("projectId") int projectId, dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_PROJECT, projectId, dalFacade); + PrivilegeEnum privilege = PrivilegeEnum.Read_PUBLIC_PROJECT; + + if (!dalFacade.isProjectPublic(projectId)) privilege = PrivilegeEnum.Read_PROJECT; + + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, privilege, projectId, dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.project.modify")); } diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index a241ad83..03deef1f 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -127,7 +127,7 @@ public void testMembers() { assertTrue(response.isJsonArray()); // Now add user role - String testRequest = String.format("{\"userId\": %s, \"role\": \"ProjectMember\"}", adamId); + String testRequest = String.format("[{\"userId\": %s, \"role\": \"ProjectMember\"}]", adamId); result = adminClient.sendRequest("PUT", path, testRequest, MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, new HashMap<>()); assertEquals(204, result.getHttpCode()); From 69983cf617b5303cdca1cae4c62cd2a2b75cb633 Mon Sep 17 00:00:00 2001 From: Thore Date: Fri, 9 Apr 2021 03:20:01 +0200 Subject: [PATCH 070/134] lastActivity for projects --- .../bazaar/service/dal/entities/Project.java | 5 +- .../repositories/ProjectRepositoryImpl.java | 177 +++++++----------- 2 files changed, 73 insertions(+), 109 deletions(-) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java index f6e384c3..fe64c01f 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java @@ -60,9 +60,12 @@ public class Project extends EntityBase implements Ownable { @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") private LocalDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") private LocalDateTime lastUpdatedDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") + private LocalDateTime lastActivity; + private Integer numberOfCategories; private Integer numberOfRequirements; private Integer numberOfFollowers; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java index d7e04112..3ab64e33 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java @@ -110,6 +110,9 @@ public class ProjectRepositoryImpl extends RepositoryImpl isFollower = DSL.select(DSL.count()) .from(PROJECT_FOLLOWER_MAP) .where(PROJECT_FOLLOWER_MAP.PROJECT_ID.equal(PROJECT.ID).and(PROJECT_FOLLOWER_MAP.USER_ID.equal(userId))) @@ -176,59 +177,75 @@ public Project findById(int id, int userId) throws BazaarException { return project; } + private PaginationResult findProjects(Pageable pageable, int userId, Boolean queryPrivate) throws Exception { + + List projects = new ArrayList<>(); + Field idCount = jooq.selectCount() + .from(PROJECT) + .where(PROJECT.VISIBILITY.isTrue()) + .and(transformer.getSearchCondition(pageable.getSearch())) + .asField("idCount"); + + Field isFollower = DSL.select(DSL.count()) + .from(PROJECT_FOLLOWER_MAP) + .where(PROJECT_FOLLOWER_MAP.PROJECT_ID.equal(PROJECT.ID).and(PROJECT_FOLLOWER_MAP.USER_ID.equal(userId))) + .asField("isFollower"); + Field lastActivity = DSL.select(LAST_ACTIVITY.field("last_activity")).from(LAST_ACTIVITY) + .where(LAST_ACTIVITY.field(PROJECT.ID).equal(PROJECT.ID)) + .asField("lastActivity"); + + Condition searchConditions = transformer.getSearchCondition(pageable.getSearch()) + .and((pageable.getIds().size() > 0) ? PROJECT.ID.in(pageable.getIds()) : trueCondition()); + + if (queryPrivate) { + // TODO: Include permission check by project membership query + searchConditions.and( + PROJECT.VISIBILITY.isTrue().or(leaderUser.ID.equal(userId)) + ); + } + + Result queryResults = jooq.select(PROJECT.fields()) + .select(idCount) + .select(CATEGORY_COUNT) + .select(REQUIREMENT_COUNT) + .select(FOLLOWER_COUNT) + .select(isFollower) + .select(leaderUser.fields()) + .select(lastActivity) + .from(PROJECT) + .leftOuterJoin(leaderUser).on(leaderUser.ID.equal(PROJECT.LEADER_ID)) + .leftOuterJoin(LAST_ACTIVITY).on(PROJECT.ID.eq(LAST_ACTIVITY.field(PROJECT.ID))) + .where(searchConditions) + .orderBy(transformer.getSortFields(pageable.getSorts())) + .limit(pageable.getPageSize()) + .offset(pageable.getOffset()) + .fetch(); + + for (Record queryResult : queryResults) { + ProjectRecord projectRecord = queryResult.into(PROJECT); + Project project = transformer.getEntityFromTableRecord(projectRecord); + UserTransformer userTransformer = new UserTransformer(); + UserRecord userRecord = queryResult.into(leaderUser); + project.setLeader(userTransformer.getEntityFromTableRecord(userRecord)); + project.setNumberOfCategories((Integer) queryResult.getValue(CATEGORY_COUNT)); + project.setNumberOfRequirements((Integer) queryResult.getValue(REQUIREMENT_COUNT)); + project.setNumberOfFollowers((Integer) queryResult.getValue(FOLLOWER_COUNT)); + project.setLastActivity((LocalDateTime) queryResult.getValue(lastActivity)); + if (userId != 1) { + project.setIsFollower(0 != (Integer) queryResult.getValue(isFollower)); + } + projects.add(project); + } + int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); + + return new PaginationResult<>(total, pageable, projects); + } + @Override public PaginationResult findAllPublic(Pageable pageable, int userId) throws BazaarException { PaginationResult result = null; - List projects; try { - projects = new ArrayList<>(); - de.rwth.dbis.acis.bazaar.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); - - Field idCount = jooq.selectCount() - .from(PROJECT) - .where(PROJECT.VISIBILITY.isTrue()) - .and(transformer.getSearchCondition(pageable.getSearch())) - .asField("idCount"); - - Field isFollower = DSL.select(DSL.count()) - .from(PROJECT_FOLLOWER_MAP) - .where(PROJECT_FOLLOWER_MAP.PROJECT_ID.equal(PROJECT.ID).and(PROJECT_FOLLOWER_MAP.USER_ID.equal(userId))) - .asField("isFollower"); - - Result queryResults = jooq.select(PROJECT.fields()) - .select(idCount) - .select(CATEGORY_COUNT) - .select(REQUIREMENT_COUNT) - .select(FOLLOWER_COUNT) - .select(isFollower) - .select(leaderUser.fields()) - .from(PROJECT) - .leftOuterJoin(leaderUser).on(leaderUser.ID.equal(PROJECT.LEADER_ID)) - .leftOuterJoin(LAST_ACTIVITY).on(PROJECT.ID.eq(LAST_ACTIVITY.field(PROJECT.ID))) - .where(PROJECT.VISIBILITY.isTrue()) - .and(transformer.getSearchCondition(pageable.getSearch())) - .and((pageable.getIds().size() > 0)?PROJECT.ID.in(pageable.getIds()):trueCondition()) //If list of ids parsed, add in condition - .orderBy(transformer.getSortFields(pageable.getSorts())) - .limit(pageable.getPageSize()) - .offset(pageable.getOffset()) - .fetch(); - - for (Record queryResult : queryResults) { - ProjectRecord projectRecord = queryResult.into(PROJECT); - Project project = transformer.getEntityFromTableRecord(projectRecord); - UserTransformer userTransformer = new UserTransformer(); - UserRecord userRecord = queryResult.into(leaderUser); - project.setLeader(userTransformer.getEntityFromTableRecord(userRecord)); - project.setNumberOfCategories((Integer) queryResult.getValue(CATEGORY_COUNT)); - project.setNumberOfRequirements((Integer) queryResult.getValue(REQUIREMENT_COUNT)); - project.setNumberOfFollowers((Integer) queryResult.getValue(FOLLOWER_COUNT)); - if (userId != 1) { - project.setIsFollower(0 != (Integer) queryResult.getValue(isFollower)); - } - projects.add(project); - } - int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); - result = new PaginationResult<>(total, pageable, projects); + result = findProjects(pageable, userId, false); } catch (Exception e) { ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); } @@ -238,64 +255,8 @@ public PaginationResult findAllPublic(Pageable pageable, int userId) th @Override public PaginationResult findAllPublicAndAuthorized(Pageable pageable, int userId) throws BazaarException { PaginationResult result = null; - List projects; try { - projects = new ArrayList<>(); - de.rwth.dbis.acis.bazaar.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); - - Field idCount = jooq.selectCount() - .from(PROJECT) - .where(transformer.getSearchCondition(pageable.getSearch())) - .asField("idCount"); - - Field isFollower = DSL.select(DSL.count()) - .from(PROJECT_FOLLOWER_MAP) - .where(PROJECT_FOLLOWER_MAP.PROJECT_ID.equal(PROJECT.ID).and(PROJECT_FOLLOWER_MAP.USER_ID.equal(userId))) - .asField("isFollower"); - - //TODO only authorized projects? - List queryResults = jooq.select(PROJECT.fields()) - .select(idCount) - .select(CATEGORY_COUNT) - .select(REQUIREMENT_COUNT) - .select(FOLLOWER_COUNT) - .select(isFollower) - .select(leaderUser.fields()) - .from(PROJECT) - .leftOuterJoin(leaderUser).on(leaderUser.ID.equal(PROJECT.LEADER_ID)) - .leftOuterJoin(LAST_ACTIVITY).on(PROJECT.ID.eq(LAST_ACTIVITY.field(PROJECT.ID))) -// .leftOuterJoin(AUTHORIZATIONS).on(AUTHORIZATIONS.PROJECT_ID.equal(PROJECTS.ID)) -// .join(USERS).on(AUTHORIZATIONS.USER_ID.equal(USERS.ID)) -// .where(PROJECTS.VISIBILITY.eq(Project.ProjectVisibility.PUBLIC.asChar()) - .where(transformer.getFilterConditions(pageable.getFilters())) - .and( - (pageable.getIds().size() > 0)?(PROJECT.ID.in(pageable.getIds())):trueCondition() - .and( - PROJECT.VISIBILITY.isTrue().or(leaderUser.ID.equal(userId)) - ).and( - transformer.getSearchCondition(pageable.getSearch())) - ) - .orderBy(transformer.getSortFields(pageable.getSorts())) - .limit(pageable.getPageSize()) - .offset(pageable.getOffset()) - .fetch(); - - for (Record queryResult : queryResults) { - ProjectRecord projectRecord = queryResult.into(PROJECT); - Project project = transformer.getEntityFromTableRecord(projectRecord); - UserTransformer userTransformer = new UserTransformer(); - UserRecord userRecord = queryResult.into(leaderUser); - project.setLeader(userTransformer.getEntityFromTableRecord(userRecord)); - project.setNumberOfCategories((Integer) queryResult.getValue(CATEGORY_COUNT)); - project.setNumberOfRequirements((Integer) queryResult.getValue(REQUIREMENT_COUNT)); - project.setNumberOfFollowers((Integer) queryResult.getValue(FOLLOWER_COUNT)); - if (userId != 1) { - project.setIsFollower(0 != (Integer) queryResult.getValue(isFollower)); - } - projects.add(project); - } - int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); - result = new PaginationResult<>(total, pageable, projects); + result = findProjects(pageable, userId, true); } catch (Exception e) { ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); } From 4377e63d44fbd37b96cc260cd7cce26d858a2d2b Mon Sep 17 00:00:00 2001 From: Thore Date: Mon, 12 Apr 2021 15:49:03 +0200 Subject: [PATCH 071/134] Add last activity to requirements, categories and projects --- CHANGELOG.md | 13 +- .../bazaar/service/dal/DALFacadeImpl.java | 14 +- .../bazaar/service/dal/entities/Category.java | 5 +- .../service/dal/entities/Requirement.java | 6 +- .../repositories/CategoryRepositoryImpl.java | 276 ++++-------- .../RequirementRepositoryImpl.java | 425 ++++++++---------- .../notification/ActivityDispatcher.java | 8 +- .../service/notification/EmailDispatcher.java | 6 +- .../NotificationDispatcherImp.java | 6 +- .../resources/RequirementsResource.java | 16 +- .../V9__more_delete_constraints.sql | 16 + .../dbis/acis/bazaar/service/BazaarTest.java | 82 ++++ 12 files changed, 401 insertions(+), 472 deletions(-) create mode 100644 requirement_bazaar/src/main/resources/migrations/V9__more_delete_constraints.sql diff --git a/CHANGELOG.md b/CHANGELOG.md index 522e1c99..277c490b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas - Added endpoints to provide anonymous feedback which can be read by project admins [#85](https://github.com/rwth-acis/RequirementsBazaar/pull/85) - Added endpoint to search for users by name or email [#90](https://github.com/rwth-acis/RequirementsBazaar/pull/90) +- Categroies, projects and requirements now have a `lastActivity` + attribute [#91](https://github.com/rwth-acis/RequirementsBazaar/pull/91). ### Changed @@ -38,9 +40,14 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas attribute in `EntityContext` to `categories` [#83](https://github.com/rwth-acis/RequirementsBazaar/pull/82) - Rework permission system as lined out in [Privileges](docs/Privileges.md) [#85](https://github.com/rwth-acis/RequirementsBazaar/pull/85) -- Category `leader` attribute has been renamed to `creator` [#85](https://github.com/rwth-acis/RequirementsBazaar/pull/85) -- Voting now returns a 303 response with reference to the modified object [#85](https://github.com/rwth-acis/RequirementsBazaar/pull/85) -- Restrict user attributes normally returned to id, username, profile image and las2peerid [#90](https://github.com/rwth-acis/RequirementsBazaar/pull/90) +- Category `leader` attribute has been renamed + to `creator` [#85](https://github.com/rwth-acis/RequirementsBazaar/pull/85) +- Voting now returns a 303 response with reference to the modified + object [#85](https://github.com/rwth-acis/RequirementsBazaar/pull/85) +- Restrict user attributes normally returned to id, username, profile image and + las2peerid [#90](https://github.com/rwth-acis/RequirementsBazaar/pull/90) +- Requirements no longer return the category objects in the `categories` attribute but a list of category + Ids [#91](https://github.com/rwth-acis/RequirementsBazaar/pull/91). ## [0.7.2] - 2017-10-25 diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index dfc9381c..31ae2e29 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -293,8 +293,8 @@ public Requirement getRequirementById(int requirementId, int userId) throws Exce public Requirement createRequirement(Requirement requirement, int userId) throws Exception { requirementRepository = (requirementRepository != null) ? requirementRepository : new RequirementRepositoryImpl(dslContext); Requirement newRequirement = requirementRepository.add(requirement); - for (Category category : requirement.getCategories()) { - addCategoryTag(newRequirement.getId(), category.getId()); + for (Integer category : requirement.getCategories()) { + addCategoryTag(newRequirement.getId(), category); } return getRequirementById(newRequirement.getId(), userId); } @@ -308,8 +308,8 @@ public Requirement modifyRequirement(Requirement modifiedRequirement, int userId PaginationResult oldCategories = listCategoriesByRequirementId(modifiedRequirement.getId(), new PageInfo(0, 1000, new HashMap<>()), userId); for (Category oldCategory : oldCategories.getElements()) { boolean containCategory = false; - for (Category newCategory : modifiedRequirement.getCategories()) { - if (oldCategory.getId() == newCategory.getId()) { + for (Integer newCategory : modifiedRequirement.getCategories()) { + if (oldCategory.getId() == newCategory) { containCategory = true; break; } @@ -318,16 +318,16 @@ public Requirement modifyRequirement(Requirement modifiedRequirement, int userId deleteCategoryTag(modifiedRequirement.getId(), oldCategory.getId()); } } - for (Category newCategory : modifiedRequirement.getCategories()) { + for (Integer newCategory : modifiedRequirement.getCategories()) { boolean containCategory = false; for (Category oldCategory : oldCategories.getElements()) { - if (oldCategory.getId() == newCategory.getId()) { + if (oldCategory.getId() == newCategory) { containCategory = true; break; } } if (!containCategory) { - addCategoryTag(modifiedRequirement.getId(), newCategory.getId()); + addCategoryTag(modifiedRequirement.getId(), newCategory); } } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java index afd7cfba..38afa7fa 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java @@ -61,9 +61,12 @@ public class Category extends EntityBase implements Ownable { @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") private LocalDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") private LocalDateTime lastUpdatedDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") + private LocalDateTime lastActivity; + private Integer numberOfRequirements; private Integer numberOfFollowers; private Boolean isFollower; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java index 9dca9b3e..a43739ad 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java @@ -38,6 +38,7 @@ public class Requirement extends EntityBase implements Ownable { private LocalDateTime realized; @Min(value = 0) + @NotNull(message = "A project id must be provided", groups = CreateValidation.class) private int projectId; private User creator; @@ -45,7 +46,7 @@ public class Requirement extends EntityBase implements Ownable { @NotNull(message = "categories should not be null", groups = CreateValidation.class) @Size(min = 1, groups = CreateValidation.class) - private List categories; + private List categories; // This field is not filled because attachments should be not included in requirements response. // But the API still allows to create a requirement with attachments at the same time. @@ -57,6 +58,9 @@ public class Requirement extends EntityBase implements Ownable { @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") private LocalDateTime lastUpdatedDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") + private LocalDateTime lastActivity; + private Integer numberOfComments; private Integer numberOfAttachments; private Integer numberOfFollowers; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java index ec2dcfb8..60387ba2 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java @@ -24,6 +24,7 @@ import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.UserRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Category; import de.rwth.dbis.acis.bazaar.service.dal.entities.Statistic; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; import de.rwth.dbis.acis.bazaar.service.dal.transform.CategoryTransformer; @@ -32,14 +33,14 @@ import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionLocation; +import org.apache.commons.lang3.tuple.ImmutablePair; import org.jooq.Record; import org.jooq.*; import org.jooq.exception.DataAccessException; import org.jooq.impl.DSL; import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.List; +import java.util.*; import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; import static org.jooq.impl.DSL.*; @@ -103,6 +104,9 @@ public class CategoryRepositoryImpl extends RepositoryImpl, Integer> getFilteredCategories(Collection categoryFilter, Pageable pageable, int userId) throws Exception { + List categories; + categories = new ArrayList<>(); + + Field idCount = jooq.selectCount() + .from(CATEGORY) + .where(categoryFilter) + .asField("idCount"); + + Field isFollower = DSL.select(DSL.count()) + .from(CATEGORY_FOLLOWER_MAP) + .where(CATEGORY_FOLLOWER_MAP.CATEGORY_ID.equal(CATEGORY.ID).and(CATEGORY_FOLLOWER_MAP.USER_ID.equal(userId))) + .asField("isFollower"); + + Field lastActivity = DSL.select(LAST_ACTIVITY.field("last_activity")).from(LAST_ACTIVITY) + .where(LAST_ACTIVITY.field(CATEGORY.ID).equal(CATEGORY.ID)) + .asField("lastActivity"); + + List queryResults = jooq.select(CATEGORY.fields()) + .select(idCount) + .select(REQUIREMENT_COUNT) + .select(FOLLOWER_COUNT) + .select(isFollower) + .select(leaderUser.fields()) + .select(lastActivity) + .from(CATEGORY) + .leftOuterJoin(leaderUser).on(leaderUser.ID.equal(CATEGORY.LEADER_ID)) + .leftOuterJoin(REQUIREMENT_CATEGORY_MAP).on(REQUIREMENT_CATEGORY_MAP.CATEGORY_ID.equal(CATEGORY.ID)) + .leftOuterJoin(LAST_ACTIVITY).on(CATEGORY.ID.eq(LAST_ACTIVITY.field(CATEGORY.ID))) + .where(categoryFilter) + .orderBy(transformer.getSortFields(pageable.getSorts())) + .limit(pageable.getPageSize()) + .offset(pageable.getOffset()) + .fetch(); + + for (Record queryResult : queryResults) { + CategoryRecord categoryRecord = queryResult.into(CATEGORY); + Category category = transformer.getEntityFromTableRecord(categoryRecord); + UserTransformer userTransformer = new UserTransformer(); + UserRecord userRecord = queryResult.into(leaderUser); + category.setCreator(userTransformer.getEntityFromTableRecord(userRecord)); + category.setNumberOfRequirements((Integer) queryResult.getValue(REQUIREMENT_COUNT)); + category.setNumberOfFollowers((Integer) queryResult.getValue(FOLLOWER_COUNT)); + category.setLastActivity((LocalDateTime) queryResult.getValue(lastActivity)); + if (userId != 1) { + category.setIsFollower((Integer) queryResult.getValue(isFollower) != 0); + } + categories.add(category); + } + int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); + return ImmutablePair.of(categories, total); + } + + private ImmutablePair, Integer> getFilteredCategories(Condition categoryFilter, Pageable pageable, int userId) throws Exception { + return getFilteredCategories(Collections.singletonList(categoryFilter), pageable, userId); + } + + private ImmutablePair, Integer> getFilteredCategories(Condition categoryFilter, int userId) throws Exception { + return getFilteredCategories(categoryFilter, new PageInfo(0, 1000, new HashMap<>()), userId); + } + @Override public Category findById(int id, int userId) throws BazaarException { Category category = null; try { - de.rwth.dbis.acis.bazaar.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); - - Field isFollower = DSL.select(DSL.count()) - .from(CATEGORY_FOLLOWER_MAP) - .where(CATEGORY_FOLLOWER_MAP.CATEGORY_ID.equal(CATEGORY.ID).and(CATEGORY_FOLLOWER_MAP.USER_ID.equal(userId))) - .asField("isFollower"); - - Result queryResult = jooq.select(CATEGORY.fields()) - .select(REQUIREMENT_COUNT) - .select(FOLLOWER_COUNT) - .select(isFollower) - .select(leaderUser.fields()) - .from(CATEGORY) - .leftOuterJoin(leaderUser).on(leaderUser.ID.equal(CATEGORY.LEADER_ID)) - .where(transformer.getTableId().equal(id)) - .fetch(); + Condition filterCondition = transformer.getTableId().equal(id); + + ImmutablePair, Integer> filteredCategories = getFilteredCategories(filterCondition, userId); - if (queryResult == null || queryResult.size() == 0) { + if (filteredCategories.left == null || filteredCategories.left.size() == 0) { ExceptionHandler.getInstance().convertAndThrowException( new Exception("No " + transformer.getRecordClass() + " found with id: " + id), ExceptionLocation.REPOSITORY, ErrorCode.NOT_FOUND); } - Category.Builder builder = Category.builder() - .name(queryResult.getValues(CATEGORY.NAME).get(0)) - .description(queryResult.getValues(CATEGORY.DESCRIPTION).get(0)) - .projectId(queryResult.getValues(CATEGORY.PROJECT_ID).get(0)) - .id(queryResult.getValues(CATEGORY.ID).get(0)) - .creationDate(queryResult.getValues(CATEGORY.CREATION_DATE).get(0)) - .lastUpdatedDate(queryResult.getValues(CATEGORY.LAST_UPDATED_DATE).get(0)); - - UserTransformer userTransformer = new UserTransformer(); - //Filling up LeadDeveloper - builder.creator(userTransformer.getEntityFromQueryResult(leaderUser, queryResult)); - - category = builder.build(); - - // Filling additional information - category.setNumberOfRequirements((Integer) queryResult.getValues(REQUIREMENT_COUNT).get(0)); - category.setNumberOfFollowers((Integer) queryResult.getValues(FOLLOWER_COUNT).get(0)); - if (userId != 1) { - category.setIsFollower(0 != (Integer) queryResult.getValues(isFollower).get(0)); - } + category = filteredCategories.left.get(0); } catch (BazaarException be) { ExceptionHandler.getInstance().convertAndThrowException(be); @@ -169,53 +202,13 @@ public Category findById(int id, int userId) throws BazaarException { @Override public PaginationResult findByProjectId(int projectId, Pageable pageable, int userId) throws BazaarException { PaginationResult result = null; - List categories; try { - categories = new ArrayList<>(); - de.rwth.dbis.acis.bazaar.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); + Condition filterCondition = CATEGORY.PROJECT_ID.equal(projectId) + .and(transformer.getSearchCondition(pageable.getSearch())); - Field idCount = jooq.selectCount() - .from(CATEGORY) - .where(CATEGORY.PROJECT_ID.equal(projectId)) - .and(transformer.getSearchCondition(pageable.getSearch())) - .asField("idCount"); - - Field isFollower = DSL.select(DSL.count()) - .from(CATEGORY_FOLLOWER_MAP) - .where(CATEGORY_FOLLOWER_MAP.CATEGORY_ID.equal(CATEGORY.ID).and(CATEGORY_FOLLOWER_MAP.USER_ID.equal(userId))) - .asField("isFollower"); - - List queryResults = jooq.select(CATEGORY.fields()) - .select(idCount) - .select(REQUIREMENT_COUNT) - .select(FOLLOWER_COUNT) - .select(isFollower) - .select(leaderUser.fields()) - .from(CATEGORY) - .leftOuterJoin(leaderUser).on(leaderUser.ID.equal(CATEGORY.LEADER_ID)) - .leftOuterJoin(LAST_ACTIVITY).on(CATEGORY.ID.eq(LAST_ACTIVITY.field(CATEGORY.ID))) - .where(CATEGORY.PROJECT_ID.equal(projectId)) - .and(transformer.getSearchCondition(pageable.getSearch())) - .orderBy(transformer.getSortFields(pageable.getSorts())) - .limit(pageable.getPageSize()) - .offset(pageable.getOffset()) - .fetch(); - - for (Record queryResult : queryResults) { - CategoryRecord categoryRecord = queryResult.into(CATEGORY); - Category category = transformer.getEntityFromTableRecord(categoryRecord); - UserTransformer userTransformer = new UserTransformer(); - UserRecord userRecord = queryResult.into(leaderUser); - category.setCreator(userTransformer.getEntityFromTableRecord(userRecord)); - category.setNumberOfRequirements((Integer) queryResult.getValue(REQUIREMENT_COUNT)); - category.setNumberOfFollowers((Integer) queryResult.getValue(FOLLOWER_COUNT)); - if (userId != 1) { - category.setIsFollower(0 != (Integer) queryResult.getValue(isFollower)); - } - categories.add(category); - } - int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); - result = new PaginationResult<>(total, pageable, categories); + ImmutablePair, Integer> filteredCategories = getFilteredCategories(filterCondition, pageable, userId); + + result = new PaginationResult<>(filteredCategories.right, pageable, filteredCategories.left); } catch (Exception e) { ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); } @@ -225,71 +218,19 @@ public PaginationResult findByProjectId(int projectId, Pageable pageab @Override public PaginationResult findAll(Pageable pageable, int userId) throws BazaarException { PaginationResult result = null; - List categories; try { - categories = new ArrayList<>(); - de.rwth.dbis.acis.bazaar.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); + Collection filterCondition = (Collection) transformer.getFilterConditions(pageable.getFilters()); + filterCondition.add(transformer.getSearchCondition(pageable.getSearch())); - Field idCount = jooq.selectCount() - .from(CATEGORY) - .where(transformer.getFilterConditions(pageable.getFilters())) - .and(transformer.getSearchCondition(pageable.getSearch())) - .asField("idCount"); - - Field requirementCount = jooq.select(DSL.count()) - .from(REQUIREMENT) - .leftJoin(REQUIREMENT_CATEGORY_MAP).on(REQUIREMENT.ID.equal(REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID)) - .where(REQUIREMENT_CATEGORY_MAP.CATEGORY_ID.equal(CATEGORY.ID)) - .asField("requirementCount"); - - Field followerCount = jooq.select(DSL.count()) - .from(CATEGORY_FOLLOWER_MAP) - .where(CATEGORY_FOLLOWER_MAP.CATEGORY_ID.equal(CATEGORY.ID)) - .asField("followerCount"); - - Field isFollower = DSL.select(DSL.count()) - .from(CATEGORY_FOLLOWER_MAP) - .where(CATEGORY_FOLLOWER_MAP.CATEGORY_ID.equal(CATEGORY.ID).and(CATEGORY_FOLLOWER_MAP.USER_ID.equal(userId))) - .asField("isFollower"); - - List queryResults = jooq.select(CATEGORY.fields()) - .select(idCount) - .select(requirementCount) - .select(followerCount) - .select(isFollower) - .select(leaderUser.fields()) - .from(CATEGORY) - .leftOuterJoin(leaderUser).on(leaderUser.ID.equal(CATEGORY.LEADER_ID)) - .leftOuterJoin(LAST_ACTIVITY).on(CATEGORY.ID.eq(LAST_ACTIVITY.field(CATEGORY.ID))) - .where(transformer.getFilterConditions(pageable.getFilters())) - .and(transformer.getSearchCondition(pageable.getSearch())) - .orderBy(transformer.getSortFields(pageable.getSorts())) - .limit(pageable.getPageSize()) - .offset(pageable.getOffset()) - .fetch(); - - for (Record queryResult : queryResults) { - CategoryRecord categoryRecord = queryResult.into(CATEGORY); - Category category = transformer.getEntityFromTableRecord(categoryRecord); - UserTransformer userTransformer = new UserTransformer(); - UserRecord userRecord = queryResult.into(leaderUser); - category.setCreator(userTransformer.getEntityFromTableRecord(userRecord)); - category.setNumberOfRequirements((Integer) queryResult.getValue(requirementCount)); - category.setNumberOfFollowers((Integer) queryResult.getValue(followerCount)); - if (userId != 1) { - category.setIsFollower(0 != (Integer) queryResult.getValue(isFollower)); - } - categories.add(category); - } - int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); - result = new PaginationResult<>(total, pageable, categories); + ImmutablePair, Integer> filteredCategories = getFilteredCategories(filterCondition, pageable, userId); + + result = new PaginationResult<>(filteredCategories.right, pageable, filteredCategories.left); } catch (Exception e) { ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); } return result; } - @Override public List listAllCategoryIds(Pageable pageable, int userId) throws BazaarException { List categoryIds = new ArrayList<>(); @@ -309,59 +250,16 @@ public List listAllCategoryIds(Pageable pageable, int userId) throws Ba return categoryIds; } - - - @Override public PaginationResult findByRequirementId(int requirementId, Pageable pageable, int userId) throws BazaarException { PaginationResult result = null; - List categories; try { - categories = new ArrayList<>(); - de.rwth.dbis.acis.bazaar.dal.jooq.tables.User leaderUser = USER.as("leaderUser"); + Condition filterCondition = REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID.equal(requirementId); - Field idCount = jooq.selectCount() - .from(CATEGORY) - .join(REQUIREMENT_CATEGORY_MAP).on(REQUIREMENT_CATEGORY_MAP.CATEGORY_ID.equal(CATEGORY.ID)) - .where(REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID.equal(requirementId)) - .asField("idCount"); - - Field isFollower = DSL.select(DSL.count()) - .from(CATEGORY_FOLLOWER_MAP) - .where(CATEGORY_FOLLOWER_MAP.CATEGORY_ID.equal(CATEGORY.ID).and(CATEGORY_FOLLOWER_MAP.USER_ID.equal(userId))) - .asField("isFollower"); - - List queryResults = jooq.select(CATEGORY.fields()) - .select(idCount) - .select(REQUIREMENT_COUNT) - .select(FOLLOWER_COUNT) - .select(isFollower) - .select(leaderUser.fields()) - .from(CATEGORY) - .leftOuterJoin(leaderUser).on(leaderUser.ID.equal(CATEGORY.LEADER_ID)) - .leftOuterJoin(REQUIREMENT_CATEGORY_MAP).on(REQUIREMENT_CATEGORY_MAP.CATEGORY_ID.equal(CATEGORY.ID)) - .where(REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID.equal(requirementId)) - .orderBy(transformer.getSortFields(pageable.getSorts())) - .limit(pageable.getPageSize()) - .offset(pageable.getOffset()) - .fetch(); - - for (Record queryResult : queryResults) { - CategoryRecord categoryRecord = queryResult.into(CATEGORY); - Category category = transformer.getEntityFromTableRecord(categoryRecord); - UserTransformer userTransformer = new UserTransformer(); - UserRecord userRecord = queryResult.into(leaderUser); - category.setCreator(userTransformer.getEntityFromTableRecord(userRecord)); - category.setNumberOfRequirements((Integer) queryResult.getValue(REQUIREMENT_COUNT)); - category.setNumberOfFollowers((Integer) queryResult.getValue(FOLLOWER_COUNT)); - if (userId != 1) { - category.setIsFollower((Integer) queryResult.getValue(isFollower) != 0); - } - categories.add(category); - } - int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); - result = new PaginationResult<>(total, pageable, categories); - } catch (DataAccessException e) { + ImmutablePair, Integer> fileredCategories = getFilteredCategories(filterCondition, pageable, userId); + + result = new PaginationResult<>(fileredCategories.right, pageable, fileredCategories.left); + } catch (Exception e) { ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); } return result; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java index c4611cc9..0636a59f 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java @@ -20,20 +20,19 @@ package de.rwth.dbis.acis.bazaar.service.dal.repositories; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementCategoryMapRecord; import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementRecord; -import de.rwth.dbis.acis.bazaar.service.dal.entities.Category; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Attachment; import de.rwth.dbis.acis.bazaar.service.dal.entities.Requirement; import de.rwth.dbis.acis.bazaar.service.dal.entities.Statistic; -import de.rwth.dbis.acis.bazaar.service.dal.helpers.EntityContextFactory; -import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; -import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; -import de.rwth.dbis.acis.bazaar.service.dal.helpers.UserVote; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.*; import de.rwth.dbis.acis.bazaar.service.dal.transform.RequirementTransformer; import de.rwth.dbis.acis.bazaar.service.dal.transform.UserTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionLocation; +import org.apache.commons.lang3.tuple.ImmutablePair; import org.jooq.Record; import org.jooq.*; import org.jooq.exception.DataAccessException; @@ -41,10 +40,7 @@ import java.math.BigDecimal; import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; import static org.jooq.impl.DSL.*; @@ -101,6 +97,11 @@ public class RequirementRepositoryImpl extends RepositoryImpl, Integer> getFilteredRequirements(Collection requirementFilter, Pageable pageable, int userId) throws Exception { + List requirements = new ArrayList<>(); + + Field idCount = jooq.selectCount() + .from(REQUIREMENT) + .where(requirementFilter) + .asField("idCount"); + + Field isFollower = DSL.select(DSL.count()) + .from(REQUIREMENT_FOLLOWER_MAP) + .where(REQUIREMENT_FOLLOWER_MAP.REQUIREMENT_ID.equal(REQUIREMENT.ID).and(REQUIREMENT_FOLLOWER_MAP.USER_ID.equal(userId))) + .asField("isFollower"); + + Field isDeveloper = DSL.select(DSL.count()) + .from(REQUIREMENT_DEVELOPER_MAP) + .where(REQUIREMENT_DEVELOPER_MAP.REQUIREMENT_ID.equal(REQUIREMENT.ID).and(REQUIREMENT_DEVELOPER_MAP.USER_ID.equal(userId))) + .asField("isDeveloper"); + + Condition isAuthorizedCondition = REQUIREMENT.PROJECT_ID.in( + DSL.select(PROJECT.ID) + .from(PROJECT) + .where(PROJECT.ID.eq(REQUIREMENT.PROJECT_ID)) + .and(PROJECT.VISIBILITY.isTrue().or(PROJECT.LEADER_ID.eq(userId))) + ); + + Field lastActivity = DSL.select(LAST_ACTIVITY.field("last_activity")).from(LAST_ACTIVITY) + .where(LAST_ACTIVITY.field(REQUIREMENT.ID).equal(REQUIREMENT.ID)) + .asField("lastActivity"); + + // Contributors = {Creator, Lead Developer, Developers, Comments creators, Attachments creators} + // This code could be improved so that not only "1" or "0" will return but how much contributions an user made + // I tried this for 2-3 hours. SQL ... yeah ... I leave this to someone else. :-> + // TODO: Try the first idea from here: http://stackoverflow.com/questions/43717672/sum-over-multiple-count-field/43721212?noredirect=1#comment74498115_43721212 + Field isContributor = select(sum(choose() + .when(REQUIREMENT.CREATOR_ID.eq(userId), inline(1)) + .when(REQUIREMENT.LEAD_DEVELOPER_ID.eq(userId), inline(1)) + .when(REQUIREMENT_DEVELOPER_MAP.USER_ID.eq(userId), inline(1)) + .when(COMMENT.USER_ID.eq(userId), inline(1)) + .when(ATTACHMENT.USER_ID.eq(userId), inline(1)) + .otherwise(inline(0)) + )) + .from(REQUIREMENT) + .leftOuterJoin(REQUIREMENT_DEVELOPER_MAP).on(REQUIREMENT_DEVELOPER_MAP.REQUIREMENT_ID.equal(REQUIREMENT.ID)) + .leftOuterJoin(COMMENT).on(COMMENT.REQUIREMENT_ID.equal(REQUIREMENT.ID)) + .leftOuterJoin(ATTACHMENT).on(ATTACHMENT.REQUIREMENT_ID.equal(REQUIREMENT.ID)) + .asField("isContributor"); + + + Result queryResults = jooq.select(REQUIREMENT.fields()) + .select(idCount) + .select(COMMENT_COUNT) + .select(ATTACHMENT_COUNT) + .select(FOLLOWER_COUNT) + .select(isFollower) + .select(isDeveloper) + .select(isContributor) + .select(creatorUser.fields()) + .select(leadDeveloperUser.fields()) + .select(PROJECT.fields()) + .select(lastActivity) + .from(REQUIREMENT) + .join(creatorUser).on(creatorUser.ID.equal(REQUIREMENT.CREATOR_ID)) + .leftOuterJoin(leadDeveloperUser).on(leadDeveloperUser.ID.equal(REQUIREMENT.LEAD_DEVELOPER_ID)) + .leftOuterJoin(PROJECT).on(PROJECT.ID.equal(REQUIREMENT.PROJECT_ID)) + .leftOuterJoin(LAST_ACTIVITY).on(REQUIREMENT.ID.eq(LAST_ACTIVITY.field(REQUIREMENT.ID))) + .where(requirementFilter) + .and(isAuthorizedCondition) + .fetch(); + + for (Record queryResult : queryResults) { + RequirementRecord requirementRecord = queryResult.into(REQUIREMENT); + Requirement requirement = transformer.getEntityFromTableRecord(requirementRecord); + requirement.setLastActivity((LocalDateTime) queryResult.getValue(lastActivity)); + + UserTransformer userTransformer = new UserTransformer(); + //Filling up Creator + requirement.setCreator( + userTransformer.getEntityFromTableRecord(queryResult.into(creatorUser)) + ); + + //Filling up LeadDeveloper + if (queryResult.getValue(leadDeveloperUser.ID) != null) { + requirement.setLeadDeveloper( + userTransformer.getEntityFromTableRecord(queryResult.into(leadDeveloperUser)) + ); + } + + //Filling up votes + Result voteQueryResult = jooq.select(DSL.count(DSL.nullif(vote.IS_UPVOTE, 0)).as("upVotes")) + .select(DSL.count(DSL.nullif(vote.IS_UPVOTE, 1)).as("downVotes")) + .select(userVote.IS_UPVOTE.as("userVoted")) + .from(REQUIREMENT) + .leftOuterJoin(vote).on(vote.REQUIREMENT_ID.eq(REQUIREMENT.ID)) + .leftOuterJoin(userVote).on(userVote.REQUIREMENT_ID.eq(REQUIREMENT.ID).and(userVote.USER_ID.eq(userId))) + .where(transformer.getTableId().equal(requirement.getId())) + .groupBy(userVote.IS_UPVOTE) + .fetch(); + + requirement.setUpVotes(voteQueryResult.get(0).getValue("upVotes", Integer.class)); + requirement.setDownVotes(voteQueryResult.get(0).getValue("downVotes", Integer.class)); + requirement.setUserVoted(transformToUserVoted(voteQueryResult.get(0).getValue("userVoted", Integer.class))); + + //Filling up categories + List categories = new ArrayList<>(); + + Result categoryRecord = jooq.selectFrom(REQUIREMENT_CATEGORY_MAP).where(REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID.eq(requirement.getId())).fetch(); + + categoryRecord.forEach(record -> categories.add(record.getValue(REQUIREMENT_CATEGORY_MAP.CATEGORY_ID))); + + requirement.setCategories(categories); + + //Filling up additional information + requirement.setNumberOfComments((Integer) queryResult.getValue(COMMENT_COUNT)); + requirement.setNumberOfAttachments((Integer) queryResult.getValue(ATTACHMENT_COUNT)); + requirement.setNumberOfFollowers((Integer) queryResult.getValue(FOLLOWER_COUNT)); + if (userId != 1) { + requirement.setIsFollower(0 != (Integer) queryResult.getValue(isFollower)); + requirement.setIsDeveloper(0 != (Integer) queryResult.getValue(isDeveloper)); + requirement.setIsContributor(!Objects.equals(queryResult.getValue(isContributor), new BigDecimal(0))); + } + + if (requirement.getNumberOfAttachments() > 0) { + AttachmentRepository attachmentRepository = new AttachmentRepositoryImpl(this.jooq); + List attachmentList = attachmentRepository.findAllByRequirementId(requirement.getId(), new PageInfo(0, 1000, new HashMap<>())).getElements(); + requirement.setAttachments(attachmentList); + } + + requirement.setContext(EntityContextFactory.create(pageable.getEmbed(), queryResult)); + requirements.add(requirement); + } + int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); + + return ImmutablePair.of(requirements, total); + } + + private ImmutablePair, Integer> getFilteredRequirements(Condition requirementFilter, Pageable pageable, int userId) throws Exception { + return getFilteredRequirements(Collections.singletonList(requirementFilter), pageable, userId); + } + + private ImmutablePair, Integer> getFilteredRequirements(Condition requirementFilter, int userId) throws Exception { + return getFilteredRequirements(requirementFilter, new PageInfo(0, 1000, new HashMap<>()), userId); + } + @Override public List listAllRequirementIds(Pageable pageable, int userId) throws BazaarException { List requirementIds = new ArrayList<>(); @@ -115,7 +259,7 @@ public List listAllRequirementIds(Pageable pageable, int userId) throws requirementIds = jooq.select() .from(REQUIREMENT) .where(transformer.getFilterConditions(pageable.getFilters())) - .and(transformer.getSearchCondition(pageable.getSearch())) + .and(transformer.getSearchCondition(pageable.getSearch())) .orderBy(transformer.getSortFields(pageable.getSorts())) // .limit(pageable.getPageSize()) // .offset(pageable.getOffset()) @@ -130,48 +274,14 @@ public List listAllRequirementIds(Pageable pageable, int userId) throws @Override public PaginationResult findAll(Pageable pageable, int userId) throws BazaarException { PaginationResult result = null; - List requirements; try { - requirements = new ArrayList<>(); + Collection filterCondition = (Collection) transformer.getFilterConditions(pageable.getFilters()); + filterCondition.add(transformer.getSearchCondition(pageable.getSearch())); - Field idCount = jooq.selectCount() - .from(REQUIREMENT) - .where(transformer.getFilterConditions(pageable.getFilters())) - .and(transformer.getSearchCondition(pageable.getSearch())) - //.and(REQUIREMENT.PROJECT_ID.eq(projectId)) - .asField("idCount"); - - - Condition isAuthorizedCondition = REQUIREMENT.PROJECT_ID.in( - DSL.select(PROJECT.ID) - .from(PROJECT) - .where(PROJECT.ID.eq(REQUIREMENT.PROJECT_ID)) - .and(PROJECT.VISIBILITY.isTrue().or(PROJECT.LEADER_ID.eq(userId))) - ); - - List queryResults = jooq.select(REQUIREMENT.fields()) - .select(idCount) - .select(VOTE_COUNT) - .select(COMMENT_COUNT) - .select(FOLLOWER_COUNT) - .from(REQUIREMENT) - .leftOuterJoin(LAST_ACTIVITY).on(REQUIREMENT.ID.eq(LAST_ACTIVITY.field(REQUIREMENT.ID))) - .where(transformer.getFilterConditions(pageable.getFilters())) - .and(transformer.getSearchCondition(pageable.getSearch())) - .and(isAuthorizedCondition) - .groupBy(REQUIREMENT.ID) - .orderBy(transformer.getSortFields(pageable.getSorts())) - .limit(pageable.getPageSize()) - .offset(pageable.getOffset()) - .fetch(); + ImmutablePair, Integer> filteredRequirements = getFilteredRequirements(filterCondition, pageable, userId); + + result = new PaginationResult<>(filteredRequirements.right, pageable, filteredRequirements.left); - for (Record queryResult : queryResults) { - RequirementRecord requirementRecord = queryResult.into(REQUIREMENT); - Requirement requirement = transformer.getEntityFromTableRecord(requirementRecord); - requirements.add(findById(requirement.getId(), userId, pageable.getEmbed())); // TODO: Remove the getId call and create the objects themself here - } - int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); - result = new PaginationResult<>(total, pageable, requirements); } catch (DataAccessException e) { ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); } catch (Exception e) { @@ -183,40 +293,14 @@ public PaginationResult findAll(Pageable pageable, int userId) thro @Override public PaginationResult findAllByProject(int projectId, Pageable pageable, int userId) throws BazaarException { PaginationResult result = null; - List requirements; try { - requirements = new ArrayList<>(); + Collection filterCondition = (Collection) transformer.getFilterConditions(pageable.getFilters()); + filterCondition.add(transformer.getSearchCondition(pageable.getSearch())); + filterCondition.add(REQUIREMENT.PROJECT_ID.eq(projectId)); - Field idCount = jooq.selectCount() - .from(REQUIREMENT) - .where(transformer.getFilterConditions(pageable.getFilters())) - .and(transformer.getSearchCondition(pageable.getSearch())) - .and(REQUIREMENT.PROJECT_ID.eq(projectId)) - .asField("idCount"); - - List queryResults = jooq.select(REQUIREMENT.fields()) - .select(idCount) - .select(VOTE_COUNT) - .select(COMMENT_COUNT) - .select(FOLLOWER_COUNT) - .from(REQUIREMENT) - .leftOuterJoin(LAST_ACTIVITY).on(REQUIREMENT.ID.eq(LAST_ACTIVITY.field(REQUIREMENT.ID))) - .where(transformer.getFilterConditions(pageable.getFilters())) - .and(transformer.getSearchCondition(pageable.getSearch())) - .and(REQUIREMENT.PROJECT_ID.eq(projectId)) - .groupBy(REQUIREMENT.ID) - .orderBy(transformer.getSortFields(pageable.getSorts())) - .limit(pageable.getPageSize()) - .offset(pageable.getOffset()) - .fetch(); + ImmutablePair, Integer> filteredRequirements = getFilteredRequirements(filterCondition, pageable, userId); - for (Record queryResult : queryResults) { - RequirementRecord requirementRecord = queryResult.into(REQUIREMENT); - Requirement requirement = transformer.getEntityFromTableRecord(requirementRecord); - requirements.add(findById(requirement.getId(), userId)); // TODO: Remove the getId call and create the objects themself here - } - int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); - result = new PaginationResult<>(total, pageable, requirements); + result = new PaginationResult<>(filteredRequirements.right, pageable, filteredRequirements.left); } catch (DataAccessException e) { ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); } catch (Exception e) { @@ -245,56 +329,14 @@ private UserVote transformToUserVoted(Integer userVotedInt) { @Override public PaginationResult findAllByCategory(int categoryId, Pageable pageable, int userId) throws BazaarException { PaginationResult result = null; - List requirements; try { - requirements = new ArrayList<>(); + Collection filterCondition = (Collection) transformer.getFilterConditions(pageable.getFilters()); + filterCondition.add(transformer.getSearchCondition(pageable.getSearch())); + filterCondition.add(REQUIREMENT_CATEGORY_MAP.CATEGORY_ID.eq(categoryId)); - Field idCount = jooq.selectCount() - .from(REQUIREMENT) - .join(REQUIREMENT_CATEGORY_MAP).on(REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID.eq(REQUIREMENT.ID)) - .where(transformer.getFilterConditions(pageable.getFilters())) - .and(transformer.getSearchCondition(pageable.getSearch())) - .and(REQUIREMENT_CATEGORY_MAP.CATEGORY_ID.eq(categoryId)) - .asField("idCount"); - - Field voteCount = jooq.select(DSL.count(DSL.nullif(VOTE.IS_UPVOTE, 0))) - .from(VOTE) - .where(VOTE.REQUIREMENT_ID.equal(REQUIREMENT.ID)) - .asField("voteCount"); - - Field commentCount = jooq.select(DSL.count()) - .from(COMMENT) - .where(COMMENT.REQUIREMENT_ID.equal(REQUIREMENT.ID)) - .asField("commentCount"); - - Field followerCount = jooq.select(DSL.count()) - .from(REQUIREMENT_FOLLOWER_MAP) - .where(REQUIREMENT_FOLLOWER_MAP.REQUIREMENT_ID.equal(REQUIREMENT.ID)) - .asField("followerCount"); - - List queryResults = jooq.select(REQUIREMENT.fields()) - .select(idCount) - .select(VOTE_COUNT) - .select(COMMENT_COUNT) - .select(FOLLOWER_COUNT) - .from(REQUIREMENT) - .leftOuterJoin(REQUIREMENT_CATEGORY_MAP).on(REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID.eq(REQUIREMENT.ID)) - .leftOuterJoin(LAST_ACTIVITY).on(REQUIREMENT.ID.eq(LAST_ACTIVITY.field(REQUIREMENT.ID))) - .where(transformer.getFilterConditions(pageable.getFilters())) - .and(transformer.getSearchCondition(pageable.getSearch())) - .and(REQUIREMENT_CATEGORY_MAP.CATEGORY_ID.eq(categoryId)) - .groupBy(REQUIREMENT.ID) - .orderBy(transformer.getSortFields(pageable.getSorts())) - .limit(pageable.getPageSize()) - .offset(pageable.getOffset()) - .fetch(); + ImmutablePair, Integer> filteredRequirements = getFilteredRequirements(filterCondition, pageable, userId); - for (Record queryResult : queryResults) { - RequirementRecord requirementRecord = queryResult.into(RequirementRecord.class); - requirements.add(findById(requirementRecord.getId(), userId)); // TODO: Remove the getId call and create the objects themself here - } - int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); - result = new PaginationResult<>(total, pageable, requirements); + result = new PaginationResult<>(filteredRequirements.right, pageable, filteredRequirements.left); } catch (Exception e) { ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); } @@ -323,135 +365,18 @@ public Requirement findById(int id, int userId) throws Exception { public Requirement findById(int id, int userId, List embed) throws Exception { Requirement requirement = null; try { - de.rwth.dbis.acis.bazaar.dal.jooq.tables.User creatorUser = USER.as("creatorUser"); - de.rwth.dbis.acis.bazaar.dal.jooq.tables.User leadDeveloperUser = USER.as("leadDeveloperUser"); - de.rwth.dbis.acis.bazaar.dal.jooq.tables.Vote vote = VOTE.as("vote"); - de.rwth.dbis.acis.bazaar.dal.jooq.tables.Vote userVote = VOTE.as("userVote"); - - Field isFollower = DSL.select(DSL.count()) - .from(REQUIREMENT_FOLLOWER_MAP) - .where(REQUIREMENT_FOLLOWER_MAP.REQUIREMENT_ID.equal(REQUIREMENT.ID).and(REQUIREMENT_FOLLOWER_MAP.USER_ID.equal(userId))) - .asField("isFollower"); - - Field isDeveloper = DSL.select(DSL.count()) - .from(REQUIREMENT_DEVELOPER_MAP) - .where(REQUIREMENT_DEVELOPER_MAP.REQUIREMENT_ID.equal(REQUIREMENT.ID).and(REQUIREMENT_DEVELOPER_MAP.USER_ID.equal(userId))) - .asField("isDeveloper"); - - // Contributors = {Creator, Lead Developer, Developers, Comments creators, Attachments creators} - // This code could be improved so that not only "1" or "0" will return but how much contributions an user made - // I tried this for 2-3 hours. SQL ... yeah ... I leave this to someone else. :-> - // TODO: Try the first idea from here: http://stackoverflow.com/questions/43717672/sum-over-multiple-count-field/43721212?noredirect=1#comment74498115_43721212 - Field isContributor = select(sum(choose() - .when(REQUIREMENT.CREATOR_ID.eq(userId), inline(1)) - .when(REQUIREMENT.LEAD_DEVELOPER_ID.eq(userId), inline(1)) - .when(REQUIREMENT_DEVELOPER_MAP.USER_ID.eq(userId), inline(1)) - .when(COMMENT.USER_ID.eq(userId), inline(1)) - .when(ATTACHMENT.USER_ID.eq(userId), inline(1)) - .otherwise(inline(0)) - )) - .from(REQUIREMENT) - .leftOuterJoin(REQUIREMENT_DEVELOPER_MAP).on(REQUIREMENT_DEVELOPER_MAP.REQUIREMENT_ID.equal(REQUIREMENT.ID)) - .leftOuterJoin(COMMENT).on(COMMENT.REQUIREMENT_ID.equal(REQUIREMENT.ID)) - .leftOuterJoin(ATTACHMENT).on(ATTACHMENT.REQUIREMENT_ID.equal(REQUIREMENT.ID)) - .where(REQUIREMENT.ID.equal(id)) - .asField("isContributor"); - - Result queryResult = jooq.select(REQUIREMENT.fields()) - .select(COMMENT_COUNT) - .select(ATTACHMENT_COUNT) - .select(FOLLOWER_COUNT) - .select(isFollower) - .select(isDeveloper) - .select(isContributor) - .select(creatorUser.fields()) - .select(leadDeveloperUser.fields()) - .select(CATEGORY.fields()) - .select(PROJECT.fields()) - .from(REQUIREMENT) - .join(creatorUser).on(creatorUser.ID.equal(REQUIREMENT.CREATOR_ID)) - .leftOuterJoin(leadDeveloperUser).on(leadDeveloperUser.ID.equal(REQUIREMENT.LEAD_DEVELOPER_ID)) - .leftOuterJoin(REQUIREMENT_CATEGORY_MAP).on(REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID.equal(REQUIREMENT.ID)) - .leftOuterJoin(CATEGORY).on(CATEGORY.ID.equal(REQUIREMENT_CATEGORY_MAP.CATEGORY_ID)) - .leftOuterJoin(PROJECT).on(PROJECT.ID.equal(REQUIREMENT.PROJECT_ID)) - .where(transformer.getTableId().equal(id)) - .fetch(); - if (queryResult == null || queryResult.size() == 0) { + Condition filterCondition = transformer.getTableId().equal(id); + + ImmutablePair, Integer> filteredRequirements = getFilteredRequirements(filterCondition, userId); + + if (filteredRequirements.left == null || filteredRequirements.left.size() == 0) { ExceptionHandler.getInstance().convertAndThrowException( new Exception("No " + transformer.getRecordClass() + " found with id: " + id), ExceptionLocation.REPOSITORY, ErrorCode.NOT_FOUND); } - //Filling up Requirement fields - Requirement.Builder builder = Requirement.builder().name(queryResult.getValues(REQUIREMENT.NAME).get(0)); - builder.id(queryResult.getValues(REQUIREMENT.ID).get(0)) - .description(queryResult.getValues(REQUIREMENT.DESCRIPTION).get(0)) - .realized(queryResult.getValues(REQUIREMENT.REALIZED).get(0)) - .creationDate(queryResult.getValues(REQUIREMENT.CREATION_DATE).get(0)) - .lastUpdatedDate(queryResult.getValues(REQUIREMENT.LAST_UPDATED_DATE).get(0)) - .projectId(queryResult.getValues(REQUIREMENT.PROJECT_ID).get(0)); - - UserTransformer userTransformer = new UserTransformer(); - //Filling up Creator - builder.creator( - userTransformer.getEntityFromQueryResult(creatorUser, queryResult) - ); - - //Filling up LeadDeveloper - if (queryResult.getValues(leadDeveloperUser.ID).get(0) != null) { - builder.leadDeveloper( - userTransformer.getEntityFromQueryResult(leadDeveloperUser, queryResult) - ); - } - - //Filling up votes - Result voteQueryResult = jooq.select(DSL.count(DSL.nullif(vote.IS_UPVOTE, 0)).as("upVotes")) - .select(DSL.count(DSL.nullif(vote.IS_UPVOTE, 1)).as("downVotes")) - .select(userVote.IS_UPVOTE.as("userVoted")) - .from(REQUIREMENT) - .leftOuterJoin(vote).on(vote.REQUIREMENT_ID.eq(REQUIREMENT.ID)) - .leftOuterJoin(userVote).on(userVote.REQUIREMENT_ID.eq(REQUIREMENT.ID).and(userVote.USER_ID.eq(userId))) - .where(transformer.getTableId().equal(id)) - .groupBy(userVote.IS_UPVOTE) - .fetch(); - - builder.upVotes(voteQueryResult.get(0).getValue("upVotes", Integer.class)); - builder.downVotes(voteQueryResult.get(0).getValue("downVotes", Integer.class)); - builder.userVoted(transformToUserVoted(voteQueryResult.get(0).getValue("userVoted", Integer.class))); - - - - requirement = builder.build(); - - //Filling up categories - List categories = new ArrayList<>(); - - for (Map.Entry> entry : queryResult.intoGroups(CATEGORY.ID).entrySet()) { - if (entry.getKey() == null) continue; - Result records = entry.getValue(); - categories.add( - Category.builder() - .name(records.getValues(CATEGORY.NAME).get(0)) - .projectId(records.getValues(CATEGORY.PROJECT_ID).get(0)) - .id(records.getValues(CATEGORY.ID).get(0)) - .description(records.getValues(CATEGORY.DESCRIPTION).get(0)) - .build() - ); - } - requirement.setCategories(categories); - - //Filling up additional information - requirement.setNumberOfComments((Integer) queryResult.getValues(COMMENT_COUNT).get(0)); - requirement.setNumberOfAttachments((Integer) queryResult.getValues(ATTACHMENT_COUNT).get(0)); - requirement.setNumberOfFollowers((Integer) queryResult.getValues(FOLLOWER_COUNT).get(0)); - if (userId != 1) { - requirement.setIsFollower(0 != (Integer) queryResult.getValues(isFollower).get(0)); - requirement.setIsDeveloper(0 != (Integer) queryResult.getValues(isDeveloper).get(0)); - requirement.setIsContributor(!Objects.equals(queryResult.getValues(isContributor).get(0), new BigDecimal(0))); - } - - requirement.setContext(EntityContextFactory.create(embed, queryResult.get(0))); + requirement = filteredRequirements.left.get(0); } catch (BazaarException be) { ExceptionHandler.getInstance().convertAndThrowException(be); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java index 5c1016d2..65c35f4a 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java @@ -69,8 +69,8 @@ public void sendActivityOverRMI(LocalDateTime creationDate, Activity.ActivityAct parentResourcePath = "categories"; Requirement requirement = dalFacade.getRequirementById(dataId, userId); frontendResourcePath = "projects" + "/" + requirement.getProjectId() + "/" + "categories" + "/" + - requirement.getCategories().get(0).getId() + "/" + "requirements" + "/" + String.valueOf(dataId); - parentDataId = requirement.getCategories().get(0).getId(); + requirement.getCategories().get(0) + "/" + "requirements" + "/" + String.valueOf(dataId); + parentDataId = requirement.getCategories().get(0); parentDataTyp = Activity.DataType.CATEGORY; } else if (dataType.equals(Activity.DataType.COMMENT)) { resourcePath = "comments"; @@ -78,7 +78,7 @@ public void sendActivityOverRMI(LocalDateTime creationDate, Activity.ActivityAct Comment comment = dalFacade.getCommentById(dataId); Requirement requirement = dalFacade.getRequirementById(comment.getRequirementId(), userId); frontendResourcePath = "projects" + "/" + requirement.getProjectId() + "/" + "categories" + "/" + - requirement.getCategories().get(0).getId() + "/" + "requirements" + "/" + String.valueOf(requirement.getId()); + requirement.getCategories().get(0) + "/" + "requirements" + "/" + String.valueOf(requirement.getId()); parentDataId = requirement.getId(); parentDataTyp = Activity.DataType.REQUIREMENT; } else if (dataType.equals(Activity.DataType.ATTACHMENT)) { @@ -87,7 +87,7 @@ public void sendActivityOverRMI(LocalDateTime creationDate, Activity.ActivityAct Attachment attachment = dalFacade.getAttachmentById(dataId); Requirement requirement = dalFacade.getRequirementById(attachment.getRequirementId(), userId); frontendResourcePath = "projects" + "/" + requirement.getProjectId() + "/" + "categories" + "/" + - requirement.getCategories().get(0).getId() + "/" + "requirements" + "/" + String.valueOf(requirement.getId()); + requirement.getCategories().get(0) + "/" + "requirements" + "/" + String.valueOf(requirement.getId()); parentDataId = requirement.getId(); parentDataTyp = Activity.DataType.REQUIREMENT; } else if (dataType.equals(Activity.DataType.USER)) { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java index e3bd053d..b05f1f6d 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java @@ -139,7 +139,7 @@ private Email generateEmail(List recipients, LocalDateTime creationDate, A Requirement requirement = additionalObject.getRequirement(); objectName = requirement.getName(); resourcePath = "projects" + "/" + requirement.getProjectId() + "/" + "categories" + "/" + - requirement.getCategories().get(0).getId() + "/" + "requirements" + "/" + dataId; + requirement.getCategories().get(0) + "/" + "requirements" + "/" + dataId; subject = subject.concat(" " + Localization.getInstance().getResourceBundle().getString("email.bodyText.requirement") + ": " + (objectName.length() > 40 ? objectName.substring(0, 39) : objectName)); bodyText = bodyText.concat(Localization.getInstance().getResourceBundle().getString("email.bodyText.user") + " " + additionalObject.getUser().getUserName()); bodyText = bodyText.concat(" " + activity); @@ -156,7 +156,7 @@ private Email generateEmail(List recipients, LocalDateTime creationDate, A Requirement requirement = additionalObject.getRequirement(); objectName = requirement.getName(); resourcePath = "projects" + "/" + requirement.getProjectId() + "/" + "categories" + "/" + - requirement.getCategories().get(0).getId() + "/" + "requirements" + "/" + requirement.getId(); + requirement.getCategories().get(0) + "/" + "requirements" + "/" + requirement.getId(); subject = subject.concat(" " + Localization.getInstance().getResourceBundle().getString("email.bodyText.comment") + " " + Localization.getInstance().getResourceBundle().getString("email.bodyText.for") + " " + Localization.getInstance().getResourceBundle().getString("email.bodyText.requirement") + ": " + (objectName.length() > 40 ? objectName.substring(0, 39) : objectName)); @@ -172,7 +172,7 @@ private Email generateEmail(List recipients, LocalDateTime creationDate, A Requirement requirement = additionalObject.getRequirement(); objectName = requirement.getName(); resourcePath = "projects" + "/" + requirement.getProjectId() + "/" + "categories" + "/" + - requirement.getCategories().get(0).getId() + "/" + "requirements" + "/" + requirement.getId(); + requirement.getCategories().get(0) + "/" + "requirements" + "/" + requirement.getId(); subject = subject.concat(" " + Localization.getInstance().getResourceBundle().getString("email.bodyText.attachment") + " " + Localization.getInstance().getResourceBundle().getString("email.bodyText.for") + " " + Localization.getInstance().getResourceBundle().getString("email.bodyText.requirement") + ": " + (objectName.length() > 40 ? objectName.substring(0, 39) : objectName)); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java index a8eadda3..a0f56d0e 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java @@ -94,19 +94,19 @@ private Activity.AdditionalObject generateAdditionalObject(Activity.DataType dat additionalObject = new Activity.AdditionalObject(project, category, null, user); } else if (dataType.equals(Activity.DataType.REQUIREMENT)) { Requirement requirement = dalFacade.getRequirementById(dataId, userId); - Category category = dalFacade.getCategoryById(requirement.getCategories().get(0).getId(), userId); + Category category = dalFacade.getCategoryById(requirement.getCategories().get(0), userId); Project project = dalFacade.getProjectById(requirement.getProjectId(), userId); additionalObject = new Activity.AdditionalObject(project, category, requirement, user); } else if (dataType.equals(Activity.DataType.COMMENT)) { Comment comment = dalFacade.getCommentById(dataId); Requirement requirement = dalFacade.getRequirementById(comment.getRequirementId(), userId); - Category category = dalFacade.getCategoryById(requirement.getCategories().get(0).getId(), userId); + Category category = dalFacade.getCategoryById(requirement.getCategories().get(0), userId); Project project = dalFacade.getProjectById(requirement.getProjectId(), userId); additionalObject = new Activity.AdditionalObject(project, category, requirement, user); } else if (dataType.equals(Activity.DataType.ATTACHMENT)) { Attachment attachment = dalFacade.getAttachmentById(dataId); Requirement requirement = dalFacade.getRequirementById(attachment.getRequirementId(), userId); - Category category = dalFacade.getCategoryById(requirement.getCategories().get(0).getId(), userId); + Category category = dalFacade.getCategoryById(requirement.getCategories().get(0), userId); Project project = dalFacade.getProjectById(requirement.getProjectId(), userId); additionalObject = new Activity.AdditionalObject(project, category, requirement, user); } else { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java index edb641ef..cbb5a9b9 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java @@ -455,13 +455,14 @@ public Response createRequirement(@ApiParam(value = "Requirement entity", requir try { Agent agent = Context.getCurrent().getMainAgent(); String userId = agent.getIdentifier(); + + dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); if (registrarErrors != null) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); } - dalFacade = bazaarService.getDBConnection(); boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Create_REQUIREMENT, requirementToCreate.getProjectId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.requirement.create")); @@ -473,8 +474,8 @@ public Response createRequirement(@ApiParam(value = "Requirement entity", requir if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); // check if all categories are in the same project - for (Category category : requirementToCreate.getCategories()) { - category = dalFacade.getCategoryById(category.getId(), internalUserId); + for (Integer catId : requirementToCreate.getCategories()) { + Category category = dalFacade.getCategoryById(catId, internalUserId); if (requirementToCreate.getProjectId() != category.getProjectId()) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.VALIDATION, "Category does not fit with project"); } @@ -1005,13 +1006,6 @@ public Response vote(@PathParam("requirementId") int requirementId, ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); } - /* Not sure why this is necessary. Should be handled by swagger - if (!(direction.equals("up") || direction.equals("down"))) { - Vtor vtor = bazaarService.getValidators(); - vtor.addViolation(new Violation("Direction can only be \"up\" or \"down\"", direction, direction)); - ExceptionHandler.getInstance().handleViolations(vtor.getViolations()); - }*/ - dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Create_VOTE, dalFacade); @@ -1025,7 +1019,7 @@ public Response vote(@PathParam("requirementId") int requirementId, Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.VOTE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_35, requirementId, Activity.DataType.REQUIREMENT, internalUserId); - return Response.status(Response.Status.SEE_OTHER).location(URI.create(bazaarService.getBaseURL() + "requirement/" + requirementId)).entity(requirement.toJSON()).build(); + return Response.status(Response.Status.SEE_OTHER).location(URI.create(bazaarService.getBaseURL() + "requirements/" + requirementId)).entity(requirement.toJSON()).build(); } catch (BazaarException bex) { if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); diff --git a/requirement_bazaar/src/main/resources/migrations/V9__more_delete_constraints.sql b/requirement_bazaar/src/main/resources/migrations/V9__more_delete_constraints.sql new file mode 100644 index 00000000..7d35654d --- /dev/null +++ b/requirement_bazaar/src/main/resources/migrations/V9__more_delete_constraints.sql @@ -0,0 +1,16 @@ +SET FOREIGN_KEY_CHECKS = 0; +ALTER TABLE reqbaz.requirement_category_map + DROP FOREIGN KEY `requirement_category_map_category`; + +ALTER TABLE reqbaz.requirement_category_map + ADD CONSTRAINT requirement_category_map_category FOREIGN KEY requirement_category_map_category (category_id) REFERENCES category (id) ON DELETE CASCADE; + + +ALTER TABLE reqbaz.requirement + DROP FOREIGN KEY `requirement_project`; + +ALTER TABLE reqbaz.requirement + ADD CONSTRAINT requirement_project FOREIGN KEY requirement_project (project_id) REFERENCES project (id) ON DELETE CASCADE; + + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index 03deef1f..375df653 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -109,6 +109,88 @@ public void testGetProjects() { } } + /** + * Test create a new requirement + */ + @Test + public void testCategories() { + try { + MiniClient client = getClient(); + MiniClient adminClient = getAdminClient(); + + String testCategory = "{\"name\": \"Test Category\", \"description\": \"A test category\", \"projectId\":" + testProject.getId() + "}"; + String path = mainPath + "categories"; + + // Plebs --> no permission + ClientResponse result = client.sendRequest("POST", path, testCategory, + MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, new HashMap<>()); + assertEquals(401, result.getHttpCode()); + + // Admin and owner --> permission + result = adminClient.sendRequest("POST", path, testCategory, + MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, new HashMap<>()); + assertEquals(201, result.getHttpCode()); + + JsonObject response = JsonParser.parseString(result.getResponse()).getAsJsonObject(); + assertTrue(response.isJsonObject()); + System.out.println(response); + + result = client.sendRequest("GET", mainPath + "projects/" + testProject.getId() + "/categories", ""); + assertEquals(200, result.getHttpCode()); + + JsonElement resp = JsonParser.parseString(result.getResponse()); + System.out.println(resp); + assertTrue(resp.isJsonArray()); + assertEquals(2, resp.getAsJsonArray().size()); + + JsonObject createdRequirement = resp.getAsJsonArray().get(1).getAsJsonObject(); + + assertTrue(createdRequirement.has("lastActivity")); + assertTrue(isValidISO8601(createdRequirement.get("creationDate").toString().replace("\"", ""))); + assertTrue(isValidISO8601(createdRequirement.get("lastActivity").toString().replace("\"", ""))); + + } catch (Exception e) { + e.printStackTrace(); + fail(e.toString()); + } + } + + /** + * Test create a new requirement + */ + @Test + public void testRequirements() { + try { + MiniClient client = getClient(); + + String testRequirement = "{\"name\": \"Test Requirements\", \"description\": \"A test requirement\", \"categories\": [" + testProject.getDefaultCategoryId() + "], \"projectId\":" + testProject.getId() + "}"; + ClientResponse result = client.sendRequest("POST", mainPath + "requirements", testRequirement, + MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, new HashMap<>()); + assertEquals(201, result.getHttpCode()); + JsonObject response = JsonParser.parseString(result.getResponse()).getAsJsonObject(); + assertTrue(response.isJsonObject()); + System.out.println(response); + + result = client.sendRequest("GET", mainPath + "requirements", ""); + assertEquals(200, result.getHttpCode()); + + JsonElement resp = JsonParser.parseString(result.getResponse()); + System.out.println(resp); + assertTrue(resp.isJsonArray()); + assertEquals(1, resp.getAsJsonArray().size()); + + JsonObject createdRequirement = resp.getAsJsonArray().get(0).getAsJsonObject(); + + assertTrue(createdRequirement.has("lastActivity")); + assertTrue(isValidISO8601(createdRequirement.get("creationDate").toString().replace("\"", ""))); + assertTrue(isValidISO8601(createdRequirement.get("lastActivity").toString().replace("\"", ""))); + + } catch (Exception e) { + e.printStackTrace(); + fail(e.toString()); + } + } + /** * Test to get a list of projects */ From 51164aa3f005e59ef333d59f34fba4ecba02a44b Mon Sep 17 00:00:00 2001 From: Thore Date: Mon, 12 Apr 2021 22:55:50 +0200 Subject: [PATCH 072/134] Fix changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 277c490b..cf3cdac7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas - Added endpoints to provide anonymous feedback which can be read by project admins [#85](https://github.com/rwth-acis/RequirementsBazaar/pull/85) - Added endpoint to search for users by name or email [#90](https://github.com/rwth-acis/RequirementsBazaar/pull/90) -- Categroies, projects and requirements now have a `lastActivity` +- Categories, projects and requirements now have a `lastActivity` attribute [#91](https://github.com/rwth-acis/RequirementsBazaar/pull/91). ### Changed @@ -47,7 +47,7 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas - Restrict user attributes normally returned to id, username, profile image and las2peerid [#90](https://github.com/rwth-acis/RequirementsBazaar/pull/90) - Requirements no longer return the category objects in the `categories` attribute but a list of category - Ids [#91](https://github.com/rwth-acis/RequirementsBazaar/pull/91). + ids [#91](https://github.com/rwth-acis/RequirementsBazaar/pull/91). ## [0.7.2] - 2017-10-25 From d187686ed30bb2f59bd2f04a0d49e6587bdeebcf Mon Sep 17 00:00:00 2001 From: Thore Date: Tue, 13 Apr 2021 12:30:18 +0200 Subject: [PATCH 073/134] Fix get requirements by category --- .../dbis/acis/bazaar/service/BazaarService.java | 2 +- .../repositories/RequirementRepositoryImpl.java | 1 + .../service/resources/RequirementsResource.java | 2 +- .../dbis/acis/bazaar/service/BazaarTest.java | 16 ++++++++++++++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java index 4a9f3ed9..6fe6f973 100755 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java @@ -114,7 +114,7 @@ protected void initResources() { getResourceConfig().register(CommentsResource.class); getResourceConfig().register(AttachmentsResource.class); getResourceConfig().register(UsersResource.class); - getResourceConfig().register(PersonalisationDataResource.class); + //getResourceConfig().register(PersonalisationDataResource.class); getResourceConfig().register(FeedbackResource.class); } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java index 0636a59f..099025c2 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java @@ -174,6 +174,7 @@ private ImmutablePair, Integer> getFilteredRequirements(Collec .leftOuterJoin(leadDeveloperUser).on(leadDeveloperUser.ID.equal(REQUIREMENT.LEAD_DEVELOPER_ID)) .leftOuterJoin(PROJECT).on(PROJECT.ID.equal(REQUIREMENT.PROJECT_ID)) .leftOuterJoin(LAST_ACTIVITY).on(REQUIREMENT.ID.eq(LAST_ACTIVITY.field(REQUIREMENT.ID))) + .leftOuterJoin(REQUIREMENT_CATEGORY_MAP).on(REQUIREMENT.ID.eq(REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID)) .where(requirementFilter) .and(isAuthorizedCondition) .fetch(); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java index cbb5a9b9..961dd365 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java @@ -996,7 +996,7 @@ public Response unfollowRequirement(@PathParam("requirementId") int requirementI @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") }) public Response vote(@PathParam("requirementId") int requirementId, - @ApiParam(value = "Vote direction", allowableValues = "up, down") @DefaultValue("up") @QueryParam("direction") String direction) { + @ApiParam(value = "Vote direction", allowableValues = "up, down") @DefaultValue("up") String direction) { DALFacade dalFacade = null; try { Agent agent = Context.getCurrent().getMainAgent(); diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index 375df653..72ab155d 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -185,6 +185,22 @@ public void testRequirements() { assertTrue(isValidISO8601(createdRequirement.get("creationDate").toString().replace("\"", ""))); assertTrue(isValidISO8601(createdRequirement.get("lastActivity").toString().replace("\"", ""))); + + // Test by category + result = client.sendRequest("GET", mainPath + "categories/" + testProject.getDefaultCategoryId() + "/requirements", ""); + assertEquals(200, result.getHttpCode()); + + resp = JsonParser.parseString(result.getResponse()); + System.out.println(resp); + assertTrue(resp.isJsonArray()); + assertEquals(1, resp.getAsJsonArray().size()); + + createdRequirement = resp.getAsJsonArray().get(0).getAsJsonObject(); + + assertTrue(createdRequirement.has("lastActivity")); + assertTrue(isValidISO8601(createdRequirement.get("creationDate").toString().replace("\"", ""))); + assertTrue(isValidISO8601(createdRequirement.get("lastActivity").toString().replace("\"", ""))); + } catch (Exception e) { e.printStackTrace(); fail(e.toString()); From 46fcab2b406f660d5cc96e645a3707b8e2419817 Mon Sep 17 00:00:00 2001 From: Thore Date: Tue, 13 Apr 2021 14:37:15 +0200 Subject: [PATCH 074/134] Add projectrole attribute to project --- CHANGELOG.md | 2 + requirement_bazaar/build.gradle | 12 ++ requirement_bazaar/lombok.config | 1 + .../bazaar/service/dal/DALFacadeImpl.java | 6 +- .../bazaar/service/dal/entities/Project.java | 2 + .../bazaar/service/dal/entities/Role.java | 12 +- .../service/dal/entities/SystemRole.java | 7 + .../repositories/ProjectRepositoryImpl.java | 128 ++++++++---------- .../dal/repositories/RoleRepository.java | 11 ++ .../dal/repositories/RoleRepositoryImpl.java | 13 ++ .../security/AuthorizationManager.java | 1 - .../dbis/acis/bazaar/service/BazaarTest.java | 16 +++ 12 files changed, 134 insertions(+), 77 deletions(-) create mode 100644 requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/SystemRole.java diff --git a/CHANGELOG.md b/CHANGELOG.md index cf3cdac7..8670d064 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas - Added endpoint to search for users by name or email [#90](https://github.com/rwth-acis/RequirementsBazaar/pull/90) - Categories, projects and requirements now have a `lastActivity` attribute [#91](https://github.com/rwth-acis/RequirementsBazaar/pull/91). +- If a user is a member of a project the respective role is now returned in the`projectRole` attribute of a + project [#94](https://github.com/rwth-acis/RequirementsBazaar/pull/94). ### Changed diff --git a/requirement_bazaar/build.gradle b/requirement_bazaar/build.gradle index 4d996d69..f47fc59f 100644 --- a/requirement_bazaar/build.gradle +++ b/requirement_bazaar/build.gradle @@ -22,6 +22,7 @@ plugins { id "nu.studer.jooq" version "5.2.1" id "io.freefair.lombok" version "5.3.0" id 'com.github.ben-manes.versions' version '0.38.0' + id 'jacoco' } application { @@ -79,6 +80,17 @@ configurations { testCompile.extendsFrom compileOnly } +test { + finalizedBy jacocoTestReport // report is always generated after tests run +} + +jacocoTestReport { + dependsOn test // tests are required to run before generating the report + reports { + xml.enabled true + } +} + jar { manifest { attributes "Main-Class": "${project.property('service.name')}.${project.property('service.class')}" diff --git a/requirement_bazaar/lombok.config b/requirement_bazaar/lombok.config index 6aa51d71..189c0bef 100644 --- a/requirement_bazaar/lombok.config +++ b/requirement_bazaar/lombok.config @@ -1,2 +1,3 @@ # This file is generated by the 'io.freefair.lombok' Gradle plugin config.stopBubbling = true +lombok.addLombokGeneratedAnnotation = true diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index 31ae2e29..0f6e4597 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -224,7 +224,11 @@ public Project createProject(Project project, int userId) throws Exception { newProject.setDefaultCategoryId(defaultCategory.getId()); // TODO: concurrency transaction -> https://www.jooq.org/doc/3.9/manual/sql-execution/transaction-management/ addUserToRole(userId, "ProjectAdmin", newProject.getId()); - return projectRepository.update(newProject); + + // This is stupid, but the return value of update is inclomplete (dependent objects won't be resolved, since only the top level get by id method is called. + // Call repository get separately + projectRepository.update(newProject); + return projectRepository.findById(newProject.getId(), userId); } @Override diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java index fe64c01f..63ba5f5a 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java @@ -71,6 +71,8 @@ public class Project extends EntityBase implements Ownable { private Integer numberOfFollowers; private Boolean isFollower; + private ProjectRole projectRole; + @JsonProperty("isFollower") public Boolean isFollower() { return isFollower; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java index 0d038e3e..195dcead 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java @@ -24,6 +24,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.extern.jackson.Jacksonized; +import net.minidev.json.annotate.JsonIgnore; import java.util.List; @@ -40,6 +41,15 @@ public class Role extends EntityBase { private final List privileges; - private final String name; + + @JsonIgnore + public boolean isProjectScoped() { + try { + ProjectRole.valueOf(name); + return true; + } catch (IllegalArgumentException e) { + return false; + } + } } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/SystemRole.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/SystemRole.java new file mode 100644 index 00000000..8a759f7f --- /dev/null +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/SystemRole.java @@ -0,0 +1,7 @@ +package de.rwth.dbis.acis.bazaar.service.dal.entities; + +public enum SystemRole { + Anonymous, + LoggedInUser, + SystemAdministrator, +} diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java index 3ab64e33..19571241 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java @@ -24,6 +24,7 @@ import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.UserRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; import de.rwth.dbis.acis.bazaar.service.dal.entities.Statistic; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; import de.rwth.dbis.acis.bazaar.service.dal.transform.ProjectTransformer; @@ -32,6 +33,7 @@ import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; import de.rwth.dbis.acis.bazaar.service.exception.ExceptionLocation; +import org.apache.commons.lang3.tuple.ImmutablePair; import org.jooq.Record; import org.jooq.*; import org.jooq.exception.DataAccessException; @@ -39,6 +41,7 @@ import java.time.LocalDateTime; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; @@ -120,70 +123,12 @@ public ProjectRepositoryImpl(DSLContext jooq) { super(jooq, new ProjectTransformer()); } - @Override - public Project findById(int id, int userId) throws BazaarException { - Project project = null; - try { - Field isFollower = DSL.select(DSL.count()) - .from(PROJECT_FOLLOWER_MAP) - .where(PROJECT_FOLLOWER_MAP.PROJECT_ID.equal(PROJECT.ID).and(PROJECT_FOLLOWER_MAP.USER_ID.equal(userId))) - .asField("isFollower"); - - Result queryResult = jooq.select(PROJECT.fields()) - .select(CATEGORY_COUNT) - .select(REQUIREMENT_COUNT) - .select(FOLLOWER_COUNT) - .select(isFollower) - .select(leaderUser.fields()) - .from(PROJECT) - .leftOuterJoin(leaderUser).on(leaderUser.ID.equal(PROJECT.LEADER_ID)) - .where(transformer.getTableId().equal(id)) - .fetch(); - - if (queryResult == null || queryResult.size() == 0) { - ExceptionHandler.getInstance().convertAndThrowException( - new Exception("No " + transformer.getRecordClass() + " found with id: " + id), - ExceptionLocation.REPOSITORY, ErrorCode.NOT_FOUND); - } - - Project.Builder builder = Project.builder() - .name(queryResult.getValues(PROJECT.NAME).get(0)) - .description(queryResult.getValues(PROJECT.DESCRIPTION).get(0)) - .id(queryResult.getValues(PROJECT.ID).get(0)) - .defaultCategoryId(queryResult.getValues(PROJECT.DEFAULT_CATEGORY_ID).get(0)) - .visibility(queryResult.getValues(PROJECT.VISIBILITY).get(0) == 1) - .creationDate(queryResult.getValues(PROJECT.CREATION_DATE).get(0)) - .lastUpdatedDate(queryResult.getValues(PROJECT.LAST_UPDATED_DATE).get(0)); - - UserTransformer userTransformer = new UserTransformer(); - //Filling up LeadDeveloper - builder.leader(userTransformer.getEntityFromQueryResult(leaderUser, queryResult)); - - project = builder.build(); - - // Filling additional information - project.setNumberOfCategories((Integer) queryResult.getValues(CATEGORY_COUNT).get(0)); - project.setNumberOfRequirements((Integer) queryResult.getValues(REQUIREMENT_COUNT).get(0)); - project.setNumberOfFollowers((Integer) queryResult.getValues(FOLLOWER_COUNT).get(0)); - if (userId != 1) { - project.setIsFollower(0 != (Integer) queryResult.getValues(isFollower).get(0)); - } - - } catch (BazaarException be) { - ExceptionHandler.getInstance().convertAndThrowException(be); - } catch (Exception e) { - ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); - } - return project; - } - - private PaginationResult findProjects(Pageable pageable, int userId, Boolean queryPrivate) throws Exception { + private ImmutablePair, Integer> getFilteredProjects(Condition searchCondition, Pageable pageable, int userId) throws Exception { List projects = new ArrayList<>(); Field idCount = jooq.selectCount() .from(PROJECT) - .where(PROJECT.VISIBILITY.isTrue()) - .and(transformer.getSearchCondition(pageable.getSearch())) + .where(searchCondition) .asField("idCount"); Field isFollower = DSL.select(DSL.count()) @@ -194,16 +139,6 @@ private PaginationResult findProjects(Pageable pageable, int userId, Bo .where(LAST_ACTIVITY.field(PROJECT.ID).equal(PROJECT.ID)) .asField("lastActivity"); - Condition searchConditions = transformer.getSearchCondition(pageable.getSearch()) - .and((pageable.getIds().size() > 0) ? PROJECT.ID.in(pageable.getIds()) : trueCondition()); - - if (queryPrivate) { - // TODO: Include permission check by project membership query - searchConditions.and( - PROJECT.VISIBILITY.isTrue().or(leaderUser.ID.equal(userId)) - ); - } - Result queryResults = jooq.select(PROJECT.fields()) .select(idCount) .select(CATEGORY_COUNT) @@ -215,7 +150,7 @@ private PaginationResult findProjects(Pageable pageable, int userId, Bo .from(PROJECT) .leftOuterJoin(leaderUser).on(leaderUser.ID.equal(PROJECT.LEADER_ID)) .leftOuterJoin(LAST_ACTIVITY).on(PROJECT.ID.eq(LAST_ACTIVITY.field(PROJECT.ID))) - .where(searchConditions) + .where(searchCondition) .orderBy(transformer.getSortFields(pageable.getSorts())) .limit(pageable.getPageSize()) .offset(pageable.getOffset()) @@ -234,18 +169,55 @@ private PaginationResult findProjects(Pageable pageable, int userId, Bo if (userId != 1) { project.setIsFollower(0 != (Integer) queryResult.getValue(isFollower)); } + RoleRepositoryImpl roleRepository = new RoleRepositoryImpl(jooq); + project.setProjectRole(roleRepository.getProjectRole(userId, project.getId())); + projects.add(project); } int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); - return new PaginationResult<>(total, pageable, projects); + return ImmutablePair.of(projects, total); + } + + private ImmutablePair, Integer> getFilteredProjects(Condition searchCondition, int userId) throws Exception { + return getFilteredProjects(searchCondition, new PageInfo(0, 1000, new HashMap<>()), userId); + } + + @Override + public Project findById(int id, int userId) throws BazaarException { + Project project = null; + try { + Condition filterCondition = transformer.getTableId().equal(id); + + ImmutablePair, Integer> filteredProjects = getFilteredProjects(filterCondition, userId); + + if (filteredProjects.left == null || filteredProjects.left.size() == 0) { + ExceptionHandler.getInstance().convertAndThrowException( + new Exception("No " + transformer.getRecordClass() + " found with id: " + id), + ExceptionLocation.REPOSITORY, ErrorCode.NOT_FOUND); + } + + project = filteredProjects.left.get(0); + + + } catch (BazaarException be) { + ExceptionHandler.getInstance().convertAndThrowException(be); + } catch (Exception e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } + return project; } @Override public PaginationResult findAllPublic(Pageable pageable, int userId) throws BazaarException { PaginationResult result = null; try { - result = findProjects(pageable, userId, false); + Condition searchConditions = transformer.getSearchCondition(pageable.getSearch()) + .and((pageable.getIds().size() > 0) ? PROJECT.ID.in(pageable.getIds()) : trueCondition()); + + ImmutablePair, Integer> filteredProjects = getFilteredProjects(searchConditions, pageable, userId); + + result = new PaginationResult<>(filteredProjects.right, pageable, filteredProjects.left); } catch (Exception e) { ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); } @@ -256,7 +228,15 @@ public PaginationResult findAllPublic(Pageable pageable, int userId) th public PaginationResult findAllPublicAndAuthorized(Pageable pageable, int userId) throws BazaarException { PaginationResult result = null; try { - result = findProjects(pageable, userId, true); + Condition searchConditions = transformer.getSearchCondition(pageable.getSearch()) + .and((pageable.getIds().size() > 0) ? PROJECT.ID.in(pageable.getIds()) : trueCondition()) + .and( + // TODO: Include permission check by project membership query + PROJECT.VISIBILITY.isTrue().or(leaderUser.ID.equal(userId)) + ); + ImmutablePair, Integer> filteredProjects = getFilteredProjects(searchConditions, pageable, userId); + + result = new PaginationResult<>(filteredProjects.right, pageable, filteredProjects.left); } catch (Exception e) { ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java index 47f8902e..30977b05 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java @@ -21,6 +21,7 @@ package de.rwth.dbis.acis.bazaar.service.dal.repositories; import de.rwth.dbis.acis.bazaar.service.dal.entities.ProjectMember; +import de.rwth.dbis.acis.bazaar.service.dal.entities.ProjectRole; import de.rwth.dbis.acis.bazaar.service.dal.entities.Role; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; @@ -42,5 +43,15 @@ public interface RoleRepository extends Repository { PaginationResult listProjectMembers(int projectId, Pageable pageable) throws BazaarException; + /** + * Return the project role or null + * + * @param userId id of the user + * @param projectId id of the project + * @return projectrole or null + * @throws BazaarException + */ + ProjectRole getProjectRole(int userId, int projectId) throws BazaarException; + void removeUserFromRole(int userId, Integer context) throws BazaarException; } diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java index 5eb53859..a54544bd 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java @@ -153,6 +153,19 @@ public PaginationResult listProjectMembers(int projectId, Pageabl return new PaginationResult<>(total, pageable, projectMembers); } + public ProjectRole getProjectRole(int userId, int projectId) throws BazaarException { + List roles = listRolesOfUser(userId, projectId); + + for (Role role : roles) { + if (role.getName().equals("SystemAdmin")) { + return ProjectRole.ProjectAdmin; + } else if (role.isProjectScoped()) { + return ProjectRole.valueOf(role.getName()); + } + } + return null; + } + @Override public void removeUserFromRole(int userId, Integer context) throws BazaarException { jooq.deleteFrom(USER_ROLE_MAP).where(USER_ROLE_MAP.USER_ID.equal(userId).and(USER_ROLE_MAP.CONTEXT_INFO.eq(context))).execute(); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java index 40c1b0fa..8bcbe29c 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java @@ -81,6 +81,5 @@ public static void SyncPrivileges(DALFacade facade) throws BazaarException { for (PrivilegeEnum privilege : privileges) { facade.createPrivilegeIfNotExists(privilege); } - } } diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index 72ab155d..20fa18db 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -71,6 +71,7 @@ public void testCreateProject() { // gson doesn't remove the quotes assertTrue(isValidISO8601(response.get("creationDate").toString().replace("\"", ""))); + assertTrue(response.has("projectRole")); } catch (Exception e) { e.printStackTrace(); @@ -85,6 +86,7 @@ public void testCreateProject() { public void testGetProjects() { try { MiniClient client = getClient(); + MiniClient adminClient = getAdminClient(); ClientResponse result = client.sendRequest("GET", mainPath + "projects", ""); @@ -103,6 +105,20 @@ public void testGetProjects() { JsonObject jsonObject = JsonParser.parseString(result.getResponse()).getAsJsonObject(); assertTrue(isValidISO8601(jsonObject.get("creationDate").toString().replace("\"", ""))); + // Normal user has no project role + assertFalse(jsonObject.has("projectRole")); + + // Test with admin + // Now for a specific project + result = adminClient.sendRequest("GET", mainPath + "projects/" + testProject.getId(), ""); + assertEquals(200, result.getHttpCode()); + + response = JsonParser.parseString(result.getResponse()); + System.out.println(response.toString()); + assertTrue(response.isJsonObject()); + + jsonObject = JsonParser.parseString(result.getResponse()).getAsJsonObject(); + assertTrue(jsonObject.has("projectRole")); } catch (Exception e) { e.printStackTrace(); fail(e.toString()); From e6aa6b6b661518711e26511b5bf3d93b3ff0ce30 Mon Sep 17 00:00:00 2001 From: Thore Date: Tue, 13 Apr 2021 14:37:32 +0200 Subject: [PATCH 075/134] Enable codecov reporting --- .github/workflows/gradle.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 9156ab47..dfb4e550 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -30,3 +30,9 @@ jobs: done - name: Build with Gradle run: ./gradlew clean build --info + - uses: codecov/codecov-action@v1 + with: + flags: unittests + files: ./requirement_bazaar/build/reports/jacoco/test/jacocoTestReport.xml + fail_ci_if_error: true + verbose: true From a98ad0a54879b2966229998f8aef8b13b6774395 Mon Sep 17 00:00:00 2001 From: Thore Date: Tue, 13 Apr 2021 14:43:03 +0200 Subject: [PATCH 076/134] Update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8670d064..5638b204 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,12 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas las2peerid [#90](https://github.com/rwth-acis/RequirementsBazaar/pull/90) - Requirements no longer return the category objects in the `categories` attribute but a list of category ids [#91](https://github.com/rwth-acis/RequirementsBazaar/pull/91). +- Vote direction can no longer be provided as a query + parameter [#94](https://github.com/rwth-acis/RequirementsBazaar/pull/94) + +### Removed + +- Personalisation endpoints [#94](https://github.com/rwth-acis/RequirementsBazaar/pull/94) ## [0.7.2] - 2017-10-25 From f993f27eff2cfed736dbb567bef6cb1192796902 Mon Sep 17 00:00:00 2001 From: Thore Date: Wed, 14 Apr 2021 09:47:55 +0200 Subject: [PATCH 077/134] Fix bug with anonymous user --- CHANGELOG.md | 3 +-- .../dal/repositories/RoleRepositoryImpl.java | 5 ++--- .../dal/transform/ProjectTransformer.java | 5 +---- .../acis/bazaar/service/dal/DALFacadeTest.java | 18 +++++++++--------- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5638b204..d063c72d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,8 +24,7 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas ### Changed - Updated all dependencies, most notably las2peer 1.0.0 [#68](https://github.com/rwth-acis/RequirementsBazaar/pull/68) -- Updated las2peer to 1.1.0 and thereby requiring Java - 14) [#73](https://github.com/rwth-acis/RequirementsBazaar/pull/73) +- Updated las2peer to 1.1.0 and thereby requiring Java 14 [#73](https://github.com/rwth-acis/RequirementsBazaar/pull/73) - Changed buildsystem to use gradle [#73](https://github.com/rwth-acis/RequirementsBazaar/pull/73) - Automatically generate jooq code from migration files at build time [#73](https://github.com/rwth-acis/RequirementsBazaar/pull/73) diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java index a54544bd..2a08173c 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java @@ -54,6 +54,7 @@ public List listRolesOfUser(int userId, Integer context) throws BazaarExce List roles = null; try { + roles = new ArrayList<>(); de.rwth.dbis.acis.bazaar.dal.jooq.tables.Role roleTable = ROLE.as("role"); de.rwth.dbis.acis.bazaar.dal.jooq.tables.Privilege privilegeTable = PRIVILEGE.as("privilege"); @@ -64,8 +65,7 @@ public List listRolesOfUser(int userId, Integer context) throws BazaarExce .leftOuterJoin(PRIVILEGE).on(PRIVILEGE.ID.eq(ROLE_PRIVILEGE_MAP.PRIVILEGE_ID)) ).where(USER_ROLE_MAP.USER_ID.equal(userId).and(USER_ROLE_MAP.CONTEXT_INFO.eq(context).or(USER_ROLE_MAP.CONTEXT_INFO.isNull()))).fetch(); - if (queryResult != null && !queryResult.isEmpty()) { - roles = new ArrayList<>(); + if (!queryResult.isEmpty()) { convertToRoles(roles, roleTable, privilegeTable, queryResult); } @@ -107,7 +107,6 @@ public Role findByRoleName(String roleName) throws BazaarException { @Override public PaginationResult listProjectMembers(int projectId, Pageable pageable) throws BazaarException { - PaginationResult result = null; List projectMembers = null; int total = 0; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java index 9abbdd9d..59526bfc 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java @@ -102,7 +102,7 @@ public Map getUpdateMap(final Project entry) { @Override public Collection> getSortFields(List sorts) { if (sorts.isEmpty()) { - return Collections.singletonList(PROJECT.NAME.asc()); + return Collections.singletonList(ProjectRepositoryImpl.LAST_ACTIVITY.field("last_activity").desc()); } List> sortFields = new ArrayList<>(); for (Pageable.SortField sort : sorts) { @@ -137,9 +137,6 @@ public Collection> getSortFields(List case ASC: sortFields.add(ProjectRepositoryImpl.LAST_ACTIVITY.field("last_activity").asc()); break; - case DESC: - sortFields.add(ProjectRepositoryImpl.LAST_ACTIVITY.field("last_activity").desc()); - break; default: sortFields.add(ProjectRepositoryImpl.LAST_ACTIVITY.field("last_activity").desc()); break; diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java index a5a6c7b5..081a90ba 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java @@ -21,10 +21,7 @@ package de.rwth.dbis.acis.bazaar.service.dal; import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.ProjectRecord; -import de.rwth.dbis.acis.bazaar.service.dal.entities.Feedback; -import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; -import de.rwth.dbis.acis.bazaar.service.dal.entities.ProjectMember; -import de.rwth.dbis.acis.bazaar.service.dal.entities.User; +import de.rwth.dbis.acis.bazaar.service.dal.entities.*; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; import de.rwth.dbis.acis.bazaar.service.helpers.SetupData; @@ -92,20 +89,23 @@ public void testCreateGetProject() throws Exception { assertEquals(project.getLeader().getId(), projectById.getLeader().getId()); assertEquals(project.getVisibility(), projectById.getVisibility()); assertTrue(projectById.isOwner(initUser)); + assertEquals(ProjectRole.ProjectAdmin, projectById.getProjectRole()); // Now check if this can also be found as a public project - PaginationResult projectsPage = facade.listPublicProjects(new PageInfo(0, 1), initUser.getId()); + PaginationResult projectsPage = facade.listPublicProjects(new PageInfo(0, 10), initUser.getId()); List projects = projectsPage.getElements(); assertNotNull(projects); - // assertEquals(1,projects.size()); - for (Project proj : projects) { - assertTrue(proj.getVisibility()); + Project proj = null; + for (Project pr : projects) { + assertTrue(pr.getVisibility()); + + if (pr.getId() == projectById.getId()) proj = pr; } - Project proj = projects.get(0); + assertNotNull(proj); assertEquals(projectById.getId(), proj.getId()); assertEquals(projectById.getName(), proj.getName()); From caa5617ac3192ca2fbd08e6cf2d355e6502fef45 Mon Sep 17 00:00:00 2001 From: Thore Date: Thu, 15 Apr 2021 14:43:14 +0200 Subject: [PATCH 078/134] Introduce userContext --- CHANGELOG.md | 8 +++- .../bazaar/service/dal/entities/Category.java | 7 +--- .../bazaar/service/dal/entities/Project.java | 9 +---- .../service/dal/entities/Requirement.java | 21 +--------- .../service/dal/entities/UserContext.java | 32 +++++++++++++++ .../repositories/CategoryRepositoryImpl.java | 7 +++- .../repositories/ProjectRepositoryImpl.java | 8 +++- .../RequirementRepositoryImpl.java | 13 ++++-- .../dal/transform/ProjectTransformer.java | 40 +++++++------------ .../dbis/acis/bazaar/service/BazaarTest.java | 15 +++++-- .../bazaar/service/dal/DALFacadeTest.java | 4 +- .../bazaar/service/helpers/SetupData.java | 2 +- 12 files changed, 91 insertions(+), 75 deletions(-) create mode 100644 requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/UserContext.java diff --git a/CHANGELOG.md b/CHANGELOG.md index d063c72d..37192331 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,8 +18,10 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas - Added endpoint to search for users by name or email [#90](https://github.com/rwth-acis/RequirementsBazaar/pull/90) - Categories, projects and requirements now have a `lastActivity` attribute [#91](https://github.com/rwth-acis/RequirementsBazaar/pull/91). -- If a user is a member of a project the respective role is now returned in the`projectRole` attribute of a - project [#94](https://github.com/rwth-acis/RequirementsBazaar/pull/94). +- Categories, projects and requirements now have a `userContext` encapsuling the dynamic user related information ( + permissions, votes, contribution) [#94](https://github.com/rwth-acis/RequirementsBazaar/pull/94). +- If a user is a member of a project the respective role is now returned in the`projectRole` attribute of the + new `userContext` attribute [#94](https://github.com/rwth-acis/RequirementsBazaar/pull/94). ### Changed @@ -51,6 +53,8 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas ids [#91](https://github.com/rwth-acis/RequirementsBazaar/pull/91). - Vote direction can no longer be provided as a query parameter [#94](https://github.com/rwth-acis/RequirementsBazaar/pull/94) +- Moved user related information in categories, requirements and projects (isFollower/Developer/Contributor, userVoted) + into the new `userContext` [#94](https://github.com/rwth-acis/RequirementsBazaar/pull/94). ### Removed diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java index 38afa7fa..5089de4d 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonProperty; import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreateValidation; import lombok.Builder; import lombok.Data; @@ -69,12 +68,8 @@ public class Category extends EntityBase implements Ownable { private Integer numberOfRequirements; private Integer numberOfFollowers; - private Boolean isFollower; - @JsonProperty("isFollower") - public Boolean isFollower() { - return isFollower; - } + private UserContext userContext; @Override public boolean isOwner(User user) { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java index 63ba5f5a..38e8c3d9 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java @@ -21,7 +21,6 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonProperty; import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreateValidation; import lombok.Builder; import lombok.Data; @@ -69,14 +68,8 @@ public class Project extends EntityBase implements Ownable { private Integer numberOfCategories; private Integer numberOfRequirements; private Integer numberOfFollowers; - private Boolean isFollower; - private ProjectRole projectRole; - - @JsonProperty("isFollower") - public Boolean isFollower() { - return isFollower; - } + private UserContext userContext; @Override public boolean isOwner(User user) { diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java index a43739ad..2d3f6c25 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java @@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreateValidation; -import de.rwth.dbis.acis.bazaar.service.dal.helpers.UserVote; import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; @@ -67,30 +66,12 @@ public class Requirement extends EntityBase implements Ownable { private int upVotes; private int downVotes; - private UserVote userVoted; - private Boolean isFollower; - private Boolean isDeveloper; - private Boolean isContributor; + private UserContext userContext; @JsonProperty("_context") private EntityContext context; - @JsonProperty("isFollower") - public Boolean isFollower() { - return isFollower; - } - - @JsonProperty("isDeveloper") - public Boolean isDeveloper() { - return isDeveloper; - } - - @JsonProperty("isContributor") - public Boolean isContributor() { - return isContributor; - } - @Override public boolean isOwner(User user) { return creator == user; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/UserContext.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/UserContext.java new file mode 100644 index 00000000..078c5c10 --- /dev/null +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/UserContext.java @@ -0,0 +1,32 @@ +package de.rwth.dbis.acis.bazaar.service.dal.entities; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.UserVote; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; + +/** + * Dynamic object to provide the context the currently logged in user has provided to the related object + */ +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") +public class UserContext extends EntityBase { + + private ProjectRole projectRole; + + private UserVote userVoted; + + private Boolean isFollower; + private Boolean isDeveloper; + private Boolean isContributor; + + @JsonIgnore + @Override + public int getId() { + return 0; + } +} diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java index 60387ba2..fe54e431 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java @@ -24,6 +24,7 @@ import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.UserRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Category; import de.rwth.dbis.acis.bazaar.service.dal.entities.Statistic; +import de.rwth.dbis.acis.bazaar.service.dal.entities.UserContext; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; @@ -154,13 +155,17 @@ private ImmutablePair, Integer> getFilteredCategories(Collection< Category category = transformer.getEntityFromTableRecord(categoryRecord); UserTransformer userTransformer = new UserTransformer(); UserRecord userRecord = queryResult.into(leaderUser); + UserContext.Builder userContext = UserContext.builder(); + category.setCreator(userTransformer.getEntityFromTableRecord(userRecord)); category.setNumberOfRequirements((Integer) queryResult.getValue(REQUIREMENT_COUNT)); category.setNumberOfFollowers((Integer) queryResult.getValue(FOLLOWER_COUNT)); category.setLastActivity((LocalDateTime) queryResult.getValue(lastActivity)); if (userId != 1) { - category.setIsFollower((Integer) queryResult.getValue(isFollower) != 0); + userContext.isFollower((Integer) queryResult.getValue(isFollower) != 0); } + + category.setUserContext(userContext.build()); categories.add(category); } int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java index 19571241..0e028535 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java @@ -24,6 +24,7 @@ import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.UserRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; import de.rwth.dbis.acis.bazaar.service.dal.entities.Statistic; +import de.rwth.dbis.acis.bazaar.service.dal.entities.UserContext; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; @@ -161,17 +162,20 @@ private ImmutablePair, Integer> getFilteredProjects(Condition sear Project project = transformer.getEntityFromTableRecord(projectRecord); UserTransformer userTransformer = new UserTransformer(); UserRecord userRecord = queryResult.into(leaderUser); + UserContext.Builder userContext = UserContext.builder(); + project.setLeader(userTransformer.getEntityFromTableRecord(userRecord)); project.setNumberOfCategories((Integer) queryResult.getValue(CATEGORY_COUNT)); project.setNumberOfRequirements((Integer) queryResult.getValue(REQUIREMENT_COUNT)); project.setNumberOfFollowers((Integer) queryResult.getValue(FOLLOWER_COUNT)); project.setLastActivity((LocalDateTime) queryResult.getValue(lastActivity)); if (userId != 1) { - project.setIsFollower(0 != (Integer) queryResult.getValue(isFollower)); + userContext.isFollower(0 != (Integer) queryResult.getValue(isFollower)); } RoleRepositoryImpl roleRepository = new RoleRepositoryImpl(jooq); - project.setProjectRole(roleRepository.getProjectRole(userId, project.getId())); + userContext.projectRole(roleRepository.getProjectRole(userId, project.getId())); + project.setUserContext(userContext.build()); projects.add(project); } int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java index 099025c2..33a85482 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java @@ -25,6 +25,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.Attachment; import de.rwth.dbis.acis.bazaar.service.dal.entities.Requirement; import de.rwth.dbis.acis.bazaar.service.dal.entities.Statistic; +import de.rwth.dbis.acis.bazaar.service.dal.entities.UserContext; import de.rwth.dbis.acis.bazaar.service.dal.helpers.*; import de.rwth.dbis.acis.bazaar.service.dal.transform.RequirementTransformer; import de.rwth.dbis.acis.bazaar.service.dal.transform.UserTransformer; @@ -182,6 +183,8 @@ private ImmutablePair, Integer> getFilteredRequirements(Collec for (Record queryResult : queryResults) { RequirementRecord requirementRecord = queryResult.into(REQUIREMENT); Requirement requirement = transformer.getEntityFromTableRecord(requirementRecord); + UserContext.Builder userContext = UserContext.builder(); + requirement.setLastActivity((LocalDateTime) queryResult.getValue(lastActivity)); UserTransformer userTransformer = new UserTransformer(); @@ -210,7 +213,8 @@ private ImmutablePair, Integer> getFilteredRequirements(Collec requirement.setUpVotes(voteQueryResult.get(0).getValue("upVotes", Integer.class)); requirement.setDownVotes(voteQueryResult.get(0).getValue("downVotes", Integer.class)); - requirement.setUserVoted(transformToUserVoted(voteQueryResult.get(0).getValue("userVoted", Integer.class))); + + userContext.userVoted(transformToUserVoted(voteQueryResult.get(0).getValue("userVoted", Integer.class))); //Filling up categories List categories = new ArrayList<>(); @@ -226,9 +230,9 @@ private ImmutablePair, Integer> getFilteredRequirements(Collec requirement.setNumberOfAttachments((Integer) queryResult.getValue(ATTACHMENT_COUNT)); requirement.setNumberOfFollowers((Integer) queryResult.getValue(FOLLOWER_COUNT)); if (userId != 1) { - requirement.setIsFollower(0 != (Integer) queryResult.getValue(isFollower)); - requirement.setIsDeveloper(0 != (Integer) queryResult.getValue(isDeveloper)); - requirement.setIsContributor(!Objects.equals(queryResult.getValue(isContributor), new BigDecimal(0))); + userContext.isFollower(0 != (Integer) queryResult.getValue(isFollower)); + userContext.isDeveloper(0 != (Integer) queryResult.getValue(isDeveloper)); + userContext.isContributor(!Objects.equals(queryResult.getValue(isContributor), new BigDecimal(0))); } if (requirement.getNumberOfAttachments() > 0) { @@ -238,6 +242,7 @@ private ImmutablePair, Integer> getFilteredRequirements(Collec } requirement.setContext(EntityContextFactory.create(pageable.getEmbed(), queryResult)); + requirement.setUserContext(userContext.build()); requirements.add(requirement); } int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java index 59526bfc..b4922524 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java +++ b/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java @@ -108,38 +108,26 @@ public Collection> getSortFields(List for (Pageable.SortField sort : sorts) { switch (sort.getField()) { case "name": - switch (sort.getSortDirection()) { - case DESC: - sortFields.add(PROJECT.NAME.length().desc()); - sortFields.add(PROJECT.NAME.desc()); - break; - default: - sortFields.add(PROJECT.NAME.length().asc()); - sortFields.add(PROJECT.NAME.asc()); - break; + if (sort.getSortDirection() == Pageable.SortDirection.DESC) { + sortFields.add(PROJECT.NAME.length().desc()); + sortFields.add(PROJECT.NAME.desc()); + } else { + sortFields.add(PROJECT.NAME.length().asc()); + sortFields.add(PROJECT.NAME.asc()); } break; case "date": - switch (sort.getSortDirection()) { - case ASC: - sortFields.add(PROJECT.CREATION_DATE.asc()); - break; - case DESC: - sortFields.add(PROJECT.CREATION_DATE.desc()); - break; - default: - sortFields.add(PROJECT.CREATION_DATE.desc()); - break; + if (sort.getSortDirection() == Pageable.SortDirection.ASC) { + sortFields.add(PROJECT.CREATION_DATE.asc()); + } else { + sortFields.add(PROJECT.CREATION_DATE.desc()); } break; case "last_activity": - switch (sort.getSortDirection()) { - case ASC: - sortFields.add(ProjectRepositoryImpl.LAST_ACTIVITY.field("last_activity").asc()); - break; - default: - sortFields.add(ProjectRepositoryImpl.LAST_ACTIVITY.field("last_activity").desc()); - break; + if (sort.getSortDirection() == Pageable.SortDirection.ASC) { + sortFields.add(ProjectRepositoryImpl.LAST_ACTIVITY.field("last_activity").asc()); + } else { + sortFields.add(ProjectRepositoryImpl.LAST_ACTIVITY.field("last_activity").desc()); } break; case "requirement": diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index 20fa18db..2db8e540 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -71,7 +71,11 @@ public void testCreateProject() { // gson doesn't remove the quotes assertTrue(isValidISO8601(response.get("creationDate").toString().replace("\"", ""))); - assertTrue(response.has("projectRole")); + assertTrue(response.has("userContext")); + + JsonObject userContext = response.getAsJsonObject("userContext"); + assertTrue(userContext.has("projectRole")); + assertTrue(userContext.has("isFollower")); } catch (Exception e) { e.printStackTrace(); @@ -106,7 +110,10 @@ public void testGetProjects() { JsonObject jsonObject = JsonParser.parseString(result.getResponse()).getAsJsonObject(); assertTrue(isValidISO8601(jsonObject.get("creationDate").toString().replace("\"", ""))); // Normal user has no project role - assertFalse(jsonObject.has("projectRole")); + assertTrue(jsonObject.has("userContext")); + JsonObject userContext = jsonObject.getAsJsonObject("userContext"); + assertFalse(userContext.has("projectRole")); + assertTrue(userContext.has("isFollower")); // Test with admin // Now for a specific project @@ -118,7 +125,9 @@ public void testGetProjects() { assertTrue(response.isJsonObject()); jsonObject = JsonParser.parseString(result.getResponse()).getAsJsonObject(); - assertTrue(jsonObject.has("projectRole")); + userContext = jsonObject.getAsJsonObject("userContext"); + assertTrue(userContext.has("projectRole")); + assertTrue(userContext.has("isFollower")); } catch (Exception e) { e.printStackTrace(); fail(e.toString()); diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java index 081a90ba..b5072aa7 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java @@ -71,7 +71,7 @@ public void testGetUserById() throws Exception { @Test public void testCreateGetProject() throws Exception { - Project project = Project.builder().name("Project3 \uD83D\uDC69\u200D\uD83D\uDC69\u200D\uD83D\uDC67\u200D\uD83D\uDC66").description("An \uD83D\uDE00awesome \uD83D\uDE03string with a few \uD83D\uDE09emojis!").id(1).leader(initUser).visibility(true).isFollower(false).build(); + Project project = Project.builder().name("Project3 \uD83D\uDC69\u200D\uD83D\uDC69\u200D\uD83D\uDC67\u200D\uD83D\uDC66").description("An \uD83D\uDE00awesome \uD83D\uDE03string with a few \uD83D\uDE09emojis!").id(1).leader(initUser).visibility(true).build(); facade.createProject(project, initUser.getId()); @@ -89,7 +89,7 @@ public void testCreateGetProject() throws Exception { assertEquals(project.getLeader().getId(), projectById.getLeader().getId()); assertEquals(project.getVisibility(), projectById.getVisibility()); assertTrue(projectById.isOwner(initUser)); - assertEquals(ProjectRole.ProjectAdmin, projectById.getProjectRole()); + assertEquals(ProjectRole.ProjectAdmin, projectById.getUserContext().getProjectRole()); // Now check if this can also be found as a public project PaginationResult projectsPage = facade.listPublicProjects(new PageInfo(0, 10), initUser.getId()); diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java index 9a13cf94..2c909f68 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java +++ b/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java @@ -68,7 +68,7 @@ public void setUp() throws Exception { try { testProject = facade.getProjectById(0, initUser.getId()); } catch (Exception e) { - testProject = Project.builder().name("ProjectTest").description("ProjDesc").leader(initUser).visibility(true).isFollower(false).build(); + testProject = Project.builder().name("ProjectTest").description("ProjDesc").leader(initUser).visibility(true).build(); testProject = facade.createProject(testProject, initUser.getId()); } } From 0ff957aa7e2b5e8552a8d0b4a5cf9b638935bf64 Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 17 Apr 2021 19:13:24 +0200 Subject: [PATCH 079/134] Also run tests on push --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index dfb4e550..cc458841 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,5 +1,5 @@ name: Gradle Build & Test -on: [pull_request] +on: [pull_request, push] jobs: build: From e975c33495e9a43862844785c90918944819806a Mon Sep 17 00:00:00 2001 From: Thore Date: Wed, 21 Apr 2021 12:02:16 +0200 Subject: [PATCH 080/134] Rename source code folder --- {requirement_bazaar => reqbaz}/build.gradle | 0 ...is.bazaar.service.BazaarService.properties | 0 {requirement_bazaar => reqbaz}/lombok.config | 0 .../acis/bazaar/service/BazaarFunction.java | 0 .../service/BazaarFunctionRegistrar.java | 0 .../acis/bazaar/service/BazaarService.java | 0 .../acis/bazaar/service/dal/DALFacade.java | 0 .../bazaar/service/dal/DALFacadeImpl.java | 0 .../bazaar/service/dal/entities/Activity.java | 0 .../service/dal/entities/Attachment.java | 0 .../bazaar/service/dal/entities/Category.java | 0 .../dal/entities/CategoryContributors.java | 0 .../dal/entities/CategoryFollower.java | 0 .../bazaar/service/dal/entities/Comment.java | 0 .../bazaar/service/dal/entities/Email.java | 0 .../service/dal/entities/EntityBase.java | 0 .../service/dal/entities/EntityContext.java | 0 .../service/dal/entities/EntityOverview.java | 0 .../bazaar/service/dal/entities/Feedback.java | 0 .../service/dal/entities/IdentifiedById.java | 0 .../bazaar/service/dal/entities/Ownable.java | 0 .../dal/entities/PersonalisationData.java | 0 .../service/dal/entities/Privilege.java | 0 .../service/dal/entities/PrivilegeEnum.java | 0 .../bazaar/service/dal/entities/Project.java | 0 .../dal/entities/ProjectContributors.java | 0 .../service/dal/entities/ProjectFollower.java | 0 .../service/dal/entities/ProjectMember.java | 0 .../service/dal/entities/ProjectRole.java | 0 .../service/dal/entities/Requirement.java | 0 .../dal/entities/RequirementCategory.java | 0 .../dal/entities/RequirementContributors.java | 0 .../dal/entities/RequirementDeveloper.java | 0 .../dal/entities/RequirementFollower.java | 0 .../bazaar/service/dal/entities/Role.java | 0 .../service/dal/entities/Statistic.java | 0 .../service/dal/entities/SystemRole.java | 0 .../bazaar/service/dal/entities/User.java | 0 .../service/dal/entities/UserContext.java | 20 +++++++++- .../bazaar/service/dal/entities/Vote.java | 0 .../service/dal/helpers/CreateValidation.java | 0 .../service/dal/helpers/CreationStatus.java | 0 .../dal/helpers/EntityContextFactory.java | 0 .../bazaar/service/dal/helpers/PageInfo.java | 0 .../bazaar/service/dal/helpers/Pageable.java | 0 .../service/dal/helpers/PaginationResult.java | 0 .../service/dal/helpers/SerializerViews.java | 0 .../bazaar/service/dal/helpers/UserVote.java | 0 .../repositories/AttachmentRepository.java | 0 .../AttachmentRepositoryImpl.java | 0 .../CategoryFollowerRepository.java | 0 .../CategoryFollowerRepositoryImpl.java | 0 .../dal/repositories/CategoryRepository.java | 0 .../repositories/CategoryRepositoryImpl.java | 0 .../dal/repositories/CommentRepository.java | 0 .../repositories/CommentRepositoryImpl.java | 0 .../dal/repositories/FeedbackRepository.java | 0 .../repositories/FeedbackRepositoryImpl.java | 0 .../PersonalisationDataRepository.java | 0 .../PersonalisationDataRepositoryImpl.java | 0 .../dal/repositories/PrivilegeRepository.java | 0 .../repositories/PrivilegeRepositoryImpl.java | 0 .../ProjectFollowerRepository.java | 0 .../ProjectFollowerRepositoryImpl.java | 0 .../dal/repositories/ProjectRepository.java | 0 .../repositories/ProjectRepositoryImpl.java | 2 +- .../service/dal/repositories/Repository.java | 0 .../dal/repositories/RepositoryImpl.java | 0 .../RequirementCategoryRepository.java | 0 .../RequirementCategoryRepositoryImpl.java | 0 .../RequirementDeveloperRepository.java | 0 .../RequirementDeveloperRepositoryImpl.java | 0 .../RequirementFollowerRepository.java | 0 .../RequirementFollowerRepositoryImpl.java | 0 .../repositories/RequirementRepository.java | 0 .../RequirementRepositoryImpl.java | 5 +-- .../dal/repositories/RoleRepository.java | 0 .../dal/repositories/RoleRepositoryImpl.java | 0 .../dal/repositories/UserRepository.java | 0 .../dal/repositories/UserRepositoryImpl.java | 0 .../dal/repositories/VoteRepository.java | 0 .../dal/repositories/VoteRepositoryImpl.java | 0 .../dal/transform/AttachmentTransformer.java | 0 .../CategoryFollowerTransformer.java | 0 .../dal/transform/CategoryTransformer.java | 0 .../dal/transform/CommentTransformer.java | 0 .../dal/transform/FeedbackTransformer.java | 0 .../PersonalisationDataTransformer.java | 0 .../dal/transform/PrivilegeEnumConverter.java | 0 .../dal/transform/PrivilegeTransformer.java | 0 .../transform/ProjectFollowerTransformer.java | 0 .../dal/transform/ProjectTransformer.java | 0 .../RequirementCategoryTransformer.java | 0 .../RequirementDeveloperTransformer.java | 0 .../RequirementFollowerTransformer.java | 0 .../dal/transform/RequirementTransformer.java | 0 .../dal/transform/RoleTransformer.java | 0 .../service/dal/transform/Transformer.java | 0 .../dal/transform/UserTransformer.java | 0 .../dal/transform/VoteTransformer.java | 0 .../service/exception/BazaarException.java | 0 .../bazaar/service/exception/ErrorCode.java | 0 .../service/exception/ExceptionHandler.java | 0 .../service/exception/ExceptionLocation.java | 0 .../service/internalization/Localization.java | 0 .../notification/ActivityDispatcher.java | 0 .../service/notification/EmailDispatcher.java | 0 .../notification/NotificationDispatcher.java | 0 .../NotificationDispatcherImp.java | 0 .../resources/AttachmentsResource.java | 0 .../service/resources/CategoryResource.java | 19 +++++----- .../service/resources/CommentsResource.java | 0 .../service/resources/FeedbackResource.java | 0 .../PersonalisationDataResource.java | 0 .../service/resources/ProjectsResource.java | 12 ++---- .../resources/RequirementsResource.java | 37 +++++++++---------- .../service/resources/UsersResource.java | 0 .../security/AuthorizationManager.java | 0 .../resources/i18n/Translation_de.properties | 0 .../resources/i18n/Translation_en.properties | 0 .../migrations/V1__create_reqbaz_schema.sql | 0 .../V2__user_las2peer_id_to_string.sql | 0 .../V3__add_personalisation_table.sql | 0 .../V4__add_personalisation_settings.sql | 0 .../migrations/V5__add_delete_constraints.sql | 0 .../resources/migrations/V6__add_feedback.sql | 0 .../migrations/V7__utf8mb4_conversion.sql | 0 .../migrations/V8__new_privileges.sql | 0 .../V9__more_delete_constraints.sql | 0 .../dbis/acis/bazaar/service/BazaarTest.java | 6 +-- .../dbis/acis/bazaar/service/TestBase.java | 0 .../bazaar/service/dal/DALFacadeTest.java | 2 +- .../bazaar/service/helpers/SetupData.java | 0 settings.gradle | 4 +- 134 files changed, 58 insertions(+), 49 deletions(-) rename {requirement_bazaar => reqbaz}/build.gradle (100%) rename {requirement_bazaar => reqbaz}/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties (100%) rename {requirement_bazaar => reqbaz}/lombok.config (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarFunction.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarFunctionRegistrar.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryContributors.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryFollower.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityBase.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Feedback.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/IdentifiedById.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Ownable.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Privilege.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectContributors.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectFollower.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectMember.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectRole.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementCategory.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementContributors.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementDeveloper.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementFollower.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Statistic.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/SystemRole.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/UserContext.java (56%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Vote.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/CreateValidation.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/CreationStatus.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PaginationResult.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/SerializerViews.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/UserVote.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepository.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepositoryImpl.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepository.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepositoryImpl.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/FeedbackRepository.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/FeedbackRepositoryImpl.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepository.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepositoryImpl.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepository.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepositoryImpl.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepository.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepositoryImpl.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java (99%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/Repository.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepository.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepositoryImpl.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepository.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepositoryImpl.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepository.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepositoryImpl.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java (98%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepository.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepository.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryFollowerTransformer.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/FeedbackTransformer.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeEnumConverter.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectFollowerTransformer.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/Transformer.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/BazaarException.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ErrorCode.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionLocation.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/internalization/Localization.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcher.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/AttachmentsResource.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CategoryResource.java (98%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/FeedbackResource.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/PersonalisationDataResource.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java (99%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java (98%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java (100%) rename {requirement_bazaar => reqbaz}/src/main/java/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java (100%) rename {requirement_bazaar => reqbaz}/src/main/resources/i18n/Translation_de.properties (100%) rename {requirement_bazaar => reqbaz}/src/main/resources/i18n/Translation_en.properties (100%) rename {requirement_bazaar => reqbaz}/src/main/resources/migrations/V1__create_reqbaz_schema.sql (100%) rename {requirement_bazaar => reqbaz}/src/main/resources/migrations/V2__user_las2peer_id_to_string.sql (100%) rename {requirement_bazaar => reqbaz}/src/main/resources/migrations/V3__add_personalisation_table.sql (100%) rename {requirement_bazaar => reqbaz}/src/main/resources/migrations/V4__add_personalisation_settings.sql (100%) rename {requirement_bazaar => reqbaz}/src/main/resources/migrations/V5__add_delete_constraints.sql (100%) rename {requirement_bazaar => reqbaz}/src/main/resources/migrations/V6__add_feedback.sql (100%) rename {requirement_bazaar => reqbaz}/src/main/resources/migrations/V7__utf8mb4_conversion.sql (100%) rename {requirement_bazaar => reqbaz}/src/main/resources/migrations/V8__new_privileges.sql (100%) rename {requirement_bazaar => reqbaz}/src/main/resources/migrations/V9__more_delete_constraints.sql (100%) rename {requirement_bazaar => reqbaz}/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java (98%) rename {requirement_bazaar => reqbaz}/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java (100%) rename {requirement_bazaar => reqbaz}/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java (99%) rename {requirement_bazaar => reqbaz}/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java (100%) diff --git a/requirement_bazaar/build.gradle b/reqbaz/build.gradle similarity index 100% rename from requirement_bazaar/build.gradle rename to reqbaz/build.gradle diff --git a/requirement_bazaar/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties b/reqbaz/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties similarity index 100% rename from requirement_bazaar/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties rename to reqbaz/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties diff --git a/requirement_bazaar/lombok.config b/reqbaz/lombok.config similarity index 100% rename from requirement_bazaar/lombok.config rename to reqbaz/lombok.config diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarFunction.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarFunction.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarFunction.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarFunction.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarFunctionRegistrar.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarFunctionRegistrar.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarFunctionRegistrar.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarFunctionRegistrar.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryContributors.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryContributors.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryContributors.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryContributors.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryFollower.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryFollower.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryFollower.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/CategoryFollower.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityBase.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityBase.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityBase.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityBase.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityContext.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/EntityOverview.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Feedback.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Feedback.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Feedback.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Feedback.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/IdentifiedById.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/IdentifiedById.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/IdentifiedById.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/IdentifiedById.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Ownable.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Ownable.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Ownable.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Ownable.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PersonalisationData.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Privilege.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Privilege.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Privilege.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Privilege.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectContributors.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectContributors.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectContributors.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectContributors.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectFollower.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectFollower.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectFollower.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectFollower.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectMember.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectMember.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectMember.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectMember.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectRole.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectRole.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectRole.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/ProjectRole.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementCategory.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementCategory.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementCategory.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementCategory.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementContributors.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementContributors.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementContributors.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementContributors.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementDeveloper.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementDeveloper.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementDeveloper.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementDeveloper.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementFollower.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementFollower.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementFollower.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementFollower.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Statistic.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Statistic.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Statistic.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Statistic.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/SystemRole.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/SystemRole.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/SystemRole.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/SystemRole.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/UserContext.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/UserContext.java similarity index 56% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/UserContext.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/UserContext.java index 078c5c10..e5bc98f2 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/UserContext.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/UserContext.java @@ -2,11 +2,14 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import de.rwth.dbis.acis.bazaar.service.dal.helpers.UserVote; +import io.swagger.annotations.ApiModelProperty; import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.extern.jackson.Jacksonized; +import javax.validation.constraints.NotNull; + /** * Dynamic object to provide the context the currently logged in user has provided to the related object */ @@ -16,12 +19,27 @@ @Builder(builderClassName = "Builder") public class UserContext extends EntityBase { - private ProjectRole projectRole; + @ApiModelProperty( + value = "The role the user has within the project. Only returned when requesting project resources." + ) + private ProjectRole userRole; + @ApiModelProperty( + value = "Only returned when requesting requirement resources." + ) private UserVote userVoted; + @NotNull private Boolean isFollower; + + @ApiModelProperty( + value = "Only returned when requesting requirement resources." + ) private Boolean isDeveloper; + + @ApiModelProperty( + value = "Only returned when requesting requirement resources." + ) private Boolean isContributor; @JsonIgnore diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Vote.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Vote.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Vote.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Vote.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/CreateValidation.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/CreateValidation.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/CreateValidation.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/CreateValidation.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/CreationStatus.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/CreationStatus.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/CreationStatus.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/CreationStatus.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/EntityContextFactory.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PaginationResult.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PaginationResult.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PaginationResult.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PaginationResult.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/SerializerViews.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/SerializerViews.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/SerializerViews.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/SerializerViews.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/UserVote.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/UserVote.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/UserVote.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/UserVote.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepository.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepository.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepository.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepositoryImpl.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepositoryImpl.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/AttachmentRepositoryImpl.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepository.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepository.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepository.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepositoryImpl.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepositoryImpl.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryFollowerRepositoryImpl.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/FeedbackRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/FeedbackRepository.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/FeedbackRepository.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/FeedbackRepository.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/FeedbackRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/FeedbackRepositoryImpl.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/FeedbackRepositoryImpl.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/FeedbackRepositoryImpl.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepository.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepository.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepository.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepositoryImpl.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepositoryImpl.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PersonalisationDataRepositoryImpl.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepository.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepository.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepository.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepositoryImpl.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepositoryImpl.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/PrivilegeRepositoryImpl.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepository.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepository.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepository.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepositoryImpl.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepositoryImpl.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectFollowerRepositoryImpl.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java similarity index 99% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java index 0e028535..6d49b141 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java @@ -173,7 +173,7 @@ private ImmutablePair, Integer> getFilteredProjects(Condition sear userContext.isFollower(0 != (Integer) queryResult.getValue(isFollower)); } RoleRepositoryImpl roleRepository = new RoleRepositoryImpl(jooq); - userContext.projectRole(roleRepository.getProjectRole(userId, project.getId())); + userContext.userRole(roleRepository.getProjectRole(userId, project.getId())); project.setUserContext(userContext.build()); projects.add(project); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/Repository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/Repository.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/Repository.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/Repository.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepository.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepository.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepository.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepositoryImpl.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepositoryImpl.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementCategoryRepositoryImpl.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepository.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepository.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepository.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepositoryImpl.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepositoryImpl.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementDeveloperRepositoryImpl.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepository.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepository.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepository.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepositoryImpl.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepositoryImpl.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementFollowerRepositoryImpl.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java similarity index 98% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java index 33a85482..bc133715 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java @@ -22,10 +22,7 @@ import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementCategoryMapRecord; import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementRecord; -import de.rwth.dbis.acis.bazaar.service.dal.entities.Attachment; -import de.rwth.dbis.acis.bazaar.service.dal.entities.Requirement; -import de.rwth.dbis.acis.bazaar.service.dal.entities.Statistic; -import de.rwth.dbis.acis.bazaar.service.dal.entities.UserContext; +import de.rwth.dbis.acis.bazaar.service.dal.entities.*; import de.rwth.dbis.acis.bazaar.service.dal.helpers.*; import de.rwth.dbis.acis.bazaar.service.dal.transform.RequirementTransformer; import de.rwth.dbis.acis.bazaar.service.dal.transform.UserTransformer; diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepository.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepository.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepository.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepository.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepository.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepository.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepository.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryFollowerTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryFollowerTransformer.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryFollowerTransformer.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryFollowerTransformer.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/FeedbackTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/FeedbackTransformer.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/FeedbackTransformer.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/FeedbackTransformer.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PersonalisationDataTransformer.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeEnumConverter.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeEnumConverter.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeEnumConverter.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeEnumConverter.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/PrivilegeTransformer.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectFollowerTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectFollowerTransformer.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectFollowerTransformer.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectFollowerTransformer.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementCategoryTransformer.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementDeveloperTransformer.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementFollowerTransformer.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RoleTransformer.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/Transformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/Transformer.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/Transformer.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/Transformer.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/BazaarException.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/BazaarException.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/BazaarException.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/BazaarException.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ErrorCode.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ErrorCode.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ErrorCode.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ErrorCode.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionHandler.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionLocation.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionLocation.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionLocation.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/ExceptionLocation.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/internalization/Localization.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/internalization/Localization.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/internalization/Localization.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/internalization/Localization.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcher.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcher.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcher.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcher.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/AttachmentsResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/AttachmentsResource.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/AttachmentsResource.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/AttachmentsResource.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CategoryResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CategoryResource.java similarity index 98% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CategoryResource.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CategoryResource.java index aaf19b90..7e242b1e 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CategoryResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CategoryResource.java @@ -274,12 +274,11 @@ public Response createCategory(@ApiParam(value = "Category entity", required = t /** * Allows to update a certain category. * - * @param categoryId id of the category under a given project * @param categoryToUpdate updated category as a JSON object * @return Response with the updated category as a JSON object. */ @PUT - @Path("/{categoryId}") + @Path("/") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "This method allows to update a certain category.") @@ -289,8 +288,7 @@ public Response createCategory(@ApiParam(value = "Category entity", required = t @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") }) - public Response updateCategory(@PathParam("categoryId") int categoryId, - @ApiParam(value = "Category entity", required = true) Category categoryToUpdate) { + public Response updateCategory(@ApiParam(value = "Category entity", required = true) Category categoryToUpdate) { DALFacade dalFacade = null; try { @@ -306,13 +304,14 @@ public Response updateCategory(@PathParam("categoryId") int categoryId, dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_CATEGORY, dalFacade); + + // Prevent forged project ids + Category internalCategory = dalFacade.getCategoryById(categoryToUpdate.getId(), internalUserId); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_CATEGORY, internalCategory.getProjectId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.category.modify")); } - if (categoryToUpdate.getId() != 0 && categoryId != categoryToUpdate.getId()) { - ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, "Id does not match"); - } + Category updatedCategory = dalFacade.modifyCategory(categoryToUpdate); bazaarService.getNotificationDispatcher().dispatchNotification(updatedCategory.getLastUpdatedDate(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_17, updatedCategory.getId(), Activity.DataType.CATEGORY, internalUserId); @@ -324,13 +323,13 @@ public Response updateCategory(@PathParam("categoryId") int categoryId, return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } else { logger.warning(bex.getMessage()); - Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Update category " + categoryId); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Update category " + categoryToUpdate.getId()); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } } catch (Exception ex) { BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); logger.warning(bex.getMessage()); - Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Update category " + categoryId); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Update category " + categoryToUpdate.getId()); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } finally { bazaarService.closeDBConnection(dalFacade); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/FeedbackResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/FeedbackResource.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/FeedbackResource.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/FeedbackResource.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/PersonalisationDataResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/PersonalisationDataResource.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/PersonalisationDataResource.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/PersonalisationDataResource.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java similarity index 99% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java index f23b76db..ad3f33b9 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java @@ -283,12 +283,11 @@ public Response createProject(@ApiParam(value = "Project entity", required = tru /** * Allows to update a certain project. * - * @param projectId id of the project to update * @param projectToUpdate updated project * @return Response with the updated project as a JSON object. */ @PUT - @Path("/{projectId}") + @Path("/") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "This method allows to update a certain project.") @@ -298,8 +297,7 @@ public Response createProject(@ApiParam(value = "Project entity", required = tru @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") }) - public Response updateProject(@PathParam("projectId") int projectId, - @ApiParam(value = "Project entity", required = true) Project projectToUpdate) { + public Response updateProject(@ApiParam(value = "Project entity", required = true) Project projectToUpdate) { DALFacade dalFacade = null; try { String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); @@ -315,13 +313,11 @@ public Response updateProject(@PathParam("projectId") int projectId, dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_PROJECT, dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_PROJECT, projectToUpdate.getId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.project.modify")); } - if (projectToUpdate.getId() != 0 && projectId != projectToUpdate.getId()) { - ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, "Id does not match"); - } + Project updatedProject = dalFacade.modifyProject(projectToUpdate); bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_6, updatedProject.getId(), Activity.DataType.PROJECT, internalUserId); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java similarity index 98% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java index 961dd365..40a4986a 100644 --- a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java @@ -519,23 +519,21 @@ public Response createRequirement(@ApiParam(value = "Requirement entity", requir /** * This method updates a specific requirement within a project and category. * - * @param requirementId id of the requirement to update * @param requirementToUpdate requirement as a JSON object * @return Response with updated requirement as a JSON object. */ @PUT - @Path("/{requirementId}") + @Path("/") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "This method updates a specific requirement.") + @ApiOperation(value = "This method updates a requirement.") @ApiResponses(value = { @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns the updated requirement", response = Requirement.class), @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") }) - public Response updateRequirement(@PathParam("requirementId") int requirementId, - @ApiParam(value = "Requirement entity", required = true) Requirement requirementToUpdate) { + public Response updateRequirement(@ApiParam(value = "Requirement entity", required = true) Requirement requirementToUpdate) { DALFacade dalFacade = null; try { String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); @@ -550,17 +548,19 @@ public Response updateRequirement(@PathParam("requirementId") int requirementId, dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_REQUIREMENT, dalFacade); + + // Get internal requirement, so a malicious actor can't provide another project id + Requirement internalRequirement = dalFacade.getRequirementById(requirementToUpdate.getId(), internalUserId); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_REQUIREMENT, internalRequirement.getProjectId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.requirement.modify")); } - if (requirementToUpdate.getId() != 0 && requirementId != requirementToUpdate.getId()) { - ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, "Id does not match"); - } + dalFacade.followRequirement(internalUserId, requirementToUpdate.getId()); Requirement updatedRequirement = dalFacade.modifyRequirement(requirementToUpdate, internalUserId); + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_27, - requirementId, Activity.DataType.REQUIREMENT, internalUserId); + updatedRequirement.getId(), Activity.DataType.REQUIREMENT, internalUserId); return Response.ok(updatedRequirement.toJSON()).build(); } catch (BazaarException bex) { if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { @@ -569,13 +569,13 @@ public Response updateRequirement(@PathParam("requirementId") int requirementId, return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } else { logger.warning(bex.getMessage()); - Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Update requirement " + requirementId); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Update requirement " + requirementToUpdate.getId()); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } } catch (Exception ex) { BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); logger.warning(bex.getMessage()); - Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Update requirement " + requirementId); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Update requirement " + requirementToUpdate.getId()); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } finally { bazaarService.closeDBConnection(dalFacade); @@ -990,13 +990,13 @@ public Response unfollowRequirement(@PathParam("requirementId") int requirementI @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "This method creates a vote for the given requirement in the name of the current user.") @ApiResponses(value = { - @ApiResponse(code = HttpURLConnection.HTTP_SEE_OTHER, message = "Returns the requirement", response = Requirement.class), + @ApiResponse(code = HttpURLConnection.HTTP_SEE_OTHER, message = "Path to parent requirement"), @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") }) public Response vote(@PathParam("requirementId") int requirementId, - @ApiParam(value = "Vote direction", allowableValues = "up, down") @DefaultValue("up") String direction) { + @ApiParam(value = "Vote direction", required = true) Direction direction) { DALFacade dalFacade = null; try { Agent agent = Context.getCurrent().getMainAgent(); @@ -1012,14 +1012,13 @@ public Response vote(@PathParam("requirementId") int requirementId, if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.vote.create")); } - dalFacade.vote(internalUserId, requirementId, direction.equals("up")); - if (direction.equals("up")) { + dalFacade.vote(internalUserId, requirementId, direction.isUpVote()); + if (direction.isUpVote()) { dalFacade.followRequirement(internalUserId, requirementId); } - Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.VOTE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_35, requirementId, Activity.DataType.REQUIREMENT, internalUserId); - return Response.status(Response.Status.SEE_OTHER).location(URI.create(bazaarService.getBaseURL() + "requirements/" + requirementId)).entity(requirement.toJSON()).build(); + return Response.status(Response.Status.SEE_OTHER).location(URI.create(bazaarService.getBaseURL() + "requirements/" + requirementId)).build(); } catch (BazaarException bex) { if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); @@ -1075,7 +1074,7 @@ public Response unvote(@PathParam("requirementId") int requirementId) { Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UNVOTE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_36, requirementId, Activity.DataType.REQUIREMENT, internalUserId); - return Response.status(Response.Status.SEE_OTHER).location(URI.create(bazaarService.getBaseURL() + "requirement/" + requirementId)).entity(requirement.toJSON()).build(); + return Response.status(Response.Status.SEE_OTHER).location(URI.create(bazaarService.getBaseURL() + "requirements/" + requirementId)).entity(requirement.toJSON()).build(); } catch (BazaarException bex) { if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java diff --git a/requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java similarity index 100% rename from requirement_bazaar/src/main/java/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java rename to reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java diff --git a/requirement_bazaar/src/main/resources/i18n/Translation_de.properties b/reqbaz/src/main/resources/i18n/Translation_de.properties similarity index 100% rename from requirement_bazaar/src/main/resources/i18n/Translation_de.properties rename to reqbaz/src/main/resources/i18n/Translation_de.properties diff --git a/requirement_bazaar/src/main/resources/i18n/Translation_en.properties b/reqbaz/src/main/resources/i18n/Translation_en.properties similarity index 100% rename from requirement_bazaar/src/main/resources/i18n/Translation_en.properties rename to reqbaz/src/main/resources/i18n/Translation_en.properties diff --git a/requirement_bazaar/src/main/resources/migrations/V1__create_reqbaz_schema.sql b/reqbaz/src/main/resources/migrations/V1__create_reqbaz_schema.sql similarity index 100% rename from requirement_bazaar/src/main/resources/migrations/V1__create_reqbaz_schema.sql rename to reqbaz/src/main/resources/migrations/V1__create_reqbaz_schema.sql diff --git a/requirement_bazaar/src/main/resources/migrations/V2__user_las2peer_id_to_string.sql b/reqbaz/src/main/resources/migrations/V2__user_las2peer_id_to_string.sql similarity index 100% rename from requirement_bazaar/src/main/resources/migrations/V2__user_las2peer_id_to_string.sql rename to reqbaz/src/main/resources/migrations/V2__user_las2peer_id_to_string.sql diff --git a/requirement_bazaar/src/main/resources/migrations/V3__add_personalisation_table.sql b/reqbaz/src/main/resources/migrations/V3__add_personalisation_table.sql similarity index 100% rename from requirement_bazaar/src/main/resources/migrations/V3__add_personalisation_table.sql rename to reqbaz/src/main/resources/migrations/V3__add_personalisation_table.sql diff --git a/requirement_bazaar/src/main/resources/migrations/V4__add_personalisation_settings.sql b/reqbaz/src/main/resources/migrations/V4__add_personalisation_settings.sql similarity index 100% rename from requirement_bazaar/src/main/resources/migrations/V4__add_personalisation_settings.sql rename to reqbaz/src/main/resources/migrations/V4__add_personalisation_settings.sql diff --git a/requirement_bazaar/src/main/resources/migrations/V5__add_delete_constraints.sql b/reqbaz/src/main/resources/migrations/V5__add_delete_constraints.sql similarity index 100% rename from requirement_bazaar/src/main/resources/migrations/V5__add_delete_constraints.sql rename to reqbaz/src/main/resources/migrations/V5__add_delete_constraints.sql diff --git a/requirement_bazaar/src/main/resources/migrations/V6__add_feedback.sql b/reqbaz/src/main/resources/migrations/V6__add_feedback.sql similarity index 100% rename from requirement_bazaar/src/main/resources/migrations/V6__add_feedback.sql rename to reqbaz/src/main/resources/migrations/V6__add_feedback.sql diff --git a/requirement_bazaar/src/main/resources/migrations/V7__utf8mb4_conversion.sql b/reqbaz/src/main/resources/migrations/V7__utf8mb4_conversion.sql similarity index 100% rename from requirement_bazaar/src/main/resources/migrations/V7__utf8mb4_conversion.sql rename to reqbaz/src/main/resources/migrations/V7__utf8mb4_conversion.sql diff --git a/requirement_bazaar/src/main/resources/migrations/V8__new_privileges.sql b/reqbaz/src/main/resources/migrations/V8__new_privileges.sql similarity index 100% rename from requirement_bazaar/src/main/resources/migrations/V8__new_privileges.sql rename to reqbaz/src/main/resources/migrations/V8__new_privileges.sql diff --git a/requirement_bazaar/src/main/resources/migrations/V9__more_delete_constraints.sql b/reqbaz/src/main/resources/migrations/V9__more_delete_constraints.sql similarity index 100% rename from requirement_bazaar/src/main/resources/migrations/V9__more_delete_constraints.sql rename to reqbaz/src/main/resources/migrations/V9__more_delete_constraints.sql diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java similarity index 98% rename from requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java rename to reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index 2db8e540..c85f55a8 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -74,7 +74,7 @@ public void testCreateProject() { assertTrue(response.has("userContext")); JsonObject userContext = response.getAsJsonObject("userContext"); - assertTrue(userContext.has("projectRole")); + assertTrue(userContext.has("userRole")); assertTrue(userContext.has("isFollower")); } catch (Exception e) { @@ -112,7 +112,7 @@ public void testGetProjects() { // Normal user has no project role assertTrue(jsonObject.has("userContext")); JsonObject userContext = jsonObject.getAsJsonObject("userContext"); - assertFalse(userContext.has("projectRole")); + assertFalse(userContext.has("userRole")); assertTrue(userContext.has("isFollower")); // Test with admin @@ -126,7 +126,7 @@ public void testGetProjects() { jsonObject = JsonParser.parseString(result.getResponse()).getAsJsonObject(); userContext = jsonObject.getAsJsonObject("userContext"); - assertTrue(userContext.has("projectRole")); + assertTrue(userContext.has("userRole")); assertTrue(userContext.has("isFollower")); } catch (Exception e) { e.printStackTrace(); diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java similarity index 100% rename from requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java rename to reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java similarity index 99% rename from requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java rename to reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java index b5072aa7..a017b5b1 100644 --- a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java +++ b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java @@ -89,7 +89,7 @@ public void testCreateGetProject() throws Exception { assertEquals(project.getLeader().getId(), projectById.getLeader().getId()); assertEquals(project.getVisibility(), projectById.getVisibility()); assertTrue(projectById.isOwner(initUser)); - assertEquals(ProjectRole.ProjectAdmin, projectById.getUserContext().getProjectRole()); + assertEquals(ProjectRole.ProjectAdmin, projectById.getUserContext().getUserRole()); // Now check if this can also be found as a public project PaginationResult projectsPage = facade.listPublicProjects(new PageInfo(0, 10), initUser.getId()); diff --git a/requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java similarity index 100% rename from requirement_bazaar/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java rename to reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java diff --git a/settings.gradle b/settings.gradle index f07b0d00..c7169383 100644 --- a/settings.gradle +++ b/settings.gradle @@ -7,5 +7,5 @@ * in the user manual at https://docs.gradle.org/6.7/userguide/multi_project_builds.html */ -rootProject.name = 'Requirement Bazaar' -include('requirement_bazaar') +rootProject.name = 'Requirements Bazaar' +include('reqbaz') From 2155ebcdb6d55decb917084da1b112ac961b81ce Mon Sep 17 00:00:00 2001 From: Thore Date: Wed, 21 Apr 2021 12:03:49 +0200 Subject: [PATCH 081/134] Separate direction into own argument --- .../bazaar/service/dal/entities/Direction.java | 16 ++++++++++++++++ .../service/dal/entities/VoteDirection.java | 6 ++++++ 2 files changed, 22 insertions(+) create mode 100644 reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Direction.java create mode 100644 reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/VoteDirection.java diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Direction.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Direction.java new file mode 100644 index 00000000..634fce71 --- /dev/null +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Direction.java @@ -0,0 +1,16 @@ +package de.rwth.dbis.acis.bazaar.service.dal.entities; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Getter; +import lombok.Setter; + +public class Direction { + @Getter + @Setter + private VoteDirection direction; + + @JsonIgnore + public boolean isUpVote() { + return direction == VoteDirection.up; + } +} diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/VoteDirection.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/VoteDirection.java new file mode 100644 index 00000000..07f5c86b --- /dev/null +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/VoteDirection.java @@ -0,0 +1,6 @@ +package de.rwth.dbis.acis.bazaar.service.dal.entities; + +public enum VoteDirection { + up, + down, +} From edc25ca98f70a04f1401b9e9af067585c20c4722 Mon Sep 17 00:00:00 2001 From: Thore Date: Wed, 21 Apr 2021 12:07:08 +0200 Subject: [PATCH 082/134] Update changelog --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37192331..d934c7ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,8 +20,8 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas attribute [#91](https://github.com/rwth-acis/RequirementsBazaar/pull/91). - Categories, projects and requirements now have a `userContext` encapsuling the dynamic user related information ( permissions, votes, contribution) [#94](https://github.com/rwth-acis/RequirementsBazaar/pull/94). -- If a user is a member of a project the respective role is now returned in the`projectRole` attribute of the - new `userContext` attribute [#94](https://github.com/rwth-acis/RequirementsBazaar/pull/94). +- If a user is a member of a project the respective role is now returned in the`usertRole` attribute of the + new `userContext` attribute [#94](https://github.com/rwth-acis/RequirementsBazaar/pull/94) [#96](https://github.com/rwth-acis/RequirementsBazaar/pull/96). ### Changed @@ -52,7 +52,7 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas - Requirements no longer return the category objects in the `categories` attribute but a list of category ids [#91](https://github.com/rwth-acis/RequirementsBazaar/pull/91). - Vote direction can no longer be provided as a query - parameter [#94](https://github.com/rwth-acis/RequirementsBazaar/pull/94) + parameter [#94](https://github.com/rwth-acis/RequirementsBazaar/pull/94) but instead as a direction object strictly defined by an enum [#96](https://github.com/rwth-acis/RequirementsBazaar/pull/96), - Moved user related information in categories, requirements and projects (isFollower/Developer/Contributor, userVoted) into the new `userContext` [#94](https://github.com/rwth-acis/RequirementsBazaar/pull/94). From 8e5354d5ef5bf6c6cf18e089e16aaaff109aff56 Mon Sep 17 00:00:00 2001 From: Thore Date: Wed, 21 Apr 2021 12:08:47 +0200 Subject: [PATCH 083/134] Set new path for gh actions codecov report --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index cc458841..df9ae2fa 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -33,6 +33,6 @@ jobs: - uses: codecov/codecov-action@v1 with: flags: unittests - files: ./requirement_bazaar/build/reports/jacoco/test/jacocoTestReport.xml + files: ./reqbaz/build/reports/jacoco/test/jacocoTestReport.xml fail_ci_if_error: true verbose: true From 5cbab74606ad32062f097df644259be22830c8e9 Mon Sep 17 00:00:00 2001 From: Thore Date: Mon, 26 Apr 2021 10:42:36 +0200 Subject: [PATCH 084/134] Fix typo in error message --- reqbaz/src/main/resources/i18n/Translation_en.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reqbaz/src/main/resources/i18n/Translation_en.properties b/reqbaz/src/main/resources/i18n/Translation_en.properties index 1debc732..19546ca1 100644 --- a/reqbaz/src/main/resources/i18n/Translation_en.properties +++ b/reqbaz/src/main/resources/i18n/Translation_en.properties @@ -48,7 +48,7 @@ error.unknown_exception=%s Error in %s\: %s ExceptionCode\: %d. category.uncategorized.Name=General Requirements category.uncategorized.Description=Requirements which do not belong to any category. error.validation=On %s constraint violation has been detected, because you sent %s and the problem is\: %s. -error.authorization.project.modify=You does not have rights to modify this project. +error.authorization.project.modify=You do not have rights to modify this project. error.authorization.requirement.modify=Only the creator can modify requirements. error.resource.notfound=$s not found. From 39fe9fa9d69433725bbe0d32c174d0d14fcac25f Mon Sep 17 00:00:00 2001 From: Thore Date: Mon, 26 Apr 2021 10:49:44 +0200 Subject: [PATCH 085/134] Fix path in releace action --- .github/workflows/release_rc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_rc.yaml b/.github/workflows/release_rc.yaml index 41355b4f..cec96900 100644 --- a/.github/workflows/release_rc.yaml +++ b/.github/workflows/release_rc.yaml @@ -58,6 +58,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./requirement_bazaar/build/dist/BazaarService.zip + asset_path: ./reqbaz/build/dist/BazaarService.zip asset_name: RequirementsBazaar-${{ steps.get_version.outputs.version }}.zip asset_content_type: application/zip From ca122bc5aa87edcdad355193188304487bee38c8 Mon Sep 17 00:00:00 2001 From: Thore Date: Fri, 30 Apr 2021 17:49:01 +0200 Subject: [PATCH 086/134] Fix categories being returned multiple times --- .../acis/bazaar/service/dal/DALFacade.java | 3 +- .../bazaar/service/dal/DALFacadeImpl.java | 10 ++--- .../service/dal/entities/Attachment.java | 5 +++ .../bazaar/service/dal/entities/Category.java | 5 +++ .../bazaar/service/dal/entities/Comment.java | 5 +++ .../bazaar/service/dal/entities/Ownable.java | 3 ++ .../bazaar/service/dal/entities/Project.java | 5 +++ .../service/dal/entities/Requirement.java | 5 +++ .../dal/repositories/CategoryRepository.java | 2 +- .../repositories/CategoryRepositoryImpl.java | 16 +++++--- .../resources/RequirementsResource.java | 4 +- .../dbis/acis/bazaar/service/BazaarTest.java | 9 +++++ .../bazaar/service/dal/DALFacadeTest.java | 39 ++++++++++++------- 13 files changed, 80 insertions(+), 31 deletions(-) diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java index 8e1aa49f..f23ee8b0 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java @@ -370,10 +370,9 @@ public interface DALFacade { /** * @param requirementId the id of the requirement we are looking in - * @param pageable pagination information * @return the categories under the given project in a paginated way */ - PaginationResult listCategoriesByRequirementId(int requirementId, Pageable pageable, int userId) throws BazaarException; + List listCategoriesByRequirementId(int requirementId, int userId) throws BazaarException; /** * @param category to be added to the database. diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index 0f6e4597..df16fcca 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -309,8 +309,8 @@ public Requirement modifyRequirement(Requirement modifiedRequirement, int userId requirementRepository.update(modifiedRequirement); if (modifiedRequirement.getCategories() != null) { - PaginationResult oldCategories = listCategoriesByRequirementId(modifiedRequirement.getId(), new PageInfo(0, 1000, new HashMap<>()), userId); - for (Category oldCategory : oldCategories.getElements()) { + List oldCategories = listCategoriesByRequirementId(modifiedRequirement.getId(), userId); + for (Category oldCategory : oldCategories) { boolean containCategory = false; for (Integer newCategory : modifiedRequirement.getCategories()) { if (oldCategory.getId() == newCategory) { @@ -324,7 +324,7 @@ public Requirement modifyRequirement(Requirement modifiedRequirement, int userId } for (Integer newCategory : modifiedRequirement.getCategories()) { boolean containCategory = false; - for (Category oldCategory : oldCategories.getElements()) { + for (Category oldCategory : oldCategories) { if (oldCategory.getId() == newCategory) { containCategory = true; break; @@ -394,9 +394,9 @@ public PaginationResult listCategoriesByProjectId(int projectId, Pagea } @Override - public PaginationResult listCategoriesByRequirementId(int requirementId, Pageable pageable, int userId) throws BazaarException { + public List listCategoriesByRequirementId(int requirementId, int userId) throws BazaarException { categoryRepository = (categoryRepository != null) ? categoryRepository : new CategoryRepositoryImpl(dslContext); - return categoryRepository.findByRequirementId(requirementId, pageable, userId); + return categoryRepository.findByRequirementId(requirementId, userId); } @Override diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java index 7cb43766..d1a5f7b4 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java @@ -73,4 +73,9 @@ public class Attachment extends EntityBase implements Ownable { public boolean isOwner(User user) { return creator == user; } + + @Override + public boolean isOwner(Integer userId) { + return creator.getId() == userId; + } } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java index 5089de4d..7b2d9b6a 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java @@ -75,4 +75,9 @@ public class Category extends EntityBase implements Ownable { public boolean isOwner(User user) { return creator == user; } + + @Override + public boolean isOwner(Integer userId) { + return creator.getId() == userId; + } } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java index 19527a25..ed31a1a8 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java @@ -70,4 +70,9 @@ public class Comment extends EntityBase implements Ownable { public boolean isOwner(User user) { return creator == user; } + + @Override + public boolean isOwner(Integer userId) { + return creator.getId() == userId; + } } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Ownable.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Ownable.java index 4c8df86a..388b03b7 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Ownable.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Ownable.java @@ -5,4 +5,7 @@ public interface Ownable { @JsonIgnore boolean isOwner(User user); + + @JsonIgnore + boolean isOwner(Integer userId); } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java index 38e8c3d9..bdabfc06 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java @@ -75,4 +75,9 @@ public class Project extends EntityBase implements Ownable { public boolean isOwner(User user) { return leader.equals(user); } + + @Override + public boolean isOwner(Integer userId) { + return leader.getId() == userId; + } } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java index 2d3f6c25..fbbbaedb 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java @@ -76,4 +76,9 @@ public class Requirement extends EntityBase implements Ownable { public boolean isOwner(User user) { return creator == user; } + + @Override + public boolean isOwner(Integer userId) { + return creator.getId() == userId; + } } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java index a49f266b..6d2605f6 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java @@ -38,7 +38,7 @@ public interface CategoryRepository extends Repository { PaginationResult findByProjectId(int projectId, Pageable pageable, int userId) throws BazaarException; - PaginationResult findByRequirementId(int requirementId, Pageable pageable, int userId) throws BazaarException; + List findByRequirementId(int requirementId, int userId) throws BazaarException; PaginationResult findAll(Pageable pageable, int userId) throws BazaarException; diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java index fe54e431..544fdc37 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java @@ -142,7 +142,7 @@ private ImmutablePair, Integer> getFilteredCategories(Collection< .select(lastActivity) .from(CATEGORY) .leftOuterJoin(leaderUser).on(leaderUser.ID.equal(CATEGORY.LEADER_ID)) - .leftOuterJoin(REQUIREMENT_CATEGORY_MAP).on(REQUIREMENT_CATEGORY_MAP.CATEGORY_ID.equal(CATEGORY.ID)) + //.leftOuterJoin(REQUIREMENT_CATEGORY_MAP).on(REQUIREMENT_CATEGORY_MAP.CATEGORY_ID.equal(CATEGORY.ID)) .leftOuterJoin(LAST_ACTIVITY).on(CATEGORY.ID.eq(LAST_ACTIVITY.field(CATEGORY.ID))) .where(categoryFilter) .orderBy(transformer.getSortFields(pageable.getSorts())) @@ -256,14 +256,18 @@ public List listAllCategoryIds(Pageable pageable, int userId) throws Ba } @Override - public PaginationResult findByRequirementId(int requirementId, Pageable pageable, int userId) throws BazaarException { - PaginationResult result = null; + public List findByRequirementId(int requirementId, int userId) throws BazaarException { + List result = null; try { - Condition filterCondition = REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID.equal(requirementId); + // Resolve map here, or the cartesian product will bite all other queries + List categoryIds = jooq.selectFrom(REQUIREMENT_CATEGORY_MAP).where(REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID.equal(requirementId)).fetch(REQUIREMENT_CATEGORY_MAP.CATEGORY_ID); + + Condition filterCondition = transformer.getTableId().in(categoryIds); + - ImmutablePair, Integer> fileredCategories = getFilteredCategories(filterCondition, pageable, userId); + ImmutablePair, Integer> fileredCategories = getFilteredCategories(filterCondition, userId); - result = new PaginationResult<>(fileredCategories.right, pageable, fileredCategories.left); + result = fileredCategories.left; } catch (Exception e) { ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java index 40a4986a..714f027f 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java @@ -523,7 +523,7 @@ public Response createRequirement(@ApiParam(value = "Requirement entity", requir * @return Response with updated requirement as a JSON object. */ @PUT - @Path("/") + //@Path("/") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "This method updates a requirement.") @@ -552,7 +552,7 @@ public Response updateRequirement(@ApiParam(value = "Requirement entity", requir // Get internal requirement, so a malicious actor can't provide another project id Requirement internalRequirement = dalFacade.getRequirementById(requirementToUpdate.getId(), internalUserId); boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_REQUIREMENT, internalRequirement.getProjectId(), dalFacade); - if (!authorized) { + if (!authorized && !internalRequirement.isOwner(internalUserId)) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.requirement.modify")); } diff --git a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index c85f55a8..a1f563b0 100644 --- a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -226,6 +226,15 @@ public void testRequirements() { assertTrue(isValidISO8601(createdRequirement.get("creationDate").toString().replace("\"", ""))); assertTrue(isValidISO8601(createdRequirement.get("lastActivity").toString().replace("\"", ""))); + // Test update + createdRequirement.addProperty("description", "Updated Description"); + result = client.sendRequest("PUT", mainPath + "requirements", createdRequirement.toString(), + MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, new HashMap<>()); + assertEquals(200, result.getHttpCode()); + response = JsonParser.parseString(result.getResponse()).getAsJsonObject(); + assertTrue(response.isJsonObject()); + System.out.println(response); + } catch (Exception e) { e.printStackTrace(); fail(e.toString()); diff --git a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java index a017b5b1..ea6bd5e6 100644 --- a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java +++ b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java @@ -159,6 +159,30 @@ public void testFeedback() { } + @Test + public void testCreateCategory() throws Exception { + String name = "TestComp9"; + Category testComp9 = Category.builder() + .name(name) + .description("Very testing") + .projectId(testProject.getId()) + .creator(initUser) + .build(); + + facade.createCategory(testComp9, initUser.getId()); + + List components = facade.listCategoriesByProjectId(testProject.getId(), ALL_IN_ONE_PAGE, initUser.getId()).getElements(); + + assertNotNull(components); + assertEquals(2,components.size()); + + components.forEach(category -> { + if (category.getName().equals(name)) { + jooq.delete(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Category.CATEGORY).where(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Category.CATEGORY.ID.equal(category.getId())).execute(); + } + }); + } + /* Doesn't work, searching breaks public void testModifyProject() throws Exception { //TODO @@ -287,21 +311,6 @@ public void testListComponentsByProjectId() throws Exception { assertEquals(1,components.get(0).getId()); } - public void testCreateCategory() throws Exception { - int createdComponentId = 9; - Category testComp9 = Category.getBuilder("TestComp9").description("Very testing").id(createdComponentId).projectId(1).leader(initUser).build(); - - facade.createCategory(testComp9, initUser.getId()); - - List components = (List) facade.listCategoriesByProjectId(1, ALL_IN_ONE_PAGE, 1); - - assertNotNull(components); - assertEquals(1,components.size()); - assertEquals(createdComponentId,components.get(0).getId()); - - jooq.delete(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Category.CATEGORY).where(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Category.CATEGORY.ID.equal(createdComponentId)).execute(); - } - public void testModifyComponent() throws Exception { //TODO } From 34ff12c71d1666558d9a2e8d3dd4e6e587403008 Mon Sep 17 00:00:00 2001 From: Thore Date: Fri, 30 Apr 2021 18:53:06 +0200 Subject: [PATCH 087/134] Add delete project capabilities --- docs/Privileges.md | 1 + .../acis/bazaar/service/dal/DALFacade.java | 8 +++ .../bazaar/service/dal/DALFacadeImpl.java | 8 +++ .../service/dal/entities/PrivilegeEnum.java | 1 + .../service/resources/ProjectsResource.java | 57 +++++++++++++++++++ .../migrations/V10__delete_project.sql | 7 +++ .../dbis/acis/bazaar/service/BazaarTest.java | 3 + 7 files changed, 85 insertions(+) create mode 100644 reqbaz/src/main/resources/migrations/V10__delete_project.sql diff --git a/docs/Privileges.md b/docs/Privileges.md index a9d404d4..0a309b7e 100644 --- a/docs/Privileges.md +++ b/docs/Privileges.md @@ -34,6 +34,7 @@ There are 6 roles, which inherit the privileges of the roles mentioned before. T |ProjectAdmin |Modify_CATEGORY | |ProjectAdmin |Modify_PROJECT | |ProjectAdmin |Modify_ADMIN_MEMBERS | +|ProjectAdmin |Delete_PROJECT | |ProjectManager|Create_CATEGORY | |ProjectManager|Modify_ATTACHMENT | |ProjectManager|Modify_COMMENT | diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java index f23ee8b0..4ec1b25b 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java @@ -184,6 +184,13 @@ public interface DALFacade { */ Project modifyProject(Project modifiedProject) throws Exception; + /** + * Deletes a given project + * @param projectId id of the project to delete + * @param userId id of the user + */ + Project deleteProjectById(int projectId, Integer userId) throws Exception; + /** * Returns if a project is public or not * @@ -665,5 +672,6 @@ public interface DALFacade { * @throws Exception */ Feedback getFeedbackById(int feedbackId) throws Exception; + // endregion feedback } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index df16fcca..392360c4 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -237,6 +237,14 @@ public Project modifyProject(Project modifiedProject) throws Exception { return projectRepository.update(modifiedProject); } + @Override + public Project deleteProjectById(int projectId, Integer userId) throws Exception { + projectRepository = (projectRepository != null) ? projectRepository : new ProjectRepositoryImpl(dslContext); + Project project = projectRepository.findById(projectId, userId); + projectRepository.delete(projectId); + return project; + } + @Override public boolean isProjectPublic(int projectId) throws BazaarException { projectRepository = (projectRepository != null) ? projectRepository : new ProjectRepositoryImpl(dslContext); diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java index 17c0e3fe..14987d37 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/PrivilegeEnum.java @@ -28,6 +28,7 @@ public enum PrivilegeEnum { Read_PROJECT, Read_PUBLIC_PROJECT, Modify_PROJECT, + Delete_PROJECT, Create_CATEGORY, Read_CATEGORY, diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java index ad3f33b9..8533826d 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java @@ -342,6 +342,63 @@ public Response updateProject(@ApiParam(value = "Project entity", required = tru } } + /** + * This method deletes a specific project. + * + * @param projectId id of the project to delete + * @return Empty Response. + */ + @DELETE + @Path("/{projectId}") + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "This method deletes a specific project.") + @ApiResponses(value = { + @ApiResponse(code = HttpURLConnection.HTTP_NO_CONTENT, message = "Successfully deleted"), + @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), + @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), + @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") + }) + public Response deleteRequirement(@PathParam("projectId") int projectId) { + DALFacade dalFacade = null; + try { + Agent agent = Context.getCurrent().getMainAgent(); + String userId = agent.getIdentifier(); + String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); + if (registrarErrors != null) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); + } + dalFacade = bazaarService.getDBConnection(); + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + + Project projectToDelete = dalFacade.getProjectById(projectId, internalUserId); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Delete_PROJECT, projectId, dalFacade); + if (!authorized && !projectToDelete.isOwner(internalUserId)) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.project.delete")); + } + dalFacade.deleteProjectById(projectId, internalUserId); + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.DELETE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_28, + projectId, Activity.DataType.PROJECT, internalUserId); + return Response.noContent().build(); + } catch (BazaarException bex) { + if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { + return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { + return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else { + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Delete project " + projectId); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } + } catch (Exception ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Delete project " + projectId); + logger.warning(bex.getMessage()); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } finally { + bazaarService.closeDBConnection(dalFacade); + } + } + /** * This method add the current user to the followers list of a given project. * diff --git a/reqbaz/src/main/resources/migrations/V10__delete_project.sql b/reqbaz/src/main/resources/migrations/V10__delete_project.sql new file mode 100644 index 00000000..d721dc7e --- /dev/null +++ b/reqbaz/src/main/resources/migrations/V10__delete_project.sql @@ -0,0 +1,7 @@ +REPLACE INTO reqbaz.privilege + (id, name) +VALUES (37, 'Delete_PROJECT'); + +INSERT INTO reqbaz.role_privilege_map +(role_id, privilege_id) +VALUES (3, 37); diff --git a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index a1f563b0..554bbc42 100644 --- a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -77,6 +77,9 @@ public void testCreateProject() { assertTrue(userContext.has("userRole")); assertTrue(userContext.has("isFollower")); + result = client.sendRequest("DELETE", mainPath + "projects/" + response.get("id").getAsString(), ""); + assertEquals(204, result.getHttpCode()); + } catch (Exception e) { e.printStackTrace(); Assert.fail(e.toString()); From bf5183c9205eccdbb7e17cc88898a6fd0bd2e1bc Mon Sep 17 00:00:00 2001 From: Thore Date: Fri, 30 Apr 2021 23:39:13 +0200 Subject: [PATCH 088/134] Allow updates of comments (closes #97) --- .../acis/bazaar/service/dal/DALFacade.java | 8 +++ .../bazaar/service/dal/DALFacadeImpl.java | 7 ++ .../service/resources/CommentsResource.java | 63 +++++++++++++++++ .../dbis/acis/bazaar/service/BazaarTest.java | 8 +-- .../bazaar/service/dal/DALFacadeTest.java | 68 +++++++++---------- .../bazaar/service/helpers/SetupData.java | 14 ++++ 6 files changed, 128 insertions(+), 40 deletions(-) diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java index 4ec1b25b..ec23536b 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java @@ -507,6 +507,14 @@ public interface DALFacade { */ Comment createComment(Comment comment) throws Exception; + /** + * Updates a comment + * @param comment comment to persist + * @return the updated comment + * @throws Exception + */ + Comment updateComment(Comment comment) throws Exception; + /** * @param commentId to identify the comment to be deleted */ diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index 392360c4..7e4e2434 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -526,6 +526,13 @@ public Comment createComment(Comment comment) throws Exception { return commentRepository.findById(newComment.getId()); } + @Override + public Comment updateComment(Comment comment) throws Exception { + commentRepository = (commentRepository != null) ? commentRepository : new CommentRepositoryImpl(dslContext); + commentRepository.update(comment); + return commentRepository.findById(comment.getId()); + } + @Override public Comment deleteCommentById(int commentId) throws Exception { commentRepository = (commentRepository != null) ? commentRepository : new CommentRepositoryImpl(dslContext); diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java index 9d2455dd..d1c3e1c5 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java @@ -375,6 +375,69 @@ public Response createComment(@ApiParam(value = "Comment entity", required = tru } } + /** + * This method updates a specific comment. + * + * @return Response with the updated comment as a JSON object. + */ + @PUT + @Path("/") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "This method modifies a specific comment.") + @ApiResponses(value = { + @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns the updated comment", response = Comment.class), + @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), + @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), + @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") + }) + public Response deleteComment(@ApiParam(value = "Comment entity", required = true) Comment commentToUpdate) { + DALFacade dalFacade = null; + try { + Agent agent = Context.getCurrent().getMainAgent(); + String userId = agent.getIdentifier(); + String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); + if (registrarErrors != null) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); + } + dalFacade = bazaarService.getDBConnection(); + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + + Comment internalComment = dalFacade.getCommentById(commentToUpdate.getId()); + Requirement requirement = dalFacade.getRequirementById(internalComment.getRequirementId(), internalUserId); + + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_COMMENT, requirement.getProjectId(), dalFacade); + if (!authorized && !internalComment.isOwner(internalUserId)) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.comment.modify")); + } + + internalComment.setMessage(commentToUpdate.getMessage()); + + Comment updatedComment = dalFacade.updateComment(internalComment); + + bazaarService.getNotificationDispatcher().dispatchNotification(internalComment.getCreationDate(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_48, + internalComment.getId(), Activity.DataType.COMMENT, internalUserId); + return Response.ok(updatedComment.toJSON()).build(); + } catch (BazaarException bex) { + if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { + return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { + return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else { + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Delete comment " + commentToUpdate.getId()); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } + } catch (Exception ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Delete comment " + commentToUpdate.getId()); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } finally { + bazaarService.closeDBConnection(dalFacade); + } + } + /** * This method deletes a specific comment. * diff --git a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index 554bbc42..0daf2b95 100644 --- a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -205,9 +205,9 @@ public void testRequirements() { JsonElement resp = JsonParser.parseString(result.getResponse()); System.out.println(resp); assertTrue(resp.isJsonArray()); - assertEquals(1, resp.getAsJsonArray().size()); + assertEquals(2, resp.getAsJsonArray().size()); - JsonObject createdRequirement = resp.getAsJsonArray().get(0).getAsJsonObject(); + JsonObject createdRequirement = resp.getAsJsonArray().get(1).getAsJsonObject(); assertTrue(createdRequirement.has("lastActivity")); assertTrue(isValidISO8601(createdRequirement.get("creationDate").toString().replace("\"", ""))); @@ -221,9 +221,9 @@ public void testRequirements() { resp = JsonParser.parseString(result.getResponse()); System.out.println(resp); assertTrue(resp.isJsonArray()); - assertEquals(1, resp.getAsJsonArray().size()); + assertEquals(2, resp.getAsJsonArray().size()); - createdRequirement = resp.getAsJsonArray().get(0).getAsJsonObject(); + createdRequirement = resp.getAsJsonArray().get(1).getAsJsonObject(); assertTrue(createdRequirement.has("lastActivity")); assertTrue(isValidISO8601(createdRequirement.get("creationDate").toString().replace("\"", ""))); diff --git a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java index ea6bd5e6..96fe6677 100644 --- a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java +++ b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java @@ -183,6 +183,38 @@ public void testCreateCategory() throws Exception { }); } + @Test + public void testComments() throws Exception { + Comment testComment = Comment.builder() + .message("TestComment") + .requirementId(testRequirement.getId()) + .creator(initUser) + .build(); + + Comment createdComment = facade.createComment(testComment); + + List comments = facade.listCommentsByRequirementId(testRequirement.getId(), ALL_IN_ONE_PAGE).getElements(); + + assertNotNull(comments); + assertEquals(1,comments.size()); + assertEquals(createdComment.getId(), comments.get(0).getId()); + + createdComment.setMessage("Updated message"); + + Comment updatedComment = facade.updateComment(createdComment); + + assertNotNull(updatedComment); + assertEquals("Updated message", updatedComment.getMessage()); + + facade.deleteCommentById(updatedComment.getId()); + + comments = facade.listCommentsByRequirementId(testRequirement.getId(), ALL_IN_ONE_PAGE).getElements(); + assertNotNull(comments); + assertEquals(0,comments.size()); + + + } + /* Doesn't work, searching breaks public void testModifyProject() throws Exception { //TODO @@ -319,42 +351,6 @@ public void testDeleteComponentById() throws Exception { //TODO } - public void testListCommentsByRequirementId() throws Exception { - List comments = facade.listCommentsByRequirementId(2, ALL_IN_ONE_PAGE).getElements(); - - assertNotNull(comments); - assertEquals(2,comments.size()); - assertTrue(comments.get(0).getId() == 1 || comments.get(0).getId() == 2); - assertTrue(comments.get(1).getId() == 1 || comments.get(1).getId() == 2); - } - - public void testCreateComment() throws Exception { - int createdCommentId = 9; - Comment testComment = Comment.getBuilder("TestComment").id(createdCommentId).creator(initUser).requirementId(1).build(); - - facade.createComment(testComment); - - List comments = facade.listCommentsByRequirementId(1, ALL_IN_ONE_PAGE).getElements(); - - assertNotNull(comments); - assertEquals(1,comments.size()); - assertEquals(createdCommentId,comments.get(0).getId()); - - jooq.delete(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Comment.COMMENT).where(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Comment.COMMENT.ID.equal(createdCommentId)).execute(); - } - - public void testDeleteCommentById() throws Exception { - Comment testComment = Comment.getBuilder("TestComment").id(9).creator(initUser).requirementId(1).build(); - - facade.createComment(testComment); - - facade.deleteCommentById(9); - - List comments = facade.listCommentsByRequirementId(1, ALL_IN_ONE_PAGE).getElements(); - assertNotNull(comments); - assertEquals(0, comments.size()); - } - public void testVoteAndUnvote() throws Exception { boolean hasUserVotedForRequirement = facade.hasUserVotedForRequirement(3, 1); diff --git a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java index 2c909f68..7b817b0d 100644 --- a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java +++ b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java @@ -2,7 +2,9 @@ import de.rwth.dbis.acis.bazaar.service.dal.DALFacade; import de.rwth.dbis.acis.bazaar.service.dal.DALFacadeImpl; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Category; import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Requirement; import de.rwth.dbis.acis.bazaar.service.dal.entities.User; import de.rwth.dbis.acis.bazaar.service.internalization.Localization; import org.apache.commons.dbcp2.BasicDataSource; @@ -12,6 +14,7 @@ import org.junit.Before; import javax.sql.DataSource; +import java.util.List; import java.util.Locale; import java.util.ResourceBundle; @@ -21,6 +24,7 @@ public abstract class SetupData { public DSLContext jooq; public User initUser; public Project testProject; + public Requirement testRequirement; // las2peer id of eve (defined in the testing components of las2peer) public String eveId = "799dea0f00e126dc3493f362bddbddbc55bdfbb918fce3b12f68e1340a8ea7de7aaaa8a7af900b6ee7f849a524b18649d4ae80cb406959568f405a487f085ac7"; @@ -67,9 +71,19 @@ public void setUp() throws Exception { } try { testProject = facade.getProjectById(0, initUser.getId()); + testRequirement = facade.getRequirementById(0, initUser.getId()); } catch (Exception e) { testProject = Project.builder().name("ProjectTest").description("ProjDesc").leader(initUser).visibility(true).build(); testProject = facade.createProject(testProject, initUser.getId()); + + testRequirement = Requirement.builder() + .name("Test") + .description("Test") + .categories(List.of(testProject.getDefaultCategoryId())) + .projectId(testProject.getId()) + .creator(initUser) + .build(); + testRequirement = facade.createRequirement(testRequirement, initUser.getId()); } } From 86f720a2c4723a16cdeba2dbfdddfbd3ac0e8537 Mon Sep 17 00:00:00 2001 From: Thore Date: Fri, 30 Apr 2021 23:52:12 +0200 Subject: [PATCH 089/134] Update changelog --- CHANGELOG.md | 2 ++ .../dbis/acis/bazaar/service/resources/ProjectsResource.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d934c7ae..89c6ac2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas permissions, votes, contribution) [#94](https://github.com/rwth-acis/RequirementsBazaar/pull/94). - If a user is a member of a project the respective role is now returned in the`usertRole` attribute of the new `userContext` attribute [#94](https://github.com/rwth-acis/RequirementsBazaar/pull/94) [#96](https://github.com/rwth-acis/RequirementsBazaar/pull/96). +- Add a delete projects endpoint [#100](https://github.com/rwth-acis/RequirementsBazaar/pull/100). +- Add an update comment endpoint [#100](https://github.com/rwth-acis/RequirementsBazaar/pull/100). ### Changed diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java index 8533826d..be246bbd 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java @@ -358,7 +358,7 @@ public Response updateProject(@ApiParam(value = "Project entity", required = tru @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") }) - public Response deleteRequirement(@PathParam("projectId") int projectId) { + public Response deleteProject(@PathParam("projectId") int projectId) { DALFacade dalFacade = null; try { Agent agent = Context.getCurrent().getMainAgent(); From 0c0c9d6565a1c1271f24be90986d78bf28d1f214 Mon Sep 17 00:00:00 2001 From: Thore Date: Tue, 4 May 2021 14:51:02 +0200 Subject: [PATCH 090/134] Fix natural sorting by magic sql function --- .../dal/transform/CategoryTransformer.java | 12 +-- .../dal/transform/ProjectTransformer.java | 10 +- .../dal/transform/RequirementTransformer.java | 99 ++++++------------- .../migrations/V11__natural_sort_function.sql | 84 ++++++++++++++++ 4 files changed, 126 insertions(+), 79 deletions(-) create mode 100644 reqbaz/src/main/resources/migrations/V11__natural_sort_function.sql diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java index fbc9b4f7..49456da7 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java @@ -30,8 +30,9 @@ import java.time.LocalDateTime; import java.util.*; -import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.CATEGORY; -import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.CATEGORY_FOLLOWER_MAP; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Routines.udfNaturalsortformat; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; +import static org.jooq.impl.DSL.val; /** * @since 6/9/2014 @@ -105,12 +106,11 @@ public Collection> getSortFields(List case "name": switch (sort.getSortDirection()) { case DESC: - sortFields.add(CATEGORY.NAME.length().desc()); - sortFields.add(CATEGORY.NAME.desc()); + // 50 is derived from the name max length + sortFields.add(udfNaturalsortformat(CATEGORY.NAME, val(50), val(".")).desc()); break; default: - sortFields.add(CATEGORY.NAME.length().asc()); - sortFields.add(CATEGORY.NAME.asc()); + sortFields.add(udfNaturalsortformat(CATEGORY.NAME, val(50), val(".")).asc()); break; } break; diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java index b4922524..6f044b3d 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java @@ -30,7 +30,9 @@ import java.time.LocalDateTime; import java.util.*; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Routines.udfNaturalsortformat; import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; +import static org.jooq.impl.DSL.val; public class ProjectTransformer implements Transformer { @@ -109,11 +111,11 @@ public Collection> getSortFields(List switch (sort.getField()) { case "name": if (sort.getSortDirection() == Pageable.SortDirection.DESC) { - sortFields.add(PROJECT.NAME.length().desc()); - sortFields.add(PROJECT.NAME.desc()); + // 50 is derived from the max length of the project name + sortFields.add(udfNaturalsortformat(PROJECT.NAME, val(50), val(".")).desc()); } else { - sortFields.add(PROJECT.NAME.length().asc()); - sortFields.add(PROJECT.NAME.asc()); + sortFields.add(udfNaturalsortformat(PROJECT.NAME, val(50), val(".")).asc()); + } break; case "date": diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java index 854f2fe5..7d705a5f 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java @@ -30,7 +30,9 @@ import java.time.LocalDateTime; import java.util.*; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Routines.udfNaturalsortformat; import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; +import static org.jooq.impl.DSL.val; public class RequirementTransformer implements Transformer { @Override @@ -100,93 +102,52 @@ public Collection> getSortFields(List for (Pageable.SortField sort : sorts) { switch (sort.getField()) { case "last_activity": - switch (sort.getSortDirection()) { - case ASC: - sortFields.add(RequirementRepositoryImpl.LAST_ACTIVITY.field("last_activity").asc()); - break; - case DESC: - sortFields.add(RequirementRepositoryImpl.LAST_ACTIVITY.field("last_activity").desc()); - break; - default: - sortFields.add(RequirementRepositoryImpl.LAST_ACTIVITY.field("last_activity").desc()); - break; + if (sort.getSortDirection() == Pageable.SortDirection.ASC) { + sortFields.add(RequirementRepositoryImpl.LAST_ACTIVITY.field("last_activity").asc()); + } else { + sortFields.add(RequirementRepositoryImpl.LAST_ACTIVITY.field("last_activity").desc()); } break; case "date": - switch (sort.getSortDirection()) { - case ASC: - sortFields.add(REQUIREMENT.CREATION_DATE.asc()); - break; - case DESC: - sortFields.add(REQUIREMENT.CREATION_DATE.desc()); - break; - default: - sortFields.add(REQUIREMENT.CREATION_DATE.desc()); - break; + if (sort.getSortDirection() == Pageable.SortDirection.ASC) { + sortFields.add(REQUIREMENT.CREATION_DATE.asc()); + } else { + sortFields.add(REQUIREMENT.CREATION_DATE.desc()); } break; case "name": - switch (sort.getSortDirection()) { - case DESC: - sortFields.add(REQUIREMENT.NAME.length().desc()); - sortFields.add(REQUIREMENT.NAME.desc()); - break; - default: - sortFields.add(REQUIREMENT.NAME.length().asc()); - sortFields.add(REQUIREMENT.NAME.asc()); - break; + if (sort.getSortDirection() == Pageable.SortDirection.DESC) { + sortFields.add(udfNaturalsortformat(REQUIREMENT.NAME, val(50), val(".")).desc()); + } else { + sortFields.add(udfNaturalsortformat(REQUIREMENT.NAME, val(50), val(".")).asc()); } break; case "vote": - switch (sort.getSortDirection()) { - case ASC: - sortFields.add(RequirementRepositoryImpl.VOTE_COUNT.asc()); - break; - case DESC: - sortFields.add(RequirementRepositoryImpl.VOTE_COUNT.desc()); - break; - default: - sortFields.add(RequirementRepositoryImpl.VOTE_COUNT.desc()); - break; + if (sort.getSortDirection() == Pageable.SortDirection.ASC) { + sortFields.add(RequirementRepositoryImpl.VOTE_COUNT.asc()); + } else { + sortFields.add(RequirementRepositoryImpl.VOTE_COUNT.desc()); } break; case "comment": - switch (sort.getSortDirection()) { - case ASC: - sortFields.add(RequirementRepositoryImpl.COMMENT_COUNT.asc()); - break; - case DESC: - sortFields.add(RequirementRepositoryImpl.COMMENT_COUNT.desc()); - break; - default: - sortFields.add(RequirementRepositoryImpl.COMMENT_COUNT.desc()); - break; + if (sort.getSortDirection() == Pageable.SortDirection.ASC) { + sortFields.add(RequirementRepositoryImpl.COMMENT_COUNT.asc()); + } else { + sortFields.add(RequirementRepositoryImpl.COMMENT_COUNT.desc()); } break; case "follower": - switch (sort.getSortDirection()) { - case ASC: - sortFields.add(RequirementRepositoryImpl.FOLLOWER_COUNT.asc()); - break; - case DESC: - sortFields.add(RequirementRepositoryImpl.FOLLOWER_COUNT.desc()); - break; - default: - sortFields.add(RequirementRepositoryImpl.FOLLOWER_COUNT.desc()); - break; + if (sort.getSortDirection() == Pageable.SortDirection.ASC) { + sortFields.add(RequirementRepositoryImpl.FOLLOWER_COUNT.asc()); + } else { + sortFields.add(RequirementRepositoryImpl.FOLLOWER_COUNT.desc()); } break; case "realized": - switch (sort.getSortDirection()) { - case ASC: - sortFields.add(REQUIREMENT.REALIZED.asc()); - break; - case DESC: - sortFields.add(REQUIREMENT.REALIZED.desc()); - break; - default: - sortFields.add(REQUIREMENT.REALIZED.desc()); - break; + if (sort.getSortDirection() == Pageable.SortDirection.ASC) { + sortFields.add(REQUIREMENT.REALIZED.asc()); + } else { + sortFields.add(REQUIREMENT.REALIZED.desc()); } break; } diff --git a/reqbaz/src/main/resources/migrations/V11__natural_sort_function.sql b/reqbaz/src/main/resources/migrations/V11__natural_sort_function.sql new file mode 100644 index 00000000..23d9d94e --- /dev/null +++ b/reqbaz/src/main/resources/migrations/V11__natural_sort_function.sql @@ -0,0 +1,84 @@ +-- From https://stackoverflow.com/a/12257917/4375998 +-- DROP FUNCTION IF EXISTS `udf_FirstNumberPos`; +DELIMITER $$ +CREATE FUNCTION `udf_FirstNumberPos` (`instring` varchar(4000)) + RETURNS int + LANGUAGE SQL + DETERMINISTIC + NO SQL + SQL SECURITY INVOKER +BEGIN +DECLARE position int; +DECLARE tmp_position int; +SET position = 5000; +SET tmp_position = LOCATE('0', instring); IF (tmp_position > 0 AND tmp_position < position) THEN SET position = tmp_position; END IF; +SET tmp_position = LOCATE('1', instring); IF (tmp_position > 0 AND tmp_position < position) THEN SET position = tmp_position; END IF; +SET tmp_position = LOCATE('2', instring); IF (tmp_position > 0 AND tmp_position < position) THEN SET position = tmp_position; END IF; +SET tmp_position = LOCATE('3', instring); IF (tmp_position > 0 AND tmp_position < position) THEN SET position = tmp_position; END IF; +SET tmp_position = LOCATE('4', instring); IF (tmp_position > 0 AND tmp_position < position) THEN SET position = tmp_position; END IF; +SET tmp_position = LOCATE('5', instring); IF (tmp_position > 0 AND tmp_position < position) THEN SET position = tmp_position; END IF; +SET tmp_position = LOCATE('6', instring); IF (tmp_position > 0 AND tmp_position < position) THEN SET position = tmp_position; END IF; +SET tmp_position = LOCATE('7', instring); IF (tmp_position > 0 AND tmp_position < position) THEN SET position = tmp_position; END IF; +SET tmp_position = LOCATE('8', instring); IF (tmp_position > 0 AND tmp_position < position) THEN SET position = tmp_position; END IF; +SET tmp_position = LOCATE('9', instring); IF (tmp_position > 0 AND tmp_position < position) THEN SET position = tmp_position; END IF; + +IF (position = 5000) THEN RETURN 0; END IF; +RETURN position; +END +$$ + +-- DROP FUNCTION IF EXISTS `udf_NaturalSortFormat`; +DELIMITER $$ +CREATE FUNCTION `udf_NaturalSortFormat` (`instring` varchar(4000), `numberLength` int, `sameOrderChars` char(50)) + RETURNS varchar(4000) + LANGUAGE SQL + DETERMINISTIC + NO SQL + SQL SECURITY INVOKER +BEGIN +DECLARE sortString varchar(4000); +DECLARE numStartIndex int; +DECLARE numEndIndex int; +DECLARE padLength int; +DECLARE totalPadLength int; +DECLARE i int; +DECLARE sameOrderCharsLen int; + +SET totalPadLength = 0; +SET instring = TRIM(instring); +SET sortString = instring; +SET numStartIndex = udf_FirstNumberPos(instring); +SET numEndIndex = 0; +SET i = 1; +SET sameOrderCharsLen = CHAR_LENGTH(sameOrderChars); + +WHILE (i <= sameOrderCharsLen) DO +SET sortString = REPLACE(sortString, SUBSTRING(sameOrderChars, i, 1), ' '); +SET i = i + 1; +END WHILE; + +WHILE (numStartIndex <> 0) DO +SET numStartIndex = numStartIndex + numEndIndex; +SET numEndIndex = numStartIndex; + +WHILE (udf_FirstNumberPos(SUBSTRING(instring, numEndIndex, 1)) = 1) DO +SET numEndIndex = numEndIndex + 1; +END WHILE; + +SET numEndIndex = numEndIndex - 1; + +SET padLength = numberLength - (numEndIndex + 1 - numStartIndex); + +IF padLength < 0 THEN +SET padLength = 0; +END IF; + +SET sortString = INSERT(sortString, numStartIndex + totalPadLength, 0, REPEAT('0', padLength)); + +SET totalPadLength = totalPadLength + padLength; +SET numStartIndex = udf_FirstNumberPos(RIGHT(instring, CHAR_LENGTH(instring) - numEndIndex)); +END WHILE; + +RETURN sortString; +END +$$ From 6eba09bba8e54ceb6c8e71bd3a10c3df4780cca8 Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 8 May 2021 15:58:44 +0200 Subject: [PATCH 091/134] Fix boolean type handling in jooq --- reqbaz/build.gradle | 4 +++ .../dal/repositories/RoleRepositoryImpl.java | 6 ++-- .../dal/repositories/UserRepositoryImpl.java | 28 +++++++++---------- .../dal/repositories/VoteRepositoryImpl.java | 2 +- .../dal/transform/ProjectTransformer.java | 4 +-- .../dal/transform/UserTransformer.java | 18 ++++++------ .../dal/transform/VoteTransformer.java | 4 +-- 7 files changed, 34 insertions(+), 32 deletions(-) diff --git a/reqbaz/build.gradle b/reqbaz/build.gradle index f47fc59f..4a31eb21 100644 --- a/reqbaz/build.gradle +++ b/reqbaz/build.gradle @@ -162,6 +162,10 @@ jooq { name = 'org.jooq.meta.mysql.MySQLDatabase' inputSchema = "${project.property('db.name')}" forcedTypes { + forcedType { + name = 'BOOLEAN' + includeTypes = '(?i:TINYINT\\(1\\))' + } } } generate { diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java index 2a08173c..b758b31b 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java @@ -132,9 +132,9 @@ public PaginationResult listProjectMembers(int projectId, Pageabl .las2peerId(entry.getValue(userTable.LAS2PEER_ID)) .userName(entry.getValue(userTable.USER_NAME)) .profileImage(entry.getValue(userTable.PROFILE_IMAGE)) - .emailLeadSubscription(entry.getValue(userTable.EMAIL_LEAD_SUBSCRIPTION) != 0) - .emailFollowSubscription(entry.getValue(userTable.EMAIL_FOLLOW_SUBSCRIPTION) != 0) - .personalizationEnabled(entry.getValue(userTable.PERSONALIZATION_ENABLED) != 0) + .emailLeadSubscription(entry.getValue(userTable.EMAIL_LEAD_SUBSCRIPTION)) + .emailFollowSubscription(entry.getValue(userTable.EMAIL_FOLLOW_SUBSCRIPTION)) + .personalizationEnabled(entry.getValue(userTable.PERSONALIZATION_ENABLED)) .build(); ProjectMember member = ProjectMember.builder() .id(entry.getValue(USER_ROLE_MAP.ID)) diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java index d1c32a2c..67a88403 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java @@ -34,10 +34,8 @@ import de.rwth.dbis.acis.bazaar.service.exception.ExceptionLocation; import i5.las2peer.api.security.AgentLockedException; import i5.las2peer.security.PassphraseAgentImpl; -import org.jooq.DSLContext; -import org.jooq.Field; +import org.jooq.*; import org.jooq.Record; -import org.jooq.Result; import java.time.LocalDateTime; import java.util.ArrayList; @@ -520,13 +518,13 @@ public List getEmailReceiverForProject(int projectId) throws BazaarExcepti .from(USER .join(PROJECT).on(USER.ID.eq(PROJECT.LEADER_ID))) .where(PROJECT.ID.eq(projectId)) - .and(USER.EMAIL_LEAD_SUBSCRIPTION.eq(ONE)) + .and(USER.EMAIL_LEAD_SUBSCRIPTION.isTrue()) .union(jooq.selectDistinct(USER.fields()) .from(USER .join(PROJECT_FOLLOWER_MAP).on(USER.ID.eq(PROJECT_FOLLOWER_MAP.USER_ID))) .where(PROJECT_FOLLOWER_MAP.PROJECT_ID.eq(projectId)) - .and(USER.EMAIL_FOLLOW_SUBSCRIPTION.eq(ONE))) + .and(USER.EMAIL_FOLLOW_SUBSCRIPTION.isTrue())) .fetch(); for (Record queryResult : queryResults) { @@ -550,20 +548,20 @@ public List getEmailReceiverForCategory(int categoryId) throws BazaarExcep .from(USER .join(CATEGORY).on(USER.ID.eq(CATEGORY.LEADER_ID))) .where(CATEGORY.ID.eq(categoryId)) - .and(USER.EMAIL_LEAD_SUBSCRIPTION.eq(ONE)) + .and(USER.EMAIL_LEAD_SUBSCRIPTION.isTrue()) .union(jooq.selectDistinct(USER.fields()) .from(USER .join(CATEGORY_FOLLOWER_MAP).on(USER.ID.eq(CATEGORY_FOLLOWER_MAP.USER_ID))) .where(CATEGORY_FOLLOWER_MAP.CATEGORY_ID.eq(categoryId)) - .and(USER.EMAIL_FOLLOW_SUBSCRIPTION.eq(ONE))) + .and(USER.EMAIL_FOLLOW_SUBSCRIPTION.isTrue())) .union(jooq.selectDistinct(USER.fields()) .from(USER .join(PROJECT).on(USER.ID.eq(PROJECT.LEADER_ID)) .join(CATEGORY).on(CATEGORY.PROJECT_ID.eq(PROJECT.ID))) .where(CATEGORY.ID.eq(categoryId)) - .and(USER.EMAIL_LEAD_SUBSCRIPTION.eq(ONE))) + .and(USER.EMAIL_LEAD_SUBSCRIPTION.isTrue())) .union(jooq.selectDistinct(USER.fields()) .from(USER @@ -571,7 +569,7 @@ public List getEmailReceiverForCategory(int categoryId) throws BazaarExcep .join(CATEGORY).on(CATEGORY.PROJECT_ID.eq(PROJECT_FOLLOWER_MAP.PROJECT_ID))) .where(CATEGORY.ID.eq(categoryId)) .and(PROJECT_FOLLOWER_MAP.PROJECT_ID.eq(CATEGORY.PROJECT_ID)) - .and(USER.EMAIL_FOLLOW_SUBSCRIPTION.eq(ONE))) + .and(USER.EMAIL_FOLLOW_SUBSCRIPTION.isTrue())) .fetch(); @@ -597,14 +595,14 @@ public List getEmailReceiverForRequirement(int requirementId) throws Bazaa .from(USER .join(REQUIREMENT).on(REQUIREMENT.LEAD_DEVELOPER_ID.eq(USER.ID))) .where(REQUIREMENT.ID.eq(requirementId)) - .and(USER.EMAIL_LEAD_SUBSCRIPTION.eq(ONE)) + .and(USER.EMAIL_LEAD_SUBSCRIPTION.isTrue()) // req follower .union(jooq.selectDistinct(USER.fields()) .from(USER .join(REQUIREMENT_FOLLOWER_MAP).on(USER.ID.eq(REQUIREMENT_FOLLOWER_MAP.USER_ID))) .where(REQUIREMENT_FOLLOWER_MAP.REQUIREMENT_ID.eq(requirementId)) - .and(USER.EMAIL_FOLLOW_SUBSCRIPTION.eq(ONE))) + .and(USER.EMAIL_FOLLOW_SUBSCRIPTION.isTrue())) // category leader .union(jooq.selectDistinct(USER.fields()) @@ -612,7 +610,7 @@ public List getEmailReceiverForRequirement(int requirementId) throws Bazaa .join(CATEGORY).on(USER.ID.eq(CATEGORY.LEADER_ID)) .join(REQUIREMENT_CATEGORY_MAP).on(REQUIREMENT_CATEGORY_MAP.CATEGORY_ID.eq(CATEGORY.ID))) .where(REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID.eq(requirementId)) - .and(USER.EMAIL_LEAD_SUBSCRIPTION.eq(ONE))) + .and(USER.EMAIL_LEAD_SUBSCRIPTION.isTrue())) // category follower .union(jooq.selectDistinct(USER.fields()) @@ -621,7 +619,7 @@ public List getEmailReceiverForRequirement(int requirementId) throws Bazaa .join(REQUIREMENT_CATEGORY_MAP).on(REQUIREMENT_CATEGORY_MAP.CATEGORY_ID.eq(CATEGORY_FOLLOWER_MAP.CATEGORY_ID)) .join(REQUIREMENT).on(REQUIREMENT.ID.eq(REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID))) .where(REQUIREMENT.ID.eq(requirementId)) - .and(USER.EMAIL_FOLLOW_SUBSCRIPTION.eq(ONE))) + .and(USER.EMAIL_FOLLOW_SUBSCRIPTION.isTrue())) // project leader .union(jooq.selectDistinct(USER.fields()) @@ -629,7 +627,7 @@ public List getEmailReceiverForRequirement(int requirementId) throws Bazaa .join(PROJECT).on(USER.ID.eq(PROJECT.LEADER_ID)) .join(REQUIREMENT).on(REQUIREMENT.PROJECT_ID.eq(PROJECT.ID))) .where(REQUIREMENT.ID.eq(requirementId)) - .and(USER.EMAIL_LEAD_SUBSCRIPTION.eq(ONE))) + .and(USER.EMAIL_LEAD_SUBSCRIPTION.isTrue())) // project follower .union(jooq.selectDistinct(USER.fields()) @@ -638,7 +636,7 @@ public List getEmailReceiverForRequirement(int requirementId) throws Bazaa .join(REQUIREMENT).on(REQUIREMENT.PROJECT_ID.eq(PROJECT_FOLLOWER_MAP.PROJECT_ID))) .where(REQUIREMENT.ID.eq(requirementId)) .and(PROJECT_FOLLOWER_MAP.PROJECT_ID.eq(REQUIREMENT.PROJECT_ID)) - .and(USER.EMAIL_FOLLOW_SUBSCRIPTION.eq(ONE))) + .and(USER.EMAIL_FOLLOW_SUBSCRIPTION.isTrue())) .fetch(); diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java index 4dd8bb29..46dd9852 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/VoteRepositoryImpl.java @@ -80,7 +80,7 @@ public CreationStatus addOrUpdate(Vote vote) throws BazaarException { .fetchOne(); if (record != null) { - if (record.getIsUpvote() != (byte) (vote.isUpvote() ? 1 : 0)) { + if (record.getIsUpvote()) { UpdateSetFirstStep update = jooq.update(transformer.getTable()); Map map = transformer.getUpdateMap(vote); UpdateSetMoreStep moreStep = null; diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java index 6f044b3d..de40bb29 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java @@ -42,7 +42,7 @@ public ProjectRecord createRecord(Project entry) { record.setDescription(entry.getDescription()); record.setName(entry.getName()); record.setLeaderId(entry.getLeader().getId()); - record.setVisibility((byte) (entry.getVisibility() ? 1 : 0)); + record.setVisibility(entry.getVisibility()); record.setDefaultCategoryId(entry.getDefaultCategoryId()); record.setCreationDate(LocalDateTime.now()); return record; @@ -55,7 +55,7 @@ public Project getEntityFromTableRecord(ProjectRecord record) { .description(record.getDescription()) .id(record.getId()) .defaultCategoryId(record.getDefaultCategoryId()) - .visibility(record.getVisibility() == 1) + .visibility(record.getVisibility()) .creationDate(record.getCreationDate()) .lastUpdatedDate(record.getLastUpdatedDate()) .build(); diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java index 8a838115..af9d17b1 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java @@ -41,9 +41,9 @@ public UserRecord createRecord(User entity) { record.setLastName(entity.getLastName()); record.setUserName(entity.getUserName()); record.setProfileImage(entity.getProfileImage()); - record.setEmailLeadSubscription((byte) (entity.isEmailLeadSubscription() ? 1 : 0)); - record.setEmailFollowSubscription((byte) (entity.isEmailFollowSubscription() ? 1 : 0)); - record.setPersonalizationEnabled((byte) (entity.isPersonalizationEnabled() ? 1:0)); + record.setEmailLeadSubscription(entity.isEmailLeadSubscription()); + record.setEmailFollowSubscription(entity.isEmailFollowSubscription()); + record.setPersonalizationEnabled(entity.isPersonalizationEnabled()); record.setCreationDate(LocalDateTime.now()); return record; @@ -59,12 +59,12 @@ public User getEntityFromTableRecord(UserRecord record) { .las2peerId(record.getLas2peerId()) .profileImage(record.getProfileImage()) .userName(record.getUserName()) - .emailLeadSubscription(record.getEmailLeadSubscription() != 0) - .emailFollowSubscription(record.getEmailFollowSubscription() != 0) + .emailLeadSubscription(record.getEmailLeadSubscription()) + .emailFollowSubscription(record.getEmailFollowSubscription()) .creationDate(record.getCreationDate()) .lastUpdatedDate(record.getLastUpdatedDate()) .lastLoginDate(record.getLastLoginDate()) - .personalizationEnabled(record.getPersonalizationEnabled() != 0) + .personalizationEnabled(record.getPersonalizationEnabled()) .build(); } @@ -77,9 +77,9 @@ public User getEntityFromQueryResult(de.rwth.dbis.acis.bazaar.dal.jooq.tables.Us .las2peerId(queryResult.getValues(user.LAS2PEER_ID).get(0)) .userName(queryResult.getValues(user.USER_NAME).get(0)) .profileImage(queryResult.getValues(user.PROFILE_IMAGE).get(0)) - .emailLeadSubscription(queryResult.getValues(user.EMAIL_LEAD_SUBSCRIPTION).get(0) != 0) - .emailFollowSubscription(queryResult.getValues(user.EMAIL_FOLLOW_SUBSCRIPTION).get(0) != 0) - .personalizationEnabled(queryResult.getValues(user.PERSONALIZATION_ENABLED).get(0) != 0) + .emailLeadSubscription(queryResult.getValues(user.EMAIL_LEAD_SUBSCRIPTION).get(0)) + .emailFollowSubscription(queryResult.getValues(user.EMAIL_FOLLOW_SUBSCRIPTION).get(0)) + .personalizationEnabled(queryResult.getValues(user.PERSONALIZATION_ENABLED).get(0)) .build(); } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java index fbc41a51..877ed457 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/VoteTransformer.java @@ -38,7 +38,7 @@ public VoteRecord createRecord(Vote entity) { VoteRecord record = new VoteRecord(); record.setUserId(entity.getUserId()); record.setRequirementId(entity.getRequirementId()); - record.setIsUpvote((byte) (entity.isUpvote() ? 1 : 0)); + record.setIsUpvote(entity.isUpvote()); return record; } @@ -48,7 +48,7 @@ public Vote getEntityFromTableRecord(VoteRecord record) { .id(record.getId()) .userId(record.getUserId()) .requirementId(record.getRequirementId()) - .isUpvote(record.getIsUpvote() != 0) + .isUpvote(record.getIsUpvote()) .build(); } From 6ae3847995a401d1653e95ec5f84471584e919b8 Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 8 May 2021 15:59:21 +0200 Subject: [PATCH 092/134] Don't delete comments when they have responses --- .../bazaar/service/dal/DALFacadeImpl.java | 8 ++++++- .../bazaar/service/dal/entities/Comment.java | 3 +++ .../dal/repositories/CommentRepository.java | 2 ++ .../repositories/CommentRepositoryImpl.java | 15 +++++++++++++ .../dal/transform/CommentTransformer.java | 3 +++ .../service/resources/CommentsResource.java | 4 +++- .../migrations/V12__comment_delete.sql | 11 ++++++++++ .../bazaar/service/dal/DALFacadeTest.java | 22 +++++++++++++++++++ 8 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 reqbaz/src/main/resources/migrations/V12__comment_delete.sql diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index 7e4e2434..13d9f826 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -537,7 +537,13 @@ public Comment updateComment(Comment comment) throws Exception { public Comment deleteCommentById(int commentId) throws Exception { commentRepository = (commentRepository != null) ? commentRepository : new CommentRepositoryImpl(dslContext); Comment comment = commentRepository.findById(commentId); - commentRepository.delete(commentId); + if (commentRepository.hasAnswers(commentId)) { + comment.setDeleted(true); + comment.setMessage("[This message has been deleted]"); + commentRepository.update(comment); + } else{ + commentRepository.delete(commentId); + } return comment; } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java index ed31a1a8..089d321f 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java @@ -63,6 +63,9 @@ public class Comment extends EntityBase implements Ownable { @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") private LocalDateTime lastUpdatedDate; + @lombok.Builder.Default + private Boolean deleted = false; + @JsonProperty("_context") private EntityContext context; diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java index d018c617..7d3f88b2 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java @@ -34,4 +34,6 @@ public interface CommentRepository extends Repository { PaginationResult findAllAnswers(Pageable pageable, int userId) throws BazaarException; boolean belongsToPublicProject(int id) throws BazaarException; + + boolean hasAnswers(int id) throws BazaarException; } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java index 82335b8d..6f4e6746 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java @@ -266,4 +266,19 @@ public boolean belongsToPublicProject(int id) throws BazaarException { } return false; } + + public boolean hasAnswers(int id) throws BazaarException { + try { + Integer answerCount = jooq.selectCount() + .from(COMMENT) + .where(COMMENT.REPLY_TO_COMMENT_ID.eq(id)) + .fetchOne(0, int.class); + + return answerCount > 0; + + } catch (DataAccessException e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } + return false; + } } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java index b1a9ff91..7112033f 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java @@ -43,6 +43,7 @@ public CommentRecord createRecord(Comment entity) { record.setRequirementId(entity.getRequirementId()); record.setReplyToCommentId(entity.getReplyToComment()); record.setCreationDate(LocalDateTime.now()); + record.setDeleted(entity.getDeleted()); return record; } @@ -55,6 +56,7 @@ public Comment getEntityFromTableRecord(CommentRecord record) { .replyToComment(record.getReplyToCommentId()) .creationDate(record.getCreationDate()) .lastUpdatedDate(record.getLastUpdatedDate()) + .deleted(record.getDeleted()) .build(); } @@ -78,6 +80,7 @@ public Map getUpdateMap(final Comment entity) { HashMap updateMap = new HashMap() {{ put(COMMENT.REQUIREMENT_ID, entity.getRequirementId()); put(COMMENT.MESSAGE, entity.getMessage()); + put(COMMENT.DELETED, entity.getDeleted()); }}; if (!updateMap.isEmpty()) { updateMap.put(COMMENT.LAST_UPDATED_DATE, LocalDateTime.now()); diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java index d1c3e1c5..f8d6979e 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java @@ -391,7 +391,7 @@ public Response createComment(@ApiParam(value = "Comment entity", required = tru @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") }) - public Response deleteComment(@ApiParam(value = "Comment entity", required = true) Comment commentToUpdate) { + public Response updateComment(@ApiParam(value = "Comment entity", required = true) Comment commentToUpdate) { DALFacade dalFacade = null; try { Agent agent = Context.getCurrent().getMainAgent(); @@ -464,10 +464,12 @@ public Response deleteComment(@PathParam("commentId") int commentId) { if (registrarErrors != null) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); } + dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Comment commentToDelete = dalFacade.getCommentById(commentId); Requirement requirement = dalFacade.getRequirementById(commentToDelete.getRequirementId(), internalUserId); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_COMMENT, requirement.getProjectId(), dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.comment.modify")); diff --git a/reqbaz/src/main/resources/migrations/V12__comment_delete.sql b/reqbaz/src/main/resources/migrations/V12__comment_delete.sql new file mode 100644 index 00000000..6d1a16e1 --- /dev/null +++ b/reqbaz/src/main/resources/migrations/V12__comment_delete.sql @@ -0,0 +1,11 @@ + +SET FOREIGN_KEY_CHECKS = 0; +ALTER TABLE reqbaz.comment + DROP FOREIGN KEY `reply_comment`; + +ALTER TABLE reqbaz.comment + ADD deleted BOOLEAN NOT NULL DEFAULT FALSE, + ADD CONSTRAINT reply_comment FOREIGN KEY reply_comment (reply_to_comment_id) REFERENCES comment (id) + ON DELETE CASCADE; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java index 96fe6677..85a4ebea 100644 --- a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java +++ b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java @@ -212,7 +212,29 @@ public void testComments() throws Exception { assertNotNull(comments); assertEquals(0,comments.size()); + testComment = Comment.builder() + .message("TestComment") + .requirementId(testRequirement.getId()) + .creator(initUser) + .build(); + + createdComment = facade.createComment(testComment); + + Comment responseComment = Comment.builder() + .message("TestResponse") + .requirementId(testRequirement.getId()) + .replyToComment(createdComment.getId()) + .creator(initUser) + .build(); + + responseComment = facade.createComment(responseComment); + + facade.deleteCommentById(createdComment.getId()); + + Comment deletedComment = facade.getCommentById(createdComment.getId()); + assertNotNull(deletedComment); + assertTrue(deletedComment.getDeleted()); } /* Doesn't work, searching breaks From aa873ecb31aaaa36426920b61b22a5e1bbc2aecf Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 8 May 2021 18:37:36 +0200 Subject: [PATCH 093/134] Return 404 when requesting non existant projects --- .../acis/bazaar/service/dal/helpers/PageInfo.java | 1 + .../bazaar/service/resources/ProjectsResource.java | 13 ++++++++++--- .../main/resources/i18n/Translation_de.properties | 1 + .../main/resources/i18n/Translation_en.properties | 1 + 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java index 334b5f5b..ee33c88c 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java @@ -31,6 +31,7 @@ * @since 6/15/2014 */ public class PageInfo implements Pageable { + @Min(-1) private final int pageNumber; @Min(0) diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java index be246bbd..453c1db7 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java @@ -182,11 +182,19 @@ public Response getProject(@PathParam("projectId") int projectId) { if (registrarErrors != null) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); } + Agent agent = Context.getCurrent().getMainAgent(); String userId = agent.getIdentifier(); dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); - if (dalFacade.isProjectPublic(projectId)) { + + Project projectToReturn = dalFacade.getProjectById(projectId, internalUserId); + + if (projectToReturn == null) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.NOT_FOUND, String.format(Localization.getInstance().getResourceBundle().getString("error.resource.notfound"), "project")); + } + + if (projectToReturn.getVisibility()) { boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_PROJECT, projectId, dalFacade); if (!authorized) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.anonymous")); @@ -194,10 +202,9 @@ public Response getProject(@PathParam("projectId") int projectId) { } else { boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PROJECT, projectId, dalFacade); if (!authorized) { - ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.category.read")); + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.project.read")); } } - Project projectToReturn = dalFacade.getProjectById(projectId, internalUserId); bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_4, projectId, Activity.DataType.PROJECT, internalUserId); return Response.ok(projectToReturn.toJSON()).build(); diff --git a/reqbaz/src/main/resources/i18n/Translation_de.properties b/reqbaz/src/main/resources/i18n/Translation_de.properties index e2288b8b..2f18fb70 100644 --- a/reqbaz/src/main/resources/i18n/Translation_de.properties +++ b/reqbaz/src/main/resources/i18n/Translation_de.properties @@ -47,6 +47,7 @@ error.unknown_exception=%s Fehler in %s\: %s Fehlercode\: %d category.uncategorized.Name=Generelle Anforderungen category.uncategorized.Description=Anforderungen welche zu keiner Projektkategorie gehörten. error.validation=Fehler bei der Validierung von %s festgestellt. Ihre Eingabe von %s erzeugt den Fehler\: %s. +error.authorization.project.read=Sie haben nicht das Recht dieses Projekt zu lesen. error.authorization.project.modify=Sie haben nicht das Recht dieses Projekt zu ändern. error.authorization.requirement.modify=Nur der Ersteller einer Anforderung kann eine Anforderung verändern. error.authorization.feedback.read=Nur Projektadmins können Feedback einsehen. diff --git a/reqbaz/src/main/resources/i18n/Translation_en.properties b/reqbaz/src/main/resources/i18n/Translation_en.properties index 19546ca1..e80b6e58 100644 --- a/reqbaz/src/main/resources/i18n/Translation_en.properties +++ b/reqbaz/src/main/resources/i18n/Translation_en.properties @@ -48,6 +48,7 @@ error.unknown_exception=%s Error in %s\: %s ExceptionCode\: %d. category.uncategorized.Name=General Requirements category.uncategorized.Description=Requirements which do not belong to any category. error.validation=On %s constraint violation has been detected, because you sent %s and the problem is\: %s. +error.authorization.project.read=You do not have rights to read this project. error.authorization.project.modify=You do not have rights to modify this project. error.authorization.requirement.modify=Only the creator can modify requirements. error.resource.notfound=$s not found. From d0f2e77188f98839fbb57900df8ecd3e7882d6e6 Mon Sep 17 00:00:00 2001 From: Thore Date: Wed, 12 May 2021 19:05:40 +0200 Subject: [PATCH 094/134] Remove comment pagination --- .../acis/bazaar/service/BazaarService.java | 4 ++++ .../acis/bazaar/service/dal/DALFacade.java | 3 +-- .../bazaar/service/dal/DALFacadeImpl.java | 4 ++-- .../dal/repositories/CommentRepository.java | 4 +++- .../repositories/CommentRepositoryImpl.java | 13 +++--------- .../service/resources/CommentsResource.java | 21 +++---------------- .../resources/RequirementsResource.java | 8 ++----- .../bazaar/service/dal/DALFacadeTest.java | 4 ++-- 8 files changed, 20 insertions(+), 41 deletions(-) diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java index 6fe6f973..b56fdbef 100755 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java @@ -409,6 +409,10 @@ public void closeDBConnection(DALFacade dalFacade) { dalFacade.close(); } + public ObjectMapper getMapper() { + return mapper; + } + public Response.ResponseBuilder paginationLinks(Response.ResponseBuilder responseBuilder, PaginationResult paginationResult, String path, Map> httpParameter) throws URISyntaxException { List links = new ArrayList<>(); diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java index ec23536b..5cd7b81e 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java @@ -478,10 +478,9 @@ public interface DALFacade { /** * @param requirementId the identifier of the requirement we are looking in - * @param pageable pagination information * @return the comments for a given requirement */ - PaginationResult listCommentsByRequirementId(int requirementId, Pageable pageable) throws BazaarException; + List listCommentsByRequirementId(int requirementId) throws BazaarException; /** * @param pageable pagination information diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index 13d9f826..6aba7867 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -496,9 +496,9 @@ public Attachment deleteAttachmentById(int attachmentId) throws Exception { } @Override - public PaginationResult listCommentsByRequirementId(int requirementId, Pageable pageable) throws BazaarException { + public List listCommentsByRequirementId(int requirementId) throws BazaarException { commentRepository = (commentRepository != null) ? commentRepository : new CommentRepositoryImpl(dslContext); - return commentRepository.findAllByRequirementId(requirementId, pageable); + return commentRepository.findAllByRequirementId(requirementId); } @Override diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java index 7d3f88b2..089742a7 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepository.java @@ -25,11 +25,13 @@ import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; +import java.util.List; + /** * @since 6/22/2014 */ public interface CommentRepository extends Repository { - PaginationResult findAllByRequirementId(int requirementId, Pageable pageable) throws BazaarException; + List findAllByRequirementId(int requirementId) throws BazaarException; PaginationResult findAllComments(Pageable pageable) throws BazaarException; PaginationResult findAllAnswers(Pageable pageable, int userId) throws BazaarException; diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java index 6f4e6746..2e983e45 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java @@ -164,11 +164,9 @@ public PaginationResult findAllComments(Pageable pageable) throws Bazaa @Override - public PaginationResult findAllByRequirementId(int requirementId, Pageable pageable) throws BazaarException { - PaginationResult result = null; - List comments; + public List findAllByRequirementId(int requirementId) throws BazaarException { + List comments = new ArrayList<>(); try { - comments = new ArrayList<>(); de.rwth.dbis.acis.bazaar.dal.jooq.tables.User creatorUser = USER.as("creatorUser"); de.rwth.dbis.acis.bazaar.dal.jooq.tables.Comment childComment = COMMENT.as("childComment"); User childCommentCreatorUser = USER.as("childCommentCreatorUser"); @@ -185,9 +183,6 @@ public PaginationResult f .leftJoin(childCommentCreatorUser).on(childCommentCreatorUser.ID.equal(childComment.USER_ID)) .join(creatorUser).on(creatorUser.ID.equal(COMMENT.USER_ID)) .where(COMMENT.REQUIREMENT_ID.equal(requirementId).and(COMMENT.REPLY_TO_COMMENT_ID.isNull())) - .orderBy(transformer.getSortFields(pageable.getSorts())) - .limit(pageable.getPageSize()) - .offset(pageable.getOffset()) .fetch(); Comment entry = null; @@ -202,13 +197,11 @@ public PaginationResult f comments.add(childEntry); } } - int total = queryResults.isEmpty() ? 0 : ((Integer) queryResults.get(0).get("idCount")); - result = new PaginationResult<>(total, pageable, comments); } catch (DataAccessException e) { ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); } - return result; + return comments; } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java index f8d6979e..03520a24 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java @@ -178,11 +178,9 @@ public Response getAllComments( * This method returns the list of comments for a specific requirement. * * @param requirementId id of the requirement - * @param page page number - * @param perPage number of projects by page * @return Response with comments as a JSON array. */ - public Response getCommentsForRequirement(int requirementId, int page, int perPage) { + public Response getCommentsForRequirement(int requirementId) { DALFacade dalFacade = null; try { Agent agent = Context.getCurrent().getMainAgent(); @@ -191,10 +189,6 @@ public Response getCommentsForRequirement(int requirementId, int page, int perPa if (registrarErrors != null) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); } - PageInfo pageInfo = new PageInfo(page, perPage); - // Take Object for generic error handling - Set> violations = bazaarService.validate(pageInfo); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); dalFacade = bazaarService.getDBConnection(); //Todo use requirement's projectId for security context, not the one sent from client @@ -212,21 +206,12 @@ public Response getCommentsForRequirement(int requirementId, int page, int perPa ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.comment.read")); } } - PaginationResult commentsResult = dalFacade.listCommentsByRequirementId(requirementId, pageInfo); + List commentsResult = dalFacade.listCommentsByRequirementId(requirementId); bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_43, requirementId, Activity.DataType.REQUIREMENT, internalUserId); - Map> parameter = new HashMap<>(); - parameter.put("page", new ArrayList() {{ - add(String.valueOf(page)); - }}); - parameter.put("per_page", new ArrayList() {{ - add(String.valueOf(perPage)); - }}); Response.ResponseBuilder responseBuilder = Response.ok(); - responseBuilder = responseBuilder.entity(commentsResult.toJSON()); - responseBuilder = bazaarService.paginationLinks(responseBuilder, commentsResult, "requirements/" + String.valueOf(requirementId) + "/comments", parameter); - responseBuilder = bazaarService.xHeaderFields(responseBuilder, commentsResult); + responseBuilder = responseBuilder.entity(bazaarService.getMapper().writeValueAsString(commentsResult)); return responseBuilder.build(); } catch (BazaarException bex) { diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java index 714f027f..4dd52a20 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java @@ -1464,8 +1464,6 @@ public Response getFollowersForRequirement(@PathParam("requirementId") int requi * This method returns the list of comments for a specific requirement. * * @param requirementId id of the requirement - * @param page page number - * @param perPage number of projects by page * @return Response with comments as a JSON array. */ @GET @@ -1478,11 +1476,9 @@ public Response getFollowersForRequirement(@PathParam("requirementId") int requi @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") }) - public Response getCommentsForRequirement(@PathParam("requirementId") int requirementId, - @ApiParam(value = "Page number", required = false) @DefaultValue("0") @QueryParam("page") int page, - @ApiParam(value = "Elements of comments by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage) throws Exception { + public Response getCommentsForRequirement(@PathParam("requirementId") int requirementId) throws Exception { CommentsResource commentsResource = new CommentsResource(); - return commentsResource.getCommentsForRequirement(requirementId, page, perPage); + return commentsResource.getCommentsForRequirement(requirementId); } /** diff --git a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java index 85a4ebea..0c053333 100644 --- a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java +++ b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeTest.java @@ -193,7 +193,7 @@ public void testComments() throws Exception { Comment createdComment = facade.createComment(testComment); - List comments = facade.listCommentsByRequirementId(testRequirement.getId(), ALL_IN_ONE_PAGE).getElements(); + List comments = facade.listCommentsByRequirementId(testRequirement.getId()); assertNotNull(comments); assertEquals(1,comments.size()); @@ -208,7 +208,7 @@ public void testComments() throws Exception { facade.deleteCommentById(updatedComment.getId()); - comments = facade.listCommentsByRequirementId(testRequirement.getId(), ALL_IN_ONE_PAGE).getElements(); + comments = facade.listCommentsByRequirementId(testRequirement.getId()); assertNotNull(comments); assertEquals(0,comments.size()); From 7384a6b597bfe48db006250b20f712d2a8c26f4d Mon Sep 17 00:00:00 2001 From: Thore Date: Thu, 13 May 2021 17:30:16 +0200 Subject: [PATCH 095/134] Add implementation for a user dashboard --- .../acis/bazaar/service/dal/DALFacade.java | 42 ++++++++- .../bazaar/service/dal/DALFacadeImpl.java | 30 ++++++- .../service/dal/entities/Dashboard.java | 34 ++++++++ .../bazaar/service/dal/helpers/PageInfo.java | 22 +++-- .../dal/repositories/CategoryRepository.java | 2 + .../repositories/CategoryRepositoryImpl.java | 26 ++++++ .../dal/repositories/ProjectRepository.java | 3 +- .../repositories/ProjectRepositoryImpl.java | 35 +++++++- .../repositories/RequirementRepository.java | 3 +- .../RequirementRepositoryImpl.java | 38 +++++++- .../service/resources/UsersResource.java | 87 +++++++++++++++---- .../dbis/acis/bazaar/service/BazaarTest.java | 41 +++++++++ 12 files changed, 329 insertions(+), 34 deletions(-) create mode 100644 reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Dashboard.java diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java index 5cd7b81e..9fde65a8 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java @@ -186,8 +186,9 @@ public interface DALFacade { /** * Deletes a given project + * * @param projectId id of the project to delete - * @param userId id of the user + * @param userId id of the user */ Project deleteProjectById(int projectId, Integer userId) throws Exception; @@ -226,6 +227,16 @@ public interface DALFacade { * @throws BazaarException */ void removeUserFromProject(int userId, Integer context) throws BazaarException; + + /** + * Returns the count most recent active projects followed by the user + * + * @param userId id of the follower + * @param count how many should be returned + * @return Followed projects ordered by last activity + */ + List getFollowedProjects(int userId, int count) throws BazaarException; + //endregion //region ProjectFollower @@ -364,6 +375,15 @@ public interface DALFacade { boolean isRequirementPublic(int requirementId) throws BazaarException; Statistic getStatisticsForRequirement(int userId, int requirementId, Calendar timestamp) throws BazaarException; + + /** + * Returns the count most recent active requirements followed by the user + * + * @param userId id of the follower + * @param count how many should be returned + * @return Followed requirements ordered by last activity + */ + List getFollowedRequirements(int userId, int count) throws BazaarException; //endregion //region Category @@ -417,6 +437,15 @@ public interface DALFacade { boolean isCategoryPublic(int categoryId) throws BazaarException; Statistic getStatisticsForCategory(int userId, int categoryId, Calendar timestamp) throws BazaarException; + + /** + * Returns the count most recent active categories followed by the user + * + * @param userId id of the follower + * @param count how many should be returned + * @return Followed categories ordered by last activity + */ + List getFollowedCategories(int userId, int count) throws BazaarException; //endregion //region CategoryFollower @@ -508,6 +537,7 @@ public interface DALFacade { /** * Updates a comment + * * @param comment comment to persist * @return the updated comment * @throws Exception @@ -681,4 +711,14 @@ public interface DALFacade { Feedback getFeedbackById(int feedbackId) throws Exception; // endregion feedback + + /** + * Aggregates the data for the dashboard + * + * @param userId Id of the user for their individual dashboard + * @param count Number of items per group + * @return + * @throws BazaarException + */ + Dashboard getDashboardData(int userId, int count) throws BazaarException; } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index 6aba7867..a561a6b4 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -271,6 +271,13 @@ public PaginationResult listFollowersForProject(int projectId, Pageable pa return userRepository.findAllByFollowing(projectId, 0, 0, pageable); } + @Override + public List getFollowedProjects(int userId, int count) throws BazaarException { + projectRepository = (projectRepository != null) ? projectRepository : new ProjectRepositoryImpl(dslContext); + return projectRepository.getFollowedProjects(userId, count); + } + + @Override public List listRequirements(Pageable pageable) throws BazaarException { requirementRepository = (requirementRepository != null) ? requirementRepository : new RequirementRepositoryImpl(dslContext); @@ -395,6 +402,12 @@ public Statistic getStatisticsForRequirement(int userId, int requirementId, Cale return requirementRepository.getStatisticsForRequirement(userId, requirementId, timestamp.toLocalDateTime()); } + @Override + public List getFollowedRequirements(int userId, int count) throws BazaarException { + requirementRepository = (requirementRepository != null) ? requirementRepository : new RequirementRepositoryImpl(dslContext); + return requirementRepository.getFollowedRequirements(userId, count); + } + @Override public PaginationResult listCategoriesByProjectId(int projectId, Pageable pageable, int userId) throws BazaarException { categoryRepository = (categoryRepository != null) ? categoryRepository : new CategoryRepositoryImpl(dslContext); @@ -462,6 +475,12 @@ public Statistic getStatisticsForCategory(int userId, int categoryId, Calendar s return categoryRepository.getStatisticsForCategory(userId, categoryId, timestamp.toLocalDateTime()); } + @Override + public List getFollowedCategories(int userId, int count) throws BazaarException { + categoryRepository = (categoryRepository != null) ? categoryRepository : new CategoryRepositoryImpl(dslContext); + return categoryRepository.getFollowedCategories(userId, count); + } + @Override public PaginationResult listFollowersForCategory(int categoryId, Pageable pageable) throws BazaarException { userRepository = (userRepository != null) ? userRepository : new UserRepositoryImpl(dslContext); @@ -541,7 +560,7 @@ public Comment deleteCommentById(int commentId) throws Exception { comment.setDeleted(true); comment.setMessage("[This message has been deleted]"); commentRepository.update(comment); - } else{ + } else { commentRepository.delete(commentId); } return comment; @@ -742,6 +761,15 @@ public Feedback getFeedbackById(int feedbackId) throws Exception { return feedbackRepository.findById(feedbackId); } + @Override + public Dashboard getDashboardData(int userId, int count) throws BazaarException { + return Dashboard.builder() + .projects(getFollowedProjects(userId, count)) + .categories(getFollowedCategories(userId, count)) + .requirements(getFollowedRequirements(userId, count)) + .build(); + } + @Override public PaginationResult getProjectMembers(int projectId, Pageable pageable) throws BazaarException { roleRepository = (roleRepository != null) ? roleRepository : new RoleRepositoryImpl(dslContext); diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Dashboard.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Dashboard.java new file mode 100644 index 00000000..40ba5361 --- /dev/null +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Dashboard.java @@ -0,0 +1,34 @@ +package de.rwth.dbis.acis.bazaar.service.dal.entities; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.UserVote; +import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; + +import javax.validation.constraints.NotNull; +import java.util.List; + +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") +public class Dashboard extends EntityBase { + + @NotNull + private List projects; + + @NotNull + private List categories; + + @NotNull + private List requirements; + + @JsonIgnore + @Override + public int getId() { + return 0; + } +} diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java index ee33c88c..5b90855d 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java @@ -40,7 +40,7 @@ public class PageInfo implements Pageable { private final List sorts; private final String search; private final List ids; - private final List embed; + private final List embed; public PageInfo(int pageNumber, int pageSize) { this(pageNumber, pageSize, new HashMap<>(), new ArrayList<>(), null, null); @@ -50,15 +50,21 @@ public PageInfo(int pageNumber, int pageSize) { public PageInfo(int pageNumber, int pageSize, Map filters) { this(pageNumber, pageSize, filters, new ArrayList<>(), null); } - public PageInfo(int pageNumber, int pageSize, Map filters, List sorts, String search){ - this(pageNumber, pageSize, filters, sorts, search,null); + + public PageInfo(int pageNumber, int pageSize, Map filters, List sorts) { + this(pageNumber, pageSize, filters, sorts, null); } - public PageInfo(int pageNumber, int pageSize, Map filters, List sorts, String search, List ids){ - this(pageNumber, pageSize, filters, sorts, search,ids, null); + + public PageInfo(int pageNumber, int pageSize, Map filters, List sorts, String search) { + this(pageNumber, pageSize, filters, sorts, search, null); } + public PageInfo(int pageNumber, int pageSize, Map filters, List sorts, String search, List ids) { + this(pageNumber, pageSize, filters, sorts, search, ids, null); + } - public PageInfo(int pageNumber, int pageSize, Map filters, List sorts, String search, List ids, List embed) { + + public PageInfo(int pageNumber, int pageSize, Map filters, List sorts, String search, List ids, List embed) { this.pageNumber = pageNumber; this.pageSize = pageSize; this.filters = filters; @@ -104,5 +110,7 @@ public List getEmbed() { } @Override - public String getSearch() {return search;} + public String getSearch() { + return search; + } } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java index 6d2605f6..e30d0bd5 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java @@ -47,4 +47,6 @@ public interface CategoryRepository extends Repository { boolean belongsToPublicProject(int id) throws BazaarException; Statistic getStatisticsForCategory(int userId, int categoryId, LocalDateTime timestamp) throws BazaarException; + + List getFollowedCategories(int userId, int count) throws BazaarException; } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java index 544fdc37..03a9039c 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java @@ -354,4 +354,30 @@ public Statistic getStatisticsForCategory(int userId, int categoryId, LocalDateT } return result; } + + @Override + public List getFollowedCategories(int userId, int count) throws BazaarException { + List categories = null; + try { + List categoryIds; + categoryIds = jooq.select() + .from(CATEGORY_FOLLOWER_MAP) + .where(CATEGORY_FOLLOWER_MAP.USER_ID.eq(userId)) + .fetch(CATEGORY_FOLLOWER_MAP.CATEGORY_ID); + + Condition filterCondition = transformer.getTableId().in(categoryIds); + + Pageable.SortField sortField = new Pageable.SortField("last_activity", "DESC"); + List sortList = new ArrayList<>(); + sortList.add(sortField); + + PageInfo filterPage = new PageInfo(0, count, new HashMap<>(), sortList); + + categories = getFilteredCategories(filterCondition, filterPage, userId).left; + + } catch (Exception e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } + return categories; + } } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java index 0bbda5a4..a6656d31 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java @@ -48,6 +48,5 @@ public interface ProjectRepository extends Repository { List listAllProjectIds(Pageable pageable, int userId) throws BazaarException; - - + List getFollowedProjects(int userId, int count) throws BazaarException; } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java index 6d49b141..952adc3d 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java @@ -254,11 +254,11 @@ public List listAllProjectIds(Pageable pageable, int userId) throws Baz projectIds = jooq.select() .from(PROJECT) .where(transformer.getFilterConditions(pageable.getFilters())) - .and(PROJECT.VISIBILITY.isTrue().or(PROJECT.LEADER_ID.equal(userId)) + .and(PROJECT.VISIBILITY.isTrue().or(PROJECT.LEADER_ID.equal(userId)) .and(transformer.getSearchCondition(pageable.getSearch()))) .orderBy(transformer.getSortFields(pageable.getSorts())) - // .limit(pageable.getPageSize()) - // .offset(pageable.getOffset()) + // .limit(pageable.getPageSize()) + // .offset(pageable.getOffset()) .fetch(PROJECT.ID); } catch (Exception e) { @@ -267,6 +267,32 @@ public List listAllProjectIds(Pageable pageable, int userId) throws Baz return projectIds; } + @Override + public List getFollowedProjects(int userId, int count) throws BazaarException { + List projects = null; + try { + List projectIds; + projectIds = jooq.select() + .from(PROJECT_FOLLOWER_MAP) + .where(PROJECT_FOLLOWER_MAP.USER_ID.eq(userId)) + .fetch(PROJECT_FOLLOWER_MAP.PROJECT_ID); + + Condition filterCondition = transformer.getTableId().in(projectIds); + + Pageable.SortField sortField = new Pageable.SortField("last_activity", "DESC"); + List sortList = new ArrayList<>(); + sortList.add(sortField); + + PageInfo filterPage = new PageInfo(0, count, new HashMap<>(), sortList); + + projects = getFilteredProjects(filterCondition, filterPage, userId).left; + + } catch (Exception e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } + return projects; + } + @Override public boolean belongsToPublicProject(int id) throws BazaarException { @@ -342,7 +368,8 @@ public Statistic getStatisticsForVisibleProjects(int userId, LocalDateTime times } @Override - public Statistic getStatisticsForProject(int userId, int projectId, LocalDateTime timestamp) throws BazaarException { + public Statistic getStatisticsForProject(int userId, int projectId, LocalDateTime timestamp) throws + BazaarException { Statistic result = null; try { // If you want to change something here, please know what you are doing! Its SQL and even worse JOOQ :-| diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java index b4932938..1f8f4968 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java @@ -42,6 +42,7 @@ public interface RequirementRepository extends Repository { boolean belongsToPublicProject(int id) throws BazaarException; Requirement findById(int id, int userId) throws Exception; + Requirement findById(int id, int userId, List embed) throws Exception; void setRealized(int id, LocalDateTime realized) throws BazaarException; @@ -50,5 +51,5 @@ public interface RequirementRepository extends Repository { Statistic getStatisticsForRequirement(int userId, int requirementId, LocalDateTime timestamp) throws BazaarException; - + List getFollowedRequirements(int userId, int count) throws BazaarException; } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java index bc133715..bf375d18 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java @@ -22,7 +22,10 @@ import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementCategoryMapRecord; import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementRecord; -import de.rwth.dbis.acis.bazaar.service.dal.entities.*; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Attachment; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Requirement; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Statistic; +import de.rwth.dbis.acis.bazaar.service.dal.entities.UserContext; import de.rwth.dbis.acis.bazaar.service.dal.helpers.*; import de.rwth.dbis.acis.bazaar.service.dal.transform.RequirementTransformer; import de.rwth.dbis.acis.bazaar.service.dal.transform.UserTransformer; @@ -233,7 +236,7 @@ private ImmutablePair, Integer> getFilteredRequirements(Collec } if (requirement.getNumberOfAttachments() > 0) { - AttachmentRepository attachmentRepository = new AttachmentRepositoryImpl(this.jooq); + AttachmentRepository attachmentRepository = new AttachmentRepositoryImpl(jooq); List attachmentList = attachmentRepository.findAllByRequirementId(requirement.getId(), new PageInfo(0, 1000, new HashMap<>())).getElements(); requirement.setAttachments(attachmentList); } @@ -314,8 +317,9 @@ public PaginationResult findAllByProject(int projectId, Pageable pa private UserVote transformToUserVoted(Integer userVotedInt) { UserVote userVoted; - if (userVotedInt == null) + if (userVotedInt == null) { return UserVote.NO_VOTE; + } switch (userVotedInt) { case 0: userVoted = UserVote.DOWN_VOTE; @@ -360,10 +364,12 @@ public boolean belongsToPublicProject(int id) throws BazaarException { } return false; } + @Override public Requirement findById(int id, int userId) throws Exception { return findById(id, userId, null); } + @Override public Requirement findById(int id, int userId, List embed) throws Exception { Requirement requirement = null; @@ -467,4 +473,30 @@ public Statistic getStatisticsForRequirement(int userId, int requirementId, Loca } return result; } + + @Override + public List getFollowedRequirements(int userId, int count) throws BazaarException { + List requirements = null; + try { + List requirementIds; + requirementIds = jooq.select() + .from(CATEGORY_FOLLOWER_MAP) + .where(CATEGORY_FOLLOWER_MAP.USER_ID.eq(userId)) + .fetch(CATEGORY_FOLLOWER_MAP.CATEGORY_ID); + + Condition filterCondition = transformer.getTableId().in(requirementIds); + + Pageable.SortField sortField = new Pageable.SortField("last_activity", "DESC"); + List sortList = new ArrayList<>(); + sortList.add(sortField); + + PageInfo filterPage = new PageInfo(0, count, new HashMap<>(), sortList); + + requirements = getFilteredRequirements(filterCondition, filterPage, userId).left; + + } catch (Exception e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } + return requirements; + } } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java index 2aa73908..cf01ab7a 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java @@ -3,10 +3,7 @@ import de.rwth.dbis.acis.bazaar.service.BazaarFunction; import de.rwth.dbis.acis.bazaar.service.BazaarService; import de.rwth.dbis.acis.bazaar.service.dal.DALFacade; -import de.rwth.dbis.acis.bazaar.service.dal.entities.Activity; -import de.rwth.dbis.acis.bazaar.service.dal.entities.EntityOverview; -import de.rwth.dbis.acis.bazaar.service.dal.entities.PrivilegeEnum; -import de.rwth.dbis.acis.bazaar.service.dal.entities.User; +import de.rwth.dbis.acis.bazaar.service.dal.entities.*; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; @@ -53,9 +50,8 @@ @Path("/users") public class UsersResource { - private BazaarService bazaarService; - private final L2pLogger logger = L2pLogger.getInstance(UsersResource.class.getName()); + private final BazaarService bazaarService; public UsersResource() throws Exception { bazaarService = (BazaarService) Context.getCurrent().getService(); @@ -98,7 +94,9 @@ public Response searchUser(@ApiParam(value = "Search filter", required = false) // Take Object for generic error handling Set> violations = bazaarService.validate(pageInfo); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } PaginationResult users = dalFacade.searchUsers(pageInfo); @@ -245,6 +243,62 @@ public Response getActiveUser() { } } + /** + * This method allows to retrieve the current users individual dashboard. + * + * @return Response with active user as a JSON object. + */ + @GET + @Path("/me/dashboard") + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "This method allows to retrieve the current users individual dashboard.") + @ApiResponses(value = { + @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns user dashboard data", response = Dashboard.class), + @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), + @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") + }) + public Response getUserDashboard() { + DALFacade dalFacade = null; + try { + Agent agent = Context.getCurrent().getMainAgent(); + String userId = agent.getIdentifier(); + String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); + if (registrarErrors != null) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); + } + dalFacade = bazaarService.getDBConnection(); + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_54, + internalUserId, Activity.DataType.USER, internalUserId); + + // Block anonymous user + if (internalUserId == 0) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.comment.read")); + } + + Dashboard data = dalFacade.getDashboardData(internalUserId, 10); + + return Response.ok(data.toJSON()).build(); + } catch (BazaarException bex) { + if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { + return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { + return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else { + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get active user"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } + } catch (Exception ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get active user"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } finally { + bazaarService.closeDBConnection(dalFacade); + } + } + /** * Allows to update a certain user. * @@ -275,7 +329,9 @@ public Response updateUser(@PathParam("userId") int userId, // Take Object for generic error handling Set> violations = bazaarService.validate(userToUpdate); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(agent.getIdentifier()); @@ -306,6 +362,7 @@ public Response updateUser(@PathParam("userId") int userId, bazaarService.closeDBConnection(dalFacade); } } + /** * This method returns an entityOverview for the logged in user * @@ -330,8 +387,8 @@ public Response getEntityOverview( @ApiParam(value = "Types of entities to include", required = true, allowMultiple = true, allowableValues = "projects,categories,requirements") @QueryParam("include") List include, @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date,last_activity,requirement,follower") @DefaultValue("date") @QueryParam("sort") List sort, @ApiParam(value = "SortDirection", allowableValues = "ASC,DESC") @QueryParam("sortDirection") String sortDirection, - @ApiParam(value = "Filter", required = false, allowMultiple = true, allowableValues = "created, following, developing") @DefaultValue("created") @QueryParam("filters") List filters){ - //Possibly allow filtertype "all"? + @ApiParam(value = "Filter", required = false, allowMultiple = true, allowableValues = "created, following, developing") @DefaultValue("created") @QueryParam("filters") List filters) { + //Possibly allow filtertype "all"? DALFacade dalFacade = null; try { String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); @@ -350,13 +407,13 @@ public Response getEntityOverview( Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); HashMap filterMap = new HashMap<>(); - for(String filterOption : filters) { - filterMap.put(filterOption,internalUserId.toString()); + for (String filterOption : filters) { + filterMap.put(filterOption, internalUserId.toString()); } PageInfo pageInfo = new PageInfo(0, 0, filterMap, sortList, search); - EntityOverview result = dalFacade.getEntitiesForUser(include, pageInfo, internalUserId); + EntityOverview result = dalFacade.getEntitiesForUser(include, pageInfo, internalUserId); // Wrong SERVICE_CUSTOM_MESSAGE_3 ? bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, 0, Activity.DataType.USER, internalUserId); @@ -368,12 +425,12 @@ public Response getEntityOverview( return responseBuilder.build(); } catch (BazaarException bex) { logger.warning(bex.getMessage()); - Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get entityOverview failed" ); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get entityOverview failed"); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } catch (Exception ex) { BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); logger.warning(bex.getMessage()); - Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get entityOverview failed" ); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get entityOverview failed"); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } finally { bazaarService.closeDBConnection(dalFacade); diff --git a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index 0daf2b95..4e260acf 100644 --- a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -51,6 +51,24 @@ public void testGetVersion() { } } + /** + * Test to get the statistics + */ + @Test + public void testStatistics() { + try { + MiniClient client = getClient(); + + ClientResponse result = client.sendRequest("GET", mainPath + "statistics", ""); + JsonObject response = JsonParser.parseString(result.getResponse()).getAsJsonObject(); + System.out.println(response.toString()); + assertTrue(response.isJsonObject()); + } catch (Exception e) { + e.printStackTrace(); + fail(e.toString()); + } + } + /** * Test to get a list of projects */ @@ -432,4 +450,27 @@ public void testUserJsonView() { fail(e.toString()); } } + + /** + * Test to get user dashboard + */ + @Test + public void testDashboard() { + try { + MiniClient client = getAdminClient(); + + ClientResponse result = client.sendRequest("GET", mainPath + "users/me/dashboard", ""); + System.out.println(result.toString()); + assertEquals(200, result.getHttpCode()); + + JsonObject response = JsonParser.parseString(result.getResponse()).getAsJsonObject(); + assertTrue(response.isJsonObject()); + assertTrue(response.has("projects")); + assertTrue(response.has("categories")); + assertTrue(response.has("requirements")); + } catch (Exception e) { + e.printStackTrace(); + fail(e.toString()); + } + } } From cea9ee3a6d21b09e4697d16e684691374b0b1105 Mon Sep 17 00:00:00 2001 From: Thore Date: Thu, 13 May 2021 19:07:34 +0200 Subject: [PATCH 096/134] Fix requirement query and authorization checks --- .../bazaar/service/dal/entities/User.java | 11 ++++++++--- .../RequirementRepositoryImpl.java | 6 +++--- .../service/exception/BazaarException.java | 13 ++++++++++--- .../service/resources/UsersResource.java | 19 ++++++++++++------- .../resources/i18n/Translation_de.properties | 1 + .../resources/i18n/Translation_en.properties | 2 +- 6 files changed, 35 insertions(+), 17 deletions(-) diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java index 01e12131..45b81361 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java @@ -60,6 +60,7 @@ public class User extends EntityBase { @NotNull(message = "las2peerId can't be null") @Size(min = 1, max = 1000, message = "las2peerId must have between 1 and 1000 characters") + @JsonView(SerializerViews.Private.class) private String las2peerId; private String profileImage; @@ -107,11 +108,15 @@ public Boolean isPersonalizationEnabled() { @Override public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof User)) return false; + if (o == this) { + return true; + } + if (!(o instanceof User)) { + return false; + } User other = (User) o; - return this.las2peerId.equals(other.las2peerId); + return las2peerId.equals(other.las2peerId); } @Override diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java index bf375d18..b49e20dd 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java @@ -480,9 +480,9 @@ public List getFollowedRequirements(int userId, int count) throws B try { List requirementIds; requirementIds = jooq.select() - .from(CATEGORY_FOLLOWER_MAP) - .where(CATEGORY_FOLLOWER_MAP.USER_ID.eq(userId)) - .fetch(CATEGORY_FOLLOWER_MAP.CATEGORY_ID); + .from(REQUIREMENT_FOLLOWER_MAP) + .where(REQUIREMENT_FOLLOWER_MAP.USER_ID.eq(userId)) + .fetch(REQUIREMENT_FOLLOWER_MAP.REQUIREMENT_ID); Condition filterCondition = transformer.getTableId().in(requirementIds); diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/BazaarException.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/BazaarException.java index aed39e4d..457ae3ca 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/BazaarException.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/exception/BazaarException.java @@ -20,6 +20,7 @@ package de.rwth.dbis.acis.bazaar.service.exception; +import com.fasterxml.jackson.annotation.JsonIgnore; import de.rwth.dbis.acis.bazaar.service.internalization.Localization; /** @@ -27,17 +28,16 @@ */ public class BazaarException extends Exception { + private final ExceptionLocation location; private String message; - private ErrorCode errorCode; - private final ExceptionLocation location; - protected BazaarException(ExceptionLocation location) { this.location = location; message = ""; } + @Override public String getMessage() { return message; } @@ -61,4 +61,11 @@ public int getExceptionCode() { public String getExceptionMessage() { return String.format(Localization.getInstance().getResourceBundle().getString("error.unknown_exception"), message, location.getMessage(), errorCode.getMessage(), getExceptionCode()); } + + @JsonIgnore + @Override + public StackTraceElement[] getStackTrace() { + return super.getStackTrace(); + } + } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java index cf01ab7a..0f116c87 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java @@ -216,6 +216,12 @@ public Response getActiveUser() { if (registrarErrors != null) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); } + + // Block anonymous user + if (userId.equals("anonymous")) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.user.read")); + } + dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); User user = dalFacade.getUserById(internalUserId); @@ -266,24 +272,23 @@ public Response getUserDashboard() { if (registrarErrors != null) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); } + + // Block anonymous user + if (userId.equals("anonymous")) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.user.read")); + } + dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_54, internalUserId, Activity.DataType.USER, internalUserId); - // Block anonymous user - if (internalUserId == 0) { - ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.comment.read")); - } - Dashboard data = dalFacade.getDashboardData(internalUserId, 10); return Response.ok(data.toJSON()).build(); } catch (BazaarException bex) { if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { - return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); } else { logger.warning(bex.getMessage()); Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get active user"); diff --git a/reqbaz/src/main/resources/i18n/Translation_de.properties b/reqbaz/src/main/resources/i18n/Translation_de.properties index 2f18fb70..48dcbb89 100644 --- a/reqbaz/src/main/resources/i18n/Translation_de.properties +++ b/reqbaz/src/main/resources/i18n/Translation_de.properties @@ -34,6 +34,7 @@ error.authorization.develop.create=Nur Projektmitglieder können sich als Entwic error.authorization.develop.delete=Nur Projektmitglieder können sich als Entwickler austragen. error.authorization.follow.create=Nur Projekmitglieder können ein Projekt folgen. error.authorization.follow.delete=Nur Projektmitglieder können ein Projekt nicht weiter folgen. +error.authorization.user.read=Nur authentifizierte Benutzer können diese Ressource einsehen. error.authorization.vote.create=Nur Projektmitglieder können abstimmen. error.authorization.vote.delete=Nur Projektmitglieder können ihre Abstimmung löschen. error.authorization.comment.read=Nur Projektmiglieder können Kommentare sehen. diff --git a/reqbaz/src/main/resources/i18n/Translation_en.properties b/reqbaz/src/main/resources/i18n/Translation_en.properties index e80b6e58..7bcdbdc7 100644 --- a/reqbaz/src/main/resources/i18n/Translation_en.properties +++ b/reqbaz/src/main/resources/i18n/Translation_en.properties @@ -34,6 +34,7 @@ error.authorization.develop.create=Only project members can register to develop error.authorization.develop.delete=Only project members can deregister from developing a requirement. error.authorization.follow.create=Only project members can register to follow a requirement. error.authorization.follow.delete=Only project members can deregister following a requirement. +error.authorization.user.read=Only logged in users can access this resource. error.authorization.vote.create=Only project members can vote. error.authorization.vote.delete=Only project members can delete vote. error.authorization.comment.read=Only project members can see comments. @@ -52,7 +53,6 @@ error.authorization.project.read=You do not have rights to read this project. error.authorization.project.modify=You do not have rights to modify this project. error.authorization.requirement.modify=Only the creator can modify requirements. error.resource.notfound=$s not found. - # email fields. english only at the moment. email.bodyText.greeting=Hello, email.bodyText.user=User From c6542035cbc28373b49c5e8a21fd088919113699 Mon Sep 17 00:00:00 2001 From: Thore Date: Thu, 13 May 2021 19:13:18 +0200 Subject: [PATCH 097/134] Update changelog --- CHANGELOG.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89c6ac2b..898ca704 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,9 +21,14 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas - Categories, projects and requirements now have a `userContext` encapsuling the dynamic user related information ( permissions, votes, contribution) [#94](https://github.com/rwth-acis/RequirementsBazaar/pull/94). - If a user is a member of a project the respective role is now returned in the`usertRole` attribute of the - new `userContext` attribute [#94](https://github.com/rwth-acis/RequirementsBazaar/pull/94) [#96](https://github.com/rwth-acis/RequirementsBazaar/pull/96). + new `userContext` + attribute [#94](https://github.com/rwth-acis/RequirementsBazaar/pull/94) [#96](https://github.com/rwth-acis/RequirementsBazaar/pull/96) + . - Add a delete projects endpoint [#100](https://github.com/rwth-acis/RequirementsBazaar/pull/100). - Add an update comment endpoint [#100](https://github.com/rwth-acis/RequirementsBazaar/pull/100). +- Redacted comments now have a deleted flag [#103](https://github.com/rwth-acis/RequirementsBazaar/pull/103). +- Added a user dashboard listing the last 10 most recent active followed projects, categories and + requirements [#106](https://github.com/rwth-acis/RequirementsBazaar/pull/106). ### Changed @@ -54,9 +59,14 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas - Requirements no longer return the category objects in the `categories` attribute but a list of category ids [#91](https://github.com/rwth-acis/RequirementsBazaar/pull/91). - Vote direction can no longer be provided as a query - parameter [#94](https://github.com/rwth-acis/RequirementsBazaar/pull/94) but instead as a direction object strictly defined by an enum [#96](https://github.com/rwth-acis/RequirementsBazaar/pull/96), + parameter [#94](https://github.com/rwth-acis/RequirementsBazaar/pull/94) but instead as a direction object strictly + defined by an enum [#96](https://github.com/rwth-acis/RequirementsBazaar/pull/96), - Moved user related information in categories, requirements and projects (isFollower/Developer/Contributor, userVoted) into the new `userContext` [#94](https://github.com/rwth-acis/RequirementsBazaar/pull/94). +- Comments with existing responses will no longer be deleted but + redacted [#103](https://github.com/rwth-acis/RequirementsBazaar/pull/103). +- Comments for a requirement are no longer paginated but instead return all + comments [#103](https://github.com/rwth-acis/RequirementsBazaar/pull/103). ### Removed From 86593fbbbfe718db6becbf6cba50783f56fc2b51 Mon Sep 17 00:00:00 2001 From: Thore Date: Tue, 25 May 2021 15:45:22 +0200 Subject: [PATCH 098/134] Patch comment update issue --- .../repositories/CommentRepositoryImpl.java | 10 ++++--- .../service/resources/CommentsResource.java | 26 +++++++++--------- .../dbis/acis/bazaar/service/BazaarTest.java | 27 +++++++++++++++++++ 3 files changed, 45 insertions(+), 18 deletions(-) diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java index 2e983e45..b6679e4a 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CommentRepositoryImpl.java @@ -53,7 +53,6 @@ public CommentRepositoryImpl(DSLContext jooq) { } - @Override public PaginationResult findAllAnswers(Pageable pageable, int userId) throws BazaarException { PaginationResult result = null; @@ -208,9 +207,11 @@ public List findAllByRequ private Comment convertToCommentWithUser(Record record, de.rwth.dbis.acis.bazaar.dal.jooq.tables.User creatorUser) { CommentRecord commentRecord = record.into(CommentRecord.class); Comment entry = transformer.getEntityFromTableRecord(commentRecord); - UserTransformer userTransformer = new UserTransformer(); - UserRecord userRecord = record.into(creatorUser); - entry.setCreator(userTransformer.getEntityFromTableRecord(userRecord)); + if (!entry.getDeleted()) { + UserTransformer userTransformer = new UserTransformer(); + UserRecord userRecord = record.into(creatorUser); + entry.setCreator(userTransformer.getEntityFromTableRecord(userRecord)); + } return entry; } @@ -260,6 +261,7 @@ public boolean belongsToPublicProject(int id) throws BazaarException { return false; } + @Override public boolean hasAnswers(int id) throws BazaarException { try { Integer answerCount = jooq.selectCount() diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java index 03520a24..c85bdc5f 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java @@ -51,26 +51,22 @@ @Path("/comments") public class CommentsResource { - private BazaarService bazaarService; - private final L2pLogger logger = L2pLogger.getInstance(CommentsResource.class.getName()); + private final BazaarService bazaarService; public CommentsResource() throws Exception { bazaarService = (BazaarService) Context.getCurrent().getService(); } - - - /** * This method returns the list of comments on the server. * - * @param page page number - * @param perPage number of comments by page + * @param page page number + * @param perPage number of comments by page * @param embedParents embed context/parents of comment (project, requirement) - * @param search search string - * @param sort sort order + * @param search search string + * @param sort sort order * @return Response with list of all requirements */ @GET @@ -88,8 +84,7 @@ public Response getAllComments( @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date") @DefaultValue("name") @QueryParam("sort") List sort, @ApiParam(value = "SortDirection", allowableValues = "ASC,DESC") @QueryParam("sortDirection") String sortDirection, @ApiParam(value = "Filter", required = true, allowMultiple = false, allowableValues = "created, following, replies") @QueryParam("filters") List filters, - @ApiParam(value = "Embed parents", required = true, allowMultiple = true, allowableValues = "project, requirement") @QueryParam("embedParents") List embedParents) - { + @ApiParam(value = "Embed parents", required = true, allowMultiple = true, allowableValues = "project, requirement") @QueryParam("embedParents") List embedParents) { DALFacade dalFacade = null; try { @@ -116,7 +111,9 @@ public Response getAllComments( // Take Object for generic error handling Set> violations = bazaarService.validate(pageInfo); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } PaginationResult commentResult = null; @@ -335,7 +332,9 @@ public Response createComment(@ApiParam(value = "Comment entity", required = tru commentToCreate.setCreator(dalFacade.getUserById(internalUserId)); // Take Object for generic error handling Set> violations = bazaarService.validateCreate(commentToCreate); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } dalFacade.followRequirement(internalUserId, requirement.getId()); Comment createdComment = dalFacade.createComment(commentToCreate); @@ -366,7 +365,6 @@ public Response createComment(@ApiParam(value = "Comment entity", required = tru * @return Response with the updated comment as a JSON object. */ @PUT - @Path("/") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "This method modifies a specific comment.") diff --git a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index 4e260acf..66c8db17 100644 --- a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -473,4 +473,31 @@ public void testDashboard() { fail(e.toString()); } } + + /** + * Test creating and updating comments + */ + @Test + public void testComments() { + MiniClient client = getClient(); + String testComment = String.format("{\"message\": \"Crashes all the time\", \"requirementId\": %s}", testRequirement.getId()); + ClientResponse result = client.sendRequest("POST", mainPath + "comments", testComment, + MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, new HashMap<>()); + System.out.println(result.toString()); + System.out.println("Result of 'testPost': " + result.getResponse().trim()); + assertEquals(201, result.getHttpCode()); + + JsonObject response = JsonParser.parseString(result.getResponse()).getAsJsonObject(); + Assert.assertTrue(response.isJsonObject()); + + assertTrue(response.has("id")); + assertTrue(isValidISO8601(response.get("creationDate").toString().replace("\"", ""))); + + // Test update + response.addProperty("message", "Updated message"); + result = client.sendRequest("PUT", mainPath + "comments", response.toString(), + MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, new HashMap<>()); + assertEquals(200, result.getHttpCode()); + } + } From 6ae167b8cb33f07c30831efcb1dc41cb01df1688 Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 29 May 2021 15:15:39 +0200 Subject: [PATCH 099/134] Add implementation to tag requirements --- ...is.bazaar.service.BazaarService.properties | 4 +- ...2peer.webConnector.WebConnector.properties | 5 +- .../acis/bazaar/service/dal/DALFacade.java | 47 +++++ .../bazaar/service/dal/DALFacadeImpl.java | 93 +++++++++- .../bazaar/service/dal/entities/Activity.java | 5 +- .../service/dal/entities/Requirement.java | 4 + .../service/dal/entities/RequirementTag.java | 17 ++ .../acis/bazaar/service/dal/entities/Tag.java | 27 +++ .../dal/repositories/RepositoryImpl.java | 16 +- .../RequirementRepositoryImpl.java | 21 ++- .../RequirementTagRepository.java | 14 ++ .../RequirementTagRepositoryImpl.java | 46 +++++ .../dal/repositories/TagRepository.java | 13 ++ .../dal/repositories/TagRepositoryImpl.java | 47 +++++ .../transform/RequirementTagTransformer.java | 70 ++++++++ .../service/dal/transform/TagTransformer.java | 80 +++++++++ .../service/resources/ProjectsResource.java | 167 +++++++++++++++++- .../resources/RequirementsResource.java | 53 ++++-- .../main/resources/migrations/V13__tags.sql | 22 +++ .../dbis/acis/bazaar/service/BazaarTest.java | 60 ++++++- .../bazaar/service/helpers/SetupData.java | 9 +- 21 files changed, 769 insertions(+), 51 deletions(-) create mode 100644 reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementTag.java create mode 100644 reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Tag.java create mode 100644 reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementTagRepository.java create mode 100644 reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementTagRepositoryImpl.java create mode 100644 reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/TagRepository.java create mode 100644 reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/TagRepositoryImpl.java create mode 100644 reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTagTransformer.java create mode 100644 reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/TagTransformer.java create mode 100644 reqbaz/src/main/resources/migrations/V13__tags.sql diff --git a/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties b/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties index a8636ff4..30a571d9 100644 --- a/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties +++ b/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties @@ -1,5 +1,5 @@ dbUserName=root -dbPassword=reqbaz +dbPassword=rootpw dbUrl=jdbc:mysql://localhost:3306/reqbaz lang=en country=us @@ -10,4 +10,4 @@ activityOrigin=https://requirements-bazaar.org smtpServer= emailFromAddress= emailSummaryTimePeriodInMinutes= -monitor= \ No newline at end of file +monitor= diff --git a/etc/i5.las2peer.webConnector.WebConnector.properties b/etc/i5.las2peer.webConnector.WebConnector.properties index 8c815727..8bcbca0e 100755 --- a/etc/i5.las2peer.webConnector.WebConnector.properties +++ b/etc/i5.las2peer.webConnector.WebConnector.properties @@ -8,7 +8,8 @@ crossOriginResourceDomain = * crossOriginResourceMaxAge = 60 enableCrossOriginResourceSharing = TRUE preferLocalServices = TRUE -xmlPath = +xmlPath = defaultLoginUser=anonymous defaultLoginPassword=anonymous -oidcProviders = https://api.learning-layers.eu/o/oauth2,https://accounts.google.com \ No newline at end of file +oidcProviders = https://api.learning-layers.eu/o/oauth2,https://accounts.google.com +#oidcProviders = http://api.learning-layers.eu:8081/auth/realms/main,https://accounts.google.com diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java index 9fde65a8..df302280 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java @@ -721,4 +721,51 @@ public interface DALFacade { * @throws BazaarException */ Dashboard getDashboardData(int userId, int count) throws BazaarException; + + // region Tags + + /** + * Allows to retrieve a tag by its id + * + * @param id + * @return + */ + Tag getTagById(int id) throws Exception; + + /** + * Returns all tags associated with a project. + * + * @param projectId + * @return + */ + List getTagsByProjectId(int projectId) throws Exception; + + /** + * Creates a new project level tag + * + * @param tag + * @return + * @throws BazaarException + */ + Tag createTag(Tag tag) throws BazaarException; + + /** + * Link a tag to a requirement + * + * @param tagId id of the tag (project scoped) + * @param requirementId id of the requirement + * @return + * @throws BazaarException + */ + CreationStatus tagRequirement(int tagId, int requirementId) throws BazaarException; + + /** + * Removes a tag from a requirement + * + * @param tagId + * @param requirementId + * @throws Exception + */ + void untagRequirement(int tagId, int requirementId) throws Exception; + // endregion tags } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index a561a6b4..f570011b 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -28,6 +28,8 @@ import de.rwth.dbis.acis.bazaar.service.dal.repositories.*; import de.rwth.dbis.acis.bazaar.service.dal.transform.PrivilegeEnumConverter; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; +import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; +import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; import de.rwth.dbis.acis.bazaar.service.internalization.Localization; import i5.las2peer.api.Context; import i5.las2peer.security.PassphraseAgentImpl; @@ -58,13 +60,15 @@ public class DALFacadeImpl implements DALFacade { private RequirementFollowerRepository requirementFollowerRepository; private ProjectRepository projectRepository; private RequirementRepository requirementRepository; - private RequirementCategoryRepository tagRepository; + private RequirementCategoryRepository requirementCategoryRepository; private UserRepository userRepository; private VoteRepository voteRepository; private RoleRepository roleRepository; private PrivilegeRepository privilegeRepository; private PersonalisationDataRepository personalisationDataRepository; private FeedbackRepository feedbackRepository; + private TagRepository tagRepository; + private RequirementTagRepository requirementTagRepository; public DALFacadeImpl(DataSource dataSource, SQLDialect dialect) { dslContext = DSL.using(dataSource, dialect); @@ -315,12 +319,16 @@ public Requirement createRequirement(Requirement requirement, int userId) throws for (Integer category : requirement.getCategories()) { addCategoryTag(newRequirement.getId(), category); } + for (Tag tag : requirement.getTags()) { + tagRequirement(newRequirement.getId(), tag.getId()); + } return getRequirementById(newRequirement.getId(), userId); } @Override public Requirement modifyRequirement(Requirement modifiedRequirement, int userId) throws Exception { requirementRepository = (requirementRepository != null) ? requirementRepository : new RequirementRepositoryImpl(dslContext); + Requirement oldRequirement = getRequirementById(modifiedRequirement.getId(), userId); requirementRepository.update(modifiedRequirement); if (modifiedRequirement.getCategories() != null) { @@ -350,6 +358,36 @@ public Requirement modifyRequirement(Requirement modifiedRequirement, int userId } } } + + // Synchronize tags + if (modifiedRequirement.getTags() != null) { + // Check if tags have changed + for (Tag tag1 : modifiedRequirement.getTags()) { + try { + Tag internalTag = getTagById(tag1.getId()); + + // Check if tag exists (in project) + if (internalTag == null || modifiedRequirement.getProjectId() != internalTag.getProjectId()) { + tag1.setProjectId(modifiedRequirement.getProjectId()); + tag1 = createTag(tag1); + } + tagRequirement(tag1.getId(), modifiedRequirement.getId()); + } catch (Exception e) { + e.printStackTrace(); + } + } + + // Remove tags no longer present + oldRequirement.getTags().stream().filter(tag -> modifiedRequirement.getTags().contains(tag)).forEach(tag -> { + try { + untagRequirement(tag.getId(), oldRequirement.getId()); + } catch (Exception e) { + e.printStackTrace(); + } + }); + + + } return getRequirementById(modifiedRequirement.getId(), userId); } @@ -633,8 +671,8 @@ public void notWantToDevelop(int userId, int requirementId) throws BazaarExcepti @Override public void addCategoryTag(int requirementId, int categoryId) throws BazaarException { - tagRepository = (tagRepository != null) ? tagRepository : new RequirementCategoryRepositoryImpl(dslContext); - tagRepository.add(RequirementCategory.builder() + requirementCategoryRepository = (requirementCategoryRepository != null) ? requirementCategoryRepository : new RequirementCategoryRepositoryImpl(dslContext); + requirementCategoryRepository.add(RequirementCategory.builder() .categoryId(categoryId) .requirementId(requirementId) .build() @@ -643,8 +681,8 @@ public void addCategoryTag(int requirementId, int categoryId) throws BazaarExcep @Override public void deleteCategoryTag(int requirementId, int categoryId) throws BazaarException { - tagRepository = (tagRepository != null) ? tagRepository : new RequirementCategoryRepositoryImpl(dslContext); - tagRepository.delete(requirementId, categoryId); + requirementCategoryRepository = (requirementCategoryRepository != null) ? requirementCategoryRepository : new RequirementCategoryRepositoryImpl(dslContext); + requirementCategoryRepository.delete(requirementId, categoryId); } @Override @@ -771,7 +809,50 @@ public Dashboard getDashboardData(int userId, int count) throws BazaarException } @Override - public PaginationResult getProjectMembers(int projectId, Pageable pageable) throws BazaarException { + public Tag getTagById(int id) throws Exception { + tagRepository = (tagRepository != null) ? tagRepository : new TagRepositoryImpl(dslContext); + try { + return tagRepository.findById(id); + } catch (BazaarException bex) { + if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { + return null; + } + ExceptionHandler.getInstance().convertAndThrowException(bex); + } + return null; + } + + @Override + public List getTagsByProjectId(int projectId) throws Exception { + tagRepository = (tagRepository != null) ? tagRepository : new TagRepositoryImpl(dslContext); + return tagRepository.findByProjectId(projectId); + } + + @Override + public Tag createTag(Tag tag) throws BazaarException { + tagRepository = (tagRepository != null) ? tagRepository : new TagRepositoryImpl(dslContext); + return tagRepository.add(tag); + } + + @Override + public CreationStatus tagRequirement(int tagId, int requirementId) throws BazaarException { + requirementTagRepository = (requirementTagRepository != null) ? requirementTagRepository : new RequirementTagRepositoryImpl(dslContext); + return requirementTagRepository.addOrUpdate(RequirementTag.builder() + .requirementId(requirementId) + .tagId(tagId) + .build() + ); + } + + @Override + public void untagRequirement(int tagId, int requirementId) throws Exception { + requirementTagRepository = (requirementTagRepository != null) ? requirementTagRepository : new RequirementTagRepositoryImpl(dslContext); + requirementTagRepository.delete(tagId, requirementId); + } + + @Override + public PaginationResult getProjectMembers(int projectId, Pageable pageable) throws + BazaarException { roleRepository = (roleRepository != null) ? roleRepository : new RoleRepositoryImpl(dslContext); return roleRepository.listProjectMembers(projectId, pageable); } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java index 016f1372..87a99b3c 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java @@ -19,7 +19,7 @@ public class Activity extends EntityBase { private final transient int id; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone="Europe/Berlin") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") private final LocalDateTime creationDate; private final ActivityAction activityAction; @@ -47,7 +47,8 @@ public enum DataType { COMMENT, ATTACHMENT, USER, - FEEDBACK + FEEDBACK, + TAG } public enum ActivityAction { diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java index fbbbaedb..5efceafe 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java @@ -13,6 +13,7 @@ import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.time.LocalDateTime; +import java.util.ArrayList; import java.util.List; /** @@ -51,6 +52,9 @@ public class Requirement extends EntityBase implements Ownable { // But the API still allows to create a requirement with attachments at the same time. private List attachments; + @lombok.Builder.Default + private List tags = new ArrayList<>(); + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") private LocalDateTime creationDate; diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementTag.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementTag.java new file mode 100644 index 00000000..e9b0e1c7 --- /dev/null +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/RequirementTag.java @@ -0,0 +1,17 @@ +package de.rwth.dbis.acis.bazaar.service.dal.entities; + +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; + +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") +public class RequirementTag extends EntityBase { + private final int id; + private final int requirementId; + + private int tagId; +} diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Tag.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Tag.java new file mode 100644 index 00000000..d1beabb2 --- /dev/null +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Tag.java @@ -0,0 +1,27 @@ +package de.rwth.dbis.acis.bazaar.service.dal.entities; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.extern.jackson.Jacksonized; + +import javax.validation.constraints.NotNull; + +@EqualsAndHashCode(callSuper = true) +@Data +@Jacksonized +@Builder(builderClassName = "Builder") +public class Tag extends EntityBase { + + private final int id; + + @NotNull + private String name; + + @NotNull + private String colour; + + @JsonIgnore + private Integer projectId; +} diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java index 9662886f..21ac8079 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RepositoryImpl.java @@ -57,6 +57,7 @@ public RepositoryImpl(DSLContext jooq, Transformer transformer) { * @param entity to add * @return the persisted entity */ + @Override public E add(E entity) throws BazaarException { E transformedEntity = null; try { @@ -80,10 +81,11 @@ public E add(E entity) throws BazaarException { * @throws Exception */ //TODO transaction (findById,delete) + @Override public E delete(int id) throws Exception { E deleted = null; try { - deleted = this.findById(id); + deleted = findById(id); int deletedRecordCount = jooq.delete(transformer.getTable()) .where(transformer.getTableId().equal(id)) @@ -100,6 +102,7 @@ public E delete(int id) throws Exception { /** * @return all the entities currently in the database */ + @Override public List findAll() throws BazaarException { List entries = null; try { @@ -107,10 +110,7 @@ public List findAll() throws BazaarException { List queryResults = jooq.selectFrom(transformer.getTable()).fetchInto(transformer.getRecordClass()); - for (R queryResult : queryResults) { - E entry = transformer.getEntityFromTableRecord(queryResult); - entries.add(entry); - } + } catch (DataAccessException e) { ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN, e.getMessage()); } @@ -173,6 +173,7 @@ public List searchAll(String searchTerm, Pageable pageable) throws Exception * @return the entity from the database with the given Id * @throws Exception */ + @Override public E findById(int id) throws Exception { R queryResult = null; try { @@ -208,10 +209,11 @@ public E update(E entity) throws Exception { for (Map.Entry item : map.entrySet()) { Field key = item.getKey(); Object value = item.getValue(); - if (moreStep == null) + if (moreStep == null) { moreStep = update.set(key, value); - else + } else { moreStep.set(key, value); + } } assert moreStep != null; moreStep.where(transformer.getTableId().equal(entity.getId())).execute(); diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java index b49e20dd..a8d6b704 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java @@ -22,12 +22,11 @@ import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementCategoryMapRecord; import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementRecord; -import de.rwth.dbis.acis.bazaar.service.dal.entities.Attachment; -import de.rwth.dbis.acis.bazaar.service.dal.entities.Requirement; -import de.rwth.dbis.acis.bazaar.service.dal.entities.Statistic; -import de.rwth.dbis.acis.bazaar.service.dal.entities.UserContext; +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.TagRecord; +import de.rwth.dbis.acis.bazaar.service.dal.entities.*; import de.rwth.dbis.acis.bazaar.service.dal.helpers.*; import de.rwth.dbis.acis.bazaar.service.dal.transform.RequirementTransformer; +import de.rwth.dbis.acis.bazaar.service.dal.transform.TagTransformer; import de.rwth.dbis.acis.bazaar.service.dal.transform.UserTransformer; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; @@ -42,6 +41,7 @@ import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.*; +import java.util.stream.Collectors; import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; import static org.jooq.impl.DSL.*; @@ -225,6 +225,19 @@ private ImmutablePair, Integer> getFilteredRequirements(Collec requirement.setCategories(categories); + // Filling up tags + Result tagRecords = jooq.select(TAG.fields()) + .from(TAG) + .leftOuterJoin(REQUIREMENT_TAG_MAP).on(REQUIREMENT_TAG_MAP.TAG_ID.eq(TAG.ID)) + .where(REQUIREMENT_TAG_MAP.REQUIREMENT_ID.eq(requirement.getId())).fetchInto(TAG); + + TagTransformer tagTransformer = new TagTransformer(); + List tags = tagRecords.stream() + .map(tagTransformer::getEntityFromTableRecord) + .collect(Collectors.toList()); + + requirement.setTags(tags); + //Filling up additional information requirement.setNumberOfComments((Integer) queryResult.getValue(COMMENT_COUNT)); requirement.setNumberOfAttachments((Integer) queryResult.getValue(ATTACHMENT_COUNT)); diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementTagRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementTagRepository.java new file mode 100644 index 00000000..72cc091f --- /dev/null +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementTagRepository.java @@ -0,0 +1,14 @@ +package de.rwth.dbis.acis.bazaar.service.dal.repositories; + +import de.rwth.dbis.acis.bazaar.service.dal.entities.RequirementTag; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreationStatus; +import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; + +/** + * @since 6/22/2014 + */ +public interface RequirementTagRepository extends Repository { + CreationStatus addOrUpdate(RequirementTag tag) throws BazaarException; + + void delete(int tagId, int requirementId); +} diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementTagRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementTagRepositoryImpl.java new file mode 100644 index 00000000..ae7b6065 --- /dev/null +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementTagRepositoryImpl.java @@ -0,0 +1,46 @@ +package de.rwth.dbis.acis.bazaar.service.dal.repositories; + +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementTagMapRecord; +import de.rwth.dbis.acis.bazaar.service.dal.entities.RequirementTag; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreationStatus; +import de.rwth.dbis.acis.bazaar.service.dal.transform.RequirementTagTransformer; +import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; +import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; +import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; +import de.rwth.dbis.acis.bazaar.service.exception.ExceptionLocation; +import org.jooq.DSLContext; + +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.REQUIREMENT_TAG_MAP; + +public class RequirementTagRepositoryImpl extends RepositoryImpl implements RequirementTagRepository { + /** + * @param jooq DSLContext for JOOQ connection + */ + public RequirementTagRepositoryImpl(DSLContext jooq) { + super(jooq, new RequirementTagTransformer()); + } + + @Override + public CreationStatus addOrUpdate(RequirementTag requirementTag) throws BazaarException { + RequirementTagMapRecord record = jooq.selectFrom(REQUIREMENT_TAG_MAP) + .where(REQUIREMENT_TAG_MAP.REQUIREMENT_ID.eq(requirementTag.getRequirementId())) + .and(REQUIREMENT_TAG_MAP.TAG_ID.eq(requirementTag.getTagId())) + .fetchOne(); + + if (record != null) { + return CreationStatus.UNCHANGED; + } else { + try { + add(requirementTag); + } catch (Exception ex) { + ExceptionHandler.getInstance().convertAndThrowException(ex, ExceptionLocation.REPOSITORY, ErrorCode.NOT_FOUND); + } + return CreationStatus.CREATED; + } + } + + @Override + public void delete(int tagId, int requirementId) { + jooq.deleteFrom(REQUIREMENT_TAG_MAP).where(REQUIREMENT_TAG_MAP.TAG_ID.eq(tagId)).and(REQUIREMENT_TAG_MAP.REQUIREMENT_ID.eq(requirementId)).execute(); + } +} diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/TagRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/TagRepository.java new file mode 100644 index 00000000..ea6a1c61 --- /dev/null +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/TagRepository.java @@ -0,0 +1,13 @@ +package de.rwth.dbis.acis.bazaar.service.dal.repositories; + +import de.rwth.dbis.acis.bazaar.service.dal.entities.Tag; + +import java.util.List; + +public interface TagRepository extends Repository { + + @Override + Tag findById(int id) throws Exception; + + List findByProjectId(int projectId) throws Exception; +} diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/TagRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/TagRepositoryImpl.java new file mode 100644 index 00000000..b5efca1f --- /dev/null +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/TagRepositoryImpl.java @@ -0,0 +1,47 @@ +package de.rwth.dbis.acis.bazaar.service.dal.repositories; + +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.TagRecord; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Tag; +import de.rwth.dbis.acis.bazaar.service.dal.transform.TagTransformer; +import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; +import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; +import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; +import de.rwth.dbis.acis.bazaar.service.exception.ExceptionLocation; +import org.jooq.DSLContext; +import org.jooq.exception.DataAccessException; + +import java.util.ArrayList; +import java.util.List; + +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.TAG; + +public class TagRepositoryImpl extends RepositoryImpl implements TagRepository { + + /** + * @param jooq DSLContext for JOOQ connection + */ + public TagRepositoryImpl(DSLContext jooq) { + super(jooq, new TagTransformer()); + } + + @Override + public List findByProjectId(int projectId) throws BazaarException { + List tags = new ArrayList<>(); + try { + + List queryResults = jooq.selectFrom(TAG) + .where(TAG.PROJECT_ID.eq(projectId)) + .orderBy(TAG.NAME) + .fetchInto(transformer.getRecordClass()); + + for (TagRecord queryResult : queryResults) { + Tag entry = transformer.getEntityFromTableRecord(queryResult); + tags.add(entry); + } + } catch (DataAccessException e) { + ExceptionHandler.getInstance().convertAndThrowException(e, ExceptionLocation.REPOSITORY, ErrorCode.UNKNOWN); + } + + return tags; + } +} diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTagTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTagTransformer.java new file mode 100644 index 00000000..cb4226f1 --- /dev/null +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTagTransformer.java @@ -0,0 +1,70 @@ +package de.rwth.dbis.acis.bazaar.service.dal.transform; + +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementTagMapRecord; +import de.rwth.dbis.acis.bazaar.service.dal.entities.RequirementTag; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; +import org.jooq.*; + +import java.util.*; + +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.REQUIREMENT_TAG_MAP; + +public class RequirementTagTransformer implements Transformer { + @Override + public RequirementTagMapRecord createRecord(RequirementTag entity) { + RequirementTagMapRecord record = new RequirementTagMapRecord(); + record.setRequirementId(entity.getRequirementId()); + record.setTagId(entity.getTagId()); + return record; + } + + @Override + public RequirementTag getEntityFromTableRecord(RequirementTagMapRecord record) { + return RequirementTag.builder() + .id(record.getId()) + .tagId(record.getTagId()) + .requirementId(record.getRequirementId()) + .build(); + } + + @Override + public Table getTable() { + return REQUIREMENT_TAG_MAP; + } + + @Override + public TableField getTableId() { + return REQUIREMENT_TAG_MAP.ID; + } + + @Override + public Class getRecordClass() { + return RequirementTagMapRecord.class; + } + + @Override + public Map getUpdateMap(RequirementTag entity) { + return new HashMap<>() {{ + put(REQUIREMENT_TAG_MAP.REQUIREMENT_ID, entity.getRequirementId()); + put(REQUIREMENT_TAG_MAP.TAG_ID, entity.getTagId()); + }}; + } + + @Override + public Collection> getSortFields(List sorts) { + if (sorts.isEmpty()) { + return Collections.singletonList(REQUIREMENT_TAG_MAP.ID.asc()); + } + return null; + } + + @Override + public Condition getSearchCondition(String search) throws Exception { + throw new Exception("Search is not supported!"); + } + + @Override + public Collection getFilterConditions(Map filters) throws Exception { + return new ArrayList<>(); + } +} diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/TagTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/TagTransformer.java new file mode 100644 index 00000000..d2092b93 --- /dev/null +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/TagTransformer.java @@ -0,0 +1,80 @@ +package de.rwth.dbis.acis.bazaar.service.dal.transform; + +import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.TagRecord; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Tag; +import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; +import org.jooq.*; + +import java.time.LocalDateTime; +import java.util.*; + +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.TAG; + +public class TagTransformer implements Transformer { + @Override + public TagRecord createRecord(Tag entity) { + TagRecord record = new TagRecord(); + record.setProjectId(entity.getProjectId()); + record.setName(entity.getName()); + record.setColour(entity.getColour()); + record.setCreationDate(LocalDateTime.now()); + return record; + } + + @Override + public Tag getEntityFromTableRecord(TagRecord record) { + return Tag.builder() + .id(record.getId()) + .projectId(record.getProjectId()) + .colour(record.getColour()) + .name(record.getName()) + .build(); + } + + @Override + public Table getTable() { + return TAG; + } + + @Override + public TableField getTableId() { + return TAG.ID; + } + + @Override + public Class getRecordClass() { + return TagRecord.class; + } + + @Override + public Map getUpdateMap(Tag entity) { + HashMap updateMap = new HashMap<>() {{ + + if (entity.getName() != null) { + put(TAG.NAME, entity.getName()); + } + if (entity.getColour() != null) { + put(TAG.COLOUR, entity.getColour()); + } + }}; + return updateMap; + } + + @Override + public Collection> getSortFields(List sorts) { + if (sorts.isEmpty()) { + return Collections.singletonList(TAG.NAME.asc()); + } + return null; + } + + @Override + public Condition getSearchCondition(String search) throws Exception { + throw new Exception("Search is not supported!"); + } + + @Override + public Collection getFilterConditions(Map filters) throws Exception { + return new ArrayList<>(); + } +} diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java index 453c1db7..21cfa28c 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java @@ -3,6 +3,7 @@ import de.rwth.dbis.acis.bazaar.service.BazaarFunction; import de.rwth.dbis.acis.bazaar.service.BazaarService; import de.rwth.dbis.acis.bazaar.service.dal.DALFacade; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Tag; import de.rwth.dbis.acis.bazaar.service.dal.entities.*; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; @@ -52,9 +53,8 @@ @Path("/projects") public class ProjectsResource { - private BazaarService bazaarService; - private final L2pLogger logger = L2pLogger.getInstance(ProjectsResource.class.getName()); + private final BazaarService bazaarService; public ProjectsResource() throws Exception { bazaarService = (BazaarService) Context.getCurrent().getService(); @@ -112,7 +112,9 @@ public Response getProjects( // Take Object for generic error handling Set> violations = bazaarService.validate(pageInfo); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } PaginationResult projectsResult; if (agent instanceof AnonymousAgent) { @@ -256,7 +258,9 @@ public Response createProject(@ApiParam(value = "Project entity", required = tru // Validate input Set> violations = bazaarService.validateCreate(projectToCreate); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); @@ -316,7 +320,9 @@ public Response updateProject(@ApiParam(value = "Project entity", required = tru // Take Object for generic error handling Set> violations = bazaarService.validate(projectToUpdate); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); @@ -657,7 +663,9 @@ public Response getFollowersForProject(@PathParam("projectId") int projectId, // Take Object for generic error handling Set> violations = bazaarService.validate(pageInfo); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); @@ -797,6 +805,141 @@ public Response getFeedbacksForProject(@PathParam("projectId") int projectId, return feedbackResource.getFeedbackForProject(projectId, page, perPage); } + @GET + @Path("/{projectId}/tags") + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "This method returns the list of tags under a given project.") + @ApiResponses(value = { + @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns a list of tags for a given project", response = Tag.class, responseContainer = "List"), + @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), + @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), + @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") + }) + public Response getTagsForProject( + @PathParam("projectId") int projectId + ) { + DALFacade dalFacade = null; + try { + Agent agent = Context.getCurrent().getMainAgent(); + String userId = agent.getIdentifier(); + String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); + if (registrarErrors != null) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); + } + + dalFacade = bazaarService.getDBConnection(); + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + + Project project = dalFacade.getProjectById(projectId, internalUserId); + + if (project == null) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.NOT_FOUND, String.format(Localization.getInstance().getResourceBundle().getString("error.resource.notfound"), "project")); + } + + if (project.getVisibility()) { + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_PROJECT, projectId, dalFacade); + if (!authorized) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.anonymous")); + } + } else { + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PROJECT, projectId, dalFacade); + if (!authorized) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.project.read")); + } + } + + List tags = dalFacade.getTagsByProjectId(projectId); + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_12, + projectId, Activity.DataType.PROJECT, internalUserId); + + Response.ResponseBuilder responseBuilder = Response.ok() + .entity(bazaarService.getMapper().writeValueAsString(tags)); + + return responseBuilder.build(); + } catch (BazaarException bex) { + if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { + return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { + return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else { + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get followers for project " + projectId); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } + } catch (Exception ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get followers for project " + projectId); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } finally { + bazaarService.closeDBConnection(dalFacade); + } + } + + /** + * This method add the current user to the followers list of a given project. + * + * @param projectId id of the project + * @param tag Tag to be created + * @return Response with project as a JSON object. + */ + @POST + @Path("/{projectId}/tags") + @Produces(MediaType.APPLICATION_JSON) + @Consumes(MediaType.APPLICATION_JSON) + @ApiOperation(value = "This method adds a new tag to a given project.") + @ApiResponses(value = { + @ApiResponse(code = HttpURLConnection.HTTP_CREATED, message = "Path to parent project", response = Tag.class), + @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), + @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), + @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") + }) + public Response createTag(@PathParam("projectId") int projectId, + @ApiParam(value = "New Tag Representation", required = true) Tag tag) { + DALFacade dalFacade = null; + try { + Agent agent = Context.getCurrent().getMainAgent(); + String userId = agent.getIdentifier(); + String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); + if (registrarErrors != null) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); + } + dalFacade = bazaarService.getDBConnection(); + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + + // TODO: Discuss permission model + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Create_CATEGORY, dalFacade); + if (!authorized) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.category.create")); + } + + // Ensure no cross-injection happens + tag.setProjectId(projectId); + Tag createdTag = dalFacade.createTag(tag); + + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.CREATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_8, + projectId, Activity.DataType.TAG, internalUserId); + return Response.status(Response.Status.CREATED).entity(createdTag.toJSON()).build(); + } catch (BazaarException bex) { + if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { + return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { + return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else { + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Create tag in project " + projectId); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } + } catch (Exception ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Follow project " + projectId); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } finally { + bazaarService.closeDBConnection(dalFacade); + } + } + /** * Allows to update a certain project. * @@ -828,7 +971,9 @@ public Response updateMembership(@PathParam("projectId") int projectId, // Take Object for generic error handling Set> violations = bazaarService.validate(projectMembers); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); @@ -907,14 +1052,18 @@ public Response getMembers(@PathParam("projectId") int projectId, // Take Object for generic error handling Set> violations = bazaarService.validate(pageInfo); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); PrivilegeEnum privilege = PrivilegeEnum.Read_PUBLIC_PROJECT; - if (!dalFacade.isProjectPublic(projectId)) privilege = PrivilegeEnum.Read_PROJECT; + if (!dalFacade.isProjectPublic(projectId)) { + privilege = PrivilegeEnum.Read_PROJECT; + } boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, privilege, projectId, dalFacade); if (!authorized) { diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java index 4dd52a20..bdc04883 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java @@ -3,6 +3,7 @@ import de.rwth.dbis.acis.bazaar.service.BazaarFunction; import de.rwth.dbis.acis.bazaar.service.BazaarService; import de.rwth.dbis.acis.bazaar.service.dal.DALFacade; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Tag; import de.rwth.dbis.acis.bazaar.service.dal.entities.*; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; @@ -52,9 +53,8 @@ @Path("/requirements") public class RequirementsResource { - private BazaarService bazaarService; - private final L2pLogger logger = L2pLogger.getInstance(RequirementsResource.class.getName()); + private final BazaarService bazaarService; public RequirementsResource() throws Exception { bazaarService = (BazaarService) Context.getCurrent().getService(); @@ -112,7 +112,9 @@ public Response getRequirements( // Take Object for generic error handling Set> violations = bazaarService.validate(pageInfo); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } PaginationResult requirementsResult = null; @@ -167,9 +169,6 @@ public Response getRequirements( } - - - /** * This method returns the list of requirements for a specific project. * @@ -202,7 +201,9 @@ public Response getRequirementsForProject(int projectId, int page, int perPage, PageInfo pageInfo = new PageInfo(page, perPage, filters, sortList, search); // Take Object for generic error handling Set> violations = bazaarService.validate(pageInfo); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); @@ -300,7 +301,9 @@ public Response getRequirementsForCategory(int categoryId, int page, int perPage PageInfo pageInfo = new PageInfo(page, perPage, filters, sortList, search); // Take Object for generic error handling Set> violations = bazaarService.validate(pageInfo); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); @@ -368,10 +371,6 @@ public Response getRequirementsForCategory(int categoryId, int page, int perPage } - - - - /** * This method returns a specific requirement. * @@ -471,7 +470,9 @@ public Response createRequirement(@ApiParam(value = "Requirement entity", requir requirementToCreate.setCreator(dalFacade.getUserById(internalUserId)); // Take Object for generic error handling Set> violations = bazaarService.validateCreate(requirementToCreate); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } // check if all categories are in the same project for (Integer catId : requirementToCreate.getCategories()) { @@ -480,6 +481,16 @@ public Response createRequirement(@ApiParam(value = "Requirement entity", requir ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.VALIDATION, "Category does not fit with project"); } } + + for (Tag tag : requirementToCreate.getTags()) { + Tag internalTag = dalFacade.getTagById(tag.getId()); + if (internalTag == null) { + dalFacade.createTag(tag); + } else if (requirementToCreate.getProjectId() != tag.getProjectId()) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.VALIDATION, "Tag does not fit with project"); + } + } + Requirement createdRequirement = dalFacade.createRequirement(requirementToCreate, internalUserId); // check if attachments are given @@ -489,7 +500,9 @@ public Response createRequirement(@ApiParam(value = "Requirement entity", requir attachment.setRequirementId(createdRequirement.getId()); // Take Object for generic error handling violations = bazaarService.validate(attachment); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } dalFacade.createAttachment(attachment); } @@ -544,7 +557,9 @@ public Response updateRequirement(@ApiParam(value = "Requirement entity", requir String userId = agent.getIdentifier(); // Take Object for generic error handling Set> violations = bazaarService.validate(requirementToUpdate); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); @@ -1293,7 +1308,9 @@ public Response getDevelopersForRequirement(@PathParam("requirementId") int requ PageInfo pageInfo = new PageInfo(page, perPage); // Take Object for generic error handling Set> violations = bazaarService.validate(pageInfo); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); @@ -1418,7 +1435,9 @@ public Response getFollowersForRequirement(@PathParam("requirementId") int requi PageInfo pageInfo = new PageInfo(page, perPage); // Take Object for generic error handling Set> violations = bazaarService.validate(pageInfo); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); diff --git a/reqbaz/src/main/resources/migrations/V13__tags.sql b/reqbaz/src/main/resources/migrations/V13__tags.sql new file mode 100644 index 00000000..f7aef404 --- /dev/null +++ b/reqbaz/src/main/resources/migrations/V13__tags.sql @@ -0,0 +1,22 @@ +CREATE TABLE IF NOT EXISTS reqbaz.tag +( + id INT NOT NULL AUTO_INCREMENT, + project_id INT NOT NULL, + creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + name VARCHAR(20) NOT NULL, + colour VARCHAR(7) NOT NULL, + CONSTRAINT tag_project FOREIGN KEY tag_project (project_id) REFERENCES project (id) ON DELETE CASCADE, + CONSTRAINT tag_pk PRIMARY KEY (id) +); + +CREATE TABLE IF NOT EXISTS reqbaz.requirement_tag_map +( + id INT NOT NULL AUTO_INCREMENT, + tag_id INT NOT NULL, + requirement_id INT NOT NULL, + CONSTRAINT requirement_tag_map_pk PRIMARY KEY (id), + CONSTRAINT requirement_tag_map_requirement FOREIGN KEY requirement_tag_map_requirement (requirement_id) REFERENCES requirement (id) + ON DELETE CASCADE, + CONSTRAINT requirement_tag_map_tag FOREIGN KEY requirement_tag_map_tag (tag_id) REFERENCES tag (id) + ON DELETE CASCADE +); diff --git a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index 66c8db17..fdeedb71 100644 --- a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -1,5 +1,6 @@ package de.rwth.dbis.acis.bazaar.service; +import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -156,7 +157,7 @@ public void testGetProjects() { } /** - * Test create a new requirement + * Test create a new category */ @Test public void testCategories() { @@ -500,4 +501,61 @@ public void testComments() { assertEquals(200, result.getHttpCode()); } + /** + * Test to get a list of tags on a project + */ + @Test + public void testTags() { + try { + MiniClient client = getClient(); + MiniClient adminClient = getAdminClient(); + + String path = mainPath + "projects/" + testProject.getId() + "/tags"; + ClientResponse result = client.sendRequest("GET", path, ""); + assertEquals(200, result.getHttpCode()); + + JsonElement response = JsonParser.parseString(result.getResponse()); + System.out.println(response.toString()); + assertTrue(response.isJsonArray()); + + // Now create + String testRequest = "{\"name\": \"Feature\", \"colour\": \"#00FF00\"}"; + ClientResponse newResult = adminClient.sendRequest("POST", path, testRequest, MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, new HashMap<>()); + assertEquals(201, newResult.getHttpCode()); + Integer tagId = JsonParser.parseString(newResult.getResponse()).getAsJsonObject().get("id").getAsInt(); + + result = client.sendRequest("GET", path, ""); + assertEquals(200, result.getHttpCode()); + + response = JsonParser.parseString(result.getResponse()); + System.out.println(response.toString()); + assertTrue(response.isJsonArray()); + assertEquals(2, response.getAsJsonArray().size()); + + // Now try to add one of these tags and an entirely new one to a requirement + result = client.sendRequest("GET", mainPath + "requirements/" + testRequirement.getId(), ""); + assertEquals(200, result.getHttpCode()); + + JsonElement resp = JsonParser.parseString(result.getResponse()); + JsonObject requirement = resp.getAsJsonObject(); + + // Create Tag array and add it to the JsonObject + JsonArray newTags = JsonParser.parseString(String.format("[{\"id\": %s, \"name\": \"Feature\", \"colour\": \"#00FF00\"}, {\"name\": \"Test\", \"colour\": \"#0000FF\"}]", tagId)).getAsJsonArray(); + requirement.add("tags", newTags); + + + result = adminClient.sendRequest("PUT", mainPath + "requirements", requirement.toString(), + MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, new HashMap<>()); + System.out.println(result.getResponse()); + assertEquals(200, result.getHttpCode()); + + response = JsonParser.parseString(result.getResponse()); + assertTrue(response.isJsonObject()); + assertEquals(2, response.getAsJsonObject().get("tags").getAsJsonArray().size()); + + } catch (Exception e) { + e.printStackTrace(); + fail(e.toString()); + } + } } diff --git a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java index 7b817b0d..3d313abf 100644 --- a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java +++ b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java @@ -2,9 +2,9 @@ import de.rwth.dbis.acis.bazaar.service.dal.DALFacade; import de.rwth.dbis.acis.bazaar.service.dal.DALFacadeImpl; -import de.rwth.dbis.acis.bazaar.service.dal.entities.Category; import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; import de.rwth.dbis.acis.bazaar.service.dal.entities.Requirement; +import de.rwth.dbis.acis.bazaar.service.dal.entities.Tag; import de.rwth.dbis.acis.bazaar.service.dal.entities.User; import de.rwth.dbis.acis.bazaar.service.internalization.Localization; import org.apache.commons.dbcp2.BasicDataSource; @@ -76,6 +76,13 @@ public void setUp() throws Exception { testProject = Project.builder().name("ProjectTest").description("ProjDesc").leader(initUser).visibility(true).build(); testProject = facade.createProject(testProject, initUser.getId()); + + facade.createTag(Tag.builder() + .name("Bug") + .colour("#FF0000") + .projectId(testProject.getId()) + .build()); + testRequirement = Requirement.builder() .name("Test") .description("Test") From a2527545fd031120a7d624739d3b26fb6cc684ce Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 29 May 2021 15:57:56 +0200 Subject: [PATCH 100/134] Create tags with requirement creation --- .../de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java | 2 +- .../acis/bazaar/service/resources/RequirementsResource.java | 6 +++++- .../java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index f570011b..46f852ae 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -320,7 +320,7 @@ public Requirement createRequirement(Requirement requirement, int userId) throws addCategoryTag(newRequirement.getId(), category); } for (Tag tag : requirement.getTags()) { - tagRequirement(newRequirement.getId(), tag.getId()); + tagRequirement(tag.getId(), newRequirement.getId()); } return getRequirementById(newRequirement.getId(), userId); } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java index bdc04883..0c7fe8e1 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java @@ -482,14 +482,18 @@ public Response createRequirement(@ApiParam(value = "Requirement entity", requir } } + List validatedTags = new ArrayList<>(); for (Tag tag : requirementToCreate.getTags()) { Tag internalTag = dalFacade.getTagById(tag.getId()); if (internalTag == null) { - dalFacade.createTag(tag); + tag.setProjectId(requirementToCreate.getProjectId()); + internalTag = dalFacade.createTag(tag); } else if (requirementToCreate.getProjectId() != tag.getProjectId()) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.VALIDATION, "Tag does not fit with project"); } + validatedTags.add(internalTag); } + requirementToCreate.setTags(validatedTags); Requirement createdRequirement = dalFacade.createRequirement(requirementToCreate, internalUserId); diff --git a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index fdeedb71..020216d8 100644 --- a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -210,7 +210,7 @@ public void testRequirements() { try { MiniClient client = getClient(); - String testRequirement = "{\"name\": \"Test Requirements\", \"description\": \"A test requirement\", \"categories\": [" + testProject.getDefaultCategoryId() + "], \"projectId\":" + testProject.getId() + "}"; + String testRequirement = String.format("{\"name\": \"Test Requirements\", \"description\": \"A test requirement\", \"categories\": [%s], \"projectId\": \"%s\", \"tags\": [{\"name\": \"CreateTest\", \"colour\": \"#FFFFFF\"}]}", testProject.getDefaultCategoryId(), testProject.getId()); ClientResponse result = client.sendRequest("POST", mainPath + "requirements", testRequirement, MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, new HashMap<>()); assertEquals(201, result.getHttpCode()); From d9663d1c5ab3b421dd33c20d8f1f166a2458f2d9 Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 29 May 2021 16:06:44 +0200 Subject: [PATCH 101/134] Fix variable naming --- .../dbis/acis/bazaar/service/dal/DALFacadeImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index 46f852ae..3407ac42 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -362,16 +362,16 @@ public Requirement modifyRequirement(Requirement modifiedRequirement, int userId // Synchronize tags if (modifiedRequirement.getTags() != null) { // Check if tags have changed - for (Tag tag1 : modifiedRequirement.getTags()) { + for (Tag tag : modifiedRequirement.getTags()) { try { - Tag internalTag = getTagById(tag1.getId()); + Tag internalTag = getTagById(tag.getId()); // Check if tag exists (in project) if (internalTag == null || modifiedRequirement.getProjectId() != internalTag.getProjectId()) { - tag1.setProjectId(modifiedRequirement.getProjectId()); - tag1 = createTag(tag1); + tag.setProjectId(modifiedRequirement.getProjectId()); + tag = createTag(tag); } - tagRequirement(tag1.getId(), modifiedRequirement.getId()); + tagRequirement(tag.getId(), modifiedRequirement.getId()); } catch (Exception e) { e.printStackTrace(); } From b12df2f869222d925b52960f8204f5ccd2927ebb Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 29 May 2021 16:08:38 +0200 Subject: [PATCH 102/134] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 898ca704..145f617a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,8 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas - Redacted comments now have a deleted flag [#103](https://github.com/rwth-acis/RequirementsBazaar/pull/103). - Added a user dashboard listing the last 10 most recent active followed projects, categories and requirements [#106](https://github.com/rwth-acis/RequirementsBazaar/pull/106). +- Requirements can now have arbitrary tags next to the categories. Tags are a project scoped + entity [#108](https://github.com/rwth-acis/RequirementsBazaar/pull/108). ### Changed From 97fd07af70dbf3810e30ddfd63673e8cf17c728d Mon Sep 17 00:00:00 2001 From: Thore Date: Tue, 1 Jun 2021 16:56:36 +0200 Subject: [PATCH 103/134] Add additional properties for projects, categories and requirements. --- .../bazaar/service/dal/entities/Category.java | 7 ++++ .../bazaar/service/dal/entities/Project.java | 7 ++++ .../service/dal/entities/Requirement.java | 7 ++++ .../dal/transform/CategoryTransformer.java | 39 ++++++++++++----- .../dal/transform/ProjectTransformer.java | 42 ++++++++++++++----- .../dal/transform/RequirementTransformer.java | 40 ++++++++++++------ .../V14__entity_json_properties.sql | 8 ++++ .../dbis/acis/bazaar/service/BazaarTest.java | 18 ++++---- 8 files changed, 126 insertions(+), 42 deletions(-) create mode 100644 reqbaz/src/main/resources/migrations/V14__entity_json_properties.sql diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java index 7b2d9b6a..a9090edb 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java @@ -22,7 +22,9 @@ import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.JsonNode; import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreateValidation; +import io.swagger.annotations.ApiModelProperty; import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; @@ -71,6 +73,11 @@ public class Category extends EntityBase implements Ownable { private UserContext userContext; + @ApiModelProperty( + dataType = "java.util.Map" + ) + private JsonNode additionalProperties; + @Override public boolean isOwner(User user) { return creator == user; diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java index bdabfc06..7fa69c13 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java @@ -21,7 +21,9 @@ package de.rwth.dbis.acis.bazaar.service.dal.entities; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.JsonNode; import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreateValidation; +import io.swagger.annotations.ApiModelProperty; import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; @@ -71,6 +73,11 @@ public class Project extends EntityBase implements Ownable { private UserContext userContext; + @ApiModelProperty( + dataType = "java.util.Map" + ) + private JsonNode additionalProperties; + @Override public boolean isOwner(User user) { return leader.equals(user); diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java index 5efceafe..eb8a18b3 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java @@ -3,7 +3,9 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreateValidation; +import io.swagger.annotations.ApiModelProperty; import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; @@ -73,6 +75,11 @@ public class Requirement extends EntityBase implements Ownable { private UserContext userContext; + @ApiModelProperty( + dataType = "java.util.Map" + ) + private JsonNode additionalProperties; + @JsonProperty("_context") private EntityContext context; diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java index 49456da7..65f6cc07 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java @@ -20,6 +20,9 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.PropertyNamingStrategy; import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.CategoryRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Category; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; @@ -31,7 +34,8 @@ import java.util.*; import static de.rwth.dbis.acis.bazaar.dal.jooq.Routines.udfNaturalsortformat; -import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.CATEGORY; +import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.CATEGORY_FOLLOWER_MAP; import static org.jooq.impl.DSL.val; /** @@ -46,19 +50,35 @@ public CategoryRecord createRecord(Category entry) { record.setProjectId(entry.getProjectId()); record.setLeaderId(entry.getCreator().getId()); record.setCreationDate(LocalDateTime.now()); + if (entry.getAdditionalProperties() != null) { + record.setAdditionalProperties(JSON.json(entry.getAdditionalProperties().toString())); + } return record; } @Override public Category getEntityFromTableRecord(CategoryRecord record) { - return Category.builder() + ObjectMapper mapper = new ObjectMapper(); + mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + + Category.Builder categoryBuilder = Category.builder() .name(record.getName()) .description(record.getDescription()) .projectId(record.getProjectId()) .id(record.getId()) .creationDate(record.getCreationDate()) - .lastUpdatedDate(record.getLastUpdatedDate()) - .build(); + .lastUpdatedDate(record.getLastUpdatedDate()); + + try { + return categoryBuilder + .additionalProperties( + mapper.readTree(record.getAdditionalProperties().data()) + ) + .build(); + } catch (Exception e) { + return categoryBuilder.build(); + } } @Override @@ -77,8 +97,8 @@ public Class getRecordClass() { } @Override - public Map getUpdateMap(final Category entry) { - HashMap updateMap = new HashMap() {{ + public Map getUpdateMap(Category entry) { + HashMap updateMap = new HashMap<>() {{ if (entry.getDescription() != null) { put(CATEGORY.DESCRIPTION, entry.getDescription()); } @@ -187,9 +207,7 @@ public Collection getFilterConditions(Map f conditions.add( CATEGORY.LEADER_ID.eq(Integer.parseInt(filterEntry.getValue())) ); - }else - - if(filterEntry.getKey().equals("following")){ + } else if (filterEntry.getKey().equals("following")) { conditions.add( CATEGORY.ID.in( DSL.select(CATEGORY_FOLLOWER_MAP.CATEGORY_ID) @@ -197,8 +215,7 @@ public Collection getFilterConditions(Map f .where(CATEGORY_FOLLOWER_MAP.USER_ID.eq(Integer.parseInt(filterEntry.getValue()))) ) ); - } - else{ + } else { conditions.add(DSL.falseCondition()); } } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java index de40bb29..34e647e3 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java @@ -20,6 +20,9 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.PropertyNamingStrategy; import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.ProjectRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Project; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; @@ -45,20 +48,36 @@ public ProjectRecord createRecord(Project entry) { record.setVisibility(entry.getVisibility()); record.setDefaultCategoryId(entry.getDefaultCategoryId()); record.setCreationDate(LocalDateTime.now()); + if (entry.getAdditionalProperties() != null) { + record.setAdditionalProperties(JSON.json(entry.getAdditionalProperties().toString())); + } return record; } @Override public Project getEntityFromTableRecord(ProjectRecord record) { - return Project.builder() + ObjectMapper mapper = new ObjectMapper(); + mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + + Project.Builder projectBuilder = Project.builder() .name(record.getName()) .description(record.getDescription()) .id(record.getId()) .defaultCategoryId(record.getDefaultCategoryId()) .visibility(record.getVisibility()) .creationDate(record.getCreationDate()) - .lastUpdatedDate(record.getLastUpdatedDate()) - .build(); + .lastUpdatedDate(record.getLastUpdatedDate()); + + try { + return projectBuilder + .additionalProperties( + mapper.readTree(record.getAdditionalProperties().data()) + ) + .build(); + } catch (Exception e) { + return projectBuilder.build(); + } } @Override @@ -77,8 +96,8 @@ public Class getRecordClass() { } @Override - public Map getUpdateMap(final Project entry) { - HashMap updateMap = new HashMap() {{ + public Map getUpdateMap(Project entry) { + HashMap updateMap = new HashMap<>() {{ if (entry.getDescription() != null) { put(PROJECT.DESCRIPTION, entry.getDescription()); } @@ -94,6 +113,9 @@ public Map getUpdateMap(final Project entry) { if (entry.getVisibility() != null) { put(PROJECT.VISIBILITY, entry.getVisibility()); } + if (entry.getAdditionalProperties() != null) { + put(PROJECT.ADDITIONAL_PROPERTIES, entry.getAdditionalProperties()); + } }}; if (!updateMap.isEmpty()) { updateMap.put(PROJECT.LAST_UPDATED_DATE, LocalDateTime.now()); @@ -185,16 +207,15 @@ public Condition getSearchCondition(String search) throws Exception { public Collection getFilterConditions(Map filters) throws Exception { List conditions = new ArrayList<>(); for (Map.Entry filterEntry : filters.entrySet()) { - if(filterEntry.getKey().equals("all")){ + if (filterEntry.getKey().equals("all")) { conditions.add( DSL.trueCondition() ); - }else - if (filterEntry.getKey().equals("created")) { + } else if (filterEntry.getKey().equals("created")) { conditions.add( PROJECT.LEADER_ID.eq(Integer.parseInt(filterEntry.getValue())) ); - }else if(filterEntry.getKey().equals("following")){ + } else if (filterEntry.getKey().equals("following")) { conditions.add( PROJECT.ID.in( DSL.select(PROJECT_FOLLOWER_MAP.PROJECT_ID) @@ -202,8 +223,7 @@ public Collection getFilterConditions(Map f .where(PROJECT_FOLLOWER_MAP.USER_ID.eq(Integer.parseInt(filterEntry.getValue()))) ) ); - } - else{ + } else { conditions.add(DSL.falseCondition()); } } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java index 7d705a5f..3ce523f3 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java @@ -20,6 +20,9 @@ package de.rwth.dbis.acis.bazaar.service.dal.transform; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.PropertyNamingStrategy; import de.rwth.dbis.acis.bazaar.dal.jooq.tables.records.RequirementRecord; import de.rwth.dbis.acis.bazaar.service.dal.entities.Requirement; import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; @@ -43,17 +46,34 @@ public RequirementRecord createRecord(Requirement entry) { record.setCreationDate(LocalDateTime.now()); record.setCreatorId(entry.getCreator().getId()); record.setProjectId(entry.getProjectId()); + if (entry.getAdditionalProperties() != null) { + record.setAdditionalProperties(JSON.json(entry.getAdditionalProperties().toString())); + } return record; } public Requirement.Builder mapToEntityBuilder(RequirementRecord record) { - return Requirement.builder().name(record.getName()) + ObjectMapper mapper = new ObjectMapper(); + mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + + Requirement.Builder requirementBuilder = Requirement.builder() + .name(record.getName()) .description(record.getDescription()) .id(record.getId()) .realized(record.getRealized()) .creationDate(record.getCreationDate()) .lastUpdatedDate(record.getLastUpdatedDate()) .projectId(record.getProjectId()); + + try { + return requirementBuilder + .additionalProperties( + mapper.readTree(record.getAdditionalProperties().data()) + ); + } catch (Exception e) { + return requirementBuilder; + } } @Override @@ -78,8 +98,8 @@ public Class getRecordClass() { } @Override - public Map getUpdateMap(final Requirement entry) { - HashMap updateMap = new HashMap() {{ + public Map getUpdateMap(Requirement entry) { + HashMap updateMap = new HashMap<>() {{ if (entry.getDescription() != null) { put(REQUIREMENT.DESCRIPTION, entry.getDescription()); } @@ -172,15 +192,11 @@ public Collection getFilterConditions(Map f if (filterEntry.getValue().equals("open")) { conditions.add(REQUIREMENT.REALIZED.isNull()); } - }else - - if (filterEntry.getKey().equals("created")) { + } else if (filterEntry.getKey().equals("created")) { conditions.add( REQUIREMENT.CREATOR_ID.eq(Integer.parseInt(filterEntry.getValue())) ); - }else - - if(filterEntry.getKey().equals("following")){ + } else if (filterEntry.getKey().equals("following")) { conditions.add( REQUIREMENT.ID.in( DSL.select(REQUIREMENT_FOLLOWER_MAP.REQUIREMENT_ID) @@ -188,9 +204,7 @@ public Collection getFilterConditions(Map f .where(REQUIREMENT_FOLLOWER_MAP.USER_ID.eq(Integer.parseInt(filterEntry.getValue()))) ) ); - }else - - if(filterEntry.getKey().equals("developing")){ + } else if (filterEntry.getKey().equals("developing")) { conditions.add( REQUIREMENT.ID.in( DSL.select(REQUIREMENT_DEVELOPER_MAP.REQUIREMENT_ID) @@ -200,7 +214,7 @@ public Collection getFilterConditions(Map f REQUIREMENT.LEAD_DEVELOPER_ID.eq(Integer.parseInt(filterEntry.getValue())) ) ); - }else{ + } else { conditions.add( DSL.falseCondition() ); diff --git a/reqbaz/src/main/resources/migrations/V14__entity_json_properties.sql b/reqbaz/src/main/resources/migrations/V14__entity_json_properties.sql new file mode 100644 index 00000000..9b02bf21 --- /dev/null +++ b/reqbaz/src/main/resources/migrations/V14__entity_json_properties.sql @@ -0,0 +1,8 @@ +ALTER TABLE reqbaz.project + ADD COLUMN additional_properties JSON; + +ALTER TABLE reqbaz.category + ADD COLUMN additional_properties JSON; + +ALTER TABLE reqbaz.requirement + ADD COLUMN additional_properties JSON; diff --git a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index 020216d8..360cb2a0 100644 --- a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -78,7 +78,7 @@ public void testCreateProject() { try { MiniClient client = getClient(); - String testProject = "{\"name\": \"Test Project\", \"description\": \"A test Project\"}"; + String testProject = "{\"name\": \"Test Project\", \"description\": \"A test Project\", \"additionalProperties\": {\"testProperty\": \"test\"}}"; ClientResponse result = client.sendRequest("POST", mainPath + "projects", testProject, MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, new HashMap<>()); System.out.println(result.toString()); @@ -91,6 +91,7 @@ public void testCreateProject() { // gson doesn't remove the quotes assertTrue(isValidISO8601(response.get("creationDate").toString().replace("\"", ""))); assertTrue(response.has("userContext")); + assertTrue(response.has("additionalProperties")); JsonObject userContext = response.getAsJsonObject("userContext"); assertTrue(userContext.has("userRole")); @@ -165,7 +166,7 @@ public void testCategories() { MiniClient client = getClient(); MiniClient adminClient = getAdminClient(); - String testCategory = "{\"name\": \"Test Category\", \"description\": \"A test category\", \"projectId\":" + testProject.getId() + "}"; + String testCategory = "{\"name\": \"Test Category\", \"description\": \"A test category\", \"additionalProperties\": {\"testProperty\": \"test\"}, \"projectId\":" + testProject.getId() + "}"; String path = mainPath + "categories"; // Plebs --> no permission @@ -190,11 +191,13 @@ public void testCategories() { assertTrue(resp.isJsonArray()); assertEquals(2, resp.getAsJsonArray().size()); - JsonObject createdRequirement = resp.getAsJsonArray().get(1).getAsJsonObject(); + JsonObject createdCategory = resp.getAsJsonArray().get(1).getAsJsonObject(); - assertTrue(createdRequirement.has("lastActivity")); - assertTrue(isValidISO8601(createdRequirement.get("creationDate").toString().replace("\"", ""))); - assertTrue(isValidISO8601(createdRequirement.get("lastActivity").toString().replace("\"", ""))); + assertTrue(createdCategory.has("lastActivity")); + assertTrue(createdCategory.has("additionalProperties")); + + assertTrue(isValidISO8601(createdCategory.get("creationDate").toString().replace("\"", ""))); + assertTrue(isValidISO8601(createdCategory.get("lastActivity").toString().replace("\"", ""))); } catch (Exception e) { e.printStackTrace(); @@ -210,7 +213,7 @@ public void testRequirements() { try { MiniClient client = getClient(); - String testRequirement = String.format("{\"name\": \"Test Requirements\", \"description\": \"A test requirement\", \"categories\": [%s], \"projectId\": \"%s\", \"tags\": [{\"name\": \"CreateTest\", \"colour\": \"#FFFFFF\"}]}", testProject.getDefaultCategoryId(), testProject.getId()); + String testRequirement = String.format("{\"name\": \"Test Requirements\", \"description\": \"A test requirement\", \"categories\": [%s], \"projectId\": \"%s\", \"tags\": [{\"name\": \"CreateTest\", \"colour\": \"#FFFFFF\"}], \"additionalProperties\": {\"testProperty\": \"test\"}}", testProject.getDefaultCategoryId(), testProject.getId()); ClientResponse result = client.sendRequest("POST", mainPath + "requirements", testRequirement, MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, new HashMap<>()); assertEquals(201, result.getHttpCode()); @@ -229,6 +232,7 @@ public void testRequirements() { JsonObject createdRequirement = resp.getAsJsonArray().get(1).getAsJsonObject(); assertTrue(createdRequirement.has("lastActivity")); + assertTrue(createdRequirement.has("additionalProperties")); assertTrue(isValidISO8601(createdRequirement.get("creationDate").toString().replace("\"", ""))); assertTrue(isValidISO8601(createdRequirement.get("lastActivity").toString().replace("\"", ""))); From c3b04c648ece7b103a7e4eeec02277d3b986b860 Mon Sep 17 00:00:00 2001 From: Thore Date: Tue, 1 Jun 2021 17:00:58 +0200 Subject: [PATCH 104/134] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 145f617a..d4ff6913 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,8 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas requirements [#106](https://github.com/rwth-acis/RequirementsBazaar/pull/106). - Requirements can now have arbitrary tags next to the categories. Tags are a project scoped entity [#108](https://github.com/rwth-acis/RequirementsBazaar/pull/108). +- Projects, categories and requirements now have an `additionalProperties` object which allows storing and providing + additional context as plain json [#109](https://github.com/rwth-acis/RequirementsBazaar/pull/109). ### Changed From 38ca3fb884d15c4c86803a8501db4ec1e3217d34 Mon Sep 17 00:00:00 2001 From: Thore Date: Tue, 1 Jun 2021 17:06:27 +0200 Subject: [PATCH 105/134] Allow additionalProperties updates --- .../acis/bazaar/service/dal/transform/CategoryTransformer.java | 3 +++ .../bazaar/service/dal/transform/RequirementTransformer.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java index 65f6cc07..2bd918bd 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java @@ -108,6 +108,9 @@ public Map getUpdateMap(Category entry) { if (entry.getCreator() != null) { put(CATEGORY.LEADER_ID, entry.getCreator().getId()); } + if (entry.getAdditionalProperties() != null) { + put(CATEGORY.ADDITIONAL_PROPERTIES, entry.getAdditionalProperties()); + } }}; if (!updateMap.isEmpty()) { updateMap.put(CATEGORY.LAST_UPDATED_DATE, LocalDateTime.now()); diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java index 3ce523f3..8f5e71a6 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java @@ -106,6 +106,9 @@ public Map getUpdateMap(Requirement entry) { if (entry.getName() != null) { put(REQUIREMENT.NAME, entry.getName()); } + if (entry.getAdditionalProperties() != null) { + put(REQUIREMENT.ADDITIONAL_PROPERTIES, entry.getAdditionalProperties()); + } }}; if (!updateMap.isEmpty()) { updateMap.put(REQUIREMENT.LAST_UPDATED_DATE, LocalDateTime.now()); From eccb9a048fe3cbe42f482848dd23973ae249e36d Mon Sep 17 00:00:00 2001 From: Thore Date: Sun, 13 Jun 2021 13:38:16 +0200 Subject: [PATCH 106/134] Update readme --- README.md | 114 +++++++++++++++++++++++++++--------------------------- 1 file changed, 58 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index 9b31ec71..56db0f0b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ -Requirements Bazaar -=================== +# Requirements Bazaar + +## Idea -Idea -------------------- In years of research at RWTH Aachen we have developed and actually operated an **Open Innovation Platform for gathering requirements** for prototypes in large international academic projects. The last version of the current product is available under http://requirements-bazaar.org . End-users can enter their requirements by providing short descriptions including user stories, screenshots and other images. The requirements can then be shared amongst its users. On the other side of the chain, developers may take up ideas and transfer the accepted requirements to an issue system like JIRA. Over the last years it turned out that people want more lightweight and mobile-friendly tools; we found the old monolithic system to be very hard to maintain to add new features. Therefore we are currently redeveloping it from scratch integrating many ideas from our users and incorporating new research findings. We are further driven by a mobile-first approach to support a wide variety of devices. We additionally want to support various social features like sharing on social networks or blogs and allowing discussions and rating amongst end-users and developers. @@ -15,52 +14,50 @@ The service is under development. You can participate by creating pull requests More information about our microservice ecosystem is explained in our **[Requirements-Bazaar wiki on Github](https://github.com/rwth-acis/RequirementsBazaar/wiki)**. ----------- +--- + +## Service Documentation -Service Documentation -------------------- We use **[Swagger](http://swagger.io/specification/)** for documenting this microservice. You can use **[Swagger UI](http://swagger.io/swagger-ui/)** to inspect the API. Please use our deployed **[Swagger UI instance](https://requirements-bazaar.org/docs)** to inspect our API. You can authorize yourself via Oauth 2.0 by clicking at the `Authorize` button at the top. After you are authorized you can try out all the API calls directly from Swagger UI. -To try out one API call open one method, fill the parameters and click `Try it out!`. The Swagger UI instance is connected to our development environment where we test nex features. So feel free to play around. +To try out one API call open one method, fill the parameters and click `Try it out!`. The Swagger UI instance is also connected to our development environment where we test nex features. You can select this in the dropdown menu at the top. Feel free to play around there. API documentation endpoints: - `baseURL/bazaar/swagger.json` ----------- +--- + +## Technology -Technology -------------------- Requirements bazaar itself is a web application, which is separated to a client-only side and a back-end side. This GitHub repo holds the codebase of the back-end side only. If you are looking for the front-end, take a look at this GitHub project: **[Requirement Bazaar Web Frontend](https://github.com/rwth-acis/RequirementsBazaar-WebFrontend)** -The backend is built on Java technologies. As a service framework we use our in-house developed **[las2peer](https://github.com/rwth-acis/LAS2peer)** project. For persisting our data we use MySQL database and jOOQ to access it. User input validation is done using Jodd Vtor library and for serializing our data into JSON format, we use the Jackson library. +The backend is built on Java technologies. As a service framework we use our in-house developed **[las2peer](https://github.com/rwth-acis/LAS2peer)** project. For persisting our data we use a MySQL database and jOOQ to access it and for serializing our data into JSON format, we use the Jackson library. + +## Dependencies -Dependencies -------------------- In order to be able to run this service project the following components should be installed on your system: - - JDK (min v1.8) + Java Cryptography Extension (JCE) - - MySQL 5.7 - - Apache Ant to build - -How to set up the database -------------------- - 1. `git clone` this repo - 2. To configure your database access look at the [Configuration](#configuration) section - 3. Compile the project with `ant` - 4. Create a new database called `reqbaz`, possibly with UTF-8 collation - 5. Run `ant migrate-db` to create your db schema or migrate to a newer version while updating your service - 6. If you need sample data run the file `\etc\add_reqbaz_demo_data.sql` or `\etc\add_reqbaz_demo_data_full.sql` - -Configuration -------------------- + - JDK 14 + - MySQL 5.7 (better 8) + - Gradle to build + +## How to set up the database (non developer guide) + + 1. Download a release bundle from [GitHub](https://github.com/rwth-acis/RequirementsBazaar/releases) + 2. Create a new database called `reqbaz`, possibly with UTF-8 collation + 3. To configure your database access look at the [Configuration](#configuration) section + 4. Use flyway to migrate the database + +## Configuration + You need to configure this service to work with your own specific environment. Here is the list of configuration variables: `\etc\de.rwth.dbis.acis.bazaar.service.BazaarService.properties`: - `dbUserName`: A database user's name, which will be used to access the database - `dbPassword`: The database user's password - `dbUrl`: JDBC Connection string to access the database. Modify it if you have changed the name of your database - - `land`: Default language setting + - `lang`: Default language setting - `country`: Default country setting - `baseURL`: Base URL this service runs on - `frontendBaseURL`: Base URL for the frontend which uses Requirements-Bazaar service @@ -71,38 +68,43 @@ You need to configure this service to work with your own specific environment. H For other configuration settings, check the **[las2peer](https://github.com/rwth-acis/LAS2peer)** project. -Build -------------------- -For build management we use Ant. To build the cloned code, please using a console/terminal navigate to the home directory, where the build.xml file is located and run the following commands: +### How to run + 1. First please make sure you have already [set up the database](#how-to-set-up-the-database). + 2. Make sure your [config settings](#configuration) are properly set. + 3. When not using a release asset, check [Building](#building). + 4. Open a console/terminal window and navigate to the project directory. + 5. Run the `bin\start_network.bat` or `bin/start_network.sh` script. - - `ant` - -You can also generate a bundled jar with all the dependencies with the command - - - `ant jar-big` +--- -How to run -------------------- - 1. First please make sure you have already [set up the database](#how-to-set-up-the-database) - 2. Make sure your [config settings](#configuration) are properly set. - 3. [Build](#build) - 4. Open a console/terminal window and navigate to the project directory - 5. Run the `bin\start_network.bat` or `bin/start_network.sh` script +## Developer guide + +### Prerequisites + +Building and testing requires a database which will be cleaned on every build. + +Set the credentials for this database in the gradle.properties and in the `reqbaz/etc` folder. +This configuration folder is relevant for any testing related settings. + +In the `etc` folder on top level you may configure a different database if you want to distinguish between local testing and automated testing. +However you'll have to apply the migrations with flyway manually to this database. + +### Building + +The build and test process is done with gradle. A simple `gradle build` should be sufficient to build the project and run the test cases. + +You may have to adjust either your global java environment or the one in your IDE to use Java 14 or the built asset won't start. + +### Debugging + +Add the debugger parameters below to your startscript and set up your IDE to connect to a remote debugging port. - How to run using Docker - ------------------- - Docker is providing the simplest way to run the Requirement Bazaar back-end. Just follow the following steps if Docker is already installed on your system: +`-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5433`. - 1. `git clone` this repo - 2. `cd` into the cloned repo - 3. `docker build -t rwthacis/reqbaz-service .` - 4. `docker run -i -t --rm -v "$(pwd)":/build rwthacis/reqbaz-service` +Now you should be able to set breakpoints and inspect the runtime. ----------- +## Troubleshooting & FAQ -Troubleshooting & FAQ -------------------- - - I get Java encryption errors: Did you install Java Cryptography Extension? - I can not run the start script: Check if you have OS permission to run the file. - The service does not start: Check if all jars in the lib and service folder are readable. - The start script seems broken: Check if the start script has the correct encoding. If you ran the service on Unix use `dos2unix` to change the encoding. From 5eac7cbc284f903b6a654f9dc07a77cb27e2aa54 Mon Sep 17 00:00:00 2001 From: Thore Date: Sun, 20 Jun 2021 02:42:59 +0200 Subject: [PATCH 107/134] Liquibase and postgres introduction changes --- reqbaz/build.gradle | 51 +- ...is.bazaar.service.BazaarService.properties | 6 +- .../acis/bazaar/service/BazaarService.java | 324 ++- .../RequirementRepositoryImpl.java | 6 +- .../dal/repositories/RoleRepositoryImpl.java | 11 +- .../dal/transform/CategoryTransformer.java | 8 +- .../dal/transform/ProjectTransformer.java | 8 +- .../dal/transform/RequirementTransformer.java | 8 +- .../src/main/resources/base-permissions.sql | 105 + reqbaz/src/main/resources/changelog.yaml | 1737 +++++++++++++++++ .../bazaar/service/helpers/SetupData.java | 8 +- 11 files changed, 2065 insertions(+), 207 deletions(-) create mode 100644 reqbaz/src/main/resources/base-permissions.sql create mode 100644 reqbaz/src/main/resources/changelog.yaml diff --git a/reqbaz/build.gradle b/reqbaz/build.gradle index 4a31eb21..0e272980 100644 --- a/reqbaz/build.gradle +++ b/reqbaz/build.gradle @@ -23,6 +23,7 @@ plugins { id "io.freefair.lombok" version "5.3.0" id 'com.github.ben-manes.versions' version '0.38.0' id 'jacoco' + id 'org.liquibase.gradle' version '2.0.3' } application { @@ -52,10 +53,16 @@ dependencies { // Use JUnit test framework. testImplementation 'junit:junit:4.13' + liquibaseRuntime 'org.liquibase:liquibase-core:3.8.1' + liquibaseRuntime 'org.yaml:snakeyaml:1.15' + liquibaseRuntime 'org.postgresql:postgresql:42.2.12' + liquibaseRuntime 'javax.xml.bind:jaxb-api:2.3.1' + // las2peer bundle which is not necessary in the runtime path // compileOnly will be moved into the lib dir afterwards compileOnly "i5:las2peer-bundle:${project.property('core.version')}" compileOnly "mysql:mysql-connector-java:${project.property('mysql.version')}" + compileOnly 'org.postgresql:postgresql:42.2.12' compileOnly 'org.hibernate:hibernate-validator:5.4.3.Final' compileOnly 'org.glassfish:jakarta.el:3.0.3' compileOnly 'javax.validation:validation-api:1.1.0.Final' @@ -63,6 +70,7 @@ dependencies { // This is for the jooq generation only jooqGenerator "mysql:mysql-connector-java:${project.property('mysql.version')}" jooqGenerator "org.jooq:jooq-codegen:${project.property('jooq.version')}" + jooqGenerator 'org.postgresql:postgresql:42.2.12' implementation "org.flywaydb:flyway-core:7.7.1" implementation 'com.google.code.gson:gson:2.8.6' @@ -151,22 +159,22 @@ jooq { generationTool { logging = org.jooq.meta.jaxb.Logging.WARN jdbc { - driver = 'com.mysql.cj.jdbc.Driver' - url = "jdbc:mysql://${project.property('db.hostname')}:${project.property('db.port')}/${project.property('db.name')}" - user = "${project.property('db.user')}" - password = "${project.property('db.password')}" + driver = 'org.postgresql.Driver' + url = "jdbc:postgresql://localhost:5432/reqbaz" + user = "reqbaz" + password = "reqbaz" } generator { name = 'org.jooq.codegen.DefaultGenerator' database { - name = 'org.jooq.meta.mysql.MySQLDatabase' - inputSchema = "${project.property('db.name')}" - forcedTypes { - forcedType { - name = 'BOOLEAN' - includeTypes = '(?i:TINYINT\\(1\\))' - } - } + name = 'org.jooq.meta.postgres.PostgresDatabase' + inputSchema = "reqbaz" +// forcedTypes { +// forcedType { +// name = 'BOOLEAN' +// includeTypes = '(?i:TINYINT\\(1\\))' +// } +// } } generate { deprecated = false @@ -195,11 +203,24 @@ flyway { locations = ["filesystem:$project.projectDir/src/main/resources/migrations"] } -generateJooq.dependsOn flywayClean -generateJooq.dependsOn flywayMigrate +// liquibase migrations +generateJooq.dependsOn dropAll +generateJooq.dependsOn update + +liquibase { + activities { + main { + changeLogFile "$projectDir/src/main/resources/changelog.yaml" + url "jdbc:postgresql://localhost:5432/reqbaz" + username 'reqbaz' + password 'reqbaz' + } + } +} + // Build export directory which can be shipped on request -task export (type: Copy, dependsOn: build) { +task export(type: Copy, dependsOn: build) { into "$buildDir/export" into("service") { diff --git a/reqbaz/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties b/reqbaz/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties index 4ce290bd..194a91bb 100644 --- a/reqbaz/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties +++ b/reqbaz/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties @@ -1,6 +1,6 @@ -dbUserName=root -dbPassword=rootpw -dbUrl=jdbc:mysql://localhost:3306/reqbaz +dbUserName=reqbaz +dbPassword=reqbaz +dbUrl=jdbc:postgresql://localhost:5432/reqbaz lang=en country=us baseURL=http://localhost:8080/bazaar/ diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java index b56fdbef..6bb41795 100755 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java @@ -83,6 +83,12 @@ @ServicePath("/bazaar") public class BazaarService extends RESTService { + private static final ObjectMapper mapper = new ObjectMapper().registerModule(new JavaTimeModule()).setSerializationInclusion(JsonInclude.Include.NON_NULL); + private final L2pLogger logger = L2pLogger.getInstance(BazaarService.class.getName()); + private final ValidatorFactory validatorFactory; + private final List functionRegistrar; + private final NotificationDispatcher notificationDispatcher; + private final DataSource dataSource; //CONFIG PROPERTIES protected String dbUserName; protected String dbPassword; @@ -97,27 +103,6 @@ public class BazaarService extends RESTService { protected String emailFromAddress; protected String emailSummaryTimePeriodInMinutes; - private ValidatorFactory validatorFactory; - private List functionRegistrar; - private NotificationDispatcher notificationDispatcher; - private DataSource dataSource; - - private final L2pLogger logger = L2pLogger.getInstance(BazaarService.class.getName()); - private static ObjectMapper mapper = new ObjectMapper().registerModule(new JavaTimeModule()).setSerializationInclusion(JsonInclude.Include.NON_NULL); - - @Override - protected void initResources() { - getResourceConfig().register(Resource.class); - getResourceConfig().register(ProjectsResource.class); - getResourceConfig().register(CategoryResource.class); - getResourceConfig().register(RequirementsResource.class); - getResourceConfig().register(CommentsResource.class); - getResourceConfig().register(AttachmentsResource.class); - getResourceConfig().register(UsersResource.class); - //getResourceConfig().register(PersonalisationDataResource.class); - getResourceConfig().register(FeedbackResource.class); - } - public BazaarService() throws Exception { setFieldValues(); Locale locale = new Locale(lang, country); @@ -173,136 +158,32 @@ public BazaarService() throws Exception { notificationDispatcher.setBazaarService(this); } - public String getBaseURL() { - return baseURL; + public static DataSource setupDataSource(String dbUrl, String dbUserName, String dbPassword) { + BasicDataSource dataSource = new BasicDataSource(); + dataSource.setUrl(dbUrl); + dataSource.setUsername(dbUserName); + dataSource.setPassword(dbPassword); + dataSource.setValidationQuery("SELECT 1;"); + dataSource.setTestOnBorrow(true); // test each connection when borrowing from the pool with the validation query + dataSource.setMaxConnLifetimeMillis(1000 * 60 * 60); // max connection life time 1h. mysql drops connection after 8h. + return dataSource; } + @Override + protected void initResources() { + getResourceConfig().register(Resource.class); + getResourceConfig().register(ProjectsResource.class); + getResourceConfig().register(CategoryResource.class); + getResourceConfig().register(RequirementsResource.class); + getResourceConfig().register(CommentsResource.class); + getResourceConfig().register(AttachmentsResource.class); + getResourceConfig().register(UsersResource.class); + //getResourceConfig().register(PersonalisationDataResource.class); + getResourceConfig().register(FeedbackResource.class); + } - @Api(value = "/", description = "Bazaar service") - @SwaggerDefinition( - info = @Info( - title = "Requirements Bazaar", - version = "0.9.0", - description = "Requirements Bazaar project", - termsOfService = "http://requirements-bazaar.org", - contact = @Contact( - name = "Requirements Bazaar Dev Team", - url = "http://requirements-bazaar.org", - email = "info@requirements-bazaar.org" - ), - license = @License( - name = "Apache2", - url = "http://requirements-bazaar.org/license" - ) - ), - schemes = SwaggerDefinition.Scheme.HTTPS - ) - @Path("/") - public static class Resource { - - private final BazaarService bazaarService = (BazaarService) Context.getCurrent().getService(); - - /** - * This method allows to retrieve the service name version. - * - * @return Response with service name version as a JSON object. - */ - @GET - @Path("/version") - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "This method allows to retrieve the service name version.") - @ApiResponses(value = { - @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns service name version"), - @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") - }) - public Response getServiceNameVersion() { - try { - String serviceNameVersion = Context.getCurrent().getService().getAgent().getServiceNameVersion().toString(); - return Response.ok("{\"version\": \"" + serviceNameVersion + "\"}").build(); - } catch (ServiceException ex) { - BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); - Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get service name version failed"); - bazaarService.logger.warning(bex.getMessage()); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } - } - - /** - * This method allows to retrieve statistics over all projects. - * - * @param since timestamp since filter, ISO-8601 e.g. 2017-12-30 or 2017-12-30T18:30:00Z - * @return Response with statistics as a JSON object. - */ - @GET - @Path("/statistics") - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "This method allows to retrieve statistics over all projects.") - @ApiResponses(value = { - @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns statistics", response = Statistic.class), - @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), - @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") - }) - public Response getStatistics( - @ApiParam(value = "Since timestamp, ISO-8601 e.g. 2017-12-30 or 2017-12-30T18:30:00Z", required = false) @QueryParam("since") String since) { - DALFacade dalFacade = null; - try { - String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); - if (registrarErrors != null) { - ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); - } - Agent agent = Context.getCurrent().getMainAgent(); - String userId = agent.getIdentifier(); - dalFacade = bazaarService.getDBConnection(); - Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); - Calendar sinceCal = since == null ? null : DatatypeConverter.parseDateTime(since); - Statistic platformStatistics = dalFacade.getStatisticsForAllProjects(internalUserId, sinceCal); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_2, - 0, Activity.DataType.STATISTIC, internalUserId); - return Response.ok(platformStatistics.toJSON()).build(); - } catch (BazaarException bex) { - if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { - return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { - return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } else { - bazaarService.logger.warning(bex.getMessage()); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } - } catch (Exception ex) { - BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); - Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get statistics failed"); - bazaarService.logger.warning(bex.getMessage()); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } finally { - bazaarService.closeDBConnection(dalFacade); - } - } - - /** - * This method sends all notifications (emails) in the waiting queue. Run this method before shutting down Requirements Bazaar. - * - * @return Response - */ - @POST - @Path("/notifications") - @ApiOperation(value = "This method sends all notifications (emails) in the waiting queue. Run this method before shutting down Requirements Bazaar.") - @ApiResponses(value = { - @ApiResponse(code = HttpURLConnection.HTTP_CREATED, message = "Notifications send"), - @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), - @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") - }) - public Response sendNotifications() { - // TODO: Use authorization scopes to limit users who can run this method to admins - try { - bazaarService.notificationDispatcher.run(); - return Response.status(Response.Status.CREATED).build(); - } catch (Exception ex) { - BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); - Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Send Notifications failed"); - bazaarService.logger.warning(bex.getMessage()); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } - } + public String getBaseURL() { + return baseURL; } public String notifyRegistrars(EnumSet functions) { @@ -386,26 +267,14 @@ private void registerUserAtFirstLogin() throws Exception { } } - public static DataSource setupDataSource(String dbUrl, String dbUserName, String dbPassword) { - BasicDataSource dataSource = new BasicDataSource(); - // Deprecated according to jooq - // dataSource.setDriverClassName("com.mysql.jdbc.Driver"); - dataSource.setUrl(dbUrl + "?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true" + - ""); - dataSource.setUsername(dbUserName); - dataSource.setPassword(dbPassword); - dataSource.setValidationQuery("SELECT 1;"); - dataSource.setTestOnBorrow(true); // test each connection when borrowing from the pool with the validation query - dataSource.setMaxConnLifetimeMillis(1000 * 60 * 60); // max connection life time 1h. mysql drops connection after 8h. - return dataSource; - } - public DALFacade getDBConnection() throws Exception { // TODO: Specify Exception - return new DALFacadeImpl(dataSource, SQLDialect.MYSQL); + return new DALFacadeImpl(dataSource, SQLDialect.POSTGRES); } public void closeDBConnection(DALFacade dalFacade) { - if (dalFacade == null) return; + if (dalFacade == null) { + return; + } dalFacade.close(); } @@ -448,4 +317,131 @@ public Response.ResponseBuilder xHeaderFields(Response.ResponseBuilder responseB return responseBuilder; } + @Api(value = "/", description = "Bazaar service") + @SwaggerDefinition( + info = @Info( + title = "Requirements Bazaar", + version = "0.9.0", + description = "Requirements Bazaar project", + termsOfService = "http://requirements-bazaar.org", + contact = @Contact( + name = "Requirements Bazaar Dev Team", + url = "http://requirements-bazaar.org", + email = "info@requirements-bazaar.org" + ), + license = @License( + name = "Apache2", + url = "http://requirements-bazaar.org/license" + ) + ), + schemes = SwaggerDefinition.Scheme.HTTPS + ) + @Path("/") + public static class Resource { + + private final BazaarService bazaarService = (BazaarService) Context.getCurrent().getService(); + + /** + * This method allows to retrieve the service name version. + * + * @return Response with service name version as a JSON object. + */ + @GET + @Path("/version") + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "This method allows to retrieve the service name version.") + @ApiResponses(value = { + @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns service name version"), + @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") + }) + public Response getServiceNameVersion() { + try { + String serviceNameVersion = Context.getCurrent().getService().getAgent().getServiceNameVersion().toString(); + return Response.ok("{\"version\": \"" + serviceNameVersion + "\"}").build(); + } catch (ServiceException ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get service name version failed"); + bazaarService.logger.warning(bex.getMessage()); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } + } + + /** + * This method allows to retrieve statistics over all projects. + * + * @param since timestamp since filter, ISO-8601 e.g. 2017-12-30 or 2017-12-30T18:30:00Z + * @return Response with statistics as a JSON object. + */ + @GET + @Path("/statistics") + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "This method allows to retrieve statistics over all projects.") + @ApiResponses(value = { + @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns statistics", response = Statistic.class), + @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), + @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") + }) + public Response getStatistics( + @ApiParam(value = "Since timestamp, ISO-8601 e.g. 2017-12-30 or 2017-12-30T18:30:00Z", required = false) @QueryParam("since") String since) { + DALFacade dalFacade = null; + try { + String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); + if (registrarErrors != null) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); + } + Agent agent = Context.getCurrent().getMainAgent(); + String userId = agent.getIdentifier(); + dalFacade = bazaarService.getDBConnection(); + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + Calendar sinceCal = since == null ? null : DatatypeConverter.parseDateTime(since); + Statistic platformStatistics = dalFacade.getStatisticsForAllProjects(internalUserId, sinceCal); + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_2, + 0, Activity.DataType.STATISTIC, internalUserId); + return Response.ok(platformStatistics.toJSON()).build(); + } catch (BazaarException bex) { + if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { + return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { + return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else { + bazaarService.logger.warning(bex.getMessage()); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } + } catch (Exception ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get statistics failed"); + bazaarService.logger.warning(bex.getMessage()); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } finally { + bazaarService.closeDBConnection(dalFacade); + } + } + + /** + * This method sends all notifications (emails) in the waiting queue. Run this method before shutting down Requirements Bazaar. + * + * @return Response + */ + @POST + @Path("/notifications") + @ApiOperation(value = "This method sends all notifications (emails) in the waiting queue. Run this method before shutting down Requirements Bazaar.") + @ApiResponses(value = { + @ApiResponse(code = HttpURLConnection.HTTP_CREATED, message = "Notifications send"), + @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), + @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") + }) + public Response sendNotifications() { + // TODO: Use authorization scopes to limit users who can run this method to admins + try { + bazaarService.notificationDispatcher.run(); + return Response.status(Response.Status.CREATED).build(); + } catch (Exception ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Send Notifications failed"); + bazaarService.logger.warning(bex.getMessage()); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } + } + } + } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java index a8d6b704..f03d75c7 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java @@ -78,7 +78,7 @@ public class RequirementRepositoryImpl extends RepositoryImpl VOTE_COUNT = select(DSL.count(DSL.nullif(VOTE.IS_UPVOTE, 0))) + public static final Field VOTE_COUNT = select(DSL.count(DSL.nullif(VOTE.IS_UPVOTE, false))) .from(VOTE) .where(VOTE.REQUIREMENT_ID.equal(REQUIREMENT.ID)) .asField("voteCount"); @@ -201,8 +201,8 @@ private ImmutablePair, Integer> getFilteredRequirements(Collec } //Filling up votes - Result voteQueryResult = jooq.select(DSL.count(DSL.nullif(vote.IS_UPVOTE, 0)).as("upVotes")) - .select(DSL.count(DSL.nullif(vote.IS_UPVOTE, 1)).as("downVotes")) + Result voteQueryResult = jooq.select(DSL.count(DSL.nullif(vote.IS_UPVOTE, false)).as("upVotes")) + .select(DSL.count(DSL.nullif(vote.IS_UPVOTE, true)).as("downVotes")) .select(userVote.IS_UPVOTE.as("userVoted")) .from(REQUIREMENT) .leftOuterJoin(vote).on(vote.REQUIREMENT_ID.eq(REQUIREMENT.ID)) diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java index b758b31b..6bb7d179 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RoleRepositoryImpl.java @@ -61,7 +61,7 @@ public List listRolesOfUser(int userId, Integer context) throws BazaarExce Result queryResult = jooq.selectFrom( USER_ROLE_MAP .join(roleTable).on(USER_ROLE_MAP.ROLE_ID.eq(roleTable.ID)) - .leftOuterJoin(ROLE_PRIVILEGE_MAP).on(ROLE_PRIVILEGE_MAP.ROLE_ID.eq(ROLE.ID)) + .leftOuterJoin(ROLE_PRIVILEGE_MAP).on(ROLE_PRIVILEGE_MAP.ROLE_ID.eq(roleTable.ID)) .leftOuterJoin(PRIVILEGE).on(PRIVILEGE.ID.eq(ROLE_PRIVILEGE_MAP.PRIVILEGE_ID)) ).where(USER_ROLE_MAP.USER_ID.equal(userId).and(USER_ROLE_MAP.CONTEXT_INFO.eq(context).or(USER_ROLE_MAP.CONTEXT_INFO.isNull()))).fetch(); @@ -152,6 +152,7 @@ public PaginationResult listProjectMembers(int projectId, Pageabl return new PaginationResult<>(total, pageable, projectMembers); } + @Override public ProjectRole getProjectRole(int userId, int projectId) throws BazaarException { List roles = listRolesOfUser(userId, projectId); @@ -199,13 +200,17 @@ public List listParentsForRole(int roleId) throws BazaarException { private void convertToRoles(List roles, de.rwth.dbis.acis.bazaar.dal.jooq.tables.Role roleTable, de.rwth.dbis.acis.bazaar.dal.jooq.tables.Privilege privilegeTable, Result queryResult) { for (Map.Entry> entry : queryResult.intoGroups(roleTable.ID).entrySet()) { - if (entry.getKey() == null) continue; + if (entry.getKey() == null) { + continue; + } Result records = entry.getValue(); List rolesToAddPrivileges = new ArrayList<>(); for (Map.Entry> privilegeEntry : records.intoGroups(privilegeTable.ID).entrySet()) { - if (privilegeEntry.getKey() == null) continue; + if (privilegeEntry.getKey() == null) { + continue; + } Result privileges = privilegeEntry.getValue(); Privilege privilege = Privilege.builder().name(new PrivilegeEnumConverter().from(privileges.getValues(privilegeTable.NAME).get(0))) diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java index 2bd918bd..4ff63bbf 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java @@ -33,10 +33,8 @@ import java.time.LocalDateTime; import java.util.*; -import static de.rwth.dbis.acis.bazaar.dal.jooq.Routines.udfNaturalsortformat; import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.CATEGORY; import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.CATEGORY_FOLLOWER_MAP; -import static org.jooq.impl.DSL.val; /** * @since 6/9/2014 @@ -51,7 +49,7 @@ public CategoryRecord createRecord(Category entry) { record.setLeaderId(entry.getCreator().getId()); record.setCreationDate(LocalDateTime.now()); if (entry.getAdditionalProperties() != null) { - record.setAdditionalProperties(JSON.json(entry.getAdditionalProperties().toString())); + record.setAdditionalProperties(JSONB.jsonb(entry.getAdditionalProperties().toString())); } return record; } @@ -130,10 +128,10 @@ public Collection> getSortFields(List switch (sort.getSortDirection()) { case DESC: // 50 is derived from the name max length - sortFields.add(udfNaturalsortformat(CATEGORY.NAME, val(50), val(".")).desc()); + sortFields.add(CATEGORY.NAME.desc()); break; default: - sortFields.add(udfNaturalsortformat(CATEGORY.NAME, val(50), val(".")).asc()); + sortFields.add(CATEGORY.NAME.asc()); break; } break; diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java index 34e647e3..4a820d1c 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java @@ -33,9 +33,7 @@ import java.time.LocalDateTime; import java.util.*; -import static de.rwth.dbis.acis.bazaar.dal.jooq.Routines.udfNaturalsortformat; import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; -import static org.jooq.impl.DSL.val; public class ProjectTransformer implements Transformer { @@ -49,7 +47,7 @@ public ProjectRecord createRecord(Project entry) { record.setDefaultCategoryId(entry.getDefaultCategoryId()); record.setCreationDate(LocalDateTime.now()); if (entry.getAdditionalProperties() != null) { - record.setAdditionalProperties(JSON.json(entry.getAdditionalProperties().toString())); + record.setAdditionalProperties(JSONB.jsonb(entry.getAdditionalProperties().toString())); } return record; } @@ -134,9 +132,9 @@ public Collection> getSortFields(List case "name": if (sort.getSortDirection() == Pageable.SortDirection.DESC) { // 50 is derived from the max length of the project name - sortFields.add(udfNaturalsortformat(PROJECT.NAME, val(50), val(".")).desc()); + sortFields.add(PROJECT.NAME.desc()); } else { - sortFields.add(udfNaturalsortformat(PROJECT.NAME, val(50), val(".")).asc()); + sortFields.add(PROJECT.NAME.asc()); } break; diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java index 8f5e71a6..ab6e74b9 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java @@ -33,9 +33,7 @@ import java.time.LocalDateTime; import java.util.*; -import static de.rwth.dbis.acis.bazaar.dal.jooq.Routines.udfNaturalsortformat; import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; -import static org.jooq.impl.DSL.val; public class RequirementTransformer implements Transformer { @Override @@ -47,7 +45,7 @@ public RequirementRecord createRecord(Requirement entry) { record.setCreatorId(entry.getCreator().getId()); record.setProjectId(entry.getProjectId()); if (entry.getAdditionalProperties() != null) { - record.setAdditionalProperties(JSON.json(entry.getAdditionalProperties().toString())); + record.setAdditionalProperties(JSONB.jsonb(entry.getAdditionalProperties().toString())); } return record; } @@ -140,9 +138,9 @@ public Collection> getSortFields(List break; case "name": if (sort.getSortDirection() == Pageable.SortDirection.DESC) { - sortFields.add(udfNaturalsortformat(REQUIREMENT.NAME, val(50), val(".")).desc()); + sortFields.add(REQUIREMENT.NAME.desc()); } else { - sortFields.add(udfNaturalsortformat(REQUIREMENT.NAME, val(50), val(".")).asc()); + sortFields.add(REQUIREMENT.NAME.asc()); } break; case "vote": diff --git a/reqbaz/src/main/resources/base-permissions.sql b/reqbaz/src/main/resources/base-permissions.sql new file mode 100644 index 00000000..2bf2bdf6 --- /dev/null +++ b/reqbaz/src/main/resources/base-permissions.sql @@ -0,0 +1,105 @@ +INSERT INTO reqbaz.role + (id, name) +VALUES (1, 'Anonymous'), + (2, 'LoggedInUser'), + (3, 'ProjectAdmin'), + (4, 'SystemAdmin'), + (5, 'ProjectManager'), + (6, 'ProjectMember'); + +INSERT INTO reqbaz.privilege + (id, name) +VALUES (1, 'Create_PROJECT'), + (2, 'Read_PROJECT'), + (3, 'Read_PUBLIC_PROJECT'), + (4, 'Modify_PROJECT'), + (5, 'Create_CATEGORY'), + (6, 'Read_CATEGORY'), + (7, 'Read_PUBLIC_CATEGORY'), + (8, 'Modify_CATEGORY'), + (9, 'Create_REQUIREMENT'), + (10, 'Read_REQUIREMENT'), + (11, 'Read_PUBLIC_REQUIREMENT'), + (12, 'Modify_REQUIREMENT'), + (13, 'Create_COMMENT'), + (14, 'Read_COMMENT'), + (15, 'Read_PUBLIC_COMMENT'), + (16, 'Modify_COMMENT'), + (17, 'Create_ATTACHMENT'), + (18, 'Read_ATTACHMENT'), + (19, 'Read_PUBLIC_ATTACHMENT'), + (20, 'Modify_ATTACHMENT'), + (21, 'Create_VOTE'), + (22, 'Delete_VOTE'), + (23, 'Create_FOLLOW'), + (24, 'Delete_FOLLOW'), + (25, 'Create_DEVELOP'), + (26, 'Delete_DEVELOP'), + (27, 'Read_PERSONALISATION_DATA'), + (28, 'Create_PERSONALISATION_DATA'), + (29, 'Read_FEEDBACK'), + (31, 'Promote_USER'), + (32, 'Realize_REQUIREMENT'), + (34, 'Modify_MEMBERS'), + (35, 'Modify_ADMIN_MEMBERS'), + (36, 'Read_USERS'); + +INSERT INTO reqbaz.user +(first_name, last_name, email, las2peer_id, user_name, profile_image, email_lead_subscription, + email_follow_subscription) +VALUES (NULL, NULL, 'anonymous@requirements-bazaar.org', '-1722613621014065292', 'anonymous', + 'https://api.learning-layers.eu/profile.png', true, true); + +INSERT INTO reqbaz.user_role_map + (role_id, user_id) +VALUES (1, 1); + + +INSERT INTO reqbaz.role_privilege_map + (role_id, privilege_id) +VALUES (1, 3), + (1, 7), + (1, 11), + (1, 15), + (1, 19), + + (2, 1), + (2, 9), + (2, 13), + (2, 17), + (2, 21), + (2, 22), + (2, 23), + (2, 24), + (2, 27), + (2, 28), + (2, 36), + + (3, 4), + (3, 8), + (3, 35), + + (5, 29), + (5, 31), + (5, 12), + (5, 16), + (5, 20), + (5, 5), + (5, 34), + + (6, 2), + (6, 6), + (6, 25), + (6, 26), + (6, 18), + (6, 14), + (6, 10), + (6, 32); + +INSERT INTO reqbaz.role_role_map + (child_id, parent_id) +VALUES (4, 3), + (3, 5), + (5, 6), + (6, 2), + (2, 1); diff --git a/reqbaz/src/main/resources/changelog.yaml b/reqbaz/src/main/resources/changelog.yaml new file mode 100644 index 00000000..c0e9c8ef --- /dev/null +++ b/reqbaz/src/main/resources/changelog.yaml @@ -0,0 +1,1737 @@ +databaseChangeLog: + - changeSet: + id: 1624138981933-1 + author: thore (generated) + changes: + - createTable: + columns: + - column: + autoIncrement: true + constraints: + primaryKey: true + primaryKeyName: feedback_pkey + name: id + type: INTEGER + - column: + constraints: + nullable: false + name: project_id + type: INTEGER + - column: + name: requirement_id + type: INTEGER + - column: + constraints: + nullable: false + defaultValueComputed: now() + name: creation_date + type: TIMESTAMP WITHOUT TIME ZONE + - column: + name: email + type: VARCHAR(255) + - column: + constraints: + nullable: false + name: feedback + type: TEXT + tableName: feedback + - changeSet: + id: 1624138981933-2 + author: thore (generated) + changes: + - createTable: + columns: + - column: + autoIncrement: true + constraints: + primaryKey: true + primaryKeyName: project_pkey + name: id + type: INTEGER + - column: + constraints: + nullable: false + name: name + type: VARCHAR(255) + - column: + constraints: + nullable: false + name: description + type: TEXT + - column: + constraints: + nullable: false + name: visibility + type: BOOLEAN + - column: + constraints: + nullable: false + defaultValueComputed: now() + name: creation_date + type: TIMESTAMP WITHOUT TIME ZONE + - column: + name: last_updated_date + type: TIMESTAMP WITHOUT TIME ZONE + - column: + constraints: + nullable: false + name: leader_id + type: INTEGER + - column: + name: default_category_id + type: INTEGER + - column: + name: additional_properties + type: JSONB + tableName: project + - changeSet: + id: 1624138981933-3 + author: thore (generated) + changes: + - createTable: + columns: + - column: + autoIncrement: true + constraints: + primaryKey: true + primaryKeyName: role_role_map_pkey + name: id + type: INTEGER + - column: + constraints: + nullable: false + name: child_id + type: INTEGER + - column: + constraints: + nullable: false + name: parent_id + type: INTEGER + tableName: role_role_map + - changeSet: + id: 1624138981933-4 + author: thore (generated) + changes: + - createTable: + columns: + - column: + autoIncrement: true + constraints: + primaryKey: true + primaryKeyName: category_pkey + name: id + type: INTEGER + - column: + constraints: + nullable: false + name: name + type: VARCHAR(255) + - column: + constraints: + nullable: false + name: description + type: TEXT + - column: + constraints: + nullable: false + defaultValueComputed: now() + name: creation_date + type: TIMESTAMP WITHOUT TIME ZONE + - column: + name: last_updated_date + type: TIMESTAMP WITHOUT TIME ZONE + - column: + constraints: + nullable: false + name: project_id + type: INTEGER + - column: + constraints: + nullable: false + name: leader_id + type: INTEGER + - column: + name: additional_properties + type: JSONB + tableName: category + - changeSet: + id: 1624138981933-5 + author: thore (generated) + changes: + - createTable: + columns: + - column: + autoIncrement: true + constraints: + primaryKey: true + primaryKeyName: personalisation_data_pkey + name: id + type: INTEGER + - column: + constraints: + nullable: false + defaultValueComputed: now() + name: creation_date + type: TIMESTAMP WITHOUT TIME ZONE + - column: + defaultValueComputed: now() + name: last_updated_date + type: TIMESTAMP WITHOUT TIME ZONE + - column: + constraints: + nullable: false + name: identifier + type: VARCHAR(50) + - column: + constraints: + nullable: false + name: user_id + type: INTEGER + - column: + constraints: + nullable: false + name: version + type: INTEGER + - column: + name: setting + type: TEXT + tableName: personalisation_data + - changeSet: + id: 1624138981933-6 + author: thore (generated) + changes: + - createTable: + columns: + - column: + autoIncrement: true + constraints: + primaryKey: true + primaryKeyName: category_follower_map_pkey + name: id + type: INTEGER + - column: + constraints: + nullable: false + name: category_id + type: INTEGER + - column: + constraints: + nullable: false + name: user_id + type: INTEGER + - column: + constraints: + nullable: false + defaultValueComputed: now() + name: creation_date + type: TIMESTAMP WITHOUT TIME ZONE + tableName: category_follower_map + - changeSet: + id: 1624138981933-7 + author: thore (generated) + changes: + - createTable: + columns: + - column: + autoIncrement: true + constraints: + primaryKey: true + primaryKeyName: requirement_category_map_pkey + name: id + type: INTEGER + - column: + constraints: + nullable: false + name: category_id + type: INTEGER + - column: + constraints: + nullable: false + name: requirement_id + type: INTEGER + tableName: requirement_category_map + - changeSet: + id: 1624138981933-8 + author: thore (generated) + changes: + - createTable: + columns: + - column: + autoIncrement: true + constraints: + primaryKey: true + primaryKeyName: requirement_developer_map_pkey + name: id + type: INTEGER + - column: + constraints: + nullable: false + name: requirement_id + type: INTEGER + - column: + constraints: + nullable: false + name: user_id + type: INTEGER + - column: + constraints: + nullable: false + defaultValueComputed: now() + name: creation_date + type: TIMESTAMP WITHOUT TIME ZONE + tableName: requirement_developer_map + - changeSet: + id: 1624138981933-9 + author: thore (generated) + changes: + - createTable: + columns: + - column: + autoIncrement: true + constraints: + primaryKey: true + primaryKeyName: user_role_map_pkey + name: id + type: INTEGER + - column: + constraints: + nullable: false + name: role_id + type: INTEGER + - column: + constraints: + nullable: false + name: user_id + type: INTEGER + - column: + name: context_info + type: INTEGER + tableName: user_role_map + - changeSet: + id: 1624138981933-10 + author: thore (generated) + changes: + - createTable: + columns: + - column: + autoIncrement: true + constraints: + primaryKey: true + primaryKeyName: vote_pkey + name: id + type: INTEGER + - column: + constraints: + nullable: false + name: is_upvote + type: BOOLEAN + - column: + constraints: + nullable: false + name: requirement_id + type: INTEGER + - column: + constraints: + nullable: false + name: user_id + type: INTEGER + - column: + constraints: + nullable: false + defaultValueComputed: now() + name: creation_date + type: TIMESTAMP WITHOUT TIME ZONE + tableName: vote + - changeSet: + id: 1624138981933-11 + author: thore (generated) + changes: + - createTable: + columns: + - column: + autoIncrement: true + constraints: + primaryKey: true + primaryKeyName: attachment_pkey + name: id + type: INTEGER + - column: + constraints: + nullable: false + defaultValueComputed: now() + name: creation_date + type: TIMESTAMP WITHOUT TIME ZONE + - column: + name: last_updated_date + type: TIMESTAMP WITHOUT TIME ZONE + - column: + constraints: + nullable: false + name: requirement_id + type: INTEGER + - column: + constraints: + nullable: false + name: user_id + type: INTEGER + - column: + constraints: + nullable: false + name: name + type: VARCHAR(255) + - column: + name: description + type: TEXT + - column: + constraints: + nullable: false + name: mime_type + type: VARCHAR(255) + - column: + constraints: + nullable: false + name: identifier + type: VARCHAR(900) + - column: + constraints: + nullable: false + name: file_url + type: VARCHAR(1000) + tableName: attachment + - changeSet: + id: 1624138981933-12 + author: thore (generated) + changes: + - createTable: + columns: + - column: + constraints: + primaryKey: true + primaryKeyName: schema_version_pkey + name: installed_rank + type: INTEGER + - column: + name: version + type: VARCHAR(50) + - column: + constraints: + nullable: false + name: description + type: VARCHAR(200) + - column: + constraints: + nullable: false + name: type + type: VARCHAR(20) + - column: + constraints: + nullable: false + name: script + type: VARCHAR(1000) + - column: + name: checksum + type: INTEGER + - column: + constraints: + nullable: false + name: installed_by + type: VARCHAR(100) + - column: + constraints: + nullable: false + defaultValueComputed: now() + name: installed_on + type: TIMESTAMP WITHOUT TIME ZONE + - column: + constraints: + nullable: false + name: execution_time + type: INTEGER + - column: + constraints: + nullable: false + name: success + type: BOOLEAN + tableName: schema_version + - changeSet: + id: 1624138981933-13 + author: thore (generated) + changes: + - createTable: + columns: + - column: + autoIncrement: true + constraints: + primaryKey: true + primaryKeyName: user_pkey + name: id + type: INTEGER + - column: + name: first_name + type: VARCHAR(150) + - column: + name: last_name + type: VARCHAR(150) + - column: + constraints: + nullable: false + name: email + type: VARCHAR(255) + - column: + name: las2peer_id + type: VARCHAR(128) + - column: + name: user_name + type: VARCHAR(255) + - column: + name: profile_image + type: TEXT + - column: + constraints: + nullable: false + defaultValueBoolean: true + name: email_lead_subscription + type: BOOLEAN + - column: + constraints: + nullable: false + defaultValueBoolean: true + name: email_follow_subscription + type: BOOLEAN + - column: + constraints: + nullable: false + defaultValueComputed: now() + name: creation_date + type: TIMESTAMP WITHOUT TIME ZONE + - column: + name: last_updated_date + type: TIMESTAMP WITHOUT TIME ZONE + - column: + name: last_login_date + type: TIMESTAMP WITHOUT TIME ZONE + - column: + defaultValueBoolean: true + name: personalization_enabled + type: BOOLEAN + tableName: user + - changeSet: + id: 1624138981933-14 + author: thore (generated) + changes: + - createTable: + columns: + - column: + autoIncrement: true + constraints: + primaryKey: true + primaryKeyName: privilege_pkey + name: id + type: INTEGER + - column: + constraints: + nullable: false + name: name + type: VARCHAR(100) + tableName: privilege + - changeSet: + id: 1624138981933-15 + author: thore (generated) + changes: + - createTable: + columns: + - column: + autoIncrement: true + constraints: + primaryKey: true + primaryKeyName: requirement_tag_map_pkey + name: id + type: INTEGER + - column: + constraints: + nullable: false + name: tag_id + type: INTEGER + - column: + constraints: + nullable: false + name: requirement_id + type: INTEGER + tableName: requirement_tag_map + - changeSet: + id: 1624138981933-16 + author: thore (generated) + changes: + - createTable: + columns: + - column: + autoIncrement: true + constraints: + primaryKey: true + primaryKeyName: comment_pkey + name: id + type: INTEGER + - column: + constraints: + nullable: false + name: message + type: TEXT + - column: + constraints: + nullable: false + defaultValueComputed: now() + name: creation_date + type: TIMESTAMP WITHOUT TIME ZONE + - column: + name: last_updated_date + type: TIMESTAMP WITHOUT TIME ZONE + - column: + constraints: + nullable: false + name: requirement_id + type: INTEGER + - column: + constraints: + nullable: false + name: user_id + type: INTEGER + - column: + name: reply_to_comment_id + type: INTEGER + - column: + constraints: + nullable: false + defaultValueBoolean: false + name: deleted + type: BOOLEAN + tableName: comment + - changeSet: + id: 1624138981933-17 + author: thore (generated) + changes: + - createTable: + columns: + - column: + autoIncrement: true + constraints: + primaryKey: true + primaryKeyName: requirement_follower_map_pkey + name: id + type: INTEGER + - column: + constraints: + nullable: false + name: requirement_id + type: INTEGER + - column: + constraints: + nullable: false + name: user_id + type: INTEGER + - column: + constraints: + nullable: false + defaultValueComputed: now() + name: creation_date + type: TIMESTAMP WITHOUT TIME ZONE + tableName: requirement_follower_map + - changeSet: + id: 1624138981933-18 + author: thore (generated) + changes: + - createTable: + columns: + - column: + autoIncrement: true + constraints: + primaryKey: true + primaryKeyName: role_pkey + name: id + type: INTEGER + - column: + name: name + type: VARCHAR(50) + tableName: role + - changeSet: + id: 1624138981933-19 + author: thore (generated) + changes: + - createTable: + columns: + - column: + autoIncrement: true + constraints: + primaryKey: true + primaryKeyName: tag_pkey + name: id + type: INTEGER + - column: + constraints: + nullable: false + name: project_id + type: INTEGER + - column: + constraints: + nullable: false + defaultValueComputed: now() + name: creation_date + type: TIMESTAMP WITHOUT TIME ZONE + - column: + constraints: + nullable: false + name: name + type: VARCHAR(20) + - column: + constraints: + nullable: false + name: colour + type: VARCHAR(7) + tableName: tag + - changeSet: + id: 1624138981933-20 + author: thore (generated) + changes: + - createTable: + columns: + - column: + autoIncrement: true + constraints: + primaryKey: true + primaryKeyName: requirement_pkey + name: id + type: INTEGER + - column: + constraints: + nullable: false + name: name + type: VARCHAR(255) + - column: + name: description + type: TEXT + - column: + name: realized + type: TIMESTAMP WITHOUT TIME ZONE + - column: + constraints: + nullable: false + defaultValueComputed: now() + name: creation_date + type: TIMESTAMP WITHOUT TIME ZONE + - column: + name: last_updated_date + type: TIMESTAMP WITHOUT TIME ZONE + - column: + name: lead_developer_id + type: INTEGER + - column: + constraints: + nullable: false + name: creator_id + type: INTEGER + - column: + constraints: + nullable: false + name: project_id + type: INTEGER + - column: + name: additional_properties + type: JSONB + tableName: requirement + - changeSet: + id: 1624138981933-21 + author: thore (generated) + changes: + - createTable: + columns: + - column: + autoIncrement: true + constraints: + primaryKey: true + primaryKeyName: project_follower_map_pkey + name: id + type: INTEGER + - column: + constraints: + nullable: false + name: project_id + type: INTEGER + - column: + constraints: + nullable: false + name: user_id + type: INTEGER + - column: + constraints: + nullable: false + defaultValueComputed: now() + name: creation_date + type: TIMESTAMP WITHOUT TIME ZONE + tableName: project_follower_map + - changeSet: + id: 1624138981933-22 + author: thore (generated) + changes: + - createTable: + columns: + - column: + autoIncrement: true + constraints: + primaryKey: true + primaryKeyName: role_privilege_map_pkey + name: id + type: INTEGER + - column: + constraints: + nullable: false + name: role_id + type: INTEGER + - column: + constraints: + nullable: false + name: privilege_id + type: INTEGER + tableName: role_privilege_map + - changeSet: + id: 1624138981933-23 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: project_id + indexName: requirement_project + tableName: requirement + - changeSet: + id: 1624138981933-24 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: project_id + baseTableName: requirement + constraintName: requirement_project + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: project + validate: true + - changeSet: + id: 1624138981933-25 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: context_info + indexName: role_project_context + tableName: user_role_map + - changeSet: + id: 1624138981933-26 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: context_info + baseTableName: user_role_map + constraintName: role_project_context + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: project + validate: true + - changeSet: + id: 1624138981933-27 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: project_id + indexName: tag_project + tableName: tag + - changeSet: + id: 1624138981933-28 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: project_id + baseTableName: tag + constraintName: tag_project + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: project + validate: true + - changeSet: + id: 1624138981933-29 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: project_id + indexName: category_project + tableName: category + - changeSet: + id: 1624138981933-30 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: project_id + baseTableName: category + constraintName: category_project + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: project + validate: true + - changeSet: + id: 1624138981933-31 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: default_category_id + indexName: project_category + tableName: project + - changeSet: + id: 1624138981933-32 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: default_category_id + baseTableName: project + constraintName: project_category + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: category + validate: true + - changeSet: + id: 1624138981933-33 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: category_id + indexName: requirement_category_map_category + tableName: requirement_category_map + - changeSet: + id: 1624138981933-34 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: category_id + baseTableName: requirement_category_map + constraintName: requirement_category_map_category + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: category + validate: true + - changeSet: + id: 1624138981933-35 + author: thore (generated) + changes: + - addUniqueConstraint: + columnNames: identifier, user_id, version + constraintName: personalisation_key + tableName: personalisation_data + - changeSet: + id: 1624138981933-36 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: category_id + indexName: category_follower_map_category + tableName: category_follower_map + - changeSet: + id: 1624138981933-37 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: category_id + baseTableName: category_follower_map + constraintName: category_follower_map_category + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: category + validate: true + - changeSet: + id: 1624138981933-38 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: success + indexName: schema_version_s_idx + tableName: schema_version + - changeSet: + id: 1624138981933-39 + author: thore (generated) + changes: + - addUniqueConstraint: + columnNames: las2peer_id + constraintName: user_las2peer_id_key + tableName: user + - changeSet: + id: 1624138981933-40 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: user_id + indexName: user_role_map_user + tableName: user_role_map + - changeSet: + id: 1624138981933-41 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: user_id + baseTableName: user_role_map + constraintName: user_role_map_user + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: user + validate: true + - changeSet: + id: 1624138981933-42 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: user_id + indexName: vote_user + tableName: vote + - changeSet: + id: 1624138981933-43 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: user_id + baseTableName: vote + constraintName: vote_user + deferrable: false + initiallyDeferred: false + onDelete: RESTRICT + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: user + validate: true + - changeSet: + id: 1624138981933-44 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: privilege_id + indexName: role_privilege_map_privilege + tableName: role_privilege_map + - changeSet: + id: 1624138981933-45 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: privilege_id + baseTableName: role_privilege_map + constraintName: role_privilege_map_privilege + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: privilege + validate: true + - changeSet: + id: 1624138981933-46 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: user_id + indexName: comment_user + tableName: comment + - changeSet: + id: 1624138981933-47 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: user_id + baseTableName: comment + constraintName: comment_user + deferrable: false + initiallyDeferred: false + onDelete: RESTRICT + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: user + validate: true + - changeSet: + id: 1624138981933-48 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: reply_to_comment_id + indexName: reply_comment + tableName: comment + - changeSet: + id: 1624138981933-49 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: reply_to_comment_id + baseTableName: comment + constraintName: reply_comment + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: comment + validate: true + - changeSet: + id: 1624138981933-50 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: user_id + indexName: requirement_follower_map_user + tableName: requirement_follower_map + - changeSet: + id: 1624138981933-51 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: user_id + baseTableName: requirement_follower_map + constraintName: requirement_follower_map_user + deferrable: false + initiallyDeferred: false + onDelete: RESTRICT + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: user + validate: true + - changeSet: + id: 1624138981933-52 + author: thore (generated) + changes: + - addUniqueConstraint: + columnNames: name + constraintName: role_name_key + tableName: role + - changeSet: + id: 1624138981933-53 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: role_id + indexName: role_privilege_map_role + tableName: role_privilege_map + - changeSet: + id: 1624138981933-54 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: role_id + baseTableName: role_privilege_map + constraintName: role_privilege_map_role + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: role + validate: true + - changeSet: + id: 1624138981933-55 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: child_id + indexName: role_role_map_child + tableName: role_role_map + - changeSet: + id: 1624138981933-56 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: child_id + baseTableName: role_role_map + constraintName: role_role_map_child + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: role + validate: true + - changeSet: + id: 1624138981933-57 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: parent_id + indexName: role_role_map_parent + tableName: role_role_map + - changeSet: + id: 1624138981933-58 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: parent_id + baseTableName: role_role_map + constraintName: role_role_map_parent + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: role + validate: true + - changeSet: + id: 1624138981933-59 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: role_id + indexName: user_role_map_role + tableName: user_role_map + - changeSet: + id: 1624138981933-60 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: role_id + baseTableName: user_role_map + constraintName: user_role_map_role + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: role + validate: true + - changeSet: + id: 1624138981933-61 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: creator_id + indexName: creator + tableName: requirement + - changeSet: + id: 1624138981933-62 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: creator_id + baseTableName: requirement + constraintName: creator + deferrable: false + initiallyDeferred: false + onDelete: RESTRICT + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: user + validate: true + - changeSet: + id: 1624138981933-63 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: lead_developer_id + indexName: lead_developer + tableName: requirement + - changeSet: + id: 1624138981933-64 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: lead_developer_id + baseTableName: requirement + constraintName: lead_developer + deferrable: false + initiallyDeferred: false + onDelete: RESTRICT + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: user + validate: true + - changeSet: + id: 1624138981933-65 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: requirement_id + indexName: requirement_tag_map_requirement + tableName: requirement_tag_map + - changeSet: + id: 1624138981933-66 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: requirement_id + baseTableName: requirement_tag_map + constraintName: requirement_tag_map_requirement + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: requirement + validate: true + - changeSet: + id: 1624138981933-67 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: requirement_id + indexName: vote_requirement + tableName: vote + - changeSet: + id: 1624138981933-68 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: requirement_id + baseTableName: vote + constraintName: vote_requirement + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: requirement + validate: true + - changeSet: + id: 1624138981933-69 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: project_id + indexName: project_follower_map_project + tableName: project_follower_map + - changeSet: + id: 1624138981933-70 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: project_id + baseTableName: project_follower_map + constraintName: project_follower_map_project + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: project + validate: true + - changeSet: + id: 1624138981933-71 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: user_id + indexName: project_follower_map_user + tableName: project_follower_map + - changeSet: + id: 1624138981933-72 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: user_id + baseTableName: project_follower_map + constraintName: project_follower_map_user + deferrable: false + initiallyDeferred: false + onDelete: RESTRICT + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: user + validate: true + - changeSet: + id: 1624138981933-73 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: project_id + indexName: feedback_project + tableName: feedback + - changeSet: + id: 1624138981933-74 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: project_id + baseTableName: feedback + constraintName: feedback_project + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: project + validate: true + - changeSet: + id: 1624138981933-75 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: leader_id + indexName: project_user + tableName: project + - changeSet: + id: 1624138981933-76 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: leader_id + baseTableName: project + constraintName: project_user + deferrable: false + initiallyDeferred: false + onDelete: RESTRICT + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: user + validate: true + - changeSet: + id: 1624138981933-77 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: leader_id + indexName: category_user + tableName: category + - changeSet: + id: 1624138981933-78 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: leader_id + baseTableName: category + constraintName: category_user + deferrable: false + initiallyDeferred: false + onDelete: RESTRICT + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: user + validate: true + - changeSet: + id: 1624138981933-79 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: user_id + indexName: personalisation_user + tableName: personalisation_data + - changeSet: + id: 1624138981933-80 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: user_id + baseTableName: personalisation_data + constraintName: personalisation_user + deferrable: false + initiallyDeferred: false + onDelete: RESTRICT + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: user + validate: true + - changeSet: + id: 1624138981933-81 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: user_id + indexName: category_follower_map_user + tableName: category_follower_map + - changeSet: + id: 1624138981933-82 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: user_id + baseTableName: category_follower_map + constraintName: category_follower_map_user + deferrable: false + initiallyDeferred: false + onDelete: RESTRICT + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: user + validate: true + - changeSet: + id: 1624138981933-83 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: requirement_id + indexName: requirement_category_map_requirement + tableName: requirement_category_map + - changeSet: + id: 1624138981933-84 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: requirement_id + baseTableName: requirement_category_map + constraintName: requirement_category_map_requirement + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: requirement + validate: true + - changeSet: + id: 1624138981933-85 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: requirement_id + indexName: requirement_developer_map_requirement + tableName: requirement_developer_map + - changeSet: + id: 1624138981933-86 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: requirement_id + baseTableName: requirement_developer_map + constraintName: requirement_developer_map_requirement + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: requirement + validate: true + - changeSet: + id: 1624138981933-87 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: user_id + indexName: requirement_developer_map_user + tableName: requirement_developer_map + - changeSet: + id: 1624138981933-88 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: user_id + baseTableName: requirement_developer_map + constraintName: requirement_developer_map_user + deferrable: false + initiallyDeferred: false + onDelete: RESTRICT + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: user + validate: true + - changeSet: + id: 1624138981933-89 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: requirement_id + indexName: attachment_requirement + tableName: attachment + - changeSet: + id: 1624138981933-90 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: requirement_id + baseTableName: attachment + constraintName: attachment_requirement + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: requirement + validate: true + - changeSet: + id: 1624138981933-91 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: user_id + indexName: attachment_user + tableName: attachment + - changeSet: + id: 1624138981933-92 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: user_id + baseTableName: attachment + constraintName: attachment_user + deferrable: false + initiallyDeferred: false + onDelete: RESTRICT + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: user + validate: true + - changeSet: + id: 1624138981933-93 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: tag_id + indexName: requirement_tag_map_tag + tableName: requirement_tag_map + - changeSet: + id: 1624138981933-94 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: tag_id + baseTableName: requirement_tag_map + constraintName: requirement_tag_map_tag + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: tag + validate: true + - changeSet: + id: 1624138981933-95 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: requirement_id + indexName: comment_requirement + tableName: comment + - changeSet: + id: 1624138981933-96 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: requirement_id + baseTableName: comment + constraintName: comment_requirement + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: requirement + validate: true + - changeSet: + id: 1624138981933-97 + author: thore (generated) + changes: + - createIndex: + columns: + - column: + name: requirement_id + indexName: requirement_follower_map_requirement + tableName: requirement_follower_map + - changeSet: + id: 1624138981933-98 + author: thore (generated) + changes: + - addForeignKeyConstraint: + baseColumnNames: requirement_id + baseTableName: requirement_follower_map + constraintName: requirement_follower_map_requirement + deferrable: false + initiallyDeferred: false + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: id + referencedTableName: requirement + validate: true + - changeSet: + id: load-permissions + author: thore + changes: + - sqlFile: + comment: Basic Role and Permission Maps + endDelimiter: \nGO + splitStatements: true + path: src/main/resources/base-permissions.sql + stripComments: true diff --git a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java index 3d313abf..3e2f63d5 100644 --- a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java +++ b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/helpers/SetupData.java @@ -32,7 +32,7 @@ private static DataSource setupDataSource(String dbUrl, String dbUserName, Strin BasicDataSource dataSource = new BasicDataSource(); // Deprecated according to jooq // dataSource.setDriverClassName("com.mysql.jdbc.Driver"); - dataSource.setUrl(dbUrl + "?useSSL=false&serverTimezone=UTC"); + dataSource.setUrl(dbUrl); dataSource.setUsername(dbUserName); dataSource.setPassword(dbPassword); dataSource.setValidationQuery("SELECT 1;"); @@ -43,11 +43,11 @@ private static DataSource setupDataSource(String dbUrl, String dbUserName, Strin @Before public void setUp() throws Exception { - String url = "jdbc:mysql://localhost:3306/reqbaz"; + String url = "jdbc:postgresql://localhost:5432/reqbaz"; - DataSource dataSource = setupDataSource(url, "root", "rootpw"); + DataSource dataSource = setupDataSource(url, "reqbaz", "reqbaz"); - dalImpl = new DALFacadeImpl(dataSource, SQLDialect.MYSQL); + dalImpl = new DALFacadeImpl(dataSource, SQLDialect.POSTGRES); facade = dalImpl; jooq = dalImpl.getDslContext(); From 61102851d3d6530cce8c069d0717ccbac556096f Mon Sep 17 00:00:00 2001 From: Thore Date: Sun, 20 Jun 2021 03:17:35 +0200 Subject: [PATCH 108/134] Include configuration for postgres --- .github/workflows/gradle.yml | 26 ++++++++++++-------------- gradle.properties | 10 ++++------ reqbaz/build.gradle | 28 +++++++--------------------- 3 files changed, 23 insertions(+), 41 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index df9ae2fa..ffe26b15 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,21 +1,24 @@ name: Gradle Build & Test -on: [pull_request, push] +on: [ pull_request, push ] jobs: build: runs-on: ubuntu-latest services: - mysql: - image: mysql:latest + postgres: + image: postgres:latest ports: - - 3306:3306 + - 5432:5432 env: - MYSQL_USER: reqbaz - MYSQL_PASSWORD: password - MYSQL_DATABASE: reqbaz - MYSQL_ROOT_PASSWORD: rootpw - options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 + POSTGRES_USER: reqbaz + POSTGRES_PASSWORD: reqbaz + POSTGRES_DB: reqbaz + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 steps: - uses: actions/checkout@v2 @@ -23,11 +26,6 @@ jobs: uses: actions/setup-java@v1 with: java-version: 14 - - name: Verify MySQL connection - run: | - while ! mysqladmin ping -h"127.0.0.1" -P"3306" --silent; do - sleep 1 - done - name: Build with Gradle run: ./gradlew clean build --info - uses: codecov/codecov-action@v1 diff --git a/gradle.properties b/gradle.properties index cc11e065..c5b435ab 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,16 +1,14 @@ org.gradle.parallel=true java.version=14 - core.version=1.1.1 service.version=0.9.0 - service.name=de.rwth.dbis.acis.bazaar.service service.class=BazaarService jooq.version=3.14.4 mysql.version=8.0.23 - -db.port=3306 +postgres.version=42.2.12 +db.port=5432 db.hostname=localhost -db.user=root -db.password=rootpw +db.user=reqbaz +db.password=reqbaz db.name=reqbaz diff --git a/reqbaz/build.gradle b/reqbaz/build.gradle index 0e272980..40270d3e 100644 --- a/reqbaz/build.gradle +++ b/reqbaz/build.gradle @@ -18,7 +18,6 @@ plugins { id 'java' id 'application' id 'idea' - id "org.flywaydb.flyway" version "7.7.1" id "nu.studer.jooq" version "5.2.1" id "io.freefair.lombok" version "5.3.0" id 'com.github.ben-manes.versions' version '0.38.0' @@ -55,24 +54,20 @@ dependencies { liquibaseRuntime 'org.liquibase:liquibase-core:3.8.1' liquibaseRuntime 'org.yaml:snakeyaml:1.15' - liquibaseRuntime 'org.postgresql:postgresql:42.2.12' + liquibaseRuntime "org.postgresql:postgresql:${project.property('postgres.version')}" liquibaseRuntime 'javax.xml.bind:jaxb-api:2.3.1' // las2peer bundle which is not necessary in the runtime path // compileOnly will be moved into the lib dir afterwards compileOnly "i5:las2peer-bundle:${project.property('core.version')}" - compileOnly "mysql:mysql-connector-java:${project.property('mysql.version')}" - compileOnly 'org.postgresql:postgresql:42.2.12' + compileOnly "org.postgresql:postgresql:${project.property('postgres.version')}" compileOnly 'org.hibernate:hibernate-validator:5.4.3.Final' compileOnly 'org.glassfish:jakarta.el:3.0.3' compileOnly 'javax.validation:validation-api:1.1.0.Final' // This is for the jooq generation only - jooqGenerator "mysql:mysql-connector-java:${project.property('mysql.version')}" jooqGenerator "org.jooq:jooq-codegen:${project.property('jooq.version')}" - jooqGenerator 'org.postgresql:postgresql:42.2.12' - implementation "org.flywaydb:flyway-core:7.7.1" implementation 'com.google.code.gson:gson:2.8.6' implementation 'org.apache.commons:commons-pool2:2.9.0' implementation 'org.apache.commons:commons-dbcp2:2.8.0' @@ -86,6 +81,7 @@ dependencies { configurations { // This ensures las2peer is available in the tests, but won't be bundled testCompile.extendsFrom compileOnly + jooqGenerator.extendsFrom liquibaseRuntime } test { @@ -160,9 +156,9 @@ jooq { logging = org.jooq.meta.jaxb.Logging.WARN jdbc { driver = 'org.postgresql.Driver' - url = "jdbc:postgresql://localhost:5432/reqbaz" - user = "reqbaz" - password = "reqbaz" + url = "jdbc:postgresql://${project.property('db.hostname')}:${project.property('db.port')}/${project.property('db.name')}" + user = "${project.property('db.user')}" + password = "${project.property('db.password')}" } generator { name = 'org.jooq.codegen.DefaultGenerator' @@ -193,16 +189,6 @@ jooq { } } -flyway { - url = "jdbc:mysql://${project.property('db.hostname')}:${project.property('db.port')}/${project.property('db.name')}" - user = "${project.property('db.user')}" - password = "${project.property('db.password')}" - schemas = ['reqbaz'] - // Flyway now uses 'flyway_schema_history' to retain compatibility override this - table = 'schema_version' - locations = ["filesystem:$project.projectDir/src/main/resources/migrations"] -} - // liquibase migrations generateJooq.dependsOn dropAll generateJooq.dependsOn update @@ -211,7 +197,7 @@ liquibase { activities { main { changeLogFile "$projectDir/src/main/resources/changelog.yaml" - url "jdbc:postgresql://localhost:5432/reqbaz" + url "jdbc:postgresql://${project.property('db.hostname')}:${project.property('db.port')}/${project.property('db.name')}" username 'reqbaz' password 'reqbaz' } From dacb3df55b79087b55f371b5e8beaada1767ee87 Mon Sep 17 00:00:00 2001 From: Thore Date: Sun, 20 Jun 2021 03:31:43 +0200 Subject: [PATCH 109/134] Try to fix query failure in gh action --- reqbaz/src/main/resources/base-permissions.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reqbaz/src/main/resources/base-permissions.sql b/reqbaz/src/main/resources/base-permissions.sql index 2bf2bdf6..b492a1a9 100644 --- a/reqbaz/src/main/resources/base-permissions.sql +++ b/reqbaz/src/main/resources/base-permissions.sql @@ -1,4 +1,4 @@ -INSERT INTO reqbaz.role +INSERT INTO reqbaz."role" (id, name) VALUES (1, 'Anonymous'), (2, 'LoggedInUser'), From e769bd58b9ef5442857043c5ea612fc7b48420ba Mon Sep 17 00:00:00 2001 From: Thore Date: Thu, 24 Jun 2021 17:58:54 +0200 Subject: [PATCH 110/134] Add tsvector search support --- ...rwth.dbis.acis.bazaar.service.BazaarService.properties | 6 +++--- .../bazaar/service/dal/transform/ProjectTransformer.java | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties b/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties index 30a571d9..082404f1 100644 --- a/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties +++ b/etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties @@ -1,6 +1,6 @@ -dbUserName=root -dbPassword=rootpw -dbUrl=jdbc:mysql://localhost:3306/reqbaz +dbUserName=reqbaz +dbPassword=reqbaz +dbUrl=jdbc:postgresql://localhost:5432/reqbaz lang=en country=us baseURL=http://localhost:8080/bazaar/ diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java index 4a820d1c..8c5145be 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java @@ -197,8 +197,12 @@ public Collection> getSortFields(List @Override public Condition getSearchCondition(String search) throws Exception { - return PROJECT.NAME.likeIgnoreCase("%" + search + "%") - .or(PROJECT.DESCRIPTION.likeIgnoreCase("%" + search + "%")); + // Catch issues with empty tsvector matching causing nothing to be found + if (search.equals("")) { + return PROJECT.NAME.likeIgnoreCase("%"); + } + return DSL.condition("to_tsvector({0} || {1}) @@ websearch_to_tsquery({2})", + PROJECT.NAME, PROJECT.DESCRIPTION, search); } @Override From 39e07a8f52e858aee8a8e16749ee95ebccb2bcae Mon Sep 17 00:00:00 2001 From: Thore Date: Fri, 2 Jul 2021 17:54:41 +0200 Subject: [PATCH 111/134] Build stuff, postgres, docker, ghcr --- .github/workflows/build_container.yaml | 57 +++++++++++++++++++ .github/workflows/gradle.yml | 2 +- Dockerfile | 11 ++-- docker-compose.yml | 15 +++++ .../src/main/resources/base-permissions.sql | 2 +- 5 files changed, 81 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/build_container.yaml create mode 100644 docker-compose.yml diff --git a/.github/workflows/build_container.yaml b/.github/workflows/build_container.yaml new file mode 100644 index 00000000..9a482a0b --- /dev/null +++ b/.github/workflows/build_container.yaml @@ -0,0 +1,57 @@ +on: [ push ] + +name: Build Container + +jobs: + build: + runs-on: ubuntu-latest + + services: + postgres: + image: postgres:13 + ports: + - 5432:5432 + env: + POSTGRES_USER: reqbaz + POSTGRES_PASSWORD: reqbaz + POSTGRES_DB: reqbaz + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 14 + uses: actions/setup-java@v1 + with: + java-version: 14 + - name: Build release bundle with Gradle + run: ./gradlew export -x test #-Pservice.version=${{ steps.get_version.outputs.version-without-v }} + - name: Docker metadata setup + id: meta + uses: docker/metadata-action@v3 + with: + # list of Docker images to use as base name for tags + images: | + rwth-acis/requirementsbazaar + ghcr.io/rwth-acis/requirementsbazaar + # generate Docker tags based on the following events/attributes + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + type=sha + - name: Login to Packages Container registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index ffe26b15..0b54c9d5 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -7,7 +7,7 @@ jobs: services: postgres: - image: postgres:latest + image: postgres:13 ports: - 5432:5432 env: diff --git a/Dockerfile b/Dockerfile index ef4f617b..1f517fa1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,22 @@ -FROM openjdk:8-jdk-alpine +# Build final container without build dependencies etc. +FROM openjdk:14-jdk-alpine ENV HTTP_PORT=8080 ENV HTTPS_PORT=8443 ENV LAS2PEER_PORT=9011 -RUN apk add --update bash mysql-client apache-ant && rm -f /var/cache/apk/* RUN addgroup -g 1000 -S las2peer && \ adduser -u 1000 -S las2peer -G las2peer +RUN apk add --update bash && rm -f /var/cache/apk/* + -COPY --chown=las2peer:las2peer . /src WORKDIR /src +COPY --chown=las2peer:las2peer ./reqbaz/build/export/ . +COPY --chown=las2peer:las2peer docker-entrypoint.sh /src/docker-entrypoint.sh +COPY --chown=las2peer:las2peer gradle.properties /src/gradle.properties # run the rest as unprivileged user USER las2peer -RUN ant jar EXPOSE $HTTP_PORT EXPOSE $HTTPS_PORT diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..8404fc2e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,15 @@ +version: '3' + +services: + mysql: + image: mysql:latest + volumes: + - .db_data:/var/lib/mysql + restart: always + environment: + MYSQL_ROOT_PASSWORD: rootpw + MYSQL_DATABASE: reqbaz + MYSQL_USER: reqbaz + MYSQL_PASSWORD: password + ports: + - 3306:3306 diff --git a/reqbaz/src/main/resources/base-permissions.sql b/reqbaz/src/main/resources/base-permissions.sql index b492a1a9..2bf2bdf6 100644 --- a/reqbaz/src/main/resources/base-permissions.sql +++ b/reqbaz/src/main/resources/base-permissions.sql @@ -1,4 +1,4 @@ -INSERT INTO reqbaz."role" +INSERT INTO reqbaz.role (id, name) VALUES (1, 'Anonymous'), (2, 'LoggedInUser'), From 5f9fcf71c6352a2446cbc6507e077fd35f7b2c4c Mon Sep 17 00:00:00 2001 From: Thore Date: Fri, 2 Jul 2021 18:55:56 +0200 Subject: [PATCH 112/134] pin schema in liquibase --- reqbaz/build.gradle | 7 ++++--- reqbaz/src/main/resources/base-permissions.sql | 12 ++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/reqbaz/build.gradle b/reqbaz/build.gradle index 40270d3e..e1925af2 100644 --- a/reqbaz/build.gradle +++ b/reqbaz/build.gradle @@ -164,7 +164,7 @@ jooq { name = 'org.jooq.codegen.DefaultGenerator' database { name = 'org.jooq.meta.postgres.PostgresDatabase' - inputSchema = "reqbaz" + inputSchema = "public" // forcedTypes { // forcedType { // name = 'BOOLEAN' @@ -196,10 +196,11 @@ generateJooq.dependsOn update liquibase { activities { main { + defaultSchemaName 'public' changeLogFile "$projectDir/src/main/resources/changelog.yaml" url "jdbc:postgresql://${project.property('db.hostname')}:${project.property('db.port')}/${project.property('db.name')}" - username 'reqbaz' - password 'reqbaz' + username "${project.property('db.user')}" + password "${project.property('db.password')}" } } } diff --git a/reqbaz/src/main/resources/base-permissions.sql b/reqbaz/src/main/resources/base-permissions.sql index 2bf2bdf6..5326c282 100644 --- a/reqbaz/src/main/resources/base-permissions.sql +++ b/reqbaz/src/main/resources/base-permissions.sql @@ -1,4 +1,4 @@ -INSERT INTO reqbaz.role +INSERT INTO role (id, name) VALUES (1, 'Anonymous'), (2, 'LoggedInUser'), @@ -7,7 +7,7 @@ VALUES (1, 'Anonymous'), (5, 'ProjectManager'), (6, 'ProjectMember'); -INSERT INTO reqbaz.privilege +INSERT INTO privilege (id, name) VALUES (1, 'Create_PROJECT'), (2, 'Read_PROJECT'), @@ -44,18 +44,18 @@ VALUES (1, 'Create_PROJECT'), (35, 'Modify_ADMIN_MEMBERS'), (36, 'Read_USERS'); -INSERT INTO reqbaz.user +INSERT INTO "user" (first_name, last_name, email, las2peer_id, user_name, profile_image, email_lead_subscription, email_follow_subscription) VALUES (NULL, NULL, 'anonymous@requirements-bazaar.org', '-1722613621014065292', 'anonymous', 'https://api.learning-layers.eu/profile.png', true, true); -INSERT INTO reqbaz.user_role_map +INSERT INTO user_role_map (role_id, user_id) VALUES (1, 1); -INSERT INTO reqbaz.role_privilege_map +INSERT INTO role_privilege_map (role_id, privilege_id) VALUES (1, 3), (1, 7), @@ -96,7 +96,7 @@ VALUES (1, 3), (6, 10), (6, 32); -INSERT INTO reqbaz.role_role_map +INSERT INTO role_role_map (child_id, parent_id) VALUES (4, 3), (3, 5), From a79b682c236395ff934141fde31b672fedbce564 Mon Sep 17 00:00:00 2001 From: Thore Date: Fri, 2 Jul 2021 19:56:59 +0200 Subject: [PATCH 113/134] remove non registry image name --- .github/workflows/build_container.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build_container.yaml b/.github/workflows/build_container.yaml index 9a482a0b..1d077073 100644 --- a/.github/workflows/build_container.yaml +++ b/.github/workflows/build_container.yaml @@ -35,7 +35,6 @@ jobs: with: # list of Docker images to use as base name for tags images: | - rwth-acis/requirementsbazaar ghcr.io/rwth-acis/requirementsbazaar # generate Docker tags based on the following events/attributes tags: | From 0922fc2a4590b88ef3ee9c5d14740c67a34bd96e Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 10 Jul 2021 00:10:23 +0200 Subject: [PATCH 114/134] Docker postgres compat --- docker-entrypoint.sh | 42 +++--------- gradle.properties | 2 +- reqbaz/build.gradle | 15 ++--- .../service/dal/entities/Attachment.java | 1 + .../service/dal/entities/Requirement.java | 1 + reqbaz/src/main/resources/changelog.yaml | 65 ------------------- 6 files changed, 18 insertions(+), 108 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 7716f83a..40301101 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -14,19 +14,17 @@ export SERVICE_VERSION=$(awk -F "=" '/service.version/ {print $2}' etc/ant_confi export SERVICE_NAME=$(awk -F "=" '/service.name/ {print $2}' etc/ant_configuration/service.properties) export SERVICE_CLASS=$(awk -F "=" '/service.class/ {print $2}' etc/ant_configuration/service.properties) export SERVICE=${SERVICE_NAME}.${SERVICE_CLASS}@${SERVICE_VERSION} -export DEMO_DATA_SQL='etc/migrations/add_reqbaz_demo_data.sql' -export DEMO_DATA_SQL_FULL='etc/migrations/add_reqbaz_demo_data_full.sql' -export MYSQL_DATABASE='reqbaz' +export POSTGRES_DATABASE='reqbaz' # check mandatory variables -[[ -z "${MYSQL_USER}" ]] && \ - echo "Mandatory variable MYSQL_USER is not set. Add -e MYSQL_USER=myuser to your arguments." && exit 1 -[[ -z "${MYSQL_PASSWORD}" ]] && \ - echo "Mandatory variable MYSQL_PASSWORD is not set. Add -e MYSQL_PASSWORD=mypasswd to your arguments." && exit 1 +[[ -z "${POSTGRES_USER}" ]] && \ + echo "Mandatory variable POSTGRES_USER is not set. Add -e POSTGRES_USER=reqbaz to your arguments." && exit 1 +[[ -z "${POSTGRES_PASSWORD}" ]] && \ + echo "Mandatory variable POSTGRES_PASSWORD is not set. Add -e POSTGRES_PASSWORD=mypasswd to your arguments." && exit 1 # set defaults for optional service parameters -[[ -z "${MYSQL_HOST}" ]] && export MYSQL_HOST='mysql' -[[ -z "${MYSQL_PORT}" ]] && export MYSQL_PORT='3306' +[[ -z "${POSTGRES_HOST}" ]] && export MYSQL_HOST='postgres' +[[ -z "${POSTGRES_PORT}" ]] && export MYSQL_PORT='5432' [[ -z "${SERVICE_PASSPHRASE}" ]] && export SERVICE_PASSPHRASE='Passphrase' [[ -z "${BAZAAR_LANG}" ]] && export BAZAAR_LANG='en' @@ -54,9 +52,9 @@ export MYSQL_DATABASE='reqbaz' function set_in_service_config { sed -i "s?${1}[[:blank:]]*=.*?${1}=${2}?g" ${SERVICE_PROPERTY_FILE} } -set_in_service_config dbUserName ${MYSQL_USER} -set_in_service_config dbPassword ${MYSQL_PASSWORD} -set_in_service_config dbUrl "jdbc:mysql://${MYSQL_HOST}:${MYSQL_PORT}/${MYSQL_DATABASE}" +set_in_service_config dbUserName ${POSTGRES_USER} +set_in_service_config dbPassword ${POSTGRES_PASSWORD} +set_in_service_config dbUrl "jdbc:postgresql://${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DATABASE}" set_in_service_config lang ${BAZAAR_LANG} set_in_service_config country ${BAZAAR_COUNTRY} set_in_service_config baseURL ${BASE_URL} @@ -84,26 +82,6 @@ set_in_web_config crossOriginResourceMaxAge ${CROSS_ORIGIN_RESOURCE_MAX_AGE} set_in_web_config enableCrossOriginResourceSharing ${ENABLE_CROSS_ORIGIN_RESOURCE_SHARING} set_in_web_config oidcProviders ${OIDC_PROVIDERS} -# ensure the database is ready -while ! mysqladmin ping -h${MYSQL_HOST} -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} --silent; do - echo "Waiting for mysql at ${MYSQL_HOST}:${MYSQL_PORT}..." - sleep 1 -done -echo "${MYSQL_HOST}:${MYSQL_PORT} is available. Continuing..." - -# run migrations (does nothing if already migrated) -ant migrate-db - -if [[ ! -z "${INSERT_DEMO_DATA}" ]]; then - echo "Inserting demo data into the database..." - mysql -h${MYSQL_HOST} -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE} < ${DEMO_DATA_SQL} -fi - -if [[ ! -z "${INSERT_DEMO_DATA_FULL}" ]]; then - echo "Inserting demo data into the database..." - mysql -h${MYSQL_HOST} -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE} < ${DEMO_DATA_SQL_FULL} -fi - # wait for any bootstrap host to be available if [[ ! -z "${BOOTSTRAP}" ]]; then echo "Waiting for any bootstrap host to become available..." diff --git a/gradle.properties b/gradle.properties index c5b435ab..6c96c5f8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,8 +5,8 @@ service.version=0.9.0 service.name=de.rwth.dbis.acis.bazaar.service service.class=BazaarService jooq.version=3.14.4 -mysql.version=8.0.23 postgres.version=42.2.12 +liquibase.version=4.4.0 db.port=5432 db.hostname=localhost db.user=reqbaz diff --git a/reqbaz/build.gradle b/reqbaz/build.gradle index e1925af2..c17c0477 100644 --- a/reqbaz/build.gradle +++ b/reqbaz/build.gradle @@ -22,7 +22,7 @@ plugins { id "io.freefair.lombok" version "5.3.0" id 'com.github.ben-manes.versions' version '0.38.0' id 'jacoco' - id 'org.liquibase.gradle' version '2.0.3' + id 'org.liquibase.gradle' version '2.0.4' } application { @@ -52,8 +52,8 @@ dependencies { // Use JUnit test framework. testImplementation 'junit:junit:4.13' - liquibaseRuntime 'org.liquibase:liquibase-core:3.8.1' - liquibaseRuntime 'org.yaml:snakeyaml:1.15' + liquibaseRuntime "org.liquibase:liquibase-core:${project.property('liquibase.version')}" + liquibaseRuntime 'org.yaml:snakeyaml:1.29' liquibaseRuntime "org.postgresql:postgresql:${project.property('postgres.version')}" liquibaseRuntime 'javax.xml.bind:jaxb-api:2.3.1' @@ -165,12 +165,6 @@ jooq { database { name = 'org.jooq.meta.postgres.PostgresDatabase' inputSchema = "public" -// forcedTypes { -// forcedType { -// name = 'BOOLEAN' -// includeTypes = '(?i:TINYINT\\(1\\))' -// } -// } } generate { deprecated = false @@ -197,7 +191,8 @@ liquibase { activities { main { defaultSchemaName 'public' - changeLogFile "$projectDir/src/main/resources/changelog.yaml" + changeLogFile "src/main/resources/changelog.yaml" + classpath "$projectDir" url "jdbc:postgresql://${project.property('db.hostname')}:${project.property('db.port')}/${project.property('db.name')}" username "${project.property('db.user')}" password "${project.property('db.password')}" diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java index d1a5f7b4..95c4223e 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java @@ -58,6 +58,7 @@ public class Attachment extends EntityBase implements Ownable { @Size(min = 1, max = 1000) private String fileUrl; + @NotNull @Min(value = 0) private int requirementId; diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java index eb8a18b3..1565a260 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java @@ -29,6 +29,7 @@ public class Requirement extends EntityBase implements Ownable { private int id; + @NotNull @Size(min = 1, max = 50, message = "name must be between 1 and 50 characters") private String name; diff --git a/reqbaz/src/main/resources/changelog.yaml b/reqbaz/src/main/resources/changelog.yaml index c0e9c8ef..d38abc9c 100644 --- a/reqbaz/src/main/resources/changelog.yaml +++ b/reqbaz/src/main/resources/changelog.yaml @@ -398,61 +398,6 @@ databaseChangeLog: name: file_url type: VARCHAR(1000) tableName: attachment - - changeSet: - id: 1624138981933-12 - author: thore (generated) - changes: - - createTable: - columns: - - column: - constraints: - primaryKey: true - primaryKeyName: schema_version_pkey - name: installed_rank - type: INTEGER - - column: - name: version - type: VARCHAR(50) - - column: - constraints: - nullable: false - name: description - type: VARCHAR(200) - - column: - constraints: - nullable: false - name: type - type: VARCHAR(20) - - column: - constraints: - nullable: false - name: script - type: VARCHAR(1000) - - column: - name: checksum - type: INTEGER - - column: - constraints: - nullable: false - name: installed_by - type: VARCHAR(100) - - column: - constraints: - nullable: false - defaultValueComputed: now() - name: installed_on - type: TIMESTAMP WITHOUT TIME ZONE - - column: - constraints: - nullable: false - name: execution_time - type: INTEGER - - column: - constraints: - nullable: false - name: success - type: BOOLEAN - tableName: schema_version - changeSet: id: 1624138981933-13 author: thore (generated) @@ -974,16 +919,6 @@ databaseChangeLog: referencedColumnNames: id referencedTableName: category validate: true - - changeSet: - id: 1624138981933-38 - author: thore (generated) - changes: - - createIndex: - columns: - - column: - name: success - indexName: schema_version_s_idx - tableName: schema_version - changeSet: id: 1624138981933-39 author: thore (generated) From ec591afa042b6574556c5ea946a9a93205cafcb1 Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 10 Jul 2021 00:32:57 +0200 Subject: [PATCH 115/134] Property setup --- docker-entrypoint.sh | 55 ++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 40301101..c11bfc00 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -4,27 +4,28 @@ set -e # print all comands to console if DEBUG is set if [[ ! -z "${DEBUG}" ]]; then - set -x + set -x fi # set some helpful variables export SERVICE_PROPERTY_FILE='etc/de.rwth.dbis.acis.bazaar.service.BazaarService.properties' export WEB_CONNECTOR_PROPERTY_FILE='etc/i5.las2peer.webConnector.WebConnector.properties' -export SERVICE_VERSION=$(awk -F "=" '/service.version/ {print $2}' etc/ant_configuration/service.properties) -export SERVICE_NAME=$(awk -F "=" '/service.name/ {print $2}' etc/ant_configuration/service.properties) -export SERVICE_CLASS=$(awk -F "=" '/service.class/ {print $2}' etc/ant_configuration/service.properties) + +export SERVICE_VERSION=$(awk -F "=" '/service.version/ {print $2}' gradle.properties) +export SERVICE_NAME=$(awk -F "=" '/service.name/ {print $2}' gradle.properties) +export SERVICE_CLASS=$(awk -F "=" '/service.class/ {print $2}' gradle.properties) export SERVICE=${SERVICE_NAME}.${SERVICE_CLASS}@${SERVICE_VERSION} export POSTGRES_DATABASE='reqbaz' # check mandatory variables -[[ -z "${POSTGRES_USER}" ]] && \ - echo "Mandatory variable POSTGRES_USER is not set. Add -e POSTGRES_USER=reqbaz to your arguments." && exit 1 -[[ -z "${POSTGRES_PASSWORD}" ]] && \ - echo "Mandatory variable POSTGRES_PASSWORD is not set. Add -e POSTGRES_PASSWORD=mypasswd to your arguments." && exit 1 +[[ -z "${POSTGRES_USER}" ]] && + echo "Mandatory variable POSTGRES_USER is not set. Add -e POSTGRES_USER=reqbaz to your arguments." && exit 1 +[[ -z "${POSTGRES_PASSWORD}" ]] && + echo "Mandatory variable POSTGRES_PASSWORD is not set. Add -e POSTGRES_PASSWORD=mypasswd to your arguments." && exit 1 # set defaults for optional service parameters -[[ -z "${POSTGRES_HOST}" ]] && export MYSQL_HOST='postgres' -[[ -z "${POSTGRES_PORT}" ]] && export MYSQL_PORT='5432' +[[ -z "${POSTGRES_HOST}" ]] && export POSTGRES_HOST='postgres' +[[ -z "${POSTGRES_PORT}" ]] && export POSTGRES_PORT='5432' [[ -z "${SERVICE_PASSPHRASE}" ]] && export SERVICE_PASSPHRASE='Passphrase' [[ -z "${BAZAAR_LANG}" ]] && export BAZAAR_LANG='en' @@ -49,8 +50,8 @@ export POSTGRES_DATABASE='reqbaz' # configure service properties -function set_in_service_config { - sed -i "s?${1}[[:blank:]]*=.*?${1}=${2}?g" ${SERVICE_PROPERTY_FILE} +function set_in_service_config() { + sed -i "s?${1}[[:blank:]]*=.*?${1}=${2}?g" ${SERVICE_PROPERTY_FILE} } set_in_service_config dbUserName ${POSTGRES_USER} set_in_service_config dbPassword ${POSTGRES_PASSWORD} @@ -65,11 +66,10 @@ set_in_service_config smtpServer ${SMTP_SERVER} set_in_service_config emailFromAddress ${EMAIL_FROM_ADDRESS} set_in_service_config emailSummaryTimePeriodInMinutes ${EMAIL_SUMMARY_TIME_PERIOD_IN_MINUTES} - # configure web connector properties -function set_in_web_config { - sed -i "s?${1}[[:blank:]]*=.*?${1}=${2}?g" ${WEB_CONNECTOR_PROPERTY_FILE} +function set_in_web_config() { + sed -i "s?${1}[[:blank:]]*=.*?${1}=${2}?g" ${WEB_CONNECTOR_PROPERTY_FILE} } set_in_web_config httpPort ${HTTP_PORT} set_in_web_config httpsPort ${HTTPS_PORT} @@ -84,28 +84,27 @@ set_in_web_config oidcProviders ${OIDC_PROVIDERS} # wait for any bootstrap host to be available if [[ ! -z "${BOOTSTRAP}" ]]; then - echo "Waiting for any bootstrap host to become available..." - for host_port in ${BOOTSTRAP//,/ }; do - arr_host_port=(${host_port//:/ }) - host=${arr_host_port[0]} - port=${arr_host_port[1]} - if { /dev/null; then - echo "${host_port} is available. Continuing..." - break - fi - done + echo "Waiting for any bootstrap host to become available..." + for host_port in ${BOOTSTRAP//,/ }; do + arr_host_port=(${host_port//:/ }) + host=${arr_host_port[0]} + port=${arr_host_port[1]} + if { /dev/null; then + echo "${host_port} is available. Continuing..." + break + fi + done fi # prevent glob expansion in lib/* set -f LAUNCH_COMMAND='java -cp lib/*:service/* i5.las2peer.tools.L2pNodeLauncher -s service -p '"${LAS2PEER_PORT} ${SERVICE_EXTRA_ARGS}" if [[ ! -z "${BOOTSTRAP}" ]]; then - LAUNCH_COMMAND="${LAUNCH_COMMAND} -b ${BOOTSTRAP}" + LAUNCH_COMMAND="${LAUNCH_COMMAND} -b ${BOOTSTRAP}" fi # start the service within a las2peer node -if [[ -z "${@}" ]] -then +if [[ -z "${@}" ]]; then exec ${LAUNCH_COMMAND} startService\("'""${SERVICE}""'", "'""${SERVICE_PASSPHRASE}""'"\) startWebConnector else exec ${LAUNCH_COMMAND} ${@} From 6704db27325f4daa023ad7a3f53b8bd4ff125699 Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 10 Jul 2021 15:26:59 +0200 Subject: [PATCH 116/134] Build logdir into container --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 1f517fa1..16c9e25c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,7 @@ WORKDIR /src COPY --chown=las2peer:las2peer ./reqbaz/build/export/ . COPY --chown=las2peer:las2peer docker-entrypoint.sh /src/docker-entrypoint.sh COPY --chown=las2peer:las2peer gradle.properties /src/gradle.properties +RUN mkdir /src/log && chown -R las2peer:las2peer /src # run the rest as unprivileged user USER las2peer From a9858863d9d9037e4afb1c9a8c3dbdeadcf561df Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 10 Jul 2021 16:05:59 +0200 Subject: [PATCH 117/134] Add files for liquibase init container --- .github/workflows/build_container.yaml | 20 ++++++++++++++++++++ DockerfileInit | 4 ++++ 2 files changed, 24 insertions(+) create mode 100644 DockerfileInit diff --git a/.github/workflows/build_container.yaml b/.github/workflows/build_container.yaml index 1d077073..8eb03d1e 100644 --- a/.github/workflows/build_container.yaml +++ b/.github/workflows/build_container.yaml @@ -41,6 +41,18 @@ jobs: type=ref,event=branch type=semver,pattern={{version}} type=sha + - name: Docker metadata setup for init container + id: meta-init + uses: docker/metadata-action@v3 + with: + # list of Docker images to use as base name for tags + images: | + ghcr.io/rwth-acis/requirementsbazaar-init + # generate Docker tags based on the following events/attributes + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + type=sha - name: Login to Packages Container registry uses: docker/login-action@v1 with: @@ -54,3 +66,11 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + - name: Build and push init container + uses: docker/build-push-action@v2 + with: + context: . + file: DockerfileInit + push: true + tags: ${{ steps.meta-init.outputs.tags }} + labels: ${{ steps.meta-init.outputs.labels }} diff --git a/DockerfileInit b/DockerfileInit new file mode 100644 index 00000000..96251ee8 --- /dev/null +++ b/DockerfileInit @@ -0,0 +1,4 @@ +FROM liquibase/liquibase + +ADD reqbaz/src/main/resources/changelog.yaml reqbaz/src/main/resources/base-permissions.sql /liquibase/changelog +CMD ["sh", "-c", "docker-entrypoint.sh --url="jdbc:postgresql://${HOST}:5432/reqbaz" --username=${USERNAME} --password=${PASSWORD} --classpath=/liquibase/changelog --changeLogFile=/liquibase/changelog/changelog.yaml update"] From 87573ec068c4d314b3fb2b88f6eb0e38d572b69a Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 10 Jul 2021 17:20:39 +0200 Subject: [PATCH 118/134] Fix init container --- Dockerfile | 1 + DockerfileInit | 7 ++++--- reqbaz/build.gradle | 4 ++-- reqbaz/src/main/resources/changelog.yaml | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 16c9e25c..ed21b873 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,4 +22,5 @@ USER las2peer EXPOSE $HTTP_PORT EXPOSE $HTTPS_PORT EXPOSE $LAS2PEER_PORT + ENTRYPOINT ["/src/docker-entrypoint.sh"] diff --git a/DockerfileInit b/DockerfileInit index 96251ee8..9aa094b2 100644 --- a/DockerfileInit +++ b/DockerfileInit @@ -1,4 +1,5 @@ -FROM liquibase/liquibase +FROM liquibase/liquibase:4.4.0 -ADD reqbaz/src/main/resources/changelog.yaml reqbaz/src/main/resources/base-permissions.sql /liquibase/changelog -CMD ["sh", "-c", "docker-entrypoint.sh --url="jdbc:postgresql://${HOST}:5432/reqbaz" --username=${USERNAME} --password=${PASSWORD} --classpath=/liquibase/changelog --changeLogFile=/liquibase/changelog/changelog.yaml update"] +ADD reqbaz/src/main/resources/changelog.yaml reqbaz/src/main/resources/base-permissions.sql /liquibase/changelog/ + +CMD docker-entrypoint.sh --url=jdbc:postgresql://${HOST}:5432/reqbaz --username=${USERNAME} --password=${PASSWORD} --classpath=/liquibase/changelog --changeLogFile=changelog.yaml update diff --git a/reqbaz/build.gradle b/reqbaz/build.gradle index c17c0477..0ed2d5b2 100644 --- a/reqbaz/build.gradle +++ b/reqbaz/build.gradle @@ -191,8 +191,8 @@ liquibase { activities { main { defaultSchemaName 'public' - changeLogFile "src/main/resources/changelog.yaml" - classpath "$projectDir" + changeLogFile "changelog.yaml" + classpath "$projectDir/src/main/resources" url "jdbc:postgresql://${project.property('db.hostname')}:${project.property('db.port')}/${project.property('db.name')}" username "${project.property('db.user')}" password "${project.property('db.password')}" diff --git a/reqbaz/src/main/resources/changelog.yaml b/reqbaz/src/main/resources/changelog.yaml index d38abc9c..55a8eb42 100644 --- a/reqbaz/src/main/resources/changelog.yaml +++ b/reqbaz/src/main/resources/changelog.yaml @@ -1668,5 +1668,5 @@ databaseChangeLog: comment: Basic Role and Permission Maps endDelimiter: \nGO splitStatements: true - path: src/main/resources/base-permissions.sql + path: base-permissions.sql stripComments: true From dd6ea417499e80c3ffccdd50af46e9a2bbd10478 Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 17 Jul 2021 15:02:57 +0200 Subject: [PATCH 119/134] Try setting external ip for pastry --- docker-entrypoint.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index c11bfc00..1a91049d 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -82,6 +82,11 @@ set_in_web_config crossOriginResourceMaxAge ${CROSS_ORIGIN_RESOURCE_MAX_AGE} set_in_web_config enableCrossOriginResourceSharing ${ENABLE_CROSS_ORIGIN_RESOURCE_SHARING} set_in_web_config oidcProviders ${OIDC_PROVIDERS} +# set pod ip in pastry conf +if [[ ! -z "${POD_IP}" ]]; then + echo external_address = ${POD_IP}:${LAS2PEER_PORT} > etc/pastry.properties +fi + # wait for any bootstrap host to be available if [[ ! -z "${BOOTSTRAP}" ]]; then echo "Waiting for any bootstrap host to become available..." From cdd9f61fc7271972c6c349b564b1bbd8c1ac27f2 Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 17 Jul 2021 18:33:07 +0200 Subject: [PATCH 120/134] add more debug utils to container --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ed21b873..24b51e1f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ ENV LAS2PEER_PORT=9011 RUN addgroup -g 1000 -S las2peer && \ adduser -u 1000 -S las2peer -G las2peer -RUN apk add --update bash && rm -f /var/cache/apk/* +RUN apk add --update bash iproute2 && rm -f /var/cache/apk/* WORKDIR /src From 693a08d69765c5186207929066914e19e86b0e4a Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 17 Jul 2021 18:44:30 +0200 Subject: [PATCH 121/134] Also pin bind address --- docker-entrypoint.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 1a91049d..16d3fd57 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -85,6 +85,8 @@ set_in_web_config oidcProviders ${OIDC_PROVIDERS} # set pod ip in pastry conf if [[ ! -z "${POD_IP}" ]]; then echo external_address = ${POD_IP}:${LAS2PEER_PORT} > etc/pastry.properties + echo socket_bindAddress = ${POD_IP} >> etc/pastry.properties + fi # wait for any bootstrap host to be available From 8289ad4404810b4161d5bfdbba48d00145902dcd Mon Sep 17 00:00:00 2001 From: Thore Date: Thu, 29 Jul 2021 18:05:41 +0200 Subject: [PATCH 122/134] Fix reduce attachment api friction --- docker-entrypoint.sh | 66 ++-- .../acis/bazaar/service/BazaarService.java | 324 +++++++++--------- .../bazaar/service/dal/DALFacadeImpl.java | 30 ++ .../resources/AttachmentsResource.java | 310 ----------------- .../resources/RequirementsResource.java | 71 +++- .../dbis/acis/bazaar/service/BazaarTest.java | 3 +- 6 files changed, 285 insertions(+), 519 deletions(-) delete mode 100644 reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/AttachmentsResource.java diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 7716f83a..5fba1f9d 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -4,7 +4,7 @@ set -e # print all comands to console if DEBUG is set if [[ ! -z "${DEBUG}" ]]; then - set -x + set -x fi # set some helpful variables @@ -19,10 +19,10 @@ export DEMO_DATA_SQL_FULL='etc/migrations/add_reqbaz_demo_data_full.sql' export MYSQL_DATABASE='reqbaz' # check mandatory variables -[[ -z "${MYSQL_USER}" ]] && \ - echo "Mandatory variable MYSQL_USER is not set. Add -e MYSQL_USER=myuser to your arguments." && exit 1 -[[ -z "${MYSQL_PASSWORD}" ]] && \ - echo "Mandatory variable MYSQL_PASSWORD is not set. Add -e MYSQL_PASSWORD=mypasswd to your arguments." && exit 1 +[[ -z "${MYSQL_USER}" ]] && + echo "Mandatory variable MYSQL_USER is not set. Add -e MYSQL_USER=myuser to your arguments." && exit 1 +[[ -z "${MYSQL_PASSWORD}" ]] && + echo "Mandatory variable MYSQL_PASSWORD is not set. Add -e MYSQL_PASSWORD=mypasswd to your arguments." && exit 1 # set defaults for optional service parameters [[ -z "${MYSQL_HOST}" ]] && export MYSQL_HOST='mysql' @@ -51,8 +51,8 @@ export MYSQL_DATABASE='reqbaz' # configure service properties -function set_in_service_config { - sed -i "s?${1}[[:blank:]]*=.*?${1}=${2}?g" ${SERVICE_PROPERTY_FILE} +function set_in_service_config() { + sed -i "s?${1}[[:blank:]]*=.*?${1}=${2}?g" ${SERVICE_PROPERTY_FILE} } set_in_service_config dbUserName ${MYSQL_USER} set_in_service_config dbPassword ${MYSQL_PASSWORD} @@ -67,11 +67,10 @@ set_in_service_config smtpServer ${SMTP_SERVER} set_in_service_config emailFromAddress ${EMAIL_FROM_ADDRESS} set_in_service_config emailSummaryTimePeriodInMinutes ${EMAIL_SUMMARY_TIME_PERIOD_IN_MINUTES} - # configure web connector properties -function set_in_web_config { - sed -i "s?${1}[[:blank:]]*=.*?${1}=${2}?g" ${WEB_CONNECTOR_PROPERTY_FILE} +function set_in_web_config() { + sed -i "s?${1}[[:blank:]]*=.*?${1}=${2}?g" ${WEB_CONNECTOR_PROPERTY_FILE} } set_in_web_config httpPort ${HTTP_PORT} set_in_web_config httpsPort ${HTTPS_PORT} @@ -84,50 +83,35 @@ set_in_web_config crossOriginResourceMaxAge ${CROSS_ORIGIN_RESOURCE_MAX_AGE} set_in_web_config enableCrossOriginResourceSharing ${ENABLE_CROSS_ORIGIN_RESOURCE_SHARING} set_in_web_config oidcProviders ${OIDC_PROVIDERS} -# ensure the database is ready -while ! mysqladmin ping -h${MYSQL_HOST} -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} --silent; do - echo "Waiting for mysql at ${MYSQL_HOST}:${MYSQL_PORT}..." - sleep 1 -done -echo "${MYSQL_HOST}:${MYSQL_PORT} is available. Continuing..." - -# run migrations (does nothing if already migrated) -ant migrate-db - -if [[ ! -z "${INSERT_DEMO_DATA}" ]]; then - echo "Inserting demo data into the database..." - mysql -h${MYSQL_HOST} -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE} < ${DEMO_DATA_SQL} -fi - -if [[ ! -z "${INSERT_DEMO_DATA_FULL}" ]]; then - echo "Inserting demo data into the database..." - mysql -h${MYSQL_HOST} -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE} < ${DEMO_DATA_SQL_FULL} +# set pod ip in pastry conf +if [[ ! -z "${POD_IP}" ]]; then + echo external_address = ${POD_IP}:${LAS2PEER_PORT} >etc/pastry.properties + echo socket_bindAddress = ${POD_IP} >>etc/pastry.properties fi # wait for any bootstrap host to be available if [[ ! -z "${BOOTSTRAP}" ]]; then - echo "Waiting for any bootstrap host to become available..." - for host_port in ${BOOTSTRAP//,/ }; do - arr_host_port=(${host_port//:/ }) - host=${arr_host_port[0]} - port=${arr_host_port[1]} - if { /dev/null; then - echo "${host_port} is available. Continuing..." - break - fi - done + echo "Waiting for any bootstrap host to become available..." + for host_port in ${BOOTSTRAP//,/ }; do + arr_host_port=(${host_port//:/ }) + host=${arr_host_port[0]} + port=${arr_host_port[1]} + if { /dev/null; then + echo "${host_port} is available. Continuing..." + break + fi + done fi # prevent glob expansion in lib/* set -f LAUNCH_COMMAND='java -cp lib/*:service/* i5.las2peer.tools.L2pNodeLauncher -s service -p '"${LAS2PEER_PORT} ${SERVICE_EXTRA_ARGS}" if [[ ! -z "${BOOTSTRAP}" ]]; then - LAUNCH_COMMAND="${LAUNCH_COMMAND} -b ${BOOTSTRAP}" + LAUNCH_COMMAND="${LAUNCH_COMMAND} -b ${BOOTSTRAP}" fi # start the service within a las2peer node -if [[ -z "${@}" ]] -then +if [[ -z "${@}" ]]; then exec ${LAUNCH_COMMAND} startService\("'""${SERVICE}""'", "'""${SERVICE_PASSPHRASE}""'"\) startWebConnector else exec ${LAUNCH_COMMAND} ${@} diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java index b56fdbef..69a50324 100755 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java @@ -83,6 +83,8 @@ @ServicePath("/bazaar") public class BazaarService extends RESTService { + private static final ObjectMapper mapper = new ObjectMapper().registerModule(new JavaTimeModule()).setSerializationInclusion(JsonInclude.Include.NON_NULL); + private final L2pLogger logger = L2pLogger.getInstance(BazaarService.class.getName()); //CONFIG PROPERTIES protected String dbUserName; protected String dbPassword; @@ -96,27 +98,10 @@ public class BazaarService extends RESTService { protected String smtpServer; protected String emailFromAddress; protected String emailSummaryTimePeriodInMinutes; - - private ValidatorFactory validatorFactory; - private List functionRegistrar; - private NotificationDispatcher notificationDispatcher; - private DataSource dataSource; - - private final L2pLogger logger = L2pLogger.getInstance(BazaarService.class.getName()); - private static ObjectMapper mapper = new ObjectMapper().registerModule(new JavaTimeModule()).setSerializationInclusion(JsonInclude.Include.NON_NULL); - - @Override - protected void initResources() { - getResourceConfig().register(Resource.class); - getResourceConfig().register(ProjectsResource.class); - getResourceConfig().register(CategoryResource.class); - getResourceConfig().register(RequirementsResource.class); - getResourceConfig().register(CommentsResource.class); - getResourceConfig().register(AttachmentsResource.class); - getResourceConfig().register(UsersResource.class); - //getResourceConfig().register(PersonalisationDataResource.class); - getResourceConfig().register(FeedbackResource.class); - } + private final ValidatorFactory validatorFactory; + private final List functionRegistrar; + private final NotificationDispatcher notificationDispatcher; + private final DataSource dataSource; public BazaarService() throws Exception { setFieldValues(); @@ -173,136 +158,34 @@ public BazaarService() throws Exception { notificationDispatcher.setBazaarService(this); } - public String getBaseURL() { - return baseURL; + public static DataSource setupDataSource(String dbUrl, String dbUserName, String dbPassword) { + BasicDataSource dataSource = new BasicDataSource(); + // Deprecated according to jooq + // dataSource.setDriverClassName("com.mysql.jdbc.Driver"); + dataSource.setUrl(dbUrl + "?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true" + + ""); + dataSource.setUsername(dbUserName); + dataSource.setPassword(dbPassword); + dataSource.setValidationQuery("SELECT 1;"); + dataSource.setTestOnBorrow(true); // test each connection when borrowing from the pool with the validation query + dataSource.setMaxConnLifetimeMillis(1000 * 60 * 60); // max connection life time 1h. mysql drops connection after 8h. + return dataSource; } + @Override + protected void initResources() { + getResourceConfig().register(Resource.class); + getResourceConfig().register(ProjectsResource.class); + getResourceConfig().register(CategoryResource.class); + getResourceConfig().register(RequirementsResource.class); + getResourceConfig().register(CommentsResource.class); + getResourceConfig().register(UsersResource.class); + //getResourceConfig().register(PersonalisationDataResource.class); + getResourceConfig().register(FeedbackResource.class); + } - @Api(value = "/", description = "Bazaar service") - @SwaggerDefinition( - info = @Info( - title = "Requirements Bazaar", - version = "0.9.0", - description = "Requirements Bazaar project", - termsOfService = "http://requirements-bazaar.org", - contact = @Contact( - name = "Requirements Bazaar Dev Team", - url = "http://requirements-bazaar.org", - email = "info@requirements-bazaar.org" - ), - license = @License( - name = "Apache2", - url = "http://requirements-bazaar.org/license" - ) - ), - schemes = SwaggerDefinition.Scheme.HTTPS - ) - @Path("/") - public static class Resource { - - private final BazaarService bazaarService = (BazaarService) Context.getCurrent().getService(); - - /** - * This method allows to retrieve the service name version. - * - * @return Response with service name version as a JSON object. - */ - @GET - @Path("/version") - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "This method allows to retrieve the service name version.") - @ApiResponses(value = { - @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns service name version"), - @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") - }) - public Response getServiceNameVersion() { - try { - String serviceNameVersion = Context.getCurrent().getService().getAgent().getServiceNameVersion().toString(); - return Response.ok("{\"version\": \"" + serviceNameVersion + "\"}").build(); - } catch (ServiceException ex) { - BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); - Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get service name version failed"); - bazaarService.logger.warning(bex.getMessage()); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } - } - - /** - * This method allows to retrieve statistics over all projects. - * - * @param since timestamp since filter, ISO-8601 e.g. 2017-12-30 or 2017-12-30T18:30:00Z - * @return Response with statistics as a JSON object. - */ - @GET - @Path("/statistics") - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "This method allows to retrieve statistics over all projects.") - @ApiResponses(value = { - @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns statistics", response = Statistic.class), - @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), - @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") - }) - public Response getStatistics( - @ApiParam(value = "Since timestamp, ISO-8601 e.g. 2017-12-30 or 2017-12-30T18:30:00Z", required = false) @QueryParam("since") String since) { - DALFacade dalFacade = null; - try { - String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); - if (registrarErrors != null) { - ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); - } - Agent agent = Context.getCurrent().getMainAgent(); - String userId = agent.getIdentifier(); - dalFacade = bazaarService.getDBConnection(); - Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); - Calendar sinceCal = since == null ? null : DatatypeConverter.parseDateTime(since); - Statistic platformStatistics = dalFacade.getStatisticsForAllProjects(internalUserId, sinceCal); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_2, - 0, Activity.DataType.STATISTIC, internalUserId); - return Response.ok(platformStatistics.toJSON()).build(); - } catch (BazaarException bex) { - if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { - return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { - return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } else { - bazaarService.logger.warning(bex.getMessage()); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } - } catch (Exception ex) { - BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); - Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get statistics failed"); - bazaarService.logger.warning(bex.getMessage()); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } finally { - bazaarService.closeDBConnection(dalFacade); - } - } - - /** - * This method sends all notifications (emails) in the waiting queue. Run this method before shutting down Requirements Bazaar. - * - * @return Response - */ - @POST - @Path("/notifications") - @ApiOperation(value = "This method sends all notifications (emails) in the waiting queue. Run this method before shutting down Requirements Bazaar.") - @ApiResponses(value = { - @ApiResponse(code = HttpURLConnection.HTTP_CREATED, message = "Notifications send"), - @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), - @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") - }) - public Response sendNotifications() { - // TODO: Use authorization scopes to limit users who can run this method to admins - try { - bazaarService.notificationDispatcher.run(); - return Response.status(Response.Status.CREATED).build(); - } catch (Exception ex) { - BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); - Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Send Notifications failed"); - bazaarService.logger.warning(bex.getMessage()); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } - } + public String getBaseURL() { + return baseURL; } public String notifyRegistrars(EnumSet functions) { @@ -386,26 +269,14 @@ private void registerUserAtFirstLogin() throws Exception { } } - public static DataSource setupDataSource(String dbUrl, String dbUserName, String dbPassword) { - BasicDataSource dataSource = new BasicDataSource(); - // Deprecated according to jooq - // dataSource.setDriverClassName("com.mysql.jdbc.Driver"); - dataSource.setUrl(dbUrl + "?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true" + - ""); - dataSource.setUsername(dbUserName); - dataSource.setPassword(dbPassword); - dataSource.setValidationQuery("SELECT 1;"); - dataSource.setTestOnBorrow(true); // test each connection when borrowing from the pool with the validation query - dataSource.setMaxConnLifetimeMillis(1000 * 60 * 60); // max connection life time 1h. mysql drops connection after 8h. - return dataSource; - } - public DALFacade getDBConnection() throws Exception { // TODO: Specify Exception return new DALFacadeImpl(dataSource, SQLDialect.MYSQL); } public void closeDBConnection(DALFacade dalFacade) { - if (dalFacade == null) return; + if (dalFacade == null) { + return; + } dalFacade.close(); } @@ -448,4 +319,131 @@ public Response.ResponseBuilder xHeaderFields(Response.ResponseBuilder responseB return responseBuilder; } + @Api(value = "/", description = "Bazaar service") + @SwaggerDefinition( + info = @Info( + title = "Requirements Bazaar", + version = "0.9.0", + description = "Requirements Bazaar project", + termsOfService = "http://requirements-bazaar.org", + contact = @Contact( + name = "Requirements Bazaar Dev Team", + url = "http://requirements-bazaar.org", + email = "info@requirements-bazaar.org" + ), + license = @License( + name = "Apache2", + url = "http://requirements-bazaar.org/license" + ) + ), + schemes = SwaggerDefinition.Scheme.HTTPS + ) + @Path("/") + public static class Resource { + + private final BazaarService bazaarService = (BazaarService) Context.getCurrent().getService(); + + /** + * This method allows to retrieve the service name version. + * + * @return Response with service name version as a JSON object. + */ + @GET + @Path("/version") + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "This method allows to retrieve the service name version.") + @ApiResponses(value = { + @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns service name version"), + @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") + }) + public Response getServiceNameVersion() { + try { + String serviceNameVersion = Context.getCurrent().getService().getAgent().getServiceNameVersion().toString(); + return Response.ok("{\"version\": \"" + serviceNameVersion + "\"}").build(); + } catch (ServiceException ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get service name version failed"); + bazaarService.logger.warning(bex.getMessage()); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } + } + + /** + * This method allows to retrieve statistics over all projects. + * + * @param since timestamp since filter, ISO-8601 e.g. 2017-12-30 or 2017-12-30T18:30:00Z + * @return Response with statistics as a JSON object. + */ + @GET + @Path("/statistics") + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "This method allows to retrieve statistics over all projects.") + @ApiResponses(value = { + @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns statistics", response = Statistic.class), + @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), + @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") + }) + public Response getStatistics( + @ApiParam(value = "Since timestamp, ISO-8601 e.g. 2017-12-30 or 2017-12-30T18:30:00Z", required = false) @QueryParam("since") String since) { + DALFacade dalFacade = null; + try { + String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); + if (registrarErrors != null) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); + } + Agent agent = Context.getCurrent().getMainAgent(); + String userId = agent.getIdentifier(); + dalFacade = bazaarService.getDBConnection(); + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + Calendar sinceCal = since == null ? null : DatatypeConverter.parseDateTime(since); + Statistic platformStatistics = dalFacade.getStatisticsForAllProjects(internalUserId, sinceCal); + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_2, + 0, Activity.DataType.STATISTIC, internalUserId); + return Response.ok(platformStatistics.toJSON()).build(); + } catch (BazaarException bex) { + if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { + return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { + return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else { + bazaarService.logger.warning(bex.getMessage()); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } + } catch (Exception ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get statistics failed"); + bazaarService.logger.warning(bex.getMessage()); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } finally { + bazaarService.closeDBConnection(dalFacade); + } + } + + /** + * This method sends all notifications (emails) in the waiting queue. Run this method before shutting down Requirements Bazaar. + * + * @return Response + */ + @POST + @Path("/notifications") + @ApiOperation(value = "This method sends all notifications (emails) in the waiting queue. Run this method before shutting down Requirements Bazaar.") + @ApiResponses(value = { + @ApiResponse(code = HttpURLConnection.HTTP_CREATED, message = "Notifications send"), + @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), + @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") + }) + public Response sendNotifications() { + // TODO: Use authorization scopes to limit users who can run this method to admins + try { + bazaarService.notificationDispatcher.run(); + return Response.status(Response.Status.CREATED).build(); + } catch (Exception ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Send Notifications failed"); + bazaarService.logger.warning(bex.getMessage()); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } + } + } + } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index 3407ac42..bcbaeaa2 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -385,9 +385,39 @@ public Requirement modifyRequirement(Requirement modifiedRequirement, int userId e.printStackTrace(); } }); + } + // Synchronize attachments + if (modifiedRequirement.getAttachments() != null) { + // Check if tags have changed + for (Attachment attachment : modifiedRequirement.getAttachments()) { + try { + Attachment internalAttachment = null; + if (attachment.getId() != 0) { + internalAttachment = getAttachmentById(attachment.getId()); + } + // Check if attachment exists, otherwise create + if (internalAttachment == null) { + attachment.setRequirementId(modifiedRequirement.getId()); + attachment.setCreator(getUserById(userId)); + createAttachment(attachment); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + // Remove tags no longer present + oldRequirement.getAttachments().stream().filter(attachment -> modifiedRequirement.getAttachments().contains(attachment)).forEach(attachment -> { + try { + deleteAttachmentById(attachment.getId()); + } catch (Exception e) { + e.printStackTrace(); + } + }); } + return getRequirementById(modifiedRequirement.getId(), userId); } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/AttachmentsResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/AttachmentsResource.java deleted file mode 100644 index 09c12275..00000000 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/AttachmentsResource.java +++ /dev/null @@ -1,310 +0,0 @@ -package de.rwth.dbis.acis.bazaar.service.resources; - -import de.rwth.dbis.acis.bazaar.service.BazaarFunction; -import de.rwth.dbis.acis.bazaar.service.BazaarService; -import de.rwth.dbis.acis.bazaar.service.dal.DALFacade; -import de.rwth.dbis.acis.bazaar.service.dal.entities.*; -import de.rwth.dbis.acis.bazaar.service.dal.helpers.PageInfo; -import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; -import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; -import de.rwth.dbis.acis.bazaar.service.exception.ErrorCode; -import de.rwth.dbis.acis.bazaar.service.exception.ExceptionHandler; -import de.rwth.dbis.acis.bazaar.service.exception.ExceptionLocation; -import de.rwth.dbis.acis.bazaar.service.internalization.Localization; -import de.rwth.dbis.acis.bazaar.service.security.AuthorizationManager; -import i5.las2peer.api.Context; -import i5.las2peer.api.logging.MonitoringEvent; -import i5.las2peer.api.security.Agent; -import i5.las2peer.logging.L2pLogger; -import io.swagger.annotations.*; - -import javax.validation.ConstraintViolation; -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import java.net.HttpURLConnection; -import java.time.LocalDateTime; -import java.util.*; - - -@Api(value = "attachments", description = "Attachments resource") -@SwaggerDefinition( - info = @Info( - title = "Requirements Bazaar", - version = "0.9.0", - description = "Requirements Bazaar project", - termsOfService = "http://requirements-bazaar.org", - contact = @Contact( - name = "Requirements Bazaar Dev Team", - url = "http://requirements-bazaar.org", - email = "info@requirements-bazaar.org" - ), - license = @License( - name = "Apache2", - url = "http://requirements-bazaar.org/license" - ) - ), - schemes = SwaggerDefinition.Scheme.HTTPS -) -@Path("/attachments") -public class AttachmentsResource { - - private final L2pLogger logger = L2pLogger.getInstance(AttachmentsResource.class.getName()); - private BazaarService bazaarService; - - public AttachmentsResource() throws Exception { - bazaarService = (BazaarService) Context.getCurrent().getService(); - } - - /** - * This method returns the list of attachments for a specific requirement. - * - * @param requirementId id of the requirement - * @param page page number - * @param perPage number of projects by page - * @return Response with comments as a JSON array. - */ - public Response getAttachmentsForRequirement(int requirementId, int page, int perPage) { - DALFacade dalFacade = null; - try { - Agent agent = Context.getCurrent().getMainAgent(); - String userId = agent.getIdentifier(); - String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); - if (registrarErrors != null) { - ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); - } - PageInfo pageInfo = new PageInfo(page, perPage); - Set> violations = bazaarService.validate(pageInfo); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); - - dalFacade = bazaarService.getDBConnection(); - //Todo use requirement's projectId for security context, not the one sent from client - Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); - Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); - Project project = dalFacade.getProjectById(requirement.getProjectId(), internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_44, - requirement.getId(), Activity.DataType.REQUIREMENT, internalUserId); - if (dalFacade.isRequirementPublic(requirementId)) { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_COMMENT, project.getId(), dalFacade); - if (!authorized) { - ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.anonymous")); - } - } else { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_COMMENT, project.getId(), dalFacade); - if (!authorized) { - ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.comment.read")); - } - } - PaginationResult attachmentsResult = dalFacade.listAttachmentsByRequirementId(requirementId, pageInfo); - - Map> parameter = new HashMap<>(); - parameter.put("page", new ArrayList() {{ - add(String.valueOf(page)); - }}); - parameter.put("per_page", new ArrayList() {{ - add(String.valueOf(perPage)); - }}); - - Response.ResponseBuilder responseBuilder = Response.ok(); - responseBuilder = responseBuilder.entity(attachmentsResult.toJSON()); - responseBuilder = bazaarService.paginationLinks(responseBuilder, attachmentsResult, "requirements/" + String.valueOf(requirementId) + "/attachments", parameter); - responseBuilder = bazaarService.xHeaderFields(responseBuilder, attachmentsResult); - - return responseBuilder.build(); - } catch (BazaarException bex) { - if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { - return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { - return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } else { - logger.warning(bex.getMessage()); - Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get attachments for requirement " + requirementId); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } - } catch (Exception ex) { - BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); - logger.warning(bex.getMessage()); - Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get attachments for requirement " + requirementId); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } finally { - bazaarService.closeDBConnection(dalFacade); - } - } - - /** - * This method allows to retrieve a certain attachment. - * - * @param attachmentId id of the attachment - * @return Response with attachment as a JSON object. - */ - @GET - @Path("/{attachmentId}") - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "This method allows to retrieve a certain attachment") - @ApiResponses(value = { - @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns a certain attachment", response = Attachment.class), - @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), - @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), - @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") - }) - public Response getAttachment(@PathParam("attachmentId") int attachmentId) { - DALFacade dalFacade = null; - try { - Agent agent = Context.getCurrent().getMainAgent(); - String userId = agent.getIdentifier(); - String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); - if (registrarErrors != null) { - ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); - } - dalFacade = bazaarService.getDBConnection(); - Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); - Attachment attachment = dalFacade.getAttachmentById(attachmentId); - Requirement requirement = dalFacade.getRequirementById(attachment.getRequirementId(), internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_49, - attachment.getId(), Activity.DataType.ATTACHMENT, internalUserId); - if (dalFacade.isProjectPublic(requirement.getProjectId())) { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_ATTACHMENT, requirement.getProjectId(), dalFacade); - if (!authorized) { - ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.anonymous")); - } - } else { - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_ATTACHMENT, requirement.getProjectId(), dalFacade); - if (!authorized) { - ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.attachment.read")); - } - } - return Response.ok(attachment.toJSON()).build(); - } catch (BazaarException bex) { - if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { - return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { - return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } else { - logger.warning(bex.getMessage()); - Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get attachment " + attachmentId); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } - } catch (Exception ex) { - BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); - logger.warning(bex.getMessage()); - Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get attachment " + attachmentId); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } finally { - bazaarService.closeDBConnection(dalFacade); - } - } - - /** - * This method allows to create a new attachment. - * - * @param attachmentToCreate as JSON object - * @return Response with the created attachment as JSON object. - */ - @POST - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "This method allows to create a new attachment.") - @ApiResponses(value = { - @ApiResponse(code = HttpURLConnection.HTTP_CREATED, message = "Returns the created attachment", response = Attachment.class), - @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), - @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), - @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") - }) - public Response createAttachment(@ApiParam(value = "Attachment entity as JSON", required = true) Attachment attachmentToCreate) { - DALFacade dalFacade = null; - try { - Agent agent = Context.getCurrent().getMainAgent(); - String userId = agent.getIdentifier(); - String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); - if (registrarErrors != null) { - ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); - } - Set> violations = bazaarService.validateCreate(attachmentToCreate); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); - - dalFacade = bazaarService.getDBConnection(); - Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); - Requirement requirement = dalFacade.getRequirementById(attachmentToCreate.getRequirementId(), internalUserId); - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Create_ATTACHMENT, requirement.getProjectId(), dalFacade); - if (!authorized) { - ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.attachment.create")); - } - attachmentToCreate.setCreator(dalFacade.getUserById(internalUserId)); - Attachment createdAttachment = dalFacade.createAttachment(attachmentToCreate); - bazaarService.getNotificationDispatcher().dispatchNotification(createdAttachment.getCreationDate(), Activity.ActivityAction.CREATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_50, - createdAttachment.getId(), Activity.DataType.ATTACHMENT, internalUserId); - return Response.status(Response.Status.CREATED).entity(createdAttachment.toJSON()).build(); - } catch (BazaarException bex) { - if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { - return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } else { - logger.warning(bex.getMessage()); - L2pLogger.logEvent(MonitoringEvent.SERVICE_CUSTOM_MESSAGE_50, Context.getCurrent().getMainAgent(), "Create attachment"); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } - } catch (Exception ex) { - BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); - logger.warning(bex.getMessage()); - L2pLogger.logEvent(MonitoringEvent.SERVICE_CUSTOM_MESSAGE_50, Context.getCurrent().getMainAgent(), "Create attachment"); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } finally { - bazaarService.closeDBConnection(dalFacade); - } - } - - /** - * This method deletes a specific attachment. - * - * @param attachmentId id of the attachment, which should be deleted - * @return Response with the deleted attachment as a JSON object. - */ - @DELETE - @Path("/{attachmentId}") - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "This method deletes a specific attachment.") - @ApiResponses(value = { - @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns the deleted attachment", response = Attachment.class), - @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), - @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found"), - @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") - }) - public Response deleteAttachment(@PathParam("attachmentId") int attachmentId) { - DALFacade dalFacade = null; - try { - Agent agent = Context.getCurrent().getMainAgent(); - String userId = agent.getIdentifier(); - String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); - if (registrarErrors != null) { - ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); - } - dalFacade = bazaarService.getDBConnection(); - Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); - Requirement requirement = dalFacade.getRequirementById(attachmentId, internalUserId); - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_ATTACHMENT, requirement.getProjectId(), dalFacade); - if (!authorized) { - ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.attachment.modify")); - } - Attachment deletedAttachment = dalFacade.deleteAttachmentById(attachmentId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.DELETE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_52, - deletedAttachment.getId(), Activity.DataType.ATTACHMENT, internalUserId); - return Response.ok(deletedAttachment.toJSON()).build(); - } catch (BazaarException bex) { - if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { - return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { - return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } else { - logger.warning(bex.getMessage()); - Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Delete attachment " + attachmentId); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } - } catch (Exception ex) { - BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); - logger.warning(bex.getMessage()); - Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Delete attachment " + attachmentId); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); - } finally { - bazaarService.closeDBConnection(dalFacade); - } - } -} diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java index 0c7fe8e1..37e29c17 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java @@ -540,7 +540,6 @@ public Response createRequirement(@ApiParam(value = "Requirement entity", requir * @return Response with updated requirement as a JSON object. */ @PUT - //@Path("/") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "This method updates a requirement.") @@ -1524,8 +1523,72 @@ public Response getCommentsForRequirement(@PathParam("requirementId") int requir }) public Response getAttachmentsForRequirement(@PathParam("requirementId") int requirementId, @ApiParam(value = "Page number", required = false) @DefaultValue("0") @QueryParam("page") int page, - @ApiParam(value = "Elements of comments by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage) throws Exception { - AttachmentsResource attachmentsResource = new AttachmentsResource(); - return attachmentsResource.getAttachmentsForRequirement(requirementId, page, perPage); + @ApiParam(value = "Elements of comments by page", required = false) @DefaultValue("10") @QueryParam("per_page") int perPage) { + DALFacade dalFacade = null; + try { + Agent agent = Context.getCurrent().getMainAgent(); + String userId = agent.getIdentifier(); + String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); + if (registrarErrors != null) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); + } + PageInfo pageInfo = new PageInfo(page, perPage); + Set> violations = bazaarService.validate(pageInfo); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } + + dalFacade = bazaarService.getDBConnection(); + //Todo use requirement's projectId for security context, not the one sent from client + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); + Project project = dalFacade.getProjectById(requirement.getProjectId(), internalUserId); + bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_44, + requirement.getId(), Activity.DataType.REQUIREMENT, internalUserId); + if (dalFacade.isRequirementPublic(requirementId)) { + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_COMMENT, project.getId(), dalFacade); + if (!authorized) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.anonymous")); + } + } else { + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_COMMENT, project.getId(), dalFacade); + if (!authorized) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.comment.read")); + } + } + PaginationResult attachmentsResult = dalFacade.listAttachmentsByRequirementId(requirementId, pageInfo); + + Map> parameter = new HashMap<>(); + parameter.put("page", new ArrayList() {{ + add(String.valueOf(page)); + }}); + parameter.put("per_page", new ArrayList() {{ + add(String.valueOf(perPage)); + }}); + + Response.ResponseBuilder responseBuilder = Response.ok(); + responseBuilder = responseBuilder.entity(attachmentsResult.toJSON()); + responseBuilder = bazaarService.paginationLinks(responseBuilder, attachmentsResult, "requirements/" + String.valueOf(requirementId) + "/attachments", parameter); + responseBuilder = bazaarService.xHeaderFields(responseBuilder, attachmentsResult); + + return responseBuilder.build(); + } catch (BazaarException bex) { + if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { + return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) { + return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else { + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get attachments for requirement " + requirementId); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } + } catch (Exception ex) { + BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); + logger.warning(bex.getMessage()); + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Get attachments for requirement " + requirementId); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } finally { + bazaarService.closeDBConnection(dalFacade); + } } } diff --git a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index 360cb2a0..f4938517 100644 --- a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -213,7 +213,7 @@ public void testRequirements() { try { MiniClient client = getClient(); - String testRequirement = String.format("{\"name\": \"Test Requirements\", \"description\": \"A test requirement\", \"categories\": [%s], \"projectId\": \"%s\", \"tags\": [{\"name\": \"CreateTest\", \"colour\": \"#FFFFFF\"}], \"additionalProperties\": {\"testProperty\": \"test\"}}", testProject.getDefaultCategoryId(), testProject.getId()); + String testRequirement = String.format("{\"name\": \"Test Requirements\", \"description\": \"A test requirement\", \"categories\": [%s], \"projectId\": \"%s\", \"tags\": [{\"name\": \"CreateTest\", \"colour\": \"#FFFFFF\"}], \"additionalProperties\": {\"testProperty\": \"test\"}, \"attachments\": [ { \"name\": \"wine.jpg\", \"mimeType\": \"image/jpeg\", \"identifier\": \"dc5562a3-fd6f-4401-b6d3-d97830cd2b5d\", \"fileUrl\": \"http://localhost/files/dc5562a3-fd6f-4401-b6d3-d97830cd2b5d\"}]}", testProject.getDefaultCategoryId(), testProject.getId()); ClientResponse result = client.sendRequest("POST", mainPath + "requirements", testRequirement, MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, new HashMap<>()); assertEquals(201, result.getHttpCode()); @@ -254,6 +254,7 @@ public void testRequirements() { // Test update createdRequirement.addProperty("description", "Updated Description"); + createdRequirement.add("attachments", JsonParser.parseString("[{ \"name\": \"wine.jpg\", \"mimeType\": \"image/jpeg\", \"identifier\": \"06e42de9-fc36-4d31-b341-09f01d012d9c\", \"fileUrl\": \"http://localhost/files/06e42de9-fc36-4d31-b341-09f01d012d9c\"}]")); result = client.sendRequest("PUT", mainPath + "requirements", createdRequirement.toString(), MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, new HashMap<>()); assertEquals(200, result.getHttpCode()); From ac412564cd2381ec32b7b0b26293237b7b5e6515 Mon Sep 17 00:00:00 2001 From: Thore Date: Wed, 4 Aug 2021 00:06:21 +0200 Subject: [PATCH 123/134] Authorize user before flushing notifications --- .../acis/bazaar/service/BazaarService.java | 27 +++++++++++++++-- .../acis/bazaar/service/dal/DALFacade.java | 2 ++ .../bazaar/service/dal/DALFacadeImpl.java | 6 ++++ .../bazaar/service/dal/entities/Role.java | 17 +++++++++++ .../service/dal/entities/SystemRole.java | 2 +- .../security/AuthorizationManager.java | 30 ++++++++++++------- .../resources/i18n/Translation_en.properties | 1 + .../dbis/acis/bazaar/service/BazaarTest.java | 26 ++++++++++++++++ 8 files changed, 97 insertions(+), 14 deletions(-) diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java index b1c317ed..5c30d9ce 100755 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java @@ -27,6 +27,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.DALFacadeImpl; import de.rwth.dbis.acis.bazaar.service.dal.entities.Activity; import de.rwth.dbis.acis.bazaar.service.dal.entities.Statistic; +import de.rwth.dbis.acis.bazaar.service.dal.entities.SystemRole; import de.rwth.dbis.acis.bazaar.service.dal.entities.User; import de.rwth.dbis.acis.bazaar.service.dal.helpers.CreateValidation; import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; @@ -426,15 +427,35 @@ public Response getStatistics( @Path("/notifications") @ApiOperation(value = "This method sends all notifications (emails) in the waiting queue. Run this method before shutting down Requirements Bazaar.") @ApiResponses(value = { - @ApiResponse(code = HttpURLConnection.HTTP_CREATED, message = "Notifications send"), + @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Notifications send"), @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized"), @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal server problems") }) public Response sendNotifications() { - // TODO: Use authorization scopes to limit users who can run this method to admins + DALFacade dalFacade = null; try { + Agent agent = Context.getCurrent().getMainAgent(); + String userId = agent.getIdentifier(); + String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); + if (registrarErrors != null) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registrarErrors); + } + dalFacade = bazaarService.getDBConnection(); + Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); + + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, dalFacade.getRoleByName(SystemRole.SystemAdmin.name()), dalFacade); + if (!authorized) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.notifications")); + } bazaarService.notificationDispatcher.run(); - return Response.status(Response.Status.CREATED).build(); + return Response.status(Response.Status.OK).build(); + } catch (BazaarException bex) { + if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) { + return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } else { + Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Flushing notifications"); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build(); + } } catch (Exception ex) { BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, ex.getMessage()); Context.get().monitorEvent(MonitoringEvent.SERVICE_ERROR, "Send Notifications failed"); diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java index df302280..c4ba83be 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacade.java @@ -652,6 +652,8 @@ public interface DALFacade { void createPrivilegeIfNotExists(PrivilegeEnum privilege) throws BazaarException; void addUserToRole(int userId, String roleName, Integer context) throws BazaarException; + + Role getRoleByName(String role) throws BazaarException; //endregion diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index bcbaeaa2..5411ee86 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -767,6 +767,12 @@ public void addUserToRole(int userId, String roleName, Integer context) throws B roleRepository.addUserToRole(userId, roleName, context); } + @Override + public Role getRoleByName(String role) throws BazaarException { + roleRepository = (roleRepository != null) ? roleRepository : new RoleRepositoryImpl(dslContext); + return roleRepository.findByRoleName(role); + } + @Override public void removeUserFromProject(int userId, Integer context) throws BazaarException { roleRepository = (roleRepository != null) ? roleRepository : new RoleRepositoryImpl(dslContext); diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java index 195dcead..603acf0d 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Role.java @@ -52,4 +52,21 @@ public boolean isProjectScoped() { return false; } } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof Role)) { + return false; + } + Role other = (Role) o; + + if (isProjectScoped()) { + return id == other.id; + } + return name.equals(other.name); + } + } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/SystemRole.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/SystemRole.java index 8a759f7f..1dcaa357 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/SystemRole.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/SystemRole.java @@ -3,5 +3,5 @@ public enum SystemRole { Anonymous, LoggedInUser, - SystemAdministrator, + SystemAdmin, } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java index 8bcbe29c..a33d2c7d 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/security/AuthorizationManager.java @@ -34,6 +34,13 @@ */ public class AuthorizationManager { + public static void SyncPrivileges(DALFacade facade) throws BazaarException { + EnumSet privileges = EnumSet.allOf(PrivilegeEnum.class); + for (PrivilegeEnum privilege : privileges) { + facade.createPrivilegeIfNotExists(privilege); + } + } + public boolean isAuthorized(int userId, PrivilegeEnum privilege, DALFacade facade) throws BazaarException { List userRoles = facade.getRolesByUserId(userId, null); @@ -48,17 +55,26 @@ public boolean isAuthorized(int userId, PrivilegeEnum privilege, Integer context } + public boolean isAuthorized(int userId, Role role, DALFacade facade) throws BazaarException { + List userRoles = facade.getRolesByUserId(userId, null); + + return userRoles.contains(role); + + } public boolean isAuthorized(List userRoles, PrivilegeEnum privilege, DALFacade facade) throws BazaarException { - if (userRoles == null || userRoles.isEmpty()) return false; + if (userRoles == null || userRoles.isEmpty()) { + return false; + } for (Role role : userRoles) { if (hasPrivilege(role, privilege)) { return true; } else { List parents = facade.getParentsForRole(role.getId()); if (parents != null && !parents.isEmpty()) { - if (isAuthorized(parents, privilege, facade)) + if (isAuthorized(parents, privilege, facade)) { return true; + } } } } @@ -69,17 +85,11 @@ public boolean hasPrivilege(Role role, PrivilegeEnum demandedPrivilege) { List privileges = role.getPrivileges(); if (privileges != null && !privileges.isEmpty()) { for (Privilege privilege : privileges) { - if (privilege.getName() == demandedPrivilege) + if (privilege.getName() == demandedPrivilege) { return true; + } } } return false; } - - public static void SyncPrivileges(DALFacade facade) throws BazaarException { - EnumSet privileges = EnumSet.allOf(PrivilegeEnum.class); - for (PrivilegeEnum privilege : privileges) { - facade.createPrivilegeIfNotExists(privilege); - } - } } diff --git a/reqbaz/src/main/resources/i18n/Translation_en.properties b/reqbaz/src/main/resources/i18n/Translation_en.properties index 7bcdbdc7..48147379 100644 --- a/reqbaz/src/main/resources/i18n/Translation_en.properties +++ b/reqbaz/src/main/resources/i18n/Translation_en.properties @@ -45,6 +45,7 @@ error.authorization.attachment.modify=Only the creator can modify attachments. error.authorization.personalisationData.read=Only logged in users can read their personal data. error.authorization.personalisationData.create=Only logged in users can write their personal data. error.authorization.feedback.read=Only project admins can read feedback. +error.authorization.notifications=Only Administrators can flush the notification queue. error.unknown_exception=%s Error in %s\: %s ExceptionCode\: %d. category.uncategorized.Name=General Requirements category.uncategorized.Description=Requirements which do not belong to any category. diff --git a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index f4938517..e05df3bc 100644 --- a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -563,4 +563,30 @@ public void testTags() { fail(e.toString()); } } + + + /** + * Test notification flush endpoint authorizations + */ + @Test + public void testNotifications() { + try { + MiniClient client = getClient(); + MiniClient adminClient = getAdminClient(); + + String path = mainPath + "notifications"; + ClientResponse result = client.sendRequest("POST", path, ""); + assertEquals(401, result.getHttpCode()); + + // Admin privilege check should pass + result = adminClient.sendRequest("POST", path, ""); + assertEquals(200, result.getHttpCode()); + + + } catch (Exception e) { + e.printStackTrace(); + fail(e.toString()); + } + } + } From 0033d97cb3cc1fd55dde2ada0d2e72311e35415e Mon Sep 17 00:00:00 2001 From: Thore Date: Wed, 4 Aug 2021 00:10:55 +0200 Subject: [PATCH 124/134] Remove compose file --- docker-compose.yml | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 8404fc2e..00000000 --- a/docker-compose.yml +++ /dev/null @@ -1,15 +0,0 @@ -version: '3' - -services: - mysql: - image: mysql:latest - volumes: - - .db_data:/var/lib/mysql - restart: always - environment: - MYSQL_ROOT_PASSWORD: rootpw - MYSQL_DATABASE: reqbaz - MYSQL_USER: reqbaz - MYSQL_PASSWORD: password - ports: - - 3306:3306 From 42bdf0383d023a283089c3e00f59b6ef221bc72d Mon Sep 17 00:00:00 2001 From: Thore Date: Fri, 6 Aug 2021 17:58:27 +0200 Subject: [PATCH 125/134] Fix old migrations included in build export --- reqbaz/build.gradle | 4 +- .../migrations/V10__delete_project.sql | 7 - .../migrations/V11__natural_sort_function.sql | 84 ----- .../migrations/V12__comment_delete.sql | 11 - .../main/resources/migrations/V13__tags.sql | 22 -- .../V14__entity_json_properties.sql | 8 - .../migrations/V1__create_reqbaz_schema.sql | 318 ------------------ .../V2__user_las2peer_id_to_string.sql | 7 - .../V3__add_personalisation_table.sql | 25 -- .../V4__add_personalisation_settings.sql | 2 - .../migrations/V5__add_delete_constraints.sql | 15 - .../resources/migrations/V6__add_feedback.sql | 10 - .../migrations/V7__utf8mb4_conversion.sql | 19 -- .../migrations/V8__new_privileges.sql | 79 ----- .../V9__more_delete_constraints.sql | 16 - 15 files changed, 2 insertions(+), 625 deletions(-) delete mode 100644 reqbaz/src/main/resources/migrations/V10__delete_project.sql delete mode 100644 reqbaz/src/main/resources/migrations/V11__natural_sort_function.sql delete mode 100644 reqbaz/src/main/resources/migrations/V12__comment_delete.sql delete mode 100644 reqbaz/src/main/resources/migrations/V13__tags.sql delete mode 100644 reqbaz/src/main/resources/migrations/V14__entity_json_properties.sql delete mode 100644 reqbaz/src/main/resources/migrations/V1__create_reqbaz_schema.sql delete mode 100644 reqbaz/src/main/resources/migrations/V2__user_las2peer_id_to_string.sql delete mode 100644 reqbaz/src/main/resources/migrations/V3__add_personalisation_table.sql delete mode 100644 reqbaz/src/main/resources/migrations/V4__add_personalisation_settings.sql delete mode 100644 reqbaz/src/main/resources/migrations/V5__add_delete_constraints.sql delete mode 100644 reqbaz/src/main/resources/migrations/V6__add_feedback.sql delete mode 100644 reqbaz/src/main/resources/migrations/V7__utf8mb4_conversion.sql delete mode 100644 reqbaz/src/main/resources/migrations/V8__new_privileges.sql delete mode 100644 reqbaz/src/main/resources/migrations/V9__more_delete_constraints.sql diff --git a/reqbaz/build.gradle b/reqbaz/build.gradle index 0ed2d5b2..fc2e72ff 100644 --- a/reqbaz/build.gradle +++ b/reqbaz/build.gradle @@ -222,8 +222,8 @@ task export(type: Copy, dependsOn: build) { } into("sql") { from processResources - include "migrations/*.sql" - rename 'migrations/(.+)', '$1' + include "*.sql" + include "changelog.yaml" } } diff --git a/reqbaz/src/main/resources/migrations/V10__delete_project.sql b/reqbaz/src/main/resources/migrations/V10__delete_project.sql deleted file mode 100644 index d721dc7e..00000000 --- a/reqbaz/src/main/resources/migrations/V10__delete_project.sql +++ /dev/null @@ -1,7 +0,0 @@ -REPLACE INTO reqbaz.privilege - (id, name) -VALUES (37, 'Delete_PROJECT'); - -INSERT INTO reqbaz.role_privilege_map -(role_id, privilege_id) -VALUES (3, 37); diff --git a/reqbaz/src/main/resources/migrations/V11__natural_sort_function.sql b/reqbaz/src/main/resources/migrations/V11__natural_sort_function.sql deleted file mode 100644 index 23d9d94e..00000000 --- a/reqbaz/src/main/resources/migrations/V11__natural_sort_function.sql +++ /dev/null @@ -1,84 +0,0 @@ --- From https://stackoverflow.com/a/12257917/4375998 --- DROP FUNCTION IF EXISTS `udf_FirstNumberPos`; -DELIMITER $$ -CREATE FUNCTION `udf_FirstNumberPos` (`instring` varchar(4000)) - RETURNS int - LANGUAGE SQL - DETERMINISTIC - NO SQL - SQL SECURITY INVOKER -BEGIN -DECLARE position int; -DECLARE tmp_position int; -SET position = 5000; -SET tmp_position = LOCATE('0', instring); IF (tmp_position > 0 AND tmp_position < position) THEN SET position = tmp_position; END IF; -SET tmp_position = LOCATE('1', instring); IF (tmp_position > 0 AND tmp_position < position) THEN SET position = tmp_position; END IF; -SET tmp_position = LOCATE('2', instring); IF (tmp_position > 0 AND tmp_position < position) THEN SET position = tmp_position; END IF; -SET tmp_position = LOCATE('3', instring); IF (tmp_position > 0 AND tmp_position < position) THEN SET position = tmp_position; END IF; -SET tmp_position = LOCATE('4', instring); IF (tmp_position > 0 AND tmp_position < position) THEN SET position = tmp_position; END IF; -SET tmp_position = LOCATE('5', instring); IF (tmp_position > 0 AND tmp_position < position) THEN SET position = tmp_position; END IF; -SET tmp_position = LOCATE('6', instring); IF (tmp_position > 0 AND tmp_position < position) THEN SET position = tmp_position; END IF; -SET tmp_position = LOCATE('7', instring); IF (tmp_position > 0 AND tmp_position < position) THEN SET position = tmp_position; END IF; -SET tmp_position = LOCATE('8', instring); IF (tmp_position > 0 AND tmp_position < position) THEN SET position = tmp_position; END IF; -SET tmp_position = LOCATE('9', instring); IF (tmp_position > 0 AND tmp_position < position) THEN SET position = tmp_position; END IF; - -IF (position = 5000) THEN RETURN 0; END IF; -RETURN position; -END -$$ - --- DROP FUNCTION IF EXISTS `udf_NaturalSortFormat`; -DELIMITER $$ -CREATE FUNCTION `udf_NaturalSortFormat` (`instring` varchar(4000), `numberLength` int, `sameOrderChars` char(50)) - RETURNS varchar(4000) - LANGUAGE SQL - DETERMINISTIC - NO SQL - SQL SECURITY INVOKER -BEGIN -DECLARE sortString varchar(4000); -DECLARE numStartIndex int; -DECLARE numEndIndex int; -DECLARE padLength int; -DECLARE totalPadLength int; -DECLARE i int; -DECLARE sameOrderCharsLen int; - -SET totalPadLength = 0; -SET instring = TRIM(instring); -SET sortString = instring; -SET numStartIndex = udf_FirstNumberPos(instring); -SET numEndIndex = 0; -SET i = 1; -SET sameOrderCharsLen = CHAR_LENGTH(sameOrderChars); - -WHILE (i <= sameOrderCharsLen) DO -SET sortString = REPLACE(sortString, SUBSTRING(sameOrderChars, i, 1), ' '); -SET i = i + 1; -END WHILE; - -WHILE (numStartIndex <> 0) DO -SET numStartIndex = numStartIndex + numEndIndex; -SET numEndIndex = numStartIndex; - -WHILE (udf_FirstNumberPos(SUBSTRING(instring, numEndIndex, 1)) = 1) DO -SET numEndIndex = numEndIndex + 1; -END WHILE; - -SET numEndIndex = numEndIndex - 1; - -SET padLength = numberLength - (numEndIndex + 1 - numStartIndex); - -IF padLength < 0 THEN -SET padLength = 0; -END IF; - -SET sortString = INSERT(sortString, numStartIndex + totalPadLength, 0, REPEAT('0', padLength)); - -SET totalPadLength = totalPadLength + padLength; -SET numStartIndex = udf_FirstNumberPos(RIGHT(instring, CHAR_LENGTH(instring) - numEndIndex)); -END WHILE; - -RETURN sortString; -END -$$ diff --git a/reqbaz/src/main/resources/migrations/V12__comment_delete.sql b/reqbaz/src/main/resources/migrations/V12__comment_delete.sql deleted file mode 100644 index 6d1a16e1..00000000 --- a/reqbaz/src/main/resources/migrations/V12__comment_delete.sql +++ /dev/null @@ -1,11 +0,0 @@ - -SET FOREIGN_KEY_CHECKS = 0; -ALTER TABLE reqbaz.comment - DROP FOREIGN KEY `reply_comment`; - -ALTER TABLE reqbaz.comment - ADD deleted BOOLEAN NOT NULL DEFAULT FALSE, - ADD CONSTRAINT reply_comment FOREIGN KEY reply_comment (reply_to_comment_id) REFERENCES comment (id) - ON DELETE CASCADE; - -SET FOREIGN_KEY_CHECKS = 1; diff --git a/reqbaz/src/main/resources/migrations/V13__tags.sql b/reqbaz/src/main/resources/migrations/V13__tags.sql deleted file mode 100644 index f7aef404..00000000 --- a/reqbaz/src/main/resources/migrations/V13__tags.sql +++ /dev/null @@ -1,22 +0,0 @@ -CREATE TABLE IF NOT EXISTS reqbaz.tag -( - id INT NOT NULL AUTO_INCREMENT, - project_id INT NOT NULL, - creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - name VARCHAR(20) NOT NULL, - colour VARCHAR(7) NOT NULL, - CONSTRAINT tag_project FOREIGN KEY tag_project (project_id) REFERENCES project (id) ON DELETE CASCADE, - CONSTRAINT tag_pk PRIMARY KEY (id) -); - -CREATE TABLE IF NOT EXISTS reqbaz.requirement_tag_map -( - id INT NOT NULL AUTO_INCREMENT, - tag_id INT NOT NULL, - requirement_id INT NOT NULL, - CONSTRAINT requirement_tag_map_pk PRIMARY KEY (id), - CONSTRAINT requirement_tag_map_requirement FOREIGN KEY requirement_tag_map_requirement (requirement_id) REFERENCES requirement (id) - ON DELETE CASCADE, - CONSTRAINT requirement_tag_map_tag FOREIGN KEY requirement_tag_map_tag (tag_id) REFERENCES tag (id) - ON DELETE CASCADE -); diff --git a/reqbaz/src/main/resources/migrations/V14__entity_json_properties.sql b/reqbaz/src/main/resources/migrations/V14__entity_json_properties.sql deleted file mode 100644 index 9b02bf21..00000000 --- a/reqbaz/src/main/resources/migrations/V14__entity_json_properties.sql +++ /dev/null @@ -1,8 +0,0 @@ -ALTER TABLE reqbaz.project - ADD COLUMN additional_properties JSON; - -ALTER TABLE reqbaz.category - ADD COLUMN additional_properties JSON; - -ALTER TABLE reqbaz.requirement - ADD COLUMN additional_properties JSON; diff --git a/reqbaz/src/main/resources/migrations/V1__create_reqbaz_schema.sql b/reqbaz/src/main/resources/migrations/V1__create_reqbaz_schema.sql deleted file mode 100644 index 296fb54f..00000000 --- a/reqbaz/src/main/resources/migrations/V1__create_reqbaz_schema.sql +++ /dev/null @@ -1,318 +0,0 @@ -SET FOREIGN_KEY_CHECKS = 0; - --- tables --- Table attachment -CREATE TABLE IF NOT EXISTS reqbaz.attachment ( - id INT NOT NULL AUTO_INCREMENT, - creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - last_updated_date TIMESTAMP NULL, - requirement_id INT NOT NULL, - user_id INT NOT NULL, - name VARCHAR(255) NOT NULL, - description TEXT NULL, - mime_type VARCHAR(255) NOT NULL, - identifier VARCHAR(900) NOT NULL, - file_url VARCHAR(1000) NOT NULL, - CONSTRAINT attachment_pk PRIMARY KEY (id), - CONSTRAINT attachment_requirement FOREIGN KEY attachment_requirement (requirement_id) REFERENCES requirement (id) - ON DELETE CASCADE, - CONSTRAINT attachment_user FOREIGN KEY attachment_user (user_id) REFERENCES user (id) -); - --- Table comment -CREATE TABLE IF NOT EXISTS reqbaz.comment ( - id INT NOT NULL AUTO_INCREMENT, - message TEXT NOT NULL, - creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - last_updated_date TIMESTAMP NULL, - requirement_id INT NOT NULL, - user_id INT NOT NULL, - reply_to_comment_id INT, - CONSTRAINT comment_pk PRIMARY KEY (id), - CONSTRAINT comment_requirement FOREIGN KEY comment_requirement (requirement_id) REFERENCES requirement (id) - ON DELETE CASCADE, - CONSTRAINT comment_user FOREIGN KEY comment_user (user_id) REFERENCES user (id), - CONSTRAINT reply_comment FOREIGN KEY reply_comment (reply_to_comment_id) REFERENCES comment (id) -); - --- Table category -CREATE TABLE IF NOT EXISTS reqbaz.category ( - id INT NOT NULL AUTO_INCREMENT, - name VARCHAR(255) NOT NULL, - description TEXT NOT NULL, - creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - last_updated_date TIMESTAMP NULL, - project_id INT NOT NULL, - leader_id INT NOT NULL, - CONSTRAINT category_pk PRIMARY KEY (id), - CONSTRAINT category_project FOREIGN KEY category_project (project_id) REFERENCES project (id), - CONSTRAINT category_user FOREIGN KEY category_user (leader_id) REFERENCES user (id) -); - --- Table requirement_developer_map -CREATE TABLE IF NOT EXISTS reqbaz.requirement_developer_map ( - id INT NOT NULL AUTO_INCREMENT, - requirement_id INT NOT NULL, - user_id INT NOT NULL, - creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - CONSTRAINT requirement_developer_map_pk PRIMARY KEY (id), - CONSTRAINT requirement_developer_map_requirement FOREIGN KEY requirement_developer_map_requirement (requirement_id) REFERENCES requirement (id) - ON DELETE CASCADE, - CONSTRAINT requirement_developer_map_user FOREIGN KEY requirement_developer_map_user (user_id) REFERENCES user (id) -); - --- Table follower_requirement_map -CREATE TABLE IF NOT EXISTS reqbaz.requirement_follower_map ( - id INT NOT NULL AUTO_INCREMENT, - requirement_id INT NOT NULL, - user_id INT NOT NULL, - creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - CONSTRAINT requirement_follower_map_pk PRIMARY KEY (id), - CONSTRAINT requirement_follower_map_requirement FOREIGN KEY requirement_follower_map_requirement (requirement_id) REFERENCES requirement (id) - ON DELETE CASCADE, - CONSTRAINT requirement_follower_map_user FOREIGN KEY requirement_follower_user (user_id) REFERENCES user (id) -); - --- Table category_follower_map -CREATE TABLE IF NOT EXISTS reqbaz.category_follower_map ( - id INT NOT NULL AUTO_INCREMENT, - category_id INT NOT NULL, - user_id INT NOT NULL, - creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - CONSTRAINT category_follower_map_pk PRIMARY KEY (id), - CONSTRAINT category_follower_map_category FOREIGN KEY category_follower_map_category (category_id) REFERENCES category (id) - ON DELETE CASCADE, - CONSTRAINT category_follower_map_user FOREIGN KEY category_follower_map_user (user_id) REFERENCES user (id) -); - --- Table project_follower_map -CREATE TABLE IF NOT EXISTS reqbaz.project_follower_map ( - id INT NOT NULL AUTO_INCREMENT, - project_id INT NOT NULL, - user_id INT NOT NULL, - creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - CONSTRAINT project_follower_map_pk PRIMARY KEY (id), - CONSTRAINT project_follower_map_project FOREIGN KEY project_follower_map_project (project_id) REFERENCES project (id) - ON DELETE CASCADE, - CONSTRAINT project_follower_map_user FOREIGN KEY project_follower_map_user (user_id) REFERENCES user (id) -); - --- Table privilege -CREATE TABLE IF NOT EXISTS reqbaz.privilege ( - id INT NOT NULL AUTO_INCREMENT, - name VARCHAR(100) NOT NULL, - CONSTRAINT privilege_pk PRIMARY KEY (id) -); - --- Table project -CREATE TABLE IF NOT EXISTS reqbaz.project ( - id INT NOT NULL AUTO_INCREMENT, - name VARCHAR(255) NOT NULL, - description TEXT NOT NULL, - visibility BOOLEAN NOT NULL, - creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - last_updated_date TIMESTAMP NULL, - leader_id INT NOT NULL, - default_category_id INT NULL, - CONSTRAINT project_pk PRIMARY KEY (id), - CONSTRAINT project_category FOREIGN KEY project_category (default_category_id) REFERENCES category (id), - CONSTRAINT project_user FOREIGN KEY project_user (leader_id) REFERENCES user (id) -); - --- Table requirement -CREATE TABLE IF NOT EXISTS reqbaz.requirement ( - id INT NOT NULL AUTO_INCREMENT, - name VARCHAR(255) NOT NULL, - description TEXT NULL, - realized TIMESTAMP NULL DEFAULT NULL, - creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - last_updated_date TIMESTAMP NULL, - lead_developer_id INT NULL, - creator_id INT NOT NULL, - project_id INT NOT NULL, - CONSTRAINT requirement_pk PRIMARY KEY (id), - CONSTRAINT creator FOREIGN KEY creator (creator_id) REFERENCES user (id), - CONSTRAINT lead_developer FOREIGN KEY lead_developer (lead_developer_id) REFERENCES user (id), - CONSTRAINT requirement_project FOREIGN KEY requirement_project (project_id) REFERENCES project (id) -); - --- Table requirement_category_map -CREATE TABLE IF NOT EXISTS reqbaz.requirement_category_map ( - id INT NOT NULL AUTO_INCREMENT, - category_id INT NOT NULL, - requirement_id INT NOT NULL, - CONSTRAINT requirement_category_map_pk PRIMARY KEY (id), - CONSTRAINT requirement_category_map_category FOREIGN KEY requirement_category_map_category (category_id) REFERENCES category (id), - CONSTRAINT requirement_category_map_requirement FOREIGN KEY requirement_category_map_requirement (requirement_id) REFERENCES requirement (id) - ON DELETE CASCADE -); - --- Table role_privilege_map -CREATE TABLE IF NOT EXISTS reqbaz.role_privilege_map ( - id INT NOT NULL AUTO_INCREMENT, - role_id INT NOT NULL, - privilege_id INT NOT NULL, - CONSTRAINT role_privilege_map_pk PRIMARY KEY (id), - CONSTRAINT role_privilege_map_privilege FOREIGN KEY role_privilege_map_privilege (privilege_id) REFERENCES privilege (id) - ON DELETE CASCADE, - CONSTRAINT role_privilege_map_role FOREIGN KEY role_privilege_map_role (role_id) REFERENCES role (id) - ON DELETE CASCADE -); - --- Table role_role_map -CREATE TABLE IF NOT EXISTS reqbaz.role_role_map ( - id INT NOT NULL AUTO_INCREMENT, - child_id INT NOT NULL, - parent_id INT NOT NULL, - CONSTRAINT role_role_map_pk PRIMARY KEY (id), - CONSTRAINT role_role_map_child FOREIGN KEY role_role_map_child (child_id) REFERENCES role (id) - ON DELETE CASCADE, - CONSTRAINT role_role_map_parent FOREIGN KEY role_role_map_parent (parent_id) REFERENCES role (id) - ON DELETE CASCADE -); - --- Table role -CREATE TABLE IF NOT EXISTS reqbaz.role ( - id INT NOT NULL AUTO_INCREMENT, - name VARCHAR(50) NULL, - CONSTRAINT role_pk PRIMARY KEY (id), - UNIQUE KEY role_idx_1 (name) -); - --- Table user_role_map -CREATE TABLE IF NOT EXISTS reqbaz.user_role_map ( - id INT NOT NULL AUTO_INCREMENT, - role_id INT NOT NULL, - user_id INT NOT NULL, - context_info VARCHAR(255) NULL, - CONSTRAINT user_role_map_pk PRIMARY KEY (id), - CONSTRAINT user_role_map_role FOREIGN KEY user_role_map_role (role_id) REFERENCES role (id) - ON DELETE CASCADE, - CONSTRAINT user_role_map_user FOREIGN KEY user_role_map_user (user_id) REFERENCES user (id) - ON DELETE CASCADE -); - --- Table user -CREATE TABLE IF NOT EXISTS reqbaz.user ( - id INT NOT NULL AUTO_INCREMENT, - first_name VARCHAR(150) NULL, - last_name VARCHAR(150) NULL, - email VARCHAR(255) NOT NULL, - admin BOOLEAN NOT NULL, - las2peer_id BIGINT NOT NULL, - user_name VARCHAR(255) NULL, - profile_image TEXT NULL, - email_lead_subscription BOOLEAN NOT NULL DEFAULT TRUE, - email_follow_subscription BOOLEAN NOT NULL DEFAULT TRUE, - creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - last_updated_date TIMESTAMP NULL, - last_login_date TIMESTAMP NULL, - CONSTRAINT user_pk PRIMARY KEY (id), - UNIQUE KEY las2peer_idx (las2peer_id) -); - --- Table vote -CREATE TABLE IF NOT EXISTS reqbaz.vote ( - id INT NOT NULL AUTO_INCREMENT, - is_upvote BOOLEAN NOT NULL, - requirement_id INT NOT NULL, - user_id INT NOT NULL, - creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - CONSTRAINT vote_pk PRIMARY KEY (id), - CONSTRAINT vote_requirement FOREIGN KEY vote_requirement (requirement_id) REFERENCES requirement (id) - ON DELETE CASCADE, - CONSTRAINT vote_user FOREIGN KEY vote_user (user_id) REFERENCES user (id) -); - --- Fill roles and privileges -REPLACE INTO reqbaz.role -(id, name) -VALUES - (1, 'Anonymous'), - (2, 'LoggedInUser'), - (3, 'ProjectAdmin'), - (4, 'SystemAdmin'); - -REPLACE INTO reqbaz.privilege -(id, name) -VALUES - (1, 'Create_PROJECT'), - (2, 'Read_PROJECT'), - (3, 'Read_PUBLIC_PROJECT'), - (4, 'Modify_PROJECT'), - (5, 'Create_CATEGORY'), - (6, 'Read_CATEGORY'), - (7, 'Read_PUBLIC_CATEGORY'), - (8, 'Modify_CATEGORY'), - (9, 'Create_REQUIREMENT'), - (10, 'Read_REQUIREMENT'), - (11, 'Read_PUBLIC_REQUIREMENT'), - (12, 'Modify_REQUIREMENT'), - (13, 'Create_COMMENT'), - (14, 'Read_COMMENT'), - (15, 'Read_PUBLIC_COMMENT'), - (16, 'Modify_COMMENT'), - (17, 'Create_ATTACHMENT'), - (18, 'Read_ATTACHMENT'), - (19, 'Read_PUBLIC_ATTACHMENT'), - (20, 'Modify_ATTACHMENT'), - (21, 'Create_VOTE'), - (22, 'Delete_VOTE'), - (23, 'Create_FOLLOW'), - (24, 'Delete_FOLLOW'), - (25, 'Create_DEVELOP'), - (26, 'Delete_DEVELOP'); - -REPLACE INTO reqbaz.role_privilege_map -(id, role_id, privilege_id) -VALUES - (1, 1, 3), - (2, 1, 7), - (3, 1, 11), - (4, 1, 15), - (5, 1, 19), - (6, 4, 1), - (7, 4, 2), - (8, 4, 8), - (9, 4, 7), - (10, 4, 6), - (11, 4, 5), - (12, 4, 3), - (13, 4, 4), - (14, 4, 9), - (15, 4, 10), - (16, 4, 11), - (17, 4, 12), - (18, 4, 13), - (19, 4, 14), - (20, 4, 16), - (21, 4, 17), - (22, 4, 18), - (23, 4, 19), - (24, 4, 20), - (25, 4, 21), - (26, 4, 22), - (27, 4, 23), - (28, 4, 24), - (29, 4, 25), - (30, 4, 26); - -REPLACE INTO reqbaz.role_role_map -(id, child_id, parent_id) -VALUES - (1, 2, 1), - (2, 3, 2), - (3, 4, 3); - -REPLACE INTO reqbaz.user_role_map -(id, role_id, user_id) -VALUES - (1, 1, 1); - -REPLACE INTO reqbaz.user -(id, first_name, last_name, email, admin, las2peer_id, user_name, profile_image, email_lead_subscription, email_follow_subscription) -VALUES - (1, NULL, NULL, 'anonymous@requirements-bazaar.org', 0, '-1722613621014065292', 'anonymous', - 'https://api.learning-layers.eu/profile.png', 0, 0); - -SET FOREIGN_KEY_CHECKS = 1; \ No newline at end of file diff --git a/reqbaz/src/main/resources/migrations/V2__user_las2peer_id_to_string.sql b/reqbaz/src/main/resources/migrations/V2__user_las2peer_id_to_string.sql deleted file mode 100644 index 48c5493f..00000000 --- a/reqbaz/src/main/resources/migrations/V2__user_las2peer_id_to_string.sql +++ /dev/null @@ -1,7 +0,0 @@ -SET FOREIGN_KEY_CHECKS = 0; - -ALTER TABLE reqbaz.user change las2peer_id las2peer_id VARCHAR(128); - -UPDATE reqbaz.user SET las2peer_id = "anonymous" where id = 1; - -SET FOREIGN_KEY_CHECKS = 1; \ No newline at end of file diff --git a/reqbaz/src/main/resources/migrations/V3__add_personalisation_table.sql b/reqbaz/src/main/resources/migrations/V3__add_personalisation_table.sql deleted file mode 100644 index deb522c4..00000000 --- a/reqbaz/src/main/resources/migrations/V3__add_personalisation_table.sql +++ /dev/null @@ -1,25 +0,0 @@ -CREATE TABLE IF NOT EXISTS reqbaz.personalisation_data ( - id INT NOT NULL AUTO_INCREMENT, - creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - last_updated_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - identifier VARCHAR(50) NOT NULL, - user_id INT NOT NULL, - version INT NOT NULL, - setting TEXT, - CONSTRAINT personalisation_pk PRIMARY KEY (id), - CONSTRAINT personalisation_key UNIQUE KEY (identifier,user_id,version), - CONSTRAINT personalisation_user FOREIGN KEY personalisation_user (user_id) REFERENCES user (id) -); - -REPLACE INTO reqbaz.privilege -(id, name) -VALUES -(27, 'Read_PERSONALISATION_DATA'), -(28, 'Create_PERSONALISATION_DATA'); - - -REPLACE INTO reqbaz.role_privilege_map -(id, role_id, privilege_id) -VALUES -(31, 2, 27), -(32, 2, 28); \ No newline at end of file diff --git a/reqbaz/src/main/resources/migrations/V4__add_personalisation_settings.sql b/reqbaz/src/main/resources/migrations/V4__add_personalisation_settings.sql deleted file mode 100644 index 3c703823..00000000 --- a/reqbaz/src/main/resources/migrations/V4__add_personalisation_settings.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE reqbaz.user -ADD personalization_enabled tinyint(1) DEFAULT '1'; \ No newline at end of file diff --git a/reqbaz/src/main/resources/migrations/V5__add_delete_constraints.sql b/reqbaz/src/main/resources/migrations/V5__add_delete_constraints.sql deleted file mode 100644 index 18245134..00000000 --- a/reqbaz/src/main/resources/migrations/V5__add_delete_constraints.sql +++ /dev/null @@ -1,15 +0,0 @@ -SET FOREIGN_KEY_CHECKS = 0; -ALTER TABLE reqbaz.category - DROP FOREIGN KEY `category_project`; - -ALTER TABLE reqbaz.category - ADD CONSTRAINT category_project FOREIGN KEY category_project (project_id) REFERENCES project (id) - ON DELETE CASCADE; - -ALTER TABLE reqbaz.project - DROP FOREIGN KEY `project_category`; - -ALTER TABLE reqbaz.project - ADD CONSTRAINT project_category FOREIGN KEY project_category (default_category_id) REFERENCES category (id) - ON DELETE CASCADE; -SET FOREIGN_KEY_CHECKS = 1; diff --git a/reqbaz/src/main/resources/migrations/V6__add_feedback.sql b/reqbaz/src/main/resources/migrations/V6__add_feedback.sql deleted file mode 100644 index c6afb9e0..00000000 --- a/reqbaz/src/main/resources/migrations/V6__add_feedback.sql +++ /dev/null @@ -1,10 +0,0 @@ -CREATE TABLE IF NOT EXISTS reqbaz.feedback ( - id INT NOT NULL AUTO_INCREMENT, - project_id INT NOT NULL, - requirement_id INT, - creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - email VARCHAR(255), - feedback TEXT NOT NULL, - CONSTRAINT feedback_project FOREIGN KEY feedback_project (project_id) REFERENCES project (id) ON DELETE CASCADE, - CONSTRAINT feedback_pk PRIMARY KEY (id) -); diff --git a/reqbaz/src/main/resources/migrations/V7__utf8mb4_conversion.sql b/reqbaz/src/main/resources/migrations/V7__utf8mb4_conversion.sql deleted file mode 100644 index df13e920..00000000 --- a/reqbaz/src/main/resources/migrations/V7__utf8mb4_conversion.sql +++ /dev/null @@ -1,19 +0,0 @@ -alter table reqbaz.attachment convert to character set utf8mb4 collate utf8mb4_unicode_ci; -alter table reqbaz.category convert to character set utf8mb4 collate utf8mb4_unicode_ci; -alter table reqbaz.category_follower_map convert to character set utf8mb4 collate utf8mb4_unicode_ci; -alter table reqbaz.comment convert to character set utf8mb4 collate utf8mb4_unicode_ci; -alter table reqbaz.feedback convert to character set utf8mb4 collate utf8mb4_unicode_ci; -alter table reqbaz.personalisation_data convert to character set utf8mb4 collate utf8mb4_unicode_ci; -alter table reqbaz.privilege convert to character set utf8mb4 collate utf8mb4_unicode_ci; -alter table reqbaz.project convert to character set utf8mb4 collate utf8mb4_unicode_ci; -alter table reqbaz.project_follower_map convert to character set utf8mb4 collate utf8mb4_unicode_ci; -alter table reqbaz.requirement convert to character set utf8mb4 collate utf8mb4_unicode_ci; -alter table reqbaz.requirement_category_map convert to character set utf8mb4 collate utf8mb4_unicode_ci; -alter table reqbaz.requirement_developer_map convert to character set utf8mb4 collate utf8mb4_unicode_ci; -alter table reqbaz.requirement_follower_map convert to character set utf8mb4 collate utf8mb4_unicode_ci; -alter table reqbaz.role convert to character set utf8mb4 collate utf8mb4_unicode_ci; -alter table reqbaz.role_privilege_map convert to character set utf8mb4 collate utf8mb4_unicode_ci; -alter table reqbaz.role_role_map convert to character set utf8mb4 collate utf8mb4_unicode_ci; -alter table reqbaz.user convert to character set utf8mb4 collate utf8mb4_unicode_ci; -alter table reqbaz.user_role_map convert to character set utf8mb4 collate utf8mb4_unicode_ci; -alter table reqbaz.vote convert to character set utf8mb4 collate utf8mb4_unicode_ci; diff --git a/reqbaz/src/main/resources/migrations/V8__new_privileges.sql b/reqbaz/src/main/resources/migrations/V8__new_privileges.sql deleted file mode 100644 index fe1fe86e..00000000 --- a/reqbaz/src/main/resources/migrations/V8__new_privileges.sql +++ /dev/null @@ -1,79 +0,0 @@ -REPLACE INTO reqbaz.privilege - (id, name) -VALUES (29, 'Read_FEEDBACK'), - (31, 'Promote_USER'), - (32, 'Realize_REQUIREMENT'), - (34, 'Modify_MEMBERS'), - (35, 'Modify_ADMIN_MEMBERS'), - (36, 'Read_USERS'); - - -REPLACE INTO reqbaz.role - (id, name) -VALUES (5, 'ProjectManager'), - (6, 'ProjectMember'); - -TRUNCATE TABLE reqbaz.role_privilege_map; -# This ist quite difficult to read -# For more info see the privileges documentation -# or run this query: -# SELECT rpm.id, r.name, p.name, p.id FROM reqbaz.role_privilege_map rpm JOIN reqbaz.role AS r on r.id = rpm.role_id JOIN reqbaz.privilege AS p ON p.id = rpm.privilege_id order by r.name asc, p.name asc; -INSERT INTO reqbaz.role_privilege_map - (role_id, privilege_id) -VALUES (1, 3), - (1, 7), - (1, 11), - (1, 15), - (1, 19), - - (2, 1), - (2, 9), - (2, 13), - (2, 17), - (2, 21), - (2, 22), - (2, 23), - (2, 24), - (2, 27), - (2, 28), - (2, 36), - - (3, 4), - (3, 8), - (3, 35), - - (5, 29), - (5, 31), - (5, 12), - (5, 16), - (5, 20), - (5, 5), - (5, 34), - - (6, 2), - (6, 6), - (6, 25), - (6, 26), - (6, 18), - (6, 14), - (6, 10), - (6, 32); - -TRUNCATE TABLE reqbaz.role_role_map; -INSERT INTO reqbaz.role_role_map -(child_id, parent_id) -VALUES -(4, 3), -(3, 5), -(5, 6), -(6, 2), -(2, 1); - -ALTER TABLE reqbaz.user_role_map - MODIFY context_info INT; - -ALTER TABLE reqbaz.user_role_map - ADD CONSTRAINT role_project_context FOREIGN KEY role_project_context (context_info) REFERENCES project (id) - ON DELETE CASCADE; - -ALTER TABLE reqbaz.user DROP COLUMN admin; diff --git a/reqbaz/src/main/resources/migrations/V9__more_delete_constraints.sql b/reqbaz/src/main/resources/migrations/V9__more_delete_constraints.sql deleted file mode 100644 index 7d35654d..00000000 --- a/reqbaz/src/main/resources/migrations/V9__more_delete_constraints.sql +++ /dev/null @@ -1,16 +0,0 @@ -SET FOREIGN_KEY_CHECKS = 0; -ALTER TABLE reqbaz.requirement_category_map - DROP FOREIGN KEY `requirement_category_map_category`; - -ALTER TABLE reqbaz.requirement_category_map - ADD CONSTRAINT requirement_category_map_category FOREIGN KEY requirement_category_map_category (category_id) REFERENCES category (id) ON DELETE CASCADE; - - -ALTER TABLE reqbaz.requirement - DROP FOREIGN KEY `requirement_project`; - -ALTER TABLE reqbaz.requirement - ADD CONSTRAINT requirement_project FOREIGN KEY requirement_project (project_id) REFERENCES project (id) ON DELETE CASCADE; - - -SET FOREIGN_KEY_CHECKS = 1; From adf92c5d6ec49ae2dc03cc8763bb6e1d90f52899 Mon Sep 17 00:00:00 2001 From: Thore Date: Fri, 6 Aug 2021 18:31:40 +0200 Subject: [PATCH 126/134] Use postgres in release pipeline --- .github/workflows/release_rc.yaml | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release_rc.yaml b/.github/workflows/release_rc.yaml index cec96900..809aa6a6 100644 --- a/.github/workflows/release_rc.yaml +++ b/.github/workflows/release_rc.yaml @@ -11,16 +11,19 @@ jobs: name: Create Pre-Release runs-on: ubuntu-latest services: - mysql: - image: mysql:latest + postgres: + image: postgres:13 ports: - - 3306:3306 + - 5432:5432 env: - MYSQL_USER: reqbaz - MYSQL_PASSWORD: password - MYSQL_DATABASE: reqbaz - MYSQL_ROOT_PASSWORD: rootpw - options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 + POSTGRES_USER: reqbaz + POSTGRES_PASSWORD: reqbaz + POSTGRES_DB: reqbaz + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 steps: - name: Checkout code @@ -32,11 +35,6 @@ jobs: uses: actions/setup-java@v1 with: java-version: 14 - - name: Verify MySQL connection - run: | - while ! mysqladmin ping -h"127.0.0.1" -P"3306" --silent; do - sleep 1 - done - name: Build release bundle with Gradle run: ./gradlew packageDistribution -x test #-Pservice.version=${{ steps.get_version.outputs.version-without-v }} - name: Create Release From bb007a6ead161cdc38ca69e78b71b4c92b4d670c Mon Sep 17 00:00:00 2001 From: Thore Date: Sun, 8 Aug 2021 02:12:14 +0200 Subject: [PATCH 127/134] Add support for timezones in timestamps --- gradle.properties | 6 +- .../acis/bazaar/service/BazaarService.java | 4 +- .../bazaar/service/dal/DALFacadeImpl.java | 13 ++-- .../bazaar/service/dal/entities/Activity.java | 6 +- .../service/dal/entities/Attachment.java | 10 +-- .../bazaar/service/dal/entities/Category.java | 14 ++-- .../bazaar/service/dal/entities/Comment.java | 10 +-- .../bazaar/service/dal/entities/Email.java | 12 ++-- .../bazaar/service/dal/entities/Feedback.java | 6 +- .../bazaar/service/dal/entities/Project.java | 14 ++-- .../service/dal/entities/Requirement.java | 18 ++--- .../bazaar/service/dal/entities/User.java | 14 ++-- .../dal/repositories/CategoryRepository.java | 4 +- .../repositories/CategoryRepositoryImpl.java | 6 +- .../dal/repositories/ProjectRepository.java | 6 +- .../repositories/ProjectRepositoryImpl.java | 8 +-- .../repositories/RequirementRepository.java | 6 +- .../RequirementRepositoryImpl.java | 12 ++-- .../dal/repositories/UserRepositoryImpl.java | 66 +++++++++++++----- .../dal/transform/AttachmentTransformer.java | 10 +-- .../dal/transform/CategoryTransformer.java | 6 +- .../dal/transform/CommentTransformer.java | 69 +++++++++---------- .../dal/transform/FeedbackTransformer.java | 7 +- .../dal/transform/ProjectTransformer.java | 6 +- .../dal/transform/RequirementTransformer.java | 6 +- .../service/dal/transform/TagTransformer.java | 4 +- .../dal/transform/UserTransformer.java | 10 +-- .../notification/ActivityDispatcher.java | 8 +-- .../service/notification/EmailDispatcher.java | 12 ++-- .../notification/NotificationDispatcher.java | 4 +- .../NotificationDispatcherImp.java | 13 ++-- .../service/resources/CategoryResource.java | 35 ++++++---- .../service/resources/CommentsResource.java | 8 +-- .../service/resources/FeedbackResource.java | 27 ++++---- .../service/resources/ProjectsResource.java | 32 ++++----- .../resources/RequirementsResource.java | 46 ++++++------- .../service/resources/UsersResource.java | 14 ++-- reqbaz/src/main/resources/changelog.yaml | 46 ++++++------- .../dbis/acis/bazaar/service/TestBase.java | 7 +- 39 files changed, 325 insertions(+), 280 deletions(-) diff --git a/gradle.properties b/gradle.properties index 6c96c5f8..06ce347d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,12 +1,12 @@ org.gradle.parallel=true java.version=14 -core.version=1.1.1 +core.version=1.1.2 service.version=0.9.0 service.name=de.rwth.dbis.acis.bazaar.service service.class=BazaarService jooq.version=3.14.4 -postgres.version=42.2.12 -liquibase.version=4.4.0 +postgres.version=42.2.23 +liquibase.version=4.4.3 db.port=5432 db.hostname=localhost db.user=reqbaz diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java index 5c30d9ce..6bc9130b 100755 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/BazaarService.java @@ -69,7 +69,7 @@ import javax.xml.bind.DatatypeConverter; import java.net.HttpURLConnection; import java.net.URISyntaxException; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.*; @@ -396,7 +396,7 @@ public Response getStatistics( Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Calendar sinceCal = since == null ? null : DatatypeConverter.parseDateTime(since); Statistic platformStatistics = dalFacade.getStatisticsForAllProjects(internalUserId, sinceCal); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_2, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_2, 0, Activity.DataType.STATISTIC, internalUserId); return Response.ok(platformStatistics.toJSON()).build(); } catch (BazaarException bex) { diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java index 5411ee86..04a8d641 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/DALFacadeImpl.java @@ -39,7 +39,8 @@ import javax.sql.DataSource; import java.sql.Timestamp; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; import java.util.Calendar; import java.util.HashMap; import java.util.List; @@ -259,14 +260,14 @@ public boolean isProjectPublic(int projectId) throws BazaarException { public Statistic getStatisticsForAllProjects(int userId, Calendar since) throws BazaarException { projectRepository = (projectRepository != null) ? projectRepository : new ProjectRepositoryImpl(dslContext); Timestamp timestamp = since == null ? new java.sql.Timestamp(0) : new java.sql.Timestamp(since.getTimeInMillis()); - return projectRepository.getStatisticsForVisibleProjects(userId, timestamp.toLocalDateTime()); + return projectRepository.getStatisticsForVisibleProjects(userId, timestamp.toLocalDateTime().atOffset(ZoneOffset.UTC)); } @Override public Statistic getStatisticsForProject(int userId, int projectId, Calendar since) throws BazaarException { projectRepository = (projectRepository != null) ? projectRepository : new ProjectRepositoryImpl(dslContext); Timestamp timestamp = since == null ? new java.sql.Timestamp(0) : new java.sql.Timestamp(since.getTimeInMillis()); - return projectRepository.getStatisticsForProject(userId, projectId, timestamp.toLocalDateTime()); + return projectRepository.getStatisticsForProject(userId, projectId, timestamp.toLocalDateTime().atOffset(ZoneOffset.UTC)); } @Override @@ -432,7 +433,7 @@ public Requirement deleteRequirementById(int requirementId, int userId) throws E @Override public Requirement setRequirementToRealized(int requirementId, int userId) throws Exception { requirementRepository = (requirementRepository != null) ? requirementRepository : new RequirementRepositoryImpl(dslContext); - requirementRepository.setRealized(requirementId, LocalDateTime.now()); + requirementRepository.setRealized(requirementId, OffsetDateTime.now()); return getRequirementById(requirementId, userId); } @@ -467,7 +468,7 @@ public boolean isRequirementPublic(int requirementId) throws BazaarException { public Statistic getStatisticsForRequirement(int userId, int requirementId, Calendar since) throws BazaarException { requirementRepository = (requirementRepository != null) ? requirementRepository : new RequirementRepositoryImpl(dslContext); Timestamp timestamp = since == null ? new java.sql.Timestamp(0) : new java.sql.Timestamp(since.getTimeInMillis()); - return requirementRepository.getStatisticsForRequirement(userId, requirementId, timestamp.toLocalDateTime()); + return requirementRepository.getStatisticsForRequirement(userId, requirementId, timestamp.toLocalDateTime().atOffset(ZoneOffset.UTC)); } @Override @@ -540,7 +541,7 @@ public boolean isCategoryPublic(int categoryId) throws BazaarException { public Statistic getStatisticsForCategory(int userId, int categoryId, Calendar since) throws BazaarException { categoryRepository = (categoryRepository != null) ? categoryRepository : new CategoryRepositoryImpl(dslContext); Timestamp timestamp = since == null ? new java.sql.Timestamp(0) : new java.sql.Timestamp(since.getTimeInMillis()); - return categoryRepository.getStatisticsForCategory(userId, categoryId, timestamp.toLocalDateTime()); + return categoryRepository.getStatisticsForCategory(userId, categoryId, timestamp.toLocalDateTime().atOffset(ZoneOffset.UTC)); } @Override diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java index 87a99b3c..3be33d10 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Activity.java @@ -9,7 +9,7 @@ import lombok.NonNull; import lombok.extern.jackson.Jacksonized; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; @EqualsAndHashCode(callSuper = true) @Data @@ -19,8 +19,8 @@ public class Activity extends EntityBase { private final transient int id; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") - private final LocalDateTime creationDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone = "Europe/Berlin") + private final OffsetDateTime creationDate; private final ActivityAction activityAction; private final String dataUrl; diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java index 95c4223e..64f867b8 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Attachment.java @@ -30,7 +30,7 @@ import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; @EqualsAndHashCode(callSuper = true) @Data @@ -64,11 +64,11 @@ public class Attachment extends EntityBase implements Ownable { private User creator; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") - private LocalDateTime creationDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone = "Europe/Berlin") + private OffsetDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") - private LocalDateTime lastUpdatedDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone = "Europe/Berlin") + private OffsetDateTime lastUpdatedDate; @Override public boolean isOwner(User user) { diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java index a9090edb..4a03b112 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Category.java @@ -33,7 +33,7 @@ import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; /** * @since 6/9/2014 @@ -59,14 +59,14 @@ public class Category extends EntityBase implements Ownable { private User creator; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") - private LocalDateTime creationDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone = "Europe/Berlin") + private OffsetDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") - private LocalDateTime lastUpdatedDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone = "Europe/Berlin") + private OffsetDateTime lastUpdatedDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") - private LocalDateTime lastActivity; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone = "Europe/Berlin") + private OffsetDateTime lastActivity; private Integer numberOfRequirements; private Integer numberOfFollowers; diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java index 089d321f..562d26e3 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java @@ -32,7 +32,7 @@ import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; /** * @since 6/11/2014 @@ -57,11 +57,11 @@ public class Comment extends EntityBase implements Ownable { private User creator; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") - private LocalDateTime creationDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone = "Europe/Berlin") + private OffsetDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") - private LocalDateTime lastUpdatedDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone = "Europe/Berlin") + private OffsetDateTime lastUpdatedDate; @lombok.Builder.Default private Boolean deleted = false; diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java index aed55f8b..fa1b0cbd 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Email.java @@ -6,7 +6,7 @@ import lombok.EqualsAndHashCode; import lombok.extern.jackson.Jacksonized; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.Set; @EqualsAndHashCode(callSuper = true) @@ -23,13 +23,13 @@ public class Email extends EntityBase { private final String message; private final String closing; private final String footer; - private final LocalDateTime creationDate; - - public void removeRecipient(User user) { - recipients.remove(user); - } + private final OffsetDateTime creationDate; public static Activity.Builder getBuilder() { return new Activity.Builder(); } + + public void removeRecipient(User user) { + recipients.remove(user); + } } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Feedback.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Feedback.java index 6a055bd9..e5b9ee00 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Feedback.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Feedback.java @@ -10,7 +10,7 @@ import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; @EqualsAndHashCode(callSuper = true) @Data @@ -26,8 +26,8 @@ public class Feedback extends EntityBase { @NotNull(message = "feedback can not be null", groups = CreateValidation.class) private String feedback; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") - private LocalDateTime creationDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone = "Europe/Berlin") + private OffsetDateTime creationDate; @JsonProperty("email") private String eMail; diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java index 7fa69c13..093736dc 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Project.java @@ -31,7 +31,7 @@ import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; /** * @since 6/9/2014 @@ -58,14 +58,14 @@ public class Project extends EntityBase implements Ownable { private User leader; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") - private LocalDateTime creationDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone = "Europe/Berlin") + private OffsetDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") - private LocalDateTime lastUpdatedDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone = "Europe/Berlin") + private OffsetDateTime lastUpdatedDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") - private LocalDateTime lastActivity; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone = "Europe/Berlin") + private OffsetDateTime lastActivity; private Integer numberOfCategories; private Integer numberOfRequirements; diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java index 1565a260..d97ed23d 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/Requirement.java @@ -14,7 +14,7 @@ import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; @@ -37,8 +37,8 @@ public class Requirement extends EntityBase implements Ownable { @Size(min = 1, message = "Description can't be empty") private String description; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") - private LocalDateTime realized; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone = "Europe/Berlin") + private OffsetDateTime realized; @Min(value = 0) @NotNull(message = "A project id must be provided", groups = CreateValidation.class) @@ -58,14 +58,14 @@ public class Requirement extends EntityBase implements Ownable { @lombok.Builder.Default private List tags = new ArrayList<>(); - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") - private LocalDateTime creationDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone = "Europe/Berlin") + private OffsetDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") - private LocalDateTime lastUpdatedDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone = "Europe/Berlin") + private OffsetDateTime lastUpdatedDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") - private LocalDateTime lastActivity; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone = "Europe/Berlin") + private OffsetDateTime lastActivity; private Integer numberOfComments; private Integer numberOfAttachments; diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java index 45b81361..d2091d73 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/entities/User.java @@ -31,7 +31,7 @@ import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.Objects; @EqualsAndHashCode(callSuper = true) @@ -74,17 +74,17 @@ public class User extends EntityBase { @JsonView(SerializerViews.Private.class) private Boolean personalizationEnabled; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone = "Europe/Berlin") @JsonView(SerializerViews.Private.class) - private LocalDateTime creationDate; + private OffsetDateTime creationDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone = "Europe/Berlin") @JsonView(SerializerViews.Private.class) - private LocalDateTime lastUpdatedDate; + private OffsetDateTime lastUpdatedDate; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "Europe/Berlin") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone = "Europe/Berlin") @JsonView(SerializerViews.Private.class) - private LocalDateTime lastLoginDate; + private OffsetDateTime lastLoginDate; @JsonView(SerializerViews.Private.class) public String getEMail() { diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java index e30d0bd5..50e34aaf 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepository.java @@ -26,7 +26,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.List; /** @@ -46,7 +46,7 @@ public interface CategoryRepository extends Repository { boolean belongsToPublicProject(int id) throws BazaarException; - Statistic getStatisticsForCategory(int userId, int categoryId, LocalDateTime timestamp) throws BazaarException; + Statistic getStatisticsForCategory(int userId, int categoryId, OffsetDateTime timestamp) throws BazaarException; List getFollowedCategories(int userId, int count) throws BazaarException; } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java index 03a9039c..e8eb0920 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/CategoryRepositoryImpl.java @@ -40,7 +40,7 @@ import org.jooq.exception.DataAccessException; import org.jooq.impl.DSL; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.*; import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; @@ -160,7 +160,7 @@ private ImmutablePair, Integer> getFilteredCategories(Collection< category.setCreator(userTransformer.getEntityFromTableRecord(userRecord)); category.setNumberOfRequirements((Integer) queryResult.getValue(REQUIREMENT_COUNT)); category.setNumberOfFollowers((Integer) queryResult.getValue(FOLLOWER_COUNT)); - category.setLastActivity((LocalDateTime) queryResult.getValue(lastActivity)); + category.setLastActivity((OffsetDateTime) queryResult.getValue(lastActivity)); if (userId != 1) { userContext.isFollower((Integer) queryResult.getValue(isFollower) != 0); } @@ -291,7 +291,7 @@ public boolean belongsToPublicProject(int id) throws BazaarException { } @Override - public Statistic getStatisticsForCategory(int userId, int categoryId, LocalDateTime timestamp) throws BazaarException { + public Statistic getStatisticsForCategory(int userId, int categoryId, OffsetDateTime timestamp) throws BazaarException { Statistic result = null; try { // If you want to change something here, please know what you are doing! Its SQL and even worse JOOQ :-| diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java index a6656d31..219c5789 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepository.java @@ -26,7 +26,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.List; /** @@ -42,9 +42,9 @@ public interface ProjectRepository extends Repository { boolean belongsToPublicProject(int id) throws BazaarException; - Statistic getStatisticsForVisibleProjects(int userId, LocalDateTime timestamp) throws BazaarException; + Statistic getStatisticsForVisibleProjects(int userId, OffsetDateTime timestamp) throws BazaarException; - Statistic getStatisticsForProject(int userId, int projectId, LocalDateTime timestamp) throws BazaarException; + Statistic getStatisticsForProject(int userId, int projectId, OffsetDateTime timestamp) throws BazaarException; List listAllProjectIds(Pageable pageable, int userId) throws BazaarException; diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java index 952adc3d..0646496e 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java @@ -40,7 +40,7 @@ import org.jooq.exception.DataAccessException; import org.jooq.impl.DSL; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -168,7 +168,7 @@ private ImmutablePair, Integer> getFilteredProjects(Condition sear project.setNumberOfCategories((Integer) queryResult.getValue(CATEGORY_COUNT)); project.setNumberOfRequirements((Integer) queryResult.getValue(REQUIREMENT_COUNT)); project.setNumberOfFollowers((Integer) queryResult.getValue(FOLLOWER_COUNT)); - project.setLastActivity((LocalDateTime) queryResult.getValue(lastActivity)); + project.setLastActivity((OffsetDateTime) queryResult.getValue(lastActivity)); if (userId != 1) { userContext.isFollower(0 != (Integer) queryResult.getValue(isFollower)); } @@ -310,7 +310,7 @@ public boolean belongsToPublicProject(int id) throws BazaarException { } @Override - public Statistic getStatisticsForVisibleProjects(int userId, LocalDateTime timestamp) throws BazaarException { + public Statistic getStatisticsForVisibleProjects(int userId, OffsetDateTime timestamp) throws BazaarException { Statistic result = null; try { // If you want to change something here, please know what you are doing! Its SQL and even worse JOOQ :-| @@ -368,7 +368,7 @@ public Statistic getStatisticsForVisibleProjects(int userId, LocalDateTime times } @Override - public Statistic getStatisticsForProject(int userId, int projectId, LocalDateTime timestamp) throws + public Statistic getStatisticsForProject(int userId, int projectId, OffsetDateTime timestamp) throws BazaarException { Statistic result = null; try { diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java index 1f8f4968..0371a733 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepository.java @@ -26,7 +26,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.helpers.PaginationResult; import de.rwth.dbis.acis.bazaar.service.exception.BazaarException; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.List; public interface RequirementRepository extends Repository { @@ -45,11 +45,11 @@ public interface RequirementRepository extends Repository { Requirement findById(int id, int userId, List embed) throws Exception; - void setRealized(int id, LocalDateTime realized) throws BazaarException; + void setRealized(int id, OffsetDateTime realized) throws BazaarException; void setLeadDeveloper(int id, Integer userId) throws BazaarException; - Statistic getStatisticsForRequirement(int userId, int requirementId, LocalDateTime timestamp) throws BazaarException; + Statistic getStatisticsForRequirement(int userId, int requirementId, OffsetDateTime timestamp) throws BazaarException; List getFollowedRequirements(int userId, int count) throws BazaarException; } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java index f03d75c7..6c808a33 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/RequirementRepositoryImpl.java @@ -39,7 +39,7 @@ import org.jooq.impl.DSL; import java.math.BigDecimal; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.*; import java.util.stream.Collectors; @@ -185,7 +185,7 @@ private ImmutablePair, Integer> getFilteredRequirements(Collec Requirement requirement = transformer.getEntityFromTableRecord(requirementRecord); UserContext.Builder userContext = UserContext.builder(); - requirement.setLastActivity((LocalDateTime) queryResult.getValue(lastActivity)); + requirement.setLastActivity((OffsetDateTime) queryResult.getValue(lastActivity)); UserTransformer userTransformer = new UserTransformer(); //Filling up Creator @@ -409,11 +409,11 @@ public Requirement findById(int id, int userId, List embed) throws Excep } @Override - public void setRealized(int id, LocalDateTime realized) throws BazaarException { + public void setRealized(int id, OffsetDateTime realized) throws BazaarException { try { jooq.update(REQUIREMENT) .set(REQUIREMENT.REALIZED, realized) - .set(REQUIREMENT.LAST_UPDATED_DATE, LocalDateTime.now()) + .set(REQUIREMENT.LAST_UPDATED_DATE, OffsetDateTime.now()) .where(REQUIREMENT.ID.eq(id)) .execute(); } catch (Exception e) { @@ -426,7 +426,7 @@ public void setLeadDeveloper(int id, Integer userId) throws BazaarException { try { jooq.update(REQUIREMENT) .set(REQUIREMENT.LEAD_DEVELOPER_ID, userId) - .set(REQUIREMENT.LAST_UPDATED_DATE, LocalDateTime.now()) + .set(REQUIREMENT.LAST_UPDATED_DATE, OffsetDateTime.now()) .where(REQUIREMENT.ID.eq(id)) .execute(); } catch (Exception e) { @@ -435,7 +435,7 @@ public void setLeadDeveloper(int id, Integer userId) throws BazaarException { } @Override - public Statistic getStatisticsForRequirement(int userId, int requirementId, LocalDateTime timestamp) throws BazaarException { + public Statistic getStatisticsForRequirement(int userId, int requirementId, OffsetDateTime timestamp) throws BazaarException { Statistic result = null; try { // If you want to change something here, please know what you are doing! Its SQL and even worse JOOQ :-| diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java index 67a88403..7520e380 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/UserRepositoryImpl.java @@ -34,10 +34,12 @@ import de.rwth.dbis.acis.bazaar.service.exception.ExceptionLocation; import i5.las2peer.api.security.AgentLockedException; import i5.las2peer.security.PassphraseAgentImpl; -import org.jooq.*; +import org.jooq.DSLContext; +import org.jooq.Field; import org.jooq.Record; +import org.jooq.Result; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -71,6 +73,7 @@ public Integer getIdByLas2PeerId(String las2PeerId) throws BazaarException { /** * Hash agent sub field. This was needed to update from las2peer 0.6.* to 0.7.*. * The las2peer id changed, and with the hashAgentSub method the old las2peer id can be generated. + * * @param agent * @return hashed agent sub * @throws BazaarException @@ -106,7 +109,7 @@ public void updateLas2peerId(int userId, String las2PeerId) throws BazaarExcepti @Override public void updateLastLoginDate(int userId) throws Exception { try { - jooq.update(USER).set(USER.LAST_LOGIN_DATE, LocalDateTime.now()) + jooq.update(USER).set(USER.LAST_LOGIN_DATE, OffsetDateTime.now()) .where(USER.ID.equal(userId)) .execute(); } catch (Exception e) { @@ -161,7 +164,9 @@ public RequirementContributors findRequirementContributors(int requirementId) th } List developers = new ArrayList<>(); for (Map.Entry> entry : queryResult.intoGroups(developer.ID).entrySet()) { - if (entry.getKey() == null) continue; + if (entry.getKey() == null) { + continue; + } Result records = entry.getValue(); developers.add( userTransformer.getEntityFromQueryResult(developer, records) @@ -171,7 +176,9 @@ public RequirementContributors findRequirementContributors(int requirementId) th List commentCreators = new ArrayList<>(); for (Map.Entry> entry : queryResult.intoGroups(commentCreator.ID).entrySet()) { - if (entry.getKey() == null) continue; + if (entry.getKey() == null) { + continue; + } Result records = entry.getValue(); commentCreators.add( userTransformer.getEntityFromQueryResult(commentCreator, records) @@ -181,7 +188,9 @@ public RequirementContributors findRequirementContributors(int requirementId) th List attachmentCreators = new ArrayList<>(); for (Map.Entry> entry : queryResult.intoGroups(attachmentCreator.ID).entrySet()) { - if (entry.getKey() == null) continue; + if (entry.getKey() == null) { + continue; + } Result records = entry.getValue(); attachmentCreators.add( userTransformer.getEntityFromQueryResult(attachmentCreator, records) @@ -246,7 +255,9 @@ public CategoryContributors findCategoryContributors(int categoryId) throws Baza List requirementCreators = new ArrayList<>(); for (Map.Entry> entry : queryResult.intoGroups(requirementCreator.ID).entrySet()) { - if (entry.getKey() == null) continue; + if (entry.getKey() == null) { + continue; + } Result records = entry.getValue(); requirementCreators.add( userTransformer.getEntityFromQueryResult(requirementCreator, records) @@ -256,7 +267,9 @@ public CategoryContributors findCategoryContributors(int categoryId) throws Baza List leadDevelopers = new ArrayList<>(); for (Map.Entry> entry : queryResult.intoGroups(leadDeveloper.ID).entrySet()) { - if (entry.getKey() == null) continue; + if (entry.getKey() == null) { + continue; + } Result records = entry.getValue(); leadDevelopers.add( userTransformer.getEntityFromQueryResult(leadDeveloper, records) @@ -266,7 +279,9 @@ public CategoryContributors findCategoryContributors(int categoryId) throws Baza List developers = new ArrayList<>(); for (Map.Entry> entry : queryResult.intoGroups(developer.ID).entrySet()) { - if (entry.getKey() == null) continue; + if (entry.getKey() == null) { + continue; + } Result records = entry.getValue(); developers.add( userTransformer.getEntityFromQueryResult(developer, records) @@ -276,7 +291,9 @@ public CategoryContributors findCategoryContributors(int categoryId) throws Baza List commentCreators = new ArrayList<>(); for (Map.Entry> entry : queryResult.intoGroups(commentCreator.ID).entrySet()) { - if (entry.getKey() == null) continue; + if (entry.getKey() == null) { + continue; + } Result records = entry.getValue(); commentCreators.add( userTransformer.getEntityFromQueryResult(commentCreator, records) @@ -286,7 +303,9 @@ public CategoryContributors findCategoryContributors(int categoryId) throws Baza List attachmentCreators = new ArrayList<>(); for (Map.Entry> entry : queryResult.intoGroups(attachmentCreator.ID).entrySet()) { - if (entry.getKey() == null) continue; + if (entry.getKey() == null) { + continue; + } Result records = entry.getValue(); attachmentCreators.add( userTransformer.getEntityFromQueryResult(attachmentCreator, records) @@ -358,7 +377,9 @@ public ProjectContributors findProjectContributors(int projectId) throws BazaarE List categoriesLeaders = new ArrayList<>(); for (Map.Entry> entry : queryResult.intoGroups(categoryLeader.ID).entrySet()) { - if (entry.getKey() == null) continue; + if (entry.getKey() == null) { + continue; + } Result records = entry.getValue(); categoriesLeaders.add( userTransformer.getEntityFromQueryResult(categoryLeader, records) @@ -368,7 +389,9 @@ public ProjectContributors findProjectContributors(int projectId) throws BazaarE List requirementCreators = new ArrayList<>(); for (Map.Entry> entry : queryResult.intoGroups(requirementCreator.ID).entrySet()) { - if (entry.getKey() == null) continue; + if (entry.getKey() == null) { + continue; + } Result records = entry.getValue(); requirementCreators.add( userTransformer.getEntityFromQueryResult(requirementCreator, records) @@ -378,7 +401,9 @@ public ProjectContributors findProjectContributors(int projectId) throws BazaarE List leadDevelopers = new ArrayList<>(); for (Map.Entry> entry : queryResult.intoGroups(leadDeveloper.ID).entrySet()) { - if (entry.getKey() == null) continue; + if (entry.getKey() == null) { + continue; + } Result records = entry.getValue(); leadDevelopers.add( userTransformer.getEntityFromQueryResult(leadDeveloper, records) @@ -388,7 +413,9 @@ public ProjectContributors findProjectContributors(int projectId) throws BazaarE List developers = new ArrayList<>(); for (Map.Entry> entry : queryResult.intoGroups(developer.ID).entrySet()) { - if (entry.getKey() == null) continue; + if (entry.getKey() == null) { + continue; + } Result records = entry.getValue(); developers.add( userTransformer.getEntityFromQueryResult(developer, records) @@ -398,7 +425,9 @@ public ProjectContributors findProjectContributors(int projectId) throws BazaarE List commentCreators = new ArrayList<>(); for (Map.Entry> entry : queryResult.intoGroups(commentCreator.ID).entrySet()) { - if (entry.getKey() == null) continue; + if (entry.getKey() == null) { + continue; + } Result records = entry.getValue(); commentCreators.add( userTransformer.getEntityFromQueryResult(commentCreator, records) @@ -408,7 +437,9 @@ public ProjectContributors findProjectContributors(int projectId) throws BazaarE List attachmentCreators = new ArrayList<>(); for (Map.Entry> entry : queryResult.intoGroups(attachmentCreator.ID).entrySet()) { - if (entry.getKey() == null) continue; + if (entry.getKey() == null) { + continue; + } Result records = entry.getValue(); attachmentCreators.add( userTransformer.getEntityFromQueryResult(attachmentCreator, records) @@ -650,6 +681,7 @@ public List getEmailReceiverForRequirement(int requirementId) throws Bazaa return entries; } + @Override public List search(Pageable pageable) throws BazaarException { List entries = null; try { diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java index d129ab1a..8fd090c3 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/AttachmentTransformer.java @@ -25,7 +25,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import org.jooq.*; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.*; import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.ATTACHMENT; @@ -43,7 +43,7 @@ public AttachmentRecord createRecord(Attachment entity) { record.setMimeType(entity.getMimeType()); record.setIdentifier(entity.getIdentifier()); record.setFileUrl(entity.getFileUrl()); - record.setCreationDate(LocalDateTime.now()); + record.setCreationDate(OffsetDateTime.now()); return record; } @@ -78,11 +78,11 @@ public Class getRecordClass() { } @Override - public Map getUpdateMap(final Attachment entity) { - HashMap updateMap = new HashMap() {{ + public Map getUpdateMap(Attachment entity) { + HashMap updateMap = new HashMap<>() {{ }}; if (!updateMap.isEmpty()) { - updateMap.put(ATTACHMENT.LAST_UPDATED_DATE, LocalDateTime.now()); + updateMap.put(ATTACHMENT.LAST_UPDATED_DATE, OffsetDateTime.now()); } return updateMap; } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java index 4ff63bbf..a8a19210 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CategoryTransformer.java @@ -30,7 +30,7 @@ import org.jooq.*; import org.jooq.impl.DSL; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.*; import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.CATEGORY; @@ -47,7 +47,7 @@ public CategoryRecord createRecord(Category entry) { record.setName(entry.getName()); record.setProjectId(entry.getProjectId()); record.setLeaderId(entry.getCreator().getId()); - record.setCreationDate(LocalDateTime.now()); + record.setCreationDate(OffsetDateTime.now()); if (entry.getAdditionalProperties() != null) { record.setAdditionalProperties(JSONB.jsonb(entry.getAdditionalProperties().toString())); } @@ -111,7 +111,7 @@ public Map getUpdateMap(Category entry) { } }}; if (!updateMap.isEmpty()) { - updateMap.put(CATEGORY.LAST_UPDATED_DATE, LocalDateTime.now()); + updateMap.put(CATEGORY.LAST_UPDATED_DATE, OffsetDateTime.now()); } return updateMap; } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java index 7112033f..9d904ffa 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformer.java @@ -26,7 +26,7 @@ import org.jooq.*; import org.jooq.impl.DSL; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.*; import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; @@ -42,7 +42,7 @@ public CommentRecord createRecord(Comment entity) { record.setMessage(entity.getMessage()); record.setRequirementId(entity.getRequirementId()); record.setReplyToCommentId(entity.getReplyToComment()); - record.setCreationDate(LocalDateTime.now()); + record.setCreationDate(OffsetDateTime.now()); record.setDeleted(entity.getDeleted()); return record; } @@ -76,14 +76,14 @@ public Class getRecordClass() { } @Override - public Map getUpdateMap(final Comment entity) { - HashMap updateMap = new HashMap() {{ + public Map getUpdateMap(Comment entity) { + HashMap updateMap = new HashMap<>() {{ put(COMMENT.REQUIREMENT_ID, entity.getRequirementId()); put(COMMENT.MESSAGE, entity.getMessage()); put(COMMENT.DELETED, entity.getDeleted()); }}; if (!updateMap.isEmpty()) { - updateMap.put(COMMENT.LAST_UPDATED_DATE, LocalDateTime.now()); + updateMap.put(COMMENT.LAST_UPDATED_DATE, OffsetDateTime.now()); } return updateMap; } @@ -132,7 +132,9 @@ public Collection> getSortFields(List @Override public Condition getSearchCondition(String search) throws Exception { //throw new Exception("Search is not supported!"); - if(search != "") return COMMENT.MESSAGE.likeIgnoreCase("%" + search + "%"); + if (search != "") { + return COMMENT.MESSAGE.likeIgnoreCase("%" + search + "%"); + } return DSL.trueCondition(); } @@ -146,32 +148,29 @@ public Collection getFilterConditions(Map f conditions.add( COMMENT.USER_ID.eq(Integer.parseInt(filterEntry.getValue())) ); - }else - - if(filterEntry.getKey().equals("following")){ + } else if (filterEntry.getKey().equals("following")) { conditions.add( COMMENT.REQUIREMENT_ID.in( DSL.select(REQUIREMENT_FOLLOWER_MAP.REQUIREMENT_ID) .from(REQUIREMENT_FOLLOWER_MAP) .where(REQUIREMENT_FOLLOWER_MAP.USER_ID.eq(Integer.parseInt(filterEntry.getValue()))) - .union( - DSL.select(REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID) - .from(REQUIREMENT_CATEGORY_MAP) - .join(CATEGORY_FOLLOWER_MAP) - .on(REQUIREMENT_CATEGORY_MAP.CATEGORY_ID.eq(CATEGORY_FOLLOWER_MAP.CATEGORY_ID) - .and(CATEGORY_FOLLOWER_MAP.USER_ID.eq(Integer.parseInt(filterEntry.getValue())))) - ).union( - DSL.select(REQUIREMENT.ID) - .from(REQUIREMENT) - .join(PROJECT_FOLLOWER_MAP) - .on(REQUIREMENT.PROJECT_ID.eq(PROJECT_FOLLOWER_MAP.PROJECT_ID) - .and(PROJECT_FOLLOWER_MAP.USER_ID.eq(Integer.parseInt(filterEntry.getValue())))) - ) + .union( + DSL.select(REQUIREMENT_CATEGORY_MAP.REQUIREMENT_ID) + .from(REQUIREMENT_CATEGORY_MAP) + .join(CATEGORY_FOLLOWER_MAP) + .on(REQUIREMENT_CATEGORY_MAP.CATEGORY_ID.eq(CATEGORY_FOLLOWER_MAP.CATEGORY_ID) + .and(CATEGORY_FOLLOWER_MAP.USER_ID.eq(Integer.parseInt(filterEntry.getValue())))) + ).union( + DSL.select(REQUIREMENT.ID) + .from(REQUIREMENT) + .join(PROJECT_FOLLOWER_MAP) + .on(REQUIREMENT.PROJECT_ID.eq(PROJECT_FOLLOWER_MAP.PROJECT_ID) + .and(PROJECT_FOLLOWER_MAP.USER_ID.eq(Integer.parseInt(filterEntry.getValue())))) + ) ) ); - }else - if(filterEntry.getKey().equals("replies")) { + } else if (filterEntry.getKey().equals("replies")) { de.rwth.dbis.acis.bazaar.dal.jooq.tables.Comment SUB_COMMENTS = COMMENT.as("sub_comments"); de.rwth.dbis.acis.bazaar.dal.jooq.tables.Comment IN_COMMENTS = COMMENT.as("in_comments"); conditions.add( @@ -179,17 +178,17 @@ public Collection getFilterConditions(Map f DSL.select(IN_COMMENTS.ID) .from(IN_COMMENTS) .leftSemiJoin(SUB_COMMENTS).on( - ( - IN_COMMENTS.REPLY_TO_COMMENT_ID.eq(SUB_COMMENTS.REPLY_TO_COMMENT_ID) //Refering same thread/base-comment - .and( - IN_COMMENTS.CREATION_DATE.greaterThan(SUB_COMMENTS.CREATION_DATE) //replies have greater timestamp than the users comment - ).and( - SUB_COMMENTS.USER_ID.eq(Integer.parseInt(filterEntry.getValue())) //Comments the user wrote + ( + IN_COMMENTS.REPLY_TO_COMMENT_ID.eq(SUB_COMMENTS.REPLY_TO_COMMENT_ID) //Refering same thread/base-comment + .and( + IN_COMMENTS.CREATION_DATE.greaterThan(SUB_COMMENTS.CREATION_DATE) //replies have greater timestamp than the users comment + ).and( + SUB_COMMENTS.USER_ID.eq(Integer.parseInt(filterEntry.getValue())) //Comments the user wrote + ) + ).or( + IN_COMMENTS.REPLY_TO_COMMENT_ID.eq(SUB_COMMENTS.ID).and(SUB_COMMENTS.USER_ID.eq(Integer.parseInt(filterEntry.getValue()))) //User is Thread-Owner ) - ).or( - IN_COMMENTS.REPLY_TO_COMMENT_ID.eq(SUB_COMMENTS.ID).and(SUB_COMMENTS.USER_ID.eq(Integer.parseInt(filterEntry.getValue()))) //User is Thread-Owner - ) - ).where(IN_COMMENTS.USER_ID.notEqual(Integer.parseInt(filterEntry.getValue()))) // Remove Users "Own" Comments + ).where(IN_COMMENTS.USER_ID.notEqual(Integer.parseInt(filterEntry.getValue()))) // Remove Users "Own" Comments ) ); } @@ -208,7 +207,7 @@ public Collection getFilterConditions(Map f }else */ - else{ + else { conditions.add( DSL.falseCondition() diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/FeedbackTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/FeedbackTransformer.java index 2e3ff409..55ce1f61 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/FeedbackTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/FeedbackTransformer.java @@ -5,7 +5,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import org.jooq.*; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.*; import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.FEEDBACK; @@ -18,7 +18,7 @@ public FeedbackRecord createRecord(Feedback entity) { record.setFeedback(entity.getFeedback()); record.setEmail(entity.getEMail()); record.setRequirementId(entity.getRequirementId()); - record.setCreationDate(LocalDateTime.now()); + record.setCreationDate(OffsetDateTime.now()); return record; } @@ -57,7 +57,8 @@ public Map getUpdateMap(Feedback entity) { put(FEEDBACK.REQUIREMENT_ID, entity.getRequirementId()); } }}; - return updateMap; } + return updateMap; + } @Override public Collection> getSortFields(List sorts) { diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java index 8c5145be..9b99942e 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/ProjectTransformer.java @@ -30,7 +30,7 @@ import org.jooq.*; import org.jooq.impl.DSL; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.*; import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; @@ -45,7 +45,7 @@ public ProjectRecord createRecord(Project entry) { record.setLeaderId(entry.getLeader().getId()); record.setVisibility(entry.getVisibility()); record.setDefaultCategoryId(entry.getDefaultCategoryId()); - record.setCreationDate(LocalDateTime.now()); + record.setCreationDate(OffsetDateTime.now()); if (entry.getAdditionalProperties() != null) { record.setAdditionalProperties(JSONB.jsonb(entry.getAdditionalProperties().toString())); } @@ -116,7 +116,7 @@ public Map getUpdateMap(Project entry) { } }}; if (!updateMap.isEmpty()) { - updateMap.put(PROJECT.LAST_UPDATED_DATE, LocalDateTime.now()); + updateMap.put(PROJECT.LAST_UPDATED_DATE, OffsetDateTime.now()); } return updateMap; } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java index ab6e74b9..3bcc81ed 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java @@ -30,7 +30,7 @@ import org.jooq.*; import org.jooq.impl.DSL; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.*; import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.*; @@ -41,7 +41,7 @@ public RequirementRecord createRecord(Requirement entry) { RequirementRecord record = new RequirementRecord(); record.setDescription(entry.getDescription()); record.setName(entry.getName()); - record.setCreationDate(LocalDateTime.now()); + record.setCreationDate(OffsetDateTime.now()); record.setCreatorId(entry.getCreator().getId()); record.setProjectId(entry.getProjectId()); if (entry.getAdditionalProperties() != null) { @@ -109,7 +109,7 @@ public Map getUpdateMap(Requirement entry) { } }}; if (!updateMap.isEmpty()) { - updateMap.put(REQUIREMENT.LAST_UPDATED_DATE, LocalDateTime.now()); + updateMap.put(REQUIREMENT.LAST_UPDATED_DATE, OffsetDateTime.now()); } return updateMap; } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/TagTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/TagTransformer.java index d2092b93..270255f7 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/TagTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/TagTransformer.java @@ -5,7 +5,7 @@ import de.rwth.dbis.acis.bazaar.service.dal.helpers.Pageable; import org.jooq.*; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.*; import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.TAG; @@ -17,7 +17,7 @@ public TagRecord createRecord(Tag entity) { record.setProjectId(entity.getProjectId()); record.setName(entity.getName()); record.setColour(entity.getColour()); - record.setCreationDate(LocalDateTime.now()); + record.setCreationDate(OffsetDateTime.now()); return record; } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java index af9d17b1..febaacee 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/UserTransformer.java @@ -26,7 +26,7 @@ import org.jooq.Record; import org.jooq.*; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.*; import static de.rwth.dbis.acis.bazaar.dal.jooq.Tables.USER; @@ -44,7 +44,7 @@ public UserRecord createRecord(User entity) { record.setEmailLeadSubscription(entity.isEmailLeadSubscription()); record.setEmailFollowSubscription(entity.isEmailFollowSubscription()); record.setPersonalizationEnabled(entity.isPersonalizationEnabled()); - record.setCreationDate(LocalDateTime.now()); + record.setCreationDate(OffsetDateTime.now()); return record; } @@ -99,8 +99,8 @@ public Class getRecordClass() { } @Override - public Map getUpdateMap(final User entity) { - HashMap updateMap = new HashMap() {{ + public Map getUpdateMap(User entity) { + HashMap updateMap = new HashMap<>() {{ if (entity.getEMail() != null) { put(USER.EMAIL, entity.getEMail()); } @@ -127,7 +127,7 @@ public Map getUpdateMap(final User entity) { } }}; if (!updateMap.isEmpty()) { - updateMap.put(USER.LAST_UPDATED_DATE, LocalDateTime.now()); + updateMap.put(USER.LAST_UPDATED_DATE, OffsetDateTime.now()); } return updateMap; } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java index 65c35f4a..e2b01019 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/ActivityDispatcher.java @@ -16,7 +16,7 @@ import i5.las2peer.logging.L2pLogger; import javax.ws.rs.core.Response; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; /** * Created by martin on 15.02.2016. @@ -28,7 +28,7 @@ public class ActivityDispatcher { private final String activityOrigin; private final String baseURL; private final String frontendBaseURL; - private BazaarService bazaarService; + private final BazaarService bazaarService; public ActivityDispatcher(BazaarService bazaarService, String activityTrackerService, String activityOrigin, String baseURL, String frontendBaseURL) { this.bazaarService = bazaarService; @@ -38,7 +38,7 @@ public ActivityDispatcher(BazaarService bazaarService, String activityTrackerSer this.frontendBaseURL = frontendBaseURL; } - public void sendActivityOverRMI(LocalDateTime creationDate, Activity.ActivityAction activityAction, + public void sendActivityOverRMI(OffsetDateTime creationDate, Activity.ActivityAction activityAction, int dataId, Activity.DataType dataType, int userId, Activity.AdditionalObject additionalObject) { DALFacade dalFacade; try { @@ -93,7 +93,7 @@ public void sendActivityOverRMI(LocalDateTime creationDate, Activity.ActivityAct } else if (dataType.equals(Activity.DataType.USER)) { resourcePath = "users"; frontendResourcePath = "users" + "/" + dataId; - } + } resourcePath = resourcePath + "/" + String.valueOf(dataId); if (parentResourcePath != null) { parentResourcePath = parentResourcePath + "/" + String.valueOf(parentDataId); diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java index b05f1f6d..d5958c05 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/EmailDispatcher.java @@ -11,7 +11,7 @@ import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.*; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -36,11 +36,11 @@ public EmailDispatcher(BazaarService bazaarService, String smtpServer, String em this.emailFromAddress = emailFromAddress; this.bazaarService = bazaarService; this.frontendBaseURL = frontendBaseURL; - this.notificationSummery = new LinkedHashMap<>(); + notificationSummery = new LinkedHashMap<>(); this.emailSummaryTimePeriodInMinutes = emailSummaryTimePeriodInMinutes; } - public void addEmailNotification(LocalDateTime creationDate, Activity.ActivityAction activityAction, + public void addEmailNotification(OffsetDateTime creationDate, Activity.ActivityAction activityAction, int dataId, Activity.DataType dataType, int userId, Activity.AdditionalObject additionalObject) { DALFacade dalFacade; try { @@ -89,7 +89,7 @@ public void addEmailNotification(LocalDateTime creationDate, Activity.ActivityAc } } - private Email generateEmail(List recipients, LocalDateTime creationDate, Activity.ActivityAction activityAction, + private Email generateEmail(List recipients, OffsetDateTime creationDate, Activity.ActivityAction activityAction, int dataId, Activity.DataType dataType, Activity.AdditionalObject additionalObject) throws Exception { DALFacade dalFacade = bazaarService.getDBConnection(); String subject = ""; @@ -244,7 +244,7 @@ public void emptyNotificationSummery() { emailBuilder.message(message); emailBuilder.closing(closing); emailBuilder.footer(footer); - emailBuilder.creationDate(LocalDateTime.now()); + emailBuilder.creationDate(OffsetDateTime.now()); Email summary = emailBuilder.build(); sendEmail(summary); @@ -279,7 +279,7 @@ private void sendEmail(Email mail) { text = text.concat(mail.getFooter()); mailMessage.setText(text); mailMessage.setHeader("X-Mailer", "msgsend"); - mailMessage.setSentDate(java.sql.Timestamp.valueOf(mail.getCreationDate())); + mailMessage.setSentDate(java.sql.Timestamp.valueOf(mail.getCreationDate().toLocalDateTime())); Transport.send(mailMessage); diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcher.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcher.java index a84af4e8..a567e1c2 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcher.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcher.java @@ -4,13 +4,13 @@ import de.rwth.dbis.acis.bazaar.service.dal.entities.Activity; import i5.las2peer.api.logging.MonitoringEvent; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; /** * Created by martin on 15.02.2016. */ public interface NotificationDispatcher extends Runnable { - void dispatchNotification(LocalDateTime creationDate, Activity.ActivityAction activityAction, final MonitoringEvent mobSOSEvent, + void dispatchNotification(OffsetDateTime creationDate, Activity.ActivityAction activityAction, MonitoringEvent mobSOSEvent, int dataId, Activity.DataType dataType, int userId); void setBazaarService(BazaarService service); diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java index a0f56d0e..0d8b9409 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/notification/NotificationDispatcherImp.java @@ -14,7 +14,7 @@ import i5.las2peer.api.logging.MonitoringEvent; import i5.las2peer.logging.L2pLogger; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.TimerTask; /** @@ -22,27 +22,30 @@ */ public class NotificationDispatcherImp extends TimerTask implements NotificationDispatcher { - private L2pLogger logger = L2pLogger.getInstance(NotificationDispatcherImp.class.getName()); + private final L2pLogger logger = L2pLogger.getInstance(NotificationDispatcherImp.class.getName()); private ActivityDispatcher activityDispatcher; private EmailDispatcher emailDispatcher; private BazaarService bazaarService; private ObjectMapper mapper; + @Override public void setBazaarService(BazaarService service) { - this.bazaarService = service; + bazaarService = service; } + @Override public void setActivityDispatcher(ActivityDispatcher activityDispatcher) { this.activityDispatcher = activityDispatcher; } + @Override public void setEmailDispatcher(EmailDispatcher emailDispatcher) { this.emailDispatcher = emailDispatcher; } @Override - public void dispatchNotification(final LocalDateTime creationDate, final Activity.ActivityAction activityAction, final MonitoringEvent mobSOSEvent, - final int dataId, final Activity.DataType dataType, final int userId) { + public void dispatchNotification(OffsetDateTime creationDate, Activity.ActivityAction activityAction, MonitoringEvent mobSOSEvent, + int dataId, Activity.DataType dataType, int userId) { // Filters to generate JSON elements FilterProvider filters = diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CategoryResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CategoryResource.java index 7e242b1e..0112fe96 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CategoryResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CategoryResource.java @@ -26,7 +26,7 @@ import javax.xml.bind.DatatypeConverter; import java.net.HttpURLConnection; import java.text.MessageFormat; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.*; @@ -52,9 +52,8 @@ @Path("/categories") public class CategoryResource { - private BazaarService bazaarService; - private final L2pLogger logger = L2pLogger.getInstance(CategoryResource.class.getName()); + private final BazaarService bazaarService; public CategoryResource() throws Exception { bazaarService = (BazaarService) Context.getCurrent().getService(); @@ -88,7 +87,9 @@ public Response getCategoriesForProject(int projectId, int page, int perPage, St PageInfo pageInfo = new PageInfo(page, perPage, new HashMap<>(), sortList, search); // Take Object for generic error handling Set> violations = bazaarService.validate(pageInfo); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); @@ -107,7 +108,7 @@ public Response getCategoriesForProject(int projectId, int page, int perPage, St } } PaginationResult categoriesResult = dalFacade.listCategoriesByProjectId(projectId, pageInfo, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_13, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_13, projectId, Activity.DataType.PROJECT, internalUserId); Map> parameter = new HashMap<>(); parameter.put("page", new ArrayList() {{ @@ -177,7 +178,7 @@ public Response getCategory(@PathParam("categoryId") int categoryId) { dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Category categoryToReturn = dalFacade.getCategoryById(categoryId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_15, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_15, categoryId, Activity.DataType.CATEGORY, internalUserId); if (dalFacade.isCategoryPublic(categoryId)) { boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_CATEGORY, categoryToReturn.getProjectId(), dalFacade); @@ -240,7 +241,9 @@ public Response createCategory(@ApiParam(value = "Category entity", required = t } // Take Object for generic error handling Set> violations = bazaarService.validateCreate(categoryToCreate); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); @@ -300,7 +303,9 @@ public Response updateCategory(@ApiParam(value = "Category entity", required = t String userId = agent.getIdentifier(); // Take Object for generic error handling Set> violations = bazaarService.validate(categoryToUpdate); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); @@ -434,7 +439,7 @@ public Response followCategory(@PathParam("categoryId") int categoryId) { } dalFacade.followCategory(internalUserId, categoryId); Category category = dalFacade.getCategoryById(categoryId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.FOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_19, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.FOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_19, category.getId(), Activity.DataType.CATEGORY, internalUserId); return Response.status(Response.Status.CREATED).entity(category.toJSON()).build(); } catch (BazaarException bex) { @@ -490,7 +495,7 @@ public Response unfollowCategory(@PathParam("categoryId") int categoryId) { } dalFacade.unFollowCategory(internalUserId, categoryId); Category category = dalFacade.getCategoryById(categoryId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UNFOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_20, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.UNFOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_20, category.getId(), Activity.DataType.CATEGORY, internalUserId); return Response.ok(category.toJSON()).build(); } catch (BazaarException bex) { @@ -546,7 +551,7 @@ public Response getStatisticsForCategory( Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Category category = dalFacade.getCategoryById(categoryId, internalUserId); Statistic categoryStatistics = dalFacade.getStatisticsForCategory(internalUserId, categoryId, sinceCal); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_21, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_21, categoryId, Activity.DataType.CATEGORY, internalUserId); return Response.ok(categoryStatistics.toJSON()).build(); } catch (BazaarException bex) { @@ -598,7 +603,7 @@ public Response getContributorsForCategory(@PathParam("categoryId") int category Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Category category = dalFacade.getCategoryById(categoryId, internalUserId); CategoryContributors categoryContributors = dalFacade.listContributorsForCategory(categoryId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_22, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_22, categoryId, Activity.DataType.CATEGORY, internalUserId); return Response.ok(categoryContributors.toJSON()).build(); } catch (BazaarException bex) { @@ -653,13 +658,15 @@ public Response getFollowersForCategory(@PathParam("categoryId") int categoryId, PageInfo pageInfo = new PageInfo(page, perPage); // Take Object for generic error handling Set> violations = bazaarService.validate(pageInfo); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Category category = dalFacade.getCategoryById(categoryId, internalUserId); PaginationResult categoryFollowers = dalFacade.listFollowersForCategory(categoryId, pageInfo); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_23, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_23, categoryId, Activity.DataType.CATEGORY, internalUserId); Map> parameter = new HashMap<>(); parameter.put("page", new ArrayList() {{ diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java index c85bdc5f..07aa8298 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/CommentsResource.java @@ -25,7 +25,7 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.net.HttpURLConnection; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.*; @@ -125,7 +125,7 @@ public Response getAllComments( } //TODO Results in "No CommentRecord found with id: 0" - //bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, + //bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, // 0, Activity.DataType.COMMENT, internalUserId); Map> parameter = new HashMap<>(); @@ -204,7 +204,7 @@ public Response getCommentsForRequirement(int requirementId) { } } List commentsResult = dalFacade.listCommentsByRequirementId(requirementId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_43, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_43, requirementId, Activity.DataType.REQUIREMENT, internalUserId); Response.ResponseBuilder responseBuilder = Response.ok(); @@ -260,7 +260,7 @@ public Response getComment(@PathParam("commentId") int commentId) { Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Comment comment = dalFacade.getCommentById(commentId); Requirement requirement = dalFacade.getRequirementById(comment.getRequirementId(), internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_45, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_45, commentId, Activity.DataType.COMMENT, internalUserId); if (dalFacade.isProjectPublic(requirement.getProjectId())) { boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_COMMENT, requirement.getProjectId(), dalFacade); diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/FeedbackResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/FeedbackResource.java index b821d1e7..dabe9bd0 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/FeedbackResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/FeedbackResource.java @@ -29,7 +29,7 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.net.HttpURLConnection; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.*; @Api(value = "feedback") @@ -54,9 +54,8 @@ @Path("/feedback") public class FeedbackResource { - private BazaarService bazaarService; - private final L2pLogger logger = L2pLogger.getInstance(CommentsResource.class.getName()); + private final BazaarService bazaarService; public FeedbackResource() throws Exception { bazaarService = (BazaarService) Context.getCurrent().getService(); @@ -65,9 +64,9 @@ public FeedbackResource() throws Exception { /** * This method returns the list of feedback for a given project. * - * @param projectId id of the project - * @param page page number - * @param perPage number of projects by page + * @param projectId id of the project + * @param page page number + * @param perPage number of projects by page * @return Response with comments as a JSON array. */ public Response getFeedbackForProject(int projectId, int page, int perPage) { @@ -82,7 +81,9 @@ public Response getFeedbackForProject(int projectId, int page, int perPage) { PageInfo pageInfo = new PageInfo(page, perPage); // Take Object for generic error handling Set> violations = bazaarService.validate(pageInfo); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } dalFacade = bazaarService.getDBConnection(); //Todo use requirement's projectId for security context, not the one sent from client @@ -91,12 +92,12 @@ public Response getFeedbackForProject(int projectId, int page, int perPage) { Project project = dalFacade.getProjectById(projectId, internalUserId); boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_FEEDBACK, project.getId(), dalFacade); - if (!authorized) { - ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.feedback.read")); - } + if (!authorized) { + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.feedback.read")); + } PaginationResult feedbackResult = dalFacade.getFeedbackByProject(projectId, pageInfo); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_43, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_43, projectId, Activity.DataType.FEEDBACK, internalUserId); Map> parameter = new HashMap<>(); parameter.put("page", new ArrayList() {{ @@ -155,7 +156,9 @@ public Response sendFeedback(@ApiParam(value = "Feedback entity", required = tru dalFacade = bazaarService.getDBConnection(); Set> violations = bazaarService.validateCreate(givenFeedback); - if (violations.size() > 0) ExceptionHandler.getInstance().handleViolations(violations); + if (violations.size() > 0) { + ExceptionHandler.getInstance().handleViolations(violations); + } Feedback createdFeedback = dalFacade.createFeedback(givenFeedback); return Response.status(Response.Status.CREATED).entity(createdFeedback.toJSON()).build(); diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java index 21cfa28c..3755fdb6 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java @@ -27,7 +27,7 @@ import javax.ws.rs.core.Response; import javax.xml.bind.DatatypeConverter; import java.net.HttpURLConnection; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.*; import java.util.concurrent.atomic.AtomicReference; @@ -124,7 +124,7 @@ public Response getProjects( // return public projects and the ones the user belongs to projectsResult = dalFacade.listPublicAndAuthorizedProjects(pageInfo, internalUserId); } - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, 0, Activity.DataType.PROJECT, internalUserId); Map> parameter = new HashMap<>(); @@ -207,7 +207,7 @@ public Response getProject(@PathParam("projectId") int projectId) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.project.read")); } } - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_4, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_4, projectId, Activity.DataType.PROJECT, internalUserId); return Response.ok(projectToReturn.toJSON()).build(); } catch (BazaarException bex) { @@ -270,7 +270,7 @@ public Response createProject(@ApiParam(value = "Project entity", required = tru } projectToCreate.setLeader(dalFacade.getUserById(internalUserId)); Project createdProject = dalFacade.createProject(projectToCreate, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.CREATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_5, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.CREATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_5, createdProject.getId(), Activity.DataType.PROJECT, internalUserId); return Response.status(Response.Status.CREATED).entity(createdProject.toJSON()).build(); } catch (BazaarException bex) { @@ -332,7 +332,7 @@ public Response updateProject(@ApiParam(value = "Project entity", required = tru } Project updatedProject = dalFacade.modifyProject(projectToUpdate); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_6, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_6, updatedProject.getId(), Activity.DataType.PROJECT, internalUserId); return Response.ok(updatedProject.toJSON()).build(); } catch (BazaarException bex) { @@ -389,7 +389,7 @@ public Response deleteProject(@PathParam("projectId") int projectId) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.project.delete")); } dalFacade.deleteProjectById(projectId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.DELETE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_28, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.DELETE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_28, projectId, Activity.DataType.PROJECT, internalUserId); return Response.noContent().build(); } catch (BazaarException bex) { @@ -445,7 +445,7 @@ public Response followProject(@PathParam("projectId") int projectId) { } dalFacade.followProject(internalUserId, projectId); Project project = dalFacade.getProjectById(projectId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.FOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_8, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.FOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_8, projectId, Activity.DataType.PROJECT, internalUserId); return Response.status(Response.Status.CREATED).entity(project.toJSON()).build(); } catch (BazaarException bex) { @@ -501,7 +501,7 @@ public Response unfollowProject(@PathParam("projectId") int projectId) { } dalFacade.unFollowProject(internalUserId, projectId); Project project = dalFacade.getProjectById(projectId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UNFOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_9, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.UNFOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_9, projectId, Activity.DataType.PROJECT, internalUserId); return Response.ok(project.toJSON()).build(); } catch (BazaarException bex) { @@ -556,7 +556,7 @@ public Response getStatisticsForProject( Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Calendar sinceCal = since == null ? null : DatatypeConverter.parseDateTime(since); Statistic projectStatistics = dalFacade.getStatisticsForProject(internalUserId, projectId, sinceCal); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_10, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_10, projectId, Activity.DataType.PROJECT, internalUserId); return Response.ok(projectStatistics.toJSON()).build(); } catch (BazaarException bex) { @@ -607,7 +607,7 @@ public Response getContributorsForProject(@PathParam("projectId") int projectId) dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); ProjectContributors projectContributors = dalFacade.listContributorsForProject(projectId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_11, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_11, projectId, Activity.DataType.PROJECT, internalUserId); return Response.ok(projectContributors.toJSON()).build(); } catch (BazaarException bex) { @@ -670,7 +670,7 @@ public Response getFollowersForProject(@PathParam("projectId") int projectId, dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); PaginationResult projectFollowers = dalFacade.listFollowersForProject(projectId, pageInfo); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_12, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_12, projectId, Activity.DataType.PROJECT, internalUserId); Map> parameter = new HashMap<>(); @@ -849,7 +849,7 @@ public Response getTagsForProject( } List tags = dalFacade.getTagsByProjectId(projectId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_12, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_12, projectId, Activity.DataType.PROJECT, internalUserId); Response.ResponseBuilder responseBuilder = Response.ok() @@ -917,7 +917,7 @@ public Response createTag(@PathParam("projectId") int projectId, tag.setProjectId(projectId); Tag createdTag = dalFacade.createTag(tag); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.CREATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_8, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.CREATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_8, projectId, Activity.DataType.TAG, internalUserId); return Response.status(Response.Status.CREATED).entity(createdTag.toJSON()).build(); } catch (BazaarException bex) { @@ -996,7 +996,7 @@ public Response updateMembership(@PathParam("projectId") int projectId, User member = dalFacade.getUserById(projectMember.getUserId()); dalFacade.addUserToRole(member.getId(), projectMember.getRole().name(), projectId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_6, projectId, Activity.DataType.PROJECT, internalUserId); + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_6, projectId, Activity.DataType.PROJECT, internalUserId); } return Response.noContent().build(); } catch (BazaarException bex) { @@ -1071,7 +1071,7 @@ public Response getMembers(@PathParam("projectId") int projectId, } PaginationResult members = dalFacade.getProjectMembers(projectId, pageInfo); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_12, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_12, projectId, Activity.DataType.PROJECT, internalUserId); Response.ResponseBuilder responseBuilder = Response.ok(); @@ -1138,7 +1138,7 @@ public Response removeMember(@PathParam("projectId") int projectId, @PathParam(" dalFacade.removeUserFromProject(memberId, projectId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_6, projectId, Activity.DataType.PROJECT, internalUserId); + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_6, projectId, Activity.DataType.PROJECT, internalUserId); return Response.noContent().build(); } catch (BazaarException bex) { diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java index 37e29c17..421d9539 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java @@ -28,7 +28,7 @@ import javax.xml.bind.DatatypeConverter; import java.net.HttpURLConnection; import java.net.URI; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.*; @Api(value = "requirements", description = "Requirements resource") @@ -125,7 +125,7 @@ public Response getRequirements( requirementsResult = dalFacade.listAllRequirements(pageInfo, internalUserId); } //TODO NotificationDispatcher tries to find Requirement with id 0 as additional Object, need to implement logic for multiple - //bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, + //bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, // 0, Activity.DataType.REQUIREMENT, internalUserId); Map> parameter = new HashMap<>(); @@ -222,7 +222,7 @@ public Response getRequirementsForProject(int projectId, int page, int perPage, } } PaginationResult requirementsResult = dalFacade.listRequirementsByProject(projectId, pageInfo, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_14, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_14, projectId, Activity.DataType.PROJECT, internalUserId); Map> parameter = new HashMap<>(); @@ -324,7 +324,7 @@ public Response getRequirementsForCategory(int categoryId, int page, int perPage } } PaginationResult requirementsResult = dalFacade.listRequirementsByCategory(categoryId, pageInfo, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_24, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_24, categoryId, Activity.DataType.CATEGORY, internalUserId); Map> parameter = new HashMap<>(); @@ -399,7 +399,7 @@ public Response getRequirement(@PathParam("requirementId") int requirementId) { dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_25, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_25, requirementId, Activity.DataType.REQUIREMENT, internalUserId); if (dalFacade.isRequirementPublic(requirementId)) { boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_REQUIREMENT, requirement.getProjectId(), dalFacade); @@ -512,7 +512,7 @@ public Response createRequirement(@ApiParam(value = "Requirement entity", requir } } createdRequirement = dalFacade.getRequirementById(createdRequirement.getId(), internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.CREATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_26, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.CREATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_26, createdRequirement.getId(), Activity.DataType.REQUIREMENT, internalUserId); return Response.status(Response.Status.CREATED).entity(createdRequirement.toJSON()).build(); } catch (BazaarException bex) { @@ -577,7 +577,7 @@ public Response updateRequirement(@ApiParam(value = "Requirement entity", requir dalFacade.followRequirement(internalUserId, requirementToUpdate.getId()); Requirement updatedRequirement = dalFacade.modifyRequirement(requirementToUpdate, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_27, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_27, updatedRequirement.getId(), Activity.DataType.REQUIREMENT, internalUserId); return Response.ok(updatedRequirement.toJSON()).build(); } catch (BazaarException bex) { @@ -634,7 +634,7 @@ public Response deleteRequirement(@PathParam("requirementId") int requirementId) ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.requirement.delete")); } Requirement deletedRequirement = dalFacade.deleteRequirementById(requirementId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.DELETE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_28, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.DELETE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_28, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.ok(deletedRequirement.toJSON()).build(); } catch (BazaarException bex) { @@ -689,7 +689,7 @@ public Response leaddevelopRequirement(@PathParam("requirementId") int requireme ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.vote.create")); } Requirement requirement = dalFacade.setUserAsLeadDeveloper(requirementId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.LEADDEVELOP, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_29, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.LEADDEVELOP, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_29, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.status(Response.Status.CREATED).entity(requirement.toJSON()).build(); } catch (BazaarException bex) { @@ -748,7 +748,7 @@ public Response unleaddevelopRequirement(@PathParam("requirementId") int require ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, "You are not lead developer."); } requirement = dalFacade.deleteUserAsLeadDeveloper(requirementId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UNLEADDEVELOP, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_30, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.UNLEADDEVELOP, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_30, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.ok(requirement.toJSON()).build(); } catch (BazaarException bex) { @@ -805,7 +805,7 @@ public Response developRequirement(@PathParam("requirementId") int requirementId dalFacade.wantToDevelop(internalUserId, requirementId); dalFacade.followRequirement(internalUserId, requirementId); Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.DEVELOP, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_31, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.DEVELOP, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_31, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.status(Response.Status.CREATED).entity(requirement.toJSON()).build(); } catch (BazaarException bex) { @@ -861,7 +861,7 @@ public Response undevelopRequirement(@PathParam("requirementId") int requirement } dalFacade.notWantToDevelop(internalUserId, requirementId); Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UNDEVELOP, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_32, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.UNDEVELOP, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_32, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.ok(requirement.toJSON()).build(); } catch (BazaarException bex) { @@ -917,7 +917,7 @@ public Response followRequirement(@PathParam("requirementId") int requirementId) } dalFacade.followRequirement(internalUserId, requirementId); Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.FOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_33, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.FOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_33, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.status(Response.Status.CREATED).entity(requirement.toJSON()).build(); } catch (BazaarException bex) { @@ -973,7 +973,7 @@ public Response unfollowRequirement(@PathParam("requirementId") int requirementI } dalFacade.unFollowRequirement(internalUserId, requirementId); Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UNFOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_34, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.UNFOLLOW, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_34, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.ok(requirement.toJSON()).build(); } catch (BazaarException bex) { @@ -1034,7 +1034,7 @@ public Response vote(@PathParam("requirementId") int requirementId, if (direction.isUpVote()) { dalFacade.followRequirement(internalUserId, requirementId); } - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.VOTE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_35, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.VOTE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_35, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.status(Response.Status.SEE_OTHER).location(URI.create(bazaarService.getBaseURL() + "requirements/" + requirementId)).build(); } catch (BazaarException bex) { @@ -1090,7 +1090,7 @@ public Response unvote(@PathParam("requirementId") int requirementId) { } dalFacade.unVote(internalUserId, requirementId); Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UNVOTE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_36, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.UNVOTE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_36, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.status(Response.Status.SEE_OTHER).location(URI.create(bazaarService.getBaseURL() + "requirements/" + requirementId)).entity(requirement.toJSON()).build(); } catch (BazaarException bex) { @@ -1146,7 +1146,7 @@ public Response realize(@PathParam("requirementId") int requirementId) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.vote.create")); } requirement = dalFacade.setRequirementToRealized(requirementId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.REALIZE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_37, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.REALIZE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_37, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.status(Response.Status.CREATED).entity(requirement.toJSON()).build(); } catch (BazaarException bex) { @@ -1201,7 +1201,7 @@ public Response unrealize(@PathParam("requirementId") int requirementId) { ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.vote.delete")); } Requirement requirement = dalFacade.setRequirementToUnRealized(requirementId, internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UNREALIZE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_38, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.UNREALIZE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_38, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.ok(requirement.toJSON()).build(); } catch (BazaarException bex) { @@ -1256,7 +1256,7 @@ public Response getStatisticsForRequirement( Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Calendar sinceCal = since == null ? null : DatatypeConverter.parseDateTime(since); Statistic requirementStatistics = dalFacade.getStatisticsForRequirement(internalUserId, requirementId, sinceCal); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_39, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_39, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.ok(requirementStatistics.toJSON()).build(); } catch (BazaarException bex) { @@ -1318,7 +1318,7 @@ public Response getDevelopersForRequirement(@PathParam("requirementId") int requ dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); PaginationResult requirementDevelopers = dalFacade.listDevelopersForRequirement(requirementId, pageInfo); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_40, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_40, requirementId, Activity.DataType.REQUIREMENT, internalUserId); Map> parameter = new HashMap<>(); @@ -1383,7 +1383,7 @@ public Response getContributorsForRequirement(@PathParam("requirementId") int re dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); RequirementContributors requirementContributors = dalFacade.listContributorsForRequirement(requirementId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_41, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_41, requirementId, Activity.DataType.REQUIREMENT, internalUserId); return Response.ok(requirementContributors.toJSON()).build(); } catch (BazaarException bex) { @@ -1445,7 +1445,7 @@ public Response getFollowersForRequirement(@PathParam("requirementId") int requi dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); PaginationResult requirementFollowers = dalFacade.listFollowersForRequirement(requirementId, pageInfo); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_42, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_42, requirementId, Activity.DataType.REQUIREMENT, internalUserId); Map> parameter = new HashMap<>(); @@ -1543,7 +1543,7 @@ public Response getAttachmentsForRequirement(@PathParam("requirementId") int req Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); Project project = dalFacade.getProjectById(requirement.getProjectId(), internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_44, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE_CHILD, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_44, requirement.getId(), Activity.DataType.REQUIREMENT, internalUserId); if (dalFacade.isRequirementPublic(requirementId)) { boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Read_PUBLIC_COMMENT, project.getId(), dalFacade); diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java index 0f116c87..8e52beb3 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/UsersResource.java @@ -24,7 +24,7 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.net.HttpURLConnection; -import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.*; @@ -100,7 +100,7 @@ public Response searchUser(@ApiParam(value = "Search filter", required = false) PaginationResult users = dalFacade.searchUsers(pageInfo); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_53, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_53, internalUserId, Activity.DataType.USER, internalUserId); Map> parameter = new HashMap<>(); @@ -168,7 +168,7 @@ public Response getUser(@PathParam("userId") int userId) { } dalFacade = bazaarService.getDBConnection(); User user = dalFacade.getUserById(userId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_53, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_53, userId, Activity.DataType.USER, userId); return Response.ok(user.toJSON()).build(); @@ -225,7 +225,7 @@ public Response getActiveUser() { dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); User user = dalFacade.getUserById(internalUserId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_54, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_54, internalUserId, Activity.DataType.USER, internalUserId); return Response.ok(user.toPrivateJSON()).build(); @@ -280,7 +280,7 @@ public Response getUserDashboard() { dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_54, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_54, internalUserId, Activity.DataType.USER, internalUserId); Dashboard data = dalFacade.getDashboardData(internalUserId, 10); @@ -345,7 +345,7 @@ public Response updateUser(@PathParam("userId") int userId, "UserId is not identical with user sending this request."); } User updatedUser = dalFacade.modifyUser(userToUpdate); - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_56, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.UPDATE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_56, userId, Activity.DataType.USER, internalUserId); return Response.ok(updatedUser.toJSON()).build(); } catch (BazaarException bex) { @@ -420,7 +420,7 @@ public Response getEntityOverview( EntityOverview result = dalFacade.getEntitiesForUser(include, pageInfo, internalUserId); // Wrong SERVICE_CUSTOM_MESSAGE_3 ? - bazaarService.getNotificationDispatcher().dispatchNotification(LocalDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, + bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.RETRIEVE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_3, 0, Activity.DataType.USER, internalUserId); diff --git a/reqbaz/src/main/resources/changelog.yaml b/reqbaz/src/main/resources/changelog.yaml index 55a8eb42..19dd9ccd 100644 --- a/reqbaz/src/main/resources/changelog.yaml +++ b/reqbaz/src/main/resources/changelog.yaml @@ -25,7 +25,7 @@ databaseChangeLog: nullable: false defaultValueComputed: now() name: creation_date - type: TIMESTAMP WITHOUT TIME ZONE + type: TIMESTAMP WITH TIME ZONE - column: name: email type: VARCHAR(255) @@ -68,10 +68,10 @@ databaseChangeLog: nullable: false defaultValueComputed: now() name: creation_date - type: TIMESTAMP WITHOUT TIME ZONE + type: TIMESTAMP WITH TIME ZONE - column: name: last_updated_date - type: TIMESTAMP WITHOUT TIME ZONE + type: TIMESTAMP WITH TIME ZONE - column: constraints: nullable: false @@ -136,10 +136,10 @@ databaseChangeLog: nullable: false defaultValueComputed: now() name: creation_date - type: TIMESTAMP WITHOUT TIME ZONE + type: TIMESTAMP WITH TIME ZONE - column: name: last_updated_date - type: TIMESTAMP WITHOUT TIME ZONE + type: TIMESTAMP WITH TIME ZONE - column: constraints: nullable: false @@ -172,11 +172,11 @@ databaseChangeLog: nullable: false defaultValueComputed: now() name: creation_date - type: TIMESTAMP WITHOUT TIME ZONE + type: TIMESTAMP WITH TIME ZONE - column: defaultValueComputed: now() name: last_updated_date - type: TIMESTAMP WITHOUT TIME ZONE + type: TIMESTAMP WITH TIME ZONE - column: constraints: nullable: false @@ -224,7 +224,7 @@ databaseChangeLog: nullable: false defaultValueComputed: now() name: creation_date - type: TIMESTAMP WITHOUT TIME ZONE + type: TIMESTAMP WITH TIME ZONE tableName: category_follower_map - changeSet: id: 1624138981933-7 @@ -278,7 +278,7 @@ databaseChangeLog: nullable: false defaultValueComputed: now() name: creation_date - type: TIMESTAMP WITHOUT TIME ZONE + type: TIMESTAMP WITH TIME ZONE tableName: requirement_developer_map - changeSet: id: 1624138981933-9 @@ -340,7 +340,7 @@ databaseChangeLog: nullable: false defaultValueComputed: now() name: creation_date - type: TIMESTAMP WITHOUT TIME ZONE + type: TIMESTAMP WITH TIME ZONE tableName: vote - changeSet: id: 1624138981933-11 @@ -360,10 +360,10 @@ databaseChangeLog: nullable: false defaultValueComputed: now() name: creation_date - type: TIMESTAMP WITHOUT TIME ZONE + type: TIMESTAMP WITH TIME ZONE - column: name: last_updated_date - type: TIMESTAMP WITHOUT TIME ZONE + type: TIMESTAMP WITH TIME ZONE - column: constraints: nullable: false @@ -448,13 +448,13 @@ databaseChangeLog: nullable: false defaultValueComputed: now() name: creation_date - type: TIMESTAMP WITHOUT TIME ZONE + type: TIMESTAMP WITH TIME ZONE - column: name: last_updated_date - type: TIMESTAMP WITHOUT TIME ZONE + type: TIMESTAMP WITH TIME ZONE - column: name: last_login_date - type: TIMESTAMP WITHOUT TIME ZONE + type: TIMESTAMP WITH TIME ZONE - column: defaultValueBoolean: true name: personalization_enabled @@ -526,10 +526,10 @@ databaseChangeLog: nullable: false defaultValueComputed: now() name: creation_date - type: TIMESTAMP WITHOUT TIME ZONE + type: TIMESTAMP WITH TIME ZONE - column: name: last_updated_date - type: TIMESTAMP WITHOUT TIME ZONE + type: TIMESTAMP WITH TIME ZONE - column: constraints: nullable: false @@ -578,7 +578,7 @@ databaseChangeLog: nullable: false defaultValueComputed: now() name: creation_date - type: TIMESTAMP WITHOUT TIME ZONE + type: TIMESTAMP WITH TIME ZONE tableName: requirement_follower_map - changeSet: id: 1624138981933-18 @@ -620,7 +620,7 @@ databaseChangeLog: nullable: false defaultValueComputed: now() name: creation_date - type: TIMESTAMP WITHOUT TIME ZONE + type: TIMESTAMP WITH TIME ZONE - column: constraints: nullable: false @@ -655,16 +655,16 @@ databaseChangeLog: type: TEXT - column: name: realized - type: TIMESTAMP WITHOUT TIME ZONE + type: TIMESTAMP WITH TIME ZONE - column: constraints: nullable: false defaultValueComputed: now() name: creation_date - type: TIMESTAMP WITHOUT TIME ZONE + type: TIMESTAMP WITH TIME ZONE - column: name: last_updated_date - type: TIMESTAMP WITHOUT TIME ZONE + type: TIMESTAMP WITH TIME ZONE - column: name: lead_developer_id type: INTEGER @@ -710,7 +710,7 @@ databaseChangeLog: nullable: false defaultValueComputed: now() name: creation_date - type: TIMESTAMP WITHOUT TIME ZONE + type: TIMESTAMP WITH TIME ZONE tableName: project_follower_map - changeSet: id: 1624138981933-22 diff --git a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java index d7ea22ea..1ed1f4b1 100644 --- a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java +++ b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/TestBase.java @@ -21,11 +21,10 @@ */ public abstract class TestBase extends SetupData { - private static final String testPass = "adamspass"; - private static final String adminPass = "evespass"; - static final String mainPath = "bazaar/"; static final String testVersion = "1.0.0"; + private static final String testPass = "adamspass"; + private static final String adminPass = "evespass"; private static LocalNode node; private static WebConnector connector; private static ByteArrayOutputStream logStream; @@ -108,7 +107,7 @@ MiniClient getAdminClient() { } boolean isValidISO8601(String dateStr) { - DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss"); + DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); try { dateFormatter.parse(dateStr); } catch (DateTimeParseException e) { From 5790d2645133232acadd331d552a428823cdf194 Mon Sep 17 00:00:00 2001 From: Thore Date: Sun, 8 Aug 2021 02:39:36 +0200 Subject: [PATCH 128/134] Update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4ff6913..6099971a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas - Updated all dependencies, most notably las2peer 1.0.0 [#68](https://github.com/rwth-acis/RequirementsBazaar/pull/68) - Updated las2peer to 1.1.0 and thereby requiring Java 14 [#73](https://github.com/rwth-acis/RequirementsBazaar/pull/73) +- Updated las2peer to 1.1.2 [#115](https://github.com/rwth-acis/RequirementsBazaar/pull/115) - Changed buildsystem to use gradle [#73](https://github.com/rwth-acis/RequirementsBazaar/pull/73) - Automatically generate jooq code from migration files at build time [#73](https://github.com/rwth-acis/RequirementsBazaar/pull/73) @@ -71,10 +72,15 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas redacted [#103](https://github.com/rwth-acis/RequirementsBazaar/pull/103). - Comments for a requirement are no longer paginated but instead return all comments [#103](https://github.com/rwth-acis/RequirementsBazaar/pull/103). +- Postgres is now the backend database [#112](https://github.com/rwth-acis/RequirementsBazaar/pull/112) +- Attachments are now updated via PUT towards the requirement + endpoint [#114](https://github.com/rwth-acis/RequirementsBazaar/pull/114). +- All timestamps now contain timezone information [#115](https://github.com/rwth-acis/RequirementsBazaar/pull/115) ### Removed - Personalisation endpoints [#94](https://github.com/rwth-acis/RequirementsBazaar/pull/94) +- Attachment endpoint [#114](https://github.com/rwth-acis/RequirementsBazaar/pull/114) ## [0.7.2] - 2017-10-25 From 3a88069157bd194c10f63198ee6e7af6ca961a09 Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 21 Aug 2021 18:27:25 +0200 Subject: [PATCH 129/134] Add documentation for attachments --- docs/AttachmentUpload.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 docs/AttachmentUpload.md diff --git a/docs/AttachmentUpload.md b/docs/AttachmentUpload.md new file mode 100644 index 00000000..f750e873 --- /dev/null +++ b/docs/AttachmentUpload.md @@ -0,0 +1,26 @@ +# File Upload + +## Implications + +Uploads and references in the database are separate operations. This may lead to incomplete and unreferenced uploads. +This is a tradeoff made in favour of having multipart API endpoints. + +A way to resolve this is to regularly synchronize the file index with the references in database. + +## Workflows + +### Upload with requirement creation + +1. Upload the file to the file service and receive or generate an identifier. +2. Include reference to the uploaded file as a regular attachment object in the attachment array. Then send this to the + create requirement endpoint. + +### Add attachments to an existing requirement + +1. Upload the file to the file service and receive or generate an identifier. +2. Add reference to the uploaded file as a regular attachment object to the attachment array and use the requirements + update endpoint. + +### Remove attachments from an existing requirement + +1. Remove the reference in the attachments array and use the update requirement endpoint. From eb4cf2ee4655f93ed6932c59d458918394490f13 Mon Sep 17 00:00:00 2001 From: Thore Date: Sat, 21 Aug 2021 18:26:53 +0200 Subject: [PATCH 130/134] Allow project search to recurse through linked entities --- .../acis/bazaar/service/dal/helpers/PageInfo.java | 13 ++++++++++++- .../acis/bazaar/service/dal/helpers/Pageable.java | 10 ++++++---- .../dal/repositories/ProjectRepositoryImpl.java | 10 +++++++++- .../dal/transform/RequirementTransformer.java | 8 ++++++-- .../bazaar/service/resources/ProjectsResource.java | 10 +++++++--- .../rwth/dbis/acis/bazaar/service/BazaarTest.java | 2 +- 6 files changed, 41 insertions(+), 12 deletions(-) diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java index 5b90855d..518339a3 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/PageInfo.java @@ -41,6 +41,8 @@ public class PageInfo implements Pageable { private final String search; private final List ids; private final List embed; + private final Map options; + public PageInfo(int pageNumber, int pageSize) { this(pageNumber, pageSize, new HashMap<>(), new ArrayList<>(), null, null); @@ -63,8 +65,11 @@ public PageInfo(int pageNumber, int pageSize, Map filters, List< this(pageNumber, pageSize, filters, sorts, search, ids, null); } - public PageInfo(int pageNumber, int pageSize, Map filters, List sorts, String search, List ids, List embed) { + this(pageNumber, pageSize, filters, sorts, search, ids, embed, new HashMap<>()); + } + + public PageInfo(int pageNumber, int pageSize, Map filters, List sorts, String search, List ids, List embed, Map options) { this.pageNumber = pageNumber; this.pageSize = pageSize; this.filters = filters; @@ -72,6 +77,7 @@ public PageInfo(int pageNumber, int pageSize, Map filters, List< this.search = search != null ? search : ""; this.ids = ids != null ? ids : new ArrayList<>(); this.embed = embed; + this.options = options; } @Override @@ -109,6 +115,11 @@ public List getEmbed() { return embed; } + @Override + public Map getOptions() { + return options; + } + @Override public String getSearch() { return search; diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java index 858cc5d9..b2ea68d9 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/helpers/Pageable.java @@ -44,6 +44,12 @@ public interface Pageable { List getEmbed(); + Map getOptions(); + + enum SortDirection { + DEFAULT, ASC, DESC + } + class SortField { String field; SortDirection sortDirection; @@ -69,8 +75,4 @@ public SortDirection getSortDirection() { return sortDirection; } } - - enum SortDirection { - DEFAULT, ASC, DESC - } } diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java index 0646496e..721cad8b 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/repositories/ProjectRepositoryImpl.java @@ -140,6 +140,15 @@ private ImmutablePair, Integer> getFilteredProjects(Condition sear .where(LAST_ACTIVITY.field(PROJECT.ID).equal(PROJECT.ID)) .asField("lastActivity"); + List matchingRequirementProjects = null; + if (pageable.getOptions().getOrDefault("recursive", false)) { + matchingRequirementProjects = jooq.selectDistinct().from(REQUIREMENT) + .where(DSL.condition("to_tsvector({0} || {1}) @@ websearch_to_tsquery({2})", + REQUIREMENT.NAME, REQUIREMENT.DESCRIPTION, pageable.getSearch())) + .fetch().getValues(REQUIREMENT.PROJECT_ID); + searchCondition = searchCondition.or(PROJECT.ID.in(matchingRequirementProjects)); + } + Result queryResults = jooq.select(PROJECT.fields()) .select(idCount) .select(CATEGORY_COUNT) @@ -203,7 +212,6 @@ public Project findById(int id, int userId) throws BazaarException { project = filteredProjects.left.get(0); - } catch (BazaarException be) { ExceptionHandler.getInstance().convertAndThrowException(be); } catch (Exception e) { diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java index 3bcc81ed..9b62c83d 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/dal/transform/RequirementTransformer.java @@ -178,8 +178,12 @@ public Collection> getSortFields(List @Override public Condition getSearchCondition(String search) throws Exception { - return REQUIREMENT.NAME.likeIgnoreCase("%" + search + "%") - .or(REQUIREMENT.DESCRIPTION.likeIgnoreCase("%" + search + "%")); + // Catch issues with empty tsvector matching causing nothing to be found + if (search.equals("")) { + return REQUIREMENT.NAME.likeIgnoreCase("%"); + } + return DSL.condition("to_tsvector({0} || {1}) @@ websearch_to_tsquery({2})", + REQUIREMENT.NAME, REQUIREMENT.DESCRIPTION, search); } @Override diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java index 3755fdb6..feffa2bf 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/ProjectsResource.java @@ -85,8 +85,8 @@ public Response getProjects( @ApiParam(value = "Sort", required = false, allowMultiple = true, allowableValues = "name,date,last_activity,requirement,follower") @DefaultValue("name") @QueryParam("sort") List sort, @ApiParam(value = "SortDirection", allowableValues = "ASC,DESC") @QueryParam("sortDirection") String sortDirection, @ApiParam(value = "Filter", required = false, allowMultiple = true, allowableValues = "all, created, following") @QueryParam("filters") List filters, - @ApiParam(value = "Ids", required = false, allowMultiple = true) @QueryParam("ids") List ids) { - + @ApiParam(value = "Ids", required = false, allowMultiple = true) @QueryParam("ids") List ids, + @ApiParam(value = "Also search in projects requirements", required = false) @DefaultValue("false") @QueryParam("recursive") boolean recursive) { DALFacade dalFacade = null; try { String registrarErrors = bazaarService.notifyRegistrars(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING)); @@ -108,7 +108,11 @@ public Response getProjects( for (String filterOption : filters) { filterMap.put(filterOption, internalUserId.toString()); } - PageInfo pageInfo = new PageInfo(page, perPage, filterMap, sortList, search, ids); + + HashMap options = new HashMap<>(); + options.put("recursive", recursive); + + PageInfo pageInfo = new PageInfo(page, perPage, filterMap, sortList, search, ids, null, options); // Take Object for generic error handling Set> violations = bazaarService.validate(pageInfo); diff --git a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java index e05df3bc..f13c7c46 100644 --- a/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java +++ b/reqbaz/src/test/java/de/rwth/dbis/acis/bazaar/service/BazaarTest.java @@ -115,7 +115,7 @@ public void testGetProjects() { MiniClient client = getClient(); MiniClient adminClient = getAdminClient(); - ClientResponse result = client.sendRequest("GET", mainPath + "projects", ""); + ClientResponse result = client.sendRequest("GET", mainPath + "projects?recursive=true", ""); assertEquals(200, result.getHttpCode()); JsonElement response = JsonParser.parseString(result.getResponse()); From c985cf662508190227c249ef516afd88b6797f4b Mon Sep 17 00:00:00 2001 From: Thore Date: Wed, 8 Sep 2021 03:28:50 +0200 Subject: [PATCH 131/134] Prepare 0.9.0 release --- .github/workflows/release.yaml | 61 +++++++++++++++++++++++++++++++ .github/workflows/release_rc.yaml | 2 +- CHANGELOG.md | 3 ++ 3 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..4953d0fc --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,61 @@ +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +name: Create Release + +jobs: + build: + name: Create Pre-Release + runs-on: ubuntu-latest + services: + postgres: + image: postgres:13 + ports: + - 5432:5432 + env: + POSTGRES_USER: reqbaz + POSTGRES_PASSWORD: reqbaz + POSTGRES_DB: reqbaz + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Get Version + id: get_version + uses: battila7/get-version-action@v2 + - name: Set up JDK 14 + uses: actions/setup-java@v1 + with: + java-version: 14 + - name: Build release bundle with Gradle + run: ./gradlew packageDistribution -x test -Pservice.version=${{ steps.get_version.outputs.version-without-v }} + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: | + This is the ${{ steps.get_version.outputs.version }} release. For changes please check the [Changelog](https://github.com/rwth-acis/RequirementsBazaar/blob/develop/CHANGELOG.md). + draft: false + prerelease: false + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./reqbaz/build/dist/BazaarService.zip + asset_name: RequirementsBazaar-${{ steps.get_version.outputs.version }}.zip + asset_content_type: application/zip diff --git a/.github/workflows/release_rc.yaml b/.github/workflows/release_rc.yaml index 809aa6a6..4e7baaec 100644 --- a/.github/workflows/release_rc.yaml +++ b/.github/workflows/release_rc.yaml @@ -36,7 +36,7 @@ jobs: with: java-version: 14 - name: Build release bundle with Gradle - run: ./gradlew packageDistribution -x test #-Pservice.version=${{ steps.get_version.outputs.version-without-v }} + run: ./gradlew packageDistribution -x test -Pservice.version=${{ steps.get_version.outputs.version-without-v }} - name: Create Release id: create_release uses: actions/create-release@v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 6099971a..5433387b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas ## [Unreleased] +## [0.9.0] - 2021-09-08 + ### Added - Added new testcases [#73](https://github.com/rwth-acis/RequirementsBazaar/pull/73) @@ -33,6 +35,7 @@ the [GitHub Release Page](https://github.com/rwth-acis/RequirementsBazaar/releas entity [#108](https://github.com/rwth-acis/RequirementsBazaar/pull/108). - Projects, categories and requirements now have an `additionalProperties` object which allows storing and providing additional context as plain json [#109](https://github.com/rwth-acis/RequirementsBazaar/pull/109). +- The projects endpoint now has a recursive flag which includes projects with requirements matching the search term into the results [#116](https://github.com/rwth-acis/RequirementsBazaar/pull/116) ### Changed From 34301fa38129a3d7ecbdc36961eb7a81e37820fe Mon Sep 17 00:00:00 2001 From: Thore Date: Wed, 8 Sep 2021 04:07:12 +0200 Subject: [PATCH 132/134] Add fix for anonymous users --- reqbaz/src/main/resources/changelog.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/reqbaz/src/main/resources/changelog.yaml b/reqbaz/src/main/resources/changelog.yaml index 19dd9ccd..9c2e8bb2 100644 --- a/reqbaz/src/main/resources/changelog.yaml +++ b/reqbaz/src/main/resources/changelog.yaml @@ -1670,3 +1670,15 @@ databaseChangeLog: splitStatements: true path: base-permissions.sql stripComments: true + - changeSet: + id: fix-anonymous-las2peerid + author: thore + changes: + - update: + columns: + - column: + name: las2peer_id + value: anonymous + schemaName: public + tableName: user + where: las2peer_id='-1722613621014065292' From fbf55457f74d7d9d1764b9caecaf19884350bd55 Mon Sep 17 00:00:00 2001 From: Thore Date: Tue, 21 Sep 2021 16:06:06 +0200 Subject: [PATCH 133/134] Update Readme to reflect postgres changes --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 56db0f0b..f2fa7c00 100644 --- a/README.md +++ b/README.md @@ -32,14 +32,14 @@ API documentation endpoints: Requirements bazaar itself is a web application, which is separated to a client-only side and a back-end side. This GitHub repo holds the codebase of the back-end side only. If you are looking for the front-end, take a look at this GitHub project: **[Requirement Bazaar Web Frontend](https://github.com/rwth-acis/RequirementsBazaar-WebFrontend)** -The backend is built on Java technologies. As a service framework we use our in-house developed **[las2peer](https://github.com/rwth-acis/LAS2peer)** project. For persisting our data we use a MySQL database and jOOQ to access it and for serializing our data into JSON format, we use the Jackson library. +The backend is built on Java technologies. As a service framework we use our in-house developed **[las2peer](https://github.com/rwth-acis/LAS2peer)** project. For persisting our data we use a PostgreSQL database and jOOQ to access it and for serializing our data into JSON format, we use the Jackson library. ## Dependencies In order to be able to run this service project the following components should be installed on your system: - JDK 14 - - MySQL 5.7 (better 8) + - PostgreSQL 12 or newer - Gradle to build ## How to set up the database (non developer guide) @@ -47,7 +47,7 @@ In order to be able to run this service project the following components should 1. Download a release bundle from [GitHub](https://github.com/rwth-acis/RequirementsBazaar/releases) 2. Create a new database called `reqbaz`, possibly with UTF-8 collation 3. To configure your database access look at the [Configuration](#configuration) section - 4. Use flyway to migrate the database + 4. Use liquibase to migrate the database ## Configuration @@ -87,7 +87,7 @@ Set the credentials for this database in the gradle.properties and in the `reqba This configuration folder is relevant for any testing related settings. In the `etc` folder on top level you may configure a different database if you want to distinguish between local testing and automated testing. -However you'll have to apply the migrations with flyway manually to this database. +However you'll have to apply the migrations with liquibase manually to this database. ### Building From 69bae4832194bee1d871f1f6f5205425218fb9e2 Mon Sep 17 00:00:00 2001 From: Thore Date: Tue, 21 Sep 2021 16:17:36 +0200 Subject: [PATCH 134/134] Fix realize requirement permissions --- .../acis/bazaar/service/resources/RequirementsResource.java | 6 +++--- reqbaz/src/main/resources/i18n/Translation_en.properties | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java index 421d9539..8181f1c7 100644 --- a/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java +++ b/reqbaz/src/main/java/de/rwth/dbis/acis/bazaar/service/resources/RequirementsResource.java @@ -1143,7 +1143,7 @@ public Response realize(@PathParam("requirementId") int requirementId) { Requirement requirement = dalFacade.getRequirementById(requirementId, internalUserId); boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Realize_REQUIREMENT, requirement.getProjectId(), dalFacade); if (!authorized) { - ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.vote.create")); + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.requirement.realize")); } requirement = dalFacade.setRequirementToRealized(requirementId, internalUserId); bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.REALIZE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_37, @@ -1196,9 +1196,9 @@ public Response unrealize(@PathParam("requirementId") int requirementId) { } dalFacade = bazaarService.getDBConnection(); Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId); - boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_REQUIREMENT, dalFacade); + boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Realize_REQUIREMENT, dalFacade); if (!authorized) { - ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.vote.delete")); + ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString("error.authorization.requirement.realize")); } Requirement requirement = dalFacade.setRequirementToUnRealized(requirementId, internalUserId); bazaarService.getNotificationDispatcher().dispatchNotification(OffsetDateTime.now(), Activity.ActivityAction.UNREALIZE, MonitoringEvent.SERVICE_CUSTOM_MESSAGE_38, diff --git a/reqbaz/src/main/resources/i18n/Translation_en.properties b/reqbaz/src/main/resources/i18n/Translation_en.properties index 48147379..388c4bbd 100644 --- a/reqbaz/src/main/resources/i18n/Translation_en.properties +++ b/reqbaz/src/main/resources/i18n/Translation_en.properties @@ -30,6 +30,7 @@ error.authorization.category.delete=This category item with id {0} cannot be del error.authorization.requirements.read=Only logged in users can read requirements. error.authorization.requirement.create=Only project members can create requirements. error.authorization.requirement.delete=Only the creator can delete requirements. +error.authorization.requirement.realize=Only project members can set requirements as realized. error.authorization.develop.create=Only project members can register to develop a requirement. error.authorization.develop.delete=Only project members can deregister from developing a requirement. error.authorization.follow.create=Only project members can register to follow a requirement.