jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ruchi goel (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-910) jcr mapping layer does not expose node move and node copy via PersistenceManager.java
Date Thu, 10 May 2007 09:46:15 GMT

    [ https://issues.apache.org/jira/browse/JCR-910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12494690
] 

ruchi goel commented on JCR-910:
--------------------------------

Recommended fix for this issue  : Kindly review .

Add following methods in PersistenceManager.java :

 public void move(String srcPath, String destPath) throws PersistenceException;
    
 public void copy(String srcPath, String destPath) throws PersistenceException;


Add following methods in PersistenceManagerImpl.java
import javax.jcr.Workspace;
 /* added by ruchi */
    public void move(String srcPath, String destPath){
        Workspace workspace = session.getWorkspace();
        try{
            workspace.move(srcPath,destPath);
        }catch(javax.jcr.nodetype.ConstraintViolationException cve){
            throw new PersistenceException(
                    "Cannot move the node from  " + srcPath + " to " + destPath + "." +  "
Violation of a nodetype or attempt to move under a property detected", cve);
            
        }catch(javax.jcr.version.VersionException ve){
            throw new VersionException(
                    "Cannot move the node from " + srcPath + " to " + destPath + "." + " Parent
node of source or destination is versionable and checked in ", ve);
            
        }catch(javax.jcr.AccessDeniedException ade){
            throw new PersistenceException(
                    "Cannot move the node from " + srcPath +  " to " + destPath + "." + "
Session does not have access permissions", ade);
            
        }catch(javax.jcr.PathNotFoundException pnf){
            throw new PersistenceException(
                    "Cannot move the node from " + srcPath + " to " + destPath + "." + " Node
at source or destination does not exist ", pnf);
            
        }catch(javax.jcr.ItemExistsException ie){
            throw new PersistenceException(
                    "Cannot move the node from " + srcPath + " to " + destPath + "." +  "
It might already exist at destination path.", ie);
            
        }catch(javax.jcr.lock.LockException le){
            throw new PersistenceException(
                    "Cannot move the node from " + srcPath + " to " + destPath + "." +  "Violation
of a lock detected", le);
            
        }catch(javax.jcr.RepositoryException re){
            throw new org.apache.portals.graffito.jcr.exception.RepositoryException(
                    "Cannot move the node from " + srcPath + " to " + destPath + "." , re);
        }
    }
    /* added by ruchi */
     public void copy(String srcPath, String destPath){
        Workspace workspace = session.getWorkspace();
        try{
            workspace.copy(srcPath,destPath);
        }catch(javax.jcr.nodetype.ConstraintViolationException cve){
            throw new PersistenceException(
                    "Cannot copy the node from " + srcPath + " to " + destPath + "." +  "Violation
of a nodetype or attempt to copy under property detected ", cve);
            
        }catch(javax.jcr.version.VersionException ve){
            throw new VersionException(
                    "Cannot copy the node from " + srcPath + " to " + destPath + "." + "Parent
node of source or destination is versionable and checked in ", ve);
            
        }catch(javax.jcr.AccessDeniedException ade){
            throw new PersistenceException(
                    "Cannot copy the node from " + srcPath + " to " + destPath + "." + " Session
does not have access permissions", ade);
            
        }catch(javax.jcr.PathNotFoundException pnf){
            throw new PersistenceException(
                    "Cannot copy the node from " + srcPath + " to " + destPath + "." + "Node
at source or destination does not exist ", pnf);
            
        }catch(javax.jcr.ItemExistsException ie){
            throw new PersistenceException(
                    "Cannot copy the node from " + srcPath + " to " + destPath + "." +  "It
might already exist at destination path.", ie);
            
        }catch(javax.jcr.lock.LockException le){
            throw new PersistenceException(
                    "Cannot copy the node from " + srcPath + " to " + destPath + "." +  "Violation
of a lock detected", le);
            
        }catch(javax.jcr.RepositoryException re){
            throw new org.apache.portals.graffito.jcr.exception.RepositoryException(
                    "Cannot copy the node from " + srcPath + " to " + destPath + "." , re);
        }
    } 

> jcr mapping layer does not expose node move and node copy via PersistenceManager.java
> -------------------------------------------------------------------------------------
>
>                 Key: JCR-910
>                 URL: https://issues.apache.org/jira/browse/JCR-910
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jcr-mapping
>    Affects Versions: 1.3
>            Reporter: ruchi goel
>
> The PersistenceManagerImpl.java  in jcr-apping layer does not implement move and copy
methods for a node.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message