Search in sources :

Example 1 with ReferenceEncodingException

use of org.alfresco.repo.virtual.ref.ReferenceEncodingException in project alfresco-repository by Alfresco.

the class GetPathMethod method execute.

@Override
public Path execute(VirtualProtocol virtualProtocol, Reference reference) throws ProtocolMethodException {
    try {
        NodeRef actualNodeRef = reference.execute(new GetActualNodeRefMethod(environment));
        Path path = null;
        if (actualNodeRef == null) {
            // Although not a feature yet, pure-virtual-references should
            // use an empty path as root since pure-virtual-references have
            // no actual peer to use.
            path = new Path();
        } else {
            path = environment.getPath(actualNodeRef);
        }
        Path virtualPath = smartStore.getPath(reference);
        return path.append(virtualPath);
    } catch (ReferenceEncodingException e) {
        throw new ProtocolMethodException(e);
    }
}
Also used : Path(org.alfresco.service.cmr.repository.Path) NodeRef(org.alfresco.service.cmr.repository.NodeRef) ProtocolMethodException(org.alfresco.repo.virtual.ref.ProtocolMethodException) ReferenceEncodingException(org.alfresco.repo.virtual.ref.ReferenceEncodingException) GetActualNodeRefMethod(org.alfresco.repo.virtual.ref.GetActualNodeRefMethod)

Aggregations

GetActualNodeRefMethod (org.alfresco.repo.virtual.ref.GetActualNodeRefMethod)1 ProtocolMethodException (org.alfresco.repo.virtual.ref.ProtocolMethodException)1 ReferenceEncodingException (org.alfresco.repo.virtual.ref.ReferenceEncodingException)1 NodeRef (org.alfresco.service.cmr.repository.NodeRef)1 Path (org.alfresco.service.cmr.repository.Path)1