Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Rose Importer Patch and Question
Rose Importer Patch and Question [message #425222] Thu, 20 November 2008 03:24 Go to next message
Scott Hendrickson is currently offline Scott HendricksonFriend
Messages: 69
Registered: July 2009
Member
As much as I'd like to get away from arcane rose models, I have to import
and process a number of them. These files use "&" resolution.
Unfortunately, unlike [1], setting CURDIR to "." will not work. My models
have the following:

folder/a.mdl
folder/b/c.cat
folder/b/d/e.cat

a.mdl has a reference: $CURDIR\\b\\c.cat , and
c.cat has a reference: $CURDIR\\d\\e.cat

I've attached a patch that causes "&" resolution to work (at least on my
models).

The patch also does a toUpper on variable names when looking them up. The
models I'm importing use both cases at the same time for CURDIR, so, I'm
guessing that Rose was case insensitive?

My second question is: Is there a substitute for the
org.eclipse.emf.importer.rose functionality? Perhaps a framework for
importing models that is more generic?

Thank you,
-- Scott

[1] http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 7288.html
[2] & patch (if patch files don't work through e-mail, please let me know
where I can e-mail it to)

### Eclipse Workspace Patch 1.0
#P org.eclipse.emf.importer.rose
Index: src/org/eclipse/emf/importer/rose/RoseImporter.java
============================================================ =======
RCS file:
/cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/or g.eclipse.emf.importer.rose/src/org/eclipse/emf/importer/ros e/RoseImporter.java,v
retrieving revision 1.14
diff -u -r1.14 RoseImporter.java
--- src/org/eclipse/emf/importer/rose/RoseImporter.java 28 Dec 2006
06:56:06 -0000 1.14
+++ src/org/eclipse/emf/importer/rose/RoseImporter.java 20 Nov 2008
03:19:38 -0000
@@ -168,7 +168,7 @@
roseUtil.getRoseEcoreBuilder().unsettablePrimitive =
unsettablePrimitive;

roseUtil.getVariableToDirectoryMap().putAll(pathMap);
- unitTreeNode =
roseUtil.createRoseUnitTreeAndTable(roseModelAbsolutePath, null);
+ unitTreeNode = roseUtil.createRoseUnitTreeAndTable(null,
roseModelAbsolutePath, null);
if (unitTreeNode == null)
{
diagnostic = new BasicDiagnostic(Diagnostic.ERROR,
Index: src/org/eclipse/emf/importer/rose/builder/RoseUtil.java
============================================================ =======
RCS file:
/cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/or g.eclipse.emf.importer.rose/src/org/eclipse/emf/importer/ros e/builder/RoseUtil.java,v
retrieving revision 1.8
diff -u -r1.8 RoseUtil.java
--- src/org/eclipse/emf/importer/rose/builder/RoseUtil.java 28 Dec 2006
06:56:06 -0000 1.8
+++ src/org/eclipse/emf/importer/rose/builder/RoseUtil.java 20 Nov 2008
03:19:38 -0000
@@ -77,9 +77,9 @@
return roseEcoreBuilder;
}

- public UnitTreeNode createRoseUnitTreeAndTable(String
fileNameNodeValue, UnitTreeNode topNode) throws Exception
+ public UnitTreeNode createRoseUnitTreeAndTable(String
ampersandFileName, String fileNameNodeValue, UnitTreeNode topNode) throws
Exception
{
- String fileName = resolveFileName(fileNameNodeValue);
+ String fileName = resolveFileName(ampersandFileName,
fileNameNodeValue);

// Store the base name for relative .cat file references.
//
@@ -412,7 +412,7 @@
}
}

