[xwiki-users] Set Parent in XWiki 8.0
Hi Users, i added over 500 Pages to the new XWiki and now want to sort it in depth. But i cant find the "Change Parent" Symbol in Edit-Mode. Where can i change the Parent of a Page? Regards, Matthias -- View this message in context: http://xwiki.475771.n2.nabble.com/Set-Parent-in-XWiki-8-0-tp7598643.html Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi Matthias,
On 25 Mar 2016, at 13:21, Matthias Wegner <[email protected]> wrote:
Hi Users,
i added over 500 Pages to the new XWiki and now want to sort it in depth. But i cant find the "Change Parent" Symbol in Edit-Mode. Where can i change the Parent of a Page?
See http://platform.xwiki.org/xwiki/bin/view/Features/PageEditing#HSettingthepag... This page should lead you to http://platform.xwiki.org/xwiki/bin/view/Features/ContentOrganization/ which in turn should lead you to http://platform.xwiki.org/xwiki/bin/view/Features/ContentOrganization/Nested... Thanks -Vincent
Regards, Matthias
Hi Vincent, thanks, now it is clear and works. But i used a query like #set($hql = "where doc.parent='Book.WebHome' and not doc.name='WebPreferences' order by doc.title asc") #set($chapters = $xwiki.searchDocuments($hql, 0, 0)) to get all Documents in den Space "Book" (old model). It shows all documents, even the nested ones. How can i query recursively starting with the parent document "Book.WebHome"? Regards, Matthias Am 25.03.2016 um 14:17 schrieb vmassol [via XWiki]:
Hi Matthias, i used a query like
On 25 Mar 2016, at 13:21, Matthias Wegner <[hidden email] </user/SendEmail.jtp?type=node&node=7598644&i=0>> wrote:
Hi Users,
i added over 500 Pages to the new XWiki and now want to sort it in depth. But i cant find the "Change Parent" Symbol in Edit-Mode. Where can i change the Parent of a Page?
See http://platform.xwiki.org/xwiki/bin/view/Features/PageEditing#HSettingthepag...
This page should lead you to http://platform.xwiki.org/xwiki/bin/view/Features/ContentOrganization/ which in turn should lead you to http://platform.xwiki.org/xwiki/bin/view/Features/ContentOrganization/Nested...
Thanks -Vincent
Regards, Matthias
_______________________________________________ users mailing list [hidden email] </user/SendEmail.jtp?type=node&node=7598644&i=1> http://lists.xwiki.org/mailman/listinfo/users
------------------------------------------------------------------------ If you reply to this email, your message will be added to the discussion below: http://xwiki.475771.n2.nabble.com/Set-Parent-in-XWiki-8-0-tp7598643p7598644....
To unsubscribe from Set Parent in XWiki 8.0, click here <http://xwiki.475771.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=7598643&code=bWljLm1hdC53ZWduZXJAd2ViLmRlfDc1OTg2NDN8LTIyMDkyOTgwMA==>. NAML <http://xwiki.475771.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
-- View this message in context: http://xwiki.475771.n2.nabble.com/Set-Parent-in-XWiki-8-0-tp7598643p7598667.... Sent from the XWiki- Users mailing list archive at Nabble.com.
Thank you Matthias! I know it wasn’t intentional but I am working on a similar issue and your code example was extremely useful. Regards, Jesse Bright
On Mar 25, 2016, at 3:10 PM, Matthias Wegner <[email protected]> wrote:
Hi Vincent,
thanks, now it is clear and works. But i used a query like
#set($hql = "where doc.parent='Book.WebHome' and not doc.name='WebPreferences' order by doc.title asc") #set($chapters = $xwiki.searchDocuments($hql, 0, 0))
to get all Documents in den Space "Book" (old model). It shows all documents, even the nested ones. How can i query recursively starting with the parent document "Book.WebHome"?
Regards, Matthias
Am 25.03.2016 um 14:17 schrieb vmassol [via XWiki]:
Hi Matthias, i used a query like
On 25 Mar 2016, at 13:21, Matthias Wegner <[hidden email] </user/SendEmail.jtp?type=node&node=7598644&i=0>> wrote:
Hi Users,
i added over 500 Pages to the new XWiki and now want to sort it in depth. But i cant find the "Change Parent" Symbol in Edit-Mode. Where can i change the Parent of a Page?
See http://platform.xwiki.org/xwiki/bin/view/Features/PageEditing#HSettingthepag...
This page should lead you to http://platform.xwiki.org/xwiki/bin/view/Features/ContentOrganization/ which in turn should lead you to http://platform.xwiki.org/xwiki/bin/view/Features/ContentOrganization/Nested...
Thanks -Vincent
Regards, Matthias
_______________________________________________ users mailing list [hidden email] </user/SendEmail.jtp?type=node&node=7598644&i=1> http://lists.xwiki.org/mailman/listinfo/users <http://lists.xwiki.org/mailman/listinfo/users>
------------------------------------------------------------------------ If you reply to this email, your message will be added to the discussion below: http://xwiki.475771.n2.nabble.com/Set-Parent-in-XWiki-8-0-tp7598643p7598644.... <http://xwiki.475771.n2.nabble.com/Set-Parent-in-XWiki-8-0-tp7598643p7598644.html>
To unsubscribe from Set Parent in XWiki 8.0, click here <http://xwiki.475771.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe... <http://xwiki.475771.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=7598643&code=bWljLm1hdC53ZWduZXJAd2ViLmRlfDc1OTg2NDN8LTIyMDkyOTgwMA==>>. NAML <http://xwiki.475771.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewe... <http://xwiki.475771.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>>
-- View this message in context: http://xwiki.475771.n2.nabble.com/Set-Parent-in-XWiki-8-0-tp7598643p7598667.... <http://xwiki.475771.n2.nabble.com/Set-Parent-in-XWiki-8-0-tp7598643p7598667.html> Sent from the XWiki- Users mailing list archive at Nabble.com <http://nabble.com/>. _______________________________________________ users mailing list [email protected] <mailto:[email protected]> http://lists.xwiki.org/mailman/listinfo/users <http://lists.xwiki.org/mailman/listinfo/users>
Hi All, i tested and tried and found a solution which gives my needed result. Now i get the nested content of a space in nice order and with correct headings. Looks a bit ugly, but works: {{velocity}} #macro(display $idoc) #set($depth = $idoc.getSpace().toString().length() - $idoc.getSpace().toString().replace(".", "").length() ) #if($depth==1) ##* $depth $idoc.getSpace() = [[$idoc.getTitle()>>${idoc.getSpace()}.${idoc.getName()}]]= #elseif($depth==2) ##** $depth $idoc.getSpace() == [[$idoc.getTitle()>>${idoc.getSpace()}.${idoc.getName()}]]== #elseif($depth==3) ##*** $depth $idoc.getSpace() === [[$idoc.getTitle()>>${idoc.getSpace()}.${idoc.getName()}]]=== #elseif($depth==4) ##**** $depth $idoc.getSpace() ==== [[$idoc.getTitle()>>${idoc.getSpace()}.${idoc.getName()}]]==== #elseif($depth==5) ##***** $depth $idoc.getSpace() ===== [[$idoc.getTitle()>>${idoc.getSpace()}.${idoc.getName()}]]===== #end ^^$idoc.getSpace(), Level: $depth^^ {{include document="${idoc.getSpace()}.${idoc.getName()}" context="new"/}} #getChildren($idoc) #foreach ($i in $children) #display($i) #end #end #macro(getChildren $document) #set($depthParent = $document.getSpace().toString().length() - $document.getSpace().toString().replace(".", "").length() ) #set($children = []) #set($q = "where doc.space like '%${document.getSpace()}.%' and not doc.name='WebPreferences' and not doc.space='${document.getSpace()}' order by doc.title asc") #set($r = $xwiki.searchDocuments($q, 0, 0)) #foreach ($i in $r) #set( $idoc = $xwiki.getDocument($i)) #set($depthChild = $idoc.getSpace().toString().length() - $idoc.getSpace().toString().replace(".", "").length() ) #if($depthChild == ($depthParent + 1)) #set($dummy = $children.add($idoc)) #end #end #end #set($hql = "where doc.space like '%${doc.getSpace()}%' and not doc.name='WebPreferences' and not doc.space='${doc.getSpace()}' order by doc.title asc") #set($chapters = $xwiki.searchDocuments($hql, 0, 0)) #foreach ($item in $chapters) #set( $d = $xwiki.getDocument($item)) #if($d.getSpace().equals("${doc.getSpace()}.${d.getSpace().substring($mathtool.add($d.getSpace().lastIndexOf('.'),1),$d.getSpace().length())}")) #display($d) #end #end {{/velocity}} -- View this message in context: http://xwiki.475771.n2.nabble.com/Set-Parent-in-XWiki-8-0-tp7598643p7598671.... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi, If want you want is "to get all Documents in den Space "Book" (old model). It shows all documents, even the nested ones. How can i query recursively starting with the parent document "Book.WebHome”?”, then the following should be enough: {{velocity}} #set ($xwql = "where doc.space like 'Sandbox' or doc.space like 'Sandbox.%'") #foreach ($item in $services.query.xwql($xwql).addFilter('unique').execute()) * $item #end {{/velocity}} Thanks -Vincent
On 27 Mar 2016, at 15:32, Matthias Wegner <[email protected]> wrote:
Hi All,
i tested and tried and found a solution which gives my needed result. Now i get the nested content of a space in nice order and with correct headings. Looks a bit ugly, but works:
{{velocity}}
#macro(display $idoc) #set($depth = $idoc.getSpace().toString().length() - $idoc.getSpace().toString().replace(".", "").length() ) #if($depth==1) ##* $depth $idoc.getSpace() = [[$idoc.getTitle()>>${idoc.getSpace()}.${idoc.getName()}]]= #elseif($depth==2) ##** $depth $idoc.getSpace() == [[$idoc.getTitle()>>${idoc.getSpace()}.${idoc.getName()}]]== #elseif($depth==3) ##*** $depth $idoc.getSpace() === [[$idoc.getTitle()>>${idoc.getSpace()}.${idoc.getName()}]]=== #elseif($depth==4) ##**** $depth $idoc.getSpace() ==== [[$idoc.getTitle()>>${idoc.getSpace()}.${idoc.getName()}]]==== #elseif($depth==5) ##***** $depth $idoc.getSpace() ===== [[$idoc.getTitle()>>${idoc.getSpace()}.${idoc.getName()}]]===== #end ^^$idoc.getSpace(), Level: $depth^^ {{include document="${idoc.getSpace()}.${idoc.getName()}" context="new"/}} #getChildren($idoc) #foreach ($i in $children) #display($i) #end #end
#macro(getChildren $document) #set($depthParent = $document.getSpace().toString().length() - $document.getSpace().toString().replace(".", "").length() ) #set($children = []) #set($q = "where doc.space like '%${document.getSpace()}.%' and not doc.name='WebPreferences' and not doc.space='${document.getSpace()}' order by doc.title asc") #set($r = $xwiki.searchDocuments($q, 0, 0)) #foreach ($i in $r) #set( $idoc = $xwiki.getDocument($i)) #set($depthChild = $idoc.getSpace().toString().length() - $idoc.getSpace().toString().replace(".", "").length() ) #if($depthChild == ($depthParent + 1)) #set($dummy = $children.add($idoc)) #end #end #end
#set($hql = "where doc.space like '%${doc.getSpace()}%' and not doc.name='WebPreferences' and not doc.space='${doc.getSpace()}' order by doc.title asc") #set($chapters = $xwiki.searchDocuments($hql, 0, 0)) #foreach ($item in $chapters) #set( $d = $xwiki.getDocument($item)) #if($d.getSpace().equals("${doc.getSpace()}.${d.getSpace().substring($mathtool.add($d.getSpace().lastIndexOf('.'),1),$d.getSpace().length())}")) #display($d) #end #end
{{/velocity}}
-- View this message in context: http://xwiki.475771.n2.nabble.com/Set-Parent-in-XWiki-8-0-tp7598643p7598671.... Sent from the XWiki- Users mailing list archive at Nabble.com.
On 29 Mar 2016, at 13:47, Vincent Massol <[email protected]> wrote:
Hi,
If want you want is "to get all Documents in den Space "Book" (old model). It shows all documents, even the nested ones. How can i query recursively starting with the parent document "Book.WebHome”?”, then the following should be enough:
{{velocity}} #set ($xwql = "where doc.space like 'Sandbox' or doc.space like 'Sandbox.%'") #foreach ($item in $services.query.xwql($xwql).addFilter('unique').execute()) * $item #end {{/velocity}}
You can also check http://extensions.xwiki.org/xwiki/bin/view/Extension/Query+Module for more examples. Thanks -Vincent
Thanks -Vincent
On 27 Mar 2016, at 15:32, Matthias Wegner <[email protected]> wrote:
Hi All,
i tested and tried and found a solution which gives my needed result. Now i get the nested content of a space in nice order and with correct headings. Looks a bit ugly, but works:
{{velocity}}
#macro(display $idoc) #set($depth = $idoc.getSpace().toString().length() - $idoc.getSpace().toString().replace(".", "").length() ) #if($depth==1) ##* $depth $idoc.getSpace() = [[$idoc.getTitle()>>${idoc.getSpace()}.${idoc.getName()}]]= #elseif($depth==2) ##** $depth $idoc.getSpace() == [[$idoc.getTitle()>>${idoc.getSpace()}.${idoc.getName()}]]== #elseif($depth==3) ##*** $depth $idoc.getSpace() === [[$idoc.getTitle()>>${idoc.getSpace()}.${idoc.getName()}]]=== #elseif($depth==4) ##**** $depth $idoc.getSpace() ==== [[$idoc.getTitle()>>${idoc.getSpace()}.${idoc.getName()}]]==== #elseif($depth==5) ##***** $depth $idoc.getSpace() ===== [[$idoc.getTitle()>>${idoc.getSpace()}.${idoc.getName()}]]===== #end ^^$idoc.getSpace(), Level: $depth^^ {{include document="${idoc.getSpace()}.${idoc.getName()}" context="new"/}} #getChildren($idoc) #foreach ($i in $children) #display($i) #end #end
#macro(getChildren $document) #set($depthParent = $document.getSpace().toString().length() - $document.getSpace().toString().replace(".", "").length() ) #set($children = []) #set($q = "where doc.space like '%${document.getSpace()}.%' and not doc.name='WebPreferences' and not doc.space='${document.getSpace()}' order by doc.title asc") #set($r = $xwiki.searchDocuments($q, 0, 0)) #foreach ($i in $r) #set( $idoc = $xwiki.getDocument($i)) #set($depthChild = $idoc.getSpace().toString().length() - $idoc.getSpace().toString().replace(".", "").length() ) #if($depthChild == ($depthParent + 1)) #set($dummy = $children.add($idoc)) #end #end #end
#set($hql = "where doc.space like '%${doc.getSpace()}%' and not doc.name='WebPreferences' and not doc.space='${doc.getSpace()}' order by doc.title asc") #set($chapters = $xwiki.searchDocuments($hql, 0, 0)) #foreach ($item in $chapters) #set( $d = $xwiki.getDocument($item)) #if($d.getSpace().equals("${doc.getSpace()}.${d.getSpace().substring($mathtool.add($d.getSpace().lastIndexOf('.'),1),$d.getSpace().length())}")) #display($d) #end #end
{{/velocity}}
-- View this message in context: http://xwiki.475771.n2.nabble.com/Set-Parent-in-XWiki-8-0-tp7598643p7598671.... Sent from the XWiki- Users mailing list archive at Nabble.com.
participants (3)
-
Matthias Wegner -
Personal -
Vincent Massol