Commit 2a4aee1f authored by Piotr Gawron's avatar Piotr Gawron
Browse files

TargetView removed

parent 4c0e2b05
package lcsb.mapviewer.services.search;
import java.util.Collection;
import java.util.List;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import lcsb.mapviewer.annotation.data.Article;
import lcsb.mapviewer.annotation.data.Target;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.model.map.model.Model;
import lcsb.mapviewer.model.map.species.Element;
import lcsb.mapviewer.services.search.data.ElementIdentifier;
import lcsb.mapviewer.services.search.data.ElementIdentifier.ElementIdentifierType;
import lcsb.mapviewer.services.search.db.GeneRow;
import lcsb.mapviewer.services.search.db.TargetDetails;
import lcsb.mapviewer.services.search.db.TargetView;
import lcsb.mapviewer.services.view.AnnotationViewFactory;
/**
......@@ -58,7 +51,6 @@ public abstract class SearchResultFactory<T, S extends ISearchResultView> extend
@Autowired
private ElementMatcher elementMatcher;
protected boolean elementMatch(Target target, Element element) {
return elementMatcher.elementMatch(target, element);
}
......
package lcsb.mapviewer.services.search.db;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
import lcsb.mapviewer.annotation.data.Article;
import lcsb.mapviewer.services.view.AbstractTargetView;
import lcsb.mapviewer.services.view.AnnotationView;
/**
* {@link lcsb.mapviewer.services.view.AbstractView View} for
* {@link lcsb.mapviewer.annotation.data.Target targets}.
*
* @author Piotr Gawron
*
*/
public class TargetView extends AbstractTargetView {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* Default class logger.
*/
@SuppressWarnings("unused")
private static Logger logger = Logger.getLogger(TargetView.class);
/**
* Name of the target.
*/
private String name;
/**
* Database from which target was acquired.
*/
private AnnotationView annotation;
/**
* List of genes and proteins included in the target.
*/
private List<GeneRow> proteins = new ArrayList<>();
/**
* List of pubmed articles about the target.
*/
private List<Article> references = new ArrayList<>();
/**
* Flag informing if target is visible in a submap or not.
*/
private boolean availableInSubmodel = false;
/**
* Default constructor. Should be used only for deserialization.
*/
protected TargetView() {
}
/**
* Adds reference article.
*
* @param reference
* article to add
*/
public void addReference(Article reference) {
references.add(reference);
}
/**
* Adds gene.
*
* @param protein
* gene to add
*/
public void addProtein(GeneRow protein) {
proteins.add(protein);
}
/**
* Returns link to pubmed that enlist all references.
*
* @return link to pubmed that enlist all references
*/
public String getAllReferencesLink() {
String result = "http://www.ncbi.nlm.nih.gov/pubmed/?term=";
for (Article article : getReferences()) {
result += article.getId() + "+";
}
return result;
}
/**
* @return the name
* @see #name
*/
public String getName() {
return name;
}
/**
* @param name
* the name to set
* @see #name
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the proteins
* @see #proteins
*/
public List<GeneRow> getProteins() {
return proteins;
}
/**
* @param proteins
* the proteins to set
* @see #proteins
*/
public void setProteins(List<GeneRow> proteins) {
this.proteins = proteins;
}
/**
* @return the references
* @see #references
*/
public List<Article> getReferences() {
return references;
}
/**
* @param references
* the references to set
* @see #references
*/
public void setReferences(List<Article> references) {
this.references = references;
}
/**
* @return the annotation
* @see #annotation
*/
public AnnotationView getAnnotation() {
return annotation;
}
/**
* @param annotation
* the annotation to set
* @see #annotation
*/
public void setAnnotation(AnnotationView annotation) {
this.annotation = annotation;
}
/**
* @return the availableIntSubmodel
* @see #availableInSubmodel
*/
public boolean isAvailableInSubmodel() {
return availableInSubmodel;
}
/**
* @param availableInSubmodel
* the availableIntSubmodel to set
* @see #availableInSubmodel
*/
public void setAvailableInSubmodel(boolean availableInSubmodel) {
this.availableInSubmodel = availableInSubmodel;
}
}
......@@ -12,7 +12,6 @@ import lcsb.mapviewer.services.search.db.mirna.MiRNAServiceTest;
@SuiteClasses({ AllSearchDrugTests.class, //
ChemicalServiceTest.class, //
MiRNAServiceTest.class, //
TargetViewTest.class,//
})
public class AllSearchDbTests {
......
package lcsb.mapviewer.services.search.db;
import org.apache.commons.lang3.SerializationUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import lcsb.mapviewer.services.search.db.TargetView;
public class TargetViewTest {
@Before
public void setUp() throws Exception {
}
@After
public void tearDown() throws Exception {
}
@Test
public void testSerialization() {
try {
SerializationUtils.serialize(new TargetView());
} catch (Exception e) {
e.printStackTrace();
throw e;
}
}
}
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