Skip to content
Snippets Groups Projects
Commit 239676ac authored by Piotr Gawron's avatar Piotr Gawron
Browse files

provide info about custom license url and name

parent 5b30c42a
No related branches found
No related tags found
2 merge requests!1755Devel 17.1.0,!1749Resolve "every project should have license defined"
......@@ -130,6 +130,12 @@ public class Project implements Serializable {
@ManyToOne
private License license;
@Column(length = 255)
private String customLicenseUrl = "";
@Column(length = 1023)
private String customLicenseName = "";
private boolean sbgnFormat = false;
/**
......@@ -470,4 +476,19 @@ public class Project implements Serializable {
this.license = license;
}
public String getCustomLicenseUrl() {
return customLicenseUrl;
}
public void setCustomLicenseUrl(String customLicenseUrl) {
this.customLicenseUrl = customLicenseUrl;
}
public String getCustomLicenseName() {
return customLicenseName;
}
public void setCustomLicenseName(String customLicenseName) {
this.customLicenseName = customLicenseName;
}
}
alter table project_table
add column custom_license_name character varying(256) default '';
alter table project_table
add column custom_license_url character varying(1024) default '';
alter table project_table
add column custom_license_name character varying(256) default '';
alter table project_table
add column custom_license_url character varying(1024) default '';
......@@ -195,6 +195,9 @@ public class ProjectController extends BaseController {
private MapCanvasType mapCanvasType;
private Optional<License> license;
private String customLicenseName;
private String customLicenseUrl;
public String getVersion() {
return version;
}
......@@ -266,6 +269,22 @@ public class ProjectController extends BaseController {
public void setLicense(final Optional<License> license) {
this.license = license;
}
public String getCustomLicenseName() {
return customLicenseName;
}
public void setCustomLicenseName(String customLicenseName) {
this.customLicenseName = customLicenseName;
}
public String getCustomLicenseUrl() {
return customLicenseUrl;
}
public void setCustomLicenseUrl(String customLicenseUrl) {
this.customLicenseUrl = customLicenseUrl;
}
}
@PreAuthorize("hasAnyAuthority('IS_ADMIN', 'WRITE_PROJECT:' + #projectId)")
......@@ -336,13 +355,22 @@ public class ProjectController extends BaseController {
if (data.getMapCanvasType() != null) {
project.setMapCanvasType(data.getMapCanvasType());
}
if (data.getCustomLicenseName() != null && data.getCustomLicenseUrl() != null) {
project.setCustomLicenseName(data.getCustomLicenseName());
project.setCustomLicenseUrl(data.getCustomLicenseUrl());
}
if (data.getLicense() != null && data.getLicense().isPresent()) {
if (data.getLicense().get() != null) {
Integer id = data.getLicense().get().getId();
License license = getLicenseById(id);
project.setLicense(license);
project.setCustomLicenseName("");
project.setCustomLicenseUrl("");
} else {
project.setLicense(null);
}
}
......
......@@ -49,6 +49,8 @@ public class ProjectDTO extends Project {
this.setOverviewImages(project.getOverviewImages());
this.setGlyphs(project.getGlyphs());
this.setLicense(project.getLicense());
this.setCustomLicenseName(project.getCustomLicenseName());
this.setCustomLicenseUrl(project.getCustomLicenseUrl());
}
public boolean isSharedInMinervaNet() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment