eXpandFramework / eXpand

DevExpress XAF (eXpressApp) extension framework. 𝗹𝗶𝗻𝗸𝗲𝗱𝗶𝗻.𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸.𝗰𝗼𝗺, 𝘆𝗼𝘂𝘁𝘂𝗯𝗲.𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸.𝗰𝗼𝗺 and 𝘁𝘄𝗶𝘁𝘁𝗲𝗿 @𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸 and or simply 𝗦𝘁𝗮𝗿/𝘄𝗮𝘁𝗰𝗵 this repository and get notified from 𝗚𝗶𝘁𝗛𝘂𝗯
http://expand.expandframework.com
Microsoft Public License
221 stars 115 forks source link

Microsoft cloud calendar in direction #789

Closed isatahiri closed 3 years ago

isatahiri commented 4 years ago

𝗤𝘂𝗲𝘀𝘁𝗶𝗼𝗻 In the IN direction, the local event is always null. Does that mean I have to request it in the db on the fly ? If so, the Id of the event is store in the CloudOfficeObject table i guess.

image

image

apobekiaris commented 4 years ago

if you e.handled=true means that u override the default map which will create an object for the Insert case like

 if (args.Instance.mapAction == MapAction.Insert&&synchronizationType.IsCreate()){
                                    localEvent = (IEvent)objectSpace.CreateObject(newCloudEventType);
                                    objectSpace.CommitChanges();
                                    objectSpace.NewCloudObject(localEvent, args.Instance.cloud).Wait();
                                    localEvent.Update( args);
                                }
                                else if (args.Instance.mapAction == MapAction.Update&&synchronizationType.IsUpdate()){
                                    localEvent.Update( args);
                                }

it use the Model for the newCloudEventType which by looking a bit up in the call chain is retrieved from

var newCloudEventType = _.frame.View.Model.Application.Calendar().NewCloudEvent.TypeInfo.Type;

https://github.com/eXpandFramework/DevExpress.XAF/blob/fc426d7b646bf18a98dadee1a91c5605e4314203/src/Modules/Office.Cloud.Microsoft.Calendar/CalendarService.cs#L197-L202

image

apobekiaris commented 4 years ago

an I have to request it in the db on the fly ?

so yes an object must be created since does not exist locally either from u or from the default map

isatahiri commented 4 years ago

I'll handle only update in this case. Seems to work. Thanks. I'm still having " SessionStore is not available.". I do not know how to repro it. So until then, I guess we cannot do much.

The error occurred:

Type:       InvalidOperationException
Message:    SessionStore is not available.
Data:       0 entries
Stack trace:

