Dehiddenifier
Last modified by Vincent Massol on 2021/03/18 11:28
![]() | Reveals all of your hidden documents |
Type | Snippet |
Category | |
Developed by | xwiki:XWiki.cjdelisle |
Rating | |
License | GNU Lesser General Public License 2.1 |
Table of contents
Description
Steps:
- BACK UP YOUR DATABASE. Even the smallest change can reveal hidden database corruption.
- log in as a user with programming permission.
- paste this snippet into a page.
- click preview.
It won't output anything, just makes all of your hidden documents visible.
{{groovy}}
try {
session = xcontext.getContext().getWiki().getHibernateStore().getSessionFactory().openSession();
session.beginTransaction()
session.createQuery("update XWikiDocument as doc set doc.hidden = false where doc.hidden = true").executeUpdate();
session.getTransaction().commit();
} finally {
session.close();
}
{{/groovy}}
try {
session = xcontext.getContext().getWiki().getHibernateStore().getSessionFactory().openSession();
session.beginTransaction()
session.createQuery("update XWikiDocument as doc set doc.hidden = false where doc.hidden = true").executeUpdate();
session.getTransaction().commit();
} finally {
session.close();
}
{{/groovy}}