Пример #1
0
 public IntelligentSearchController(
     IWebUtilWrapper webUtil,
     ISitecoreDataWrapper dataWrapper,
     IIntelligentSearchSettings settings,
     ISearchService searcher,
     ILuisService luisService,
     ILuisConversationService luisConversationService,
     IAutoSuggestService autoSuggestService,
     ISpeechService speechService,
     IWebSearchService webSearchService,
     IConversationContextFactory conversationContextFactory,
     IMicrosoftCognitiveServicesApiKeys apiKeys)
 {
     WebUtil                    = webUtil;
     DataWrapper                = dataWrapper;
     Settings                   = settings;
     Searcher                   = searcher;
     LuisService                = luisService;
     LuisConversationService    = luisConversationService;
     AutoSuggestService         = autoSuggestService;
     SpeechService              = speechService;
     WebSearchService           = webSearchService;
     ConversationContextFactory = conversationContextFactory;
     ApiKeys                    = apiKeys;
 }
Пример #2
0
        public CognitiveImageSearchController(
            IImageSearchService searchService,
            ICognitiveImageSearchContext searcher,
            ISitecoreDataWrapper dataWrapper,
            IWebUtilWrapper webUtil,
            ICognitiveImageSearchFactory msFactory,
            ISetAltTagsAllFactory satarFactory,
            ICognitiveImageAnalysisFactory iaFactory,
            IReanalyzeAllFactory pFactory)
        {
            Assert.IsNotNull(searchService, typeof(IImageSearchService));
            Assert.IsNotNull(searcher, typeof(ICognitiveImageSearchContext));
            Assert.IsNotNull(dataWrapper, typeof(ISitecoreDataWrapper));
            Assert.IsNotNull(webUtil, typeof(IWebUtilWrapper));
            Assert.IsNotNull(msFactory, typeof(ICognitiveImageSearchFactory));
            Assert.IsNotNull(satarFactory, typeof(ISetAltTagsAllFactory));
            Assert.IsNotNull(iaFactory, typeof(ICognitiveImageAnalysisFactory));
            Assert.IsNotNull(pFactory, typeof(IReanalyzeAllFactory));

            SearchService        = searchService;
            Searcher             = searcher;
            DataWrapper          = dataWrapper;
            WebUtil              = webUtil;
            MediaSearchFactory   = msFactory;
            SetAltTagsAllFactory = satarFactory;
            ImageAnalysisFactory = iaFactory;
            ReanalyzeAllFactory  = pFactory;
        }
        public IntelligentTaggingController(
            IWebUtilWrapper webUtil,
            ISitecoreDataWrapper dataWrapper,
            IIntelligentTaggingSettings settings,
            ISetupInformationFactory setupFactory,
            ISetupService setupService,
            IContentSearchWrapper contentSearch,
            INaturalLanguageClassifierService naturalLanguageClassifier,
            IContentService contentService,
            IContentSearchService contentSearchService,
            IClassifierFactory classifierFactory)
        {
            WebUtil                   = webUtil;
            DataWrapper               = dataWrapper;
            Settings                  = settings;
            SetupFactory              = setupFactory;
            SetupService              = setupService;
            ContentSearch             = contentSearch;
            NaturalLanguageClassifier = naturalLanguageClassifier;
            ContentService            = contentService;
            ContentSearchService      = contentSearchService;
            ClassifierFactory         = classifierFactory;

            Id       = WebUtil.GetQueryString("id");
            Language = WebUtil.GetQueryString("language");
            Database = WebUtil.GetQueryString("db");
        }
 public ImageSearchRepository(
     IApiKeys apiKeys,
     IWebUtilWrapper webUtil,
     IRepositoryClient repoClient)
     : base(apiKeys.BingSearch)
 {
     WebUtil          = webUtil;
     RepositoryClient = repoClient;
 }
Пример #5
0
 public void Setup()
 {
     SearchService        = Substitute.For <IImageSearchService>();
     Searcher             = Substitute.For <ICognitiveImageSearchContext>();
     DataWrapper          = Substitute.For <ISitecoreDataWrapper>();
     WebUtil              = Substitute.For <IWebUtilWrapper>();
     MediaSearchFactory   = Substitute.For <ICognitiveImageSearchFactory>();
     SetAltTagsAllFactory = Substitute.For <ISetAltTagsAllFactory>();
     ImageAnalysisFactory = Substitute.For <ICognitiveImageAnalysisFactory>();
     ReanalyzeAllFactory  = Substitute.For <IReanalyzeAllFactory>();
 }
Пример #6
0
        public OleChatController(
            ILuisService luisService,
            ILuisConversationService luisConversationService,
            IWebUtilWrapper webUtil,
            ISitecoreDataWrapper dataWrapper,
            IOleSettings chatSettings,
            ISetupInformationFactory setupFactory,
            ISetupService setupService,
            ISpeechService speechService,
            ISearchService searcher,
            IConversationContextFactory conversationContextFactory,
            ISpellCheckService spellCheckService,
            IIntentProvider intentProvider)
        {
            LuisService             = luisService;
            LuisConversationService = luisConversationService;
            WebUtil       = webUtil;
            DataWrapper   = dataWrapper;
            ChatSettings  = chatSettings;
            SetupFactory  = setupFactory;
            SetupService  = setupService;
            SpeechService = speechService;
            Searcher      = searcher;
            ConversationContextFactory = conversationContextFactory;
            SpellCheckService          = spellCheckService;
            IntentProvider             = intentProvider;
            ThemeManager.GetImage("Office/32x32/man_8.png", 32, 32);

            var lang = WebUtil.GetQueryString("language");

            if (string.IsNullOrWhiteSpace(lang))
            {
                lang = Sitecore.Context.Language.Name;
            }

            var db = WebUtil.GetQueryString("db");

            if (string.IsNullOrWhiteSpace(db))
            {
                db = "master";
            }

            Parameters = new ItemContextParameters()
            {
                Id       = WebUtil.GetQueryString("id"),
                Language = lang,
                Database = db
            };
        }
Пример #7
0
        public CognitiveMediaSearchController(
            ICognitiveSearchContext searcher,
            ISitecoreDataService dataService,
            IWebUtilWrapper webUtil,
            ICognitiveMediaSearchFactory msFactory)
        {
            Assert.IsNotNull(searcher, typeof(ICognitiveSearchContext));
            Assert.IsNotNull(dataService, typeof(ISitecoreDataService));
            Assert.IsNotNull(webUtil, typeof(IWebUtilWrapper));
            Assert.IsNotNull(msFactory, typeof(ICognitiveMediaSearchFactory));

            Searcher           = searcher;
            DataService        = dataService;
            WebUtil            = webUtil;
            MediaSearchFactory = msFactory;
        }
        public CognitiveBotController(
            IConversationService conversationService,
            IWebUtilWrapper webUtil)
        {
            ConversationService = conversationService;
            WebUtil             = webUtil;

            Parameters = new ItemContextParameters()
            {
                Id       = WebUtil.GetQueryString("id"),
                Language = WebUtil.GetQueryString("language"),
                Database = WebUtil.GetQueryString("db")
            };

            ThemeManager.GetImage("Office/32x32/man_8.png", 32, 32);
        }
Пример #9
0
        public IntelligentMediaController(
            IIntelligentMediaSearchService searchService,
            ISitecoreDataWrapper dataWrapper,
            IWebUtilWrapper webUtil,
            IImageSearchFactory msFactory,
            ISetAltTagsAllFactory satarFactory,
            IImageAnalysisService analysisService,
            IJobResultFactory jobResultFactory,
            ISetupInformationFactory setupFactory,
            ISetupService setupService,
            IIntelligentMediaSettings searchSettings,
            IFaceService faceService,
            IPersonGroupService personGroupService,
            IComputerVisionService computerVisionService,
            IMediaWrapper mediaWrapper)
        {
            Assert.IsNotNull(searchService, typeof(IIntelligentMediaSearchService));
            Assert.IsNotNull(dataWrapper, typeof(ISitecoreDataWrapper));
            Assert.IsNotNull(webUtil, typeof(IWebUtilWrapper));
            Assert.IsNotNull(msFactory, typeof(IImageSearchFactory));
            Assert.IsNotNull(satarFactory, typeof(ISetAltTagsAllFactory));
            Assert.IsNotNull(analysisService, typeof(IImageAnalysisService));
            Assert.IsNotNull(jobResultFactory, typeof(IJobResultFactory));
            Assert.IsNotNull(setupFactory, typeof(ISetupInformationFactory));
            Assert.IsNotNull(setupService, typeof(ISetupService));
            Assert.IsNotNull(searchSettings, typeof(IIntelligentMediaSettings));
            Assert.IsNotNull(faceService, typeof(IFaceService));
            Assert.IsNotNull(personGroupService, typeof(IPersonGroupService));
            Assert.IsNotNull(computerVisionService, typeof(IComputerVisionService));
            Assert.IsNotNull(mediaWrapper, typeof(IMediaWrapper));

            SearchService         = searchService;
            DataWrapper           = dataWrapper;
            WebUtil               = webUtil;
            MediaSearchFactory    = msFactory;
            SetAltTagsAllFactory  = satarFactory;
            AnalysisService       = analysisService;
            JobResultFactory      = jobResultFactory;
            SetupFactory          = setupFactory;
            SetupService          = setupService;
            SearchSettings        = searchSettings;
            FaceService           = faceService;
            PersonGroupService    = personGroupService;
            ComputerVisionService = computerVisionService;
            MediaWrapper          = mediaWrapper;
        }
        public void Setup()
        {
            SearchService           = Substitute.For <IIntelligentMediaSearchService>();
            DataWrapper             = Substitute.For <ISitecoreDataWrapper>();
            WebUtil                 = Substitute.For <IWebUtilWrapper>();
            MediaSearchFactory      = Substitute.For <IImageSearchFactory>();
            SetAltTagsAllFactory    = Substitute.For <ISetAltTagsAllFactory>();
            ImageAnalysisFactory    = Substitute.For <IImageAnalysisFactory>();
            ImageAnalysisService    = Substitute.For <IImageAnalysisService>();
            JobResultFactory        = Substitute.For <IJobResultFactory>();
            SetupInformationFactory = Substitute.For <ISetupInformationFactory>();
            Settings                = Substitute.For <IIntelligentMediaSettings>();
            SetupService            = Substitute.For <ISetupService>();

            User u = User.FromName("sitecore\\name", true);

            DataWrapper.ContextUser.Returns(u);
        }
        public CognitiveImageSearchController(
            IImageSearchService searchService,
            ISitecoreDataWrapper dataWrapper,
            IWebUtilWrapper webUtil,
            ICognitiveImageSearchFactory msFactory,
            ISetAltTagsAllFactory satarFactory,
            IAnalyzeAllFactory pFactory,
            IImageAnalysisService analysisService,
            IAnalysisJobResultFactory jobResultFactory,
            ISetupInformationFactory setupFactory,
            ISetupService setupService,
            IImageSearchSettings searchSettings)
        {
            Assert.IsNotNull(searchService, typeof(IImageSearchService));
            Assert.IsNotNull(dataWrapper, typeof(ISitecoreDataWrapper));
            Assert.IsNotNull(webUtil, typeof(IWebUtilWrapper));
            Assert.IsNotNull(msFactory, typeof(ICognitiveImageSearchFactory));
            Assert.IsNotNull(satarFactory, typeof(ISetAltTagsAllFactory));
            Assert.IsNotNull(pFactory, typeof(IAnalyzeAllFactory));
            Assert.IsNotNull(analysisService, typeof(IImageAnalysisService));
            Assert.IsNotNull(jobResultFactory, typeof(IAnalysisJobResultFactory));
            Assert.IsNotNull(setupFactory, typeof(ISetupInformationFactory));
            Assert.IsNotNull(setupService, typeof(ISetupService));
            Assert.IsNotNull(searchSettings, typeof(IImageSearchSettings));

            SearchService        = searchService;
            DataWrapper          = dataWrapper;
            WebUtil              = webUtil;
            MediaSearchFactory   = msFactory;
            SetAltTagsAllFactory = satarFactory;
            AnalyzeAllFactory    = pFactory;
            AnalysisService      = analysisService;
            JobResultFactory     = jobResultFactory;
            SetupFactory         = setupFactory;
            SetupService         = setupService;
            SearchSettings       = searchSettings;
        }
        public CognitiveOleChatController(
            IConversationService conversationService,
            IWebUtilWrapper webUtil,
            ISitecoreDataWrapper dataWrapper,
            IOleSettings chatSettings,
            ISetupInformationFactory setupFactory,
            ISetupService setupService)
        {
            ConversationService = conversationService;
            WebUtil             = webUtil;
            DataWrapper         = dataWrapper;
            ChatSettings        = chatSettings;
            SetupFactory        = setupFactory;
            SetupService        = setupService;

            Parameters = new ItemContextParameters()
            {
                Id       = WebUtil.GetQueryString("id"),
                Language = WebUtil.GetQueryString("language"),
                Database = WebUtil.GetQueryString("db")
            };

            ThemeManager.GetImage("Office/32x32/man_8.png", 32, 32);
        }