Skip to content

Commit

Permalink
Merge pull request #725 from OHDSI/release-1.17.1
Browse files Browse the repository at this point in the history
Release 1.17.1
  • Loading branch information
acumarav authored Apr 8, 2021
2 parents 74740fe + 2b43246 commit c6706f4
Show file tree
Hide file tree
Showing 18 changed files with 430 additions and 160 deletions.
44 changes: 27 additions & 17 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<artifactId>portal</artifactId>
<groupId>com.odysseusinc.arachne</groupId>
<version>1.17.0</version>
<version>1.17.1</version>
<packaging>jar</packaging>

<parent>
Expand All @@ -21,23 +21,26 @@
<start-class>com.odysseusinc.arachne.portal.PortalStarter</start-class>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<jjwt.version>0.10.5</jjwt.version>
<jjwt.version>0.10.8</jjwt.version>
<activemq.version>5.15.14</activemq.version>
<assertj.version>3.13.2</assertj.version>
<build.id>${BUILD_TIMESTAMP}</build.id>
<build.number>${BUILD_NUMBER}</build.number>
<clamav.version>2.0.1</clamav.version>
<commons.fileupload.version>1.4</commons.fileupload.version>
<commons.io.version>2.8.0</commons.io.version>
<commons.lang3.version>3.11</commons.lang3.version>
<commonsCsv.version>1.7</commonsCsv.version>
<dockerImagePrefix>hub.odysseusinc.com</dockerImagePrefix>
<ehcache.version>1.3.0</ehcache.version>
<postgresql.version>42.2.1</postgresql.version>
<gson.version>2.7</gson.version>
<commons.lang3.version>3.8.1</commons.lang3.version>
<hibernate.version>5.2.12.Final</hibernate.version>
<hikaricp.version>2.6.3</hikaricp.version>
<build.number>${BUILD_NUMBER}</build.number>
<build.id>${BUILD_TIMESTAMP}</build.id>
<dockerImagePrefix>hub.arachnenetwork.com</dockerImagePrefix>
<jackson.version>2.10.5.20201202</jackson.version>
<jodConverter.version>4.2.0</jodConverter.version>
<hibernate.version>5.2.12.Final</hibernate.version>
<clamav.version>2.0.1</clamav.version>
<postgresql.version>42.2.15</postgresql.version>
<springRetryVersion>1.2.4.RELEASE</springRetryVersion>
<assertj.version>3.13.2</assertj.version>
<commonsCsv.version>1.7</commonsCsv.version>
<commons.fileupload.version>1.4</commons.fileupload.version>
<commons.io.version>2.5</commons.io.version>
<bcprov-jdk15on.version>1.68</bcprov-jdk15on.version>
</properties>

<profiles>
Expand Down Expand Up @@ -107,7 +110,7 @@
<dependency>
<artifactId>solr-solrj</artifactId>
<groupId>org.apache.solr</groupId>
<version>7.2.1</version>
<version>7.7.3</version>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
Expand Down Expand Up @@ -139,6 +142,13 @@
<artifactId>arachne-common-utils</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>${bcprov-jdk15on.version}</version>
</dependency>

<dependency>
<groupId>com.odysseusinc.arachne</groupId>
<artifactId>arachne-no-handler-found-exception-util</artifactId>
Expand Down Expand Up @@ -263,7 +273,7 @@
<dependency>
<groupId>net.lingala.zip4j</groupId>
<artifactId>zip4j</artifactId>
<version>2.1.1</version>
<version>2.6.4</version>
</dependency>
<dependency>
<groupId>edu.vt.middleware</groupId>
Expand Down Expand Up @@ -489,8 +499,8 @@
<include>${project.build.finalName}-exec.${project.packaging}</include>
</resource>
</resources>
<serverId>arachne-hub</serverId>
<registryUrl>https://hub.arachnenetwork.com/v2/</registryUrl>
<serverId>hub.odysseusinc.com</serverId>
<registryUrl>https://hub.odysseusinc.com/v2/</registryUrl>
</configuration>
<executions>
<execution>
Expand Down
2 changes: 1 addition & 1 deletion solr_config/conf/solrconfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
that you fully re-index after changing this setting as it can
affect both how text is indexed and queried.
-->
<luceneMatchVersion>7.2.1</luceneMatchVersion>
<luceneMatchVersion>7.7.1</luceneMatchVersion>

<!-- <lib/> directives can be used to instruct Solr to load any Jars
identified and use them to resolve any "plugins" specified in
Expand Down
4 changes: 2 additions & 2 deletions src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM hub.arachnenetwork.com/portal_env:1.0.13
MAINTAINER alexandr.ryabokon@odysseusinc.com
FROM hub.odysseusinc.com/portal_env:1.1.0
MAINTAINER alexandr.cumarav@odysseusinc.com
USER root
VOLUME /tmp
ADD portal-exec.jar /portal.jar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,14 @@ private void checkIfUserBlocked(String username) throws PermissionDeniedExceptio

