void ServerVariablesParser_Parsing(object sender, Dictionary<string, object> e) { if (HttpContext.Current == null) return; var urlHelper = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData())); var mainDictionary = new Dictionary<string, object> { { "ocBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<ObjectController>(controller => controller.PostCreate(null)) }, { "pecBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<PropertyEditorsApiController>( controller => controller.GetAllTypes()) }, { "fcBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<FieldApiController>(controller => controller.GetAllUsers()) } }; if (!e.Keys.Contains("uioMatic")) { e.Add("uioMatic", mainDictionary); } }
/// <summary> /// The server variables parser parsing. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="items"> /// The items. /// </param> private static void ServerVariablesParserParsing(object sender, Dictionary<string, object> items) { if (!items.ContainsKey("umbracoUrls")) { return; } var umbracoUrls = (Dictionary<string, object>) items["umbracoUrls"]; var url = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData())); umbracoUrls.Add( "gleanerSettingsApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<SettingsApiController>( controller => controller.GetAllCountries())); umbracoUrls.Add( "gleanerAgentApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<AgentApiController>( controller => controller.SearchAgents(new QueryDisplay { CurrentPage = 0, ItemsPerPage = 25, Parameters = new QueryDisplayParameter[] { } }))); umbracoUrls.Add( "gleanerMemberApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<MemberApiController>( controller => controller.SearchMembers(new QueryDisplay { CurrentPage = 0, ItemsPerPage = 25, Parameters = new QueryDisplayParameter[] { } }))); umbracoUrls.Add( "gleanerFormApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<FormApiController>( controller => controller.SearchForms(new QueryDisplay { CurrentPage = 0, ItemsPerPage = 25, Parameters = new QueryDisplayParameter[] { } }))); umbracoUrls.Add( "gleanerFormGroupApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<FormGroupApiController>( controller => controller.SearchFormGroups(new QueryDisplay { CurrentPage = 0, ItemsPerPage = 25, Parameters = new QueryDisplayParameter[] { } }))); }
static void ServerVariablesParser_Parsing(object sender, Dictionary<string, object> e) { if (HttpContext.Current == null) throw new InvalidOperationException("HttpContext is null"); var urlHelper = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData())); e.Add("articulate", new Dictionary<string, object> { {"articulateImportBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<ArticulateBlogImportController>(controller => controller.PostImportBlogMl(null))}, {"articulatePropertyEditorsBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<ArticulatePropertyEditorsController>(controller => controller.GetThemes())} }); }
void ServerVariablesParser_Parsing(object sender, Dictionary<string, object> e) { if (HttpContext.Current == null) return; var urlHelper = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData())); var mainDictionary = new Dictionary<string, object>(); mainDictionary.Add("demoBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<PeopleApiController>(controller => controller.GetAll())); if (!e.Keys.Contains("demoSection")) { e.Add("demoSection", mainDictionary); } }
void ServerVariablesParser_Parsing(object sender, Dictionary<string, object> dictionary) { if (HttpContext.Current == null) throw new InvalidOperationException("HttpContext is null"); var urlHelper = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData())); var url = urlHelper.GetUmbracoApiServiceBaseUrl<RelationsApiController>("GetRelations"); dictionary.Add("arknuRelations", new Dictionary<string, object> { {"relationsApiBase", url} }); }
void ServerVariablesParser_Parsing(object sender, Dictionary<string, object> e) { if (HttpContext.Current == null) return; var urlHelper = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData())); var mainDictionary = new Dictionary<string, object> { { "apiBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<VortoApiController>( controller => controller.GetInstalledLanguages()) } }; if (!e.Keys.Contains("vorto")) { e.Add("vorto", mainDictionary); } }
private void Parsing(object sender, Dictionary<string, object> e) { if (HttpContext.Current == null) throw new InvalidOperationException("HttpContext is null"); var urlHelper = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData())); var mainDictionary = new Dictionary<string, object>(); mainDictionary.Add("calendarBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<CalendarApiController>(controller => controller.PostSave(null))); mainDictionary.Add("locationBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<LocationApiController>(controller => controller.PostSave(null))); mainDictionary.Add("eventBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<EventApiController>(controller => controller.PostSave(null))); mainDictionary.Add("reventBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<REventApiController>(controller => controller.PostSave(null))); mainDictionary.Add("userBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<UserApiController>(controller => controller.PostSave(null))); mainDictionary.Add("importBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<ImportApiController>(controller => controller.Import())); if (!e.Keys.Contains("eventCalendar")) { e.Add("eventCalendar", mainDictionary); } }
private static void ServerVariablesParserParsing(object sender, Dictionary<string, object> items) { if (!items.ContainsKey("umbracoUrls")) return; var umbracoUrls = (Dictionary<string, object>)items["umbracoUrls"]; var url = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData())); umbracoUrls.Add("merchelloProductApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<ProductApiController>( controller => controller.GetAllProducts())); umbracoUrls.Add("merchelloProductVariantsApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<ProductVariantApiController>( controller => controller.GetProductVariant(Guid.NewGuid()))); umbracoUrls.Add("merchelloSettingsApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<SettingsApiController>( controller => controller.GetAllCountries())); umbracoUrls.Add("merchelloWarehouseApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<WarehouseApiController>( controller => controller.GetDefaultWarehouse())); umbracoUrls.Add("merchelloCatalogShippingApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<CatalogShippingApiController>( controller => controller.GetShipCountry(Guid.NewGuid()))); umbracoUrls.Add("merchelloCatalogFixedRateShippingApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<CatalogFixedRateShippingApiController>( controller => controller.GetAllShipCountryFixedRateProviders(Guid.NewGuid()))); umbracoUrls.Add("merchelloPaymentGatewayApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<PaymentGatewayApiController>( controller => controller.GetAllGatewayProviders())); umbracoUrls.Add("merchelloTaxationGatewayApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<TaxationGatewayApiController>( controller => controller.GetAllGatewayProviders())); umbracoUrls.Add("merchelloInvoiceApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<InvoiceApiController>( controller => controller.GetAllInvoices())); umbracoUrls.Add("merchelloOrderApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<OrderApiController>( controller => controller.GetOrder(Guid.NewGuid()))); umbracoUrls.Add("merchelloShipmentApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<ShipmentApiController>( controller => controller.GetShipment(Guid.NewGuid()))); umbracoUrls.Add("merchelloPaymentApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<PaymentApiController>( controller => controller.GetPayment(Guid.NewGuid()))); umbracoUrls.Add("merchelloGatewayProviderApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<GatewayProviderApiController>( controller => controller.GetGatewayProvider(Guid.NewGuid()))); }
/// <summary> /// Updates Umbraco's server variables collection with Merchello server variable values. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The dictionary of server variables. /// </param> private static void ServerVariablesParserParsing(object sender, Dictionary<string, object> e) { if (HttpContext.Current == null) throw new InvalidOperationException("HttpContext is null"); if (e.ContainsKey("merchelloUrls")) return; var merchelloUrls = new Dictionary<string, object>(); var url = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData())); merchelloUrls.Add( "merchelloAuditLogApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<AuditLogApiController>( controller => controller.GetSalesHistoryByInvoiceKey(Guid.Empty))); merchelloUrls.Add( "merchelloBackOfficeCheckoutApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<BackOfficeCheckoutApiController>( controller => controller.GetPaymentMethods())); merchelloUrls.Add( "merchelloCustomerApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<CustomerApiController>( controller => controller.SearchCustomers(new QueryDisplay() { CurrentPage = 0, ItemsPerPage = 25, Parameters = new QueryDisplayParameter[] { } }))); merchelloUrls.Add( "merchelloDetachedContentApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<DetachedContentApiController>( controller => controller.GetContentTypes())); merchelloUrls.Add( "merchelloEntityCollectionApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<EntityCollectionApiController>( controller => controller.GetEntityCollectionProviders())); merchelloUrls.Add( "merchelloFixedRateShippingApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<FixedRateShippingApiController>( controller => controller.GetShipFixedRateTable(new ShipMethodDisplay()))); merchelloUrls.Add( "merchelloGatewayProviderApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<GatewayProviderApiController>( controller => controller.GetGatewayProvider(Guid.NewGuid()))); merchelloUrls.Add( "merchelloInvoiceApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<InvoiceApiController>( controller => controller.SearchInvoices(new QueryDisplay() { CurrentPage = 0, ItemsPerPage = 25, Parameters = new QueryDisplayParameter[] { } }))); merchelloUrls.Add( "merchelloMarketingApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<MarketingApiController>( controller => controller.GetAllOfferSettings())); merchelloUrls.Add( "merchelloNoteApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<NoteApiController>( controller => controller.GetByEntityKey(Guid.Empty))); merchelloUrls.Add( "merchelloNotificationApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<NotificationGatewayApiController>( controller => controller.GetAllGatewayProviders())); merchelloUrls.Add( "merchelloOrderApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<OrderApiController>( controller => controller.GetOrder(Guid.NewGuid()))); merchelloUrls.Add( "merchelloPaymentApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<PaymentApiController>( controller => controller.GetPayment(Guid.NewGuid()))); merchelloUrls.Add( "merchelloPaymentGatewayApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<PaymentGatewayApiController>( controller => controller.GetAllGatewayProviders())); merchelloUrls.Add( "merchelloPluginViewEditorApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<PluginViewEditorApiController>( controller => controller.GetAllAppPluginsViews())); merchelloUrls.Add( "merchelloProductApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<ProductApiController>( controller => controller.SearchProducts(new QueryDisplay() { CurrentPage = 0, ItemsPerPage = 25, Parameters = new QueryDisplayParameter[] { } }))); merchelloUrls.Add( "merchelloProductOptionApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<ProductOptionApiController>( controller => controller.SearchOptions(new QueryDisplay() { CurrentPage = 0, ItemsPerPage = 25, Parameters = new QueryDisplayParameter[] { } }))); merchelloUrls.Add( "merchelloSettingsApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<SettingsApiController>( controller => controller.GetAllCountries())); merchelloUrls.Add( "merchelloShipmentApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<ShipmentApiController>( controller => controller.GetShipment(Guid.NewGuid()))); merchelloUrls.Add( "merchelloShippingGatewayApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<ShippingGatewayApiController>( controller => controller.GetShipCountry(Guid.NewGuid()))); merchelloUrls.Add( "merchelloTaxationGatewayApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<TaxationGatewayApiController>( controller => controller.GetAllGatewayProviders())); merchelloUrls.Add( "merchelloWarehouseApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<WarehouseApiController>( controller => controller.GetDefaultWarehouse())); if (!ReportApiControllerResolver.HasCurrent) return; foreach (var keyValue in ReportApiControllerResolver.Current.GetAll().Select(reportController => reportController.BaseUrl)) { merchelloUrls.Add(keyValue.Key, keyValue.Value); } e.Add("merchelloUrls", merchelloUrls); }
/// <summary> /// The server variables parser parsing. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="items"> /// The items. /// </param> private static void ServerVariablesParserParsing(object sender, Dictionary<string, object> items) { if (!items.ContainsKey("umbracoUrls")) return; var umbracoUrls = (Dictionary<string, object>)items["umbracoUrls"]; var url = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData())); umbracoUrls.Add( "merchelloAuditLogApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<AuditLogApiController>( controller => controller.GetSalesHistoryByInvoiceKey(Guid.Empty))); umbracoUrls.Add( "merchelloProductApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<ProductApiController>( controller => controller.SearchProducts(new QueryDisplay() { CurrentPage = 0, ItemsPerPage = 100, Parameters = new QueryDisplayParameter[] { } }))); //umbracoUrls.Add( // "merchelloProductVariantsApiBaseUrl", // url.GetUmbracoApiServiceBaseUrl<ProductVariantApiController>( // controller => controller.GetProductVariant(Guid.NewGuid()))); umbracoUrls.Add( "merchelloCustomerApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<CustomerApiController>( controller => controller.SearchCustomers(new QueryDisplay() { CurrentPage = 0, ItemsPerPage = 100, Parameters = new QueryDisplayParameter[] { } }))); umbracoUrls.Add( "merchelloSettingsApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<SettingsApiController>( controller => controller.GetAllCountries())); umbracoUrls.Add( "merchelloWarehouseApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<WarehouseApiController>( controller => controller.GetDefaultWarehouse())); umbracoUrls.Add( "merchelloCatalogShippingApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<ShippingGatewayApiController>( controller => controller.GetShipCountry(Guid.NewGuid()))); umbracoUrls.Add( "merchelloNotificationApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<NotificationGatewayApiController>( controller => controller.GetAllGatewayProviders())); umbracoUrls.Add( "merchelloPaymentGatewayApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<PaymentGatewayApiController>( controller => controller.GetAllGatewayProviders())); umbracoUrls.Add( "merchelloTaxationGatewayApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<TaxationGatewayApiController>( controller => controller.GetAllGatewayProviders())); umbracoUrls.Add( "merchelloInvoiceApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<InvoiceApiController>( controller => controller.SearchInvoices(new QueryDisplay() { CurrentPage = 0, ItemsPerPage = 100, Parameters = new QueryDisplayParameter[] { } }))); umbracoUrls.Add( "merchelloOrderApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<OrderApiController>( controller => controller.GetOrder(Guid.NewGuid()))); umbracoUrls.Add( "merchelloShipmentApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<ShipmentApiController>( controller => controller.GetShipment(Guid.NewGuid()))); umbracoUrls.Add( "merchelloRateTableApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<FixedRateShippingApiController>( controller => controller.GetShipFixedRateTable(new ShipMethodDisplay()))); umbracoUrls.Add( "merchelloPaymentApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<PaymentApiController>( controller => controller.GetPayment(Guid.NewGuid()))); umbracoUrls.Add( "merchelloGatewayProviderApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<GatewayProviderApiController>( controller => controller.GetGatewayProvider(Guid.NewGuid()))); if (!ReportApiControllerResolver.HasCurrent) return; foreach (var keyValue in ReportApiControllerResolver.Current.GetAll().Select(reportController => reportController.BaseUrl)) { umbracoUrls.Add(keyValue.Key, keyValue.Value); } }
/// <summary> /// The server variables parser on parsing. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The dictionary. /// </param> private static void ServerVariablesParserOnParsing(object sender, Dictionary<string, object> e) { if (HttpContext.Current == null) throw new InvalidOperationException("HttpContext is null"); var urlHelper = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData())); if (!e.ContainsKey("merchelloBazaarUrls")) e.Add( "merchelloBazaarUrls", new Dictionary<string, object>() { { "merchelloBazaarPropertyEditorsApiBaseUrl", urlHelper.GetUmbracoApiServiceBaseUrl<PropertyEditorsController>(controller => controller.GetThemes()) } }); }
/// <summary> /// The server variables parser on parsing. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The dictionary. /// </param> private static void ServerVariablesParserOnParsing(object sender, Dictionary<string, object> e) { if (HttpContext.Current == null) throw new InvalidOperationException("HttpContext is null"); if (e.ContainsKey("merchelloPaymentsUrls")) return; var merchelloPaymentsUrls = new Dictionary<string, object>(); var url = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData())); merchelloPaymentsUrls.Add( "merchelloBraintreeApiBaseUrl", url.GetUmbracoApiServiceBaseUrl<BraintreeApiController>( controller => controller.GetClientRequestToken(Guid.Empty))); e.Add("merchelloPaymentsUrls", merchelloPaymentsUrls); }