Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-7471

Shortcut links URL encoding breaks javadoc link generation

    • Icon: Bug Bug
    • Resolution: Not a bug
    • Icon: Low Low
    • None
    • 2.2.10, 2.3
    • None

      Javadoc 5.0 allows the JavaDoc of particular class to be displayed directly using the URLs. For example:

      http://java.sun.com/j2se/1.5.0/docs/api/index.html?java/lang/String.html

      All the links within the page will be broken if the URL above is generated from a shortcut link. Using the URL above as an example, the URL generated will look like:

      http://java.sun.com/j2se/1.5.0/docs/api/index.html?java%2Flang%2FString.html

      Please follow these steps to reproduce the bug:
      1) Create a shortcut link with the expanded value of "http://java.sun.com/j2se/1.5.0/docs/api/index.html?"
      2) Create a page that uses the shortcut link. For example, "[java/lang/String@shortcutlink]"
      3) Click on the rendered link
      4) After the page is loaded, click on any of the links within it.

            [CONFSERVER-7471] Shortcut links URL encoding breaks javadoc link generation

            Agnes Ro added a comment -

            This is actually not a bug.

            Confluence is generating the links correctly, however you are missing the ".html" at the end.
            For example:
            [java/lang/String.html@javadoc]

            Cheers,
            Agnes.

            Agnes Ro added a comment - This is actually not a bug. Confluence is generating the links correctly, however you are missing the ".html" at the end. For example: [java/lang/String.html@javadoc] Cheers, Agnes.

            Agnes Ro added a comment -

            Reopening issue - My bad, it does work going to the link directly.

            Agnes Ro added a comment - Reopening issue - My bad, it does work going to the link directly.

            Agnes Ro added a comment -

            We will not be fixing this as Confluence is generating the links correctly, however it is the javadoc that does not allow you to directly access those specific pages.

            Agnes Ro added a comment - We will not be fixing this as Confluence is generating the links correctly, however it is the javadoc that does not allow you to directly access those specific pages.

            Thanks for the tip, Limor. I did try user macros, but I found it always surrounded it with paragraph tags, which would have messed up lots of pages that have inline shortcut links. So I knocked up a little java plugin that lets you define shortcuts, and expand them. The shortcuts are saved in bandana, and it seems to work. I'm reticent to finish it, since

            1. I'd have to change all shortcuts from [text|path@name] to {shortcut:text|path|name}
            2. users would be tempted to still use the official shortcut links
            3. one day, it'll get fixed, and I'll have to change everything back.

            At least my plugin uses the great {table-plus} plugin to display all shortcuts, so you can sort it

            Reg Skelton added a comment - Thanks for the tip, Limor. I did try user macros, but I found it always surrounded it with paragraph tags, which would have messed up lots of pages that have inline shortcut links. So I knocked up a little java plugin that lets you define shortcuts, and expand them. The shortcuts are saved in bandana, and it seems to work. I'm reticent to finish it, since I'd have to change all shortcuts from [text|path@name] to {shortcut:text|path|name} users would be tempted to still use the official shortcut links one day, it'll get fixed, and I'll have to change everything back. At least my plugin uses the great {table-plus} plugin to display all shortcuts, so you can sort it

            Hi Reg,

            There is a great workaround that worked for me.. Create a user macro, like this (just replace the URL with your relevant one):

            <a href="http://www.gigaspaces.com/docs/JavaDoc/index.html?${param0}.html" >$param1</a>

            My macro is called javadoc. So the syntax, with the link text 'click here' would look like this:

            {javadoc:com\j_spaces\kernel|click here}

            Hope this helps,

            Limor

            Limor Maayan added a comment - Hi Reg, There is a great workaround that worked for me.. Create a user macro, like this (just replace the URL with your relevant one): <a href="http://www.gigaspaces.com/docs/JavaDoc/index.html?${param0}.html" >$param1</a> My macro is called javadoc. So the syntax, with the link text 'click here' would look like this: {javadoc:com\j_spaces\kernel|click here} Hope this helps, Limor

            I can recreate this 2.4.2 as well. As there's no workaround (is there?), and it means functionality is broken, should the priority be major?

            Reg Skelton added a comment - I can recreate this 2.4.2 as well. As there's no workaround (is there?), and it means functionality is broken, should the priority be major?

              agnes@atlassian.com Agnes Ro
              dchui DavidA
              Affected customers:
              4 This affects my team
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: