@Override public void createProjection( String absNodePath, String sourceName, String externalPath, String alias) throws RepositoryException { NodeKey key = session.getNode(absNodePath).key(); WritableSessionCache internalSession = (WritableSessionCache) session.spawnSessionCache(false); internalSession.createProjection(key, sourceName, externalPath, alias); internalSession.save(); }
@Override public void removeProjection(String projectionPath) throws RepositoryException { CheckArg.isNotNull(projectionPath, "projectionPath"); Path path = session.pathFactory().create(projectionPath); if (path.isRoot()) { throw new IllegalArgumentException(JcrI18n.invalidProjectionPath.text(projectionPath)); } NodeKey federatedNodeKey = session.getNode(path.getParent().getString()).key(); NodeKey externalNodeKey = session.getNode(path.getString()).key(); WritableSessionCache internalSession = (WritableSessionCache) session.spawnSessionCache(false); internalSession.removeProjection(federatedNodeKey, externalNodeKey); internalSession.save(); }