Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

IProcessConfiguration.getCharacterData() removes linebreaks?

I'm using my custom process operation participant, which parses its process config via by com.ibm.team.process.common.IProcessConfigurationElement...

However, it seems that loading text nodes (via element.getCharacterData()) remove the linebreaks at load time.

Here's the code to load the character data:

IProcessConfigurationElement[] children = element.getChildren();

for (int i = 0; i < children.length; i++) {
IProcessConfigurationElement child = children[i];
String elementName = child.getName();
if (elementName.equals(IStateChangeHookDefinitions.TAG_SCRIPT)) {
parsedConfig.fHookCodeScript =child.getCharacterData();
}
}



The process configuration source looks like this:
<action>

<script>for (int i = 0; i < 10: i++) {&#13 ;
&#13 ;
do something else
}&#13 ;
</script>
</action>


Note that there are linebreaks (entity-encoded as &#13 ;)... This gets correctly saved/loaded by the UI part, e.g. IMemento ...
However, loading that config element inside the serverside participant from the config element, results in a single-line String - without linebreaks.

Am I missing something, or is actually not working correctly?
Thanks for any hints...

1

1 vote



One answer

Permanent link
I'm using my custom process operation participant, which parses its process config via by com.ibm.team.process.common.IProcessConfigurationElement...

However, it seems that loading text nodes (via element.getCharacterData()) remove the linebreaks at load time.

Here's the code to load the character data:

IProcessConfigurationElement[] children = element.getChildren();

for (int i = 0; i < children.length; i++) {
IProcessConfigurationElement child = children[i];
String elementName = child.getName();
if (elementName.equals(IStateChangeHookDefinitions.TAG_SCRIPT)) {
parsedConfig.fHookCodeScript =child.getCharacterData();
}
}



The process configuration source looks like this:
<action>

<script>for (int i = 0; i < 10: i++) {&#13 ;
&#13 ;
do something else
}&#13 ;
</script>
</action>


Note that there are linebreaks (entity-encoded as &#13 ;)... This gets correctly saved/loaded by the UI part, e.g. IMemento ...
However, loading that config element inside the serverside participant from the config element, results in a single-line String - without linebreaks.

Am I missing something, or is actually not working correctly?
Thanks for any hints...


Looks it is a bug here, please file a bug against Process component, thanks.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,941

Question asked: Sep 24 '11, 9:17 a.m.

Question was seen: 5,139 times

Last updated: Sep 24 '11, 9:17 a.m.

Confirmation Cancel Confirm