Skip to content
Snippets Groups Projects
Commit 53e22da4 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Merge branch 'develop'

parents e60b89e8 de7660fb
No related branches found
No related tags found
1 merge request!7Gnuaffero
NIBIO OPEN SOURCE LICENSE V.1.0 (2014) GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
PREAMBLE AND ADDITIONAL TERMS
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
The original licensor is the Norwegian Institute for Agricultural and Everyone is permitted to copy and distribute verbatim copies
Environmental Research, registered in Norway with registration number 988 983 of this license document, but changing it is not allowed.
837, and business address NO-1430 ÅS, NORWAY, hereafter referred to as
"NIBIO". Preamble
This NIBIO OPEN SOURCE LICENSE V.1.0 (2014), in short the NIBIO Open The GNU Affero General Public License is a free, copyleft license for
Source License, is based on the GNU Affero General Public License, version 3. software and other kinds of works, specifically designed to ensure
All of the terms and conditions of the GNU Affero General Public License, cooperation with the community in the case of network server software.
version 3, have been set out below, save the below mentioned additional
prevailing terms that have priority over the terms otherwise identical to the The licenses for most software and other practical works are designed
GNU Affero General Public License, version 3, and that Section 0 ("This to take away your freedom to share and change the works. By contrast,
License" definition changed), 13 ("version 3 of the GNU General Public License" our General Public Licenses are intended to guarantee your freedom to
replaced by "this License") and 14 ("The Free Software Foundation" replaced by share and change all versions of a program--to make sure it remains free
"NIBIO" and "GNU Affero General Public License" replaced by "License") have software for all its users.
been adjusted as a consequence of this.
When we speak of free software, we are referring to freedom, not
ADDITONAL PREVAILING TERMS price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
(a) The NIBIO Open Source License regulates the NIBIO VIPS Platform them if you wish), that you receive source code or can get it if you
software, an Internet based system enabling prediction of infection risk of want it, that you can change the software or use pieces of it in new
plant diseases, pests and weeds. The NIBIO Open Source License DOES NOT free programs, and that you know you can do these things.
INCLUDE the specific forecasting models, neither their algorithms nor their
implementation to be used by the NIBIO VIPS Platform. You are free to Developers that use our General Public Licenses protect your rights
implement any other forecasting model to be used by the NIBIO VIPS Platform, with two steps: (1) assert copyright on the software, and (2) offer
regardless of license terms at your own responsibility. you this License which gives you legal permission to copy, distribute
and/or modify the software.
(b) This license is governed by Norwegian law, as far as any party or third
party purports or sets forward any claim towards NIBIO. Any claims towards A secondary benefit of defending all users' freedom is that
NIBIO shall be solved by the exclusive venue of Oslo City Courts, Norway. improvements made in alternate versions of the program, if they
This paragraph is not applicable for claims only between any later parties to receive widespread use, become available for other developers to
this license. incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
(c) By entering into this agreement you also agree to indemnify NIBIO and software used on network servers, this result may fail to come about.
its employees / consultants / board, for any claims of liability related to The GNU General Public License permits making a modified version and
this license set forward by yourself or any party deviating its rights from you. letting the public access it on a server without ever releasing its
source code to the public.
(d) You shall include the following in the start of each source file:
The GNU Affero General Public License is designed specifically to
Copyright (c) <year> <name of author> ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
This file is part of <application name>. <application name> is free provide the source code of the modified version running there to the
software: you can redistribute it and/or modify it under the terms of users of that server. Therefore, public use of a modified version, on
the NIBIO Open Source License as published by NIBIO, either a publicly accessible server, gives the public access to the source
version 1 of the License, or (at your option) any later version. code of the modified version.
<application name> is distributed in the hope that it will be useful, An older license, called the Affero General Public License and
but WITHOUT ANY WARRANTY; without even the implied warranty of published by Affero, was designed to accomplish similar goals. This is
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the a different license, not a version of the Affero GPL, but Affero has
NIBIO Open Source License for more details. released a new version of the Affero GPL which permits relicensing under
this license.
You should have received a copy of the NIBIO Open Source License
along with <application name>. If not, see The precise terms and conditions for copying, distribution and
<http://www.nibio.no/licenses/>. modification follow.
It is also recommended that you add information on how to contact you by TERMS AND CONDITIONS
electronic and paper mail.
0. Definitions.
1. TERMS AND CONDITIONS
"This License" refers to version 3 of the GNU Affero General Public License.
2. 0. Definitions.
"This License" refers to NIBIO Open Source License v.1.0 (2014).
"Copyright" also means copyright-like laws that apply to other kinds of "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks. works, such as semiconductor masks.
...@@ -100,7 +97,7 @@ work under this License, and how to view a copy of this License. If ...@@ -100,7 +97,7 @@ work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion. menu, a prominent item in the list meets this criterion.
3. 1. Source Code. 1. Source Code.
The "source code" for a work means the preferred form of the work The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source for making modifications to it. "Object code" means any non-source
...@@ -142,7 +139,7 @@ Source. ...@@ -142,7 +139,7 @@ Source.
The Corresponding Source for a work in source code form is that The Corresponding Source for a work in source code form is that
same work. same work.
4. 2. Basic Permissions. 2. Basic Permissions.
All rights granted under this License are granted for the term of All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated copyright on the Program, and are irrevocable provided the stated
...@@ -167,7 +164,7 @@ your copyrighted material outside their relationship with you. ...@@ -167,7 +164,7 @@ your copyrighted material outside their relationship with you.
the conditions stated below. Sublicensing is not allowed; section 10 the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary. makes it unnecessary.
5. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article measure under any applicable law fulfilling obligations under article
...@@ -183,7 +180,7 @@ modification of the work as a means of enforcing, against the work's ...@@ -183,7 +180,7 @@ modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of users, your or third parties' legal rights to forbid circumvention of
technological measures. technological measures.
6. 4. Conveying Verbatim Copies. 4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and receive it, in any medium, provided that you conspicuously and
...@@ -196,7 +193,7 @@ recipients a copy of this License along with the Program. ...@@ -196,7 +193,7 @@ recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee. and you may offer support or warranty protection for a fee.
7. 5. Conveying Modified Source Versions. 5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the produce it from the Program, in the form of source code under the
...@@ -233,7 +230,7 @@ beyond what the individual works permit. Inclusion of a covered work ...@@ -233,7 +230,7 @@ beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other in an aggregate does not cause this License to apply to the other
parts of the aggregate. parts of the aggregate.
8. 6. Conveying Non-Source Forms. 6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the of sections 4 and 5, provided that you also convey the
...@@ -331,7 +328,7 @@ documented (and with an implementation available to the public in ...@@ -331,7 +328,7 @@ documented (and with an implementation available to the public in
source code form), and must require no special password or key for source code form), and must require no special password or key for
unpacking, reading or copying. unpacking, reading or copying.
9. 7. Additional Terms. 7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions. License by making exceptions from one or more of its conditions.
...@@ -395,7 +392,7 @@ where to find the applicable terms. ...@@ -395,7 +392,7 @@ where to find the applicable terms.
form of a separately written license, or stated as exceptions; form of a separately written license, or stated as exceptions;
the above requirements apply either way. the above requirements apply either way.
10. 8. Termination. 8. Termination.
You may not propagate or modify a covered work except as expressly You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or provided under this License. Any attempt otherwise to propagate or
...@@ -423,7 +420,7 @@ this License. If your rights have been terminated and not permanently ...@@ -423,7 +420,7 @@ this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same reinstated, you do not qualify to receive new licenses for the same
material under section 10. material under section 10.
11. 9. Acceptance Not Required for Having Copies. 9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work run a copy of the Program. Ancillary propagation of a covered work
...@@ -434,7 +431,7 @@ modify any covered work. These actions infringe copyright if you do ...@@ -434,7 +431,7 @@ modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so. covered work, you indicate your acceptance of this License to do so.
12. 10. Automatic Licensing of Downstream Recipients. 10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and receives a license from the original licensors, to run, modify and
...@@ -459,7 +456,7 @@ rights granted under this License, and you may not initiate litigation ...@@ -459,7 +456,7 @@ rights granted under this License, and you may not initiate litigation
any patent claim is infringed by making, using, selling, offering for any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it. sale, or importing the Program or any portion of it.
13. 11. Patents. 11. Patents.
A "contributor" is a copyright holder who authorizes use under this A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The License of the Program or a work on which the Program is based. The
...@@ -528,7 +525,7 @@ or that patent license was granted, prior to 28 March 2007. ...@@ -528,7 +525,7 @@ or that patent license was granted, prior to 28 March 2007.
any implied license or other defenses to infringement that may any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law. otherwise be available to you under applicable patent law.
14. 12. No Surrender of Others' Freedom. 12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not otherwise) that contradict the conditions of this License, they do not
...@@ -540,7 +537,7 @@ to collect a royalty for further conveying from those to whom you convey ...@@ -540,7 +537,7 @@ to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program. License would be to refrain entirely from conveying the Program.
15. 13. Remote Network Interaction; Use with the GNU General Public License. 13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users Program, your modified version must prominently offer all users
...@@ -549,8 +546,9 @@ supports such interaction) an opportunity to receive the Corresponding ...@@ -549,8 +546,9 @@ supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by This License shall include the Corresponding Source for any work covered by version 3
that is incorporated pursuant to the following paragraph. of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed permission to link or combine any covered work with a work licensed
...@@ -560,30 +558,33 @@ License will continue to apply to the part which is the covered work, ...@@ -560,30 +558,33 @@ License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version but the work with which it is combined will remain governed by version
3 of the GNU General Public License. 3 of the GNU General Public License.
16. 14. Revised Versions of this License. 14. Revised Versions of this License.
NIBIO may publish revised and/or new versions of the License from time to The Free Software Foundation may publish revised and/or new versions of
time. Such new versions will be similar in spirit to the present version, but the GNU Affero General Public License from time to time. Such new versions
may differ in detail to address new problems or concerns. will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the License "or any later Program specifies that a certain numbered version of the GNU Affero General
version" applies to it, you have the option of following the terms and Public License "or any later version" applies to it, you have the
conditions either of that numbered version or of any later version published by option of following the terms and conditions either of that numbered
NIBIO. If the Program does not specify a version number of the License, you version or of any later version published by the Free Software
may choose any version ever published by the NIBIO. Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future If the Program specifies that a proxy can decide which future
versions of the License can be used, that proxy's public statement of versions of the GNU Affero General Public License can be used, that proxy's
acceptance of a version permanently authorizes you to choose that version for public statement of acceptance of a version permanently authorizes you
the Program. to choose that version for the Program.
Later license versions may give you additional or different Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a author or copyright holder as a result of your choosing to follow a
later version. later version.
17. 15. Disclaimer of Warranty. 15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
...@@ -594,7 +595,7 @@ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM ...@@ -594,7 +595,7 @@ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION. ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
18. 16. Limitation of Liability. 16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
...@@ -606,7 +607,7 @@ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), ...@@ -606,7 +607,7 @@ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES. SUCH DAMAGES.
19. 17. Interpretation of Sections 15 and 16. 17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms, above cannot be given local legal effect according to their terms,
...@@ -615,4 +616,46 @@ an absolute waiver of all civil liability in connection with the ...@@ -615,4 +616,46 @@ an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee. copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS
\ No newline at end of file
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.
...@@ -55,6 +55,7 @@ Add the model jar file, and edit module.xml accordingly. ...@@ -55,6 +55,7 @@ Add the model jar file, and edit module.xml accordingly.
<module name="com.fasterxml.jackson.core.jackson-databind" export="false"/> <module name="com.fasterxml.jackson.core.jackson-databind" export="false"/>
<module name="com.vividsolutions.jts" export="false"/> <module name="com.vividsolutions.jts" export="false"/>
<module name="org.renjin" export="false"/> <module name="org.renjin" export="false"/>
<module name="org.slf4j" export="false"/>
</dependencies> </dependencies>
</module> </module>
......
...@@ -2,25 +2,28 @@ ...@@ -2,25 +2,28 @@
Running a model is a matter of creating a client that is able to send a POST request to a common endpoint, and provide Json in the request body and consume the standard Json that is returned from the model. Running a model is a matter of creating a client that is able to send a POST request to a common endpoint, and provide Json in the request body and consume the standard Json that is returned from the model.
The endpoint for running a model is: The **endpoint for running a model** is:
``` ```
{{vipslogic_url}}/models/{{MODEL_ID}}/run {{vipscore_url}}/models/{{MODEL_ID}}/run
``` ```
Get the model ID by simply connecting to **Get the model ID** by simply connecting to
``` ```
{{vipslogic_url}}/models/ {{vipscore_url}}/models/
``` ```
So you must create a model configuration object and pass it in the request body. Each model has its own set of input data. To se a configuration example for a specific model, query So you must create a model configuration object and pass it in the request body. Each model has its own set of input data.
To see a **configuration example for a specific model**, query
``` ```
{{vipslogic_url}}/models/{{MODEL_ID}}/sampleconfig {{vipscore_url}}/models/{{MODEL_ID}}/sampleconfig
``` ```
Here's a sample for the Carrot rust fly temperature model (PSILARTEMP) Here's a sample for the Carrot rust fly temperature model (PSILARTEMP)
**NOTE: Not all models are properly documented. If you find models with missing information, get in touch and we'll
help you out**
``` ```
{ {
...@@ -47,7 +50,7 @@ The `"loginInfo"` property is only relevant when running the model through the V ...@@ -47,7 +50,7 @@ The `"loginInfo"` property is only relevant when running the model through the V
An explanation of the input parameters should be provided for each model from this endpoint: An explanation of the input parameters should be provided for each model from this endpoint:
``` ```
{{vipslogic_url}}/models/{{MODEL_ID}}/sampleconfig {{vipscore_url}}/models/{{MODEL_ID}}/usage
``` ```
If not, please contact the model provider and notify them. If not, please contact the model provider and notify them.
...@@ -109,7 +112,7 @@ Each model has its own output parameters, given in "allValues". They all provide ...@@ -109,7 +112,7 @@ Each model has its own output parameters, given in "allValues". They all provide
The exact interpretation of the warningStatus is provided by the model, and can be read from this endpoint: The exact interpretation of the warningStatus is provided by the model, and can be read from this endpoint:
``` ```
{{vipslogic_url}}/models/{{MODEL_ID}}/warningstatusinterpretation {{vipscore_url}}/models/{{MODEL_ID}}/warningstatusinterpretation
``` ```
Example from the PSILARTEMP model: Example from the PSILARTEMP model:
......
...@@ -74,7 +74,7 @@ public class ModelResourceImpl implements ModelResource{ ...@@ -74,7 +74,7 @@ public class ModelResourceImpl implements ModelResource{
@Override @Override
public Response defaultResponse() public Response defaultResponse()
{ {
return Response.ok().entity("<html><head></head><body><a href=\"" + servletRequest.getContextPath() + "/models/\">Models</a></body></html>").build(); return Response.ok().entity("<html><head></head><body><a href=\"/models/\">Models</a></body></html>").build();
} }
/** /**
...@@ -88,7 +88,7 @@ public class ModelResourceImpl implements ModelResource{ ...@@ -88,7 +88,7 @@ public class ModelResourceImpl implements ModelResource{
public Response printModelListJSON() public Response printModelListJSON()
{ {
return this.printModelListJSON(null); return this.printModelListJSON(Model.DEFAULT_LANGUAGE);
} }
/** /**
...@@ -327,8 +327,7 @@ public class ModelResourceImpl implements ModelResource{ ...@@ -327,8 +327,7 @@ public class ModelResourceImpl implements ModelResource{
if(config.getConfigParameter("fieldObservations") != null && List.class.isAssignableFrom(config.getConfigParameter("fieldObservations").getClass())) if(config.getConfigParameter("fieldObservations") != null && List.class.isAssignableFrom(config.getConfigParameter("fieldObservations").getClass()))
{ {
config.setConfigParameter("pestObservations", dt.getVIPSPestObservations( config.setConfigParameter("pestObservations", dt.getVIPSPestObservations(
(List) config.getConfigParameter("fieldObservations"), (List) config.getConfigParameter("fieldObservations")
(List) config.getConfigParameter("fieldObservationQuantifications")
) )
); );
} }
...@@ -336,6 +335,10 @@ public class ModelResourceImpl implements ModelResource{ ...@@ -336,6 +335,10 @@ public class ModelResourceImpl implements ModelResource{
{ {
throw new ConfigValidationException("ERROR: fieldObservations must be of type array"); throw new ConfigValidationException("ERROR: fieldObservations must be of type array");
} }
else if(config.getConfigParameter("fieldObservations") == null)
{
config.setConfigParameter("pestObservations",new ArrayList<>());
}
Model calledModel = ModelFactory.getInstance().getModelInstance(modelId); Model calledModel = ModelFactory.getInstance().getModelInstance(modelId);
calledModel.setConfiguration(config); calledModel.setConfiguration(config);
List<Result> results = calledModel.getResult(); List<Result> results = calledModel.getResult();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment