update to current development status
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..cad8a61
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,39 @@
+**/bin/
+**/target/
+**._trace
+**git.properties
+**.log.properties
+git.properties
+**/target/
+**/.metadata/
+
+**/emf-gen/**/.gitignore
+**/src-gen/**/.gitignore
+**/git.properties
+**/*.java._trace
+**/*.log
+**/*.log.properties
+
+**/bin/
+**/build/
+*.class
+*.ctrl
+**/Debug/
+.DS_Store
+*.ear
+*.war
+
+**/*.actionbin
+**/*.blipbin
+**/*.chartbin
+**/*.cubebin
+**/*.datatypebin
+**/*.dtobin
+**/*.entitybin
+**/*.servicebin
+**/*.tablebin
+**/*.uibin
+**/*.uisemanticbin
+**/*.xtendbin
+**/*.xtextbin
+
diff --git a/.project b/.project
index 5f47942..6e50d5a 100644
--- a/.project
+++ b/.project
@@ -10,11 +10,6 @@
<arguments>
</arguments>
</buildCommand>
- <buildCommand>
- <name>org.sonarlint.eclipse.core.sonarlintBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
diff --git a/jenkins.build.config.xml b/jenkins.build.config.xml
index 8f3c04d..4139d4c 100644
--- a/jenkins.build.config.xml
+++ b/jenkins.build.config.xml
@@ -15,12 +15,13 @@
<jenkins>
<!-- DO NOT EDIT BELOW THIS LINE -->
<jenkins.build.dependencies>
+ <jenkins.build.dependency>org.eclipse.osbp.core.api</jenkins.build.dependency>
<jenkins.build.dependency>org.eclipse.osbp.dsl</jenkins.build.dependency>
- <jenkins.build.dependency>org.eclipse.osbp.persistence</jenkins.build.dependency>
+ <jenkins.build.dependency>org.eclipse.osbp.jpa.services</jenkins.build.dependency>
<jenkins.build.dependency>org.eclipse.osbp.preferences</jenkins.build.dependency>
<jenkins.build.dependency>org.eclipse.osbp.runtime</jenkins.build.dependency>
<jenkins.build.dependency>org.eclipse.osbp.ui.api</jenkins.build.dependency>
- <jenkins.build.dependency>org.eclipse.osbp.utils.blob</jenkins.build.dependency>
<jenkins.build.dependency>org.eclipse.osbp.xtext.i18n</jenkins.build.dependency>
+ <jenkins.build.dependency>org.eclipse.osbp.xtext.oxtype</jenkins.build.dependency>
</jenkins.build.dependencies>
</jenkins>
diff --git a/org.eclipse.osbp.authentication.feature/.gitignore b/org.eclipse.osbp.authentication.feature/.gitignore
new file mode 100644
index 0000000..92be9f2
--- /dev/null
+++ b/org.eclipse.osbp.authentication.feature/.gitignore
@@ -0,0 +1,3 @@
+/target/
+/apidocs/
+!/apidocs/README.txt
diff --git a/org.eclipse.osbp.authentication.feature/feature.xml b/org.eclipse.osbp.authentication.feature/feature.xml
index 66fcf3c..5e2e545 100644
--- a/org.eclipse.osbp.authentication.feature/feature.xml
+++ b/org.eclipse.osbp.authentication.feature/feature.xml
@@ -14,7 +14,8 @@
id="org.eclipse.osbp.authentication.feature"
label="%featureName"
version="0.9.0.qualifier"
- provider-name="%providerName">
+ provider-name="%providerName"
+ plugin="org.eclipse.osbp.authentication">
<description>
%description
diff --git a/org.eclipse.osbp.authentication/META-INF/MANIFEST.MF b/org.eclipse.osbp.authentication/META-INF/MANIFEST.MF
index d2d57a6..f5bcba9 100644
--- a/org.eclipse.osbp.authentication/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.authentication/META-INF/MANIFEST.MF
@@ -8,15 +8,16 @@
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
JPA-PersistenceUnits: authentication
-Import-Package: javax.servlet,
+Import-Package: javax.annotation,
+ javax.servlet,
javax.servlet.http,
javax.validation,
- org.apache.http.annotation;version="4.3.3",
+ org.eclipse.osbp.core.api.persistence;version="0.9.0",
org.osgi.framework
-Require-Bundle: com.vaadin.server;bundle-version="[7.5.7,7.7.0)",
+Require-Bundle: com.vaadin.server;bundle-version="[7.7.6,7.8.0)",
+ com.vaadin.shared;bundle-version="[7.7.6,7.8.0)",
org.slf4j.api,
javax.persistence;bundle-version="2.1.0",
- javax.annotation;bundle-version="[1.1.0,1.2.0)",
javax.inject;bundle-version="1.0.0",
org.apache.commons.beanutils;bundle-version="1.8.0",
org.eclipse.persistence.core;bundle-version="2.6.0",
@@ -25,88 +26,255 @@
org.apache.commons.compress;bundle-version="1.6.0",
org.eclipse.persistence.jpa;bundle-version="2.6.0",
com.google.inject;bundle-version="3.0.0",
- org.eclipse.xtext.xbase.lib;bundle-version="[2.7.3,2.8.0)";resolution:=optional,
+ org.eclipse.xtext.xbase.lib;bundle-version="[2.11.0,2.12.0)";resolution:=optional,
org.eclipse.osbp.runtime.common;bundle-version="[0.9.0,0.10.0)",
- org.eclipse.osbp.dsl.dto.lib;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.dsl.datatype.lib;bundle-version="[0.9.0,0.10.0)",
- org.eclipse.osbp.dsl.xtext.lazyresolver;bundle-version="[0.9.0,0.10.0)",
- org.eclipse.osbp.dsl.xtext.lazyresolver.api;bundle-version="[0.9.0,0.10.0)",
- org.eclipse.osbp.preferences;bundle-version="[0.9.0,0.10.0)",
- org.eclipse.osbp.persistence;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.xtext.i18n;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.gitinfo;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.ui.api;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osgi;bundle-version="3.10.2",
org.eclipse.osgi.services,
- javax.validation.api
+ javax.validation.api,
+ org.eclipse.osbp.xtext.oxtype;bundle-version="0.9.0",
+ org.eclipse.osbp.dsl.dto.lib;bundle-version="0.9.0",
+ org.eclipse.osbp.preferences;bundle-version="0.9.0",
+ org.eclipse.osbp.jpa.services;bundle-version="0.9.0"
Bundle-ClassPath: .,
lib/shiro-all-1.2.3.jar
-Export-Package: org.apache.shiro,
- org.apache.shiro.aop,
- org.apache.shiro.authc,
- org.apache.shiro.authc.credential,
- org.apache.shiro.authc.pam,
- org.apache.shiro.authz,
+Export-Package: org.apache.shiro;uses:="org.apache.shiro.mgt,org.apache.shiro.subject",
+ org.apache.shiro.aop;uses:="org.apache.shiro.subject",
+ org.apache.shiro.authc;
+ uses:="org.apache.shiro.authz,
+ org.apache.shiro,
+ org.apache.shiro.util,
+ org.apache.shiro.subject",
+ org.apache.shiro.authc.credential;
+ uses:="org.apache.shiro.crypto.hash,
+ org.apache.shiro.authc,
+ org.apache.shiro.codec,
+ org.apache.shiro.util,
+ org.apache.shiro.crypto.hash.format",
+ org.apache.shiro.authc.pam;uses:="org.apache.shiro.authc,org.apache.shiro.realm,org.apache.shiro.subject",
+ org.apache.shiro.authz;uses:="org.apache.shiro,org.apache.shiro.subject,org.apache.shiro.authz.permission",
org.apache.shiro.authz.annotation,
- org.apache.shiro.authz.aop,
- org.apache.shiro.authz.permission,
- org.apache.shiro.cache,
- org.apache.shiro.cache.ehcache,
- org.apache.shiro.codec,
- org.apache.shiro.concurrent,
- org.apache.shiro.config,
- org.apache.shiro.crypto,
- org.apache.shiro.crypto.hash,
- org.apache.shiro.crypto.hash.format,
- org.apache.shiro.dao,
- org.apache.shiro.env,
+ org.apache.shiro.authz.aop;uses:="org.apache.shiro.aop",
+ org.apache.shiro.authz.permission;uses:="org.apache.shiro.authz,org.apache.shiro",
+ org.apache.shiro.cache;uses:="org.apache.shiro,org.apache.shiro.util",
+ org.apache.shiro.cache.ehcache;uses:="org.apache.shiro.cache,org.apache.shiro.util,net.sf.ehcache",
+ org.apache.shiro.codec;uses:="org.apache.shiro",
+ org.apache.shiro.concurrent;uses:="org.apache.shiro.subject",
+ org.apache.shiro.config;
+ uses:="org.apache.shiro.mgt,
+ org.apache.shiro,
+ org.slf4j,
+ org.apache.shiro.util,
+ org.apache.shiro.realm,
+ new org.apache.shiro.config",
+ org.apache.shiro.crypto;uses:="org.apache.shiro,org.apache.shiro.util",
+ org.apache.shiro.crypto.hash;uses:="org.apache.shiro.codec,org.apache.shiro.crypto,org.apache.shiro.util",
+ org.apache.shiro.crypto.hash.format;uses:="org.apache.shiro.crypto.hash",
+ org.apache.shiro.dao;uses:="org.apache.shiro",
+ org.apache.shiro.env;uses:="org.apache.shiro.mgt,org.apache.shiro,org.apache.shiro.util",
org.apache.shiro.functor,
- org.apache.shiro.io,
- org.apache.shiro.jndi,
- org.apache.shiro.ldap,
- org.apache.shiro.mgt,
- org.apache.shiro.realm,
- org.apache.shiro.realm.activedirectory,
- org.apache.shiro.realm.jdbc,
- org.apache.shiro.realm.jndi,
- org.apache.shiro.realm.ldap,
- org.apache.shiro.realm.text,
- org.apache.shiro.session,
- org.apache.shiro.session.mgt,
- org.apache.shiro.session.mgt.eis,
- org.apache.shiro.session.mgt.quartz,
- org.apache.shiro.spring,
- org.apache.shiro.spring.aop,
- org.apache.shiro.spring.remoting,
- org.apache.shiro.spring.security.interceptor,
- org.apache.shiro.spring.web,
- org.apache.shiro.subject,
- org.apache.shiro.subject.support,
- org.apache.shiro.util,
- org.apache.shiro.web.config,
- org.apache.shiro.web.env,
- org.apache.shiro.web.filter,
- org.apache.shiro.web.filter.authc,
- org.apache.shiro.web.filter.authz,
- org.apache.shiro.web.filter.mgt,
- org.apache.shiro.web.filter.session,
- org.apache.shiro.web.mgt,
- org.apache.shiro.web.servlet,
- org.apache.shiro.web.session,
- org.apache.shiro.web.session.mgt,
- org.apache.shiro.web.subject,
- org.apache.shiro.web.subject.support,
- org.apache.shiro.web.tags,
- org.apache.shiro.web.util,
- org.eclipse.osbp.authentication;version="0.9.0",
- org.eclipse.osbp.authentication.account.dtos;version="0.9.0",
- org.eclipse.osbp.authentication.account.dtos.mapper;version="0.9.0",
- org.eclipse.osbp.authentication.account.dtos.service;version="0.9.0",
- org.eclipse.osbp.authentication.account.entities;version="0.9.0",
+ org.apache.shiro.io;uses:="org.apache.shiro",
+ org.apache.shiro.jndi;uses:="org.apache.shiro.util,javax.naming",
+ org.apache.shiro.ldap;uses:="org.apache.shiro.dao",
+ org.apache.shiro.mgt;
+ uses:="org.apache.shiro.authc,
+ org.apache.shiro.session.mgt,
+ org.apache.shiro.util,
+ org.apache.shiro.realm,
+ org.apache.shiro.session,
+ org.apache.shiro.cache,
+ org.apache.shiro.authz,
+ org.apache.shiro.io,
+ org.apache.shiro.crypto,
+ org.apache.shiro.subject",
+ org.apache.shiro.realm;
+ uses:="org.apache.shiro.cache,
+ org.apache.shiro.authz,
+ org.apache.shiro.authc,
+ org.apache.shiro.authc.credential,
+ org.apache.shiro.util,
+ org.apache.shiro.subject,
+ org.apache.shiro.authz.permission",
+ org.apache.shiro.realm.activedirectory;
+ uses:="org.apache.shiro.authz,
+ org.apache.shiro.authc,
+ org.apache.shiro.realm.ldap,
+ org.apache.shiro.subject",
+ org.apache.shiro.realm.jdbc;
+ uses:="org.apache.shiro.authz,
+ org.apache.shiro.authc,
+ org.apache.shiro.realm,
+ javax.sql,
+ org.apache.shiro.subject",
+ org.apache.shiro.realm.jndi;uses:="org.apache.shiro.realm,org.apache.shiro.jndi",
+ org.apache.shiro.realm.ldap;
+ uses:="org.apache.shiro.authz,
+ javax.naming.directory,
+ org.apache.shiro.authc,
+ javax.naming.ldap,
+ org.apache.shiro.realm,
+ javax.naming,
+ org.apache.shiro.subject",
+ org.apache.shiro.realm.text;uses:="org.apache.shiro.config,org.apache.shiro.util,org.apache.shiro.realm",
+ org.apache.shiro.session;uses:="org.apache.shiro",
+ org.apache.shiro.session.mgt;
+ uses:="org.apache.shiro.cache,
+ org.apache.shiro.session.mgt.eis,
+ org.apache.shiro.util,
+ org.apache.shiro.session",
+ org.apache.shiro.session.mgt.eis;uses:="org.apache.shiro.cache,org.apache.shiro.session",
+ org.apache.shiro.session.mgt.quartz;uses:="org.apache.shiro.session.mgt,org.quartz",
+ org.apache.shiro.spring;uses:="org.springframework.beans.factory.config,org.springframework.core",
+ org.apache.shiro.spring.aop;uses:="org.apache.shiro.aop",
+ org.apache.shiro.spring.remoting;uses:="org.apache.shiro.mgt,org.springframework.remoting.support,org.aopalliance.intercept",
+ org.apache.shiro.spring.security.interceptor;
+ uses:="org.apache.shiro.authz.aop,
+ org.apache.shiro.mgt,
+ org.springframework.aop.support,
+ org.apache.shiro.aop,
+ org.aopalliance.intercept",
+ org.apache.shiro.spring.web;
+ uses:="org.apache.shiro.web.servlet,
+ org.apache.shiro.mgt,
+ org.apache.shiro.web.filter.mgt,
+ org.springframework.beans.factory,
+ org.springframework.beans.factory.config",
+ org.apache.shiro.subject;
+ uses:="org.apache.shiro.mgt,
+ org.apache.shiro,
+ org.apache.shiro.authz,
+ org.apache.shiro.authc,
+ org.apache.shiro.session",
+ org.apache.shiro.subject.support;
+ uses:="org.apache.shiro.mgt,
+ org.apache.shiro.authz,
+ org.apache.shiro.authc,
+ org.apache.shiro.session.mgt,
+ org.apache.shiro.util,
+ org.apache.shiro.session,
+ org.apache.shiro.subject",
+ org.apache.shiro.util;
+ uses:="org.apache.shiro.mgt,
+ org.slf4j,
+ org.apache.shiro,
+ org.apache.shiro.subject,
+ org.apache.shiro.authz.permission",
+ org.apache.shiro.web.config;
+ uses:="javax.servlet,
+ org.apache.shiro.mgt,
+ org.apache.shiro.web.filter.mgt,
+ org.apache.shiro.config",
+ org.apache.shiro.web.env;
+ uses:="javax.servlet,
+ org.apache.shiro.mgt,
+ org.apache.shiro.web.filter.mgt,
+ org.apache.shiro.config,
+ org.apache.shiro.util,
+ org.apache.shiro.web.mgt,
+ org.apache.shiro.env",
+ org.apache.shiro.web.filter;
+ uses:="org.apache.shiro.web.servlet,
+ javax.servlet,
+ org.apache.shiro.util,
+ org.apache.shiro.subject",
+ org.apache.shiro.web.filter.authc;
+ uses:="org.apache.shiro.web.servlet,
+ javax.servlet,
+ org.apache.shiro.authc,
+ org.apache.shiro.web.filter,
+ org.apache.shiro.subject",
+ org.apache.shiro.web.filter.authz;uses:="javax.servlet,javax.servlet.http,org.apache.shiro.web.filter",
+ org.apache.shiro.web.filter.mgt;uses:="javax.servlet,org.apache.shiro.util",
+ org.apache.shiro.web.filter.session;uses:="javax.servlet,org.apache.shiro.web.filter",
+ org.apache.shiro.web.mgt;
+ uses:="org.apache.shiro.web.servlet,
+ javax.servlet,
+ org.apache.shiro.mgt,
+ org.apache.shiro.session.mgt,
+ org.apache.shiro.realm,
+ org.apache.shiro.session,
+ org.apache.shiro.subject",
+ org.apache.shiro.web.servlet;
+ uses:="org.apache.shiro.web.filter.mgt,
+ javax.servlet.http,
+ org.apache.shiro.config,
+ org.apache.shiro.util,
+ org.apache.shiro.session,
+ org.apache.shiro.web.subject,
+ javax.servlet,
+ org.apache.shiro.web.mgt,
+ org.apache.shiro.subject",
+ org.apache.shiro.web.session;uses:="javax.servlet.http,org.apache.shiro.session",
+ org.apache.shiro.web.session.mgt;
+ uses:="org.apache.shiro.web.servlet,
+ javax.servlet,
+ org.apache.shiro.session.mgt,
+ javax.servlet.http,
+ org.apache.shiro.web.util,
+ org.apache.shiro.session",
+ org.apache.shiro.web.subject;
+ uses:="javax.servlet,
+ org.apache.shiro.mgt,
+ org.apache.shiro.web.util,
+ org.apache.shiro.subject",
+ org.apache.shiro.web.subject.support;
+ uses:="org.apache.shiro.web.subject,
+ javax.servlet,
+ org.apache.shiro.mgt,
+ org.apache.shiro.session.mgt,
+ org.apache.shiro.session,
+ org.apache.shiro.subject.support,
+ org.apache.shiro.subject",
+ org.apache.shiro.web.tags;uses:="javax.servlet.jsp.tagext,org.apache.shiro.subject",
+ org.apache.shiro.web.util;uses:="javax.servlet,javax.servlet.http,org.apache.shiro.web.env",
+ org.eclipse.osbp.authentication;version="0.9.0";uses:="org.osgi.framework,org.eclipse.osbp.ui.api.complexdatacontainer,org.eclipse.osbp.ui.api.useraccess",
+ org.eclipse.osbp.authentication.account.dtos;version="0.9.0";uses:="org.eclipse.osbp.dsl.common.datatypes",
+ org.eclipse.osbp.authentication.account.dtos.mapper;version="0.9.0";uses:="org.eclipse.osbp.authentication.account.entities,org.eclipse.osbp.dsl.dto.lib,org.eclipse.osbp.authentication.account.dtos",
+ org.eclipse.osbp.authentication.account.dtos.service;version="0.9.0";uses:="org.eclipse.osbp.dsl.dto.lib.services.impl,org.eclipse.osbp.authentication.account.dtos",
+ org.eclipse.osbp.authentication.account.entities;version="0.9.0";uses:="org.eclipse.osbp.dsl.common.datatypes",
org.eclipse.osbp.authentication.exceptions;version="0.9.0",
- org.eclipse.osbp.authentication.providerimpl;version="0.9.0",
- org.eclipse.osbp.authentication.shiro.extensions;version="0.9.0",
- org.eclipse.osbp.authentication.shiro.extensionsimpl;version="0.9.0",
- org.eclipse.osbp.authentication.vaadin;version="0.9.0"
+ org.eclipse.osbp.authentication.providerimpl;version="0.9.0";
+ uses:="org.eclipse.osbp.core.api.persistence,
+ org.osgi.service.component,
+ org.apache.shiro.authc,
+ org.eclipse.osbp.runtime.common.filter,
+ org.eclipse.osbp.ui.api.userfilter,
+ org.eclipse.osbp.ui.api.complexdatacontainer,
+ org.apache.shiro.authz,
+ org.eclipse.osbp.ui.api.useraccess,
+ org.apache.shiro.authc.credential,
+ org.apache.shiro.subject,
+ org.eclipse.osbp.authentication.account.dtos",
+ org.eclipse.osbp.authentication.shiro.extensions;version="0.9.0";
+ uses:="org.apache.shiro.authc,
+ org.eclipse.osbp.authentication.providerimpl,
+ org.apache.shiro.realm,
+ org.eclipse.osbp.authentication.shiro.extensionsimpl,
+ org.apache.shiro.authz,
+ javax.naming.ldap,
+ org.eclipse.osbp.ui.api.useraccess,
+ org.apache.shiro.authc.credential,
+ org.apache.shiro.realm.ldap,
+ org.apache.shiro.subject,
+ org.eclipse.osbp.authentication.account.dtos",
+ org.eclipse.osbp.authentication.shiro.extensionsimpl;version="0.9.0";
+ uses:="org.eclipse.osbp.authentication.shiro.extensions,
+ org.apache.shiro.authz,
+ org.apache.shiro.authc,
+ org.eclipse.osbp.ui.api.useraccess,
+ org.eclipse.osbp.authentication.providerimpl,
+ org.apache.shiro.realm,
+ org.apache.shiro.subject",
+ org.eclipse.osbp.authentication.vaadin;version="0.9.0";
+ uses:="com.google.inject,
+ org.apache.shiro.session.mgt,
+ com.vaadin.server,
+ org.apache.shiro.session,
+ org.apache.shiro.subject"
Service-Component: OSGI-INF/*.xml
-Factory-Model: datatype, entity, dto
+Factory-Model: datatype,
+ entity,
+ dto
diff --git a/org.eclipse.osbp.authentication/OSGI-INF/org.eclipse.osbp.authentication.ServiceListener.xml b/org.eclipse.osbp.authentication/OSGI-INF/org.eclipse.osbp.authentication.ServiceListener.xml
deleted file mode 100644
index 92ceb37..0000000
--- a/org.eclipse.osbp.authentication/OSGI-INF/org.eclipse.osbp.authentication.ServiceListener.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osbp.authentication.ServiceListener">
- <reference bind="bindOrganizationService" cardinality="0..1" interface="org.eclipse.osbp.ui.api.useraccess.IOrganizationService" name="OrganizationService" policy="dynamic" unbind="unbindOrganizationService"/>
- <implementation class="org.eclipse.osbp.authentication.ServiceListener"/>
-</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.authentication/OSGI-INF/org.eclipse.osbp.authentication.account.dtos.service.UserAccountDtoService.xml b/org.eclipse.osbp.authentication/OSGI-INF/org.eclipse.osbp.authentication.account.dtos.service.UserAccountDtoService.xml
index c1e189c..4e885a5 100644
--- a/org.eclipse.osbp.authentication/OSGI-INF/org.eclipse.osbp.authentication.account.dtos.service.UserAccountDtoService.xml
+++ b/org.eclipse.osbp.authentication/OSGI-INF/org.eclipse.osbp.authentication.account.dtos.service.UserAccountDtoService.xml
@@ -2,12 +2,14 @@
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osbp.authentication.account.dtos.service.useraccountdtoservice">
<implementation class="org.eclipse.osbp.authentication.account.dtos.service.UserAccountDtoService"/>
<service>
- <provide interface="org.eclipse.osbp.dsl.dto.lib.services.IDTOService"/>
+ <provide interface="org.eclipse.osbp.runtime.common.filter.IDTOService"/>
</service>
<property name="dto" type="String" value="org.eclipse.osbp.authentication.account.dtos.UserAccountDto"/>
<property name="service.pid" type="String" value="org.eclipse.osbp.authentication.account.dtos.service.useraccountdtoservice"/>
<reference name="mapperAccess" interface="org.eclipse.osbp.dsl.dto.lib.IMapperAccess" cardinality="1..1"
policy="dynamic" bind="bindMapperAccess" unbind="unbindMapperAccess"/>
-<reference name="filterEnhancers" interface="org.eclipse.osbp.dsl.dto.lib.services.filters.IFilterEnhancer" cardinality="0..n"
+<reference name="filterEnhancers" interface="org.eclipse.osbp.runtime.common.filter.IFilterEnhancer" cardinality="0..n"
policy="dynamic" bind="addFilterEnhancer" unbind="removeFilterEnhancer"/>
+<reference name="sessionManager" interface="org.eclipse.osbp.runtime.common.session.ISessionManager" cardinality="1..1"
+ policy="dynamic" bind="bindSessionManager" unbind="unbindSessionManager"/>
</scr:component>
diff --git a/org.eclipse.osbp.authentication/OSGI-INF/org.eclipse.osbp.authentication.account.dtos.service.UserAccountFilterDtoService.xml b/org.eclipse.osbp.authentication/OSGI-INF/org.eclipse.osbp.authentication.account.dtos.service.UserAccountFilterDtoService.xml
index a9bb4ff..e2d8626 100644
--- a/org.eclipse.osbp.authentication/OSGI-INF/org.eclipse.osbp.authentication.account.dtos.service.UserAccountFilterDtoService.xml
+++ b/org.eclipse.osbp.authentication/OSGI-INF/org.eclipse.osbp.authentication.account.dtos.service.UserAccountFilterDtoService.xml
@@ -2,12 +2,14 @@
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osbp.authentication.account.dtos.service.useraccountfilterdtoservice">
<implementation class="org.eclipse.osbp.authentication.account.dtos.service.UserAccountFilterDtoService"/>
<service>
- <provide interface="org.eclipse.osbp.dsl.dto.lib.services.IDTOService"/>
+ <provide interface="org.eclipse.osbp.runtime.common.filter.IDTOService"/>
</service>
<property name="dto" type="String" value="org.eclipse.osbp.authentication.account.dtos.UserAccountFilterDto"/>
<property name="service.pid" type="String" value="org.eclipse.osbp.authentication.account.dtos.service.useraccountfilterdtoservice"/>
<reference name="mapperAccess" interface="org.eclipse.osbp.dsl.dto.lib.IMapperAccess" cardinality="1..1"
policy="dynamic" bind="bindMapperAccess" unbind="unbindMapperAccess"/>
-<reference name="filterEnhancers" interface="org.eclipse.osbp.dsl.dto.lib.services.filters.IFilterEnhancer" cardinality="0..n"
+<reference name="filterEnhancers" interface="org.eclipse.osbp.runtime.common.filter.IFilterEnhancer" cardinality="0..n"
policy="dynamic" bind="addFilterEnhancer" unbind="removeFilterEnhancer"/>
+<reference name="sessionManager" interface="org.eclipse.osbp.runtime.common.session.ISessionManager" cardinality="1..1"
+ policy="dynamic" bind="bindSessionManager" unbind="unbindSessionManager"/>
</scr:component>
diff --git a/org.eclipse.osbp.authentication/OSGI-INF/org.eclipse.osbp.authentication.providerimpl.UserAccessService.xml b/org.eclipse.osbp.authentication/OSGI-INF/org.eclipse.osbp.authentication.providerimpl.UserAccessService.xml
index d3047a1..1803545 100644
--- a/org.eclipse.osbp.authentication/OSGI-INF/org.eclipse.osbp.authentication.providerimpl.UserAccessService.xml
+++ b/org.eclipse.osbp.authentication/OSGI-INF/org.eclipse.osbp.authentication.providerimpl.UserAccessService.xml
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.osbp.authentication.providerimpl.UserAccessService">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osbp.authentication.providerimpl.UserAccessService">
<service>
<provide interface="org.eclipse.osbp.ui.api.useraccess.IUserAccessService"/>
</service>
+ <reference bind="bindOrganizationService" cardinality="0..1" interface="org.eclipse.osbp.ui.api.useraccess.IOrganizationService" name="OrganizationService" policy="dynamic" unbind="unbindOrganizationService"/>
+ <reference bind="bindPersistenceService" cardinality="1..1" interface="org.eclipse.osbp.core.api.persistence.IPersistenceService" name="PersistenceService" policy="static" unbind="unbindPersistenceService"/>
<implementation class="org.eclipse.osbp.authentication.providerimpl.UserAccessService"/>
</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.authentication/OSGI-INF/org.eclipse.osbp.authentication.providerimpl.UserProtocol.xml b/org.eclipse.osbp.authentication/OSGI-INF/org.eclipse.osbp.authentication.providerimpl.UserProtocol.xml
deleted file mode 100644
index 1b0b82b..0000000
--- a/org.eclipse.osbp.authentication/OSGI-INF/org.eclipse.osbp.authentication.providerimpl.UserProtocol.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.osbp.authentication.providerimpl.UserProtocol">
- <reference bind="bindPersistenceService" cardinality="1..1" interface="org.eclipse.osbp.persistence.IPersistenceService" name="PersistenceService" policy="static" unbind="unbindPersistenceService"/>
- <implementation class="org.eclipse.osbp.authentication.providerimpl.UserProtocol"/>
-</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.authentication/about.properties b/org.eclipse.osbp.authentication/about.properties
index 28e72a6..0fec1a8 100644
--- a/org.eclipse.osbp.authentication/about.properties
+++ b/org.eclipse.osbp.authentication/about.properties
@@ -11,8 +11,6 @@
# NLS_MESSAGEFORMAT_VAR
-featureName=org.eclipse.osbp.authentication
-
################ blurb property ####################################
featureText=\
Copyright (c) 2012-2016 - Loetz GmbH&Co.KG \n\
diff --git a/org.eclipse.osbp.authentication/build.properties b/org.eclipse.osbp.authentication/build.properties
index d65fcd1..33936c9 100644
--- a/org.eclipse.osbp.authentication/build.properties
+++ b/org.eclipse.osbp.authentication/build.properties
@@ -9,7 +9,6 @@
OSGI-INF/,\
.,\
.classpath,\
- modelsbin/,\
.project,\
i18n/,\
license.html,\
diff --git a/org.eclipse.osbp.authentication/i18n/I18N.properties b/org.eclipse.osbp.authentication/i18n/I18N.properties
index b4cd5e5..d8ce2b1 100644
--- a/org.eclipse.osbp.authentication/i18n/I18N.properties
+++ b/org.eclipse.osbp.authentication/i18n/I18N.properties
@@ -1,36 +1,67 @@
#default
activation_time=activation_time
actual_owner=actual_owner
+administration=administration
+all_accounts=all_accounts
+answer_no_text=answer_no_text
+answer_yes_text=answer_yes_text
+cancel=cancel
+cancel_item=cancel_item
+clear_filter=clear_filter
cookie_hash_code=cookie_hash_code
created_by=created_by
created_on=created_on
default_perpective=default_perpective
+default_perspective=default_perspective
+delete_item=delete_item
description=description
+edit_account=edit_account
email=email
enabled=enabled
+end_date=end_date
+equal_to=equal_to
expiration_time=expiration_time
extra_password=extra_password
failed_attempt=failed_attempt
filter=filter
focusing_strategy=focusing_strategy
+foo=foo
force_pwd_change=force_pwd_change
+greater_than=greater_than
+groups=groups
id=id
invers=invers
+items_per_page=items_per_page
layouting_strategy=layouting_strategy
+lesser_than=lesser_than
locale_tag=locale_tag
locked=locked
+menu=menu
name=name
+new_item=new_item
not_registered=not_registered
+ok=ok
+page=page
password=password
password_reset=password_reset
+perspective_na=perspective_na
position=position
print_service=print_service
priority=priority
process_id=process_id
process_instance_id=process_instance_id
process_session_id=process_session_id
+profile=profile
profileimage=profileimage
registered=registered
+reset=reset
+save=save
+save_item=save_item
+security_message=security_message
+set_filter=set_filter
+show_all=show_all
+start_date=start_date
+start_process_text=start_process_text
status=status
subject=subject
successful_attempt=successful_attempt
@@ -38,6 +69,10 @@
supervisor=supervisor
task_id=task_id
theme=theme
+toolbar_for_dialogs=toolbar_for_dialogs
user_account=user_account
user_account_filter=user_account_filter
+user_administration=user_administration
user_name=user_name
+users=users
+x=x
diff --git a/org.eclipse.osbp.authentication/i18n/I18N_de.properties b/org.eclipse.osbp.authentication/i18n/I18N_de.properties
index a4a1425..56cab9c 100644
--- a/org.eclipse.osbp.authentication/i18n/I18N_de.properties
+++ b/org.eclipse.osbp.authentication/i18n/I18N_de.properties
@@ -1,36 +1,70 @@
#de
+=======
+<<<<<<<=HEAD
+>>>>>>>=0a6131d7378b5d2ff10c97c0281c8e0fcd631678
activation_time=Activation time
actual_owner=Actual owner
+administration=Administration
+all_accounts=All accounts
+answer_no_text=Answer no text
+answer_yes_text=Answer yes text
+cancel=Cancel
+cancel_item=Cancel item
+clear_filter=Clear filter
cookie_hash_code=Hashcode
created_by=Created by
created_on=Created on
default_perpective=Default perpective
+default_perspective=Default perspective
+delete_item=Delete item
description=Description
+edit_account=Edit account
email=EMail
enabled=freigegeben
+end_date=End date
+equal_to=Equal to
expiration_time=Expiration time
extra_password=Extra password
failed_attempt=fehlgeschlagene Versuche
filter=Filter
focusing_strategy=Focusing Strategie
+foo=Foo
force_pwd_change=Passwort\u00E4nderung erzwingen
+greater_than=Greater than
+groups=Groups
id=ID
invers=invers
+items_per_page=Items per page
layouting_strategy=Layouting Strategie
+lesser_than=Lesser than
locale_tag=L\u00E4ndereinstellung
locked=gesperrt
+menu=Menu
name=Name
+new_item=New item
not_registered=Not registered
+ok=Ok
+page=Page
password=Passwort
password_reset=Password reset
+perspective_na=Perspective na
position=Position
print_service=Print service
priority=Priority
process_id=Process identifier
process_instance_id=Process instance identifier
process_session_id=Process session identifier
+profile=Profile
profileimage=Profilbild
registered=Registered
+reset=Reset
+save=Save
+save_item=Save item
+security_message=Security message
+set_filter=Set filter
+show_all=Show all
+start_date=Start date
+start_process_text=Start process text
status=Status
subject=Subject
successful_attempt=erfolgreiche Versuche
@@ -38,6 +72,10 @@
supervisor=Supervisor
task_id=Task identifier
theme=Theme
+toolbar_for_dialogs=Toolbar for dialogs
user_account=Benutzerkonto
user_account_filter=Filter f\u00FCr Benutzerkonto
+user_administration=User administration
user_name=Benutzername
+users=Users
+x=X
diff --git a/org.eclipse.osbp.authentication/i18n/I18N_en.properties b/org.eclipse.osbp.authentication/i18n/I18N_en.properties
index fa35f78..0a971ab 100644
--- a/org.eclipse.osbp.authentication/i18n/I18N_en.properties
+++ b/org.eclipse.osbp.authentication/i18n/I18N_en.properties
@@ -1,36 +1,67 @@
#en
activation_time=Activation time
actual_owner=Actual owner
+administration=Administration
+all_accounts=All accounts
+answer_no_text=Answer no text
+answer_yes_text=Answer yes text
+cancel=Cancel
+cancel_item=Cancel item
+clear_filter=Clear filter
cookie_hash_code=cookie hash code
created_by=Created by
created_on=Created on
default_perpective=Default perpective
+default_perspective=Default perspective
+delete_item=Delete item
description=Description
+edit_account=Edit account
email=email
enabled=enabled
+end_date=End date
+equal_to=Equal to
expiration_time=Expiration time
extra_password=Extra password
failed_attempt=failed attempt
filter=filter
focusing_strategy=focusing strategy
+foo=Foo
force_pwd_change=force pwd change
+greater_than=Greater than
+groups=Groups
id=identifier
invers=invers
+items_per_page=Items per page
layouting_strategy=layouting strategy
+lesser_than=Lesser than
locale_tag=locale tag
locked=locked
+menu=Menu
name=Name
+new_item=New item
not_registered=Not registered
+ok=Ok
+page=Page
password=password
password_reset=Password reset
+perspective_na=Perspective na
position=position
print_service=Print service
priority=Priority
process_id=Process identifier
process_instance_id=Process instance identifier
process_session_id=Process session identifier
+profile=Profile
profileimage=profileimage
registered=Registered
+reset=Reset
+save=Save
+save_item=Save item
+security_message=Security message
+set_filter=Set filter
+show_all=Show all
+start_date=Start date
+start_process_text=Start process text
status=Status
subject=Subject
successful_attempt=successful attempt
@@ -38,6 +69,10 @@
supervisor=Supervisor
task_id=Task identifier
theme=theme
+toolbar_for_dialogs=Toolbar for dialogs
user_account=user account
user_account_filter=user account filter
+user_administration=User administration
user_name=user name
+users=Users
+x=X
diff --git a/org.eclipse.osbp.authentication/lib/shiro-all-1.2.3.jar b/org.eclipse.osbp.authentication/lib/shiro-all-1.2.3.jar
new file mode 100644
index 0000000..c753962
--- /dev/null
+++ b/org.eclipse.osbp.authentication/lib/shiro-all-1.2.3.jar
Binary files differ
diff --git a/org.eclipse.osbp.authentication/modelsbin/account.datatype.datatypes_bin b/org.eclipse.osbp.authentication/modelsbin/account.datatype.datatypes_bin
deleted file mode 100644
index 1376944..0000000
--- a/org.eclipse.osbp.authentication/modelsbin/account.datatype.datatypes_bin
+++ /dev/null
@@ -1,105 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<types:LCommonModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:types="http://osbp.eclipse.org/dsl/common/types/v1" xmlns:types_1="http://www.eclipse.org/xtext/common/JavaVMTypes">
- <packages name="org.eclipse.osbp.authentication.account.datatypes">
- <types xsi:type="types:LDataType" name="boolean" asPrimitive="true">
- <jvmTypeReference xsi:type="types_1:JvmParameterizedTypeReference">
- <type xsi:type="types_1:JvmGenericType" href="java:/Objects/java.lang.Boolean#java.lang.Boolean"/>
- </jvmTypeReference>
- </types>
- <types xsi:type="types:LDataType" name="short" asPrimitive="true">
- <jvmTypeReference xsi:type="types_1:JvmParameterizedTypeReference">
- <type xsi:type="types_1:JvmGenericType" href="java:/Objects/java.lang.Short#java.lang.Short"/>
- </jvmTypeReference>
- </types>
- <types xsi:type="types:LDataType" name="int" asPrimitive="true">
- <jvmTypeReference xsi:type="types_1:JvmParameterizedTypeReference">
- <type xsi:type="types_1:JvmGenericType" href="java:/Objects/java.lang.Integer#java.lang.Integer"/>
- </jvmTypeReference>
- </types>
- <types xsi:type="types:LDataType" name="long" asPrimitive="true">
- <jvmTypeReference xsi:type="types_1:JvmParameterizedTypeReference">
- <type xsi:type="types_1:JvmGenericType" href="java:/Objects/java.lang.Long#java.lang.Long"/>
- </jvmTypeReference>
- </types>
- <types xsi:type="types:LDataType" name="double" asPrimitive="true">
- <jvmTypeReference xsi:type="types_1:JvmParameterizedTypeReference">
- <type xsi:type="types_1:JvmGenericType" href="java:/Objects/java.lang.Double#java.lang.Double"/>
- </jvmTypeReference>
- </types>
- <types xsi:type="types:LDataType" name="float" asPrimitive="true">
- <jvmTypeReference xsi:type="types_1:JvmParameterizedTypeReference">
- <type xsi:type="types_1:JvmGenericType" href="java:/Objects/java.lang.Float#java.lang.Float"/>
- </jvmTypeReference>
- </types>
- <types xsi:type="types:LDataType" name="character" asPrimitive="true">
- <jvmTypeReference xsi:type="types_1:JvmParameterizedTypeReference">
- <type xsi:type="types_1:JvmGenericType" href="java:/Objects/java.lang.Character#java.lang.Character"/>
- </jvmTypeReference>
- </types>
- <types xsi:type="types:LDataType" name="byte" asPrimitive="true">
- <jvmTypeReference xsi:type="types_1:JvmParameterizedTypeReference">
- <type xsi:type="types_1:JvmGenericType" href="java:/Objects/java.lang.Byte#java.lang.Byte"/>
- </jvmTypeReference>
- </types>
- <types xsi:type="types:LDataType" name="Boolean">
- <jvmTypeReference xsi:type="types_1:JvmParameterizedTypeReference">
- <type xsi:type="types_1:JvmGenericType" href="java:/Objects/java.lang.Boolean#java.lang.Boolean"/>
- </jvmTypeReference>
- </types>
- <types xsi:type="types:LDataType" name="Short">
- <jvmTypeReference xsi:type="types_1:JvmParameterizedTypeReference">
- <type xsi:type="types_1:JvmGenericType" href="java:/Objects/java.lang.Short#java.lang.Short"/>
- </jvmTypeReference>
- </types>
- <types xsi:type="types:LDataType" name="Int">
- <jvmTypeReference xsi:type="types_1:JvmParameterizedTypeReference">
- <type xsi:type="types_1:JvmGenericType" href="java:/Objects/java.lang.Integer#java.lang.Integer"/>
- </jvmTypeReference>
- </types>
- <types xsi:type="types:LDataType" name="Long">
- <jvmTypeReference xsi:type="types_1:JvmParameterizedTypeReference">
- <type xsi:type="types_1:JvmGenericType" href="java:/Objects/java.lang.Long#java.lang.Long"/>
- </jvmTypeReference>
- </types>
- <types xsi:type="types:LDataType" name="Double">
- <jvmTypeReference xsi:type="types_1:JvmParameterizedTypeReference">
- <type xsi:type="types_1:JvmGenericType" href="java:/Objects/java.lang.Double#java.lang.Double"/>
- </jvmTypeReference>
- </types>
- <types xsi:type="types:LDataType" name="Float">
- <jvmTypeReference xsi:type="types_1:JvmParameterizedTypeReference">
- <type xsi:type="types_1:JvmGenericType" href="java:/Objects/java.lang.Float#java.lang.Float"/>
- </jvmTypeReference>
- </types>
- <types xsi:type="types:LDataType" name="Character">
- <jvmTypeReference xsi:type="types_1:JvmParameterizedTypeReference">
- <type xsi:type="types_1:JvmGenericType" href="java:/Objects/java.lang.Character#java.lang.Character"/>
- </jvmTypeReference>
- </types>
- <types xsi:type="types:LDataType" name="Byte">
- <jvmTypeReference xsi:type="types_1:JvmParameterizedTypeReference">
- <type xsi:type="types_1:JvmGenericType" href="java:/Objects/java.lang.Byte#java.lang.Byte"/>
- </jvmTypeReference>
- </types>
- <types xsi:type="types:LDataType" name="BigDecimal">
- <jvmTypeReference xsi:type="types_1:JvmParameterizedTypeReference">
- <type xsi:type="types_1:JvmGenericType" href="java:/Objects/java.math.BigDecimal#java.math.BigDecimal"/>
- </jvmTypeReference>
- </types>
- <types xsi:type="types:LDataType" name="String">
- <jvmTypeReference xsi:type="types_1:JvmParameterizedTypeReference">
- <type xsi:type="types_1:JvmGenericType" href="java:/Objects/java.lang.String#java.lang.String"/>
- </jvmTypeReference>
- </types>
- <types xsi:type="types:LDataType" name="BlobImage">
- <jvmTypeReference xsi:type="types_1:JvmParameterizedTypeReference">
- <type xsi:type="types_1:JvmGenericType" href="java:/Objects/java.lang.String#java.lang.String"/>
- </jvmTypeReference>
- <properties key="Blob" value="2"/>
- </types>
- <types xsi:type="types:LDataType" name="Date" date="true"/>
- <types xsi:type="types:LDataType" name="datetype" date="true"/>
- <types xsi:type="types:LDataType" name="timetype" date="true" dateType="TIME"/>
- <types xsi:type="types:LDataType" name="blobtype" asBlob="true"/>
- </packages>
-</types:LCommonModel>
diff --git a/org.eclipse.osbp.authentication/modelsbin/account.entity.entities_bin b/org.eclipse.osbp.authentication/modelsbin/account.entity.entities_bin
deleted file mode 100644
index 201dec9..0000000
--- a/org.eclipse.osbp.authentication/modelsbin/account.entity.entities_bin
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<entity:LEntityModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:entity="http://osbp.eclipse.org/dsl/entity/v1" xmlns:types="http://osbp.eclipse.org/dsl/common/types/v1">
- <packages name="org.eclipse.osbp.authentication.account.entities">
- <imports importedNamespace="org.eclipse.osbp.authentication.account.datatypes.*"/>
- <types xsi:type="entity:LEntity" name="UserAccount" persistenceUnit="authentication">
- <annotationInfo xsi:type="types:LClass"/>
- <persistenceInfo/>
- <features xsi:type="entity:LEntityAttribute" name="id" uuid="true">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.17"/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="email">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.17"/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="userName">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.17"/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="password">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.17"/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="extraPassword">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.17"/>
- <constraints xsi:type="types:LDtCRegEx" pattern="[0-9]*"/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="passwordReset">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.0"/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="position">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.17"/>
- <properties key="organization" value=""/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="defaultPerpective">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.17"/>
- <properties key="perspective" value=""/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="enabled">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.0"/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="locked">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.0"/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="superuser">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.0"/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="supervisor">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.0"/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="forcePwdChange">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.0"/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="notRegistered">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.0"/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="failedAttempt">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.2"/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="successfulAttempt">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.2"/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="cookieHashCode">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.2"/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="localeTag">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.17"/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="profileimage">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.18"/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="layoutingStrategy">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.17"/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="focusingStrategy">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.17"/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="theme">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.17"/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="printService">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.17"/>
- </features>
- <features xsi:type="entity:LEntityReference" name="userAccountFilter" type="//@packages.0/@types.1" opposite="//@packages.0/@types.1/@features.3">
- <multiplicity lower="MANY"/>
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- </features>
- </types>
- <types xsi:type="entity:LEntity" name="UserAccountFilter" persistenceUnit="authentication">
- <annotationInfo xsi:type="types:LClass"/>
- <persistenceInfo/>
- <features xsi:type="entity:LEntityAttribute" name="id" uuid="true">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.17"/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="filter">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.17"/>
- </features>
- <features xsi:type="entity:LEntityAttribute" name="invers">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- <type href="platform:/resource/org.eclipse.osbp.authentication/src/account.datatype#/0/@packages.0/@types.0"/>
- </features>
- <features xsi:type="entity:LEntityReference" name="userAccount" type="//@packages.0/@types.0" opposite="//@packages.0/@types.0/@features.23">
- <annotationInfo xsi:type="entity:LEntityFeature"/>
- </features>
- </types>
- </packages>
-</entity:LEntityModel>
diff --git a/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/dtos/UserAccountDto.java b/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/dtos/UserAccountDto.java
index 274a608..5704367 100644
--- a/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/dtos/UserAccountDto.java
+++ b/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/dtos/UserAccountDto.java
@@ -8,13 +8,14 @@
import javax.validation.constraints.Pattern;
import org.eclipse.osbp.authentication.account.dtos.UserAccountFilterDto;
import org.eclipse.osbp.dsl.common.datatypes.IDto;
-import org.eclipse.osbp.dsl.dto.lib.MappingContext;
+import org.eclipse.osbp.runtime.common.annotations.Dirty;
import org.eclipse.osbp.runtime.common.annotations.Dispose;
import org.eclipse.osbp.runtime.common.annotations.DomainReference;
+import org.eclipse.osbp.runtime.common.annotations.FilterDepth;
import org.eclipse.osbp.runtime.common.annotations.Id;
import org.eclipse.osbp.runtime.common.annotations.Properties;
import org.eclipse.osbp.runtime.common.annotations.Property;
-import org.eclipse.osbp.runtime.jsr303.validation.common.InfoSeverity;
+import org.eclipse.osbp.runtime.jsr303.validation.common.ErrorSeverity;
@SuppressWarnings("all")
public class UserAccountDto implements IDto, Serializable, PropertyChangeListener {
@@ -23,6 +24,9 @@
@Dispose
private boolean disposed;
+ @Dirty
+ private transient boolean dirty;
+
@Id
private String id = java.util.UUID.randomUUID().toString();
@@ -32,7 +36,7 @@
private String password;
- @Pattern(regexp = "[0-9]*", payload = InfoSeverity.class)
+ @Pattern(regexp = "[0-9]*", payload = ErrorSeverity.class)
private String extraPassword;
private boolean passwordReset;
@@ -41,7 +45,7 @@
private String position;
@Properties(properties = @Property(key = "perspective", value = ""))
- private String defaultPerpective;
+ private String defaultPerspective;
private boolean enabled;
@@ -70,11 +74,13 @@
private String focusingStrategy;
+ @Properties(properties = @Property(key = "theme", value = ""))
private String theme;
private String printService;
@DomainReference
+ @FilterDepth(depth = 0)
private List<UserAccountFilterDto> userAccountFilter;
public UserAccountDto() {
@@ -89,7 +95,7 @@
userAccountFilter = new org.eclipse.osbp.dsl.dto.lib.OppositeDtoList<>(
org.eclipse.osbp.dsl.dto.lib.MappingContext.getCurrent(),
UserAccountFilterDto.class, "userAccount.id",
- (java.util.function.Supplier<Object> & Serializable) () -> this.getId());
+ (java.util.function.Supplier<Object> & Serializable) () -> this.getId(), this);
}
/**
@@ -138,6 +144,22 @@
}
/**
+ * @return true, if the object is dirty.
+ *
+ */
+ public boolean isDirty() {
+ return dirty;
+ }
+
+ /**
+ * Sets the dirty state of this object.
+ *
+ */
+ public void setDirty(final boolean dirty) {
+ firePropertyChange("dirty", this.dirty, this.dirty = dirty );
+ }
+
+ /**
* Checks whether the object is disposed.
* @throws RuntimeException if the object is disposed.
*/
@@ -200,7 +222,7 @@
}
/**
- * Returns the userName property or <code>null</code> if not present.
+ * Returns the <em>required</em> userName property.
*/
public String getUserName() {
return this.userName;
@@ -290,21 +312,21 @@
}
/**
- * Returns the defaultPerpective property or <code>null</code> if not present.
+ * Returns the defaultPerspective property or <code>null</code> if not present.
*/
- public String getDefaultPerpective() {
- return this.defaultPerpective;
+ public String getDefaultPerspective() {
+ return this.defaultPerspective;
}
/**
- * Sets the <code>defaultPerpective</code> property to this instance.
+ * Sets the <code>defaultPerspective</code> property to this instance.
*
- * @param defaultPerpective - the property
+ * @param defaultPerspective - the property
* @throws RuntimeException if instance is <code>disposed</code>
*
*/
- public void setDefaultPerpective(final String defaultPerpective) {
- firePropertyChange("defaultPerpective", this.defaultPerpective, this.defaultPerpective = defaultPerpective );
+ public void setDefaultPerspective(final String defaultPerspective) {
+ firePropertyChange("defaultPerspective", this.defaultPerspective, this.defaultPerspective = defaultPerspective );
}
/**
@@ -630,14 +652,16 @@
*/
public void internalAddToUserAccountFilter(final UserAccountFilterDto userAccountFilterDto) {
- if(!MappingContext.isMappingMode()) {
- // collections will become resolved! We need to send a delta notification.
- List<UserAccountFilterDto> oldList = new java.util.ArrayList<>(internalGetUserAccountFilter());
- internalGetUserAccountFilter().add(userAccountFilterDto);
- firePropertyChange("userAccountFilter", oldList, internalGetUserAccountFilter());
- } else {
- // in mapping mode, we do NOT resolve any collection
- internalGetUserAccountFilter().add(userAccountFilterDto);
+ if(!internalGetUserAccountFilter().contains(userAccountFilterDto)) {
+ if(!org.eclipse.osbp.dsl.dto.lib.MappingContext.isMappingMode()) {
+ // collections will become resolved! We need to send a delta notification.
+ List<UserAccountFilterDto> oldList = new java.util.ArrayList<>(internalGetUserAccountFilter());
+ internalGetUserAccountFilter().add(userAccountFilterDto);
+ firePropertyChange("userAccountFilter", oldList, internalGetUserAccountFilter());
+ } else {
+ // in mapping mode, we do NOT resolve any collection
+ internalGetUserAccountFilter().add(userAccountFilterDto);
+ }
}
}
@@ -645,7 +669,7 @@
* For internal use only!
*/
public void internalRemoveFromUserAccountFilter(final UserAccountFilterDto userAccountFilterDto) {
- if(!MappingContext.isMappingMode()) {
+ if(!org.eclipse.osbp.dsl.dto.lib.MappingContext.isMappingMode()) {
// collections will become resolved! We need to send a delta notification.
List<UserAccountFilterDto> oldList = new java.util.ArrayList<>(internalGetUserAccountFilter());
internalGetUserAccountFilter().remove(userAccountFilterDto);
@@ -682,8 +706,7 @@
}
}
- @Override
- public boolean equals(final Object obj) {
+ public boolean equalVersions(final Object obj) {
if (this == obj)
return true;
if (obj == null)
@@ -699,129 +722,6 @@
return true;
}
- @Override
- public int hashCode() {
- int prime = 31;
- int result = 1;
- result = prime * result + ((this.id== null) ? 0 : this.id.hashCode());
- return result;
- }
-
- public UserAccountDto createDto() {
- return new UserAccountDto();
- }
-
- public UserAccountDto copy(final MappingContext context) {
- checkDisposed();
-
- if (context == null) {
- throw new IllegalArgumentException("Context must not be null!");
- }
-
- if(context.isMaxLevel()){
- return null;
- }
-
- // if context contains a copied instance of this object
- // then return it
- UserAccountDto newDto = context.get(this);
- if(newDto != null){
- return newDto;
- }
-
- try{
- context.increaseLevel();
-
- newDto = createDto();
- context.register(this, newDto);
-
- // first copy the containments and attributes
- copyContainments(this, newDto, context);
-
- // then copy cross references to ensure proper
- // opposite references are copied too.
- copyCrossReferences(this, newDto, context);
- } finally {
- context.decreaseLevel();
- }
-
- return newDto;
- }
-
- public void copyContainments(final UserAccountDto dto, final UserAccountDto newDto, final MappingContext context) {
- checkDisposed();
-
- if (context == null) {
- throw new IllegalArgumentException("Context must not be null!");
- }
-
-
- // copy attributes and beans (beans if derived from entity model)
- // copy id
- newDto.setId(getId());
- // copy email
- newDto.setEmail(getEmail());
- // copy userName
- newDto.setUserName(getUserName());
- // copy password
- newDto.setPassword(getPassword());
- // copy extraPassword
- newDto.setExtraPassword(getExtraPassword());
- // copy passwordReset
- newDto.setPasswordReset(getPasswordReset());
- // copy position
- newDto.setPosition(getPosition());
- // copy defaultPerpective
- newDto.setDefaultPerpective(getDefaultPerpective());
- // copy enabled
- newDto.setEnabled(getEnabled());
- // copy locked
- newDto.setLocked(getLocked());
- // copy superuser
- newDto.setSuperuser(getSuperuser());
- // copy supervisor
- newDto.setSupervisor(getSupervisor());
- // copy forcePwdChange
- newDto.setForcePwdChange(getForcePwdChange());
- // copy notRegistered
- newDto.setNotRegistered(getNotRegistered());
- // copy failedAttempt
- newDto.setFailedAttempt(getFailedAttempt());
- // copy successfulAttempt
- newDto.setSuccessfulAttempt(getSuccessfulAttempt());
- // copy cookieHashCode
- newDto.setCookieHashCode(getCookieHashCode());
- // copy localeTag
- newDto.setLocaleTag(getLocaleTag());
- // copy profileimage
- newDto.setProfileimage(getProfileimage());
- // copy layoutingStrategy
- newDto.setLayoutingStrategy(getLayoutingStrategy());
- // copy focusingStrategy
- newDto.setFocusingStrategy(getFocusingStrategy());
- // copy theme
- newDto.setTheme(getTheme());
- // copy printService
- newDto.setPrintService(getPrintService());
-
- // copy containment references (cascading is true)
- }
-
- public void copyCrossReferences(final UserAccountDto dto, final UserAccountDto newDto, final org.eclipse.osbp.dsl.dto.lib.MappingContext context) {
- checkDisposed();
-
- if (context == null) {
- throw new IllegalArgumentException("Context must not be null!");
- }
-
-
- // copy cross references (cascading is false)
- // copy list of userAccountFilter dtos
- for(org.eclipse.osbp.authentication.account.dtos.UserAccountFilterDto _dto : getUserAccountFilter()) {
- newDto.addToUserAccountFilter(_dto.copy(context));
- }
- }
-
public void propertyChange(final java.beans.PropertyChangeEvent event) {
Object source = event.getSource();
diff --git a/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/dtos/UserAccountFilterDto.java b/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/dtos/UserAccountFilterDto.java
index 1e5a129..0162b37 100644
--- a/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/dtos/UserAccountFilterDto.java
+++ b/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/dtos/UserAccountFilterDto.java
@@ -5,9 +5,10 @@
import java.io.Serializable;
import org.eclipse.osbp.authentication.account.dtos.UserAccountDto;
import org.eclipse.osbp.dsl.common.datatypes.IDto;
-import org.eclipse.osbp.dsl.dto.lib.MappingContext;
+import org.eclipse.osbp.runtime.common.annotations.Dirty;
import org.eclipse.osbp.runtime.common.annotations.Dispose;
import org.eclipse.osbp.runtime.common.annotations.DomainReference;
+import org.eclipse.osbp.runtime.common.annotations.FilterDepth;
import org.eclipse.osbp.runtime.common.annotations.Id;
@SuppressWarnings("all")
@@ -17,6 +18,9 @@
@Dispose
private boolean disposed;
+ @Dirty
+ private transient boolean dirty;
+
@Id
private String id = java.util.UUID.randomUUID().toString();
@@ -25,6 +29,7 @@
private boolean invers;
@DomainReference
+ @FilterDepth(depth = 0)
private UserAccountDto userAccount;
public UserAccountFilterDto() {
@@ -85,6 +90,22 @@
}
/**
+ * @return true, if the object is dirty.
+ *
+ */
+ public boolean isDirty() {
+ return dirty;
+ }
+
+ /**
+ * Sets the dirty state of this object.
+ *
+ */
+ public void setDirty(final boolean dirty) {
+ firePropertyChange("dirty", this.dirty, this.dirty = dirty );
+ }
+
+ /**
* Checks whether the object is disposed.
* @throws RuntimeException if the object is disposed.
*/
@@ -202,8 +223,7 @@
firePropertyChange("userAccount", this.userAccount, this.userAccount = userAccount);
}
- @Override
- public boolean equals(final Object obj) {
+ public boolean equalVersions(final Object obj) {
if (this == obj)
return true;
if (obj == null)
@@ -219,89 +239,6 @@
return true;
}
- @Override
- public int hashCode() {
- int prime = 31;
- int result = 1;
- result = prime * result + ((this.id== null) ? 0 : this.id.hashCode());
- return result;
- }
-
- public UserAccountFilterDto createDto() {
- return new UserAccountFilterDto();
- }
-
- public UserAccountFilterDto copy(final MappingContext context) {
- checkDisposed();
-
- if (context == null) {
- throw new IllegalArgumentException("Context must not be null!");
- }
-
- if(context.isMaxLevel()){
- return null;
- }
-
- // if context contains a copied instance of this object
- // then return it
- UserAccountFilterDto newDto = context.get(this);
- if(newDto != null){
- return newDto;
- }
-
- try{
- context.increaseLevel();
-
- newDto = createDto();
- context.register(this, newDto);
-
- // first copy the containments and attributes
- copyContainments(this, newDto, context);
-
- // then copy cross references to ensure proper
- // opposite references are copied too.
- copyCrossReferences(this, newDto, context);
- } finally {
- context.decreaseLevel();
- }
-
- return newDto;
- }
-
- public void copyContainments(final UserAccountFilterDto dto, final UserAccountFilterDto newDto, final MappingContext context) {
- checkDisposed();
-
- if (context == null) {
- throw new IllegalArgumentException("Context must not be null!");
- }
-
-
- // copy attributes and beans (beans if derived from entity model)
- // copy id
- newDto.setId(getId());
- // copy filter
- newDto.setFilter(getFilter());
- // copy invers
- newDto.setInvers(getInvers());
-
- // copy containment references (cascading is true)
- }
-
- public void copyCrossReferences(final UserAccountFilterDto dto, final UserAccountFilterDto newDto, final org.eclipse.osbp.dsl.dto.lib.MappingContext context) {
- checkDisposed();
-
- if (context == null) {
- throw new IllegalArgumentException("Context must not be null!");
- }
-
-
- // copy cross references (cascading is false)
- // copy dto userAccount
- if(getUserAccount() != null) {
- newDto.setUserAccount(getUserAccount().copy(context));
- }
- }
-
public void propertyChange(final java.beans.PropertyChangeEvent event) {
Object source = event.getSource();
diff --git a/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/dtos/mapper/UserAccountDtoMapper.java b/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/dtos/mapper/UserAccountDtoMapper.java
index 7baf26f..abb6bbc 100644
--- a/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/dtos/mapper/UserAccountDtoMapper.java
+++ b/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/dtos/mapper/UserAccountDtoMapper.java
@@ -94,7 +94,7 @@
dto.setExtraPassword(toDto_extraPassword(entity, context));
dto.setPasswordReset(toDto_passwordReset(entity, context));
dto.setPosition(toDto_position(entity, context));
- dto.setDefaultPerpective(toDto_defaultPerpective(entity, context));
+ dto.setDefaultPerspective(toDto_defaultPerspective(entity, context));
dto.setEnabled(toDto_enabled(entity, context));
dto.setLocked(toDto_locked(entity, context));
dto.setSuperuser(toDto_superuser(entity, context));
@@ -135,7 +135,7 @@
entity.setExtraPassword(toEntity_extraPassword(dto, entity, context));
entity.setPasswordReset(toEntity_passwordReset(dto, entity, context));
entity.setPosition(toEntity_position(dto, entity, context));
- entity.setDefaultPerpective(toEntity_defaultPerpective(dto, entity, context));
+ entity.setDefaultPerspective(toEntity_defaultPerspective(dto, entity, context));
entity.setEnabled(toEntity_enabled(dto, entity, context));
entity.setLocked(toEntity_locked(dto, entity, context));
entity.setSuperuser(toEntity_superuser(dto, entity, context));
@@ -330,19 +330,19 @@
}
/**
- * Maps the property defaultPerpective from the given entity to dto property.
+ * Maps the property defaultPerspective from the given entity to dto property.
*
* @param in - The source entity
* @param context - The context to get information about depth,...
* @return the mapped value
*
*/
- protected String toDto_defaultPerpective(final UserAccount in, final MappingContext context) {
- return in.getDefaultPerpective();
+ protected String toDto_defaultPerspective(final UserAccount in, final MappingContext context) {
+ return in.getDefaultPerspective();
}
/**
- * Maps the property defaultPerpective from the given entity to dto property.
+ * Maps the property defaultPerspective from the given entity to dto property.
*
* @param in - The source entity
* @param parentEntity - The parentEntity
@@ -350,8 +350,8 @@
* @return the mapped value
*
*/
- protected String toEntity_defaultPerpective(final UserAccountDto in, final UserAccount parentEntity, final MappingContext context) {
- return in.getDefaultPerpective();
+ protected String toEntity_defaultPerspective(final UserAccountDto in, final UserAccount parentEntity, final MappingContext context) {
+ return in.getDefaultPerspective();
}
/**
diff --git a/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/dtos/mapper/UserAccountFilterDtoMapper.java b/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/dtos/mapper/UserAccountFilterDtoMapper.java
index 9e96dcc..3d9655a 100644
--- a/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/dtos/mapper/UserAccountFilterDtoMapper.java
+++ b/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/dtos/mapper/UserAccountFilterDtoMapper.java
@@ -248,7 +248,7 @@
entity = (UserAccount) context
.findEntityByEntityManager(UserAccount.class, in.getUserAccount().getId());
if (entity != null) {
- context.register(mapper.createEntityHash(entity), entity);
+ context.register(mapper.createEntityHash(in.getUserAccount()), entity);
return entity;
}
}
diff --git a/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/entities/UserAccount.java b/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/entities/UserAccount.java
index 88d3acb..74d163a 100644
--- a/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/entities/UserAccount.java
+++ b/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/entities/UserAccount.java
@@ -1,14 +1,3 @@
-/**
- * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
- */
package org.eclipse.osbp.authentication.account.entities;
import java.util.ArrayList;
@@ -18,9 +7,11 @@
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Id;
+import javax.persistence.Index;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.PreRemove;
+import javax.persistence.PreUpdate;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.Pattern;
@@ -29,11 +20,11 @@
import org.eclipse.osbp.runtime.common.annotations.Dispose;
import org.eclipse.osbp.runtime.common.annotations.Properties;
import org.eclipse.osbp.runtime.common.annotations.Property;
-import org.eclipse.osbp.runtime.jsr303.validation.common.InfoSeverity;
+import org.eclipse.osbp.runtime.jsr303.validation.common.ErrorSeverity;
import org.eclipse.persistence.annotations.Noncacheable;
@Entity
-@Table(name = "USER_ACCOUNT")
+@Table(name = "USER_ACCOUNT", indexes = @Index(name = "INDEX_USER_NAME", unique = true, columnList = "USER_NAME"))
@DiscriminatorValue(value = "USER_ACCOUNT")
@SuppressWarnings("all")
public class UserAccount implements IEntity {
@@ -47,14 +38,14 @@
@Column(name = "EMAIL")
private String email;
- @Column(name = "USER_NAME")
+ @Column(name = "USER_NAME", nullable = false)
private String userName;
@Column(name = "PASSWORD")
private String password;
@Column(name = "EXTRA_PASSWORD")
- @Pattern(regexp = "[0-9]*", payload = InfoSeverity.class)
+ @Pattern(regexp = "[0-9]*", payload = ErrorSeverity.class)
private String extraPassword;
@Column(name = "PASSWORD_RESET")
@@ -64,9 +55,9 @@
@Properties(properties = @Property(key = "organization", value = ""))
private String position;
- @Column(name = "DEFAULT_PERPECTIVE")
+ @Column(name = "DEFAULT_PERSPECTIVE")
@Properties(properties = @Property(key = "perspective", value = ""))
- private String defaultPerpective;
+ private String defaultPerspective;
@Column(name = "ENABLED")
private boolean enabled;
@@ -109,6 +100,7 @@
private String focusingStrategy;
@Column(name = "THEME")
+ @Properties(properties = @Property(key = "theme", value = ""))
private String theme;
@Column(name = "PRINT_SERVICE")
@@ -188,7 +180,7 @@
}
/**
- * @return Returns the userName property or <code>null</code> if not present.
+ * @return Returns the <em>required</em> userName property.
*/
public String getUserName() {
checkDisposed();
@@ -268,19 +260,19 @@
}
/**
- * @return Returns the defaultPerpective property or <code>null</code> if not present.
+ * @return Returns the defaultPerspective property or <code>null</code> if not present.
*/
- public String getDefaultPerpective() {
+ public String getDefaultPerspective() {
checkDisposed();
- return this.defaultPerpective;
+ return this.defaultPerspective;
}
/**
- * Sets the defaultPerpective property to this instance.
+ * Sets the defaultPerspective property to this instance.
*/
- public void setDefaultPerpective(final String defaultPerpective) {
+ public void setDefaultPerspective(final String defaultPerspective) {
checkDisposed();
- this.defaultPerpective = defaultPerpective;
+ this.defaultPerspective = defaultPerspective;
}
/**
@@ -583,7 +575,13 @@
* For internal use only!
*/
public void internalAddToUserAccountFilter(final UserAccountFilter userAccountFilter) {
- internalGetUserAccountFilter().add(userAccountFilter);
+ if(userAccountFilter == null) {
+ return;
+ }
+
+ if(!internalGetUserAccountFilter().contains(userAccountFilter)) {
+ internalGetUserAccountFilter().add(userAccountFilter);
+ }
}
/**
@@ -593,8 +591,15 @@
internalGetUserAccountFilter().remove(userAccountFilter);
}
- @Override
- public boolean equals(final Object obj) {
+ @PreUpdate
+ public void preUpdate() {
+ if ((this.locked && (!this.enabled))) {
+ this.locked = false;
+ this.failedAttempt = 00;
+ }
+ }
+
+ public boolean equalVersions(final Object obj) {
if (this == obj)
return true;
if (obj == null)
@@ -611,6 +616,11 @@
}
@Override
+ public boolean equals(final Object obj) {
+ return equalVersions(obj);
+ }
+
+ @Override
public int hashCode() {
int prime = 31;
int result = 1;
diff --git a/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/entities/UserAccountFilter.java b/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/entities/UserAccountFilter.java
index c9d3365..bfa5fbc 100644
--- a/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/entities/UserAccountFilter.java
+++ b/org.eclipse.osbp.authentication/src-gen/org/eclipse/osbp/authentication/account/entities/UserAccountFilter.java
@@ -1,14 +1,3 @@
-/**
- * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
- */
package org.eclipse.osbp.authentication.account.entities;
import javax.persistence.Column;
@@ -150,15 +139,21 @@
if (this.userAccount != null) {
this.userAccount.internalRemoveFromUserAccountFilter(this);
}
- this.userAccount = userAccount;
+ internalSetUserAccount(userAccount);
if (this.userAccount != null) {
this.userAccount.internalAddToUserAccountFilter(this);
}
}
- @Override
- public boolean equals(final Object obj) {
+ /**
+ * For internal use only!
+ */
+ public void internalSetUserAccount(final UserAccount userAccount) {
+ this.userAccount = userAccount;
+ }
+
+ public boolean equalVersions(final Object obj) {
if (this == obj)
return true;
if (obj == null)
@@ -175,6 +170,11 @@
}
@Override
+ public boolean equals(final Object obj) {
+ return equalVersions(obj);
+ }
+
+ @Override
public int hashCode() {
int prime = 31;
int result = 1;
diff --git a/org.eclipse.osbp.authentication/src/account.datatype b/org.eclipse.osbp.authentication/src/account.datatype
index 39be23c..73daa5c 100644
--- a/org.eclipse.osbp.authentication/src/account.datatype
+++ b/org.eclipse.osbp.authentication/src/account.datatype
@@ -1,28 +1,42 @@
+/**
+ *
+ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
+ *
+ */
+
package org.eclipse.osbp.authentication.account.datatypes {
- datatype boolean jvmType java.lang.Boolean as primitive;
- datatype short jvmType java.lang.Short as primitive;
- datatype int jvmType java.lang.Integer as primitive;
- datatype long jvmType java.lang.Long as primitive;
- datatype double jvmType java.lang.Double as primitive;
- datatype float jvmType java.lang.Float as primitive;
- datatype character jvmType java.lang.Character as primitive;
- datatype byte jvmType java.lang.Byte as primitive;
+ datatype boolean jvmType java.lang.Boolean asPrimitive
+ datatype short jvmType java.lang.Short asPrimitive
+ datatype int jvmType java.lang.Integer asPrimitive
+ datatype long jvmType java.lang.Long asPrimitive
+ datatype double jvmType java.lang.Double asPrimitive
+ datatype float jvmType java.lang.Float asPrimitive
+ datatype character jvmType java.lang.Character asPrimitive
+ datatype byte jvmType java.lang.Byte asPrimitive
- datatype Boolean jvmType java.lang.Boolean;
- datatype Short jvmType java.lang.Short;
- datatype Int jvmType java.lang.Integer;
- datatype Long jvmType java.lang.Long;
- datatype Double jvmType java.lang.Double;
- datatype Float jvmType java.lang.Float;
- datatype Character jvmType java.lang.Character;
- datatype Byte jvmType java.lang.Byte;
- datatype BigDecimal jvmType java.math.BigDecimal;
+ datatype Boolean jvmType java.lang.Boolean
+ datatype Short jvmType java.lang.Short
+ datatype Int jvmType java.lang.Integer
+ datatype Long jvmType java.lang.Long
+ datatype Double jvmType java.lang.Double
+ datatype Float jvmType java.lang.Float
+ datatype Character jvmType java.lang.Character
+ datatype Byte jvmType java.lang.Byte
+ datatype BigDecimal jvmType java.math.BigDecimal
- datatype String jvmType java.lang.String;
- datatype BlobImage jvmType java.lang.String properties (key="Blob" value="2");
- datatype Date dateType date;
- datatype datetype dateType date;
- datatype timetype dateType time;
- datatype blobtype as blob;
-}
\ No newline at end of file
+ datatype String jvmType java.lang.String
+ datatype BlobImage jvmType java.lang.String properties (key="Blob" value="2")
+ datatype Date dateType date
+ datatype datetype dateType date
+ datatype timetype dateType time
+ datatype blobtype asBlob
+}
\ No newline at end of file
diff --git a/org.eclipse.osbp.authentication/src/account.dto b/org.eclipse.osbp.authentication/src/account.dto
index c65191d..615471d 100644
--- a/org.eclipse.osbp.authentication/src/account.dto
+++ b/org.eclipse.osbp.authentication/src/account.dto
@@ -1,40 +1,56 @@
+/**
+ *
+ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
+ *
+ */
+
+import ns org.eclipse.osbp.authentication.account.entities.UserAccount
+import ns org.eclipse.osbp.authentication.account.entities.UserAccountFilter
package org.eclipse.osbp.authentication.account.dtos {
- import org.eclipse.osbp.authentication.account.entities.*;
+
autoDto UserAccountDto wraps UserAccount {
- inherit var id
- inherit var email
- inherit var userName
- inherit var password
- inherit var extraPassword
- inherit var passwordReset
- inherit var position
- inherit var defaultPerpective
- inherit var enabled
- inherit var locked
- inherit var superuser
- inherit var supervisor
- inherit var forcePwdChange
- inherit var notRegistered
- inherit var failedAttempt
- inherit var successfulAttempt
- inherit var cookieHashCode
- inherit var localeTag
- inherit var profileimage
- inherit var layoutingStrategy
- inherit var focusingStrategy
- inherit var theme
- inherit var printService
- inherit ref userAccountFilter mapto UserAccountFilterDto
+ inheritVar id
+ inheritVar email
+ inheritVar userName
+ inheritVar password
+ inheritVar extraPassword
+ inheritVar passwordReset
+ inheritVar position
+ inheritVar defaultPerspective
+ inheritVar enabled
+ inheritVar locked
+ inheritVar superuser
+ inheritVar supervisor
+ inheritVar forcePwdChange
+ inheritVar notRegistered
+ inheritVar failedAttempt
+ inheritVar
+ successfulAttempt
+ inheritVar cookieHashCode
+ inheritVar localeTag
+ inheritVar profileimage
+ inheritVar layoutingStrategy
+ inheritVar focusingStrategy
+ inheritVar theme
+ inheritVar printService
+ inheritRef userAccountFilter mapto UserAccountFilterDto
}
autoDto UserAccountFilterDto wraps UserAccountFilter {
- inherit var id
- inherit var filter
- inherit var invers
- inherit ref userAccount mapto UserAccountDto
+ inheritVar id
+ inheritVar ^filter
+ inheritVar invers
+ inheritRef userAccount mapto UserAccountDto
}
-
}
\ No newline at end of file
diff --git a/org.eclipse.osbp.authentication/src/account.entity b/org.eclipse.osbp.authentication/src/account.entity
index 259d82b..b19dd03 100644
--- a/org.eclipse.osbp.authentication/src/account.entity
+++ b/org.eclipse.osbp.authentication/src/account.entity
@@ -11,42 +11,60 @@
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
*
*/
+
+import javax.persistence.PreUpdate
+import ns org.eclipse.osbp.authentication.account.datatypes.BlobImage
+import ns org.eclipse.osbp.authentication.account.datatypes.String
+import ns org.eclipse.osbp.authentication.account.datatypes.boolean
+import ns org.eclipse.osbp.authentication.account.datatypes.int
+import ns org.eclipse.osbp.authentication.account.datatypes.Boolean
+
package org.eclipse.osbp.authentication.account.entities {
- import org.eclipse.osbp.authentication.account.datatypes.*;
entity UserAccount {
- persistenceUnit "authentication";
- uuid String id;
- var String email;
- var String userName;
- var String password;
- var String [regex("[0-9]*")] extraPassword;
- var boolean passwordReset;
- var String position properties (key="organization" value="");
- var String defaultPerpective properties (key="perspective" value="");
- var boolean enabled;
- var boolean locked;
- var boolean superuser;
- var boolean supervisor;
- var boolean forcePwdChange;
- var boolean notRegistered;
- var int failedAttempt;
- var int successfulAttempt;
- var int cookieHashCode;
- var String localeTag;
- var BlobImage profileimage;
- var String layoutingStrategy;
- var String focusingStrategy;
- var String theme;
- var String printService;
- ref UserAccountFilter [*] userAccountFilter opposite userAccount;
+ persistenceUnit "authentication"
+ uuid String id
+ var String email
+ var String[1] userName
+ var String password
+ var String [ regex("[0-9]*") ] extraPassword
+ var boolean passwordReset
+ var String position properties(key = "organization" value = "")
+ var String defaultPerspective properties(key = "perspective" value = "")
+ var boolean enabled
+ var boolean locked
+ var boolean superuser
+ var boolean supervisor
+ var boolean forcePwdChange
+ var boolean notRegistered
+ var int failedAttempt
+ var int successfulAttempt
+ var int cookieHashCode
+ var String localeTag
+ var BlobImage profileimage
+ var String layoutingStrategy
+ var String focusingStrategy
+ var String theme properties(key = "theme" value = "")
+ var String printService
+ ref UserAccountFilter [*] userAccountFilter opposite userAccount
+ @PreUpdate
+ def void preUpdate() {
+ if ( locked && ! enabled )
+ {
+ locked = false
+ failedAttempt = 00
+ }
+ }
+ unique index indexUserName {
+ userName
+ }
}
-
+
entity UserAccountFilter {
- persistenceUnit "authentication";
- uuid String id;
- var String filter;
- var boolean invers;
- ref UserAccount userAccount opposite userAccountFilter;
+ persistenceUnit "authentication"
+ uuid String id
+ var String ^filter
+ var boolean invers
+ ref UserAccount userAccount opposite userAccountFilter
}
-}
+}
\ No newline at end of file
diff --git a/org.eclipse.osbp.authentication/src/account.service b/org.eclipse.osbp.authentication/src/account.service
index a1e8c63..9b8fb8e 100644
--- a/org.eclipse.osbp.authentication/src/account.service
+++ b/org.eclipse.osbp.authentication/src/account.service
@@ -1,13 +1,24 @@
+/**
+ *
+ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
+ *
+ */
+import ns org.eclipse.osbp.authentication.account.dtos.UserAccountDto
+import ns org.eclipse.osbp.authentication.account.dtos.UserAccountFilterDto package org.eclipse.osbp.authentication.account.dtos.service {
-package org.eclipse.osbp.authentication.account.dtos.services {
- import org.eclipse.osbp.authentication.account.dtos.*;
-}
-package org.eclipse.osbp.authentication.account.dtos.service {
- import org.eclipse.osbp.authentication.account.dtos.*;
dtoservice UserAccountDtoService provides UserAccountDto {
- mutable persistenceUnit authentication;
+ mutable persistenceUnit authentication
}
+
dtoservice UserAccountFilterDtoService provides UserAccountFilterDto {
- mutable persistenceUnit authentication;
+ mutable persistenceUnit authentication
}
}
\ No newline at end of file
diff --git a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/ServiceListener.java b/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/ServiceListener.java
deleted file mode 100644
index bc8db50..0000000
--- a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/ServiceListener.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/**
- *
- * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
- */
-package org.eclipse.osbp.authentication;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.osbp.ui.api.complexdatacontainer.IComplexDataContainer;
-import org.eclipse.osbp.ui.api.complexdatacontainer.IComplexDataContainerChangedListener;
-import org.eclipse.osbp.ui.api.useraccess.IOrganizationService;
-import org.osgi.service.component.annotations.Component;
-import org.osgi.service.component.annotations.Reference;
-import org.osgi.service.component.annotations.ReferenceCardinality;
-import org.osgi.service.component.annotations.ReferencePolicy;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-// TODO: Auto-generated Javadoc
-/**
- * The listener interface for receiving service events. The class that is
- * interested in processing a service event implements this interface, and the
- * object created with that class is registered with a component using the
- * component's <code>addServiceListener</code> method. When the service event
- * occurs, that object's appropriate method is invoked.
- *
- */
-// TODO: check reference
-/*
- * reference not found
- *
- * @see ServiceEvent
- */
-@Component
-public class ServiceListener {
-
- /** The Constant LOGGER. */
- private static final Logger LOGGER = LoggerFactory.getLogger(ServiceListener.class);
-
- /** The Constant sOrganizationServices. */
- public static final Map<String, IOrganizationService> sOrganizationServices = new HashMap<String, IOrganizationService>();
-
- /** The listeners which are listening for changed complex data changes. */
- public static final Set<IComplexDataContainerChangedListener> complexDataContainerChangedListeners = new HashSet<IComplexDataContainerChangedListener>();
-
- /**
- * Gets the organization services.
- *
- * @return the organization services
- */
- public static Set<IOrganizationService> getOrganizationServices() {
- return new HashSet<IOrganizationService>(sOrganizationServices.values());
- }
-
- /**
- * Bind organization service.
- *
- * @param organization
- * the organization
- */
- @Reference(cardinality = ReferenceCardinality.OPTIONAL, policy = ReferencePolicy.DYNAMIC)
- public void bindOrganizationService(IOrganizationService organization) {
- LOGGER.debug(ServiceListener.class.getCanonicalName() + ": " + organization.getClass().getCanonicalName() + " bound");
- sOrganizationServices.put(organization.getClass().getCanonicalName(), organization);
- triggerComplexDataContainerChangedListeners();
- }
-
- /**
- * Unbind organization service.
- *
- * @param organization
- * the organization
- */
- public void unbindOrganizationService(IOrganizationService organization) {
- LOGGER.debug(ServiceListener.class.getCanonicalName() + ": " + organization.getClass().getCanonicalName() + " unbound");
- sOrganizationServices.remove(organization.getClass().getCanonicalName());
- triggerComplexDataContainerChangedListeners();
- }
-
- public static void addComplexDataContainerChangedListener(IComplexDataContainerChangedListener listener) {
- complexDataContainerChangedListeners.add(listener);
- }
-
- public static void removeComplexDataContainerChangedListener(IComplexDataContainerChangedListener listener) {
- complexDataContainerChangedListeners.remove(listener);
- }
-
- public static void triggerComplexDataContainerChangedListeners() {
- for (IComplexDataContainerChangedListener listener : complexDataContainerChangedListeners) {
- listener.complexDataContainerChanged();
- }
- }
-}
diff --git a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/providerimpl/AuthorizationInformation.java b/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/providerimpl/AuthorizationInformation.java
index 601f279..5c595ba 100644
--- a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/providerimpl/AuthorizationInformation.java
+++ b/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/providerimpl/AuthorizationInformation.java
@@ -12,13 +12,12 @@
*/
package org.eclipse.osbp.authentication.providerimpl;
-import java.util.Collection;
import java.util.HashSet;
import org.apache.shiro.authz.SimpleAuthorizationInfo;
import org.apache.shiro.subject.PrincipalCollection;
+import org.eclipse.osbp.ui.api.useraccess.AbstractAuthorization;
import org.eclipse.osbp.ui.api.useraccess.AbstractPosition;
-import org.eclipse.osbp.ui.api.useraccess.IPermissionList;
/**
* The Class AuthorizationInformation holds metadata of the authenticated subject.
@@ -29,7 +28,7 @@
private static final long serialVersionUID = 8654353182167477248L;
/** The position. */
- private final AbstractPosition fPosition;
+ private final transient AbstractPosition fPosition;
/** The portal id. */
private final String fPortalId;
@@ -46,21 +45,13 @@
* @param roles the roles
* @param permissions the permissions
*/
- public AuthorizationInformation(String portalId, PrincipalCollection principals, AbstractPosition position, Collection<String> roles, IPermissionList permissions) {
+ public AuthorizationInformation(String portalId, PrincipalCollection principals, AbstractPosition position, AbstractAuthorization authorization) {
super();
fPortalId = portalId;
fPrincipal = principals;
fPosition = position;
if(roles != null) {
- super.setRoles(new HashSet<String>(roles));
- }
- if (permissions != null) {
- for (String permission : permissions.getPermissions()) {
- while (permission.endsWith(":*")) {
- permission = permission.substring(0, permission.length()-2);
- }
- super.addStringPermission(permission);
- }
+ super.setRoles(new HashSet<>(authorization.getRoles()));
}
}
diff --git a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/providerimpl/UserAccessService.java b/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/providerimpl/UserAccessService.java
index fed01ba..a2e8940 100644
--- a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/providerimpl/UserAccessService.java
+++ b/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/providerimpl/UserAccessService.java
@@ -14,24 +14,25 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException;
+import org.apache.shiro.authc.credential.DefaultPasswordService;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.config.Ini;
import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.realm.AuthenticatingRealm;
import org.apache.shiro.subject.Subject;
-import org.apache.shiro.util.Factory;
import org.apache.shiro.util.ThreadContext;
import org.apache.shiro.web.config.WebIniSecurityManagerFactory;
import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
-import org.eclipse.osbp.authentication.ServiceListener;
import org.eclipse.osbp.authentication.account.dtos.UserAccountDto;
import org.eclipse.osbp.authentication.account.dtos.UserAccountFilterDto;
import org.eclipse.osbp.authentication.shiro.extensions.StaticRealm;
@@ -40,50 +41,41 @@
import org.eclipse.osbp.authentication.vaadin.SubjectProvider;
import org.eclipse.osbp.authentication.vaadin.VaadinSessionManager;
import org.eclipse.osbp.authentication.vaadin.VaadinSessionProvider;
-import org.eclipse.osbp.dsl.dto.lib.services.Query;
+import org.eclipse.osbp.core.api.persistence.IPersistenceService;
+import org.eclipse.osbp.dsl.dto.lib.impl.DtoServiceAccess;
+import org.eclipse.osbp.jpa.services.Query;
import org.eclipse.osbp.preferences.ProductConfiguration;
+import org.eclipse.osbp.runtime.common.filter.IDTOServiceWithMutablePersistence;
import org.eclipse.osbp.ui.api.complexdatacontainer.IComplexDataContainerChangedListener;
-import org.eclipse.osbp.ui.api.useraccess.AbstractAuthorization.Permission;
-import org.eclipse.osbp.ui.api.useraccess.AbstractAuthorization.PermissionResult;
+import org.eclipse.osbp.ui.api.useraccess.AbstractAuthorization;
+import org.eclipse.osbp.ui.api.useraccess.AbstractAuthorization.Action;
+import org.eclipse.osbp.ui.api.useraccess.AbstractAuthorization.Group;
import org.eclipse.osbp.ui.api.useraccess.AbstractPosition;
import org.eclipse.osbp.ui.api.useraccess.IOrganizationService;
-import org.eclipse.osbp.ui.api.useraccess.IPermissionList;
import org.eclipse.osbp.ui.api.useraccess.IPosition;
import org.eclipse.osbp.ui.api.useraccess.ISubOrganization;
import org.eclipse.osbp.ui.api.useraccess.IUserAccessService;
import org.eclipse.osbp.ui.api.userfilter.UserFilterMap;
import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.component.annotations.ReferenceCardinality;
+import org.osgi.service.component.annotations.ReferencePolicy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.vaadin.server.Page;
-// TODO: Auto-generated Javadoc
/**
* The Class UserAccessService.
*/
-@Component(service = IUserAccessService.class, immediate = true)
-public class UserAccessService extends UserProtocol implements
- IUserAccessService {
+@Component(service = IUserAccessService.class)
+public class UserAccessService extends UserProtocol implements IUserAccessService {
/** The Constant LOGGER. */
- private static final Logger LOGGER = LoggerFactory
- .getLogger(UserAccessService.class);
-
- /** The s factory. */
- private static Factory<SecurityManager> sFactory;
-
- /** The s security manager. */
- private static SecurityManager sSecurityManager;
-
- /** The vaadin session provider. */
- private static VaadinSessionProvider vaadinSessionProvider;
-
- /** The vaadin session manager. */
- private static VaadinSessionManager vaadinSessionManager;
+ private static final Logger LOGGER = LoggerFactory.getLogger(UserAccessService.class);
/** The subject provider. */
- private static SubjectProvider subjectProvider;
+ private SubjectProvider subjectProvider;
/** The Constant USER_KEY. */
private static final String USER_KEY = "user";
@@ -98,14 +90,30 @@
private static final String ROLES_KEY = "roles";
/** The Constant PERMISSIONS_KEY. */
- private static final String PERMISSIONS_KEY = "permissions";
+ private static final String AUTHORIZATION_KEY = "authorization";
/** The Constant AUTHENTICATED_BY_REALM. */
private static final String AUTHENTICATED_BY_REALM = "realm";
- /** The Constant AUTHORIZATION_KEY. */
- private static final String AUTHORIZATION_KEY = ThreadContext.class
- .getName() + "_AUTHORIZATION_KEY";
+ /** The Constant USER_DEFAULT_PERSPECTIVE. */
+ private static final String USER_DEFAULT_PERSPECTIVE = "defaultPerspective";
+
+
+ /** The Constant sOrganizationServices. */
+ protected static final Map<String, IOrganizationService> sOrganizationServices = new HashMap<>();
+
+ /** The listeners which are listening for changed complex data changes. */
+ protected static final Set<IComplexDataContainerChangedListener> complexDataContainerChangedListeners = new HashSet<>();
+
+ /**
+ * Gets the organization services.
+ *
+ * @return the organization services
+ */
+ public static Set<IOrganizationService> getOrganizationServices() {
+ return new HashSet<>(sOrganizationServices.values());
+ }
+
/**
* Instantiates a new user access service.
@@ -114,36 +122,36 @@
super();
}
- static {
+ protected void activate() {
// We use a factory that can injects a .ini file and
// returns a SecurityManager instance
Ini ini = new Ini();
- ini.load(ProductConfiguration.getShiroConfiguration(StaticRealm.class
- .getCanonicalName()));
- sFactory = new WebIniSecurityManagerFactory(ini);
+ ini.load(ProductConfiguration.getShiroConfiguration(StaticRealm.class.getCanonicalName()));
+ WebIniSecurityManagerFactory sFactory = new WebIniSecurityManagerFactory(ini);
// the following line works with reflection and looks for shiro in the
// current bundle. no osgi possible in this version.
- sSecurityManager = sFactory.getInstance();
- vaadinSessionProvider = new VaadinSessionProvider();
- vaadinSessionManager = new VaadinSessionManager(vaadinSessionProvider);
+ SecurityManager sSecurityManager = sFactory.getInstance();
+ VaadinSessionProvider vaadinSessionProvider = new VaadinSessionProvider();
+ VaadinSessionManager vaadinSessionManager = new VaadinSessionManager(vaadinSessionProvider);
// the vaadin session embeds the shiro subject
- ((DefaultWebSecurityManager) sSecurityManager)
- .setSessionManager(vaadinSessionManager);
+ ((DefaultWebSecurityManager) sSecurityManager).setSessionManager(vaadinSessionManager);
subjectProvider = new SubjectProvider(vaadinSessionProvider);
SecurityUtils.setSecurityManager(sSecurityManager);
LOGGER.debug("security manager is set");
+ UserProtocol.persistenceService.registerPersistenceUnit(persistenceId, UserProtocol.class);
+ if (UserProtocol.dtoUserAccountDtoService == null) {
+ UserProtocol.dtoUserAccountDtoService = (IDTOServiceWithMutablePersistence<UserAccountDto>) DtoServiceAccess
+ .getService(UserAccountDto.class);
+ }
+ // for password encryption
+ if (UserProtocol.passwordService == null) {
+ UserProtocol.passwordService = new DefaultPasswordService();
+ }
+
}
- @Override
- public void addComplexDataContainerChangedListener(
- IComplexDataContainerChangedListener listener) {
- ServiceListener.addComplexDataContainerChangedListener(listener);
- }
-
- @Override
- public void removeComplexDataContainerChangedListener(
- IComplexDataContainerChangedListener listener) {
- ServiceListener.removeComplexDataContainerChangedListener(listener);
+ protected void deactivate() {
+ LOGGER.debug("useraccessservice deactivated");
}
/*
@@ -160,17 +168,18 @@
try {
info = (AuthorizationInfo) ThreadContext.get(AUTHORIZATION_KEY);
} catch (Exception e) {
- } // NOP // NOSONAR
+ LOGGER.info("");
+ }
try {
- realm = (AuthenticatingRealm) ThreadContext
- .get(AUTHENTICATED_BY_REALM);
+ realm = (AuthenticatingRealm) ThreadContext.get(AUTHENTICATED_BY_REALM);
} catch (Exception e) {
- } // NOP // NOSONAR
+ LOGGER.info("");
+ }
if (info == null) {
info = new AuthorizationInformation(
- (realm instanceof UserAccessAuthorizationRealm) ? ((UserAccessAuthorizationRealm) realm).getPortalId()
- : "", subjectProvider.get().getPrincipals(),
- getPosition(), getRoles(), getPermissions());
+ (realm instanceof UserAccessAuthorizationRealm)
+ ? ((UserAccessAuthorizationRealm) realm).getPortalId() : "",
+ subjectProvider.get().getPrincipals(), getPosition(), getAuthorization());
ThreadContext.put(AUTHORIZATION_KEY, info);
}
}
@@ -198,8 +207,7 @@
@Override
public boolean authenticate(String portal, String username, String password) {
PortalUsernamePasswordToken token = new PortalUsernamePasswordToken(
- Page.getCurrent().getWebBrowser().getAddress(), portal,
- username, password);
+ Page.getCurrent().getWebBrowser().getAddress(), portal, username, password);
token.setRememberMe(false);
token.setUserProtocol(this);
AuthenticatingRealm realm = null;
@@ -212,43 +220,43 @@
AbstractPosition position = null;
String defaultPerspective = null;
Collection<String> roles = null;
- IPermissionList permissions = null;
+ AbstractAuthorization authorization = null;
if (realm instanceof UserAccessAuthorizationRealm) {
- user = ((UserAccessAuthorizationRealm) realm)
- .findUserAccount(username);
+ user = ((UserAccessAuthorizationRealm) realm).findUserAccount(username);
userFilterMap = createFilterMap(user);
- position = ((UserAccessAuthorizationRealm) realm)
- .findPositionForUser(username);
- defaultPerspective = user.getDefaultPerpective();
- permissions = ((UserAccessAuthorizationRealm) realm)
- .findPermissionsForUser(username);
+ position = ((UserAccessAuthorizationRealm) realm).findPositionForUser(username);
+ defaultPerspective = user.getDefaultPerspective();
+ authorization = ((UserAccessAuthorizationRealm) realm).findPermissionsForUser(username);
}
if (position != null) {
roles = position.getRoles();
}
- setSessionAttribute(AUTHENTICATED_BY_REALM,
- token.getAuthenticatedByRealm());
+ setSessionAttribute(AUTHENTICATED_BY_REALM, token.getAuthenticatedByRealm());
setSessionAttribute(USER_KEY, user);
setSessionAttribute(USER_FILTER_MAP_KEY, userFilterMap);
setSessionAttribute(POSITION_KEY, position);
setSessionAttribute(ROLES_KEY, roles);
- setSessionAttribute(PERMISSIONS_KEY, permissions);
+ setSessionAttribute(AUTHORIZATION_KEY, authorization);
+ setSessionAttribute(USER_DEFAULT_PERSPECTIVE, defaultPerspective);
- LOGGER.debug(subjectProvider.get().getSession().getAttributeKeys()
- .toString());
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug(subjectProvider.get().getSession().getAttributeKeys().toString());
+ }
trackSuccessfulLoginAttempt(username);
- // if(isPermitted(Permission.forEntityProperty("Memployee",
- // "first_name", Action.noneditable)).isPermitted()) {
- // LOGGER.debug("mEmployee.first_name is non-editable");
- // } else {
- // LOGGER.debug("mEmployee.first_name is editable");
- // }
- // if (isPermitted(Permission.forBpm("ProductMaintenance",
- // Action.executable)).isPermitted()) {
- // LOGGER.debug("ProductMaintenance can be executed");
- // } else {
- // LOGGER.debug("ProductMaintenance cannot be executed");
- // }
+ if (LOGGER.isDebugEnabled()) {
+ if (isGranted(Group.ENTITY, Action.CREATABLE,
+ "org.eclipse.osbp.authentication.account.entities.UserAccount")) {
+ LOGGER.debug("UserAccount is creatable");
+ } else {
+ LOGGER.debug("UserAccount is not creatable");
+ }
+ if (isVetoed(Group.ENTITY, Action.DISABLED,
+ "org.eclipse.osbp.authentication.account.entities.UserAccount", "superuser")) {
+ LOGGER.debug("superuser from UserAccount is disabled");
+ } else {
+ LOGGER.debug("superuser from UserAccount is not disabled");
+ }
+ }
return true;
} catch (AuthenticationException ae) { // NOSONAR
// captcha
@@ -257,11 +265,17 @@
lockAccount(username, true);
}
try {
+ // NOSONAR
// wait exponentially along failed logins up to a maximum of
// 18,2 hours to prevent "Rapid-Fire Login Attempts"
// http://stackoverflow.com/questions/549/the-definitive-guide-to-form-based-website-authentication
- Thread.sleep((long) (1000.0 * Math.pow(2, Math.min(cnt, 16))));
+
+ Long sleepLong = (long) (1000.0 * Math.max(5, Math.pow(2, Math.min(cnt, 16))));
+ Long sleepLongSecs = sleepLong / 1000;
+ LOGGER.info("User '{}' is locked for {} seconds now ... pls. wait", username, sleepLongSecs.toString());
+ Thread.sleep(sleepLong);
} catch (InterruptedException e) { // NOSONAR
+ // Empty by design
}
LOGGER.error("Authentication: " + ae.getLocalizedMessage());
}
@@ -329,13 +343,15 @@
setSessionAttribute(USER_KEY, null);
setSessionAttribute(POSITION_KEY, null);
setSessionAttribute(ROLES_KEY, null);
- setSessionAttribute(PERMISSIONS_KEY, null);
+ setSessionAttribute(AUTHORIZATION_KEY, null);
} catch (Exception e) {
- } // NOSONAR
+ LOGGER.info("");
+ }
try {
subject.logout();
} catch (Exception e) {
- } // NOSONAR
+ LOGGER.info("");
+ }
}
/*
@@ -355,6 +371,20 @@
/*
* (non-Javadoc)
*
+ * @see org.eclipse.osbp.ui.api.useraccess.IUserAccessService#getUserName()
+ */
+ @Override
+ public String getUserName() {
+ UserAccountDto user = (UserAccountDto) getSessionAttribute(USER_KEY);
+ if (user != null) {
+ return user.getUserName();
+ }
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
* @see
* org.eclipse.osbp.ui.api.useraccess.IUserAccessService#getProfileimageId()
*/
@@ -427,9 +457,8 @@
/*
* (non-Javadoc)
*
- * @see
- * org.eclipse.osbp.ui.api.useraccess.IUserAccessService#getLayoutingStrategy
- * ()
+ * @see org.eclipse.osbp.ui.api.useraccess.IUserAccessService#
+ * getLayoutingStrategy ()
*/
@Override
public String getLayoutingStrategy() {
@@ -470,8 +499,11 @@
return "";
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ui.api.useraccess.IUserAccessService#getPrintService()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ui.api.useraccess.IUserAccessService#getPrintService()
*/
@Override
public String getPrintService() {
@@ -530,7 +562,7 @@
public String getPerspective() {
UserAccountDto user = getUser();
if (user != null) {
- return user.getDefaultPerpective();
+ return user.getDefaultPerspective();
}
return "";
}
@@ -583,44 +615,24 @@
* org.eclipse.osbp.ui.api.useraccess.IUserAccessService#getPermissions()
*/
@Override
- public IPermissionList getPermissions() {
- return (IPermissionList) getSessionAttribute(PERMISSIONS_KEY);
+ public AbstractAuthorization getAuthorization() {
+ return (AbstractAuthorization) getSessionAttribute(AUTHORIZATION_KEY);
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.osbp.ui.api.useraccess.IUserAccessService#isPermitted(org
- * .eclipse.osbp.ui.api.useraccess.AbstractAuthorization.Permission)
- */
@Override
- public PermissionResult isPermitted(Permission permission) {
- // --- check if this permission is granted ---
- if (getPermissions() != null) {
- boolean retcode = getPermissions().getPermissions().contains(
- permission.toString());
- // --- if it is granted, but the requested permission has an veto
- // ---
- if (retcode && permission.hasVeto()) {
- try {
- // --- check for the EXPLICIT "negative" permission ---
- if (getPermissions().getPermissions().contains(
- permission.toString()
- + IPermissionList.NEGATIVE_POSTFIX)) {
- return PermissionResult.EXPLICIT_DENIED;
- }
- } catch (Exception e) {
- } // NOP // NOSONAR
- return PermissionResult.EXPLICIT_GRANTED;
- }
- return retcode ? PermissionResult.EXPLICIT_GRANTED
- : PermissionResult.IMPLICIT_DENIED;
+ public boolean isGranted(Group group, Action action, String objectDescriptor) {
+ if (getAuthorization() == null) { // administrator
+ return true;
}
- if (permission.isAttribute()) {
- return PermissionResult.IMPLICIT_DENIED;
+ return getAuthorization().isApplicableGrant(group, action, objectDescriptor);
+ }
+
+ @Override
+ public boolean isVetoed(Group group, Action action, String objectDescriptor, String propertyDescriptor) {
+ if (getAuthorization() == null) { // administrator
+ return false;
}
- return PermissionResult.EXPLICIT_GRANTED;
+ return getAuthorization().isApplicableVeto(group, action, objectDescriptor, propertyDescriptor);
}
/**
@@ -629,8 +641,8 @@
* @return the organization service
*/
public final IOrganizationService getOrganizationService() {
- if (ServiceListener.getOrganizationServices().size() == 1) {
- return ServiceListener.getOrganizationServices().iterator().next();
+ if (UserAccessService.sOrganizationServices.size() == 1) {
+ return UserAccessService.sOrganizationServices.entrySet().iterator().next().getValue();
}
return null;
}
@@ -654,27 +666,23 @@
AuthenticatingRealm realm = getAuthenticationRealm();
if (realm instanceof UserAccessAuthorizationRealm) {
return ((UserAccessAuthorizationRealm) realm).getAllUsers();
- } else {
- return null;
}
+ return Collections.emptySet();
}
/*
* (non-Javadoc)
*
- * @see
- * org.eclipse.osbp.ui.api.useraccess.IUserAccessService#getAllUsersPositions
- * ()
+ * @see org.eclipse.osbp.ui.api.useraccess.IUserAccessService#
+ * getAllUsersPositions ()
*/
@Override
public Map<String, String> getAllUsersPositions() {
AuthenticatingRealm realm = getAuthenticationRealm();
if (realm instanceof UserAccessAuthorizationRealm) {
- return ((UserAccessAuthorizationRealm) realm)
- .getAllUsersPositions();
- } else {
- return null;
+ return ((UserAccessAuthorizationRealm) realm).getAllUsersPositions();
}
+ return Collections.emptyMap();
}
/*
@@ -687,32 +695,23 @@
AuthenticatingRealm realm = getAuthenticationRealm();
if (realm instanceof UserAccessAuthorizationRealm) {
return ((UserAccessAuthorizationRealm) realm).getAllEmails();
- } else {
- return null;
}
+ return Collections.emptySet();
}
- // @Override - no, use the inherited one
- // public String encryptPassword(String decryptedPassword) {
- // return super.encryptPassword(decryptedPassword);
- // }
-
/*
* (non-Javadoc)
*
- * @see
- * org.eclipse.osbp.ui.api.useraccess.IUserAccessService#findUsersForPosition
- * (java.lang.String)
+ * @see org.eclipse.osbp.ui.api.useraccess.IUserAccessService#
+ * findUsersForPosition (java.lang.String)
*/
@Override
public Set<String> findUsersForPosition(String position) {
AuthenticatingRealm realm = getAuthenticationRealm();
if (realm instanceof UserAccessAuthorizationRealm) {
- return ((UserAccessAuthorizationRealm) realm)
- .findUsersForPosition(position);
- } else {
- return null;
+ return ((UserAccessAuthorizationRealm) realm).findUsersForPosition(position);
}
+ return Collections.emptySet();
}
/*
@@ -726,12 +725,9 @@
AuthenticatingRealm realm = getAuthenticationRealm();
if (realm instanceof UserAccessAuthorizationRealm) {
Set<AbstractPosition> retcode = new HashSet<>();
- for (IOrganizationService organizationService : ServiceListener
- .getOrganizationServices()) {
- String organizationID = ProductConfiguration
- .getAuthenticationOrganizationId();
- ISubOrganization organization = organizationService
- .getOrganization(organizationID);
+ for (Entry<String, IOrganizationService> entrySet : UserAccessService.sOrganizationServices.entrySet()) {
+ String organizationID = ProductConfiguration.getAuthenticationOrganizationId();
+ ISubOrganization organization = entrySet.getValue().getOrganization(organizationID);
if (organization != null) {
for (IPosition position : organization.getPositions()) {
retcode.add((AbstractPosition) position);
@@ -742,9 +738,8 @@
retcode = null;
}
return retcode;
- } else {
- return null;
}
+ return Collections.emptySet();
}
/*
@@ -758,11 +753,9 @@
public AbstractPosition findPositionForUser(String username) {
AuthenticatingRealm realm = getAuthenticationRealm();
if (realm instanceof UserAccessAuthorizationRealm) {
- return ((UserAccessAuthorizationRealm) realm)
- .findPositionForUser(username);
- } else {
- return null;
+ return ((UserAccessAuthorizationRealm) realm).findPositionForUser(username);
}
+ return null;
}
/*
@@ -775,11 +768,9 @@
public AbstractPosition findPositionForPositionName(String positionName) {
AuthenticatingRealm realm = getAuthenticationRealm();
if (realm instanceof UserAccessAuthorizationRealm) {
- return ((UserAccessAuthorizationRealm) realm)
- .findPositionForPositionName(positionName);
- } else {
- return null;
+ return ((UserAccessAuthorizationRealm) realm).findPositionForPositionName(positionName);
}
+ return null;
}
/*
@@ -793,29 +784,24 @@
public Collection<String> findRolesForUser(String username) {
AuthenticatingRealm realm = getAuthenticationRealm();
if (realm instanceof UserAccessAuthorizationRealm) {
- return ((UserAccessAuthorizationRealm) realm)
- .findRolesForUser(username);
- } else {
- return null;
+ return ((UserAccessAuthorizationRealm) realm).findRolesForUser(username);
}
+ return Collections.emptyList();
}
/*
* (non-Javadoc)
*
- * @see
- * org.eclipse.osbp.ui.api.useraccess.IUserAccessService#findPermissionsForUser
- * (java.lang.String)
+ * @see org.eclipse.osbp.ui.api.useraccess.IUserAccessService#
+ * findPermissionsForUser (java.lang.String)
*/
@Override
- public IPermissionList findPermissionsForUser(String username) {
+ public AbstractAuthorization findPermissionsForUser(String username) {
AuthenticatingRealm realm = getAuthenticationRealm();
if (realm instanceof UserAccessAuthorizationRealm) {
- return ((UserAccessAuthorizationRealm) realm)
- .findPermissionsForUser(username);
- } else {
- return null;
+ return ((UserAccessAuthorizationRealm) realm).findPermissionsForUser(username);
}
+ return null;
}
/*
@@ -836,109 +822,84 @@
/*
* (non-Javadoc)
*
- * @see
- * org.eclipse.osbp.ui.api.useraccess.IUserAccessService#checkUsernameUniqueness
- * (java.lang.String)
+ * @see org.eclipse.osbp.ui.api.useraccess.IUserAccessService#
+ * checkUsernameUniqueness (java.lang.String)
*/
@Override
public boolean checkLoggedInUsernameExists(String username) {
AuthenticatingRealm realm = getAuthenticationRealm();
if (realm instanceof UserAccessAuthorizationRealm) {
- return ((UserAccessAuthorizationRealm) realm)
- .checkUsernameExists(username);
- } else {
- return false;
+ return ((UserAccessAuthorizationRealm) realm).checkUsernameExists(username);
}
+ return false;
}
/*
* (non-Javadoc)
*
- * @see
- * org.eclipse.osbp.ui.api.useraccess.IUserAccessService#checkUsernameUniqueness
- * (java.lang.String)
+ * @see org.eclipse.osbp.ui.api.useraccess.IUserAccessService#
+ * checkUsernameUniqueness (java.lang.String)
*/
@Override
public boolean checkNotLoggedInUsernameExists(String username) {
UserAccountDto userAccount = findUserAccount(username);
- if (userAccount != null) {
- return true;
- } else {
- return false;
- }
+ return (userAccount != null);
}
/*
* (non-Javadoc)
*
- * @see
- * org.eclipse.osbp.ui.api.useraccess.IUserAccessService#checkEmailUniqueness
- * (java.lang.String)
+ * @see org.eclipse.osbp.ui.api.useraccess.IUserAccessService#
+ * checkEmailUniqueness (java.lang.String)
*/
@Override
public boolean checkEmailExists(String email) {
AuthenticatingRealm realm = getAuthenticationRealm();
if (realm instanceof UserAccessAuthorizationRealm) {
- return ((UserAccessAuthorizationRealm) realm)
- .checkEmailExists(email);
- } else {
- return false;
+ return ((UserAccessAuthorizationRealm) realm).checkEmailExists(email);
}
+ return false;
}
- // @Override
- // public void encryptPasswords() {
- // super.encryptPasswords();
- // }
-
/*
* (non-Javadoc)
*
- * @see
- * org.eclipse.osbp.ui.api.useraccess.IUserAccessService#getAllUserAccountRoles
- * ()
+ * @see org.eclipse.osbp.ui.api.useraccess.IUserAccessService#
+ * getAllUserAccountRoles ()
*/
@Override
- public Map<String, Collection<String>> getAllUserAccountRoles() {
+ public Map<String, Collection<String>> getAllUserAccountRoles() { // NOSONAR
Map<String, Collection<String>> userRolesMap = new HashMap<>();
- List<String> adminRoles = new ArrayList<String>();
+ List<String> adminRoles = new ArrayList<>();
Query query = new Query();
int size = UserProtocol.getDtoUserAccountDtoService().size(query);
- Collection<UserAccountDto> users = UserProtocol
- .getDtoUserAccountDtoService().getByIndex(0, size, query);
+ Collection<UserAccountDto> users = UserProtocol.getDtoUserAccountDtoService().getByIndex(0, size, query);
for (UserAccountDto user : users) {
if (user.getUserName() != null && user.getPosition() != null) {
boolean needsDefault = true;
- for (IOrganizationService organizationService : ServiceListener
- .getOrganizationServices()) {
+ for (Entry<String, IOrganizationService> entrySet : UserAccessService.sOrganizationServices.entrySet()) {
// as positions in organigram are not allowed to have spaces
- String organizationID = ProductConfiguration
- .getAuthenticationOrganizationId();
- ISubOrganization organization = organizationService
- .getOrganization(organizationID);
+ String organizationID = ProductConfiguration.getAuthenticationOrganizationId();
+ ISubOrganization organization = entrySet.getValue().getOrganization(organizationID);
if (organization != null) {
- IPosition position = organization.getPosition(user
- .getPosition().replace(" ", "_"));
- if (position != null
- && position instanceof AbstractPosition) {
- userRolesMap.put(user.getUserName(),
- ((AbstractPosition) position).getRoles());
+ IPosition position = organization.getPositionByLinkAlias(user.getPosition());
+ if (position != null && position instanceof AbstractPosition) {
+ userRolesMap.put(user.getUserName(), ((AbstractPosition) position).getRoles());
needsDefault = false;
}
}
}
if (needsDefault) {
- List<String> userRoles = new ArrayList<String>();
+ List<String> userRoles = new ArrayList<>();
userRoles.add(IUserAccessService.DEFAULTUSERROLE);
userRolesMap.put(user.getUserName(), userRoles);
}
}
}
// finally, add the admin and assign all roles
- for (IOrganizationService organization : ServiceListener
- .getOrganizationServices()) {
- adminRoles.addAll(organization.getRoles());
+ for (Entry<String, IOrganizationService> entrySet : UserAccessService.sOrganizationServices.entrySet()) {
+ adminRoles.addAll(entrySet.getValue().getRoles());
}
// if the organizations provide no roles
if (adminRoles.isEmpty()) {
@@ -961,23 +922,80 @@
for (UserAccountFilterDto filter : user.getUserAccountFilter()) {
String[] splitFilter = filter.getFilter().split(":");
if (filter.getInvers()) {
- List<String> notFilterValueList = filterMap.getNotFilterMap()
- .get(splitFilter[0]);
- notFilterValueList = ((notFilterValueList != null) ? notFilterValueList
- : new ArrayList<String>());
+ List<String> notFilterValueList = filterMap.getNotFilterMap().get(splitFilter[0]);
+ notFilterValueList = ((notFilterValueList != null) ? notFilterValueList : new ArrayList<>());
notFilterValueList.add(splitFilter[1]);
- filterMap.getNotFilterMap().put(splitFilter[0],
- notFilterValueList);
+ filterMap.getNotFilterMap().put(splitFilter[0], notFilterValueList);
} else {
- List<String> inFilterValueList = filterMap.getInFilterMap()
- .get(splitFilter[0]);
- inFilterValueList = ((inFilterValueList != null) ? inFilterValueList
- : new ArrayList<String>());
+ List<String> inFilterValueList = filterMap.getInFilterMap().get(splitFilter[0]);
+ inFilterValueList = ((inFilterValueList != null) ? inFilterValueList : new ArrayList<>());
inFilterValueList.add(splitFilter[1]);
- filterMap.getInFilterMap().put(splitFilter[0],
- inFilterValueList);
+ filterMap.getInFilterMap().put(splitFilter[0], inFilterValueList);
}
}
return filterMap;
}
+
+ /**
+ * Bind persistence service.
+ *
+ * @param persistenceService
+ * the persistence service
+ */
+ @Reference(cardinality = ReferenceCardinality.MANDATORY, policy = ReferencePolicy.STATIC)
+ public synchronized void bindPersistenceService(final IPersistenceService persistenceService) {
+ UserProtocol.persistenceService = persistenceService;
+ LOGGER.debug("UserProtocolPersistenceService bound");
+ }
+
+ /**
+ * Unbind persistence service.
+ *
+ * @param persistenceService
+ * the persistence service
+ */
+ public synchronized void unbindPersistenceService(final IPersistenceService persistenceService) { // NOSONAR
+ UserProtocol.persistenceService = null;
+ LOGGER.debug("UserProtocolPersistenceService unbound");
+ }
+
+ /**
+ * Bind organization service.
+ *
+ * @param organization
+ * the organization
+ */
+ @Reference(cardinality = ReferenceCardinality.OPTIONAL, policy = ReferencePolicy.DYNAMIC)
+ public void bindOrganizationService(IOrganizationService organization) {
+ LOGGER.debug(UserAccessService.class.getCanonicalName() + ": " + organization.getClass().getCanonicalName() + " bound");
+ sOrganizationServices.put(organization.getClass().getCanonicalName(), organization);
+ triggerComplexDataContainerChangedListeners();
+ }
+
+ /**
+ * Unbind organization service.
+ *
+ * @param organization
+ * the organization
+ */
+ public void unbindOrganizationService(IOrganizationService organization) {
+ LOGGER.debug(UserAccessService.class.getCanonicalName() + ": " + organization.getClass().getCanonicalName() + " unbound");
+ sOrganizationServices.remove(organization.getClass().getCanonicalName());
+ triggerComplexDataContainerChangedListeners();
+ }
+
+ public void addComplexDataContainerChangedListener(IComplexDataContainerChangedListener listener) {
+ complexDataContainerChangedListeners.add(listener);
+ }
+
+ public void removeComplexDataContainerChangedListener(IComplexDataContainerChangedListener listener) {
+ complexDataContainerChangedListeners.remove(listener);
+ }
+
+ public static void triggerComplexDataContainerChangedListeners() {
+ for (IComplexDataContainerChangedListener listener : complexDataContainerChangedListeners) {
+ listener.complexDataContainerChanged();
+ }
+ }
+
}
diff --git a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/providerimpl/UserProtocol.java b/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/providerimpl/UserProtocol.java
index 2ffea44..0cee90c 100644
--- a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/providerimpl/UserProtocol.java
+++ b/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/providerimpl/UserProtocol.java
@@ -14,18 +14,15 @@
import java.util.Collection;
-import org.apache.shiro.authc.credential.DefaultPasswordService;
import org.apache.shiro.authc.credential.PasswordService;
import org.eclipse.osbp.authentication.account.dtos.UserAccountDto;
-import org.eclipse.osbp.dsl.dto.lib.impl.DtoServiceAccess;
-import org.eclipse.osbp.dsl.dto.lib.services.IDTOServiceWithMutablePersistence;
-import org.eclipse.osbp.dsl.dto.lib.services.Query;
-import org.eclipse.osbp.dsl.dto.lib.services.filters.LCompare;
-import org.eclipse.osbp.persistence.IPersistenceService;
+import org.eclipse.osbp.core.api.persistence.IPersistenceService;
+import org.eclipse.osbp.jpa.services.Query;
+import org.eclipse.osbp.jpa.services.filters.LCompare;
+import org.eclipse.osbp.preferences.ProductConfiguration;
+import org.eclipse.osbp.runtime.common.filter.IDTOServiceWithMutablePersistence;
import org.eclipse.osbp.ui.api.useraccess.IUserAccessService;
-import org.osgi.framework.InvalidSyntaxException;
import org.osgi.service.component.ComponentContext;
-import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.component.annotations.ReferenceCardinality;
import org.osgi.service.component.annotations.ReferencePolicy;
@@ -37,26 +34,22 @@
* not. User accounts will be locked on too many unsuccessful login attempts.
* The maximum tries is configured in the preferences.
*/
-@Component(service = {}, immediate = true)
public class UserProtocol {
/** The dto user account dto service. */
- private static IDTOServiceWithMutablePersistence<UserAccountDto> dtoUserAccountDtoService = null;
-
- /** The find by user name. */
- private static boolean findByUserName = true; // false means find by email
+ protected static IDTOServiceWithMutablePersistence<UserAccountDto> dtoUserAccountDtoService = null;
/** The Constant LOGGER. */
private static final Logger LOGGER = LoggerFactory.getLogger(UserProtocol.class);
/** The persistence service. */
- private IPersistenceService persistenceService;
+ protected static IPersistenceService persistenceService;
/** The persistence id. */
- private static String persistenceId = "authentication";
+ protected static String persistenceId = "authentication";
/** The password service. */
- private static PasswordService passwordService = null;
+ protected static PasswordService passwordService = null;
//
// OSGI Infrastructure
@@ -70,29 +63,11 @@
* @throws Exception
* the exception
*/
- protected void activate(ComponentContext context) {
+ protected void activate(ComponentContext context) { // NOSONAR
LOGGER.debug("UserProtocol activated");
}
/**
- * Internal activate.
- *
- * @throws InvalidSyntaxException
- * the invalid syntax exception
- */
- @SuppressWarnings("restriction")
- protected static void internalActivate() {
- if (UserProtocol.dtoUserAccountDtoService == null) {
- UserProtocol.dtoUserAccountDtoService = (IDTOServiceWithMutablePersistence<UserAccountDto>) DtoServiceAccess
- .getService(UserAccountDto.class);
- }
- // for password encryption
- if (UserProtocol.passwordService == null) {
- UserProtocol.passwordService = new DefaultPasswordService();
- }
- }
-
- /**
* Called by OSGi-DS to deactivate the service.
*
* @param context
@@ -108,7 +83,6 @@
* @return the dto user account dto service
*/
public static IDTOServiceWithMutablePersistence<UserAccountDto> getDtoUserAccountDtoService() {
- UserProtocol.internalActivate();
return UserProtocol.dtoUserAccountDtoService;
}
@@ -128,15 +102,23 @@
* the username
* @return the user account dto
*/
- // TODO (JCD): New method that ONLY finds a user. That´s all!
public UserAccountDto findUserAccount(String username) {
Collection<UserAccountDto> users = null;
- try {
- // try to find by username
- users = getDtoUserAccountDtoService().find(new Query(new LCompare.Equal("userName", username)));
- } catch (Exception e) {
- LOGGER.error("Exception while trying to find user", e);
- }
+ if (ProductConfiguration.getIdentifyByUsername()) {
+ try {
+ // try to find by username first
+ users = getDtoUserAccountDtoService().find(new Query(new LCompare.Equal("userName", username)));
+ } catch (Exception e) {
+ LOGGER.error("Exception while trying to find user {} by userName", username, e);
+ }
+ } else {
+ try {
+ // try to find by email
+ users = getDtoUserAccountDtoService().find(new Query(new LCompare.Equal("email", username)));
+ } catch (Exception e) {
+ LOGGER.error("Exception while trying to find user {} by email", username, e);
+ }
+ }
if (users != null) {
if (users.size() > 1) {
LOGGER.error("user account is not unique - first match taken");
@@ -150,50 +132,6 @@
}
/**
- * Find user account.
- *
- * @param username
- * the username
- * @return the user account dto
- */
- // TODO (JCD): I changed this method into OLD due to the not knowing heed of
- // a method that finds a user by email using the introduced username and
- // that creates a new user if it doesn´t exist and that all in a
- // find.Method. Very strange!!!!
- public UserAccountDto findUserAccount_OLD(String username) {
- Collection<UserAccountDto> users = null;
- try {
- if (isFindByUserName()) {
- // try to find by username first
- users = getDtoUserAccountDtoService().find(new Query(new LCompare.Equal("userName", username)));
- } else {
- // try to find by email
- users = getDtoUserAccountDtoService().find(new Query(new LCompare.Equal("email", username)));
- }
- } catch (Exception e) {
- LOGGER.error("Exception while trying to find user", e);
- }
- if (users != null) {
- if (users.size() > 1) {
- LOGGER.error("user account is not unique - first match taken");
- } else if (users.isEmpty()) {
- LOGGER.debug("user account not found -create one");
- UserAccountDto userAccount = new UserAccountDto();
- userAccount.setEnabled(true);
- if (isFindByUserName()) {
- userAccount.setUserName(username);
- } else {
- userAccount.setEmail(username);
- }
- getDtoUserAccountDtoService().update(userAccount);
- return userAccount;
- }
- return users.iterator().next();
- }
- return null;
- }
-
- /**
* Update user account.
*
* @param user
@@ -285,7 +223,7 @@
if (user != null) {
return user.getNotRegistered();
}
- return false;
+ return true; // if no account information present - it is the same as not registered
}
/**
@@ -381,8 +319,11 @@
LOGGER.debug("cookie is valid");
return true;
} else {
- LOGGER.debug("fraud detected as an invalid cookie was presented. expected:" + user.getCookieHashCode() + " found:"
- + cookie.hashCode());
+ int hashCode = 0;
+ if(cookie != null) {
+ hashCode = cookie.hashCode();
+ }
+ LOGGER.debug("fraud detected as an invalid cookie was presented. expected: {} found:",user.getCookieHashCode(), hashCode);
return false;
}
} else {
@@ -392,15 +333,6 @@
}
/**
- * Checks if is find by user name.
- *
- * @return true, if is find by user name
- */
- public boolean isFindByUserName() {
- return findByUserName;
- }
-
- /**
* Gets the persistence service.
*
* @return the persistence service
@@ -442,29 +374,4 @@
getDtoUserAccountDtoService().update(user);
}
}
-
- /**
- * Bind persistence service.
- *
- * @param persistenceService
- * the persistence service
- */
- @Reference(cardinality = ReferenceCardinality.MANDATORY, policy = ReferencePolicy.STATIC)
- public synchronized void bindPersistenceService(final IPersistenceService persistenceService) {
- this.persistenceService = persistenceService;
- this.persistenceService.registerPersistenceUnit(persistenceId, getClass());
- internalActivate();
- LOGGER.debug("UserProtocolPersistenceService bound");
- }
-
- /**
- * Unbind persistence service.
- *
- * @param persistenceService
- * the persistence service
- */
- public synchronized void unbindPersistenceService(final IPersistenceService persistenceService) { // NOSONAR
- this.persistenceService = null;
- LOGGER.debug("UserProtocolPersistenceService unbound");
- }
}
diff --git a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensions/DTORealm.java b/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensions/DTORealm.java
index 1edccbb..853f119 100644
--- a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensions/DTORealm.java
+++ b/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensions/DTORealm.java
@@ -33,19 +33,18 @@
import org.apache.shiro.authz.AuthorizationException;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.subject.PrincipalCollection;
-import org.eclipse.osbp.dsl.dto.lib.services.Query;
-import org.eclipse.osbp.dsl.dto.lib.services.filters.LCompare;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.eclipse.osbp.authentication.account.dtos.UserAccountDto;
import org.eclipse.osbp.authentication.providerimpl.AuthenticationInformation;
import org.eclipse.osbp.authentication.providerimpl.AuthorizationInformation;
import org.eclipse.osbp.authentication.providerimpl.UserProtocol;
import org.eclipse.osbp.authentication.shiro.extensionsimpl.UserAccessAuthorizationRealm;
+import org.eclipse.osbp.jpa.services.Query;
+import org.eclipse.osbp.jpa.services.filters.LCompare;
import org.eclipse.osbp.preferences.ProductConfiguration;
import org.eclipse.osbp.ui.api.useraccess.AbstractPosition;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
-// TODO: Auto-generated Javadoc
/**
* The Class DTORealm.
*/
@@ -98,7 +97,6 @@
getPortalId(),
principals,
position,
- position.getRoles(),
findPermissionsForUser(username));
}
@@ -218,7 +216,7 @@
@Override
public UserAccountDto findUserAccount(String username) {
Collection<UserAccountDto> users = null; // NOSONAR
- if (dtoToken.getUserProtocol().isFindByUserName()) {
+ if (ProductConfiguration.getIdentifyByUsername()) {
dtoToken.getUserProtocol();
// try to find by username first
users = UserProtocol.getDtoUserAccountDtoService().find(new Query(new LCompare.Equal("userName", username))); // NOSONAR
diff --git a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensions/IPortalAuthenticationToken.java b/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensions/IPortalAuthenticationToken.java
index 0b7c947..1443c7d 100644
--- a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensions/IPortalAuthenticationToken.java
+++ b/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensions/IPortalAuthenticationToken.java
@@ -17,7 +17,6 @@
import org.eclipse.osbp.authentication.providerimpl.UserProtocol;
-// TODO: Auto-generated Javadoc
/**
* The Interface IPortalAuthenticationToken.
*/
diff --git a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensions/IUserAccess.java b/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensions/IUserAccess.java
index 1f38aa8..0d221d0 100644
--- a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensions/IUserAccess.java
+++ b/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensions/IUserAccess.java
@@ -17,8 +17,8 @@
import java.util.Set;
import org.eclipse.osbp.authentication.account.dtos.UserAccountDto;
+import org.eclipse.osbp.ui.api.useraccess.AbstractAuthorization;
import org.eclipse.osbp.ui.api.useraccess.AbstractPosition;
-import org.eclipse.osbp.ui.api.useraccess.IPermissionList;
// TODO: Auto-generated Javadoc
/**
@@ -92,7 +92,7 @@
* @param username the username
* @return the permission list
*/
- IPermissionList findPermissionsForUser(String username);
+ AbstractAuthorization findPermissionsForUser(String username);
/**
* Check username uniqueness.
diff --git a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensions/LDAPRealm.java b/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensions/LDAPRealm.java
index f63ab6d..7e3fac3 100644
--- a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensions/LDAPRealm.java
+++ b/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensions/LDAPRealm.java
@@ -420,7 +420,6 @@
getPortalId(),
principals,
position,
- position.getRoles(),
findPermissionsForUser(username));
}
@@ -575,7 +574,7 @@
ctx = getContextFactory().getLdapContext(authenticationInfo.getPrincipals(), authenticationInfo.getCredentials());
SearchControls controls = new SearchControls();
controls.setSearchScope(SearchControls.SUBTREE_SCOPE);
- if (ldapToken.getUserProtocol().isFindByUserName()) {
+ if (ProductConfiguration.getIdentifyByUsername()) {
// common name search
results = ctx.search("", "(cn="+username+")", controls);
}
diff --git a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensions/StaticRealm.java b/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensions/StaticRealm.java
index acece03..67126df 100644
--- a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensions/StaticRealm.java
+++ b/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensions/StaticRealm.java
@@ -39,7 +39,6 @@
import org.eclipse.osbp.preferences.ProductConfiguration;
import org.eclipse.osbp.ui.api.useraccess.AbstractPosition;
-// TODO: Auto-generated Javadoc
/**
* The Class StaticRealm.
*/
@@ -93,7 +92,6 @@
getPortalId(),
principals,
position,
- position.getRoles(),
findPermissionsForUser(username));
}
diff --git a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensionsimpl/PortalUsernamePasswordToken.java b/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensionsimpl/PortalUsernamePasswordToken.java
index f3e2b27..188f478 100644
--- a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensionsimpl/PortalUsernamePasswordToken.java
+++ b/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensionsimpl/PortalUsernamePasswordToken.java
@@ -18,8 +18,6 @@
import org.eclipse.osbp.authentication.providerimpl.UserProtocol;
import org.eclipse.osbp.authentication.shiro.extensions.IPortalAuthenticationToken;
-
-// TODO: Auto-generated Javadoc
/**
* The Class PortalUsernamePasswordToken.
*/
diff --git a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensionsimpl/UserAccessAuthorizationRealm.java b/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensionsimpl/UserAccessAuthorizationRealm.java
index 1326d0b..2a63433 100644
--- a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensionsimpl/UserAccessAuthorizationRealm.java
+++ b/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/shiro/extensionsimpl/UserAccessAuthorizationRealm.java
@@ -13,28 +13,25 @@
package org.eclipse.osbp.authentication.shiro.extensionsimpl;
import java.util.Collection;
-import java.util.Map;
-import java.util.Set;
+import java.util.Collections;
-import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.subject.PrincipalCollection;
-import org.eclipse.osbp.authentication.ServiceListener;
import org.eclipse.osbp.authentication.account.dtos.UserAccountDto;
+import org.eclipse.osbp.authentication.providerimpl.UserAccessService;
import org.eclipse.osbp.authentication.shiro.extensions.IUserAccess;
import org.eclipse.osbp.preferences.ProductConfiguration;
+import org.eclipse.osbp.ui.api.useraccess.AbstractAuthorization;
import org.eclipse.osbp.ui.api.useraccess.AbstractPosition;
import org.eclipse.osbp.ui.api.useraccess.IOrganizationService;
-import org.eclipse.osbp.ui.api.useraccess.IPermissionList;
import org.eclipse.osbp.ui.api.useraccess.IPosition;
import org.eclipse.osbp.ui.api.useraccess.ISubOrganization;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-// TODO: Auto-generated Javadoc
/**
* The Class UserAccessAuthorizationRealm.
*
@@ -53,9 +50,6 @@
/** The portal id. */
private String portalId = "";
- // private static final Logger LOGGER =
- // LoggerFactory.getLogger(UserAccessAuthorizationRealm.class);
-
/**
* Instantiates a new user access authorization realm.
*/
@@ -65,44 +59,6 @@
/*
* (non-Javadoc)
*
- * @see
- * org.eclipse.osbp.authentication.shiro.extensions.IUserAccess#getAllUsers
- * ()
- */
- @Override
- public abstract Set<String> getAllUsers();
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.osbp.authentication.shiro.extensions.IUserAccess#
- * getAllUsersPositions()
- */
- @Override
- public abstract Map<String, String> getAllUsersPositions();
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.osbp.authentication.shiro.extensions.IUserAccess#findUserAccount
- * (java.lang.String)
- */
- @Override
- public abstract UserAccountDto findUserAccount(String username);
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.osbp.authentication.shiro.extensions.IUserAccess#
- * findUsersForPosition(java.lang.String)
- */
- @Override
- public abstract Set<String> findUsersForPosition(String positionName);
-
- /*
- * (non-Javadoc)
- *
* @see org.eclipse.osbp.authentication.shiro.extensions.IUserAccess#
* findPositionForUser(java.lang.String)
*/
@@ -124,13 +80,11 @@
@Override
public AbstractPosition findPositionForPositionName(String positionName) {
if (positionName != null) {
- // as positions in organization are not allowed to have spaces
- String pos = positionName.replace(" ", "_");
- for (IOrganizationService organizationService : ServiceListener.getOrganizationServices()) {
+ for (IOrganizationService organizationService : UserAccessService.getOrganizationServices()) {
String organizationID = ProductConfiguration.getAuthenticationOrganizationId();
ISubOrganization organization = organizationService.getOrganization(organizationID);
if (organization != null) {
- IPosition position = (organization != null) ? organization.getPosition(pos) : null;
+ IPosition position = organization.getPositionByLinkAlias(positionName);
if (position != null && position instanceof AbstractPosition) {
return (AbstractPosition) position;
}
@@ -153,7 +107,7 @@
if (position != null) {
return position.getRoles();
}
- return null;
+ return Collections.emptyList();
}
/*
@@ -163,10 +117,10 @@
* findPermissionsForUser(java.lang.String)
*/
@Override
- public IPermissionList findPermissionsForUser(String username) {
+ public AbstractAuthorization findPermissionsForUser(String username) {
AbstractPosition position = findPositionForUser(username);
if (position != null) {
- return position.getPermissionList();
+ return position.getAuthorization();
}
return null;
}
@@ -215,7 +169,7 @@
* .apache.shiro.authc.AuthenticationToken)
*/
@Override
- protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
+ protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) {
return null;
}
diff --git a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/vaadin/SubjectProvider.java b/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/vaadin/SubjectProvider.java
index 36c18c0..afbc5a5 100644
--- a/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/vaadin/SubjectProvider.java
+++ b/org.eclipse.osbp.authentication/src/org/eclipse/osbp/authentication/vaadin/SubjectProvider.java
@@ -12,24 +12,19 @@
*/
package org.eclipse.osbp.authentication.vaadin;
-//import com.google.inject.Inject;
import com.google.inject.Provider;
import com.vaadin.server.VaadinSession;
-import org.apache.http.annotation.ThreadSafe;
-//import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-// TODO: Auto-generated Javadoc
/**
* Use this instead of using {@link org.apache.shiro.SecurityUtils#getSubject()} directly, to ensure that the Subject instance remains
* consistent for the duration of a Vaadin Session.
*
* depends on ideas of David Sowerby
*/
-@ThreadSafe
public class SubjectProvider implements Provider<Subject> {
/** The log. */
diff --git a/org.eclipse.osbp.user/META-INF/MANIFEST.MF b/org.eclipse.osbp.user/META-INF/MANIFEST.MF
index 55758c1..bc1f626 100644
--- a/org.eclipse.osbp.user/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.user/META-INF/MANIFEST.MF
@@ -7,11 +7,7 @@
Bundle-Activator: org.eclipse.osbp.user.Activator
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.e4.core.di.extensions,
- com.vaadin.server;bundle-version="7.5.7",
- javax.annotation;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.osbp.dsl.dto.lib;bundle-version="[0.9.0,0.10.0)",
- org.eclipse.osbp.utils.blob;bundle-version="[0.9.0,0.10.0)",
- org.eclipse.osbp.authentication;bundle-version="[0.9.0,0.10.0)",
+ com.vaadin.server;bundle-version="[7.7.6,7.8.0)",
org.eclipse.osgi.services;bundle-version="3.4.0",
org.eclipse.e4.ui.model.workbench,
org.eclipse.e4.core.contexts;bundle-version="1.3.100",
@@ -21,7 +17,7 @@
Import-Package: org.eclipse.osbp.ui.api.customfields;version="0.9.0",
org.eclipse.osbp.ui.api.user;version="0.9.0",
org.eclipse.osbp.ui.api.useraccess;version="0.9.0",
- org.slf4j
+ org.slf4j,
+ javax.annotation
Export-Package: org.eclipse.osbp.user;version="0.9.0"
Service-Component: OSGI-INF/*.xml
-
diff --git a/org.eclipse.osbp.user/src/org/eclipse/osbp/user/User.java b/org.eclipse.osbp.user/src/org/eclipse/osbp/user/User.java
index 522467a..4d0dd58 100644
--- a/org.eclipse.osbp.user/src/org/eclipse/osbp/user/User.java
+++ b/org.eclipse.osbp.user/src/org/eclipse/osbp/user/User.java
@@ -23,7 +23,6 @@
import org.eclipse.e4.ui.model.application.MApplication;
import org.eclipse.osbp.ui.api.user.IUser;
import org.eclipse.osbp.ui.api.useraccess.IUserAccessService;
-import org.eclipse.osbp.utils.blob.component.BlobUploadComponent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -32,11 +31,10 @@
* data. User can be injected. It conforms the vaaclipse AuthenticationProvider
* mechanism.
*/
-@SuppressWarnings("restriction")
public class User extends Hashtable<String, Object> implements IUser {
/** The application. */
- private MApplication application;
+ private transient MApplication application;
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
@@ -82,11 +80,11 @@
/** The Constant LOGGER. */
private static final Logger LOGGER = LoggerFactory.getLogger(User.class);
- /** The blob upload component. */
- private BlobUploadComponent blobUploadComponent;
-
/** The listeners. */
- private List<UserLocaleListener> listeners;
+ private transient List<UserLocaleListener> listeners;
+
+ /** The profile image id. */
+ private String profileImageId;
/**
* Instantiates a new user.
@@ -102,8 +100,7 @@
super();
this.userName = userName;
if (UserBinder.getUserAccessService() != null) {
- blobUploadComponent = new BlobUploadComponent();
- blobUploadComponent.setValue(UserBinder.getUserAccessService().getProfileimageId());
+ profileImageId = UserBinder.getUserAccessService().getProfileimageId();
position = UserBinder.getUserAccessService().getPositionName();
perspective = UserBinder.getUserAccessService().getPerspective();
extraPassword = UserBinder.getUserAccessService().getExtraPassword();
@@ -194,6 +191,10 @@
this.userName = userName;
}
+ public String getProfileImageId() {
+ return profileImageId;
+ }
+
/**
* Gets the id.
*
@@ -276,22 +277,14 @@
this.locale = locale;
// force e4 application to switch locale and update localization
if (application != null) {
- application.getContext().set(TranslationService.LOCALE, locale.toLanguageTag());
+ application.getContext().set(TranslationService.LOCALE, locale);
ApplicationLocalization.updateLocalization(application);
}
+ Locale.setDefault(locale);
notifyUserLocaleChanged(locale);
}
/**
- * Gets the blob upload component.
- *
- * @return the blob upload component
- */
- public BlobUploadComponent getBlobUploadComponent() {
- return blobUploadComponent;
- }
-
- /**
* Gets the user access service.
*
* @return the user access service
@@ -303,7 +296,7 @@
@Override
public void addUserLocaleListener(UserLocaleListener listener) {
if (listeners == null) {
- listeners = new ArrayList<User.UserLocaleListener>();
+ listeners = new ArrayList<>();
}
if (!listeners.contains(listener)) {
diff --git a/org.eclipse.osbp.user/src/org/eclipse/osbp/user/UserBinder.java b/org.eclipse.osbp.user/src/org/eclipse/osbp/user/UserBinder.java
index d766a59..99ffc9f 100644
--- a/org.eclipse.osbp.user/src/org/eclipse/osbp/user/UserBinder.java
+++ b/org.eclipse.osbp.user/src/org/eclipse/osbp/user/UserBinder.java
@@ -12,6 +12,7 @@
*/
package org.eclipse.osbp.user;
+import org.eclipse.osbp.ui.api.customfields.IBlobService;
import org.eclipse.osbp.ui.api.useraccess.IUserAccessService;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
@@ -20,7 +21,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-// TODO: Auto-generated Javadoc
/**
* The Class UserBinder.
*/
@@ -62,5 +62,4 @@
UserBinder.userAccessService = null;
LOGGER.debug("UserMenuAuthenticationService unbound");
}
-
}