Coder Social home page Coder Social logo

easyoc / easyoc Goto Github PK

View Code? Open in Web Editor NEW
42.0 42.0 9.0 31.04 MB

EasyOC 是一个基于OrchardCore 的低代码SPA 服务端开发框架 ,前端项目 https://github.com/EasyOC/easyoc-amis-admin

License: Apache License 2.0

JavaScript 11.96% PowerShell 0.01% C# 4.40% HTML 11.39% CSS 72.13% SCSS 0.06% Liquid 0.03% TypeScript 0.03%
graphql lowcode lucene orchardcore

easyoc's Introduction

EasyOC 是一个基于OrchardCore 的服务端开发框架

基于Orchard Core CMS 增加了一系列模块用于提供 SPA服务 ,参考 ABP 的功能设计实现了一些用于 SPA 的特性和功能

EasyOC is a SPA development framework based on OrchardCore

It adds a series of modules based on Orchard Core CMS to provide SPA services in a non-invasive manner, and implements some features and functions specifically for SPA by referring to the functional design of ABP

前端项目:https://github.com/EasyOC/EasyOC.VbenAdmin

QQ群:877196442

Features

For SPA Service Application

  • GraphQL lucene queries can support Total and items
  • wrapper API returns the result, You can use the Restful API to query OrchardCore for notifications added using INotify
  • SwaggerUI
  • Dynamic Web API
  • Authorization Attribute
  • Users And Roles Api

For OrchardCore CMS

install

image

Swagger UI and openid code flow auth

swaggerUI

Generate ContentType form RDBMS

image

RDBMS

数据同步

image

注意!尽量不要一次更新太多数据,使Document表被长时间锁死,导致其他页面无法访问

Generate ContentMapping with RDBMS

image

可以在Management Studio 中选中某条数据,然后右键选择“连同标题一起复制” 使用 https://www.bejson.com/json/col2json/ 之类的工具将Excel 转换为json 复制结果到内容模板中

image

拦截所有工作流异常

虽然代码中不会拦截触发的节点,但尽量不要在异常处理工作流中再次引发异常,不然可能会造成死循环 如果要触发当前工作流,如果表达式成立,则将触发工作流,捕获全局异常,直接返回true

image

获取错误信息: input('ErrorInfo') 包含如下属性:

  • WorkflowId:工作流Id
  • WorkflowName:工作流名称
  • ExcutedActivityCount:已执行节点数量
  • ActivityDisplayName:节点名称
  • ActivityTypeName:节点类型名称
  • ActivityId:节点Id
  • ErrorMessage:异常信息概要
  • ExceptionDetails:异常详细信息
  • FaultMessage:包含工作流节点手动引发的错误信息

easyoc's People

Contributors

hyzx86 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

easyoc's Issues

Approaches for Orchard Core and SPA Framework ?

Im following this interesting project.
What is your experience with oc and this spa approach ?
Is it working out well ?
Im thinking of trying something similar using htmx with orchard core to acheive spa like functionality.

如果升级到.net core8 会出现 FreeSql.DatabaseModel.DbColumnInfo 报错。暂时没找到哪个dll的问题

image
`An unhandled exception occurred while processing the request.
VerificationException: Method System.Linq.Enumerable.MaxInteger: type argument 'FreeSql.DatabaseModel.DbColumnInfo' violates the constraint of type parameter 'T'.
System.RuntimeMethodHandle.GetStubIfNeeded(RuntimeMethodHandleInternal method, RuntimeType declaringType, RuntimeType[] methodInstantiation)

ArgumentException: GenericArguments[0], 'FreeSql.DatabaseModel.DbColumnInfo', on 'System.Nullable1[T] MaxInteger[T](System.Collections.Generic.IEnumerable1[System.Nullable`1[T]])' violates the constraint of type 'T'.
System.RuntimeType.ValidateGenericArguments(MemberInfo definition, RuntimeType[] genericArguments, Exception e)

Stack Query Cookies Headers Routing
VerificationException: Method System.Linq.Enumerable.MaxInteger: type argument 'FreeSql.DatabaseModel.DbColumnInfo' violates the constraint of type parameter 'T'.
System.RuntimeMethodHandle.GetStubIfNeeded(RuntimeMethodHandleInternal method, RuntimeType declaringType, RuntimeType[] methodInstantiation)
System.Reflection.RuntimeMethodInfo.MakeGenericMethod(Type[] methodInstantiation)

