Commit 83dea760 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

checkstyle with line length and tab

parent 2c649f66
......@@ -47,7 +47,8 @@ public class DrugbankParserTest extends AnnotationTestFunctions {
assertEquals("Urokinase", test.getName());
assertTrue(test.getBloodBrainBarrier().equalsIgnoreCase("N/A"));
boolean res = test.getDescription().contains(
"Low molecular weight form of human urokinase, that consists of an A chain of 2,000 daltons linked by a sulfhydryl bond to a B chain of 30,400 daltons. Recombinant urokinase plasminogen activator");
"Low molecular weight form of human urokinase, that consists of an A chain of 2,000 daltons linked "
+ "by a sulfhydryl bond to a B chain of 30,400 daltons. Recombinant urokinase plasminogen activator");
assertTrue(res);
assertEquals(10, test.getTargets().size());
assertNull(test.getApproved());
......@@ -105,7 +106,10 @@ public class DrugbankParserTest extends AnnotationTestFunctions {
assertEquals("Aluminum hydroxide", test.getName());
assertEquals("DB06723", test.getSources().get(0).getResource());
assertTrue(test.getDescription().contains(
"Aluminum hydroxide is an inorganic salt used as an antacid. It is a basic compound that acts by neutralizing hydrochloric acid in gastric secretions. Subsequent increases in pH may inhibit the action of pepsin. An increase in bicarbonate ions and prostaglandins may also confer cytoprotective effects."));
"Aluminum hydroxide is an inorganic salt used as an antacid. "
+ "It is a basic compound that acts by neutralizing hydrochloric acid in gastric secretions. "
+ "Subsequent increases in pH may inhibit the action of pepsin. "
+ "An increase in bicarbonate ions and prostaglandins may also confer cytoprotective effects."));
assertEquals(0, test.getTargets().size());
}
......
This diff is collapsed.
package lcsb.mapviewer.common;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import java.io.File;
import java.lang.reflect.Constructor;
......@@ -9,7 +11,9 @@ import java.util.List;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class ConfigurationTest extends CommonTestFunctions {
......
......@@ -58,8 +58,8 @@ public enum ModifierType {
/**
* CellDesigner 2.5 modification type.
*/
TRANSCRIPTIONAL_INHIBITION("TRANSCRIPTIONAL_INHIBITION", Inhibition.class, ArrowType.CROSSBAR, 8.0, ReactionCellDesignerConverter.RECT_SIZE / 2 - 1),
TRANSCRIPTIONAL_INHIBITION("TRANSCRIPTIONAL_INHIBITION", Inhibition.class, ArrowType.CROSSBAR, 8.0,
ReactionCellDesignerConverter.RECT_SIZE / 2 - 1),
;
......
......@@ -304,7 +304,12 @@ public class CellDesignerXmlParserTest extends CellDesignerTestFunctions {
speciesAlias.setName("ROS");
RestAnnotationParser rap = new RestAnnotationParser();
rap.processNotes(
"Symbol: ROS1\r\nName: c-ros oncogene 1 , receptor tyrosine kinase\r\nDescription: RecName: Full=Proto-oncogene tyrosine-protein kinase ROS; EC=2.7.10.1; AltName: Full=Proto-oncogene c-Ros; AltName: Full=Proto-oncogene c-Ros-1; AltName: Full=Receptor tyrosine kinase c-ros oncogene 1; AltName: Full=c-Ros receptor tyrosine kinase; Flags: Precursor;\r\nPrevious Symbols:\r\nSynonyms: ROS, MCF3",
"Symbol: ROS1\r\nName: c-ros oncogene 1 , receptor tyrosine kinase\r\n"
+ "Description: RecName: Full=Proto-oncogene tyrosine-protein kinase ROS; EC=2.7.10.1; "
+ "AltName: Full=Proto-oncogene c-Ros; AltName: Full=Proto-oncogene c-Ros-1; "
+ "AltName: Full=Receptor tyrosine kinase c-ros oncogene 1; "
+ "AltName: Full=c-Ros receptor tyrosine kinase; Flags: Precursor;\r\n"
+ "Previous Symbols:\r\nSynonyms: ROS, MCF3",
speciesAlias);
model.addElement(speciesAlias);
......@@ -315,7 +320,11 @@ public class CellDesignerXmlParserTest extends CellDesignerTestFunctions {
SimpleMolecule speciesAlias2 = createSimpleMolecule();
speciesAlias2.setName("PDK1");
rap.processNotes(
"Symbol: ROS1\r\nName: c-ros oncogene 1 , receptor tyrosine kinase\r\nDescription: RecName: Full=Proto-oncogene tyrosine-protein kinase ROS; EC=2.7.10.1; AltName: Full=Proto-oncogene c-Ros; AltName: Full=Proto-oncogene c-Ros-1; AltName: Full=Receptor tyrosine kinase c-ros oncogene 1; AltName: Full=c-Ros receptor tyrosine kinase; Flags: Precursor;\r\nPrevious Symbols:\r\nSynonyms: ROS, MCF3",
"Symbol: ROS1\r\nName: c-ros oncogene 1 , receptor tyrosine kinase\r\n"
+ "Description: RecName: Full=Proto-oncogene tyrosine-protein kinase ROS; EC=2.7.10.1; "
+ "AltName: Full=Proto-oncogene c-Ros; AltName: Full=Proto-oncogene c-Ros-1; "
+ "AltName: Full=Receptor tyrosine kinase c-ros oncogene 1; AltName: Full=c-Ros receptor tyrosine kinase; Flags: Precursor;\r\n"
+ "Previous Symbols:\r\nSynonyms: ROS, MCF3",
speciesAlias2);
model.addElement(speciesAlias2);
......@@ -934,7 +943,8 @@ public class CellDesignerXmlParserTest extends CellDesignerTestFunctions {
CellDesignerXmlParser parser = new CellDesignerXmlParser();
Model model = parser.createModel(new ConverterParams().filename("testFiles/orthogonal_reaction_to_phenotype.xml"));
Reaction r = model.getReactionByReactionId("re2");
assertEquals(r.getReactants().get(0).getLine().getStartPoint().getY(), r.getProducts().get(0).getLine().getStartPoint().getY(), Configuration.EPSILON);
assertEquals(r.getReactants().get(0).getLine().getStartPoint().getY(),
r.getProducts().get(0).getLine().getStartPoint().getY(), Configuration.EPSILON);
}
@Test
......@@ -942,7 +952,8 @@ public class CellDesignerXmlParserTest extends CellDesignerTestFunctions {
CellDesignerXmlParser parser = new CellDesignerXmlParser();
Model model = parser.createModel(new ConverterParams().filename("testFiles/orthogonal_reaction_to_drug.xml"));
Reaction r = model.getReactionByReactionId("re3");
assertEquals(r.getReactants().get(0).getLine().getStartPoint().getY(), r.getProducts().get(0).getLine().getStartPoint().getY(), Configuration.EPSILON);
assertEquals(r.getReactants().get(0).getLine().getStartPoint().getY(),
r.getProducts().get(0).getLine().getStartPoint().getY(), Configuration.EPSILON);
}
......
......@@ -272,12 +272,12 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions {
public void testGetNotesWithMissingBody() throws Exception {
RestAnnotationParser rap = new RestAnnotationParser();
Node node = super.getNodeFromXmlString("<celldesigner:notes>\n" +
" <html xmlns=\"http://www.w3.org/1999/xhtml\">\n" +
" <head>\n" +
" <title/>\n" +
" </head>\n" +
" </html>\n" +
Node node = super.getNodeFromXmlString("<celldesigner:notes>\n" +
" <html xmlns=\"http://www.w3.org/1999/xhtml\">\n" +
" <head>\n" +
" <title/>\n" +
" </head>\n" +
" </html>\n" +
" </celldesigner:notes>");
String notes = rap.getNotes(node);
assertNotNull(notes);
......@@ -289,11 +289,13 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions {
Node node = super.getNodeFromXmlString("<notes>\n" +
"Name: L-cystine\n" +
"Synonyms: (R,R)-3,3&apos;-dithiobis(2-aminopropanoic acid), (R-(R*,R*))-3,3&apos;-Dithiobis(2-aminopropanoic acid), 3,3&apos;-Dithiobis-L-alanine, beta,beta&apos;-diamino-beta,beta&apos;-dicarboxydiethyl disulfide, beta,beta&apos;-dithiodialanine, bis(beta-amino-beta-carboxyethyl) disulfide, E921, L-alpha-Diamino-beta-dithiolactic acid, L-Cystine, L-Dicysteine, oxidized L-cysteine, Recon metabolite: mma\n"
+
"Description: VMH database: <a xmlns=\"http://www.w3.org/1999/xhtml\" href=\"http://vmh.uni.lu/#metabolite/mma\">mma</a>\n"
+
"SemanticZoomLevelVisibility: 5\n" +
"Synonyms: (R,R)-3,3&apos;-dithiobis(2-aminopropanoic acid), "
+ "(R-(R*,R*))-3,3&apos;-Dithiobis(2-aminopropanoic acid), "
+ "3,3&apos;-Dithiobis-L-alanine, beta,beta&apos;-diamino-beta,beta&apos;-dicarboxydiethyl disulfide, "
+ "beta,beta&apos;-dithiodialanine, bis(beta-amino-beta-carboxyethyl) disulfide, E921, "
+ "L-alpha-Diamino-beta-dithiolactic acid, L-Cystine, L-Dicysteine, oxidized L-cysteine, Recon metabolite: mma\n"
+ "Description: VMH database: <a xmlns=\"http://www.w3.org/1999/xhtml\" href=\"http://vmh.uni.lu/#metabolite/mma\">mma</a>\n"
+ "SemanticZoomLevelVisibility: 5\n" +
"Charge: 0\n" +
"</notes>\n" +
"");
......@@ -356,5 +358,4 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions {
assertNull(color);
}
}
......@@ -56,7 +56,7 @@ public class ProteinXmlParserTest extends CellDesignerTestFunctions {
assertEquals("S176 bla bla", protein.getModificationResidues().get(0).getName());
assertEquals("Difference to big", 3.141592653589793, protein.getModificationResidues().get(0).getAngle(), 1e-6);
assertEquals("none", protein.getModificationResidues().get(0).getSide());
assertTrue(protein.getNotes().contains("UniProtKB P31040 SDHA GO:0005749 GO_REF:0000024"));
assertTrue(protein.getNotes().contains("UniProtKB\tP31040\tSDHA\t\tGO:0005749\tGO_REF:0000024"));
}
@Test
......
package lcsb.mapviewer.converter;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.awt.geom.Point2D;
import java.io.File;
import java.io.IOException;
import java.util.*;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import org.apache.commons.io.FileUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import com.google.common.io.Files;
import lcsb.mapviewer.converter.zip.ImageZipEntryFile;
import lcsb.mapviewer.model.map.*;
import lcsb.mapviewer.model.map.OverviewImage;
import lcsb.mapviewer.model.map.OverviewLink;
import lcsb.mapviewer.model.map.OverviewModelLink;
import lcsb.mapviewer.model.map.model.Model;
import lcsb.mapviewer.model.map.model.ModelFullIndexed;
......@@ -173,8 +183,8 @@ public class OverviewParserTest extends ConverterTestFunctions {
*/
@Test(expected = InvalidOverviewFile.class)
public void testParseInvalidCoordinates() throws Exception {
String invalidCoordinates = "test.png 10,10 100,10 100,100 10,10 main.xml 10,10 3\n" +
"test.png 10,10 10,400 400,400 400,10 main.xml 10,10 4";
String invalidCoordinates = "test.png\t10,10 100,10 100,100 10,10\tmain.xml\t10,10\t3\n" +
"test.png\t10,10 10,400 400,400 400,10\tmain.xml\t10,10\t4";
Set<Model> models = createValidTestMapModel();
List<OverviewImage> images = new ArrayList<OverviewImage>();
......@@ -189,9 +199,9 @@ public class OverviewParserTest extends ConverterTestFunctions {
@Test
public void testParseValidCoordinates() throws Exception {
String invalidCoordinates = "FILE POLYGON LINK_TARGET MODEL_COORDINATES MODEL_ZOOM_LEVEL LINK_TYPE\n" +
"test.png 10,10 100,10 100,100 10,10 main.xml 10,10 3 MODEL\n" +
"test.png 200,200 200,400 400,400 400,200 main.xml 10,10 4 MODEL";
String invalidCoordinates = "FILE\tPOLYGON\tLINK_TARGET\tMODEL_COORDINATES\tMODEL_ZOOM_LEVEL\tLINK_TYPE\n" +
"test.png\t10,10 100,10 100,100 10,10\tmain.xml\t10,10\t3\tMODEL\n" +
"test.png\t200,200 200,400 400,400 400,200\tmain.xml\t10,10\t4\tMODEL";
Set<Model> models = createValidTestMapModel();
List<OverviewImage> images = new ArrayList<OverviewImage>();
......@@ -247,7 +257,7 @@ public class OverviewParserTest extends ConverterTestFunctions {
oi2.setWidth(1000);
oi2.setHeight(1000);
images.add(oi2);
OverviewImage oi3 = new OverviewImage();
oi3.setFilename("test2.png");
oi3.setWidth(1000);
......
......@@ -18,7 +18,7 @@ package lcsb.mapviewer.model.graphics;
*
*/
public enum ArrowType {
// CHECKSTYLE:OFF
// CHECKSTYLE.OFF
/**
* The arrow end that should look as an image bellow. <br/>
* <br/>
......@@ -104,6 +104,6 @@ public enum ArrowType {
*/
NONE
// CHECKSTYLE:ON
// CHECKSTYLE.ON
}
......@@ -37,10 +37,9 @@ public class Plugin implements Serializable {
return new IntegerComparator().compare(o1.getId(), o2.getId());
}
};
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* Unique database identifier.
*/
......@@ -71,7 +70,7 @@ public class Plugin implements Serializable {
*/
private boolean isPublic = false;
private boolean isDefault= false;
private boolean isDefault = false;
/**
* List of urls from which plugin can be downloaded.
......
......@@ -25,9 +25,6 @@ import lcsb.mapviewer.modelutils.serializer.model.plugin.PluginDataEntrySerializ
@JsonSerialize(using = PluginDataEntrySerializer.class)
public class PluginDataEntry implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
......
......@@ -113,7 +113,8 @@ public enum ConfigurationElementType {
* Max number of results in search box.
*/
SEARCH_RESULT_NUMBER(
"Max number of results (this value indicates the max number of elements that will be returned from search - not the number of aggregated elements in the search box).",
"Max number of results (this value indicates the max number of elements that will be returned from search"
+ " - not the number of aggregated elements in the search box).",
"100", ConfigurationElementEditType.INTEGER, false, ConfigurationElementTypeGroup.POINT_AND_CLICK),
/**
......@@ -224,7 +225,8 @@ public enum ConfigurationElementType {
ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS),
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/\" target='_blank'>license of Google Maps Platform</a>."
+ "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/\" target='_blank'>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, ConfigurationElementTypeGroup.SERVER_CONFIGURATION),
......
......@@ -29,7 +29,7 @@ public class CommentSerializer extends JsonSerializer<Comment> {
private Function<Integer, Reaction> getReaction;
private Function<Integer, Element> getElement;
private PointTransformation pt = new PointTransformation();
public CommentSerializer(Function<Integer, Reaction> getReaction, Function<Integer, Element> getElement) {
......@@ -114,7 +114,20 @@ public class CommentSerializer extends JsonSerializer<Comment> {
}
public static List<String> availableColumns() {
return Arrays.asList("title", "icon", "type", "content", "removed", "coord", "modelId", "elementId", "id", "pinned", "email", "owner", "removeReason");
return Arrays.asList(
"title",
"icon",
"type",
"content",
"removed",
"coord",
"modelId",
"elementId",
"id",
"pinned",
"email",
"owner",
"removeReason");
}
private Object getId(Comment comment) {
......
......@@ -51,7 +51,8 @@ public class DataOverlayDao extends BaseDao<DataOverlay> {
+ " where element.model in :maps and entry.dataOverlay.id = :overlayId "
+ " and (lower(element.name) = lower(entry.name) or entry.name ='' or entry.name is null) "
+ " and (lower(element.model.name) = lower(entry.modelName) or entry.modelName='' or entry.modelName is null) "
+ " and (entry_miriam is null or (entry_miriam.dataType = element_miriam.dataType and lower(entry_miriam.resource) = lower(element_miriam.resource)) ) "
+ " and (entry_miriam is null or "
+ " (entry_miriam.dataType = element_miriam.dataType and lower(entry_miriam.resource) = lower(element_miriam.resource)) ) "
+ " and (compartment is null or"
+ " element.compartment.id in (select id from " + Element.class.getSimpleName()
+ " compartment_element where lower(compartment_element.name) = lower(compartment) and compartment_element.model in :maps)) "
......@@ -96,7 +97,8 @@ public class DataOverlayDao extends BaseDao<DataOverlay> {
+ " where reaction.model in :maps and entry.dataOverlay.id = :overlayId "
+ " and (lower(reaction.name) = lower(entry.name) or entry.name ='' or entry.name is null) "
+ " and (lower(reaction.model.name) = lower(entry.modelName) or entry.modelName='' or entry.modelName is null) "
+ " and (entry_miriam is null or (entry_miriam.dataType = reaction_miriam.dataType and lower(entry_miriam.resource) = lower(reaction_miriam.resource)) ) "
+ " and (entry_miriam is null or "
+ " (entry_miriam.dataType = reaction_miriam.dataType and lower(entry_miriam.resource) = lower(reaction_miriam.resource)) ) "
+ " and (lower(reaction.idReaction) = lower(entry.elementId) or entry.elementId='' or entry.elementId is null) ";
if (reactionIdentifiers.size() > 0) {
queryString += " and (reaction.id in :reactionId) ";
......
......@@ -117,10 +117,11 @@
<surefire-api.version>2.22.2</surefire-api.version>
<hsqldb.version>2.5.0</hsqldb.version>
<git-commit-id-plugin.version>4.0.4</git-commit-id-plugin.version>
<surefire.rerunFailingTestsCount>4</surefire.rerunFailingTestsCount>
<checkstyle.version>3.1.1</checkstyle.version>
</properties>
<repositories>
......@@ -188,6 +189,28 @@
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle.version}</version>
<executions>
<execution>
<id>checkstyle</id>
<phase>validate</phase>
<configuration>
<configLocation>checkstyle.xml</configLocation>
<encoding>UTF-8</encoding>
<failsOnError>true</failsOnError>
<consoleOutput>true</consoleOutput>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
</configuration>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
......
......@@ -256,7 +256,9 @@ public class ReferenceGenomeController extends BaseController {
@PreAuthorize("hasAuthority('IS_ADMIN')")
@DeleteMapping(value = "/{genomeId}/geneMapping/{mappingId}/")
public Map<String, Object> removeGeneMapping(@PathVariable(value = "genomeId") Integer genomeId, @PathVariable(value = "mappingId") Integer mappingId)
public Map<String, Object> removeGeneMapping(
@PathVariable(value = "genomeId") Integer genomeId,
@PathVariable(value = "mappingId") Integer mappingId)
throws IOException, QueryException {
if (genomeId == null) {
throw new QueryException("Invalid genomeId");
......
......@@ -101,7 +101,8 @@ public class ProjectController extends BaseController {
@Autowired
public ProjectController(ServletContext context, IUserService userService, IProjectService projectService,
IMeshService meshService, List<Converter> modelConverters, IFileService fileService, IElementService elementService, IReactionService reactionService,
IMeshService meshService, List<Converter> modelConverters, IFileService fileService,
IElementService elementService, IReactionService reactionService,
IModelService modelService, IConfigurationService configurationService) {
this.context = context;
this.userService = userService;
......
......@@ -278,7 +278,8 @@ public class CommentController extends BaseController {
throw new QueryException("email too long");
}
Comment comment = commentService.addComment(email, content, pointCoordinates, elementService.getElementById(projectId, modelId, elementId), pinned,
Comment comment = commentService.addComment(email, content, pointCoordinates,
elementService.getElementById(projectId, modelId, elementId), pinned,
modelId, user);
return comment;
......@@ -308,7 +309,8 @@ public class CommentController extends BaseController {
throw new QueryException("email too long");
}
Comment comment = commentService.addComment(email, content, pointCoordinates, reactionService.getReactionById(projectId, modelId, reactionId), pinned,
Comment comment = commentService.addComment(email, content, pointCoordinates,
reactionService.getReactionById(projectId, modelId, reactionId), pinned,
modelId, user);
return comment;
......
......@@ -159,7 +159,8 @@ public class OverlayController extends BaseController {
@PreAuthorize("hasAuthority('IS_ADMIN')" +
" or hasAuthority('IS_CURATOR') and hasAuthority('READ_PROJECT:' + #projectId)" +
" or hasAuthority('READ_PROJECT:' + #projectId) and " +
" (@dataOverlayService.getOverlayCreator(#overlayId)?.login == authentication.name or @dataOverlayService.getDataOverlayById(#overlayId)?.public == true)")
" (@dataOverlayService.getOverlayCreator(#overlayId)?.login == authentication.name "
+ " or @dataOverlayService.getDataOverlayById(#overlayId)?.public == true)")
@GetMapping(value = "/{overlayId}/models/{modelId}/bioEntities/reactions/{reactionId}/")
public MappingJacksonValue getFullReaction(
@PathVariable(value = "projectId") String projectId,
......@@ -193,7 +194,8 @@ public class OverlayController extends BaseController {
@PreAuthorize("hasAuthority('IS_ADMIN')" +
" or hasAuthority('IS_CURATOR') and hasAuthority('READ_PROJECT:' + #projectId)" +
" or hasAuthority('READ_PROJECT:' + #projectId) and " +
" (@dataOverlayService.getOverlayCreator(#overlayId)?.login == authentication.name or @dataOverlayService.getDataOverlayById(#overlayId)?.public == true)")
" (@dataOverlayService.getOverlayCreator(#overlayId)?.login == authentication.name "
+ " or @dataOverlayService.getDataOverlayById(#overlayId)?.public == true)")
@GetMapping(value = "/{overlayId}/models/{modelId}/bioEntities/elements/{elementId}/")
public MappingJacksonValue getFullSpecies(
@PathVariable(value = "projectId") String projectId,
......@@ -409,7 +411,8 @@ public class OverlayController extends BaseController {
@PreAuthorize("hasAuthority('IS_ADMIN')" +
" or hasAuthority('IS_CURATOR') and hasAuthority('READ_PROJECT:' + #projectId)" +
" or hasAuthority('READ_PROJECT:' + #projectId) and " +
" (@dataOverlayService.getOverlayCreator(#overlayId)?.login == authentication.name or @dataOverlayService.getDataOverlayById(#overlayId)?.public == true)")
" (@dataOverlayService.getOverlayCreator(#overlayId)?.login == authentication.name "
+ " or @dataOverlayService.getDataOverlayById(#overlayId)?.public == true)")
@GetMapping(value = "/{overlayId}:downloadSource")
public ResponseEntity<byte[]> getOverlaySource(
@PathVariable(value = "projectId") String projectId,
......
......@@ -150,12 +150,14 @@ public interface IDataOverlayService {
DataOverlay getDataOverlayById(String projectId, Integer overlayId) throws ObjectNotFoundException;
List<Pair<Reaction, DataOverlayEntry>> getFullReactionForDataOverlay(String projectId, int mapId, Integer id, int overlayId, boolean fetchLazy) throws QueryException;
List<Pair<Reaction, DataOverlayEntry>> getFullReactionForDataOverlay(String projectId, int mapId,
Integer id, int overlayId, boolean fetchLazy) throws QueryException;
List<Pair<Element, DataOverlayEntry>> getFullElementForDataOverlay(String projectId, int mapId, Integer id, int overlayId, boolean fetchLazy)
throws ObjectNotFoundException, QueryException;
List<Pair<Element, DataOverlayEntry>> getFullElementForDataOverlay(String projectId, int mapId,
Integer id, int overlayId, boolean fetchLazy) throws ObjectNotFoundException, QueryException;
List<Pair<? extends BioEntity, DataOverlayEntry>> getBioEntitiesForDataOverlay(String projectId, int mapId, Integer overlayId, boolean fetchLazy) throws QueryException;
List<Pair<? extends BioEntity, DataOverlayEntry>> getBioEntitiesForDataOverlay(String projectId, int mapId,
Integer overlayId, boolean fetchLazy) throws QueryException;
List<Pair<Element, DataOverlayEntry>> getElementsForDataOverlay(String projectId, int overlayId, boolean fetchLazy) throws QueryException;
......
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