protected void checkIfUserHasTenant(String username) throws AuthenticationException {

IUser user = userService.getByUsernameInAnyTenant(username);
if (user == null) {
throw new BadCredentialsException(ErrorMessages.BAD_CREDENTIALS.getMessage());
}
if (user.getTenants() == null || user.getTenants().isEmpty()) {
throw new NoDefaultTenantException("Request admin to add you into a tenant.");
if (authenticationHelperService.isNative()) {
IUser user = userService.getByUsernameInAnyTenant(username);
if (user == null) {
throw new BadCredentialsException(ErrorMessages.BAD_CREDENTIALS.getMessage());
}
if (user.getTenants() == null || user.getTenants().isEmpty()) {
throw new NoDefaultTenantException("Request admin to add you into a tenant.");
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ public JsonResult<UserProfileDTO> viewProfile(
Principal principal,
@PathVariable("userId") String userId) {

IUser logginedUser = userService.getByUsername(principal.getName());
IUser loggedInUser = userService.getByUsername(principal.getName());
JsonResult<UserProfileDTO> result;
IUser user = userService.getByUuidAndInitializeCollections(userId);

UserProfileDTO userProfileDTO = conversionService.convert(user, UserProfileDTO.class);
userProfileDTO.setIsEditable(logginedUser.getUuid().equals(userId));
userProfileDTO.setIsEditable(loggedInUser.getUuid().equals(userId));
result = new JsonResult<>(JsonResult.ErrorCode.NO_ERROR);
result.setResult(userProfileDTO);
return result;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
*
* Copyright 2021 Odysseus Data Services, inc.
* 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.
*
* Company: Odysseus Data Services, Inc.
* Product Owner/Architecture: Gregory Klebanov
* Authors: Yaroslav Molodkov, Alexandr Cumarav, Vitaliy Kulakov
* Created: March 17, 2021
*
*/

package com.odysseusinc.arachne.portal.component.ldap;

public class ImportResult {

public enum ImportResultState {
CREATED,
UPDATED,
ERROR
}

private String id;
private ImportResultState state;
private String message;

public ImportResult(String id, ImportResultState state) {

this.id = id;
this.state = state;
}

public ImportResult(String id, ImportResultState state, String message) {

this.id = id;
this.state = state;
this.message = message;
}

public String getId() {

return id;
}

public void setId(String id) {

this.id = id;
}

public ImportResultState getState() {

return state;
}

public void setState(ImportResultState state) {

this.state = state;
}

public String getMessage() {

return message;
}

public void setMessage(String message) {

this.message = message;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,17 @@ public interface BaseRawUserRepository<U extends IUser> extends EntityGraphJpaRe

U findByIdAndEnabledTrue(Long id);

U findByOriginAndUsername(String userOrigin, String username);
U findByOriginAndUsernameIgnoreCase(String userOrigin, String username);

U findByRegistrationCode(String activateCode);

U findByEmail(String email, EntityGraph entityGraph);

U findByEmailIgnoreCase(String email, EntityGraph entityGraph);

U findByEmail(String email);

U findByEmailAndEnabledTrue(String email);

U findByOriginAndUsernameAndEnabledTrue(String userOrigin, String username);
U findByOriginAndUsernameIgnoreCaseAndEnabledTrue(String userOrigin, String username);

@Query(nativeQuery = true, value = "SELECT * FROM users_data "
+ " WHERE "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,8 @@ public interface BaseUserRepository<U extends IUser> extends EntityGraphJpaRepos

List<U> findByIdIn(List<Long> idList);

U findByEmail(String email);

U findByEmailAndEnabledTrue(String email);

U findByEmailAndEmailConfirmedFalse(String email);

U findByOriginAndUsername(String userOrigin, String username);

U findByOriginAndUsernameAndEnabledTrue(String userOrigin, String username);
Expand Down Expand Up @@ -87,8 +83,6 @@ List<U> suggestToPaper(@Param("suggestRequest") String suggestRequest,
@Query(nativeQuery = true, value = "SELECT * FROM users_data u WHERE enabled = TRUE")
List<U> findAllEnabledFromAllTenants();

Page<U> findAllBy(Pageable pageable);

List<U> findAllByUsernameInAndEnabledTrue(List<String> userNames);

@Query(nativeQuery = true, value = "SELECT DISTINCT u.* FROM users u "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
import com.odysseusinc.arachne.portal.model.CommentTopic;
import java.util.List;
import java.util.Set;
import javax.transaction.Transactional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;

public interface CommentRepository extends PagingAndSortingRepository<Comment, Long> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,22 @@
import java.util.zip.ZipFile;
import javax.persistence.EntityManager;
import javax.persistence.FlushModeType;
import javax.transaction.Transactional;
import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class AchillesImportServiceImpl implements AchillesImportService {

private static final String IMPORT_ACHILLES_RESULT_LOG =
"{} import Achilles result for Data Source with id='{}', name='{}', Data Node with id='{}' name='{}'";

private static final Logger LOGGER = LoggerFactory.getLogger(AchillesImportService.class);
private static final Logger LOGGER = LoggerFactory.getLogger(AchillesImportServiceImpl.class);

@Value("${spring.jpa.properties.hibernate.jdbc.batch_size}")
private int batchSize = 1000;
Expand Down
Loading

0 comments on commit c6706f4

Please sign in to comment.