Author: thn
Date: 2008-08-05 13:50:55-0700
New Revision: 15514
Modified:
trunk/src/argouml-app/src/org/argouml/i18n/dialog.properties
trunk/src/argouml-app/src/org/argouml/persistence/UmlFilePersister.java
Log:
Issue 5278: failed to load project when a deactivated profile is not available
(fixed by better error message)
Modified: trunk/src/argouml-app/src/org/argouml/i18n/dialog.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/i18n/dialog.properties?view=diff&rev=15514&p1=trunk/src/argouml-app/src/org/argouml/i18n/dialog.properties&p2=trunk/src/argouml-app/src/org/argouml/i18n/dialog.properties&r1=15513&r2=15514
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/i18n/dialog.properties (original)
+++ trunk/src/argouml-app/src/org/argouml/i18n/dialog.properties 2008-08-05 13:50:55-0700
@@ -69,10 +69,11 @@
<a href="http://argouml.tigris.org/project_bugs.html">\
http://argouml.tigris.org/project_bugs.html</a>.
dialog.error.xmi.reference.error = XMI reference error : {0} \n\
- Please make sure that either this XMI file is listed in the profile tab of\n\
- the edit->settings dialog, or a module containing this XMI as a profile\n\
- is loaded (e.g. by putting the module jar file in the ext directory of\n\
- your ArgoUML installation).
+ Please make sure that the profile is available:\n\
+ (1) Either load a module which contains that profile,\n\
+ (2) or make sure that the URL can be resolved,\n\
+ (3) or load it as a user defined profile in the profile configuration in \
+ the edit->settings dialog.
dialog.exception.link.report = Please report this problem at \
<a href="http://argouml.tigris.org/project_bugs.html">\
http://argouml.tigris.org/project_bugs.html</a>
Modified: trunk/src/argouml-app/src/org/argouml/persistence/UmlFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/persistence/UmlFilePersister.java?view=diff&rev=15514&p1=trunk/src/argouml-app/src/org/argouml/persistence/UmlFilePersister.java&p2=trunk/src/argouml-app/src/org/argouml/persistence/UmlFilePersister.java&r1=15513&r2=15514
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/persistence/UmlFilePersister.java (original)
+++ trunk/src/argouml-app/src/org/argouml/persistence/UmlFilePersister.java 2008-08-05 13:50:55-0700
@@ -77,7 +77,7 @@
/**
* To persist to and from argo (xml file) storage.
*
- * @author Bob Tarling
+ * @author Bob Tarling, Thomas Neustupny
*/
public class UmlFilePersister extends AbstractFilePersister {
@@ -104,6 +104,11 @@
private static final String ARGO_TEE =
"/org/argouml/persistence/argo.tee";
+ // TODO: either don't rely on that string or move it elsewhere, it must
+ // have the same value as used in org.argouml.model.mdr.XmiReaderImpl:
+ private static final String REFERENCE_ERROR =
+ "Error reading external document ";
+
/**
* The constructor.
*/
@@ -307,7 +312,7 @@
protected Project doLoad(File originalFile, File file,
ProgressMgr progressMgr) throws OpenException,
- InterruptedException {
+ InterruptedException, XmiReferenceException {
XmlInputStream inputStream = null;
try {
@@ -377,6 +382,12 @@
inputStream.reopen("uml:Model");
persister.load(p, inputStream);
} else {
+ int ix = e.getMessage().indexOf(REFERENCE_ERROR);
+ if (ix != -1) {
+ // detected failed external reference loading
+ throw new XmiReferenceException(
+ e.getMessage(), null);
+ }
throw e;
}
}
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.