//[DebuggerStepThrough()] public static Content GetContentByPath(string documentPath) { Content lResult = null; try { var spacesStore = new ContentWebService.Store(); spacesStore.scheme = ContentWebService.StoreEnum.workspace; spacesStore.address = Constants.SPACES_STORE; var reference = new ContentWebService.Reference(); reference.store = spacesStore; reference.path = PathUtils.ConvertToRepositoryPath(documentPath); var predicate = new ContentWebService.Predicate(); predicate.Items = new Object[] { reference }; Content[] contents = WebServiceFactory.getContentService().read(predicate, "{http://www.alfresco.org/model/content/1.0}content"); if (contents.Length != 0) { lResult = contents[0]; } } catch (SoapException ex) { if (ex.Detail.InnerText.Contains("Node does not exist")) { throw new NotFoundDocumentException(ErrorMessages.NoData, documentPath, ErrorMessages.DocumentNotFound); } //else // throw ex; } return(lResult); }
//[DebuggerStepThrough()] public static Content GetContentByPath(string documentPath) { Content lResult = null; try { var spacesStore = new ContentWebService.Store(); spacesStore.scheme = ContentWebService.StoreEnum.workspace; spacesStore.address = Constants.SPACES_STORE; var reference = new ContentWebService.Reference(); reference.store = spacesStore; reference.path = PathUtils.ConvertToRepositoryPath(documentPath); var predicate = new ContentWebService.Predicate(); predicate.Items = new Object[] { reference }; Content[] contents = WebServiceFactory.getContentService().read(predicate, "{http://www.alfresco.org/model/content/1.0}content"); if (contents.Length != 0) { lResult = contents[0]; } } catch (SoapException ex) { if (ex.Detail.InnerText.Contains("Node does not exist")) throw new NotFoundDocumentException(ErrorMessages.NoData, documentPath, ErrorMessages.DocumentNotFound); //else // throw ex; } return lResult; }