Base solution for your next web application

Activities of "ebenzle"

Question

Where in MVC application can you set the default theme? Do you have an suggestions on Rapid Application development tools that give you a visible drag and drop interface or split screen to mdodify and create custom views for quick UI design? Does meteronic have their own tools to modify installed themes?

Good Morning,

Where does the Net Zero Entity Tool it get the host database connection string from?

=============================================================== When I ran for first time the out put was:

Could not execute because the specified command or file was not found. Possible reasons for this include:

  • You misspelled a built-in dotnet command.
  • You intended to execute a .NET Core program, but dotnet-ef does not exist.
  • You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH. Running migrator... 2020-02-26 05:53:34 | Host database: Server=localhost; Database=NextGenLmsDb; Trusted_Connection=True; 2020-02-26 05:53:34 | Continue to migration for this host database and all tenants..? (Y/N):

======================================================================== My appsettings.json has the correct connection string to database!

I used the rad tool to add entitities and created a name space called Namespace NextGenLms.Courses. Now that the pages were generated it will not recognze this name space. What's my solution?

After running Power Tools to create a new Entity we always get an error:

An unhandled exception occurred while processing the request. AbpException: There is no permission with name: AppPermissions.Pages_CourseCategories

Checking the file 'AppNavigationProvider.cs' it looks like the tool wrapped the permission in double quotes:

.AddItem(new MenuItemDefinition( AppPageNames.Common.CourseCategories, L("CourseCategories"), url: "App/CourseCategories", icon: "flaticon-more", permissionDependency: new SimplePermissionDependency("AppPermissions.Pages_CourseCategories") <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ) )

Removing the quotes in that line fixes the error: permissionDependency: new SimplePermissionDependency(AppPermissions.Pages_CourseCategories) <<<<<<<<<<<<<<

Is this a bug with the Power Tools, or am I doing something wrong when I create the entity? Would rather not manually update that file everytime.

Confirmed. I'm running RAD Tool in MVC/Jquery project and having the same issue. A coworker of mine is using the RAD tool on the same project and is not having this issue. Could be something with the environment?

Hi, I've uninstalled Power Tools and reinstalled the latest version. Still having this issue. I also noticed that the tool is not creating cooresponding fields for Navigation Property. This causes an error when trying to add or edit an entity.

A coworker is using the tools without this issue, so I think it may be something with the way my environment is setup. Any thoughts?

asp.net zero v8.1.0 ASP.NET MVC 5.x & jQuery

We'd like to add a navigation link that will allow users direct access to the create/edit modal for entities.

For example, an entity names 'Courses' might have a menu item like this:

AddItem(new MenuItemDefinition( AppPageNames.Common.AddCourses, L("AddCourses"), url: [open /Courses/\_CreateOrEditModal.cshtml], icon: "flaticon-presentation-1", permissionDependency: new SimplePermissionDependency(AppPermissions.Pages\_Administration\_Courses) ) )

If it's not possible to open the modal because of dependancies on the main entity page, then is it possible to open that page, then auto trigger _addCourseModal.open() once the page loads?

Is there a built in way for users to provide their own translation strings when adding content to the site? For example, in a text area our admin would type:

<span data-lang="es_mx">Bienvenido a la pagina web.Welcome to the website.</span>

When displayed on a page that would show the correct string based on the current user's language.

Thanks

ASP.Net Core MVC/jQuery

In our application service we need to be able to handle an API call to the same route, but process it differently based on the HTTP method. This call is coming from an external application and we are unable to change how the call is made, only how we handle it within our application.

the route: App/ActivityOnlineLesson/activities/state

[HttpPut] - should save the passed value
[HttpGet] - will return a saved value

Our current code returns an error: Microsoft.AspNetCore.Routing.Matching.AmbiguousMatchException: The request matched multiple endpoints. Matches:

How do we have the same route process the Get and Put methods separately?


Our AppService:

        /* Saves the state for xAPI activities */        [HttpPut]
        [Route("/App/ActivityOnlineLesson/activities/state")]
        public async Task<ActivityOnlineLessonXapiResumeOutput> State(ActivityOnlineLessonXapiResumeInput input)
        {
            // processes the xAPI state request
            var ActivityOnlineLessonXapiResumeOutput = new ActivityOnlineLessonXapiResumeOutput();
            ActivityOnlineLessonXapiResumeOutput.Success = true;

            return ActivityOnlineLessonXapiResumeOutput;
        }

        /* Gets the initial state for xAPI activities */
        [HttpGet]
        [Route("/App/ActivityOnlineLesson/activities/state")]
        public async Task<string> State()
        {
            return "24146070ji1001112a0101201112C10v_player_6BypgqIVLDo_6MymGJoBbaC1^1^0000";
        }

I thought that the [HttpGet] and [HttpPut] would determine which to use depending on the HTTP Method.


Our Interface looks like this:

    public interface IActivityOnlineLessonAppService : IActivityBaseAppService<ActivityOnlineLessonDto>, IApplicationService
    {
        Task<ActivityOnlineLessonXapiResumeOutput> State(ActivityOnlineLessonXapiResumeInput input);

        Task<string> State();
    }

Hi. It's net core 3.x

Here is ActivityOnlineLessonAppService.cs

using System.Threading.Tasks;
using Abp.Domain.Repositories;
using NextGenLms.Courses.Dtos;
using Abp.Application.Services.Dto;
using Microsoft.EntityFrameworkCore;
using NextGenLms.Storage;
using Abp.UI;
using System;
using NextGenLms.ScormCloud;
using NextGenLms.Grading.Dtos;
using NextGenLms.Grading;
using System.IO;
using Abp.Authorization;
using NextGenLms.Authorization;
using Microsoft.Extensions.Configuration;
using Microsoft.AspNetCore.Hosting;
using NextGenLms.Configuration;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Web;

namespace NextGenLms.Courses
{
    [AbpAuthorize]
    public class ActivityOnlineLessonAppService : NextGenLmsAppServiceBase, IActivityOnlineLessonAppService
    {
        private readonly ITempFileCacheManager _tempFileCacheManager;
        private readonly IRepository<ActivityOnlineLesson> _activityOnlineLessonRepository;
        private readonly IRepository<ActivityOnlineLessonUserResult> _activityOnlineLessonUserResultRepository;
        private readonly ICourseActivityAppService _courseActivityAppService;
        private readonly IGradesAppService _gradeAppService;
        private readonly IScormCloudManager _scormCloudManager;
        private readonly IConfigurationRoot _appConfiguration;
        private readonly IAppFolders _appFolders;

        public ActivityOnlineLessonAppService(
            ITempFileCacheManager tempFileCacheManager,
            IRepository<ActivityOnlineLesson> activityOnlineLessonRepository,
            IRepository<ActivityOnlineLessonUserResult> activityOnlineLessonUserResultRepository,
            ICourseActivityAppService courseActivityAppService,
            IGradesAppService gradeAppService,
            IScormCloudManager scormCloudManager,
            IWebHostEnvironment env,
            IAppFolders appFolders)
        {
            _tempFileCacheManager = tempFileCacheManager;
            _activityOnlineLessonRepository = activityOnlineLessonRepository;
            _activityOnlineLessonUserResultRepository = activityOnlineLessonUserResultRepository;
            _courseActivityAppService = courseActivityAppService;
            _gradeAppService = gradeAppService;
            _scormCloudManager = scormCloudManager;
            _appConfiguration = env.GetAppConfiguration();
            _appFolders = appFolders;
        }


        /* Saves the state for xAPI activities */
        [HttpPut]
        [Route("/App/ActivityOnlineLesson/activities/state")]
        public async Task<ActivityOnlineLessonXapiResumeOutput> State(ActivityOnlineLessonXapiResumeInput input)
        {
            // processes the xAPI state request
            var ActivityOnlineLessonXapiResumeOutput = new ActivityOnlineLessonXapiResumeOutput();

            if (input.Value == "123") {
                ActivityOnlineLessonXapiResumeOutput.Success = true;
            } else
            {
                ActivityOnlineLessonXapiResumeOutput.Success = false;
            }

            return ActivityOnlineLessonXapiResumeOutput;
        }

        /* Gets the initial state for xAPI activities */
        [HttpGet]
        [Route("/App/ActivityOnlineLesson/activities/state")]
        public async Task<string> State()
        {

            return "24146070ji1001112a0101201112C10v_player_6BypgqIVLDo_6MymGJoBbaC1^1^0000";
        }

    }
}

And the interface:

using Abp.Application.Services;
using Abp.Application.Services.Dto;
using NextGenLms.Courses.Dtos;
using NextGenLms.Courses.Dtos.Activities;
using NextGenLms.Courses.Dtos.Quiz;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace NextGenLms.Courses
{
    public interface IActivityOnlineLessonAppService : IActivityBaseAppService<ActivityOnlineLessonDto>, IApplicationService
    {

        Task<string> State();
    }
}

This is the error when trying to call the service at the URL:

Request URL: https://localhost:44312/App/ActivityOnlineLesson/activities/state?stateId=resume&activityId=68&agent=%7B%22objectType%22%3A%22Agent%22%2C%22mbox%22%3A%22mailto%3A%20admin%40defaulttenant.com%22%2C%22name%22%3A%22admin%20admin%22%7D&course_id=7&base_url=https%3A%2F%2Flocalhost%3A44312%2F

Microsoft.AspNetCore.Routing.Matching.AmbiguousMatchException: The request matched multiple endpoints. Matches: 