Show raw exception details
ArgumentException: GenericArguments[0], 'FreeSql.DatabaseModel.DbColumnInfo', on 'System.Nullable1[T] MaxInteger[T](System.Collections.Generic.IEnumerable1[System.Nullable1[T]])' violates the constraint of type 'T'. System.RuntimeType.ValidateGenericArguments(MemberInfo definition, RuntimeType[] genericArguments, Exception e) System.Reflection.RuntimeMethodInfo.MakeGenericMethod(Type[] methodInstantiation) AutoMapper.Internal.TypeDetails+<>c__DisplayClass25_1.<GetPublicNoArgExtensionMethods>b__10(MethodInfo extensionMethod) System.Linq.Enumerable+WhereSelectArrayIterator<TSource, TResult>.MoveNext() System.Linq.Enumerable+ConcatIterator<TSource>.MoveNext() System.Linq.Enumerable.SelectManyIterator<TSource, TCollection, TResult>(IEnumerable<TSource> source, Func<TSource, IEnumerable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector)+MoveNext() System.Linq.Enumerable+WhereSelectEnumerableIterator<TSource, TResult>.MoveNext() System.Linq.Enumerable+UnionIterator<TSource>.GetNext() System.Linq.Enumerable+UnionIterator<TSource>.MoveNext() System.Linq.Enumerable+ConcatIterator<TSource>.MoveNext() AutoMapper.Internal.TypeDetails.PossibleNames() AutoMapper.Internal.TypeDetails.GetMember(string name) AutoMapper.Configuration.Conventions.DefaultName.GetMatchingMemberInfo(TypeDetails sourceTypeDetails, Type destType, Type destMemberType, string nameToSearch) AutoMapper.Configuration.Conventions.ParentSourceToDestinationNameMapper.GetMatchingMemberInfo(TypeDetails sourceTypeDetails, Type destType, Type destMemberType, string nameToSearch) AutoMapper.Configuration.Conventions.DefaultMember.MapDestinationPropertyToSource(ProfileMap options, TypeDetails sourceTypeDetails, Type destType, Type destMemberType, string nameToSearch, List<MemberInfo> resolvers, IMemberConfiguration parent, bool isReverseMap) AutoMapper.Configuration.Conventions.MemberConfiguration.MapDestinationPropertyToSource(ProfileMap options, TypeDetails sourceType, Type destType, Type destMemberType, string nameToSearch, List<MemberInfo> resolvers, bool isReverseMap) AutoMapper.Configuration.Conventions.NameSplitMember.MapDestinationPropertyToSource(ProfileMap options, TypeDetails sourceType, Type destType, Type destMemberType, string nameToSearch, List<MemberInfo> resolvers, IMemberConfiguration parent, bool isReverseMap) AutoMapper.Configuration.Conventions.MemberConfiguration.MapDestinationPropertyToSource(ProfileMap options, TypeDetails sourceType, Type destType, Type destMemberType, string nameToSearch, List<MemberInfo> resolvers, bool isReverseMap) AutoMapper.ProfileMap.MapDestinationPropertyToSource(TypeDetails sourceTypeDetails, Type destType, Type destMemberType, string destMemberName, List<MemberInfo> members, bool reverseNamingConventions) AutoMapper.TypeMap..ctor(Type sourceType, Type destinationType, ProfileMap profile, bool isReverseMap) AutoMapper.ProfileMap.BuildTypeMap(IGlobalConfiguration configurationProvider, ITypeMapConfiguration config) AutoMapper.ProfileMap.Register(IGlobalConfiguration configurationProvider) AutoMapper.MapperConfiguration.Seal() AutoMapper.MapperConfiguration..ctor(MapperConfigurationExpression configurationExpression) Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions+<>c.<AddAutoMapperClasses>b__12_2(IServiceProvider sp) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<TArgument, TResult>.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<TArgument, TResult>.VisitCallSite(ServiceCallSite callSite, TArgument argument) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier) System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>.GetOrAdd(TKey key, Func<TKey, TValue> valueFactory) Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope) Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType) Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<T>(IServiceProvider provider) Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions+<>c.<AddAutoMapperClasses>b__12_3(IServiceProvider sp) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<TArgument, TResult>.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<TArgument, TResult>.VisitCallSite(ServiceCallSite callSite, TArgument argument) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<TArgument, TResult>.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<TArgument, TResult>.VisitCallSite(ServiceCallSite callSite, TArgument argument) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<TArgument, TResult>.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<TArgument, TResult>.VisitCallSite(ServiceCallSite callSite, TArgument argument) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier) System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>.GetOrAdd(TKey key, Func<TKey, TValue> valueFactory) Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope) Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType) Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<T>(IServiceProvider provider) Microsoft.Extensions.DependencyInjection.OrchardCoreBuilderExtensions+<>c.<AddDataAccess>b__0_1(IServiceProvider sp) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<TArgument, TResult>.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<TArgument, TResult>.VisitCallSite(ServiceCallSite callSite, TArgument argument) Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier) System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>.GetOrAdd(TKey key, Func<TKey, TValue> valueFactory) Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope) Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType) Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService<T>(IServiceProvider provider) Microsoft.Extensions.DependencyInjection.OrchardCoreBuilderExtensions+<>c+<<AddDataAccess>b__0_2>d.MoveNext() OrchardCore.Environment.Shell.Builders.ShellContextFactory.CreateDescribedContextAsync(ShellSettings settings, ShellDescriptor shellDescriptor) OrchardCore.Environment.Shell.Builders.ShellContextFactory.OrchardCore.Environment.Shell.Builders.IShellContextFactory.CreateShellContextAsync(ShellSettings settings) OrchardCore.Environment.Shell.ShellHost.GetOrCreateShellContextAsync(ShellSettings settings) OrchardCore.Environment.Shell.ShellHost.GetScopeAsync(ShellSettings settings) OrchardCore.Modules.ModularTenantContainerMiddleware.Invoke(HttpContext httpContext) Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

调回net6 就没有问题

Error on setup screen

Hello when I try to run the setup screen and use the EasyOC init recipe after pressing Setup I get the following error :

An unhandled exception has occurred while executing the request. OpenIddict.Abstractions.OpenIddictExceptions+ValidationException: One or more validation error(s) occurred while trying to create a new application:

The client secret cannot be null or empty for a confidential application.

RDBMS的js方法, 默认返回的表是空的。

原因是: 默认过滤filterText 跟connectionConfigIdid一样。
造成 查询id ,且过滤掉 id 等于filtertext的内容
预期目标是 filterText 应该是空。
实际是跟id一致。
后台代码-对应filtertext 应该是要数据库scheme.table 而不是id:
` public async Task<IEnumerable> GetAllTablesAsync(QueryTablesDto queryTablesDto)
{
if (HttpContextAccessor.HttpContext.User.Identity.IsAuthenticated)
{
Console.WriteLine();
}
List result = await GetTablesFromCache(queryTablesDto.ConnectionConfigId, queryTablesDto.DisableCache);

        if (!string.IsNullOrEmpty(queryTablesDto.FilterText))
        {
            queryTablesDto.FilterText = queryTablesDto.FilterText.ToLower().Replace("[", string.Empty).Replace("]", string.Empty);
        }

        var tables = result
            .WhereIf(!string.IsNullOrEmpty(queryTablesDto.FilterText),
            x => $"{x.Schema}.{x.Name}".ToLower().Contains(queryTablesDto.FilterText))
            .OrderBy(x => x.Schema).ThenBy(x => x.Name)
            .Take(queryTablesDto.MaxResultCount)
            .Select(x => {
                var mResult = new DbTableInfoDto()
                {
                    ColumnsCount = x.Columns.Count
                };
                x.Columns.Clear();
                mResult = _mapper.Map(x, mResult);
                return mResult;
            }
            );

        return tables;
    }`

image

Does freesql help in doing json queries in orchards db?

Since orchards records are stored in the documents table in json format does freesql help in writing queries in json and return objects ?
Ive seen freesql has some json extensions but cant find examples on how to use them

项目启动会报错,NatashaInitiizer .preheating() 执行错误

这个没跟踪到是什么原因。 应该不是版本问题吧。
program-main 执行错误。
image

发生异常: CLR/NatashaException
“NatashaException”类型的异常在 EasyOC.CMS.WebHost.dll 中发生,但未在用户代码中进行处理: '应输入标识符'
在 AssemblyCSharpBuilder.Add(String script)
在 NatashaInitializer.Preheating(Func`3 excludeReferencesFunc)
在 EasyOC.CMS.WebHost.Program.<>c.

b__0_0() 在 e:\2024\EasyOC\EasyOC-github\EasyOC\src\EasyOC.CMS.WebHost\Program.cs 中: 第 20 行
在 System.Threading.Tasks.Task.InnerInvoke()
在 System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
在 System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)

Script Query 的使用: params 必须是 parameters

shellDb.GetRows('Select * from Document where id=@id',params), 注意遵循不同数据库的语法规范

parameters 要用IDictionary<string, object> 格式的json
`{

    "Id": 1,
    "Name": "John Doe",
    "IsVerified": true,
    "Roles": [
        "Admin",
        "User"
    ],
    "Profile": {
        "Age": 30,
        "Country": "USA"
    }

}`

要将 params 修改为: parameters 。 后台代码已经定死了
image

Integration Features

Can you import content into orchard from excel files for a specific content type?

graphql 更新内容mutation Api

目前的内容更新方式是在前端将 ContentItem.CotentTypePart.Field.Text 这样的深度路径直接展开成直属字段
在更新内容时再根据类型定义将单级属性对象转换为ContentItem

比如 :

{
    "Customer": {
        "CustName": {
            "Text": "Google"
        }
    }
}

展开为 :

{   "CustName":"Google" }

以上的操作如果对于简单类型的直接属性看起来没什么问题,但对于复杂一些的类型定义比如

{
    "Customer": {
        "CustName": {
            "Text": "Google"
        },
        "Field1": {
            "Text": "Value1"
        }
    },
    "Part1": {
        "Field1": {
            "Text": "Value2"
        }
    }
}

此时将会转换为

{
    "CustName": "Google",
    "Field1": "Value1",
    "Field1": "Value2"
}

会产生两个重复的Field1,
所以此时需要新建一个Api

{
    "CustName": "Google",
    "Field1": "Value1",
    "Part1": {
        "Field1": "Value2"
    }
}

理想的方式是实现Graphql 的 mutation api ,它可以避免传输一些非必要的字段,减少网络开销
https://graphql.org/learn/queries/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.