[ 
http://issues.apache.org/jira/browse/TUSCANY-711?page=comments#action_12433955 
] 
            
Ron Gavlin commented on TUSCANY-711:
------------------------------------

After further investigation, I have confirmed this is definately a Tuscany SDO 
problem with class SDOXSDEcoreBuilder. The problem is caused by a limitation in 
Tuscany's efforts to override the standard EMF name-mangling algorithm.

Problematic-Line 226 of SDOXSDEcoreBuilder is as follows:

/**
 * Override default EMF behavior so that the name is not mangled.
 */
protected String validName(String name, int casing, String prefix) {
  return name;
}

For namespace "http://www.example.com/simple-1";, this method is eventually 
called with parameters ("1", 2, "_"). The EMF NameMangler base class would 
return the correct value, "_1". The SDO-overridden method returns "1" which 
eventually gets used incorrectly as a namespace prefix. I can see a few fixes 
to this problem:

1. Modify SDOXSDEcoreBuilder.validName to handle this special case. I am not 
sure this is correct.

2. Add override method SDOXSDEcoreBuilder.getEPackage(XSDNamedComponent 
xsdNamedComponent). Reimplement the method replacing the invocation of 
qualifiedPackageName(targetNamespace) with 
SDOXSDEcoreBuilder.getDefaultPackageName(targetNamespace)

3. Add override method SDOXSDEcoreBuilder.qualifiedPackageName(String 
targetNamespace) which simply delegates to 
SDOXSDEcoreBuilder.getDefaultPackageName(targetNamespace). This looks like the 
most straightforward solution. Are there drawbacks?

This is a showstopper problem for us. Any guidance would be appreciated.

Thanks in advance,

- Ron



> Tuscany SDO generates invalid namespace prefixes for namespaces that end with 
> a '-' followed by a number
> --------------------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-711
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-711
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M1
>         Environment: Win2K Sun JDK 1.4.2_11
>            Reporter: Ron Gavlin
>            Priority: Critical
>
> The Tuscany SDO Serializer generates an invalid namespace prefix for 
> namespaces that end with a '-' followed by a number. 
> For example, Tuscany SDO generates the invalid namespace prefix "1" for 
> namespace http://www.example.com/simple-1. Any DataObjects saved with the 
> .../simple-1 namespace cannot be subsequently loaded. 
> I suspect this may be an EMF bug.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Reply via email to