- return vars;
- }
-
- /**
- * Import declared node type definitions, trying to update them if they have
- * changed. In case of failures an error will be logged but no exception
- * will be thrown.
- */
- protected void importNodeTypeDefinitions(final Repository repository) {
- Runnable action = new Runnable() {
- public void run() {
- Reader reader = null;
- Session session = null;
- try {
- session = repository.login();
- processNewSession(session);
- // Load cnds as resources
- for (String resUrl : cndFiles) {
- Resource res = resourceLoader.getResource(resUrl);
- byte[] arr = IOUtils.toByteArray(res.getInputStream());
- reader = new InputStreamReader(
- new ByteArrayInputStream(arr));
- CndImporter.registerNodeTypes(reader, session, true);
- }
- session.save();
- } catch (Exception e) {
- log.error(
- "Cannot import node type definitions " + cndFiles,
- e);
- JcrUtils.discardQuietly(session);
- } finally {
- IOUtils.closeQuietly(reader);
- JcrUtils.logoutQuietly(session);
- }
- }
- };
-
- if (systemExecutor != null)
- systemExecutor.execute(action);
- else
- action.run();
- }
-
- // JCR REPOSITORY (delegated)
- public String getDescriptor(String key) {
- return repository.getDescriptor(key);