Written by The Jahia Team
 
Sysadmins
   Estimated reading time:
7.2.3.4 7.3.0.2

How can I check the consistency of specific nodes at the Jackrabbit level?

Answer

Open the Groovy console (DX_URL/modules/tools/groovyConsole.jsp)  and execute the script below (do not forget to add the list of UUIDs to check):

import org.apache.jackrabbit.core.persistence.PersistenceManager;
import org.jahia.services.content.impl.jackrabbit.SpringJackrabbitRepository;
import org.jahia.services.SpringContextSingleton;

def String[] uuids = ["6e45a064-a1ce-466f-a19e-4441f3aeb21a"];
def boolean doFix = false;

PersistenceManager pm = ((SpringJackrabbitRepository) SpringContextSingleton.getBean("jackrabbit")).getRepository().getWorkspaceInfo("default").getPersistenceManager();
pm.checkConsistency(uuids, true, doFix);

pm = ((SpringJackrabbitRepository) SpringContextSingleton.getBean("jackrabbit")).getRepository().getWorkspaceInfo("live").getPersistenceManager();
pm.checkConsistency(uuids, true, doFix);

pm = ((SpringJackrabbitRepository) SpringContextSingleton.getBean("jackrabbit")).getRepository().getContext().getInternalVersionManager().getPersistenceManager();
pm.checkConsistency(uuids, true, doFix);

Related links