Example #1
0
 public VendorController(CaptchaSettings captchaSettings,
                         ICustomerService customerService,
                         IDownloadService downloadService,
                         IGenericAttributeService genericAttributeService,
                         IHtmlFormatter htmlFormatter,
                         ILocalizationService localizationService,
                         IPictureService pictureService,
                         IUrlRecordService urlRecordService,
                         IVendorAttributeParser vendorAttributeParser,
                         IVendorAttributeService vendorAttributeService,
                         IVendorModelFactory vendorModelFactory,
                         IVendorService vendorService,
                         IWorkContext workContext,
                         IWorkflowMessageService workflowMessageService,
                         LocalizationSettings localizationSettings,
                         VendorSettings vendorSettings)
 {
     _captchaSettings         = captchaSettings;
     _customerService         = customerService;
     _downloadService         = downloadService;
     _genericAttributeService = genericAttributeService;
     _htmlFormatter           = htmlFormatter;
     _localizationService     = localizationService;
     _pictureService          = pictureService;
     _urlRecordService        = urlRecordService;
     _vendorAttributeParser   = vendorAttributeParser;
     _vendorAttributeService  = vendorAttributeService;
     _vendorModelFactory      = vendorModelFactory;
     _vendorService           = vendorService;
     _workContext             = workContext;
     _workflowMessageService  = workflowMessageService;
     _localizationSettings    = localizationSettings;
     _vendorSettings          = vendorSettings;
 }
Example #2
0
        public ViewRenderer(
            IIdentifierDefaults identifierDefaults,
            IHtmlFormatter formatter,
            IReadOnlyCollection <IDatabaseView> views,
            ReferencedObjectTargets referencedObjectTargets,
            DirectoryInfo exportDirectory
            )
        {
            if (views == null || views.AnyNull())
            {
                throw new ArgumentNullException(nameof(views));
            }

            Views = views;

            IdentifierDefaults      = identifierDefaults ?? throw new ArgumentNullException(nameof(identifierDefaults));
            Formatter               = formatter ?? throw new ArgumentNullException(nameof(formatter));
            ReferencedObjectTargets = referencedObjectTargets ?? throw new ArgumentNullException(nameof(referencedObjectTargets));

            if (exportDirectory == null)
            {
                throw new ArgumentNullException(nameof(exportDirectory));
            }

            ExportDirectory = new DirectoryInfo(Path.Combine(exportDirectory.FullName, "views"));
        }
Example #3
0
 public OrderService(IHtmlFormatter htmlFormatter,
                     IProductService productService,
                     IRepository <Address> addressRepository,
                     IRepository <Customer> customerRepository,
                     IRepository <Order> orderRepository,
                     IRepository <OrderItem> orderItemRepository,
                     IRepository <OrderNote> orderNoteRepository,
                     IRepository <Product> productRepository,
                     IRepository <ProductWarehouseInventory> productWarehouseInventoryRepository,
                     IRepository <RecurringPayment> recurringPaymentRepository,
                     IRepository <RecurringPaymentHistory> recurringPaymentHistoryRepository,
                     IShipmentService shipmentService)
 {
     _htmlFormatter       = htmlFormatter;
     _productService      = productService;
     _addressRepository   = addressRepository;
     _customerRepository  = customerRepository;
     _orderRepository     = orderRepository;
     _orderItemRepository = orderItemRepository;
     _orderNoteRepository = orderNoteRepository;
     _productRepository   = productRepository;
     _productWarehouseInventoryRepository = productWarehouseInventoryRepository;
     _recurringPaymentRepository          = recurringPaymentRepository;
     _recurringPaymentHistoryRepository   = recurringPaymentHistoryRepository;
     _shipmentService = shipmentService;
 }
 public ProductAttributeFormatter(ICurrencyService currencyService,
                                  IDownloadService downloadService,
                                  IHtmlFormatter htmlFormatter,
                                  ILocalizationService localizationService,
                                  IPriceCalculationService priceCalculationService,
                                  IPriceFormatter priceFormatter,
                                  IProductAttributeParser productAttributeParser,
                                  IProductAttributeService productAttributeService,
                                  ITaxService taxService,
                                  IWebHelper webHelper,
                                  IWorkContext workContext,
                                  ShoppingCartSettings shoppingCartSettings)
 {
     _currencyService         = currencyService;
     _downloadService         = downloadService;
     _htmlFormatter           = htmlFormatter;
     _localizationService     = localizationService;
     _priceCalculationService = priceCalculationService;
     _priceFormatter          = priceFormatter;
     _productAttributeParser  = productAttributeParser;
     _productAttributeService = productAttributeService;
     _taxService           = taxService;
     _webHelper            = webHelper;
     _workContext          = workContext;
     _shoppingCartSettings = shoppingCartSettings;
 }
Example #5
0
        public TableRenderer(
            IIdentifierDefaults identifierDefaults,
            IHtmlFormatter formatter,
            IReadOnlyCollection <IRelationalDatabaseTable> tables,
            IReadOnlyDictionary <Identifier, ulong> rowCounts,
            DirectoryInfo exportDirectory
            )
        {
            if (tables == null || tables.AnyNull())
            {
                throw new ArgumentNullException(nameof(tables));
            }

            Tables = tables;

            IdentifierDefaults = identifierDefaults ?? throw new ArgumentNullException(nameof(identifierDefaults));
            Formatter          = formatter ?? throw new ArgumentNullException(nameof(formatter));
            RowCounts          = rowCounts ?? throw new ArgumentNullException(nameof(rowCounts));

            if (exportDirectory == null)
            {
                throw new ArgumentNullException(nameof(exportDirectory));
            }

            ExportDirectory = new DirectoryInfo(Path.Combine(exportDirectory.FullName, "tables"));
        }
Example #6
0
 public virtual IHtmlFormatter GetHtmlFormatter()
 {
     if ((_htmlFormatter == null) && (_htmlFormatterDelegation != null))
     {
         _htmlFormatter = (IHtmlFormatter)_htmlFormatterDelegation.GetDelegate();
         log.Debug("created field.htmlFormatter delegate: " + _htmlFormatter);
     }
     return(_htmlFormatter);
 }
Example #7
0
 public ProductController(CaptchaSettings captchaSettings,
                          CatalogSettings catalogSettings,
                          IAclService aclService,
                          ICompareProductsService compareProductsService,
                          ICustomerActivityService customerActivityService,
                          ICustomerService customerService,
                          IEventPublisher eventPublisher,
                          IHtmlFormatter htmlFormatter,
                          ILocalizationService localizationService,
                          IOrderService orderService,
                          IPermissionService permissionService,
                          IProductAttributeParser productAttributeParser,
                          IProductModelFactory productModelFactory,
                          IProductService productService,
                          IRecentlyViewedProductsService recentlyViewedProductsService,
                          IReviewTypeService reviewTypeService,
                          IShoppingCartModelFactory shoppingCartModelFactory,
                          IShoppingCartService shoppingCartService,
                          IStoreContext storeContext,
                          IStoreMappingService storeMappingService,
                          IUrlRecordService urlRecordService,
                          IWebHelper webHelper,
                          IWorkContext workContext,
                          IWorkflowMessageService workflowMessageService,
                          LocalizationSettings localizationSettings,
                          ShoppingCartSettings shoppingCartSettings,
                          ShippingSettings shippingSettings)
 {
     _captchaSettings               = captchaSettings;
     _catalogSettings               = catalogSettings;
     _aclService                    = aclService;
     _compareProductsService        = compareProductsService;
     _customerActivityService       = customerActivityService;
     _customerService               = customerService;
     _eventPublisher                = eventPublisher;
     _htmlFormatter                 = htmlFormatter;
     _localizationService           = localizationService;
     _orderService                  = orderService;
     _permissionService             = permissionService;
     _productAttributeParser        = productAttributeParser;
     _productModelFactory           = productModelFactory;
     _productService                = productService;
     _reviewTypeService             = reviewTypeService;
     _recentlyViewedProductsService = recentlyViewedProductsService;
     _shoppingCartModelFactory      = shoppingCartModelFactory;
     _shoppingCartService           = shoppingCartService;
     _storeContext                  = storeContext;
     _storeMappingService           = storeMappingService;
     _urlRecordService              = urlRecordService;
     _webHelper              = webHelper;
     _workContext            = workContext;
     _workflowMessageService = workflowMessageService;
     _localizationSettings   = localizationSettings;
     _shoppingCartSettings   = shoppingCartSettings;
     _shippingSettings       = shippingSettings;
 }
Example #8
0
 public VendorService(IHtmlFormatter htmlFormatter,
                      IRepository <Customer> customerRepository,
                      IRepository <Product> productRepository,
                      IRepository <Vendor> vendorRepository,
                      IRepository <VendorNote> vendorNoteRepository)
 {
     _htmlFormatter        = htmlFormatter;
     _customerRepository   = customerRepository;
     _productRepository    = productRepository;
     _vendorRepository     = vendorRepository;
     _vendorNoteRepository = vendorNoteRepository;
 }
 public VendorAttributeFormatter(IHtmlFormatter htmlFormatter,
                                 ILocalizationService localizationService,
                                 IVendorAttributeParser vendorAttributeParser,
                                 IVendorAttributeService vendorAttributeService,
                                 IWorkContext workContext)
 {
     _htmlFormatter          = htmlFormatter;
     _localizationService    = localizationService;
     _vendorAttributeParser  = vendorAttributeParser;
     _vendorAttributeService = vendorAttributeService;
     _workContext            = workContext;
 }
 public AddressAttributeFormatter(IAddressAttributeParser addressAttributeParser,
                                  IAddressAttributeService addressAttributeService,
                                  IHtmlFormatter htmlFormatter,
                                  ILocalizationService localizationService,
                                  IWorkContext workContext)
 {
     _addressAttributeParser  = addressAttributeParser;
     _addressAttributeService = addressAttributeService;
     _htmlFormatter           = htmlFormatter;
     _localizationService     = localizationService;
     _workContext             = workContext;
 }
 public CustomerAttributeFormatter(ICustomerAttributeParser customerAttributeParser,
                                   ICustomerAttributeService customerAttributeService,
                                   IHtmlFormatter htmlFormatter,
                                   ILocalizationService localizationService,
                                   IWorkContext workContext)
 {
     _customerAttributeParser  = customerAttributeParser;
     _customerAttributeService = customerAttributeService;
     _htmlFormatter            = htmlFormatter;
     _localizationService      = localizationService;
     _workContext = workContext;
 }
 public RelationshipsRenderer(
     IIdentifierDefaults identifierDefaults,
     IHtmlFormatter formatter,
     IEnumerable <IRelationalDatabaseTable> tables,
     IReadOnlyDictionary <Identifier, ulong> rowCounts,
     DirectoryInfo exportDirectory)
 {
     IdentifierDefaults = identifierDefaults ?? throw new ArgumentNullException(nameof(identifierDefaults));
     Formatter          = formatter ?? throw new ArgumentNullException(nameof(formatter));
     Tables             = tables ?? throw new ArgumentNullException(nameof(tables));
     RowCounts          = rowCounts ?? throw new ArgumentNullException(nameof(rowCounts));
     ExportDirectory    = exportDirectory ?? throw new ArgumentNullException(nameof(exportDirectory));
 }
 public LogModelFactory(IBaseAdminModelFactory baseAdminModelFactory,
                        ICustomerService customerService,
                        IDateTimeHelper dateTimeHelper,
                        IHtmlFormatter htmlFormatter,
                        ILocalizationService localizationService,
                        ILogger logger)
 {
     _baseAdminModelFactory = baseAdminModelFactory;
     _dateTimeHelper        = dateTimeHelper;
     _customerService       = customerService;
     _htmlFormatter         = htmlFormatter;
     _localizationService   = localizationService;
     _logger = logger;
 }
Example #14
0
 public TaxTransactionLogController(ICustomerService customerService,
                                    IDateTimeHelper dateTimeHelper,
                                    IHtmlFormatter htmlFormatter,
                                    ILocalizationService localizationService,
                                    INotificationService notificationService,
                                    IPermissionService permissionService,
                                    TaxTransactionLogService taxTransactionLogService)
 {
     _customerService          = customerService;
     _dateTimeHelper           = dateTimeHelper;
     _htmlFormatter            = htmlFormatter;
     _localizationService      = localizationService;
     _notificationService      = notificationService;
     _permissionService        = permissionService;
     _taxTransactionLogService = taxTransactionLogService;
 }
Example #15
0
        public TriggersRenderer(
            IIdentifierDefaults identifierDefaults,
            IHtmlFormatter formatter,
            IReadOnlyCollection <IRelationalDatabaseTable> tables,
            DirectoryInfo exportDirectory)
        {
            if (tables == null || tables.AnyNull())
            {
                throw new ArgumentNullException(nameof(tables));
            }

            Tables = tables;

            IdentifierDefaults = identifierDefaults ?? throw new ArgumentNullException(nameof(identifierDefaults));
            Formatter          = formatter ?? throw new ArgumentNullException(nameof(formatter));
            ExportDirectory    = exportDirectory ?? throw new ArgumentNullException(nameof(exportDirectory));
        }
Example #16
0
        public RoutinesRenderer(
            IIdentifierDefaults identifierDefaults,
            IHtmlFormatter formatter,
            IReadOnlyCollection <IDatabaseRoutine> routines,
            DirectoryInfo exportDirectory)
        {
            if (routines == null || routines.AnyNull())
            {
                throw new ArgumentNullException(nameof(routines));
            }

            Routines = routines;

            IdentifierDefaults = identifierDefaults ?? throw new ArgumentNullException(nameof(identifierDefaults));
            Formatter          = formatter ?? throw new ArgumentNullException(nameof(formatter));
            ExportDirectory    = exportDirectory ?? throw new ArgumentNullException(nameof(exportDirectory));
        }
Example #17
0
        public ViewsRenderer(
            IIdentifierDefaults identifierDefaults,
            IHtmlFormatter formatter,
            IReadOnlyCollection <IDatabaseView> views,
            DirectoryInfo exportDirectory)
        {
            if (views == null || views.AnyNull())
            {
                throw new ArgumentNullException(nameof(views));
            }

            Views = views;

            IdentifierDefaults = identifierDefaults ?? throw new ArgumentNullException(nameof(identifierDefaults));
            Formatter          = formatter ?? throw new ArgumentNullException(nameof(formatter));
            ExportDirectory    = exportDirectory ?? throw new ArgumentNullException(nameof(exportDirectory));
        }
Example #18
0
        public MainRenderer(
            IRelationalDatabase database,
            IHtmlFormatter formatter,
            IReadOnlyCollection <IRelationalDatabaseTable> tables,
            IReadOnlyCollection <IDatabaseView> views,
            IReadOnlyCollection <IDatabaseSequence> sequences,
            IReadOnlyCollection <IDatabaseSynonym> synonyms,
            IReadOnlyCollection <IDatabaseRoutine> routines,
            IReadOnlyDictionary <Identifier, ulong> rowCounts,
            string dbVersion,
            DirectoryInfo exportDirectory)
        {
            if (tables == null || tables.AnyNull())
            {
                throw new ArgumentNullException(nameof(tables));
            }
            if (views == null || views.AnyNull())
            {
                throw new ArgumentNullException(nameof(views));
            }
            if (sequences == null || sequences.AnyNull())
            {
                throw new ArgumentNullException(nameof(sequences));
            }
            if (synonyms == null || synonyms.AnyNull())
            {
                throw new ArgumentNullException(nameof(synonyms));
            }
            if (routines == null || routines.AnyNull())
            {
                throw new ArgumentNullException(nameof(routines));
            }

            Tables    = tables;
            Views     = views;
            Sequences = sequences;
            Synonyms  = synonyms;
            Routines  = routines;

            Database  = database ?? throw new ArgumentNullException(nameof(database));
            Formatter = formatter ?? throw new ArgumentNullException(nameof(formatter));
            RowCounts = rowCounts ?? throw new ArgumentNullException(nameof(rowCounts));
            DatabaseDisplayVersion = dbVersion;
            ExportDirectory        = exportDirectory ?? throw new ArgumentNullException(nameof(exportDirectory));
        }
Example #19
0
        public SynonymsRenderer(
            IIdentifierDefaults identifierDefaults,
            IHtmlFormatter formatter,
            IReadOnlyCollection <IDatabaseSynonym> synonyms,
            SynonymTargets synonymTargets,
            DirectoryInfo exportDirectory)
        {
            if (synonyms == null || synonyms.AnyNull())
            {
                throw new ArgumentNullException(nameof(synonyms));
            }

            Synonyms           = synonyms;
            IdentifierDefaults = identifierDefaults ?? throw new ArgumentNullException(nameof(identifierDefaults));
            Formatter          = formatter ?? throw new ArgumentNullException(nameof(formatter));
            SynonymTargets     = synonymTargets ?? throw new ArgumentNullException(nameof(synonymTargets));
            ExportDirectory    = exportDirectory ?? throw new ArgumentNullException(nameof(exportDirectory));
        }
Example #20
0
        private void AddFormData(IActivityForm activityForm)
        {
            IDictionary userInputFields = (IDictionary)HttpContext.Session["userInputFields"];

            if (userInputFields == null)
            {
                userInputFields = new Hashtable();
            }
            HttpContext.Session.Add("activityForm", activityForm);
            IList       fields     = activityForm.Fields;
            IEnumerator fildEnumer = fields.GetEnumerator();
            IList       formRows   = new ArrayList();

            while (fildEnumer.MoveNext())
            {
                IField field = (IField)fildEnumer.Current;
                // Construct a meaningfull name that is http-compliant
                String attributeName = field.Attribute.Name;
                String parameterName = convertToHttpCompliant(attributeName);

                IHtmlFormatter htmlFormatter = field.GetHtmlFormatter();
                if (htmlFormatter != null)
                {
                    Object objectToFormat = null;
                    if (userInputFields.Contains(attributeName))
                    {
                        objectToFormat = userInputFields[attributeName];
                    }
                    else
                    {
                        objectToFormat = activityForm.AttributeValues[field.Attribute.Name];
                    }
                    // TODO: Test if there is the possibility to simplify the interface, see null
                    String  html    = htmlFormatter.ObjectToHtml(objectToFormat, parameterName, null);
                    FormRow formRow = new FormRow(field, html);
                    formRows.Add(formRow);
                }
                else
                {
                    //log.Warn("skipping field for attribute '" + attributeName + "' because it doesn't have a HtmlFormatter");
                }
            }
            ViewData["formRows"] = formRows;
        }
Example #21
0
        public LintRenderer(
            IRelationalDatabaseLinter linter,
            IIdentifierDefaults identifierDefaults,
            IHtmlFormatter formatter,
            IReadOnlyCollection <IRelationalDatabaseTable> tables,
            IReadOnlyCollection <IDatabaseView> views,
            IReadOnlyCollection <IDatabaseSequence> sequences,
            IReadOnlyCollection <IDatabaseSynonym> synonyms,
            IReadOnlyCollection <IDatabaseRoutine> routines,
            DirectoryInfo exportDirectory
            )
        {
            if (tables == null || tables.AnyNull())
            {
                throw new ArgumentNullException(nameof(tables));
            }
            if (views == null || views.AnyNull())
            {
                throw new ArgumentNullException(nameof(views));
            }
            if (sequences == null || sequences.AnyNull())
            {
                throw new ArgumentNullException(nameof(sequences));
            }
            if (synonyms == null || synonyms.AnyNull())
            {
                throw new ArgumentNullException(nameof(synonyms));
            }
            if (routines == null || routines.AnyNull())
            {
                throw new ArgumentNullException(nameof(routines));
            }

            Tables    = tables;
            Views     = views;
            Sequences = sequences;
            Synonyms  = synonyms;
            Routines  = routines;

            Linter             = linter ?? throw new ArgumentNullException(nameof(linter));
            IdentifierDefaults = identifierDefaults ?? throw new ArgumentNullException(nameof(identifierDefaults));
            Formatter          = formatter ?? throw new ArgumentNullException(nameof(formatter));
            ExportDirectory    = exportDirectory ?? throw new ArgumentNullException(nameof(exportDirectory));
        }
Example #22
0
        public TriggerRenderer(
            IHtmlFormatter formatter,
            IReadOnlyCollection <IRelationalDatabaseTable> tables,
            DirectoryInfo exportDirectory
            )
        {
            if (tables == null || tables.AnyNull())
            {
                throw new ArgumentNullException(nameof(tables));
            }

            Tables    = tables;
            Formatter = formatter ?? throw new ArgumentNullException(nameof(formatter));

            if (exportDirectory == null)
            {
                throw new ArgumentNullException(nameof(exportDirectory));
            }

            ExportDirectory = new DirectoryInfo(Path.Combine(exportDirectory.FullName, "tables"));
        }
Example #23
0
 public CommonController(CaptchaSettings captchaSettings,
                         CommonSettings commonSettings,
                         ICommonModelFactory commonModelFactory,
                         ICurrencyService currencyService,
                         ICustomerActivityService customerActivityService,
                         IGenericAttributeService genericAttributeService,
                         IHtmlFormatter htmlFormatter,
                         ILanguageService languageService,
                         ILocalizationService localizationService,
                         IStoreContext storeContext,
                         IThemeContext themeContext,
                         IVendorService vendorService,
                         IWorkContext workContext,
                         IWorkflowMessageService workflowMessageService,
                         LocalizationSettings localizationSettings,
                         SitemapSettings sitemapSettings,
                         SitemapXmlSettings sitemapXmlSettings,
                         StoreInformationSettings storeInformationSettings,
                         VendorSettings vendorSettings)
 {
     _captchaSettings          = captchaSettings;
     _commonSettings           = commonSettings;
     _commonModelFactory       = commonModelFactory;
     _currencyService          = currencyService;
     _customerActivityService  = customerActivityService;
     _genericAttributeService  = genericAttributeService;
     _htmlFormatter            = htmlFormatter;
     _languageService          = languageService;
     _localizationService      = localizationService;
     _storeContext             = storeContext;
     _themeContext             = themeContext;
     _vendorService            = vendorService;
     _workContext              = workContext;
     _workflowMessageService   = workflowMessageService;
     _localizationSettings     = localizationSettings;
     _sitemapSettings          = sitemapSettings;
     _sitemapXmlSettings       = sitemapXmlSettings;
     _storeInformationSettings = storeInformationSettings;
     _vendorSettings           = vendorSettings;
 }
Example #24
0
 public CheckoutAttributeFormatter(ICheckoutAttributeParser checkoutAttributeParser,
                                   ICheckoutAttributeService checkoutAttributeService,
                                   ICurrencyService currencyService,
                                   IDownloadService downloadService,
                                   IHtmlFormatter htmlFormatter,
                                   ILocalizationService localizationService,
                                   IPriceFormatter priceFormatter,
                                   ITaxService taxService,
                                   IWebHelper webHelper,
                                   IWorkContext workContext)
 {
     _checkoutAttributeParser  = checkoutAttributeParser;
     _checkoutAttributeService = checkoutAttributeService;
     _currencyService          = currencyService;
     _downloadService          = downloadService;
     _htmlFormatter            = htmlFormatter;
     _localizationService      = localizationService;
     _priceFormatter           = priceFormatter;
     _taxService  = taxService;
     _webHelper   = webHelper;
     _workContext = workContext;
 }
 public ProductReviewModelFactory(CatalogSettings catalogSettings,
                                  IBaseAdminModelFactory baseAdminModelFactory,
                                  ICustomerService customerService,
                                  IDateTimeHelper dateTimeHelper,
                                  IHtmlFormatter htmlFormatter,
                                  ILocalizationService localizationService,
                                  IProductService productService,
                                  IReviewTypeService reviewTypeService,
                                  IStoreService storeService,
                                  IWorkContext workContext)
 {
     _catalogSettings       = catalogSettings;
     _baseAdminModelFactory = baseAdminModelFactory;
     _customerService       = customerService;
     _dateTimeHelper        = dateTimeHelper;
     _htmlFormatter         = htmlFormatter;
     _localizationService   = localizationService;
     _productService        = productService;
     _reviewTypeService     = reviewTypeService;
     _storeService          = storeService;
     _workContext           = workContext;
 }
