Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327408 - Enhance URI fragment format
Summary: Enhance URI fragment format
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard: Appealing to a Broader Community
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2010-10-10 15:11 EDT by Eike Stepper CLA
Modified: 2011-06-23 03:38 EDT (History)
0 users

See Also:


Attachments
Patch v1 - for future reference (9.94 KB, patch)
2010-10-10 15:19 EDT, Eike Stepper CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eike Stepper CLA 2010-10-10 15:11:12 EDT
In CDO the URI fragments represent the CDOIDs of CDOObjects. 
The current format of the fragment is:

	CDOID.getType().ordinal() "/" CDOID.value                 // If CDOID.getType() != Type.OBJECT
	-InternalCDOIDObject.getSubType().ordinal() "/" CDOID.value                 // Otherwise
	
That's hard to read, to parse and to use as a key in many environments (e.g. file system).

Come up with a better format.
Comment 1 Eike Stepper CLA 2010-10-10 15:19:40 EDT
Created attachment 180568 [details]
Patch v1 - for future reference
Comment 2 Eike Stepper CLA 2010-10-10 15:20:20 EDT
The new format involves a single character as a type/subtype prefix for the id value (no slash anymore!):

  public enum Type
  {
    NULL('N'),
    OBJECT(' '), // Superceded by ObjectType.getID()
    EXTERNAL_OBJECT('E'),
    DANGLING_OBJECT('D'),
    EXTERNAL_TEMP_OBJECT('e'),
    TEMP_OBJECT('t'),
    META('M'),
    TEMP_META('m')
}

  public enum ObjectType
  {
    LONG('L'),
    STRING('S'),
    LONG_WITH_CLASSIFIER('l'),
    STRING_WITH_CLASSIFIER('s'),
    UUID('U')
}

The following methods have been updated accordingly:

	CDOIDUtil.write(StringBuilder, CDOID)
	CDOIDUtil.read(String)
Comment 3 Eike Stepper CLA 2010-10-10 15:20:45 EDT
Committed to HEAD
Comment 4 Eike Stepper CLA 2011-06-23 03:38:48 EDT
Available in R20110608-1407