diff --git a/CHANGELOG b/CHANGELOG
index 1d02c5026166064a57887dda3e9322db397ef54a..6bfcc91cb308d5027703d573c1dc4826e896774b 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -19,6 +19,9 @@ minerva (14.0.0~alpha.0) unstable; urgency=low
about type of database that identifies the target (#66)
* Small improvement: redundant 'references' field in gene variants data
overlay is now deprecated (#850)
+ * Small improvement: information about deprecated columns in data overlay is
+ visible in overlay list (#838)
+ * Small improvement: publication list is resizable (#740)
* Bug fix: export to CellDesigner of reaction with two modifiers connected
with boolean operator resulted was skipping some layout information
* Bug fix: reaction in SBGNML file containing two products was improperly
diff --git a/commons/src/main/java/lcsb/mapviewer/common/UnitTestFailedWatcher.java b/commons/src/main/java/lcsb/mapviewer/common/UnitTestFailedWatcher.java
index cf8337839412ceb899d0adb94ed415855aaa1b53..833ee1a0c8d7b6a585345a8d66edfc4da0d14dff 100644
--- a/commons/src/main/java/lcsb/mapviewer/common/UnitTestFailedWatcher.java
+++ b/commons/src/main/java/lcsb/mapviewer/common/UnitTestFailedWatcher.java
@@ -6,6 +6,8 @@ import org.junit.runner.Description;
public class UnitTestFailedWatcher extends TestWatcher {
@Override
protected void failed(Throwable e, Description description) {
- e.printStackTrace();
+ if (!(e instanceof AssertionError)) {
+ e.printStackTrace();
+ }
}
}
diff --git a/frontend-js/src/main/js/gui/leftPanel/OverlayPanel.js b/frontend-js/src/main/js/gui/leftPanel/OverlayPanel.js
index e26912cc9434a9dbde7ba4d8dd3b6ef67312abc5..1c6454fa0405edb0fa5984c960cd024bd1b6f455 100644
--- a/frontend-js/src/main/js/gui/leftPanel/OverlayPanel.js
+++ b/frontend-js/src/main/js/gui/leftPanel/OverlayPanel.js
@@ -318,7 +318,17 @@ OverlayPanel.prototype.createOverlayRow = function (overlay, checked, disabled)
OverlayPanel.prototype.overlayToDataRow = function (overlay, checked, disabled) {
var result = [];
result[0] = overlay.getOrder();
- result[1] = overlay.getName();
+ if (overlay.getDeprecatedColumns() !== undefined && overlay.getDeprecatedColumns() !== null && overlay.getDeprecatedColumns().length > 0) {
+
+ result[1] = "
" +
+ "" + overlay.getName() + "
"
+ } else {
+ result[1] = overlay.getName();
+ }
if (overlay.getInputDataAvailable()) {
if (disabled) {
@@ -351,6 +361,7 @@ OverlayPanel.prototype.overlayToDataRow = function (overlay, checked, disabled)
"";
}
}
+ logger.debug(result);
return result;
};
diff --git a/frontend-js/src/main/js/map/data/DataOverlay.js b/frontend-js/src/main/js/map/data/DataOverlay.js
index 16692fff0dbb5e6f1a90cb56f3ea5a3b044b3d96..8e5a78f53b94ebf74836b88f7a77a635f1b7790a 100644
--- a/frontend-js/src/main/js/map/data/DataOverlay.js
+++ b/frontend-js/src/main/js/map/data/DataOverlay.js
@@ -26,6 +26,7 @@ function DataOverlay(overlayId, name) {
this.setImagesDirectory(object.images);
this.setDescription(object.description);
this.setCreator(object.creator);
+ this.setDeprecatedColumns(object.deprecatedColumns);
this.setContent(object.content);
this.setFilename(object.filename);
this.setPublicOverlay(object.publicOverlay);
@@ -328,6 +329,22 @@ DataOverlay.prototype.setContent = function (content) {
this._content = content;
};
+/**
+ *
+ * @returns {string[]}
+ */
+DataOverlay.prototype.getDeprecatedColumns = function () {
+ return this._deprecatedColumns;
+};
+
+/**
+ *
+ * @param {string[]} deprecatedColumns
+ */
+DataOverlay.prototype.setDeprecatedColumns = function (deprecatedColumns) {
+ this._deprecatedColumns = deprecatedColumns;
+};
+
/**
*
* @returns {number}
@@ -380,7 +397,7 @@ DataOverlay.prototype.setType = function (type) {
*
* @param {boolean} value
*/
-DataOverlay.prototype.setGoogleLicenseConsent = function(value) {
+DataOverlay.prototype.setGoogleLicenseConsent = function (value) {
this._googleLicenseConsent = value;
};
@@ -388,7 +405,7 @@ DataOverlay.prototype.setGoogleLicenseConsent = function(value) {
*
* @returns {boolean}
*/
-DataOverlay.prototype.isGoogleLicenseConsent = function() {
+DataOverlay.prototype.isGoogleLicenseConsent = function () {
return this._googleLicenseConsent;
};
diff --git a/persist/src/main/java/lcsb/mapviewer/persist/dao/BaseDao.java b/persist/src/main/java/lcsb/mapviewer/persist/dao/BaseDao.java
index 5cb391fb1974970566703b1586ba4ca568ecd532..efb3df7af91bfa2b7e796cf7f48152c1ef95a2ba 100644
--- a/persist/src/main/java/lcsb/mapviewer/persist/dao/BaseDao.java
+++ b/persist/src/main/java/lcsb/mapviewer/persist/dao/BaseDao.java
@@ -254,7 +254,10 @@ public abstract class BaseDao {
* @return object width identifier given as parameter
*/
@SuppressWarnings("unchecked")
- public T getById(int id) {
+ public T getById(Integer id) {
+ if (id == null) {
+ return null;
+ }
List> list = getSession()
.createQuery(" from " + this.clazz.getSimpleName() + " where id=:id " + removableAndStatemant())
.setParameter("id", id).list();
diff --git a/persist/src/main/java/lcsb/mapviewer/persist/dao/map/ModelDao.java b/persist/src/main/java/lcsb/mapviewer/persist/dao/map/ModelDao.java
index 28b9f7f15f3cc0d3725a8d8358fc4def9e9ca655..395398d9c9e650577a6d2be4d9daa3fb380c888d 100644
--- a/persist/src/main/java/lcsb/mapviewer/persist/dao/map/ModelDao.java
+++ b/persist/src/main/java/lcsb/mapviewer/persist/dao/map/ModelDao.java
@@ -40,12 +40,6 @@ public class ModelDao extends BaseDao {
super.delete(model);
}
- @Override
- public ModelData getById(int id) {
- ModelData result = super.getById(id);
- return result;
- }
-
/**
* Return the latest model for the project with a given project identifier.
*
diff --git a/rest-api/src/main/java/lcsb/mapviewer/api/BaseController.java b/rest-api/src/main/java/lcsb/mapviewer/api/BaseController.java
index e5e295b8d406d27adc8bba98d38031cf10dcc726..b286c43cd408a9ccffd88694072ee7a0a57ae249 100644
--- a/rest-api/src/main/java/lcsb/mapviewer/api/BaseController.java
+++ b/rest-api/src/main/java/lcsb/mapviewer/api/BaseController.java
@@ -14,6 +14,7 @@ import org.springframework.web.HttpMediaTypeNotSupportedException;
import org.springframework.web.bind.MissingServletRequestParameterException;
import org.springframework.web.bind.ServletRequestBindingException;
import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -42,7 +43,7 @@ public abstract class BaseController {
|| e instanceof HttpMessageNotReadableException
|| e instanceof MissingServletRequestParameterException
|| e instanceof HttpMediaTypeNotSupportedException
- || e instanceof IllegalArgumentException) {
+ || e instanceof MethodArgumentTypeMismatchException) {
logger.error(e, e);
return createErrorResponse("Query server error.", e.getMessage(), new HttpHeaders(), HttpStatus.BAD_REQUEST);
} else if (e instanceof ServletRequestBindingException && e.getMessage().contains(Configuration.AUTH_TOKEN)) {
diff --git a/rest-api/src/main/java/lcsb/mapviewer/api/BaseRestImpl.java b/rest-api/src/main/java/lcsb/mapviewer/api/BaseRestImpl.java
index b7be8ff5af3f907c70abfda44200a1517faa4a37..bc9c4366ab4c056f74a422392e16135c94007e6c 100644
--- a/rest-api/src/main/java/lcsb/mapviewer/api/BaseRestImpl.java
+++ b/rest-api/src/main/java/lcsb/mapviewer/api/BaseRestImpl.java
@@ -8,6 +8,7 @@ import javax.xml.transform.*;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -160,10 +161,9 @@ public abstract class BaseRestImpl {
* @param modelId
* list of model identifiers separated by "," or '*' when all models
* should be returned
- * @throws ObjectNotFoundException
- * thrown when data for given identifiers doesn't exist
+ * @throws QueryException
*/
- protected List getModels(String projectId, String modelId) throws ObjectNotFoundException {
+ protected List getModels(String projectId, String modelId) throws QueryException {
Model model = modelService.getLastModelByProjectId(projectId);
if (model == null) {
throw new ObjectNotFoundException("Project with given id doesn't exist");
@@ -172,6 +172,10 @@ public abstract class BaseRestImpl {
if (!modelId.equals("*")) {
for (String str : modelId.split(",")) {
+ if (!StringUtils.isNumeric(str)) {
+ throw new QueryException("Invalid modelId: " + modelId);
+ }
+
Model submodel = model.getSubmodelById(Integer.valueOf(str));
if (submodel == null) {
throw new ObjectNotFoundException("Model with given id doesn't exist");
diff --git a/rest-api/src/main/java/lcsb/mapviewer/api/files/FileController.java b/rest-api/src/main/java/lcsb/mapviewer/api/files/FileController.java
index fee30ce281e042109342bc2b5e499ee64b526373..1f9ec07f9e43010d8e225392da13766b4965a233 100644
--- a/rest-api/src/main/java/lcsb/mapviewer/api/files/FileController.java
+++ b/rest-api/src/main/java/lcsb/mapviewer/api/files/FileController.java
@@ -36,13 +36,13 @@ public class FileController extends BaseController {
@PostAuthorize("hasAuthority('IS_ADMIN') or returnObject['owner'] == authentication.name")
@GetMapping(value = "/{id}")
- public Map getFile(@PathVariable(value = "id") String id) throws ObjectNotFoundException {
+ public Map getFile(@PathVariable(value = "id") Integer id) throws ObjectNotFoundException {
return fileRest.getFile(id);
}
- @PreAuthorize("@fileService.getById(#id)?.owner?.login == authentication.name")
+ @PreAuthorize("@fileService.getOwnerByFileId(#id)?.login == authentication.name")
@PostMapping(value = "/{id}:uploadContent")
- public Map uploadContent(@PathVariable(value = "id") String id, @RequestBody byte[] data)
+ public Map uploadContent(@PathVariable(value = "id") Integer id, @RequestBody byte[] data)
throws ObjectNotFoundException {
return fileRest.uploadContent(id, data);
}
diff --git a/rest-api/src/main/java/lcsb/mapviewer/api/files/FileRestImpl.java b/rest-api/src/main/java/lcsb/mapviewer/api/files/FileRestImpl.java
index 636cf3c0052e0deb70260984a38a68d778c9292f..4a3073d7ef556c117e56b91af6a255b81f247dd9 100644
--- a/rest-api/src/main/java/lcsb/mapviewer/api/files/FileRestImpl.java
+++ b/rest-api/src/main/java/lcsb/mapviewer/api/files/FileRestImpl.java
@@ -15,6 +15,7 @@ import lcsb.mapviewer.common.exception.InvalidStateException;
import lcsb.mapviewer.model.cache.UploadedFileEntry;
import lcsb.mapviewer.model.user.User;
import lcsb.mapviewer.persist.dao.cache.UploadedFileEntryDao;
+import lcsb.mapviewer.services.interfaces.IFileService;
@Transactional
@Service
@@ -22,9 +23,12 @@ public class FileRestImpl extends BaseRestImpl {
private UploadedFileEntryDao uploadedFileEntryDao;
+ private IFileService fileService;
+
@Autowired
- public FileRestImpl(UploadedFileEntryDao uploadedFileEntryDao) {
+ public FileRestImpl(UploadedFileEntryDao uploadedFileEntryDao, IFileService fileService) {
this.uploadedFileEntryDao = uploadedFileEntryDao;
+ this.fileService = fileService;
}
public Map createFile(String filename, String length, User user) {
@@ -35,15 +39,14 @@ public class FileRestImpl extends BaseRestImpl {
entry.setOwner(user);
uploadedFileEntryDao.add(entry);
try {
- return getFile(entry.getId() + "");
+ return getFile(entry.getId());
} catch (ObjectNotFoundException e) {
throw new InvalidStateException(e);
}
}
- public Map getFile(String id) throws ObjectNotFoundException {
- int fileId = Integer.valueOf(id);
- UploadedFileEntry fileEntry = uploadedFileEntryDao.getById(fileId);
+ public Map getFile(Integer id) throws ObjectNotFoundException {
+ UploadedFileEntry fileEntry = fileService.getById(id);
if (fileEntry == null) {
throw new ObjectNotFoundException("Object not found");
}
@@ -60,7 +63,7 @@ public class FileRestImpl extends BaseRestImpl {
return result;
}
- public Map uploadContent(String id, byte[] data) throws ObjectNotFoundException {
+ public Map uploadContent(Integer id, byte[] data) throws ObjectNotFoundException {
int fileId = Integer.valueOf(id);
UploadedFileEntry fileEntry = uploadedFileEntryDao.getById(fileId);
if (fileEntry == null) {
diff --git a/rest-api/src/main/java/lcsb/mapviewer/api/genomics/ReferenceGenomeRestImpl.java b/rest-api/src/main/java/lcsb/mapviewer/api/genomics/ReferenceGenomeRestImpl.java
index d6271f6d2b3c8c0f3d8525cb353ab3bc38ce8367..b260d3c77451ead036cacdc3ff3f414890dc6cbf 100644
--- a/rest-api/src/main/java/lcsb/mapviewer/api/genomics/ReferenceGenomeRestImpl.java
+++ b/rest-api/src/main/java/lcsb/mapviewer/api/genomics/ReferenceGenomeRestImpl.java
@@ -168,7 +168,12 @@ public class ReferenceGenomeRestImpl extends BaseRestImpl {
public List