Clarity

Expand all | Collapse all

Shortening the Long URL attribute

Deactivated User

Deactivated UserSep 28, 2011 02:40 PM

Deactivated User

Deactivated UserOct 05, 2011 04:09 AMBest Answer

  • 1.  Shortening the Long URL attribute

    Posted Sep 28, 2011 05:22 AM
    Hi,

    I have to display a URL which is outside of clarity and opens a BO report. The URL will have to be constructed dynamically with the server name and some parameters. For that, I have created a URL attribute which will be populated by a Process. My Problem is, this URL is very Long and it looks very weird in the Edit View. Is there any way to display it as an image or icon in the Edit View which upon clicking direct to the Original URL. I tried the URL Redirection Portlet, but since we don't have clarity URL , this would not be very useful.

    Is there any way to shorten the URL just for display purpose and contain the actual URL upon clicking so that Edit view will look more cleaner ?

    Thanks,
    Rahul


  • 2.  RE: Shortening the Long URL attribute

    Posted Sep 28, 2011 08:30 AM
    There is a way...

    Paul Maxwell post in
    Dealing with a long URL within a view
    2301372

    has links to more details

    Martti K.


  • 3.  RE: Shortening the Long URL attribute

    Posted Sep 28, 2011 01:45 PM
    Hi Martti,

    Before posting, I saw this link. But the Two links mentioned by maxad are not opening.

    http://caforums.ca.com/t5/CA-Clarity-General-Discussion/URL-Redirect-to-a-Clarity-Page/m-p/13901

    you will want this:
    http://caforums.ca.com/ca/attachments/ca/CAClarityGeneralDiscussion/4452/1/url_redirection_pg_portlet.zip

    Both are redirecting me to below
    http://www.ca.com/us/not-found.aspx

    Are you able to open them.

    Thanks,
    Rahul


  • 4.  RE: Shortening the Long URL attribute

    Posted Sep 28, 2011 10:37 AM
      |   view attached
    That is something you have to live with as long as the system is changed every now and then without backward compatibility and posters just putting links without the name of the topic, but never mind the original post, use the How to instead

    Examples of URL redirection in Links

    Martti K.

    P.S. The thread is below and the zip is attached.

    Threads [ Previous | Next ]
    Display Ideas
    Post New Thread Post New Thread
    Subscribe Subscribe
    Re: URL Redirect to a Clarity Page
    Christophe_D
    Christophe_D Rank: New Member Posts: 2
    Join Date: 5/2/10

    Recent Posts Recent Posts


    URL Redirect to a Clarity Page
    10/13/09 7:16 AM

    *
    * Reply Reply
    * Reply with Quote Reply with Quote

    Hi,
    On the C.A. Sandbox, within a NSQL query definition, we can create linking with the action "URL Redirect to a Clarity Page".

    Anybody knows if this value in the "Action" is an Out of The Box value or if it comes with the BRM content pack (or other)?

    Thanks,
    Christophe.

    * ±0
    *
    * (0 Votes)

    Report Abuse Report Abuse

    * Top Top

    maxad
    maxad Rank: Jedi Master Posts: 367
    Join Date: 5/2/10

    Recent Posts Recent Posts


    Re: URL Redirect to a Clarity Page
    Answer Answer (Unmark)
    10/13/09 7:17 PM as a reply to Christophe_D.

    *
    * Reply Reply
    * Reply with Quote Reply with Quote

    This is not OOTB (and not to my knowledge in any content pack)

    To enable this facility is quite simple, you need a dedicated page (based on pop-up template) and on that page a html portlet that uses javascript to 'scrape' the URL and perform the redirect.

    ALL users should be given security access to both page and portlet (they will only see it fleetingly, but if they don't have access to them the redirct will fail with a 'you are not authorized' error)

    I'm attaching both the page and portlet in xog form (zipped) The xog contains reference to Clarity 8.1.0.4247 but it should work in any 8x or 12x

    The portlet's javascript is designed to be "graceful" if an error is detected (see image below) and it has been used extensivley in IE6 & 7 and FF2 & 3 (Chrome also)

    Once this page/portlet exists it should register a link type called "URL Redirection" and you use that by passing a single string parameter which will be the URL you want to reach.

    Remember that when doing intra-Clarity jumps this way you should use "relative" URLs starting with "\niku\app?action=...." - strongly advise you avoid "absolute URLs" for Clarity pages! (If you don't follow this advice you will have problems moving queries/portlets from dev to test to prod. for instance)

    I suggest you use the xog 'as is' (i.e. use the page and portlet id's of 'url_redirection' - this makes it very clear what that page and portlet do).

    BTW:
    1. This page/portlet was published for the Australian User Group some time back - a good reason to join or create a user group :-)
    2. The same page/portlet is used in at least 2 Clarity add-ons available from CA: "Data Integrity" and "Fiscal Focus"
    Attachment

    Attachments:
    url_redirection_pg_portlet.zip (1.7k), url_redirect_portlet_preview.png (4.2k)

    * +1
    *
    * (1 Vote)

    Report Abuse Report Abuse

    * Top Top

    Christophe_D
    Christophe_D Rank: New Member Posts: 2
    Join Date: 5/2/10

    Recent Posts Recent Posts


    Re: URL Redirect to a Clarity Page
    10/14/09 4:09 PM as a reply to maxad.

    *
    * Reply Reply
    * Reply with Quote Reply with Quote

    Thanks a lot for your answer, it works fine :)

    * ±0
    *
    * (0 Votes)

    Report Abuse Report Abuse

    * Top Top

    TomConnery
    TomConnery Rank: Jedi Knight Posts: 131
    Join Date: 5/2/10

    Recent Posts Recent Posts


    Re: URL Redirect to a Clarity Page
    10/16/09 3:18 PM as a reply to Christophe_D.

    *
    * Reply Reply
    * Reply with Quote Reply with Quote

    I'm interested in using this type of functionality but... I don't get it..

    I downloaded the xog, wrote it in and assigned rights to portlet and page but how do I test this?

    Can you provide an example of usage?.. What code or variable needs to be modified?

    Sorry...
    Message Edited by TConnery on 10-16-2009 03:18 PM

    * ±0
    *
    * (0 Votes)

    Report Abuse Report Abuse

    * Top Top

    maxad
    maxad Rank: Jedi Master Posts: 367
    Join Date: 5/2/10

    Recent Posts Recent Posts


    Re: URL Redirect to a Clarity Page
    10/17/09 5:13 AM as a reply to TomConnery.

    *
    * Reply Reply
    * Reply with Quote Reply with Quote

    this redirection expects you to provide the wanted URL - as a string

    in (very brief) form
    query contains concatenation of basic URL with object instance id =

    Attachment(s)



  • 5.  RE: Shortening the Long URL attribute

    Posted Sep 28, 2011 10:38 AM
    The thread that Paul (maxad) was linking to is this one (which also has the zip files attached within) URL Redirect to a Clarity Page.

    (but I suspect you have looked at this already)


  • 6.  RE: Shortening the Long URL attribute

    Posted Sep 28, 2011 02:40 PM
    This time I was faster by one second ;-)

    Martti K.


  • 7.  RE: Shortening the Long URL attribute

    Posted Sep 28, 2011 10:12 PM
    Hi,

    Yes, I have gone through this link. I guess this link will be useful if you are redirecting with the Clarity (Intra Clarity). As per my requirement, I have to construct a URL which will have the server name as BO server (Not the clarity) and then I have to provide some values which will be the name (not ID) so that upon clicking it can directly open the BO Report in BO server with the filters already provide in URL. This Link I am able to generate and populate in URL attribute through a process. BUT the pain point is, this URL is very big and occupies lot of space in Edit View. ( I want this URL to be displayed in Edit View Only and NOT the List View ).

    Any idea how can I make this URL look shorter but when clicked opens correctly.

    Thanks,
    Rahul


  • 8.  RE: Shortening the Long URL attribute

    Posted Sep 29, 2011 03:22 AM

    rahul.agrawal03 wrote:

    I guess this link will be useful if you are redirecting with the Clarity (Intra Clarity)
    [color=#ff0000]NO[color] - this technique is not just intra-Clarity; it can be used to launch ANY URL that you can programmatically construct....

    rahul.agrawal03 wrote:

    As per my requirement, I have to construct a URL which will have the server name as BO server (Not the clarity) and then I have to provide some values which will be the name (not ID) so that upon clicking it can directly open the BO Report in BO server with the filters already provide in URL.
    yes exactly; that technique can be used to launch any URL - for example the one you have just built!

    rahul.agrawal03 wrote:

    Any idea how can I make this URL look shorter but when clicked opens correctly.
    the URL-redirection technique in NSQL portlets allows you to 'hide' the actual URL behind an icon or link in the developed portlet - display it however you need to.


  • 9.  RE: Shortening the Long URL attribute

    Posted Sep 29, 2011 04:22 AM
    Thanks Dave !

    Sorry but I still got some doubts, will this technique work in Edit page (Not Edit mode display ) ?

    In the list view this technique works fine because we can put the Hyper Link in the List view only. In this way we pass the link parameter which are the attributes.
    But in the Edit mode, I will put the URL attribute as an icon. Upon clicking, I don't have to pass fixed attribute, I have to do some calculation (e.g. to get the 'name' I will have to use lookup query , can't use lookup code). Similarly, there are some more parameter which I need to populate in the URL based on the data. So where will we do these calculation related to the database? Even we have to pass different server name in the URL based upon where it was clicked. (e.g. DEV, SIT, PROD)

    In the portlet we directly pass the parameter which are attribute values.

    Thanks,
    Rahul


  • 10.  RE: Shortening the Long URL attribute

    Posted Sep 29, 2011 12:49 AM

    rahul.agrawal03 wrote:

    will this technique work in Edit page
    No the technique only works where you can put in a "link" - i.e. NSQL portlets.

    In edit mode you are just stuck with how the tool works.


  • 11.  RE: Shortening the Long URL attribute

    Posted Sep 29, 2011 01:19 AM
    So Dave, there are no other alternatives which I can use to shorten the URL ?


  • 12.  RE: Shortening the Long URL attribute

    Posted Sep 29, 2011 04:33 AM

    rahul.agrawal03 wrote:

    So Dave, there are no other alternatives which I can use to shorten the URL ?
    Buy yourself a URL shortener service?

    Build your IT infrastructure such that URLs to your services are much shorter?

    Set up your network DNS so that you have URL aliases to your services rather than big long URLs?

    --

    Clarity is not going to give you a "magic button" that does what you want though - we have outlined how you can do clever things in portlets using the url-redirection technique; perhaps a solution that utilises that is OK rather than trying to change the way that Clarity behaves (but I entirely accept that this is not what you are trying to do).


  • 13.  RE: Shortening the Long URL attribute

    Posted Sep 30, 2011 09:31 AM
    IMHO the same technique works on Edit properties page except that the link can't be and image, but has to be an URL in text form

    E.g.shorten following URL
    54955299
    to
    http://c8/niku/app?action=url_short
    and it displays without problems.
    If your url is not the same for every instance or you have to construct it from various elements you can use a script to do that.

    Martti K.

    Attachment(s)

    pdf
    Long_URL_Edit_props.pdf   559 KB 1 version


  • 14.  RE: Shortening the Long URL attribute

    Posted Oct 05, 2011 04:31 AM
    Hi Martti,

    That's great !

    IMHO technique which you are referring - is it the same mentioned by maxad ? OR any other technique you are talking here...Also I am not getting how can I keep script to construct URL and display it as a short one. Right now I am using a process to update the URL attribute in Edit Properties page as soon as any create/update is done on that object.

    It would be great if you can please elaborate more on this.

    Thanks,
    Rahul


  • 15.  RE: Shortening the Long URL attribute

    Posted Oct 05, 2011 03:29 AM
    The principle is the same: the displayed URL directs the user to a Clarity page with an HTLM portlet.
    In the original method a parameter is passed to the portlet. The parameter depends on the instance where the user is located.
    In my example the portlet has a frame which displays a page on an outside system. That is the same for all instances.
    In the original method there is a script on the HTML page which compiles the destination URL.
    That could be done in my example as well, but I did not try to create the script because the destination page is always the same.
    In both cases the URL is a field. In the list view it can presented with an image as in the original method or as the URL text.
    In edit properties I know only how to display the URL, but not how to display an image which would act as a link.


    Martti K.


  • 16.  RE: Shortening the Long URL attribute
    Best Answer

    Posted Oct 05, 2011 04:09 AM
    The examples are in
    Examples of URL redirection in Links

    Martti K.


  • 17.  RE: Shortening the Long URL attribute

    Posted Oct 06, 2011 06:03 AM
    Thanks a lot Martti. You rocks !! -_-

    Regards,
    Rahul


  • 18.  RE: Shortening the Long URL attribute

    Posted Oct 10, 2011 02:17 PM
    If you put the URL field in list view say project list take note of CLRT-60242 detailed in TEC555773:

    Main Application > Projects List View > Display Mode

    The value in the column for 'myURL' is not displayed

    Expected Result: To see the value displayed in the 'myURL' column
    Actual Result: No value is displayed in the 'myURL' column


    That information, however, is erroneous and outdated. It does not give the version, but it only applies to v12.1.1. Prior and subsequent versions work fine.

    Martti K.


  • 19.  RE: Shortening the Long URL attribute

    Posted Oct 24, 2013 04:50 PM
    The example links in the images above are too far to the right and not in the view. Download oe View images to see them.

    Martti K.


  • 20.  RE: Shortening the Long URL attribute

    Posted Oct 25, 2013 03:23 AM
    (since we are BUMPing old threads :grin: )

    I would now use the technique detailed here ; TIP : How To Put Any Dynamically Generated Value On A Clarity Object to put a readable hyperlink to a long URL on a property page.


  • 21.  RE: Shortening the Long URL attribute

    Posted Oct 27, 2013 05:11 AM

    Why would you choose that?

    Could you please give pros and cons for those two methods.

     

    Martti K.



  • 22.  RE: Shortening the Long URL attribute

    Posted Oct 28, 2013 05:09 AM
    another_martink:

    Why would you choose that?

    Because it works, it is easy and gives me the cosmetic result I want (being able to display a hyperlink rather than a full, long, unreadable URL).



  • 23.  Re: RE: Shortening the Long URL attribute

    Posted May 25, 2015 03:55 AM

    As far as I understand it that would still be an URL like http://something_link.

    Is that correct? Dave

     

    What I should like to do is have just the link on the properties page. That is either a word which is link or an image.

    Is that possible with "How to put any dynamic value..."

    That would be the same URL and no parameters.



  • 24.  Re: RE: Shortening the Long URL attribute

    Posted May 25, 2015 04:00 AM

    In the thread

    https://communities.ca.com/message/102025972#102025972

    Dave you say
    I do this sort of thing using the technique detailed here ; TIP : How To Put Any Dynamically Generated Value On A Clarity Object

    I don't get how to add a link to the properties to text or image. All I can do is add progress bar.

    Using an html portlet with a short name will do it, but I'd rather have just the image or a text link.



  • 25.  Re: Shortening the Long URL attribute

    Posted May 25, 2015 07:28 PM

    urmas wrote:

     

    As far as I understand it that would still be an URL like http://something_link.

    Is that correct? Dave

    .

    No.

     

    As I said above (in Oct 13) it can display a hyperlink - just need to format the text in the dummy lookup correctly.



  • 26.  Re: Shortening the Long URL attribute

    Posted May 26, 2015 04:53 AM

    Dave: please educate me.

    My understanding is that in Clarity in a properties page a link to work would have to be in an URL type field which you would click or if set to read only you would click the GO button.

    If the field is of type URL Clarity automatically starts the value with http://

    On the hand links do not have to be in that format they can be any text or image, but I don't see how make such a link on a property page only on list views.

     

    Am I missing something?



  • 27.  Re: Shortening the Long URL attribute

    Posted May 26, 2015 10:45 PM

    I think you are missing understanding what that "tip" technique does ; it allows me to put 'any' text on a properties page, and by formatting that text as a hyperlink I can thus put a link on the page.

     

    (This is NOTHING to do with a URL field)



  • 28.  Re: Shortening the Long URL attribute

    Posted May 28, 2015 04:14 AM

    Dave

    you are right, I don't understand it and that is why need to be educated.

    When trying to mechanically follow your document I get

    2x5nnar4.bmp

    I pass the text value to the attribute and it is formatted as a link, but it does not work a link, but is displayed as text.

    If I put the same text in an URL field, the link works and I can navigate to the page in question.

     

    However, I'd rather have just the word HINT displayed and that to be a working link or an image with a link would be fine, too.



  • 29.  Re: Shortening the Long URL attribute

    Posted Jun 08, 2015 05:08 AM

    (sorry, been away for a couple of weeks, wasn't actively ignoring you )

     

    Your screenshot looks almost right though ; quick guess would be that the lookup is set to "Browse" rather than "Pull-Down" (in the [Fields] section on the object configuration)?

     

    (not sure if the document I wrote makes that requirement very clear though? I do say "...and change the lookup display type from browse to drop-down..." but I don't emphasise that very well)



  • 30.  Re: Shortening the Long URL attribute

    Posted Jun 11, 2015 02:55 PM

    Thank you master  (Dave) for the education It certainly did the trick.



  • 31.  Re: RE: Shortening the Long URL attribute

    Posted Jun 23, 2015 08:05 AM

    It is me again.

    Now I've manage to make a couple of implementations of those rather smoothly and are banging the limitations hard.

     

    Is it correct that color mapping is not possible if the data is numeric, because there is  lookup and it is dynamic and not static?

     

    Secondly the values displayed in the properties view are not stored in the database (like in the CMN_CAPTIONS_NLS) but always calculated on the fly?

    So I I want the values in a portlet I would need the include the same query as in the lookup to the query of the portlet?



  • 32.  Re: RE: Shortening the Long URL attribute

    Posted Jun 23, 2015 08:07 AM

    Actually that fits better to the How to put any .... thread so I*ll copy it there.