コード例 #1
0
 public ReportController(
     IOrchardServices services,
     IProcessService processService,
     ISortService sortService,
     ISecureFileService secureFileService,
     ICfgService cfgService,
     ISlugService slugService,
     IAppDataFolder appDataFolder,
     IClock clock,
     IBatchCreateService batchCreateService,
     IBatchWriteService batchWriteService,
     IBatchRunService batchRunService,
     IBatchRedirectService batchRedirectService,
     IFileService fileService
     )
 {
     _orchardServices      = services;
     _processService       = processService;
     _secureFileService    = secureFileService;
     _sortService          = sortService;
     _batchCreateService   = batchCreateService;
     _batchWriteService    = batchWriteService;
     _batchRunService      = batchRunService;
     _batchRedirectService = batchRedirectService;
     T      = NullLocalizer.Instance;
     Logger = NullLogger.Instance;
 }
コード例 #2
0
 public CalendarController(
     IOrchardServices services,
     IProcessService processService,
     ISecureFileService secureFileService
     )
 {
     _orchardServices   = services;
     _processService    = processService;
     _secureFileService = secureFileService;
 }
コード例 #3
0
 public ReportController(
     IOrchardServices services,
     IProcessService processService,
     ISortService sortService,
     ISecureFileService secureFileService
     )
 {
     _orchardServices   = services;
     _processService    = processService;
     _secureFileService = secureFileService;
     _sortService       = sortService;
 }
コード例 #4
0
 public FileController(
     IOrchardServices services,
     IFileService fileService,
     IRoleService roleService,
     ISecureFileService secureFileService
     )
 {
     _orchardServices   = services;
     _fileService       = fileService;
     _roleService       = roleService;
     _secureFileService = secureFileService;
     T = NullLocalizer.Instance;
 }
コード例 #5
0
 public FormController(
     IOrchardServices services,
     IProcessService processService,
     ISecureFileService secureFileService,
     IFileService fileService
     )
 {
     _orchardServices   = services;
     _processService    = processService;
     _secureFileService = secureFileService;
     _fileService       = fileService;
     T      = NullLocalizer.Instance;
     Logger = NullLogger.Instance;
 }
コード例 #6
0
 public ApiController(
     IOrchardServices orchardServices,
     IIpRangeService ipRangeService,
     IProcessService processService,
     ISortService sortService,
     ISecureFileService secureFileService
     )
 {
     _orchardServices   = orchardServices;
     _ipRangeService    = ipRangeService;
     _processService    = processService;
     _sortService       = sortService;
     _secureFileService = secureFileService;
     T      = NullLocalizer.Instance;
     Logger = NullLogger.Instance;
 }
コード例 #7
0
 public PivotTableController(
     IOrchardServices services,
     IProcessService processService,
     ISortService sortService,
     ISecureFileService secureFileService,
     ICfgService cfgService,
     ISlugService slugService,
     IAppDataFolder appDataFolder,
     IClock clock,
     IBatchCreateService batchCreateService,
     IBatchWriteService batchWriteService,
     IBatchRunService batchRunService,
     IBatchRedirectService batchRedirectService,
     IFileService fileService
     )
 {
     _orchardServices   = services;
     _processService    = processService;
     _secureFileService = secureFileService;
 }
コード例 #8
0
 public CfgController(
     IOrchardServices services,
     IProcessService processService,
     ISortService sortService,
     ISecureFileService secureFileService,
     ICfgService cfgService,
     ISlugService slugService,
     ITemplateProcessor templateProcessor
     )
 {
     _orchardServices   = services;
     _processService    = processService;
     _secureFileService = secureFileService;
     _cfgService        = cfgService;
     _sortService       = sortService;
     _slugService       = slugService;
     _templateProcessor = templateProcessor;
     T      = NullLocalizer.Instance;
     Logger = NullLogger.Instance;
 }
コード例 #9
0
 public ActionController(
     IOrchardServices services,
     IProcessService processService,
     ISecureFileService secureFileService,
     IBatchCreateService batchCreateService,
     IBatchWriteService batchWriteService,
     IBatchRunService batchRunService,
     IBatchRedirectService batchRedirectService
     )
 {
     _orchardServices      = services;
     _processService       = processService;
     _secureFileService    = secureFileService;
     _batchCreateService   = batchCreateService;
     _batchWriteService    = batchWriteService;
     _batchRunService      = batchRunService;
     _batchRedirectService = batchRedirectService;
     T      = NullLocalizer.Instance;
     Logger = NullLogger.Instance;
 }
