Search This Blog

Monday, December 14, 2015

DashboardView - Allowing end-users to delete created dashboards via the application UI

In v15.2.4 we have added the DeleteDashboardsController which provides the DeleteDashboard Action. This Action is located in the Tools category and invokes a popup dialog with a list of all dashboard views defined in the user's model differences.

In this popup you can select one or more dashboards and click Delete to remove them. The DeleteDashboardsController.CanDeleteParentGroup property specifies whether or not the dashboard's parent group is deleted when you remove the last dashboard in this group. 

The DeleteDashboard Action is active when there are dashboards that can be deleted and the EnableCreation property of the Options | Dashboards node is set to true in the Application Model.


Previously, it was only possible to manage these user-defined dashboards via the Model Editor or in code. So, I hope you will now be able to enable this feature for your clients without the fear of being overloaded with support calls about removing unwanted stuff.

You can find more information on this XAF feature in the online docs here:

XPO ORM Data Model Designer and Wizard FAQ

My fellow colleague Michael has recently written an article based on the most popular support calls regarding the visual designer that XPO ships with, for editing visual data models. Some things may already be known to you, but others are worth repeating and I hope you will find this short doc helpful:



How to hide or filter out certain types from the drop-down editor for the System.Type properties

I want to share my recent article on the subject that demonstrates yet another example of how flexible and powerful XAF really is. There, I will describe three possible ways of accomplishing the same task, starting with the most recommended platform-agnostic solution at the business model level (write once, work everywhere) and finishing by manipulating end control properties in the UI for certain platforms and contexts. 


So, let me quite myself from this KB article in our Support Center:

Tuesday, October 27, 2015

Conditional Formatting for WinForms Tree List Editor

This is merely a follow up to my previous post:
How to enable the Conditional Formatting feature of the WinForms GridControl in the XAF GridListEditor and preserve ListView formatting settings between runs?

I want to share a similar solution for the TreeListEditor, which I coded and updated according to great customer feedback recently. You can learn more on this feature from the WinForms Controls > Controls and Libraries > Tree List > Conditional Formatting and TreeListOptionsMenu.ShowConditionalFormattingItem documentation.

Here are the steps needed to use the TreeListEditor in your XAF project:
1. In the Module Designer invoked for YourSolutionName.Module.Win/Module.xx file, add the Tree List Editor module to allow Visual Studio to automatically add required assembly references;
2. Copy and include this C# source file into YourSolutionName.Module.Win project (vb.net guys can either use this approach OR convert this code into their language using free tools).

Please track the corresponding Support Center thread to be automatically notified of any changes or other improvements in this regard.

As always, I am looking forward to hearing from you on whether you find this feature helpful for your apps.


Thursday, October 22, 2015

Avoiding the GetObjectsNonReenterant error for security permissions with complex criteria

UPDATE2

UPDATE1
During further testing we found that the new solution is not appropriate for certain scenarios (e.g., when new objects are created and saved under certain scenarios) and eventually decided not to make this new mode as default in v15.2. We will also mark the CanCheckModifiedObject option as obsolete for now. We will try to approach this problem from another angle at a lower XPO level. As always, we will keep you posted of our results once have anything to share. We apologize for all the inconvenience here.



OUTDATED
Let me quote myself from the Security - Avoid the GetObjectsNonReenterant error while evaluating security permission criteria involving collections during the object saving procedure thread in our Support Center:

We have provided the new CanCheckModifiedObject property in the DevExpress.ExpressApp.Security.SecurityRule class, which can be used to avoid loading additional collections and thus throwing the "GetObjectsNonReenterant" error from XPO internals while evaluating security permission criteria during the object saving procedure.


If CanCheckModifiedObject = True, both currently modified and existing database records are validated by security rules (the current behavior leading to the error).

Otherwise, if CanCheckModifiedObject = False, only the existing database records are validated by security rules. The latter configuration should be suitable in most business scenarios we are aware of and this will be the default configuration in v15.2.

Thus, to avoid the "Entering state 'GetObjectsNonReenterant' from state 'CommitTransactionNonReenterant, CommitChangesToDataLayer' is prohibited due to state 'CommitChangesToDataLayer' for 'DevExpress.Xpo.UnitOfWork(35)'" error in v15.1.8+, 
set the static DevExpress.ExpressApp.Security.SecurityRule.CanCheckModifiedObject property to False in the entry point of your application; e.g., within the constructor of your platform-agnostic module (YourSolutionName.Module/Module.xx) OR within the Main method of the WinForms app (YourSolutionName.Win/Program.xx) OR within the Application_Start method of the ASP.NET app (YourSolutionName.Web/Global.xx).

For instance, below is the code I added in the MainDemo.Module/Module.cs file of the project from the E4045: 
How to separate data between employees and managers of different departments using security permissions example while testing this improvement locally:

Friday, October 9, 2015

Improving performance when a large portion of data matches a workflow activity criterion

Here is a real customer scenario from a related Support Center thread: 

"Hi, I have an application with several workflows that work ok in my local computer (testing with few records), but when I deploy the workflows to a server and the workflow gets approximately 1,500,000 records that match the criteria the workflow service crashes...
I've done some testing and this only happens when the workflow needs to deal with a lot of data, workflows that deal with less records don't have a problem. I've been looking for an alternative like XPCursor or something similar to ask the workflow to page the records that meet the criteria but I haven't found any."


After some time, we could replicate this behavior locally and found that it could be easily improved upon on our side. In short, our solution is in using XafDataView + a sort of paging  when first querying and processing records that match a certain workflow activity definition criteria in the workflow service. 

A minor improvement to the Object Property Editors that represent aggregated object references in the UI


Starting with version 15.1.8, you can easily specify a custom DetailView for ObjectPropertyEditor via the Model Editor at the DetailView | Items or ListView | Columns node levels in the Application Model:


Thus,  the IModelMemberViewItem.View  attribute now helps you specify custom Views for all object reference property editors used in both ListView and DetailView.

Previously, this task required a custom-tailored code solution like in the How to change ASPxObjectPropertyEditor's DetailView thread.  So, I hope you find this addition helpful.