Example #26
0
        public SequenceRenderer(
            IIdentifierDefaults identifierDefaults,
            IHtmlFormatter formatter,
            IReadOnlyCollection <IDatabaseSequence> sequences,
            DirectoryInfo exportDirectory
            )
        {
            if (sequences == null || sequences.AnyNull())
            {
                throw new ArgumentNullException(nameof(sequences));
            }

            Sequences = sequences;

            IdentifierDefaults = identifierDefaults ?? throw new ArgumentNullException(nameof(identifierDefaults));
            Formatter          = formatter ?? throw new ArgumentNullException(nameof(formatter));

            if (exportDirectory == null)
            {
                throw new ArgumentNullException(nameof(exportDirectory));
            }

            ExportDirectory = new DirectoryInfo(Path.Combine(exportDirectory.FullName, "sequences"));
        }
 public NewsModelFactory(CatalogSettings catalogSettings,
                         IBaseAdminModelFactory baseAdminModelFactory,
                         ICustomerService customerService,
                         IDateTimeHelper dateTimeHelper,
                         IHtmlFormatter htmlFormatter,
                         ILanguageService languageService,
                         ILocalizationService localizationService,
                         INewsService newsService,
                         IStoreMappingSupportedModelFactory storeMappingSupportedModelFactory,
                         IStoreService storeService,
                         IUrlRecordService urlRecordService)
 {
     _catalogSettings                   = catalogSettings;
     _customerService                   = customerService;
     _baseAdminModelFactory             = baseAdminModelFactory;
     _dateTimeHelper                    = dateTimeHelper;
     _htmlFormatter                     = htmlFormatter;
     _languageService                   = languageService;
     _localizationService               = localizationService;
     _newsService                       = newsService;
     _storeMappingSupportedModelFactory = storeMappingSupportedModelFactory;
     _storeService                      = storeService;
     _urlRecordService                  = urlRecordService;
 }
Example #28
0
		public IHtmlFormatter GetHtmlFormatter()
		{
			if ((_htmlFormatter == null) && (_htmlFormatterDelegation != null))
			{
				_htmlFormatter = (IHtmlFormatter) _htmlFormatterDelegation.GetDelegate();
				log.Debug("created field.htmlFormatter delegate: " + _htmlFormatter);
			}
			return _htmlFormatter;
		}
