Clarity

Expand all | Collapse all

Xog write a carry return

  • 1.  Xog write a carry return

    Posted Jun 23, 2017 06:39 AM

    Hi everyone,

     

    do you know any way to xog write a carry return in a text field?

    I've been looking through the communities and I couldn't find anything related

     

    Regards!



  • 2.  Re: Xog write a carry return

    Posted Jun 23, 2017 07:05 AM

    try playing around with

       
  and/or  


    (I don't remember the subtleties of which one you use when!)  



  • 3.  Re: Xog write a carry return

    Posted Jun 23, 2017 11:38 AM

    You can get the OS dependent  lineSeparator like this.

     

    V/r,

    Gene

     

     

    <core:invokeStatic class='java.lang.System' method='lineSeparator' var='lineSeparator' />


  • 4.  Re: Xog write a carry return

    Posted Jun 23, 2017 11:55 AM

    ^ think thats a GEL answer rather than a XOG one

    (but great info anyway  )



  • 5.  Re: Xog write a carry return

    Posted Jun 27, 2017 07:14 AM

    Thank you for the reply, but unfortunately the solution is not working.

     

    Wherever we use ${lineSeparator} in our GEL Script to set our var values they are lost and it doesn't put a carry return in the destination field.

     

    Is there anything else we could do?

     

    Regards



  • 6.  Re: Xog write a carry return

    Posted Jun 27, 2017 08:53 AM

    Have you tried &#xA;



  • 7.  Re: Xog write a carry return

    Posted Jun 27, 2017 09:45 AM

    I don't think you have not described the problem in detail.

    Do you want to insert line breaks and carriage returns in a text field or do you want to maintain/keep line breaks that are already there?

     

    When it goes to gel there are threads which might help.

    https://communities.ca.com/message/241953703-re-how-to-remove-line-breaks-in-gel-script-to-file?commentID=241953703#comm… 

    and

    https://communities.ca.com/thread/101116630?commentID=101123795#comment-101123795 

    When there is a script with a query then that opens the possibility to use SQL for the breaks.



  • 8.  Re: Xog write a carry return

    Posted Jun 27, 2017 11:17 AM

    This is what we want to accomplish: Editing General Notes field with additional info on an Idea instance.

     

    Intended behaviour

     

    Sadly, this is the result we get:

    Result

     

    We've tried both options:

    <core:set var="newGeneralNotes">${newGeneralNotes.concat(lineSeparator+"[ADDITIONAL INFO] "+newInfo)}</core:set>
    <core:set var="newGeneralNotes" value='${IdeaGeneralNotes}&#xd;&#xA;[ADDITIONAL INFO]: ${newInfo}'/>

     

     

    And then the XOG XML:

    [...]
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_idea.xsd">
      <Header action="write" externalSource="niku" objectType="idea" version="8.0"/>
      <Ideas>                           
        <Idea name="${PRName}" objectID="${ideaCode}" description="${PRDescription}"
          generalNotes="${newGeneralNotes}">

    [...]

     

    No matter the option, the ${newGeneralNotes} loses the new lines.

    We certainly cannot find a way around.



  • 9.  Re: Xog write a carry return

    Posted Jun 27, 2017 10:12 AM

    Dave's way works.  For windows it is &#xd;&#xA; linux just &#xA;

     

      xmlns:core="jelly:core"
      xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary">

         <gel:log>Start Test lineSeparator</gel:log>

         <core:invokeStatic className="java.lang.System" method="getProperty" var="lineSeparator">
              <core:arg type="java.lang.String" value="line.separator" />
         </core:invokeStatic>

         <core:set var="testVar1">lineSeparator</core:set>
         <core:set var="testVar1">${testVar1.concat(lineSeparator+"One")}</core:set>
         <core:set var="testVar1">${testVar1.concat(lineSeparator+"Two")}</core:set>
         <core:set var="testVar1">${testVar1.concat(lineSeparator+"Three")}</core:set>
         <core:set var="testVar1">${testVar1.concat(lineSeparator+"Four")}</core:set>
         <core:set var="testVar1">${testVar1.concat(lineSeparator+"Five")}</core:set>

         <core:set var="testVar2">&#xd;&#xA;</core:set>
         <core:set var="testVar2" value='${testVar2}&#xd;&#xA;One'/>
         <core:set var="testVar2" value='${testVar2}&#xd;&#xA;Two'/>
         <core:set var="testVar2" value='${testVar2}&#xd;&#xA;Three'/>
         <core:set var="testVar2" value='${testVar2}&#xd;&#xA;Four'/>
         <core:set var="testVar2" value='${testVar2}&#xd;&#xA;Five'/>


         <gel:log>${testVar1}</gel:log>
         <gel:log>${testVar2}</gel:log>

    </gel:script>

     

     

    V/r,

    Gene



  • 10.  Re: Xog write a carry return

    Posted Jun 27, 2017 12:12 PM

    I use &#xA;&#xA; in a GEL script that creates a XOG file to load "large string" data to the application

     

    So can you try;

    <core:set var="newGeneralNotes" value='${IdeaGeneralNotes}&#xA;&#xA;[ADDITIONAL INFO]: ${newInfo}'/>

    ?



  • 11.  Re: Xog write a carry return

    Posted Jun 27, 2017 12:38 PM

    Same result. This time it added 2 blank spaces instead of one, but no line breaks.

    Thanks for your help anyway.



  • 12.  Re: Xog write a carry return

    Posted Jun 28, 2017 03:26 AM

    Agh - the &#xA;&#xA; works for me; APP, BG service running on Windows.



  • 13.  Re: Xog write a carry return

    Posted Jul 04, 2017 05:53 AM

    We are using Redhat. Maybe is something related with the OS...

     

    Any idea about our OS code for that?