svn commit: r13098 - branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: b00__1
Date: 2007-07-18 23:33:52-0700
New Revision: 13098

Modified:
   branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java
   branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java

Log:
Changed the default URI for a XMI document.

Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java?view=diff&rev=13098&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java&r1=13097&r2=13098
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java	(original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java	2007-07-18 23:33:52-0700
@@ -86,8 +86,7 @@
 	    resource.unload();
 	}
 	
-	// Dummy URI
-	Resource r = editingDomain.createResource("foo.xmi"); //$NON-NLS-1$
+	Resource r = editingDomain.createResource("http://argouml.tigris.org/euml/resource/default_uri.xmi"); //$NON-NLS-1$
 	try {
 	    r.load(inputSource.getByteStream(), null);
 	} catch (IOException e) {

Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java?view=diff&rev=13098&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java&r1=13097&r2=13098
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java	(original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java	2007-07-18 23:33:52-0700
@@ -96,9 +96,9 @@
     }
 
     public void write() throws UmlException {
-        // This URI is a dummy.  We're going to write to our OutputStream
-        Resource resource = modelImpl.getEditingDomain().createResource("foo.xmi");
-        resource.getContents().add(model);
+	if (model.eResource() == null) {
+	    throw new UmlException("Root container is not affiliated with any resource!"); //$NON-NLS-1$
+	}
 
         // Do we need to get stereotype applications for each element? - tfm
 //        for (Iterator allContents = UMLUtil.getAllContents(model, true,
@@ -114,7 +114,7 @@
         // TODO: Is there an option we can use to save our ArgoUML version?
         
         try {
-            resource.save(oStream, options);
+            model.eResource().save(oStream, options);
         } catch (IOException ioe) {
             throw new UmlException(ioe);
         }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.