Beispiel #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;
 }
 public CognitiveImageAnalysisFactory(
     ISitecoreDataWrapper dataWrapper,
     IServiceProvider provider)
 {
     DataWrapper = dataWrapper;
     Provider    = provider;
 }
 public IBMWatsonApiKeys(
     ISitecoreDataWrapper dataWrapper,
     ISCSDKSettings settings)
 {
     DataWrapper = dataWrapper;
     Settings    = settings;
 }
Beispiel #4
0
 public CognitiveImage()
 {
     Class       = "scContentControlImage";
     Change      = "#";
     Activation  = true;
     DataWrapper = DependencyResolver.Current.GetService <ISitecoreDataWrapper>();
 }
        public virtual ICognitiveImageSearchJsonResult CreateMediaSearchJsonResult(ISitecoreDataWrapper dataWrapper, ICognitiveImageSearchResult searchResult)
        {
            var obj = Provider.GetService <ICognitiveImageSearchJsonResult>();

            MediaItem m = dataWrapper.GetItemByUri(searchResult.UniqueId);

            try
            {
                obj.Url = $"/sitecore/shell/-/media/{m.ID.Guid:N}.ashx";
            }
            catch (Exception ex)
            {
                obj.Url = string.Empty;
            }
            try
            {
                obj.Alt = m.Alt;
            }
            catch (Exception ex)
            {
                obj.Alt = string.Empty;
            }

            return(obj);
        }
        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");
        }
Beispiel #7
0
 public CognitiveImageSearchContext(
     ISitecoreDataWrapper dataWrapper,
     IImageSearchSettings imageSearchSettings)
 {
     DataWrapper         = dataWrapper;
     ImageSearchSettings = imageSearchSettings;
 }
 public IntelligentMediaSettings(
     ISitecoreDataWrapper dataWrapper,
     IMicrosoftCognitiveServicesApiKeys msApiKeys)
 {
     MSApiKeys   = msApiKeys;
     DataWrapper = dataWrapper;
 }
 public IntelligentTaggingSettings(
     ISitecoreDataWrapper dataWrapper,
     IIBMWatsonApiKeys ibmApiKeys)
 {
     IBMApiKeys  = ibmApiKeys;
     DataWrapper = dataWrapper;
 }
 public MicrosoftCognitiveServicesApiKeys(
     ISitecoreDataWrapper dataWrapper,
     ISCSDKSettings settings)
 {
     DataWrapper = dataWrapper;
     Settings    = settings;
 }
Beispiel #11
0
 public ContentSearchWrapper(
     ISitecoreDataWrapper dataWrapper,
     ISCSDKSettings applicationSettings)
 {
     DataWrapper         = dataWrapper;
     ApplicationSettings = applicationSettings;
 }
Beispiel #12
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 BlogCastController(
     ISitecoreDataWrapper dataWrapper,
     ISpeechService speechService)
 {
     DataWrapper   = dataWrapper;
     SpeechService = speechService;
 }
        public AssignGoalIntent(
            IOleSettings settings,
            ISitecoreDataWrapper dataWrapper,
            IIntentInputFactory inputFactory,
            IConversationResponseFactory responseFactory,
            IPublishWrapper publishWrapper,
            IParameterResultFactory resultFactory,
            IProfileService profileService) : base(inputFactory, responseFactory, settings)
        {
            DataWrapper    = dataWrapper;
            PublishWrapper = publishWrapper;
            ProfileService = profileService;

            var goalParameters = new Dictionary <string, string>
            {
                { Constants.SearchParameters.FilterPath, Constants.Paths.GoalPath },
                { Constants.SearchParameters.TemplateId, Constants.TemplateIds.GoalTemplateId.ToString() },
                { Constants.SearchParameters.AutoStart, "true" }
            };

            ConversationParameters.Add(new ItemParameter(GoalItemKey, Translator.Text("Chat.Intents.AssignGoal.GoalParameterRequest"), goalParameters, dataWrapper, inputFactory, resultFactory));
            var contentParameters = new Dictionary <string, string>
            {
                { Constants.SearchParameters.FilterPath, Constants.Paths.ContentPath }
            };

            ConversationParameters.Add(new ItemParameter(PageItemKey, Translator.Text("Chat.Intents.AssignGoal.PageParameterRequest"), contentParameters, dataWrapper, inputFactory, resultFactory));
        }
Beispiel #15
0
        public PublishIntent(
            IOleSettings settings,
            ISitecoreDataWrapper dataWrapper,
            IIntentInputFactory inputFactory,
            IConversationResponseFactory responseFactory,
            IPublishWrapper publishWrapper,
            IParameterResultFactory resultFactory) : base(inputFactory, responseFactory, settings)
        {
            DataWrapper    = dataWrapper;
            PublishWrapper = publishWrapper;

            ConversationParameters.Add(new RoleParameter(Translator.Text("Chat.Intents.Publish.RoleParameterWarning"), new List <string> {
                @"sitecore\Sitecore Client Publishing", @"sitecore\Sitecore Client Advanced Publishing"
            }, DataWrapper));
            var parameters = new Dictionary <string, string>
            {
                { Constants.SearchParameters.FilterPath, Constants.Paths.ContentPath }
            };

            ConversationParameters.Add(new ItemParameter(ItemKey, Translator.Text("Chat.Intents.Publish.ItemParameterRequest"), parameters, dataWrapper, inputFactory, resultFactory));
            ConversationParameters.Add(new LanguageParameter(LangKey, Translator.Text("Chat.Parameters.LangParameterRequest"), settings, dataWrapper, inputFactory, resultFactory));
            ConversationParameters.Add(new WorkflowParameter(ItemKey, LangKey, Translator.Text("Chat.Intents.Publish.WorkflowParameterWarning")));
            ConversationParameters.Add(new DatabaseParameter(DBKey, Translator.Text("Chat.Parameters.DBParameterRequest"), settings, dataWrapper, inputFactory, publishWrapper, resultFactory));
            ConversationParameters.Add(new YesOrNoParameter(RecursionKey, Translator.Text("Chat.Intents.Publish.RecursionParameterRequest"), inputFactory, resultFactory));
            ConversationParameters.Add(new YesOrNoParameter(RelatedKey, Translator.Text("Chat.Intents.Publish.RelatedParameterRequest"), inputFactory, resultFactory));
        }
 public MediaWrapper(
     ISitecoreDataWrapper dataWrapper,
     ILogWrapper logger)
 {
     DataWrapper = dataWrapper;
     Logger      = logger;
 }
Beispiel #17
0
 public MediaItemDeleted(
     ISitecoreDataWrapper dataWrapper,
     IImageSearchService searchService)
 {
     DataWrapper   = dataWrapper;
     SearchService = searchService;
 }
 public ImageSearchFactory(
     IServiceProvider provider,
     ISitecoreDataWrapper dataWrapper,
     IIntelligentMediaSearchService searchService)
 {
     Provider      = provider;
     DataWrapper   = dataWrapper;
     SearchService = searchService;
 }
 public SearchService(
     ISitecoreDataWrapper dataWrapper,
     IIntelligentSearchSettings settings,
     IContentSearchWrapper contentSearch)
 {
     DataWrapper   = dataWrapper;
     Settings      = settings;
     ContentSearch = contentSearch;
 }
 public ImageAnalysisFactory(
     ISitecoreDataWrapper dataWrapper,
     IServiceProvider provider,
     IMediaWrapper mediaWrapper)
 {
     DataWrapper  = dataWrapper;
     Provider     = provider;
     MediaWrapper = mediaWrapper;
 }
 public PersonFaceSaved(
     ISitecoreDataWrapper dataWrapper,
     IPersonGroupService personGroupService,
     IIntelligentMediaSettings settings)
 {
     DataWrapper        = dataWrapper;
     PersonGroupService = personGroupService;
     Settings           = settings;
 }
 public MediaItemDeleted(
     ISitecoreDataWrapper dataWrapper,
     IIntelligentMediaSearchService searchService,
     IMediaWrapper mediaWrapper)
 {
     DataWrapper   = dataWrapper;
     SearchService = searchService;
     MediaWrapper  = mediaWrapper;
 }
        public AssignProfileCardIntent(
            IOleSettings settings,
            ISitecoreDataWrapper dataWrapper,
            IIntentInputFactory inputFactory,
            IConversationResponseFactory responseFactory,
            IParameterResultFactory resultFactory,
            IPublishWrapper publishWrapper,
            IProfileService profileService,
            ISearchService searchService) : base(inputFactory, responseFactory, settings)
        {
            DataWrapper    = dataWrapper;
            PublishWrapper = publishWrapper;
            ProfileService = profileService;
            SearchService  = searchService;

            var profileParameters = new Dictionary <string, string>
            {
                { Constants.SearchParameters.FilterPath, Constants.Paths.ProfilePath },
                { Constants.SearchParameters.TemplateId, Constants.TemplateIds.ProfileCardTemplateId.ToString() },
                { Constants.SearchParameters.AutoStart, "true" }
            };

            ConversationParameters.Add(new ItemParameter(ProfileCardItemKey, Translator.Text("Chat.Intents.AssignProfileCard.ProfileCardItemParameterRequest"), profileParameters, dataWrapper, inputFactory, resultFactory));

            var nameParameter = new Dictionary <string, string>
            {
                { Constants.SearchParameters.FilterPath, Constants.Paths.ContentPath },
            };
            var nameParam = new ItemParameter(ItemNameKey, Translator.Text("Chat.Intents.AssignProfileCard.ItemNameParameterRequest"), nameParameter, dataWrapper, inputFactory, resultFactory);

            nameParam.IsOptional = true;
            ConversationParameters.Add(nameParam);

            var templateParameter = new Dictionary <string, string>
            {
                { Constants.SearchParameters.FilterPath, Constants.Paths.TemplatePath },
            };
            var templateParam = new ItemParameter(TemplateItemKey, Translator.Text("Chat.Intents.AssignProfileCard.TemplateItemParameterRequest"), templateParameter, dataWrapper, inputFactory, resultFactory);

            templateParam.IsOptional = true;
            ConversationParameters.Add(templateParam);

            var folderParameter = new Dictionary <string, string>
            {
                { Constants.SearchParameters.FilterPath, Constants.Paths.ContentPath },
            };
            var folderParam = new ItemParameter(FolderItemKey, Translator.Text("Chat.Intents.AssignProfileCard.FolderItemParameterRequest"), folderParameter, dataWrapper, inputFactory, resultFactory);

            folderParam.IsOptional = true;
            ConversationParameters.Add(folderParam);

            var fieldParam = new KeyValueParameter(FieldItemKey, Translator.Text("Chat.Intents.AssignProfileCard.FieldNameParameterRequest"), Translator.Text("Chat.Intents.AssignProfileCard.FieldValueParameterRequest"), inputFactory, resultFactory);

            fieldParam.IsOptional = true;
            ConversationParameters.Add(fieldParam);
        }
