Hello, is there a easy way to get all links which are in a page (Forewardlinks, external and internal) and links which linking to page (Backlinks, internal)? I found nothing usefull in the api and the forum. Need i to parse the page my own to get them? Is there a Parser i could use which do the half way? Regards, Matthias -- View this message in context: http://xwiki.475771.n2.nabble.com/Links-to-from-page-tp7587920.html Sent from the XWiki- Dev mailing list archive at Nabble.com.
On Wed, Nov 13, 2013 at 11:23 AM, Matthias Wegner <[email protected]>wrote:
Hello, is there a easy way to get all links which are in a page (Forewardlinks, external and internal) and links which linking to page (Backlinks, internal)? I found nothing usefull in the api and the forum.
Need i to parse the page my own to get them? Is there a Parser i could use which do the half way?
Each page content is represented through an AST (we call it a XDOM). Documentation: http://rendering.xwiki.org Example of parsing a page's XDOM: http://dev.xwiki.org/xwiki/bin/view/Community/ReleaseManagerRoster?viewer=co... Hope it helps -Vincent
Regards, Matthias
-- View this message in context: http://xwiki.475771.n2.nabble.com/Links-to-from-page-tp7587920.html Sent from the XWiki- Dev mailing list archive at Nabble.com. _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Hi Vincent, i found a simple script-solution: {{velocity}} **Parents**: #set($hql = "where doc.space='Main' order by doc.date asc") #set($results = $xwiki.searchDocuments($hql, 0, 0)) #foreach ($item in $results) #set($document = $xwiki.getDocument($item)) ##* $document.getFullName() #foreach( $link in $document.getLinks() ) ##** $link.getLink() #if($link.getLink().equals($doc.getFullName())) * [[$link.getFullName()]] #end #end #end {{/velocity}} -- View this message in context: http://xwiki.475771.n2.nabble.com/Links-to-from-page-tp7587920p7587924.html Sent from the XWiki- Dev mailing list archive at Nabble.com.
Indeed this is simpler for you. Just know that if you wanted to find elements other than links you could use what I pointed to and it would work too. Internally $document.getLinks() will search the XDOM to find Link blocks. Thanks -Vincent On Wed, Nov 13, 2013 at 1:05 PM, Matthias Wegner <[email protected]>wrote:
Hi Vincent,
i found a simple script-solution:
{{velocity}} **Parents**: #set($hql = "where doc.space='Main' order by doc.date asc") #set($results = $xwiki.searchDocuments($hql, 0, 0)) #foreach ($item in $results) #set($document = $xwiki.getDocument($item)) ##* $document.getFullName() #foreach( $link in $document.getLinks() ) ##** $link.getLink() #if($link.getLink().equals($doc.getFullName())) * [[$link.getFullName()]] #end #end #end {{/velocity}}
-- View this message in context: http://xwiki.475771.n2.nabble.com/Links-to-from-page-tp7587920p7587924.html Sent from the XWiki- Dev mailing list archive at Nabble.com. _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
I want to "inject" the found parents to every page in the header <div id="hierarchy"> before the title. What you recommend? OnLoadListener? Javascript? Plugin? Is the example on changing content on load? Regards, Matthias -- View this message in context: http://xwiki.475771.n2.nabble.com/Links-to-from-page-tp7587920p7587927.html Sent from the XWiki- Dev mailing list archive at Nabble.com.
So basically you wish to move the information that is currently in the "Info" tab at the bottom of each page at the top of the page? Thanks -Vincent On Wed, Nov 13, 2013 at 2:21 PM, Matthias Wegner <[email protected]>wrote:
I want to "inject" the found parents to every page in the header <div id="hierarchy"> before the title. What you recommend? OnLoadListener? Javascript? Plugin? Is the example on changing content on load?
Regards, Matthias
-- View this message in context: http://xwiki.475771.n2.nabble.com/Links-to-from-page-tp7587920p7587927.html Sent from the XWiki- Dev mailing list archive at Nabble.com. _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
*LOL* Simply my requirements are with your comment fullfilled. I don't need it at the top, when is is already done. The Function is more important for me. Thanks, Matthias -- View this message in context: http://xwiki.475771.n2.nabble.com/Links-to-from-page-tp7587920p7587929.html Sent from the XWiki- Dev mailing list archive at Nabble.com.
On Wed, Nov 13, 2013 at 2:44 PM, Matthias Wegner <[email protected]>wrote:
*LOL* Simply my requirements are with your comment fullfilled. I don't need it at the top, when is is already done. The Function is more important for me. Thanks, Matthias
Great! :) -Vincent
participants (2)
-
Matthias Wegner -
Vincent Massol