Dehiddenifier

Last modified by Vincent Massol on 2021/03/18 11:28

cogReveals all of your hidden documents
TypeSnippet
Category
Developed by

xwiki:XWiki.cjdelisle

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1

Table of contents

Description

Steps:

  1. BACK UP YOUR DATABASE. Even the smallest change can reveal hidden database corruption.
  2. log in as a user with programming permission.
  3. paste this snippet into a page.
  4. 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}}
     

Get Connected