This page shows the source for this entry, with WebCore formatting language tags and attributes highlighted.

Title

Quino v1.13.0: Schema migration, remoting, services and web apps

Description

The summary below describes major new features, items of note and breaking changes in <a href="http://encodo.com/en/quino.php">Quino</a>. The <a href="https://secure.encodo.ch/jira/secure/ReleaseNote.jspa?projectId=10006&version=17404">full list of issues</a> is also available for those with access to the Encodo issue tracker. <h>Highlights</h> <h level="3">Data & Schema</h> <ul> Applications can now choose a <b>base class</b> for <b>generated ORM objects</b>. (<a href="https://secure.encodo.ch/jira/browse/QNO-3107">QNO-3107</a>) <b>Data driver</b>: made various bug fixes and improvements. (<a href="https://secure.encodo.ch/jira/browse/QNO-4538">QNO-4538</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4554">QNO-4554</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4551">QNO-4551</a>) Improved schema migration for fields and constraint-violation messages under <b>SQL Server</b>. (<a href="https://secure.encodo.ch/jira/browse/QNO-4490">QNO-4490</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4111">QNO-4111</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4582">QNO-4582</a>) Improved the <b>console migrator</b> and APIs, input queries and exit-code handling for console applications in general. Also changed the default command from [R]efresh to [S]how differences. (<a href="https://secure.encodo.ch/jira/browse/QNO-4649">QNO-4649</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4646">QNO-4646</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4648">QNO-4648</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4650">QNO-4650</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4651">QNO-4651</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4615">QNO-4615</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4645">QNO-4645</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4616">QNO-4616</a>) </ul> <h level="3">Remoting & services</h> <ul> Fixed several issues in the <b>remoting</b> driver (client and server parts). (<a href="https://secure.encodo.ch/jira/browse/QNO-4626">QNO-4626</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4630">QNO-4630</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4631">QNO-4631</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4388">QNO-4388</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4575">QNO-4575</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4629">QNO-4629</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4573">QNO-4573</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4625">QNO-4625</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4633">QNO-4633</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4575">QNO-4575</a>) Added a runner for <b>Windows services</b> that allows debugging and shows logging output for applications that use the <c>CoreServiceBase</c>, which extends the standard .NET <c>ServiceBase</c>. The runner is available in the <c>Encodo.Service</c> assembly. </ul> <h level="3">Web</h> <ul> Improved default and custom <b>authentication</b> in web applications and the remoting server. Also improved support for authorization for remote-method routes as well as MVC controllers. Improved configuration, error-handling and stability of the <b><c>HttpApplicationBase</c></b>, especially in situations where the application fails to start. Error-page handling was also improved, including handling for <c>Windows Event Log</c> errors. Improved appearance of the <b>web-based schema migrator</b>. (<a href="https://secure.encodo.ch/jira/browse/QNO-4559">QNO-4559</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4561">QNO-4561</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4563">QNO-4563</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4548">QNO-4548</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4487">QNO-4487</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4486">QNO-4486</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4488">QNO-4488</a>) </ul> <h level="3">Winform</h> <ul> <b>Data-provider statistics</b>: improved the WinForm-based statistics form. (<a href="https://secure.encodo.ch/jira/browse/QNO-4231">QNO-4231</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4545">QNO-4545</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4546">QNO-4546</a>) <b>Standard forms</b>: updated the standard WinForm about window and splash screen to use Encodo web-site CI. (<a href="https://secure.encodo.ch/jira/browse/QNO-4529">QNO-4529</a>) </ul> <h level="3">System & Tools</h> <ul> Removed the <b>dependency</b> on the <i>SmartWeakEvents</i> library from Quino. (<a href="https://secure.encodo.ch/jira/browse/QNO-4645">QNO-4645</a>); the Quino and Encodo assemblies now no longer have any external dependencies. <b>Image handling</b>: the Encodo and Quino libraries now use the Windows Imaging Components instead of System.Drawing. (<a href="https://secure.encodo.ch/jira/browse/QNO-4536">QNO-4536</a>) <b>Window 8.1</b>: fixed culture-handling for en-US and de-CH that is broken in Windows 8.1. (<a href="https://secure.encodo.ch/jira/browse/QNO-4534">QNO-4534</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4553">QNO-4553</a>) <b>R# annotations</b> have been added to the Encodo assembly. Tell R# to look in the <c>Encodo.Core</c> namespace to use annotations like <c>NotNull</c> and <c>CanBeNull</c> with parameters and results. (<a href="https://secure.encodo.ch/jira/browse/QNO-4508">QNO-4508</a>) <div><b>Generated code</b> now includes a property that returns a <c>ValueListObject</c> for each <c>enum</c> property in the metadata. For example, for a property named <c>State</c> of type <c>CoreState</c>, the generated code includes the former properties for the <c>enum</c> and the foreign key backing it, but now also includes the <c>ValueListObject</c> property. This new property provides easy access to the captions. <code>public CoreState State { ... } <hl>public ValueListObject StateObject { ... }</hl> public int? CoreStateIdId { ... }</code></div> <div>Improved the <b>nant fix</b> command in the default build tools to fix the assembly name as well. The build tools are available in bin/tools/build. See the <c>src/demo/Demo.build</c> file for an example on how to use the Nant build scripts for your own solutions. To change the company name used by the "fix" command, for example, add the following task override: <code><target name="fix.before"> <call target="fix.before.base"> <property name="InfoCompanyName" value="Foobar Corporation"> </target> </code></div> Fixed the implementation of <c>IntegrateRemotableMethods</c> to avoid a race condition with <b>remote methods</b>. Also improved the stability of the <c>DataProvider</c> statistics. (<a href="https://secure.encodo.ch/jira/browse/QNO-4599">QNO-4599</a>) </ul> <clear><h>Breaking changes</h> <ul> The generic argument <c>TRight</c> has been removed from all classes and interfaces in the <c>Encodo.Security.*</c> namespace. In order to fix this code, just remove the <c>int</c> generic parameter wherever it was used. For example, where before you used the interface <c>IUser<int></c>, you should now use <c>IUser</c> (<a href="https://secure.encodo.ch/jira/browse/QNO-4576">QNO-4576</a>). The overridable method <c>MetaAccessControl.DoGetAccessChecker()</c> has been renamed to <c>MetaAccessControl.GetAccessChecker()</c>. Renamed the <c>Encodo.ServiceLocator.SimpleInjector.dll</c> to <c>Encodo.Services.SimpleInjector.dll</c> and <c>Quino.ServiceLocator.SimpleInjector.dll</c> to <c>Quino.Services.SimpleInjector.dll</c> Also changed the namespace <c>Quino.ServiceLocator</c> to <c>Encodo.Quino.Services</c>. Renamed <c>HttpApplicationBase.StartMetaApplication()</c> to <c>CreateAndStartUpApplication()</c>. Classes may no longer contain properties with names that conflict with properties of <c>IMetaReadable</c> (e.g. <c>Deleted</c>, <c>Persisted</c>). The model will no longer validate until the properties have been renamed and the code regenerated. (<a href="https://secure.encodo.ch/jira/browse/QNO-4185">QNO-4185</a>) Removed <c>StandardIntRights</c> with integer constants and replaced it with <c>StandardRights</c> with string constants. The <c>IAccessControl.Check()</c> and other related methods now accept a sequence of string rights rather than integers. <div><c>IMetaConfiguration.ConfigureSession()</c> has been deprecated. The method will still be called but may have undesired side-effects, depending on why it was overridden. The common use was to initialize a custom <c>AccessControl</c> for the session. Continuing to do so may overwrite the current user set by the default Winform startup. Instead, applications should use the <c>IDataSessionAccessControlFactory</c> and <c>IDataSessionFactory</c> to customize the data sessions and access controls returned for an application. In order to attach an access control, take care to only set your custom access control for sessions that correspond to your application model.<fn> <code>internal class JobVortexDataSessionAccessControlFactory : DataSessionAccessControlFactory { public override IAccessControl CreateAccessControl(IDataSession session) { if (session.Application.Model.MetaId == JobVortexModelGenerator.ModelGuid) { return new JobVortexAccessControl(session); } return base.CreateAccessControl(session); } }</code> </div> <div>The default length of the <c>UserModule.User.PasswordHash</c> property has been increased from 100 characters to 1000. This default is more sensible for implementations that use much longer validations tokens instead of passwords. To avoid the schema migration, revert the change by setting the property default length back to 0 in your application model, after importing the security module, as shown below. <code>var securityModule = Builder.Include<securitymodulegenerator>(); securityModule.Elements.Classes.User.Properties[ Encodo.Quino.Models.Security.Classes.SecurityUser.Fields.PasswordHash ].MaximumSize = 100; </code></div> <div><c>Application.Credentials</c> has been removed. To fix references, retrieve the <c>IUserCredentialsManager</c> from the service locator. For example, the following code returns the current user: <code>Session.Application.Configuration.ServiceLocator.GetInstance<iusercredentialsmanager>().Current</code> If your application uses the <c>WinformMetaConfigurationTools.IntegrateWinformPackages()</c> or <c>WinformDxMetaConfigurationTools.IntegrateWinformDxPackages()</c>, then the <c>IDataSession.AccessControl.CurrentUser</c> will continue to be set correctly. If not, add the <c>SingleUserApplicationConfigurationPackage</c> to your application's configuration. The user in the remoting server will be set up correctly. Add the <c>WebApplicationConfigurationPackage</c> to web applications in order to ensure that the current user is set up correctly for each request. (<a href="https://secure.encodo.ch/jira/browse/QNO-4596">QNO-4596</a>)</div> <c>IDataSession.SyncRoot</c> has been removed as it was no longer needed or used in Quino itself. Sessions should <i>not</i> be used in multiple threads, so there is no need for a <c>SyncRoot</c>. Code that uses it should be reworked to use a separate session for each thread. Moved <c>IMetaApplication.CreateSession()</c> to an extension method. Add <c>Encodo.Quino.App</c> to the using clauses to fix any compile errors. Removed <c>IMetaApplication.DataProvider</c>; use <c>IMetaApplication.Configuration.DataProvider</c> instead. (<a href="https://secure.encodo.ch/jira/browse/QNO-4604">QNO-4604</a>) The schema migration API has been completely overhauled. <c>ISchemaChange</c> and descendents has been completely removed. <c>ISchemaAction</c> is no longer part of the external API, although it is still used internally. The <c>ISchemaChangeFactory</c> has been renamed to <c>ISchemaCommandFactory</c> and, instead of creating change objects, which are then applied directly, returns <c>ISchemaCommand</c> objects, which can be either executed or transformed in some other way. <c>IMigrateToolkit.GetActionFor()</c> has also been replace with <c>CreateCommands()</c>, which mirrors the rest of the API by returning a sequence of commands to address a given <c>ISchemaDifference</c>. This release still has some commands that cannot be transformed to pure SQL, but the goal is to be able to generate pure SQL for a schema migration. (<a href="https://secure.encodo.ch/jira/browse/QNO-993">QNO-993</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4579">QNO-4579</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4581">QNO-4581</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4588">4588</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4591">4591</a>, <a href="https://secure.encodo.ch/jira/browse/QNO-4594">QNO-4594</a>) <div><c>IMigrateSchemaAspect.Apply()</c> has been removed. All aspects will have to be updated to implement <c>GetCommands()</c> instead, or to use one of the available base classes, like <c>UpdateDataAspectBase</c> or <c>ConvertPropertyTypeSchemaAspect</c>. The following example shows how to use the <c>UpdateDataAspectBase</c> to customize migration for a renamed property. <code> internal class ArchivedMigrationAspect : UpdateDataAspectBase { public ArchivedMigrationAspect() : base("ArchivedMigrationAspect", DifferenceType.RenamedProperty, ChangePhase.Instead) { } protected override void UpdateData(IMigrateContext context, ISchemaDifference difference) { using (var session = context.CreateSession(difference)) { session.ChangeAndSaveAll<project>(UpdateArchivedFlag); } } private void UpdateArchivedFlag(Project obj) { obj.Archived = !obj.Archived; } } </code> The base aspects should cover most needs; if your functionality is completely customized, you can easily pass your previous implementation of <c>Apply()</c> to a <c>DelegateSchemaCommand</c> and return that from your implementation of <c>GetCommands()</c>. See the implementation of <c>UpdateDataAspectBase</c> for more examples. (<a href="https://secure.encodo.ch/jira/browse/QNO-4580">QNO-4580</a>)</div> <c>MetaObjectIdEqualityComparer<t></c> can no longer be constructed directly. Instead, use <c>MetaObjectIdEqualityComparer<project>.Default</c>. Renamed <c>MetaClipboardControlDx.UpdateColorSkinaware()</c> to <c>MetaClipboardControlDx.UpdateSkinAwareColors()</c>. <c>IMetaUnique.LogicalParent</c> has been moved to <c>IMetaBase</c>. Since <c>IMetaUnique</c> inherits from <c>IMetaBase</c>, it is unlikely that code is affected (unless reflection or some other direct means was used to reference the property). (<a href="https://secure.encodo.ch/jira/browse/QNO-4586">QNO-4586</a>) <c>IUntypedMessage</c> has been removed; the <c>AssociatedObject</c> formerly found there has been moved to <c>IMessage</c>. <c>ITypedMessage.AssociatedObject</c> has been renamed to <c>ITypedMessage.TypedAssociatedObject</c>. (<a href="https://secure.encodo.ch/jira/browse/QNO-4647">QNO-4647</a>) Renamed <c>MetaObjectTools</c> to <c>MetaReadableTools</c>. Redefined the protected methods <c>GenericObject.GetAsGuid()</c> and <c>GenericObject.GetAsGuidDefault</c> as extension methods in <c>MetaWritableTools</c>. <c>IMetaFeedback.CreateGlobalContext()</c> has been removed. Instead the <c>IGlobalContext</c> is created using the service locator. </ul> <hr> <ft>The schema migration creates a metadata model for your model---meta-metadata---and uses the Quino ORM to load data when importing a model from a database. If you aren't careful, as shown in the code example, then you'll attach your custom access control to the sessions created for the schema migration's data-access, which will more than likely fail when it tries to load user data from a table that does not exist in that model.</ft>