Package javax.jcr

Examples of javax.jcr.UnsupportedRepositoryOperationException


         throw new AccessDeniedException("Access denied: restore operation " + getPath() + " for: "
            + session.getUserID() + " item owner " + getACL().getOwner());
      }

      if (!this.isNodeType(Constants.MIX_VERSIONABLE))
         throw new UnsupportedRepositoryOperationException("Node is not versionable " + getPath());

      if (session.hasPendingChanges())
         throw new InvalidItemStateException("Session has pending changes ");

      if (((VersionImpl)version).getInternalName().equals(Constants.JCR_ROOTVERSION))
View Full Code Here


            if (!destNode.isNode())
               throw new ConstraintViolationException("Item at relPath is not a node " + destNode.getPath());

            if (!destNode.isNodeType(Constants.MIX_VERSIONABLE))
               throw new UnsupportedRepositoryOperationException("Node at relPath is not versionable "
                  + destNode.getPath());

            if (!destNode.versionHistory(false).isVersionBelongToThis(version))
               throw new VersionException("Bad version " + version.getPath());
View Full Code Here

      RepositoryException
   {

      if (!this.isNodeType(Constants.MIX_VERSIONABLE))
      {
         throw new UnsupportedRepositoryOperationException("Node is not mix:versionable " + getPath());
      }

      PropertyData vhProp =
         (PropertyData)dataManager.getItemData(nodeData(), new QPathEntry(Constants.JCR_VERSIONHISTORY, 1),
            ItemType.PROPERTY);
      if (vhProp == null)
         throw new UnsupportedRepositoryOperationException("Node does not have jcr:versionHistory " + getPath());

      try
      {
         return (VersionHistoryImpl)dataManager.getItemByIdentifier(new String(vhProp.getValues().get(0)
            .getAsByteArray()), pool, false);
View Full Code Here

   protected void doOrderBefore(QPath srcPath, QPath destPath) throws RepositoryException
   {
      if (!getPrimaryNodeType().hasOrderableChildNodes())
      {
         throw new UnsupportedRepositoryOperationException("child node ordering not supported on node " + getPath());
      }

      if (srcPath.equals(destPath))
      {
         return;
      }

      // check existence
      if (dataManager.getItemData(srcPath) == null)
      {
         throw new ItemNotFoundException(getPath() + " has no child node with name " + srcPath.getName().getAsString());
      }

      if (destPath != null && dataManager.getItemData(destPath) == null)
      {

         throw new ItemNotFoundException(getPath() + " has no child node with name " + destPath.getName().getAsString());
      }

      if (!checkedOut())
      {
         throw new VersionException(" cannot change child node ordering of a checked-in node ");
      }

      if (destPath != null && srcPath.getDepth() != destPath.getDepth())
      {
         throw new ItemNotFoundException("Source and destenation is not relative paths of depth one, "
            + "i.e. is not a childs of same parent node");
      }

      List<NodeData> siblings = new ArrayList<NodeData>(dataManager.getChildNodesData(nodeData()));
      if (siblings.size() < 2)
      {
         throw new UnsupportedRepositoryOperationException("Nothing to order Count of child nodes " + siblings.size());
      }

      Collections.sort(siblings, new NodeDataOrderComparator());

      // calculating source and destination position
View Full Code Here

         throw new AccessDeniedException("Access denied: checkin operation " + getPath() + " for: "
            + session.getUserID() + " item owner " + getACL().getOwner());
      }

      if (!this.isNodeType(Constants.MIX_VERSIONABLE))
         throw new UnsupportedRepositoryOperationException(
            "Node.checkin() is not supported for not mix:versionable node ");

      if (!this.checkedOut())
      {
         return (Version)dataManager.getItemByIdentifier(property(Constants.JCR_BASEVERSION).getString(), false);
View Full Code Here

         throw new AccessDeniedException("Access denied: checkout operation " + getPath() + " for: "
            + session.getUserID() + " item owner " + getACL().getOwner());
      }

      if (!this.isNodeType(Constants.MIX_VERSIONABLE))
         throw new UnsupportedRepositoryOperationException(
            "Node.checkout() is not supported for not mix:versionable node ");

      if (!checkLocking())
         throw new LockException("Node " + getPath() + " is locked ");
     
View Full Code Here

   {

      checkValid();

      if (!this.isNodeType(Constants.MIX_VERSIONABLE))
         throw new UnsupportedRepositoryOperationException("Node is not versionable " + getPath());

      PropertyData bvProp =
         (PropertyData)dataManager.getItemData(nodeData(), new QPathEntry(Constants.JCR_BASEVERSION, 1),
            ItemType.PROPERTY);
      try
View Full Code Here

      if (isNodeType(Constants.MIX_REFERENCEABLE))
      {
         return this.getInternalIdentifier();
      }

      throw new UnsupportedRepositoryOperationException("Node " + getPath() + " is not referenceable");

   }
View Full Code Here

   {

      checkValid();

      if (!getPrimaryNodeType().hasOrderableChildNodes())
         throw new UnsupportedRepositoryOperationException("Node does not support child ordering "
            + getPrimaryNodeType().getName());

      JCRPath sourcePath = locationFactory.createJCRPath(getLocation(), srcName);
      JCRPath destenationPath = destName != null ? locationFactory.createJCRPath(getLocation(), destName) : null;
      QPath srcPath = sourcePath.getInternalPath();
View Full Code Here

         throw new AccessDeniedException("Access denied: restore operation " + getPath() + " for: "
            + session.getUserID() + " item owner " + getACL().getOwner());
      }

      if (!this.isNodeType(Constants.MIX_VERSIONABLE))
         throw new UnsupportedRepositoryOperationException("Node is not versionable " + getPath());

      if (session.hasPendingChanges())
         throw new InvalidItemStateException("Session has pending changes ");

      if (((VersionImpl)version).getInternalName().equals(Constants.JCR_ROOTVERSION))
View Full Code Here

TOP

Related Classes of javax.jcr.UnsupportedRepositoryOperationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.