Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation/setup steps #529

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e6d577e
REST API for Arctic Sea Faroe
sujit-jaunjal Jul 18, 2022
489e26c
added the dependencies in the faroe-rest.pom file
sujit-jaunjal Jul 22, 2022
713e674
Removed all the errors in .pom file and nows its working perfectly
sujit-jaunjal Jul 22, 2022
ff8be01
added faroe.xml file
sujit-jaunjal Jul 25, 2022
5feb3d8
Resolved all issues in faroe.xml
sujit-jaunjal Jul 25, 2022
1756743
Removed minor errors and performed successful build
sujit-jaunjal Jul 25, 2022
ae0e113
Update SpringrestApplication.java
sujit-jaunjal Jul 27, 2022
8102457
Add files via upload
sujit-jaunjal Jul 27, 2022
b6183fa
Implemented GETGroups and GETGroupDefinitionsByTitle
sujit-jaunjal Jul 28, 2022
fad65a0
API methods under implementation
sujit-jaunjal Aug 1, 2022
04d4998
Working on delete API
sujit-jaunjal Aug 1, 2022
1592bdb
Added .json file storage
sujit-jaunjal Sep 14, 2022
3ca1da8
code formatting, dependency issues and imports
autermann Sep 15, 2022
a840128
Merge pull request #2 from sujit-jaunjal/build-fix
autermann Sep 15, 2022
7555c3f
bug fixes, simplifications
autermann Sep 16, 2022
c67b889
api refactoring
autermann Sep 19, 2022
c519f4d
Update SettingDefinition.java
sujit-jaunjal Sep 19, 2022
58d9adb
Merge branch 'master' of https://github.com/sujit-jaunjal/arctic-sea
autermann Sep 19, 2022
20309a7
settings values
autermann Sep 19, 2022
53c7210
remove obsolete line
autermann Sep 19, 2022
5845e02
do not allow to override existing defintions
autermann Sep 19, 2022
2c4643d
fix compile and build errors
autermann Sep 20, 2022
28d4518
better encoding for localized strings
autermann Sep 20, 2022
f7391e4
Create sudoku_solver.cpp
sujit-jaunjal Sep 21, 2022
d135d47
Delete sudoku_solver.cpp
sujit-jaunjal Sep 21, 2022
9615da5
Added the UI for FAROE REST API
sujit-jaunjal Sep 22, 2022
aebebef
Merge branch 'master' of https://github.com/sujit-jaunjal/arctic-sea
sujit-jaunjal Sep 22, 2022
86ec38b
Final cleanup for REST API
sujit-jaunjal Sep 23, 2022
b5a0d3e
Updated Springrest and other files
sujit-jaunjal Apr 3, 2023
3f8dc09
Added setup steps for the Faroe Settings API
ThePhilosopher4097 Apr 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 6 additions & 24 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,14 @@ This project includes:
52°North Faroe JSON Backend under The Apache Software License, Version 2.0
52°North Faroe Parent under The Apache Software License, Version 2.0
52°North Faroe Utilities under The Apache Software License, Version 2.0
52°North Iceland under The Apache Software License, Version 2.0
52°North Iceland Aggregator Project under The Apache Software License, Version 2.0
52°North Iceland Statistics under The Apache Software License, Version 2.0
52°North Iceland Statistics Documentation Generator under The Apache Software License, Version 2.0
52°North Iceland Statistics Geolocation Feature under The Apache Software License, Version 2.0
52°North Iceland Statistics Kibana Exporter Tool under The Apache Software License, Version 2.0
52°North Jan Mayen under The Apache Software License, Version 2.0
52°North Shetland under The Apache Software License, Version 2.0
52°North Shetland Parent under The Apache Software License, Version 2.0
52°North Shetland RDF under The Apache Software License, Version 2.0
52°North Svalbard Core under The Apache Software License, Version 2.0
52°North Svalbard Exi under The Apache Software License, Version 2.0
52°North Svalbard JSON Common under The Apache Software License, Version 2.0
52°North Svalbard JSON encoding under The Apache Software License, Version 2.0
Expand All @@ -42,25 +39,19 @@ This project includes:
aggs-matrix-stats under Elastic License 2.0 or Server Side Public License, v 1
ANTLR 4 Runtime under The BSD License
Apache Commons CLI under Apache License, Version 2.0
Apache Commons Codec under Apache License, Version 2.0
Apache Commons Compress under Apache License, Version 2.0
Apache Commons CSV under Apache License, Version 2.0
Apache Commons IO under Apache License, Version 2.0
Apache HttpAsyncClient under Apache License, Version 2.0
Apache HttpClient under Apache License, Version 2.0
Apache HttpClient Cache under Apache License, Version 2.0
Apache HttpCore under Apache License, Version 2.0
Apache HttpCore NIO under Apache License, Version 2.0
Apache Jena - ARQ (SPARQL 1.1 Query Engine) under The Apache Software License, Version 2.0
Apache Jena - Base Common Environment under The Apache Software License, Version 2.0
Apache Jena - Core under The Apache Software License, Version 2.0
Apache Jena - IRI under The Apache Software License, Version 2.0
Apache Jena - Shadowed external libraries under The Apache Software License, Version 2.0
Apache Log4j API under Apache License, Version 2.0
Apache Thrift under The Apache Software License, Version 2.0
c3p0 under GNU Lesser General Public License, Version 2.1 or Eclipse Public License, Version 1.0
Checker Qual under The MIT License
Commons Lang under The Apache Software License, Version 2.0
compiler under Apache License 2.0
dexx under MIT License
elasticsearch-cli under Elastic License 2.0 or Server Side Public License, v 1
Expand All @@ -72,14 +63,14 @@ This project includes:
elasticsearch-x-content under Elastic License 2.0 or Server Side Public License, v 1
embedded-elasticsearch under The Apache Software License, Version 2.0
error-prone annotations under Apache 2.0
faroe-rest under The Apache Software License, Version 2.0
FindBugs-jsr305 under The Apache Software License, Version 2.0
Geographic Common (GCO) schema (version 2012-07-13) under The Apache Software License, Version 2.0
Geographic MetaData (GMD) schema (version 2012-07-13) under The Apache Software License, Version 2.0
Guava InternalFutureFailureAccess and InternalFutures under The Apache Software License, Version 2.0
Guava ListenableFuture only under The Apache Software License, Version 2.0
Guava: Google Core Libraries for Java under Apache License, Version 2.0
HdrHistogram under Public Domain, per Creative Commons CC0
HikariCP under The Apache Software License, Version 2.0
HPPC Collections under The Apache Software License, Version 2.0
INSPIRE Addresses schema (spec. v4.0) under The Apache Software License, Version 2.0
INSPIRE Administrative Units schema (spec. v4.0) under The Apache Software License, Version 2.0
Expand All @@ -98,17 +89,18 @@ This project includes:
J2ObjC Annotations under The Apache Software License, Version 2.0
Jackson dataformat: CBOR under The Apache Software License, Version 2.0
Jackson dataformat: Smile under The Apache Software License, Version 2.0
Jackson datatype: jdk8 under The Apache Software License, Version 2.0
Jackson-annotations under The Apache Software License, Version 2.0
Jackson-core under The Apache Software License, Version 2.0
jackson-databind under The Apache Software License, Version 2.0
Jackson-dataformat-YAML under The Apache Software License, Version 2.0
Jackson-datatype-Hibernate5 under The Apache Software License, Version 2.0
Java archiving library under Apache 2
JavaBeans(TM) Activation Framework under COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
JavaMail API jar under CDDL or GPLv2+CE
javax.annotation API under CDDL + GPLv2 with classpath exception
javax.inject under The Apache Software License, Version 2.0
javax.transaction API under CDDL + GPLv2 with classpath exception
jaxb-api under CDDL 1.1 or GPL2 w/ CPE
JCL 1.2 implemented over SLF4J under Apache License, Version 2.0
Joda-Time under Apache License, Version 2.0
JOpt Simple under The MIT License
JSONLD Java :: Core under Revised BSD License
Expand All @@ -129,16 +121,15 @@ This project includes:
mapper-extras under Elastic License 2.0 or Server Side Public License, v 1
MaxMind DB Reader under Apache License 2.0
MaxMind GeoIP2 API under Apache License, Version 2.0
mchange-commons-java under GNU Lesser General Public License, Version 2.1 or Eclipse Public License, Version 1.0
Neo Visionaries Internationalization Package under The Apache Software License, Version 2.0
Netty/Buffer under Apache License, Version 2.0
Netty/Codec under Apache License, Version 2.0
Netty/Codec/HTTP under Apache License, Version 2.0
Netty/Common under Apache License, Version 2.0
Netty/Handler under Apache License, Version 2.0
Netty/Resolver under Apache License, Version 2.0
Netty/TomcatNative [OpenSSL - Classes] under The Apache Software License, Version 2.0
Netty/Transport under Apache License, Version 2.0
Netty/Transport/Native/Unix/Common under Apache License, Version 2.0
null under Lesser General Public License, version 3 or greater or Apache Software License, version 2.0
OASIS WS-N specification schemas - including WS-BrokeredNotification (v1.3) under The Apache Software License, Version 2.0
OASIS WS-Resources specification schemas v1.2 under The Apache Software License, Version 2.0
Expand Down Expand Up @@ -178,35 +169,26 @@ This project includes:
OGC WaterML DR schema (spec. v2.0) under The Apache Software License, Version 2.0
OGC WaterML schema (spec. v2.0) under The Apache Software License, Version 2.0
OGC XML schemas under The Apache Software License, Version 2.0
Old JAXB Core under CDDL+GPL License
Old JAXB Runtime under CDDL+GPL License
org.locationtech.jts:jts-core under Eclipse Public License, Version 2.0 or Eclipse Distribution License - v 1.0
parent-join under Elastic License 2.0 or Server Side Public License, v 1
Portele Schape Change schema (spec. v3.0) under The Apache Software License, Version 2.0
quartz under The Apache Software License, Version 2.0
rank-eval under Elastic License 2.0 or Server Side Public License, v 1
rest under The Apache Software License, Version 2.0
rest-high-level under Elastic License 2.0
Saxon-HE under Mozilla Public License Version 2.0
server under Elastic License 2.0 or Server Side Public License, v 1
SLF4J API Module under MIT License
SnakeYAML under Apache License, Version 2.0
Spring AOP under Apache License, Version 2.0
Spring Beans under Apache License, Version 2.0
Spring Commons Logging Bridge under Apache License, Version 2.0
Spring Context under Apache License, Version 2.0
Spring Context Support under Apache License, Version 2.0
Spring Core under Apache License, Version 2.0
Spring Expression Language (SpEL) under Apache License, Version 2.0
Spring Web under Apache License, Version 2.0
Spring Web MVC under Apache License, Version 2.0
T-Digest under The Apache Software License, Version 2.0
W3C SOAP specification recommondation (v1.1) under The Apache Software License, Version 2.0
W3C SOAP specification recommondation (v1.2 part 1) under The Apache Software License, Version 2.0
W3C WS-Addressing specification schemas (v1.0) under The Apache Software License, Version 2.0
W3C xlink schema (spec. v1.1.0) under The Apache Software License, Version 2.0
XML Commons External Components XML APIs under The Apache Software License, Version 2.0 or The SAX License or The W3C License
XML Resolver under Apache License version 2.0
XmlBeans under The Apache Software License, Version 2.0
XmlBeansXPath under The Apache Software License, Version 2.0
XMLUnit for Java under BSD License

9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,12 @@ The development of the 52°North Arctic Sea implementation was supported by se
| [![BMVI](https://raw.githubusercontent.com/52North/arctic-sea/master/etc/images/bmvi-logo.png)](https://www.bmvi.de/)[![mFund](https://raw.githubusercontent.com/52North/arctic-sea/master/etc/images/mfund-logo.jpg)](https://www.bmvi.de/DE/Themen/Digitales/mFund/Ueberblick/ueberblick.html)[![WaCoDis](https://raw.githubusercontent.com/52North/arctic-sea/master/etc/images/wacodis-logo.png)](http://wacodis.fbg-hsbo.de/) | The development of this version of 52°North Arctic Sea was supported by the [German Federal Ministry of of Transport and Digital Infrastructure](https://www.bmvi.de/) research project [WaCoDis](http://wacodis.fbg-hsbo.de/) (co-funded by the German Federal Ministry of Transport and Digital Infrastructure, programme mFund) |
| [![BMBF](https://raw.githubusercontent.com/52North/arctic-sea/master/etc/images/bmbf-logo.png)](https://www.bmbf.de/)[![fona](https://raw.githubusercontent.com/52North/arctic-sea/master/etc/images/fona-logo.png)](https://www.fona.de/)[![MuDak-WRM](https://raw.githubusercontent.com/52North/arctic-sea/master/etc/images/mudak-wrm-logo.png)](http://www.mudak-wrm.kit.edu/) | The development of this version of 52°North Arctic Sea was supported by the [German Federal Ministry of Education and Research](https://www.bmbf.de/) research project [MuDak-WRM](http://www.mudak-wrm.kit.edu/) (co-funded by the German Federal Ministry of Education and Research, programme [fona](https://www.fona.de/)) |
| [![BRIDGES](https://raw.githubusercontent.com/52North/arctic-sea/master/etc/images/bridges-logo.jpg)](http://www.bridges-h2020.eu/)| The development of this version of the 52°North Arctic Sea was supported by the [Horizon 2020](https://ec.europa.eu/programmes/horizon2020/) research project [BRIDGES](http://www.bridges-h2020.eu/) (co-funded by the European Commission under the grant agreement n°635359)

<hr>

## Steps to Run Faroe REST Backend--------->

- 1. Open the project in a Java IDE (Ecplise or intellij)
- 2. Go to the faroe--->rest--->src/main/java/--->org.n52.faroeREST.springrest--->SpringrestApplication.java
- 3. Run this file as a Java Application
- (The above steps aresufficient, however, If you encounter any error, then try: maven clean ---> maven build ---> update project---> and repeat step 3)
4 changes: 4 additions & 0 deletions faroe/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ public interface JSONSettingConstants {
String FILE_TYPE = "file";
String URI_TYPE = "uri";


String SETTING_DEFINITIONS = "settingDefinitions";
}
47 changes: 40 additions & 7 deletions faroe/core/src/main/java/org/n52/faroe/SettingDefinition.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,56 @@
import java.io.Serializable;
import java.util.Optional;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import org.n52.faroe.settings.BooleanSettingDefinition;
import org.n52.faroe.settings.ChoiceSettingDefinition;
import org.n52.faroe.settings.DateTimeSettingDefinition;
import org.n52.faroe.settings.FileSettingDefinition;
import org.n52.faroe.settings.IntegerSettingDefinition;
import org.n52.faroe.settings.MultilingualStringSettingDefinition;
import org.n52.faroe.settings.NumericSettingDefinition;
import org.n52.faroe.settings.StringSettingDefinition;
import org.n52.faroe.settings.UriSettingDefinition;

/**
*
* Interface for setting definitions that can be used within the Service. Defined settings will be presented in the
* administrator and installer view.
*
* @param <T> The type of the value
* @author <a href="mailto:[email protected]">Christian Autermann</a>
* @see SettingDefinitionGroup
* @see SettingsService
* @see org.n52.faroe.settings.FileSettingDefinition
* @see org.n52.faroe.settings.BooleanSettingDefinition
* @see BooleanSettingDefinition
* @see org.n52.faroe.settings.IntegerSettingDefinition
* @see org.n52.faroe.settings.NumericSettingDefinition
* @see org.n52.faroe.settings.StringSettingDefinition
* @see org.n52.faroe.settings.UriSettingDefinition
* @param <T> The type of the value
*
* @author <a href="mailto:[email protected]">Christian Autermann</a>
* @since 1.0.0
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonSubTypes(value = {
@JsonSubTypes.Type(value = BooleanSettingDefinition.class,
name = JSONSettingConstants.BOOLEAN_TYPE),
@JsonSubTypes.Type(value = StringSettingDefinition.class,
name = JSONSettingConstants.STRING_TYPE),
@JsonSubTypes.Type(value = ChoiceSettingDefinition.class,
name = JSONSettingConstants.CHOICE_TYPE),
@JsonSubTypes.Type(value = DateTimeSettingDefinition.class,
name = JSONSettingConstants.TIME_INSTANT_TYPE),
@JsonSubTypes.Type(value = FileSettingDefinition.class,
name = JSONSettingConstants.FILE_TYPE),
@JsonSubTypes.Type(value = IntegerSettingDefinition.class,
name = JSONSettingConstants.INTEGER_TYPE),
@JsonSubTypes.Type(value = MultilingualStringSettingDefinition.class,
name = JSONSettingConstants.MULTILINGUAL_TYPE),
@JsonSubTypes.Type(value = NumericSettingDefinition.class,
name = JSONSettingConstants.NUMBER_TYPE),
@JsonSubTypes.Type(value = UriSettingDefinition.class,
name = JSONSettingConstants.URI_TYPE)
})
public interface SettingDefinition<T> extends Ordered, Serializable {
/**
* @return the unique key of this definition
Expand All @@ -53,7 +85,7 @@ public interface SettingDefinition<T> extends Ordered, Serializable {
String getDescription();

/**
* @return wether this setting is optional or required.
* @return weather this setting is optional or required.
*/
boolean isOptional();

Expand All @@ -62,6 +94,7 @@ public interface SettingDefinition<T> extends Ordered, Serializable {
*/
T getDefaultValue();

@JsonIgnore
default Optional<T> getOptionalDefaultValue() {
if (hasDefaultValue()) {
return Optional.of(getDefaultValue());
Expand Down Expand Up @@ -125,7 +158,6 @@ default SettingDefinitionGroup getGroup(SettingDefinitionGroup defaultGroup) {
* Sets whether this setting is optional or can be null. By default all settings are required.
*
* @param optional if this setting is optional
*
*/
SettingDefinition<?> setOptional(boolean optional);

Expand All @@ -147,5 +179,6 @@ default SettingDefinitionGroup getGroup(SettingDefinitionGroup defaultGroup) {
/**
* @return the type of the value of this definition
*/
@JsonIgnore
SettingType getType();
}
4 changes: 4 additions & 0 deletions faroe/core/src/main/java/org/n52/faroe/SettingType.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import java.io.File;
import java.net.URI;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import org.joda.time.DateTime;

import org.n52.janmayen.i18n.LocalizedString;
Expand Down Expand Up @@ -69,6 +71,7 @@ public enum SettingType {
*/
CHOICE;

@JsonCreator
public static SettingType fromString(String type) {
switch (type) {
case JSONSettingConstants.INTEGER_TYPE:
Expand Down Expand Up @@ -120,6 +123,7 @@ public static String toString(SettingType type) {
}

@Override
@JsonValue
public String toString() {
return toString(this);
}
Expand Down
2 changes: 2 additions & 0 deletions faroe/core/src/main/java/org/n52/faroe/SettingValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonTypeInfo;

/**
* Holder for generic settings. Implementations are {@link SettingsService} specific.
*
Expand Down
19 changes: 17 additions & 2 deletions faroe/core/src/main/java/org/n52/faroe/SettingsChangeEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,22 @@
public class SettingsChangeEvent<T> implements Event {

private final SettingDefinition<T> setting;
private final String settings;
private final SettingValue<T> oldValue;
private final SettingValue<T> newValue;

@SuppressFBWarnings({"EI_EXPOSE_REP2"})
public SettingsChangeEvent(SettingDefinition<T> setting, SettingValue<T> oldValue, SettingValue<T> newValue) {
this.setting = setting;
this.settings = null;
this.oldValue = oldValue;
this.newValue = newValue;
}


public SettingsChangeEvent(String settings, SettingValue<T> oldValue, SettingValue<T> newValue) {
this.setting = null;
this.settings = settings;
this.oldValue = oldValue;
this.newValue = newValue;
}
Expand All @@ -45,6 +55,10 @@ public SettingDefinition<T> getSetting() {
return setting;
}

public String getSettings() {
return settings;
}

@SuppressFBWarnings({"EI_EXPOSE_REP"})
public SettingValue<T> getOldValue() {
return oldValue;
Expand All @@ -65,7 +79,8 @@ public boolean hasOldValue() {

@Override
public String toString() {
return String.format("SettingsChangeEvent[setting=%s, oldValue=%s, newValue=%s",
getSetting(), getOldValue(), getNewValue());
return String.format("SettingsChangeEvent[setting=%s, settings=%s, oldValue=%s, newValue=%s",
getSetting(), getSettings(), getOldValue(), getNewValue());
}

}
1 change: 1 addition & 0 deletions faroe/core/src/main/java/org/n52/faroe/SettingsDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public interface SettingsDao {
*/
void saveSettingValue(SettingValue<?> setting);


void deleteAll();

}
26 changes: 26 additions & 0 deletions faroe/core/src/main/java/org/n52/faroe/SettingsDefinitionDao.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (C) 2015-2022 52°North Spatial Information Research GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.n52.faroe;

import java.util.Collection;

public interface SettingsDefinitionDao extends SettingsDao {

Collection<SettingDefinition<?>> getAllSettings();

void saveSettings(Collection<SettingDefinition<?>> settings);

}
Loading