Skip to content
Snippets Groups Projects
Commit 81e7d18e authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

Merge branch 'dev' into f-fix-datetime

parents 663d105d 7a372ef8
No related branches found
No related tags found
2 merge requests!123Release 0.13.0,!121FIX: breaking datetime in edit mode
Pipeline #41910 passed
Showing
with 181 additions and 248 deletions
......@@ -108,7 +108,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
WebUI Legacy Adapter](https://gitlab.com/caosdb/caosdb-webui-legacy-adapter))
when the new query panel is used.
### Changed (for changes in existing functionality)
### Changed
* Changed name from LinkAhead to LinkAhead.
* The new query panel from the [CaosDB WebUI Legacy
Adapter](https://gitlab.com/caosdb/caosdb-webui-legacy-adapter) is now the
......@@ -156,7 +158,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* [#189](https://gitlab.com/caosdb/caosdb-webui/-/issues/189) The order in which
the properties of (Records of) a RecordType are displayed can be configured.
### Changed (for changes in existing functionality)
### Changed
* Version bump of caosdb_map module (0.5.0):
* Added configurable entityLayers
......@@ -171,7 +173,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [0.9.0] - 2022-11-02
(Florian Spreckelsen)
### Changed (for changes in existing functionality)
### Changed
* ext_references: names will be shown instead of file names if they exist
......@@ -199,18 +201,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
PROPERTY LIKE '*john*' AND A PROPERTY LIKE '*gibson*'`, not in `FIND ENTITY
WHICH HAS A PROPERTY LIKE '*john gibson*'` as before).
### Deprecated
### Removed
### Fixed
* Styling of the selects in the edit_mode.
### Security
### Documentation
## [0.7.0] - 2022-05-31
(Florian Spreckelsen)
......@@ -248,7 +242,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* `BUILD_MODULE_SHOW_ID_IN_LABEL` build variable with which the showing of
entity ids together with their names if it is enabled (disabled by default).
* Introduced `caosdb-f-form-required-marker` and `caosdb-f-form-required-label`
css classes for the markers of required fields in CaosDB form elements.
css classes for the markers of required fields in LinkAhead form elements.
* The navbar has now an html id `caosdb-navbar-full`
### Changed
......@@ -259,8 +253,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
backwards-compatible for the map config. Clients need to update their
version string in their config file, tho.
### Deprecated
### Removed
* globla `setNameID` function (replaced by `_setDescriptionNameID` which should
......@@ -274,10 +266,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Fixed an issue whereby missing property descriptions in the edit mode would
lead to wrongly detected entity updates in the server
### Security
### Documentation
## [0.4.2] - 2021-12-06
### Added (for new features, dependecies etc.)
......@@ -297,59 +285,46 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
`DISABLED` by default.
* Added button to version history panel that allows restoring old versions
### Changed (for changes in existing functionality)
### Changed
* Default footer elements contain invalid links for imprint, contact, and data-policy now
### Deprecated (for soon-to-be removed features)
### Removed (for now removed features)
### Removed
* Build property `BUILD_CUSTOM_IMPRINT`. Please use BUILD_FOOTER_IMPRINT_HREF
and link a document instead. You can always put a html page to
`src/ext/html/` and link to that.
### Fixed (for any bug fixes)
### Fixed
- #156
- #251
### Security (in case of vulnerabilities)
### Documentation (for notable additions or changes of the documentation)
## [0.4.1] - 2021-11-04
### Added (for new features, dependecies etc.)
### Added
* `form_panel` module for conveniently creating a panel for web forms.
* `restore_old_version` function to base functionality (caosdb.js)
* buttons to the version history modal that allow restoring older versions
### Changed (for changes in existing functionality)
### Changed
* Default footer elements contain invalid links for imprint, contact, and data-policy now
### Deprecated (for soon-to-be removed features)
### Removed (for now removed features)
### Removed
* Build property `BUILD_CUSTOM_IMPRINT`. Please use BUILD_FOOTER_IMPRINT_HREF
and link a document instead. You can always put a html page to
`src/ext/html/` and link to that.
### Fixed (for any bug fixes)
### Fixed
* Auto-completion and edit_mode can handle entity names with empty spaces better now
* [#251](https://gitlab.indiscale.com/caosdb/src/caosdb-webui/-/issues/251) - Data loss when editing Entities with URL-like properties
### Security (in case of vulnerabilities)
### Documentation (for notable additions or changes of the documentation)
## [0.4.0] - 2021-10-28
### Added (for new features, dependecies etc.)
### Added
* Module `ext_qrcode` which generates a QR Code for an entity (pointing to the
the head or the exact version).
......@@ -357,23 +332,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
bookmarks will result in the URI being too lang and bookmarks will have to be
cleared manually.
### Changed (for changes in existing functionality)
### Deprecated (for soon-to-be removed features)
### Removed (for now removed features)
### Removed
* `getEntityId`, a former duplicate of `getEntityID` which must be used instead.
### Fixed (for any bug fixes)
### Security (in case of vulnerabilities)
### Documentation (for notable additions or changes of the documentation)
### Documentation
## [v0.4.0-rc1] - 2021-06-16
### Added (for new features, dependecies etc.)
### Added
- `ext_applicable` module for building fancy features which append
functionality to entities (EXPERIMENTAL).
......@@ -386,7 +353,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added a tutorial for the edit mode to the documentation
- Documentation on how to customize reference resolving
### Changed (for changes in existing functionality)
### Changed
- Updated from bootstrap 3 to bootstrap 5. This is a major change which will
possibly break existing custom implementations (e.g. a custom welcome page)
......@@ -397,12 +364,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Moved the resolving of references to Person Records to separate
example which can be disabled
### Deprecated (for soon-to-be removed features)
### Deprecated
- css-class `.caosdb-property-text-value`. Please use
`.caosdb-f-property-text-value` or `.caosdb-v-property-text-value` instead.
### Removed (for now removed features)
### Removed
* `#subnav` element from navbar which was previously used for spacing
* `caosdb.form.ready` event
......@@ -418,31 +385,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
changing the map view.
- #200 - Re-enabled the file-upload button
### Security (in case of vulnerabilities)
## [v0.3.1] - 2021-06-15
This is the last Bootstrap-3 compatible release.
### Added (for new features, dependecies etc.)
### Added
* Displaying and interacting with the entity state.
* Change password functionality for users of the internal user source. Disable
with `BUILD_MODULE_USER_MANAGEMENT=DISABLED` and set the user realm with
`BUILD_MODULE_USER_MANAGEMENT_CHANGE_OWN_PASSWORD_REALM=CaosDB`.
`BUILD_MODULE_USER_MANAGEMENT_CHANGE_OWN_PASSWORD_REALM=CAOSDB`.
* Visually highlighted drop zones for properties and parents in the edit_mode.
* two new field types for the form_elements module, `file` and `select`. See
the module documentation for more information.
### Changed (for changes in existing functionality)
### Changed
- The heading attributes datatype, path, checksum and size are now placed
in a `details` html element.
### Deprecated (for soon-to-be removed features)
### Deprecated
* Any bootstrap-3 dependencies. Please prepare upgrading to bootstrap-5 with the next release.
### Removed (for now removed features)
### Removed
* `ext_revisions` module. This module was only a work-around which had been
used for versioning functionality before the native versioning was
......@@ -456,11 +421,9 @@ This is the last Bootstrap-3 compatible release.
* Several minor cosmetic flaws
* Fixed edit mode for Safari 11.
### Security (in case of vulnerabilities)
## [v0.3.0] - 2021-02-10
### Added (for new features, dependecies etc.)
### Added
- The versioning model has a new styling and can show and tsv-export the full
version history now.
......@@ -482,16 +445,12 @@ This is the last Bootstrap-3 compatible release.
* Automated documentation builds: `make doc`
- documentation on queries
### Changed (for changes in existing functionality)
### Changed
* ext_map version bumped to 0.4
- enabled and enhanced autocompletion
* Login form is hidden behind another button.
### Deprecated (for soon-to-be removed features)
### Removed (for now removed features)
### Fixed
- #144 (Select with ANY VERSION OF).
......@@ -503,27 +462,15 @@ This is the last Bootstrap-3 compatible release.
- #158 show preview if the entity is too large for the viewport if
bottom line is in view.
### Security (in case of vulnerabilities)
## [v0.2.1] - 2020-09-07
### Added (for new features, dependecies etc.)
### Added
* `ext_jupyterdrag` (v0.1) module for dragging entities into jupyter notebooks.
### Changed (for changes in existing functionality)
### Deprecated (for soon-to-be removed features)
### Removed (for now removed features)
### Fixed
### Security (in case of vulnerabilities)
## [v0.2] - 2020-09-02
### Added (for new features, dependecies etc.)
### Added
* Build variable `EXT_REFERENCES_CUSTOM_REFERENCE_RESOLVER`. The value of this
variable must be module which has at least a `resolve(id)` function, which
......@@ -546,30 +493,26 @@ This is the last Bootstrap-3 compatible release.
* `preview` also works for versioned references
* `edit_mode` prevents the user from editing old versions of an entity.
### Changed (for changes in existing functionality)
### Changed
- The `navbar.add_button` signatur changed to `add_button(button, options)`.
See the doc string of that method for more information.
- added a layout argument to the create_plot function of ext_bottom_line
### Deprecated (for soon-to-be removed features)
### Deprecated
* css class `caosdb-property-text-value` is deprecated because different
functionality interpreted it differently and most of the uses of this class
have already been removed and replaced by specialized classes.
### Removed (for now removed features)
### Fixed
* #101 - loading of A LOT of references in `ext_references` slows down the
webui or even freezes the brower.
* Fixed a bug where the Tour would lose its state upon page reload.
### Security (in case of vulnerabilities)
## [v0.2-rc.1] - 2020-04-10
### Added (for new features, dependecies etc.)
### Added
* ext_bottom_line module (v0.1 - Experimental)
* A module which adds a preview section where any kind of summarizing
......@@ -613,7 +556,7 @@ This is the last Bootstrap-3 compatible release.
Works only for non-LIST properties
* Edit Mode - switch the LISTishness of entity properties back and forth.
### Changed (for changes in existing functionality)
### Changed
* The old `caosdb-property-row` CSS class has been replaced by
`caosdb-v-property-row` for styling and `caosdb-f-property` for functional
......@@ -640,25 +583,22 @@ This is the last Bootstrap-3 compatible release.
`annotation` module now (which uses the `markdown` module as back-end, tho).
* updated QUnit test framework to 2.9.2
### Deprecated (for soon-to-be removed features)
### Deprecated
* Image Preview in the FileSystem. The functionality is to be replaced by real
thumbnails, which cover also non-image data-formats. The thumbnails resource
is part of the new file system API of the CaosDB Server which is currently
is part of the new file system API of the LinkAhead Server which is currently
under development.
### Removed (for now removed features)
### Removed
* Removed non-informative tests for webcaosdb.css
* Hard-coded image and video preview in the entity panel. The preview of images
and videos is controlled by the `ext_bottom_line` module now.
### Fixed (for any bug fixes)
### Fixed
* #95 - Edit Mode removes property values of reference properties when server
response for possible reference targets is empty.
* Bug in `getPropertyFromElement` (see above) which returned the unit as the
property value if the actual value was an empty string.
### Security (in case of vulnerabilities)
......@@ -19,7 +19,7 @@ authors:
- family-names: Luther
given-names: Stefan
orcid: https://orcid.org/0000-0001-7214-8125
title: CaosDB - WebUI
title: LinkAhead - WebUI
version: 0.12.0
doi: 10.3390/data4020083
date-released: 2023-05-31
* CaosDB Server 0.9.0
* LinkAhead Server 0.9.0
* Make 4.2.0
# Java Script Libraries (included in this repository)
......
#
# ** header v3.0
# This file is a part of the CaosDB Project.
# This file is a part of the LinkAhead Project.
#
# Copyright (C) 2018 Research Group Biomedical Physics,
# Max-Planck-Institute for Dynamics and Self-Organization Göttingen
......
......@@ -3,8 +3,8 @@
## Welcome
This is the **CaosDB Web User Interface** repository and a part of the
CaosDB project.
This is the **LinkAhead Web User Interface** repository and a part of the
LinkAhead project.
## Setup
......@@ -14,36 +14,36 @@ setup this code.
## Further Reading
Please refer to the [official documentation](https://docs.indiscale.com/caosdb-webui/) for more information.
Please refer to the [official documentation](https://docs.indiscale.com/linkhead-webui/) for more information.
## Contributing
Thank you very much to all contributers—[past, present](https://gitlab.com/caosdb/caosdb/-/blob/dev/HUMANS.md), and prospective ones.
Thank you very much to all contributers—[past, present](https://gitlab.com/linkahead/linkahead-meta/-/blob/dev/HUMANS.md), and prospective ones.
### Code of Conduct
By participating, you are expected to uphold our [Code of Conduct](https://gitlab.com/caosdb/caosdb/-/blob/dev/CODE_OF_CONDUCT.md).
By participating, you are expected to uphold our [Code of Conduct](https://gitlab.com/linkahead/linkahead-meta/-/blob/dev/CODE_OF_CONDUCT.md).
### How to Contribute
* You found a bug, have a question, or want to request a feature? Please
[create an issue](https://gitlab.com/caosdb/caosdb-webui/-/issues).
[create an issue](https://gitlab.com/linkahead/linkahead-webui/-/issues).
* You want to contribute code? Please fork the repository and create a merge
request in GitLab and choose this repository as target. Make sure to select
"Allow commits from members who can merge the target branch" under Contribution
when creating the merge request. This allows our team to work with you on your request.
- If you have a suggestion for the [documentation](https://docs.indiscale.com/caosdb-webui/),
- If you have a suggestion for the [documentation](https://docs.indiscale.com/linkhead-webui/),
the preferred way is also a merge request as describe above (the documentation resides in `src/doc`).
However, you can also create an issue for it.
- You can also contact us at **info (AT) caosdb.org** and join the
CaosDB community on
[#caosdb:matrix.org](https://matrix.to/#/!unwwlTfOznjEnMMXxf:matrix.org).
- You can also contact us at **info (AT) indiscale.com** and join the
LinkAhead community on
[#linkahead:matrix.org](https://matrix.to/#/!unwwlTfOznjEnMMXxf:matrix.org).
## License
* Copyright (C) 2018 Research Group Biomedical Physics, Max Planck Institute
for Dynamics and Self-Organization Göttingen.
* Copyright (C) 2020-2021 Indiscale GmbH <info@indiscale.com>
* Copyright (C) 2020-2023 Indiscale GmbH <info@indiscale.com>
All files in this repository are licensed under a [GNU Affero General Public
License](LICENCE.md) (version 3 or later).
<!--
* ** header v3.0
* This file is a part of the CaosDB Project.
* This file is a part of the LinkAhead Project.
*
* Copyright (C) 2019 Timm Fitschen (t.fitschen@indiscale.com)
* Copyright (C) 2019 IndiScale GmbH (info@indiscale.com)
......@@ -22,7 +22,7 @@
-->
# Build and install the Web Interface
Here, we document how to install and build the CaosDB Web Interface. If you are
Here, we document how to install and build the LinkAhead Web Interface. If you are
only interested in how to use it, please continue [here](tutorials/index).
## Folder Structure
......
# Release Guidelines for the CaosDB Web Interface
# Release Guidelines for the LinkAhead Web Interface
This document specifies release guidelines in addition to the generel release
guidelines of the CaosDB Project
([RELEASE_GUIDELINES.md](https://gitlab.com/caosdb/caosdb/blob/dev/RELEASE_GUIDELINES.md))
This document specifies release guidelines in addition to the general release
guidelines of the LinkAhead Project
([RELEASE_GUIDELINES.md](https://gitlab.com/linkahead/linkahead-meta/blob/dev/RELEASE_GUIDELINES.md))
## General Prerequisites
......@@ -18,7 +18,7 @@ guidelines of the CaosDB Project
2. Check all general prerequisites.
3. Update the version:
- Update `src/doc/conf.py` version and check that the correct caosdb-server
- Update `src/doc/conf.py` version and check that the correct linkahead-server
version is listed in `DEPENDENCIES.md`.
- `CITATION.cff` (update version and date)
......
#
# ** header v3.0
# This file is a part of the CaosDB Project.
# This file is a part of the LinkAhead Project.
#
# Copyright (C) 2019 Timm Fitschen (t.fitschen@indiscale.com)
# Copyright (C) 2019 IndiScale GmbH (info@indiscale.com)
......@@ -21,7 +21,7 @@
# ** end header
#
# Default configuration for the CaosDB Web Interface.
# Default configuration for the LinkAhead Web Interface.
#
# This file will be sourced during the `make install` and `make test` builds
# and must comply with BASH.
......@@ -77,12 +77,20 @@ BUILD_LONG_TEXT_PROPERTY_THRESHOLD_SINGLE=140
##############################################################################
# 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 to the right of the logo image.
BUILD_NAVBAR_BRAND_NAME=CaosDB
BUILD_TITLE_BRAND_NAME=CaosDB
BUILD_FAVICON=pics/caosdb_logo_42.png
# `./src/core/pics/linkahead_logo_medium.png`, relative to the build directory.
BUILD_NAVBAR_LOGO="pics/logo_linkahead_no_subtitle_144x25.png"
# The name LinkAhead is shown to the right of the logo image.
BUILD_NAVBAR_BRAND_NAME="&#x200b;"
BUILD_TITLE_BRAND_NAME="LinkAhead"
BUILD_FAVICON="pics/linkahead_icon_64.png"
##############################################################################
# Background properties
##############################################################################
BUILD_WELCOME_BACKGROUND_1="pics/bg_kCrrUx7US04.jpg"
BUILD_WELCOME_BACKGROUND_2="pics/bg_OxHPDs4WV8Y.jpg"
BUILD_WELCOME_BACKGROUND_3="pics/bg_txQT60OPSwA.jpg"
BUILD_WELCOME_BACKGROUND_4="pics/bg_WDbuusPOnkM.jpg"
##############################################################################
# queryForm properties
......@@ -112,11 +120,11 @@ BUILD_FREE_SEARCH_ROLE_NAME_FACET_OPTIONS=
# Link to the data policy statement document.
BUILD_FOOTER_DATA_POLICY_HREF="Please configure me!"
# Contact mail or link to contact information for the responsible administrator of this caosdb server instance.
# Contact mail or link to contact information for the responsible administrator of this linkahead server instance.
BUILD_FOOTER_CONTACT_HREF="Please configure me!"
#BUILD_FOOTER_CONTACT_HREF=mailto:info@indiscale.com
# Link to imprint for this caosdb server instance.
# Link to imprint for this linkahead server instance.
BUILD_FOOTER_IMPRINT_HREF="Please configure me!"
#BUILD_FOOTER_IMPRINT_HREF=https://www.indiscale.com/imprint/
......@@ -124,22 +132,19 @@ BUILD_FOOTER_IMPRINT_HREF="Please configure me!"
BUILD_FOOTER_DOCS_HREF="https://docs.indiscale.com"
# Link to sources (should almost never be changed (maybe for additional sources))
BUILD_FOOTER_SOURCES_HREF="https://gitlab.com/caosdb"
BUILD_FOOTER_SOURCES_HREF="https://gitlab.com/linkahead"
# Link to license (should almost never be changed (maybe for other languages))
BUILD_FOOTER_LICENCE_HREF="https://www.gnu.org/licenses/agpl-3.0.en.html"
# Custom footer elements can be placed here (will be placed inside a <div>
# element).
BUILD_FOOTER_CUSTOM_ELEMENT_ONE=
# BUILD_FOOTER_CUSTOM_ELEMENT_ONE='<p>Some content <img
# src="/webinterface/${BUILD_NUMBER}/pics/some_image.png"/>'
BUILD_FOOTER_CUSTOM_ELEMENT_ONE='<p class="caosdb-footer-element"> <a href="https://getlinkahead.com"><img src="/webinterface/pics/logo_linkahead_no_subtitle_dark_bg_144x25.png" style="vertical-align: -7px; margin-right: 6px"/> </a> – Thinking data management ahead. </p>'
BUILD_FOOTER_CUSTOM_ELEMENT_TWO='<p class="caosdb-footer-element"> <a href="https://indiscale.com"><img src="/webinterface/pics/logo_indiscale_no_subtitle_dark_bg_156x25.png" style="vertical-align: -5px; margin-right: 3px;"/> </a> – We make individual data management scalable. </p>'
# Files from the `build.properties.files` directory can also be included here
# These files will also have a second step of variable substitution with
# ${BUILD_NUMBER}.
BUILD_FOOTER_CUSTOM_ELEMENT_TWO=
# BUILD_FOOTER_CUSTOM_ELEMENT_TWO=$(cat footer_element_2.html)
##############################################################################
# ext_trigger_crawler_form properties
......
<!--
* ** header v3.0
* This file is a part of the CaosDB Project.
* This file is a part of the LinkAhead Project.
*
* Copyright (C) 2019 IndiScale GmbH
*
......
#!/usr/bin/env python3
import sys
import caosdb as db
import linkahead as db
_PASSWORD = "Password1!"
......@@ -98,7 +98,6 @@ def setup_state_model():
unpublished_state.acl = unpublished_acl
unpublished_state.insert()
review_acl = db.ACL()
review_acl.grant(role="publisher", permission="*")
review_acl.grant(role="normal", permission="RETRIEVE:ENTITY")
......@@ -112,7 +111,6 @@ def setup_state_model():
review_state.acl = db.State.create_state_acl(review_acl)
review_state.insert()
published_acl = db.ACL()
published_state = db.Record(
......
......@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# ** header v3.0
# This file is a part of the CaosDB Project.
# This file is a part of the LinkAhead Project.
#
# Copyright (C) 2020 IndiScale GmbH <info@indiscale.com>
# Copyright (C) 2020 Timm Fitschen <t.fitschen@indiscale.com>
......@@ -23,42 +23,42 @@
# ** end header
import os
import caosdb
import linkahead
import random
filename = "small.webm"
if not os.path.isfile(filename):
import wget # pylint: disable=E0401
filename = wget.download("http://techslides.com/demos/sample-videos/small.webm")
caosdb.configure_connection(ssl_insecure=True)
linkahead.configure_connection(ssl_insecure=True)
# clean
old = caosdb.execute_query("FIND Test*")
old = linkahead.execute_query("FIND Test*")
if len(old):
old.delete()
# data model
datamodel = caosdb.Container()
datamodel = linkahead.Container()
datamodel.extend([
caosdb.RecordType("TestPreviewRecordType")
linkahead.RecordType("TestPreviewRecordType")
])
datamodel.insert()
# test data
testdata = caosdb.Container()
testdata = linkahead.Container()
## record with references
refrec = caosdb.Record("TestPreviewRecord-references").add_parent("TestPreviewRecordType")
# record with references
refrec = linkahead.Record("TestPreviewRecord-references").add_parent("TestPreviewRecordType")
testdata.append(refrec)
video = caosdb.File(name="TestFileVideo", file=filename, path="testfile.webm")
image = caosdb.File(name="TestFileImage",
file="../src/core/pics/map_tile_caosdb_logo.png",
video = linkahead.File(name="TestFileVideo", file=filename, path="testfile.webm")
image = linkahead.File(name="TestFileImage",
file="../src/core/pics/map_tile_linkahead_logo.png",
path="testfile.png")
for i in ["load-forever", "fall-back", "error", "success", "success-2"]:
rec = caosdb.Record("TestPreviewRecord-{}".format(i)).add_parent("TestPreviewRecordType")
rec = linkahead.Record("TestPreviewRecord-{}".format(i)).add_parent("TestPreviewRecordType")
testdata.append(rec)
refrec.add_property("TestPreviewRecordType", rec)
......@@ -66,8 +66,6 @@ testdata.append(image)
testdata.append(video)
testdata.insert();
testdata.insert()
os.remove(filename)
......@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# ** header v3.0
# This file is a part of the CaosDB Project.
# This file is a part of the LinkAhead Project.
#
# Copyright (C) 2020 IndiScale GmbH <info@indiscale.com>
# Copyright (C) 2020 Timm Fitschen <t.fitschen@indiscale.com>
......@@ -22,7 +22,7 @@
#
# ** end header
import caosdb as db
import linkahead as db
# clean
old = db.execute_query("FIND Test*")
......
......@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# ** header v3.0
# This file is a part of the CaosDB Project.
# This file is a part of the LinkAhead Project.
#
# Copyright (C) 2020 IndiScale GmbH <info@indiscale.com>
# Copyright (C) 2020 Timm Fitschen <t.fitschen@indiscale.com>
......@@ -23,7 +23,7 @@
# ** end header
import sys
import caosdb as db
import linkahead as db
if len(db.execute_query("FIND RecordType CommentAnnotation")) > 0:
......
......@@ -7,39 +7,38 @@
Test entities for the ext_references module.
"""
import caosdb
import linkahead
import random
d = caosdb.execute_query("FIND TestReferenc*")
d = linkahead.execute_query("FIND TestReferenc*")
if len(d) > 0:
d.delete()
# data model
datamodel = caosdb.Container()
datamodel = linkahead.Container()
datamodel.extend([
caosdb.RecordType("TestReferenced"),
caosdb.RecordType(
linkahead.RecordType("TestReferenced"),
linkahead.RecordType(
"TestReferencing"
).add_property("TestReferenced", datatype=caosdb.LIST("TestReferenced")),
).add_property("TestReferenced", datatype=linkahead.LIST("TestReferenced")),
])
datamodel.insert()
# test data
testdata = caosdb.Container()
testdata = linkahead.Container()
for i in range(100):
testdata.append(
caosdb.Record("TestReferenceObject-{}".format(i)
linkahead.Record("TestReferenceObject-{}".format(i)
).add_parent("TestReferenced")
)
testdata.insert();
caosdb.Record().add_parent(
testdata.insert()
linkahead.Record().add_parent(
"TestReferencing"
).add_property("TestReferenced",
datatype=caosdb.LIST("TestReferenced"),
datatype=linkahead.LIST("TestReferenced"),
value=testdata
).insert()
......@@ -4,23 +4,23 @@
(C) Copyright IndiScale GmbH 2019
"""
import caosdb
import linkahead
import random
caosdb.get_connection()._login()
linkahead.get_connection()._login()
# data model
datamodel = caosdb.Container()
datamodel = linkahead.Container()
datamodel.extend([
caosdb.Property("longitude", datatype=caosdb.DOUBLE, unit="°"),
caosdb.Property("latitude", datatype=caosdb.DOUBLE, unit="°"),
caosdb.RecordType(
linkahead.Property("longitude", datatype=linkahead.DOUBLE, unit="°"),
linkahead.Property("latitude", datatype=linkahead.DOUBLE, unit="°"),
linkahead.RecordType(
"MapObject"
).add_property("longitude", importance=caosdb.OBLIGATORY
).add_property("latitude", importance=caosdb.OBLIGATORY),
caosdb.RecordType(
).add_property("longitude", importance=linkahead.OBLIGATORY
).add_property("latitude", importance=linkahead.OBLIGATORY),
linkahead.RecordType(
"PathObject"
).add_property("MapObject", datatype=caosdb.LIST("MapObject")),
).add_property("MapObject", datatype=linkahead.LIST("MapObject")),
])
datamodel.insert()
......@@ -28,15 +28,15 @@ datamodel.insert()
# test data
testdata = caosdb.Container()
testdata = linkahead.Container()
path = caosdb.Record()
path = linkahead.Record()
path.add_parent("PathObject")
path.add_property("MapObject", datatype=caosdb.LIST("MapObject"), value=[])
path.add_property("MapObject", datatype=linkahead.LIST("MapObject"), value=[])
testdata.append(path)
for i in range(100):
loc = caosdb.Record(
loc = linkahead.Record(
"Object-{}".format(i)
).add_parent("MapObject"
).add_property("longitude", random.gauss(-42.0, 5)
......@@ -45,8 +45,4 @@ for i in range(100):
path.get_property("MapObject").value.append(loc)
testdata.insert();
testdata.insert()
#!/bin/bash
#
# ** header v3.0
# This file is a part of the CaosDB Project.
# This file is a part of the LinkAhead Project.
#
# Copyright (C) 2021 IndiScale GmbH
# Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com>
......
#!/bin/bash
#
# ** header v3.0
# This file is a part of the CaosDB Project.
# This file is a part of the LinkAhead Project.
#
# Copyright (C) 2020 IndiScale GmbH
# Copyright (C) 2020 Timm Fitschen (t.fitschen@indiscale.com)
......
......@@ -4,32 +4,32 @@
(C) Copyright IndiScale GmbH 2019
"""
import caosdb
import linkahead
caosdb.get_connection()._login()
linkahead.get_connection()._login()
# data model
if caosdb.execute_query("COUNT RecordType UserTemplate") == 0:
if linkahead.execute_query("COUNT RecordType UserTemplate") == 0:
datamodel = caosdb.Container()
datamodel = linkahead.Container()
datamodel.extend([
caosdb.Property("Query", datatype=caosdb.TEXT),
caosdb.Property("templateDescription", datatype=caosdb.TEXT),
caosdb.RecordType(
linkahead.Property("Query", datatype=linkahead.TEXT),
linkahead.Property("templateDescription", datatype=linkahead.TEXT),
linkahead.RecordType(
"UserTemplate"
).add_property("Query", importance=caosdb.OBLIGATORY
).add_property("templateDescription", importance=caosdb.OBLIGATORY),
).add_property("Query", importance=linkahead.OBLIGATORY
).add_property("templateDescription", importance=linkahead.OBLIGATORY),
])
datamodel.insert()
# test data
testdata = caosdb.Container()
testdata = linkahead.Container()
if caosdb.execute_query("COUNT Record 'Test Template (Delete with Error)'") == 0:
if linkahead.execute_query("COUNT Record 'Test Template (Delete with Error)'") == 0:
testdata.append(
caosdb.Record(
linkahead.Record(
"Test Template (Delete with Error)"
).add_parent("UserTemplate"
).add_property("Query", "FIND Error"
......@@ -37,9 +37,9 @@ if caosdb.execute_query("COUNT Record 'Test Template (Delete with Error)'") == 0
"Test Template (Delete with Error)")
)
if caosdb.execute_query("COUNT Record 'Test Template (Referencing)'") == 0:
if linkahead.execute_query("COUNT Record 'Test Template (Referencing)'") == 0:
testdata.append(
caosdb.Record(
linkahead.Record(
"Test Template (Referencing)"
).add_parent("UserTemplate"
).add_property("UserTemplate", "Test Template (Delete with Error)")
......@@ -47,7 +47,7 @@ if caosdb.execute_query("COUNT Record 'Test Template (Referencing)'") == 0:
for i in range(2):
testdata.append(
caosdb.Record(
linkahead.Record(
"Test Template (User {})".format(i)
).add_parent("UserTemplate"
).add_property("Query", "FIND Thing{}".format(i)
......@@ -55,7 +55,4 @@ for i in range(2):
"Test Template (User {})".format(i))
)
testdata.insert();
testdata.insert()
......@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# ** header v3.0
# This file is a part of the CaosDB Project.
# This file is a part of the LinkAhead Project.
#
# Copyright (C) 2020 IndiScale GmbH <info@indiscale.com>
# Copyright (C) 2020 Timm Fitschen <t.fitschen@indiscale.com>
......@@ -22,40 +22,40 @@
#
# ** end header
import caosdb
import linkahead
d = caosdb.execute_query("FIND Test*")
d = linkahead.execute_query("FIND Test*")
if len(d) > 0:
d.delete()
rt_house = caosdb.RecordType("TestHouse").insert()
rt_house = linkahead.RecordType("TestHouse").insert()
rt_house.description = "A House"
caosdb.RecordType("TestWindow").insert()
rt_person = caosdb.RecordType("TestPerson").insert()
caosdb.RecordType("TestParty").insert()
caosdb.Property("TestHeight", datatype=caosdb.DOUBLE, unit="ft").insert()
caosdb.Property("TestDate", datatype=caosdb.DATETIME).insert()
linkahead.RecordType("TestWindow").insert()
rt_person = linkahead.RecordType("TestPerson").insert()
linkahead.RecordType("TestParty").insert()
linkahead.Property("TestHeight", datatype=linkahead.DOUBLE, unit="ft").insert()
linkahead.Property("TestDate", datatype=linkahead.DATETIME).insert()
window = caosdb.Record().add_parent("TestWindow")
window = linkahead.Record().add_parent("TestWindow")
window.add_property("TestHeight", 20.5, unit="ft")
window.insert()
owner = caosdb.Record("The Queen").add_parent("TestPerson").insert()
owner = linkahead.Record("The Queen").add_parent("TestPerson").insert()
house = caosdb.Record("Buckingham Palace")
house = linkahead.Record("Buckingham Palace")
house.description = "A rather large house"
house.add_parent("TestHouse")
house.add_property(rt_person, name="TestOwner", value=owner)
house.add_property("TestWindow", window).insert()
g1 = caosdb.Record().add_parent("TestPerson").insert()
g2 = caosdb.Record().add_parent("TestPerson").insert()
g3 = caosdb.Record().add_parent("TestPerson").insert()
g1 = linkahead.Record().add_parent("TestPerson").insert()
g2 = linkahead.Record().add_parent("TestPerson").insert()
g3 = linkahead.Record().add_parent("TestPerson").insert()
party = caosdb.Record("Diamond Jubilee of Elizabeth II").add_parent("TestParty")
party = linkahead.Record("Diamond Jubilee of Elizabeth II").add_parent("TestParty")
party.add_property(rt_house, name="Location", value=house)
party.add_property("TestDate", "2012-02-06")
party.add_property(rt_person, datatype=caosdb.LIST(rt_person), name="Guests",
party.add_property(rt_person, datatype=linkahead.LIST(rt_person), name="Guests",
value=[g1, g2, g3])
party.insert()
import caosdb as db
import linkahead as db
try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment