예제 #1
0
			public void Initialize(IInitializationControl control)
			{
				if (HttpContext.Current == null)
				{
					control.NotNow();
					return;
				}
				_aliasses = new UwebshopAliassesXMLConfig();
				const string path = "/App_Plugins/uWebshop/config/ContentMapping.config";
				if (!System.IO.File.Exists(HttpContext.Current.Server.MapPath(path)))
				{
					control.Debug("No Aliasses.config");
				}
				else
				{
					try
					{
						_aliasses = DomainHelper.DeserializeXmlStringToObject<UwebshopAliassesXMLConfig>(System.IO.File.ReadAllText(HttpContext.Current.Server.MapPath(path)));
						Log.Instance.LogDebug("ContentMapping xml loaded");
						control.Debug("Done loading Aliasses.config");
					}
					catch (Exception ex)
					{
						Log.Instance.LogError(ex, "ContentMapping xml loading failed");
						control.FatalError("Failure deserializing " + path);
						throw;
					}
				}

				InitNodeAliasses.Initialize(_aliasses);
			}
		public StubContentTypeAliassesXmlService()
		{
			it = new UwebshopAliassesXMLConfig();
			InitNodeAliasses.Initialize(it);
		}
public static class GenerateXML {public static string GenerateXMLString()
{
var xml = new UwebshopAliassesXMLConfig();
xml.Catalog.ContentTypeAlias = "uwbsCatalog";
xml.Category.ContentTypeAlias = "uwbsCategory";
xml.Category.categories = "categories";
xml.Category.metaTags = "metaTags";
xml.Category.images = "images";
xml.Category.title = "title";
xml.Category.url = "url";
xml.Category.metaDescription = "metaDescription";
xml.Category.description = "description";
xml.CategoryRepository.ContentTypeAlias = "uwbsCategoryRepository";
xml.DateFolder.ContentTypeAlias = "uwbsOrderDateFolder";
xml.DiscountOrder.ContentTypeAlias = "uwbsDiscountOrder";
xml.DiscountOrder.items = "items";
xml.DiscountOrder.affectedOrderlines = "affectedOrderlines";
xml.DiscountOrder.affectedTags = "affectedTags";
xml.DiscountOrder.orderCondition = "orderCondition";
xml.DiscountOrder.numberOfItemsCondition = "numberOfItemsCondition";
xml.DiscountOrder.shippingDiscountable = "shippingDiscountable";
xml.DiscountOrder.minimumAmount = "minimumAmount";
xml.DiscountOrder.couponCodes = "couponCodes";
xml.DiscountOrder.oncePerCustomer = "oncePerCustomer";
xml.DiscountOrder.title = "title";
xml.DiscountOrder.description = "description";
xml.DiscountOrder.disable = "disable";
xml.DiscountOrder.discountType = "discountType";
xml.DiscountOrder.discount = "discount";
xml.DiscountOrder.ranges = "ranges";
xml.DiscountOrder.countdownEnabled = "countdownEnabled";
xml.DiscountOrder.countdown = "countdown";
xml.DiscountOrder.memberGroups = "memberGroups";
xml.DiscountOrderSection.ContentTypeAlias = "uwbsDiscountOrderSection";
xml.DiscountProduct.ContentTypeAlias = "uwbsDiscountProduct";
xml.DiscountProduct.products = "products";
xml.DiscountProduct.excludeVariants = "excludeVariants";
xml.DiscountProduct.title = "title";
xml.DiscountProduct.description = "description";
xml.DiscountProduct.disable = "disable";
xml.DiscountProduct.discountType = "discountType";
xml.DiscountProduct.discount = "discount";
xml.DiscountProduct.ranges = "ranges";
xml.DiscountProduct.countdownEnabled = "countdownEnabled";
xml.DiscountProduct.countdown = "countdown";
xml.DiscountProduct.memberGroups = "memberGroups";
xml.DiscountProductSection.ContentTypeAlias = "uwbsDiscountProductSection";
xml.DiscountRepository.ContentTypeAlias = "uwbsDiscountRepository";
xml.EmailCustomer.ContentTypeAlias = "uwbsEmailTemplateCustomer";
xml.EmailCustomer.title = "title";
xml.EmailCustomer.description = "description";
xml.EmailCustomer.emailtemplate = "emailtemplate";
xml.EmailCustomer.templatePreview = "templatePreview";
xml.EmailCustomerSection.ContentTypeAlias = "uwbsEmailTemplateCustomerSection";
xml.EmailRepository.ContentTypeAlias = "uwbsEmailRepository";
xml.EmailStore.ContentTypeAlias = "uwbsEmailTemplateStore";
xml.EmailStore.title = "title";
xml.EmailStore.description = "description";
xml.EmailStore.emailtemplate = "emailtemplate";
xml.EmailStore.templatePreview = "templatePreview";
xml.EmailStoreSection.ContentTypeAlias = "uwbsEmailTemplateStoreSection";
xml.Order.ContentTypeAlias = "uwbsOrder";
xml.Order.orderStatusPicker = "orderStatusPicker";
xml.Order.orderPaid = "orderPaid";
xml.Order.orderDetails = "orderDetails";
xml.Order.orderGuid = "orderGuid";
xml.Order.customerEmail = "customerEmail";
xml.Order.customerFirstName = "customerFirstName";
xml.Order.customerLastName = "customerLastName";
xml.OrderedProduct.ContentTypeAlias = "uwbsOrderedProduct";
xml.OrderedProduct.productId = "productId";
xml.OrderedProduct.typeAlias = "typeAlias";
xml.OrderedProduct.title = "title";
xml.OrderedProduct.sku = "sku";
xml.OrderedProduct.length = "length";
xml.OrderedProduct.width = "width";
xml.OrderedProduct.height = "height";
xml.OrderedProduct.weight = "weight";
xml.OrderedProduct.ranges = "ranges";
xml.OrderedProduct.price = "price";
xml.OrderedProduct.vat = "vat";
xml.OrderedProduct.itemCount = "itemCount";
xml.OrderedProduct.orderedProductDiscountPercentage = "orderedProductDiscountPercentage";
xml.OrderedProduct.orderedProductDiscountAmount = "orderedProductDiscountAmount";
xml.OrderedProduct.orderedProductDiscountExcludingVariants = "orderedProductDiscountExcludingVariants";
xml.OrderedProductVariant.ContentTypeAlias = "uwbsOrderedProductVariant";
xml.OrderedProductVariant.variantId = "variantId";
xml.OrderedProductVariant.typeAlias = "typeAlias";
xml.OrderedProductVariant.title = "title";
xml.OrderedProductVariant.sku = "sku";
xml.OrderedProductVariant.group = "group";
xml.OrderedProductVariant.length = "length";
xml.OrderedProductVariant.width = "width";
xml.OrderedProductVariant.height = "height";
xml.OrderedProductVariant.weight = "weight";
xml.OrderedProductVariant.price = "price";
xml.OrderedProductVariant.ranges = "ranges";
xml.OrderedProductVariant.discountPercentage = "discountPercentage";
xml.OrderedProductVariant.discountAmount = "discountAmount";
xml.OrderRepository.ContentTypeAlias = "uwbsOrderRepository";
xml.OrderRepository.orderSection = "orderSection";
xml.OrderStoreFolder.ContentTypeAlias = "uwbsOrderStoreFolder";
xml.PaymentProvider.ContentTypeAlias = "uwbsPaymentProvider";
xml.PaymentProvider.title = "title";
xml.PaymentProvider.description = "description";
xml.PaymentProvider.image = "image";
xml.PaymentProvider.type = "type";
xml.PaymentProvider.zone = "zone";
xml.PaymentProvider.successNode = "successNode";
xml.PaymentProvider.errorNode = "errorNode";
xml.PaymentProvider.cancelNode = "cancelNode";
xml.PaymentProvider.testMode = "testMode";
xml.PaymentProviderMethod.ContentTypeAlias = "uwbsPaymentProviderMethod";
xml.PaymentProviderMethod.disable = "disable";
xml.PaymentProviderMethod.title = "title";
xml.PaymentProviderMethod.description = "description";
xml.PaymentProviderMethod.image = "image";
xml.PaymentProviderMethod.price = "price";
xml.PaymentProviderMethod.vat = "vat";
xml.PaymentProviderMethod.amountType = "amountType";
xml.PaymentProviderRepository.ContentTypeAlias = "uwbsPaymentProviderRepository";
xml.PaymentProviderSection.ContentTypeAlias = "uwbsPaymentProviderSection";
xml.PaymentProviderZone.ContentTypeAlias = "uwbsPaymentProviderZone";
xml.PaymentProviderZone.zone = "zone";
xml.PaymentProviderZoneSection.ContentTypeAlias = "uwbsPaymentProviderZoneSection";
xml.Product.ContentTypeAlias = "uwbsProduct";
xml.Product.sku = "sku";
xml.Product.metaTags = "metaTags";
xml.Product.categories = "categories";
xml.Product.images = "images";
xml.Product.files = "files";
xml.Product.length = "length";
xml.Product.width = "width";
xml.Product.height = "height";
xml.Product.weight = "weight";
xml.Product.price = "price";
xml.Product.ranges = "ranges";
xml.Product.vat = "vat";
xml.Product.stock = "stock";
xml.Product.ordered = "ordered";
xml.Product.stockStatus = "stockStatus";
xml.Product.backorderStatus = "backorderStatus";
xml.Product.useVariantStock = "useVariantStock";
xml.Product.title = "title";
xml.Product.url = "url";
xml.Product.metaDescription = "metaDescription";
xml.Product.description = "description";
xml.Product.disable = "disable";
xml.ProductRepository.ContentTypeAlias = "uwbsProductRepository";
xml.ProductRepository.productOverview = "productOverview";
xml.ProductVariant.ContentTypeAlias = "uwbsProductVariant";
xml.ProductVariant.title = "title";
xml.ProductVariant.sku = "sku";
xml.ProductVariant.disable = "disable";
xml.ProductVariant.description = "description";
xml.ProductVariant.length = "length";
xml.ProductVariant.width = "width";
xml.ProductVariant.height = "height";
xml.ProductVariant.weight = "weight";
xml.ProductVariant.price = "price";
xml.ProductVariant.ranges = "ranges";
xml.ProductVariant.stock = "stock";
xml.ProductVariant.ordered = "ordered";
xml.ProductVariant.stockStatus = "stockStatus";
xml.ProductVariant.backorderStatus = "backorderStatus";
xml.ProductVariantGroup.ContentTypeAlias = "uwbsProductVariantGroup";
xml.ProductVariantGroup.title = "title";
xml.ProductVariantGroup.required = "required";
xml.ProductVariantGroup.description = "description";
xml.Settings.ContentTypeAlias = "uwbsSettings";
xml.Settings.includingVat = "includingVat";
xml.Settings.lowercaseUrls = "lowercaseUrls";
xml.Settings.incompleteOrderLifetime = "incompleteOrderLifetime";
xml.ShippingProvider.ContentTypeAlias = "uwbsShippingProvider";
xml.ShippingProvider.title = "title";
xml.ShippingProvider.description = "description";
xml.ShippingProvider.image = "image";
xml.ShippingProvider.type = "type";
xml.ShippingProvider.rangeType = "rangeType";
xml.ShippingProvider.rangeStart = "rangeStart";
xml.ShippingProvider.rangeEnd = "rangeEnd";
xml.ShippingProvider.overrule = "overrule";
xml.ShippingProvider.zone = "zone";
xml.ShippingProvider.testMode = "testMode";
xml.ShippingProviderMethod.ContentTypeAlias = "uwbsShippingProviderMethod";
xml.ShippingProviderMethod.disable = "disable";
xml.ShippingProviderMethod.title = "title";
xml.ShippingProviderMethod.description = "description";
xml.ShippingProviderMethod.image = "image";
xml.ShippingProviderMethod.price = "price";
xml.ShippingProviderMethod.vat = "vat";
xml.ShippingProviderRepository.ContentTypeAlias = "uwbsShippingProviderRepository";
xml.ShippingProviderSection.ContentTypeAlias = "uwbsShippingProviderSection";
xml.ShippingProviderZone.ContentTypeAlias = "uwbsShippingProviderZone";
xml.ShippingProviderZone.zone = "zone";
xml.ShippingProviderZoneSection.ContentTypeAlias = "uwbsShippingProviderZoneSection";
xml.Store.ContentTypeAlias = "uwbsStore";
xml.Store.storeCulture = "storeCulture";
xml.Store.countryCode = "countryCode";
xml.Store.currencies = "currencies";
xml.Store.globalVat = "globalVat";
xml.Store.orderNumberPrefix = "orderNumberPrefix";
xml.Store.orderNumberTemplate = "orderNumberTemplate";
xml.Store.orderNumberStartNumber = "orderNumberStartNumber";
xml.Store.enableStock = "enableStock";
xml.Store.defaultUseVariantStock = "defaultUseVariantStock";
xml.Store.defaultCountdownEnabled = "defaultCountdownEnabled";
xml.Store.storeStock = "storeStock";
xml.Store.useBackorders = "useBackorders";
xml.Store.enableTestmode = "enableTestmode";
xml.Store.storeEmailFrom = "storeEmailFrom";
xml.Store.storeEmailFromName = "storeEmailFromName";
xml.Store.storeEmailTo = "storeEmailTo";
xml.Store.accountEmailCreated = "accountEmailCreated";
xml.Store.accountForgotPassword = "******";
xml.Store.confirmationEmailStore = "confirmationEmailStore";
xml.Store.confirmationEmailCustomer = "confirmationEmailCustomer";
xml.Store.onlinePaymentEmailStore = "onlinePaymentEmailStore";
xml.Store.onlinePaymentEmailCustomer = "onlinePaymentEmailCustomer";
xml.Store.offlinePaymentEmailStore = "offlinePaymentEmailStore";
xml.Store.offlinePaymentEmailCustomer = "offlinePaymentEmailCustomer";
xml.Store.paymentFailedEmailStore = "paymentFailedEmailStore";
xml.Store.paymentFailedEmailCustomer = "paymentFailedEmailCustomer";
xml.Store.dispatchedEmailStore = "dispatchedEmailStore";
xml.Store.dispatchedEmailCustomer = "dispatchedEmailCustomer";
xml.Store.cancelEmailStore = "cancelEmailStore";
xml.Store.cancelEmailCustomer = "cancelEmailCustomer";
xml.Store.closedEmailStore = "closedEmailStore";
xml.Store.closedEmailCustomer = "closedEmailCustomer";
xml.Store.pendingEmailStore = "pendingEmailStore";
xml.Store.pendingEmailCustomer = "pendingEmailCustomer";
xml.Store.temporaryOutOfStockEmailStore = "temporaryOutOfStockEmailStore";
xml.Store.temporaryOutOfStockEmailCustomer = "temporaryOutOfStockEmailCustomer";
xml.Store.undeliverableEmailStore = "undeliverableEmailStore";
xml.Store.undeliverableEmailCustomer = "undeliverableEmailCustomer";
xml.Store.returnEmailStore = "returnEmailStore";
xml.Store.returnEmailCustomer = "returnEmailCustomer";
xml.StoreRepository.ContentTypeAlias = "uwbsStoreRepository";
xml.UwebshopRoot.ContentTypeAlias = "uWebshop";
	var settings = new XmlWriterSettings();
	settings.OmitXmlDeclaration = true;
	settings.ConformanceLevel = ConformanceLevel.Document;
	settings.CloseOutput = false;
	settings.Indent = true;
	using (var writer = new System.IO.StringWriter())
		{
			var writerr = XmlWriter.Create(writer, settings);
			var x = new System.Xml.Serialization.XmlSerializer(xml.GetType());
			
			x.Serialize(writerr, xml);
				
			writerr.Flush();
			writerr.Close();
			return writer.ToString();
		}
	}
public static void Initialize(UwebshopAliassesXMLConfig aliasses)
{
Catalog.NodeAlias = aliasses.Catalog.ContentTypeAlias ?? "uwbsCatalog";
Category.NodeAlias = aliasses.Category.ContentTypeAlias ?? "uwbsCategory";
CategoryRepositoryContentType.NodeAlias = aliasses.CategoryRepository.ContentTypeAlias ?? "uwbsCategoryRepository";
DateFolder.NodeAlias = aliasses.DateFolder.ContentTypeAlias ?? "uwbsOrderDateFolder";
DiscountOrder.NodeAlias = aliasses.DiscountOrder.ContentTypeAlias ?? "uwbsDiscountOrder";
DiscountOrderSectionContentType.NodeAlias = aliasses.DiscountOrderSection.ContentTypeAlias ?? "uwbsDiscountOrderSection";
DiscountProduct.NodeAlias = aliasses.DiscountProduct.ContentTypeAlias ?? "uwbsDiscountProduct";
DiscountProductSectionContentType.NodeAlias = aliasses.DiscountProductSection.ContentTypeAlias ?? "uwbsDiscountProductSection";
DiscountRepositoryContentType.NodeAlias = aliasses.DiscountRepository.ContentTypeAlias ?? "uwbsDiscountRepository";
EmailCustomer.NodeAlias = aliasses.EmailCustomer.ContentTypeAlias ?? "uwbsEmailTemplateCustomer";
EmailCustomerSectionContentType.NodeAlias = aliasses.EmailCustomerSection.ContentTypeAlias ?? "uwbsEmailTemplateCustomerSection";
EmailRepositoryContentType.NodeAlias = aliasses.EmailRepository.ContentTypeAlias ?? "uwbsEmailRepository";
EmailStore.NodeAlias = aliasses.EmailStore.ContentTypeAlias ?? "uwbsEmailTemplateStore";
EmailStoreSectionContentType.NodeAlias = aliasses.EmailStoreSection.ContentTypeAlias ?? "uwbsEmailTemplateStoreSection";
Order.NodeAlias = aliasses.Order.ContentTypeAlias ?? "uwbsOrder";
OrderedProduct.NodeAlias = aliasses.OrderedProduct.ContentTypeAlias ?? "uwbsOrderedProduct";
OrderedProductVariant.NodeAlias = aliasses.OrderedProductVariant.ContentTypeAlias ?? "uwbsOrderedProductVariant";
OrderRepositoryContentType.NodeAlias = aliasses.OrderRepository.ContentTypeAlias ?? "uwbsOrderRepository";
OrderStoreFolder.NodeAlias = aliasses.OrderStoreFolder.ContentTypeAlias ?? "uwbsOrderStoreFolder";
PaymentProvider.NodeAlias = aliasses.PaymentProvider.ContentTypeAlias ?? "uwbsPaymentProvider";
PaymentProviderMethod.NodeAlias = aliasses.PaymentProviderMethod.ContentTypeAlias ?? "uwbsPaymentProviderMethod";
PaymentProviderRepositoryContentType.NodeAlias = aliasses.PaymentProviderRepository.ContentTypeAlias ?? "uwbsPaymentProviderRepository";
PaymentProviderSectionContentType.NodeAlias = aliasses.PaymentProviderSection.ContentTypeAlias ?? "uwbsPaymentProviderSection";
PaymentProviderZone.NodeAlias = aliasses.PaymentProviderZone.ContentTypeAlias ?? "uwbsPaymentProviderZone";
PaymentProviderZoneSectionContentType.NodeAlias = aliasses.PaymentProviderZoneSection.ContentTypeAlias ?? "uwbsPaymentProviderZoneSection";
Product.NodeAlias = aliasses.Product.ContentTypeAlias ?? "uwbsProduct";
ProductRepositoryContentType.NodeAlias = aliasses.ProductRepository.ContentTypeAlias ?? "uwbsProductRepository";
ProductVariant.NodeAlias = aliasses.ProductVariant.ContentTypeAlias ?? "uwbsProductVariant";
ProductVariantGroup.NodeAlias = aliasses.ProductVariantGroup.ContentTypeAlias ?? "uwbsProductVariantGroup";
Settings.NodeAlias = aliasses.Settings.ContentTypeAlias ?? "uwbsSettings";
ShippingProvider.NodeAlias = aliasses.ShippingProvider.ContentTypeAlias ?? "uwbsShippingProvider";
ShippingProviderMethod.NodeAlias = aliasses.ShippingProviderMethod.ContentTypeAlias ?? "uwbsShippingProviderMethod";
ShippingProviderRepositoryContentType.NodeAlias = aliasses.ShippingProviderRepository.ContentTypeAlias ?? "uwbsShippingProviderRepository";
ShippingProviderSectionContentType.NodeAlias = aliasses.ShippingProviderSection.ContentTypeAlias ?? "uwbsShippingProviderSection";
ShippingProviderZone.NodeAlias = aliasses.ShippingProviderZone.ContentTypeAlias ?? "uwbsShippingProviderZone";
ShippingProviderZoneSectionContentType.NodeAlias = aliasses.ShippingProviderZoneSection.ContentTypeAlias ?? "uwbsShippingProviderZoneSection";
Store.NodeAlias = aliasses.Store.ContentTypeAlias ?? "uwbsStore";
StoreRepositoryContentType.NodeAlias = aliasses.StoreRepository.ContentTypeAlias ?? "uwbsStoreRepository";
UwebshopRootContentType.NodeAlias = aliasses.UwebshopRoot.ContentTypeAlias ?? "uWebshop";
}