NextGenLms.Web.Areas.App.Controllers.ActivityOnlineLessonController.state (NextGenLms.Web.Mvc)
NextGenLms.Courses.ActivityOnlineLessonAppService.State (NextGenLms.Application)
   at Microsoft.AspNetCore.Routing.Matching.DefaultEndpointSelector.ReportAmbiguity(CandidateState[] candidateState)
   at Microsoft.AspNetCore.Routing.Matching.DefaultEndpointSelector.ProcessFinalCandidates(HttpContext httpContext, CandidateState[] candidateState)
   at Microsoft.AspNetCore.Routing.Matching.DefaultEndpointSelector.Select(HttpContext httpContext, CandidateState[] candidateState)
   at Microsoft.AspNetCore.Routing.Matching.DfaMatcher.MatchAsync(HttpContext httpContext)
   at Microsoft.AspNetCore.Routing.Matching.DataSourceDependentMatcher.MatchAsync(HttpContext httpContext)
   at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

HEADERS
=======
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Authorization: null
Connection: keep-alive
Cookie: .AspNetCore.Antiforgery.LvCbYuYZ0jQ=CfDJ8MZ5iXL2Cq9JmHEp0VtZuygW3VNV9s4pgXA7uVXZcJmrDDW_Ki_4MJAbWrcHA_8izlDoWJtLV6EjAGbv7qowvvdTwtoo7Gtxpb3GZVKJaSX6mrQ9JbuTD7hA7rA8BjzWqh9BpYZ3uPj3rsxVhVjE7XU; idsrv.session=HI_7vLf0gvPNxgCYcQM6mw; googtrans=/en/en; XSRF-TOKEN=CfDJ8MZ5iXL2Cq9JmHEp0VtZuyg0LT35YHGojvJWUMTda0XGMmm-WY7GwoiabCuR0MK-4_85-5yta9-xA62uFrgLDVphnH3tRAtGqxUid-KzH4YDlPZ-Fc9eQgFaFnMfaWgKELUkF-tjMHd_qRQTMgb8OvNKcjjSmvmxRvEB2iisN029C-_fl_dS9pCPgZZgqYAuUQ; .AspNetCore.Identity.Application=CfDJ8MZ5iXL2Cq9JmHEp0VtZuyjiKQwKR2Y7qQ1RgaiNDQmoVvpimfIBPPpJcd_6PCijFwK5qbeOVLOkKP0dyhZcGuOq9Doa_Wz2U87mqnMB23zZQi88JyyOrIBTE6q2C-QewbT57SzX2Tn_8UZkzupWNZ8Lh9aTtw_AQY9sU39-uyEWFOjWwOd3qsobIlbzapItCUJAb6DdVFzAvuuWZlucKXIeNtBJ7p6lJc6f8Z60QGLWPmvTzH2NVhybsTGeqWny4K7jA_IHxFUSX9X1DE7JMWJOY0AB1hqWPtcCe6bAAx9VMRAra_xyNCfJxoGjYkwC1zC4EjAuZHmlSdxcKajNeRay-hyMD96PvJYIcHiipocEmJdNJR8FjC7w2ha6TvXxD0OeTOCG6N0o8TX7yL6-qNt-__s9c4wkhjIlHYIHDFhI-LGaY6yD6qLg1SqUrSEjxlHAg1iPtgXiJmgLgzHl3w0HuI7PNuFra_KQDzr4lYgQWANtVUpofmbVa6YmnhGlOHc-1ACIHD1mg28TND4YDAjxpBmZ860Kgwob_7tpf1yvVqnzoMbluiEhb9ci3MDcV0988b_NyXdp5RxGD-7ZdmvHbgbcODit0Xrnn0hbG41FekWbFFq0ONJTABu_khvM_ALnaUd1zx20dFt12124BkGppl60eJOYq_aGL9YJgWsbch_UWL8O6d7SpHKaLhLtZOkB1ZeW_kSo1v5TGF6x7srtInRJYgO4Vb0U_RIJlU8m1BijBBq6Z2niiBFkT30CqB_meLgQnIXM_afSy9bUg-fclsUnm12rFNlRBZkjAvXZAXNBWXlHvY14cJ9TsKTQ2j7tgppTQEj_RH4zr3BNORfQoSwoxeEkGelIQ3xEaYEdkp8p6bQ9tb3p-LwTZzchN04JdAhn9P_MvNEun8yaN4Ld2fh6zv5GeAoCm8ij9WpDYXe2BuvtO_zU8YRyQJe9y94HHVo-JZvdWzC8UM4u3tg
Host: localhost:44312
Referer: https://localhost:44312/ActivityFiles/OnlineLessons/99df21dd-4238-432d-8eb0-6dd2722dc621/story.html?endpoint=https://localhost:44312/App/ActivityOnlineLesson/&course_id=7&actor=%7B%22name%22%3A%20%5B%22admin%20admin%22%5D%2C%20%22mbox%22%3A%20%5B%22mailto%3A%20admin%40defaulttenant.com%22%5D%7D&activity_id=68&base_url=https://localhost:44312/
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
X-Experience-API-Version: 1.0.1
DNT: 1
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty

I believe those are all the related code files.

Thanks.

Showing 1 to 10 of 16 entries