import java.io.IOException;
+import javax.jcr.Node;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
+import org.argeo.entity.EntityNames;
+import org.argeo.entity.EntityType;
import org.argeo.maintenance.AbstractMaintenanceService;
/** Initialises an Argeo Suite backend. */
@Override
public boolean prepareJcrTree(Session adminSession) throws RepositoryException, IOException {
- //EntityJcrUtils.getOrAddFormFolder(adminSession.getRootNode(), EntityNames.FORM_BASE);
- return adminSession.hasPendingChanges();
+ boolean modified = false;
+ Node rootNode = adminSession.getRootNode();
+ if (!rootNode.hasNode(EntityNames.TERM_BASE)) {
+ rootNode.addNode(EntityNames.TERM_BASE, EntityType.typologies.qualified());
+ modified = true;
+ }
+ if (modified)
+ adminSession.save();
+ return modified;
}
}