Base solution for your next web application

Activities of "patrickglaudemans"

Hi,

Is there something like this for the ABP log file format. <a class="postlink" href="https://github.com/sebagomez/log4net-for-notepadpp">https://github.com/sebagomez/log4net-for-notepadpp</a>

Colorfiles will be formatted with nice colors for all kind of log data.

Worked with it in other projects.

Thanks,

Patrick

Hi,

Zero/abp logs entity validation errors – great! ERROR 2015-12-22 11:36:58,854 [7 ] BI.EntityFramework.BIDbContext - There are some validation errors while saving changes in EntityFramework: ERROR 2015-12-22 11:36:58,854 [7 ] BI.EntityFramework.BIDbContext - - Site: The Site field is required. ERROR 2015-12-22 11:36:59,071 [7 ] lers.Filters.AbpExceptionFilterAttribute - System.Data.Entity.Validation.DbEntityValidationException: Validation failed for one or more entities. See 'EntityValidationErrors' property for more details. at System.Data.Entity.Internal.InternalContext.SaveChangesAsync(CancellationToken cancellationToken) at System.Data.Entity.Internal.LazyInternalContext.SaveChangesAsync(CancellationToken cancellationToken) at System.Data.Entity.DbContext.SaveChangesAsync(CancellationToken cancellationToken) at Abp.EntityFramework.AbpDbContext.<>n__FabricatedMethod2(CancellationToken ) at Abp.EntityFramework.AbpDbContext.<SaveChangesAsync>d__0.MoveNext()

What is, a@client side, the detail object – see below. (validationErrors are clientside val errors)

abp.js:174 ERROR: abp.js:174 Object {code: 0, message: "An internal error occurred during your request!", details: null, validationErrors: null}

Regards, P

Hi,

