Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
minerva
core
Commits
495c777c
Commit
495c777c
authored
2 months ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
add name when exporting default compartment
parent
9992d824
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!1871
Resolve "problem with websocket connection"
,
!1870
Resolve "bug in CellDesigner export: the default compartment is exported with an empty string as its name"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG
+2
-1
2 additions, 1 deletion
CHANGELOG
converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/compartment/CompartmentCollectionXmlParser.java
+24
-30
24 additions, 30 deletions
...ldesigner/compartment/CompartmentCollectionXmlParser.java
with
26 additions
and
31 deletions
CHANGELOG
+
2
−
1
View file @
495c777c
minerva (18.1.1) stable; urgency=medium
* Bug fix: SBGN-ML import/export should not use compartmentOrder for
non-compartment entities (#2193)
* Bug fix: invali
r
relation type has been used as default
* Bug fix: invali
d
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
...
...
This diff is collapsed.
Click to expand it.
converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/compartment/CompartmentCollectionXmlParser.java
+
24
−
30
View file @
495c777c
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
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment