public AccountController( IUserService userService, SignInManager <IUser> signInManager, UserManager <IUser> userManager, ILogger <AccountController> logger, ISiteService siteService, IStringLocalizer <AccountController> stringLocalizer, IEnumerable <ILoginFormEvent> accountEvents, IScriptingManager scriptingManager, IClock clock, IDistributedCache distributedCache, IDataProtectionProvider dataProtectionProvider, IEnumerable <IExternalLoginEventHandler> externalLoginHandlers, IEnumerable <ILogOutEvent> accountLogOutEvents ) { _signInManager = signInManager; _userManager = userManager; _userService = userService; _logger = logger; _siteService = siteService; _accountEvents = accountEvents; _scriptingManager = scriptingManager; _clock = clock; _distributedCache = distributedCache; _dataProtectionProvider = dataProtectionProvider; _externalLoginHandlers = externalLoginHandlers; S = stringLocalizer; _accountLogOutEvents = accountLogOutEvents; }
public ScriptExecutionAction(IScriptingManager scriptingManager, IContentManager contentManager) { _scriptingManager = scriptingManager; _contentManager = contentManager; T = NullLocalizer.Instance; }
public ScriptExecutionForms(IShapeFactory shapeFactory, IScriptingManager scriptingManager) { Shape = shapeFactory; _scriptingManager = scriptingManager; T = NullLocalizer.Instance; }
/// <summary> /// Traverse all the nodes of the json document and replaces their value if they are scripted. /// </summary> private void EvaluateJsonTree(IScriptingManager scriptingManager, JToken node) { switch (node.Type) { case JTokenType.Array: var array = (JArray)node; for (var i = 0; i < array.Count; i++) { EvaluateJsonTree(scriptingManager, array[i]); } break; case JTokenType.Object: foreach (var property in (JObject)node) { EvaluateJsonTree(scriptingManager, property.Value); } break; case JTokenType.String: var value = node.Value <string>(); // Evaluate the expression while the result is another expression while (value.StartsWith("[") && value.EndsWith("]")) { value = value.Trim('[', ']'); value = (scriptingManager.Evaluate(value) ?? "").ToString(); ((JValue)node).Value = value; } break; } }
public void Init() { var builder = new ContainerBuilder(); builder.RegisterType<RubyScriptingRuntime>().As<IScriptingRuntime>(); builder.RegisterType<ScriptingManager>().As<IScriptingManager>(); _container = builder.Build(); _scriptingManager = _container.Resolve<IScriptingManager>(); }
public VueFormController( ILogger <VueFormController> logger, IContentManager contentManager, IAuthorizationService authorizationService, IContentDefinitionManager contentDefinitionManager, IContentItemDisplayManager contentItemDisplayManager, IUpdateModelAccessor updateModelAccessor, IScriptingManager scriptingManager, ILiquidTemplateManager liquidTemplateManager, HtmlEncoder htmlEncoder, IShortcodeService shortcodeService, IContentPermissionsService contentPermissionsService, IStringLocalizer <VueFormController> stringLocalizer, IWorkflowManager workflowManager = null ) { _logger = logger; _contentManager = contentManager; _contentDefinitionManager = contentDefinitionManager; _contentItemDisplayManager = contentItemDisplayManager; _updateModelAccessor = updateModelAccessor; _scriptingManager = scriptingManager; _liquidTemplateManager = liquidTemplateManager; _htmlEncoder = htmlEncoder; _shortcodeService = shortcodeService; _contentPermissionsService = contentPermissionsService; S = stringLocalizer; _workflowManager = workflowManager; _authorizationService = authorizationService; }
/// <summary> /// Traverse all the nodes of the json document and replaces their value if they are scripted. /// </summary> private void EvaluateJsonTree(IScriptingManager scriptingManager, RecipeExecutionContext context, JToken node) { switch (node.Type) { case JTokenType.Array: var array = (JArray)node; for (var i = 0; i < array.Count; i++) { EvaluateJsonTree(scriptingManager, context, array[i]); } break; case JTokenType.Object: foreach (var property in (JObject)node) { EvaluateJsonTree(scriptingManager, context, property.Value); } break; case JTokenType.String: var value = node.Value <string>(); // Evaluate the expression while the result is another expression while (value.StartsWith('[') && value.EndsWith(']')) { value = value.Trim('[', ']'); value = (scriptingManager.Evaluate(value, context.RecipeDescriptor.FileProvider, context.RecipeDescriptor.BasePath, null) ?? "").ToString(); ((JValue)node).Value = value; } break; } }
public JavaScriptExpressionEvaluator( IScriptingManager scriptingManager, IEnumerable <IWorkflowExecutionEventHandler> workflowContextHandlers, ILogger <JavaScriptExpressionEvaluator> logger) { _scriptingManager = scriptingManager; _workflowContextHandlers = workflowContextHandlers; _logger = logger; }
public void Init() { var builder = new ContainerBuilder(); builder.RegisterType <RubyScriptingRuntime>().As <IScriptingRuntime>(); builder.RegisterType <ScriptingManager>().As <IScriptingManager>(); _container = builder.Build(); _scriptingManager = _container.Resolve <IScriptingManager>(); }
public ScriptConsole(Window w) { DataContext = this; _parent = w; _scriptmanager = CompositionManager.Get<IScriptingManager>(); _scriptlibrary = CompositionManager.Get<IScriptingLibrarian>(); _scriptconfiguration = CompositionManager.Get<IScriptingConfiguration>(); InitializeComponent(); }
/// <summary> /// Traverse all the nodes of the recipe steps and replaces their value if they are scripted. /// </summary> private void EvaluateScriptNodes(RecipeExecutionContext context, IScriptingManager scriptingManager) { if (_variablesMethodProvider != null) { _variablesMethodProvider.ScriptingManager = scriptingManager; scriptingManager.GlobalMethodProviders.Add(_variablesMethodProvider); } EvaluateJsonTree(scriptingManager, context, context.Step); }
public ScriptExternalLoginEventHandler( ISiteService siteService, IScriptingManager scriptingManager, ILogger <ScriptExternalLoginEventHandler> logger ) { _siteService = siteService; _scriptingManager = scriptingManager; _logger = logger; }
public ScriptingAdminTestbedPartDriver( IScriptingManager scriptingManager, IContentManager contentManager, INotifier notifier) { _scriptingManager = scriptingManager; _contentManager = contentManager; _notifier = notifier; T = NullLocalizer.Instance; }
public AdminController( IScriptingManager scriptingManager, IOrchardServices orchardServices) { _scriptingManager = scriptingManager; _orchardServices = orchardServices; _contentManager = orchardServices.ContentManager; _authorizer = orchardServices.Authorizer; T = NullLocalizer.Instance; }
public JavaScriptWorkflowScriptEvaluator( IScriptingManager scriptingManager, IEnumerable <IWorkflowExecutionContextHandler> workflowContextHandlers, IStringLocalizer <JavaScriptWorkflowScriptEvaluator> localizer, ILogger <JavaScriptWorkflowScriptEvaluator> logger ) { _scriptingManager = scriptingManager; _workflowContextHandlers = workflowContextHandlers; _logger = logger; T = localizer; }
/// <summary> /// Set scripting frontend /// Call this before Run() /// </summary> /// <param name="scriptingFrontend"></param> public void SetScripting(IScriptingManager scriptingFrontend) { if (_scriptingManager != null) { throw new Exception($"Scripting has already set to {_scriptingManager.GetType().Name}"); } // We not actually initialize scripting here, because Initialize() not called yet // see SetScripting _scriptingManager = scriptingFrontend; LogManager.Log($"Using scripting frontend: {scriptingFrontend.GetType().Name}"); }
public DynamicResourcesFilter(IScriptingManager scriptingManager, ILayoutAccessor layoutAccessor, IUpdateModelAccessor modelUpdaterAccessor, IContentManager contentManager, IContentItemDisplayManager contentItemDisplayManager, IDynamicResourcesService dynamicResourcesService) { _scriptingManager = scriptingManager; _modelUpdaterAccessor = modelUpdaterAccessor; _layoutAccessor = layoutAccessor; _contentManager = contentManager; _contentItemDisplayManager = contentItemDisplayManager; _dynamicResourcesService = dynamicResourcesService; }
/// <summary> /// Traverse all the nodes of the json document and replaces their value if they are scripted. /// </summary> private void EvaluateJsonTree(IScriptingManager scriptingManager, RecipeExecutionContext context, JToken node) { switch (node.Type) { case JTokenType.Array: var array = (JArray)node; for (var i = 0; i < array.Count; i++) { EvaluateJsonTree(scriptingManager, context, array[i]); } break; case JTokenType.Object: foreach (var property in (JObject)node) { EvaluateJsonTree(scriptingManager, context, property.Value); } break; case JTokenType.String: const char scriptSeparator = ':'; var value = node.Value <string>(); // Evaluate the expression while the result is another expression while (value.StartsWith('[') && value.EndsWith(']')) { var scriptSeparatorIndex = value.IndexOf(scriptSeparator); // Only remove brackets if this is a valid script expression, e.g. '[js:xxx]', or '[file:xxx]' if (!(scriptSeparatorIndex > -1 && value[1..scriptSeparatorIndex].All(c => Char.IsLetter(c)))) { break; } value = value.Trim('[', ']'); value = (scriptingManager.Evaluate( value, context.RecipeDescriptor.FileProvider, context.RecipeDescriptor.BasePath, _methodProviders[context.ExecutionId]) ?? "").ToString(); ((JValue)node).Value = value; } break; } }
public void Init() { var builder = new ContainerBuilder(); builder.RegisterType<RubyScriptingRuntime>().As<IScriptingRuntime>(); builder.RegisterType<ScriptingManager>().As<IScriptingManager>(); _container = builder.Build(); _scriptingRuntime = _container.Resolve<IScriptingRuntime>(); _scriptingManager = _container.Resolve<IScriptingManager>(); _tempFolderName = _tempFixtureFolderName.Combine(System.IO.Path.GetRandomFileName()); try { _tempFolderName.Delete(); } catch { } _tempFolderName.CreateDirectory(); }
/// <summary> /// Traverse all the nodes of the recipe steps and replaces their value if they are scripted. /// </summary> private void EvaluateScriptNodes(RecipeExecutionContext recipeStep, IScriptingManager scriptingManager) { if (_variablesMethodProvider != null) { _variablesMethodProvider.ScriptingManager = scriptingManager; scriptingManager.GlobalMethodProviders.Add(_variablesMethodProvider); } if (_applicationLifetime.ApplicationStopping.IsCancellationRequested) { throw new OrchardException(T["Recipe cancelled, application is restarting"]); } EvaluateJsonTree(scriptingManager, recipeStep.Step); }
public void Init() { var builder = new ContainerBuilder(); builder.RegisterType <RubyScriptingRuntime>().As <IScriptingRuntime>(); builder.RegisterType <ScriptingManager>().As <IScriptingManager>(); _container = builder.Build(); _scriptingRuntime = _container.Resolve <IScriptingRuntime>(); _scriptingManager = _container.Resolve <IScriptingManager>(); _tempFolderName = _tempFixtureFolderName.Combine(System.IO.Path.GetRandomFileName()); try { _tempFolderName.Delete(); } catch { } _tempFolderName.CreateDirectory(); }
public LayerFilter( ILayerService layerService, ILayoutAccessor layoutAccessor, IContentItemDisplayManager contentItemDisplayManager, IUpdateModelAccessor modelUpdaterAccessor, IScriptingManager scriptingManager, IServiceProvider serviceProvider, IMemoryCache memoryCache, ISignal signal) { _layerService = layerService; _layoutAccessor = layoutAccessor; _contentItemDisplayManager = contentItemDisplayManager; _modelUpdaterAccessor = modelUpdaterAccessor; _scriptingManager = scriptingManager; _serviceProvider = serviceProvider; _memoryCache = memoryCache; _signal = signal; }
public LayerFilter( ILayerService layerService, ILayoutAccessor layoutAccessor, IContentItemDisplayManager contentItemDisplayManager, IUpdateModelAccessor modelUpdaterAccessor, IScriptingManager scriptingManager, IMemoryCache memoryCache, IThemeManager themeManager, IAdminThemeService adminThemeService, IVolatileDocumentManager <LayerState> layerStateManager) { _layerService = layerService; _layoutAccessor = layoutAccessor; _contentItemDisplayManager = contentItemDisplayManager; _modelUpdaterAccessor = modelUpdaterAccessor; _scriptingManager = scriptingManager; _memoryCache = memoryCache; _themeManager = themeManager; _adminThemeService = adminThemeService; _layerStateManager = layerStateManager; }
public LayerFilter( ILayerService layerService, ILayoutAccessor layoutAccessor, IContentItemDisplayManager contentItemDisplayManager, IUpdateModelAccessor modelUpdaterAccessor, IScriptingManager scriptingManager, IMemoryCache memoryCache, ISignal signal, IThemeManager themeManager, IAdminThemeService adminThemeService) { _layerService = layerService; _layoutAccessor = layoutAccessor; _contentItemDisplayManager = contentItemDisplayManager; _modelUpdaterAccessor = modelUpdaterAccessor; _scriptingManager = scriptingManager; _memoryCache = memoryCache; _signal = signal; _themeManager = themeManager; _adminThemeService = adminThemeService; }
public VueFormController( ILogger <VueFormController> logger, IContentManager contentManager, IContentDefinitionManager contentDefinitionManager, IContentItemDisplayManager contentItemDisplayManager, IUpdateModelAccessor updateModelAccessor, IScriptingManager scriptingManager, ILiquidTemplateManager liquidTemplateManager, HtmlEncoder htmlEncoder, IWorkflowManager workflowManager = null ) { _logger = logger; _contentManager = contentManager; _contentDefinitionManager = contentDefinitionManager; _contentItemDisplayManager = contentItemDisplayManager; _updateModelAccessor = updateModelAccessor; _scriptingManager = scriptingManager; _liquidTemplateManager = liquidTemplateManager; _htmlEncoder = htmlEncoder; _workflowManager = workflowManager; }
/// <summary> /// Traverse all the nodes of the json document and replaces their value if they are scripted. /// </summary> private void EvaluateJsonTree(IScriptingManager scriptingManager, JToken node) { var items = node as IEnumerable <JToken>; switch (node.Type) { case JTokenType.Array: foreach (var token in (JArray)node) { EvaluateJsonTree(scriptingManager, token); } break; case JTokenType.Object: foreach (var property in (JObject)node) { if (property.Value.Type == JTokenType.String) { var value = property.Value.Value <string>(); // Evaluate the expression while the result is another expression while (value.StartsWith("[") && value.EndsWith("]")) { value = value.Trim('[', ']'); value = (scriptingManager.Evaluate(value) ?? "").ToString(); node[property.Key] = new JValue(value); } } else { EvaluateJsonTree(scriptingManager, property.Value); } } break; } }
public DynamicLanguagesScriptEngine() { _scriptingManager = CompositionManager.Get<IScriptingManager>(); _scriptLibrarian = CompositionManager.Get<IScriptingLibrarian>(); _scriptingConfiguration = CompositionManager.Get<IScriptingConfiguration>(); }
public RubyScriptExpressionEvaluator(IScriptingManager scriptingManager, ICacheManager cacheManager) { _scriptingManager = scriptingManager; _cacheManager = cacheManager; }
public VisibilityRuleManager(IScriptingManager scriptingManager, IServiceProvider serviceProvider) { _scriptingManager = scriptingManager; _serviceProvider = serviceProvider; }
public JavascriptConditionEvaluator(IScriptingManager scriptingManager, IServiceProvider serviceProvider) { _scriptingManager = scriptingManager; _serviceProvider = serviceProvider; }
/// <summary> /// Executes javascript by prefixing the script . /// </summary> /// <param name="script">The script to evaluate</param> /// <param name="scopedMethodProviders">A list of method providers scoped to the script evaluation.</param> /// <returns>The result of the script if any.</returns> public static object EvaluateJs(this IScriptingManager scriptingManager, string script, params IGlobalMethodProvider[] scopedMethodProviders) { var directive = $"js:{script}"; return(scriptingManager.Evaluate(directive, null, null, scopedMethodProviders)); }