Commit 10e98433 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

googleLicenseConsent info for overlays is provided via API

parent d12ef350
...@@ -159,7 +159,11 @@ public enum ConfigurationElementType { ...@@ -159,7 +159,11 @@ public enum ConfigurationElementType {
SHOW_REACTION_TYPE("Don't touch [12.0.x compatibility]", "true", ConfigurationElementEditType.STRING, true), SHOW_REACTION_TYPE("Don't touch [12.0.x compatibility]", "true", ConfigurationElementEditType.STRING, true),
GOOGLE_MAPS_API_KEY("Google Maps API key", "", ConfigurationElementEditType.STRING, false), GOOGLE_MAPS_API_KEY("By providing this Google Maps Platform API key I declare that I am aware that "
+ "I am a Customer of the Google Maps Platform and I agree to the terms of the <a href=\"https://cloud.google.com/maps-platform/terms/\">license of Google Maps Platform</a>." +
"In particular, I warrant that neither any of the maps nor publicly available data overlays "
+ "(\"General overlays\") on this MINERVA server contain Protected Health Information (as defined in and subject to HIPAA).",
"", ConfigurationElementEditType.STRING, false),
; ;
......
...@@ -158,9 +158,13 @@ public class OverlayRestImpl extends BaseRestImpl { ...@@ -158,9 +158,13 @@ public class OverlayRestImpl extends BaseRestImpl {
if (overlayData.containsKey("description")) { if (overlayData.containsKey("description")) {
layout.setDescription((String) overlayData.get("description")); layout.setDescription((String) overlayData.get("description"));
} }
if (overlayData.containsKey("name")) { if (overlayData.containsKey("name")) {
layout.setTitle((String) overlayData.get("name")); layout.setTitle((String) overlayData.get("name"));
} }
if (overlayData.containsKey("googleLicenseConsent")) {
layout.setGoogleLicenseConsent((Boolean) overlayData.get("googleLicenseConsent"));
}
layoutDao.update(layout); layoutDao.update(layout);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
throw new ObjectNotFoundException("overlay doesn't exist"); throw new ObjectNotFoundException("overlay doesn't exist");
......
...@@ -493,6 +493,7 @@ public class LayoutService implements ILayoutService { ...@@ -493,6 +493,7 @@ public class LayoutService implements ILayoutService {
} else { } else {
topLayout.setPublicLayout(false); topLayout.setPublicLayout(false);
} }
topLayout.setGoogleLicenseConsent(params.isGoogleLicenseConsent());
topLayout.setStatus(LayoutStatus.OK); topLayout.setStatus(LayoutStatus.OK);
topLayout.setProgress(0.0); topLayout.setProgress(0.0);
UploadedFileEntry fileEntry = new UploadedFileEntry(); UploadedFileEntry fileEntry = new UploadedFileEntry();
......
...@@ -95,7 +95,9 @@ public interface ILayoutService { ...@@ -95,7 +95,9 @@ public interface ILayoutService {
* who creates the layout. * who creates the layout.
* *
*/ */
private boolean async = false; private boolean async = false;
private boolean googleLicenseConsent = false;
/** /**
* Type of the uploaded file. * Type of the uploaded file.
...@@ -210,24 +212,43 @@ public interface ILayoutService { ...@@ -210,24 +212,43 @@ public interface ILayoutService {
return this; return this;
} }
/** /**
* @return the async * @return the async
* @see #async * @see #async
*/ */
public boolean isAsync() { public boolean isAsync() {
return async; return async;
} }
/** /**
* @param async * @param async
* the async to set * the async to set
* @see #async * @see #async
* @return {@link CreateLayoutParams} object * @return {@link CreateLayoutParams} object
*/ */
public CreateLayoutParams async(boolean async) { public CreateLayoutParams async(boolean async) {
this.async = async; this.async = async;
return this; return this;
} }
/**
* @return the googleLicenseConsent
* @see #googleLicenseConsent
*/
public boolean isGoogleLicenseConsent() {
return googleLicenseConsent;
}
/**
* @param googleLicenseConsent
* the googleLicenseConsent to set
* @see #googleLicenseConsent
* @return {@link CreateLayoutParams} object
*/
public CreateLayoutParams googleLicenseConsent(boolean googleLicenseConsent) {
this.googleLicenseConsent = googleLicenseConsent;
return this;
}
/** /**
* @return the description * @return the description
......
...@@ -81,7 +81,10 @@ public class LayoutView extends AbstractView<Layout> implements Serializable { ...@@ -81,7 +81,10 @@ public class LayoutView extends AbstractView<Layout> implements Serializable {
* "true" if input file from which layout was created is available, "false" * "true" if input file from which layout was created is available, "false"
* otherwise. * otherwise.
*/ */
private String inputDataAvailable; private String inputDataAvailable;
private boolean googleLicenseConsent;
/** /**
* Default constructor. * Default constructor.
...@@ -235,4 +238,12 @@ public class LayoutView extends AbstractView<Layout> implements Serializable { ...@@ -235,4 +238,12 @@ public class LayoutView extends AbstractView<Layout> implements Serializable {
this.inputDataAvailable = inputDataAvailable; this.inputDataAvailable = inputDataAvailable;
} }
public boolean isGoogleLicenseConsent() {
return googleLicenseConsent;
}
public void setGoogleLicenseConsent(boolean googleLicenseConsent) {
this.googleLicenseConsent = googleLicenseConsent;
}
} }
...@@ -51,6 +51,7 @@ public class LayoutViewFactory extends AbstractViewFactory<Layout, LayoutView> { ...@@ -51,6 +51,7 @@ public class LayoutViewFactory extends AbstractViewFactory<Layout, LayoutView> {
} else { } else {
result.setInputDataAvailable("false"); result.setInputDataAvailable("false");
} }
result.setGoogleLicenseConsent(layout.isGoogleLicenseConsent());
return result; return result;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment