diff --git a/MessageContentAnalyzer-ejb/pom.xml b/MessageContentAnalyzer-ejb/pom.xml index d77973fd2924f763f6008f290fb31e47089fc530..8bf25eaa9f8335ae93940c41c4b9bc90ab2c5a99 100644 --- a/MessageContentAnalyzer-ejb/pom.xml +++ b/MessageContentAnalyzer-ejb/pom.xml @@ -5,7 +5,7 @@ <parent> <artifactId>message-content-analyzer</artifactId> <groupId>net.ihe.gazelle</groupId> - <version>3.0.5-SNAPSHOT</version> + <version>3.1.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> @@ -55,7 +55,7 @@ <dependency> <groupId>net.ihe.gazelle</groupId> <artifactId>gazelle-evsclient-common</artifactId> - <version>2.0.5</version> + <version>2.0.6-NPD-692-SNAPSHOT</version> </dependency> <dependency> <groupId>ca.uhn.hapi</groupId> @@ -98,7 +98,11 @@ <artifactId>richfaces-core-impl</artifactId> </dependency> - + <!-- SSO Identity --> + <dependency> + <groupId>net.ihe.gazelle</groupId> + <artifactId>sso-api-v7</artifactId> + </dependency> <!-- slf4j --> @@ -201,7 +205,7 @@ <dependency> <groupId>net.ihe.gazelle.maven</groupId> <artifactId>version</artifactId> - <version>1.0.4</version> + <version>1.0.5-VER-2-SNAPSHOT</version> <type>ejb</type> <scope>provided</scope> </dependency> diff --git a/MessageContentAnalyzer-ejb/src/main/java/net/ihe/gazelle/mca/contentanalyzer/adapters/analysis/gui/AnalysisBeanGui.java b/MessageContentAnalyzer-ejb/src/main/java/net/ihe/gazelle/mca/contentanalyzer/adapters/analysis/gui/AnalysisBeanGui.java index 1edacecaca00e61655d056a793b34058905a8f4b..8c1f44f89810ed8003de3ec6546818114ca0c4cf 100644 --- a/MessageContentAnalyzer-ejb/src/main/java/net/ihe/gazelle/mca/contentanalyzer/adapters/analysis/gui/AnalysisBeanGui.java +++ b/MessageContentAnalyzer-ejb/src/main/java/net/ihe/gazelle/mca/contentanalyzer/adapters/analysis/gui/AnalysisBeanGui.java @@ -30,7 +30,6 @@ import net.ihe.gazelle.evsclient.application.CallerMetadataFactory; import net.ihe.gazelle.evsclient.application.interfaces.ForbiddenAccessException; import net.ihe.gazelle.evsclient.application.interfaces.NotFoundException; import net.ihe.gazelle.evsclient.application.interfaces.UnauthorizedException; -import net.ihe.gazelle.evsclient.application.interfaces.adapters.EvsIdentity; import net.ihe.gazelle.evsclient.application.interfaces.adapters.NotLoadedException; import net.ihe.gazelle.evsclient.application.interfaces.adapters.ProcessingNotSavedException; import net.ihe.gazelle.evsclient.connector.api.EVSClientResults; @@ -65,6 +64,7 @@ import net.ihe.gazelle.mca.contentanalyzer.application.utils.DocTypeUtils; import net.ihe.gazelle.mca.contentanalyzer.application.utils.FileContentUtils; import net.ihe.gazelle.mca.contentanalyzer.business.exceptions.UnexpectedAnalysisException; import net.ihe.gazelle.mca.contentanalyzer.business.model.*; +import net.ihe.gazelle.ssov7.authn.domain.GazelleIdentity; import org.apache.commons.collections.MapUtils; import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; @@ -138,8 +138,8 @@ public class AnalysisBeanGui extends AbstractProcessingBeanGui<Analysis, Analysi McaApi mcaApi, AnalyzerManager analyzerManager, CallerMetadataFactory callerMetadataFactory, Base64Converter base64Converter, FilesDownloaderManager filesDownloaderManager, ApplicationPreferenceManager applicationPreferenceManager, - EvsIdentity evsIdentity) { - super(AnalysisBeanGui.class, analysisManager, callerMetadataFactory, evsIdentity, applicationPreferenceManager, + GazelleIdentity gazelleIdentity) { + super(AnalysisBeanGui.class, analysisManager, callerMetadataFactory, gazelleIdentity, applicationPreferenceManager, new AbstractGuiPermanentLink(applicationPreferenceManager) { @Override public String getResultPageUrl() { @@ -409,7 +409,7 @@ public class AnalysisBeanGui extends AbstractProcessingBeanGui<Analysis, Analysi analysisPartManager.save(analysisPart); } analysis = processingManager.getObjectByOID( - analysisPart.getRootParent().getOid(), privacyKey, evsIdentity); + analysisPart.getRootParent().getOid(), privacyKey, identity); } else { throw nfe; } @@ -901,10 +901,10 @@ public class AnalysisBeanGui extends AbstractProcessingBeanGui<Analysis, Analysi public FilterDataModel<Analysis> getDataModel() { if (this.dataModel == null) { - boolean isLoggedIn = super.evsIdentity.isLoggedIn(); - boolean isMonitor = super.evsIdentity.isMonitorOrAdmin(); - String login = super.evsIdentity.getCredentialsUsername(); - String organization = super.evsIdentity.getInstitutionKeyword(); + boolean isLoggedIn = super.identity.isLoggedIn(); + boolean isMonitor = super.identity.hasRole("monitor_role") || super.identity.hasRole("admin_role"); + String login = super.identity.getUsername(); + String organization = super.identity.getOrganisationKeyword(); this.dataModel = new FilterDataModel<Analysis>( new Filter<>(processingManager.getCriterionForFilter(login, organization, isMonitor, isLoggedIn))) { private static final long serialVersionUID = -6565448932848176287L; diff --git a/MessageContentAnalyzer-ejb/src/main/java/net/ihe/gazelle/mca/contentanalyzer/adapters/factory/ApplicationFactory.java b/MessageContentAnalyzer-ejb/src/main/java/net/ihe/gazelle/mca/contentanalyzer/adapters/factory/ApplicationFactory.java index 17a177d2378dad2ed68136a28e1d64291d6c1cd0..051e0efb26f67acf4f9acf61524a8a1798097caf 100644 --- a/MessageContentAnalyzer-ejb/src/main/java/net/ihe/gazelle/mca/contentanalyzer/adapters/factory/ApplicationFactory.java +++ b/MessageContentAnalyzer-ejb/src/main/java/net/ihe/gazelle/mca/contentanalyzer/adapters/factory/ApplicationFactory.java @@ -14,7 +14,7 @@ import net.ihe.gazelle.mca.contentanalyzer.application.converters.Base64Converte import net.ihe.gazelle.mca.contentanalyzer.application.converters.DicomToTxtConverter; import net.ihe.gazelle.mca.contentanalyzer.application.files.FilesDownloaderManager; import net.ihe.gazelle.mca.contentanalyzer.application.files.TmpFilesManager; -import net.ihe.version.ws.Interface.VersionProviderInterface; +import net.ihe.gazelle.version.ws.VersionProviderInterface; import org.jboss.seam.ScopeType; import org.jboss.seam.annotations.*; diff --git a/MessageContentAnalyzer-ejb/src/main/java/net/ihe/gazelle/mca/contentanalyzer/adapters/factory/GuiFactory.java b/MessageContentAnalyzer-ejb/src/main/java/net/ihe/gazelle/mca/contentanalyzer/adapters/factory/GuiFactory.java index 36def61ea06152f42cd9e0ff3a434d00c4e795b2..73d71f8cd38dbbc48a9e5cb9bbf177f7073baffc 100644 --- a/MessageContentAnalyzer-ejb/src/main/java/net/ihe/gazelle/mca/contentanalyzer/adapters/factory/GuiFactory.java +++ b/MessageContentAnalyzer-ejb/src/main/java/net/ihe/gazelle/mca/contentanalyzer/adapters/factory/GuiFactory.java @@ -1,10 +1,10 @@ package net.ihe.gazelle.mca.contentanalyzer.adapters.factory; import net.ihe.gazelle.common.application.action.ApplicationPreferenceManager; -import net.ihe.gazelle.evsclient.application.interfaces.adapters.EvsIdentity; import net.ihe.gazelle.evsclient.interlay.factory.EvsCommonApplicationFactory; import net.ihe.gazelle.mca.contentanalyzer.adapters.analysis.gui.AnalysisBeanGui; import net.ihe.gazelle.mca.contentanalyzer.adapters.config.gui.ConfigBeanGui; +import net.ihe.gazelle.ssov7.authn.domain.GazelleIdentity; import org.jboss.seam.ScopeType; import org.jboss.seam.annotations.*; @@ -23,7 +23,7 @@ public class GuiFactory { private ApplicationPreferenceManager applicationPreferenceManager; @In(value = "org.jboss.seam.security.identity", create = true) - private EvsIdentity evsIdentity; + private GazelleIdentity gazelleIdentity; @Factory(value= "configBeanGui", scope = ScopeType.PAGE) public ConfigBeanGui getConfigBeanGui() { @@ -35,7 +35,7 @@ public class GuiFactory { return new AnalysisBeanGui(applicationFactory.getAnalysisManager(), applicationFactory.getAnalysisPartManager(), applicationFactory.getMcaConfigManager(), applicationFactory.getMcaApi(), applicationFactory.getAnalyzerManager(), evsCommonApplicationFactory.getCallerMetadataFactory(), applicationFactory.getBase64Converter(), applicationFactory.getFilesDownloaderManager(), applicationPreferenceManager, - evsIdentity); + gazelleIdentity); } } diff --git a/MessageContentAnalyzer-ejb/src/main/java/net/ihe/gazelle/mca/contentanalyzer/application/analysis/AnalysisManager.java b/MessageContentAnalyzer-ejb/src/main/java/net/ihe/gazelle/mca/contentanalyzer/application/analysis/AnalysisManager.java index 0e377baf655510232ccf1235bcddb87a26f41306..5ba4ab31fa457f2889b8d7ea216b909b5abaf380 100644 --- a/MessageContentAnalyzer-ejb/src/main/java/net/ihe/gazelle/mca/contentanalyzer/application/analysis/AnalysisManager.java +++ b/MessageContentAnalyzer-ejb/src/main/java/net/ihe/gazelle/mca/contentanalyzer/application/analysis/AnalysisManager.java @@ -17,7 +17,7 @@ import net.ihe.gazelle.mca.contentanalyzer.application.utils.DocTypeUtils; import net.ihe.gazelle.mca.contentanalyzer.application.utils.FileContentUtils; import net.ihe.gazelle.mca.contentanalyzer.business.model.Analysis; import net.ihe.gazelle.mca.contentanalyzer.business.model.AnalysisPart; -import net.ihe.version.ws.Interface.VersionProviderInterface; +import net.ihe.gazelle.version.ws.VersionProviderInterface; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/MessageContentAnalyzer-ejb/src/test/java/net/ihe/gazelle/mca/contentanalyzer/adapters/analysis/dao/AnalysisDaoTest.java b/MessageContentAnalyzer-ejb/src/test/java/net/ihe/gazelle/mca/contentanalyzer/adapters/analysis/dao/AnalysisDaoTest.java index f59ab5a1309db2d399002f7ebc522cfe6a3f639e..815ccc76263fa3737d3ee6edbd332d73dc725de0 100644 --- a/MessageContentAnalyzer-ejb/src/test/java/net/ihe/gazelle/mca/contentanalyzer/adapters/analysis/dao/AnalysisDaoTest.java +++ b/MessageContentAnalyzer-ejb/src/test/java/net/ihe/gazelle/mca/contentanalyzer/adapters/analysis/dao/AnalysisDaoTest.java @@ -9,7 +9,6 @@ import net.ihe.gazelle.evsclient.interlay.dao.Repository; import net.ihe.gazelle.evsclient.application.OIDGeneratorManagerImpl; import net.ihe.gazelle.evsclient.application.interfaces.ProcessingCacheManager; import net.ihe.gazelle.evsclient.domain.processing.HandledObject; -import net.ihe.gazelle.evsclient.interlay.gui.sso.SsoIdentityImpl; import net.ihe.gazelle.hql.providers.EntityManagerService; import net.ihe.gazelle.mca.contentanalyzer.adapters.factory.ApplicationTestFactory; import net.ihe.gazelle.mca.contentanalyzer.adapters.factory.DaoTestFactory; @@ -21,7 +20,7 @@ import net.ihe.gazelle.mca.contentanalyzer.application.utils.FileContentUtils; import net.ihe.gazelle.mca.contentanalyzer.business.model.Analysis; import net.ihe.gazelle.mca.contentanalyzer.business.model.AnalysisPart; import net.ihe.gazelle.mca.contentanalyzer.business.model.DocType; -import net.ihe.version.ws.Interface.VersionProvider; +import net.ihe.gazelle.version.ws.VersionProvider; import org.apache.commons.io.FileUtils; import org.junit.Assert; import org.junit.Before; @@ -57,7 +56,6 @@ public class AnalysisDaoTest { EntityManager entityManager; VersionProvider versionProvider; OIDGeneratorManagerImpl oidGeneratorManager; - SsoIdentityImpl ssoIdentity; ProcessingCacheManager processingCacheManager; ApplicationPreferenceManager applicationPreferenceManager; diff --git a/MessageContentAnalyzer-ejb/src/test/java/net/ihe/gazelle/mca/contentanalyzer/application/AnalyzerManagerTest.java b/MessageContentAnalyzer-ejb/src/test/java/net/ihe/gazelle/mca/contentanalyzer/application/AnalyzerManagerTest.java index 5a8e227a361afda23efdecc4a65fab2cf675f9a9..0ffb420e0ba4e703fc08ef0d8743b0cb1b75a79a 100644 --- a/MessageContentAnalyzer-ejb/src/test/java/net/ihe/gazelle/mca/contentanalyzer/application/AnalyzerManagerTest.java +++ b/MessageContentAnalyzer-ejb/src/test/java/net/ihe/gazelle/mca/contentanalyzer/application/AnalyzerManagerTest.java @@ -13,7 +13,6 @@ import net.ihe.gazelle.evsclient.application.interfaces.adapters.ProcessingNotSa import net.ihe.gazelle.evsclient.domain.processing.*; import net.ihe.gazelle.evsclient.interlay.dao.HandledObjectFile; import net.ihe.gazelle.evsclient.interlay.gui.document.ContentConverter; -import net.ihe.gazelle.evsclient.interlay.gui.sso.SsoIdentityImpl; import net.ihe.gazelle.evsclient.interlay.servlet.Upload; import net.ihe.gazelle.mca.contentanalyzer.adapters.analysis.dao.AnalysisDaoImpl; import net.ihe.gazelle.mca.contentanalyzer.adapters.analysis.dao.AnalysisPartDaoImpl; @@ -33,7 +32,8 @@ import net.ihe.gazelle.mca.contentanalyzer.business.model.AnalysisPart; import net.ihe.gazelle.mca.contentanalyzer.business.model.AnalysisStatus; import net.ihe.gazelle.mca.contentanalyzer.business.model.EncodedType; import net.ihe.gazelle.mca.contentanalyzer.business.model.config.McaConfigDaoStub; -import net.ihe.version.ws.Interface.VersionProvider; +import net.ihe.gazelle.ssov7.authn.domain.GazelleIdentity; +import net.ihe.gazelle.version.ws.VersionProvider; import org.apache.commons.io.FileUtils; import org.jboss.seam.Component; import org.jboss.seam.contexts.Contexts; @@ -92,7 +92,7 @@ public class AnalyzerManagerTest { @Mock OIDGeneratorManagerImpl oidGeneratorManager; @Mock - SsoIdentityImpl ssoIdentity; + GazelleIdentity gazelleIdentity; @Mock ProcessingCacheManager processingCacheManager; @Mock @@ -159,8 +159,8 @@ public class AnalyzerManagerTest { mockAnalysisPartDao(); mockAnalysisDao(); - ssoIdentity = Mockito.mock(SsoIdentityImpl.class); - when(ssoIdentity.isLoggedIn()).thenReturn(false); + gazelleIdentity = Mockito.mock(GazelleIdentity.class); + when(gazelleIdentity.isLoggedIn()).thenReturn(false); processingCacheManager = Mockito.mock(ProcessingCacheManager.class); @@ -186,7 +186,7 @@ public class AnalyzerManagerTest { analysisBeanGui = new AnalysisBeanGui(analysisManagerSpied, analysisPartManager, new McaConfigManager(new McaConfigDaoStub()), mcaApi, analyzerManager, - callerMetadataFactory, null, null, applicationPreferenceManager, ssoIdentity); + callerMetadataFactory, null, null, applicationPreferenceManager, gazelleIdentity); } private void mockUpload() { @@ -245,10 +245,10 @@ public class AnalyzerManagerTest { } private void mockAnalysisManager() throws UnauthorizedException, NotFoundException, ForbiddenAccessException { - doReturn(analysis).when(analysisManagerSpied).getObjectByOID(EXISTING_OID_CONTENT, null, ssoIdentity); + doReturn(analysis).when(analysisManagerSpied).getObjectByOID(EXISTING_OID_CONTENT, null, gazelleIdentity); doReturn(new Analysis(new HandledObject(EXISTING_ID_CONTENT.getBytes(), null), null)) - .when(analysisManagerSpied).getObjectByID(1, null, ssoIdentity); - doReturn(analysis).when(analysisManagerSpied).getObjectByOID(EXISTING_OID, null, ssoIdentity); + .when(analysisManagerSpied).getObjectByID(1, null, gazelleIdentity); + doReturn(analysis).when(analysisManagerSpied).getObjectByOID(EXISTING_OID, null, gazelleIdentity); } private void mockFacesMessages(String key, String value) { diff --git a/MessageContentAnalyzer-ejb/src/test/java/net/ihe/gazelle/mca/contentanalyzer/application/McaApiTest.java b/MessageContentAnalyzer-ejb/src/test/java/net/ihe/gazelle/mca/contentanalyzer/application/McaApiTest.java index da463a71fc4524c8e6d5a3798e1f46174d50450a..df11ff599427e9b7aad72c264a2f1ecbfd66e287 100644 --- a/MessageContentAnalyzer-ejb/src/test/java/net/ihe/gazelle/mca/contentanalyzer/application/McaApiTest.java +++ b/MessageContentAnalyzer-ejb/src/test/java/net/ihe/gazelle/mca/contentanalyzer/application/McaApiTest.java @@ -7,7 +7,7 @@ import net.ihe.gazelle.mca.contentanalyzer.adapters.factory.ApplicationTestFacto import net.ihe.gazelle.mca.contentanalyzer.application.utils.AnalysisUtils; import net.ihe.gazelle.mca.contentanalyzer.business.exceptions.UnexpectedAnalysisException; import net.ihe.gazelle.mca.contentanalyzer.business.model.Analysis; -import net.ihe.version.ws.Interface.VersionProvider; +import net.ihe.gazelle.version.ws.VersionProvider; import org.apache.commons.io.FileUtils; import org.junit.Assert; import org.junit.Before; diff --git a/MessageContentAnalyzer-war/pom.xml b/MessageContentAnalyzer-war/pom.xml index b9119ce827d5f09dd53514ac993b77953526450b..2325369ececd89468ea4ce234ba7dda51e47fef0 100644 --- a/MessageContentAnalyzer-war/pom.xml +++ b/MessageContentAnalyzer-war/pom.xml @@ -5,7 +5,7 @@ <parent> <artifactId>message-content-analyzer</artifactId> <groupId>net.ihe.gazelle</groupId> - <version>3.0.5-SNAPSHOT</version> + <version>3.1.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/pom.xml b/pom.xml index 8569db7a974db435d8ed767c55c15a0a9d2c4f49..d25edab2f0bce93e2cfcd37a0f26b632978f0028 100644 --- a/pom.xml +++ b/pom.xml @@ -3,13 +3,13 @@ <parent> <groupId>net.ihe.gazelle.maven</groupId> <artifactId>gazelle-tools</artifactId> - <version>3.1.4</version> + <version>3.3.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>net.ihe.gazelle</groupId> <artifactId>message-content-analyzer</artifactId> - <version>3.0.5-SNAPSHOT</version> + <version>3.1.0-SNAPSHOT</version> <packaging>pom</packaging> <name>Message Content Analyzer</name> @@ -34,7 +34,7 @@ <git.user.token>changeit</git.user.token> <git.project.url>https://${git.user.name}:${git.user.token}@gitlab.inria.fr/gazelle/library/message-content-analyzer</git.project.url> - <gazelle.model.version>4.2.11</gazelle.model.version> + <gazelle.model.version>5.0.0-SNAPSHOT</gazelle.model.version> <powermock.version>1.7.1</powermock.version> <mockito.version>1.10.19</mockito.version> <maven.compiler.source>1.7</maven.compiler.source> @@ -53,6 +53,7 @@ <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> <sonar.jacoco.reportPaths>target/jacoco.exec</sonar.jacoco.reportPaths> <sonar.maven.plugin>3.5.0.1254</sonar.maven.plugin> + <sso.client.v7.version>2.0.0-SNAPSHOT</sso.client.v7.version> </properties> <modules> @@ -124,15 +125,22 @@ <dependency> <groupId>net.ihe.gazelle</groupId> <artifactId>message-content-analyzer-ejb</artifactId> - <version>3.0.5-SNAPSHOT</version> + <version>3.1.0-SNAPSHOT</version> <type>ejb</type> </dependency> <dependency> <groupId>net.ihe.gazelle</groupId> <artifactId>message-content-analyzer-war</artifactId> - <version>3.0.5-SNAPSHOT</version> + <version>3.1.0-SNAPSHOT</version> <type>war</type> </dependency> + <dependency> + <groupId>net.ihe.gazelle</groupId> + <artifactId>sso-client-v7</artifactId> + <version>${sso.client.v7.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> </dependencies> </dependencyManagement>