Author |
Message |
15/11/2010 12:57:02
|
moebus
Power User
Joined: 21/11/2007 12:49:18
Messages: 93
Offline
|
in some complex pages we have rowdynamic, using rowinclude, with the attribute contentReplace set to some value.
This is not rencered correctly, it passes through ROWINCLUDEComponent.removeDoubleReplacements(), where in our case the argument list contains two elements:
Code:
#{d.:#{d.d_55.
#{d.d55.Something:#{d.d55.SomethingElse
This method in question removes the first item since it is considered as double, but clearly it is not.
While it might be a good idea from performance point of view it is probably best to discard this method altogether (as seems to be done in RowIncludeComponent.initContentReplaceList()), since there are many complex scenarios where a simple string checking can be tricked by possible replacement settings, when one might be constructed to explicitly take into account the effects of a previous replacements.
Manfred
|
|
|
15/11/2010 13:06:15
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5555
Offline
|
...the background of this method is not performance (this is done one time only when loading the page...) but really avoiding of logical double replacements...
We will have a closer look inside, but wiping out too fast is dangerous.
In the meantime please switch to ".Something.:.SomethingElse."...
Regards, Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
15/11/2010 13:20:25
|
moebus
Power User
Joined: 21/11/2007 12:49:18
Messages: 93
Offline
|
using Something:SomethingElse was our first try, but we came upon the double replacement problem you mention. We then found some code handling double stuff containing if's about replacement string starting with #{d.
So it worked better the way described, and with some special codes we could even trick your removeDoubleReplacements method so currently the code is working (though with much pain).
But we might try Something:SomeElseThing, or even do some more refactoring and check if the PageBean stuff is useful for our problem.
|
|
|
15/11/2010 14:42:06
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5555
Offline
|
Hi,
we now change the method to...:
Code:
for (int i=0; i<replacementsArray.length-1; i++)
{
ValueManager.NameValue nvFrom = replacementsArray[i];
for (int j=i+1; j<replacementsArray.length; j++)
{
ValueManager.NameValue nvTo = replacementsArray[j];
if (nvTo.name.startsWith(nvFrom.name) && // #{d.:#{d.d_55.;#{d.XXX.;#{d.d_55.YYY. => must be removed
nvTo.value.startsWith(nvFrom.value) &&
(nvTo.name.startsWith(nvFrom.value) == false)) // #{d.:#{d.d_55.;#{d.d_55.XXX.:#{d.d_55.YYY. must not be removed
{
replacementsArray[i] = null;
removedItem = true;
}
}
}
...and do "some testing"...
We can make this available as hot fix this week only, there is no Monday update this week...
Regards, Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
|