-
-
Notifications
You must be signed in to change notification settings - Fork 44
Office.DocumentStyleManager
The DocumentStyleManager can massively re-brand a large number of documents using style templates.
Credits: to the Company (wants anonymity) that sponsor the initial implementation of this module.
This is a platform agnostic module that can be used to configure templates that can be applied to XAF domain components that contain members which store RTF documents.
Using the UI, the end user, from a predefined detailView can execute the Style Manager SingleChoice action to display the manager view for template generation or for re-branding of the documents contained in the DetailView Domain Component.
-
To configure for which members populate the StyleManager SingleChoiceAction you can use the model as in the next image.

-
In the
ImportStylesnode you can configure which views contain Domain Components that will be used in case you need to import styles from other documents while you generating the template.
-
The
ApplyTemplateListViewsnode contain the ListViews where you can apply the generated template.
Additional options are available as DocumentStyManager attributes.

You can use the model to configure:
- The subject
Views, the target containerCalendarand which Domain Component should be created when aNewCloudEvent.
- The CRUD
SynchronizationTypeand theCallDirection.
The package can operate without any configuration by executing a predefined map between the IEvent and Google.Apis.Calendar.v3.Event objects on Update and on Insert for both incoming and outgoing calls.
To customize the predefined map you can use a query like the next one which suffix the Google.Apis.Calendar.v3.Event subject with the current date:
CalendarService.CustomizeSynchronization
.Do(e => {
var tuple = e.Instance;
if (tuple.mapAction != MapAction.Delete){
if (tuple.callDirection == CallDirection.In){
tuple.local.Subject = $"{tuple.cloud.Subject} - {DateTime.Now}";
}
else if (tuple.callDirection == CallDirection.Out){
tuple.cloud.Subject = $"{tuple.local.Subject} - {DateTime.Now}";
}
e.Handled = true;
}
})
.Subscribe();Cloud to local synchronization: The package track changes using synchronization tokens.
The first time the run method is called it will perform a full sync and store the sync token. On each subsequent execution it will load the saved sync token and perform an incremental sync.
Possible future improvements:
Any other need you may have.
Let me know if you want me to implement them for you.
In the next screencast you can see all CRUD operations on the Event BO and how they synchronize with the Google Calendar, for both platforms Win, Web and both directions Incoming, Outgoing. At the bottom the Reactive.Logger.Client.Win is reporting as the module is used.
-
First you need the nuget package so issue this command to the
VS Nuget package consoleInstall-Package Xpand.XAF.Modules.Office.DocumentStyleManager.The above only references the dependencies and next steps are mandatory.
-
Ways to Register a Module or simply add the next call to your module constructor
RequiredModuleTypes.Add(typeof(Xpand.XAF.Modules.Office.DocumentStyleManagerModule));
The module is not bound to DevExpress versioning, which means you can use the latest version with your old DevExpress projects Read more.
The module follows the Nuget Version Basics.
.NetFramework: net461
| DevExpress.Persistent.Base | Any |
| DevExpress.ExpressApp | Any |
| DevExpress.ExpressApp.Xpo | Any |
| Fasterflect.Xpand | 2.0.7 |
| Google.Apis.Auth | 1.49.0 |
| Google.Apis.Calendar.v3 | 1.49.0.2049 |
| JetBrains.Annotations | 2020.1.0 |
| Newtonsoft.Json | 12.0.3 |
| System.Reactive | 4.4.1 |
| Xpand.Extensions | 2.202.53 |
| Xpand.Extensions.Office.Cloud | 2.202.54 |
| Xpand.Extensions.Reactive | 2.202.54 |
| Xpand.Extensions.XAF | 2.202.54 |
| Xpand.Extensions.XAF.Xpo | 2.202.50 |
| Xpand.XAF.Modules.Office.Cloud.Google | 2.202.15 |
| Xpand.XAF.Modules.Reactive | 2.202.54 |
| Xpand.VersionConverter | 2.202.10 |
To Step in the source code you need to enable Source Server support in your Visual Studio/Tools/Options/Debugging/Enable Source Server Support. See also How to boost your DevExpress Debugging Experience.
If the package is installed in a way that you do not have access to uninstall it, then you can unload it with the next call at the constructor of your module.
Xpand.XAF.Modules.Reactive.ReactiveModuleBase.Unload(typeof(Xpand.XAF.Modules.Office.DocumentStyleManager.Office.Office.DocumentStyleManagerModule))The module is tested on Azure for each build with these tests. All Tests run as per our Compatibility Matrix
)