Beispiel #24
0
 public PublishIntent(
     IOleSettings settings,
     ISitecoreDataWrapper dataWrapper,
     IIntentOptionSetFactory optionSetFactory,
     IConversationResponseFactory responseFactory,
     IPublishWrapper publishWrapper) : base(optionSetFactory, responseFactory, settings)
 {
     DataWrapper    = dataWrapper;
     PublishWrapper = publishWrapper;
 }
        public MicrosoftCognitiveServicesApiKeys(
            ISitecoreDataWrapper dataWrapper,
            ISCSDKSettings settings)
        {
            DataWrapper = dataWrapper;
            Settings    = settings;

            KeyItem = DataWrapper?
                      .GetDatabase(Settings.MasterDatabase)
                      .GetItem(Settings.MSSDKId);
        }
        public NexosisApiKeys(
            ISitecoreDataWrapper dataWrapper,
            ISCSDKSettings settings)
        {
            DataWrapper = dataWrapper;
            Settings    = settings;

            KeyItem = DataWrapper
                      .GetDatabase(Settings.MasterDatabase)
                      .GetItem(Settings.NexSDKId);
        }
 public PersonGroupService(
     IIntelligentMediaSettings settings,
     ISitecoreDataWrapper dataWrapper,
     IFaceService faceService,
     IIntelligentMediaSearchService searchService)
 {
     Settings      = settings;
     DataWrapper   = dataWrapper;
     FaceService   = faceService;
     SearchService = searchService;
 }
        public IBMWatsonApiKeys(
            ISitecoreDataWrapper dataWrapper,
            ISCSDKSettings settings)
        {
            DataWrapper = dataWrapper;
            Settings    = settings;

            KeyItem = DataWrapper
                      .GetDatabase(Settings.MasterDatabase)
                      .GetItem(Settings.IBMSDKId);
        }
Beispiel #29
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>();
 }
        public RoleParameter(
            string paramMessage,
            List <string> roles,
            ISitecoreDataWrapper dataWrapper)
        {
            Roles = roles;
            var roleNames = Roles.Select(a => GetRoleDisplayName(a));

            ParamMessage = string.Format(paramMessage, string.Join(", ", roleNames));
            DataWrapper  = dataWrapper;
        }