コード例 #10
0
        public static IDictionary <string, string> GetParameters(
            HttpRequestBase request,
            ISecureFileService secureFileService,
            IOrchardServices orchard
            )
        {
            var parameters = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);

            if (request != null)
            {
                if (request.QueryString != null)
                {
                    foreach (string key in request.QueryString)
                    {
                        if (key == null)
                        {
                            continue;
                        }
                        parameters[key] = request.QueryString[key];
                    }
                }
                if (request.Form != null)
                {
                    foreach (string key in request.Form)
                    {
                        if (key == null)
                        {
                            continue;
                        }
                        if (!key.Equals("__requestverificationtoken", StringComparison.OrdinalIgnoreCase))
                        {
                            parameters[key] = request.Form[key];
                        }
                    }
                }
            }

            // handle input file
            int inputFileId;

            if (parameters.ContainsKey(Common.InputFileIdName) && int.TryParse(parameters[Common.InputFileIdName], out inputFileId))
            {
                var response = secureFileService.Get(inputFileId);
                if (response.Status == 200)
                {
                    parameters[Common.InputFilePath]      = response.Part.FullPath;
                    parameters[Common.InputFileName]      = response.Part.FileName();
                    parameters[Common.InputFileTitleName] = response.Part.Title();
                }
                else
                {
                    parameters[Common.InputFilePath]      = response.Message;
                    parameters[Common.InputFileName]      = response.Message;
                    parameters[Common.InputFileTitleName] = response.Message;
                }
            }
            else
            {
                parameters[Common.InputFileIdName] = "0";
            }

            AddOrchardVariables(parameters, orchard, request);
            return(parameters);
        }
コード例 #11
0
ファイル: Common.cs プロジェクト: brumschlag/Transformalize
        public static IDictionary <string, string> GetParameters(
            HttpRequestBase request,
            ISecureFileService secureFileService,
            IOrchardServices orchard
            )
        {
            var parameters = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);

            if (request != null)
            {
                if (request.QueryString != null)
                {
                    foreach (string key in request.QueryString)
                    {
                        parameters[key] = request.QueryString[key];
                    }
                }
                if (request.Form != null)
                {
                    foreach (string key in request.Form)
                    {
                        if (!key.Equals("__requestverificationtoken", StringComparison.OrdinalIgnoreCase))
                        {
                            parameters[key] = request.Form[key];
                        }
                    }
                }
            }
            if (!parameters.ContainsKey("user"))
            {
                var defaultUser = ConfigurationManager.AppSettings["default-user"];
                if (!string.IsNullOrEmpty(defaultUser))
                {
                    parameters["user"] = defaultUser;
                }
            }
            if (!parameters.ContainsKey("password"))
            {
                var defaultPassword = ConfigurationManager.AppSettings["default-password"];
                if (!string.IsNullOrEmpty(defaultPassword))
                {
                    parameters["password"] = defaultPassword;
                }
            }

            // handle input file
            int inputFileId;

            if (parameters.ContainsKey(Common.InputFileIdName) && int.TryParse(parameters[Common.InputFileIdName], out inputFileId))
            {
                var response = secureFileService.Get(inputFileId);
                if (response.Status == 200)
                {
                    parameters[Common.InputFilePath]      = response.Part.FullPath;
                    parameters[Common.InputFileName]      = response.Part.FileName();
                    parameters[Common.InputFileTitleName] = response.Part.Title();
                }
                else
                {
                    parameters[Common.InputFilePath]      = response.Message;
                    parameters[Common.InputFileName]      = response.Message;
                    parameters[Common.InputFileTitleName] = response.Message;
                }
            }
            else
            {
                parameters[Common.InputFileIdName] = "0";
            }

            parameters["Orchard.User"]  = orchard.WorkContext.CurrentUser?.UserName;
            parameters["Orchard.Email"] = orchard.WorkContext.CurrentUser?.Email;

            return(parameters);
        }