Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Generated Element IDs (xmi:id)?
Generated Element IDs (xmi:id)? [message #657387] Wed, 02 March 2011 16:21 Go to next message
Conor Missing name is currently offline Conor Missing nameFriend
Messages: 159
Registered: July 2009
Senior Member
Hi All,

I was wondering if it was possible to shorten the generated xmi:id that is associated with GMF editor components. I have to process composed models multiple times and need to reduce their size to the absolute minimum. I have already stripped out everything I can from the composed models with a transform with the element ids the last thing to be addressed.

Is there anyway of setting the ids length to be in the region of 2 or 3 characters? (instead of the default of 23 or 24)

Thanks,

Gaff
Re: Generated Element IDs (xmi:id)? [message #657410 is a reply to message #657387] Wed, 02 March 2011 16:52 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Gaff,

IDs need to be unique within a resource. GMF makes heavy use of UUIDs
for that purpose; they're guaranteed to be universally unique.
Certainly it's possible (via XMLResource.setID) for you to assign
different values.


Conor wrote:
> Hi All,
>
> I was wondering if it was possible to shorten the generated xmi:id
> that is associated with GMF editor components. I have to process
> composed models multiple times and need to reduce their size to the
> absolute minimum. I have already stripped out everything I can from
> the composed models with a transform with the element ids the last
> thing to be addressed.
>
> Is there anyway of setting the ids length to be in the region of 2 or
> 3 characters? (instead of the default of 23 or 24)
>
> Thanks,
>
> Gaff


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Generated Element IDs (xmi:id)? [message #723437 is a reply to message #657410] Thu, 08 September 2011 14:45 Go to previous messageGo to next message
chavi   is currently offline chavi Friend
Messages: 67
Registered: April 2011
Member
Can you please tell me that how to fetch XMI Id.
I have written following code


import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.xmi.XMLResource;

public class myxmi{

public static String xmiId(EObject x) {
Resource resouce = x.eResource();
if (resouce instanceof XMLResource) {
XMLResource xmlResource = (XMLResource)resouce;
return xmlResource.getID(x);
}
return "";
}

}

But when i call this method as myxmi.xmiId(eobject).How can i fetch this object when i click on a particular component.
Re: Generated Element IDs (xmi:id)? [message #724368 is a reply to message #723437] Mon, 12 September 2011 08:03 Go to previous message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

to get the XMI id use getProxyID from this class http://publib.boulder.ibm.com/infocenter/rsmhelp/v7r0m0/index.jsp?topic=/org.eclipse.gmf.doc/reference/api/runtime/org/eclipse/gmf/runtime/emf/core/util/EMFCoreUtil.html.

Ralph
Previous Topic:Semantics
Next Topic:Printing GenModel Diagram Textually
Goto Forum:
  


Current Time: Fri Apr 26 23:14:21 GMT 2024

Powered by FUDForum. Page generated in 0.04752 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top