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

Merge branch...

Merge branch '2208-bug-in-celldesigner-export-the-default-compartment-is-exported-with-an-empty-string-as-its-name' into 'master'

Resolve "bug in CellDesigner export: the default compartment is exported with an empty string as its name"

See merge request !1870
parents 252fd456 a1e70bd6
No related branches found
No related tags found
2 merge requests!1871Resolve "problem with websocket connection",!1870Resolve "bug in CellDesigner export: the default compartment is exported with an empty string as its name"
Pipeline #102141 passed
......@@ -305,6 +305,7 @@ ird
irefweb
isbn
isDefault
isDescribedBy
isfinder
isoform
Isoform
......
minerva (18.1.1) stable; urgency=medium
* Bug fix: SBGN-ML import/export should not use compartmentOrder for
non-compartment entities (#2193)
* Bug fix: invalir relation type has been used as default
* Bug fix: invalid relation type has been used as default
(bqbiol:isDescribedBy), the default is changed to: bqbiol:is (#2206)
* Bug fix: export of default compartment provide compartment name (#2208)
-- Piotr Gawron <piotr.gawron@uni.lu> Wed, 05 Feb 2025 12:00:00 +0200
......
package lcsb.mapviewer.converter.model.celldesigner.compartment;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import lcsb.mapviewer.common.Pair;
import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
import lcsb.mapviewer.converter.model.celldesigner.CellDesignerElementCollection;
......@@ -18,12 +7,21 @@ import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerCompart
import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerElement;
import lcsb.mapviewer.model.map.compartment.Compartment;
import lcsb.mapviewer.model.map.compartment.PathwayCompartment;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* CellDEsigner xml parser for collection of compartments.
*
*
* @author Piotr Gawron
*
*/
public class CompartmentCollectionXmlParser {
......@@ -31,25 +29,24 @@ public class CompartmentCollectionXmlParser {
* Default class logger.
*/
@SuppressWarnings("unused")
private Logger logger = LogManager.getLogger();
private final Logger logger = LogManager.getLogger();
/**
* CellDesigner xml parser for single compartment.
*/
private CompartmentXmlParser compartmentParser;
private final CompartmentXmlParser compartmentParser;
/**
* Collection of {@link CellDesignerElement cell designer elements} parsed from
* xml.
*/
private CellDesignerElementCollection elements;
private final CellDesignerElementCollection elements;
/**
* Default constructor.
*
* @param elements
* collection of {@link CellDesignerElement cell designer elements}
* parsed from xml
*
* @param elements collection of {@link CellDesignerElement cell designer elements}
* parsed from xml
*/
public CompartmentCollectionXmlParser(final CellDesignerElementCollection elements) {
this.elements = elements;
......@@ -58,14 +55,11 @@ public class CompartmentCollectionXmlParser {
/**
* Parse CellDEsigner xml node with collection of compartments.
*
* @param compartmentsNode
* xml node to parse
*
* @param compartmentsNode xml node to parse
* @return list of compartments obtained from xml node
* @throws InvalidXmlSchemaException
* thrown when there is a problem with xml
* @throws CompartmentParserException
* thrown when there is a problem with parsing a compartment
* @throws InvalidXmlSchemaException thrown when there is a problem with xml
* @throws CompartmentParserException thrown when there is a problem with parsing a compartment
*/
public List<CellDesignerCompartment> parseXmlCompartmentCollection(final Node compartmentsNode)
throws InvalidXmlSchemaException, CompartmentParserException {
......@@ -87,9 +81,8 @@ public class CompartmentCollectionXmlParser {
/**
* Creates CellDesigner xml string from set of compartments.
*
* @param collection
* collection of compartments to be transformed into xml
*
* @param collection collection of compartments to be transformed into xml
* @return xml representation of the compartments
*/
public String toXml(final Collection<Compartment> collection) {
......@@ -104,6 +97,7 @@ public class CompartmentCollectionXmlParser {
}
}
Compartment defaultCompartment = new Compartment("default");
defaultCompartment.setName("default");
result.append(compartmentParser.toXml(defaultCompartment));
result.append("</listOfCompartments>\n");
return result.toString();
......
......@@ -86,7 +86,7 @@ public class SearchService implements ISearchService {
this.elementDao = elementDao;
this.reactionDao = reactionDao;
addSearchPrefix("complex", Collections.singletonList(Complex.class));
addSearchPrefix("degrded", Collections.singletonList(Degraded.class));
addSearchPrefix("degraded", Collections.singletonList(Degraded.class));
addSearchPrefix("drug", Collections.singletonList(Drug.class));
addSearchPrefix("gene", Collections.singletonList(Gene.class));
addSearchPrefix("ion", Collections.singletonList(Ion.class));
......
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