@Override public void remove( String absPath ) throws UnsupportedOperationException, PathNotFoundException, VersionException, RepositoryException { if (LOGGER.isDebugEnabled()) LOGGER.debug("VersionManager.remove('{0}')", absPath); JcrSession removeSession = session.spawnSession(false); AbstractJcrNode node = removeSession.getNode(absPath); checkVersionable(node); SessionCache systemCache = session.createSystemCache(false); removeHistories(node, systemCache); node.remove(); removeSession.cache().save(systemCache, null); }
@Override public void remove( String absPath ) throws UnsupportedOperationException, PathNotFoundException, VersionException, RepositoryException { if (LOGGER.isDebugEnabled()) LOGGER.debug("VersionManager.remove('{0}')", absPath); JcrSession removeSession = session.spawnSession(false); AbstractJcrNode node = removeSession.getNode(absPath); checkVersionable(node); SessionCache systemCache = session.createSystemCache(false); removeHistories(node, systemCache); node.remove(); removeSession.cache().save(systemCache, null); }
@Override public void removeVersionLabel( String label ) throws VersionException, RepositoryException { AbstractJcrNode versionLabels = versionLabels(); Name propName = null; try { // This throws a PNFE if the named property doesn't already exist propName = versionLabels.getProperty(label).name(); } catch (PathNotFoundException pnfe) { // This gets thrown if the label doesn't already exist throw new VersionException(JcrI18n.invalidVersionLabel.text(label, getPath())); } // Use a separate system session to remove the REFERENCE property on the 'nt:versionLabels' child node ... SessionCache system = session.createSystemCache(false); system.mutable(versionLabels.key()).removeProperty(system, propName); system.save(); }
@Override public void removeVersionLabel( String label ) throws VersionException, RepositoryException { AbstractJcrNode versionLabels = versionLabels(); Name propName = null; try { // This throws a PNFE if the named property doesn't already exist propName = versionLabels.getProperty(label).name(); } catch (PathNotFoundException pnfe) { // This gets thrown if the label doesn't already exist throw new VersionException(JcrI18n.invalidVersionLabel.text(label, getPath())); } // Use a separate system session to remove the REFERENCE property on the 'nt:versionLabels' child node ... SessionCache system = session.createSystemCache(false); system.mutable(versionLabels.key()).removeProperty(system, propName); system.save(); }
private void initializeVersionHistoryFor( AbstractJcrNode node, NodeKey historyKey, SessionCache cache ) throws RepositoryException { SystemContent content = new SystemContent(session.createSystemCache(false)); CachedNode cachedNode = node.node(); Name primaryTypeName = cachedNode.getPrimaryType(cache); Set<Name> mixinTypeNames = cachedNode.getMixinTypes(cache); NodeKey versionedKey = cachedNode.getKey(); Path versionHistoryPath = versionHistoryPathFor(versionedKey); DateTime now = session().dateFactory().create(); content.initializeVersionStorage(versionedKey, historyKey, null, primaryTypeName, mixinTypeNames, versionHistoryPath, null, now); content.save(); }
private void initializeVersionHistoryFor( AbstractJcrNode node, NodeKey historyKey, SessionCache cache ) throws RepositoryException { SystemContent content = new SystemContent(session.createSystemCache(false)); CachedNode cachedNode = node.node(); Name primaryTypeName = cachedNode.getPrimaryType(cache); Set<Name> mixinTypeNames = cachedNode.getMixinTypes(cache); NodeKey versionedKey = cachedNode.getKey(); Path versionHistoryPath = versionHistoryPathFor(versionedKey); DateTime now = session().dateFactory().create(); content.initializeVersionStorage(versionedKey, historyKey, null, primaryTypeName, mixinTypeNames, versionHistoryPath, null, now); content.save(); }
AbstractJcrProperty successors = version.getProperty(JcrLexicon.SUCCESSORS); SessionCache system = session.createSystemCache(false);
SessionCache systemCache = createSystemCache(false); SystemContent systemContent = new SystemContent(systemCache); Map<NodeKey, NodeKey> baseVersionKeys = this.baseVersionKeys.get();
@Override public void addVersionLabel( String versionName, String label, boolean moveLabel ) throws VersionException, RepositoryException { AbstractJcrNode versionLabels = versionLabels(); JcrVersionNode version = getVersion(versionName); try { // This throws a PNFE if the named property doesn't already exist versionLabels.getProperty(label); if (!moveLabel) throw new LabelExistsVersionException(JcrI18n.versionLabelAlreadyExists.text(label)); } catch (PathNotFoundException pnfe) { // This gets thrown if the label doesn't already exist } // Use a separate system session to set the REFERENCE property on the 'nt:versionLabels' child node ... SessionCache system = session.createSystemCache(false); Reference labelReference = session.referenceFactory().create(version.key(), true); Property ref = session.propertyFactory().create(nameFrom(label), labelReference); system.mutable(versionLabels.key()).setProperty(system, ref); system.save(); }
AbstractJcrProperty successors = version.getProperty(JcrLexicon.SUCCESSORS); SessionCache system = session.createSystemCache(false);
SessionCache systemCache = createSystemCache(false); SystemContent systemContent = new SystemContent(systemCache); Map<NodeKey, NodeKey> baseVersionKeys = this.baseVersionKeys.get();
@Override public void addVersionLabel( String versionName, String label, boolean moveLabel ) throws VersionException, RepositoryException { AbstractJcrNode versionLabels = versionLabels(); JcrVersionNode version = getVersion(versionName); try { // This throws a PNFE if the named property doesn't already exist versionLabels.getProperty(label); if (!moveLabel) throw new LabelExistsVersionException(JcrI18n.versionLabelAlreadyExists.text(label)); } catch (PathNotFoundException pnfe) { // This gets thrown if the label doesn't already exist } // Use a separate system session to set the REFERENCE property on the 'nt:versionLabels' child node ... SessionCache system = session.createSystemCache(false); Reference labelReference = session.referenceFactory().create(version.key(), true); Property ref = session.propertyFactory().create(nameFrom(label), labelReference); system.mutable(versionLabels.key()).setProperty(system, ref); system.save(); }
SessionCache systemCache = createSystemCache(false); SystemContent systemContent = new SystemContent(systemCache); Map<NodeKey, NodeKey> baseVersionKeys = this.baseVersionKeys.get();
SessionCache systemCache = createSystemCache(false); SystemContent systemContent = new SystemContent(systemCache); Map<NodeKey, NodeKey> baseVersionKeys = this.baseVersionKeys.get();
SessionCache systemSession = session.createSystemCache(false); SystemContent systemContent = new SystemContent(systemSession);
SessionCache systemSession = session.createSystemCache(false); SystemContent systemContent = new SystemContent(systemSession);