[Uml-devel] [Bug 56184] Umbrello XMI file format doesn't conform with uml13.dtd

Oliver Kellogg okellogg at users.sourceforge.net
Sun Nov 27 11:26:03 UTC 2005


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=56184         




------- Additional Comments From okellogg users sourceforge net  2005-11-27 20:25 -------
SVN commit 483699 by okellogg:

Give the <UML:Model> an xmi.id.
Add the attribute "namespace" when saving the XMI of UMLObjects.
These changes get Umbrello files imported into StarUML
(http://www.staruml.com)
CCBUG:56184


 M  +6 -0      umldoc.cpp  
 M  +7 -0      umldoc.h  
 M  +6 -0      umlobject.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umldoc.cpp #483698:483699
 @ -90,6 +90,7  @
 
 UMLDoc::UMLDoc() {
     m_Name = i18n("UML Model");
+    m_modelID = "m1";
     m_currentView = 0;
     m_uniqueID = 0;
     m_count = 0;
 @ -1494,6 +1495,10  @
     return m_Name;
 }
 
+Uml::IDType UMLDoc::getModelID() const {
+    return m_modelID;
+}
+
 void UMLDoc::saveToXMI(QIODevice& file, bool saveSubmodelFiles /* = false */) {
     QDomDocument doc;
 
 @ -1570,6 +1575,7  @
     QDomElement contentNS = doc.createElement( "UML:Namespace.contents" );
 
     QDomElement objectsElement = doc.createElement( "UML:Model" );
+    objectsElement.setAttribute( "xmi.id", ID2STR(m_modelID) );
     objectsElement.setAttribute( "name", m_Name );
     objectsElement.setAttribute( "isSpecification", "false" );
     objectsElement.setAttribute( "isAbstract", "false" );
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umldoc.h #483698:483699
 @ -432,6 +432,12  @
     QString getName() const;
 
     /**
+     * Return the m_modelID (currently this a fixed value:
+     * Umbrello supports only a single document.)
+     */
+    Uml::IDType getModelID() const;
+
+    /**
      * Used to give a unique ID to any sort of object.
      *
      *  return  A new unique ID.
 @ -931,6 +937,7  @
     int m_uniqueID;
 
     QString m_Name; ///< name of this model as stored in the <UML:Model> tag
+    Uml::IDType m_modelID; ///< xmi.id of this model in the <UML:Model>
     int m_count;   ///< auxiliary counter for the progress bar
     bool m_modified;
     KURL m_doc_url;
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umlobject.cpp #483698:483699
 @ -471,6 +471,12  @
     }
     qElement.setAttribute( "xmi.id", ID2STR(m_nId) );
     qElement.setAttribute( "name", m_Name );
+    Uml::IDType nmSpc;
+    if (m_pUMLPackage)
+        nmSpc = m_pUMLPackage->getID();
+    else
+        nmSpc = UMLApp::app()->getDocument()->getModelID();
+    qElement.setAttribute( "namespace", ID2STR(nmSpc) );
     if (! m_Doc.isEmpty())
         qElement.setAttribute( "comment", m_Doc );  //CHECK: uml13.dtd compliance
 #ifdef XMI_FLAT_PACKAGES




More information about the umbrello-devel mailing list