1 2 Previous Next 16 Replies Latest reply: Jul 11, 2012 11:00 AM by Martin Gibbs RSS

Parsing URL's in Mid-Tier

Martin Gibbs

OK, so we are moving a few folks onto mid-tier to make sure our forms and active links work as expected in the client. One thing we've noticed is that links embedded in text boxes no longer show up as clickable hyperlinks. We are on 7.5.

 

I've done a little searching, and 7.6 delivers RTF, but we won't be upgrading for awhile. I've also seen talk of templates, but I'm not sure how you'd setup a template to parse a URL inside a text box.

 

Has anyone had any luck on Mid-Tier with displaying links?

  • 1. Parsing URL's in Mid-Tier
    Misi Mladoniczky

    Which syntax do you use?

     

    Do you have a <a href="http://www.rrr.se">RRR.se</a> or similar for your hyperlinks?

     

            Best Regards - Misi, RRR AB, http://rrr.se

  • 2. Parsing URL's in Mid-Tier
    Martin Gibbs

    In the text box users have entered the following types of entries. Both come across as clickable in client, text in mid-tier

     

     

    HOW TO LOCATE

     

     

     

     

     

     

    file:///L:/file:///L:/remedylinks/Lawson_Instructions.xlsremedylinks/Instructions.xlsfile:///L:/remedylinks/Lawson_Instructions.xls

    REVIEWING PAYCHECKS

    www.google.com

  • 3. Parsing URL's in Mid-Tier
    Misi Mladoniczky

    Hi,

     

    I thought you were talking about a Text-field, which is a static text on your form.

     

    If you are talking about Character Fields, it is another thing entirely. There is a Display-setting called 'Show URL' that needs to be set to "True" on your field.

     

            Best Regards - Misi, RRR AB, http://rrr.se

  • 4. Parsing URL's in Mid-Tier
    Martin Gibbs

    Is that in 7.6, though? I'm in 7.5 Developer and there is no Show URL option in the Display settings for a character field.

  • 5. Parsing URL's in Mid-Tier
    Misi Mladoniczky

    Hi,

     

    I checked a 7.5 installation, and I can not find it either...

     

    I guess that limits your options...

     

    Maybe you can make use a view-field where you assign the content of your field. Possibly with some HTML-tags surrounding the data to force it into believing it is indeed HTML data.

     

           Best Regards - Misi, RRR AB, http://rrr.se

  • 6. Parsing URL's in Mid-Tier
    Martin Gibbs

    I was able to create a View field and wrap HTML around the field, but the mid-tier still won't parse the URL's in the text.

  • 7. Parsing URL's in Mid-Tier
    Misi Mladoniczky

    Hi,

     

    In that case you should try to add tags arround it: <a href="xxx">xxx</a>

     

             Best Regards - Misi, RRR AB, http://rrr.se

  • 8. Parsing URL's in Mid-Tier
    Martin Gibbs

    That works, the problem is that links can be buried within the text. So you'd have "Make sure to do XYZ, and then click here, <a href="www.google.com">Google</a>, before you update the record. See <a href="file:///\\mystem.myfiles.org\public\help.xlsx">Scripting Resources</a> for more information.

  • 9. Parsing URL's in Mid-Tier
    Martin Gibbs

    I tried to use JavaScript to trick this out, but it won't work in an Active link. It doesn't like the document.write. Now I'm thinking, all I need to do is run that urlRegex function below and find/replace the form field with the newly encoded value.

     

    What I've tried so far:

     

    <script language="javascript">

    function linkify(text) {                      

    var urlRegex =/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;   

    return text.replace(urlRegex, function(url) {
    return '<a href="' + url + '">' + url + '</a>';
                              
    })
    }

    function setURL () {
    document.write(linkify(document.form.resource.value));
    }

    </script>
    <body onLoad="setURL();">

    <html>

    <form name="form"><input name="resource" value="+$Questions-Links$+">

  • 10. Parsing URL's in Mid-Tier
    Martin Gibbs

    Does anyone have any further ideas for this? I hate to bump my own thread, but it would be nice to be able to do a replace view the URL's on the web.

  • 11. Parsing URL's in Mid-Tier
    David J. Easter

    Obviously moving to AR System 7.6.0x and using RTF is the preferred solution.

     

    In AR System 7.5.00, tooltips were enhanced to include the ability to have URL links, which can be added through a Set Fields action.  It may be possible, therefore, to populate the tooltip with the URL you want folks to go to.  Then just activate the tooltip on hover.

     

    Thanks,

    -----------------

    David J. Easter

    Product Line Manager, AR System

    BSM & Atrium Solutions Mgmt
    BMC Software, Inc.

  • 12. Re: Parsing URL's in Mid-Tier
    Laurent Matheo

    Isn't the <body> supposed to be after the <html> tag? Actually the <html> should be on top but perhaps it was just an example?

     

    Anyway, perhaps it's better to walk through the DOM and replace in all textarea (for example) or fields the value you want?

    This would be kinda the same script, but you would browse on all the "document" objects and change their value accordingly.

     

    Or something like this:

    https://communities.bmc.com/communities/message/236512#236512

    https://communities.bmc.com/communities/message/204815#204815

  • 13. Parsing URL's in Mid-Tier
    Sylvain YVON

    Hi Martin,

     

    I have done that many times on 7.5, if you set a valid html text into a view field, it will display it correctly under Mid-Tier.

    For example :

    <html>

      <head>

       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

       <style .......>

       ...

       </style>

      </head>

      <body>

        your text with <a href="www.google.com" title="dont forget a title ">your link</a>

       </body>

    </html>

     

    You can also use a template as you said, if you want all your values to look the same and to be able to change the style without changing your workflow. To do this, create an HTML template in AR System Resource Definitions with the code above. Replace the body content with ${body}, save it into an html file and then as an attachment in the new record. Now in your set fields action, use TEMPLATE(<name of your template>,"body",$field that contains your text$).

     

    Sylvain

  • 14. Parsing URL's in Mid-Tier
    Martin Gibbs

    First thing I tried was the Template. Here is the HTML for that file, named URLParser:

     

    <html>
      <head>
       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
       <style>
       </style>
      </head>

      <body>
    ${body}
       </body>
    </html>

     

    And the Set Fields:

    TEMPLATE("URLParser", "body", $Questions-Links$)

     

    The View field is blank.

1 2 Previous Next