eXpress App Framework Team
  • XAF - Additional Enhancements for Windows & Web Platforms, Core and Model Editor (Shipping now in v16.2)

    Happy New Year Everyone!

    Late last year, I described some of the new features we shipped as part of XAF v16.2. In this post, I'll discuss a few other enhancements we incorporated in v16.2.

    Support for Multiple Browser Tabs

    v16.2 includes support for a popular ASP.NET scenario - displaying multiple independent XAF views via browser tabs within the same web browser instance . If you've used XAF in the past, you'll know that this specific requirement was not easy to implement, as the XAF web site stored information about the current main window within the ASP.NET session between requests (learn more...). Technically, it still does, but with v16.2, each loaded web window has a unique identifier by which all requests are correctly routed on the server. 

    With the new static WebApplication.EnableMultipleBrowserTabsSupport feature toggle, you can, for instance, include hyper links to two different XAF views in a customer email and when clicked, these links will open two separate browser tabs so that end-user can work with them independently.

     


    Custom grouping of Application Model nodes in the Model Editor

    This feature was inspired by customer feedback and to help explain it, let's consider a real world scenario. Assume that you have numerous custom Controllers placed in folders with the following naming convention:

    https://community.devexpress.com/blogs/eaf/16.2/ModelEditorCustomGrouping1.png

    In previous versions, XAF did not offer an easy way to navigate between these Controllers and Actions in the Model Editor due to the default grouping by the Action identifier. Essentially, users requesting this feature needed to provide custom grouping - similar to that found in Solution Explorer. With v16.2, you can use the new ModelEditorGroupingHelper API to customize default node grouping. Here is a sample screenshot from an actual end-user project:

    https://community.devexpress.com/blogs/eaf/16.2/ModelEditorCustomGrouping2.png

     

    Improved Web UI Theme Customization

    Though this feature was derived from the DevExpress ASP.NET product library, I definitely want to make mention of it. Let me quote myself from my personal blog:

    "There were a good number of requests to simplify the process of adjusting the New Web UI to match corporate colors. With v16.2, this process became much easier with the new options for changing the base color and font in code or configuration files of your app. Our XCRM.Web demo now contains a custom color/font scheme picker to demonstrate the use of these new release capabilities:

    https://community.devexpress.com/blogs/eaf/16.2/ColorFontChooserInXCRM.Web.png

    In addition, the XAF theme was better integrated with the ASPxThemeBuilder & ASPxThemeDeployer tools offered by our DevExpress ASP.NET team for creating and deploying custom themes. These actions appear to be a good start towards a "true" themes chooser requested by some customers or rather their end-users, who liked a vast number of predefined styles. The idea under consideration is  that we may support changing more theme parameters at runtime (e.g., the white background was reported as eye-fatiguing by some users), i.e., not only the main color and font."

    Take special note that color/font picker feature is NOT part of the standard delivery and is enabled only in our XCRM demo by default. To add and customize this feature in your project, do the following:
        1. Copy and include the "C:\Users\Public\Documents\DevExpress Demos 16.2\Components\eXpressApp Framework\XCRM\CS\XCRM.Web\BaseColorSelector" folder in the YourSolutionName.Web project.
        2. Copy and include the "C:\Users\Public\Documents\DevExpress Demos 16.2\Components\eXpressApp Framework\XCRM\CS\XCRM.Web\CustomDefaultVerticalTemplateContent.xx" files in the YourSolutionName.Web project and optionally customize the custom template in Visual Studio to meet your business requirements.
        3. In the YourSolutionName.Web/Global.asax.cs file, add the WebApplication.Instance.Settings.DefaultVerticalTemplateContentPath = "CustomDefaultVerticalTemplateContent.ascx"; line to the Session_Start method after the WebApplication.SetInstance call.
    Refer to the Task-Based Help > How to: Customize an ASP.NET Template article to learn more about this customization process.

    Platform-Agnostic API for Displaying Dialogs

    With v16.2, use of custom dialogs has been simplified for both WinForms and ASP.NET applications. The ShowViewStrategyBase.ShowViewInPopupWindow method displays the specified View in a popup dialog with OK and Cancel buttons:

    Application.ShowViewStrategy.ShowViewInPopupWindow(Application.CreateDashboardView(Application.CreateObjectSpace(), "PaymentSuccessConfirmation", true));

    You can also pass the okDelegate and cancelDelegate  parameters to this method and specify the code to be executed when the OK and Cancel buttons are clicked. Button captions can be customized using the okButtonCaption and cancelButtonCaption parameters.

    In the following screenshot, you can see how a DashboardView configured in the Application Model can be used with this new method in an ASP.NET app:

    https://community.devexpress.com/blogs/eaf/16.2/ShowViewInPopupWindow.png

    The ShowViewInPopupWindow method provides a platform-agnostic way to display popup dialogs from your code. However, there are certain specifics in ASP.NET applications:

    - The ShowViewInPopupWindow method can be used on XafCallbackManager callbacks initiated by the RaiseXafCallback script. It cannot be used on control callbacks (e.g., grid sorting).
    - It is impossible to pause the current request to wait for user input.
    - Main window is not refreshed when the Cancel button is clicked.

    Improved Customization of Action Controls

    The customization of UI controls used to visualize XAF Actions has been simplified. With v16.2, each Action exposes the CustomizeControl event that provides access to the underlying control including its context information. Related product documentation and examples like How to: Customize Action Controls and How to: Access Navigation Control were updated to reflect the new implementation. All of the possible scenarios are also demonstrated in the Action section of the Feature Center demo that is shipped with XAF. Below is a screenshot of Visual Studio demonstrating customization of a parametrized Action control in WinForms:

    https://community.devexpress.com/blogs/eaf/16.2/CustomizeControl.png

    To learn more about the reasons behind this feature, be sure to check out my blog as well.

    Instant Feedback UI Mode in WinForms GridListEditor

    With this release, XAF List Views support our server-side data processing engine - Instant Feedback UI Mode. When used, your apps will remain responsive regardless of dataset size. To enable this feature, set the ListView's DataAccesMode property to InstantFeedback. Refer to the List View Data Access Modes  and How to: Access Objects Selected in the Current View help articles for more information on supported scenarios and usage specificities.


    Faster App Startup

    We've improved our Application Model cache (introduced in v16.1) and further reduced WinForms application startup times. To learn more, check out the XafApplication.EnableModelCache article for additional information. Please note that you can now enable parallel loading of business types and tune the model cache by setting the static DevExpress.ExpressApp.ModelCacheManager.UseMultithreadedLoading and DevExpress.ExpressApp.ModelCacheManager.SkipEmptyNodes properties to True before the XafApplication.Setup method is called in the YourSolutionName.Win/Program.xx file. Based upon tests with various large customer applications, startup time can be reduced up to 30% when implemented. In general, the more business classes and Controllers included in an app, the greater the impact from this enhancement.

    As always, we welcome your comments and feedback. Tell us what you think of these new features.

  • XAF - The New Dashboards Module & Much More (Shipping now in v16.2)

    I'd like to preface this blog post with a recent quote from one of our loyal XAF users - Mario Blataric. He was an active beta tester in this release cycle. 

    Here is what he wrote in an urgent DevExpress Support Center ticket: T460839 - Urgent, need to share 16.2 excitement !!  

    "I know I can be hard customer sometimes with loads of tickets, so in the light of 16.2 release and near the end of 2016, I would like to do something different for a change. I would like to express my excitement about 16.2 release. I have been using alpha and beta rather intense in both Win and Web platforms and I can not remember when so many goodies were coming in single release. It is possible that this time many more things affect me than usual, but never the less - I absolutely love 16.2. Let me just quickly mention several things that excite me the most:

    - startup improvements of Win application (model caching)
    - ability to custom group Actions in model (as well as other nodes separately)
    - ability to edit reports (massive excitement generator - please make sure reports team get this one :-))
    - improvements of new web ui and color schemes
    - navigation permissions and PermissionPolicy (ok, PP is not 16.2 - but it got my attention in combination with navigation permissions so it is just a bonus)
    - InstantFeedback mode - I love it!
    - improved filter control on web - real beauty
    - mobile support (not born in 16.2, but got serious enough to take my attention)
    - Visual Studio 2017 support (another nice bonus)
    - and basically everything else. Some seriously amazing stuff was done for 16.2 - huge cudos!

    Also, I would like to express my deepest gratitude for support you provided in last couple of months helping me with some long-term issues I could not squash for months or even years. So, thank you for that.

    Best regards and keep doing amazing job, Mario"

    We appreciate those of you willing to migrate your apps to our most recent builds. As I'm sure you can appreciate, feedback goes a long way to making our product more stable and easier to use. 

    With that - let's take a quick look at the newest features shipping inside XAF v16.2.

    New Dashboards Module (Windows and Web)

    You can now leverage the flexibility of DevExpress Dashboard to create interactive decision support systems for Windows and the Web. We considered previously available custom solutions for the most popular dashboard scenarios (see this Support Center ticket) and determined that our best path forward was to deliver a universal Dashboards module. This built-in module should reduce the work and complexities associated with the integration of the DashboardViewer/DashboardDesigner and ASPxDashboard components into your next XAF-based WinForms and ASP.NET app.

    XAF WinForms Dashboard Module

    XAF Web Dashboard Module

    If you're reading to give this new module a try, I suggest you start with our online documentation at Dashboards Module as well as XCRM and Feature Center demos.

    Before I continue, I want to take a moment and emphasize that this new feature is a perfect example of what XAF is and how it's developed. Technically, XAF is a set of best practices and proven solutions - This set it finite as are our resources, but you are still "safe" and not "locked in". That is because you can always implement custom requirements, if a control or feature is currently unavailable - our team has done its best to ensure that the Framework is flexible and extensible. When we see high demand for a feature or we develop a better understanding of usage scenarios, new solutions typically get baked into the standard delivery.

    Permissions for Navigation Items and Groups

    With v16.2, you can grant or deny access for specific navigation items and groups in the Navigation Permissions tab of the PermissionPolicyRole Detail View:

    Much like Dashboards, we have also reconsidered and integrated previously available custom solutions into our standard delivery. Take special note that this new feature is available only for permission policy and the PermissionPolicyRole class added in v16.1.

    If you are still using SecuritySystemXXX classes, you might want to consider the following migration guidelines: 
    How to use the Allow/Deny permissions policy (aka the PermissionPolicyUser and PermissionPolicyRole classes) in the existing project

    If you're using Entity Framework and want to upgrade from v16.1 to v16.2, please review the following KB article:
    How to: Add Navigation Permissions to an Entity Framework Application Created with XAF 16.1

    Criteria Editor Enhancements (Web UI)

    XAF's ASP.NET Criteria Property Editor now supports many of the features available in its WinForms counterpart, including:

    • ability to display full object hierarchies, including members of reference and collection properties;
    • use of built-in XAF editors for value types that don't have a native editor;
    • ability to edit criteria as a string;
    • display user-friendly criteria strings within the grid footer.


    This feature is very helpful when configuring security permissions with criteria and a variety of other data analytics scenarios (e.g. with Pivot Chart - your end-users will love it!). Our wrappers around the DevExpress ASPxFilterControl also expose a number of options which you may want to tune based upon your business requirements (see the updated Concepts > Business Model Design > Data Types Supported by built-in Editors > Criteria Properties help article for more details).


    Mobile Platform (CTP) Enhancements

    We continue to focus energy on our new mobile UI, and in this release, we've incorporated the following enhancements:

    • Improved look and feel, with new UI layouts optimized for desktop and tablet devices. What do you think of the new blue design, btw?
    • Application Simulator no longer requires an internet connection. Previously, XAF users required to connect to our Azure-hosted web site for testing, which was not always convenient.
    • 'Active' and 'Enabled' action states are now context-dependent, i.e. can be updated depending on whether the currently selected list or detail record matches some criteria.

    XAF Mobile UI - Phones

    XAF Mobile UI - Tablet

    We have also fixed a series of issues for improved stability. This mobile UI is still available as a CTP, because we have a number of things in our TODO list for the final release. These include: simplified localization, easier custom control integration and better support for extended modules like maps, reports, etc. Check out the links below to learn about what we ship in the box or how to add the same functionality to your next project:

    Demo    FAQ    Tutorial    Video

    I'll have more to share about XAF v16.2 in a subsequent post. In the meantime, I'd love to get your feedback on these new features.

    Happy New Year!

  • XAF - Check out a case-study on the New Web UI from DevPark

    I wanted to draw your attention to a recent case study we published about DevPark's  https://www.fitness365.ru project. Roman Shelomanov and his team have created an XAF powered Web and Windows client with a common core and logic.

    You can read the case study here: https://www.devexpress.com/Home/Case-Studies/fitness365/


    Should you have an XAF project you'd like us to showcase on our site OR want to share suggestions on how you'd like us to improve your XAF development experience, please email me. Happy XAFIng:)

  • XAF - Mobile Platform (CTP) Updates (Shipping now in v16.1)

    I wanted to update all of you on XAF's Mobile UI (CTP) we first publicly announced in late April (XAF Goes Mobile: CTP Version Ships with v15.2.9). To refresh your memory, this new feature allows you to create iOS, Android and Windows Phone apps alongside its Windows and Web app counterparts. XAF's mobile apps reuse the database, as well as certain aspects of the data model, application logic and UI settings of existing XAF applications.

    In the last couple of months, we've received some great feedback from early adopters (thank you very much for all your support and assistance) and as a result, we've been hard at work improving our implementation. At this stage, the mobile platform is still in CTP and is not yet ready for production use due to known issues, unsupported scenarios and a somewhat long TODO list. Additionally, certain aspects of XAF Mobile's functionality and API are likely to change...

    In this blog post, I'd like to describe the primary changes made between our last set of iterations.

    XAF Solution Wizard integration

    With v16.1.4, you can create XAF Mobile apps via our Solution Wizard - invoked via the File | New | Project... menu in Visual Studio:

    The wizard's UI is automatically updated based on selected options (Entity Framework, AuthenticationActiveDirectory and Client Side Security UI-level items are filtered out, because they are unsupported). See more wizard screenshots here: onetwothreefourfive.

     

    Simplified Navigation

    Business classes marked with the DefaultClassOptions attribute and residing in the Default navigation group appear in the mobile navigation automatically - without the need to set MobileVisible = True for each corresponding View via the Model Editor. This should simplify your path to a Mobile app for existing projects. At this point, if your navigation items reside in custom navigation groups (other than "Default"), you will need to place them into the Default group.

    In the future, it's likely that a different DevExpress Navigation Control (like the DevExpress Accordion) will be introduced to cover complex navigation hierarchies.


    Simplified Testing - Local Simulator Built into your Mobile Project

    Simulator (Index.html and player.html) - technically this is a web page that contains a client "player" script that queries the aforementioned backend data and UI metadata services and generates the actual HTML5/JS UI inside the web browser. This player script also gets redistributed to the actual mobile device when a native package is installed. The simulator is automatically opened in the web browser when you make a YourSolutionName.Mobile project as startup in Solution Explorer and start debugging (F5). Note: At present, this simulator downloads resources from Azure and thus requires at Internet connection. Going forward, this will not be required as all resources will be obtained from an assembly locally.



    Secured OData Service with Basic Authentication

    If you are not yet familiar with Basic Authentication and our its support in XAF v16.1, refer to this Wikipedia article: https://en.wikipedia.org/wiki/Basic_access_authentication#Client_side. Going forward, I will also use examples from this article to better explain the implemented feature.The mobile project created by the Solution Wizard consists of a DataService.svc file, representing the backend service used to serve requests, manage security and execute actions. Technically, it's a standard OData service (WCF Data Services 5.0) based on an XPO OData V3 provider.

    Let me show how the security portion of this data service works:

    http://localhost:51562/DataService.svc/DevExpress_Persistent_BaseImpl_Task/$count service query produced the following results for different users, as expected:

        4 for Sam with an empty password (Authorization:Basic U2FtOg==);

        1 for Aladdin with the OpenSesame password (Authorization:Basic QWxhZGRpbjpPcGVuU2VzYW1l)

    Based upon security permissions, only a single task is visible to Alladin while Sam sees all four tasks. User credentials are passed from the client to the service in request headers via the special Authorization field (see that base64-encoded thing in parentheses above). If you are curious as to how I modified request headers for these tests, I used the ModHeader plug-in from the Chrome Web Store:

    The XAF mobile client queries the data service in a similar way, but does it behind the scene via AJAX requests. Below is a screenshot from the mobile simulator when a user Aladdin navigates to tasks: 


    As you can see, the XAF Mobile UI works much like our Windows and Web interfaces with the same security settings:


    The most important thing is that this secured XAF Data Service is not limited to XAF Mobile apps. You can leverage it from other non-XAF clients supporting Basic Authentication.

    For instance, you can use our Data Explorer product for iOS with XAF's data service to generate a secured app:


    Here I am just showing a couple of configuration steps along with the resulting app (which was generated from the XAF Data Service deployed in Azure -- http://maindemo.cloudapp.net/DataService.svc). You can find full configuration instructions for Data Explorer client apps in its getting started guide or in the How to use Data Explorer with the XAF secured OData Service supporting Basic Authentication KB article.

    To obtain additional information on XAF Data Service and its usage from various clients, be certain to check out the following article: FAQ: New XAF HTML5/JavaScript mobile UI (CTP).

    Windows Phone 8.1 Support

    We have tuned native package settings so that they can be used on the Adobe PhoneGap Build service to generate an XAP file ready for Windows Phone 8.1 deployment. 

    You can modify the config.xml file in the *.ZIP file we generate in order to specify the architecture of your device (anycpu, arm, x86 either x64): <preference name="windows-arch" value="anycpu" />
    As for the future, we hope to simplify the current mechanism towards built-in Visual Studio integration so that you do not need to learn and use a separate service.

    Updated Learning Materials and Demo for the Mobile platform

    We have updated our Getting Started Tutorial and Frequently Asked Questions articles to reflect the latest changes in v16.1. If you don't have time to build your own XAF Mobile app but want to experience some of what's possible, feel free to try our Online Mobile Demo today.

    Things we are still working on

    We have mostly met the goals we set for ourselves in v16.1, but there are still many features we need to implement in order to consider XAF Mobile ready for its first beta. Specifically, we're focused on :  

    • Improved stability, API;
    • Look & feel and other UX related matters;
    • Supporting frequently requested use-case scenarios;
    • Improved online documentation;

    It is likely that there will be more updates on this in the coming months. Follow our team blog for more information as it becomes available...

    We would love to hear your feedback on XAF Mobile, so please contact us via the Support Center (preferred) or here in the Comments section.  

  • XAF - UX Improvements for Design Time Templates, Windows and Web UI (Coming soon in v16.1)

    Design-time enhancements

    With our upcoming release, all XAF templates will be available from the DX Template Gallery (look for the DevExpress v16.1 Template Gallery item in the standard Add New Item... dialog or see the "Add DevExpress Item" context menu item for your projects in Solution Explorer):


    Additionally, we've provided shortcuts for the most recently used (MRU) item templates to the Add DevExpress Item... menu - invoked for XAF projects under the Solution Explorer:


    Notice that there is a new Non-Persistent Object item template that allows you to create non-persistent classes with ease (it contains all the required boilerplate code and example implementations of the INotifyPropertyChanged, IXafEntityObject, IObjectSpaceLink interfaces). Please review my earlier blog post to learn on more improvements with regard to managing non-persistent objects in standard XAF forms. See the Changes to Visual Studio Item Templates in XAF v16.1 KB article for more details.


    WinForms SDI: Outlook-Style Navigation Integration

    For those of you targeting Windows, XAF's integration of DevExpress WinForms Outlook-Style navigation controls and OfficeNavigationBar is now better than ever.

    The OfficeNavigationBar can be displayed in non-compact mode, as in the screenshot above, or in the compact mode (enabled by default) demonstrated below:

    You can always switch between compact and non-compact modes via the Navigation Options dialog ().

    Each navigation link at the bottom of the OfficeNavigationBar panel corresponds to the root navigation group defined under the NavigationItems node.

    Clicking on these group items can be include animations managed by our TransitionManager component  where the SlideFadeTransition type is used by default (view a full-size GIF without losing quality HERE):


    This new feature is enabled only in SDI mode (UIType = SingleWindowSDI) with the ribbon menu (FormStyle=Ribbon) when the new RootGroupStyle property is set to OutlookSimple or OutlookAnimated. You can initialize these configurations in code or via the Model Editor:

    For a cleaner UI and better end-user experience, the DockPanel previously hosting the NavBarControl was also removed. The NavBarControl is now positioned directly in the form template, which also helped us remove unnecessary borders.

    The expand/collapse functions of the removed dock panel are now natively managed by the NavBarControl and the two new buttons added into the status bar. The "Normal View" button expands the NavBarControl while pressing the "Reading View" button collapses the NavBarControl.


    SVG icons support in ASP.NET

    In XAF ASP.NET applications, SVG images are now supported, which improves your website's appearance on displays with high pixel density (resolution).

    If you're adding custom images as per this documentation article, note that image display size is determined by the svg element's viewBox attribute. Also, SVG icons are not grayed out automatically for disabled Actions. You should manually add a disabled variant of an SVG icon with the _Disabled suffix (e.g., MyIcon_Disabled.svg).

    Our UX designers also started to redraw standard XAF images, but this is still in works. You can easily view already updated images in the Model Editor's image picker:

    Our future plans include completing this image collection and to introduce this same capability for XAF's WinForms UI.


    Faster rendering and other performance optimizations for popular Web UI scenarios

    In short, the core idea for all these performance improvements in XAF ASP.NET WebForms apps is that under certain circumstances, we intentionally suppress creation and rendering of current web page controls, disable unnecessary data-binding operations, reduce the number of requests to the server and perform updates on the client side where possible. This allows us to produce a web app that behaves faster and is more responsive, which is essential for hand-held devices (e.g., tablets, smart phones). Desktop web browser users will also benefit from these changes, especially in scenarios involving popup windows.

    Since several thousand of our unit and complex functional tests have passed, these optimizations are turned on by default in XAF v16.1, so that everyone can benefit from them. For backward compatibility or any unhandled issues in your custom code that might occur due to these optimizations, we also provided various static options in the DevExpress.ExpressApp.Web.WebApplication.OptimizationSettings class allowing you to turn this feature off completely (or partially). I've described these options and scenarios in the following KB Article: https://www.devexpress.com/kb=T386142 


    Your feedback is needed!

    As always, my team and I look forward to hearing your thoughts on each of these improvements in comments to this blog or via the https://www.devexpress.com/Support/Center/Question/Create service.

  • XAF - Reports and Security System Enhancements (Coming soon in v16.1)

    This post is devoted to several improvements for the two key features of any serious line-of-business application - reporting and security. As you might expect from a mature application framework, DevExpress XAF ships with reusable ReportsV2 and Security modules designed to simplify the integration of the DevExpress Reporting Platform and role-based authorization features (actually much more than this!) for Windows, Web and Mobile platforms.

    Let's take a look and see what's inside the upcoming major release for reports and security.


    Grid Based Reporting in WinForms Applications

    XAF now supports the built-in printing/export capabilities of the DevExpress Grid and thus allows you to create a report from any grid-based List View. The report's layout is autocreated (and is based on grid columns, appearance and filter settings) when you click the "New Report" command in the Export menu.


    Technically, this is done by handling the ExportController.ExportActionItemsCreated event from the WinGridReportExportController and adding a New report item to the ExportController.ExportAction.

    The New report item invokes the Report Designer. The current grid layout is automatically converted to a report layout. You can learn more about report generation rules in our Advanced Grid Printing and Exporting topic.

    If you click Save, the report is saved to the application database, together with other user-defined reports.


    Allow/Deny Modifier for Security Permissions (Beta)

    With XAF's Security System, your application administrators can now allow access to all data within the application for a specific role and simultaneously deny access to a few data types or members. Alternatively, an end-user can deny access to all data for a role and only allow access to a strict list of objects or members. Both approaches make it easy to allow/deny data access across a broad range of use-case scenarios. To use this feature, choose Allow/Deny Permission Policy on the Choose Security page of the Solution Wizard.

    As a result, special types of security users and roles will be used in your application - PermissionPolicyUser and PermissionPolicyRole. Entity Framework and XPO versions of these classes are declared in the Business Class Library. The primary difference with SecuritySystemUser and SecuritySystemRole classes (which were previously used by default and are now used for the Deny All policy) is that the role object exposes the PermissionPolicy property:

    With this property, you can assign "deny all", "read only all" or "allow all" default permission policies for each role. This allows you to create very complex and flexible security configurations.

    For each operation, you can explicitly specify the Allow or Deny modifier or leave it blank.

    If the modifier is not specified, the permission is determined by the role's policy type. Note that policy has the lowest priority and is in play only when permissions are not explicitly specified.


    Dynamic Permissions for Associated Objects

    To allow users to modify objects used in associations (one-to-many and many-to-many), you should grant access to the properties on both sides of the association, because linking and unlinking operations always lead to the modification of both properties. XAF's Security System now simplifies this task by detecting associations and configuring required permissions automatically.

    Required permissions are granted dynamically each time an associated object is requested when the ServerPermissionRequestProcessor.UseAutoAssociationPermission or ServerPermissionPolicyRequestProcessor.UseAutoAssociationPermission static field is set to true. The former field is considered for the Deny All policy, and the latter - for the Allow/Deny policy (see the Allow/Deny Modifier for Security Permissions section above). The SecuritySystem.IsGranted request for a member is processed as follows in this mode.

    • The default security request is processed for a given member. If permission is granted, the result of this request is returned.
    • If permission is not granted at the previous step and the current member is an association (see IMemberInfo.IsAssociation), the request is processed for the associated member. The result of this additional request is returned.
    • If permission is not granted at the first step, and the current member is not an association, Security System checks if the member type is aggregated to another type. If owner type is found, a permission for the corresponding aggregated collection is requested and returned.

    The SecuritySystem.IsGranted request for a type or object is processed as follows.

    • The default security request is processed for the given type. If type permission is granted, the result is returned.
    • If type permission is not granted at the previous step, Security System checks if the type is aggregated to another type. If the owner type is found, a permission for the corresponding aggregated collection is requested and returned.
    • The requests for the Navigate operation are not processed using associations.

    Simply stated, you configure permissions on one side of the one-to-many or many-to-many association, and the same configuration is automatically applied on the other side. If this does not fit your requirements, you can always configure permissions explicitly.

  • XAF - Startup Performance, Application Model and Non-Persistent Objects Enhancements (Coming soon in v16.1)

    In my opinion, XAF's Application Model (defined as a set of application settings or UI skeleton) is the second most important XAF feature (first being automatic database and CRUD forms generation based on your ORM data model).

    Because of its importance, we consistently strive to improve the Application Model and in our upcoming release, we focused our energies on improving startup application performance and general usability for XAF developers.

    Application Model Caching

    With v16.1, you can speed up WinForms application startup using the EnableModelCache property. When set to true, Application Model content is cached to a file when the application is first launched and recovered on subsequent runs. This property works in a production environment when the debugger is not attached (see Debugger.IsAttached). By default, EnableModelCache is set to false. To change this property value, add the following code to the Program.cs (Program.vb) file, before the Setup method is called: winApplication.EnableModelCache = true;

    As a result of these settings, Nodes Generators and Generator Updaters will be executed and the Model.Cache.xafml cache file will be created only when the application is started for the first time. Note that initial startup can take more time than normal, however, the time taken by subsequent startups will be reduced, because the Application Model content will be recovered from the cache. The cache is recreated when application module version is incremented. 


    By default, the Model.Cache.xafml file is located in the application folder. You can change its path using one of the following methods:
    1. override the GetModelCacheFileLocationPath method in XafApplication descendant;
    2. use the ModelCacheLocation key in the configuration file (App.config).

    The Model.Cache.xafml file name is specified by the ModelStoreBase.ModelCacheDefaultName constant. If your application is localized, separate cache files are created for each language (e.g. Model.Cache_de.xafml).

        

    Frequently Asked Questions

    Q: How is this different from the existing ModelAssembly.dll-based cache?
    A: Unlike the existing ModelAssembly file-based cache (which is technically an assembly providing Application Model object implementation based on the IModelXXX interfaces), the new model cache file contains the entire model structure in XAFML format.

    Q: Is this cached file an equivalent of merging of the platform agnostic model and WinForms/ASP.NET models?  Does this include user modifications?
    A: No, this Model.Cache.xafml only contains an unchangeable Application Model layer. Administrative (Model.XAFML) and user-specific (e.g. Model.User.XAFML) model differences are not cached (they are meant to be modified once the app is deployed).

    Q: Is generation of this cache file somehow connected with database schema changes?
    A: No.

    Q: Can this cached file be supplied with the installer?
    A: Absolutely. You can generate this file by running your app without the debugger attached and then copy it into your installation program. This manual process may be unnecessary in many cases because the cache file will still be automatically generated after the released application is executed for the first time.

    Q: What about this feature for ASP.NET?
    A: By default, the EnableModelCache property has no effect on an ASP.NET application since a shared application model is usually generated once for all web clients. If you wish, you can manually activate the creation of this cache file by overriding the GetModelCacheFileLocationPath method of your WebApplication descendant.


    Application Model Database Storage Enhancements

    As you know, XAF apps can store user-defined application customizations (layouts, selected skin, etc.) in an application database with the use of the ModelDifferenceDbStore class introduced several releases ago. In this release, we've enhanced functionality in the following ways:

    • Design-time customizations are now always loaded from the Model.xafml file stored in the file system to simplify debugging.
      In other words, for administrative model differences we have returned to the schema we used prior to introduction of ModelDifferenceDbStore. Only user-specific model differences are loaded from the database by default. When required, you can uncomment the XafApplication.CreateCustomModelDifferenceStore event subscription manually. Note that Model.xafml file content will be loaded to the database once the application starts. Further changes to this file will be ignored if the database record already exists for shared model differences. To reload settings from Model.xafml, enable the administrative UI and use the Import Shared Model Difference Action (or delete the Shared Model Difference record and restart).

    • ModelDifferenceDbStore can now be used when the Security System is disabled.
      Currently, if the Security System is enabled, the SecuritySystem.CurrentUserId value is used as the identifier.  The System.Security.Principal.WindowsIdentity.GetCurrent().Name value is used as a user identifier (passed to the IModelDifference.UserId property) when the Security System is disabled. So, you can enable ModelDifferenceDbStore for WinForms applications with the disabled Security System using the approach described here. However, we do not recommended that you enable ModelDifferenceDbStore for unsecured ASP.NET applications because the UserID will be the same for all users. Shared model differences are supported for both WinForms and ASP.NET when the Security System is disabled. 

    • XML settings are now validated before being persisted.
      This is a small usability improvement to simplify error debugging when using ModelDifferenceDbStore and when the administrative UI for editing model differences is enabled in the application as described here. Application administrators will not be able to save invalid XML, e.g. with unclosed tags.

        


    Non-Persistent Objects Enhancements

    We continue incorporating non-persistent objects support implemented in our most recent releases with the help of the NonPersistentObjectSpace and NonPersistentObjectSpaceProvider classes.

    With this release, you can display persistent objects in a non-persistent object view with much less code. This is possible with the help of the AdditionalObjectSpaces property in the NonPersistentObjectSpace class. It is best to illustrate this improvement with a short code snippet:

    ...
    [DomainComponent, DefaultClassOptions]
    public class NonPersistentObject {
        // ... 
        public string Name { get; set; }
        public Person Owner { get; set; }
    ...
    public class AdditionalPersonObjectSpaceController : WindowController {
        private IObjectSpace additionalObjectSpace;
        protected override void OnActivated() {
            base.OnActivated();
            Application.ObjectSpaceCreated += Application_ObjectSpaceCreated;
            additionalObjectSpace = Application.CreateObjectSpace(typeof(Person));
        }
    private void Application_ObjectSpaceCreated(Object sender, ObjectSpaceCreatedEventArgs e) {
            if (e.ObjectSpace is NonPersistentObjectSpace) {
                ((NonPersistentObjectSpace)e.ObjectSpace).AdditionalObjectSpaces.Add(additionalObjectSpace);//!!!
            }
        }
    ...


    Once XAF v16.1 is released, refer to the "How to: Show Persistent Objects in a Non-Persistent Object's View" article in the online documentation for a full tutorial and additional explanations. Also notice the new ORM-agnostic DevExpress.ExpressApp.Data.Key attribute we introduced to mark unique key properties of an object type.

        

    Another improvement involves showing a non-persistent Detail View: Separately (e.g., from a navigation control or in a popup window) or Embedded (inside a DashboardView item). With XAF v16.1, you can handle the new ObjectByKeyGetting event of the NonPersistentObjectSpace class to provide a non-persistent object instance manually. As an example, consider a scenario when a navigation item pointing to a non-persistent class DetailView was added under the NavigationItems node and its ObjectKey parameter was specified in the Model Editor as shown below:

        

    You can now add the following Controller to handle this scenario:

    ...
    public class NonPersistentObjectsController : WindowController {
        protected override void OnActivated() {
            base.OnActivated();
            Application.ObjectSpaceCreated += Application_ObjectSpaceCreated;
        }
        private void Application_ObjectSpaceCreated(object sender, ObjectSpaceCreatedEventArgs e) {
            NonPersistentObjectSpace nonPersistentObjectSpace = e.ObjectSpace as NonPersistentObjectSpace;
            if(nonPersistentObjectSpace != null) {
                nonPersistentObjectSpace.ObjectByKeyGetting += nonPersistentObjectSpace_ObjectByKeyGetting;
            }
        }
        private void nonPersistentObjectSpace_ObjectByKeyGetting(object sender, ObjectByKeyGettingEventArgs e) {
            if(e.ObjectType.IsAssignableFrom(typeof(NonPersistentObject))) {
                if(((int)e.Key) == 138) {
                    NonPersistentObject obj138 = new NonPersistentObject();
                    obj138.Name = "Sample Object";
                    e.Object = obj138;
                }
            }
        }
    ...


    If you want to create a non-persistent object automatically for each Detail View, you do not need to specify an ObjectKey in the Model Editor. Leave the ObjectKey value empty and create the following View Controller, which will create a non-persistent object

    ...
    public class NonPersistentObjectActivatorController : ViewController<DetailView> {
        protected override void OnActivated() {
            base.OnActivated();
            if(ObjectSpace is NonPersistentObjectSpace) {
                View.CurrentObject = View.ObjectTypeInfo.CreateInstance();
            }
        }
    }
    ...


    On a final note, let me add that custom calculated fields are now supported as well. In other words, you can define custom fields  for non-persistent types in the Model Editor with the Expression attribute like NonPersistentProperty1 + NonPersistentProperty2.


    Several types have changed their host assemblies without changes in namespaces

    This is just a formal notification as this change should not be "breaking" or affect you at all in the majority of cases. Refer to the Several types have been moved to the DevExpress.Persistent.Base and DevExpress.Persistent.BaseImpl assemblies from the Charts, ConditionalAppearance, KPI and StateMachine modules in XAF v16.1 KB Article for more details.

  • XAF Goes Mobile: CTP Version Ships with v15.2.9

    UPDATE:

    Refer to the eXpressApp Framework > Getting Started > XAF Mobile (CTP) Tutorial article to learn more on the new Mobile UI, which is technically is a single-page HTML5/JavaScript application (SPA) based on DevExtreme components that is ready to be compiled by Apache Cordova (PhoneGap) into a native package that can then be submitted to app stores.

    ========================================================

    The eXpressApp Framework (XAF) team has been working hard to add a mobile UI option to your existing or new projects and we are ready for the first public preview. This new feature will let you easily create iOS and Android apps in addition to WinForms and ASP.NET UI options already available to you. The mobile apps will reuse the database, as well as certain aspects of the data model, application logic and UI settings of your existing XAF applications. This will help you avoid all the routine work that would take days or weeks of development efforts if building those mobile apps from scratch.

    XAF Mobile App UI

    We’ve already shown this functionality to a small group of XAF developers at the end of last year and got lots of useful feedback. The team has fixed issues and incorporated a number of improvements and we now feel that the framework is ready to go public. 

    Certain aspects of the new functionality will change and we'd like to think that your feedback will play an important role in that. Please use the resources in this email to evaluate the new features and share your opinion with us.

     

    Review the Demo App

    Start your evaluation by reviewing a sample mobile application hosted on Azure. Either use the browser-based simulator or try it on your smartphone by simply scanning the QR code.

    Run the Demo

     

    Build a Mobile App Yourself

    We encourage you to follow the tutorial below to create a mobile app based on your own XAF solution. The article uses the Project Manager demo as an example, but you can apply the same steps to any XAF project.

    Follow the Tutorial

     

    Review Frequently Asked Questions

    To learn more about the capabilities and limitations of the XAF Mobile UI, review the knowledge base article that answers the most frequently asked questions.

    Read FAQ

     

    Complete the Survey: Help Prioritize Future Development

    Complete the following survey so we can learn more about the types of application you’re looking to build. We know your time is valuable so we’ve limited it to only 5 questions and the entire survey shouldn’t take longer than 10 minutes.

    Complete the Survey

     

    Contact Us via the Support Center

    We are also looking forward to your reports via the Support Center. Please submit separate tickets for each problem or question for better tracking. Thank you for your help!

  • XAF – A Simpler Way to Check Database Compatibility (Coming soon in v15.2)

     

    In earlier versions, to check the compatibility of an application and its database, a ModuleInfo table was created in the database. This table stores information on the module versions used in an application. When checking the compatibility of the database and the application, the versions stored in the ModuleInfo table are compared with actual module versions. A DatabaseVersionMismatch event occurs when there's a mismatch. By default, each module's version is set to "1.0.*" using the AssemblyVersion Attribute in the Properties\AssemblyInfo.cs file. The asterisk sign in the version indicates that the build and revision numbers in the version are autoincremented, and so version value is updated with each new build. As a result, WinForms and ASP.NET module versions may not be synced if you build WinForms and ASP.NET applications separately (e.g, when creating a ClickOnce installation or deploying to IIS).

      
    With v15.2, we've introduced a new application and database compatibility check mode; one that utilizes native XPO methodologies. In this mode, the following checks are performed:

    1. The database exists.

    2. All required tables exist.

    3. All required columns exist.

     

    The DatabaseVersionMismatch event occurs if any of these checks fails.


    The new XafApplication.CheckCompatibilityType property specifies which mode to use. The CheckCompatibilityType.ModuleInfo value indicates that the old mode that relies on the ModuleInfo table is used. This mode is still used by default for applications created with earlier versions of XAF. In applications created with the Solution Wizard in version v15.2, the XafApplication.CheckCompatibilityType value is CheckCompatibilityType.DatabaseSchema, which corresponds to the new mode detailed above. This property value can be changed in the Application Designer:


    Untitled (1)

     

    Note that the use of ModuleInfo is more complicated, but it ensures business logic compatibility in addition to data model compatibility. The new DatabaseSchema mode relies on the database schema only.

    A CheckCompatibilityType property has also been added to the IObjectSpaceProvider interface, allowing you to specify the mode individually for each Object Space Provider (when you use multiple databases). By default, it is set to null and the XafApplication.CheckCompatibilityType value is actually used. Another useful change with this interface is the new  IObjectSpaceProvider.SchemaUpdateMode property. You can now use it to specify handle compatibility checking for the database associated with the current Object Space Provider. The following values are available:

    • DatabaseAndSchema - Missing database is autocreated. The database schema is updated when the compatibility check fails.

    • None - Database compatibility issues are ignored.

    =======================================

    That's my  last post prior to launch and hopefully you've liked what we've done with XAF. As always, we want to hear your thoughts. Please tell us what you think of XAF v15.2.

  • XAF - Enhancements to Core and other modules (Coming soon in v15.2)

    Over the last few days, I've described some of the new features we've introduced into the eXpressApp Framework v15.2. In this post, I'll describe enhancements we've made to XAF's core and other modules.
    Reset View Settings
    The Reset View Settings Action re-opens the current View and resets all user customizations made to the View's model. This Action is disabled (grayed out) if there are unsaved changes.



    Detail Form Layout Customization in Code

    With this release, you can customize the Detail View's default layout in your Data Model code using the DetailViewLayout attribute. Please refer to the following example code/screenshot below:

    public class Contact {
        [Browsable(false)]
        public int ID { get; private set; }
        [DetailViewLayoutAttribute(LayoutColumnPosition.Left)]
        public string FirstName { get; set; }
        [DetailViewLayoutAttribute(LayoutColumnPosition.Right)]
        public string LastName { get; set; }
        [DetailViewLayoutAttribute("FullName", 0)]
        public string FullName {
            get { return FirstName + " " + LastName; }
        }
        [DetailViewLayoutAttribute(LayoutColumnPosition.Left)]
        public string Email { get; set; }
        [DetailViewLayoutAttribute(LayoutColumnPosition.Right)]
        public virtual Contact Manager { get; set; }
        [DetailViewLayoutAttribute(LayoutColumnPosition.Left)]
        public DateTime? Birthday { get; set; }
        [FieldSize(FieldSizeAttribute.Unlimited)]
        [DetailViewLayoutAttribute("NotesAndRemarks", LayoutGroupType.TabbedGroup, 100)]
        public string Notes { get; set; }
        [FieldSize(FieldSizeAttribute.Unlimited)]
        [DetailViewLayoutAttribute("NotesAndRemarks", LayoutGroupType.TabbedGroup, 100)]
        public string Remarks { get; set; }
    }



    Non-Persistent Objects Enhancements

    In this release we have extended support for usage scenarios when using non-persistent objects first introduced in v15.1:

    • The New, Delete and Save Actions are available for non-persistent objects. Modified objects are accessible using the NonPersistentObjectSpace.ModifiedObjects property.
    • The INotifyPropertyChanged.PropertyChanged event is now triggered for non-persistent objects.
    • The non-persistent Object Space is now accessible for objects that support IObjectSpaceLink.

    Security System Enhancements

    We continue making the new security system more capable with the following updates:

    • Security permissions are immediately refreshed once the administrator applies changes. You are no longer required to log off all affected users to refresh permissions (learn more...).
    • If the administrator grants certain permissions to a reference or collection property that participates in an association (one-to-many or many-to-many), the same permissions are automatically granted for a property at the other end of this association (learn more...).
    • The Data View mode in now supported.
    • Upcasting is now supported in List View columns.
    You should expect more news in this regard after the official release.



    General usability and API improvements:

    The following is a list of minor features that should make using XAF a little easier. While you can see the full list of these smaller enhancements in our What's New docs, I would like to highlight the following items:

    • S38140 - Core - Introduce IObjectSpace.Evaluate method that will evaluate a criteria expression against both EF and XPO objects (including Domain Components)
    • Q483608 - Core - Make it easier to obtain IQueryable<T> collection through IObjectSpace for LINQ
    • S171061 - Core - Provide an option to avoid saving a master record immediately when a new non-aggregated child object is created in a nested List View
    • S170756 - Core - Provide Refresh method overloads allowing the refresh of the underlying data source
    • T204296 - EF.Usability - Support complex types that are not registered in DbContext and have no key property
    • T177760 - EFDataView - Support common criteria function operators
    • S172038 - Core - Provide a simplified database compatibility check mode; one that relies on the database schema and ignores module assembly versions
    • T312781 - ImagePropertyEditor - Support images declared as reference properties instead of byte array
    • T303205 - Workflow - Add an option to repeat the workflow multiple times while the target object fits criteria

    =====================================

    I will post additional content on some of these items (like S172038) separatly, once we release v15.2. Please stay tuned and let us know what you think of these new features.

1
2 3 4 5 6 7 8 9 10
LIVE CHAT

Chat is one of the many ways you can contact members of the DevExpress Team.
We are available Monday-Friday between 7:30am and 4:30pm Pacific Time.

If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

FOLLOW US

DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

Copyright © 1998-2017 Developer Express Inc.
All trademarks or registered trademarks are property of their respective owners