コード例 #1
0
 public Startup(IConfiguration configuration, IWebHostEnvironment env)
 {
     Configuration = configuration;
     ContentURI    = new DevTreks.Data.ContentURI();
     //set the webroot full file path: C:\\DevTreks\\src\\DevTreks\\wwwroot
     DefaultRootFullFilePath = string.Concat(env.WebRootPath, "\\");
 }
コード例 #2
0
        private async Task <bool> SaveFullXhtmlDocFromFullXmlDoc1Async(StringWriter writer,
                                                                       DevTreks.Data.ContentURI uri, string xmlDocToReadPath,
                                                                       DataHelpers.GeneralHelpers.DOC_STATE_NUMBER displayDocType)
        {
            bool bIsCompleted = false;

            //check whether files with 'full' fileexttypes need to be converted to html
            //(i.e. full budgets). These files can get too big for day-to-day
            //server side work, but the full xml and xhtml budgets will be downloaded
            //in packages and then used on the client
            if (displayDocType
                == DataHelpers.GeneralHelpers.DOC_STATE_NUMBER.thirddoc)
            {
                string sFullDocToReadPath = await DataAppHelpers.LinkedViews.GetFullXhtmlDocPath(
                    uri, xmlDocToReadPath);

                if (!string.IsNullOrEmpty(sFullDocToReadPath))
                {
                    if (await DataHelpers.FileStorageIO.URIAbsoluteExists(uri, sFullDocToReadPath))
                    {
                        string sHtmlDocPath = string.Empty;
                        //this will be returned in ebook packages for clientside use
                        //client uses full xhtml docs
                        bool bHasHtmlDoc = await SaveFullXhtmlDocFromXmlDoc2Async(uri,
                                                                                  sFullDocToReadPath, sHtmlDocPath,
                                                                                  DataAppHelpers.Resources.FILEEXTENSION_TYPES.html,
                                                                                  displayDocType);

                        sHtmlDocPath = uri.URIDataManager.MiscDocPath;
                    }
                }
            }
            bIsCompleted = true;
            return(bIsCompleted);
        }
コード例 #3
0
ファイル: AppHelper.cs プロジェクト: kpboyle1/devtreks.3.1
        public static void SetErrorMessage(Exception x, DevTreks.Data.ContentURI uri)
        {
            //move this to error component and tie in with help file system
            //dynamic help, dynamic messaging
            string sExceptionMessage = x.ToString();
            string sErrorMessage     = string.Empty;

            if (uri.URIDataManager != null)
            {
                //the error was generated by the search page
                if (uri.URIService == null)
                {
                    uri.URIService = new AccountToService();
                }
                if (uri.URIMember == null)
                {
                    uri.URIMember = new AccountToMember();
                }
                if (uri.URIMember.ClubInUse == null)
                {
                    uri.URIMember.ClubInUse = new Account();
                }
                sErrorMessage += (x.InnerException == null) ? string.Empty : x.InnerException.ToString();
                sErrorMessage  = string.Concat(sExceptionMessage, "</ br>", uri.ErrorMessage);
                string[] arrErrorMessage = { uri.URIDataManager.ServerActionType.ToString(),
                                             uri.URIDataManager.AppType.ToString(),
                                             uri.URIDataManager.SubAppType.ToString(),
                                             uri.URINodeName,
                                             uri.URIId.ToString(),
                                             uri.URIService.PKId.ToString(),
                                             uri.URIMember.ClubInUse.ToString(),
                                             sErrorMessage };
                uri.ErrorMessage = PublishError(uri, x.InnerException,
                                                DataHelpers.MakeStringWithDelimiter(arrErrorMessage,
                                                                                    DataHelpers.STRING_DELIMITER));
            }
            else
            {
                //xml document or file upload error
                uri.ErrorMessage = DevTreks.Exceptions.DevTreksErrors.MakeStandardErrorMsg(string.Empty, "APPHELPER_WHOKNOWS");
            }
        }
コード例 #4
0
ファイル: AppHelper.cs プロジェクト: kpboyle1/devtreks.3.1
        public static void PublishErrorMessage(DevTreks.Data.ContentURI uri)
        {
            string sErrorMessage = string.Empty;

            if (!string.IsNullOrEmpty(uri.ErrorMessage))
            {
                if (uri.URIDataManager == null)
                {
                    uri.URIDataManager = new DevTreks.Data.ContentURI.DataManager();
                }
                //the error was generated by the search page
                if (uri.URIService == null)
                {
                    uri.URIService = new AccountToService();
                }
                if (uri.URIMember == null)
                {
                    uri.URIMember = new AccountToMember();
                }
                if (uri.URIMember.ClubInUse == null)
                {
                    uri.URIMember.ClubInUse = new Account();
                }
                string[] arrErrorMessage = { uri.URIDataManager.ServerActionType.ToString(),
                                             uri.URIDataManager.AppType.ToString(),
                                             uri.URIDataManager.SubAppType.ToString(),
                                             uri.URINodeName,
                                             uri.URIId.ToString(),
                                             uri.URIService.PKId.ToString(),
                                             uri.URIMember.ClubInUse.ToString(),
                                             uri.ErrorMessage };
                //160 changed from getneworkpath to this
                string sErrorPath = string.Concat(DevTreks.Data.Helpers.AppSettings.GetResourceRootPath(uri, false),
                                                  DevTreks.Exceptions.DevTreksErrors.ERRORFOLDERNAME, DataHelpers.FILE_PATH_DELIMITER);
                uri.ErrorMessage = DevTreks.Exceptions.DevTreksErrors.Publish(DataHelpers.MakeStringWithDelimiter(arrErrorMessage,
                                                                                                                  DataHelpers.STRING_DELIMITER), sErrorPath);
            }
        }