- public String resolveFileName(String name)
+ public String resolveFileName(String ampersandFileName, String name)
{
name = Util.trimQuotes(name);
name = Util.updateFileName(name, "\\\\");
@@ -426,7 +426,7 @@
String directoryName = name.substring(0, index);
if (directoryName.startsWith("$")) //directoryName.length() > 0 &&
directoryName.charAt(0) == '$')
{
- String variableName = directoryName.substring(1);
+ String variableName = directoryName.substring(1).toUpperCase();
directoryName = variableToDirectoryMap.get(variableName);
if (directoryName == null)
{
@@ -434,6 +434,13 @@
directoryName = "";
}
}
+ if (directoryName.equals("&") && ampersandFileName != null)
+ {
+ int lastSeparatorIndex =
ampersandFileName.lastIndexOf(File.separator);
+ if(lastSeparatorIndex != -1){
+ directoryName = ampersandFileName.substring(0,
lastSeparatorIndex);
+ }
+ }
result += directoryName + File.separator;
name = name.substring(index + 1);
}
Index: src/org/eclipse/emf/importer/rose/builder/UnitTreeBuilder.ja va
============================================================ =======
RCS file:
/cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/or g.eclipse.emf.importer.rose/src/org/eclipse/emf/importer/ros e/builder/UnitTreeBuilder.java,v
retrieving revision 1.4
diff -u -r1.4 UnitTreeBuilder.java
--- src/org/eclipse/emf/importer/rose/builder/UnitTreeBuilder.ja va 28 Dec
2006 06:56:06 -0000 1.4
+++ src/org/eclipse/emf/importer/rose/builder/UnitTreeBuilder.ja va 20 Nov
2008 03:19:39 -0000
@@ -111,10 +111,10 @@
if (fileNameNode != null)
{
String fileNameNodeValue = fileNameNode.getValue();
- String fileName = roseUtil.resolveFileName(fileNameNodeValue);
+ String fileName =
roseUtil.resolveFileName(unitNode.roseFileName, fileNameNodeValue);
UnitTreeNode unitTreeNode = new UnitTreeNode(objName, quid,
fileName);
unitNode.addNode(unitTreeNode);
- roseUtil.createRoseUnitTreeAndTable(fileNameNodeValue,
unitTreeNode);
+ roseUtil.createRoseUnitTreeAndTable(unitNode.roseFileName,
fileNameNodeValue, unitTreeNode);
}
}
else
Re: Rose Importer Patch and Question [message #425226 is a reply to message #425222] Thu, 20 November 2008 06:59 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Scott,

I'm not sure I understand where "&" comes into the picture. Don't the
settings for pathmap variables address the issue? Please open a
bugzilla with your patch and include a model that shows how it works
(keeping in mind that I no longer have Rose installed).


Scott Hendrickson wrote:
> As much as I'd like to get away from arcane rose models, I have to
> import and process a number of them. These files use "&" resolution.
> Unfortunately, unlike [1], setting CURDIR to "." will not work. My
> models have the following:
>
> folder/a.mdl
> folder/b/c.cat
> folder/b/d/e.cat
>
> a.mdl has a reference: $CURDIR\\b\\c.cat , and
> c.cat has a reference: $CURDIR\\d\\e.cat
>
> I've attached a patch that causes "&" resolution to work (at least on
> my models).
>
> The patch also does a toUpper on variable names when looking them up.
> The models I'm importing use both cases at the same time for CURDIR,
> so, I'm guessing that Rose was case insensitive?
>
> My second question is: Is there a substitute for the
> org.eclipse.emf.importer.rose functionality? Perhaps a framework for
> importing models that is more generic?
>
> Thank you,
> -- Scott
>
> [1] http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 7288.html
> [2] & patch (if patch files don't work through e-mail, please let me
> know where I can e-mail it to)
>
> ### Eclipse Workspace Patch 1.0
> #P org.eclipse.emf.importer.rose
> Index: src/org/eclipse/emf/importer/rose/RoseImporter.java
> ============================================================ =======
> RCS file:
> /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/or g.eclipse.emf.importer.rose/src/org/eclipse/emf/importer/ros e/RoseImporter.java,v
>
> retrieving revision 1.14
> diff -u -r1.14 RoseImporter.java
> --- src/org/eclipse/emf/importer/rose/RoseImporter.java 28 Dec 2006
> 06:56:06 -0000 1.14
> +++ src/org/eclipse/emf/importer/rose/RoseImporter.java 20 Nov 2008
> 03:19:38 -0000
> @@ -168,7 +168,7 @@
> roseUtil.getRoseEcoreBuilder().unsettablePrimitive =
> unsettablePrimitive;
>
> roseUtil.getVariableToDirectoryMap().putAll(pathMap);
> - unitTreeNode =
> roseUtil.createRoseUnitTreeAndTable(roseModelAbsolutePath, null);
> + unitTreeNode = roseUtil.createRoseUnitTreeAndTable(null,
> roseModelAbsolutePath, null);
> if (unitTreeNode == null)
> {
> diagnostic = new BasicDiagnostic(Diagnostic.ERROR, Index:
> src/org/eclipse/emf/importer/rose/builder/RoseUtil.java
> ============================================================ =======
> RCS file:
> /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/or g.eclipse.emf.importer.rose/src/org/eclipse/emf/importer/ros e/builder/RoseUtil.java,v
>
> retrieving revision 1.8
> diff -u -r1.8 RoseUtil.java
> --- src/org/eclipse/emf/importer/rose/builder/RoseUtil.java 28 Dec
> 2006 06:56:06 -0000 1.8
> +++ src/org/eclipse/emf/importer/rose/builder/RoseUtil.java 20 Nov
> 2008 03:19:38 -0000
> @@ -77,9 +77,9 @@
> return roseEcoreBuilder;
> }
>
> - public UnitTreeNode createRoseUnitTreeAndTable(String
> fileNameNodeValue, UnitTreeNode topNode) throws Exception
> + public UnitTreeNode createRoseUnitTreeAndTable(String
> ampersandFileName, String fileNameNodeValue, UnitTreeNode topNode)
> throws Exception
> {
> - String fileName = resolveFileName(fileNameNodeValue);
> + String fileName = resolveFileName(ampersandFileName,
> fileNameNodeValue);
>
> // Store the base name for relative .cat file references.
> //
> @@ -412,7 +412,7 @@
> }
> }
>
> - public String resolveFileName(String name)
> + public String resolveFileName(String ampersandFileName, String name)
> {
> name = Util.trimQuotes(name);
> name = Util.updateFileName(name, "\\\\");
> @@ -426,7 +426,7 @@
> String directoryName = name.substring(0, index);
> if (directoryName.startsWith("$")) //directoryName.length() > 0
> && directoryName.charAt(0) == '$') {
> - String variableName = directoryName.substring(1);
> + String variableName = directoryName.substring(1).toUpperCase();
> directoryName = variableToDirectoryMap.get(variableName);
> if (directoryName == null)
> {
> @@ -434,6 +434,13 @@
> directoryName = "";
> }
> }
> + if (directoryName.equals("&") && ampersandFileName != null)
> + {
> + int lastSeparatorIndex =
> ampersandFileName.lastIndexOf(File.separator);
> + if(lastSeparatorIndex != -1){
> + directoryName = ampersandFileName.substring(0,
> lastSeparatorIndex);
> + }
> + }
> result += directoryName + File.separator;
> name = name.substring(index + 1);
> }
> Index: src/org/eclipse/emf/importer/rose/builder/UnitTreeBuilder.ja va
> ============================================================ =======
> RCS file:
> /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/or g.eclipse.emf.importer.rose/src/org/eclipse/emf/importer/ros e/builder/UnitTreeBuilder.java,v
>
> retrieving revision 1.4
> diff -u -r1.4 UnitTreeBuilder.java
> --- src/org/eclipse/emf/importer/rose/builder/UnitTreeBuilder.ja va
> 28 Dec 2006 06:56:06 -0000 1.4
> +++ src/org/eclipse/emf/importer/rose/builder/UnitTreeBuilder.ja va
> 20 Nov 2008 03:19:39 -0000
> @@ -111,10 +111,10 @@
> if (fileNameNode != null)
> {
> String fileNameNodeValue = fileNameNode.getValue();
> - String fileName = roseUtil.resolveFileName(fileNameNodeValue);
> + String fileName =
> roseUtil.resolveFileName(unitNode.roseFileName, fileNameNodeValue);
> UnitTreeNode unitTreeNode = new UnitTreeNode(objName, quid,
> fileName);
> unitNode.addNode(unitTreeNode);
> - roseUtil.createRoseUnitTreeAndTable(fileNameNodeValue,
> unitTreeNode);
> + roseUtil.createRoseUnitTreeAndTable(unitNode.roseFileName,
> fileNameNodeValue, unitTreeNode);
> }
> }
> else
>
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Rose Importer Patch and Question [message #425244 is a reply to message #425226] Thu, 20 November 2008 16:39 Go to previous messageGo to next message
Scott Hendrickson is currently offline Scott HendricksonFriend
Messages: 69
Registered: July 2009
Member
Thanks for the reply, Ed. Before opening a bugzilla report. I'd like to
know the answer to my second question that was burried in there at the end:

>> My second question is: Is there a substitute for the
>> org.eclipse.emf.importer.rose functionality? Perhaps a framework for
>> importing models that is more generic?

It might be better to consider alternatives first.

Thanks,
-- Scott


Ed Merks wrote:

> Scott,

> I'm not sure I understand where "&" comes into the picture. Don't the
> settings for pathmap variables address the issue? Please open a
> bugzilla with your patch and include a model that shows how it works
> (keeping in mind that I no longer have Rose installed).


> Scott Hendrickson wrote:
>> As much as I'd like to get away from arcane rose models, I have to
>> import and process a number of them. These files use "&" resolution.
>> Unfortunately, unlike [1], setting CURDIR to "." will not work. My
>> models have the following:
>>
>> folder/a.mdl
>> folder/b/c.cat
>> folder/b/d/e.cat
>>
>> a.mdl has a reference: $CURDIR\b\c.cat , and
>> c.cat has a reference: $CURDIR\d\e.cat
>>
>> I've attached a patch that causes "&" resolution to work (at least on
>> my models).
>>
>> The patch also does a toUpper on variable names when looking them up.
>> The models I'm importing use both cases at the same time for CURDIR,
>> so, I'm guessing that Rose was case insensitive?
>>
>> My second question is: Is there a substitute for the
>> org.eclipse.emf.importer.rose functionality? Perhaps a framework for
>> importing models that is more generic?
>>
>> Thank you,
>> -- Scott
>>
>> [1] http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 7288.html
>> [2] & patch (if patch files don't work through e-mail, please let me
>> know where I can e-mail it to)
>>
>> ### Eclipse Workspace Patch 1.0
>> #P org.eclipse.emf.importer.rose
>> Index: src/org/eclipse/emf/importer/rose/RoseImporter.java
>> ============================================================ =======
>> RCS file:
>>
/cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/or g.eclipse.emf.importer.rose/src/org/eclipse/emf/importer/ros e/RoseImporter.java,v
>>
>> retrieving revision 1.14
>> diff -u -r1.14 RoseImporter.java
>> --- src/org/eclipse/emf/importer/rose/RoseImporter.java 28 Dec 2006
>> 06:56:06 -0000 1.14
>> +++ src/org/eclipse/emf/importer/rose/RoseImporter.java 20 Nov 2008
>> 03:19:38 -0000
>> @@ -168,7 +168,7 @@
>> roseUtil.getRoseEcoreBuilder().unsettablePrimitive =
>> unsettablePrimitive;
>>
>> roseUtil.getVariableToDirectoryMap().putAll(pathMap);
>> - unitTreeNode =
>> roseUtil.createRoseUnitTreeAndTable(roseModelAbsolutePath, null);
>> + unitTreeNode = roseUtil.createRoseUnitTreeAndTable(null,
>> roseModelAbsolutePath, null);
>> if (unitTreeNode == null)
>> {
>> diagnostic = new BasicDiagnostic(Diagnostic.ERROR, Index:
>> src/org/eclipse/emf/importer/rose/builder/RoseUtil.java
>> ============================================================ =======
>> RCS file:
>>
/cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/or g.eclipse.emf.importer.rose/src/org/eclipse/emf/importer/ros e/builder/RoseUtil.java,v
>>
>> retrieving revision 1.8
>> diff -u -r1.8 RoseUtil.java
>> --- src/org/eclipse/emf/importer/rose/builder/RoseUtil.java 28 Dec
>> 2006 06:56:06 -0000 1.8
>> +++ src/org/eclipse/emf/importer/rose/builder/RoseUtil.java 20 Nov
>> 2008 03:19:38 -0000
>> @@ -77,9 +77,9 @@
>> return roseEcoreBuilder;
>> }
>>
>> - public UnitTreeNode createRoseUnitTreeAndTable(String
>> fileNameNodeValue, UnitTreeNode topNode) throws Exception
>> + public UnitTreeNode createRoseUnitTreeAndTable(String
>> ampersandFileName, String fileNameNodeValue, UnitTreeNode topNode)
>> throws Exception
>> {
>> - String fileName = resolveFileName(fileNameNodeValue);
>> + String fileName = resolveFileName(ampersandFileName,
>> fileNameNodeValue);
>>
>> // Store the base name for relative .cat file references.
>> //
>> @@ -412,7 +412,7 @@
>> }
>> }
>>
>> - public String resolveFileName(String name)
>> + public String resolveFileName(String ampersandFileName, String name)
>> {
>> name = Util.trimQuotes(name);
>> name = Util.updateFileName(name, "\\");
>> @@ -426,7 +426,7 @@
>> String directoryName = name.substring(0, index);
>> if (directoryName.startsWith("$")) //directoryName.length() > 0
>> && directoryName.charAt(0) == '$') {
>> - String variableName = directoryName.substring(1);
>> + String variableName = directoryName.substring(1).toUpperCase();
>> directoryName = variableToDirectoryMap.get(variableName);
>> if (directoryName == null)
>> {
>> @@ -434,6 +434,13 @@
>> directoryName = "";
>> }
>> }
>> + if (directoryName.equals("&") && ampersandFileName != null)
>> + {
>> + int lastSeparatorIndex =
>> ampersandFileName.lastIndexOf(File.separator);
>> + if(lastSeparatorIndex != -1){
>> + directoryName = ampersandFileName.substring(0,
>> lastSeparatorIndex);
>> + }
>> + }
>> result += directoryName + File.separator;
>> name = name.substring(index + 1);
>> }
>> Index: src/org/eclipse/emf/importer/rose/builder/UnitTreeBuilder.ja va
>> ============================================================ =======
>> RCS file:
>>
/cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/or g.eclipse.emf.importer.rose/src/org/eclipse/emf/importer/ros e/builder/UnitTreeBuilder.java,v
>>
>> retrieving revision 1.4
>> diff -u -r1.4 UnitTreeBuilder.java
>> --- src/org/eclipse/emf/importer/rose/builder/UnitTreeBuilder.ja va
>> 28 Dec 2006 06:56:06 -0000 1.4
>> +++ src/org/eclipse/emf/importer/rose/builder/UnitTreeBuilder.ja va
>> 20 Nov 2008 03:19:39 -0000
>> @@ -111,10 +111,10 @@
>> if (fileNameNode != null)
>> {
>> String fileNameNodeValue = fileNameNode.getValue();
>> - String fileName = roseUtil.resolveFileName(fileNameNodeValue);
>> + String fileName =
>> roseUtil.resolveFileName(unitNode.roseFileName, fileNameNodeValue);
>> UnitTreeNode unitTreeNode = new UnitTreeNode(objName, quid,
>> fileName);
>> unitNode.addNode(unitTreeNode);
>> - roseUtil.createRoseUnitTreeAndTable(fileNameNodeValue,
>> unitTreeNode);
>> + roseUtil.createRoseUnitTreeAndTable(unitNode.roseFileName,
>> fileNameNodeValue, unitTreeNode);
>> }
>> }
>> else
>>
>>
>>
>>
Re: Rose Importer Patch and Question [message #425254 is a reply to message #425244] Thu, 20 November 2008 23:24 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Scott,

There's an importer framework and the rose importer is a specialized
example. There is nothing beyond what you see in the source...


Scott Hendrickson wrote:
> Thanks for the reply, Ed. Before opening a bugzilla report. I'd like
> to know the answer to my second question that was burried in there at
> the end:
>
>>> My second question is: Is there a substitute for the
>>> org.eclipse.emf.importer.rose functionality? Perhaps a framework for
>>> importing models that is more generic?
>
> It might be better to consider alternatives first.
>
> Thanks,
> -- Scott
>
>
> Ed Merks wrote:
>
>> Scott,
>
>> I'm not sure I understand where "&" comes into the picture. Don't
>> the settings for pathmap variables address the issue? Please open a
>> bugzilla with your patch and include a model that shows how it works
>> (keeping in mind that I no longer have Rose installed).
>
>
>> Scott Hendrickson wrote:
>>> As much as I'd like to get away from arcane rose models, I have to
>>> import and process a number of them. These files use "&" resolution.
>>> Unfortunately, unlike [1], setting CURDIR to "." will not work. My
>>> models have the following:
>>>
>>> folder/a.mdl
>>> folder/b/c.cat
>>> folder/b/d/e.cat
>>>
>>> a.mdl has a reference: $CURDIR\b\c.cat , and
>>> c.cat has a reference: $CURDIR\d\e.cat
>>>
>>> I've attached a patch that causes "&" resolution to work (at least
>>> on my models).
>>>
>>> The patch also does a toUpper on variable names when looking them
>>> up. The models I'm importing use both cases at the same time for
>>> CURDIR, so, I'm guessing that Rose was case insensitive?
>>>
>>> My second question is: Is there a substitute for the
>>> org.eclipse.emf.importer.rose functionality? Perhaps a framework for
>>> importing models that is more generic?
>>>
>>> Thank you,
>>> -- Scott
>>>
>>> [1]
>>> http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 7288.html
>>> [2] & patch (if patch files don't work through e-mail, please let me
>>> know where I can e-mail it to)
>>>
>>> ### Eclipse Workspace Patch 1.0
>>> #P org.eclipse.emf.importer.rose
>>> Index: src/org/eclipse/emf/importer/rose/RoseImporter.java
>>> ============================================================ =======
>>> RCS file:
> /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/or g.eclipse.emf.importer.rose/src/org/eclipse/emf/importer/ros e/RoseImporter.java,v
>
>>>
>>> retrieving revision 1.14
>>> diff -u -r1.14 RoseImporter.java
>>> --- src/org/eclipse/emf/importer/rose/RoseImporter.java 28 Dec
>>> 2006 06:56:06 -0000 1.14
>>> +++ src/org/eclipse/emf/importer/rose/RoseImporter.java 20 Nov
>>> 2008 03:19:38 -0000
>>> @@ -168,7 +168,7 @@
>>> roseUtil.getRoseEcoreBuilder().unsettablePrimitive =
>>> unsettablePrimitive;
>>>
>>> roseUtil.getVariableToDirectoryMap().putAll(pathMap);
>>> - unitTreeNode =
>>> roseUtil.createRoseUnitTreeAndTable(roseModelAbsolutePath, null);
>>> + unitTreeNode = roseUtil.createRoseUnitTreeAndTable(null,
>>> roseModelAbsolutePath, null);
>>> if (unitTreeNode == null)
>>> {
>>> diagnostic = new BasicDiagnostic(Diagnostic.ERROR, Index:
>>> src/org/eclipse/emf/importer/rose/builder/RoseUtil.java
>>> ============================================================ =======
>>> RCS file:
> /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/or g.eclipse.emf.importer.rose/src/org/eclipse/emf/importer/ros e/builder/RoseUtil.java,v
>
>>>
>>> retrieving revision 1.8
>>> diff -u -r1.8 RoseUtil.java
>>> --- src/org/eclipse/emf/importer/rose/builder/RoseUtil.java 28
>>> Dec 2006 06:56:06 -0000 1.8
>>> +++ src/org/eclipse/emf/importer/rose/builder/RoseUtil.java 20
>>> Nov 2008 03:19:38 -0000
>>> @@ -77,9 +77,9 @@
>>> return roseEcoreBuilder;
>>> }
>>>
>>> - public UnitTreeNode createRoseUnitTreeAndTable(String
>>> fileNameNodeValue, UnitTreeNode topNode) throws Exception
>>> + public UnitTreeNode createRoseUnitTreeAndTable(String
>>> ampersandFileName, String fileNameNodeValue, UnitTreeNode topNode)
>>> throws Exception
>>> {
>>> - String fileName = resolveFileName(fileNameNodeValue);
>>> + String fileName = resolveFileName(ampersandFileName,
>>> fileNameNodeValue);
>>>
>>> // Store the base name for relative .cat file references.
>>> //
>>> @@ -412,7 +412,7 @@
>>> }
>>> }
>>>
>>> - public String resolveFileName(String name)
>>> + public String resolveFileName(String ampersandFileName, String name)
>>> {
>>> name = Util.trimQuotes(name);
>>> name = Util.updateFileName(name, "\\");
>>> @@ -426,7 +426,7 @@
>>> String directoryName = name.substring(0, index);
>>> if (directoryName.startsWith("$")) //directoryName.length() >
>>> 0 && directoryName.charAt(0) == '$') {
>>> - String variableName = directoryName.substring(1);
>>> + String variableName =
>>> directoryName.substring(1).toUpperCase();
>>> directoryName = variableToDirectoryMap.get(variableName);
>>> if (directoryName == null)
>>> {
>>> @@ -434,6 +434,13 @@
>>> directoryName = "";
>>> }
>>> }
>>> + if (directoryName.equals("&") && ampersandFileName != null)
>>> + {
>>> + int lastSeparatorIndex =
>>> ampersandFileName.lastIndexOf(File.separator);
>>> + if(lastSeparatorIndex != -1){
>>> + directoryName = ampersandFileName.substring(0,
>>> lastSeparatorIndex);
>>> + }
>>> + }
>>> result += directoryName + File.separator;
>>> name = name.substring(index + 1);
>>> }
>>> Index: src/org/eclipse/emf/importer/rose/builder/UnitTreeBuilder.ja va
>>> ============================================================ =======
>>> RCS file:
> /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/or g.eclipse.emf.importer.rose/src/org/eclipse/emf/importer/ros e/builder/UnitTreeBuilder.java,v
>
>>>
>>> retrieving revision 1.4
>>> diff -u -r1.4 UnitTreeBuilder.java
>>> ---
>>> src/org/eclipse/emf/importer/rose/builder/UnitTreeBuilder.ja va 28
>>> Dec 2006 06:56:06 -0000 1.4
>>> +++
>>> src/org/eclipse/emf/importer/rose/builder/UnitTreeBuilder.ja va 20
>>> Nov 2008 03:19:39 -0000
>>> @@ -111,10 +111,10 @@
>>> if (fileNameNode != null)
>>> {
>>> String fileNameNodeValue = fileNameNode.getValue();
>>> - String fileName =
>>> roseUtil.resolveFileName(fileNameNodeValue);
>>> + String fileName =
>>> roseUtil.resolveFileName(unitNode.roseFileName, fileNameNodeValue);
>>> UnitTreeNode unitTreeNode = new UnitTreeNode(objName,
>>> quid, fileName);
>>> unitNode.addNode(unitTreeNode);
>>> - roseUtil.createRoseUnitTreeAndTable(fileNameNodeValue,
>>> unitTreeNode);
>>> +
>>> roseUtil.createRoseUnitTreeAndTable(unitNode.roseFileName,
>>> fileNameNodeValue, unitTreeNode);
>>> }
>>> }
>>> else
>>>
>>>
>>>
>>>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Teneo not passing hibernate.properties?
Next Topic:[Teneo] How to reference an object by its Composite Key
Goto Forum:
  


Current Time: Thu Apr 25 22:09:29 GMT 2024

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

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

Back to the top