public static Guid ParseDocumentId(Guid libraryId, PageContext pageContext) { var tokenValue = pageContext.GetTokenValue("documentId"); if (tokenValue == null) { return(Guid.Empty); } var token = tokenValue.ToString(); var contentId = listItemDataService.GetItemUniqueId(token, libraryId); if (contentId == Guid.Empty) { contentId = listItemService.GetItemUniqueId(token, libraryId); } return(contentId); }