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
7e3d5a47
Commit
7e3d5a47
authored
Mar 16, 2015
by
michael.simon
Browse files
More changes in webapp to reflect attribute-sources
parent
55a6e548
Changes
8
Hide whitespace changes
Inline
Side-by-side
bwreg-jpa/src/main/java/edu/kit/scc/webreg/dao/RegistryDao.java
View file @
7e3d5a47
...
...
@@ -56,8 +56,8 @@ public interface RegistryDao extends BaseDao<RegistryEntity, Long> {
List
<
RegistryEntity
>
findByServiceAndUserAndNotStatus
(
ServiceEntity
service
,
UserEntity
user
,
RegistryStatus
...
status
);
List
<
RegistryEntity
>
findByUserAndNotStatus
(
UserEntity
user
,
RegistryStatus
status
);
List
<
RegistryEntity
>
findRegistriesForDepro
(
String
serviceShortName
);
List
<
RegistryEntity
>
findByUserAndNotStatus
(
UserEntity
user
,
RegistryStatus
...
status
);
}
bwreg-jpa/src/main/java/edu/kit/scc/webreg/dao/jpa/JpaRegistryDao.java
View file @
7e3d5a47
...
...
@@ -232,16 +232,19 @@ public class JpaRegistryDao extends JpaBaseDao<RegistryEntity, Long> implements
}
@Override
public
List
<
RegistryEntity
>
findByUserAndNotStatus
(
UserEntity
user
,
RegistryStatus
status
)
{
public
List
<
RegistryEntity
>
findByUserAndNotStatus
(
UserEntity
user
,
RegistryStatus
...
status
)
{
CriteriaBuilder
builder
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
RegistryEntity
>
criteria
=
builder
.
createQuery
(
RegistryEntity
.
class
);
Root
<
RegistryEntity
>
root
=
criteria
.
from
(
RegistryEntity
.
class
);
criteria
.
where
(
builder
.
and
(
builder
.
equal
(
root
.
get
(
"user"
),
user
)),
builder
.
notEqual
(
root
.
get
(
"registryStatus"
),
status
));
List
<
Predicate
>
predList
=
new
ArrayList
<
Predicate
>();
predList
.
add
(
builder
.
equal
(
root
.
get
(
"user"
),
user
));
for
(
RegistryStatus
s
:
status
)
predList
.
add
(
builder
.
notEqual
(
root
.
get
(
"registryStatus"
),
s
));
criteria
.
where
(
builder
.
and
(
predList
.
toArray
(
new
Predicate
[]{})));
criteria
.
select
(
root
);
criteria
.
distinct
(
true
);
criteria
.
orderBy
(
builder
.
asc
(
root
.
get
(
"id"
)));
return
em
.
createQuery
(
criteria
).
getResultList
();
}
...
...
bwreg-jpa/src/main/java/edu/kit/scc/webreg/entity/as/ASUserAttrValueEntity.java
View file @
7e3d5a47
...
...
@@ -10,8 +10,6 @@
******************************************************************************/
package
edu.kit.scc.webreg.entity.as
;
import
java.util.Date
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Inheritance
;
...
...
@@ -21,7 +19,6 @@ import javax.persistence.ManyToOne;
import
javax.persistence.Table
;
import
edu.kit.scc.webreg.entity.AbstractBaseEntity
;
import
edu.kit.scc.webreg.entity.UserEntity
;
@Entity
(
name
=
"ASUserAttrValueEntity"
)
@Table
(
name
=
"attribute_src_ua_value"
)
...
...
bwreg-service/src/main/java/edu/kit/scc/webreg/service/RegistryService.java
View file @
7e3d5a47
...
...
@@ -55,7 +55,7 @@ public interface RegistryService extends BaseService<RegistryEntity, Long> {
UserEntity
user
,
RegistryStatus
...
status
);
List
<
RegistryEntity
>
findByUserAndNotStatus
(
UserEntity
user
,
RegistryStatus
status
);
RegistryStatus
...
status
);
List
<
RegistryEntity
>
findRegistriesForDepro
(
String
serviceShortName
);
}
bwreg-service/src/main/java/edu/kit/scc/webreg/service/impl/RegistryServiceImpl.java
View file @
7e3d5a47
...
...
@@ -98,7 +98,7 @@ public class RegistryServiceImpl extends BaseServiceImpl<RegistryEntity, Long> i
}
@Override
public
List
<
RegistryEntity
>
findByUserAndNotStatus
(
UserEntity
user
,
RegistryStatus
status
)
{
public
List
<
RegistryEntity
>
findByUserAndNotStatus
(
UserEntity
user
,
RegistryStatus
...
status
)
{
return
dao
.
findByUserAndNotStatus
(
user
,
status
);
}
...
...
bwreg-webapp/src/main/java/edu/kit/scc/webreg/sec/AuthorizationBean.java
View file @
7e3d5a47
...
...
@@ -21,6 +21,7 @@ import javax.enterprise.context.RequestScoped;
import
javax.inject.Inject
;
import
javax.inject.Named
;
import
edu.kit.scc.webreg.bootstrap.ApplicationConfig
;
import
edu.kit.scc.webreg.entity.AdminRoleEntity
;
import
edu.kit.scc.webreg.entity.ApproverRoleEntity
;
import
edu.kit.scc.webreg.entity.GroupAdminRoleEntity
;
...
...
@@ -71,6 +72,9 @@ public class AuthorizationBean implements Serializable {
@Inject
private
GroupService
groupService
;
@Inject
private
ApplicationConfig
appConfig
;
@PostConstruct
private
void
init
()
{
if
(
sessionManager
.
getUserId
()
==
null
)
...
...
@@ -80,7 +84,7 @@ public class AuthorizationBean implements Serializable {
List
<
GroupEntity
>
groupList
=
groupService
.
findByUser
(
user
);
String
groupString
=
groupsToString
(
groupList
);
userRegistryList
=
registryService
.
findByUserAndNotStatus
(
user
,
RegistryStatus
.
DELETED
);
userRegistryList
=
registryService
.
findByUserAndNotStatus
(
user
,
RegistryStatus
.
DELETED
,
RegistryStatus
.
DEPROVISIONED
);
serviceApproverList
=
new
ArrayList
<
ServiceEntity
>();
serviceAdminList
=
new
ArrayList
<
ServiceEntity
>();
...
...
@@ -252,4 +256,8 @@ public class AuthorizationBean implements Serializable {
public
List
<
ServiceEntity
>
getServiceGroupAdminList
()
{
return
serviceGroupAdminList
;
}
public
ApplicationConfig
getAppConfig
()
{
return
appConfig
;
}
}
bwreg-webapp/src/main/webapp/template/left-side-bar-kit.xhtml
View file @
7e3d5a47
...
...
@@ -25,6 +25,11 @@
<li><span
class=
"ui-icon ui-icon-star"
style=
"display:inline-block; vertical-align: bottom;"
/>
<h:link
outcome=
"#{request.contextPath}/user/index.xhtml"
value=
"#{messages.user_properties}"
/>
</li>
<h:panelGroup
rendered=
"#{authorizationBean.appConfig.getConfigValue('show_user_attribute_source').equalsIgnoreCase('true')}"
>
<li><span
class=
"ui-icon ui-icon-suitcase"
style=
"display:inline-block; vertical-align: bottom;"
/>
<h:link
outcome=
"#{request.contextPath}/user/attribute-sources.xhtml"
value=
"#{messages.my_attribute_sources}"
/>
</li>
</h:panelGroup>
</ul>
</div>
</div>
...
...
bwreg-webapp/src/main/webapp/template/left-side-bar.xhtml
View file @
7e3d5a47
...
...
@@ -25,6 +25,11 @@
<li><span
class=
"ui-icon ui-icon-star"
style=
"display:inline-block; vertical-align: bottom;"
/>
<h:link
outcome=
"#{request.contextPath}/user/index.xhtml"
value=
"#{messages.user_properties}"
/>
</li>
<h:panelGroup
rendered=
"#{authorizationBean.appConfig.getConfigValue('show_user_attribute_source').equalsIgnoreCase('true')}"
>
<li><span
class=
"ui-icon ui-icon-suitcase"
style=
"display:inline-block; vertical-align: bottom;"
/>
<h:link
outcome=
"#{request.contextPath}/user/attribute-sources.xhtml"
value=
"#{messages.my_attribute_sources}"
/>
</li>
</h:panelGroup>
</ul>
</div>
</div>
...
...
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