예제 #1
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);
        }