[ 
https://issues.apache.org/jira/browse/SOLR-4889?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13673844#comment-13673844
 ] 

Hoss Man commented on SOLR-4889:
--------------------------------

Hmm...

my previous speculation about how to get the URL of the current page in the 
autoexport template...

bq. should be some variant of `$confluenceUri/$page.urlPath` if i understand 
correctly

...was based on how the code in the autoexport template generates links to the 
current page nad child pages in the nav breadcrumbs, combined with what objects 
are put in the velocity scope...

* 
https://bitbucket.org/atlassianlabs/confluence-autoexport-plugin/src/91cb9d4d3839b76e41aebf4a39b6660b66beea99/src/main/java/it/could/confluence/autoexport/engine/ExportUtils.java?at=AUTOEXPORT-26#cl-70
* 
https://bitbucket.org/atlassianlabs/confluence-autoexport-plugin/src/91cb9d4d3839b76e41aebf4a39b6660b66beea99/src/main/java/it/could/confluence/autoexport/ExportManager.java?at=AUTOEXPORT-26#cl-248

However, when i attempted to follow in these footsteps, the results were 
unexpected.  `$confluenceUri/$page.urlPath` produced the URL of the dynamic 
confluence page, not the autoexported page.  more experimentation lead me to 
discover that this...

{noformat}
    <div class="test">
      <h3>Hoss'ss test</h3>
      <p>$autoexport.link($page) == <a 
href="$confluenceUri$page.urlPath">$page.title</a> == 
$confluenceUri$page.urlPath</p>
    </div>
{noformat}

produced this...

{noformat}
<div class="test">
      <h3>Hoss'ss test</h3>
      <p><a href="" title="Test Page 1">Test Page 1</a> == <a href="">Test Page 
1</a> == https://cwiki.apache.org/confluence/display/SOLR/Test+Page+1</p>
    </div>
{noformat}

Apparently there is code in the autoexport plugin that post processes the HTML 
produced to convert any links to dynamic pages into links to the static pages, 
but it only looks at true links, not arbitrary URLs in the body of the page, 
nor (as i found out in another test) URLs specified as params in more 
complicated script requests like we would need for comments.

So i'm going to dig into the autoexporter code a bit more to try and figure 
this out.  Worst case scenario, there is way to use the comments system such 
that it just depends on the Refer header, but that has some annoying failure 
cases.  i think a last resort before that would be some javascript to check the 
current location URL and update the script tag.


                
> setup comments on autoexported pages of SOLR CWIKI
> --------------------------------------------------
>
>                 Key: SOLR-4889
>                 URL: https://issues.apache.org/jira/browse/SOLR-4889
>             Project: Solr
>          Issue Type: Sub-task
>          Components: documentation
>            Reporter: Hoss Man
>            Assignee: Hoss Man
>
> https://comments.apache.org/help.html
> * coordinate with infra to get a new comment key created for "solr"
> * add comment code to autoexport template
> ** may require some experimentation to get `{{path}}` right
> ** should be some variant of `$confluenceUri/$page.urlPath` if i understand 
> correctly
> * coordinate adding volunteers to be comment moderators

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to