示例#1
0
 public string GetDictionaryEntryByXmlId(string bookId, string versionId, string xmlEntryId,
                                         string transformationName, OutputFormatEnumContract outputFormat,
                                         ResourceLevelEnumContract transformationLevel)
 {
     return(m_existManager.GetDictionaryEntryByXmlId(bookId, versionId, xmlEntryId, transformationName, outputFormat,
                                                     transformationLevel));
 }
示例#2
0
 public string GetEditionPageFromSearch(IList <SearchCriteriaContract> searchCriterias, string bookId, string versionId, string pageXmlId, string transformationName,
                                        OutputFormatEnumContract outputFormat, ResourceLevelEnumContract transformationLevel)
 {
     return(m_existManager.GetEditionPageFromSearch(searchCriterias, bookId, versionId, pageXmlId,
                                                    transformationName, outputFormat,
                                                    transformationLevel));
 }
示例#3
0
 public string GetBookPagesByName(string bookId, string versionId, string startPageName, string endPageName,
                                  string transformationName, OutputFormatEnumContract outputFormat,
                                  ResourceLevelEnumContract transformationLevel)
 {
     return(m_searchServiceManager.GetBookPagesByName(bookId, versionId, startPageName, endPageName,
                                                      transformationName, outputFormat, transformationLevel));
 }
示例#4
0
 public string GetEditionPageFromSearch(IList <SearchCriteriaContract> searchCriterias, string bookXmlId, string versionId, string pageXmlId,
                                        string transformationName, OutputFormatEnumContract outputFormat, ResourceLevelEnumContract transformationLevel)
 {
     try
     {
         return(Channel.GetEditionPageFromSearch(searchCriterias, bookXmlId, versionId, pageXmlId, transformationName, outputFormat, transformationLevel));
     }
     catch (CommunicationException ex)
     {
         if (m_log.IsErrorEnabled)
         {
             m_log.ErrorFormat("{0} failed with: {1}", GetCurrentMethod(), ex);
         }
         throw;
     }
     catch (TimeoutException ex)
     {
         if (m_log.IsErrorEnabled)
         {
             m_log.ErrorFormat("{0} failed with: {1}", GetCurrentMethod(), ex);
         }
         throw;
     }
     catch (ObjectDisposedException ex)
     {
         if (m_log.IsErrorEnabled)
         {
             m_log.ErrorFormat("{0} failed with: {1}", GetCurrentMethod(), ex);
         }
         throw;
     }
 }
示例#5
0
 public string GetDictionaryEntryByXmlId(string bookId, string versionId, string xmlEntryId, string transformationName,
                                         OutputFormatEnumContract outputFormat, ResourceLevelEnumContract transformationLevel)
 {
     try
     {
         return(Channel.GetDictionaryEntryByXmlId(bookId, versionId, xmlEntryId, transformationName, outputFormat, transformationLevel));
     }
     catch (CommunicationException ex)
     {
         if (m_log.IsErrorEnabled)
         {
             m_log.ErrorFormat("{0} failed with: {1}", GetCurrentMethod(), ex);
         }
         throw;
     }
     catch (TimeoutException ex)
     {
         if (m_log.IsErrorEnabled)
         {
             m_log.ErrorFormat("{0} failed with: {1}", GetCurrentMethod(), ex);
         }
         throw;
     }
     catch (ObjectDisposedException ex)
     {
         if (m_log.IsErrorEnabled)
         {
             m_log.ErrorFormat("{0} failed with: {1}", GetCurrentMethod(), ex);
         }
         throw;
     }
 }
示例#6
0
        public string GetPageByXmlId(string bookId, string versionId, string pageXmlId, string transformationName,
                                     OutputFormatEnumContract outputFormat, ResourceLevelEnumContract transformationLevel)
        {
            var xslPath = m_existResourceManager.GetTransformationUri(transformationName, outputFormat,
                                                                      transformationLevel, bookId, versionId);

            return(m_communicationManager.GetPageByXmlId(bookId, versionId, pageXmlId,
                                                         Enum.GetName(typeof(OutputFormatEnumContract), outputFormat), xslPath));
        }
示例#7
0
 public string GetBookPageByXmlId(string bookId, string versionId, string pageXmlId, string transformationName,
                                  OutputFormatEnumContract outputFormat, ResourceLevelEnumContract transformationLevel)
 {
     if (m_log.IsDebugEnabled)
     {
         m_log.DebugFormat("SearchService request recieved...");
     }
     return(m_searchServiceManager.GetBookPageByXmlId(bookId, versionId, pageXmlId, transformationName,
                                                      outputFormat, transformationLevel));
 }
示例#8
0
        public string GetTransformationUri(string transformationName, OutputFormatEnumContract outputFormat, ResourceLevelEnumContract transformationLevel,
                                           string bookGuid, string bookVersion)
        {
            switch (transformationLevel)
            {
            case ResourceLevelEnumContract.Book:
                return(string.Format("{0}{1}/{2}", m_existSettings.BooksRelativeUri, Uri.EscapeUriString(bookGuid), transformationName));

            case ResourceLevelEnumContract.Version:
                return(string.Format("{0}{1}/{2}/{3}", m_existSettings.BooksRelativeUri, Uri.EscapeUriString(bookGuid), bookVersion,
                                     transformationName));

            case ResourceLevelEnumContract.Shared:
                return(string.Format("{0}/{1}", m_existSettings.TransformationRelativeUri, transformationName));

            default:
                return("");
            }
        }
示例#9
0
        public string GetBookPageByXmlId(string bookGuid, string pageXmlId, OutputFormatEnumContract resultFormat,
                                         BookTypeEnumContract bookTypeContract)
        {
            if (m_log.IsDebugEnabled)
            {
                m_log.DebugFormat("Start MainService (BookManager) get page xmlId '{0}' of book '{1}'", pageXmlId,
                                  bookGuid);
            }

            m_authorizationManager.AuthorizeBook(bookGuid);

            OutputFormat outputFormat;

            if (!Enum.TryParse(resultFormat.ToString(), true, out outputFormat))
            {
                throw new ArgumentException(string.Format("Result format : '{0}' unknown", resultFormat));
            }

            BookTypeEnum bookType;

            if (!Enum.TryParse(bookTypeContract.ToString(), true, out bookType))
            {
                throw new ArgumentException(string.Format("Book type : '{0}' unknown", bookTypeContract));
            }

            var bookVersion         = m_bookRepository.GetLastVersionForBookWithType(bookGuid);
            var transformation      = m_bookRepository.FindTransformation(bookVersion, outputFormat, bookType);
            var transformationName  = transformation.Name;
            var transformationLevel = (ResourceLevelEnumContract)transformation.ResourceLevel;
            var pageText            = m_searchServiceClient.GetBookPageByXmlId(bookGuid, bookVersion.VersionId, pageXmlId,
                                                                               transformationName, resultFormat, transformationLevel);

            if (m_log.IsDebugEnabled)
            {
                m_log.DebugFormat("End MainService (BookManager) get page xmlId '{0}' of book '{1}'", pageXmlId,
                                  bookGuid);
            }

            return(pageText);
        }
示例#10
0
        public string GetDictionaryEntryByXmlId(string bookGuid, string xmlEntryId,
                                                OutputFormatEnumContract resultFormat, BookTypeEnumContract bookTypeContract)
        {
            m_authorizationManager.AuthorizeBook(bookGuid);

            OutputFormat outputFormat;

            if (!Enum.TryParse(resultFormat.ToString(), true, out outputFormat))
            {
                throw new ArgumentException(string.Format("Result format : '{0}' unknown", resultFormat));
            }

            var bookType            = Mapper.Map <BookTypeEnum>(bookTypeContract);
            var bookVersion         = m_bookRepository.GetLastVersionForBookWithType(bookGuid);
            var transformation      = m_bookRepository.FindTransformation(bookVersion, outputFormat, bookType);
            var transformationName  = transformation.Name;
            var transformationLevel = (ResourceLevelEnumContract)transformation.ResourceLevel;
            var dictionaryEntryText = m_searchServiceClient.GetDictionaryEntryByXmlId(bookGuid, bookVersion.VersionId,
                                                                                      xmlEntryId, transformationName, resultFormat, transformationLevel);

            return(dictionaryEntryText);
        }
示例#11
0
        public string GetBookEditionNote(long bookId, OutputFormatEnumContract resultFormat)
        {
            m_authorizationManager.AuthorizeBook(bookId);

            OutputFormat outputFormat;

            if (!Enum.TryParse(resultFormat.ToString(), true, out outputFormat))
            {
                throw new ArgumentException(string.Format("Result format : '{0}' unknown", resultFormat));
            }

            var book                = m_bookRepository.FindBookById(bookId);
            var bookVersion         = m_bookRepository.GetLastVersionForBookByBookId(bookId);
            var bookType            = m_bookVersionRepository.GetBookTypeByBookVersionId(bookVersion.Id);
            var transformation      = m_bookRepository.FindTransformation(bookVersion, outputFormat, bookType.Type);
            var transformationName  = transformation.Name;
            var transformationLevel = (ResourceLevelEnumContract)transformation.ResourceLevel;

            var editionNoteText = m_searchServiceClient.GetBookEditionNote(book.Guid, bookVersion.VersionId,
                                                                           transformationName, resultFormat, transformationLevel);

            return(editionNoteText);
        }
示例#12
0
        public string GetEditionPageFromSearch(IEnumerable <SearchCriteriaContract> searchCriterias, string bookXmlId, string pageXmlId,
                                               OutputFormatEnumContract resultFormat)
        {
            var criterias = searchCriterias.ToList();

            m_authorizationManager.AuthorizeCriteria(criterias);

            OutputFormat outputFormat;

            if (!Enum.TryParse(resultFormat.ToString(), true, out outputFormat))
            {
                throw new ArgumentException(string.Format("Result format : '{0}' unknown", resultFormat));
            }

            var bookVersion    = m_bookRepository.GetLastVersionForBookWithType(bookXmlId);
            var transformation = m_bookRepository.FindTransformation(bookVersion, outputFormat,
                                                                     bookVersion.DefaultBookType.Type); //TODO add bookType as method parameter
            var transformationName  = transformation.Name;
            var transformationLevel = (ResourceLevelEnumContract)transformation.ResourceLevel;
            var pageText            = m_searchServiceClient.GetEditionPageFromSearch(criterias,
                                                                                     bookXmlId, bookVersion.VersionId, pageXmlId, transformationName, resultFormat, transformationLevel);

            return(pageText);
        }
示例#13
0
        public string GetDictionaryEntryFromSearch(List <SearchCriteriaContract> searchCriterias, string bookId, string versionId, string xmlEntryId, string transformationName, OutputFormatEnumContract outputFormat, ResourceLevelEnumContract transformationLevel)
        {
            var resultSearchConjunctions = new ResultConjunctionsCriteriaContract
            {
                ConjunctionSearchCriterias = GetFilteredResultSearchCriterias(searchCriterias).ConjunctionSearchCriterias
            };

            var xslPath = m_existResourceManager.GetTransformationUri(transformationName, outputFormat,
                                                                      transformationLevel, bookId, versionId);

            return(m_communicationManager.GetDictionaryEntryFromSearch(resultSearchConjunctions.ToXml(), bookId, versionId, xmlEntryId,
                                                                       Enum.GetName(typeof(OutputFormatEnumContract), outputFormat), xslPath));
        }
示例#14
0
 public string GetDictionaryEntryFromSearch(List <SearchCriteriaContract> searchCriterias, string bookId, string versionId, string xmlEntryId,
                                            string transformationName, OutputFormatEnumContract outputFormat, ResourceLevelEnumContract transformationLevel)
 {
     return(m_searchServiceManager.GetDictionaryEntryFromSearch(searchCriterias, bookId, versionId, xmlEntryId, transformationName, outputFormat, transformationLevel));
 }
示例#15
0
 public string GetBookPageByPosition(string bookId, string versionId, int pagePosition, string transformationName, OutputFormatEnumContract outputFormat, ResourceLevelEnumContract transformationLevel)
 {
     return(m_searchServiceManager.GetBookPageByPosition(bookId, versionId, pagePosition, transformationName, outputFormat, transformationLevel));
 }
示例#16
0
 public string GetDictionaryEntryByXmlId(string bookGuid, string xmlEntryId, OutputFormatEnumContract resultFormat, BookTypeEnumContract bookType)
 {
     return(m_bookManager.GetDictionaryEntryByXmlId(bookGuid, xmlEntryId, resultFormat, bookType));
 }
示例#17
0
 public string GetDictionaryEntryFromSearch(IEnumerable <SearchCriteriaContract> searchCriterias, string bookGuid, string xmlEntryId,
                                            OutputFormatEnumContract resultFormat, BookTypeEnumContract bookType)
 {
     return(m_searchManager.GetDictionaryEntryFromSearch(searchCriterias, bookGuid, xmlEntryId, resultFormat, bookType));
 }
示例#18
0
 public string GetBookEditionNote(string bookId, string versionId, string transformationName,
                                  OutputFormatEnumContract outputFormat, ResourceLevelEnumContract transformationLevel)
 {
     return(m_searchServiceManager.GetBookEditionNote(bookId, versionId, transformationName, outputFormat, transformationLevel));
 }
示例#19
0
 public string GetEditionPageFromSearch(IEnumerable <SearchCriteriaContract> searchCriterias, string bookXmlId,
                                        string pageXmlId, OutputFormatEnumContract resultFormat)
 {
     return(m_searchManager.GetEditionPageFromSearch(searchCriterias, bookXmlId, pageXmlId, resultFormat));
 }
示例#20
0
 public string GetBookPageByXmlId(string bookId, string versionId, string pageXmlId, string transformationName,
                                  OutputFormatEnumContract outputFormat, ResourceLevelEnumContract transformationLevel)
 {
     return(m_existManager.GetPageByXmlId(bookId, versionId, pageXmlId, transformationName, outputFormat,
                                          transformationLevel));
 }
示例#21
0
 public string GetBookEditionNote(long bookId, OutputFormatEnumContract outputFormat)
 {
     return(m_bookManager.GetBookEditionNote(bookId, outputFormat));
 }
示例#22
0
 public string GetBookPageByXmlId(string bookGuid, string pageXmlId, OutputFormatEnumContract resultFormat, BookTypeEnumContract bookTypeContract)
 {
     return(m_bookManager.GetBookPageByXmlId(bookGuid, pageXmlId, resultFormat, bookTypeContract));
 }