From: <mcu...@us...> - 2007-07-31 23:47:05
|
Revision: 1075 http://orm.svn.sourceforge.net/orm/?rev=1075&view=rev Author: mcurland Date: 2007-07-31 16:47:02 -0700 (Tue, 31 Jul 2007) Log Message: ----------- Added mechanism for ObjectType filtering. refs #327 Modified Paths: -------------- trunk/Oial/ORMOialBridge/OialModelIsForORMModel.cs Modified: trunk/Oial/ORMOialBridge/OialModelIsForORMModel.cs =================================================================== --- trunk/Oial/ORMOialBridge/OialModelIsForORMModel.cs 2007-07-24 18:16:18 UTC (rev 1074) +++ trunk/Oial/ORMOialBridge/OialModelIsForORMModel.cs 2007-07-31 23:47:02 UTC (rev 1075) @@ -138,8 +138,12 @@ #endregion #region ORM Error Filtering Methods - private static bool ShouldIgnoreFactType(FactType factType) + private bool ShouldIgnoreObjectType(ObjectType objectType) { + return false; + } + private bool ShouldIgnoreFactType(FactType factType) + { // Subtype facts are always binarized, and never missing role players if (factType is SubtypeFact) { @@ -155,8 +159,8 @@ // Ignore fact types that contain roles that are missing role players foreach (RoleBase roleBase in roles) { - // UNDONE: Should we just be checking RolePlayer == null instead? - if (roleBase.Role.RolePlayerRequiredError != null) + ObjectType rolePlayer = roleBase.Role.RolePlayer; + if (rolePlayer != null || ShouldIgnoreObjectType(rolePlayer)) { return true; } @@ -579,6 +583,10 @@ // For each ValueType in the model... foreach (ObjectType valueType in modelValueTypes) { + if (ShouldIgnoreObjectType(valueType)) + { + continue; + } // Create InformationTypeFormat. PropertyAssignment namePropertyAssignment = new PropertyAssignment(InformationTypeFormat.NameDomainPropertyId, valueType.Name); InformationTypeFormat informationTypeFormat = new InformationTypeFormat(Store, namePropertyAssignment); @@ -604,6 +612,10 @@ // For each object type in the model... foreach (ObjectType objectType in modelObjectTypes) { + if (ShouldIgnoreObjectType(objectType)) + { + continue; + } // If it should have a conctpt type... if (ObjectTypeIsConceptType(objectType, factTypeMappings)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |