hi luis.
Luis Sergio Oliveira schrieb:
[...]
Hmm, I think we may make this work if the website contains the XMI
files - this may be hacked as sym links from a repository directory
argouml/trunk/www/profiles/uml14/ into the source files... Regarding
user defined profiles it is harder, since we would have to provide
some way for the users to control the domain part of the references
while keeping the references labeled as user defined profiles in order
for ArgoUML to make its auto magical replacement of HTTP references to
directories configured in the ProfileManager.
as you mentioned further down in your mail, the modules should supply a
valid url for the profile. for the modules argouml should offer to
upload them to the website, probably with some "contraints", the files
should be versioned in their name(like "TheFancyProfile-1.0.xmi"), etc.
[...]
I'll check this out tonight, but, we must be careful not to break
backwards compatibility of persisted models with ArgoUML 0.24.
Probably it will have to include some optional matching of the
OLD_PROFILE_BASE_URL.
honestly i don't care that much about breaking files, argouml from trunk
does this from time to time on my files anyway, unfortunately not in a
reproducable way :(
[...]
i attached a newer version of the patch. it's still a hack but i looks
something more like a solution ;)
it should work with all profiles from modules, but i only tested the
default-uml and the c++-profile.
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)
@@ -33,6 +33,7 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -45,6 +46,10 @@
import org.netbeans.api.xmi.XMIInputConfig;
import org.netbeans.lib.jmi.xmi.XmiContext;
+import org.argouml.profile.Profile;
+import org.argouml.profile.ProfileManager;
+import org.argouml.profile.ProfileFacade;
+
/**
* Custom resolver to use with XMI reader.
* <p>
@@ -79,7 +84,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 +191,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 +428,24 @@
} 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 {
+ /* search the registered profiles, if a profile knows publicId
+ * as a resource, return it's url
+ */
+ ProfileManager pm = ProfileFacade.getManager();
+ List<Profile> profiles = pm.getRegisteredProfiles();
+
+ for(Profile p: profiles){
+ URL resourceURL = p.getClass().getResource(publicId);
+ if(resourceURL != null){
+ return resourceURL;
+ }
+ }
+ }
} else {
int filenameIndex = systemId.lastIndexOf("/");
if (filenameIndex > 0) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]