Starts in:
2 DAYS
5 HRS
46 MIN
10 SEC
Starts in:
2 D
5 H
46 M
10 S
Open Closed

"VoloDocsModule' PostgreSQL Usage Error" #4717


User avatar
0
ilhan.ordukaya created

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v7.0.3
  • UI type: MVC
  • DB provider: EF Core / PostgrSql
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

We want to add VoloDocs, which is a documentation system with ABP Framework, to our project. We are using PostgreSQL as our database in the project. When we run VoloDocs.Web.exe located in the Web folder in the VoloDocs download file available on the ABP Framework website, we encounter an error stating that it does not support the syntax "port" in the connection string. Is it possible to use VoloDocs with PostgreSQL?

Log Error


30 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    It seems the project still using the Sql Server.

    You can try to search SqlServer keyword globally, then replace it to PostgreSQL

    https://docs.abp.io/en/abp/latest/Entity-Framework-Core-PostgreSQL

  • User Avatar
    0
    ilhan.ordukaya created

    hi

    It seems the project still using the Sql Server.

    You can try to search SqlServer keyword globally, then replace it to PostgreSQL

    https://docs.abp.io/en/abp/latest/Entity-Framework-Core-PostgreSQL

    I have checked these corrections, but SqlServer is not used in my project. The fields that need to be changed are already in PostgreSQL.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Can you share a project? liming.ma@volosoft.com

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    There is no docs module in your project.

  • User Avatar
    0
    ilhan.ordukaya created

    There is no docs module in your project.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    This is not the correct way to use modules.

    See https://docs.abp.io/en/abp/latest/Modules/Docs

  • User Avatar
    0
    ilhan.ordukaya created

    This is not the correct way to use modules.

    See https://docs.abp.io/en/abp/latest/Modules/Docs

    I have reviewed the example you provided for the correct usage of the Docs module and based on this example, I have created two different projects. I used MSSQL and PostgreSQL in these projects. I used the ABP Framework GitHub sample project registration in both projects. I am able to view the documents in the MSSQL project, but I am unable to view the documents in the project where I used PostgreSQL

    USE MSSQL USE POSTGRESQL Why might the problem be caused?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please share the POSTGRESQL project. liming.ma@volosoft.com

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I downloaded your project and inserted data into postgres DocsProjects table.

    INSERT INTO public."DocsProjects" ("Id", "Name", "ShortName", "Format", "DefaultDocumentName", "NavigationDocumentName", "ParametersDocumentName", "MinimumVersion", "DocumentStoreType", "MainWebsiteUrl", "LatestVersionBranchName", "ExtraProperties", "ConcurrencyStamp") VALUES ('12f21123-e08e-4f15-bedb-ae0b2d939658', 'ABP framework (GitHub)', 'abp', 'md', 'Index', 'docs-nav.json', '', null, 'GitHub', '/', 'dev', '{"GitHubRootUrl":"https://github.com/abpframework/abp/tree/{version}/docs","GitHubAccessToken":"","GitHubUserAgent":""}', null);
    
    

  • User Avatar
    0
    ilhan.ordukaya created

    hi maliming

    I followed the instructions in the link https://docs.abp.io/en/abp/latest/Modules/Docs?_ga=2.11693748.1887967256.1679480673-1788700351.1679480673#full-text-search-elastic-search to add Elastic Search to my project, but I am getting errors when trying to add it. I included the code from the "documents" folder in the Volo.Docs.SourceCode project into my own project, but I am still getting errors. I could not find any resources on how to add the search bar to my document page.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please share the detailed error log(Logs.txt).

  • User Avatar
    0
    ilhan.ordukaya created

    hi

    Please share the detailed error log(Logs.txt).

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please share the project. liming.ma@volosoft.com

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can rename your SearchModel class to MySearchModel or inherit the Volo.Docs.Pages.Documents.SearchModel.

    [Dependency(ReplaceServices = true)]
    [ExposeServices(typeof(SearchModel), typeof(MySearchModel))]
    public class MySearchModel : SearchModel
    {
        private readonly IProjectAppService _projectAppService;
        private readonly IDocumentAppService _documentAppService;
        private readonly HtmlEncoder _encoder;
    
        public MySearchModel(
            IProjectAppService projectAppService,
            IDocumentAppService documentAppService,
            HtmlEncoder encoder)
            : base(projectAppService, documentAppService, encoder)
        {
            _projectAppService = projectAppService;
            _documentAppService = documentAppService;
            _encoder = encoder;
        }
    
        public override async Task<IActionResult> OnGetAsync(string keyword)
        {
            if (!await _documentAppService.FullSearchEnabledAsync())
            {
                return RedirectToPage("Index");
            }
    
            KeyWord = keyword;
    
            Project = await _projectAppService.GetAsync(ProjectName);
    
            var output = await _projectAppService.GetVersionsAsync(Project.ShortName);
    
            var versions = output.Items.ToList();
    
            if (versions.Any() &&
                string.Equals(Version, DocsAppConsts.Latest, StringComparison.OrdinalIgnoreCase))
            {
                if ((!Project.ExtraProperties.ContainsKey("GithubVersionProviderSource") ||
                     (GithubVersionProviderSource) (long) Project.ExtraProperties["GithubVersionProviderSource"] ==GithubVersionProviderSource.Releases) &&
                    !string.IsNullOrEmpty(Project.LatestVersionBranchName))
                {
                    Version = Project.LatestVersionBranchName;
                }
                else
                {
                    Version = (versions.FirstOrDefault(v => !SemanticVersionHelper.IsPreRelease(v.Name)) ?? versions.First()).Name;
                }
            }
    
            SearchOutputs = await _documentAppService.SearchAsync(new DocumentSearchInput
            {
                ProjectId = Project.Id,
                Context = KeyWord,
                LanguageCode = LanguageCode,
                Version = Version
            });
    
            var highlightTag1 = Guid.NewGuid().ToString();
            var highlightTag2 = Guid.NewGuid().ToString();
            foreach (var searchOutput in SearchOutputs)
            {
                for (var i = 0; i < searchOutput.Highlight.Count; i++)
                {
                    searchOutput.Highlight[i] = _encoder
                        .Encode(searchOutput.Highlight[i].Replace("<highlight>", highlightTag1)
                            .Replace("</highlight>", highlightTag2))
                        .Replace(highlightTag1, "<highlight>").Replace(highlightTag2, "</highlight>");
                }
            }
    
            return Page();
        }
    
    }
    
  • User Avatar
    0
    ilhan.ordukaya created

    hi

    You can rename your SearchModel class to MySearchModel or inherit the Volo.Docs.Pages.Documents.SearchModel.

    [Dependency(ReplaceServices = true)] 
    [ExposeServices(typeof(SearchModel), typeof(MySearchModel))] 
    public class MySearchModel : SearchModel 
    { 
        private readonly IProjectAppService _projectAppService; 
        private readonly IDocumentAppService _documentAppService; 
        private readonly HtmlEncoder _encoder; 
     
        public MySearchModel( 
            IProjectAppService projectAppService, 
            IDocumentAppService documentAppService, 
            HtmlEncoder encoder) 
            : base(projectAppService, documentAppService, encoder) 
        { 
            _projectAppService = projectAppService; 
            _documentAppService = documentAppService; 
            _encoder = encoder; 
        } 
     
        public override async Task<IActionResult> OnGetAsync(string keyword) 
        { 
            if (!await _documentAppService.FullSearchEnabledAsync()) 
            { 
                return RedirectToPage("Index"); 
            } 
     
            KeyWord = keyword; 
     
            Project = await _projectAppService.GetAsync(ProjectName); 
     
            var output = await _projectAppService.GetVersionsAsync(Project.ShortName); 
     
            var versions = output.Items.ToList(); 
     
            if (versions.Any() && 
                string.Equals(Version, DocsAppConsts.Latest, StringComparison.OrdinalIgnoreCase)) 
            { 
                if ((!Project.ExtraProperties.ContainsKey("GithubVersionProviderSource") || 
                     (GithubVersionProviderSource) (long) Project.ExtraProperties["GithubVersionProviderSource"] ==GithubVersionProviderSource.Releases) && 
                    !string.IsNullOrEmpty(Project.LatestVersionBranchName)) 
                { 
                    Version = Project.LatestVersionBranchName; 
                } 
                else 
                { 
                    Version = (versions.FirstOrDefault(v => !SemanticVersionHelper.IsPreRelease(v.Name)) ?? versions.First()).Name; 
                } 
            } 
     
            SearchOutputs = await _documentAppService.SearchAsync(new DocumentSearchInput 
            { 
                ProjectId = Project.Id, 
                Context = KeyWord, 
                LanguageCode = LanguageCode, 
                Version = Version 
            }); 
     
            var highlightTag1 = Guid.NewGuid().ToString(); 
            var highlightTag2 = Guid.NewGuid().ToString(); 
            foreach (var searchOutput in SearchOutputs) 
            { 
                for (var i = 0; i < searchOutput.Highlight.Count; i++) 
                { 
                    searchOutput.Highlight[i] = _encoder 
                        .Encode(searchOutput.Highlight[i].Replace("<highlight>", highlightTag1) 
                            .Replace("</highlight>", highlightTag2)) 
                        .Replace(highlightTag1, "<highlight>").Replace(highlightTag2, "</highlight>"); 
                } 
            } 
     
            return Page(); 
        } 
     
    } 
    

    hi I have made the necessary adjustments to my project. However, I am unable to display the search bar in my project, and I am getting an error when trying to navigate to the search page using the link "https://localhost:44337/search".

    I shared the project with the error by e-mail

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please rename the file name as well.

  • User Avatar
    0
    ilhan.ordukaya created

    hi

    Please rename the file name as well.

    I have already tried this solution and I continue to get the same errors.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please use override for OnGetAsync.

    public override async Task<IActionResult> OnGetAsync(string keyword)

    Please remove the Documents folder. They exist on Volo.Docs.Domain package.

  • User Avatar
    0
    ilhan.ordukaya created

    Hi I made the necessary adjustments, but I am getting an error due to a different redirection when I try to search. I can't figure out how to fix this error

    I sent the project to your e-mail

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Add the below code.

    Configure<DocsUiOptions>(options =>
    {
       options.RoutePrefix = null;
    });
    
    

  • User Avatar
    0
    ilhan.ordukaya created

    hi

    Add the below code.

    Configure<DocsUiOptions>(options => 
    { 
       options.RoutePrefix = null; 
    }); 
     
    

    hi maliming

    Do you have any program or method suggestions for easier creation of .md files?

    The transition between document pages takes 5-6 seconds. What could be the reason for this? And what can I do to improve performance?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    The transition between document pages takes 5-6 seconds. What could be the reason for this? And what can I do to improve performance?

    Can you share the logs? It shouldn't take too long.

  • User Avatar
    0
    ilhan.ordukaya created

    The transition between document pages takes 5-6 seconds. What could be the reason for this? And what can I do to improve performance?

    Can you share the logs? It shouldn't take too long.

    hi maliming

    I sent log.txt via mail "I couldn't find any documentation related to the usage of the version dropdown on the document page. Can you assist me on this matter?"

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    There are no performance problems here, and our docs website is also using this module.

    https://docs.abp.io/en/abp/latest/ https://docs.abp.io/en/commercial/latest/

    I couldn't find any documentation related to the usage of the version dropdown on the document page. Can you assist me on this matter?

    You can add some releases.

    https://github.com/burakyilmaz45/abp/releases

  • User Avatar
    0
    ilhan.ordukaya created

    hi

    There are no performance problems here, and our docs website is also using this module.

    https://docs.abp.io/en/abp/latest/ https://docs.abp.io/en/commercial/latest/

    I couldn't find any documentation related to the usage of the version dropdown on the document page. Can you assist me on this matter?

    You can add some releases.

    https://github.com/burakyilmaz45/abp/releases

    hi When I want to search with Elastic search, I need to search for the whole word. For example, when I want to find the word "String", I cannot find it when I type "Str", but I can find it when I type "String". Is there a solution for this?

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06