mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-19 01:57:55 +08:00
Adding data versioning capabilities which content parts may opt-into. Still needs query support though.
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4044752
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -3488,6 +3488,9 @@
|
||||
<member name="F:NHibernate.Cfg.MappingSchema.HbmKeyManyToOne.lazySpecified">
|
||||
<remarks/>
|
||||
</member>
|
||||
<member name="F:NHibernate.Cfg.MappingSchema.HbmKeyManyToOne.notfound">
|
||||
<remarks/>
|
||||
</member>
|
||||
<member name="T:NHibernate.Cfg.MappingSchema.HbmKeyProperty">
|
||||
<remarks/>
|
||||
</member>
|
||||
@@ -5234,6 +5237,9 @@
|
||||
<member name="T:NHibernate.Cfg.MappingSchema.HbmDefinition">
|
||||
<remarks/>
|
||||
</member>
|
||||
<member name="F:NHibernate.Cfg.MappingSchema.HbmDefinition.param">
|
||||
<remarks/>
|
||||
</member>
|
||||
<member name="F:NHibernate.Cfg.MappingSchema.HbmDefinition.class">
|
||||
<remarks/>
|
||||
</member>
|
||||
@@ -5267,6 +5273,9 @@
|
||||
<member name="F:NHibernate.Cfg.MappingSchema.HbmFilterDef.condition">
|
||||
<remarks/>
|
||||
</member>
|
||||
<member name="F:NHibernate.Cfg.MappingSchema.HbmFilterDef.usemanytoone">
|
||||
<remarks/>
|
||||
</member>
|
||||
<member name="T:NHibernate.Cfg.MappingSchema.HbmFilterParam">
|
||||
<remarks/>
|
||||
</member>
|
||||
@@ -8246,6 +8255,11 @@
|
||||
Get an executable instance of <c>Criteria</c>,
|
||||
to actually run the query.</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Criterion.DetachedCriteria.GetExecutableCriteria(NHibernate.IStatelessSession)">
|
||||
<summary>
|
||||
Get an executable instance of <c>Criteria</c>,
|
||||
to actually run the query.</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Criterion.DetachedCriteria.GetRootEntityTypeIfAvailable">
|
||||
<summary>
|
||||
Gets the root entity type if available, throws otherwise
|
||||
@@ -13175,6 +13189,13 @@
|
||||
<param name="sqlType">The SqlType to set for IDbDataParameter.</param>
|
||||
<returns>An IDbDataParameter ready to be added to an IDbCommand.</returns>
|
||||
</member>
|
||||
<member name="M:NHibernate.Driver.DriverBase.OnBeforePrepare(System.Data.IDbCommand)">
|
||||
<summary>
|
||||
Override to make any adjustments to the IDbCommand object. (e.g., Oracle custom OUT parameter)
|
||||
Parameters have been bound by this point, so their order can be adjusted too.
|
||||
This is analagous to the RegisterResultSetOutParameter() function in Hibernate.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:NHibernate.Driver.DriverBase.UseNamedPrefixInSql">
|
||||
<summary>
|
||||
Does this Driver require the use of a Named Prefix in the SQL statement.
|
||||
@@ -15455,7 +15476,7 @@
|
||||
information includes its name as well as its defined parameters (name and type).
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Engine.FilterDefinition.#ctor(System.String,System.String,System.Collections.Generic.IDictionary{System.String,NHibernate.Type.IType})">
|
||||
<member name="M:NHibernate.Engine.FilterDefinition.#ctor(System.String,System.String,System.Collections.Generic.IDictionary{System.String,NHibernate.Type.IType},System.Boolean)">
|
||||
<summary>
|
||||
Set the named parameter's value list for this filter.
|
||||
</summary>
|
||||
@@ -15463,6 +15484,7 @@
|
||||
<param name="defaultCondition">The default filter condition.</param>
|
||||
<param name="parameterTypes">A dictionary storing the NHibernate <see cref="T:NHibernate.Type.IType"/> type
|
||||
of each parameter under its name.</param>
|
||||
<param name="useManyToOne">if set to <c>true</c> used in many to one rel</param>
|
||||
</member>
|
||||
<member name="M:NHibernate.Engine.FilterDefinition.GetParameterType(System.String)">
|
||||
<summary>
|
||||
@@ -15471,6 +15493,12 @@
|
||||
<param name="parameterName">The name of the filter parameter for which to return the type.</param>
|
||||
<returns>The type of the named parameter.</returns>
|
||||
</member>
|
||||
<member name="P:NHibernate.Engine.FilterDefinition.UseInManyToOne">
|
||||
<summary>
|
||||
Gets a value indicating whether to use this filter-def in manytoone refs.
|
||||
</summary>
|
||||
<value><c>true</c> if [use in many to one]; otherwise, <c>false</c>.</value>
|
||||
</member>
|
||||
<member name="P:NHibernate.Engine.FilterDefinition.FilterName">
|
||||
<summary>
|
||||
Get the name of the filter this configuration defines.
|
||||
@@ -16481,36 +16509,24 @@
|
||||
<member name="P:NHibernate.Engine.ISessionImplementor.EntityMode">
|
||||
<summary> Retrieve the entity mode in effect for this session. </summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Engine.JoinHelper.GetAliasedLHSColumnNames(NHibernate.Type.IAssociationType,System.String,System.Int32,NHibernate.Persister.Entity.IOuterJoinLoadable,NHibernate.Engine.IMapping)">
|
||||
<summary>
|
||||
Get the aliased columns of the owning entity which are to
|
||||
be used in the join
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Engine.JoinHelper.GetLHSColumnNames(NHibernate.Type.IAssociationType,System.Int32,NHibernate.Persister.Entity.IOuterJoinLoadable,NHibernate.Engine.IMapping)">
|
||||
<summary>
|
||||
Get the columns of the owning entity which are to
|
||||
be used in the join
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Engine.JoinHelper.GetAliasedLHSColumnNames(NHibernate.Type.IAssociationType,System.String,System.Int32,System.Int32,NHibernate.Persister.Entity.IOuterJoinLoadable,NHibernate.Engine.IMapping)">
|
||||
<summary>
|
||||
Get the aliased columns of the owning entity which are to
|
||||
be used in the join
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Engine.JoinHelper.GetLHSColumnNames(NHibernate.Type.IAssociationType,System.Int32,System.Int32,NHibernate.Persister.Entity.IOuterJoinLoadable,NHibernate.Engine.IMapping)">
|
||||
<summary>
|
||||
Get the columns of the owning entity which are to
|
||||
be used in the join
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Engine.JoinHelper.GetRHSColumnNames(NHibernate.Type.IAssociationType,NHibernate.Engine.ISessionFactoryImplementor)">
|
||||
<summary>
|
||||
Get the columns of the associated table which are to
|
||||
be used in the join
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Engine.ILhsAssociationTypeSqlInfo.GetAliasedColumnNames(NHibernate.Type.IAssociationType,System.Int32)">
|
||||
<summary>
|
||||
Get the aliased columns of the owning entity which are to
|
||||
be used in the join
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Engine.ILhsAssociationTypeSqlInfo.GetColumnNames(NHibernate.Type.IAssociationType,System.Int32)">
|
||||
<summary>
|
||||
Get the columns of the owning entity which are to
|
||||
be used in the join
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:NHibernate.Engine.Nullability">
|
||||
<summary>
|
||||
Implements the algorithm for validating property values
|
||||
@@ -18038,6 +18054,12 @@
|
||||
Defines a base class for Session generated events.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:NHibernate.Event.IDatabaseEventArgs.Session">
|
||||
<summary>
|
||||
Returns the session event source for this event.
|
||||
This is the underlying session from which this event was generated.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Event.AbstractEvent.#ctor(NHibernate.Event.IEventSource)">
|
||||
<summary>
|
||||
Constructs an event from the given event session.
|
||||
@@ -18083,11 +18105,61 @@
|
||||
collection and does not include the entity's ID)
|
||||
</value>
|
||||
</member>
|
||||
<member name="T:NHibernate.Event.AbstractPostDatabaseOperationEvent">
|
||||
<summary>
|
||||
Represents an operation we performed against the database.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:NHibernate.Event.IPostDatabaseOperationEventArgs">
|
||||
<summary>
|
||||
Represents an operation we performed against the database.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:NHibernate.Event.IPostDatabaseOperationEventArgs.Entity">
|
||||
<summary> The entity involved in the database operation. </summary>
|
||||
</member>
|
||||
<member name="P:NHibernate.Event.IPostDatabaseOperationEventArgs.Id">
|
||||
<summary> The id to be used in the database operation. </summary>
|
||||
</member>
|
||||
<member name="P:NHibernate.Event.IPostDatabaseOperationEventArgs.Persister">
|
||||
<summary>
|
||||
The persister for the <see cref="P:NHibernate.Event.IPostDatabaseOperationEventArgs.Entity"/>.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Event.AbstractPostDatabaseOperationEvent.#ctor(NHibernate.Event.IEventSource,System.Object,System.Object,NHibernate.Persister.Entity.IEntityPersister)">
|
||||
<summary> Constructs an event containing the pertinent information. </summary>
|
||||
<param name="source">The session from which the event originated. </param>
|
||||
<param name="entity">The entity to be invloved in the database operation. </param>
|
||||
<param name="id">The entity id to be invloved in the database operation. </param>
|
||||
<param name="persister">The entity's persister. </param>
|
||||
</member>
|
||||
<member name="P:NHibernate.Event.AbstractPostDatabaseOperationEvent.Entity">
|
||||
<summary> The entity involved in the database operation. </summary>
|
||||
</member>
|
||||
<member name="P:NHibernate.Event.AbstractPostDatabaseOperationEvent.Id">
|
||||
<summary> The id to be used in the database operation. </summary>
|
||||
</member>
|
||||
<member name="P:NHibernate.Event.AbstractPostDatabaseOperationEvent.Persister">
|
||||
<summary>
|
||||
The persister for the <see cref="P:NHibernate.Event.AbstractPostDatabaseOperationEvent.Entity"/>.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:NHibernate.Event.AbstractPreDatabaseOperationEvent">
|
||||
<summary>
|
||||
Represents an operation we are about to perform against the database.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:NHibernate.Event.IPreDatabaseOperationEventArgs.Entity">
|
||||
<summary> The entity involved in the database operation. </summary>
|
||||
</member>
|
||||
<member name="P:NHibernate.Event.IPreDatabaseOperationEventArgs.Id">
|
||||
<summary> The id to be used in the database operation. </summary>
|
||||
</member>
|
||||
<member name="P:NHibernate.Event.IPreDatabaseOperationEventArgs.Persister">
|
||||
<summary>
|
||||
The persister for the <see cref="P:NHibernate.Event.IPreDatabaseOperationEventArgs.Entity"/>.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Event.AbstractPreDatabaseOperationEvent.#ctor(NHibernate.Event.IEventSource,System.Object,System.Object,NHibernate.Persister.Entity.IEntityPersister)">
|
||||
<summary> Constructs an event containing the pertinent information. </summary>
|
||||
<param name="source">The session from which the event originated. </param>
|
||||
@@ -21967,6 +22039,35 @@
|
||||
Wraps SessionFactoryImpl, adding more lookup behaviors and encapsulating some of the error handling.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Hql.Util.SessionFactoryHelper.GetCollectionPersister(System.String)">
|
||||
<summary>
|
||||
Locate the collection persister by the collection role.
|
||||
</summary>
|
||||
<param name="role">The collection role name.</param>
|
||||
<returns>The defined CollectionPersister for this collection role, or null.</returns>
|
||||
</member>
|
||||
<member name="M:NHibernate.Hql.Util.SessionFactoryHelper.RequireClassPersister(System.String)">
|
||||
<summary>
|
||||
Locate the persister by class or entity name, requiring that such a persister
|
||||
exists
|
||||
</summary>
|
||||
<param name="name">The class or entity name</param>
|
||||
<returns>The defined persister for this entity</returns>
|
||||
</member>
|
||||
<member name="M:NHibernate.Hql.Util.SessionFactoryHelper.FindEntityPersisterByName(System.String)">
|
||||
<summary>
|
||||
Locate the persister by class or entity name.
|
||||
</summary>
|
||||
<param name="name">The class or entity name</param>
|
||||
<returns>The defined persister for this entity, or null if none found.</returns>
|
||||
</member>
|
||||
<member name="M:NHibernate.Hql.Util.SessionFactoryHelper.GetCollectionPropertyMapping(System.String)">
|
||||
<summary>
|
||||
Retreive a PropertyMapping describing the given collection role.
|
||||
</summary>
|
||||
<param name="role">The collection role for whcih to retrieve the property mapping.</param>
|
||||
<returns>The property mapping.</returns>
|
||||
</member>
|
||||
<member name="T:NHibernate.Hql.NameGenerator">
|
||||
<summary>
|
||||
Provides utility methods for generating HQL / SQL names.
|
||||
@@ -24655,6 +24756,13 @@
|
||||
</summary>
|
||||
<returns>The clone of the root criteria.</returns>
|
||||
</member>
|
||||
<member name="P:NHibernate.Impl.CurrentSessionIdLoggingContext.SessionId">
|
||||
<summary>
|
||||
Error handling in this case will only kick in if we cannot set values on the TLS
|
||||
this is usally the case if we are called from the finalizer, since this is something
|
||||
that we do only for logging, we ignore the error.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:NHibernate.Impl.DbCommandSet`2">
|
||||
<summary>
|
||||
Expose the batch functionality in ADO.Net 2.0
|
||||
@@ -25628,9 +25736,6 @@
|
||||
you are serializing in the same AppDomain then there will be no problem because the uid will
|
||||
be in this object.
|
||||
</para>
|
||||
<para>
|
||||
TODO: verify that the AppDomain statements are correct.
|
||||
</para>
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="M:NHibernate.Impl.SessionFactoryObjectFactory.#cctor">
|
||||
@@ -25669,9 +25774,11 @@
|
||||
</member>
|
||||
<member name="P:NHibernate.Impl.SessionIdLoggingContext.SessionId">
|
||||
<summary>
|
||||
Error handling in this case will only kick in if we cannot set values on the TLS
|
||||
this is usally the case if we are called from the finalizer, since this is something
|
||||
that we do only for logging, we ignore the error.
|
||||
We always set the result to use a thread static variable, on the face of it,
|
||||
it looks like it is not a valid choice, since ASP.Net and WCF may decide to switch
|
||||
threads on us. But, since SessionIdLoggingContext is only used inside NH calls, and since
|
||||
NH calls are never async, this isn't an issue for us.
|
||||
In addition to that, attempting to match to the current context has proven to be performance hit.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:NHibernate.Impl.SessionImpl">
|
||||
@@ -26477,7 +26584,7 @@
|
||||
by outerjoin
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Loader.JoinWalker.WalkComponentTree(NHibernate.Type.IAbstractComponentType,System.Int32,System.Int32,NHibernate.Persister.Entity.IOuterJoinLoadable,System.String,System.String,System.Int32)">
|
||||
<member name="M:NHibernate.Loader.JoinWalker.WalkComponentTree(NHibernate.Type.IAbstractComponentType,System.Int32,System.String,System.String,System.Int32,NHibernate.Engine.ILhsAssociationTypeSqlInfo)">
|
||||
<summary>
|
||||
For a component, add to a list of associations to be fetched by outerjoin
|
||||
</summary>
|
||||
@@ -30779,6 +30886,11 @@
|
||||
Get the table name for the given property path
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Persister.Entity.IOuterJoinLoadable.ToIdentifierColumns(System.String)">
|
||||
<summary>
|
||||
Return the alised identifier column names
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:NHibernate.Persister.Entity.IQueryable">
|
||||
<summary>
|
||||
Extends the generic <c>ILoadable</c> contract to add operations required by HQL
|
||||
@@ -37929,6 +38041,13 @@
|
||||
<member name="T:NHibernate.Util.FilterHelper">
|
||||
<summary></summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Util.FilterHelper.GetEnabledForManyToOne(System.Collections.Generic.IDictionary{System.String,NHibernate.IFilter})">
|
||||
<summary>
|
||||
Get only filters enabled for many-to-one association.
|
||||
</summary>
|
||||
<param name="enabledFilters">All enabled filters</param>
|
||||
<returns>A new <see cref="T:System.Collections.Generic.IDictionary`2"/> for filters enabled for many to one.</returns>
|
||||
</member>
|
||||
<member name="T:NHibernate.Util.IdentityMap">
|
||||
<summary>
|
||||
An <see cref="T:System.Collections.IDictionary"/> where keys are compared by object identity, rather than <c>equals</c>.
|
||||
|
@@ -80,6 +80,14 @@
|
||||
<param name="columnName">The column name in the database to use for this key, or null to use the property name</param>
|
||||
<returns>The composite identity part fluent interface</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Mapping.CompositeIdentityPart`1.KeyProperty(System.Linq.Expressions.Expression{System.Func{`0,System.Object}},System.Action{FluentNHibernate.Mapping.KeyPropertyPart})">
|
||||
<summary>
|
||||
Defines a property to be used as a key for this composite-id with an explicit column name.
|
||||
</summary>
|
||||
<param name="expression">A member access lambda expression for the property</param>
|
||||
<param name="keyPropertyAction">Additional settings for the key property</param>
|
||||
<returns>The composite identity part fluent interface</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Mapping.CompositeIdentityPart`1.KeyReference(System.Linq.Expressions.Expression{System.Func{`0,System.Object}})">
|
||||
<summary>
|
||||
Defines a reference to be used as a many-to-one key for this composite-id with an explicit column name.
|
||||
@@ -95,6 +103,15 @@
|
||||
<param name="columnName">The column name in the database to use for this key, or null to use the property name</param>
|
||||
<returns>The composite identity part fluent interface</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Mapping.CompositeIdentityPart`1.KeyReference(System.Linq.Expressions.Expression{System.Func{`0,System.Object}},System.String,System.Action{FluentNHibernate.Mapping.KeyManyToOnePart})">
|
||||
<summary>
|
||||
Defines a reference to be used as a many-to-one key for this composite-id with an explicit column name.
|
||||
</summary>
|
||||
<param name="expression">A member access lambda expression for the property</param>
|
||||
<param name="columnName">The column name in the database to use for this key, or null to use the property name</param>
|
||||
<param name="customMapping">A lambda expression specifying additional settings for the key reference</param>
|
||||
<returns>The composite identity part fluent interface</returns>
|
||||
</member>
|
||||
<member name="P:FluentNHibernate.Mapping.CompositeIdentityPart`1.Access">
|
||||
<summary>
|
||||
Set the access and naming strategy for this identity.
|
||||
@@ -175,6 +192,12 @@
|
||||
<param name="expression">Expression to get property from</param>
|
||||
<returns>many-to-many part</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Mapping.JoinedSubClassPart`1.EntityName(System.String)">
|
||||
<summary>
|
||||
Specifies an entity-name.
|
||||
</summary>
|
||||
<remarks>See http://nhforge.org/blogs/nhibernate/archive/2008/10/21/entity-name-in-action-a-strongly-typed-entity.aspx</remarks>
|
||||
</member>
|
||||
<member name="P:FluentNHibernate.Mapping.JoinedSubClassPart`1.Not">
|
||||
<summary>
|
||||
Inverts the next boolean
|
||||
@@ -236,6 +259,34 @@
|
||||
</summary>
|
||||
<param name="subselectSql">Subselect SQL Query</param>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Mapping.ClassMap`1.EntityName(System.String)">
|
||||
<summary>
|
||||
Specifies an entity-name.
|
||||
</summary>
|
||||
<remarks>See http://nhforge.org/blogs/nhibernate/archive/2008/10/21/entity-name-in-action-a-strongly-typed-entity.aspx</remarks>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Mapping.ClassMap`1.ApplyFilter``1(System.String)">
|
||||
<overloads>
|
||||
Applies a named filter to this one-to-many.
|
||||
</overloads>
|
||||
<summary>
|
||||
Applies a named filter to this one-to-many.
|
||||
</summary>
|
||||
<param name="condition">The condition to apply</param>
|
||||
<typeparam name="TFilter">
|
||||
The type of a <see cref="T:FluentNHibernate.Mapping.FilterDefinition"/> implementation
|
||||
defining the filter to apply.
|
||||
</typeparam>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Mapping.ClassMap`1.ApplyFilter``1">
|
||||
<summary>
|
||||
Applies a named filter to this one-to-many.
|
||||
</summary>
|
||||
<typeparam name="TFilter">
|
||||
The type of a <see cref="T:FluentNHibernate.Mapping.FilterDefinition"/> implementation
|
||||
defining the filter to apply.
|
||||
</typeparam>
|
||||
</member>
|
||||
<member name="P:FluentNHibernate.Mapping.ClassMap`1.Cache">
|
||||
<summary>
|
||||
Specify caching for this entity.
|
||||
@@ -391,16 +442,23 @@
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Mapping.SubClassPart`1.EntityName(System.String)">
|
||||
<summary>
|
||||
Specifies an entity-name.
|
||||
</summary>
|
||||
<remarks>See http://nhforge.org/blogs/nhibernate/archive/2008/10/21/entity-name-in-action-a-strongly-typed-entity.aspx</remarks>
|
||||
</member>
|
||||
<member name="P:FluentNHibernate.Mapping.SubClassPart`1.Not">
|
||||
<summary>
|
||||
Inverts the next boolean
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:FluentNHibernate.Conventions.IHibernateMappingConvention">
|
||||
<member name="T:FluentNHibernate.Conventions.AttributeCollectionConvention`1">
|
||||
<summary>
|
||||
Convention for the hibernate-mapping container for a class, this can be used to
|
||||
set some class-wide settings such as lazy-load and access strategies.
|
||||
Base class for attribute based conventions. Create a subclass of this to supply your own
|
||||
attribute based conventions.
|
||||
</summary>
|
||||
<typeparam name="T">Attribute identifier</typeparam>
|
||||
</member>
|
||||
<member name="T:FluentNHibernate.Conventions.IConvention`2">
|
||||
<summary>
|
||||
@@ -419,6 +477,26 @@
|
||||
Apply changes to the target
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Conventions.IConventionAcceptance`1.Accept(FluentNHibernate.Conventions.AcceptanceCriteria.IAcceptanceCriteria{`0})">
|
||||
<summary>
|
||||
Whether this convention will be applied to the target.
|
||||
</summary>
|
||||
<param name="criteria">Instace that could be supplied</param>
|
||||
<returns>Apply on this target?</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Conventions.AttributeCollectionConvention`1.Apply(`0,FluentNHibernate.Conventions.Instances.ICollectionInstance)">
|
||||
<summary>
|
||||
Apply changes to a property with an attribute matching T.
|
||||
</summary>
|
||||
<param name="attribute">Instance of attribute found on property.</param>
|
||||
<param name="instance">Property with attribute</param>
|
||||
</member>
|
||||
<member name="T:FluentNHibernate.Conventions.IHibernateMappingConvention">
|
||||
<summary>
|
||||
Convention for the hibernate-mapping container for a class, this can be used to
|
||||
set some class-wide settings such as lazy-load and access strategies.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:FluentNHibernate.Conventions.IReferenceConvention">
|
||||
<summary>
|
||||
Reference convention, implement this interface to apply changes to Reference/many-to-one
|
||||
@@ -462,13 +540,6 @@
|
||||
to dynamic components.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Conventions.IConventionAcceptance`1.Accept(FluentNHibernate.Conventions.AcceptanceCriteria.IAcceptanceCriteria{`0})">
|
||||
<summary>
|
||||
Whether this convention will be applied to the target.
|
||||
</summary>
|
||||
<param name="criteria">Instace that could be supplied</param>
|
||||
<returns>Apply on this target?</returns>
|
||||
</member>
|
||||
<member name="P:FluentNHibernate.Conventions.Inspections.IInspector.StringIdentifierForModel">
|
||||
<summary>
|
||||
Represents a string identifier for the model instance, used in conventions for a lazy
|
||||
@@ -478,7 +549,7 @@
|
||||
this allows the user to find any columns with the matching name.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Conventions.Inspections.CollectionInspector.IsSet(System.Reflection.PropertyInfo)">
|
||||
<member name="M:FluentNHibernate.Conventions.Inspections.CollectionInspector.IsSet(FluentNHibernate.Member)">
|
||||
<summary>
|
||||
Represents a string identifier for the model instance, used in conventions for a lazy
|
||||
shortcut.
|
||||
@@ -786,17 +857,61 @@
|
||||
<param name="collection">Main collection</param>
|
||||
<returns>Many-to-many table name</returns>
|
||||
</member>
|
||||
<member name="P:FluentNHibernate.Mapping.ColumnPart.Not">
|
||||
<summary>
|
||||
Inverts the next boolean
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:FluentNHibernate.Mapping.FilterPart">
|
||||
<summary>
|
||||
Maps to the Filter element in NH 2.0
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:FluentNHibernate.Mapping.KeyManyToOnePart.Not">
|
||||
<summary>
|
||||
Inverts the next boolean
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:FluentNHibernate.Mapping.KeyManyToOnePart.Access">
|
||||
<summary>
|
||||
Defines how NHibernate will access the object for persisting/hydrating (Defaults to Property)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.SeparateSubclassVisitor.SortByDistanceFrom(System.Type,System.Collections.Generic.IEnumerable{FluentNHibernate.Mapping.Providers.IIndeterminateSubclassMappingProvider})">
|
||||
<summary>
|
||||
Takes a type that represents the level in the class/subclass-hiearchy that we're starting from, the parent,
|
||||
this can be a class or subclass; also takes a list of subclass providers. The providers are then iterated
|
||||
and added to a dictionary key'd by the types "distance" from the parentType; distance being the number of levels
|
||||
between parentType and the subclass-type.
|
||||
|
||||
By default if the Parent type is an interface the level will always be zero. At this time there is no check for
|
||||
hierarchical interface inheritance.
|
||||
</summary>
|
||||
<param name="parentType">Starting point, parent type.</param>
|
||||
<param name="providers">List of subclasses</param>
|
||||
<param name="subProviders">List of subclasses</param>
|
||||
<returns>Dictionary key'd by the distance from the parentType.</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.SeparateSubclassVisitor.DistanceFromParentInterface(System.Type,System.Type,System.Int32@)">
|
||||
<summary>
|
||||
The evalType starts out as the original subclass. The class hiearchy is only
|
||||
walked if the subclass inherits from a class that is included in the subclassProviders.
|
||||
</summary>
|
||||
<param name="parentType"></param>
|
||||
<param name="evalType"></param>
|
||||
<param name="level"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.SeparateSubclassVisitor.DistanceFromParentBase(System.Type,System.Type,System.Int32@)">
|
||||
<summary>
|
||||
The evalType is always one class higher in the hiearchy starting from the original subclass. The class
|
||||
hiearchy is walked until the IsTopLevel (base class is Object) is met. The level is only incremented if
|
||||
the subclass inherits from a class that is also in the subclassProviders.
|
||||
</summary>
|
||||
<param name="parentType"></param>
|
||||
<param name="evalType"></param>
|
||||
<param name="level"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Mapping.GeneratorBuilder.Identity">
|
||||
<summary>
|
||||
supports identity columns in DB2, MySQL, MS SQL Server and Sybase.
|
||||
@@ -1103,6 +1218,235 @@
|
||||
The Oracle.DataAccess library must be available to the calling application/library.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxDRDAConnectionStringBuilder.Authentication(System.String)">
|
||||
<summary>
|
||||
The type of authentication to be used. Acceptable values:
|
||||
<list type="bullet">
|
||||
<item>
|
||||
SERVER
|
||||
</item>
|
||||
<item>
|
||||
SERVER_ENCRYPT
|
||||
</item>
|
||||
<item>
|
||||
DATA_ENCRYPT
|
||||
</item>
|
||||
<item>
|
||||
KERBEROS
|
||||
</item>
|
||||
<item>
|
||||
GSSPLUGIN
|
||||
</item>
|
||||
</list>
|
||||
</summary>
|
||||
<param name="authentication"></param>
|
||||
<returns>IfxDRDAConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxDRDAConnectionStringBuilder.Database(System.String)">
|
||||
<summary>
|
||||
The name of the database within the server instance.
|
||||
</summary>
|
||||
<param name="database"></param>
|
||||
<returns>IfxSQLIConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxDRDAConnectionStringBuilder.HostVarParameter(System.String)">
|
||||
<summary>
|
||||
<list type="bullet">
|
||||
<item>
|
||||
<term>true</term>
|
||||
<description> - host variable (:param) support enabled.</description>
|
||||
</item>
|
||||
<item>
|
||||
<term>false (default)</term>
|
||||
<description> - host variable support disabled.</description>
|
||||
</item>
|
||||
</list>
|
||||
</summary>
|
||||
<param name="hostVarParameter"></param>
|
||||
<returns>IfxSQLIConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxDRDAConnectionStringBuilder.IsolationLevel(System.String)">
|
||||
<summary>
|
||||
Isolation level for the connection. Possible values:
|
||||
<list type="bullet">
|
||||
<item>
|
||||
ReadCommitted
|
||||
</item>
|
||||
<item>
|
||||
ReadUncommitted
|
||||
</item>
|
||||
<item>
|
||||
RepeatableRead
|
||||
</item>
|
||||
<item>
|
||||
Serializable
|
||||
</item>
|
||||
<item>
|
||||
Transaction
|
||||
</item>
|
||||
</list>
|
||||
This keyword is only supported for applications participating in a
|
||||
distributed transaction.
|
||||
</summary>
|
||||
<param name="isolationLevel"></param>
|
||||
<returns>IfxDRDAConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxDRDAConnectionStringBuilder.MaxPoolSize(System.String)">
|
||||
<summary>
|
||||
The maximum number of connections allowed in the pool.
|
||||
</summary>
|
||||
<param name="maxPoolSize"></param>
|
||||
<returns>IfxDRDAConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxDRDAConnectionStringBuilder.MinPoolSize(System.String)">
|
||||
<summary>
|
||||
The minimum number of connections allowed in the pool. Default value 0.
|
||||
</summary>
|
||||
<param name="minPoolSize"></param>
|
||||
<returns>IfxDRDAConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxDRDAConnectionStringBuilder.Password(System.String)">
|
||||
<summary>
|
||||
The password associated with the User ID.
|
||||
</summary>
|
||||
<param name="password"></param>
|
||||
<returns>IfxDRDAConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxDRDAConnectionStringBuilder.Pooling(System.String)">
|
||||
<summary>
|
||||
When set to true, the IfxConnection object is drawn from
|
||||
the appropriate pool, or if necessary, it is created and added
|
||||
to the appropriate pool. Default value 'true'.
|
||||
</summary>
|
||||
<param name="pooling"></param>
|
||||
<returns>IfxDRDAConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxDRDAConnectionStringBuilder.Server(System.String)">
|
||||
<summary>
|
||||
Server name with optional port number for direct connection using either
|
||||
IPv4 notation (<![CDATA[<server name/ip address>[:<port>]]]>) or IPv6 notation.
|
||||
</summary>
|
||||
<param name="server"></param>
|
||||
<returns>IfxDRDAConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxDRDAConnectionStringBuilder.Username(System.String)">
|
||||
<summary>
|
||||
The login account.
|
||||
</summary>
|
||||
<param name="username"></param>
|
||||
<returns>IfxDRDAConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxDRDAConnectionStringBuilder.OtherOptions(System.String)">
|
||||
<summary>
|
||||
Other options: Connection Lifetime, Connection Reset, Connection Timeout, CurrentSchema, Enlist,
|
||||
Interrupt, Persist Security Info, ResultArrayAsReturnValue, Security, TrustedContextSystemUserID,
|
||||
TrustedContextSystemPassword
|
||||
</summary>
|
||||
<param name="otherOptions"></param>
|
||||
<returns>IfxDRDAConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxSQLIConnectionStringBuilder.ClientLocale(System.String)">
|
||||
<summary>
|
||||
Client locale, default value is en_us.CP1252 (Windows)
|
||||
</summary>
|
||||
<param name="clientLocale"></param>
|
||||
<returns>IfxSQLIConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxSQLIConnectionStringBuilder.Database(System.String)">
|
||||
<summary>
|
||||
The name of the database within the server instance.
|
||||
</summary>
|
||||
<param name="database"></param>
|
||||
<returns>IfxSQLIConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxSQLIConnectionStringBuilder.DatabaseLocale(System.String)">
|
||||
<summary>
|
||||
The language locale of the database. Default value is en_US.8859-1
|
||||
</summary>
|
||||
<param name="databaseLocale"></param>
|
||||
<returns>IfxSQLIConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxSQLIConnectionStringBuilder.Delimident(System.Boolean)">
|
||||
<summary>
|
||||
When set to true or y for yes, any string within double
|
||||
quotes (") is treated as an identifier, and any string within
|
||||
single quotes (') is treated as a string literal. Default value 'y'.
|
||||
</summary>
|
||||
<param name="delimident"></param>
|
||||
<returns>IfxSQLIConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxSQLIConnectionStringBuilder.Host(System.String)">
|
||||
<summary>
|
||||
The name or IP address of the machine on which the
|
||||
Informix server is running. Required.
|
||||
</summary>
|
||||
<param name="host"></param>
|
||||
<returns>IfxSQLIConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxSQLIConnectionStringBuilder.MaxPoolSize(System.String)">
|
||||
<summary>
|
||||
The maximum number of connections allowed in the pool. Default value 100.
|
||||
</summary>
|
||||
<param name="maxPoolSize"></param>
|
||||
<returns>IfxSQLIConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxSQLIConnectionStringBuilder.MinPoolSize(System.String)">
|
||||
<summary>
|
||||
The minimum number of connections allowed in the pool. Default value 0.
|
||||
</summary>
|
||||
<param name="minPoolSize"></param>
|
||||
<returns>IfxSQLIConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxSQLIConnectionStringBuilder.Password(System.String)">
|
||||
<summary>
|
||||
The password associated with the User ID. Required if the
|
||||
client machine or user account is not trusted by the host.
|
||||
Prohibited if a User ID is not given.
|
||||
</summary>
|
||||
<param name="password"></param>
|
||||
<returns>IfxSQLIConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxSQLIConnectionStringBuilder.Pooling(System.String)">
|
||||
<summary>
|
||||
When set to true, the IfxConnection object is drawn from
|
||||
the appropriate pool, or if necessary, it is created and added
|
||||
to the appropriate pool. Default value 'true'.
|
||||
</summary>
|
||||
<param name="pooling"></param>
|
||||
<returns>IfxSQLIConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxSQLIConnectionStringBuilder.Server(System.String)">
|
||||
<summary>
|
||||
The name or alias of the instance of the Informix server to
|
||||
which to connect. Required.
|
||||
</summary>
|
||||
<param name="server"></param>
|
||||
<returns>IfxSQLIConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxSQLIConnectionStringBuilder.Service(System.String)">
|
||||
<summary>
|
||||
The service name or port number through which the server
|
||||
is listening for connection requests.
|
||||
</summary>
|
||||
<param name="service"></param>
|
||||
<returns>IfxSQLIConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxSQLIConnectionStringBuilder.Username(System.String)">
|
||||
<summary>
|
||||
The login account. Required, unless the client machine is
|
||||
trusted by the host machine.
|
||||
</summary>
|
||||
<param name="username"></param>
|
||||
<returns>IfxSQLIConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Cfg.Db.IfxSQLIConnectionStringBuilder.OtherOptions(System.String)">
|
||||
<summary>
|
||||
Other options like: Connection Lifetime, Enlist, Exclusive, Optimize OpenFetchClose,
|
||||
Fetch Buffer Size, Persist Security Info, Protocol, Single Threaded, Skip Parsing
|
||||
</summary>
|
||||
<param name="otherOptions"></param>
|
||||
<returns>IfxSQLIConnectionStringBuilder object</returns>
|
||||
</member>
|
||||
<member name="T:FluentNHibernate.Cfg.FluentConfiguration">
|
||||
<summary>
|
||||
Fluent configuration API for NHibernate
|
||||
@@ -1614,11 +1958,11 @@
|
||||
Naming strategy prefix.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Testing.PersistenceSpecification`1.CheckComponentList``1(System.Linq.Expressions.Expression{System.Func{`0,System.Object}},System.Collections.Generic.IList{``0})">
|
||||
<member name="M:FluentNHibernate.Testing.PersistenceSpecificationExtensions.CheckComponentList``2(FluentNHibernate.Testing.PersistenceSpecification{``0},System.Linq.Expressions.Expression{System.Func{``0,System.Object}},System.Collections.Generic.IEnumerable{``1},System.Collections.IEqualityComparer)">
|
||||
<summary>
|
||||
Checks a list of components for validity.
|
||||
</summary>
|
||||
<typeparam name="TList">Type of list element</typeparam>
|
||||
<typeparam name="TListElement">Type of list element</typeparam>
|
||||
<param name="expression">Property</param>
|
||||
<param name="propertyValue">Value to save</param>
|
||||
</member>
|
||||
@@ -1726,6 +2070,28 @@
|
||||
Sets a custom collection type
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Mapping.ToManyBase`3.ApplyFilter``1(System.String)">
|
||||
<overloads>
|
||||
Applies a named filter to this one-to-many.
|
||||
</overloads>
|
||||
<summary>
|
||||
Applies a named filter to this one-to-many.
|
||||
</summary>
|
||||
<param name="condition">The condition to apply</param>
|
||||
<typeparam name="TFilter">
|
||||
The type of a <see cref="T:FluentNHibernate.Mapping.FilterDefinition"/> implementation
|
||||
defining the filter to apply.
|
||||
</typeparam>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Mapping.ToManyBase`3.ApplyFilter``1">
|
||||
<summary>
|
||||
Applies a named filter to this one-to-many.
|
||||
</summary>
|
||||
<typeparam name="TFilter">
|
||||
The type of a <see cref="T:FluentNHibernate.Mapping.FilterDefinition"/> implementation
|
||||
defining the filter to apply.
|
||||
</typeparam>
|
||||
</member>
|
||||
<member name="P:FluentNHibernate.Mapping.ToManyBase`3.Cache">
|
||||
<summary>
|
||||
Specify caching for this entity.
|
||||
@@ -2110,6 +2476,14 @@
|
||||
Inverts the next boolean
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Mapping.OneToManyPart`1.PropertyRef(System.String)">
|
||||
<summary>
|
||||
This method is used to set a different key column in this table to be used for joins.
|
||||
The output is set as the property-ref attribute in the "key" subelement of the collection
|
||||
</summary>
|
||||
<param name="propertyRef">The name of the column in this table which is linked to the foreign key</param>
|
||||
<returns>OneToManyPart</returns>
|
||||
</member>
|
||||
<member name="M:FluentNHibernate.Mapping.OneToManyPart`1.OrderBy(System.String)">
|
||||
<summary>
|
||||
Sets the order-by clause for this one-to-many relationship.
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -3488,6 +3488,9 @@
|
||||
<member name="F:NHibernate.Cfg.MappingSchema.HbmKeyManyToOne.lazySpecified">
|
||||
<remarks/>
|
||||
</member>
|
||||
<member name="F:NHibernate.Cfg.MappingSchema.HbmKeyManyToOne.notfound">
|
||||
<remarks/>
|
||||
</member>
|
||||
<member name="T:NHibernate.Cfg.MappingSchema.HbmKeyProperty">
|
||||
<remarks/>
|
||||
</member>
|
||||
@@ -5234,6 +5237,9 @@
|
||||
<member name="T:NHibernate.Cfg.MappingSchema.HbmDefinition">
|
||||
<remarks/>
|
||||
</member>
|
||||
<member name="F:NHibernate.Cfg.MappingSchema.HbmDefinition.param">
|
||||
<remarks/>
|
||||
</member>
|
||||
<member name="F:NHibernate.Cfg.MappingSchema.HbmDefinition.class">
|
||||
<remarks/>
|
||||
</member>
|
||||
@@ -5267,6 +5273,9 @@
|
||||
<member name="F:NHibernate.Cfg.MappingSchema.HbmFilterDef.condition">
|
||||
<remarks/>
|
||||
</member>
|
||||
<member name="F:NHibernate.Cfg.MappingSchema.HbmFilterDef.usemanytoone">
|
||||
<remarks/>
|
||||
</member>
|
||||
<member name="T:NHibernate.Cfg.MappingSchema.HbmFilterParam">
|
||||
<remarks/>
|
||||
</member>
|
||||
@@ -8246,6 +8255,11 @@
|
||||
Get an executable instance of <c>Criteria</c>,
|
||||
to actually run the query.</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Criterion.DetachedCriteria.GetExecutableCriteria(NHibernate.IStatelessSession)">
|
||||
<summary>
|
||||
Get an executable instance of <c>Criteria</c>,
|
||||
to actually run the query.</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Criterion.DetachedCriteria.GetRootEntityTypeIfAvailable">
|
||||
<summary>
|
||||
Gets the root entity type if available, throws otherwise
|
||||
@@ -13175,6 +13189,13 @@
|
||||
<param name="sqlType">The SqlType to set for IDbDataParameter.</param>
|
||||
<returns>An IDbDataParameter ready to be added to an IDbCommand.</returns>
|
||||
</member>
|
||||
<member name="M:NHibernate.Driver.DriverBase.OnBeforePrepare(System.Data.IDbCommand)">
|
||||
<summary>
|
||||
Override to make any adjustments to the IDbCommand object. (e.g., Oracle custom OUT parameter)
|
||||
Parameters have been bound by this point, so their order can be adjusted too.
|
||||
This is analagous to the RegisterResultSetOutParameter() function in Hibernate.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:NHibernate.Driver.DriverBase.UseNamedPrefixInSql">
|
||||
<summary>
|
||||
Does this Driver require the use of a Named Prefix in the SQL statement.
|
||||
@@ -15455,7 +15476,7 @@
|
||||
information includes its name as well as its defined parameters (name and type).
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Engine.FilterDefinition.#ctor(System.String,System.String,System.Collections.Generic.IDictionary{System.String,NHibernate.Type.IType})">
|
||||
<member name="M:NHibernate.Engine.FilterDefinition.#ctor(System.String,System.String,System.Collections.Generic.IDictionary{System.String,NHibernate.Type.IType},System.Boolean)">
|
||||
<summary>
|
||||
Set the named parameter's value list for this filter.
|
||||
</summary>
|
||||
@@ -15463,6 +15484,7 @@
|
||||
<param name="defaultCondition">The default filter condition.</param>
|
||||
<param name="parameterTypes">A dictionary storing the NHibernate <see cref="T:NHibernate.Type.IType"/> type
|
||||
of each parameter under its name.</param>
|
||||
<param name="useManyToOne">if set to <c>true</c> used in many to one rel</param>
|
||||
</member>
|
||||
<member name="M:NHibernate.Engine.FilterDefinition.GetParameterType(System.String)">
|
||||
<summary>
|
||||
@@ -15471,6 +15493,12 @@
|
||||
<param name="parameterName">The name of the filter parameter for which to return the type.</param>
|
||||
<returns>The type of the named parameter.</returns>
|
||||
</member>
|
||||
<member name="P:NHibernate.Engine.FilterDefinition.UseInManyToOne">
|
||||
<summary>
|
||||
Gets a value indicating whether to use this filter-def in manytoone refs.
|
||||
</summary>
|
||||
<value><c>true</c> if [use in many to one]; otherwise, <c>false</c>.</value>
|
||||
</member>
|
||||
<member name="P:NHibernate.Engine.FilterDefinition.FilterName">
|
||||
<summary>
|
||||
Get the name of the filter this configuration defines.
|
||||
@@ -16481,36 +16509,24 @@
|
||||
<member name="P:NHibernate.Engine.ISessionImplementor.EntityMode">
|
||||
<summary> Retrieve the entity mode in effect for this session. </summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Engine.JoinHelper.GetAliasedLHSColumnNames(NHibernate.Type.IAssociationType,System.String,System.Int32,NHibernate.Persister.Entity.IOuterJoinLoadable,NHibernate.Engine.IMapping)">
|
||||
<summary>
|
||||
Get the aliased columns of the owning entity which are to
|
||||
be used in the join
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Engine.JoinHelper.GetLHSColumnNames(NHibernate.Type.IAssociationType,System.Int32,NHibernate.Persister.Entity.IOuterJoinLoadable,NHibernate.Engine.IMapping)">
|
||||
<summary>
|
||||
Get the columns of the owning entity which are to
|
||||
be used in the join
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Engine.JoinHelper.GetAliasedLHSColumnNames(NHibernate.Type.IAssociationType,System.String,System.Int32,System.Int32,NHibernate.Persister.Entity.IOuterJoinLoadable,NHibernate.Engine.IMapping)">
|
||||
<summary>
|
||||
Get the aliased columns of the owning entity which are to
|
||||
be used in the join
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Engine.JoinHelper.GetLHSColumnNames(NHibernate.Type.IAssociationType,System.Int32,System.Int32,NHibernate.Persister.Entity.IOuterJoinLoadable,NHibernate.Engine.IMapping)">
|
||||
<summary>
|
||||
Get the columns of the owning entity which are to
|
||||
be used in the join
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Engine.JoinHelper.GetRHSColumnNames(NHibernate.Type.IAssociationType,NHibernate.Engine.ISessionFactoryImplementor)">
|
||||
<summary>
|
||||
Get the columns of the associated table which are to
|
||||
be used in the join
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Engine.ILhsAssociationTypeSqlInfo.GetAliasedColumnNames(NHibernate.Type.IAssociationType,System.Int32)">
|
||||
<summary>
|
||||
Get the aliased columns of the owning entity which are to
|
||||
be used in the join
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Engine.ILhsAssociationTypeSqlInfo.GetColumnNames(NHibernate.Type.IAssociationType,System.Int32)">
|
||||
<summary>
|
||||
Get the columns of the owning entity which are to
|
||||
be used in the join
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:NHibernate.Engine.Nullability">
|
||||
<summary>
|
||||
Implements the algorithm for validating property values
|
||||
@@ -18038,6 +18054,12 @@
|
||||
Defines a base class for Session generated events.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:NHibernate.Event.IDatabaseEventArgs.Session">
|
||||
<summary>
|
||||
Returns the session event source for this event.
|
||||
This is the underlying session from which this event was generated.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Event.AbstractEvent.#ctor(NHibernate.Event.IEventSource)">
|
||||
<summary>
|
||||
Constructs an event from the given event session.
|
||||
@@ -18083,11 +18105,61 @@
|
||||
collection and does not include the entity's ID)
|
||||
</value>
|
||||
</member>
|
||||
<member name="T:NHibernate.Event.AbstractPostDatabaseOperationEvent">
|
||||
<summary>
|
||||
Represents an operation we performed against the database.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:NHibernate.Event.IPostDatabaseOperationEventArgs">
|
||||
<summary>
|
||||
Represents an operation we performed against the database.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:NHibernate.Event.IPostDatabaseOperationEventArgs.Entity">
|
||||
<summary> The entity involved in the database operation. </summary>
|
||||
</member>
|
||||
<member name="P:NHibernate.Event.IPostDatabaseOperationEventArgs.Id">
|
||||
<summary> The id to be used in the database operation. </summary>
|
||||
</member>
|
||||
<member name="P:NHibernate.Event.IPostDatabaseOperationEventArgs.Persister">
|
||||
<summary>
|
||||
The persister for the <see cref="P:NHibernate.Event.IPostDatabaseOperationEventArgs.Entity"/>.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Event.AbstractPostDatabaseOperationEvent.#ctor(NHibernate.Event.IEventSource,System.Object,System.Object,NHibernate.Persister.Entity.IEntityPersister)">
|
||||
<summary> Constructs an event containing the pertinent information. </summary>
|
||||
<param name="source">The session from which the event originated. </param>
|
||||
<param name="entity">The entity to be invloved in the database operation. </param>
|
||||
<param name="id">The entity id to be invloved in the database operation. </param>
|
||||
<param name="persister">The entity's persister. </param>
|
||||
</member>
|
||||
<member name="P:NHibernate.Event.AbstractPostDatabaseOperationEvent.Entity">
|
||||
<summary> The entity involved in the database operation. </summary>
|
||||
</member>
|
||||
<member name="P:NHibernate.Event.AbstractPostDatabaseOperationEvent.Id">
|
||||
<summary> The id to be used in the database operation. </summary>
|
||||
</member>
|
||||
<member name="P:NHibernate.Event.AbstractPostDatabaseOperationEvent.Persister">
|
||||
<summary>
|
||||
The persister for the <see cref="P:NHibernate.Event.AbstractPostDatabaseOperationEvent.Entity"/>.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:NHibernate.Event.AbstractPreDatabaseOperationEvent">
|
||||
<summary>
|
||||
Represents an operation we are about to perform against the database.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:NHibernate.Event.IPreDatabaseOperationEventArgs.Entity">
|
||||
<summary> The entity involved in the database operation. </summary>
|
||||
</member>
|
||||
<member name="P:NHibernate.Event.IPreDatabaseOperationEventArgs.Id">
|
||||
<summary> The id to be used in the database operation. </summary>
|
||||
</member>
|
||||
<member name="P:NHibernate.Event.IPreDatabaseOperationEventArgs.Persister">
|
||||
<summary>
|
||||
The persister for the <see cref="P:NHibernate.Event.IPreDatabaseOperationEventArgs.Entity"/>.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Event.AbstractPreDatabaseOperationEvent.#ctor(NHibernate.Event.IEventSource,System.Object,System.Object,NHibernate.Persister.Entity.IEntityPersister)">
|
||||
<summary> Constructs an event containing the pertinent information. </summary>
|
||||
<param name="source">The session from which the event originated. </param>
|
||||
@@ -21967,6 +22039,35 @@
|
||||
Wraps SessionFactoryImpl, adding more lookup behaviors and encapsulating some of the error handling.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Hql.Util.SessionFactoryHelper.GetCollectionPersister(System.String)">
|
||||
<summary>
|
||||
Locate the collection persister by the collection role.
|
||||
</summary>
|
||||
<param name="role">The collection role name.</param>
|
||||
<returns>The defined CollectionPersister for this collection role, or null.</returns>
|
||||
</member>
|
||||
<member name="M:NHibernate.Hql.Util.SessionFactoryHelper.RequireClassPersister(System.String)">
|
||||
<summary>
|
||||
Locate the persister by class or entity name, requiring that such a persister
|
||||
exists
|
||||
</summary>
|
||||
<param name="name">The class or entity name</param>
|
||||
<returns>The defined persister for this entity</returns>
|
||||
</member>
|
||||
<member name="M:NHibernate.Hql.Util.SessionFactoryHelper.FindEntityPersisterByName(System.String)">
|
||||
<summary>
|
||||
Locate the persister by class or entity name.
|
||||
</summary>
|
||||
<param name="name">The class or entity name</param>
|
||||
<returns>The defined persister for this entity, or null if none found.</returns>
|
||||
</member>
|
||||
<member name="M:NHibernate.Hql.Util.SessionFactoryHelper.GetCollectionPropertyMapping(System.String)">
|
||||
<summary>
|
||||
Retreive a PropertyMapping describing the given collection role.
|
||||
</summary>
|
||||
<param name="role">The collection role for whcih to retrieve the property mapping.</param>
|
||||
<returns>The property mapping.</returns>
|
||||
</member>
|
||||
<member name="T:NHibernate.Hql.NameGenerator">
|
||||
<summary>
|
||||
Provides utility methods for generating HQL / SQL names.
|
||||
@@ -24655,6 +24756,13 @@
|
||||
</summary>
|
||||
<returns>The clone of the root criteria.</returns>
|
||||
</member>
|
||||
<member name="P:NHibernate.Impl.CurrentSessionIdLoggingContext.SessionId">
|
||||
<summary>
|
||||
Error handling in this case will only kick in if we cannot set values on the TLS
|
||||
this is usally the case if we are called from the finalizer, since this is something
|
||||
that we do only for logging, we ignore the error.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:NHibernate.Impl.DbCommandSet`2">
|
||||
<summary>
|
||||
Expose the batch functionality in ADO.Net 2.0
|
||||
@@ -25628,9 +25736,6 @@
|
||||
you are serializing in the same AppDomain then there will be no problem because the uid will
|
||||
be in this object.
|
||||
</para>
|
||||
<para>
|
||||
TODO: verify that the AppDomain statements are correct.
|
||||
</para>
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="M:NHibernate.Impl.SessionFactoryObjectFactory.#cctor">
|
||||
@@ -25669,9 +25774,11 @@
|
||||
</member>
|
||||
<member name="P:NHibernate.Impl.SessionIdLoggingContext.SessionId">
|
||||
<summary>
|
||||
Error handling in this case will only kick in if we cannot set values on the TLS
|
||||
this is usally the case if we are called from the finalizer, since this is something
|
||||
that we do only for logging, we ignore the error.
|
||||
We always set the result to use a thread static variable, on the face of it,
|
||||
it looks like it is not a valid choice, since ASP.Net and WCF may decide to switch
|
||||
threads on us. But, since SessionIdLoggingContext is only used inside NH calls, and since
|
||||
NH calls are never async, this isn't an issue for us.
|
||||
In addition to that, attempting to match to the current context has proven to be performance hit.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:NHibernate.Impl.SessionImpl">
|
||||
@@ -26477,7 +26584,7 @@
|
||||
by outerjoin
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Loader.JoinWalker.WalkComponentTree(NHibernate.Type.IAbstractComponentType,System.Int32,System.Int32,NHibernate.Persister.Entity.IOuterJoinLoadable,System.String,System.String,System.Int32)">
|
||||
<member name="M:NHibernate.Loader.JoinWalker.WalkComponentTree(NHibernate.Type.IAbstractComponentType,System.Int32,System.String,System.String,System.Int32,NHibernate.Engine.ILhsAssociationTypeSqlInfo)">
|
||||
<summary>
|
||||
For a component, add to a list of associations to be fetched by outerjoin
|
||||
</summary>
|
||||
@@ -30779,6 +30886,11 @@
|
||||
Get the table name for the given property path
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Persister.Entity.IOuterJoinLoadable.ToIdentifierColumns(System.String)">
|
||||
<summary>
|
||||
Return the alised identifier column names
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:NHibernate.Persister.Entity.IQueryable">
|
||||
<summary>
|
||||
Extends the generic <c>ILoadable</c> contract to add operations required by HQL
|
||||
@@ -37929,6 +38041,13 @@
|
||||
<member name="T:NHibernate.Util.FilterHelper">
|
||||
<summary></summary>
|
||||
</member>
|
||||
<member name="M:NHibernate.Util.FilterHelper.GetEnabledForManyToOne(System.Collections.Generic.IDictionary{System.String,NHibernate.IFilter})">
|
||||
<summary>
|
||||
Get only filters enabled for many-to-one association.
|
||||
</summary>
|
||||
<param name="enabledFilters">All enabled filters</param>
|
||||
<returns>A new <see cref="T:System.Collections.Generic.IDictionary`2"/> for filters enabled for many to one.</returns>
|
||||
</member>
|
||||
<member name="T:NHibernate.Util.IdentityMap">
|
||||
<summary>
|
||||
An <see cref="T:System.Collections.IDictionary"/> where keys are compared by object identity, rather than <c>equals</c>.
|
||||
|
Binary file not shown.
Binary file not shown.
@@ -1,460 +0,0 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -37,7 +37,7 @@ namespace Orchard.Core.Tests.Common.Providers {
|
||||
|
||||
protected override IEnumerable<Type> DatabaseTypes {
|
||||
get {
|
||||
return new[] {typeof (ContentTypeRecord), typeof (ContentItemRecord), typeof (CommonRecord)};
|
||||
return new[] { typeof(ContentTypeRecord), typeof(ContentItemRecord), typeof(ContentItemVersionRecord), typeof(CommonRecord) };
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -39,7 +39,7 @@ namespace Orchard.Tests.Packages.Users.Controllers {
|
||||
|
||||
protected override IEnumerable<Type> DatabaseTypes {
|
||||
get {
|
||||
return new[] { typeof(UserRecord), typeof(ContentItemRecord), typeof(ContentTypeRecord) };
|
||||
return new[] { typeof(UserRecord), typeof(ContentItemRecord), typeof(ContentItemVersionRecord), typeof(ContentTypeRecord) };
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -43,6 +43,7 @@ namespace Orchard.Tests.Packages.Users.Services {
|
||||
_sessionFactory = DataUtility.CreateSessionFactory(
|
||||
databaseFileName,
|
||||
typeof(UserRecord),
|
||||
typeof(ContentItemVersionRecord),
|
||||
typeof(ContentItemRecord),
|
||||
typeof(ContentTypeRecord));
|
||||
}
|
||||
|
@@ -29,6 +29,7 @@ namespace Orchard.Tests.Models {
|
||||
databaseFileName,
|
||||
typeof(GammaRecord),
|
||||
typeof(DeltaRecord),
|
||||
typeof(ContentItemVersionRecord),
|
||||
typeof(ContentItemRecord),
|
||||
typeof(ContentTypeRecord));
|
||||
}
|
||||
@@ -56,10 +57,11 @@ namespace Orchard.Tests.Models {
|
||||
builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>));
|
||||
|
||||
_session = _sessionFactory.OpenSession();
|
||||
builder.Register(new DefaultModelManagerTests.TestSessionLocator(_session)).As<ISessionLocator>();
|
||||
builder.Register(new DefaultContentManagerTests.TestSessionLocator(_session)).As<ISessionLocator>();
|
||||
|
||||
_session.Delete("from GammaRecord");
|
||||
_session.Delete("from DeltaRecord");
|
||||
_session.Delete("from ContentItemVersionRecord");
|
||||
_session.Delete("from ContentItemRecord");
|
||||
_session.Delete("from ContentTypeRecord");
|
||||
_session.Flush();
|
||||
@@ -187,19 +189,21 @@ namespace Orchard.Tests.Models {
|
||||
_manager.Create<Gamma>("gamma", init => { init.Record.Frap = "three"; });
|
||||
_manager.Create<Gamma>("gamma", init => { init.Record.Frap = "four"; });
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
|
||||
var ascending = _manager.Query("gamma")
|
||||
.OrderBy<GammaRecord, string>(x => x.Frap)
|
||||
.List<Gamma>();
|
||||
.List<Gamma>().ToList();
|
||||
|
||||
Assert.That(ascending.Count(), Is.EqualTo(5));
|
||||
Assert.That(ascending.First().Record.Frap, Is.EqualTo("four"));
|
||||
Assert.That(ascending.Last().Record.Frap, Is.EqualTo("two"));
|
||||
|
||||
_session.Clear();
|
||||
|
||||
var descending = _manager.Query<Gamma, GammaRecord>()
|
||||
.OrderByDescending(x => x.Frap)
|
||||
.List();
|
||||
.List().ToList();
|
||||
|
||||
Assert.That(descending.Count(), Is.EqualTo(5));
|
||||
Assert.That(descending.First().Record.Frap, Is.EqualTo("two"));
|
||||
|
414
src/Orchard.Tests/Models/DefaultContentManagerTests.cs
Normal file
414
src/Orchard.Tests/Models/DefaultContentManagerTests.cs
Normal file
@@ -0,0 +1,414 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using Autofac;
|
||||
using Autofac.Builder;
|
||||
using Autofac.Modules;
|
||||
using NHibernate;
|
||||
using NUnit.Framework;
|
||||
using Orchard.Data;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.ContentManagement.Records;
|
||||
using Orchard.Tests.Models.Records;
|
||||
using Orchard.Tests.Models.Stubs;
|
||||
|
||||
namespace Orchard.Tests.Models {
|
||||
[TestFixture]
|
||||
public class DefaultContentManagerTests {
|
||||
private IContainer _container;
|
||||
private IContentManager _manager;
|
||||
private ISessionFactory _sessionFactory;
|
||||
private ISession _session;
|
||||
|
||||
[TestFixtureSetUp]
|
||||
public void InitFixture() {
|
||||
var databaseFileName = System.IO.Path.GetTempFileName();
|
||||
_sessionFactory = DataUtility.CreateSessionFactory(
|
||||
databaseFileName,
|
||||
typeof(ContentTypeRecord),
|
||||
typeof(ContentItemRecord),
|
||||
typeof(ContentItemVersionRecord),
|
||||
typeof(GammaRecord),
|
||||
typeof(DeltaRecord),
|
||||
typeof(EpsilonRecord));
|
||||
}
|
||||
|
||||
[TestFixtureTearDown]
|
||||
public void TermFixture() {
|
||||
|
||||
}
|
||||
|
||||
[SetUp]
|
||||
public void Init() {
|
||||
var builder = new ContainerBuilder();
|
||||
builder.RegisterModule(new ImplicitCollectionSupportModule());
|
||||
builder.Register<DefaultContentManager>().As<IContentManager>();
|
||||
builder.Register<AlphaHandler>().As<IContentHandler>();
|
||||
builder.Register<BetaHandler>().As<IContentHandler>();
|
||||
builder.Register<GammaHandler>().As<IContentHandler>();
|
||||
builder.Register<DeltaHandler>().As<IContentHandler>();
|
||||
builder.Register<EpsilonHandler>().As<IContentHandler>();
|
||||
builder.Register<FlavoredHandler>().As<IContentHandler>();
|
||||
builder.Register<StyledHandler>().As<IContentHandler>();
|
||||
|
||||
builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>));
|
||||
|
||||
_session = _sessionFactory.OpenSession();
|
||||
builder.Register(new TestSessionLocator(_session)).As<ISessionLocator>();
|
||||
|
||||
_container = builder.Build();
|
||||
_manager = _container.Resolve<IContentManager>();
|
||||
}
|
||||
|
||||
public class TestSessionLocator : ISessionLocator {
|
||||
private readonly ISession _session;
|
||||
|
||||
public TestSessionLocator(ISession session) {
|
||||
_session = session;
|
||||
}
|
||||
|
||||
public ISession For(Type entityType) {
|
||||
return _session;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AlphaDriverShouldWeldItsPart() {
|
||||
var foo = _manager.New("alpha");
|
||||
|
||||
Assert.That(foo.Is<Alpha>(), Is.True);
|
||||
Assert.That(foo.As<Alpha>(), Is.Not.Null);
|
||||
Assert.That(foo.Is<Beta>(), Is.False);
|
||||
Assert.That(foo.As<Beta>(), Is.Null);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void StronglyTypedNewShouldTypeCast() {
|
||||
var foo = _manager.New<Alpha>("alpha");
|
||||
Assert.That(foo, Is.Not.Null);
|
||||
Assert.That(foo.GetType(), Is.EqualTo(typeof(Alpha)));
|
||||
}
|
||||
|
||||
[Test, ExpectedException(typeof(InvalidCastException))]
|
||||
public void StronglyTypedNewShouldThrowCastExceptionIfNull() {
|
||||
_manager.New<Beta>("alpha");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AlphaIsFlavoredAndStyledAndBetaIsFlavoredOnly() {
|
||||
var alpha = _manager.New<Alpha>("alpha");
|
||||
var beta = _manager.New<Beta>("beta");
|
||||
|
||||
Assert.That(alpha.Is<Flavored>(), Is.True);
|
||||
Assert.That(alpha.Is<Styled>(), Is.True);
|
||||
Assert.That(beta.Is<Flavored>(), Is.True);
|
||||
Assert.That(beta.Is<Styled>(), Is.False);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetByIdShouldDetermineTypeAndLoadParts() {
|
||||
var modelRecord = CreateModelRecord("alpha");
|
||||
|
||||
var contentItem = _manager.Get(modelRecord.Id);
|
||||
Assert.That(contentItem.ContentType, Is.EqualTo("alpha"));
|
||||
Assert.That(contentItem.Id, Is.EqualTo(modelRecord.Id));
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void ModelPartWithRecordShouldCallRepositoryToPopulate() {
|
||||
|
||||
CreateModelRecord("gamma");
|
||||
CreateModelRecord("gamma");
|
||||
var modelRecord = CreateModelRecord("gamma");
|
||||
|
||||
var model = _manager.Get(modelRecord.Id);
|
||||
|
||||
// create a gamma record
|
||||
var gamma = new GammaRecord {
|
||||
ContentItemRecord = _container.Resolve<IRepository<ContentItemRecord>>().Get(model.Id),
|
||||
Frap = "foo"
|
||||
};
|
||||
|
||||
_container.Resolve<IRepository<GammaRecord>>().Create(gamma);
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
|
||||
// re-fetch from database
|
||||
model = _manager.Get(modelRecord.Id);
|
||||
|
||||
Assert.That(model.ContentType, Is.EqualTo("gamma"));
|
||||
Assert.That(model.Id, Is.EqualTo(modelRecord.Id));
|
||||
Assert.That(model.Is<Gamma>(), Is.True);
|
||||
Assert.That(model.As<Gamma>().Record, Is.Not.Null);
|
||||
Assert.That(model.As<Gamma>().Record.ContentItemRecord.Id, Is.EqualTo(model.Id));
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CreateShouldMakeModelAndContentTypeRecords() {
|
||||
var beta = _manager.New("beta");
|
||||
_manager.Create(beta);
|
||||
|
||||
var modelRecord = _container.Resolve<IRepository<ContentItemRecord>>().Get(beta.Id);
|
||||
Assert.That(modelRecord, Is.Not.Null);
|
||||
Assert.That(modelRecord.ContentType.Name, Is.EqualTo("beta"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetContentTypesShouldReturnAllTypes() {
|
||||
var types = _manager.GetContentTypes();
|
||||
Assert.That(types.Count(), Is.EqualTo(4));
|
||||
Assert.That(types, Has.Some.With.Property("Name").EqualTo("alpha"));
|
||||
Assert.That(types, Has.Some.With.Property("Name").EqualTo("beta"));
|
||||
Assert.That(types, Has.Some.With.Property("Name").EqualTo("gamma"));
|
||||
Assert.That(types, Has.Some.With.Property("Name").EqualTo("delta"));
|
||||
}
|
||||
|
||||
private ContentItemRecord CreateModelRecord(string contentType) {
|
||||
var contentTypeRepository = _container.Resolve<IRepository<ContentTypeRecord>>();
|
||||
var contentItemRepository = _container.Resolve<IRepository<ContentItemRecord>>();
|
||||
var contentItemVersionRepository = _container.Resolve<IRepository<ContentItemVersionRecord>>();
|
||||
|
||||
var modelRecord = new ContentItemRecord { ContentType = contentTypeRepository.Get(x => x.Name == contentType) };
|
||||
if (modelRecord.ContentType == null) {
|
||||
modelRecord.ContentType = new ContentTypeRecord { Name = contentType };
|
||||
contentTypeRepository.Create(modelRecord.ContentType);
|
||||
}
|
||||
contentItemRepository.Create(modelRecord);
|
||||
|
||||
contentItemVersionRepository.Create(new ContentItemVersionRecord { ContentItemRecord = modelRecord, Latest = true, Published = true, Number = 1 });
|
||||
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
return modelRecord;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InitialVersionShouldBeOne() {
|
||||
var gamma1 = _manager.Create<Gamma>("gamma");
|
||||
Assert.That(gamma1.ContentItem.Record, Is.Not.Null);
|
||||
Assert.That(gamma1.ContentItem.VersionRecord, Is.Not.Null);
|
||||
Assert.That(gamma1.ContentItem.Version, Is.EqualTo(1));
|
||||
Assert.That(gamma1.ContentItem.VersionRecord.Number, Is.EqualTo(1));
|
||||
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
Trace.WriteLine("session flushed");
|
||||
|
||||
var gamma2 = _manager.Get<Gamma>(gamma1.ContentItem.Id);
|
||||
Assert.That(gamma2.ContentItem.Record, Is.Not.Null);
|
||||
Assert.That(gamma2.ContentItem.VersionRecord, Is.Not.Null);
|
||||
Assert.That(gamma2.ContentItem.Version, Is.EqualTo(1));
|
||||
Assert.That(gamma2.ContentItem.VersionRecord.Number, Is.EqualTo(1));
|
||||
|
||||
// asserts results are re-acquired from db
|
||||
Assert.That(gamma1, Is.Not.SameAs(gamma2));
|
||||
Assert.That(gamma1.Record, Is.Not.SameAs(gamma2.Record));
|
||||
Assert.That(gamma1.ContentItem, Is.Not.SameAs(gamma2.ContentItem));
|
||||
Assert.That(gamma1.ContentItem.Record, Is.Not.SameAs(gamma2.ContentItem.Record));
|
||||
Assert.That(gamma1.ContentItem.VersionRecord, Is.Not.SameAs(gamma2.ContentItem.VersionRecord));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InitialVersionCanBeSpecifiedAndIsPublished() {
|
||||
var gamma1 = _manager.Create<Gamma>("gamma", VersionOptions.Number(4));
|
||||
|
||||
Assert.That(gamma1.ContentItem.Version, Is.EqualTo(4));
|
||||
Assert.That(gamma1.ContentItem.VersionRecord.Published, Is.True);
|
||||
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PublishedShouldBeLatestButNotDraft() {
|
||||
var gamma1 = _manager.Create("gamma", VersionOptions.Published);
|
||||
|
||||
var gammaPublished = _manager.Get(gamma1.Id, VersionOptions.Published);
|
||||
var gammaLatest = _manager.Get(gamma1.Id, VersionOptions.Latest);
|
||||
var gammaDraft = _manager.Get(gamma1.Id, VersionOptions.Draft);
|
||||
|
||||
Assert.That(gammaPublished.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id));
|
||||
Assert.That(gammaLatest.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id));
|
||||
Assert.That(gammaDraft, Is.Null);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DraftShouldBeLatestButNotPublished() {
|
||||
var gamma1 = _manager.Create("gamma", VersionOptions.Draft);
|
||||
|
||||
var gammaPublished = _manager.Get(gamma1.Id, VersionOptions.Published);
|
||||
var gammaLatest = _manager.Get(gamma1.Id, VersionOptions.Latest);
|
||||
var gammaDraft = _manager.Get(gamma1.Id, VersionOptions.Draft);
|
||||
|
||||
Assert.That(gammaDraft.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id));
|
||||
Assert.That(gammaLatest.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id));
|
||||
Assert.That(gammaPublished, Is.Null);
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void CreateDraftShouldNotCreateExtraDraftCopies() {
|
||||
var gamma1 = _manager.Create("gamma", VersionOptions.Draft);
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
|
||||
var gammaDraft1 = _manager.Get(gamma1.Id, VersionOptions.Draft);
|
||||
Assert.That(gammaDraft1.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id));
|
||||
Assert.That(gammaDraft1.Record.Versions, Has.Count.EqualTo(1));
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
|
||||
var gammaDraft2 = _manager.Get(gamma1.Id, VersionOptions.DraftRequired);
|
||||
Assert.That(gammaDraft2.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id));
|
||||
Assert.That(gammaDraft2.Record.Versions, Has.Count.EqualTo(1));
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
|
||||
var gammaDraft3 = _manager.Get(gamma1.Id, VersionOptions.Draft);
|
||||
Assert.That(gammaDraft3.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id));
|
||||
Assert.That(gammaDraft3.Record.Versions, Has.Count.EqualTo(1));
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
|
||||
var gammaDraft4 = _manager.Get(gamma1.Id, VersionOptions.DraftRequired);
|
||||
Assert.That(gammaDraft4.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id));
|
||||
Assert.That(gammaDraft4.Record.Versions, Has.Count.EqualTo(1));
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DraftRequiredShouldBuildNewVersionIfLatestIsAlreadyPublished() {
|
||||
Trace.WriteLine("gamma1");
|
||||
var gamma1 = _manager.Create("gamma", VersionOptions.Published);
|
||||
Trace.WriteLine("flush");
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
|
||||
Trace.WriteLine("gammaDraft1");
|
||||
var gammaDraft1 = _manager.Get(gamma1.Id, VersionOptions.Draft);
|
||||
Assert.That(gammaDraft1, Is.Null);
|
||||
Trace.WriteLine("flush");
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
|
||||
Trace.WriteLine("gammaDraft2");
|
||||
var gammaDraft2 = _manager.Get(gamma1.Id, VersionOptions.DraftRequired);
|
||||
Assert.That(gammaDraft2.VersionRecord.Id, Is.Not.EqualTo(gamma1.VersionRecord.Id));
|
||||
Assert.That(gamma1.Version, Is.EqualTo(1));
|
||||
Assert.That(gammaDraft2.Version, Is.EqualTo(2));
|
||||
Trace.WriteLine("flush");
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
|
||||
foreach (var x in _container.Resolve<IRepository<ContentItemVersionRecord>>().Fetch(x => true)) {
|
||||
Trace.WriteLine(string.Format("{0}/{1} #{2} published:{3} latest:{4}",
|
||||
x.ContentItemRecord.Id,
|
||||
x.Id,
|
||||
x.Number,
|
||||
x.Published,
|
||||
x.Latest));
|
||||
}
|
||||
|
||||
Trace.WriteLine("gammaDraft3");
|
||||
var gammaDraft3 = _manager.Get(gamma1.Id, VersionOptions.Draft);
|
||||
Assert.That(gammaDraft3.VersionRecord.Id, Is.EqualTo(gammaDraft2.VersionRecord.Id));
|
||||
Assert.That(gammaDraft3.Record, Is.Not.SameAs(gammaDraft2.Record));
|
||||
Assert.That(gammaDraft3.Record.Versions, Is.Not.SameAs(gammaDraft2.Record.Versions));
|
||||
|
||||
Assert.That(gammaDraft3.Record.Versions, Has.Count.EqualTo(2));
|
||||
Trace.WriteLine("flush");
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
|
||||
Trace.WriteLine("gammaDraft4");
|
||||
var gammaDraft4 = _manager.Get(gamma1.Id, VersionOptions.DraftRequired);
|
||||
Assert.That(gammaDraft4.VersionRecord.Id, Is.EqualTo(gammaDraft2.VersionRecord.Id));
|
||||
Assert.That(gammaDraft4.Record.Versions, Has.Count.EqualTo(2));
|
||||
Trace.WriteLine("flush");
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
|
||||
Trace.WriteLine("gamma2");
|
||||
var gamma2 = _manager.Get(gamma1.Id);
|
||||
Assert.That(gamma2.Record.Versions, Has.Count.EqualTo(2));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void NonVersionedPartsAreBoundToSameRecord() {
|
||||
Trace.WriteLine("gamma1");
|
||||
var gamma1 = _manager.Create<Gamma>("gamma", VersionOptions.Published, init => init.Record.Frap = "version one");
|
||||
Trace.WriteLine("gamma2");
|
||||
var gamma2 = _manager.Get<Gamma>(gamma1.ContentItem.Id, VersionOptions.DraftRequired);
|
||||
Assert.That(gamma1.Record.Frap, Is.EqualTo("version one"));
|
||||
Assert.That(gamma2.Record.Frap, Is.EqualTo("version one"));
|
||||
gamma2.Record.Frap = "version two";
|
||||
Assert.That(gamma1.Record.Frap, Is.EqualTo("version two"));
|
||||
Assert.That(gamma2.Record.Frap, Is.EqualTo("version two"));
|
||||
|
||||
Trace.WriteLine("flush");
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
|
||||
Trace.WriteLine("gamma1B");
|
||||
var gamma1B = _manager.Get<Gamma>(gamma1.ContentItem.Id, VersionOptions.Published);
|
||||
Trace.WriteLine("gamma2B");
|
||||
var gamma2B = _manager.Get<Gamma>(gamma1.ContentItem.Id, VersionOptions.Draft);
|
||||
Assert.That(gamma1B.Record, Is.SameAs(gamma2B.Record));
|
||||
Assert.That(gamma1B.Record.Frap, Is.EqualTo("version two"));
|
||||
Assert.That(gamma2B.Record.Frap, Is.EqualTo("version two"));
|
||||
Assert.That(gamma1B.ContentItem.VersionRecord.Id, Is.Not.EqualTo(gamma2B.ContentItem.VersionRecord.Id));
|
||||
|
||||
Assert.That(gamma1.ContentItem.Record, Is.Not.SameAs(gamma1B.ContentItem.Record));
|
||||
Assert.That(gamma2.ContentItem.Record, Is.Not.SameAs(gamma2B.ContentItem.Record));
|
||||
Assert.That(gamma1.ContentItem.Record, Is.SameAs(gamma2.ContentItem.Record));
|
||||
Assert.That(gamma1B.ContentItem.Record, Is.SameAs(gamma2B.ContentItem.Record));
|
||||
Assert.That(gamma1.ContentItem.VersionRecord, Is.Not.SameAs(gamma2.ContentItem.VersionRecord));
|
||||
Assert.That(gamma1B.ContentItem.VersionRecord, Is.Not.SameAs(gamma2B.ContentItem.VersionRecord));
|
||||
|
||||
Trace.WriteLine("flush");
|
||||
_session.Flush();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void VersionedPartsShouldBeDifferentRecordsWithClonedData() {
|
||||
var gamma1 = _manager.Create<Gamma>("gamma", VersionOptions.Published, init => init.Record.Frap = "version one");
|
||||
var epsilon1 = gamma1.As<Epsilon>();
|
||||
epsilon1.Record.Quad = "epsilon one";
|
||||
|
||||
var gamma2 = _manager.Get<Gamma>(gamma1.ContentItem.Id, VersionOptions.DraftRequired);
|
||||
var epsilon2 = gamma2.As<Epsilon>();
|
||||
|
||||
Assert.That(epsilon1.Record.Quad, Is.EqualTo("epsilon one"));
|
||||
Assert.That(epsilon2.Record.Quad, Is.EqualTo("epsilon one"));
|
||||
epsilon2.Record.Quad = "epsilon two";
|
||||
Assert.That(epsilon1.Record.Quad, Is.EqualTo("epsilon one"));
|
||||
Assert.That(epsilon2.Record.Quad, Is.EqualTo("epsilon two"));
|
||||
|
||||
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
|
||||
var gamma1B = _manager.Get<Gamma>(gamma1.ContentItem.Id, VersionOptions.Published);
|
||||
var epsilon1B = gamma1B.As<Epsilon>();
|
||||
var gamma2B = _manager.Get<Gamma>(gamma1.ContentItem.Id, VersionOptions.Draft);
|
||||
var epsilon2B = gamma2B.As<Epsilon>();
|
||||
Assert.That(gamma1B.Record, Is.SameAs(gamma2B.Record));
|
||||
Assert.That(epsilon1B.Record, Is.Not.SameAs(epsilon2B.Record));
|
||||
Assert.That(epsilon1B.Record.Quad, Is.EqualTo("epsilon one"));
|
||||
Assert.That(epsilon2B.Record.Quad, Is.EqualTo("epsilon two"));
|
||||
Assert.That(epsilon1B.ContentItem.VersionRecord.Id, Is.Not.EqualTo(epsilon2B.ContentItem.VersionRecord.Id));
|
||||
|
||||
Assert.That(epsilon1.ContentItem.Record, Is.Not.SameAs(epsilon1B.ContentItem.Record));
|
||||
Assert.That(epsilon2.ContentItem.Record, Is.Not.SameAs(epsilon2B.ContentItem.Record));
|
||||
Assert.That(epsilon1.ContentItem.Record, Is.SameAs(epsilon2.ContentItem.Record));
|
||||
Assert.That(epsilon1B.ContentItem.Record, Is.SameAs(epsilon2B.ContentItem.Record));
|
||||
Assert.That(epsilon1.ContentItem.VersionRecord, Is.Not.SameAs(epsilon2.ContentItem.VersionRecord));
|
||||
Assert.That(epsilon1B.ContentItem.VersionRecord, Is.Not.SameAs(epsilon2B.ContentItem.VersionRecord));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,176 +0,0 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Autofac;
|
||||
using Autofac.Builder;
|
||||
using Autofac.Modules;
|
||||
using NHibernate;
|
||||
using NUnit.Framework;
|
||||
using Orchard.Data;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.ContentManagement.Records;
|
||||
using Orchard.Tests.Models.Records;
|
||||
using Orchard.Tests.Models.Stubs;
|
||||
|
||||
namespace Orchard.Tests.Models {
|
||||
[TestFixture]
|
||||
public class DefaultModelManagerTests {
|
||||
private IContainer _container;
|
||||
private IContentManager _manager;
|
||||
private ISessionFactory _sessionFactory;
|
||||
private ISession _session;
|
||||
|
||||
[TestFixtureSetUp]
|
||||
public void InitFixture() {
|
||||
var databaseFileName = System.IO.Path.GetTempFileName();
|
||||
_sessionFactory = DataUtility.CreateSessionFactory(
|
||||
databaseFileName,
|
||||
typeof(GammaRecord),
|
||||
typeof(ContentItemRecord),
|
||||
typeof(ContentTypeRecord));
|
||||
}
|
||||
|
||||
[TestFixtureTearDown]
|
||||
public void TermFixture() {
|
||||
|
||||
}
|
||||
|
||||
[SetUp]
|
||||
public void Init() {
|
||||
var builder = new ContainerBuilder();
|
||||
builder.RegisterModule(new ImplicitCollectionSupportModule());
|
||||
builder.Register<DefaultContentManager>().As<IContentManager>();
|
||||
builder.Register<AlphaHandler>().As<IContentHandler>();
|
||||
builder.Register<BetaHandler>().As<IContentHandler>();
|
||||
builder.Register<GammaHandler>().As<IContentHandler>();
|
||||
builder.Register<FlavoredHandler>().As<IContentHandler>();
|
||||
builder.Register<StyledHandler>().As<IContentHandler>();
|
||||
|
||||
builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>));
|
||||
|
||||
_session = _sessionFactory.OpenSession();
|
||||
builder.Register(new TestSessionLocator(_session)).As<ISessionLocator>();
|
||||
|
||||
_container = builder.Build();
|
||||
_manager = _container.Resolve<IContentManager>();
|
||||
}
|
||||
|
||||
public class TestSessionLocator : ISessionLocator {
|
||||
private readonly ISession _session;
|
||||
|
||||
public TestSessionLocator(ISession session) {
|
||||
_session = session;
|
||||
}
|
||||
|
||||
public ISession For(Type entityType) {
|
||||
return _session;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AlphaDriverShouldWeldItsPart() {
|
||||
var foo = _manager.New("alpha");
|
||||
|
||||
Assert.That(foo.Is<Alpha>(), Is.True);
|
||||
Assert.That(foo.As<Alpha>(), Is.Not.Null);
|
||||
Assert.That(foo.Is<Beta>(), Is.False);
|
||||
Assert.That(foo.As<Beta>(), Is.Null);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void StronglyTypedNewShouldTypeCast() {
|
||||
var foo = _manager.New<Alpha>("alpha");
|
||||
Assert.That(foo, Is.Not.Null);
|
||||
Assert.That(foo.GetType(), Is.EqualTo(typeof(Alpha)));
|
||||
}
|
||||
|
||||
[Test, ExpectedException(typeof(InvalidCastException))]
|
||||
public void StronglyTypedNewShouldThrowCastExceptionIfNull() {
|
||||
_manager.New<Beta>("alpha");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AlphaIsFlavoredAndStyledAndBetaIsFlavoredOnly() {
|
||||
var alpha = _manager.New<Alpha>("alpha");
|
||||
var beta = _manager.New<Beta>("beta");
|
||||
|
||||
Assert.That(alpha.Is<Flavored>(), Is.True);
|
||||
Assert.That(alpha.Is<Styled>(), Is.True);
|
||||
Assert.That(beta.Is<Flavored>(), Is.True);
|
||||
Assert.That(beta.Is<Styled>(), Is.False);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetByIdShouldDetermineTypeAndLoadParts() {
|
||||
var modelRecord = CreateModelRecord("alpha");
|
||||
|
||||
var contentItem = _manager.Get(modelRecord.Id);
|
||||
Assert.That(contentItem.ContentType, Is.EqualTo("alpha"));
|
||||
Assert.That(contentItem.Id, Is.EqualTo(modelRecord.Id));
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void ModelPartWithRecordShouldCallRepositoryToPopulate() {
|
||||
|
||||
CreateModelRecord("gamma");
|
||||
CreateModelRecord("gamma");
|
||||
var modelRecord = CreateModelRecord("gamma");
|
||||
|
||||
var model = _manager.Get(modelRecord.Id);
|
||||
|
||||
// create a gamma record
|
||||
var gamma = new GammaRecord {
|
||||
ContentItemRecord = _container.Resolve<IRepository<ContentItemRecord>>().Get(model.Id),
|
||||
Frap = "foo"
|
||||
};
|
||||
|
||||
_container.Resolve<IRepository<GammaRecord>>().Create(gamma);
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
|
||||
// re-fetch from database
|
||||
model = _manager.Get(modelRecord.Id);
|
||||
|
||||
Assert.That(model.ContentType, Is.EqualTo("gamma"));
|
||||
Assert.That(model.Id, Is.EqualTo(modelRecord.Id));
|
||||
Assert.That(model.Is<Gamma>(), Is.True);
|
||||
Assert.That(model.As<Gamma>().Record, Is.Not.Null);
|
||||
Assert.That(model.As<Gamma>().Record.ContentItemRecord.Id, Is.EqualTo(model.Id));
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CreateShouldMakeModelAndContentTypeRecords() {
|
||||
var beta = _manager.New("beta");
|
||||
_manager.Create(beta);
|
||||
|
||||
var modelRecord = _container.Resolve<IRepository<ContentItemRecord>>().Get(beta.Id);
|
||||
Assert.That(modelRecord, Is.Not.Null);
|
||||
Assert.That(modelRecord.ContentType.Name, Is.EqualTo("beta"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetContentTypesShouldReturnAllTypes() {
|
||||
var types = _manager.GetContentTypes();
|
||||
Assert.That(types.Count(), Is.EqualTo(3));
|
||||
Assert.That(types, Has.Some.With.Property("Name").EqualTo("alpha"));
|
||||
Assert.That(types, Has.Some.With.Property("Name").EqualTo("beta"));
|
||||
Assert.That(types, Has.Some.With.Property("Name").EqualTo("gamma"));
|
||||
}
|
||||
|
||||
private ContentItemRecord CreateModelRecord(string contentType) {
|
||||
var contentItemRepository = _container.Resolve<IRepository<ContentItemRecord>>();
|
||||
var contentTypeRepository = _container.Resolve<IRepository<ContentTypeRecord>>();
|
||||
|
||||
var modelRecord = new ContentItemRecord { ContentType = new ContentTypeRecord { Name = contentType } };
|
||||
contentTypeRepository.Create(modelRecord.ContentType);
|
||||
contentItemRepository.Create(modelRecord);
|
||||
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
return modelRecord;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
7
src/Orchard.Tests/Models/Records/EpsilonRecord.cs
Normal file
7
src/Orchard.Tests/Models/Records/EpsilonRecord.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
using Orchard.ContentManagement.Records;
|
||||
|
||||
namespace Orchard.Tests.Models.Stubs {
|
||||
public class EpsilonRecord : ContentPartVersionRecord {
|
||||
public virtual string Quad { get; set; }
|
||||
}
|
||||
}
|
23
src/Orchard.Tests/Models/Stubs/Epsilon.cs
Normal file
23
src/Orchard.Tests/Models/Stubs/Epsilon.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Data;
|
||||
using Orchard.Tests.Models.Records;
|
||||
|
||||
namespace Orchard.Tests.Models.Stubs {
|
||||
|
||||
|
||||
public class Epsilon : ContentPart<EpsilonRecord> {
|
||||
}
|
||||
|
||||
public class EpsilonHandler : ContentHandler {
|
||||
|
||||
public EpsilonHandler(IRepository<EpsilonRecord> repository) {
|
||||
Filters.Add(new ActivatingFilter<Epsilon>(x => x == "gamma"));
|
||||
Filters.Add(new StorageVersionFilter<EpsilonRecord>(repository));
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,7 +1,4 @@
|
||||
using System.Linq;
|
||||
using FluentNHibernate.Automapping;
|
||||
using FluentNHibernate.Automapping.Alterations;
|
||||
using Orchard.Data;
|
||||
using Orchard.Data;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Tests.Models.Records;
|
||||
@@ -12,7 +9,7 @@ namespace Orchard.Tests.Models.Stubs {
|
||||
|
||||
|
||||
public class GammaHandler : ContentHandler {
|
||||
public override System.Collections.Generic.IEnumerable<Orchard.ContentManagement.ContentType> GetContentTypes() {
|
||||
public override System.Collections.Generic.IEnumerable<ContentType> GetContentTypes() {
|
||||
return new[] { new ContentType { Name = "gamma" } };
|
||||
}
|
||||
|
||||
@@ -23,30 +20,4 @@ namespace Orchard.Tests.Models.Stubs {
|
||||
}
|
||||
|
||||
|
||||
//public class ContentItemRecordAlteration : IAutoMappingAlteration {
|
||||
// public void Alter(AutoPersistenceModel model) {
|
||||
// model.OverrideAll(mapping => {
|
||||
// var genericArguments = mapping.GetType().GetGenericArguments();
|
||||
// if (!genericArguments.Single().IsSubclassOf(typeof (ContentPartRecord))) {
|
||||
// return;
|
||||
// }
|
||||
// });
|
||||
|
||||
// model.Override<ContentItemRecord>(mapping => mapping.HasOne(record => (GammaRecord)record["GammaRecord"]).Access.NoOp().Fetch.Select());
|
||||
|
||||
|
||||
// }
|
||||
|
||||
// interface IAlteration {
|
||||
// void Override(object mapping);
|
||||
// }
|
||||
|
||||
// class Alteration<T> : IAlteration where T : ContentPartRecord {
|
||||
// public void Override(object mappingObj) {
|
||||
// var mapping = (AutoMapping<T>)mappingObj;
|
||||
// mapping.Id(x => x.Id).GeneratedBy.Foreign("ContentItem");
|
||||
// mapping.HasOne(x => x.ContentItem).Constrained();
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
@@ -117,7 +117,7 @@
|
||||
<Compile Include="Localization\NullLocalizerTests.cs" />
|
||||
<Compile Include="Logging\LoggingModuleTests.cs" />
|
||||
<Compile Include="Models\ContentQueryTests.cs" />
|
||||
<Compile Include="Models\DefaultModelManagerTests.cs" />
|
||||
<Compile Include="Models\DefaultContentManagerTests.cs" />
|
||||
<Compile Include="Models\Drivers\ModelBuilderTests.cs" />
|
||||
<Compile Include="Models\Drivers\ModelDriverTests.cs" />
|
||||
<Compile Include="Models\PartDriverHandlerTests.cs" />
|
||||
@@ -127,6 +127,8 @@
|
||||
<Compile Include="Models\Stubs\BetaHandler.cs" />
|
||||
<Compile Include="Models\Stubs\Delta.cs" />
|
||||
<Compile Include="Models\Records\DeltaRecord.cs" />
|
||||
<Compile Include="Models\Stubs\Epsilon.cs" />
|
||||
<Compile Include="Models\Records\EpsilonRecord.cs" />
|
||||
<Compile Include="Models\Stubs\Flavored.cs" />
|
||||
<Compile Include="Models\Stubs\FlavoredHandler.cs" />
|
||||
<Compile Include="Models\Stubs\Gamma.cs" />
|
||||
|
@@ -5,7 +5,6 @@ using Orchard.Localization;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Settings;
|
||||
using Orchard.UI.Notify;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
|
||||
namespace Orchard.Core.Settings.Controllers {
|
||||
[ValidateInput(false)]
|
||||
@@ -25,17 +24,18 @@ namespace Orchard.Core.Settings.Controllers {
|
||||
|
||||
public ActionResult Index(string tabName) {
|
||||
var model = new Orchard.Core.Settings.ViewModels.SettingsIndexViewModel {
|
||||
Site = _siteService.GetSiteSettings().As<SiteSettings>() };
|
||||
Site = _siteService.GetSiteSettings().As<SiteSettings>()
|
||||
};
|
||||
model.EditorModel = _modelManager.BuildEditorModel(model.Site);
|
||||
return View(model);
|
||||
}
|
||||
|
||||
[AcceptVerbs(HttpVerbs.Post)]
|
||||
public ActionResult Index(string tabName, FormCollection input) {
|
||||
[HttpPost, ActionName("Index")]
|
||||
public ActionResult IndexPOST(string tabName) {
|
||||
var viewModel = new SettingsIndexViewModel { Site = _siteService.GetSiteSettings().As<SiteSettings>() };
|
||||
viewModel.EditorModel = _modelManager.UpdateEditorModel(viewModel.Site.ContentItem, this);
|
||||
|
||||
if (!TryUpdateModel(viewModel, input.ToValueProvider())) {
|
||||
if (!TryUpdateModel(viewModel)) {
|
||||
return View(viewModel);
|
||||
}
|
||||
|
||||
|
@@ -1,8 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Routing;
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.Blogs.Models;
|
||||
using Orchard.ContentManagement;
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{4A9C04A6-0986-4A92-A610-5F59FF273FB9}</ProjectGuid>
|
||||
<ProjectTypeGuids>{F85E285D-A4E0-4152-9332-AB1D724D3325};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Orchard.Pages</RootNamespace>
|
||||
|
@@ -6,10 +6,9 @@ using Orchard.ContentManagement.Records;
|
||||
using Orchard.ContentManagement.ViewModels;
|
||||
|
||||
namespace Orchard.ContentManagement {
|
||||
public static class ContentCreateExtensions {
|
||||
|
||||
public static class ContentExtensions {
|
||||
|
||||
/* Item creation and accessing extension methods */
|
||||
/* Item creation extension methods */
|
||||
|
||||
public static T New<T>(this IContentManager manager, string contentType) where T : class, IContent {
|
||||
var contentItem = manager.New(contentType);
|
||||
@@ -23,6 +22,11 @@ namespace Orchard.ContentManagement {
|
||||
return part;
|
||||
}
|
||||
|
||||
|
||||
public static ContentItem Create(this IContentManager manager, string contentType) {
|
||||
return manager.Create<ContentItem>(contentType, init => { });
|
||||
}
|
||||
|
||||
public static T Create<T>(this IContentManager manager, string contentType) where T : class, IContent {
|
||||
return manager.Create<T>(contentType, init => { });
|
||||
}
|
||||
@@ -37,11 +41,39 @@ namespace Orchard.ContentManagement {
|
||||
return content;
|
||||
}
|
||||
|
||||
public static ContentItem Create(this IContentManager manager, string contentType, VersionOptions options) {
|
||||
return manager.Create<ContentItem>(contentType, options, init => { });
|
||||
}
|
||||
|
||||
public static T Create<T>(this IContentManager manager, string contentType, VersionOptions options) where T : class, IContent {
|
||||
return manager.Create<T>(contentType, options, init => { });
|
||||
}
|
||||
|
||||
public static T Create<T>(this IContentManager manager, string contentType, VersionOptions options, Action<T> initialize) where T : class, IContent {
|
||||
var content = manager.New<T>(contentType);
|
||||
if (content == null)
|
||||
return null;
|
||||
|
||||
initialize(content);
|
||||
manager.Create(content.ContentItem, options);
|
||||
return content;
|
||||
}
|
||||
}
|
||||
|
||||
public static class ContentExtensions {
|
||||
|
||||
|
||||
|
||||
public static T Get<T>(this IContentManager manager, int id) where T : class, IContent {
|
||||
var contentItem = manager.Get(id);
|
||||
return contentItem == null ? null : contentItem.Get<T>();
|
||||
}
|
||||
|
||||
public static T Get<T>(this IContentManager manager, int id, VersionOptions options) where T : class, IContent {
|
||||
var contentItem = manager.Get(id, options);
|
||||
return contentItem == null ? null : contentItem.Get<T>();
|
||||
}
|
||||
|
||||
|
||||
/* Display and editor convenience extension methods */
|
||||
|
||||
|
@@ -13,16 +13,19 @@ namespace Orchard.ContentManagement {
|
||||
private readonly IList<ContentPart> _parts;
|
||||
ContentItem IContent.ContentItem { get { return this; } }
|
||||
|
||||
public int Id { get; set; }
|
||||
public int Id { get { return Record == null ? 0 : Record.Id; } }
|
||||
public int Version { get { return VersionRecord == null ? 0 : VersionRecord.Number; } }
|
||||
|
||||
public string ContentType { get; set; }
|
||||
public ContentItemRecord Record { get; set; }
|
||||
public ContentItemRecord Record { get { return VersionRecord == null ? null : VersionRecord.ContentItemRecord; } }
|
||||
public ContentItemVersionRecord VersionRecord { get; set; }
|
||||
|
||||
public IEnumerable<ContentPart> Parts { get { return _parts; } }
|
||||
|
||||
public IContentManager ContentManager { get; set; }
|
||||
|
||||
public bool Has(Type partType) {
|
||||
return partType==typeof(ContentItem) || _parts.Any(part => partType.IsAssignableFrom(part.GetType()));
|
||||
return partType == typeof(ContentItem) || _parts.Any(part => partType.IsAssignableFrom(part.GetType()));
|
||||
}
|
||||
|
||||
public IContent Get(Type partType) {
|
||||
|
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using Autofac;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
@@ -11,16 +12,19 @@ using Orchard.UI.Navigation;
|
||||
namespace Orchard.ContentManagement {
|
||||
public class DefaultContentManager : IContentManager {
|
||||
private readonly IContext _context;
|
||||
private readonly IRepository<ContentItemRecord> _contentItemRepository;
|
||||
private readonly IRepository<ContentTypeRecord> _contentTypeRepository;
|
||||
private readonly IRepository<ContentItemRecord> _contentItemRepository;
|
||||
private readonly IRepository<ContentItemVersionRecord> _contentItemVersionRepository;
|
||||
|
||||
public DefaultContentManager(
|
||||
IContext context,
|
||||
IRepository<ContentTypeRecord> contentTypeRepository,
|
||||
IRepository<ContentItemRecord> contentItemRepository,
|
||||
IRepository<ContentTypeRecord> contentTypeRepository) {
|
||||
IRepository<ContentItemVersionRecord> contentItemVersionRepository) {
|
||||
_context = context;
|
||||
_contentItemRepository = contentItemRepository;
|
||||
_contentTypeRepository = contentTypeRepository;
|
||||
_contentItemRepository = contentItemRepository;
|
||||
_contentItemVersionRepository = contentItemVersionRepository;
|
||||
}
|
||||
|
||||
private IEnumerable<IContentHandler> _handlers;
|
||||
@@ -67,24 +71,66 @@ namespace Orchard.ContentManagement {
|
||||
}
|
||||
|
||||
public virtual ContentItem Get(int id) {
|
||||
// obtain root record to determine the model type
|
||||
var record = _contentItemRepository.Get(id);
|
||||
return Get(id, VersionOptions.Published);
|
||||
}
|
||||
|
||||
// no record of that id means content item doesn't exist
|
||||
if (record == null)
|
||||
public virtual ContentItem Get(int id, VersionOptions options) {
|
||||
ContentItemVersionRecord versionRecord = null;
|
||||
var appendLatestVersion = false;
|
||||
|
||||
// obtain the root records based on version options
|
||||
if (options.VersionRecordId != 0) {
|
||||
// explicit version record known
|
||||
versionRecord = _contentItemVersionRepository.Get(options.VersionRecordId);
|
||||
}
|
||||
else {
|
||||
var record = _contentItemRepository.Get(id);
|
||||
if (options.IsPublished) {
|
||||
versionRecord = _contentItemVersionRepository.Get(x => x.ContentItemRecord == record && x.Published);
|
||||
}
|
||||
else if (options.IsLatest) {
|
||||
versionRecord = _contentItemVersionRepository.Get(x => x.ContentItemRecord == record && x.Latest);
|
||||
}
|
||||
else if (options.IsDraft || options.IsDraftRequired) {
|
||||
versionRecord = _contentItemVersionRepository.Get(x => x.ContentItemRecord == record && x.Latest && !x.Published);
|
||||
if (versionRecord == null && options.IsDraftRequired) {
|
||||
versionRecord = _contentItemVersionRepository.Get(x => x.ContentItemRecord == record && x.Latest);
|
||||
appendLatestVersion = true;
|
||||
}
|
||||
}
|
||||
else if (options.VersionNumber != 0) {
|
||||
versionRecord = _contentItemVersionRepository.Get(x => x.ContentItemRecord == record && x.Number == options.VersionNumber);
|
||||
}
|
||||
|
||||
//TEMP: this is to transition people with old databases
|
||||
if (versionRecord == null && !record.Versions.Any() && options.IsPublished) {
|
||||
versionRecord = new ContentItemVersionRecord {
|
||||
ContentItemRecord = record,
|
||||
Latest = true,
|
||||
Published = true,
|
||||
Number = 1
|
||||
};
|
||||
record.Versions.Add(versionRecord);
|
||||
_contentItemVersionRepository.Create(versionRecord);
|
||||
}
|
||||
}
|
||||
|
||||
// no record means content item doesn't exist
|
||||
if (versionRecord == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// allocate instance and set record property
|
||||
var contentItem = New(record.ContentType.Name);
|
||||
contentItem.Id = record.Id;
|
||||
contentItem.Record = record;
|
||||
var contentItem = New(versionRecord.ContentItemRecord.ContentType.Name);
|
||||
contentItem.VersionRecord = versionRecord;
|
||||
|
||||
// create a context with a new instance to load
|
||||
var context = new LoadContentContext {
|
||||
Id = contentItem.Id,
|
||||
ContentType = contentItem.ContentType,
|
||||
ContentItemRecord = record,
|
||||
ContentItem = contentItem,
|
||||
ContentItemRecord = contentItem.Record,
|
||||
ContentItemVersionRecord = contentItem.VersionRecord,
|
||||
};
|
||||
|
||||
// invoke handlers to acquire state, or at least establish lazy loading callbacks
|
||||
@@ -95,26 +141,100 @@ namespace Orchard.ContentManagement {
|
||||
handler.Loaded(context);
|
||||
}
|
||||
|
||||
// when draft is required and not currently available a new version is appended
|
||||
if (appendLatestVersion) {
|
||||
return AppendLatestVersion(context.ContentItem);
|
||||
}
|
||||
|
||||
return context.ContentItem;
|
||||
}
|
||||
|
||||
public void Create(ContentItem contentItem) {
|
||||
public virtual ContentItem AppendLatestVersion(ContentItem existingContentItem) {
|
||||
var contentItemRecord = existingContentItem.Record;
|
||||
|
||||
// locate the existing and the current latest versions, allocate building version
|
||||
var existingItemVersionRecord = existingContentItem.VersionRecord;
|
||||
var buildingItemVersionRecord = new ContentItemVersionRecord {
|
||||
ContentItemRecord = contentItemRecord,
|
||||
Latest = true,
|
||||
Published = false
|
||||
};
|
||||
|
||||
if (existingItemVersionRecord.Latest == false) {
|
||||
var latestVersion = _contentItemVersionRepository.Get(x => x.ContentItemRecord == contentItemRecord && x.Latest);
|
||||
latestVersion.Latest = false;
|
||||
buildingItemVersionRecord.Number = latestVersion.Number + 1;
|
||||
}
|
||||
else {
|
||||
existingItemVersionRecord.Latest = false;
|
||||
buildingItemVersionRecord.Number = existingItemVersionRecord.Number + 1;
|
||||
}
|
||||
|
||||
|
||||
_contentItemVersionRepository.Create(buildingItemVersionRecord);
|
||||
|
||||
var buildingContentItem = New(existingContentItem.ContentType);
|
||||
buildingContentItem.VersionRecord = buildingItemVersionRecord;
|
||||
|
||||
var context = new VersionContentContext {
|
||||
Id = existingContentItem.Id,
|
||||
ContentType = existingContentItem.ContentType,
|
||||
ContentItemRecord = contentItemRecord,
|
||||
ExistingContentItem = existingContentItem,
|
||||
BuildingContentItem = buildingContentItem,
|
||||
ExistingItemVersionRecord = existingItemVersionRecord,
|
||||
BuildingItemVersionRecord = buildingItemVersionRecord,
|
||||
};
|
||||
foreach (var handler in Handlers) {
|
||||
handler.Versioning(context);
|
||||
}
|
||||
foreach (var handler in Handlers) {
|
||||
handler.Versioned(context);
|
||||
}
|
||||
|
||||
return context.BuildingContentItem;
|
||||
}
|
||||
|
||||
public virtual void Create(ContentItem contentItem) {
|
||||
Create(contentItem, VersionOptions.Published);
|
||||
}
|
||||
|
||||
public virtual void Create(ContentItem contentItem, VersionOptions options) {
|
||||
// produce root record to determine the model id
|
||||
var modelRecord = new ContentItemRecord { ContentType = AcquireContentTypeRecord(contentItem.ContentType) };
|
||||
_contentItemRepository.Create(modelRecord);
|
||||
contentItem.Record = modelRecord;
|
||||
contentItem.VersionRecord = new ContentItemVersionRecord {
|
||||
ContentItemRecord = new ContentItemRecord {
|
||||
ContentType = AcquireContentTypeRecord(contentItem.ContentType)
|
||||
},
|
||||
Number = 1,
|
||||
Latest = true,
|
||||
Published = true
|
||||
};
|
||||
// add to the collection manually for the created case
|
||||
contentItem.VersionRecord.ContentItemRecord.Versions.Add(contentItem.VersionRecord);
|
||||
|
||||
// version may be specified
|
||||
if (options.VersionNumber != 0) {
|
||||
contentItem.VersionRecord.Number = options.VersionNumber;
|
||||
}
|
||||
|
||||
// draft flag on create is required for explicitly-published content items
|
||||
if (options.IsDraft) {
|
||||
contentItem.VersionRecord.Published = false;
|
||||
}
|
||||
|
||||
_contentItemRepository.Create(contentItem.Record);
|
||||
_contentItemVersionRepository.Create(contentItem.VersionRecord);
|
||||
|
||||
|
||||
// build a context with the initialized instance to create
|
||||
var context = new CreateContentContext {
|
||||
Id = modelRecord.Id,
|
||||
ContentType = modelRecord.ContentType.Name,
|
||||
ContentItemRecord = modelRecord,
|
||||
Id = contentItem.Id,
|
||||
ContentType = contentItem.ContentType,
|
||||
ContentItemRecord = contentItem.Record,
|
||||
ContentItemVersionRecord = contentItem.VersionRecord,
|
||||
ContentItem = contentItem
|
||||
};
|
||||
|
||||
// set the id
|
||||
context.ContentItem.Id = context.Id;
|
||||
|
||||
|
||||
// invoke handlers to add information to persistent stores
|
||||
foreach (var handler in Handlers) {
|
||||
@@ -137,7 +257,7 @@ namespace Orchard.ContentManagement {
|
||||
}
|
||||
|
||||
public ItemDisplayModel<TContentPart> BuildDisplayModel<TContentPart>(TContentPart content, string displayType) where TContentPart : IContent {
|
||||
var itemView = new ItemDisplayModel<TContentPart> {Item = content};
|
||||
var itemView = new ItemDisplayModel<TContentPart> { Item = content };
|
||||
var context = new BuildDisplayModelContext(itemView, displayType);
|
||||
foreach (var handler in Handlers) {
|
||||
handler.BuildDisplayModel(context);
|
||||
|
@@ -36,6 +36,15 @@ namespace Orchard.ContentManagement.Drivers {
|
||||
|
||||
void IContentHandler.Loaded(LoadContentContext context) { }
|
||||
|
||||
void IContentHandler.Versioning(VersionContentContext context) { }
|
||||
|
||||
void IContentHandler.Versioned(VersionContentContext context) { }
|
||||
|
||||
void IContentHandler.Removing(RemoveContentContext context) { }
|
||||
|
||||
void IContentHandler.Removed(RemoveContentContext context) { }
|
||||
|
||||
|
||||
void IContentHandler.GetItemMetadata(GetItemMetadataContext context) {
|
||||
_drivers.Invoke(driver => driver.GetItemMetadata(context), Logger);
|
||||
}
|
||||
@@ -63,6 +72,8 @@ namespace Orchard.ContentManagement.Drivers {
|
||||
result.Apply(context);
|
||||
}, Logger);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -32,6 +32,14 @@ namespace Orchard.ContentManagement.Drivers {
|
||||
|
||||
void IContentHandler.Loaded(LoadContentContext context) { }
|
||||
|
||||
void IContentHandler.Versioning(VersionContentContext context) { }
|
||||
|
||||
void IContentHandler.Versioned(VersionContentContext context) { }
|
||||
|
||||
void IContentHandler.Removing(RemoveContentContext context) { }
|
||||
|
||||
void IContentHandler.Removed(RemoveContentContext context) { }
|
||||
|
||||
void IContentHandler.GetItemMetadata(GetItemMetadataContext context) { }
|
||||
|
||||
void IContentHandler.BuildDisplayModel(BuildDisplayModelContext context) {
|
||||
|
@@ -33,6 +33,22 @@ namespace Orchard.ContentManagement.Handlers {
|
||||
Filters.Add(new InlineStorageFilter<TPart> { OnLoaded = handler });
|
||||
}
|
||||
|
||||
protected void OnVersioning<TPart>(Action<VersionContentContext, TPart, TPart> handler) where TPart : class, IContent {
|
||||
Filters.Add(new InlineStorageFilter<TPart> { OnVersioning = handler });
|
||||
}
|
||||
|
||||
protected void OnVersioned<TPart>(Action<VersionContentContext, TPart, TPart> handler) where TPart : class, IContent {
|
||||
Filters.Add(new InlineStorageFilter<TPart> { OnVersioned = handler });
|
||||
}
|
||||
|
||||
protected void OnRemoving<TPart>(Action<RemoveContentContext, TPart> handler) where TPart : class, IContent {
|
||||
Filters.Add(new InlineStorageFilter<TPart> { OnRemoving = handler });
|
||||
}
|
||||
|
||||
protected void OnRemoved<TPart>(Action<RemoveContentContext, TPart> handler) where TPart : class, IContent {
|
||||
Filters.Add(new InlineStorageFilter<TPart> { OnRemoved = handler });
|
||||
}
|
||||
|
||||
protected void OnGetItemMetadata<TPart>(Action<GetItemMetadataContext, TPart> handler) where TPart : class, IContent {
|
||||
Filters.Add(new InlineTemplateFilter<TPart> { OnGetItemMetadata = handler });
|
||||
}
|
||||
@@ -54,6 +70,10 @@ namespace Orchard.ContentManagement.Handlers {
|
||||
public Action<CreateContentContext, TPart> OnCreated { get; set; }
|
||||
public Action<LoadContentContext, TPart> OnLoading { get; set; }
|
||||
public Action<LoadContentContext, TPart> OnLoaded { get; set; }
|
||||
public Action<VersionContentContext, TPart, TPart> OnVersioning { get; set; }
|
||||
public Action<VersionContentContext, TPart, TPart> OnVersioned { get; set; }
|
||||
public Action<RemoveContentContext, TPart> OnRemoving { get; set; }
|
||||
public Action<RemoveContentContext, TPart> OnRemoved { get; set; }
|
||||
protected override void Activated(ActivatedContentContext context, TPart instance) {
|
||||
if (OnActivated != null) OnActivated(context, instance);
|
||||
}
|
||||
@@ -69,6 +89,18 @@ namespace Orchard.ContentManagement.Handlers {
|
||||
protected override void Loaded(LoadContentContext context, TPart instance) {
|
||||
if (OnLoaded != null) OnLoaded(context, instance);
|
||||
}
|
||||
protected override void Versioning(VersionContentContext context, TPart existing, TPart building) {
|
||||
if (OnVersioning != null) OnVersioning(context, existing, building);
|
||||
}
|
||||
protected override void Versioned(VersionContentContext context, TPart existing, TPart building) {
|
||||
if (OnVersioned != null) OnVersioned(context, existing, building);
|
||||
}
|
||||
protected override void Removing(RemoveContentContext context, TPart instance) {
|
||||
if (OnRemoving != null) OnRemoving(context, instance);
|
||||
}
|
||||
protected override void Removed(RemoveContentContext context, TPart instance) {
|
||||
if (OnRemoved != null) OnRemoved(context, instance);
|
||||
}
|
||||
}
|
||||
|
||||
class InlineTemplateFilter<TPart> : TemplateFilterBase<TPart> where TPart : class, IContent {
|
||||
@@ -129,6 +161,28 @@ namespace Orchard.ContentManagement.Handlers {
|
||||
filter.Loaded(context);
|
||||
Loaded(context);
|
||||
}
|
||||
void IContentHandler.Versioning(VersionContentContext context) {
|
||||
foreach (var filter in Filters.OfType<IContentStorageFilter>())
|
||||
filter.Versioning(context);
|
||||
Versioning(context);
|
||||
}
|
||||
|
||||
void IContentHandler.Versioned(VersionContentContext context) {
|
||||
foreach (var filter in Filters.OfType<IContentStorageFilter>())
|
||||
filter.Versioned(context);
|
||||
Versioned(context);
|
||||
}
|
||||
void IContentHandler.Removing(RemoveContentContext context) {
|
||||
foreach (var filter in Filters.OfType<IContentStorageFilter>())
|
||||
filter.Removing(context);
|
||||
Removing(context);
|
||||
}
|
||||
|
||||
void IContentHandler.Removed(RemoveContentContext context) {
|
||||
foreach (var filter in Filters.OfType<IContentStorageFilter>())
|
||||
filter.Removed(context);
|
||||
Removed(context);
|
||||
}
|
||||
|
||||
|
||||
void IContentHandler.GetItemMetadata(GetItemMetadataContext context) {
|
||||
@@ -155,15 +209,21 @@ namespace Orchard.ContentManagement.Handlers {
|
||||
protected virtual void Activating(ActivatingContentContext context) { }
|
||||
protected virtual void Activated(ActivatedContentContext context) { }
|
||||
|
||||
protected virtual void Creating(CreateContentContext context) { }
|
||||
protected virtual void Created(CreateContentContext context) { }
|
||||
|
||||
protected virtual void Loading(LoadContentContext context) { }
|
||||
protected virtual void Loaded(LoadContentContext context) { }
|
||||
|
||||
protected virtual void Creating(CreateContentContext context) { }
|
||||
protected virtual void Created(CreateContentContext context) { }
|
||||
protected virtual void Versioning(VersionContentContext context) { }
|
||||
protected virtual void Versioned(VersionContentContext context) { }
|
||||
|
||||
protected virtual void Removing(RemoveContentContext context) { }
|
||||
protected virtual void Removed(RemoveContentContext context) { }
|
||||
|
||||
protected virtual void GetItemMetadata(GetItemMetadataContext context) { }
|
||||
protected virtual void BuildDisplayModel(BuildDisplayModelContext context) { }
|
||||
protected virtual void BuildEditorModel(BuildEditorModelContext context) { }
|
||||
protected virtual void UpdateEditorModel(UpdateEditorModelContext context) {}
|
||||
protected virtual void UpdateEditorModel(UpdateEditorModelContext context) { }
|
||||
}
|
||||
}
|
@@ -4,7 +4,9 @@ namespace Orchard.ContentManagement.Handlers {
|
||||
public class CreateContentContext {
|
||||
public int Id { get; set; }
|
||||
public string ContentType { get; set; }
|
||||
public ContentItemRecord ContentItemRecord { get; set; }
|
||||
|
||||
public ContentItem ContentItem { get; set; }
|
||||
public ContentItemRecord ContentItemRecord { get; set; }
|
||||
public ContentItemVersionRecord ContentItemVersionRecord { get; set; }
|
||||
}
|
||||
}
|
@@ -10,6 +10,10 @@ namespace Orchard.ContentManagement.Handlers {
|
||||
void Created(CreateContentContext context);
|
||||
void Loading(LoadContentContext context);
|
||||
void Loaded(LoadContentContext context);
|
||||
void Versioning(VersionContentContext context);
|
||||
void Versioned(VersionContentContext context);
|
||||
void Removing(RemoveContentContext context);
|
||||
void Removed(RemoveContentContext context);
|
||||
|
||||
void GetItemMetadata(GetItemMetadataContext context);
|
||||
void BuildDisplayModel(BuildDisplayModelContext context);
|
||||
|
@@ -5,5 +5,9 @@ namespace Orchard.ContentManagement.Handlers {
|
||||
void Created(CreateContentContext context);
|
||||
void Loading(LoadContentContext context);
|
||||
void Loaded(LoadContentContext context);
|
||||
void Versioning(VersionContentContext context);
|
||||
void Versioned(VersionContentContext context);
|
||||
void Removing(RemoveContentContext context);
|
||||
void Removed(RemoveContentContext context);
|
||||
}
|
||||
}
|
||||
|
@@ -5,7 +5,29 @@ namespace Orchard.ContentManagement.Handlers {
|
||||
public class LoadContentContext {
|
||||
public int Id { get; set; }
|
||||
public string ContentType { get; set; }
|
||||
public ContentItemRecord ContentItemRecord { get; set; }
|
||||
public ContentItem ContentItem { get; set; }
|
||||
public ContentItemRecord ContentItemRecord { get; set; }
|
||||
public ContentItemVersionRecord ContentItemVersionRecord { get; set; }
|
||||
}
|
||||
|
||||
public class RemoveContentContext {
|
||||
public int Id { get; set; }
|
||||
public string ContentType { get; set; }
|
||||
public ContentItem ContentItem { get; set; }
|
||||
public ContentItemRecord ContentItemRecord { get; set; }
|
||||
}
|
||||
|
||||
public class VersionContentContext {
|
||||
public int Id { get; set; }
|
||||
public string ContentType { get; set; }
|
||||
|
||||
public ContentItemRecord ContentItemRecord { get; set; }
|
||||
public ContentItemVersionRecord ExistingItemVersionRecord { get; set; }
|
||||
public ContentItemVersionRecord BuildingItemVersionRecord { get; set; }
|
||||
|
||||
public ContentItem ExistingContentItem { get; set; }
|
||||
public ContentItem BuildingContentItem { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -21,7 +21,7 @@ namespace Orchard.ContentManagement.Handlers {
|
||||
}
|
||||
|
||||
protected override void Loading(LoadContentContext context, ContentPart<TRecord> instance) {
|
||||
var record = _repository.Get(instance.ContentItem.Id);
|
||||
var record = _repository.Get(context.Id);
|
||||
if (record != null) {
|
||||
instance.Record = record;
|
||||
}
|
||||
@@ -30,5 +30,52 @@ namespace Orchard.ContentManagement.Handlers {
|
||||
_repository.Create(instance.Record);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Versioning(VersionContentContext context, ContentPart<TRecord> existing, ContentPart<TRecord> building) {
|
||||
building.Record = existing.Record;
|
||||
}
|
||||
}
|
||||
|
||||
public class StorageVersionFilter<TRecord> : StorageFilterBase<ContentPart<TRecord>> where TRecord : ContentPartVersionRecord, new() {
|
||||
private readonly IRepository<TRecord> _repository;
|
||||
|
||||
public StorageVersionFilter(IRepository<TRecord> repository) {
|
||||
_repository = repository;
|
||||
}
|
||||
|
||||
public bool AutomaticallyCreateMissingRecord { get; set; }
|
||||
|
||||
protected override void Activated(ActivatedContentContext context, ContentPart<TRecord> instance) {
|
||||
instance.Record = new TRecord();
|
||||
}
|
||||
|
||||
protected override void Creating(CreateContentContext context, ContentPart<TRecord> instance) {
|
||||
instance.Record.ContentItemRecord = context.ContentItemRecord;
|
||||
instance.Record.ContentItemVersionRecord = context.ContentItemVersionRecord;
|
||||
_repository.Create(instance.Record);
|
||||
}
|
||||
|
||||
protected override void Loading(LoadContentContext context, ContentPart<TRecord> instance) {
|
||||
var record = _repository.Get(context.ContentItemVersionRecord.Id);
|
||||
if (record != null) {
|
||||
instance.Record = record;
|
||||
}
|
||||
else if (AutomaticallyCreateMissingRecord) {
|
||||
instance.Record.ContentItemRecord = context.ContentItemRecord;
|
||||
instance.Record.ContentItemVersionRecord = context.ContentItemVersionRecord;
|
||||
_repository.Create(instance.Record);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Versioning(VersionContentContext context, ContentPart<TRecord> existing, ContentPart<TRecord> building) {
|
||||
// move known ORM values over
|
||||
_repository.Copy(existing.Record, building.Record);
|
||||
|
||||
// only the up-reference to the particular version differs at this point
|
||||
building.Record.ContentItemVersionRecord = context.BuildingItemVersionRecord;
|
||||
|
||||
// push the new instance into the transaction and session
|
||||
_repository.Create(building.Record);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -6,6 +6,10 @@ namespace Orchard.ContentManagement.Handlers {
|
||||
protected virtual void Created(CreateContentContext context, TPart instance) { }
|
||||
protected virtual void Loading(LoadContentContext context, TPart instance) { }
|
||||
protected virtual void Loaded(LoadContentContext context, TPart instance) { }
|
||||
protected virtual void Versioning(VersionContentContext context, TPart existing, TPart building) { }
|
||||
protected virtual void Versioned(VersionContentContext context, TPart existing, TPart building) { }
|
||||
protected virtual void Removing(RemoveContentContext context, TPart instance) { }
|
||||
protected virtual void Removed(RemoveContentContext context, TPart instance) { }
|
||||
|
||||
|
||||
void IContentStorageFilter.Activated(ActivatedContentContext context) {
|
||||
@@ -32,5 +36,25 @@ namespace Orchard.ContentManagement.Handlers {
|
||||
if (context.ContentItem.Is<TPart>())
|
||||
Loaded(context, context.ContentItem.As<TPart>());
|
||||
}
|
||||
|
||||
void IContentStorageFilter.Versioning(VersionContentContext context) {
|
||||
if (context.ExistingContentItem.Is<TPart>() || context.BuildingContentItem.Is<TPart>())
|
||||
Versioning(context, context.ExistingContentItem.As<TPart>(), context.BuildingContentItem.As<TPart>());
|
||||
}
|
||||
|
||||
void IContentStorageFilter.Versioned(VersionContentContext context) {
|
||||
if (context.ExistingContentItem.Is<TPart>() || context.BuildingContentItem.Is<TPart>())
|
||||
Versioned(context, context.ExistingContentItem.As<TPart>(), context.BuildingContentItem.As<TPart>());
|
||||
}
|
||||
|
||||
void IContentStorageFilter.Removing(RemoveContentContext context) {
|
||||
if (context.ContentItem.Is<TPart>())
|
||||
Removing(context, context.ContentItem.As<TPart>());
|
||||
}
|
||||
|
||||
void IContentStorageFilter.Removed(RemoveContentContext context) {
|
||||
if (context.ContentItem.Is<TPart>())
|
||||
Removed(context, context.ContentItem.As<TPart>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.ContentManagement.ViewModels;
|
||||
|
||||
namespace Orchard.ContentManagement {
|
||||
@@ -7,9 +6,14 @@ namespace Orchard.ContentManagement {
|
||||
IEnumerable<ContentType> GetContentTypes();
|
||||
|
||||
ContentItem New(string contentType);
|
||||
|
||||
void Create(ContentItem contentItem);
|
||||
void Create(ContentItem contentItem, VersionOptions options);
|
||||
|
||||
ContentItem Get(int id);
|
||||
ContentItem Get(int id, VersionOptions options);
|
||||
|
||||
ContentItem AppendLatestVersion(ContentItem sourceVersion);
|
||||
|
||||
IContentQuery<ContentItem> Query();
|
||||
|
||||
@@ -19,4 +23,20 @@ namespace Orchard.ContentManagement {
|
||||
ItemEditorModel<TContent> BuildEditorModel<TContent>(TContent content) where TContent : IContent;
|
||||
ItemEditorModel<TContent> UpdateEditorModel<TContent>(TContent content, IUpdateModel updater) where TContent : IContent;
|
||||
}
|
||||
|
||||
public class VersionOptions {
|
||||
public static VersionOptions Latest { get { return new VersionOptions { IsLatest = true }; } }
|
||||
public static VersionOptions Published { get { return new VersionOptions { IsPublished = true }; } }
|
||||
public static VersionOptions Draft { get { return new VersionOptions { IsDraft = true }; } }
|
||||
public static VersionOptions DraftRequired { get { return new VersionOptions { IsDraft = true, IsDraftRequired = true }; } }
|
||||
public static VersionOptions Number(int version) { return new VersionOptions { VersionNumber = version }; }
|
||||
public static VersionOptions VersionRecord(int id) { return new VersionOptions { VersionRecordId = id }; }
|
||||
|
||||
public bool IsLatest { get; private set; }
|
||||
public bool IsPublished { get; private set; }
|
||||
public bool IsDraft { get; private set; }
|
||||
public bool IsDraftRequired { get; private set; }
|
||||
public int VersionNumber { get; private set; }
|
||||
public int VersionRecordId { get; private set; }
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Orchard.ContentManagement.Records {
|
||||
public class ContentItemRecord {
|
||||
public ContentItemRecord() {
|
||||
// ReSharper disable DoNotCallOverridableMethodsInConstructor
|
||||
Versions = new List<ContentItemVersionRecord>();
|
||||
// ReSharper restore DoNotCallOverridableMethodsInConstructor
|
||||
}
|
||||
|
||||
public virtual int Id { get; set; }
|
||||
public virtual ContentTypeRecord ContentType { get; set; }
|
||||
public virtual IList<ContentItemVersionRecord> Versions { get; set; }
|
||||
}
|
||||
}
|
@@ -36,25 +36,32 @@ namespace Orchard.ContentManagement.Records {
|
||||
|
||||
class Alteration<TPartRecord> : IAlteration where TPartRecord : ContentPartRecord {
|
||||
public void Override(AutoMapping<ContentItemRecord> mapping) {
|
||||
|
||||
// public TPartRecord TPartRecord {get;set;}
|
||||
var name = typeof(TPartRecord).Name;
|
||||
|
||||
|
||||
var syntheticMethod = new DynamicMethod(name, typeof(TPartRecord), null, typeof(ContentItemRecord));
|
||||
var syntheticProperty = new FakePropertyInfo(syntheticMethod);
|
||||
var syntheticProperty = new SyntheticPropertyInfo(syntheticMethod);
|
||||
|
||||
// record => record.TPartRecord
|
||||
var parameter = Expression.Parameter(typeof(ContentItemRecord), "record");
|
||||
var syntheticExpression = (Expression<Func<ContentItemRecord, TPartRecord>>)Expression.Lambda(
|
||||
typeof(Func<ContentItemRecord, TPartRecord>),
|
||||
Expression.Property(parameter, syntheticProperty),
|
||||
parameter);
|
||||
|
||||
mapping.HasOne(syntheticExpression).Access.NoOp().Fetch.Select();
|
||||
mapping.References(syntheticExpression)
|
||||
.Access.NoOp()
|
||||
.Column("Id")
|
||||
.Unique()
|
||||
.Not.Insert()
|
||||
.Not.Update()
|
||||
.Cascade.All();
|
||||
}
|
||||
|
||||
private class FakePropertyInfo : PropertyInfo {
|
||||
private class SyntheticPropertyInfo : PropertyInfo {
|
||||
private readonly DynamicMethod _getMethod;
|
||||
|
||||
public FakePropertyInfo(DynamicMethod dynamicMethod) {
|
||||
public SyntheticPropertyInfo(DynamicMethod dynamicMethod) {
|
||||
_getMethod = dynamicMethod;
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,10 @@
|
||||
namespace Orchard.ContentManagement.Records {
|
||||
public class ContentItemVersionRecord {
|
||||
public virtual int Id { get; set; }
|
||||
public virtual ContentItemRecord ContentItemRecord { get; set; }
|
||||
public virtual int Number { get; set; }
|
||||
|
||||
public virtual bool Published { get; set; }
|
||||
public virtual bool Latest { get; set; }
|
||||
}
|
||||
}
|
@@ -27,8 +27,12 @@ namespace Orchard.ContentManagement.Records {
|
||||
class Alteration<T> : IAlteration where T : ContentPartRecord {
|
||||
public void Override(object mappingObj) {
|
||||
var mapping = (AutoMapping<T>)mappingObj;
|
||||
mapping.Id(x => x.Id).GeneratedBy.Foreign("ContentItemRecord");
|
||||
mapping.HasOne(x => x.ContentItemRecord).Constrained();
|
||||
|
||||
mapping.Id(x => x.Id)
|
||||
.GeneratedBy.Foreign("ContentItemRecord");
|
||||
|
||||
mapping.HasOne(x => x.ContentItemRecord)
|
||||
.Constrained();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,7 @@
|
||||
namespace Orchard.ContentManagement.Records {
|
||||
public abstract class ContentPartVersionRecord {
|
||||
public virtual int Id { get; set; }
|
||||
public virtual ContentItemRecord ContentItemRecord { get; set; }
|
||||
public virtual ContentItemVersionRecord ContentItemVersionRecord { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using FluentNHibernate.Automapping;
|
||||
using FluentNHibernate.Automapping.Alterations;
|
||||
|
||||
namespace Orchard.ContentManagement.Records {
|
||||
public class ContentPartVersionRecordAlteration : IAutoMappingAlteration {
|
||||
public void Alter(AutoPersistenceModel model) {
|
||||
|
||||
model.OverrideAll(mapping => {
|
||||
var genericArguments = mapping.GetType().GetGenericArguments();
|
||||
if (!genericArguments.Single().IsSubclassOf(typeof(ContentPartVersionRecord))) {
|
||||
return;
|
||||
}
|
||||
|
||||
var type = typeof(Alteration<>).MakeGenericType(genericArguments);
|
||||
var alteration = (IAlteration)Activator.CreateInstance(type);
|
||||
alteration.Override(mapping);
|
||||
});
|
||||
}
|
||||
|
||||
interface IAlteration {
|
||||
void Override(object mapping);
|
||||
}
|
||||
|
||||
class Alteration<T> : IAlteration where T : ContentPartVersionRecord {
|
||||
public void Override(object mappingObj) {
|
||||
var mapping = (AutoMapping<T>)mappingObj;
|
||||
|
||||
mapping.Id(x => x.Id)
|
||||
.GeneratedBy.Foreign("ContentItemVersionRecord");
|
||||
|
||||
mapping.HasOne(x => x.ContentItemVersionRecord)
|
||||
.Constrained();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -2,12 +2,14 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using Orchard.ContentManagement.Records;
|
||||
|
||||
namespace Orchard.Data {
|
||||
public interface IRepository<T> {
|
||||
void Create(T entity);
|
||||
void Update(T entity);
|
||||
void Delete(T entity);
|
||||
void Copy(T source, T target);
|
||||
|
||||
T Get(int id);
|
||||
T Get(Expression<Func<T, bool>> predicate);
|
||||
@@ -19,6 +21,7 @@ namespace Orchard.Data {
|
||||
IEnumerable<T> Fetch(Expression<Func<T, bool>> predicate, Action<Orderable<T>> order);
|
||||
IEnumerable<T> Fetch(Expression<Func<T, bool>> predicate, Action<Orderable<T>> order, int skip, int count);
|
||||
|
||||
[Obsolete]
|
||||
void Transaction(Action action);
|
||||
}
|
||||
}
|
@@ -44,6 +44,10 @@ namespace Orchard.Data {
|
||||
Delete(entity);
|
||||
}
|
||||
|
||||
void IRepository<T>.Copy(T source, T target) {
|
||||
Copy(source, target);
|
||||
}
|
||||
|
||||
T IRepository<T>.Get(int id) {
|
||||
return Get(id);
|
||||
}
|
||||
@@ -114,6 +118,14 @@ namespace Orchard.Data {
|
||||
Session.Delete(entity);
|
||||
}
|
||||
|
||||
public virtual void Copy(T source, T target) {
|
||||
Logger.Debug("Delete {0}", source, target);
|
||||
var metadata = Session.SessionFactory.GetClassMetadata(typeof (T));
|
||||
var values = metadata.GetPropertyValues(source, EntityMode.Poco);
|
||||
metadata.SetPropertyValues(target, values, EntityMode.Poco);
|
||||
}
|
||||
|
||||
|
||||
public virtual int Count(Expression<Func<T, bool>> predicate) {
|
||||
return Fetch(predicate).Count();
|
||||
}
|
||||
|
@@ -41,8 +41,12 @@ namespace Orchard.Environment {
|
||||
|
||||
public IEnumerable<Type> GetRecordTypes() {
|
||||
var types = _extensionManager.ActiveExtensions().SelectMany(x => x.ExportedTypes);
|
||||
var recordTypes = types.Where(IsRecordType)
|
||||
.Concat(new[] { typeof(ContentItemRecord), typeof(ContentPartRecord), typeof(ContentTypeRecord) });
|
||||
var coreRecords = new[] {
|
||||
typeof (ContentTypeRecord),
|
||||
typeof (ContentItemRecord),
|
||||
typeof (ContentItemVersionRecord),
|
||||
};
|
||||
var recordTypes = types.Where(IsRecordType).Concat(coreRecords);
|
||||
return recordTypes;
|
||||
}
|
||||
|
||||
|
@@ -1,21 +1,30 @@
|
||||
using System.Web.Mvc;
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.Security;
|
||||
using Orchard.Settings;
|
||||
|
||||
namespace Orchard.Mvc.Filters {
|
||||
[UsedImplicitly]
|
||||
public class AntiForgeryAuthorizationFilter : FilterProvider, IAuthorizationFilter {
|
||||
private readonly ISiteService _siteService;
|
||||
private readonly IAuthenticationService _authenticationService;
|
||||
|
||||
public AntiForgeryAuthorizationFilter(ISiteService siteService) {
|
||||
public AntiForgeryAuthorizationFilter(ISiteService siteService, IAuthenticationService authenticationService) {
|
||||
_siteService = siteService;
|
||||
_authenticationService = authenticationService;
|
||||
}
|
||||
|
||||
public void OnAuthorization(AuthorizationContext filterContext) {
|
||||
if (!(filterContext.HttpContext.Request.HttpMethod == "POST" && filterContext.RequestContext.HttpContext.Request.IsAuthenticated))
|
||||
// not a post: no work to do
|
||||
if (filterContext.HttpContext.Request.HttpMethod != "POST")
|
||||
return;
|
||||
|
||||
// not logged in: no attack vector
|
||||
if (_authenticationService.GetAuthenticatedUser() == null)
|
||||
return;
|
||||
|
||||
var siteSalt = _siteService.GetSiteSettings().SiteSalt;
|
||||
ValidateAntiForgeryTokenAttribute validator = new ValidateAntiForgeryTokenAttribute { Salt = siteSalt };
|
||||
|
||||
var validator = new ValidateAntiForgeryTokenAttribute { Salt = siteSalt };
|
||||
validator.OnAuthorization(filterContext);
|
||||
}
|
||||
}
|
||||
|
@@ -66,6 +66,9 @@
|
||||
<HintPath>..\..\lib\linqnhibernate\NHibernate.Linq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
@@ -168,8 +171,11 @@
|
||||
<Compile Include="ContentManagement\IUpdateModel.cs" />
|
||||
<Compile Include="ContentManagement\Records\ContentItemRecord.cs" />
|
||||
<Compile Include="ContentManagement\Records\ContentItemRecordAlteration.cs" />
|
||||
<Compile Include="ContentManagement\Records\ContentItemVersionRecord.cs" />
|
||||
<Compile Include="ContentManagement\Records\ContentPartRecord.cs" />
|
||||
<Compile Include="ContentManagement\Records\ContentPartRecordAlteration.cs" />
|
||||
<Compile Include="ContentManagement\Records\ContentPartVersionRecord.cs" />
|
||||
<Compile Include="ContentManagement\Records\ContentPartVersionRecordAlteration.cs" />
|
||||
<Compile Include="ContentManagement\Records\ContentTypeRecord.cs" />
|
||||
<Compile Include="ContentManagement\ViewModels\ItemDisplayModel.cs" />
|
||||
<Compile Include="ContentManagement\ViewModels\ItemEditorModel.cs" />
|
||||
|
Reference in New Issue
Block a user