à DevExpress.ExpressApp.Web.ASPSessionValueManagerBase.SetValue(String key, Object value) à DevExpress.ExpressApp.Web.ASPSessionValueManager1.set_Value(ValueType value) à DevExpress.ExpressApp.Model.Core.ModelNodeValuesCache.get_ModelValuesCache() à DevExpress.ExpressApp.Model.Core.ModelNodeValuesCache.GetValue(ModelNode modelNode, String name, Func2 getValueMethod) à DevExpress.ExpressApp.Model.Core.ModelNode.GetDefaultValueCore(ModelValueInfo info, String name) à DevExpress.ExpressApp.Model.Core.ModelNode.GetValue[ValueType](IModelValue1 modelValue, String name, Int32 aspectIndex) à DevExpress.ExpressApp.Model.Core.ModelNode.GetValue[T](String name, Boolean inThisLayer, Int32 aspectIndex) à DevExpress.ExpressApp.Model.Core.ModelNode.GetValue[T](String name) à ModelCalendarItem.get_ObjectView() à Xpand.XAF.Modules.Office.Cloud.Microsoft.Calendar.CalendarService.<>c__DisplayClass27_0.<Authorize>b__4(IModelCalendarItem item) dans D:\a\1\s\src\Modules\Office.Cloud.Microsoft.Calendar\CalendarService.cs:ligne 116 à System.Linq.Enumerable.First[TSource](IEnumerable1 source, Func2 predicate) à Xpand.XAF.Modules.Office.Cloud.Microsoft.Calendar.CalendarService.<>c.<Authorize>b__27_2(ValueTuple3 t) dans D:\a\1\s\src\Modules\Office.Cloud.Microsoft.Calendar\CalendarService.cs:ligne 114 à System.Reactive.Linq.ObservableImpl.Select`2.Selector..OnNext(TSource value) dans //Rx.NET/Source/src/System.Reactive/Linq/Observable/Select.cs:ligne 39 InnerException is null

apobekiaris commented 4 years ago

SessionStore is not availabl

means that u access non-thread safe data stored in the HttpSession which is not available. from the screenshot u posted I cannot see clear, if you cannot find it ping me tomorrow on skype and I can remote to you

isatahiri commented 4 years ago

Ok Thanks

isatahiri commented 4 years ago

So after commenting all my customization, I still have the issue When looking at the stack, i checked the line 114-116 of the CalendarService and there you are accessing to the model : image

isatahiri commented 4 years ago

Method in CalendarService

static IObservable<(Frame frame, GraphServiceClient client, global::Microsoft.Graph.Calendar calendar, IModelCalendarItem calerdarItem)> Authorize(this  IObservable<Frame> source) 
        => source
            .AuthorizeMS()
            .EnsureCalendar()
            .Publish().RefCount()
            .WhenNotDefault(t => t.frame.Application)
            .Do(tuple => ClientSubject.OnNext((tuple.frame,tuple.client)))
            .Select(t => (t.frame, t.client, t.calendar,
                t.frame.Application.Model.ToReactiveModule<IModelReactiveModuleOffice>().Office.Microsoft()
                    .Calendar().Items.First(item => item.ObjectView==t.frame.View.Model)))
            .TraceMicrosoftCalendarModule(_ => _.frame.View.Id);
expand commented 3 years ago

The pre-release 2.201.19.3 in the DevExpress.XAF lab branch includes commits that relate to this task:

To minimize version conflicts we recommend that you use the Xpand.XAF.Core.All, Xpand.XAF.Win.All, Xpand.XAF.Web.All packages. Doing so, all packages will be at your disposal and .NET will add a dependecy only to those packages that you actually use and not to all (see the Modules installation-registrations youtube video).

Released packages: 1. [Xpand.Extensions.Office.Cloud v.2.202.59.6](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Extensions/Xpand.Extensions.Office.Cloud) 1. [Xpand.Extensions.Office.Cloud.Google.Blazor v.2.202.0.1](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Extensions/Xpand.Extensions.Office.Cloud.Google.Blazor) 1. [Xpand.XAF.Core.All v.2.202.43.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules) 1. [Xpand.XAF.Modules.AutoCommit v.2.202.59.6](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/AutoCommit) 1. [Xpand.XAF.Modules.CloneMemberValue v.2.202.59.6](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/CloneMemberValue) 1. [Xpand.XAF.Modules.CloneModelView v.2.202.59.6](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/CloneModelView) 1. [Xpand.XAF.Modules.GridListEditor v.2.202.59.6](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/GridListEditor) 1. [Xpand.XAF.Modules.HideToolBar v.2.202.59.6](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/HideToolBar) 1. [Xpand.XAF.Modules.LookupCascade v.2.202.61.6](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/LookupCascade) 1. [Xpand.XAF.Modules.MasterDetail v.2.202.59.6](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/MasterDetail) 1. [Xpand.XAF.Modules.ModelMapper v.2.202.59.7](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ModelMapper) 1. [Xpand.XAF.Modules.Office.Cloud.Google v.2.202.20.7](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.Cloud.Google) 1. [Xpand.XAF.Modules.Office.Cloud.Google.Calendar v.2.202.10.7](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.Cloud.Google.Calendar) 1. [Xpand.XAF.Modules.Office.Cloud.Google.Tasks v.2.202.17.7](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.Cloud.Google.Tasks) 1. [Xpand.XAF.Modules.Office.Cloud.Microsoft v.2.202.60.7](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.Cloud.Microsoft) 1. [Xpand.XAF.Modules.Office.Cloud.Microsoft.Calendar v.2.202.31.7](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.Cloud.Microsoft.Calendar) 1. [Xpand.XAF.Modules.Office.Cloud.Microsoft.Todo v.2.202.30.7](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.Cloud.Microsoft.Todo) 1. [Xpand.XAF.Modules.Office.DocumentStyleManager v.2.202.7.6](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.DocumentStyleManager) 1. [Xpand.XAF.Modules.OneView v.2.202.59.6](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/OneView) 1. [Xpand.XAF.Modules.PositionInListView v.2.202.30.6](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/PositionInListView) 1. [Xpand.XAF.Modules.ProgressBarViewItem v.2.202.59.6](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ProgressBarViewItem) 1. [Xpand.XAF.Modules.Reactive v.2.202.59.6](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive) 1. [Xpand.XAF.Modules.Reactive.Logger v.2.202.59.6](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive.Logger) 1. [Xpand.XAF.Modules.Reactive.Logger.Client.Win v.2.202.59.6](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive.Logger.Client.Win) 1. [Xpand.XAF.Modules.Reactive.Logger.Hub v.2.202.59.6](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive.Logger.Hub) 1. [Xpand.XAF.Modules.Reactive.Win v.2.202.59.6](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive.Win) 1. [Xpand.XAF.Modules.RefreshView v.2.202.59.8](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/RefreshView) 1. [Xpand.XAF.Modules.SequenceGenerator v.2.202.59.7](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/SequenceGenerator) 1. [Xpand.XAF.Modules.SuppressConfirmation v.2.202.59.6](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/SuppressConfirmation) 1. [Xpand.XAF.Modules.ViewEditMode v.2.202.59.6](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ViewEditMode) 1. [Xpand.XAF.Modules.ViewItemValue v.2.202.25.6](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ViewItemValue) 1. [Xpand.XAF.Modules.ViewWizard v.2.202.21.6](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ViewWizard) 1. [Xpand.XAF.Web.All v.2.202.43.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules) 1. [Xpand.XAF.Win.All v.2.202.43.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules)

Please update the related Nuget packages and test if issues is addressed. These are nightly nuget packages available only from our NugetServer.

If you do not use these packages directly but through a module of the main eXpandFramework project, please wait for the bot to notify you again when integration is finished or update the related packages manually.

Thanks a lot for your contribution.

expand commented 3 years ago

The pre-release 2.201.20.1 in the DevExpress.XAF lab branch includes commits that relate to this task:

To minimize version conflicts we recommend that you use the Xpand.XAF.Core.All, Xpand.XAF.Win.All, Xpand.XAF.Web.All packages. Doing so, all packages will be at your disposal and .NET will add a dependecy only to those packages that you actually use and not to all (see the Modules installation-registrations youtube video).

Released packages: 1. [Xpand.Extensions v.2.202.59](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Extensions/Xpand.Extensions) 1. [Xpand.Extensions.Mono.Cecil v.2.202.54](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Extensions/Xpand.Extensions.Mono.Cecil) 1. [Xpand.Extensions.Office.Cloud v.2.202.60](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Extensions/Xpand.Extensions.Office.Cloud) 1. [Xpand.Extensions.Office.Cloud.Google.Blazor v.2.202.4](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Extensions/Xpand.Extensions.Office.Cloud.Google.Blazor) 1. [Xpand.Extensions.Reactive v.2.202.60](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Extensions/Xpand.Extensions.Reactive) 1. [Xpand.Extensions.XAF v.2.202.60](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Extensions/Xpand.Extensions.XAF) 1. [Xpand.Extensions.XAF.Xpo v.2.202.56](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Extensions/Xpand.Extensions.XAF.Xpo) 1. [Xpand.XAF.Core.All v.2.202.44](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules) 1. [Xpand.XAF.Modules.AutoCommit v.2.202.60](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/AutoCommit) 1. [Xpand.XAF.Modules.CloneMemberValue v.2.202.60](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/CloneMemberValue) 1. [Xpand.XAF.Modules.CloneModelView v.2.202.60](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/CloneModelView) 1. [Xpand.XAF.Modules.GridListEditor v.2.202.60](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/GridListEditor) 1. [Xpand.XAF.Modules.HideToolBar v.2.202.60](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/HideToolBar) 1. [Xpand.XAF.Modules.LookupCascade v.2.202.62](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/LookupCascade) 1. [Xpand.XAF.Modules.MasterDetail v.2.202.60](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/MasterDetail) 1. [Xpand.XAF.Modules.ModelMapper v.2.202.60](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ModelMapper) 1. [Xpand.XAF.Modules.ModelViewInheritance v.2.202.60](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ModelViewInheritance) 1. [Xpand.XAF.Modules.Office.Cloud.Google v.2.202.21](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.Cloud.Google) 1. [Xpand.XAF.Modules.Office.Cloud.Google.Calendar v.2.202.11](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.Cloud.Google.Calendar) 1. [Xpand.XAF.Modules.Office.Cloud.Google.Tasks v.2.202.18](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.Cloud.Google.Tasks) 1. [Xpand.XAF.Modules.Office.Cloud.Microsoft v.2.202.61](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.Cloud.Microsoft) 1. [Xpand.XAF.Modules.Office.Cloud.Microsoft.Calendar v.2.202.32](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.Cloud.Microsoft.Calendar) 1. [Xpand.XAF.Modules.Office.Cloud.Microsoft.Todo v.2.202.31](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.Cloud.Microsoft.Todo) 1. [Xpand.XAF.Modules.Office.DocumentStyleManager v.2.202.8](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.DocumentStyleManager) 1. [Xpand.XAF.Modules.OneView v.2.202.60](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/OneView) 1. [Xpand.XAF.Modules.PositionInListView v.2.202.31](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/PositionInListView) 1. [Xpand.XAF.Modules.ProgressBarViewItem v.2.202.60](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ProgressBarViewItem) 1. [Xpand.XAF.Modules.Reactive v.2.202.60](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive) 1. [Xpand.XAF.Modules.Reactive.Logger v.2.202.60](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive.Logger) 1. [Xpand.XAF.Modules.Reactive.Logger.Client.Win v.2.202.60](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive.Logger.Client.Win) 1. [Xpand.XAF.Modules.Reactive.Logger.Hub v.2.202.60](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive.Logger.Hub) 1. [Xpand.XAF.Modules.Reactive.Win v.2.202.60](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive.Win) 1. [Xpand.XAF.Modules.RefreshView v.2.202.61](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/RefreshView) 1. [Xpand.XAF.Modules.SequenceGenerator v.2.202.60](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/SequenceGenerator) 1. [Xpand.XAF.Modules.SuppressConfirmation v.2.202.60](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/SuppressConfirmation) 1. [Xpand.XAF.Modules.ViewEditMode v.2.202.60](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ViewEditMode) 1. [Xpand.XAF.Modules.ViewItemValue v.2.202.26](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ViewItemValue) 1. [Xpand.XAF.Modules.ViewWizard v.2.202.22](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ViewWizard) 1. [Xpand.XAF.Web.All v.2.202.44](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules) 1. [Xpand.XAF.Win.All v.2.202.44](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules)

Please update the related Nuget packages and test if issues is addressed. These are nightly nuget packages available only from our NugetServer.

If you do not use these packages directly but through a module of the main eXpandFramework project, please wait for the bot to notify you again when integration is finished or update the related packages manually.

Thanks a lot for your contribution.

isatahiri commented 3 years ago

Passing to blazor... So closing this issue created for asp.net app.