hi luis.

thanks for explaining this.

Luis Sergio Oliveira schrieb:
[...]
Hello Alexander,

this is a special URL understood by a custom XmiReferenceResolverImpl class that handles it in a special way. The profile file default-uml14.xmi is within the argouml.jar file and the profile base reference "http://argouml.org/profiles/uml14"; signals that special handling is needed by the reference resolver.

Please see http://argouml.tigris.org/source/browse/argouml/trunk/src/model-mdr/src/org/argouml/model/mdr/XmiReferenceResolverImpl.java?rev=14178&view=markup

I have expanded this theme recently in the context of issue #4946 by adding "http://argouml.org/user-profiles/"; as a special base reference which labels user defined profiles...

Regards,

Luís
  additional commands, e-mail: [EMAIL PROTECTED]

i've attached a patch for the resolver which add a "/" to default profile, so the filename is correct: <UML:Stereotype href = 'http://argouml.org/profiles/uml14/default-uml14.xmi#.:0000000000000847'/> <UML:Stereotype href = 'http://argouml.org/user-profiles/CppUmlProfile.xmi#.:000000000000085A'/>

the url would be valid if the files would exist on the web-server. this would be *really* nice to external tools.

the href for the profiles imported by modules were strange, the included the url *and* the runtime resource location, i changed it in the patch.

when reading such references back, they have to be mapped to available profiles. this works for the internal profiles but not for profiles imported by modules(like the c++-profile). i couldn't find a way to get the correct resource location, the patch contains a hack here to make it work for the c++-profile, to see if it works.

i still don't know where the location should come from.

any ideas?

yours

alexander
Index: C:/Dokumente und 
Einstellungen/alex/argo_workspace_new/argouml-core-model-mdr/src/org/argouml/model/mdr/XmiReferenceResolverImpl.java
===================================================================
--- C:/Dokumente und 
Einstellungen/alex/argo_workspace_new/argouml-core-model-mdr/src/org/argouml/model/mdr/XmiReferenceResolverImpl.java
       (revision 14189)
+++ C:/Dokumente und 
Einstellungen/alex/argo_workspace_new/argouml-core-model-mdr/src/org/argouml/model/mdr/XmiReferenceResolverImpl.java
       (working copy)
@@ -79,7 +79,7 @@
     private static final String PROFILE_RESOURCE_PATH = 
         "/org/argouml/profile/profiles/";
     private static final String PROFILE_BASE_URL = 
-        "http://argouml.org/profiles/uml14";;
+        "http://argouml.org/profiles/uml14/";;
 
     private static final String USER_PROFILE_BASE_URL = 
         "http://argouml.org/user-profiles/";;
@@ -186,7 +186,7 @@
                 systemId = PROFILE_BASE_URL + getSuffix(systemId);
             else if (systemId.contains("file:/")) {
                 // user defined profile - replace path with corresponding label
-                systemId = USER_PROFILE_BASE_URL + modelPublicId;
+                systemId = USER_PROFILE_BASE_URL + 
this.getSuffix(modelPublicId);
             } else 
                 systemId = PROFILE_BASE_URL + modelPublicId;
         } else if (systemId == topSystemId) {
@@ -423,6 +423,23 @@
             } else { 
                 modelName = PROFILE_RESOURCE_PATH + publicId;
             }
+        } else if (systemId.startsWith(USER_PROFILE_BASE_URL)) {
+            String publicId = 
systemId.substring(USER_PROFILE_BASE_URL.length());
+            if (modelsPublicIds.contains(publicId)) {
+                modelName = publicId;
+            } else { 
+                // TODO: get the resource location for the user-profile, if it 
exists.
+                // dunno where to get :(
+                // for the internal profiles this is known because
+                // of PROFILE_RESOURCE_PATH but for the user-profiles
+                // this is different. profiles provided by modules should
+                // be available, although the Profile interface doesn't 
support this.
+                // no idea about user-loaded profiles.
+                
+                if (publicId.contains("Cpp")) {
+                    modelName = "/org/argouml/language/cpp/profile/" + 
publicId;
+                }                
+            }
         } else {
             int filenameIndex = systemId.lastIndexOf("/");
             if (filenameIndex > 0) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to