diff --git a/README_SETUP.md b/README_SETUP.md index f024a9f4ced9aae6cfb134c666c587f3b18b21bf..0f437c80af11df263a34676d191ad757bf862571 100644 --- a/README_SETUP.md +++ b/README_SETUP.md @@ -1,3 +1,26 @@ +<!-- + * ** header v3.0 + * This file is a part of the CaosDB Project. + * + * Copyright (C) 2019 Timm Fitschen (t.fitschen@indiscale.com) + * Copyright (C) 2019 IndiScale GmbH (info@indiscale.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + * ** end header +--> + # Folder Structure * The `src` folder contains all source code for the webinterface. @@ -8,6 +31,23 @@ javascript in the `public/xsl/main.xsl`. * The `misc` folder contains a simple http server which is used for running the unit tests. +* The `build.properties.d/` folder contains configuration files for the build. + + +# Build Configuration + +The default configuration is defined in +`build.properties.d/00_default.properties`. + +This file defines default variables which will be replaced in the source files +during the build. + +All files in that directory will be sourced during `make install` and `make test`. +Thus any customized configuration can also be added to that folder by just placing +files in there which override the default values from `00_default.properties`. + +See `build.properties.d/00_default.properties` for more +information. # Setup diff --git a/build.properties.d/00_default.properties b/build.properties.d/00_default.properties new file mode 100644 index 0000000000000000000000000000000000000000..af9b94ab0079ee6ab6241ac6869b8b59a33cff5f --- /dev/null +++ b/build.properties.d/00_default.properties @@ -0,0 +1,56 @@ +# +# ** header v3.0 +# This file is a part of the CaosDB Project. +# +# Copyright (C) 2019 Timm Fitschen (t.fitschen@indiscale.com) +# Copyright (C) 2019 IndiScale GmbH (info@indiscale.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. +# +# ** end header +# + +# Default configuration for the CaosDB Web Interface. +# +# This file will be sourced during the `make install` and `make test` builds +# and must comply with BASH. +# +# All variables with the format "BUILD_[A-Z_]" will replace any variable +# reference of the same name in the source files during the build. +# +# E.g. all occurences of "${BUILD_NAVBAR_LOGO}" will be replaced by the value +# defined below. +# +# Each variable should be described in this file. However, the exact semantics +# depend on the source files and cannot guaranteed here. +# +# Note: The variable BUILD_NUMBER is special and should not be used. It will be +# overridden in the makefile in any case. + +############################################################################## +# Navbar properties +############################################################################## + +# relative file path in the webui to the logo. The actual files resides in +# `./src/core/pics/caosdb_logo_medium.png`, relative to the build directory. +BUILD_NAVBAR_LOGO=pics/caosdb_logo_medium.png +# The name CaosDB is shown right of the logo image. +BUILD_NAVBAR_BRAND_NAME=CaosDB + +############################################################################## +# Footer properties +############################################################################## + +# Link to the data policy statement document. +BUILD_FOOTER_DATA_POLICY_HREF=https://indiscale.com/?page_id=156 diff --git a/makefile b/makefile index 937b85c0508b4f5ed06772572241a100f1550f74..dd6231578e9753a478df89ee4e04422aef1134b4 100644 --- a/makefile +++ b/makefile @@ -4,6 +4,8 @@ # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen +# Copyright (C) 2019 Timm Fitschen (t.fitschen@indiscale.com) +# Copyright (C) 2019 IndiScale GmbH (info@indiscale.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -23,6 +25,7 @@ # Unzip all the external libraries and set up the links in the public folder +SHELL:=/bin/bash PERCENT=% BUILD_NUMBER:=$(shell date +$(PERCENT)s) SQ=\' @@ -45,12 +48,9 @@ LIBS_SUBDIRS = $(addprefix $(LIBS_DIR)/, js css fonts) ALL: install -install: clean cp-src cp-ext cp-conf $(addprefix $(PUBLIC_DIR)/, $(LIBS)) - for f in $$(grep "__BUILD_NUMBER__" -r -l public/); do \ - sed -i "s/__BUILD_NUMBER__/$(BUILD_NUMBER)/g" $$f ; \ - done +install: clean cp-src cp-ext cp-conf $(addprefix $(PUBLIC_DIR)/, $(LIBS)) build_properties -test: clean cp-src cp-ext cp-ext-test cp-conf $(addprefix $(PUBLIC_DIR)/, $(TEST_LIBS)) +test: clean cp-src cp-ext cp-ext-test cp-conf $(addprefix $(PUBLIC_DIR)/, $(TEST_LIBS)) build_properties @for f in $(shell find $(TEST_EXT_DIR) -type f -iname *.js) ; do \ sed -i "/EXTENSIONS/a \<script src=\"$${f#$(TEST_EXT_DIR)/}\" ></script>" $(PUBLIC_DIR)/index.html ; \ echo include $$f; \ @@ -59,10 +59,24 @@ test: clean cp-src cp-ext cp-ext-test cp-conf $(addprefix $(PUBLIC_DIR)/, $(TEST sed -i "/EXTENSIONS/a \<script src=\"$${f#$(SRC_EXT_DIR)/}\" ></script>" $(PUBLIC_DIR)/index.html ; \ echo include $$f; \ done - ln -s $(PUBLIC_DIR) $(PUBLIC_DIR)/webinterface - for f in $$(grep "__BUILD_NUMBER__" -r -l public/); do \ - sed -i "s/__BUILD_NUMBER__/$(BUILD_NUMBER)/g" $$f ; \ + +build_properties: + @set -a ; \ + for f in $$(ls build.properties.d/) ; do source "build.properties.d/$$f" ; done ; \ + BUILD_NUMBER=$(BUILD_NUMBER) ; \ + PROPS=$$(printenv | grep -e "^BUILD_") ; \ + echo "SET BUILD PROPERTIES:" ; \ + for p in $$PROPS ; do echo " $$p" ; done; \ + VARS=$$(printenv | grep -e "^BUILD_" | sed 's/=.*$$/}/' | sed 's/^/$${/') ; \ + for f in $$(find $(PUBLIC_DIR) -type f) ; do \ + echo "BUILD FILE: $$f" ; \ + mv "$$f" "$${f}.tmp" ; \ + envsubst $$VARS < "$${f}.tmp" > "$$f" ; \ + rm "$${f}.tmp" ; \ done + @echo $(BUILD_NUMBER) > $(PUBLIC_DIR)/.build_number + @ln -s $(PUBLIC_DIR) $(PUBLIC_DIR)/$(BUILD_NUMBER) + @ln -s $(PUBLIC_DIR) $(PUBLIC_DIR)/webinterface PORT = 8000 TIMEOUT = 500 @@ -102,7 +116,7 @@ run-qunit: cp-ext: for f in $(wildcard $(SRC_EXT_DIR)/js/*) ; do \ echo "y" | cp -i -r "$$f" $(PUBLIC_DIR)/js/ ; \ - sed -i "/EXTENSIONS/a \<xsl:element name=\"script\"><xsl:attribute name=\"src\"><xsl:value-of select=\"concat\(\$$basepath, 'webinterface/__BUILD_NUMBER__$${f#$(SRC_EXT_DIR)}'\)\" /></xsl:attribute></xsl:element>" $(PUBLIC_DIR)/xsl/main.xsl ; \ + sed -i "/EXTENSIONS/a \<xsl:element name=\"script\"><xsl:attribute name=\"src\"><xsl:value-of select=\"concat\(\$$basepath, 'webinterface/${BUILD_NUMBER}$${f#$(SRC_EXT_DIR)}'\)\" /></xsl:attribute></xsl:element>" $(PUBLIC_DIR)/xsl/main.xsl ; \ done mkdir -p $(PUBLIC_DIR)/html for f in $(wildcard $(SRC_EXT_DIR)/html/*) ; do \ @@ -118,7 +132,7 @@ cp-ext: cp-ext-test: for f in $(wildcard $(TEST_EXT_DIR)/js/*) ; do \ echo "y" | cp -i -r "$$f" $(PUBLIC_DIR)/js/ ; \ - sed -i "/EXTENSIONS/a \<xsl:element name=\"script\"><xsl:attribute name=\"src\"><xsl:value-of select=\"concat\(\$$basepath, 'webinterface/__BUILD_NUMBER__$${f#$(SRC_EXT_DIR)}'\)\" /></xsl:attribute></xsl:element>" $(PUBLIC_DIR)/xsl/main.xsl ; \ + sed -i "/EXTENSIONS/a \<xsl:element name=\"script\"><xsl:attribute name=\"src\"><xsl:value-of select=\"concat\(\$$basepath, 'webinterface/${BUILD_NUMBER}$${f#$(SRC_EXT_DIR)}'\)\" /></xsl:attribute></xsl:element>" $(PUBLIC_DIR)/xsl/main.xsl ; \ done mkdir -p $(PUBLIC_DIR)/html for f in $(wildcard $(TEST_EXT_DIR)/html/*) ; do \ @@ -138,8 +152,6 @@ cp-conf: cp-src: cp -r $(SRC_CORE_DIR) $(PUBLIC_DIR) - echo $(BUILD_NUMBER) > $(PUBLIC_DIR)/.build_number - ln -s $(PUBLIC_DIR) $(PUBLIC_DIR)/$(BUILD_NUMBER) $(PUBLIC_DIR)/%: $(LIBS_DIR)/% ln -s $< $@ diff --git a/src/core/js/annotation.js b/src/core/js/annotation.js index 8a05bd0e03e6b3dc94488bedf27d99c8de32c415..25260abcaf076c0174af1455802e85fcaeeea825 100644 --- a/src/core/js/annotation.js +++ b/src/core/js/annotation.js @@ -1,3 +1,26 @@ +/* + * ** header v3.0 + * This file is a part of the CaosDB Project. + * + * Copyright (C) 2019 IndiScale GmbH (info@indiscale.com) + * Copyright (C) 2019 Timm Fitschen (t.fitschen@indiscale.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + * ** end header + */ + /** * annotation module contains all code for retrieving and posting annotations on * entities. @@ -362,7 +385,7 @@ this.annotation = new function() { return $.ajax({ cache: true, dataType: 'xml', - url: basepath + "webinterface/__BUILD_NUMBER__/xsl/annotation.xsl", + url: basepath + "webinterface/${BUILD_NUMBER}/xsl/annotation.xsl", }); } diff --git a/src/core/js/ext_map.js b/src/core/js/ext_map.js index bef4930e91cfb6889b500c9fdd25a2f5c5847b36..e28b1101d4d310b68de2042c5f1f844b76ec7ea3 100644 --- a/src/core/js/ext_map.js +++ b/src/core/js/ext_map.js @@ -2,7 +2,8 @@ * ** header v3.0 * This file is a part of the CaosDB Project. * - * Copyright (C) 2019 IndiScale GmbH + * Copyright (C) 2019 IndiScale GmbH (info@indiscale.com) + * Copyright (C) 2019 Timm Fitschen (t.fitschen@indiscale.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -962,7 +963,7 @@ var caosdb_map = new function() { // Distance to zoom buttons: button.style.marginTop = "10px"; // TODO implement helper for pictures - button.innerHTML = '<img width="20px" height="20px" style="margin-top: 5px;" src="/webinterface/__BUILD_NUMBER__/pics/select.svg.png">'; + button.innerHTML = '<img width="20px" height="20px" style="margin-top: 5px;" src="/webinterface/${BUILD_NUMBER}/pics/select.svg.png">'; button.onclick = callback; $(button).on("mousedown", (event) => { event.stopPropagation(); }); diff --git a/src/core/js/query_shortcuts.js b/src/core/js/query_shortcuts.js index 7eb92d5e6a22b54e3920d8804aba2c5199c22bd0..9d0bdf3eece6541b48ce4fae1888f096a6603d9c 100644 --- a/src/core/js/query_shortcuts.js +++ b/src/core/js/query_shortcuts.js @@ -32,7 +32,7 @@ * * Loads, generates and expands shortcuts. * - * Global shortcuts are loaded from webinterface/__BUILD_NUMBER__/conf/json/global_query_shortcuts.json, the + * Global shortcuts are loaded from webinterface/${BUILD_NUMBER}/conf/json/global_query_shortcuts.json, the * format is as follows: * * [ diff --git a/src/core/js/webcaosdb.js b/src/core/js/webcaosdb.js index 02c960d4a6a70579615d8ecabc89607a101c0bb4..73356bb105f1da30ca543e4b6ebba2f82a311d4e 100644 --- a/src/core/js/webcaosdb.js +++ b/src/core/js/webcaosdb.js @@ -4,6 +4,8 @@ * * Copyright (C) 2018 Research Group Biomedical Physics, * Max-Planck-Institute for Dynamics and Self-Organization Göttingen + * Copyright (C) 2019 IndiScale GmbH (info@indiscale.com) + * Copyright (C) 2019 Timm Fitschen (t.fitschen@indiscale.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -327,7 +329,7 @@ this.transformation = new function() { * @return {XMLDocument} xslt document. */ this.retrieveXsltScript = async function _rXS(name) { - return await connection.get("webinterface/__BUILD_NUMBER__/xsl/" + name); + return await connection.get("webinterface/${BUILD_NUMBER}/xsl/" + name); } /** @@ -1209,7 +1211,7 @@ function xml2str(xml) { async function load_config(filename) { try { var data = await $.ajax({ - url: connection.getBasePath() + "webinterface/__BUILD_NUMBER__/conf/" + filename, + url: connection.getBasePath() + "webinterface/${BUILD_NUMBER}/conf/" + filename, dataType: "json", }); } catch (error) { diff --git a/src/core/owner.xsl b/src/core/owner.xsl index 85f657ac871ca17b89cb0bce948397766db7bc15..7f03e7c10ebb1edbf0a6fa3879ea0cb840275651 100644 --- a/src/core/owner.xsl +++ b/src/core/owner.xsl @@ -5,6 +5,8 @@ * * Copyright (C) 2018 Research Group Biomedical Physics, * Max-Planck-Institute for Dynamics and Self-Organization Göttingen + * Copyright (C) 2019 Timm Fitschen (t.fitschen@indiscale.com) + * Copyright (C) 2019 IndiScale GmbH (info@indiscale.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -37,7 +39,7 @@ <link rel="stylesheet" type="text/css"> <xsl:attribute name="href"> <xsl:value-of - select="concat($base_uri, 'webinterface/__BUILD_NUMBER__/owner.css')" /> + select="concat($base_uri, 'webinterface/${BUILD_NUMBER}/owner.css')" /> </xsl:attribute> </link> diff --git a/src/core/permissions.xsl b/src/core/permissions.xsl index 61d17e929a9fc90128a592264c8e475f04892ee4..d47903553a80c88822743cedc69af1791ca49251 100644 --- a/src/core/permissions.xsl +++ b/src/core/permissions.xsl @@ -5,6 +5,8 @@ * * Copyright (C) 2018 Research Group Biomedical Physics, * Max-Planck-Institute for Dynamics and Self-Organization Göttingen + * Copyright (C) 2019 Timm Fitschen (t.fitschen@indiscale.com) + * Copyright (C) 2019 IndiScale GmbH (info@indiscale.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -37,7 +39,7 @@ <link rel="stylesheet" type="text/css"> <xsl:attribute name="href"> <xsl:value-of - select="concat($base_uri, 'webinterface/__BUILD_NUMBER__/permissions.css')" /> + select="concat($base_uri, 'webinterface/${BUILD_NUMBER}/permissions.css')" /> </xsl:attribute> </link> diff --git a/src/core/webcaosdb.xsl b/src/core/webcaosdb.xsl index e6dccff3c21c0d422937dc3c716db1d5ae5c0d5c..0a98d7b52721ed05726b5d759e6839435cdceb23 100644 --- a/src/core/webcaosdb.xsl +++ b/src/core/webcaosdb.xsl @@ -5,6 +5,8 @@ * * Copyright (C) 2018 Research Group Biomedical Physics, * Max-Planck-Institute for Dynamics and Self-Organization Göttingen + * Copyright (C) 2019 Timm Fitschen (t.fitschen@indiscale.com) + * Copyright (C) 2019 IndiScale GmbH (info@indiscale.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -49,7 +51,7 @@ </body> <footer> See data policy statement - <a href="https://indiscale.com/?page_id=156">here </a> + <a href="${BUILD_FOOTER_DATA_POLICY_HREF}">here </a> </footer> </html> </xsl:template> diff --git a/src/core/xsl/main.xsl b/src/core/xsl/main.xsl index 280098129b9b5d6f68dbe0ea1a0ff707e7a3fc2f..83fe6739d6ec213172801bf98dfc4143fa08265a 100644 --- a/src/core/xsl/main.xsl +++ b/src/core/xsl/main.xsl @@ -5,7 +5,8 @@ * * Copyright (C) 2018 Research Group Biomedical Physics, * Max-Planck-Institute for Dynamics and Self-Organization Göttingen - * Copyright (C) 2019 IndiScale GmbH + * Copyright (C) 2019 IndiScale GmbH (info@indiscale.com) + * Copyright (C) 2019 Timm Fitschen (t.fitschen@indiscale.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -45,83 +46,83 @@ <xsl:element name="link"> <xsl:attribute name="rel">stylesheet</xsl:attribute> <xsl:attribute name="href"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/css/bootstrap.css')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/css/bootstrap.css')"/> </xsl:attribute> </xsl:element> <xsl:element name="link"> <xsl:attribute name="rel">stylesheet</xsl:attribute> <xsl:attribute name="href"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/css/webcaosdb.css')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/css/webcaosdb.css')"/> </xsl:attribute> </xsl:element> <xsl:element name="link"> <xsl:attribute name="rel">stylesheet</xsl:attribute> <xsl:attribute name="href"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/css/dropzone.css')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/css/dropzone.css')"/> </xsl:attribute> </xsl:element> <xsl:element name="link"> <xsl:attribute name="rel">stylesheet</xsl:attribute> <xsl:attribute name="href"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/css/leaflet.css')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/css/leaflet.css')"/> </xsl:attribute> </xsl:element> <xsl:element name="link"> <xsl:attribute name="rel">stylesheet</xsl:attribute> <xsl:attribute name="href"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/css/leaflet-coordinates.css')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/css/leaflet-coordinates.css')"/> </xsl:attribute> </xsl:element> <xsl:element name="link"> <xsl:attribute name="rel">stylesheet</xsl:attribute> <xsl:attribute name="href"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/css/bootstrap-select.css')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/css/bootstrap-select.css')"/> </xsl:attribute> </xsl:element> </xsl:template> <xsl:template name="caosdb-head-js"> <script> - var caosdb_webui_build_number = "__BUILD_NUMBER__"; + var caosdb_webui_build_number = "${BUILD_NUMBER}"; window.sessionStorage.caosdbBasePath = "<xsl:value-of select="$basepath"/>"; </script> <xsl:element name="script"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/js/jquery.js')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/js/jquery.js')"/> </xsl:attribute> </xsl:element> <xsl:element name="script"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/js/bootstrap.js')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/js/bootstrap.js')"/> </xsl:attribute> </xsl:element> <xsl:element name="script"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/js/bootstrap-select.js')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/js/bootstrap-select.js')"/> </xsl:attribute> </xsl:element> <xsl:element name="script"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/js/state-machine.js')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/js/state-machine.js')"/> </xsl:attribute> </xsl:element> <xsl:element name="script"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/js/showdown.js')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/js/showdown.js')"/> </xsl:attribute> </xsl:element> <xsl:element name="script"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/js/dropzone.js')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/js/dropzone.js')"/> </xsl:attribute> </xsl:element> <xsl:element name="script"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/js/loglevel.js')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/js/loglevel.js')"/> </xsl:attribute> </xsl:element> <xsl:element name="script"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/js/webcaosdb.js')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/js/webcaosdb.js')"/> </xsl:attribute> </xsl:element> <script> @@ -129,77 +130,77 @@ </script> <xsl:element name="script"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/js/caosdb.js')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/js/caosdb.js')"/> </xsl:attribute> </xsl:element> <xsl:element name="script"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/js/form_elements.js')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/js/form_elements.js')"/> </xsl:attribute> </xsl:element> <xsl:element name="script"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/js/preview.js')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/js/preview.js')"/> </xsl:attribute> </xsl:element> <xsl:element name="script"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/js/ext_references.js')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/js/ext_references.js')"/> </xsl:attribute> </xsl:element> <xsl:element name="script"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/js/ext_xls_download.js')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/js/ext_xls_download.js')"/> </xsl:attribute> </xsl:element> <xsl:element name="script"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/js/query_shortcuts.js')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/js/query_shortcuts.js')"/> </xsl:attribute> </xsl:element> <xsl:element name="script"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/js/annotation.js')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/js/annotation.js')"/> </xsl:attribute> </xsl:element> <xsl:element name="script"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/js/edit_mode.js')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/js/edit_mode.js')"/> </xsl:attribute> </xsl:element> <xsl:element name="script"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/js/leaflet.js')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/js/leaflet.js')"/> </xsl:attribute> </xsl:element> <xsl:element name="script"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/js/leaflet-graticule.js')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/js/leaflet-graticule.js')"/> </xsl:attribute> </xsl:element> <xsl:element name="script"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/js/leaflet-latlng-graticule.js')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/js/leaflet-latlng-graticule.js')"/> </xsl:attribute> </xsl:element> <xsl:element name="script"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/js/leaflet-coordinates.js')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/js/leaflet-coordinates.js')"/> </xsl:attribute> </xsl:element> <xsl:element name="script"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/js/proj4.js')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/js/proj4.js')"/> </xsl:attribute> </xsl:element> <xsl:element name="script"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/js/proj4leaflet.js')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/js/proj4leaflet.js')"/> </xsl:attribute> </xsl:element> <xsl:element name="script"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/js/ext_map.js')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/js/ext_map.js')"/> </xsl:attribute> </xsl:element> <!--EXTENSIONS--> diff --git a/src/core/xsl/navbar.xsl b/src/core/xsl/navbar.xsl index 9152e5bae513b95afb9e85dfad6b2faab987780c..ca5aea7cf552fb717003b61f858a816a41d94dbd 100644 --- a/src/core/xsl/navbar.xsl +++ b/src/core/xsl/navbar.xsl @@ -5,6 +5,8 @@ * * Copyright (C) 2018 Research Group Biomedical Physics, * Max-Planck-Institute for Dynamics and Self-Organization Göttingen + * Copyright (C) 2019 IndiScale GmbH (info@indiscale.com) + * Copyright (C) 2019 Timm Fitschen (t.fitschen@indiscale.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -49,14 +51,16 @@ <span class="icon-bar"></span> </button> <a class="navbar-brand"> - <xsl:element name="img"> + <xsl:if test="${BUILD_NAVBAR_BRAND_NAME} != ''"> <xsl:attribute name="class">caosdb-logo</xsl:attribute> + </xsl:if> + <xsl:element name="img"> <xsl:attribute name="src"> - <xsl:value-of select="concat($basepath,'webinterface/__BUILD_NUMBER__/pics/caosdb_logo_medium.png')"/> + <xsl:value-of select="concat($basepath,'webinterface/${BUILD_NUMBER}/${BUILD_NAVBAR_LOGO}')"/> </xsl:attribute> </xsl:element> - CaosDB - </a> + ${BUILD_NAVBAR_BRAND_NAME} + </a> </div> <div class="collapse navbar-collapse" id="top-navbar"> <xsl:if test="/Response/UserInfo"> diff --git a/test/core/js/modules/webcaosdb.js.js b/test/core/js/modules/webcaosdb.js.js index 590f05bba438c940dbe9a04551cdc4d35a5e209e..aba5d845d4032514f17bcddac0916cd73d421018 100644 --- a/test/core/js/modules/webcaosdb.js.js +++ b/test/core/js/modules/webcaosdb.js.js @@ -4,8 +4,8 @@ * * Copyright (C) 2018 Research Group Biomedical Physics, * Max-Planck-Institute for Dynamics and Self-Organization Göttingen + * Copyright (C) 2019 IndiScale GmbH (info@indiscale.com) * Copyright (C) 2019 Timm Fitschen (t.fitschen@indiscale.com), Göttingen - * Copyright (C) 2019 IndiScale GmbH, Göttingen * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -155,7 +155,7 @@ QUnit.test("get", function(assert) { assert.expect(4); assert.ok(connection.get, "function available"); let done = assert.async(2); - connection.get("webinterface/xsl/entity.xsl").then(function(resolve) { + connection.get("webinterface/${BUILD_NUMBER}/xsl/entity.xsl").then(function(resolve) { assert.equal(resolve.toString(), "[object XMLDocument]", "entity.xsl returned."); done(); }); @@ -185,7 +185,7 @@ QUnit.test("retrieveXsltScript", function(assert) { done(); }); transformation.retrieveXsltScript("asdfasdfasdf.xsl").then(xsl => xsl, err => { - assert.equal(err.toString().split(" - ")[0], "Error: GET webinterface/__BUILD_NUMBER__/xsl/asdfasdfasdf.xsl returned with HTTP status 404", "not found."); + assert.equal(err.toString().split(" - ")[0], "Error: GET webinterface/${BUILD_NUMBER}/xsl/asdfasdfasdf.xsl returned with HTTP status 404", "not found."); done(); }); }); diff --git a/test/core/xml/test_case_file_preview.xml b/test/core/xml/test_case_file_preview.xml index ae76ecf2e66025774bcc68ba42164831f42127c0..8c2320cf1c4eb44fede4ec0e68e55df62f3f38c7 100644 --- a/test/core/xml/test_case_file_preview.xml +++ b/test/core/xml/test_case_file_preview.xml @@ -5,6 +5,8 @@ * * Copyright (C) 2018 Research Group Biomedical Physics, * Max-Planck-Institute for Dynamics and Self-Organization Göttingen + * Copyright (C) 2019 Timm Fitschen (t.fitschen@indiscale.com) + * Copyright (C) 2019 IndiScale GmbH (info@indiscale.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -21,7 +23,6 @@ * * ** end header --> -<?xml-stylesheet type="text/xsl" href="https://dumiatis01:8833/playground/webinterface/webcaosdb.xsl" ?> <Response username="user" realm="PAM" srid="19b9c846d7c4519429be6a9df551b1df" timestamp="1503319134742" baseuri="https://host:port/root" count="1"> <File id="77176" name="test.txt" checksum="CF83E1357EEFB8BDF1542850D66D8007D620E4050B5715DC83F4A921D36CE9CE47D0D13C5D85F2B0FF8318D2877EEC2F63B931BD47417A81A538327AF927DA3E" path="/path/to/test.txt" size="0"> <Permissions> diff --git a/test/core/xml/test_case_preview_entities.xml b/test/core/xml/test_case_preview_entities.xml index 2a24f51e1e9d665c36d03393653f87c2c495b2d8..1e600004df0607bfd5ef682d5441027aea536b7a 100644 --- a/test/core/xml/test_case_preview_entities.xml +++ b/test/core/xml/test_case_preview_entities.xml @@ -5,6 +5,8 @@ * * Copyright (C) 2018 Research Group Biomedical Physics, * Max-Planck-Institute for Dynamics and Self-Organization Göttingen + * Copyright (C) 2019 Timm Fitschen (t.fitschen@indiscale.com) + * Copyright (C) 2019 IndiScale GmbH (info@indiscale.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -21,7 +23,6 @@ * * ** end header --> -<?xml-stylesheet type="text/xsl" href="https://smaxx15:8433/mpidsserver/webinterface/webcaosdb.xsl" ?> <Response username="user" realm="PAM" srid="f04608453407431fa208390742db285b" timestamp="1503058894805" baseuri="https://host:port/root" count="3"> <Record id="142"> <Permissions>