I'm developing a .net windows service. I want to connect this service to my zero application layer. The application layer still follows the initial setup. Api controllers are therefore dynamically created.

  1. I want to connect to the application layer with REST. What is the best way to set that up with ExternalBearer token etc.
  2. I want to connect an angular file upload call to my application service. Therefore, I have to enhance the Web Api wrapper controller. Should I then manually create the web api controller? How should i do that? I want to create something like this: public class FilesController : ApiController { [HttpPost] // This is from System.Web.Http, and not from System.Web.Mvc public async Task<HttpResponseMessage> Upload() { if (!Request.Content.IsMimeMultipartContent()) { this.Request.CreateResponse(HttpStatusCode.UnsupportedMediaType); } (...) etc.

Thanks for all your help in advance - hope others can gain something from it as well!

Regards, p

Hi,

(by mistake I also posted this question in non premium zero. If preferred, you can delete it there - sorry)

I'm developing a .net windows service. I want to connect this service to my zero application layer. The application layer still follows the initial setup. Api controllers are therefore dynamically created.

  1. I want to connect to the application layer with REST. What is the best way to set that up with ExternalBearer token etc.
  2. I want to connect an angular file upload call to my application service. Therefore, I have to enhance the Web Api wrapper controller. Should I then manually create the web api controller? How should i do that? I want to create something like this: public class FilesController : ApiController { [HttpPost] // This is from System.Web.Http, and not from System.Web.Mvc public async Task<HttpResponseMessage> Upload() { if (!Request.Content.IsMimeMultipartContent()) { this.Request.CreateResponse(HttpStatusCode.UnsupportedMediaType); } (...) etc.

Thanks for all your help in advance - hope others can gain something from it as well!

Hi,

I'm getting sourcemap errors in my google chrome console like so: Failed to parse SourceMap: <a class="postlink" href="http://localhost:6234/App/app.css.map">http://localhost:6234/App/app.css.map</a> Failed to parse SourceMap: <a class="postlink" href="http://localhost:6234/App/common/views/datasources/createOrEditModal.css.map">http://localhost:6234/App/common/views/ ... al.css.map</a> Failed to parse SourceMap: <a class="postlink" href="http://localhost:6234/Common/Styles/core.css.map">http://localhost:6234/Common/Styles/core.css.map</a> Failed to parse SourceMap: <a class="postlink" href="http://localhost:6234/App/common/directives/gridlists/datasource/datasource-List.css.map">http://localhost:6234/App/common/direct ... st.css.map</a> Failed to parse SourceMap: <a class="postlink" href="http://localhost:6234/App/common/views/layout/layout.css.map">http://localhost:6234/App/common/views/ ... ut.css.map</a> Failed to parse SourceMap: <a class="postlink" href="http://localhost:6234/App/common/views/profile/changePicture.css.map">http://localhost:6234/App/common/views/ ... re.css.map</a>

the seems to come out of the blue. Did some googling but got no luck.

Anyone seeing the light?

Thanks,

p

Hi There!

As mentioned in the header I have a custom entity which is some sort of group to which I want to be able to add abpusers. In public class User : AbpUser<Tenant, User> (part of zero in core lib) I added: public List<ContentGroup> ContentGroups { get; set; } and in the custom entity: public List<User> Users { get; set; }

Entity framework created link tables and so far so good. But - no records are inserted after a contentGroup.Users.Add(existingUser) check this piece of code: var user = await UserManager.GetUserByIdAsync(System.Convert.ToInt64(selection)); contentGroup.Users.Add(user); if (contentGroup != null) { await _contentGroupRepository.UpdateAsync(contentGroup);
}

etc.

In the same entity I have another property Reports that is setup exact the same way: it has Reports and Report has ContentGroups (many to many). It works with the report entity..

I think it has something to do with the entity user which is not attached to the build in repository. Can you help me out?

Thanks, P

Hi There!

As mentioned in the header I have a custom entity which is some sort of group to which I want to be able to add abpusers. In public class User : AbpUser<Tenant, User> (part of zero in core lib) I added: public List<ContentGroup> ContentGroups { get; set; } and in the custom entity: public List<User> Users { get; set; }

Entity framework created link tables and so far so good. But - no records are inserted after a contentGroup.Users.Add(existingUser) check this piece of code: var user = await UserManager.GetUserByIdAsync(System.Convert.ToInt64(selection)); contentGroup.Users.Add(user); if (contentGroup != null) { await _contentGroupRepository.UpdateAsync(contentGroup);
}

etc.

In the same entity I have another property Reports that is setup exact the same way: it has Reports and Report has ContentGroups (many to many). It works with the report entity..

I think it has something to do with the entity user which is not attached to the build in repository. Can you help me out?

Thanks, P

My last sentence was not quite clear. What I ment to say is that is has something to do with the user entity not being monitored for changes by the Entity Framework.

Halil any comments? Thanks, Patrick

Hi,

Thanks for your reply. Last time I provided incomplete code for the example - that's where the null check failed but that is irrelevant. Here is, however, the complete method code. Still the users are not get saved, al other properties like reports, do! THis code is in exact the same appservice structure like recommended in manual etc.

public async Task UpdateContentGroupMembers(UpdateContentGroupMembersInput input)
        {

            if (input != null)
            {
                ContentGroup contentGroup = null;
                if (input.ReportMembers != null)
                {
                    if (input.ReportMembers.Any())
                    {
                        contentGroup = _contentGroupRepository.GetAll()
                            .Include(c=>c.Reports)
                            .Include(c=>c.Users).FirstOrDefault();
                        if (contentGroup != null)
                        {
                            //check if selection is in saved selection - if not add
                            foreach (var selection in input.ReportMembers)
                            {
                                if (contentGroup.Reports.Find(r => r.Id == selection) == null)
                                {
                                    //selected but not yet in saved selection: add
                                    contentGroup.Reports.Add(_reportRepository.Get(selection));
                                }
                            }
                            //check if selection is in saved
                            foreach (var savedSelection in contentGroup.Reports)
                            {
                                if (!input.ReportMembers.Contains(savedSelection.Id))
                                {
                                    //in saved but not selected anymore: delete
                                    contentGroup.Reports.Remove(savedSelection);
                                }
                            }  
                        }
                    }

                    if (input.UserMembers != null)
                    {
                        if (input.UserMembers.Any())
                        {
                            if (contentGroup == null)
                            {
                                contentGroup = _contentGroupRepository.GetAll()
                                    .Include(c => c.Reports)
                                    .Include(c => c.Users).FirstOrDefault();
                            }
                            if (contentGroup != null)
                            {
                                //check if selection is in saved selection - if not add
                                foreach (var selection in input.UserMembers)
                                {
                                    if (contentGroup.Users.Find(r => r.Id == selection) == null)
                                    {
                                        //selected but not yet in saved selection: add
                                        var user = await UserManager.GetUserByIdAsync(System.Convert.ToInt64(selection));
                                        contentGroup.Users.Add(user);
                                    }
                                }
                                //check if selection is in saved
                                foreach (var savedSelection in contentGroup.Users)
                                {
                                    if (!input.UserMembers.Contains(System.Convert.ToInt32(savedSelection.Id)))
                                    {
                                        //in saved but not selected anymore: delete
                                        contentGroup.Users.Remove(savedSelection);
                                    }
                                }

                            }
                        }
                        contentGroup.Users.Add(new User());
                    }
                }

               



                if (contentGroup != null)
                {
                    await _contentGroupRepository.UpdateAsync(contentGroup);    
                }
                else
                {
                    //nothing to do - bye
                }
            }

        }

Best,

Hi,

contentGroup.Users.Add(new User());

can be ignored - it was for testing p.

Showing 1 to 10 of 47 entries