From 229532c46d7925fd5f1549cae6e0aa73284d896a Mon Sep 17 00:00:00 2001
From: "rainer.breuss"
Date: Tue, 12 May 2020 11:57:11 +0200
Subject: [PATCH 1/4] =?UTF-8?q?show=20info=20box=20that=20describes=20?=
=?UTF-8?q?=C3=96NORM=20content?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/main/webapp/WEB-INF/jsp/freebim_account.jsp | 4 ++++
.../src/main/webapp/resources/css/freebim.css | 11 ++++++++++-
.../src/main/webapp/resources/lang/de-DE.json | 2 ++
.../src/main/webapp/resources/lang/en-US.json | 2 ++
.../src/main/webapp/resources/lang/es-ES.json | 2 ++
.../src/main/webapp/resources/lang/fr-FR.json | 2 ++
6 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/freebim-parent/freebim-webapp/src/main/webapp/WEB-INF/jsp/freebim_account.jsp b/freebim-parent/freebim-webapp/src/main/webapp/WEB-INF/jsp/freebim_account.jsp
index 59208c4..b4c9ac1 100644
--- a/freebim-parent/freebim-webapp/src/main/webapp/WEB-INF/jsp/freebim_account.jsp
+++ b/freebim-parent/freebim-webapp/src/main/webapp/WEB-INF/jsp/freebim_account.jsp
@@ -164,4 +164,8 @@
${appBuildTime}
www.freebim.at
+
+
+
+
diff --git a/freebim-parent/freebim-webapp/src/main/webapp/resources/css/freebim.css b/freebim-parent/freebim-webapp/src/main/webapp/resources/css/freebim.css
index 346aa85..9cc6ff0 100644
--- a/freebim-parent/freebim-webapp/src/main/webapp/resources/css/freebim.css
+++ b/freebim-parent/freebim-webapp/src/main/webapp/resources/css/freebim.css
@@ -1061,7 +1061,7 @@ input[type="radio"] {
}
.freebim-item.path, .freebim-path-rel {
- float: left;
+/* float: left; */
height: 12px;
}
@@ -1177,4 +1177,13 @@ div.freebim-MessageDlg p.message.warning {
#login_error_box {
display: none;
+}
+p.info {
+ max-width: 50%;
+ margin: 12px auto;
+ border: solid 1px lightgray;
+ padding: 4px;
+ border-radius: 4px;
+ box-shadow: 2px 1px lightgrey;
+ background-color: antiquewhite;
}
\ No newline at end of file
diff --git a/freebim-parent/freebim-webapp/src/main/webapp/resources/lang/de-DE.json b/freebim-parent/freebim-webapp/src/main/webapp/resources/lang/de-DE.json
index b64af06..becaf24 100644
--- a/freebim-parent/freebim-webapp/src/main/webapp/resources/lang/de-DE.json
+++ b/freebim-parent/freebim-webapp/src/main/webapp/resources/lang/de-DE.json
@@ -1,4 +1,6 @@
{
+ "INFO_BIB" : "Der Merkmalserver verwaltet Inhalte aus unterschiedlichen Quellen, die in sog. 'Bibliotheken' gegliedert sind. Für die ÖNORM sind nur Inhalte der Bibliotheken 'ÖNORM A6241-1' und 'ÖNORM A6241-2' relevant.",
+ "INFO_STATE" : "Inhalte, deren Status nicht 'geprüft' (grün) ist, sind nicht Teil der ÖNORM.",
"ALL_COMPONENTS": "alle Komponenten",
"APP_FREEBIM_LINK": "http://www.freebim.at/?info",
"APP_VERSION": "Version:",
diff --git a/freebim-parent/freebim-webapp/src/main/webapp/resources/lang/en-US.json b/freebim-parent/freebim-webapp/src/main/webapp/resources/lang/en-US.json
index bc94c00..1c16d91 100644
--- a/freebim-parent/freebim-webapp/src/main/webapp/resources/lang/en-US.json
+++ b/freebim-parent/freebim-webapp/src/main/webapp/resources/lang/en-US.json
@@ -1,4 +1,6 @@
{
+ "INFO_BIB" : "Der Merkmalserver verwaltet Inhalte aus unterschiedlichen Quellen, die in sog. 'Bibliotheken' gegliedert sind. Für die ÖNORM sind nur Inhalte der Bibliotheken 'ÖNORM A6241-1' und 'ÖNORM A6241-2' relevant.",
+ "INFO_STATE" : "Inhalte, deren Status nicht 'geprüft' (grün) ist, sind nicht Teil der ÖNORM.",
"ALL_COMPONENTS": "all Components",
"APP_FREEBIM_LINK": "http://www.freebim.at/?info",
"APP_VERSION": "Version:",
diff --git a/freebim-parent/freebim-webapp/src/main/webapp/resources/lang/es-ES.json b/freebim-parent/freebim-webapp/src/main/webapp/resources/lang/es-ES.json
index b4bda7e..ace1c63 100644
--- a/freebim-parent/freebim-webapp/src/main/webapp/resources/lang/es-ES.json
+++ b/freebim-parent/freebim-webapp/src/main/webapp/resources/lang/es-ES.json
@@ -1,4 +1,6 @@
{
+ "INFO_BIB" : "Der Merkmalserver verwaltet Inhalte aus unterschiedlichen Quellen, die in sog. 'Bibliotheken' gegliedert sind. Für die ÖNORM sind nur Inhalte der Bibliotheken 'ÖNORM A6241-1' und 'ÖNORM A6241-2' relevant.",
+ "INFO_STATE" : "Inhalte, deren Status nicht 'geprüft' (grün) ist, sind nicht Teil der ÖNORM.",
"ALL_COMPONENTS": "todos los componentes",
"APP_FREEBIM_LINK": "http://www.freebim.at/?info",
"APP_VERSION": "Versión:",
diff --git a/freebim-parent/freebim-webapp/src/main/webapp/resources/lang/fr-FR.json b/freebim-parent/freebim-webapp/src/main/webapp/resources/lang/fr-FR.json
index bca4a7b..e4e8edd 100644
--- a/freebim-parent/freebim-webapp/src/main/webapp/resources/lang/fr-FR.json
+++ b/freebim-parent/freebim-webapp/src/main/webapp/resources/lang/fr-FR.json
@@ -1,4 +1,6 @@
{
+ "INFO_BIB" : "Der Merkmalserver verwaltet Inhalte aus unterschiedlichen Quellen, die in sog. 'Bibliotheken' gegliedert sind. Für die ÖNORM sind nur Inhalte der Bibliotheken 'ÖNORM A6241-1' und 'ÖNORM A6241-2' relevant.",
+ "INFO_STATE" : "Inhalte, deren Status nicht 'geprüft' (grün) ist, sind nicht Teil der ÖNORM.",
"ALL_COMPONENTS": "tous les composants",
"APP_FREEBIM_LINK": "http://www.freebim.at/?info",
"APP_VERSION": "Version:",
From 22ef060da9eea35382aeaf5e58a456c79c1e9e64 Mon Sep 17 00:00:00 2001
From: "rainer.breuss"
Date: Tue, 12 May 2020 11:57:58 +0200
Subject: [PATCH 2/4] don't show 'code' of Parameters
---
.../freebim-webapp/src/main/webapp/resources/js/domain.js | 2 +-
.../freebim-webapp/src/main/webapp/resources/js/tree.js | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/freebim-parent/freebim-webapp/src/main/webapp/resources/js/domain.js b/freebim-parent/freebim-webapp/src/main/webapp/resources/js/domain.js
index c62e64a..5c1b070 100644
--- a/freebim-parent/freebim-webapp/src/main/webapp/resources/js/domain.js
+++ b/freebim-parent/freebim-webapp/src/main/webapp/resources/js/domain.js
@@ -5723,7 +5723,7 @@ at.freebim.db.domain.Parameter = {
+ "type" + self.table.csvDelim
+ "status" + self.table.csvDelim;
self.table.cols = [
- d.columns.code,
+// d.columns.code,
{
label: "NAME",
field: nf.NAME,
diff --git a/freebim-parent/freebim-webapp/src/main/webapp/resources/js/tree.js b/freebim-parent/freebim-webapp/src/main/webapp/resources/js/tree.js
index 388344c..c599633 100644
--- a/freebim-parent/freebim-webapp/src/main/webapp/resources/js/tree.js
+++ b/freebim-parent/freebim-webapp/src/main/webapp/resources/js/tree.js
@@ -417,12 +417,12 @@ at.freebim.db.tree = {
field : rf.ORDERING,
type : "text",
sort : true
- }, {
+ }/*, {
label : "CODE",
field : nf.CODE,
type : "text",
sort : true
- },
+ }*/,
{
label : "NAME",
field : "name",
From 61532016ccc8d313792155f1506d0d69ad62cb61 Mon Sep 17 00:00:00 2001
From: "rainer.breuss"
Date: Tue, 12 May 2020 11:58:48 +0200
Subject: [PATCH 3/4] show all content, even when User is GUEST
---
.../db/service/impl/RelationServiceImpl.java | 6 ++--
.../impl/StatedBaseNodeServiceImpl.java | 31 ++++++++++++-------
2 files changed, 22 insertions(+), 15 deletions(-)
diff --git a/freebim-parent/freebim-data-neo4j/src/main/java/at/freebim/db/service/impl/RelationServiceImpl.java b/freebim-parent/freebim-data-neo4j/src/main/java/at/freebim/db/service/impl/RelationServiceImpl.java
index 2a201fe..1e1dd33 100644
--- a/freebim-parent/freebim-data-neo4j/src/main/java/at/freebim/db/service/impl/RelationServiceImpl.java
+++ b/freebim-parent/freebim-data-neo4j/src/main/java/at/freebim/db/service/impl/RelationServiceImpl.java
@@ -502,7 +502,7 @@ public ArrayList getAllRelatedInOut(Long nodeId) {
if (user.getRoles().contains(Role.ROLE_GUEST)) {
b.append("MATCH (n) WHERE ID(n)={id}");
- b.append(" AND (\"StatedBaseNode\" in labels(n) and (n.status = \"CHECKED\" or ");
+ b.append(" AND (\"StatedBaseNode\" in labels(n) and (n.state IN ['CHECKED', 'IMPORTED', 'RELEASED', 'UNDEFINED'] or ");
b.append("(\"BigBangNode\" in labels(n) or \"Library\" in labels(n))))");
b.append(" OPTIONAL MATCH (n)<-[relIn]-(a) WHERE");
@@ -526,7 +526,7 @@ public ArrayList getAllRelatedInOut(Long nodeId) {
b.append(RelationType.BELONGS_TO);
b.append("\"");
- b.append(" AND (\"StatedBaseNode\" in labels(a) and (a.status = \"CHECKED\" or ");
+ b.append(" AND (\"StatedBaseNode\" in labels(a) and (a.state IN ['CHECKED', 'IMPORTED', 'RELEASED', 'UNDEFINED'] or ");
b.append("(\"BigBangNode\" in labels(a) or \"Library\" in labels(a))))");
b.append(" OPTIONAL MATCH (n)-[relOut]->(b) WHERE");
@@ -545,7 +545,7 @@ public ArrayList getAllRelatedInOut(Long nodeId) {
b.append(" type(relOut) <> \"");
b.append(RelationType.BELONGS_TO);
b.append("\"");
- b.append(" AND (\"StatedBaseNode\" in labels(b) and (b.status = \"CHECKED\" or ");
+ b.append(" AND (\"StatedBaseNode\" in labels(b) and (b.state IN ['CHECKED', 'IMPORTED', 'RELEASED', 'UNDEFINED'] or ");
b.append("(\"BigBangNode\" in labels(b) or \"Library\" in labels(b))))");
b.append(" RETURN distinct n, a, b, relIn, relOut, relIn.ts AS t1, relOut.ts AS t2");
} else {
diff --git a/freebim-parent/freebim-data-neo4j/src/main/java/at/freebim/db/service/impl/StatedBaseNodeServiceImpl.java b/freebim-parent/freebim-data-neo4j/src/main/java/at/freebim/db/service/impl/StatedBaseNodeServiceImpl.java
index 98bf16f..9ef5ef3 100644
--- a/freebim-parent/freebim-data-neo4j/src/main/java/at/freebim/db/service/impl/StatedBaseNodeServiceImpl.java
+++ b/freebim-parent/freebim-data-neo4j/src/main/java/at/freebim/db/service/impl/StatedBaseNodeServiceImpl.java
@@ -158,12 +158,21 @@ public T filterResponse(T node, Long now) {
user = this.freebimUserService.get(auth.getName());
if (user != null) {
- if (user.getRoles().contains(Role.ROLE_GUEST) && node instanceof StatedBaseNode
- && node.getState() != State.CHECKED && !(node instanceof BigBangNode)
+ if (user.getRoles().contains(Role.ROLE_GUEST)
+ && node instanceof StatedBaseNode
+ && !(node instanceof BigBangNode)
&& !(node instanceof Library)) {
- return super.filterResponse(null, now);
- } else {
- return super.filterResponse(node, now);
+ switch (node.getState()) {
+ case CHECKED:
+ case IMPORTED:
+ case RELEASED:
+ case UNDEFINED:
+ break;
+ case REJECTED:
+ case TODELETE:
+ default:
+ return super.filterResponse(null, now);
+ }
}
}
@@ -184,22 +193,20 @@ public ArrayList getAllRelevantNodeIds() {
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
+ boolean permissionRequired = false;
// permission required
FreebimUser user = null;
if (auth != null) {
logger.debug("auth.name=[{}]", auth.getName());
user = this.freebimUserService.get(auth.getName());
-
if (user != null) {
if (user.getRoles().contains(Role.ROLE_GUEST)) {
- getRelevantQuery(b,
- "AND (y.state = \"CHECKED\" or (\"BigBangNode\" in labels(y) or \"Library\" in labels(y))) RETURN DISTINCT ID(y) AS id");
- } else {
- getRelevantQuery(b, " RETURN DISTINCT ID(y) AS id");
+ permissionRequired = true;
}
- } else {
- getRelevantQuery(b, " RETURN DISTINCT ID(y) AS id");
}
+ }
+ if (permissionRequired) {
+ getRelevantQuery(b, "AND (y.state IN ['CHECKED', 'IMPORTED', 'RELEASED', 'UNDEFINED'] or ('BigBangNode' in labels(y) or 'Library' in labels(y))) RETURN DISTINCT ID(y) AS id");
} else {
getRelevantQuery(b, " RETURN DISTINCT ID(y) AS id");
}
From fa9ab2019140d779fa69aed32818ccff76c076df Mon Sep 17 00:00:00 2001
From: "rainer.breuss"
Date: Tue, 12 May 2020 11:59:21 +0200
Subject: [PATCH 4/4] bugfixing: search did't work for GUEST-User
---
.../java/at/freebim/db/service/SearchStringNodeService.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/freebim-parent/freebim-data-neo4j/src/main/java/at/freebim/db/service/SearchStringNodeService.java b/freebim-parent/freebim-data-neo4j/src/main/java/at/freebim/db/service/SearchStringNodeService.java
index bf18b45..eec0c77 100644
--- a/freebim-parent/freebim-data-neo4j/src/main/java/at/freebim/db/service/SearchStringNodeService.java
+++ b/freebim-parent/freebim-data-neo4j/src/main/java/at/freebim/db/service/SearchStringNodeService.java
@@ -16,6 +16,8 @@
*****************************************************************************/
package at.freebim.db.service;
+import org.springframework.security.access.annotation.Secured;
+
import at.freebim.db.domain.SearchStringNode;
/**
@@ -33,6 +35,7 @@ public interface SearchStringNodeService extends BaseNodeService