Example #29
0
        public ActionResult ActivityForm(string aa)
        {
            IDictionary   userInputFields = new Hashtable();
            IActivityForm activityForm    = (IActivityForm)HttpContext.Session["activityForm"];
            IList         fields          = activityForm.Fields;
            IEnumerator   fildEnumer      = fields.GetEnumerator();

            while (fildEnumer.MoveNext())
            {
                IField field = (IField)fildEnumer.Current;
                // Construct a meaningfull name that is http-compliant
                String attributeName  = field.Attribute.Name;
                String parameterName  = convertToHttpCompliant(attributeName);
                String parameterValue = HttpContext.Request.Params[parameterName];

                if (FieldAccessHelper.IsRequired(field.Access) && (parameterValue == null || "".Equals(parameterValue)))
                {
                    //AddMessage("Field "+field.Name+" is required. Please, provide a value");
                }
                else
                {
                    try
                    {
                        Object         parsedParameter = null;
                        IHtmlFormatter htmlFormatter   = field.GetHtmlFormatter();
                        if (htmlFormatter != null)
                        {
                            // TODO: Test if there is the possibility to simplify the interface, see null
                            parsedParameter = htmlFormatter.ParseHttpParameter(parameterValue, null);

                            if (parsedParameter != null)
                            {
                                userInputFields.Add(attributeName, parsedParameter);
                            }
                        }
                        else
                        {
                            //log.Warn("No htmlformatter defined for field:"+field.Name);
                        }
                    }
                    catch (Exception ex)
                    {
                        //log.Debug( "error parsing user-input-field " + field.Name + " : " + parameterValue,ex);
                        //AddMessage("error parsing user-input-field " + field.Name + " with value: " + parameterValue);
                    }
                }
            }

            if (false)
            {
                //log.Debug( "submitted activity-form has messages, redirecting to activityFormPage..." );
                HttpContext.Session.Add("userInputFields", userInputFields);
                if (activityForm.Flow == null)
                {
                    return(RedirectToAction("ActivityForm", "Form",
                                            new RouteValueDictionary()
                    {
                        { "flowId", activityForm.ProcessDefinition.Id }
                    }));
                    //StartProcessInstance(activityForm.ProcessDefinition.Id);
                }
                else
                {
                    return(RedirectToAction("ActivityForm", "Form", new RouteValueDictionary()));
                    //ShowActivityForm(activityForm.Flow.Id);
                }
            }
            else
            {
                // remove the old inputvalues
                HttpContext.Session.Remove("userInputFields");
                //log.Debug( "submitting the form..." );
                IList activatedFlows = null;
                IFlow flow           = activityForm.Flow;
                // if there is no flow in the activityForm
                IExecutionSessionLocal executionComponent = null;
                try
                {
                    executionComponent = ServiceLocator.Instance.GetService(typeof(IExecutionSessionLocal)) as IExecutionSessionLocal;
                    if (flow == null)
                    {
                        // this means that it is a start-activity being performed so we have to
                        // start a new process instance
                        IProcessDefinition processDefinition = activityForm.ProcessDefinition;
                        IProcessInstance   processInstance   = executionComponent.StartProcessInstance(processDefinition.Id, userInputFields);
                        activatedFlows = new ArrayList();
                        //AddAllActiveFlows(processInstance.RootFlow,activatedFlows);
                        //activatedFlows.Add(processInstance.RootFlow);
                    }
                    else
                    {
                        activatedFlows = executionComponent.PerformActivity(flow.Id, userInputFields);
                    }
                }
                finally
                {
                    ServiceLocator.Instance.Release(executionComponent);
                }
                if (activatedFlows.Count > 0)
                {
                    System.Text.StringBuilder feedbackBuffer = new System.Text.StringBuilder();
                    for (int i = 0; i < activatedFlows.Count; ++i)
                    {
                        IFlow activatedFlow = (IFlow)activatedFlows[i];

                        if (activatedFlow.GetActor() != null)
                        {
                            feedbackBuffer.Append(activatedFlow.GetActor().Name);
                        }
                        else
                        {
                            // when flow's node is start-state no actor is assigned to it, this is to handle the NPE thrown
                            feedbackBuffer.Append("Nobody");
                        }
                        if (i + 1 < activatedFlows.Count)
                        {
                            feedbackBuffer.Append(", ");
                        }
                    }

                    if (activatedFlows.Count > 1)
                    {
                        //AddMessage("Now, following people are handling this process :"+feedbackBuffer.ToString());
                    }
                    else
                    {
                        //AddMessage("Now, "+  feedbackBuffer.ToString() +" is handling this process");
                    }
                    return(Redirect("/User/ShowHome"));
                }
                else
                {
                    //AddMessage("This flow in the process finished");
                    return(Redirect("/User/ShowHome"));
                }
            }
        }