Skip to content

Commit

Permalink
Feature/api upgrade (#4)
Browse files Browse the repository at this point in the history
* Updated to the newest version of the Cineast OpenAPI.

- Regenerated library files.
- Implemented parametrized spatial query term builder.
- Fixed Boolean terms always being sent as string.
- Bumped package version.

* Removed unnecessary IDE files.

* Updated README.
  • Loading branch information
Spiess authored Mar 31, 2022
1 parent a9ad36f commit a1ef472
Show file tree
Hide file tree
Showing 15 changed files with 1,567 additions and 376 deletions.
42 changes: 1 addition & 41 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,11 @@
### Rider ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
.idea/

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

Expand All @@ -54,18 +21,12 @@ out/
# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

Expand Down Expand Up @@ -120,7 +81,6 @@ Assets/StreamingAssets/crashlytics-build.properties

# Temp file
*~
.idea/.idea.UnityInterface

# Exclude the Generated Stuff
!Generated/
Expand Down
Empty file removed .idea/.gitignore
Empty file.
4 changes: 0 additions & 4 deletions .idea/.idea.CineastUnityInterface/.idea/encodings.xml

This file was deleted.

25 changes: 0 additions & 25 deletions .idea/.idea.CineastUnityInterface/.idea/indexLayout.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/.idea.CineastUnityInterface/.idea/modules.xml

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/.idea.CineastUnityInterface/.idea/vcs.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/.idea.CineastUnityInterface/riderModule.iml

This file was deleted.

70 changes: 16 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,89 +1,51 @@
# README

**This is in very early development. Do not use in production.**

## Features

This is a Unity3d endpoint for vitrivr's Cineast RESTful API.
# Cineast Unity Interface

A Unity Package Manager package for the Cineast OpenAPI RESTful API.
See [Cineast](https://github.com/vitrivr/cineast) for further API informations

## Prerequisites

This package provides a Unity3d endpoint for vitrivr's Cineast RESTful API.
Thus, a running cineast instance is a requirement for this package to work.
This package provides a Unity endpoint for vitrivr's Cineast RESTful API.
Thus, a running Cineast instance is a requirement for this package to work.

For a guide on how to setup cineast, please see [Cineast's Github page](https://github.com/vitrivr/cineast).

## Usage -- Unity3d
## Usage -- Unity

To use this package in unity, the `manifest.json` has to be expanded by the following entry:
To use this package in Unity, the `manifest.json` has to be expanded by the following entry:

```json
"com.vitrivr.unityinterface.cineastapi": "https://github.com/vitrivr/CineastUnityInterface.git"
```

The Unity Package Manager ( _upm_ ) will take care of downloading and linking this package.
The Unity Package Manager (_upm_) will take care of downloading and linking this package.

### Versions

Besides using [semver]() to specify the package's version, there are two _upm_ packages available:

* `#release` -- The latest released version of the package (semver version Major.Minor.Path)
* `#latest` -- Development versions of the package (semver version Major.Minor.Path-SNAPSHOT)

In most of the cases you want to have the `#release` version. In case you would like to have the development version,
use this `manifest.json` entry:

```json
"com.vitrivr.unityinterface.cineastapi": "https://github.com/vitrivr/UnityInterface.git#latest"
```

The package was tested with Unity 2018.4 LTS.

### Example

_TODO_

### Documentation

For the underlying API documentation, please refer to `Generated/README.md` and `Generated/docs/`.
This package uses [semver](https://semver.org). It is recommended to manually specify a version in the packages manifest entry.
The package was tested with Unity 2020.3 LTS.

## Usage -- Developer

This is a Unity3d project setup to easily develop (and test) the Unity3d Cineast Interface.
We strongly recommend cloning this repository into the `Assets` directory of a Unity shell project to make development and generation of `.meta` files easier.
To allow the shell project to function without compile errors, it is currently necessary to include the `jillejr.newtonsoft.json-for-unity` package as a workaround. Add the following to the root object in `manifest.json` on the same level as `dependencies`:
```json
"scopedRegistries": [
{
"name": "Packages from jillejr",
"url": "https://npm.cloudsmith.io/jillejr/newtonsoft-json-for-unity/",
"scopes": ["jillejr"]
}
]
```
And add the following line to the dependencies: `"jillejr.newtonsoft.json-for-unity": "12.0.201"`
To actively develop this package, follow these steps:
We strongly recommend cloning this repository into the `Packages` directory of a Unity shell project to make development and generation of `.meta` files easier.

1. If necessary, update the OpenApi Specs (OAS) of vitrivr. Reade more in [Generate OpenApi Dependencies](#generate-openapi-dependencies).
2. To test your changes and generate the **required** `.meta` files for any files you may have added, import the root directory of this repository into a Unity project as a local package with the `file:` method.
3. Do not forget to create a PR of your work to include it in the main branch.

### Generate OpenApi Dependencies
### Generate OpenAPI Dependencies

Follow these steps to generate / update the cineast OAS. We provide the latest generation in this repo for convenience.

For unix systems, the build requires an installation of the [.NET Core SDK](https://dotnet.microsoft.com/), [wget](https://www.gnu.org/software/wget/) and [mono](https://www.mono-project.com). Mono and wget are available through [homebrew](https://brew.sh) on mac.

1. Have an updated, running cineast api.
2. Issue the following `gradle` command:
1. Issue the following `gradle` command:
```
$> ./gradlew clean deploy -Poas="http://cineast-host:port/openapi-specs" tidy
$> ./gradlew clean deploy tidy
```
Replace `cineast-host:port` with your running cineast api. Most propably this will be the default (`localhost:4567`), in this case you can ommit the argument.
3. (Android Only) Delete the file `Runtime/Libs/Newtonsoft.Json.dll`.
4. Generate the **required** `.meta` files for generated files by importing the root directory of this repository into a Unity project as a local package with the `file:` method.
2. (Android Only) Delete the file `Runtime/Libs/Newtonsoft.Json.dll`.
3. Generate the **required** `.meta` files for generated files by importing the root directory of this repository into a Unity project as a local package with the `file:` method.

> _Notice_
> These steps were tested under Windows 10 64bit, using OpenJDK 11 and Gradle 6.1.1. The publish script was tested with python 3.8.2.
Expand All @@ -105,4 +67,4 @@ This work is licensed under the MIT open source license. Please refer to the LIC
## Credits

* Credits go to @neogeek, his [Tutorial](https://github.com/neogeek/unity-package-example) lead to the transformation to a proper _upm_ package.
* Credits go to @SamuelBoerlin, his [first steps](https://github.com/SamuelBoerlin/Cineast-OpenAPI-Implementation) with Cienast and OpenApi helped a lot.
* Credits go to @SamuelBoerlin, his [first steps](https://github.com/SamuelBoerlin/Cineast-OpenAPI-Implementation) with Cineast and OpenAPI helped a lot.
Binary file modified Runtime/Libs/Org.Vitrivr.CineastApi.dll
Binary file not shown.
Loading

0 comments on commit a1ef472

Please sign in to comment.