Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
reg-app
Regapp
Commits
4c7a9a37
Commit
4c7a9a37
authored
Mar 18, 2015
by
michael.simon
Browse files
Update AS at Userregistration
parent
5c48701a
Changes
4
Hide whitespace changes
Inline
Side-by-side
bwreg-jpa/src/main/java/edu/kit/scc/webreg/entity/ServiceEntity.java
View file @
4c7a9a37
...
...
@@ -29,6 +29,8 @@ import org.hibernate.annotations.Fetch;
import
org.hibernate.annotations.FetchMode
;
import
org.hibernate.annotations.Type
;
import
edu.kit.scc.webreg.entity.as.AttributeSourceServiceEntity
;
@Entity
(
name
=
"ServiceEntity"
)
@Table
(
name
=
"service"
)
public
class
ServiceEntity
extends
AbstractBaseEntity
{
...
...
@@ -61,6 +63,9 @@ public class ServiceEntity extends AbstractBaseEntity {
@OneToMany
(
targetEntity
=
PolicyEntity
.
class
,
mappedBy
=
"service"
)
private
Set
<
PolicyEntity
>
policies
;
@OneToMany
(
targetEntity
=
AttributeSourceServiceEntity
.
class
,
mappedBy
=
"service"
)
private
Set
<
AttributeSourceServiceEntity
>
attributeSourceService
;
@NotNull
@Column
(
name
=
"register_bean"
,
length
=
256
,
nullable
=
false
)
private
String
registerBean
;
...
...
@@ -244,4 +249,13 @@ public class ServiceEntity extends AbstractBaseEntity {
this
.
mandatoryValueRulePackage
=
mandatoryValueRulePackage
;
}
public
Set
<
AttributeSourceServiceEntity
>
getAttributeSourceService
()
{
return
attributeSourceService
;
}
public
void
setAttributeSourceService
(
Set
<
AttributeSourceServiceEntity
>
attributeSourceService
)
{
this
.
attributeSourceService
=
attributeSourceService
;
}
}
bwreg-jpa/src/main/java/edu/kit/scc/webreg/entity/UserEntity.java
View file @
4c7a9a37
...
...
@@ -26,6 +26,8 @@ import javax.persistence.MapKeyColumn;
import
javax.persistence.OneToMany
;
import
javax.persistence.Table
;
import
edu.kit.scc.webreg.entity.as.ASUserAttrEntity
;
@Entity
(
name
=
"UserEntity"
)
@Table
(
name
=
"usertable"
)
public
class
UserEntity
extends
AbstractBaseEntity
{
...
...
@@ -81,6 +83,9 @@ public class UserEntity extends AbstractBaseEntity {
@OneToMany
(
targetEntity
=
UserGroupEntity
.
class
,
mappedBy
=
"user"
)
private
Set
<
UserGroupEntity
>
groups
;
@OneToMany
(
targetEntity
=
ASUserAttrEntity
.
class
,
mappedBy
=
"user"
)
private
Set
<
ASUserAttrEntity
>
userAttrs
;
@Enumerated
(
EnumType
.
STRING
)
private
UserStatus
userStatus
;
...
...
@@ -271,4 +276,12 @@ public class UserEntity extends AbstractBaseEntity {
public
void
setLastFailedUpdate
(
Date
lastFailedUpdate
)
{
this
.
lastFailedUpdate
=
lastFailedUpdate
;
}
public
Set
<
ASUserAttrEntity
>
getUserAttrs
()
{
return
userAttrs
;
}
public
void
setUserAttrs
(
Set
<
ASUserAttrEntity
>
userAttrs
)
{
this
.
userAttrs
=
userAttrs
;
}
}
bwreg-jpa/src/main/java/edu/kit/scc/webreg/entity/as/ASUserAttrEntity.java
View file @
4c7a9a37
...
...
@@ -22,7 +22,6 @@ import javax.persistence.Table;
import
edu.kit.scc.webreg.entity.AbstractBaseEntity
;
import
edu.kit.scc.webreg.entity.UserEntity
;
import
edu.kit.scc.webreg.entity.UserGroupEntity
;
@Entity
(
name
=
"ASUserAttrEntity"
)
@Table
(
name
=
"attribute_src_ua"
)
...
...
bwreg-webapp/src/main/java/edu/kit/scc/webreg/bean/RegisterServiceBean.java
View file @
4c7a9a37
...
...
@@ -35,11 +35,13 @@ import edu.kit.scc.webreg.entity.RegistryEntity;
import
edu.kit.scc.webreg.entity.RegistryStatus
;
import
edu.kit.scc.webreg.entity.ServiceEntity
;
import
edu.kit.scc.webreg.entity.UserEntity
;
import
edu.kit.scc.webreg.entity.as.AttributeSourceServiceEntity
;
import
edu.kit.scc.webreg.exc.MisconfiguredServiceException
;
import
edu.kit.scc.webreg.exc.RegisterException
;
import
edu.kit.scc.webreg.service.RegistryService
;
import
edu.kit.scc.webreg.service.ServiceService
;
import
edu.kit.scc.webreg.service.UserService
;
import
edu.kit.scc.webreg.service.reg.AttributeSourceQueryService
;
import
edu.kit.scc.webreg.service.reg.RegisterUserService
;
import
edu.kit.scc.webreg.util.FacesMessageGenerator
;
import
edu.kit.scc.webreg.util.SessionManager
;
...
...
@@ -86,7 +88,10 @@ public class RegisterServiceBean implements Serializable {
@Inject
private
KnowledgeSessionService
knowledgeSessionService
;
@Inject
private
AttributeSourceQueryService
asQueryService
;
@Inject
private
FacesMessageGenerator
messageGenerator
;
...
...
@@ -101,7 +106,7 @@ public class RegisterServiceBean implements Serializable {
id
=
service
.
getId
();
}
service
=
serviceService
.
find
WithPolicies
(
id
);
service
=
serviceService
.
find
ByIdWithAttrs
(
id
,
"policies"
,
"attributeSourceService"
);
List
<
RegistryEntity
>
r
=
registryService
.
findByServiceAndUserAndNotStatus
(
service
,
user
,
RegistryStatus
.
DELETED
,
RegistryStatus
.
DEPROVISIONED
);
...
...
@@ -111,6 +116,15 @@ public class RegisterServiceBean implements Serializable {
return
;
}
for
(
AttributeSourceServiceEntity
asse
:
service
.
getAttributeSourceService
())
{
logger
.
info
(
"Updating attribute source {}"
,
asse
.
getAttributeSource
().
getName
());
try
{
asQueryService
.
updateUserAttributes
(
user
,
asse
.
getAttributeSource
(),
"user-"
+
user
.
getId
());
}
catch
(
RegisterException
e
)
{
logger
.
info
(
"Updating attribute source exception"
,
e
);
}
}
policyHolderList
=
new
ArrayList
<
RegisterServiceBean
.
PolicyHolder
>();
List
<
PolicyEntity
>
policiesTemp
=
new
ArrayList
<
PolicyEntity
>(
service
.
getPolicies
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment