You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(21) |
Sep
(25) |
Oct
(13) |
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(1) |
Oct
(1) |
Nov
(8) |
Dec
(3) |
2009 |
Jan
(5) |
Feb
(3) |
Mar
(10) |
Apr
(6) |
May
(3) |
Jun
(4) |
Jul
(1) |
Aug
(3) |
Sep
(5) |
Oct
(1) |
Nov
(2) |
Dec
(2) |
2010 |
Jan
|
Feb
(3) |
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(2) |
Aug
|
Sep
(3) |
Oct
(2) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(3) |
Jul
(1) |
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2012 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(4) |
Nov
(4) |
Dec
(2) |
2013 |
Jan
(1) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(3) |
Dec
(2) |
2014 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(1) |
Jun
|
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
(2) |
Dec
(5) |
2015 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <mcu...@us...> - 2013-11-26 06:26:34
|
Revision: 1532 http://sourceforge.net/p/orm/code/1532 Author: mcurland Date: 2013-11-26 06:26:31 +0000 (Tue, 26 Nov 2013) Log Message: ----------- Incorrect conditional order from [1519] adds an unparented link fact type for a newly added role in an explicitly or implicitly objectified fact type. The link fact type does not serialize, but references to it do, so the file will not reload. Modified Paths: -------------- trunk/ORMModel/ObjectModel/Objectification.cs Modified: trunk/ORMModel/ObjectModel/Objectification.cs =================================================================== --- trunk/ORMModel/ObjectModel/Objectification.cs 2013-11-06 01:48:28 UTC (rev 1531) +++ trunk/ORMModel/ObjectModel/Objectification.cs 2013-11-26 06:26:31 UTC (rev 1532) @@ -702,7 +702,7 @@ { IHasAlternateOwner<ObjectType> toAlternateOwner; IAlternateElementOwner<FactType> alternateFactTypeOwner = (null != (toAlternateOwner = nestingType as IHasAlternateOwner<ObjectType>)) ? toAlternateOwner.AlternateOwner as IAlternateElementOwner<FactType> : null; - CreateImpliedFactTypeForRole(alternateFactTypeOwner == null ? null : nestingType.Model, alternateFactTypeOwner, nestingType, nestedRole, objectificationLink, unaryRole != null); + CreateImpliedFactTypeForRole(alternateFactTypeOwner == null ? nestingType.Model : null, alternateFactTypeOwner, nestingType, nestedRole, objectificationLink, unaryRole != null); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2013-10-28 01:33:01
|
Revision: 1529 http://sourceforge.net/p/orm/code/1529 Author: mcurland Date: 2013-10-28 01:32:57 +0000 (Mon, 28 Oct 2013) Log Message: ----------- Ongoing derivation rule verbalization adjustments: * Add 'is by definition' to the subtype derivation rules to clarify the intent of the subtype derivation. * Fixed some variable subscripting cases during verbalization and adjusted when variables are descoped in negations. Modified Paths: -------------- trunk/ORMModel/ObjectModel/Verbalization.cs trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xml trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xsd trunk/ORMModel/ObjectModel/VerbalizationCoreSnippetsDocumentation.html trunk/ORMModel/ObjectModel/VerbalizationDocumentation.xml trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs Modified: trunk/ORMModel/ObjectModel/Verbalization.cs =================================================================== --- trunk/ORMModel/ObjectModel/Verbalization.cs 2013-10-18 03:44:19 UTC (rev 1528) +++ trunk/ORMModel/ObjectModel/Verbalization.cs 2013-10-28 01:32:57 UTC (rev 1529) @@ -4135,6 +4135,7 @@ private StateFlags myFlags; private ObjectType myRolePlayer; private int mySubscript; + private int mySubscriptOffset; private int myUsePhase; private int myDescopedUseCount; /// <summary> @@ -4145,6 +4146,7 @@ { myRolePlayer = rolePlayer; mySubscript = -1; + mySubscriptOffset = 0; } /// <summary> /// Get the associated role player @@ -4163,7 +4165,7 @@ /// consistent across use phases, so once a subscript /// for a variable has been set it does not change. /// </summary> - public int Subscript + public int BaseSubscript { get { @@ -4175,6 +4177,37 @@ } } /// <summary> + /// Get or set the subscript offset, which is calculated + /// from the descoped counts on variables of this type + /// when this is set. + /// </summary> + public int SubscriptOffset + { + get + { + return mySubscriptOffset; + } + set + { + mySubscriptOffset = value; + } + } + /// <summary> + /// Get the current displayed subscript for this variable. + /// </summary> + public int Subscript + { + get + { + int retVal = mySubscript; + if (retVal > 0) + { + retVal += mySubscriptOffset; + } + return retVal; + } + } + /// <summary> /// Return the current use phase for this variable /// </summary> public int UsePhase @@ -4221,6 +4254,7 @@ { myUsePhase = 0; mySubscript = -1; + mySubscriptOffset = 0; ++myDescopedUseCount; } /// <summary> @@ -4434,12 +4468,12 @@ else { RolePlayerVariable currentVariable = node.Value; - retVal = Math.Max(currentVariable.Subscript, retVal); + retVal = Math.Max(currentVariable.BaseSubscript, retVal); descopedCount += currentVariable.DescopedCount; while (nextNode != null) { currentVariable = nextNode.Value; - retVal = Math.Max(currentVariable.Subscript, retVal); + retVal = Math.Max(currentVariable.BaseSubscript, retVal); descopedCount += currentVariable.DescopedCount; nextNode = nextNode.Next; } @@ -4449,11 +4483,12 @@ } ++retVal; } + variable.BaseSubscript = retVal; + variable.SubscriptOffset = descopedCount; if (retVal != 0) { retVal += descopedCount; } - variable.Subscript = retVal; } return retVal; } @@ -7570,6 +7605,7 @@ { collapseBlockingSnippets = new CoreVerbalizationSnippetType[] { }; } + myCollapseBlockingSnippets = collapseBlockingSnippets; } switch (collapseBlockingSnippets.Length) { @@ -10665,22 +10701,71 @@ VerbalizationPlanBranchType childBranchType; VerbalizationPlanNodeType previousChildNodeType = (VerbalizationPlanNodeType)(-1); VerbalizationPlanNode previousChildNode = null; + bool pushPopPairing = true; + bool popPairingAfterOnly = false; + if (childNodeLink != null) + { + switch (renderingStyle) + { + case VerbalizationPlanBranchRenderingStyle.IsolatedList: + pushPopPairing = false; + break; + case VerbalizationPlanBranchRenderingStyle.OperatorSeparated: + switch (branchType) + { + case VerbalizationPlanBranchType.None: + case VerbalizationPlanBranchType.AndSplit: + pushPopPairing = false; + break; + case VerbalizationPlanBranchType.Chain: + VerbalizationPlanNode testLeadNegation = childNodeLink.Value; + if (testLeadNegation.NodeType == VerbalizationPlanNodeType.VariableExistence && + testLeadNegation.NegateExistence) + { + popPairingAfterOnly = true; + } + else + { + pushPopPairing = false; + } + break; + case VerbalizationPlanBranchType.NegatedAndSplit: + case VerbalizationPlanBranchType.NegatedChain: + popPairingAfterOnly = true; + break; + } + break; + } + } while (childNodeLink != null) { snippet = (CoreVerbalizationSnippetType)(-1); childNode = childNodeLink.Value; switch (renderingStyle) { - case VerbalizationPlanBranchRenderingStyle.HeaderList: - if (!first) + case VerbalizationPlanBranchRenderingStyle.IsolatedList: + BeginQuantificationUsePhase(); + break; + default: + if (pushPopPairing) { - PopPairingUsePhase(); + if (popPairingAfterOnly) + { + if (first) + { + PushPairingUsePhase(); + } + } + else + { + if (!first) + { + PopPairingUsePhase(); + } + PushPairingUsePhase(); + } } - PushPairingUsePhase(); break; - case VerbalizationPlanBranchRenderingStyle.IsolatedList: - BeginQuantificationUsePhase(); - break; } string requiredVariableContextPhrase = null; LinkedNode<object> requiredVariableUseKeyLink = childNode.RequiredContextVariableUseKeys; @@ -10994,7 +11079,7 @@ outdentPosition = nestedOutdent; } } - if (renderingStyle == VerbalizationPlanBranchRenderingStyle.HeaderList) + if (pushPopPairing) { PopPairingUsePhase(); } @@ -11452,14 +11537,17 @@ { // Skip partnering if possible. Pretend that the variables are the same variable by giving them // the same subscript. - int partnerSubscript = partnerWithVariable.Subscript; - int primarySubscript = primaryVariable.Subscript; + int partnerSubscript = partnerWithVariable.BaseSubscript; + int primarySubscript = primaryVariable.BaseSubscript; + int partnerSubscriptOffset = partnerWithVariable.SubscriptOffset; + int primarySubscriptOffset = primaryVariable.SubscriptOffset; if (primarySubscript == -1) { if (partnerSubscript != -1) { // Use the existing subscript - primaryVariable.Subscript = primarySubscript = partnerSubscript; + primaryVariable.BaseSubscript = primarySubscript = partnerSubscript; + primaryVariable.SubscriptOffset = primarySubscriptOffset = partnerSubscriptOffset; if (IsPairingUsePhaseInScope(partnerWithVariable.UsePhase)) { UseVariable(primaryVariable, CurrentQuantificationUsePhase, false); @@ -11475,7 +11563,8 @@ } if (partnerSubscript == -1) { - partnerWithVariable.Subscript = primarySubscript = partnerSubscript = primaryVariable.Subscript; // Primary subscript now reserved and set by GetSubscriptedRolePlayerName, read off new value + partnerWithVariable.BaseSubscript = primarySubscript = partnerSubscript = primaryVariable.BaseSubscript; // Primary subscript now reserved and set by GetSubscriptedRolePlayerName, read off new value + partnerWithVariable.SubscriptOffset = primarySubscriptOffset = partnerSubscriptOffset = primaryVariable.SubscriptOffset; } } else @@ -11486,7 +11575,8 @@ } if (partnerSubscript == -1) { - partnerWithVariable.Subscript = partnerSubscript = primarySubscript; + partnerWithVariable.BaseSubscript = partnerSubscript = primarySubscript; + partnerWithVariable.SubscriptOffset = partnerSubscriptOffset = primarySubscriptOffset; if (IsPairingUsePhaseInScope(primaryVariable.UsePhase)) { UseVariable(partnerWithVariable, CurrentQuantificationUsePhase, false); Modified: trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xml =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xml 2013-10-18 03:44:19 UTC (rev 1528) +++ trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xml 2013-10-28 01:32:57 UTC (rev 1529) @@ -96,11 +96,11 @@ <Snippet type="PartialFactTypeDerivation"><![CDATA[<span class="quantifier"><sup style="font-size:smaller;">+</sup></span>{0} <span class="quantifier">if</span><br/>{1}<br/>]]></Snippet> <Snippet type="PartialFactTypeStoredDerivation"><![CDATA[<span class="quantifier"><sup style="font-size:smaller;">++</sup></span>{0} <span class="quantifier">if</span><br/>{1}<br/>]]></Snippet> <Snippet type="PartialStoredFactTypeDescription"><![CDATA[<span class="indent"><span class="quantifier">derived instances of this fact type are also stored immediately after they are derived</span></span>]]></Snippet> - <Snippet type="FullSubtypeDerivation"><![CDATA[<span class="quantifier">*Each</span> {0} <span class="quantifier">is</span> {1}]]></Snippet> - <Snippet type="FullSubtypeStoredDerivation"><![CDATA[<span class="quantifier">**Each</span> {0} <span class="quantifier">is</span> {1}]]></Snippet> + <Snippet type="FullSubtypeDerivation"><![CDATA[<span class="quantifier">*Each</span> {0} <span class="quantifier">is by definition</span> {1}]]></Snippet> + <Snippet type="FullSubtypeStoredDerivation"><![CDATA[<span class="quantifier">**Each</span> {0} <span class="quantifier">is by definition</span> {1}]]></Snippet> <Snippet type="FullStoredSubtypeDescription"><![CDATA[<span class="smallIndent"><span class="quantifier">instances of this subtype are stored immediately after they are derived</span></span>]]></Snippet> - <Snippet type="PartialSubtypeDerivation"><![CDATA[<span class="quantifier"><sup style="font-size:smaller;">+</sup>each derived</span> {0} <span class="quantifier">is</span> {1}]]></Snippet> - <Snippet type="PartialSubtypeStoredDerivation"><![CDATA[<span class="quantifier"><sup style="font-size:smaller;">++</sup>each derived</span> {0} <span class="quantifier">is</span> {1}]]></Snippet> + <Snippet type="PartialSubtypeDerivation"><![CDATA[<span class="quantifier"><sup style="font-size:smaller;">+</sup>each derived</span> {0} <span class="quantifier">is by definition</span> {1}]]></Snippet> + <Snippet type="PartialSubtypeStoredDerivation"><![CDATA[<span class="quantifier"><sup style="font-size:smaller;">++</sup>each derived</span> {0} <span class="quantifier">is by definition</span> {1}]]></Snippet> <Snippet type="PartialStoredSubtypeDescription"><![CDATA[<span class="smallIndent"><span class="quantifier">derived instances of this subtype are also stored immediately after they are derived</span></span>]]></Snippet> <Snippet type="QueryParameterContainer"><![CDATA[<span class="quantifier">given</span> {0} ]]></Snippet> <Snippet type="QueryNamedParameter"><![CDATA[{1}<span class="logicalOperator">=</span>{0}]]></Snippet> @@ -312,7 +312,7 @@ <Snippet type="RolePathHeaderListDirective"><![CDATA[!And !Or Xor !Xor]]></Snippet> <Snippet type="RolePathCollapsibleLeadDirective"><![CDATA[And Or Chain]]></Snippet> <Snippet type="RolePathCollapsibleListOpenForBackReferenceDirective"><![CDATA[And Or Chain]]></Snippet> - <Snippet type="RolePathBlockLeadCollapseForSnippetDirective"><![CDATA[AndTailListOpen OrTailListOpen]]></Snippet> + <Snippet type="RolePathBlockLeadCollapseForSnippetDirective"><![CDATA[AndTailListOpen OrTailListOpen ChainedListLocalRestrictionSeparator ChainedListComplexRestrictionSeparator ChainedListComplexRestrictionSeparator ChainedListTopLevelComplexRestrictionSeparator]]></Snippet> <Snippet type="ImpersonalIdentityCorrelation"><![CDATA[{0} <span class="quantifier">that is</span> {1}]]></Snippet> <Snippet type="ImpersonalLeadIdentityCorrelation"><![CDATA[{1} <span class="quantifier">is</span> {0} <span class="quantifier">that</span>]]></Snippet> <Snippet type="PersonalIdentityCorrelation"><![CDATA[{0} <span class="quantifier">who is</span> {1}]]></Snippet> Modified: trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xsd =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xsd 2013-10-18 03:44:19 UTC (rev 1528) +++ trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xsd 2013-10-28 01:32:57 UTC (rev 1529) @@ -1201,13 +1201,13 @@ <xs:enumeration value="FullSubtypeDerivation"> <xs:annotation> <xs:documentation>Description: Used to specify a fully derived subtype derivation rule. -Format: *each {0} is {1}</xs:documentation> +Format: *each {0} is by definition {1}</xs:documentation> </xs:annotation> </xs:enumeration> <xs:enumeration value="FullSubtypeStoredDerivation"> <xs:annotation> <xs:documentation>Description: Used to specify a fully derived (and stored) subtype derivation rule. -Format: **each {0} is {1}</xs:documentation> +Format: **each {0} is by definition {1}</xs:documentation> </xs:annotation> </xs:enumeration> <xs:enumeration value="FullStoredSubtypeDescription"> @@ -1219,13 +1219,13 @@ <xs:enumeration value="PartialSubtypeDerivation"> <xs:annotation> <xs:documentation>Description: Used to specify a partially derived subtype derivation rule. -Format: +each derived {0} is {1}</xs:documentation> +Format: +each derived {0} is by definition {1}</xs:documentation> </xs:annotation> </xs:enumeration> <xs:enumeration value="PartialSubtypeStoredDerivation"> <xs:annotation> <xs:documentation>Description: Used to specify a partially derived (and stored) subtype derivation rule. -Format: ++each derived {0} is {1}</xs:documentation> +Format: ++each derived {0} is by definition {1}</xs:documentation> </xs:annotation> </xs:enumeration> <xs:enumeration value="PartialStoredSubtypeDescription"> @@ -1267,7 +1267,7 @@ <xs:documentation>Description: Specify a space-separated list of snippet names to specify list snippets that would allow lead role collapsing based on the RolePathCollapsibleLeadDirective, but do not actually support this construct. This allows a final override to block the collapsing behavior for specific snippets. This is checked for the -(Negated)[And|Or|Xor][Tail|Nested]List[(Collapsed)Open|Separator] snippets. +(Negated)[Chained|And|Or|Xor][Tail|Nested]List[(Collapsed)Open|Separator] and the ChainedList*Restrction* snippets. Format: AndTailListOpen OrTailListOpen</xs:documentation> </xs:annotation> </xs:enumeration> Modified: trunk/ORMModel/ObjectModel/VerbalizationCoreSnippetsDocumentation.html =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationCoreSnippetsDocumentation.html 2013-10-18 03:44:19 UTC (rev 1528) +++ trunk/ORMModel/ObjectModel/VerbalizationCoreSnippetsDocumentation.html 2013-10-28 01:32:57 UTC (rev 1529) @@ -4401,13 +4401,13 @@ <div class="snippetStatement"> <strong>Description: </strong> Used to specify a fully derived subtype derivation rule. <br /> - <strong>Format: </strong> *each {0} is {1}</div> + <strong>Format: </strong> *each {0} is by definition {1}</div> <div class="snippetReplacementFieldCount"> <span class="reportItem">Number of replacement fields: </span>2</div> <div class="snippetUnformattedText"> <span class="reportItem">Unformatted version: </span> <div class="unformattedSnippet"> - <pre class="unformattedSnippetDecorator">*Each {0} is {1}</pre> + <pre class="unformattedSnippetDecorator">*Each {0} is by definition {1}</pre> </div> </div> </div> @@ -4418,13 +4418,13 @@ <div class="snippetStatement"> <strong>Description: </strong> Used to specify a fully derived (and stored) subtype derivation rule. <br /> - <strong>Format: </strong> **each {0} is {1}</div> + <strong>Format: </strong> **each {0} is by definition {1}</div> <div class="snippetReplacementFieldCount"> <span class="reportItem">Number of replacement fields: </span>2</div> <div class="snippetUnformattedText"> <span class="reportItem">Unformatted version: </span> <div class="unformattedSnippet"> - <pre class="unformattedSnippetDecorator">**Each {0} is {1}</pre> + <pre class="unformattedSnippetDecorator">**Each {0} is by definition {1}</pre> </div> </div> </div> @@ -7473,13 +7473,13 @@ <div class="snippetStatement"> <strong>Description: </strong> Used to specify a partially derived subtype derivation rule. <br /> - <strong>Format: </strong> +each derived {0} is {1}</div> + <strong>Format: </strong> +each derived {0} is by definition {1}</div> <div class="snippetReplacementFieldCount"> <span class="reportItem">Number of replacement fields: </span>2</div> <div class="snippetUnformattedText"> <span class="reportItem">Unformatted version: </span> <div class="unformattedSnippet"> - <pre class="unformattedSnippetDecorator">+each derived {0} is {1}</pre> + <pre class="unformattedSnippetDecorator">+each derived {0} is by definition {1}</pre> </div> </div> </div> @@ -7490,13 +7490,13 @@ <div class="snippetStatement"> <strong>Description: </strong> Used to specify a partially derived (and stored) subtype derivation rule. <br /> - <strong>Format: </strong> ++each derived {0} is {1}</div> + <strong>Format: </strong> ++each derived {0} is by definition {1}</div> <div class="snippetReplacementFieldCount"> <span class="reportItem">Number of replacement fields: </span>2</div> <div class="snippetUnformattedText"> <span class="reportItem">Unformatted version: </span> <div class="unformattedSnippet"> - <pre class="unformattedSnippetDecorator">++each derived {0} is {1}</pre> + <pre class="unformattedSnippetDecorator">++each derived {0} is by definition {1}</pre> </div> </div> </div> Modified: trunk/ORMModel/ObjectModel/VerbalizationDocumentation.xml =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationDocumentation.xml 2013-10-18 03:44:19 UTC (rev 1528) +++ trunk/ORMModel/ObjectModel/VerbalizationDocumentation.xml 2013-10-28 01:32:57 UTC (rev 1529) @@ -1318,16 +1318,16 @@ </snippet> <snippet name="FullSubtypeDerivation" replacementCount="2"> <statement>Description: Used to specify a fully derived subtype derivation rule. -Format: *each {0} is {1}</statement> - <unformattedSnippet>*Each {0} is {1}</unformattedSnippet> +Format: *each {0} is by definition {1}</statement> + <unformattedSnippet>*Each {0} is by definition {1}</unformattedSnippet> <contains /> <containedIn /> <usedBy /> </snippet> <snippet name="FullSubtypeStoredDerivation" replacementCount="2"> <statement>Description: Used to specify a fully derived (and stored) subtype derivation rule. -Format: **each {0} is {1}</statement> - <unformattedSnippet>**Each {0} is {1}</unformattedSnippet> +Format: **each {0} is by definition {1}</statement> + <unformattedSnippet>**Each {0} is by definition {1}</unformattedSnippet> <contains /> <containedIn /> <usedBy /> @@ -2593,16 +2593,16 @@ </snippet> <snippet name="PartialSubtypeDerivation" replacementCount="2"> <statement>Description: Used to specify a partially derived subtype derivation rule. -Format: +each derived {0} is {1}</statement> - <unformattedSnippet>+each derived {0} is {1}</unformattedSnippet> +Format: +each derived {0} is by definition {1}</statement> + <unformattedSnippet>+each derived {0} is by definition {1}</unformattedSnippet> <contains /> <containedIn /> <usedBy /> </snippet> <snippet name="PartialSubtypeStoredDerivation" replacementCount="2"> <statement>Description: Used to specify a partially derived (and stored) subtype derivation rule. -Format: ++each derived {0} is {1}</statement> - <unformattedSnippet>++each derived {0} is {1}</unformattedSnippet> +Format: ++each derived {0} is by definition {1}</statement> + <unformattedSnippet>++each derived {0} is by definition {1}</unformattedSnippet> <contains /> <containedIn /> <usedBy /> Modified: trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs 2013-10-18 03:44:19 UTC (rev 1528) +++ trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs 2013-10-28 01:32:57 UTC (rev 1529) @@ -422,11 +422,11 @@ FullStoredSubtypeDescription, /// <summary>The 'FullSubtypeDerivation' format string snippet. Contains 2 replacement fields.</summary> /// <remark>Description: Used to specify a fully derived subtype derivation rule. - /// Format: *each {0} is {1}</remark> + /// Format: *each {0} is by definition {1}</remark> FullSubtypeDerivation, /// <summary>The 'FullSubtypeStoredDerivation' format string snippet. Contains 2 replacement fields.</summary> /// <remark>Description: Used to specify a fully derived (and stored) subtype derivation rule. - /// Format: **each {0} is {1}</remark> + /// Format: **each {0} is by definition {1}</remark> FullSubtypeStoredDerivation, /// <summary>The 'GreaterThanOrEqualValueComparator' format string snippet. Contains 2 replacement fields.</summary> /// <remark>Description: Used to compare the two values in a value comparison constraint with a 'greater than or equal' operator. @@ -855,11 +855,11 @@ PartialStoredSubtypeDescription, /// <summary>The 'PartialSubtypeDerivation' format string snippet. Contains 2 replacement fields.</summary> /// <remark>Description: Used to specify a partially derived subtype derivation rule. - /// Format: +each derived {0} is {1}</remark> + /// Format: +each derived {0} is by definition {1}</remark> PartialSubtypeDerivation, /// <summary>The 'PartialSubtypeStoredDerivation' format string snippet. Contains 2 replacement fields.</summary> /// <remark>Description: Used to specify a partially derived (and stored) subtype derivation rule. - /// Format: ++each derived {0} is {1}</remark> + /// Format: ++each derived {0} is by definition {1}</remark> PartialSubtypeStoredDerivation, /// <summary>The 'PeriodSeparator' format string snippet. Contains 2 replacement fields.</summary> /// <remark>Description: Used to delimit two snippet replacements by a snippet. @@ -922,7 +922,7 @@ /// <remark>Description: Specify a space-separated list of snippet names to specify list snippets that /// would allow lead role collapsing based on the RolePathCollapsibleLeadDirective, but do not actually support this construct. /// This allows a final override to block the collapsing behavior for specific snippets. This is checked for the - /// (Negated)[And|Or|Xor][Tail|Nested]List[(Collapsed)Open|Separator] snippets. + /// (Negated)[Chained|And|Or|Xor][Tail|Nested]List[(Collapsed)Open|Separator] and the ChainedList*Restrction* snippets. /// Format: AndTailListOpen OrTailListOpen</remark> RolePathBlockLeadCollapseForSnippetDirective, /// <summary>The 'RolePathCollapsibleLeadDirective' simple snippet value.</summary> @@ -1282,8 +1282,8 @@ @"<span class=""quantifier"">**</span>{0} <span class=""quantifier"">if and only if</span><br/>{1}<br/>", @"<span class=""indent""><span class=""quantifier"">instances of this fact type are stored immediately after they are derived</span></span>", @"<span class=""smallIndent""><span class=""quantifier"">instances of this subtype are stored immediately after they are derived</span></span>", - @"<span class=""quantifier"">*Each</span> {0} <span class=""quantifier"">is</span> {1}", - @"<span class=""quantifier"">**Each</span> {0} <span class=""quantifier"">is</span> {1}", + @"<span class=""quantifier"">*Each</span> {0} <span class=""quantifier"">is by definition</span> {1}", + @"<span class=""quantifier"">**Each</span> {0} <span class=""quantifier"">is by definition</span> {1}", @"{0}<span class=""quantifier""> is greather than or equal to </span>{1}", @"{0}<span class=""quantifier""> is greater than </span>{1}", @"<span class=""quantifier"">all or none of the following hold:</span> {0}", @@ -1412,8 +1412,8 @@ @"<span class=""quantifier""><sup style=""font-size:smaller;"">++</sup></span>{0} <span class=""quantifier"">if</span><br/>{1}<br/>", @"<span class=""indent""><span class=""quantifier"">derived instances of this fact type are also stored immediately after they are derived</span></span>", @"<span class=""smallIndent""><span class=""quantifier"">derived instances of this subtype are also stored immediately after they are derived</span></span>", - @"<span class=""quantifier""><sup style=""font-size:smaller;"">+</sup>each derived</span> {0} <span class=""quantifier"">is</span> {1}", - @"<span class=""quantifier""><sup style=""font-size:smaller;"">++</sup>each derived</span> {0} <span class=""quantifier"">is</span> {1}", + @"<span class=""quantifier""><sup style=""font-size:smaller;"">+</sup>each derived</span> {0} <span class=""quantifier"">is by definition</span> {1}", + @"<span class=""quantifier""><sup style=""font-size:smaller;"">++</sup>each derived</span> {0} <span class=""quantifier"">is by definition</span> {1}", @"{0}<span class=""listSeparator"">.</span>{1}", @"{0} <span class=""quantifier"">who is</span> {1}", @"{1} <span class=""quantifier"">is</span> {0} <span class=""quantifier"">who</span>", @@ -1430,7 +1430,7 @@ @"<span class=""smallIndent""><span class=""quantifier"">Reference Scheme:</span> {0}</span>", @"<span class=""quantifier"">itself</span>", @"{0} <span class=""quantifier"">itself</span>", - "AndTailListOpen OrTailListOpen", + "AndTailListOpen OrTailListOpen ChainedListLocalRestrictionSeparator ChainedListComplexRestrictionSeparator ChainedListComplexRestrictionSeparator ChainedListTopLevelComplexRestrictionSeparator", "And Or Chain", "And Or Chain", "!And !Or Xor !Xor", @@ -1636,8 +1636,8 @@ @"<span class=""quantifier"">**</span>{0} <span class=""quantifier"">if and only if</span><br/>{1}<br/>", @"<span class=""indent""><span class=""quantifier"">instances of this fact type are stored immediately after they are derived</span></span>", @"<span class=""smallIndent""><span class=""quantifier"">instances of this subtype are stored immediately after they are derived</span></span>", - @"<span class=""quantifier"">*Each</span> {0} <span class=""quantifier"">is</span> {1}", - @"<span class=""quantifier"">**Each</span> {0} <span class=""quantifier"">is</span> {1}", + @"<span class=""quantifier"">*Each</span> {0} <span class=""quantifier"">is by definition</span> {1}", + @"<span class=""quantifier"">**Each</span> {0} <span class=""quantifier"">is by definition</span> {1}", @"{0}<span class=""quantifier""> is greather than or equal to </span>{1}", @"{0}<span class=""quantifier""> is greater than </span>{1}", @"<span class=""quantifier"">all or none of the following hold:</span> {0}", @@ -1766,8 +1766,8 @@ @"<span class=""quantifier""><sup style=""font-size:smaller;"">++</sup></span>{0} <span class=""quantifier"">if</span><br/>{1}<br/>", @"<span class=""indent""><span class=""quantifier"">derived instances of this fact type are also stored immediately after they are derived</span></span>", @"<span class=""smallIndent""><span class=""quantifier"">derived instances of this subtype are also stored immediately after they are derived</span></span>", - @"<span class=""quantifier""><sup style=""font-size:smaller;"">+</sup>each derived</span> {0} <span class=""quantifier"">is</span> {1}", - @"<span class=""quantifier""><sup style=""font-size:smaller;"">++</sup>each derived</span> {0} <span class=""quantifier"">is</span> {1}", + @"<span class=""quantifier""><sup style=""font-size:smaller;"">+</sup>each derived</span> {0} <span class=""quantifier"">is by definition</span> {1}", + @"<span class=""quantifier""><sup style=""font-size:smaller;"">++</sup>each derived</span> {0} <span class=""quantifier"">is by definition</span> {1}", @"{0}<span class=""listSeparator"">.</span>{1}", @"{0} <span class=""quantifier"">who is</span> {1}", @"{1} <span class=""quantifier"">is</span> {0} <span class=""quantifier"">who</span>", @@ -1784,7 +1784,7 @@ @"<span class=""smallIndent""><span class=""quantifier"">Reference Scheme:</span> {0}</span>", @"<span class=""quantifier"">itself</span>", @"{0} <span class=""quantifier"">itself</span>", - "AndTailListOpen OrTailListOpen", + "AndTailListOpen OrTailListOpen ChainedListLocalRestrictionSeparator ChainedListComplexRestrictionSeparator ChainedListComplexRestrictionSeparator ChainedListTopLevelComplexRestrictionSeparator", "And Or Chain", "And Or Chain", "!And !Or Xor !Xor", @@ -1990,8 +1990,8 @@ @"<span class=""quantifier"">**</span>{0} <span class=""quantifier"">if and only if</span><br/>{1}<br/>", @"<span class=""indent""><span class=""quantifier"">instances of this fact type are stored immediately after they are derived</span></span>", @"<span class=""smallIndent""><span class=""quantifier"">instances of this subtype are stored immediately after they are derived</span></span>", - @"<span class=""quantifier"">*Each</span> {0} <span class=""quantifier"">is</span> {1}", - @"<span class=""quantifier"">**Each</span> {0} <span class=""quantifier"">is</span> {1}", + @"<span class=""quantifier"">*Each</span> {0} <span class=""quantifier"">is by definition</span> {1}", + @"<span class=""quantifier"">**Each</span> {0} <span class=""quantifier"">is by definition</span> {1}", @"{0}<span class=""quantifier""> is greather than or equal to </span>{1}", @"{0}<span class=""quantifier""> is greater than </span>{1}", @"<span class=""quantifier"">all or none of the following hold:</span> {0}", @@ -2120,8 +2120,8 @@ @"<span class=""quantifier""><sup style=""font-size:smaller;"">++</sup></span>{0} <span class=""quantifier"">if</span><br/>{1}<br/>", @"<span class=""indent""><span class=""quantifier"">derived instances of this fact type are also stored immediately after they are derived</span></span>", @"<span class=""smallIndent""><span class=""quantifier"">derived instances of this subtype are also stored immediately after they are derived</span></span>", - @"<span class=""quantifier""><sup style=""font-size:smaller;"">+</sup>each derived</span> {0} <span class=""quantifier"">is</span> {1}", - @"<span class=""quantifier""><sup style=""font-size:smaller;"">++</sup>each derived</span> {0} <span class=""quantifier"">is</span> {1}", + @"<span class=""quantifier""><sup style=""font-size:smaller;"">+</sup>each derived</span> {0} <span class=""quantifier"">is by definition</span> {1}", + @"<span class=""quantifier""><sup style=""font-size:smaller;"">++</sup>each derived</span> {0} <span class=""quantifier"">is by definition</span> {1}", @"{0}<span class=""listSeparator"">.</span>{1}", @"{0} <span class=""quantifier"">who is</span> {1}", @"{1} <span class=""quantifier"">is</span> {0} <span class=""quantifier"">who</span>", @@ -2138,7 +2138,7 @@ @"<span class=""smallIndent""><span class=""quantifier"">Reference Scheme:</span> {0}</span>", @"<span class=""quantifier"">itself</span>", @"{0} <span class=""quantifier"">itself</span>", - "AndTailListOpen OrTailListOpen", + "AndTailListOpen OrTailListOpen ChainedListLocalRestrictionSeparator ChainedListComplexRestrictionSeparator ChainedListComplexRestrictionSeparator ChainedListTopLevelComplexRestrictionSeparator", "And Or Chain", "And Or Chain", "!And !Or Xor !Xor", @@ -2344,8 +2344,8 @@ @"<span class=""quantifier"">**</span>{0} <span class=""quantifier"">if and only if</span><br/>{1}<br/>", @"<span class=""indent""><span class=""quantifier"">instances of this fact type are stored immediately after they are derived</span></span>", @"<span class=""smallIndent""><span class=""quantifier"">instances of this subtype are stored immediately after they are derived</span></span>", - @"<span class=""quantifier"">*Each</span> {0} <span class=""quantifier"">is</span> {1}", - @"<span class=""quantifier"">**Each</span> {0} <span class=""quantifier"">is</span> {1}", + @"<span class=""quantifier"">*Each</span> {0} <span class=""quantifier"">is by definition</span> {1}", + @"<span class=""quantifier"">**Each</span> {0} <span class=""quantifier"">is by definition</span> {1}", @"{0}<span class=""quantifier""> is greather than or equal to </span>{1}", @"{0}<span class=""quantifier""> is greater than </span>{1}", @"<span class=""quantifier"">all or none of the following hold:</span> {0}", @@ -2474,8 +2474,8 @@ @"<span class=""quantifier""><sup style=""font-size:smaller;"">++</sup></span>{0} <span class=""quantifier"">if</span><br/>{1}<br/>", @"<span class=""indent""><span class=""quantifier"">derived instances of this fact type are also stored immediately after they are derived</span></span>", @"<span class=""smallIndent""><span class=""quantifier"">derived instances of this subtype are also stored immediately after they are derived</span></span>", - @"<span class=""quantifier""><sup style=""font-size:smaller;"">+</sup>each derived</span> {0} <span class=""quantifier"">is</span> {1}", - @"<span class=""quantifier""><sup style=""font-size:smaller;"">++</sup>each derived</span> {0} <span class=""quantifier"">is</span> {1}", + @"<span class=""quantifier""><sup style=""font-size:smaller;"">+</sup>each derived</span> {0} <span class=""quantifier"">is by definition</span> {1}", + @"<span class=""quantifier""><sup style=""font-size:smaller;"">++</sup>each derived</span> {0} <span class=""quantifier"">is by definition</span> {1}", @"{0}<span class=""listSeparator"">.</span>{1}", @"{0} <span class=""quantifier"">who is</span> {1}", @"{1} <span class=""quantifier"">is</span> {0} <span class=""quantifier"">who</span>", @@ -2492,7 +2492,7 @@ @"<span class=""smallIndent""><span class=""quantifier"">Reference Scheme:</span> {0}</span>", @"<span class=""quantifier"">itself</span>", @"{0} <span class=""quantifier"">itself</span>", - "AndTailListOpen OrTailListOpen", + "AndTailListOpen OrTailListOpen ChainedListLocalRestrictionSeparator ChainedListComplexRestrictionSeparator ChainedListComplexRestrictionSeparator ChainedListTopLevelComplexRestrictionSeparator", "And Or Chain", "And Or Chain", "!And !Or Xor !Xor", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2013-08-25 03:53:00
|
Revision: 1521 http://sourceforge.net/p/orm/code/1521 Author: mcurland Date: 2013-08-25 03:52:55 +0000 (Sun, 25 Aug 2013) Log Message: ----------- Miscellaneous bug fixes: * Context window not populating (broken by more stringent partition check in [1518]) * Added Ctrl-=-0 key bindings for zoom in/out/100%. Left in Ctrl-Shift-=-0 bindings as well, but Ctrl-Shift-0 is a system hotkey used for keyboard switching in and after Win7. * Sample population errors on disjunctive mandatory constraints could not be cleared if the constrained roles had different (compatible) role players. Added tests to look for subtype instances in the population. * Choosing the RequireUserModification option during database import caused a schema violation error during load. Modified Paths: -------------- trunk/ORMModel/ObjectModel/SamplePopulation.cs trunk/ORMModel/ShapeModel/ORMDiagram.cs trunk/ORMModel/Shell/Converters/OIALtoORM.xslt trunk/ORMModel/Shell/ORMContextWindow.cs trunk/ORMModel/Shell/PackageResources/PkgCmd.vsct Modified: trunk/ORMModel/ObjectModel/SamplePopulation.cs =================================================================== --- trunk/ORMModel/ObjectModel/SamplePopulation.cs 2013-07-28 22:58:39 UTC (rev 1520) +++ trunk/ORMModel/ObjectModel/SamplePopulation.cs 2013-08-25 03:52:55 UTC (rev 1521) @@ -3903,6 +3903,8 @@ if (null != (objectType = this.ObjectType)) { LinkedElementCollection<Role> playedRoles = objectType.PlayedRoleCollection; + LinkedElementCollection<EntityTypeSubtypeInstance> subtypeInstances = null; + bool retrievedSubtypeInstances = false; int playedRoleCount = playedRoles.Count; LinkedElementCollection<PopulationMandatoryError> errors = this.PopulationMandatoryErrorCollection; if (playedRoleCount == 0) @@ -4048,9 +4050,60 @@ } else { - ReadOnlyLinkedElementCollection<ObjectTypeInstance> roleInstances = (currentRole == constraintRole) ? currentRoleInstances : constraintRole.ObjectTypeInstanceCollection; - if (roleInstances.Contains(this)) + ReadOnlyLinkedElementCollection<ObjectTypeInstance> roleInstances; + ObjectTypeInstance findInstance; + if (currentRole == constraintRole) { + roleInstances = currentRoleInstances; + findInstance = this; + } + else + { + roleInstances = constraintRole.ObjectTypeInstanceCollection; + ObjectType roleType = constraintRole.RolePlayer; + if (roleType == objectType) + { + findInstance = this; + } + else + { + findInstance = null; + if (!retrievedSubtypeInstances) + { + retrievedSubtypeInstances = true; + EntityTypeInstance entityInstance; + EntityTypeSubtypeInstance subtypeInstance; + if (null != (entityInstance = this as EntityTypeInstance)) + { + subtypeInstances = entityInstance.EntityTypeSubtypeInstanceCollection; + } + else if (null != (subtypeInstance = this as EntityTypeSubtypeInstance)) + { + subtypeInstances = subtypeInstance.SupertypeInstance.EntityTypeSubtypeInstanceCollection; + } + if (subtypeInstances != null && + subtypeInstances.Count == 0) + { + subtypeInstances = null; + } + } + if (subtypeInstances != null) + { + foreach (EntityTypeSubtypeInstance subtypeInstance in subtypeInstances) + { + if (subtypeInstance.EntityTypeSubtype == roleType) + { + findInstance = subtypeInstance; + break; + } + } + } + } + } + //= (currentRole == constraintRole) ? currentRoleInstances : constraintRole.ObjectTypeInstanceCollection; + if (findInstance != null && + roleInstances.Contains(findInstance)) + { break; } } Modified: trunk/ORMModel/ShapeModel/ORMDiagram.cs =================================================================== --- trunk/ORMModel/ShapeModel/ORMDiagram.cs 2013-07-28 22:58:39 UTC (rev 1520) +++ trunk/ORMModel/ShapeModel/ORMDiagram.cs 2013-08-25 03:52:55 UTC (rev 1521) @@ -1087,6 +1087,17 @@ return element; } /// <summary> + /// Customizable test to determine if shapes should be + /// created for elements in a given partition. Allows a + /// diagram and the elements it is displaying to be in + /// different partitions. Implementations of this callback + /// should use the <see cref="Partition.AlternateId"/> property + /// of the provided partition instead of the <see cref="Partition"/> + /// instance so that drag-drop from others models is supported. + /// </summary> + [NonSerialized] + public Predicate<Partition> ForeignPartitionTest = null; + /// <summary> /// Check if the element has valid ownership for appearing /// on this diagram. Allows ORM elements to be used in structures /// outside the core model without appearing on a diagram. @@ -1097,7 +1108,11 @@ { // Use the partition id instead of the partition itself so that dragging // from other models is supported. - return element.Partition.AlternateId == this.Partition.AlternateId && !(element is IHasAlternateOwner); + Predicate<Partition> partitionTest = ForeignPartitionTest; + return (partitionTest != null ? + partitionTest(element.Partition) : + element.Partition.AlternateId == this.Partition.AlternateId) && + !(element is IHasAlternateOwner); } /// <summary> /// Called as a result of the FixUpDiagram calls Modified: trunk/ORMModel/Shell/Converters/OIALtoORM.xslt =================================================================== --- trunk/ORMModel/Shell/Converters/OIALtoORM.xslt 2013-07-28 22:58:39 UTC (rev 1520) +++ trunk/ORMModel/Shell/Converters/OIALtoORM.xslt 2013-08-25 03:52:55 UTC (rev 1521) @@ -72,7 +72,7 @@ <xsl:if test="$RequireReadingModification"> <orm:ModelErrors> <xsl:for-each select="$allFactTypes/orm:ReadingOrders/orm:ReadingOrder/orm:Readings/orm:Reading"> - <orm:ReadingRequiresUserModificationError id="ReadingRequiresUserModificationError.{@id}"> + <orm:ReadingRequiresUserModificationError Name="" id="ReadingRequiresUserModificationError.{@id}"> <orm:Reading ref="{@id}"/> </orm:ReadingRequiresUserModificationError> </xsl:for-each> Modified: trunk/ORMModel/Shell/ORMContextWindow.cs =================================================================== --- trunk/ORMModel/Shell/ORMContextWindow.cs 2013-07-28 22:58:39 UTC (rev 1520) +++ trunk/ORMModel/Shell/ORMContextWindow.cs 2013-08-25 03:52:55 UTC (rev 1521) @@ -571,6 +571,10 @@ using (Transaction t = store.TransactionManager.BeginTransaction("Create Context Diagram")) { diagram = new ORMDiagram(partition); + diagram.ForeignPartitionTest = delegate(Partition elementPartition) + { + return elementPartition.AlternateId == null; + }; diagram.Associate(myDiagramView); myDiagramView.HasWatermark = false; diagram.ModelElement = model; Modified: trunk/ORMModel/Shell/PackageResources/PkgCmd.vsct =================================================================== --- trunk/ORMModel/Shell/PackageResources/PkgCmd.vsct 2013-07-28 22:58:39 UTC (rev 1520) +++ trunk/ORMModel/Shell/PackageResources/PkgCmd.vsct 2013-08-25 03:52:55 UTC (rev 1521) @@ -944,8 +944,13 @@ <KeyBinding guid="guidORMDesignerCommandSet" id="cmdIdViewReferenceModeEditor" editor="guidORMDesignerEditor" key1="W" mod1="Control" key2="E" mod2="Control"/> <KeyBinding guid="guidORMDesignerCommandSet" id="cmdIdViewContextWindow" editor="guidORMDesignerEditor" key1="W" mod1="Control" key2="C" mod2="Control"/> <KeyBinding guid="guidORMDesignerCommandSet" id="cmdIdViewDiagramSpyWindow" editor="guidORMDesignerEditor" key1="W" mod1="Control" key2="D" mod2="Control"/> + <KeyBinding guid="guidORMDesignerCommandSet" id="cmdIdZoom100" editor="guidORMDesignerEditor" key1="48" mod1="Control"/> + <!-- Note that Control-Shift-0 is a default windows hotkey in and after Windows 7. This was the original setting, but the control-only + versionts needed to be added so that Zoom100 would have a normal hotkey. --> <KeyBinding guid="guidORMDesignerCommandSet" id="cmdIdZoom100" editor="guidORMDesignerEditor" key1="48" mod1="Control Shift"/> + <KeyBinding guid="guidORMDesignerCommandSet" id="cmdIdZoomIn" editor="guidORMDesignerEditor" key1="187" mod1="Control"/> <KeyBinding guid="guidORMDesignerCommandSet" id="cmdIdZoomIn" editor="guidORMDesignerEditor" key1="187" mod1="Control Shift"/> + <KeyBinding guid="guidORMDesignerCommandSet" id="cmdIdZoomOut" editor="guidORMDesignerEditor" key1="189" mod1="Control"/> <KeyBinding guid="guidORMDesignerCommandSet" id="cmdIdZoomOut" editor="guidORMDesignerEditor" key1="189" mod1="Control Shift"/> <!-- Fact editor key bindings--> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2013-07-28 22:58:41
|
Revision: 1520 http://sourceforge.net/p/orm/code/1520 Author: mcurland Date: 2013-07-28 22:58:39 +0000 (Sun, 28 Jul 2013) Log Message: ----------- Wrong variable in error reporting blocked renaming of an object type with a role in a populated fact type. Issue introduced in [1515]. Modified Paths: -------------- trunk/ORMModel/ObjectModel/Role.cs Modified: trunk/ORMModel/ObjectModel/Role.cs =================================================================== --- trunk/ORMModel/ObjectModel/Role.cs 2013-07-24 09:40:16 UTC (rev 1519) +++ trunk/ORMModel/ObjectModel/Role.cs 2013-07-28 22:58:39 UTC (rev 1520) @@ -1220,7 +1220,7 @@ } ReadOnlyCollection<DerivedRoleProjection> projections = DerivedRoleProjection.GetLinksToDerivationProjectionCollection(this); - count = roleInstances.Count; + count = projections.Count; for (int i = 0; i < count; ++i) { DerivedRoleRequiresCompatibleProjectionError compatibilityError = projections[i].IncompatibleProjectionError; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2013-05-19 05:07:33
|
Revision: 1518 http://orm.svn.sourceforge.net/orm/?rev=1518&view=rev Author: mcurland Date: 2013-05-19 05:07:26 +0000 (Sun, 19 May 2013) Log Message: ----------- * Fixed bug with subset constraint from subtype to role in simple case with no supertypes between the subtype and role. Modified Paths: -------------- trunk/ORMModel/ObjectModel/Constraint.cs trunk/Setup/Readme.htm Modified: trunk/ORMModel/ObjectModel/Constraint.cs =================================================================== --- trunk/ORMModel/ObjectModel/Constraint.cs 2013-05-17 23:23:44 UTC (rev 1517) +++ trunk/ORMModel/ObjectModel/Constraint.cs 2013-05-19 05:07:26 UTC (rev 1518) @@ -2544,9 +2544,11 @@ } } else if (subsetSupertypeRole != null && - column == 0 && - sequence == 1 && - !superTypesCache.ContainsKey(currentRolePlayer)) + column == 0 && + sequence == 1 && + populatedCaches && + populatedCachesForType != currentRolePlayer && + (superTypesCache == null || !superTypesCache.ContainsKey(currentRolePlayer))) { // Don't set if not compatible. hasSubtypeSubsetError = true; Modified: trunk/Setup/Readme.htm =================================================================== --- trunk/Setup/Readme.htm 2013-05-17 23:23:44 UTC (rev 1517) +++ trunk/Setup/Readme.htm 2013-05-19 05:07:26 UTC (rev 1518) @@ -44,7 +44,7 @@ <hr/> <h2>May 2013 CTP Changes</h2> -<div>The May 2013 CTP release includes all modifications through changeset 1517. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<div>The May 2013 CTP release includes all modifications through changeset 1518. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> <ul> <li>Feature Changes: <ol> @@ -61,6 +61,7 @@ <li>Modified z-order on an ORM diagram to ensure consistent display. By default, z-order is determined by shape creation order. Creating a new shape for an object type or fact type that uses an existing role connector would draw the connector behind the shape. This was especially noticable with objectified fact types, which could obscur the role player connects behind the objectified fact type shape.</li> <li>Verbalization of disjunctive mandatory constraints over multiple roles in the same fact type and multiple role player types was incorrectly correlating unrelated variables.</li> <li>Fixed a timing issue with shape deletion. If mouse movement started a tooltip timer on a shape that was deleted before the timer fired and the tooltip requested text, then the IDE would crash. This was hard to hit, but was not recoverable and resulted in data loss.</li> +<li>Validating a subset constraint from a subtype to a single role crashes if the supertype hierarchy is not sufficiently complex.</li> </ol> </li> </ul> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2013-05-17 23:24:37
|
Revision: 1517 http://orm.svn.sourceforge.net/orm/?rev=1517&view=rev Author: mcurland Date: 2013-05-17 23:23:44 +0000 (Fri, 17 May 2013) Log Message: ----------- * Fix crash with tooltip timers. Shape deletion after a tooltip timer begins but before it fires crashes VS and results in data loss. * Introduce nested 'and' and 'or' blocks in role path verbalization using 'where' instead of 'and'. * Use parentheses around all negated path verbalization expressions, 'it is not true that (...)'. This reduces confusion with nested expressions. This is likely to be relaxed in the future so that simple single clause negations are not parenthesized. * Remove some vertical whitespace from the relational view table header. * Updated version to May 2013 in preparation for public release. refs #193 Modified Paths: -------------- trunk/AlternateViews/RelationalView/GeneratedCode/Shapes.VS2010.cs trunk/AlternateViews/RelationalView/GeneratedCode/Shapes.cs trunk/AlternateViews/RelationalView/RelationalShape.dsl trunk/ORMModel/ObjectModel/ObjectType.cs trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xml trunk/ORMModel/ObjectModel/VerbalizationCoreSnippetsDocumentation.html trunk/ORMModel/ObjectModel/VerbalizationDocumentation.xml trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs trunk/ORMModel/ShapeModel/ExternalConstraintShape.cs trunk/ORMModel/ShapeModel/FactTypeShape.cs trunk/ORMModel/ShapeModel/ObjectTypeShape.cs trunk/ORMModel/ShapeModel/ValueRangeShape.cs trunk/Setup/Readme.htm trunk/VersionGenerator.exe.config Modified: trunk/AlternateViews/RelationalView/GeneratedCode/Shapes.VS2010.cs =================================================================== --- trunk/AlternateViews/RelationalView/GeneratedCode/Shapes.VS2010.cs 2013-04-23 22:04:54 UTC (rev 1516) +++ trunk/AlternateViews/RelationalView/GeneratedCode/Shapes.VS2010.cs 2013-05-17 23:23:44 UTC (rev 1517) @@ -138,7 +138,7 @@ { get { - return new DslDiagrams::SizeD(1, 0.3); + return new DslDiagrams::SizeD(1, 0.25); } } #endregion Modified: trunk/AlternateViews/RelationalView/GeneratedCode/Shapes.cs =================================================================== --- trunk/AlternateViews/RelationalView/GeneratedCode/Shapes.cs 2013-04-23 22:04:54 UTC (rev 1516) +++ trunk/AlternateViews/RelationalView/GeneratedCode/Shapes.cs 2013-05-17 23:23:44 UTC (rev 1517) @@ -136,7 +136,7 @@ { get { - return new DslDiagrams::SizeD(1, 0.3); + return new DslDiagrams::SizeD(1, 0.25); } } #endregion Modified: trunk/AlternateViews/RelationalView/RelationalShape.dsl =================================================================== --- trunk/AlternateViews/RelationalView/RelationalShape.dsl 2013-04-23 22:04:54 UTC (rev 1516) +++ trunk/AlternateViews/RelationalView/RelationalShape.dsl 2013-05-17 23:23:44 UTC (rev 1517) @@ -34,7 +34,7 @@ </Attributes> <Shapes> - <CompartmentShape Name="TableShape" Id="50DABFCD-909C-418A-8895-172AADAAD4FB" Namespace="ORMSolutions.ORMArchitect.Views.RelationalView" GeneratesDoubleDerived="true" InitialHeight="0.3" InitialWidth="1" OutlineThickness="0.015625" AccessModifier="Assembly"> + <CompartmentShape Name="TableShape" Id="50DABFCD-909C-418A-8895-172AADAAD4FB" Namespace="ORMSolutions.ORMArchitect.Views.RelationalView" GeneratesDoubleDerived="true" InitialHeight="0.25" InitialWidth="1" OutlineThickness="0.015625" AccessModifier="Assembly"> <Attributes> <ClrAttribute Name="global::System.ComponentModel.TypeDescriptionProvider"> <Parameters> Modified: trunk/ORMModel/ObjectModel/ObjectType.cs =================================================================== --- trunk/ORMModel/ObjectModel/ObjectType.cs 2013-04-23 22:04:54 UTC (rev 1516) +++ trunk/ORMModel/ObjectModel/ObjectType.cs 2013-05-17 23:23:44 UTC (rev 1517) @@ -1757,7 +1757,7 @@ if (!WalkSupertypesForNearestCompatibleTypes(typeNodes, passedExclusions, currentObjectType, currentRoleIndex)) { // Exclusion checking failed, get out. - return null; + return EmptyArray; } ++expectedVisitCount; } Modified: trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xml =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xml 2013-04-23 22:04:54 UTC (rev 1516) +++ trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xml 2013-05-17 23:23:44 UTC (rev 1517) @@ -316,7 +316,7 @@ <!-- Role plath list management --> <Snippet type="RolePathListCloseOutdentSnippets"><![CDATA[ChainedListClose NegatedChainedListClose AndTailListClose AndNestedListClose NegatedAndLeadListClose NegatedAndTailListClose NegatedAndNestedListClose OrTailListClose OrNestedListClose NegatedOrLeadListClose NegatedOrTailListClose NegatedOrNestedListClose XorLeadListClose XorTailListClose XorNestedListClose NegatedXorLeadListClose NegatedXorTailListClose NegatedXorNestedListClose]]></Snippet> - <Snippet type="RolePathOutdentAwareTrailingListSnippets"><![CDATA[NegatedAndLeadListSeparator NegatedAndNestedListSeparator NegatedAndTailListSeparator NegatedOrLeadListSeparator NegatedOrNestedListSeparator NegatedOrTailListSeparator XorLeadListSeparator XorNestedListSeparator XorTailListSeparator NegatedXorLeadListSeparator NegatedXorNestedListSeparator NegatedXorTailListSeparator]]></Snippet> + <Snippet type="RolePathOutdentAwareTrailingListSnippets"><![CDATA[NegatedAndLeadListSeparator NegatedAndNestedListSeparator NegatedAndTailListSeparator NegatedOrLeadListSeparator NegatedOrNestedListSeparator NegatedOrTailListSeparator XorLeadListSeparator XorNestedListSeparator XorTailListSeparator NegatedXorLeadListSeparator NegatedXorNestedListSeparator NegatedXorTailListSeparator NegatedChainedListClose]]></Snippet> <Snippet type="ChainedListOpen"><![CDATA[<span>]]></Snippet> <Snippet type="ChainedListLocalRestrictionSeparator"><![CDATA[ <span class="quantifier">where</span> ]]></Snippet> <Snippet type="ChainedListLocalRestrictionBackReferenceSeparator"><![CDATA[ ]]></Snippet> @@ -328,12 +328,12 @@ <Snippet type="ChainedListTopLevelComplexRestrictionCollapsedLeadSeparator"><![CDATA[<br/><span class="quantifier">and</span> ]]></Snippet> <Snippet type="ChainedListCollapsedSeparator"><![CDATA[ ]]></Snippet> <Snippet type="ChainedListClose"><![CDATA[</span>]]></Snippet> - <Snippet type="NegatedChainedListOpen"><![CDATA[<span class="quantifier">it is not true that </span>]]></Snippet> - <Snippet type="NegatedChainedListClose"><![CDATA[]]></Snippet> + <Snippet type="NegatedChainedListOpen"><![CDATA[<span class="quantifier">it is not true that </span><span class="listSeparator">(</span>]]></Snippet> + <Snippet type="NegatedChainedListClose"><![CDATA[<span class="listSeparator">)</span>]]></Snippet> <Snippet type="AndLeadListOpen"><![CDATA[]]></Snippet> <Snippet type="AndLeadListSeparator"><![CDATA[<br/><span class="quantifier">and</span> ]]></Snippet> <Snippet type="AndLeadListClose"><![CDATA[]]></Snippet> - <Snippet type="AndTailListOpen"><![CDATA[<br/><span class="smallIndent"><span class="quantifier">and</span> ]]></Snippet> + <Snippet type="AndTailListOpen"><![CDATA[<br/><span class="smallIndent"><span class="quantifier">where</span> ]]></Snippet> <Snippet type="AndTailListCollapsedOpen" groupWith="AndTailListOpen"><![CDATA[<br/><span class="smallIndent">]]></Snippet> <Snippet type="AndTailListSeparator"><![CDATA[<br/><span class="quantifier">and</span> ]]></Snippet> <Snippet type="AndTailListClose"><![CDATA[</span>]]></Snippet> @@ -355,7 +355,7 @@ <Snippet type="OrLeadListOpen"><![CDATA[]]></Snippet> <Snippet type="OrLeadListSeparator"><![CDATA[<br/><span class="quantifier">or</span> ]]></Snippet> <Snippet type="OrLeadListClose"><![CDATA[]]></Snippet> - <Snippet type="OrTailListOpen"><![CDATA[<br/><span class="smallIndent"><span class="quantifier">and</span> ]]></Snippet> + <Snippet type="OrTailListOpen"><![CDATA[<br/><span class="smallIndent"><span class="quantifier">where</span> ]]></Snippet> <Snippet type="OrTailListCollapsedOpen" groupWith="OrTailListOpen"><![CDATA[<br/><span class="smallIndent">]]></Snippet> <Snippet type="OrTailListSeparator"><![CDATA[<br/><span class="quantifier">or</span> ]]></Snippet> <Snippet type="OrTailListClose"><![CDATA[</span>]]></Snippet> Modified: trunk/ORMModel/ObjectModel/VerbalizationCoreSnippetsDocumentation.html =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationCoreSnippetsDocumentation.html 2013-04-23 22:04:54 UTC (rev 1516) +++ trunk/ORMModel/ObjectModel/VerbalizationCoreSnippetsDocumentation.html 2013-05-17 23:23:44 UTC (rev 1517) @@ -1544,7 +1544,7 @@ <div class="snippetUnformattedText"> <span class="reportItem">Unformatted version: </span> <div class="unformattedSnippet"> - <pre class="unformattedSnippetDecorator">and </pre> + <pre class="unformattedSnippetDecorator">where </pre> </div> </div> </div> @@ -5782,7 +5782,7 @@ <div class="snippetUnformattedText"> <span class="reportItem">Unformatted version: </span> <div class="unformattedSnippet"> - <strong>Not Available</strong> + <pre class="unformattedSnippetDecorator">)</pre> </div> </div> </div> @@ -5799,7 +5799,7 @@ <div class="snippetUnformattedText"> <span class="reportItem">Unformatted version: </span> <div class="unformattedSnippet"> - <pre class="unformattedSnippetDecorator">it is not true that </pre> + <pre class="unformattedSnippetDecorator">it is not true that (</pre> </div> </div> </div> @@ -6706,7 +6706,7 @@ <div class="snippetUnformattedText"> <span class="reportItem">Unformatted version: </span> <div class="unformattedSnippet"> - <pre class="unformattedSnippetDecorator">and </pre> + <pre class="unformattedSnippetDecorator">where </pre> </div> </div> </div> @@ -7322,7 +7322,7 @@ <div class="snippetUnformattedText"> <span class="reportItem">Unformatted version: </span> <div class="unformattedSnippet"> - <pre class="unformattedSnippetDecorator">NegatedAndLeadListSeparator NegatedAndNestedListSeparator NegatedAndTailListSeparator NegatedOrLeadListSeparator NegatedOrNestedListSeparator NegatedOrTailListSeparator XorLeadListSeparator XorNestedListSeparator XorTailListSeparator NegatedXorLeadListSeparator NegatedXorNestedListSeparator NegatedXorTailListSeparator</pre> + <pre class="unformattedSnippetDecorator">NegatedAndLeadListSeparator NegatedAndNestedListSeparator NegatedAndTailListSeparator NegatedOrLeadListSeparator NegatedOrNestedListSeparator NegatedOrTailListSeparator XorLeadListSeparator XorNestedListSeparator XorTailListSeparator NegatedXorLeadListSeparator NegatedXorNestedListSeparator NegatedXorTailListSeparator NegatedChainedListClose</pre> </div> </div> </div> Modified: trunk/ORMModel/ObjectModel/VerbalizationDocumentation.xml =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationDocumentation.xml 2013-04-23 22:04:54 UTC (rev 1516) +++ trunk/ORMModel/ObjectModel/VerbalizationDocumentation.xml 2013-05-17 23:23:44 UTC (rev 1517) @@ -146,7 +146,7 @@ </snippet> <snippet name="AndTailListOpen" replacementCount="0"> <statement></statement> - <unformattedSnippet>and </unformattedSnippet> + <unformattedSnippet>where </unformattedSnippet> <contains /> <containedIn /> <usedBy /> @@ -1915,14 +1915,14 @@ </snippet> <snippet name="NegatedChainedListClose" replacementCount="0"> <statement></statement> - <unformattedSnippet></unformattedSnippet> + <unformattedSnippet>)</unformattedSnippet> <contains /> <containedIn /> <usedBy /> </snippet> <snippet name="NegatedChainedListOpen" replacementCount="0"> <statement></statement> - <unformattedSnippet>it is not true that </unformattedSnippet> + <unformattedSnippet>it is not true that (</unformattedSnippet> <contains /> <containedIn /> <usedBy /> @@ -2296,7 +2296,7 @@ </snippet> <snippet name="OrTailListOpen" replacementCount="0"> <statement></statement> - <unformattedSnippet>and </unformattedSnippet> + <unformattedSnippet>where </unformattedSnippet> <contains /> <containedIn /> <usedBy /> @@ -2563,7 +2563,7 @@ <statement>Description: A space separated list of list separators and close elements that must be placed before any active trailing outdent snippets. Format: NegatedAndLeadListSeparator NegatedAndNestedListSeparator NegatedAndTailListSeparator NegatedOrLeadListSeparator NegatedOrNestedListSeparator NegatedOrTailListSeparator XorLeadListSeparator XorNestedListSeparator XorTailListSeparator NegatedXorLeadListSeparator NegatedXorNestedListSeparator NegatedXorTailListSeparator</statement> - <unformattedSnippet>NegatedAndLeadListSeparator NegatedAndNestedListSeparator NegatedAndTailListSeparator NegatedOrLeadListSeparator NegatedOrNestedListSeparator NegatedOrTailListSeparator XorLeadListSeparator XorNestedListSeparator XorTailListSeparator NegatedXorLeadListSeparator NegatedXorNestedListSeparator NegatedXorTailListSeparator</unformattedSnippet> + <unformattedSnippet>NegatedAndLeadListSeparator NegatedAndNestedListSeparator NegatedAndTailListSeparator NegatedOrLeadListSeparator NegatedOrNestedListSeparator NegatedOrTailListSeparator XorLeadListSeparator XorNestedListSeparator XorTailListSeparator NegatedXorLeadListSeparator NegatedXorNestedListSeparator NegatedXorTailListSeparator NegatedChainedListClose</unformattedSnippet> <contains /> <containedIn /> <usedBy /> Modified: trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs 2013-04-23 22:04:54 UTC (rev 1516) +++ trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs 2013-05-17 23:23:44 UTC (rev 1517) @@ -1121,7 +1121,7 @@ "<span>", @"</span><br/><span class=""smallIndent""><span class=""quantifier"">and</span> ", "</span>", - @"<br/><span class=""smallIndent""><span class=""quantifier"">and</span> ", + @"<br/><span class=""smallIndent""><span class=""quantifier"">where</span> ", @"<br/><span class=""smallIndent"">", @"<br/><span class=""quantifier"">and</span> ", @"<span class=""quantifier"">at most one</span> {0}", @@ -1276,8 +1276,8 @@ @"<span class=""quantifier"">at least one of the following is <em>false:</em></span><br/><span class=""smallIndent"">", @"<span class=""quantifier"">at least one of the following is <em>false:</em></span><br/><span class=""smallIndent"">", @"<span class=""listSeparator"">;</span><br/>", - "", - @"<span class=""quantifier"">it is not true that </span>", + @"<span class=""listSeparator"">)</span>", + @"<span class=""quantifier"">it is not true that </span><span class=""listSeparator"">(</span>", "</span>", @"<span class=""quantifier"">all of the following are <em>false:</em></span><br/><span class=""smallIndent"">", @"<span class=""listSeparator"">;</span><br/>", @@ -1323,7 +1323,7 @@ "<span>", @"</span><br/><span class=""smallIndent""><span class=""quantifier"">or</span> ", "</span>", - @"<br/><span class=""smallIndent""><span class=""quantifier"">and</span> ", + @"<br/><span class=""smallIndent""><span class=""quantifier"">where</span> ", @"<br/><span class=""smallIndent"">", @"<br/><span class=""quantifier"">or</span> ", @"<span class=""quantifier""><sup style=""font-size:smaller;"">+</sup></span>{0} <span class=""quantifier"">if</span><br/>{1}<br/>", @@ -1352,7 +1352,7 @@ "And Or Chain", "!And !Or Xor !Xor", "ChainedListClose NegatedChainedListClose AndTailListClose AndNestedListClose NegatedAndLeadListClose NegatedAndTailListClose NegatedAndNestedListClose OrTailListClose OrNestedListClose NegatedOrLeadListClose NegatedOrTailListClose NegatedOrNestedListClose XorLeadListClose XorTailListClose XorNestedListClose NegatedXorLeadListClose NegatedXorTailListClose NegatedXorNestedListClose", - "NegatedAndLeadListSeparator NegatedAndNestedListSeparator NegatedAndTailListSeparator NegatedOrLeadListSeparator NegatedOrNestedListSeparator NegatedOrTailListSeparator XorLeadListSeparator XorNestedListSeparator XorTailListSeparator NegatedXorLeadListSeparator NegatedXorNestedListSeparator NegatedXorTailListSeparator", + "NegatedAndLeadListSeparator NegatedAndNestedListSeparator NegatedAndTailListSeparator NegatedOrLeadListSeparator NegatedOrNestedListSeparator NegatedOrTailListSeparator XorLeadListSeparator XorNestedListSeparator XorTailListSeparator NegatedXorLeadListSeparator NegatedXorNestedListSeparator NegatedXorTailListSeparator NegatedChainedListClose", @"{0}<span class=""logicalOperator""> is not </span>{1}", "{0}", "", @@ -1459,7 +1459,7 @@ "<span>", @"</span><br/><span class=""smallIndent""><span class=""quantifier"">and</span> ", "</span>", - @"<br/><span class=""smallIndent""><span class=""quantifier"">and</span> ", + @"<br/><span class=""smallIndent""><span class=""quantifier"">where</span> ", @"<br/><span class=""smallIndent"">", @"<br/><span class=""quantifier"">and</span> ", @"<span class=""quantifier"">at most one</span> {0}", @@ -1614,8 +1614,8 @@ @"<span class=""quantifier"">at least one of the following is <em>false:</em></span><br/><span class=""smallIndent"">", @"<span class=""quantifier"">at least one of the following is <em>false:</em></span><br/><span class=""smallIndent"">", @"<span class=""listSeparator"">;</span><br/>", - "", - @"<span class=""quantifier"">it is not true that </span>", + @"<span class=""listSeparator"">)</span>", + @"<span class=""quantifier"">it is not true that </span><span class=""listSeparator"">(</span>", "</span>", @"<span class=""quantifier"">all of the following are <em>false:</em></span><br/><span class=""smallIndent"">", @"<span class=""listSeparator"">;</span><br/>", @@ -1661,7 +1661,7 @@ "<span>", @"</span><br/><span class=""smallIndent""><span class=""quantifier"">or</span> ", "</span>", - @"<br/><span class=""smallIndent""><span class=""quantifier"">and</span> ", + @"<br/><span class=""smallIndent""><span class=""quantifier"">where</span> ", @"<br/><span class=""smallIndent"">", @"<br/><span class=""quantifier"">or</span> ", @"<span class=""quantifier""><sup style=""font-size:smaller;"">+</sup></span>{0} <span class=""quantifier"">if</span><br/>{1}<br/>", @@ -1690,7 +1690,7 @@ "And Or Chain", "!And !Or Xor !Xor", "ChainedListClose NegatedChainedListClose AndTailListClose AndNestedListClose NegatedAndLeadListClose NegatedAndTailListClose NegatedAndNestedListClose OrTailListClose OrNestedListClose NegatedOrLeadListClose NegatedOrTailListClose NegatedOrNestedListClose XorLeadListClose XorTailListClose XorNestedListClose NegatedXorLeadListClose NegatedXorTailListClose NegatedXorNestedListClose", - "NegatedAndLeadListSeparator NegatedAndNestedListSeparator NegatedAndTailListSeparator NegatedOrLeadListSeparator NegatedOrNestedListSeparator NegatedOrTailListSeparator XorLeadListSeparator XorNestedListSeparator XorTailListSeparator NegatedXorLeadListSeparator NegatedXorNestedListSeparator NegatedXorTailListSeparator", + "NegatedAndLeadListSeparator NegatedAndNestedListSeparator NegatedAndTailListSeparator NegatedOrLeadListSeparator NegatedOrNestedListSeparator NegatedOrTailListSeparator XorLeadListSeparator XorNestedListSeparator XorTailListSeparator NegatedXorLeadListSeparator NegatedXorNestedListSeparator NegatedXorTailListSeparator NegatedChainedListClose", @"{0}<span class=""logicalOperator""> is not </span>{1}", "{0}", "", @@ -1797,7 +1797,7 @@ "<span>", @"</span><br/><span class=""smallIndent""><span class=""quantifier"">and</span> ", "</span>", - @"<br/><span class=""smallIndent""><span class=""quantifier"">and</span> ", + @"<br/><span class=""smallIndent""><span class=""quantifier"">where</span> ", @"<br/><span class=""smallIndent"">", @"<br/><span class=""quantifier"">and</span> ", @"<span class=""quantifier"">at most one</span> {0}", @@ -1952,8 +1952,8 @@ @"<span class=""quantifier"">at least one of the following is <em>false:</em></span><br/><span class=""smallIndent"">", @"<span class=""quantifier"">at least one of the following is <em>false:</em></span><br/><span class=""smallIndent"">", @"<span class=""listSeparator"">;</span><br/>", - "", - @"<span class=""quantifier"">it is not true that </span>", + @"<span class=""listSeparator"">)</span>", + @"<span class=""quantifier"">it is not true that </span><span class=""listSeparator"">(</span>", "</span>", @"<span class=""quantifier"">all of the following are <em>false:</em></span><br/><span class=""smallIndent"">", @"<span class=""listSeparator"">;</span><br/>", @@ -1999,7 +1999,7 @@ "<span>", @"</span><br/><span class=""smallIndent""><span class=""quantifier"">or</span> ", "</span>", - @"<br/><span class=""smallIndent""><span class=""quantifier"">and</span> ", + @"<br/><span class=""smallIndent""><span class=""quantifier"">where</span> ", @"<br/><span class=""smallIndent"">", @"<br/><span class=""quantifier"">or</span> ", @"<span class=""quantifier""><sup style=""font-size:smaller;"">+</sup></span>{0} <span class=""quantifier"">if</span><br/>{1}<br/>", @@ -2028,7 +2028,7 @@ "And Or Chain", "!And !Or Xor !Xor", "ChainedListClose NegatedChainedListClose AndTailListClose AndNestedListClose NegatedAndLeadListClose NegatedAndTailListClose NegatedAndNestedListClose OrTailListClose OrNestedListClose NegatedOrLeadListClose NegatedOrTailListClose NegatedOrNestedListClose XorLeadListClose XorTailListClose XorNestedListClose NegatedXorLeadListClose NegatedXorTailListClose NegatedXorNestedListClose", - "NegatedAndLeadListSeparator NegatedAndNestedListSeparator NegatedAndTailListSeparator NegatedOrLeadListSeparator NegatedOrNestedListSeparator NegatedOrTailListSeparator XorLeadListSeparator XorNestedListSeparator XorTailListSeparator NegatedXorLeadListSeparator NegatedXorNestedListSeparator NegatedXorTailListSeparator", + "NegatedAndLeadListSeparator NegatedAndNestedListSeparator NegatedAndTailListSeparator NegatedOrLeadListSeparator NegatedOrNestedListSeparator NegatedOrTailListSeparator XorLeadListSeparator XorNestedListSeparator XorTailListSeparator NegatedXorLeadListSeparator NegatedXorNestedListSeparator NegatedXorTailListSeparator NegatedChainedListClose", @"{0}<span class=""logicalOperator""> is not </span>{1}", "{0}", "", @@ -2135,7 +2135,7 @@ "<span>", @"</span><br/><span class=""smallIndent""><span class=""quantifier"">and</span> ", "</span>", - @"<br/><span class=""smallIndent""><span class=""quantifier"">and</span> ", + @"<br/><span class=""smallIndent""><span class=""quantifier"">where</span> ", @"<br/><span class=""smallIndent"">", @"<br/><span class=""quantifier"">and</span> ", @"<span class=""quantifier"">at most one</span> {0}", @@ -2290,8 +2290,8 @@ @"<span class=""quantifier"">at least one of the following is <em>false:</em></span><br/><span class=""smallIndent"">", @"<span class=""quantifier"">at least one of the following is <em>false:</em></span><br/><span class=""smallIndent"">", @"<span class=""listSeparator"">;</span><br/>", - "", - @"<span class=""quantifier"">it is not true that </span>", + @"<span class=""listSeparator"">)</span>", + @"<span class=""quantifier"">it is not true that </span><span class=""listSeparator"">(</span>", "</span>", @"<span class=""quantifier"">all of the following are <em>false:</em></span><br/><span class=""smallIndent"">", @"<span class=""listSeparator"">;</span><br/>", @@ -2337,7 +2337,7 @@ "<span>", @"</span><br/><span class=""smallIndent""><span class=""quantifier"">or</span> ", "</span>", - @"<br/><span class=""smallIndent""><span class=""quantifier"">and</span> ", + @"<br/><span class=""smallIndent""><span class=""quantifier"">where</span> ", @"<br/><span class=""smallIndent"">", @"<br/><span class=""quantifier"">or</span> ", @"<span class=""quantifier""><sup style=""font-size:smaller;"">+</sup></span>{0} <span class=""quantifier"">if</span><br/>{1}<br/>", @@ -2366,7 +2366,7 @@ "And Or Chain", "!And !Or Xor !Xor", "ChainedListClose NegatedChainedListClose AndTailListClose AndNestedListClose NegatedAndLeadListClose NegatedAndTailListClose NegatedAndNestedListClose OrTailListClose OrNestedListClose NegatedOrLeadListClose NegatedOrTailListClose NegatedOrNestedListClose XorLeadListClose XorTailListClose XorNestedListClose NegatedXorLeadListClose NegatedXorTailListClose NegatedXorNestedListClose", - "NegatedAndLeadListSeparator NegatedAndNestedListSeparator NegatedAndTailListSeparator NegatedOrLeadListSeparator NegatedOrNestedListSeparator NegatedOrTailListSeparator XorLeadListSeparator XorNestedListSeparator XorTailListSeparator NegatedXorLeadListSeparator NegatedXorNestedListSeparator NegatedXorTailListSeparator", + "NegatedAndLeadListSeparator NegatedAndNestedListSeparator NegatedAndTailListSeparator NegatedOrLeadListSeparator NegatedOrNestedListSeparator NegatedOrTailListSeparator XorLeadListSeparator XorNestedListSeparator XorTailListSeparator NegatedXorLeadListSeparator NegatedXorNestedListSeparator NegatedXorTailListSeparator NegatedChainedListClose", @"{0}<span class=""logicalOperator""> is not </span>{1}", "{0}", "", Modified: trunk/ORMModel/ShapeModel/ExternalConstraintShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/ExternalConstraintShape.cs 2013-04-23 22:04:54 UTC (rev 1516) +++ trunk/ORMModel/ShapeModel/ExternalConstraintShape.cs 2013-05-17 23:23:44 UTC (rev 1517) @@ -601,11 +601,15 @@ bool rVal = false; Role r; IConstraint constraint = AssociatedConstraint; - if (mel == constraint) + if (constraint == null) { + rVal = false; + } + else if (mel == constraint) + { rVal = true; } - else if (constraint != null && null != (r = mel as Role)) + else if (null != (r = mel as Role)) { switch (constraint.ConstraintStorageStyle) { Modified: trunk/ORMModel/ShapeModel/FactTypeShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/FactTypeShape.cs 2013-04-23 22:04:54 UTC (rev 1516) +++ trunk/ORMModel/ShapeModel/FactTypeShape.cs 2013-05-17 23:23:44 UTC (rev 1517) @@ -3953,6 +3953,12 @@ /// </summary> public override string GetToolTipText(DiagramItem item) { + if (IsDeleted) + { + // Protect against a timing issue. A delete can happen after the + // tooltip timer starts but before this fires. + return null; + } string retVal = null; ShapeSubField subField = item.SubField; RoleSubField roleField; @@ -3994,11 +4000,13 @@ } } } + FactType factType; if (retVal == null && OptionsPage.CurrentDisplayDefinitionTooltips && - (subField == null || roleField != null)) + (subField == null || roleField != null) && + null != (factType = AssociatedFactType)) { - retVal = AssociatedFactType.DefinitionText; + retVal = factType.DefinitionText; if (retVal.Length == 0) { retVal = null; @@ -7034,9 +7042,13 @@ public override string GetToolTipText(DiagramItem item) { string retVal = null; - // Show for all shapes and fields in item - retVal = AssociatedObjectType.DefinitionText; - if (retVal.Length == 0) + ObjectType objectType; + // Show for all shapes and fields in item. + // Make sure that the shape has not been destroyed between the tooltip text + // timer starting and firing. + if (!IsDeleted && + null != (objectType = AssociatedObjectType) && + (retVal = objectType.DefinitionText).Length == 0) { retVal = null; } Modified: trunk/ORMModel/ShapeModel/ObjectTypeShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/ObjectTypeShape.cs 2013-04-23 22:04:54 UTC (rev 1516) +++ trunk/ORMModel/ShapeModel/ObjectTypeShape.cs 2013-05-17 23:23:44 UTC (rev 1517) @@ -430,9 +430,13 @@ public override string GetToolTipText(DiagramItem item) { string retVal = null; - // Show for all shapes and fields in item - retVal = AssociatedObjectType.DefinitionText; - if (retVal.Length == 0) + ObjectType objectType; + // Show for all shapes and fields in item. + // Make sure that the shape has not been destroyed between the tooltip text + // timer starting and firing. + if (!IsDeleted && + null != (objectType = AssociatedObjectType) && + (retVal = objectType.DefinitionText).Length == 0) { retVal = null; } Modified: trunk/ORMModel/ShapeModel/ValueRangeShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/ValueRangeShape.cs 2013-04-23 22:04:54 UTC (rev 1516) +++ trunk/ORMModel/ShapeModel/ValueRangeShape.cs 2013-05-17 23:23:44 UTC (rev 1517) @@ -229,7 +229,8 @@ { string retVal = null; ValueConstraint constraint; - if (null != (constraint = AssociatedValueConstraint)) + if (!IsDeleted && + null != (constraint = AssociatedValueConstraint)) { retVal = constraint.GetDisplayText(MaximumDisplayedColumns, 0); if (string.IsNullOrEmpty(retVal)) Modified: trunk/Setup/Readme.htm =================================================================== --- trunk/Setup/Readme.htm 2013-04-23 22:04:54 UTC (rev 1516) +++ trunk/Setup/Readme.htm 2013-05-17 23:23:44 UTC (rev 1517) @@ -3,7 +3,7 @@ <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/> -<title>NORMA January 2013 CTP Readme</title> +<title>NORMA May 2013 CTP Readme</title> <style type="text/css"> .new {font-size:x-small; background-color:Gold; color:Blue; } li {padding-bottom: 3px;} @@ -12,9 +12,9 @@ <body> -<p><b><a id="The Top" style="font-family:Verdana;font-size:medium">NORMA January 2013 CTP Readme</a> </b></p> +<p><b><a id="The Top" style="font-family:Verdana;font-size:medium">NORMA May 2013 CTP Readme</a> </b></p> <p>This file supersedes the previous readme.txt and older readme.htm files. This readme has parallel indexing mechanisms: by topic, and by release date (starting with the October 2008 (2008-10) release). The file will be extended for future product releases.<br/><br/> -The January 2013 release adds Visual Studio 2012 support, new constraint connections between a subtyping relationship and normal roles, some enhancements to disjunctive mandatory and external uniqueness verbalization patterns, native SQL Server data type handling, and other bug fixes. See detailed change notes below for specifics.<br/><br/> +The May 2013 release is a bug fix release with no major feature changes. See detailed change notes below for specifics.<br/><br/> </p> <h2>Contents</h2> <ul> @@ -43,8 +43,31 @@ </ul>--> <hr/> +<h2>May 2013 CTP Changes</h2> +<div>The May 2013 CTP release includes all modifications through changeset 1517. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<ul> +<li>Feature Changes: +<ol> +<li>Display both ModelName and DiagramName properties when an ORM diagram is selected. This removes ambiguity and makes it easier to edit the diagram names.</li> +<li>Enable persistent customization of generated relational schema names. Extends support for persistent customization of table and column names.</li> +<li>Remove the 'Columns' header from the Relational View page and remove some vertical whitespace from the table name section.</li> +<li>Improve foreign key highlighting in the Relational View. The entire foreign key line highlights on a mouse over, making it visually easier to trace foreign key lines.</li> +</ol> +</li> +<li>Bug Fixes: +<ol> +<li>Restore missing constraints in the <em>Constraint Validation</em> page of HTML report. Internal constraints on this page displayed only the first constraint of each type, so this report page was missing most of the internal constraints in the model.</li> +<li>Compatible column validation for constraints now look for exclusion constraints across subtypes and treat these as incompatible types.</li> +<li>Modified z-order on an ORM diagram to ensure consistent display. By default, z-order is determined by shape creation order. Creating a new shape for an object type or fact type that uses an existing role connector would draw the connector behind the shape. This was especially noticable with objectified fact types, which could obscur the role player connects behind the objectified fact type shape.</li> +<li>Verbalization of disjunctive mandatory constraints over multiple roles in the same fact type and multiple role player types was incorrectly correlating unrelated variables.</li> +<li>Fixed a timing issue with shape deletion. If mouse movement started a tooltip timer on a shape that was deleted before the timer fired and the tooltip requested text, then the IDE would crash. This was hard to hit, but was not recoverable and resulted in data loss.</li> +</ol> +</li> +</ul> + +<hr/> <h2>January 2013 CTP Changes</h2> -<div>The January 2013 CTP release includes all modifications through changeset 1510. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<div>The January 2013 CTP release includes all modifications through changeset 1510.</div> <ul> <li><a href="#VerbalizedObjectTypeNameRemoveSpecialCharacterDisplay 2013-01">Verbalized object type name separator character removal options</a></li> <li><a href="#SQLServerNativeDataTypes 2013-01">SQL Server Native Data Types</a></li> @@ -86,7 +109,7 @@ <hr/> <h2>April 2012 CTP Changes</h2> -<div>The April 2012 CTP release includes all modifications through changeset 1487. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<div>The April 2012 CTP release includes all modifications through changeset 1487.</div> <ul> <li><a href="#VerbalizePossiblePopulationsOption 2012-04">Verbalize possible populations option</a> </li> <li>Other Features: Modified: trunk/VersionGenerator.exe.config =================================================================== --- trunk/VersionGenerator.exe.config 2013-04-23 22:04:54 UTC (rev 1516) +++ trunk/VersionGenerator.exe.config 2013-05-17 23:23:44 UTC (rev 1517) @@ -2,7 +2,7 @@ <configuration> <appSettings> <add key="RevisionStartYearMonth" value="2006-01"/> - <add key="ReleaseYearMonth" value="2013-01"/> + <add key="ReleaseYearMonth" value="2013-05"/> <add key="CountQuartersFromYearMonth" value="2011-01"/> <!-- ReleaseType: "CTP" or "RTM" --> <add key="ReleaseType" value="CTP"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2013-04-23 22:05:04
|
Revision: 1516 http://orm.svn.sourceforge.net/orm/?rev=1516&view=rev Author: mcurland Date: 2013-04-23 22:04:54 +0000 (Tue, 23 Apr 2013) Log Message: ----------- * Report generation constraint report stops showing some constraints after the first constraint of that type. Fixed by changing verbalization helper objects to calculate equality on current state instead of having the same identity for all uses so that 'alreadyVerbalized' does not get triggered. * Changing derivation projection to a different pathed role crashed due to improper cast in tracking rule. * Verbalization of disjunctive mandatory constraints with multiple restricted (compatible) role players and multiple roles in the same fact type was incorrectly correlated constrained roles. Fixed by correlating the 'primary' role for each fact statement instead of the 'included' roles. * Fact type derivation path schema requires DerivationProjections before InformalRule elements, but the serializer was unordered for these element. Mark child elements as ordered for FactTypeDerivationRule serialization. Modified Paths: -------------- trunk/ORMModel/ObjectModel/Constraint.cs trunk/ORMModel/ObjectModel/FactType.cs trunk/ORMModel/ObjectModel/ORMCore.SerializationExtensions.cs trunk/ORMModel/ObjectModel/ORMCore.SerializationExtensions.xml trunk/ORMModel/ObjectModel/ObjectType.cs trunk/ORMModel/ObjectModel/Role.cs trunk/ORMModel/ObjectModel/RolePath.cs trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs trunk/ORMModel/ObjectModel/VerbalizationGenerator.xml Modified: trunk/ORMModel/ObjectModel/Constraint.cs =================================================================== --- trunk/ORMModel/ObjectModel/Constraint.cs 2013-03-18 22:49:06 UTC (rev 1515) +++ trunk/ORMModel/ObjectModel/Constraint.cs 2013-04-23 22:04:54 UTC (rev 1516) @@ -8184,6 +8184,25 @@ return verbalizer.myConstraint; } #endregion // Passthrough properties + #region Equality Overrides + // Override equality operators so that muliple uses of the verbalization helper + // for this object with different values does not trigger an 'already verbalized' + // response for later verbalizations. + /// <summary> + /// Standard equality override + /// </summary> + public override int GetHashCode() + { + return Utility.GetCombinedHashCode(myConstraint != null ? myConstraint.GetHashCode() : 0, this.GetType().GetHashCode()); + } + /// <summary> + /// Standard equality override + /// </summary> + public override bool Equals(object obj) + { + return obj != null && obj.GetType() == this.GetType() && ((UniquenessVerbalizerBase)obj).myConstraint == myConstraint; + } + #endregion // Equality Overrides } private partial class UniquenessConstraintVerbalizer : UniquenessVerbalizerBase { } private partial class UniquenessPossibilityVerbalizer : UniquenessVerbalizerBase { } @@ -8451,6 +8470,25 @@ return verbalizer.myConstraint; } #endregion // Passthrough properties + #region Equality Overrides + // Override equality operators so that muliple uses of the verbalization helper + // for this object with different values does not trigger an 'already verbalized' + // response for later verbalizations. + /// <summary> + /// Standard equality override + /// </summary> + public override int GetHashCode() + { + return Utility.GetCombinedHashCode(myConstraint != null ? myConstraint.GetHashCode() : 0, this.GetType().GetHashCode()); + } + /// <summary> + /// Standard equality override + /// </summary> + public override bool Equals(object obj) + { + return obj != null && obj.GetType() == this.GetType() && ((MandatoryVerbalizerBase)obj).myConstraint == myConstraint; + } + #endregion // Equality Overrides } private partial class SimpleMandatoryVerbalizer : MandatoryVerbalizerBase { } private partial class DisjunctiveMandatoryVerbalizer : MandatoryVerbalizerBase { } @@ -9459,6 +9497,25 @@ } } #endregion // Passthrough properties + #region Equality Overrides + // Override equality operators so that muliple uses of the verbalization helper + // for this object with different values does not trigger an 'already verbalized' + // response for later verbalizations. + /// <summary> + /// Standard equality override + /// </summary> + public override int GetHashCode() + { + return Utility.GetCombinedHashCode(myConstraint != null ? myConstraint.GetHashCode() : 0, this.GetType().GetHashCode()); + } + /// <summary> + /// Standard equality override + /// </summary> + public override bool Equals(object obj) + { + return obj != null && obj.GetType() == this.GetType() && ((RingVerbalizerBase)obj).myConstraint == myConstraint; + } + #endregion // Equality Overrides } private partial class AcyclicRingVerbalizer : RingVerbalizerBase { } private partial class AntisymmetricRingVerbalizer : RingVerbalizerBase { } Modified: trunk/ORMModel/ObjectModel/FactType.cs =================================================================== --- trunk/ORMModel/ObjectModel/FactType.cs 2013-03-18 22:49:06 UTC (rev 1515) +++ trunk/ORMModel/ObjectModel/FactType.cs 2013-04-23 22:04:54 UTC (rev 1516) @@ -2699,23 +2699,23 @@ /// </summary> private partial class ImpliedUniqueVerbalizer { - private FactType myFact; + private FactType myFactType; private UniquenessConstraint myConstraint; - public void Initialize(FactType fact, UniquenessConstraint constraint) + public void Initialize(FactType factType, UniquenessConstraint constraint) { - myFact = fact; + myFactType = factType; myConstraint = constraint; } private void DisposeHelper() { - myFact = null; + myFactType = null; myConstraint = null; } private FactType FactType { get { - return myFact; + return myFactType; } } private LinkedElementCollection<Role> RoleCollection @@ -2739,6 +2739,26 @@ return myConstraint.IsPreferred; } } + #region Equality Overrides + // Override equality operators so that muliple uses of the verbalization helper + // for this object with different values does not trigger an 'already verbalized' + // response for later verbalizations. + /// <summary> + /// Standard equality override + /// </summary> + public override int GetHashCode() + { + return Utility.GetCombinedHashCode(myFactType != null ? myFactType.GetHashCode() : 0, myConstraint != null ? myConstraint.GetHashCode() : 0); + } + /// <summary> + /// Standard equality override + /// </summary> + public override bool Equals(object obj) + { + ImpliedUniqueVerbalizer other; + return (null != (other = obj as ImpliedUniqueVerbalizer)) && other.myFactType == myFactType && other.myConstraint == myConstraint; + } + #endregion // Equality Overrides } #endregion // ImpliedUniqueVerbalizer class #region ImpliedMandatoryVerbalizer class @@ -2748,23 +2768,23 @@ /// </summary> private partial class ImpliedMandatoryVerbalizer { - private FactType myFact; + private FactType myFactType; private MandatoryConstraint myConstraint; - public void Initialize(FactType fact, MandatoryConstraint constraint) + public void Initialize(FactType factType, MandatoryConstraint constraint) { - myFact = fact; + myFactType = factType; myConstraint = constraint; } private void DisposeHelper() { - myFact = null; + myFactType = null; myConstraint = null; } private FactType FactType { get { - return myFact; + return myFactType; } } private LinkedElementCollection<Role> RoleCollection @@ -2781,6 +2801,26 @@ return myConstraint.Modality; } } + #region Equality Overrides + // Override equality operators so that muliple uses of the verbalization helper + // for this object with different values does not trigger an 'already verbalized' + // response for later verbalizations. + /// <summary> + /// Standard equality override + /// </summary> + public override int GetHashCode() + { + return Utility.GetCombinedHashCode(myFactType != null ? myFactType.GetHashCode() : 0, myConstraint != null ? myConstraint.GetHashCode() : 0); + } + /// <summary> + /// Standard equality override + /// </summary> + public override bool Equals(object obj) + { + ImpliedMandatoryVerbalizer other; + return (null != (other = obj as ImpliedMandatoryVerbalizer)) && other.myFactType == myFactType && other.myConstraint == myConstraint; + } + #endregion // Equality Overrides } #endregion // ImpliedMandatoryVerbalizer class #region CombinedMandatoryUniqueVerbalizer class @@ -2790,18 +2830,18 @@ /// </summary> private partial class CombinedMandatoryUniqueVerbalizer : IModelErrorOwner { - private FactType myFact; + private FactType myFactType; private UniquenessConstraint myUniquenessConstraint; private MandatoryConstraint myMandatoryConstraint; - public void Initialize(FactType fact, UniquenessConstraint uniquenessConstraint, MandatoryConstraint mandatoryConstraint) + public void Initialize(FactType factType, UniquenessConstraint uniquenessConstraint, MandatoryConstraint mandatoryConstraint) { - myFact = fact; + myFactType = factType; myUniquenessConstraint = uniquenessConstraint; myMandatoryConstraint = mandatoryConstraint; } private void DisposeHelper() { - myFact = null; + myFactType = null; myUniquenessConstraint = null; myMandatoryConstraint = null; } @@ -2809,7 +2849,7 @@ { get { - return myFact; + return myFactType; } } private LinkedElementCollection<Role> RoleCollection @@ -2847,6 +2887,26 @@ { } #endregion // IModelErrorOwner Implementation + #region Equality Overrides + // Override equality operators so that muliple uses of the verbalization helper + // for this object with different values does not trigger an 'already verbalized' + // response for later verbalizations. + /// <summary> + /// Standard equality override + /// </summary> + public override int GetHashCode() + { + return Utility.GetCombinedHashCode(myFactType != null ? myFactType.GetHashCode() : 0, myMandatoryConstraint != null ? myMandatoryConstraint.GetHashCode() : 0, myUniquenessConstraint != null ? myUniquenessConstraint.GetHashCode() : 0); + } + /// <summary> + /// Standard equality override + /// </summary> + public override bool Equals(object obj) + { + CombinedMandatoryUniqueVerbalizer other; + return (null != (other = obj as CombinedMandatoryUniqueVerbalizer)) && other.myFactType == myFactType && other.myMandatoryConstraint == myMandatoryConstraint && other.myMandatoryConstraint == myMandatoryConstraint; + } + #endregion // Equality Overrides } #endregion // CombinedMandatoryUniqueVerbalizer class #region FactTypeInstanceVerbalizer class @@ -2856,25 +2916,25 @@ /// </summary> private partial class FactTypeInstanceVerbalizer { - private FactType myFact; + private FactType myFactType; private FactTypeInstance myInstance; private bool myDisplayIdentifier; public void Initialize(FactType factType, FactTypeInstance factInstance, bool displayIdentifier) { - myFact = factType; + myFactType = factType; myInstance = factInstance; myDisplayIdentifier = displayIdentifier; } private void DisposeHelper() { - myFact = null; + myFactType = null; myInstance = null; } private FactType FactType { get { - return myFact; + return myFactType; } } private FactTypeInstance Instance @@ -2891,6 +2951,26 @@ return myDisplayIdentifier; } } + #region Equality Overrides + // Override equality operators so that muliple uses of the verbalization helper + // for this object with different values does not trigger an 'already verbalized' + // response for later verbalizations. + /// <summary> + /// Standard equality override + /// </summary> + public override int GetHashCode() + { + return Utility.GetCombinedHashCode(myFactType != null ? myFactType.GetHashCode() : 0, myInstance != null ? myInstance.GetHashCode() : 0, myDisplayIdentifier.GetHashCode()); + } + /// <summary> + /// Standard equality override + /// </summary> + public override bool Equals(object obj) + { + FactTypeInstanceVerbalizer other; + return (null != (other = obj as FactTypeInstanceVerbalizer)) && other.myFactType == myFactType && other.myInstance == myInstance && other.myDisplayIdentifier == myDisplayIdentifier; + } + #endregion // Equality Overrides } #endregion // FactTypeInstanceVerbalizer class #region IVerbalizeCustomChildren Implementation @@ -3214,23 +3294,23 @@ #region DefaultBinaryMissingUniquenessVerbalizer private partial class DefaultBinaryMissingUniquenessVerbalizer { - private FactType myFact; + private FactType myFactType; private UniquenessConstraint myConstraint; - public void Initialize(FactType fact, UniquenessConstraint constraint) + public void Initialize(FactType factType, UniquenessConstraint constraint) { - myFact = fact; + myFactType = factType; myConstraint = constraint; } private void DisposeHelper() { - myFact = null; + myFactType = null; myConstraint = null; } private FactType FactType { get { - return myFact; + return myFactType; } } private LinkedElementCollection<Role> RoleCollection @@ -3247,6 +3327,26 @@ return myConstraint.Modality; } } + #region Equality Overrides + // Override equality operators so that muliple uses of the verbalization helper + // for this object with different values does not trigger an 'already verbalized' + // response for later verbalizations. + /// <summary> + /// Standard equality override + /// </summary> + public override int GetHashCode() + { + return Utility.GetCombinedHashCode(myFactType != null ? myFactType.GetHashCode() : 0, myConstraint != null ? myConstraint.GetHashCode() : 0); + } + /// <summary> + /// Standard equality override + /// </summary> + public override bool Equals(object obj) + { + DefaultBinaryMissingUniquenessVerbalizer other; + return (null != (other = obj as DefaultBinaryMissingUniquenessVerbalizer)) && other.myFactType == myFactType && other.myConstraint == myConstraint; + } + #endregion // Equality Overrides } #endregion // DefaultBinaryMissingUniquenessVerbalizer #region IHierarchyContextEnabled Members Modified: trunk/ORMModel/ObjectModel/ORMCore.SerializationExtensions.cs =================================================================== --- trunk/ORMModel/ObjectModel/ORMCore.SerializationExtensions.cs 2013-03-18 22:49:06 UTC (rev 1515) +++ trunk/ORMModel/ObjectModel/ORMCore.SerializationExtensions.cs 2013-04-23 22:04:54 UTC (rev 1516) @@ -3961,7 +3961,7 @@ { get { - return base.SupportedCustomSerializedOperations | CustomSerializedElementSupportedOperations.ChildElementInfo | CustomSerializedElementSupportedOperations.ElementInfo | CustomSerializedElementSupportedOperations.PropertyInfo | CustomSerializedElementSupportedOperations.LinkInfo; + return base.SupportedCustomSerializedOperations | CustomSerializedElementSupportedOperations.ChildElementInfo | CustomSerializedElementSupportedOperations.ElementInfo | CustomSerializedElementSupportedOperations.PropertyInfo | CustomSerializedElementSupportedOperations.LinkInfo | CustomSerializedElementSupportedOperations.CustomSortChildRoles; } } CustomSerializedElementSupportedOperations ICustomSerializedElement.SupportedCustomSerializedOperations @@ -4093,6 +4093,74 @@ { return this.GetCustomSerializedLinkInfo(rolePlayedInfo, elementLink); } + private static IComparer<DomainRoleInfo> myCustomSortChildComparer; + private sealed class CustomSortChildComparer : IComparer<DomainRoleInfo> + { + private readonly Dictionary<string, int> myRoleOrderDictionary; + private IComparer<DomainRoleInfo> myBaseComparer; + public CustomSortChildComparer(Store store, IComparer<DomainRoleInfo> baseComparer) + { + this.myBaseComparer = baseComparer; + DomainDataDirectory domainDataDirectory = store.DomainDataDirectory; + Dictionary<string, int> roleOrderDictionary = new Dictionary<string, int>(); + DomainRoleInfo domainRole; + domainRole = domainDataDirectory.FindDomainRole(RoleSetDerivationProjection.RolePathDomainRoleId).OppositeDomainRole; + roleOrderDictionary[string.Concat(domainRole.DomainRelationship.ImplementationClass.FullName, ".", domainRole.Name)] = 0; + domainRole = domainDataDirectory.FindDomainRole(FactTypeDerivationRuleHasDerivationNote.DerivationNoteDomainRoleId).OppositeDomainRole; + roleOrderDictionary[string.Concat(domainRole.DomainRelationship.ImplementationClass.FullName, ".", domainRole.Name)] = 1; + domainRole = domainDataDirectory.FindDomainRole(RoleProjectedDerivationRuleHasProjectionRequiredError.ProjectionRequiredErrorDomainRoleId).OppositeDomainRole; + roleOrderDictionary[string.Concat(domainRole.DomainRelationship.ImplementationClass.FullName, ".", domainRole.Name)] = 2; + this.myRoleOrderDictionary = roleOrderDictionary; + } + int IComparer<DomainRoleInfo>.Compare(DomainRoleInfo x, DomainRoleInfo y) + { + if (this.myBaseComparer != null) + { + int baseOpinion = this.myBaseComparer.Compare(x, y); + if (0 != baseOpinion) + { + return baseOpinion; + } + } + int xPos; + if (!this.myRoleOrderDictionary.TryGetValue(string.Concat(x.DomainRelationship.ImplementationClass.FullName, ".", x.Name), out xPos)) + { + xPos = int.MaxValue; + } + int yPos; + if (!this.myRoleOrderDictionary.TryGetValue(string.Concat(y.DomainRelationship.ImplementationClass.FullName, ".", y.Name), out yPos)) + { + yPos = int.MaxValue; + } + return xPos.CompareTo(yPos); + } + } + /// <summary>Implements ICustomSerializedElement.CustomSerializedChildRoleComparer</summary> + protected new IComparer<DomainRoleInfo> CustomSerializedChildRoleComparer + { + get + { + IComparer<DomainRoleInfo> retVal = FactTypeDerivationRule.myCustomSortChildComparer; + if (null == retVal) + { + IComparer<DomainRoleInfo> baseComparer = null; + if (0 != (CustomSerializedElementSupportedOperations.CustomSortChildRoles & base.SupportedCustomSerializedOperations)) + { + baseComparer = base.CustomSerializedChildRoleComparer; + } + retVal = new CustomSortChildComparer(this.Store, baseComparer); + FactTypeDerivationRule.myCustomSortChildComparer = retVal; + } + return retVal; + } + } + IComparer<DomainRoleInfo> ICustomSerializedElement.CustomSerializedChildRoleComparer + { + get + { + return this.CustomSerializedChildRoleComparer; + } + } private static Dictionary<string, CustomSerializedElementMatch> myChildElementMappings; /// <summary>Implements ICustomSerializedElement.MapChildElement</summary> protected new CustomSerializedElementMatch MapChildElement(string elementNamespace, string elementName, string containerNamespace, string containerName, string outerContainerNamespace, string outerContainerName) Modified: trunk/ORMModel/ObjectModel/ORMCore.SerializationExtensions.xml =================================================================== --- trunk/ORMModel/ObjectModel/ORMCore.SerializationExtensions.xml 2013-03-18 22:49:06 UTC (rev 1515) +++ trunk/ORMModel/ObjectModel/ORMCore.SerializationExtensions.xml 2013-04-23 22:04:54 UTC (rev 1516) @@ -678,7 +678,7 @@ </se:Element> <!-- UNDONE: File format change, remove derivation expression. --> <se:Element Class="FactTypeDerivationExpression" Name="DerivationExpression" Override="true"/> - <se:Element Class="FactTypeDerivationRule" Name="FactTypeDerivationPath" Override="true"> + <se:Element Class="FactTypeDerivationRule" Name="FactTypeDerivationPath" Override="true" SortChildElements="true"> <se:Attribute ID="DerivationCompleteness"> <se:Condition WriteStyle="NotWritten"> <plx:binaryOperator type="equality"> Modified: trunk/ORMModel/ObjectModel/ObjectType.cs =================================================================== --- trunk/ORMModel/ObjectModel/ObjectType.cs 2013-03-18 22:49:06 UTC (rev 1515) +++ trunk/ORMModel/ObjectModel/ObjectType.cs 2013-04-23 22:04:54 UTC (rev 1516) @@ -4961,26 +4961,48 @@ #region ObjectTypeInstanceVerbalizer class private partial class ObjectTypeInstanceVerbalizer { - private ObjectType myParentObject; + private ObjectType myParentObjectType; private IList<ObjectTypeInstance> myInstances; - public void Initialize(ObjectType parentObject, IList<ObjectTypeInstance> instances) + public void Initialize(ObjectType parentObjectType, IList<ObjectTypeInstance> instances) { - myParentObject = parentObject; + myParentObjectType = parentObjectType; myInstances = instances; } private void DisposeHelper() { - myParentObject = null; + myParentObjectType = null; myInstances = null; } private ObjectType ParentObject { - get { return myParentObject; } + get { return myParentObjectType; } } private IList<ObjectTypeInstance> Instances { get { return myInstances; } } + #region Equality Overrides + // Override equality operators so that muliple uses of the verbalization helper + // for this object with different values does not trigger an 'already verbalized' + // response for later verbalizations. + /// <summary> + /// Standard equality override + /// </summary> + public override int GetHashCode() + { + // Ignore the actual instances for equality, but combine additional + // data so that we aren't exactly the same as the object type. + return Utility.GetCombinedHashCode(myParentObjectType != null ? myParentObjectType.GetHashCode() : 0, GetType().GetHashCode()); + } + /// <summary> + /// Standard equality override + /// </summary> + public override bool Equals(object obj) + { + ObjectTypeInstanceVerbalizer other; + return (null != (other = obj as ObjectTypeInstanceVerbalizer)) && other.myParentObjectType == myParentObjectType; + } + #endregion // Equality Overrides } #endregion // ObjectTypeInstanceVerbalizer class #region NearestValueConstraintVerbalizer class @@ -5026,6 +5048,26 @@ return myValueConstraint.ValueRangeCollection; } } + #region Equality Overrides + // Override equality operators so that muliple uses of the verbalization helper + // for this object with different values does not trigger an 'already verbalized' + // response for later verbalizations. + /// <summary> + /// Standard equality override + /// </summary> + public override int GetHashCode() + { + return Utility.GetCombinedHashCode(myParentObjectType != null ? myParentObjectType.GetHashCode() : 0, myValueConstraint != null ? myValueConstraint.GetHashCode() : 0); + } + /// <summary> + /// Standard equality override + /// </summary> + public override bool Equals(object obj) + { + NearestValueConstraintVerbalizer other; + return (null != (other = obj as NearestValueConstraintVerbalizer)) && other.myParentObjectType == myParentObjectType && other.myValueConstraint == myValueConstraint; + } + #endregion // Equality Overrides } #endregion // NearestValueConstraintVerbalizer class } Modified: trunk/ORMModel/ObjectModel/Role.cs =================================================================== --- trunk/ORMModel/ObjectModel/Role.cs 2013-03-18 22:49:06 UTC (rev 1515) +++ trunk/ORMModel/ObjectModel/Role.cs 2013-04-23 22:04:54 UTC (rev 1516) @@ -1520,6 +1520,28 @@ { } #endregion // IModelErrorOwner Implementation + #region Equality Overrides + // Override equality operators so that muliple uses of the verbalization helper + // for this object with different values does not trigger an 'already verbalized' + // response for later verbalizations. + /// <summary> + /// Standard equality override + /// </summary> + public override int GetHashCode() + { + // Combine the role has code with a nother value so we don't get in a hash + // bucket with the role itself. + return Utility.GetCombinedHashCode(myRole != null ? myRole.GetHashCode() : 0, GetType().GetHashCode()); + } + /// <summary> + /// Standard equality override + /// </summary> + public override bool Equals(object obj) + { + ErrorReport other; + return (null != (other = obj as ErrorReport)) && other.myRole == myRole; + } + #endregion // Equality Overrides } #endregion // ErrorReport verbalizer class #endregion // IVerbalizeCustomChildren Implementation Modified: trunk/ORMModel/ObjectModel/RolePath.cs =================================================================== --- trunk/ORMModel/ObjectModel/RolePath.cs 2013-03-18 22:49:06 UTC (rev 1515) +++ trunk/ORMModel/ObjectModel/RolePath.cs 2013-04-23 22:04:54 UTC (rev 1516) @@ -5812,7 +5812,7 @@ { if (e.DomainRole.Id == DerivedRoleProjectedFromPathedRole.SourceDomainRoleId) { - DerivedRoleProjection projection = ((DerivedRoleProjectedFromRolePathRoot)e.ElementLink).RoleProjection; + DerivedRoleProjection projection = ((DerivedRoleProjectedFromPathedRole)e.ElementLink).RoleProjection; if (projection.IsAutomatic && !ChangingAutomaticProjection(projection.Store, null)) { projection.IsAutomatic = false; Modified: trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs 2013-03-18 22:49:06 UTC (rev 1515) +++ trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs 2013-04-23 22:04:54 UTC (rev 1516) @@ -7176,7 +7176,11 @@ { if (replaceRole == constraintRole.Role) { - return pathVerbalizer.RenderAssociatedRolePlayer(constraintRole, hyphenBindingFormatString, RolePathRolePlayerRenderingOptions.Quantify); + if (primaryRole == replaceRole) + { + return pathVerbalizer.RenderAssociatedRolePlayer(constraintRole, hyphenBindingFormatString, RolePathRolePlayerRenderingOptions.Quantify); + } + break; } } return pathVerbalizer.RenderAssociatedRolePlayer(replaceRole, hyphenBindingFormatString, RolePathRolePlayerRenderingOptions.Quantify); Modified: trunk/ORMModel/ObjectModel/VerbalizationGenerator.xml =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationGenerator.xml 2013-03-18 22:49:06 UTC (rev 1515) +++ trunk/ORMModel/ObjectModel/VerbalizationGenerator.xml 2013-04-23 22:04:54 UTC (rev 1516) @@ -670,7 +670,7 @@ <CompositeList listStyle="IndentedLogicalOrList"> <IterateRoles match="providedConstraintRoles" minFactArity="2"> <Fact readingChoice="PreferPrimaryLeadReadingNoFrontText"> - <ProvidedPredicateReplacement match="included" minimizeHeadSubscripting="true" quantify="true"/> + <ProvidedPredicateReplacement match="primary" minimizeHeadSubscripting="true" quantify="true"/> <ProvidedPredicateReplacement match="excluded" minimizeHeadSubscripting="true" quantify="true"/> </Fact> </IterateRoles> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2013-03-06 20:25:29
|
Revision: 1513 http://orm.svn.sourceforge.net/orm/?rev=1513&view=rev Author: mcurland Date: 2013-03-06 20:25:20 +0000 (Wed, 06 Mar 2013) Log Message: ----------- Eliminate existing intra-fact type splits from role paths on load. An intra-fact type split is a continuation of a fact type entered in a previous section of the role path which is then split to create compound conditions. The replacement is a newly rooted path with a correlation to a pathed role in the initial entry section of the path. This checkin eliminates the intra-fact type splits on load, but does not make them illegal internally (pending). This is a more versatile construct because it allows conditions to be applied to any in-scope path nodes, not just the roles in the immediate fact type. This construct was previously supported, and is now the only way to do this. This is an internal deprecation and will not have a visible effect on NORMA users. Modified Paths: -------------- trunk/ORMModel/ObjectModel/RolePath.cs Modified: trunk/ORMModel/ObjectModel/RolePath.cs =================================================================== --- trunk/ORMModel/ObjectModel/RolePath.cs 2013-02-21 23:40:39 UTC (rev 1512) +++ trunk/ORMModel/ObjectModel/RolePath.cs 2013-03-06 20:25:20 UTC (rev 1513) @@ -1020,6 +1020,18 @@ // NEW: AggregationContext can reference multiple path nodes, UniversalAggregationContext // property used otherwise. No context for an aggregate calculation is an error. // Scope is no longer used for scalar functions. + // 7) OLD: A subpath could lead with a non-join pathed role. This 'intra-fact type split' + // indicated branching within the roles of a single fact type. + // NEW: The intra-fact type split approach is difficult to use because it requires looking + // down sub paths to determine variables for a fact type entry, and it doesn't display + // well. More importantly, it does not actually solve the general problem of adding + // conditions to an inscope variable because variables can be in scope for both the + // most recent fact type and variables declared earlier in the path. The new approach + // deprecates the intra-fact type split, moves all pathed roles to the path with the + // initial entry role, and uses path roots and correlation in sub paths to state the + // conditions originally covered by intra-fact type splits. This pattern also allows + // additional conditions on all in-scope variables, which was not included in the + // intra-fact type split pattern. // Move from the single contained element to the many containment RolePathOwnerHasPathComponent_Deprecated rootContainmentLink = RolePathOwnerHasPathComponent_Deprecated.GetLinkToPathComponent(element); @@ -1346,10 +1358,10 @@ } } - // Replace deprecated StartRole pathed role purpose with PostInnerJoin pathed roles - // and modify projections. foreach (LeadRolePath leadRolePath in element.OwnedLeadRolePathCollection) { + // Replace deprecated StartRole pathed role purpose with PostInnerJoin pathed roles + // and modify projections. VisitPathNodes( leadRolePath, RolePathNode.Empty, @@ -1536,10 +1548,523 @@ } } } + + // Eliminate intra-fact type splits. The basic approach is to add new pathed role declarations + // immediately after the entry role for the fact type, replace the ift split roles + // with new path roots, and move all projections, calculations, and value ranges to the + // new path root node. While most IFT roles will be single, it is also possible to have + // multiple roles at the start of the path. In this case, we need to create a new subpath + // for each additional role. + ReadOnlyCollection<PathedRole> entryPathedRoles = null; + RemoveIntraFactTypeSplits(leadRolePath, ref entryPathedRoles, -1, leadRolePath.SplitCombinationOperator == LogicalCombinationOperator.And && !leadRolePath.SplitIsNegated, notifyAdded); } } } /// <summary> + /// Recursive helper function for ProcessElement + /// </summary> + /// <param name="rolePath">The role path to check</param> + /// <param name="entryPathedRoles">The pathed roles for the path that contains the last + /// entry role into a fact type use. Passed by reference so the readonly collection can + /// be updated when it changes.</param> + /// <param name="entryRoleIndex">The index of the entry role in <paramref name="entryPathedRoles"/></param> + /// <param name="inPositiveConjunction">True if all of the splits passed since the entry pathed role + /// are 'and' splits and not negated.</param> + /// <param name="notifyAdded">Add notification callback.</param> + private static void RemoveIntraFactTypeSplits(RolePath rolePath, ref ReadOnlyCollection<PathedRole> entryPathedRoles, int entryRoleIndex, bool inPositiveConjunction, INotifyElementAdded notifyAdded) + { + LinkedElementCollection<RoleSubPath> subpaths = rolePath.SubPathCollection; + int subpathCount = subpaths.Count; + ReadOnlyCollection<PathedRole> currentPathedRoles = null; + if (subpathCount == 0 && + entryRoleIndex == -1) + { + // There is no bound ift role at the beginning without a context, + // and there are no trailing ones without subpaths. + return; + } + bool hasRoot = rolePath.PathRoot != null; + bool scrubbedSplit; + if (scrubbedSplit = (entryRoleIndex != -1 && + !hasRoot && + (currentPathedRoles = rolePath.PathedRoleCollection).Count != 0 && + currentPathedRoles[0].PathedRolePurpose == PathedRolePurpose.SameFactType)) + { + // Clear the ift split in this branch. Do the work in a non-recursive routine + // to keep the stack reasonable for this function. + ScrubIntraFactTypeSplit(rolePath, currentPathedRoles, ref entryPathedRoles, entryRoleIndex, inPositiveConjunction, notifyAdded); + } + + if (subpathCount != 0) + { + // Find an entry pathed role in the current roles. If there is none, then we may have + // a nested ift split in a following branch, so we leave the entry role the same as with + // this call. + // Note that the count can change with the ift cleanup, don't cache + int i = (currentPathedRoles ?? (currentPathedRoles = rolePath.PathedRoleCollection)).Count - 1; + for (; i >= 0; --i) + { + if (currentPathedRoles[i].PathedRolePurpose != PathedRolePurpose.SameFactType) + { + entryPathedRoles = currentPathedRoles; + entryRoleIndex = i; + break; + } + } + if (i == -1 && hasRoot) + { + // The root is reset, so there is no connection to a previous entry role + entryPathedRoles = null; + entryRoleIndex = -1; + } + RoleSubPath[] subpathSnap = subpaths.ToArray(); + RoleSubPath subpath; + for (i = 0; i < subpathCount; ++i) + { + subpath = subpathSnap[i]; + RemoveIntraFactTypeSplits( + subpath, + ref entryPathedRoles, + entryRoleIndex, + entryPathedRoles == null || (inPositiveConjunction && subpath.SplitCombinationOperator == LogicalCombinationOperator.And && !subpath.SplitIsNegated), + notifyAdded); + } + if (subpaths.Count == 1 && + (subpath = subpaths[0]).PathRoot == null) + { + // We've eliminated one or more subpaths and no longer need the single path. + // Move pathed roles and subpaths up one level. + foreach (PathedRole nestedPathedRole in subpath.PathedRoleCollection) + { + nestedPathedRole.RolePath = rolePath; + } + foreach (RoleSubPathIsContinuationOfRolePath nestedSubPathLink in RoleSubPathIsContinuationOfRolePath.GetLinksToSubPathCollection(rolePath)) + { + nestedSubPathLink.ParentRolePath = rolePath; + } + subpath.Delete(); + } + } + else if (scrubbedSplit && rolePath.RoleCollection.Count == 0) + { + // This branch is empty, we don't need it anymore + rolePath.Delete(); + } + } + private static void ScrubIntraFactTypeSplit(RolePath rolePath, ReadOnlyCollection<PathedRole> currentPathedRoles, ref ReadOnlyCollection<PathedRole> entryPathedRoles, int entryRoleIndex, bool inPositiveConjunction, INotifyElementAdded notifyAdded) + { + // Find the deepest role to scrub and work backwards + int pathedRoleCount = currentPathedRoles.Count; + + // We already know 0 is an ift role and there is no path root, or we wouldn't be here. + + // The initial ift role can be transformed directly into the path root of this path, + // but any subsequent roles need to split off their own path. Do this part first. + PathedRole replacePathedRole; + PathedRole correlatedRole; + RolePathObjectTypeRoot replacementPathRoot; + bool injectedRoleAtEnd; + for (int i = 1; i < pathedRoleCount; ++i) + { + if (currentPathedRoles[i].PathedRolePurpose != PathedRolePurpose.SameFactType) + { + // Work backwards. Injecting these roles into the entry fact type will + // at least give some semblance of order. + RoleSubPath lastSubpath = null; + Store store = rolePath.Store; + for (int j = i - 1; j >= 1; --j) + { + replacePathedRole = currentPathedRoles[j]; + correlatedRole = InjectPathedRole(replacePathedRole, ref entryPathedRoles, entryRoleIndex, false, notifyAdded, out injectedRoleAtEnd); + RoleSubPath subpath; + notifyAdded.ElementAdded(subpath = new RoleSubPath(store)); + if (null != (replacementPathRoot = CreateCorrelatedRoot(subpath, correlatedRole, notifyAdded))) + { + TransferAdherents(replacePathedRole, replacementPathRoot, null, notifyAdded); + } + replacePathedRole.Delete(); + if (lastSubpath == null) + { + // Move all trailing pathed roles down to the new subpath. Note that + // we've deleted j, but the indices don't move because we're analyzing + // a read-only collection. + for (int k = j + 1; j < pathedRoleCount; ++k) + { + PathedRole reparentPathedRole = currentPathedRoles[k]; + reparentPathedRole.RolePath = subpath; + } + foreach (RoleSubPathIsContinuationOfRolePath subPathLink in RoleSubPathIsContinuationOfRolePath.GetLinksToSubPathCollection(rolePath)) + { + subPathLink.ParentRolePath = subpath; + } + } + else + { + notifyAdded.ElementAdded(new RoleSubPathIsContinuationOfRolePath(subpath, lastSubpath), false); + } + lastSubpath = subpath; + } + if (lastSubpath != null) + { + notifyAdded.ElementAdded(new RoleSubPathIsContinuationOfRolePath(rolePath, lastSubpath)); + } + break; + } + } + + // Handle the lead pathed role + replacePathedRole = currentPathedRoles[0]; + correlatedRole = InjectPathedRole(replacePathedRole, ref entryPathedRoles, entryRoleIndex, inPositiveConjunction, notifyAdded, out injectedRoleAtEnd); + if (correlatedRole == replacePathedRole) + { + // The role pathed role was moved to the end of the entry fact type + // and can be joined to directly to any following elements. Anything + // left in this subpath can be moved to the parent path (this only + // happens under positive conjunction, so the split settings no longer + // need to be checked or moved). + RoleSubPath subpath; + if (null != (subpath = rolePath as RoleSubPath)) + { + RolePath parentPath = subpath.ParentRolePath; + bool movedPathedRole = false; + foreach (PathedRole remainingPathedRole in PathedRole.GetLinksToRoleCollection(rolePath)) + { + remainingPathedRole.RolePath = parentPath; + movedPathedRole = true; + } + if (movedPathedRole) + { + entryPathedRoles = entryPathedRoles[0].RolePath.PathedRoleCollection; + } + ReadOnlyCollection<RoleSubPathIsContinuationOfRolePath> nestedSubpathLinks = RoleSubPathIsContinuationOfRolePath.GetLinksToSubPathCollection(rolePath); + int nestedSubpathCount = nestedSubpathLinks.Count; + if (nestedSubpathCount != 0) + { + // Find a context entry role in the new extended pathed roles + ReadOnlyCollection<PathedRole> newPathedRoles = parentPath.PathedRoleCollection; + int newEntryRoleIndex = -1; + for (int i = newPathedRoles.Count - 1; i >= 0; --i) + { + if (newPathedRoles[i].PathedRolePurpose != PathedRolePurpose.SameFactType) + { + newEntryRoleIndex = i; + break; + } + } + if (newEntryRoleIndex == -1) + { + newPathedRoles = null; + } + + // Move all of the nested subpaths to this location + LinkedElementCollection<RoleSubPath> parentSubpaths = parentPath.SubPathCollection; + int moveTo = parentSubpaths.IndexOf(subpath) + 1; + bool atEnd = moveTo == parentSubpaths.Count; + DomainRoleInfo roleInfo = atEnd ? null : parentPath.Store.DomainDataDirectory.FindDomainRole(RoleSubPathIsContinuationOfRolePath.ParentRolePathDomainRoleId); + for (int i = 0; i < nestedSubpathCount; ++i) + { + RoleSubPathIsContinuationOfRolePath nestedSubpathLink = nestedSubpathLinks[i]; + nestedSubpathLink.ParentRolePath = parentPath; + if (!atEnd) + { + nestedSubpathLink.MoveToIndex(roleInfo, moveTo); + ++moveTo; + } + } + + // Delete the current subpath before recursing + subpath.Delete(); + + // With these subpaths now attached to the parent, we can do their + // ift processing. These won't be picked up by the calling code, which snapshots + // the roles before we get this far. + for (int i = 0; i < nestedSubpathCount; ++i) + { + RemoveIntraFactTypeSplits(nestedSubpathLinks[i].SubPath, ref newPathedRoles, newEntryRoleIndex, rolePath.SplitCombinationOperator == LogicalCombinationOperator.And && !rolePath.SplitIsNegated, notifyAdded); + } + } + else + { + // This subpath has been fully absorbed into the parent path, delete it. + subpath.Delete(); + } + } + } + else + { + // There is nothing needed. The injected role was placed the end of the list, which + // means that the natural join is for the next role. + if (injectedRoleAtEnd) + { + replacementPathRoot = null; + TransferAdherents( + replacePathedRole, + null, + delegate() + { + return replacementPathRoot ?? (replacementPathRoot = CreateCorrelatedRoot(rolePath, correlatedRole, notifyAdded)); + }, + notifyAdded); + } + else + { + if (null != (replacementPathRoot = CreateCorrelatedRoot(rolePath, correlatedRole, notifyAdded))) + { + TransferAdherents(replacePathedRole, replacementPathRoot, null, notifyAdded); + } + } + replacePathedRole.Delete(); + } + } + private delegate RolePathObjectTypeRoot GetPathRoot(); + /// <summary> + /// Helper for RemoveIntraFactTypeSplits. Move projections, calculations, and value + /// range information from a pending removed role to a path root. + /// </summary> + private static void TransferAdherents(PathedRole fromRole, RolePathObjectTypeRoot toRoot, GetPathRoot delayCreateRoot, INotifyElementAdded notifyAdded) + { + // Move value constraint ranges + Store store = fromRole.Store; + PathConditionRoleValueConstraint roleValueConstraint; + if (null != (roleValueConstraint = fromRole.ValueConstraint)) + { + PathConditionRootValueConstraint rootConstraint; + notifyAdded.ElementAdded(rootConstraint = new PathConditionRootValueConstraint(store)); + foreach (ValueConstraintHasValueRange rangeLink in ValueConstraintHasValueRange.GetLinksToValueRangeCollection(roleValueConstraint)) + { + rangeLink.ValueConstraint = rootConstraint; + } + if (null == (toRoot ?? (toRoot = delayCreateRoot()))) + { + return; + } + notifyAdded.ElementAdded(new RolePathRootHasValueConstraint(toRoot, rootConstraint)); + roleValueConstraint.Delete(); + } + + // Note that correlations have already been synchronized during InjectPathedRole and CreateCorrelatedRoot, + // there is no need to check them here. + + // Check remaining known link types. Note that this could be optimized with + // a lookup table by link type, but speed is not paramount while eliminating + // deprecated elements. + CalculatedPathValueInputBindsToPathedRole calculationInputLink; + DerivedRoleProjectedFromPathedRole roleProjectionLink; + ConstraintRoleProjectedFromPathedRole constraintRoleProjectionLink; + CalculatedPathValueAggregationContextIncludesPathedRole aggContextLink; + QueryParameterBoundToPathedRole queryParameterBindingLink; + SubqueryParameterInputFromPathedRole subqueryParameterInputLink; + foreach (ElementLink link in DomainRoleInfo.GetAllElementLinks(fromRole)) + { + if (null != (calculationInputLink = link as CalculatedPathValueInputBindsToPathedRole)) + { + if (null == (toRoot ?? (toRoot = delayCreateRoot()))) + { + return; + } + notifyAdded.ElementAdded(new CalculatedPathValueInputBindsToRolePathRoot(calculationInputLink.Input, toRoot)); + } + else if (null != (roleProjectionLink = link as DerivedRoleProjectedFromPathedRole)) + { + if (null == (toRoot ?? (toRoot = delayCreateRoot()))) + { + return; + } + notifyAdded.ElementAdded(new DerivedRoleProjectedFromRolePathRoot(roleProjectionLink.RoleProjection, toRoot)); + } + else if (null != (constraintRoleProjectionLink = link as ConstraintRoleProjectedFromPathedRole)) + { + if (null == (toRoot ?? (toRoot = delayCreateRoot()))) + { + return; + } + notifyAdded.ElementAdded(new ConstraintRoleProjectedFromRolePathRoot(constraintRoleProjectionLink.ConstraintRoleProjection, toRoot)); + } + else if (null != (aggContextLink = link as CalculatedPathValueAggregationContextIncludesPathedRole)) + { + if (null == (toRoot ?? (toRoot = delayCreateRoot()))) + { + return; + } + notifyAdded.ElementAdded(new CalculatedPathValueAggregationContextIncludesRolePathRoot(aggContextLink.CalculatedValue, toRoot)); + } + else if (null != (queryParameterBindingLink = link as QueryParameterBoundToPathedRole)) + { + if (null == (toRoot ?? (toRoot = delayCreateRoot()))) + { + return; + } + notifyAdded.ElementAdded(new QueryParameterBoundToRolePathRoot(queryParameterBindingLink.ParameterBinding, toRoot)); + } + else if (null != (subqueryParameterInputLink = link as SubqueryParameterInputFromPathedRole)) + { + if (null == (toRoot ?? (toRoot = delayCreateRoot()))) + { + return; + } + notifyAdded.ElementAdded(new SubqueryParameterInputFromRolePathRoot(subqueryParameterInputLink.ParameterInput, toRoot)); + } + else + { + continue; + } + link.Delete(); + } + } + private static PathedRole InjectPathedRole(PathedRole replacePathedRole, ref ReadOnlyCollection<PathedRole> entryPathedRoles, int entryRoleIndex, bool canStealReplaceRole, INotifyElementAdded notifyAdded, out bool injectedRoleAtEnd) + { + // Inject a role immediately after the entry role. Theoretically each role during + // an ift was used one time only, but this was weakly enforced and there was no + // underlying theoretical reason for it, so we verify this condition. + // The harder case here is if there is no trailing same fact type role, + // which means that the following joined roles will now need a new correlation + // root to clean this up. + Role role = replacePathedRole.Role; + + PathedRole factTypeEntry = entryPathedRoles[entryRoleIndex]; + int roleCount = entryPathedRoles.Count; + if (factTypeEntry.Role == role) + { + // Unlikely, but sufficient + SynchronizePathedRoleUnifiers(factTypeEntry, replacePathedRole); + injectedRoleAtEnd = entryRoleIndex == (roleCount - 1); + return factTypeEntry; + } + int i = entryRoleIndex + 1; + for (; i < roleCount; ++i) + { + PathedRole testPathedRole = entryPathedRoles[i]; + if (testPathedRole.PathedRolePurpose != PathedRolePurpose.SameFactType) + { + break; + } + else if (testPathedRole.Role == role) + { + SynchronizePathedRoleUnifiers(testPathedRole, replacePathedRole); + injectedRoleAtEnd = i == (roleCount - 1); + return testPathedRole; + } + } + RolePath rolePath = factTypeEntry.RolePath; + if (i == (entryRoleIndex + 1)) + { + // There are no trailing same fact type roles, so we need to make sure that + // following subpaths get a correlated root to the entry role. + // Note that anything that already has a path root can be safely ignored. + // All of these variables are in the same fact use, so it doesn't matter + // which of the variables we coexist with. Only worry about the subpaths + // with no root and a lead join role. The path to modify may be nested + // because subpaths can exist for splits only. + ReanchorSubpaths(rolePath.SubPathCollection, factTypeEntry, notifyAdded); + } + // Create and return a new same fact type pathed role at this location. + PathedRole newPathedRole; + if (canStealReplaceRole && + (entryRoleIndex + 1) == roleCount) + { + newPathedRole = replacePathedRole; + newPathedRole.RolePath = rolePath; + } + else + { + notifyAdded.ElementAdded(newPathedRole = new PathedRole(rolePath, role), false); + if ((entryRoleIndex + 1) != roleCount) + { + newPathedRole.MoveToIndex(newPathedRole.Store.DomainDataDirectory.FindDomainRole(PathedRole.RolePathDomainRoleId), entryRoleIndex + 1); + } + + } + // The readonly collection has changed, update it for future reference + entryPathedRoles = rolePath.PathedRoleCollection; + SynchronizePathedRoleUnifiers(newPathedRole, replacePathedRole); + injectedRoleAtEnd = entryRoleIndex == (roleCount - 1); + return newPathedRole; + } + /// <summary> + /// Synchronize correlation settings prior to deleting a role. + /// Helper for RemoveIntraFactTypeSplits. + /// </summary> + private static void SynchronizePathedRoleUnifiers(PathedRole pathedRole, PathedRole replacePathedRole) + { + PathObjectUnifier unifier; + if (pathedRole != replacePathedRole && // Sanity check + null != (unifier = replacePathedRole.ObjectUnifier)) + { + PathObjectUnifier otherUnifier; + if (null != (otherUnifier = pathedRole.ObjectUnifier)) + { + foreach (PathObjectUnifierUnifiesPathedRole pathedRoleLink in PathObjectUnifierUnifiesPathedRole.GetLinksToPathedRoleCollection(unifier)) + { + if (pathedRoleLink.PathedRole != replacePathedRole) + { + pathedRoleLink.ObjectUnifier = otherUnifier; + } + } + foreach (PathObjectUnifierUnifiesRolePathRoot pathRootLink in PathObjectUnifierUnifiesRolePathRoot.GetLinksToPathRootCollection(unifier)) + { + pathRootLink.ObjectUnifier = otherUnifier; + } + unifier.Delete(); + } + else + { + replacePathedRole.ObjectUnifier = null; + pathedRole.ObjectUnifier = unifier; + } + } + } + /// <summary> + /// Helper for RemoveIntraFactTypeSplits. For a following subpath that begins with an entry role and + /// has no path root, set the path root and correlated with the provided pathed role. + /// </summary> + private static void ReanchorSubpaths(LinkedElementCollection<RoleSubPath> subpaths, PathedRole unifyWithPathedRole, INotifyElementAdded notifyAdded) + { + foreach (RoleSubPath subpath in subpaths) + { + if (subpath.PathRoot == null) + { + ReadOnlyCollection<PathedRole> pathedRoles = subpath.PathedRoleCollection; + if (pathedRoles.Count == 0) + { + // This path splits before it does anything, recurse. + ReanchorSubpaths(subpath.SubPathCollection, unifyWithPathedRole, notifyAdded); + } + else if (pathedRoles[0].PathedRolePurpose != PathedRolePurpose.SameFactType) + { + CreateCorrelatedRoot(subpath, unifyWithPathedRole, notifyAdded); + } + } + } + } + /// <summary> + /// Helper for RemoveIntraFactTypeSplits. Correlates a new path root with an existing + /// pathed role. The pathed role is guaranteed to be in the path (so we can get + /// back to the root to create unifiers), but the provided subpath may not be rooted yet. + /// Note that this will return null if the role does not have a role player. + /// </summary> + private static RolePathObjectTypeRoot CreateCorrelatedRoot(RolePath rolePath, PathedRole unifyWithPathedRole, INotifyElementAdded notifyAdded) + { + ObjectType rootType = unifyWithPathedRole.Role.RolePlayer; + if (rootType == null) + { + // This will result in correlation errors in the path, but this case is rare + // and the only way to avoid the issue is to stick with the intra-fact type splits, + // which do not require role players. + return null; + } + RolePathObjectTypeRoot pathRoot; + PathObjectUnifier unifier; + notifyAdded.ElementAdded(pathRoot = new RolePathObjectTypeRoot(rolePath, unifyWithPathedRole.Role.RolePlayer), false); + if (null == (unifier = unifyWithPathedRole.ObjectUnifier)) + { + notifyAdded.ElementAdded(unifier = new PathObjectUnifier(rolePath.Store), false); + notifyAdded.ElementAdded(new LeadRolePathHasObjectUnifier(unifyWithPathedRole.RolePath.RootRolePath, unifier)); + notifyAdded.ElementAdded(new PathObjectUnifierUnifiesPathedRole(unifier, unifyWithPathedRole)); + } + notifyAdded.ElementAdded(new PathObjectUnifierUnifiesRolePathRoot(unifier, pathRoot)); + return pathRoot; + } + /// <summary> /// Upgrade a pathed role correlation hierarchy to the replacement <see cref="PathObjectUnifier"/> element. /// </summary> private static void UpgradeRemoteCorrelationToObjectUnifier(LeadRolePath leadRolePath, PathedRole correlationParent, INotifyElementAdded notifyAdded) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2013-02-21 23:40:47
|
Revision: 1512 http://orm.svn.sourceforge.net/orm/?rev=1512&view=rev Author: mcurland Date: 2013-02-21 23:40:39 +0000 (Thu, 21 Feb 2013) Log Message: ----------- Fix null reference exception doing non-customized name generation when initially turning on relational model. Fixes problem in [1511]. Modified Paths: -------------- trunk/ORMModel/ShapeModel/ORMDiagram.resx trunk/RelationalModel/OialDcilBridge/NameGeneration.cs Modified: trunk/ORMModel/ShapeModel/ORMDiagram.resx =================================================================== --- trunk/ORMModel/ShapeModel/ORMDiagram.resx 2013-02-20 04:50:30 UTC (rev 1511) +++ trunk/ORMModel/ShapeModel/ORMDiagram.resx 2013-02-21 23:40:39 UTC (rev 1512) @@ -536,7 +536,7 @@ <comment xml:space="preserve">The message displayed if a selected item cannot be located in the model browser.</comment> </data> <data name="MessageBox.RevertExtensions.Message"> - <value xml:space="preserve">Restoring previous model state, loading new extensions faileds with exception:
</value> + <value xml:space="preserve">Restoring previous model state, loading new extensions failed with exception:
</value> <comment xml:space="preserve">The header for the message displayed if a set of extensions fails to correctly reload.</comment> </data> <data name="MessageBox.ImpliedInternalUniquenessConstraint.Message"> Modified: trunk/RelationalModel/OialDcilBridge/NameGeneration.cs =================================================================== --- trunk/RelationalModel/OialDcilBridge/NameGeneration.cs 2013-02-20 04:50:30 UTC (rev 1511) +++ trunk/RelationalModel/OialDcilBridge/NameGeneration.cs 2013-02-21 23:40:39 UTC (rev 1512) @@ -166,17 +166,15 @@ public static void GenerateAllNames(Schema schema, SchemaCustomization customization) { // Verify the schema name - string customSchemaName = customization.CustomizedSchemaName; - if (customSchemaName == null) + AbstractionModel abstraction; + string customSchemaName; + if (null != (customSchemaName = + ((null == customization || + null == (customSchemaName = customization.CustomizedSchemaName)) && + null != (abstraction = SchemaIsForAbstractionModel.GetAbstractionModel(schema))) ? + abstraction.Name : + null)) { - AbstractionModel abstraction; - if (null != (abstraction = SchemaIsForAbstractionModel.GetAbstractionModel(schema))) - { - customSchemaName = abstraction.Name; - } - } - if (customSchemaName != null) - { schema.Name = customSchemaName; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2013-01-12 07:28:33
|
Revision: 1510 http://orm.svn.sourceforge.net/orm/?rev=1510&view=rev Author: mcurland Date: 2013-01-12 07:28:20 +0000 (Sat, 12 Jan 2013) Log Message: ----------- * Initial relational and Barker diagrams not loading shapes immediately after diagram is loaded. Caused by diagram initialization changes in [1508]. Explicitly request shapes for displayed elements during diagram initialization. * Enable shapes from generated models to share the 'Select on Diagram' menu with other designers displaying the same type of shape. Based on the IRecognizedSharedPresentationType, which extends IDisplayMultiplePresentations to provide a 'presentation type key' string that can be returned by multiple diagram types. * Pushed version to January 2013 to match actually date refs #193 Modified Paths: -------------- trunk/AlternateViews/BarkerERView/ShapeModel/BarkerERDiagram.cs trunk/AlternateViews/BarkerERView/ShapeModel/BarkerEntityShape.cs trunk/AlternateViews/RelationalView/ShapeModel/RelationalDiagram.cs trunk/AlternateViews/RelationalView/ShapeModel/TableShape.cs trunk/ORMModel/Framework/Diagrams/MultiShapeUtility.cs trunk/Setup/Readme.htm trunk/VersionGenerator.exe.config Modified: trunk/AlternateViews/BarkerERView/ShapeModel/BarkerERDiagram.cs =================================================================== --- trunk/AlternateViews/BarkerERView/ShapeModel/BarkerERDiagram.cs 2013-01-02 07:18:49 UTC (rev 1509) +++ trunk/AlternateViews/BarkerERView/ShapeModel/BarkerERDiagram.cs 2013-01-12 07:28:20 UTC (rev 1510) @@ -3,6 +3,7 @@ * Natural Object-Role Modeling Architect for Visual Studio * * * * Copyright \xA9 Neumont University. All rights reserved. * +* Copyright \xA9 ORM Solutions, LLC. All rights reserved. * * * * The use and distribution terms for this software are covered by the * * Common Public License 1.0 (http://opensource.org/licenses/cpl) which * @@ -56,7 +57,19 @@ ReadOnlyCollection<BarkerErModel> barkerModels = store.ElementDirectory.FindElements<BarkerErModel>(false); if (barkerModels.Count != 0) { - diagram.Associate(barkerModels[0]); + BarkerErModel model = barkerModels[0]; + diagram.Associate(model); + foreach (EntityType entity in model.EntityTypeCollection) + { + Diagram.FixUpDiagram(model, entity); + } + foreach (BarkerErModelContainsBinaryAssociation link in store.ElementDirectory.FindElements<BarkerErModelContainsBinaryAssociation>(false)) + { + if (link.BarkerErModel == model) + { + FixUpDiagram(model, link); + } + } } } } Modified: trunk/AlternateViews/BarkerERView/ShapeModel/BarkerEntityShape.cs =================================================================== --- trunk/AlternateViews/BarkerERView/ShapeModel/BarkerEntityShape.cs 2013-01-02 07:18:49 UTC (rev 1509) +++ trunk/AlternateViews/BarkerERView/ShapeModel/BarkerEntityShape.cs 2013-01-12 07:28:20 UTC (rev 1510) @@ -3,6 +3,7 @@ * Natural Object-Role Modeling Architect for Visual Studio * * * * Copyright \xA9 Neumont University. All rights reserved. * +* Copyright \xA9 ORM Solutions, LLC. All rights reserved. * * * * The use and distribution terms for this software are covered by the * * Common Public License 1.0 (http://opensource.org/licenses/cpl) which * @@ -15,19 +16,20 @@ #endregion using System; +using System.Collections; using System.Collections.Generic; +using System.Diagnostics; using Microsoft.VisualStudio.Modeling; using Microsoft.VisualStudio.Modeling.Diagrams; using ORMSolutions.ORMArchitect.Core.ObjectModel; using ORMSolutions.ORMArchitect.Framework; -using System.Collections; -using System.Diagnostics; +using ORMSolutions.ORMArchitect.Framework.Diagrams; using ORMSolutions.ORMArchitect.EntityRelationshipModels.Barker; using Barker = ORMSolutions.ORMArchitect.EntityRelationshipModels.Barker; namespace ORMSolutions.ORMArchitect.Views.BarkerERView { - partial class BarkerEntityShape + partial class BarkerEntityShape : IRecognizedSharedPresentationType { #region Customize Appearance /// <summary> @@ -328,6 +330,25 @@ return retVal; } #endregion // Customize Column Order + #region IRecognizedSharedPresentationType Implementation + /// <summary> + /// Allow 'select on diagram' to work with other relational shape models + /// </summary> + protected static string SharedPresentationTypeKey + { + get + { + return "EntityRelationalEntityShape"; + } + } + string IRecognizedSharedPresentationType.SharedPresentationTypeKey + { + get + { + return SharedPresentationTypeKey; + } + } + #endregion // IRecognizedSharedPresentationType Implementation #region Event Management /// <summary> /// Manages <see cref="EventHandler{TEventArgs}"/>s in the <see cref="Store"/> for <see cref="BarkerEntityShape"/>s. Modified: trunk/AlternateViews/RelationalView/ShapeModel/RelationalDiagram.cs =================================================================== --- trunk/AlternateViews/RelationalView/ShapeModel/RelationalDiagram.cs 2013-01-02 07:18:49 UTC (rev 1509) +++ trunk/AlternateViews/RelationalView/ShapeModel/RelationalDiagram.cs 2013-01-12 07:28:20 UTC (rev 1510) @@ -3,6 +3,7 @@ * Natural Object-Role Modeling Architect for Visual Studio * * * * Copyright \xA9 Neumont University. All rights reserved. * +* Copyright \xA9 ORM Solutions, LLC. All rights reserved. * * * * The use and distribution terms for this software are covered by the * * Common Public License 1.0 (http://opensource.org/licenses/cpl) which * @@ -55,7 +56,24 @@ ReadOnlyCollection<Catalog> catalogs = store.ElementDirectory.FindElements<Catalog>(false); if (catalogs.Count != 0) { - diagram.Associate(catalogs[0]); + Catalog catalog = catalogs[0]; + diagram.Associate(catalog); + foreach (Schema schema in catalog.SchemaCollection) + { + foreach (Table table in schema.TableCollection) + { + Diagram.FixUpDiagram(catalog, table); + } + foreach (ReferenceConstraintTargetsTable fkLink in store.ElementDirectory.FindElements<ReferenceConstraintTargetsTable>(false)) + { + Table sourceTable; + if (null != (sourceTable = fkLink.ReferenceConstraint.SourceTable) && + schema == sourceTable.Schema) + { + Diagram.FixUpDiagram(catalog, fkLink); + } + } + } } } } Modified: trunk/AlternateViews/RelationalView/ShapeModel/TableShape.cs =================================================================== --- trunk/AlternateViews/RelationalView/ShapeModel/TableShape.cs 2013-01-02 07:18:49 UTC (rev 1509) +++ trunk/AlternateViews/RelationalView/ShapeModel/TableShape.cs 2013-01-12 07:28:20 UTC (rev 1510) @@ -23,18 +23,19 @@ // #define CUSTOMSORT using System; +using System.Collections; using System.Collections.Generic; +using System.Diagnostics; using Microsoft.VisualStudio.Modeling; using Microsoft.VisualStudio.Modeling.Diagrams; -using ORMSolutions.ORMArchitect.RelationalModels.ConceptualDatabase; using ORMSolutions.ORMArchitect.Core.ObjectModel; using ORMSolutions.ORMArchitect.Framework; -using System.Collections; -using System.Diagnostics; +using ORMSolutions.ORMArchitect.Framework.Diagrams; +using ORMSolutions.ORMArchitect.RelationalModels.ConceptualDatabase; namespace ORMSolutions.ORMArchitect.Views.RelationalView { - partial class TableShape + partial class TableShape : IRecognizedSharedPresentationType { #region Customize Appearance /// <summary> @@ -329,6 +330,25 @@ } #endif // CUSTOMSORT #endregion // Customize Column Order + #region IRecognizedSharedPresentationType Implementation + /// <summary> + /// Allow 'select on diagram' to work with other relational shape models + /// </summary> + protected static string SharedPresentationTypeKey + { + get + { + return "RelationalTableShape"; + } + } + string IRecognizedSharedPresentationType.SharedPresentationTypeKey + { + get + { + return SharedPresentationTypeKey; + } + } + #endregion // IRecognizedSharedPresentationType Implementation #region Event Management /// <summary> /// Manages <see cref="EventHandler{TEventArgs}"/>s in the <see cref="Store"/> for <see cref="TableShape"/>s. Modified: trunk/ORMModel/Framework/Diagrams/MultiShapeUtility.cs =================================================================== --- trunk/ORMModel/Framework/Diagrams/MultiShapeUtility.cs 2013-01-02 07:18:49 UTC (rev 1509) +++ trunk/ORMModel/Framework/Diagrams/MultiShapeUtility.cs 2013-01-12 07:28:20 UTC (rev 1510) @@ -1291,7 +1291,9 @@ /// Determines if a the model element backing the shape element /// is represented by a shape of the same type elsewhere in the presentation /// layer. If a derived shape displays multiple presentations, they should - /// implement the<see cref="IDisplayMultiplePresentations"/> interface. + /// implement the <see cref="IDisplayMultiplePresentations"/> interface. + /// Shapes of different types can also included if both the context and + /// target shapes implement <see cref="IRecognizedSharedPresentationType"/> /// </summary> public static bool ElementHasMultiplePresentations(ShapeElement shapeElement) { @@ -1305,10 +1307,17 @@ { Partition shapePartition = shapeElement.Partition; Type thisType = shapeElement.GetType(); + IRecognizedSharedPresentationType sharedType = shapeElement as IRecognizedSharedPresentationType; + string sharedKey = sharedType == null ? null : sharedType.SharedPresentationTypeKey; for (int i = 0; i < pelCount; ++i) { PresentationElement pel = presentationElements[i]; - if (shapeElement != pel && shapePartition == pel.Partition && thisType.IsAssignableFrom(pel.GetType())) + IRecognizedSharedPresentationType sharedPelType; + if (shapeElement != pel && + shapePartition == pel.Partition && + (sharedKey == null ? + thisType.IsAssignableFrom(pel.GetType()) : + (null != (sharedPelType = pel as IRecognizedSharedPresentationType) && sharedPelType.SharedPresentationTypeKey == sharedKey))) { return true; } @@ -1341,11 +1350,29 @@ Diagram visitedDiagram = null; Partition shapePartition = (shapeElement != null) ? shapeElement.Partition : modelElement.Partition; - Type thisType = (shapeElement != null) ? shapeElement.GetType() : typeof(ShapeElement); + Type thisType; + string sharedKey = null; + if (shapeElement != null) + { + thisType = shapeElement.GetType(); + IRecognizedSharedPresentationType sharedType; + if (null != (sharedType = shapeElement as IRecognizedSharedPresentationType)) + { + sharedKey = sharedType.SharedPresentationTypeKey; + } + } + else + { + thisType = typeof(ShapeElement); + } for (int i = 0; i < pelCount; ++i) { PresentationElement pel = presentationElements[i]; - if (shapePartition == pel.Partition && thisType.IsAssignableFrom(pel.GetType())) + IRecognizedSharedPresentationType sharedPelType; + if (shapePartition == pel.Partition && + (sharedKey == null ? + thisType.IsAssignableFrom(pel.GetType()) : + (null != (sharedPelType = pel as IRecognizedSharedPresentationType) && sharedPelType.SharedPresentationTypeKey == sharedKey))) { ShapeElement sel = pel as ShapeElement; Diagram selDiagram = sel.Diagram; @@ -1474,10 +1501,26 @@ /// than one presentation is visible. Derived shapes should /// use the <see cref="MultiShapeUtility.ElementHasMultiplePresentations"/> /// method to determine when multiple presentations should be displayed. + /// The default behavior requires that the diagram types be exactly the + /// same. To match shapes across different diagram types, both diagram + /// types should also implement <see cref="IRecognizedSharedPresentationType"/>, + /// which derives from this interface. /// </summary> public interface IDisplayMultiplePresentations { // No methods } + /// <summary> + /// An extension to <see cref="IDisplayMultiplePresentations"/> to allow shapes of + /// different types to be included in the 'Select on Diagram' list. All shared types + /// must returned the same type key to enable cross-navigation. + /// </summary> + public interface IRecognizedSharedPresentationType : IDisplayMultiplePresentations + { + /// <summary> + /// Return a string indicating a named type + /// </summary> + string SharedPresentationTypeKey { get;} + } #endregion //Interfaces } Modified: trunk/Setup/Readme.htm =================================================================== --- trunk/Setup/Readme.htm 2013-01-02 07:18:49 UTC (rev 1509) +++ trunk/Setup/Readme.htm 2013-01-12 07:28:20 UTC (rev 1510) @@ -3,7 +3,7 @@ <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/> -<title>NORMA December 2012 CTP Readme</title> +<title>NORMA January 2013 CTP Readme</title> <style type="text/css"> .new {font-size:x-small; background-color:Gold; color:Blue; } li {padding-bottom: 3px;} @@ -12,9 +12,9 @@ <body> -<p><b><a id="The Top" style="font-family:Verdana;font-size:medium">NORMA December 2012 CTP Readme</a> </b></p> +<p><b><a id="The Top" style="font-family:Verdana;font-size:medium">NORMA January 2013 CTP Readme</a> </b></p> <p>This file supersedes the previous readme.txt and older readme.htm files. This readme has parallel indexing mechanisms: by topic, and by release date (starting with the October 2008 (2008-10) release). The file will be extended for future product releases.<br/><br/> -The December 2012 release adds Visual Studio 2012 support, new constraint connections between a subtyping relationship and normal roles, some enhancements to disjunctive mandatory and external uniqueness verbalization patterns, native SQL Server data type handling, and other bug fixes. See detailed change notes below for specifics.<br/><br/> +The January 2013 release adds Visual Studio 2012 support, new constraint connections between a subtyping relationship and normal roles, some enhancements to disjunctive mandatory and external uniqueness verbalization patterns, native SQL Server data type handling, and other bug fixes. See detailed change notes below for specifics.<br/><br/> </p> <h2>Contents</h2> <ul> @@ -43,12 +43,12 @@ </ul>--> <hr/> -<h2>December 2012 CTP Changes</h2> -<div>The December 2012 CTP release includes all modifications through changeset 1509. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<h2>January 2013 CTP Changes</h2> +<div>The January 2013 CTP release includes all modifications through changeset 1510. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> <ul> -<li><a href="#VerbalizedObjectTypeNameRemoveSpecialCharacterDisplay 2012-12">Verbalized object type name separator character removal options</a></li> -<li><a href="#SQLServerNativeDataTypes 2012-12">SQL Server Native Data Types</a></li> -<li><a href="#ExtendedSubtypeConstraintCombinations 2012-12">Extended Subtyping Constraint Combinations</a></li> +<li><a href="#VerbalizedObjectTypeNameRemoveSpecialCharacterDisplay 2013-01">Verbalized object type name separator character removal options</a></li> +<li><a href="#SQLServerNativeDataTypes 2013-01">SQL Server Native Data Types</a></li> +<li><a href="#ExtendedSubtypeConstraintCombinations 2013-01">Extended Subtyping Constraint Combinations</a></li> <li>Other Features: <ol> @@ -598,7 +598,7 @@ The <strong>Possible Populations</strong> option has replaced the <strong>Verbalization Default Constraint</strong> option in the <em>Verbalization</em> section of the <em>ORM Designer</em> tab on the <em>Options</em> page (available on the <em>Tools</em> menu). This option now applies to the possible populations of spanning internal uniqueness constraints in addition to many-to-one binary fact types. </li> <li> -<a id="VerbalizedObjectTypeNameRemoveSpecialCharacterDisplay 2012-12" class="new" title="October 2012 CTP: Verbalized object type name separator character removal options">2012-12</a> +<a id="VerbalizedObjectTypeNameRemoveSpecialCharacterDisplay 2013-01" class="new" title="January 2013 CTP: Verbalized object type name separator character removal options">2013-01</a> As an enhancement to automatic name separation and casing of object type names (see <a href="#VerbalizedObjectTypeNameDisplay 2012-01">Verbalized object type name options</a>), punctuation and symbol characters are recognized in addition to upper cases and numeric characters. <ul> <li>All symbol and punctuation characters form word boundaries.</li> @@ -704,7 +704,7 @@ </ul> Designing consistent glyphs for the new combinations required some minor display modifications to published ring display: the tick mark for <em>irreflexive</em> has been moved from the bottom of the shape to directly opposite the dot, the interior circle for <em>symmetric+irreflexive</em> has been moved to the left edge of the symmetric oval and shares the left dot, and an interior tick mark has been added to <em>purely reflexive</em> to distinguish it from <em>reflexive</em> and visually indicate the <em>and no other</em> part of this ring type. </li> -<li><a id="ExtendedSubtypeConstraintCombinations 2012-12" class="new" title="December 2012 CTP: Extended Subtyping Constraint Combinations">2012-12</a> +<li><a id="ExtendedSubtypeConstraintCombinations 2013-01" class="new" title="January 2013 CTP: Extended Subtyping Constraint Combinations">2013-01</a> Selected external constraints can now be connected simultaneously to a subtyping relationship and a normal role. The following constraint combinations are supported: <ul> <li>External mandatory constraints (both inclusive and exclusive).</li> @@ -771,7 +771,7 @@ </ul> <br />Opening and saving files with the relational extensions enabled will automatically update to use the new column orders. Generated DDL will also be updated when the file is saved. </li> -<li><a id="SQLServerNativeDataTypes 2012-12" class="new" title="December 2012 CTP: SQL Server Native Data Types">2012-12</a> +<li><a id="SQLServerNativeDataTypes 2013-01" class="new" title="January 2013 CTP: SQL Server Native Data Types">2013-01</a> Prior to this release, the DDL generated for SQL Server used ANSI standard data type names, but these are not supported by default in SQL Server 2012. The default has now been changed to use native SQL Server data type names. The generator that produces ANSI data types is still included. To use the ANSI types, expand the SQL_SQLServer node in the <em>ORM Generator Settings</em> dialog and choose <em>DDIL to SQL Server (ANSI Types)</em> instead of the default <em>DDIL to SQL Server</em>. <br />You will need to open and save a model file to see the new data types, or right-click the .ORM file in the Solution Explorer and choose the 'Run Custom Tool' menu item. </li> Modified: trunk/VersionGenerator.exe.config =================================================================== --- trunk/VersionGenerator.exe.config 2013-01-02 07:18:49 UTC (rev 1509) +++ trunk/VersionGenerator.exe.config 2013-01-12 07:28:20 UTC (rev 1510) @@ -2,7 +2,7 @@ <configuration> <appSettings> <add key="RevisionStartYearMonth" value="2006-01"/> - <add key="ReleaseYearMonth" value="2012-12"/> + <add key="ReleaseYearMonth" value="2013-01"/> <add key="CountQuartersFromYearMonth" value="2011-01"/> <!-- ReleaseType: "CTP" or "RTM" --> <add key="ReleaseType" value="CTP"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2012-12-13 06:11:56
|
Revision: 1507 http://orm.svn.sourceforge.net/orm/?rev=1507&view=rev Author: mcurland Date: 2012-12-13 06:11:48 +0000 (Thu, 13 Dec 2012) Log Message: ----------- Fixed build warning from [1506]. Modified Paths: -------------- trunk/ORMModel/ObjectModel/Verbalization.cs trunk/Setup/Readme.htm Modified: trunk/ORMModel/ObjectModel/Verbalization.cs =================================================================== --- trunk/ORMModel/ObjectModel/Verbalization.cs 2012-12-13 06:10:08 UTC (rev 1506) +++ trunk/ORMModel/ObjectModel/Verbalization.cs 2012-12-13 06:11:48 UTC (rev 1507) @@ -2734,8 +2734,7 @@ /// <param name="objectType">The object type to get the name from. If the object type is a /// reference mode value type, then it is treated as multiple names.</param> /// <param name="originalName">The name as entered in the model.</param> - /// <param name="style">The verbalization style for this name. Pre-extracted from the <paramref name="verbalizationOptions"/>, or - /// set explicitly when processing different parts of composite generated object type names.</param> + /// <param name="style">The verbalization style for this name.</param> /// <param name="removeSeparatedCharacters">A list of characters to remove from the generated name and treat as spaces. Used when separating combined names.</param> /// <param name="builder">A string builder to append new names to. Can be null on first call, in which case a string is returned.</param> /// <param name="spacePending">A space should be added before the next text part. Used with recursive calls when the style has spaces between the names. Initially false.</param> Modified: trunk/Setup/Readme.htm =================================================================== --- trunk/Setup/Readme.htm 2012-12-13 06:10:08 UTC (rev 1506) +++ trunk/Setup/Readme.htm 2012-12-13 06:11:48 UTC (rev 1507) @@ -44,7 +44,7 @@ <hr/> <h2>December 2012 CTP Changes</h2> -<div>The December 2012 CTP release includes all modifications through changeset 1506. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<div>The December 2012 CTP release includes all modifications through changeset 1507. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> <ul> <li><a href="#VerbalizedObjectTypeNameRemoveSpecialCharacterDisplay 2012-12">Verbalized object type name separator character removal options</a></li> <li><a href="#SQLServerNativeDataTypes 2012-12">SQL Server Native Data Types</a></li> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2012-12-06 04:49:57
|
Revision: 1505 http://orm.svn.sourceforge.net/orm/?rev=1505&view=rev Author: mcurland Date: 2012-12-06 04:49:49 +0000 (Thu, 06 Dec 2012) Log Message: ----------- * Fixed context menu crash when two exclusion constraints selected. * Fixed error implication cases on overlapping equality and exclusion constraints. Error was dependent on creation order of overlapping constraints. * Updated reading text for implication errors to distinguish between subset implication and superset implication in different scenarios. * Missed November, changed version to December 2012 refs #193 Modified Paths: -------------- trunk/ORMModel/ObjectModel/Constraint.cs trunk/ORMModel/ObjectModel/ORMModel.resx trunk/ORMModel/Resources/ResourceStringsGenerator.cs trunk/ORMModel/Resources/ResourceStringsGenerator.xml trunk/ORMModel/Shell/ORMDesignerCommandManager.cs trunk/Setup/Readme.htm trunk/VersionGenerator.exe.config Modified: trunk/ORMModel/ObjectModel/Constraint.cs =================================================================== --- trunk/ORMModel/ObjectModel/Constraint.cs 2012-11-19 16:08:06 UTC (rev 1504) +++ trunk/ORMModel/ObjectModel/Constraint.cs 2012-12-06 04:49:49 UTC (rev 1505) @@ -1495,7 +1495,8 @@ } } } - Guid domainRoleErrorId = validationInfo.DomainRoleToError.Value; + Guid? domainRoleInfo = validationInfo.DomainRoleToError; + Guid domainRoleErrorId = domainRoleInfo.HasValue ? domainRoleInfo.Value : validationInfo.IntersectingDomainRoleToError.Value; Store store = Store; ModelError error = (ModelError)DomainRoleInfo.GetLinkedElement(this, domainRoleErrorId); if (hasError) @@ -3656,13 +3657,11 @@ } //Get these GUIDs from data - DomainRoleInfo towardsErrorRoleInfo = null; ModelError error = null; Guid? domainRoleErrorId = validationInfo.DomainRoleToError; if (domainRoleErrorId.HasValue) { - towardsErrorRoleInfo = store.DomainDataDirectory.GetDomainRole(domainRoleErrorId.Value); - error = (ModelError)towardsErrorRoleInfo.GetLinkedElement((ModelElement)currentConstraint); + error = (ModelError)store.DomainDataDirectory.GetDomainRole(domainRoleErrorId.Value).GetLinkedElement((ModelElement)currentConstraint); } //This variable is used in the code for each validation pattern; but it will be reset @@ -4271,13 +4270,13 @@ /// <summary> /// Validates the SetComparisonConstraint Subset Pattern /// </summary> - /// <param name="setComparsionConstraint">The constraint that might be a subset of another constraint, which + /// <param name="setComparisonConstraint">The constraint that might be a subset of another constraint, which /// would result in an error</param> /// <param name="notifyAdded"></param> /// <param name="validationInfo">Validation information of the current constraint</param> /// <param name="constraintSequences">Sequences linked to the constraint</param> private static void ValidateSetComparisonConstraintSubsetPattern( - SetComparisonConstraint setComparsionConstraint, + SetComparisonConstraint setComparisonConstraint, INotifyElementAdded notifyAdded, IntersectingConstraintValidation validationInfo, LinkedElementCollection<SetComparisonConstraintRoleSequence> constraintSequences) @@ -4289,7 +4288,7 @@ } #region Validation Code - ConstraintModality currentModality = setComparsionConstraint.Modality; + ConstraintModality currentModality = setComparisonConstraint.Modality; List<IConstraint> constraintsToCheck = null; for (int iConstraintSequence = 0; iConstraintSequence < constraintSequenceCount; ++iConstraintSequence) { @@ -4305,7 +4304,7 @@ { ConstraintRoleSequence eligibleSequence = eligibleSequences[k]; IConstraint intersectingConstraint = eligibleSequence.Constraint; - if (intersectingConstraint != setComparsionConstraint && + if (intersectingConstraint != setComparisonConstraint && validationInfo.TestModality(currentModality, intersectingConstraint.Modality) && (validationInfo.ConstraintTypesInPotentialConflict as IList<ConstraintType>).Contains(intersectingConstraint.ConstraintType)) { @@ -4395,10 +4394,15 @@ #region Handling the error int constraintsInErrorCount = (constraintsInError == null) ? 0 : constraintsInError.Count; - Guid domainRoleErrorId = validationInfo.DomainRoleToError.Value; - Store store = setComparsionConstraint.Store; - DomainRoleInfo constraintRoleInfo = store.DomainDataDirectory.FindDomainRole(domainRoleErrorId); - DomainRoleInfo errorRoleInfo = constraintRoleInfo.OppositeDomainRole; + Guid? nullableDomainRoleInfo = validationInfo.DomainRoleToError; + bool errorOnIntersectingConstraint; + if (errorOnIntersectingConstraint = !nullableDomainRoleInfo.HasValue) + { + nullableDomainRoleInfo = validationInfo.IntersectingDomainRoleToError; + } + Guid domainRoleErrorId = nullableDomainRoleInfo.Value; + Store store = setComparisonConstraint.Store; + DomainRoleInfo errorRoleInfo = store.DomainDataDirectory.GetDomainRole(domainRoleErrorId).OppositeDomainRole.OppositeDomainRole; Multiplicity errorToItsConstraintsMultiplicity = errorRoleInfo.Multiplicity; DomainClassInfo errorType = errorRoleInfo.RolePlayer; @@ -4406,10 +4410,13 @@ if (errorToItsConstraintsMultiplicity == Multiplicity.OneMany || errorToItsConstraintsMultiplicity == Multiplicity.ZeroMany) { + // UNDONE: This does not handle the IntersectingDomainRoleToError. This construct isn't used in + // pattern data that triggers this case, but may be in the future. + //If the multiplicity is one-to-many ot zero-to-many: all constraintsInError found need to be attached //to the error - ModelError error = (ModelError)DomainRoleInfo.GetLinkedElement(setComparsionConstraint, domainRoleErrorId); + ModelError error = (ModelError)DomainRoleInfo.GetLinkedElement(setComparisonConstraint, domainRoleErrorId); if (constraintsInErrorCount != 0) { //For this pattern: there can be an error only if there are more than one sequences on @@ -4418,7 +4425,7 @@ { //Updating error object Hashtable constraints = new Hashtable(); - constraints.Add(setComparsionConstraint, domainRoleErrorId); + constraints.Add(setComparisonConstraint, domainRoleErrorId); foreach (IConstraint c in constraintsInError) { @@ -4429,7 +4436,7 @@ //Need to attach the error to all: the current constraint and all constraints, which were found to conflict with it - HandleError(store, false, ref error, domainRoleErrorId, notifyAdded, setComparsionConstraint); + HandleError(store, false, ref error, domainRoleErrorId, notifyAdded, setComparisonConstraint); HandleError(store, true, ref error, domainRoleErrorId, notifyAdded, constraintsInError); } } @@ -4449,32 +4456,48 @@ { //If the multiplicity is one-to-one ot zero-to-one: each constraint found to conflict needs to be //attached to the appropriate error + bool hasError = false; for (int iConstraintInPotentialConflict = 0; iConstraintInPotentialConflict < constraintsToCheckCount; ++iConstraintInPotentialConflict) { IConstraint curConstraint = constraintsToCheck[iConstraintInPotentialConflict]; - ModelError error = (ModelError)DomainRoleInfo.GetLinkedElement((ModelElement)curConstraint, domainRoleErrorId); + if (errorOnIntersectingConstraint) + { + ModelError error = (ModelError)DomainRoleInfo.GetLinkedElement((ModelElement)curConstraint, domainRoleErrorId); - if (constraintsInError != null && constraintsInError.Contains(curConstraint)) - { - //For this pattern: there can be an error only if there are more than one sequences on - //the constraint - if (constraintSequenceCount > 1) + if (constraintsInError != null && constraintsInError.Contains(curConstraint)) { - //Attach the error only to the current constraint - HandleError(store, true, ref error, domainRoleErrorId, notifyAdded, curConstraint); + //For this pattern: there can be an error only if there are more than one sequences on + //the constraint + if (constraintSequenceCount > 1) + { + //Attach the error only to the current constraint + HandleError(store, true, ref error, domainRoleErrorId, notifyAdded, curConstraint); + } } + else if (error != null) //there was an error but not anymore + { + error.Delete(); + } } - else if (error != null) //there was an error but not anymore + else if (constraintSequenceCount > 1 && + constraintsInError != null && + constraintsInError.Contains(curConstraint)) { - error.Delete(); + hasError = true; + break; } } - if (constraintsInErrorCount == 0) + + if (!errorOnIntersectingConstraint) { - ModelError error = (ModelError)DomainRoleInfo.GetLinkedElement(setComparsionConstraint, domainRoleErrorId); - if (error != null) + ModelError error = (ModelError)DomainRoleInfo.GetLinkedElement(setComparisonConstraint, domainRoleErrorId); + if (hasError) { + HandleError(store, true, ref error, domainRoleErrorId, notifyAdded, setComparisonConstraint); + } + else if (error != null) + { error.Delete(); } } @@ -9631,11 +9654,13 @@ public override void GenerateErrorText() { string errorName; + bool impliedBySuperset = false; //Do not know whether the underlying constraint is Set or SetComparison //The error has property for each if (this.SetComparisonConstraint != null) { errorName = SetComparisonConstraint.Name; + impliedBySuperset = true; Debug.Assert(SetConstraint == null); } else @@ -9643,7 +9668,7 @@ errorName = SetConstraint.Name; } - ErrorText = String.Format(CultureInfo.InvariantCulture, ResourceStrings.ModelErrorConstraintImplication, errorName, Model.Name); + ErrorText = String.Format(CultureInfo.InvariantCulture, impliedBySuperset ? ResourceStrings.ModelErrorConstraintImplicationBySuperset : ResourceStrings.ModelErrorConstraintImplicationBySubset, errorName, Model.Name); } /// <summary> /// Regenerate error text when the constraint name or model name changes @@ -10125,8 +10150,8 @@ new IntersectingConstraintValidation( IntersectingConstraintPattern.SetConstraintSubset, IntersectingConstraintPatternOptions.IntersectingConstraintModalityNotWeaker, + null, SetConstraintHasImplicationError.SetConstraintDomainRoleId, - null, ConstraintType.InternalUniqueness, ConstraintType.ExternalUniqueness), }; @@ -10345,6 +10370,13 @@ private static readonly IntersectingConstraintValidation[] myIntersectingValidationInfo = new IntersectingConstraintValidation[] { //Implication + // UNDONE: There are two types of 'subset' than can occur with an exclusion constraint. The + // first is where an exclusion constraint where the implied constraint has a subset of equivalent + // arguments to another constraint. In this case, the constraint with more rows implies the smaller. + // The second case occurs when the argument length is shorter in one case than the other. For an + // equality constraint, the pair (or longer) arguments implies the shorter arguments. However, for an + // exclusion constraint, the implication is reversed. By trying to cover both of these cases in the + // same pattern we're running into trouble. new IntersectingConstraintValidation( IntersectingConstraintPattern.SetComparisonConstraintSubset, IntersectingConstraintPatternOptions.IntersectingConstraintModalityNotWeaker, @@ -10452,8 +10484,8 @@ new IntersectingConstraintValidation( IntersectingConstraintPattern.SetConstraintSubset, IntersectingConstraintPatternOptions.IntersectingConstraintModalityNotWeaker, + null, SetConstraintHasImplicationError.SetConstraintDomainRoleId, - null, ConstraintType.SimpleMandatory, ConstraintType.DisjunctiveMandatory), Modified: trunk/ORMModel/ObjectModel/ORMModel.resx =================================================================== --- trunk/ORMModel/ObjectModel/ORMModel.resx 2012-11-19 16:08:06 UTC (rev 1504) +++ trunk/ORMModel/ObjectModel/ORMModel.resx 2012-12-06 04:49:49 UTC (rev 1505) @@ -316,10 +316,14 @@ <value>Frequency constraint '{0}' in model '{1}' is violated by a Uniqueness constraint on the same roles.</value> <comment>Model validation error text used when a frequency constraint is places on the same roles as a uniqueness constraint. {0}=constraint name {1}=model name</comment> </data> - <data name="ModelError.Constraint.ImplicationError.Text" xml:space="preserve"> + <data name="ModelError.Constraint.ImplicationError.ImpliedBySubsetText" xml:space="preserve"> <value>Constraint '{0}' in model '{1}' is implied by at least one constraint of the same type attached to a subset of the same roles.</value> - <comment>Model validation error text when a constraint intersects a second constraint where the second constraints roles are a subset of the constraint roles.</comment> + <comment>Model validation error text when a constraint intersects a second constraint where the second constraint's roles are a subset of the constraint roles.</comment> </data> + <data name="ModelError.Constraint.ImplicationError.ImpliedBySupersetText" xml:space="preserve"> + <value>Constraint '{0}' in model '{1}' is implied by at least one constraint of the same type attached to a superset of the same roles.</value> + <comment>Model validation error text when a constraint intersects a second constraint where the second constraint's roles are a superset of the constraint roles.</comment> + </data> <data name="ModelError.Constraint.NotWellModeledSubsetAndMandatoryError.Text" xml:space="preserve"> <value>Subset constraint '{0}' and mandatory constraint '{1}' in model '{2}' are not well-modeled. Suggested ways to fix: (1) Delete the mandatory constraint. (2) Add another mandatory constraint on the superset role. (3) Delete the subset constraint.</value> <comment>Model validation error text when a mandatory constraint is put on the subset role of a subset constraint relationship.</comment> Modified: trunk/ORMModel/Resources/ResourceStringsGenerator.cs =================================================================== --- trunk/ORMModel/Resources/ResourceStringsGenerator.cs 2012-11-19 16:08:06 UTC (rev 1504) +++ trunk/ORMModel/Resources/ResourceStringsGenerator.cs 2012-12-06 04:49:49 UTC (rev 1505) @@ -1012,14 +1012,22 @@ return ResourceStrings.GetString(ResourceManagers.Model, "ModelError.CalculatedPathValue.CalculatedPathValueMustBeConsumed.Text"); } } - /// <summary>Model validation error text when a constraint intersects a second constraint where the second constraints roles are a subset of the constraint roles.</summary> - public static string ModelErrorConstraintImplication + /// <summary>Model validation error text when a constraint intersects a second constraint where the second constraint's roles are a subset of the constraint roles.</summary> + public static string ModelErrorConstraintImplicationBySubset { get { - return ResourceStrings.GetString(ResourceManagers.Model, "ModelError.Constraint.ImplicationError.Text"); + return ResourceStrings.GetString(ResourceManagers.Model, "ModelError.Constraint.ImplicationError.ImpliedBySubsetText"); } } + /// <summary>Model validation error text when a constraint intersects a second constraint where the second constraint's roles are a superset of the constraint roles.</summary> + public static string ModelErrorConstraintImplicationBySuperset + { + get + { + return ResourceStrings.GetString(ResourceManagers.Model, "ModelError.Constraint.ImplicationError.ImpliedBySupersetText"); + } + } /// <summary>Model validation error text when a single-column equality constraint is put on a set of mandatory roles.</summary> public static string ModelErrorConstraintImplicationEqualityMandatory { Modified: trunk/ORMModel/Resources/ResourceStringsGenerator.xml =================================================================== --- trunk/ORMModel/Resources/ResourceStringsGenerator.xml 2012-11-19 16:08:06 UTC (rev 1504) +++ trunk/ORMModel/Resources/ResourceStringsGenerator.xml 2012-12-06 04:49:49 UTC (rev 1505) @@ -176,7 +176,8 @@ <ResourceString name="ModelErrorCalculatedPathValueRequiresFunction" model="Model" resourceName="ModelError.CalculatedPathValue.CalculatedPathValueRequiresFunction.Text"/> <ResourceString name="ModelErrorCalculatedPathValueParameterBinding" model="Model" resourceName="ModelError.CalculatedPathValue.CalculatedPathValueParameterBinding.Text"/> <ResourceString name="ModelErrorCalculatedPathValueMustBeConsumed" model="Model" resourceName="ModelError.CalculatedPathValue.CalculatedPathValueMustBeConsumed.Text"/> - <ResourceString name="ModelErrorConstraintImplication" model="Model" resourceName="ModelError.Constraint.ImplicationError.Text"/> + <ResourceString name="ModelErrorConstraintImplicationBySubset" model="Model" resourceName="ModelError.Constraint.ImplicationError.ImpliedBySubsetText"/> + <ResourceString name="ModelErrorConstraintImplicationBySuperset" model="Model" resourceName="ModelError.Constraint.ImplicationError.ImpliedBySupersetText"/> <ResourceString name="ModelErrorConstraintImplicationEqualityMandatory" model="Model" resourceName="ModelError.Constraint.EqualityImpliedByMandatoryError.Text"/> <ResourceString name="ModelErrorConstraintImplicationSubsetMandatory" model="Model" resourceName="ModelError.Constraint.SubsetImpliedByMandatoryError.Text"/> <ResourceString name="ModelErrorNotWellModeledSubsetAndMandatoryError" model="Model" resourceName="ModelError.Constraint.NotWellModeledSubsetAndMandatoryError.Text"/> Modified: trunk/ORMModel/Shell/ORMDesignerCommandManager.cs =================================================================== --- trunk/ORMModel/Shell/ORMDesignerCommandManager.cs 2012-11-19 16:08:06 UTC (rev 1504) +++ trunk/ORMModel/Shell/ORMDesignerCommandManager.cs 2012-12-06 04:49:49 UTC (rev 1505) @@ -1171,6 +1171,7 @@ { break; } + bool ambiguous = false; switch (testConstraint.ConstraintType) { case ConstraintType.DisjunctiveMandatory: @@ -1178,16 +1179,30 @@ { mandatory = (MandatoryConstraint)testConstraint; } + else + { + ambiguous = true; + mandatory = null; + } break; case ConstraintType.Exclusion: if (exclusion == null) { exclusion = (ExclusionConstraint)testConstraint; } + else + { + ambiguous = true; + exclusion = null; + } break; } + if (ambiguous) + { + break; + } } - if (null == mandatory && null == exclusion) + if (null == mandatory || null == exclusion) { disable = hide = true; } Modified: trunk/Setup/Readme.htm =================================================================== --- trunk/Setup/Readme.htm 2012-11-19 16:08:06 UTC (rev 1504) +++ trunk/Setup/Readme.htm 2012-12-06 04:49:49 UTC (rev 1505) @@ -3,7 +3,7 @@ <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/> -<title>NORMA November 2012 CTP Readme</title> +<title>NORMA December 2012 CTP Readme</title> <style type="text/css"> .new {font-size:x-small; background-color:Gold; color:Blue; } li {padding-bottom: 3px;} @@ -12,9 +12,9 @@ <body> -<p><b><a id="The Top" style="font-family:Verdana;font-size:medium">NORMA November 2012 CTP Readme</a> </b></p> +<p><b><a id="The Top" style="font-family:Verdana;font-size:medium">NORMA December 2012 CTP Readme</a> </b></p> <p>This file supersedes the previous readme.txt and older readme.htm files. This readme has parallel indexing mechanisms: by topic, and by release date (starting with the October 2008 (2008-10) release). The file will be extended for future product releases.<br/><br/> -The November 2012 release adds Visual Studio 2012 support, new constraint connections between a subtyping relationship and normal roles, some enhancements to disjunctive mandatory and external uniqueness verbalization patterns, native SQL Server data type handling, and other bug fixes. See detailed change notes below for specifics.<br/><br/> +The December 2012 release adds Visual Studio 2012 support, new constraint connections between a subtyping relationship and normal roles, some enhancements to disjunctive mandatory and external uniqueness verbalization patterns, native SQL Server data type handling, and other bug fixes. See detailed change notes below for specifics.<br/><br/> </p> <h2>Contents</h2> <ul> @@ -43,12 +43,12 @@ </ul>--> <hr/> -<h2>November 2012 CTP Changes</h2> -<div>The November 2012 CTP release includes all modifications through changeset 1504. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<h2>December 2012 CTP Changes</h2> +<div>The December 2012 CTP release includes all modifications through changeset 1505. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> <ul> -<li><a href="#VerbalizedObjectTypeNameRemoveSpecialCharacterDisplay 2012-11">Verbalized object type name separator character removal options</a></li> -<li><a href="#SQLServerNativeDataTypes 2012-11">SQL Server Native Data Types</a></li> -<li><a href="#ExtendedSubtypeConstraintCombinations 2012-11">Extended Subtyping Constraint Combinations</a></li> +<li><a href="#VerbalizedObjectTypeNameRemoveSpecialCharacterDisplay 2012-12">Verbalized object type name separator character removal options</a></li> +<li><a href="#SQLServerNativeDataTypes 2012-12">SQL Server Native Data Types</a></li> +<li><a href="#ExtendedSubtypeConstraintCombinations 2012-12">Extended Subtyping Constraint Combinations</a></li> <li>Other Features: <ol> @@ -73,6 +73,8 @@ <li>Changing the reference mode kind of a custom reference mode (in the <em>ORM Reference Mode Editor</em> tool window) would not automatically create or remove the needed value types. For example, a <em>General</em> reference mode kind uses one value type for all identified entity types, while a <em>Popular</em> kind uses one value type per entity type. Switch from general to popular will now create new value types (instead of just renaming one), and switching from popular to general may delete value types.</li> <li>The <em>ExpandRefMode</em> property on object type shapes was automatically set to <em>False</em> when a reference mode was deleted then re-added. This propery may change to <em>True</em> in this case if the reference mode fact type is displayed on the diagram, but will no longer clear automatically.</li> <li>An outdated validation error indicating a poor modeling choice with overlapping subset and mandatory constraints could get stuck in the model file, preventing future load. These files will now load with the shift key down (skipping schema validation), and the problem should no longer occur. Note that the orm:ModelErrors section can always be hand-deleted from the .ORM file because it regenerates on load.</li> +<li>Selecting two or more exclusion or mandatory constraints and opening a context menu failed determine the available of the exclusive-or coupling command.</li> +<li>Some set comparison overlap validation was dependent on the order the constraints were added to the model and failed to display an overlap implication errors.</li> </ol> </li> </ul> @@ -591,7 +593,7 @@ The <strong>Possible Populations</strong> option has replaced the <strong>Verbalization Default Constraint</strong> option in the <em>Verbalization</em> section of the <em>ORM Designer</em> tab on the <em>Options</em> page (available on the <em>Tools</em> menu). This option now applies to the possible populations of spanning internal uniqueness constraints in addition to many-to-one binary fact types. </li> <li> -<a id="VerbalizedObjectTypeNameRemoveSpecialCharacterDisplay 2012-11" class="new" title="October 2012 CTP: Verbalized object type name separator character removal options">2012-11</a> +<a id="VerbalizedObjectTypeNameRemoveSpecialCharacterDisplay 2012-12" class="new" title="October 2012 CTP: Verbalized object type name separator character removal options">2012-12</a> As an enhancement to automatic name separation and casing of object type names (see <a href="#VerbalizedObjectTypeNameDisplay 2012-01">Verbalized object type name options</a>), punctuation and symbol characters are recognized in addition to upper cases and numeric characters. <ul> <li>All symbol and punctuation characters form word boundaries.</li> @@ -697,7 +699,7 @@ </ul> Designing consistent glyphs for the new combinations required some minor display modifications to published ring display: the tick mark for <em>irreflexive</em> has been moved from the bottom of the shape to directly opposite the dot, the interior circle for <em>symmetric+irreflexive</em> has been moved to the left edge of the symmetric oval and shares the left dot, and an interior tick mark has been added to <em>purely reflexive</em> to distinguish it from <em>reflexive</em> and visually indicate the <em>and no other</em> part of this ring type. </li> -<li><a id="ExtendedSubtypeConstraintCombinations 2012-11" class="new" title="November 2012 CTP: Extended Subtyping Constraint Combinations">2012-11</a> +<li><a id="ExtendedSubtypeConstraintCombinations 2012-12" class="new" title="December 2012 CTP: Extended Subtyping Constraint Combinations">2012-12</a> Selected external constraints can now be connected simultaneously to a subtyping relationship and a normal role. The following constraint combinations are supported: <ul> <li>External mandatory constraints (both inclusive and exclusive).</li> @@ -764,7 +766,7 @@ </ul> <br />Opening and saving files with the relational extensions enabled will automatically update to use the new column orders. Generated DDL will also be updated when the file is saved. </li> -<li><a id="SQLServerNativeDataTypes 2012-11" class="new" title="November 2012 CTP: SQL Server Native Data Types">2012-11</a> +<li><a id="SQLServerNativeDataTypes 2012-12" class="new" title="December 2012 CTP: SQL Server Native Data Types">2012-12</a> Prior to this release, the DDL generated for SQL Server used ANSI standard data type names, but these are not supported by default in SQL Server 2012. The default has now been changed to use native SQL Server data type names. The generator that produces ANSI data types is still included. To use the ANSI types, expand the SQL_SQLServer node in the <em>ORM Generator Settings</em> dialog and choose <em>DDIL to SQL Server (ANSI Types)</em> instead of the default <em>DDIL to SQL Server</em>. <br />You will need to open and save a model file to see the new data types, or right-click the .ORM file in the Solution Explorer and choose the 'Run Custom Tool' menu item. </li> Modified: trunk/VersionGenerator.exe.config =================================================================== --- trunk/VersionGenerator.exe.config 2012-11-19 16:08:06 UTC (rev 1504) +++ trunk/VersionGenerator.exe.config 2012-12-06 04:49:49 UTC (rev 1505) @@ -2,7 +2,7 @@ <configuration> <appSettings> <add key="RevisionStartYearMonth" value="2006-01"/> - <add key="ReleaseYearMonth" value="2012-11"/> + <add key="ReleaseYearMonth" value="2012-12"/> <add key="CountQuartersFromYearMonth" value="2011-01"/> <!-- ReleaseType: "CTP" or "RTM" --> <add key="ReleaseType" value="CTP"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2012-11-19 16:08:13
|
Revision: 1504 http://orm.svn.sourceforge.net/orm/?rev=1504&view=rev Author: mcurland Date: 2012-11-19 16:08:06 +0000 (Mon, 19 Nov 2012) Log Message: ----------- Subtyping constraint connections in [1503] worked first time, but not the second. Reset new fields. Modified Paths: -------------- trunk/ORMModel/ShapeModel/ExternalConstraintConnectAction.cs trunk/Setup/Readme.htm Modified: trunk/ORMModel/ShapeModel/ExternalConstraintConnectAction.cs =================================================================== --- trunk/ORMModel/ShapeModel/ExternalConstraintConnectAction.cs 2012-11-18 07:22:54 UTC (rev 1503) +++ trunk/ORMModel/ShapeModel/ExternalConstraintConnectAction.cs 2012-11-19 16:08:06 UTC (rev 1504) @@ -756,6 +756,10 @@ myPendingOnClickedAction = OnClickedAction.Normal; mySubtypeConnection = false; myAllowSubtypeConnection = false; + myOriginalAllowSubtypeConnection = false; + mySubtypeAnchoredSubset = false; + myOriginalSubtypeAnchoredSubset = false; + mySelectedSupertypeRoleCount = 0; FactTypeShape.ActiveExternalConstraintConnectAction = null; } /// <summary> Modified: trunk/Setup/Readme.htm =================================================================== --- trunk/Setup/Readme.htm 2012-11-18 07:22:54 UTC (rev 1503) +++ trunk/Setup/Readme.htm 2012-11-19 16:08:06 UTC (rev 1504) @@ -14,7 +14,7 @@ <p><b><a id="The Top" style="font-family:Verdana;font-size:medium">NORMA November 2012 CTP Readme</a> </b></p> <p>This file supersedes the previous readme.txt and older readme.htm files. This readme has parallel indexing mechanisms: by topic, and by release date (starting with the October 2008 (2008-10) release). The file will be extended for future product releases.<br/><br/> -The November 2012 release adds Visual Studio 2012 support, some enhancements to disjunctive mandatory and external uniqueness verbalization patterns, native SQL Server data type handling, and other bug fixes. See detailed change notes below for specifics.<br/><br/> +The November 2012 release adds Visual Studio 2012 support, new constraint connections between a subtyping relationship and normal roles, some enhancements to disjunctive mandatory and external uniqueness verbalization patterns, native SQL Server data type handling, and other bug fixes. See detailed change notes below for specifics.<br/><br/> </p> <h2>Contents</h2> <ul> @@ -44,7 +44,7 @@ <hr/> <h2>November 2012 CTP Changes</h2> -<div>The November 2012 CTP release includes all modifications through changeset 1503. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<div>The November 2012 CTP release includes all modifications through changeset 1504. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> <ul> <li><a href="#VerbalizedObjectTypeNameRemoveSpecialCharacterDisplay 2012-11">Verbalized object type name separator character removal options</a></li> <li><a href="#SQLServerNativeDataTypes 2012-11">SQL Server Native Data Types</a></li> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2012-11-06 03:47:34
|
Revision: 1501 http://orm.svn.sourceforge.net/orm/?rev=1501&view=rev Author: mcurland Date: 2012-11-06 03:47:28 +0000 (Tue, 06 Nov 2012) Log Message: ----------- Ignore query fact types on during database generation Modified Paths: -------------- trunk/Oial/ORMOialBridge/ORMElementGateway.cs Modified: trunk/Oial/ORMOialBridge/ORMElementGateway.cs =================================================================== --- trunk/Oial/ORMOialBridge/ORMElementGateway.cs 2012-11-04 07:40:25 UTC (rev 1500) +++ trunk/Oial/ORMOialBridge/ORMElementGateway.cs 2012-11-06 03:47:28 UTC (rev 1501) @@ -36,7 +36,7 @@ } private bool ShouldIgnoreFactType(FactType factType) { - return ORMElementGateway.IsElementExcluded(factType) || (null != factType.Objectification && factType.UnaryRole == null); + return ORMElementGateway.IsElementExcluded(factType) || factType is QueryBase || (null != factType.Objectification && factType.UnaryRole == null); } #endregion // ORM Error Filtering Methods #region ORMElementGateway class @@ -191,7 +191,8 @@ // Note that any changes to the list of errors must correspond to changes in // FactTypeErrorAddedRule and FactTypeErrorDeletedRule if (null == factType.InternalUniquenessConstraintRequiredError && - null == factType.ImpliedInternalUniquenessConstraintError) + null == factType.ImpliedInternalUniquenessConstraintError && + !(factType is QueryBase)) { if (!(factType is SubtypeFact)) { @@ -415,7 +416,8 @@ if (forceCreate || null == ExcludedORMModelElement.GetAbstractionModel(factType)) { - if (null == factType.Objectification || factType.UnaryRole != null) + if (!(factType is QueryBase) && + (null == factType.Objectification || factType.UnaryRole != null)) { new ExcludedORMModelElement(factType, model); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2012-11-04 07:40:31
|
Revision: 1500 http://orm.svn.sourceforge.net/orm/?rev=1500&view=rev Author: mcurland Date: 2012-11-04 07:40:25 +0000 (Sun, 04 Nov 2012) Log Message: ----------- * Subtype connectors involved objectified fact types displayed as object types failed to create a shape, even though the underlying subtype was created. * Subtype connectors from an objectified fact type were not recreated on load. Modified Paths: -------------- trunk/ORMModel/ShapeModel/ORMDiagram.cs trunk/ORMModel/ShapeModel/SubtypeLink.cs trunk/Setup/Readme.htm Modified: trunk/ORMModel/ShapeModel/ORMDiagram.cs =================================================================== --- trunk/ORMModel/ShapeModel/ORMDiagram.cs 2012-11-04 03:28:26 UTC (rev 1499) +++ trunk/ORMModel/ShapeModel/ORMDiagram.cs 2012-11-04 07:40:25 UTC (rev 1500) @@ -1046,8 +1046,8 @@ } else if ((subtypeFact = element as SubtypeFact) != null) { - element1 = subtypeFact.Subtype; - element2 = subtypeFact.Supertype; + element1 = RedirectToDisplayedElement(subtypeFact.Subtype); + element2 = RedirectToDisplayedElement(subtypeFact.Supertype); } bool isLink = link != null || subtypeFact != null; Modified: trunk/ORMModel/ShapeModel/SubtypeLink.cs =================================================================== --- trunk/ORMModel/ShapeModel/SubtypeLink.cs 2012-11-04 03:28:26 UTC (rev 1499) +++ trunk/ORMModel/ShapeModel/SubtypeLink.cs 2012-11-04 07:40:25 UTC (rev 1500) @@ -612,11 +612,20 @@ ORMDiagram diagram; if ((diagram = presentationViewsSubject.Presentation as ORMDiagram) != null) { - //add a link shape for each fact type shape on the diagram for the played role - foreach (ObjectTypeShape shapeElement in MultiShapeUtility.FindAllShapesForElement<ObjectTypeShape>(diagram, subTypeFact.Subtype)) + ObjectType subtype = subTypeFact.Subtype; + // add a link shape for each object type shape on the diagram for the played role + foreach (ObjectTypeShape shapeElement in MultiShapeUtility.FindAllShapesForElement<ObjectTypeShape>(diagram, subtype)) { diagram.FixUpLocalDiagram(subTypeFact); } + FactType objectifiedFactType; + if (null != (objectifiedFactType = subtype.NestedFactType)) + { + foreach (FactTypeShape shapeElement in MultiShapeUtility.FindAllShapesForElement<FactTypeShape>(diagram, objectifiedFactType)) + { + diagram.FixUpLocalDiagram(subTypeFact); + } + } } } Modified: trunk/Setup/Readme.htm =================================================================== --- trunk/Setup/Readme.htm 2012-11-04 03:28:26 UTC (rev 1499) +++ trunk/Setup/Readme.htm 2012-11-04 07:40:25 UTC (rev 1500) @@ -44,7 +44,7 @@ <hr/> <h2>October 2012 CTP Changes</h2> -<div>The October 2012 CTP release includes all modifications through changeset 1499. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<div>The October 2012 CTP release includes all modifications through changeset 1500. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> <ul> <li><a href="#VerbalizedObjectTypeNameRemoveSpecialCharacterDisplay 2012-10">Verbalized object type name separator character removal options</a></li> <li>Bug Fixes: @@ -58,6 +58,8 @@ <li>Fixed verbalization of external uniqueness and frequency constraints over unary fact types.</li> <li>(VS2010) Database import wizard worked from File/New, but not adding a file directly to a project.</li> <li>(VS2010) Diagram Spy and other tool windows could end up blank, requiring restart.</li> +<li>Subtype connectors to or from objectified fact types displayed as object type would sometimes fail to create a shape.</li> +<li>Subtype connectors with an objectified fact type as the subtype role player were not reconnecting on load.</li> </ol> </li> </ul> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2012-11-04 03:28:33
|
Revision: 1499 http://orm.svn.sourceforge.net/orm/?rev=1499&view=rev Author: mcurland Date: 2012-11-04 03:28:26 +0000 (Sun, 04 Nov 2012) Log Message: ----------- Fixed path verbalization issues: * Joined subset constraint with a disjunction was handling indentation incorrectly, beginning of 'then' clause overwrote end of 'if' clause. * Variable joining in subqueries needs to give precedence to custom correlated variables of the same type (two paired variables of the same type was not possible without subquery expansion, so this was not previously an issue). Modified Paths: -------------- trunk/ORMModel/ObjectModel/Verbalization.cs trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs trunk/ORMModel/ObjectModel/VerbalizationGenerator.xml trunk/ORMModel/ObjectModel/VerbalizationGenerator.xsd trunk/ORMModel/ObjectModel/VerbalizationGenerator.xslt trunk/Setup/Readme.htm Modified: trunk/ORMModel/ObjectModel/Verbalization.cs =================================================================== --- trunk/ORMModel/ObjectModel/Verbalization.cs 2012-10-31 04:41:06 UTC (rev 1498) +++ trunk/ORMModel/ObjectModel/Verbalization.cs 2012-11-04 03:28:26 UTC (rev 1499) @@ -10716,10 +10716,12 @@ { if (possibleCorrelationPartners != null) { + RolePlayerVariable firstUnpairedSameTypedVariable = null; // With subquery process, we can end up pairing variables of the same type RolePlayerVariable firstUnpairedNormalVariable = null; // Normal meaning not the head RolePlayerVariable firstUnpairedHeadVariable = null; int pairedDuringPhase; RolePlayerVariable floatingRootVariable = myFloatingRootVariable; + ObjectType primaryRolePlayer = primaryVariable.RolePlayer; bool unusedFloatingRootVariable = false; foreach (RolePlayerVariable possiblePartner in possibleCorrelationPartners) { @@ -10737,12 +10739,20 @@ IsPairingUsePhaseInScope(pairedDuringPhase)) { // We have an existing pairing, get out + firstUnpairedSameTypedVariable = null; firstUnpairedHeadVariable = null; firstUnpairedNormalVariable = null; break; } - if (possiblePartner.IsHeadVariable) + if (possiblePartner.RolePlayer == primaryRolePlayer) { + if (firstUnpairedSameTypedVariable == null) + { + firstUnpairedSameTypedVariable = possiblePartner; + } + } + else if (possiblePartner.IsHeadVariable) + { if (firstUnpairedHeadVariable == null) { firstUnpairedHeadVariable = possiblePartner; @@ -10758,7 +10768,7 @@ unusedFloatingRootVariable = true; } } - return firstUnpairedHeadVariable ?? firstUnpairedNormalVariable ?? (unusedFloatingRootVariable ? floatingRootVariable : null); + return firstUnpairedSameTypedVariable ?? firstUnpairedHeadVariable ?? firstUnpairedNormalVariable ?? (unusedFloatingRootVariable ? floatingRootVariable : null); } return null; } Modified: trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs 2012-10-31 04:41:06 UTC (rev 1498) +++ trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs 2012-11-04 03:28:26 UTC (rev 1499) @@ -4373,7 +4373,6 @@ Array.Clear(snippet1Replace1Replace1ItemUniqueFactTypes1, 0, snippet1Replace1Replace1ItemUniqueFactTypes1.Length); } snippet1Replace1ReplaceCompositeIterator1 = 0; - string[] snippet1Replace1ReplaceCompositeFields1 = new string[snippet1Replace1ReplaceCompositeCount1]; if (sbTemp == null) { sbTemp = new StringBuilder(); @@ -4411,8 +4410,7 @@ listSnippet = CoreVerbalizationSnippetType.CompoundListSeparator; } sbTemp.Append(snippets.GetSnippet(listSnippet, isDeontic, isNegative)); - sbTemp.AppendFormat("{{{0}}}", snippet1Replace1ReplaceCompositeIterator1); - snippet1Replace1ReplaceCompositeFields1[snippet1Replace1ReplaceCompositeIterator1] = pathVerbalizer.RenderPathVerbalization(joinPath, sbTemp); + sbTemp.Append(pathVerbalizer.RenderPathVerbalization(joinPath, sbTemp)); if (snippet1Replace1ReplaceCompositeIterator1 == snippet1Replace1ReplaceCompositeCount1 - 1) { sbTemp.Append(snippets.GetSnippet(CoreVerbalizationSnippetType.CompoundListClose, isDeontic, isNegative)); @@ -4452,7 +4450,6 @@ listSnippet = CoreVerbalizationSnippetType.CompoundListSeparator; } sbTemp.Append(snippets.GetSnippet(listSnippet, isDeontic, isNegative)); - sbTemp.AppendFormat("{{{0}}}", snippet1Replace1ReplaceCompositeIterator1); reading = parentFact.GetMatchingReading(allReadingOrders, null, primaryRole, null, factRoles, MatchingReadingOptions.AllowAnyOrder); hyphenBinder = new VerbalizationHyphenBinder(reading, writer.FormatProvider, factRoles, unaryRoleIndex, snippets.GetSnippet(CoreVerbalizationSnippetType.HyphenBoundPredicatePart, isDeontic, isNegative), predicatePartFormatString); snippet1Replace1Replace1Item1 = hyphenBinder.PopulatePredicateText(reading, writer.FormatProvider, predicatePartFormatString, factRoles, delegate(RoleBase replaceRole, string hyphenBindingFormatString) @@ -4466,7 +4463,7 @@ } return pathVerbalizer.RenderAssociatedRolePlayer(replaceRole, hyphenBindingFormatString, RolePathRolePlayerRenderingOptions.Quantify); }); - snippet1Replace1ReplaceCompositeFields1[snippet1Replace1ReplaceCompositeIterator1] = snippet1Replace1Replace1Item1; + sbTemp.Append(snippet1Replace1Replace1Item1); if (snippet1Replace1ReplaceCompositeIterator1 == snippet1Replace1ReplaceCompositeCount1 - 1) { sbTemp.Append(snippets.GetSnippet(CoreVerbalizationSnippetType.CompoundListClose, isDeontic, isNegative)); @@ -4477,9 +4474,6 @@ } Array.Clear(snippet1Replace1Replace1ItemUniqueFactTypes1, 0, snippet1Replace1Replace1ItemUniqueFactTypes1.Length); } - string snippet1Replace1ReplaceFormat1 = sbTemp.ToString(); - sbTemp.Length = 0; - RolePathVerbalizer.FormatResolveOutdent(writer.FormatProvider, sbTemp, writer.NewLine, snippet1Replace1ReplaceFormat1, snippet1Replace1ReplaceCompositeFields1); snippet1Replace1Replace1 = sbTemp.ToString(); string snippet1Replace1Replace2 = null; int snippet1Replace1ReplaceSequenceIter2; @@ -4510,7 +4504,6 @@ Array.Clear(snippet1Replace1Replace2ItemUniqueFactTypes1, 0, snippet1Replace1Replace2ItemUniqueFactTypes1.Length); } snippet1Replace1ReplaceCompositeIterator2 = 0; - string[] snippet1Replace1ReplaceCompositeFields2 = new string[snippet1Replace1ReplaceCompositeCount2]; if (sbTemp == null) { sbTemp = new StringBuilder(); @@ -4548,8 +4541,7 @@ listSnippet = CoreVerbalizationSnippetType.CompoundListSeparator; } sbTemp.Append(snippets.GetSnippet(listSnippet, isDeontic, isNegative)); - sbTemp.AppendFormat("{{{0}}}", snippet1Replace1ReplaceCompositeIterator2); - snippet1Replace1ReplaceCompositeFields2[snippet1Replace1ReplaceCompositeIterator2] = pathVerbalizer.RenderPathVerbalization(joinPath, sbTemp); + sbTemp.Append(pathVerbalizer.RenderPathVerbalization(joinPath, sbTemp)); if (snippet1Replace1ReplaceCompositeIterator2 == snippet1Replace1ReplaceCompositeCount2 - 1) { sbTemp.Append(snippets.GetSnippet(CoreVerbalizationSnippetType.CompoundListClose, isDeontic, isNegative)); @@ -4589,7 +4581,6 @@ listSnippet = CoreVerbalizationSnippetType.CompoundListSeparator; } sbTemp.Append(snippets.GetSnippet(listSnippet, isDeontic, isNegative)); - sbTemp.AppendFormat("{{{0}}}", snippet1Replace1ReplaceCompositeIterator2); reading = parentFact.GetMatchingReading(allReadingOrders, null, primaryRole, null, factRoles, MatchingReadingOptions.AllowAnyOrder); hyphenBinder = new VerbalizationHyphenBinder(reading, writer.FormatProvider, factRoles, unaryRoleIndex, snippets.GetSnippet(CoreVerbalizationSnippetType.HyphenBoundPredicatePart, isDeontic, isNegative), predicatePartFormatString); snippet1Replace1Replace2Item1 = hyphenBinder.PopulatePredicateText(reading, writer.FormatProvider, predicatePartFormatString, factRoles, delegate(RoleBase replaceRole, string hyphenBindingFormatString) @@ -4603,7 +4594,7 @@ } return pathVerbalizer.RenderAssociatedRolePlayer(replaceRole, hyphenBindingFormatString, RolePathRolePlayerRenderingOptions.Quantify); }); - snippet1Replace1ReplaceCompositeFields2[snippet1Replace1ReplaceCompositeIterator2] = snippet1Replace1Replace2Item1; + sbTemp.Append(snippet1Replace1Replace2Item1); if (snippet1Replace1ReplaceCompositeIterator2 == snippet1Replace1ReplaceCompositeCount2 - 1) { sbTemp.Append(snippets.GetSnippet(CoreVerbalizationSnippetType.CompoundListClose, isDeontic, isNegative)); @@ -4614,11 +4605,8 @@ } Array.Clear(snippet1Replace1Replace2ItemUniqueFactTypes1, 0, snippet1Replace1Replace2ItemUniqueFactTypes1.Length); } - string snippet1Replace1ReplaceFormat2 = sbTemp.ToString(); - sbTemp.Length = 0; - RolePathVerbalizer.FormatResolveOutdent(writer.FormatProvider, sbTemp, writer.NewLine, snippet1Replace1ReplaceFormat2, snippet1Replace1ReplaceCompositeFields2); snippet1Replace1Replace2 = sbTemp.ToString(); - snippet1Replace1 = string.Format(writer.FormatProvider, snippet1ReplaceFormat1, snippet1Replace1Replace1, snippet1Replace1Replace2); + snippet1Replace1 = RolePathVerbalizer.FormatResolveOutdent(writer.FormatProvider, null, writer.NewLine, snippet1ReplaceFormat1, snippet1Replace1Replace1, snippet1Replace1Replace2); FactType.WriteVerbalizerSentence(writer, string.Format(writer.FormatProvider, snippetFormat1, snippet1Replace1), snippets.GetSnippet(CoreVerbalizationSnippetType.CloseVerbalizationSentence, isDeontic, isNegative)); } else if (0 != (sign & VerbalizationSign.AttemptOppositeSign)) Modified: trunk/ORMModel/ObjectModel/VerbalizationGenerator.xml =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationGenerator.xml 2012-10-31 04:41:06 UTC (rev 1498) +++ trunk/ORMModel/ObjectModel/VerbalizationGenerator.xml 2012-11-04 03:28:26 UTC (rev 1499) @@ -200,7 +200,7 @@ </ConstrainedRoles> <ConstrainedRoles sign="positive"> <Snippet ref="ImpliedModalNecessityOperator"> - <Snippet ref="Conditional"> + <Snippet ref="Conditional" applyTrailingOutdentHere="true"> <IterateSequences listStyle="CompoundList" pass="first" compositeList="true"> <SequenceJoinPath markTrailingOutdentStart="true"> <IterateRoles match="constraintRoles" listStyle="null" uniqueFactType="true"> Modified: trunk/ORMModel/ObjectModel/VerbalizationGenerator.xsd =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationGenerator.xsd 2012-10-31 04:41:06 UTC (rev 1498) +++ trunk/ORMModel/ObjectModel/VerbalizationGenerator.xsd 2012-11-04 03:28:26 UTC (rev 1499) @@ -545,6 +545,11 @@ </xs:restriction> </xs:simpleType> </xs:attribute> + <xs:attribute name="applyTrailingOutdentHere" use="optional" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Use with a nested SequenceJoinPath@markTrailingOutdentStart to force outdent resolution in the snippet instead of while the list is generating.</xs:documentation> + </xs:annotation> + </xs:attribute> </xs:complexType> <xs:complexType name="SnippetLeafTypeWithConditionalMatch"> <xs:complexContent> Modified: trunk/ORMModel/ObjectModel/VerbalizationGenerator.xslt =================================================================== (Binary files differ) Modified: trunk/Setup/Readme.htm =================================================================== --- trunk/Setup/Readme.htm 2012-10-31 04:41:06 UTC (rev 1498) +++ trunk/Setup/Readme.htm 2012-11-04 03:28:26 UTC (rev 1499) @@ -44,7 +44,7 @@ <hr/> <h2>October 2012 CTP Changes</h2> -<div>The October 2012 CTP release includes all modifications through changeset 1498. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<div>The October 2012 CTP release includes all modifications through changeset 1499. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> <ul> <li><a href="#VerbalizedObjectTypeNameRemoveSpecialCharacterDisplay 2012-10">Verbalized object type name separator character removal options</a></li> <li>Bug Fixes: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2012-10-31 04:41:13
|
Revision: 1498 http://orm.svn.sourceforge.net/orm/?rev=1498&view=rev Author: mcurland Date: 2012-10-31 04:41:06 +0000 (Wed, 31 Oct 2012) Log Message: ----------- Various bug fixes and verbalization enhancements * Objectification of formally fully derived fact type should not create a table and did not create one on load, but did during incremental processing. * Multiple value constraints created on load. Regression caused by [1493] modifications. * Name generation and object type name normalization now recognize punctuation and symbol characters as name part delimiters. * Verbalization of separated object type names now has an option to replace certain characters with spaces. The default is ".:_" * Verbalization of derivation rules that project a value type on an entity type use 'is identified by' to relate the entity and value. Changes to type the value (the VALUETYPE 'CONST') are still pending. * Updated test case baselines to match recent shape and column ordering changes. Modified Paths: -------------- trunk/ORMModel/ObjectModel/Verbalization.cs trunk/Setup/Readme.htm Modified: trunk/ORMModel/ObjectModel/Verbalization.cs =================================================================== --- trunk/ORMModel/ObjectModel/Verbalization.cs 2012-10-25 16:34:18 UTC (rev 1497) +++ trunk/ORMModel/ObjectModel/Verbalization.cs 2012-10-31 04:41:06 UTC (rev 1498) @@ -4720,7 +4720,7 @@ #endregion // Member variables #region Constructor /// <summary> - /// Create a new <see cref="InlineSubqueryContext"/> + /// Create a new <see cref="InlineSubqueryRole"/> /// </summary> /// <param name="parentContext">The context representing the derivation path that invokes this subquery.</param> /// <param name="parentEntryRole">The <see cref="PathedRole"/> in the context path used to invoke an instance of this subquery.</param> @@ -4830,7 +4830,7 @@ #endregion // Member variables #region Constructor /// <summary> - /// Create a new <see cref="InlineSubqueryContext"/> + /// Create a new <see cref="InlineSubqueryParameter"/> /// </summary> /// <param name="parentContext">The context representing the derivation path that invokes this subquery.</param> /// <param name="parentEntryRole">The <see cref="PathedRole"/> in the context path used to invoke an instance of this subquery.</param> @@ -5416,7 +5416,7 @@ /// <summary> /// Create and attach a new variable equality node. /// </summary> - /// <param name="equivalentVariableKeys">A list of keys to render as equivlanet</param> + /// <param name="equivalentVariableKeys">A list of keys to render as equivalent</param> /// <param name="pathContext">The path context for this node.</param> /// <param name="parentNode">The parent <see cref="VerbalizationPlanNode"/> for the new node.</param> /// <param name="rootNode">A reference to the root node of the chain.</param> @@ -6478,7 +6478,7 @@ // Populate path variables for this owner and process all role paths in the root (null) path context LinkedNode<object> pendingRequiredVariableKeys = null; - InitializeRolePaths(null, null, pathOwner, AddPathProjections(pathOwner), ref pendingRequiredVariableKeys); + InitializeRolePaths(null, null, null, pathOwner, AddPathProjections(pathOwner), ref pendingRequiredVariableKeys); VerbalizationPlanNode newRootNode = myRootPlanNode; if (newRootNode != null) @@ -6518,7 +6518,7 @@ BeginQuantificationUsePhase(); } private delegate object PathContextCreator(LeadRolePath rolePath); - private void InitializeRolePaths(object pathContext, PathContextCreator contextCreator, RolePathOwner pathOwner, IDictionary<LeadRolePath, IList<IList<object>>> equivalentVariableKeysByPath, ref LinkedNode<object> pendingRequiredVariableKeys) + private void InitializeRolePaths(object pathContext, PathContextCreator contextCreator, VariableKeyDecorator keyDecorator, RolePathOwner pathOwner, IDictionary<LeadRolePath, IList<IList<object>>> equivalentVariableKeysByPath, ref LinkedNode<object> pendingRequiredVariableKeys) { // Determine owned paths to verbalize // Verbalize in owned/shared order. The LeadRolePathCollection is unordered. @@ -6573,7 +6573,7 @@ { PushSplit(outerContext, VerbalizationPlanBranchType.AndSplit, ref pendingRequiredVariableKeys); } - InitializeRolePath(pathContext, pathOwner, filteredPath, ref pendingRequiredVariableKeys); + InitializeRolePath(pathContext, pathOwner, filteredPath, keyDecorator, ref pendingRequiredVariableKeys); if (equivalentVariables != null) { int equivalentVariableSetCount = equivalentVariables.Count; @@ -6591,7 +6591,7 @@ } } } - private void InitializeRolePath(object initialPathContext, RolePathOwner pathOwner, LeadRolePath leadRolePath, ref LinkedNode<object> requiredVariableKeys) + private void InitializeRolePath(object initialPathContext, RolePathOwner pathOwner, LeadRolePath leadRolePath, VariableKeyDecorator keyDecorator, ref LinkedNode<object> requiredVariableKeys) { LinkedElementCollection<CalculatedPathValue> pathConditions = leadRolePath.CalculatedConditionCollection; int pathConditionCount = pathConditions.Count; @@ -7045,7 +7045,7 @@ } } } - AddCalculatedAndConstantProjections(initialPathContext, pathOwner, leadRolePath); + AddCalculatedAndConstantProjections(initialPathContext, pathOwner, leadRolePath, keyDecorator); PopConditionalChainNode(); if (rootObjectTypeVariable != null && !rootObjectTypeVariable.HasBeenUsed(myLatestUsePhase, false) && @@ -8126,6 +8126,27 @@ int localInlineSubqueryRoleBaseIndex = inlineSubqueryRoleBaseIndex; List<InlineSubqueryParameter> localInlineSubqueryParameters = inlineSubqueryParameters; int localInlineSubqueryParameterBaseIndex = inlineSubqueryParameterBaseIndex; + VariableKeyDecorator keyDecorator = delegate(object key) + { + Role role; + QueryParameter parameter; + int index; + if (null != (role = key as Role)) + { + if (-1 != (index = ResolveRoleIndex(queryRoles, role))) // Guard against bogus path + { + return localInlineSubqueryRoles[localInlineSubqueryRoleBaseIndex + index]; + } + } + else if (null != (parameter = key as QueryParameter)) + { + if (-1 != (index = queryParameters.IndexOf(parameter))) + { + return localInlineSubqueryParameters[localInlineSubqueryParameterBaseIndex + index]; // Guard against bogus path + } + } + return key; // Fallback, shouldn't reach here + }; IDictionary<LeadRolePath, IList<IList<object>>> equivalentSubqueryProjectionKeysByPath = GenerateRoleAndParameterProjections( subqueryRule, delegate(object key, LeadRolePath forRolePath, ObjectType variableType, RolePathNode correlationNode) @@ -8143,33 +8164,16 @@ correlationNode = new RolePathNode(correlationNode, innerPathContext); } RolePlayerVariable newVar = RegisterRolePlayerUse(variableType, null, correlationNode, correlationNode); - RolePlayerVariableUse? correlateWithVar = GetRolePlayerVariableUse(key); - if (correlateWithVar.HasValue) + if (!correlationNode.IsEmpty) { - CustomCorrelateVariables(correlateWithVar.Value.PrimaryRolePlayerVariable, newVar); - } - }, - delegate(object key) - { - Role role; - QueryParameter parameter; - int index; - if (null != (role = key as Role)) - { - if (-1 != (index = ResolveRoleIndex(queryRoles, role))) // Guard against bogus path + RolePlayerVariableUse? correlateWithVar = GetRolePlayerVariableUse(key); + if (correlateWithVar.HasValue) { - return localInlineSubqueryRoles[localInlineSubqueryRoleBaseIndex + index]; + CustomCorrelateVariables(correlateWithVar.Value.PrimaryRolePlayerVariable, newVar); } } - else if (null != (parameter = key as QueryParameter)) - { - if (-1 != (index = queryParameters.IndexOf(parameter))) - { - return localInlineSubqueryParameters[localInlineSubqueryParameterBaseIndex + index]; // Guard against bogus path - } - } - return key; // Fallback, shouldn't reach here - }); + }, + keyDecorator); // Add value constraints and local condition code based on roles in the outer path int currentPathedRoleCount = pathedRoles.Count; @@ -8294,6 +8298,7 @@ } return innerPathContext; }, + keyDecorator, subqueryRule, equivalentSubqueryProjectionKeysByPath, ref pendingRequiredVariableKeys); @@ -9133,6 +9138,12 @@ return null; } /// <summary> + /// A callback for decorating variable keys. + /// </summary> + /// <param name="key">The key value.</param> + /// <returns>The original key or a decorated value.</returns> + protected delegate object VariableKeyDecorator(object key); + /// <summary> /// Add calculations and constants that are bound directly to a /// head variable registered during <see cref="AddPathProjections"/> /// using the <see cref="ProjectExternalVariable(Object,CalculatedPathValue,Object)"/> and @@ -9141,7 +9152,8 @@ /// <param name="pathContext">The context representing a use of this path.</param> /// <param name="pathOwner">The <see cref="RolePathOwner"/></param> /// <param name="rolePath">A <see cref="LeadRolePath"/> with associated projections.</param> - protected virtual void AddCalculatedAndConstantProjections(object pathContext, RolePathOwner pathOwner, LeadRolePath rolePath) + /// <param name="keyDecorator">A callback function for decorating keys of projected items.</param> + protected virtual void AddCalculatedAndConstantProjections(object pathContext, RolePathOwner pathOwner, LeadRolePath rolePath, VariableKeyDecorator keyDecorator) { // Default implementation is empty } @@ -10435,8 +10447,9 @@ testChildIndex = testChildIndex == 0 ? 1 : 0; int usePhase = CurrentQuantificationUsePhase; object pathContext = node.PathContext; + RolePlayerVariableUse? resolvedChildVariableUse; if (testChildIndex >= childPathedRoles.Count || // Indicates a pure existential, we're here because the entry role can possibly be partnered. - !GetRolePlayerVariableUse(new RolePathNode(childPathedRoles[testChildIndex], pathContext)).Value.PrimaryRolePlayerVariable.HasBeenUsed(usePhase, true)) + ((resolvedChildVariableUse = GetRolePlayerVariableUse(new RolePathNode(childPathedRoles[testChildIndex], pathContext))).HasValue && !resolvedChildVariableUse.Value.PrimaryRolePlayerVariable.HasBeenUsed(usePhase, true))) { RolePlayerVariableUse variableUse = GetRolePlayerVariableUse(new RolePathNode(entryPathedRole, pathContext)).Value; RolePlayerVariable primaryVariable = variableUse.PrimaryRolePlayerVariable; @@ -10987,7 +11000,6 @@ return retVal; } private delegate void RegisterSubqueryProjectionVariable(object key, LeadRolePath rolePath, ObjectType variableType, RolePathNode correlationNode); - private delegate object DecorateSubqueryProjectionKey(object key); /// <summary> /// Register variables required for projection by a subquery object. Helper method to /// ensure consistency in subquery projection processing by <see cref="InitializeRolePath"/> and @@ -10997,7 +11009,7 @@ /// <param name="variableRegistrar">A callback to register variables.</param> /// <param name="keyDecorator">A callback to translate a projection key (either a role or a parameter) into a decorated key. /// If specified, keys are preprocessed by this call before being passed to the variable registrar.</param> - private IDictionary<LeadRolePath, IList<IList<object>>> GenerateRoleAndParameterProjections(RolePathOwner pathOwner, RegisterSubqueryProjectionVariable variableRegistrar, DecorateSubqueryProjectionKey keyDecorator) + private IDictionary<LeadRolePath, IList<IList<object>>> GenerateRoleAndParameterProjections(RolePathOwner pathOwner, RegisterSubqueryProjectionVariable variableRegistrar, VariableKeyDecorator keyDecorator) { // Overlay all projection information // Make the QueryDerivationRule optional so that this supports inlining of derived fact types @@ -11575,7 +11587,7 @@ /// <summary> /// Override to bind calculation and constant projections /// </summary> - protected override void AddCalculatedAndConstantProjections(object pathContext, RolePathOwner pathOwner, LeadRolePath rolePath) + protected override void AddCalculatedAndConstantProjections(object pathContext, RolePathOwner pathOwner, LeadRolePath rolePath, VariableKeyDecorator keyDecorator) { // Overlay projection information RoleSetDerivationProjection projection = RoleSetDerivationProjection.GetLink((RoleProjectedDerivationRule)pathOwner, rolePath); @@ -11585,13 +11597,16 @@ { CalculatedPathValue calculation; PathConstant constant; + Role role; if (null != (calculation = roleProjection.ProjectedFromCalculatedValue)) { - ProjectExternalVariable(roleProjection.ProjectedRole, calculation, pathContext); + role = roleProjection.ProjectedRole; + ProjectExternalVariable(keyDecorator != null ? keyDecorator(role) : role, calculation, pathContext); } else if (null != (constant = roleProjection.ProjectedFromConstant)) { - ProjectExternalVariable(roleProjection.ProjectedRole, constant, pathContext); + role = roleProjection.ProjectedRole; + ProjectExternalVariable(keyDecorator != null ? keyDecorator(role) : role, constant, pathContext); } } } @@ -11903,9 +11918,10 @@ /// <summary> /// Override to bind calculation and constant projections /// </summary> - protected override void AddCalculatedAndConstantProjections(object pathContext, RolePathOwner pathOwner, LeadRolePath rolePath) + protected override void AddCalculatedAndConstantProjections(object pathContext, RolePathOwner pathOwner, LeadRolePath rolePath, VariableKeyDecorator keyDecorator) { - // Overlay projection information + // Overlay projection information. + // Key decorator is ignored as this is always called top level. ConstraintRoleSequenceJoinPathProjection projection = ConstraintRoleSequenceJoinPathProjection.GetLink((ConstraintRoleSequenceJoinPath)pathOwner, rolePath); if (projection != null) { @@ -12071,9 +12087,10 @@ /// <summary> /// Override to bind calculation and constant projections /// </summary> - protected override void AddCalculatedAndConstantProjections(object pathContext, RolePathOwner pathOwner, LeadRolePath rolePath) + protected override void AddCalculatedAndConstantProjections(object pathContext, RolePathOwner pathOwner, LeadRolePath rolePath, VariableKeyDecorator keyDecorator) { // Overlay projection information + // Key decorator is ignored as this is always called top level. ConstraintRoleSequenceJoinPathProjection projection = ConstraintRoleSequenceJoinPathProjection.GetLink((ConstraintRoleSequenceJoinPath)pathOwner, rolePath); if (projection != null) { Modified: trunk/Setup/Readme.htm =================================================================== --- trunk/Setup/Readme.htm 2012-10-25 16:34:18 UTC (rev 1497) +++ trunk/Setup/Readme.htm 2012-10-31 04:41:06 UTC (rev 1498) @@ -14,7 +14,7 @@ <p><b><a id="The Top" style="font-family:Verdana;font-size:medium">NORMA October 2012 CTP Readme</a> </b></p> <p>This file supersedes the previous readme.txt and older readme.htm files. This readme has parallel indexing mechanisms: by topic, and by release date (starting with the October 2008 (2008-10) release). The file will be extended for future product releases.<br/><br/> -The October 2012 release adds Visual Studio 2012 support and some enhances some disjunctive mandatory and external uniqueness verbalization patterns, and other bug fixes. See detailed change notes below for specifics.<br/><br/> +The October 2012 release adds Visual Studio 2012 support, some enhancements to disjunctive mandatory and external uniqueness verbalization patterns, and other bug fixes. See detailed change notes below for specifics.<br/><br/> </p> <h2>Contents</h2> <ul> @@ -44,8 +44,9 @@ <hr/> <h2>October 2012 CTP Changes</h2> -<div>The October 2012 CTP release includes all modifications through changeset 1496. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<div>The October 2012 CTP release includes all modifications through changeset 1498. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> <ul> +<li><a href="#VerbalizedObjectTypeNameRemoveSpecialCharacterDisplay 2012-10">Verbalized object type name separator character removal options</a></li> <li>Bug Fixes: <ol> <li>Crash verbalizing internal uniqueness constraints with no roles (possible from toolbox and with error activation).</li> @@ -574,6 +575,14 @@ <a id="VerbalizePossiblePopulationsOption 2012-04" class="new" title="April 2012 CTP: Verbalize possible populations option">2012-04</a> The <strong>Possible Populations</strong> option has replaced the <strong>Verbalization Default Constraint</strong> option in the <em>Verbalization</em> section of the <em>ORM Designer</em> tab on the <em>Options</em> page (available on the <em>Tools</em> menu). This option now applies to the possible populations of spanning internal uniqueness constraints in addition to many-to-one binary fact types. </li> +<li> +<a id="VerbalizedObjectTypeNameRemoveSpecialCharacterDisplay 2012-10" class="new" title="October 2012 CTP: Verbalized object type name separator character removal options">2012-10</a> +As an enhancement to automatic name separation and casing of object type names (see <a href="#VerbalizedObjectTypeNameDisplay 2012-01">Verbalized object type name options</a>), punctuation and symbol characters are recognized in addition to upper cases and numeric characters. +<ul> +<li>All symbol and punctuation characters form word boundaries.</li> +<li>Most special characters remain in the final name and do not get extra spaces around them.</li> +<li>The new <em>Object Type Name Removed Characters</em> options lists special characters that should be replaced with a space. The default setting replaces the <strong>.:_</strong> (period, colon, and underscore) characters with a space in the final name.</li></ul> +</li> </ol> <a href="#The Top">Return to top</a> <hr /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2012-10-15 23:22:42
|
Revision: 1495 http://orm.svn.sourceforge.net/orm/?rev=1495&view=rev Author: mcurland Date: 2012-10-15 23:22:36 +0000 (Mon, 15 Oct 2012) Log Message: ----------- Fix tool window reactivation issues on VS2010. Unlike the other platforms (including VS2012), VS2010 sends a FRAMESHOW_TabDeactivated between the FRAMESHOW_BeforeWinHidden and FRAMESHOW_WinHidden notification. This was causing the window to think it was covered instead of closed, which stopped it from reinitializing properly when it was shown. The result was the occasional blank tool window (diagram spy, model browser, and possibly others). Modified Paths: -------------- trunk/ORMModel/Framework/Shell/ToolWindowActivator.cs trunk/Setup/Readme.htm Modified: trunk/ORMModel/Framework/Shell/ToolWindowActivator.cs =================================================================== --- trunk/ORMModel/Framework/Shell/ToolWindowActivator.cs 2012-10-09 04:48:09 UTC (rev 1494) +++ trunk/ORMModel/Framework/Shell/ToolWindowActivator.cs 2012-10-15 23:22:36 UTC (rev 1495) @@ -581,8 +581,6 @@ { FrameVisibilityFlags flags = myFrameVisibility; FrameVisibilityFlags startFlags = flags & ~(FrameVisibilityFlags.FrameVisibilityMask | FrameVisibilityFlags.PersistentFlagsMask); - bool coverPending = 0 != (flags & FrameVisibilityFlags.PendingHiddenMeansCovered); - bool closePending = !coverPending && 0 != (flags & FrameVisibilityFlags.PendingHiddenMeansCovered); myFrameVisibility &= FrameVisibilityFlags.FrameVisibilityMask | FrameVisibilityFlags.PersistentFlagsMask; switch ((__FRAMESHOW)fShow) { @@ -591,7 +589,9 @@ break; case __FRAMESHOW.FRAMESHOW_WinMinimized: case __FRAMESHOW.FRAMESHOW_TabDeactivated: - myFrameVisibility |= FrameVisibilityFlags.PendingHiddenMeansCovered; + // VS2010 is sending a BeforeWinHidden/TabDeactivated/Hidden, which results in a covered state + // with a closed window. If closed is already pending, don't degrade to cover pending instead. + myFrameVisibility |= 0 != (startFlags & FrameVisibilityFlags.PendingHiddenMeansClosed) ? FrameVisibilityFlags.PendingHiddenMeansClosed : FrameVisibilityFlags.PendingHiddenMeansCovered; break; case __FRAMESHOW.FRAMESHOW_DestroyMultInst: case __FRAMESHOW.FRAMESHOW_WinClosed: Modified: trunk/Setup/Readme.htm =================================================================== --- trunk/Setup/Readme.htm 2012-10-09 04:48:09 UTC (rev 1494) +++ trunk/Setup/Readme.htm 2012-10-15 23:22:36 UTC (rev 1495) @@ -44,7 +44,7 @@ <hr/> <h2>October 2012 CTP Changes</h2> -<div>The October 2012 CTP release includes all modifications through changeset 1495. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<div>The October 2012 CTP release includes all modifications through changeset 1496. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> <ul> <li>Bug Fixes: <ol> @@ -53,7 +53,10 @@ <li>Cross-model drag lost position of value constraint shapes for object types and fact types.</li> <li>Duplication of fact types shapes with role value constraints on the same diagram did not conect the new constraint shapes to the new fact type shapes.</li> <li>Database import did not create shapes for most object types and fact types.</li> +<li>Fixed verbalization subscripting for disjunctive mandatory constraints with multiple roles in the same fact type.</li> +<li>Fixed verbalization of external uniqueness and frequency constraints over unary fact types.</li> <li>(VS2010) Database import wizard worked from File/New, but not adding a file directly to a project.</li> +<li>(VS2010) Diagram Spy and other tool windows could end up blank, requiring restart.</li> </ol> </li> </ul> @@ -399,8 +402,8 @@ <li>Updating NORMA to the latest version requires Setup.bat to be run from the downloaded .zip file, which should be chosen based on whether you want to install for Visual Studio 2010, Visual Studio 2008, or Visual Studio 2005. NORMA does not share installation files between these two products, so you must choose your target when you download the installation package.</li> <li>Any previous NORMA versions and any dependencies will be automatically uninstalled and reinstalled by the Setup.bat file. Make sure Visual Studio is not running during the installation pocess. Please be patient with the uninstall, which takes roughly the same amount of time as the install. Killing installation processes (the setup command prompt, msiexec, devenv) can leave you with a system that requires manual intervention to restore.</li> <li>First extract the files from the .zip file first unless you open them with the standard 'Compressed (zipped) Folders' viewer, in which case you can usually run Setup.bat without pre-expanding the zip file. Vista is likely to recommend expansion even with the standard viewer.</li> -<li><a id="#Setup 2008-10" class="new" title="October 2008 CTP: SetupVista.bat elevates install permissions on Vista">2008-10</a> -The setup process must be run with admistrative permissions on Vista. You can either right-click the Setup.bat file and choose 'Run as Administrator', or you can run SetupVista.bat instead of Setup.bat and agree to the Vista security warnings.</li> +<li><a id="#Setup 2008-10" class="new" title="October 2008 CTP: SetupVistaOrLater.bat elevates install permissions on Vista, Windows7, and later operating systems.">2008-10</a> +The setup process must be run with admistrative permissions on Vista, Windows7, and later operating systems. You can either right-click the Setup.bat file and choose 'Run as Administrator', or you can run SetupVistaOrLater.bat instead of Setup.bat and agree to the security warnings.</li> <li>(Visual Studio 2005 Install Only) The DSLToolsRedist.msi included with this release will not automatically upgrade if you have an older DSL installation on your machine. If you were an early user of NORMA or other DSL products and have not previously upgraded, or have experience designer issues on Windows Vista, then you may want to explicit uninstall the 'Microsoft DSL Tools Redistributable' product before running NORMA setup.</li> </ol> <a href="#The Top">Return to top</a> @@ -769,7 +772,6 @@ <p>These are areas that are incomplete and known issues with Visual Studio 2010.</p> <ol> <li>If the .orm designer is opened simultaneously with more than one other file (such as when opening a solution) and is the active file immediately after load, then the ORM designer tool windows and menu items will not activate properly. Activating a second document (of any type) and reactivating the ORM designer will fix the problem. <em>This is a Visual Studio 2010 bug</em> (I can reproduce similar behavior with missing menus with one XML and one Text file).</li> -<li>The <em>ORM Diagram Spy</em> window will occasionally go blank after extended use with multiple open ORM files. A restart of the environment is required to recover the window. If you can reliably reproduce this issue please report the scenario.</li> <li>The NORMA help files are not installed or integrated with Visual Studio 2010. [The installer merge modules used for help integration in VS2005 and VS2008 are not included with the VS2010 SDK.]</li> <li>The FrequencyConstraint and Reading shapes are larger in Visual Studio 2010.</li> <li>The document tab after a database import using <em>File/New</em> displays the full path of the temporary file instead of the base file name.</li> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2012-10-04 01:30:35
|
Revision: 1493 http://orm.svn.sourceforge.net/orm/?rev=1493&view=rev Author: mcurland Date: 2012-10-04 01:30:28 +0000 (Thu, 04 Oct 2012) Log Message: ----------- Bug fixes for shape creation scenarios * ORMDiagram.AutoPopulateShapes (set during import scenarios) was no longer effective after changes in [1482] to reduce phantom shape creation. Add an additional fixup listener to automatically add object type and fact type shapes for all elements to a diagram when this property is set. * Duplicating a fact type shape with a connected role value constraint on the same diagram or in a different model did not recreate the rang link shape (the dotted line) for the new shape. * Cross-model dragging of value constraint shapes on both value type and fact type shapes reverted copied shape position to the default location. Modified Paths: -------------- trunk/ORMModel/Framework/DeserializationManager.cs trunk/ORMModel/Framework/Diagrams/MultiShapeUtility.cs trunk/ORMModel/ObjectModel/ORMModel.cs trunk/ORMModel/ShapeModel/ORMShape.DeserializationFixupListeners.cs trunk/ORMModel/ShapeModel/ReadingShape.cs trunk/ORMModel/ShapeModel/RoleNameShape.cs trunk/ORMModel/ShapeModel/ValueRangeShape.cs trunk/ORMModel/ShapeModel/ViewFixupRules.cs Modified: trunk/ORMModel/Framework/DeserializationManager.cs =================================================================== --- trunk/ORMModel/Framework/DeserializationManager.cs 2012-10-04 01:16:54 UTC (rev 1492) +++ trunk/ORMModel/Framework/DeserializationManager.cs 2012-10-04 01:30:28 UTC (rev 1493) @@ -326,21 +326,26 @@ /// <summary> /// The first standard fixup phase for loading presentation elements. /// </summary> - FirstPresentationElementPhase = ValidateStoredPresentationElements, + FirstPresentationElementPhase = AutoCreateStoredPresentationElements, + /// <summary> + /// Initialized automatically created stored presentation elements that + /// will be serialized with the model. + /// </summary> + AutoCreateStoredPresentationElements = 5100, /// <summary> /// Fixup stored presentation elements /// </summary> - ValidateStoredPresentationElements = 5100, + ValidateStoredPresentationElements = 5200, /// <summary> /// Validate presentation elements that are implicitly recreated /// if they are not serialized. /// </summary> - ValidateImplicitStoredPresentationElements = 5200, + ValidateImplicitStoredPresentationElements = 5300, /// <summary> /// Add any presentation elements that are implicit and not /// serialized with the model. /// </summary> - AddImplicitPresentationElements = 5300, + AddImplicitPresentationElements = 5400, /// <summary> /// The last standard fixup phase for loading presentation elements. /// </summary> Modified: trunk/ORMModel/Framework/Diagrams/MultiShapeUtility.cs =================================================================== --- trunk/ORMModel/Framework/Diagrams/MultiShapeUtility.cs 2012-10-04 01:16:54 UTC (rev 1492) +++ trunk/ORMModel/Framework/Diagrams/MultiShapeUtility.cs 2012-10-04 01:30:28 UTC (rev 1493) @@ -149,7 +149,8 @@ } } - if (allowMultipleShapesForChildren) + if (allowMultipleShapesForChildren && + (existingChildShape == null || existingChildShape is LinkShape || existingChildShape.ParentShape != existingParentShape)) { if (unparentedChildShape == null) { @@ -188,10 +189,10 @@ existingChildShape.OnBoundsFixup(BoundsFixupState.ViewFixup, 0, false); //fix up grand child shapes - ICollection GrandChildShapes = existingChildShape.GetChildElements(childElement); - foreach (ModelElement GrandChildShape in GrandChildShapes) + ICollection grandChildShapes = existingChildShape.GetChildElements(childElement); + foreach (ModelElement grandChildShape in grandChildShapes) { - existingChildShape.FixUpChildShapes(GrandChildShape); + existingChildShape.FixUpChildShapes(grandChildShape); } return existingChildShape; Modified: trunk/ORMModel/ObjectModel/ORMModel.cs =================================================================== --- trunk/ORMModel/ObjectModel/ORMModel.cs 2012-10-04 01:16:54 UTC (rev 1492) +++ trunk/ORMModel/ObjectModel/ORMModel.cs 2012-10-04 01:30:28 UTC (rev 1493) @@ -70,11 +70,15 @@ /// explicit, intrinsic, and implicit elements are in place. /// </summary> ValidateErrors = StandardFixupPhase.LastModelElementPhase + 200, - /// <summary> + /// <summary> + /// Create implicitly stored presentation elements + /// </summary> + AutoCreateStoredPresentationElements = StandardFixupPhase.AutoCreateStoredPresentationElements, + /// <summary> /// Fixup stored presentation elements /// </summary> ValidateStoredPresentationElements = StandardFixupPhase.ValidateStoredPresentationElements, - /// <summary> + /// <summary> /// Add any presentation elements that are implicit and not /// serialized with the model. /// </summary> Modified: trunk/ORMModel/ShapeModel/ORMShape.DeserializationFixupListeners.cs =================================================================== --- trunk/ORMModel/ShapeModel/ORMShape.DeserializationFixupListeners.cs 2012-10-04 01:16:54 UTC (rev 1492) +++ trunk/ORMModel/ShapeModel/ORMShape.DeserializationFixupListeners.cs 2012-10-04 01:30:28 UTC (rev 1493) @@ -38,7 +38,8 @@ yield return new DisplayValueTypeValueConstraintFixupListener(); yield return new DisplayRoleNameFixupListener(); yield return new DisplayModelNoteLinksFixupListener(); - yield return FactTypeShape.FixupListener; + yield return new DisplayAutoPopulatedShapesFixupListener(); + yield return FactTypeShape.FixupListener; yield return ReadingShape.FixupListener; yield return ObjectTypeShape.FixupListener; yield return ObjectifiedFactTypeNameShape.FixupListener; Modified: trunk/ORMModel/ShapeModel/ReadingShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/ReadingShape.cs 2012-10-04 01:16:54 UTC (rev 1492) +++ trunk/ORMModel/ShapeModel/ReadingShape.cs 2012-10-04 01:30:28 UTC (rev 1493) @@ -331,24 +331,27 @@ /// <param name="createdDuringViewFixup">Whether this shape was created as part of a view fixup</param> public override void PlaceAsChildOf(NodeShape parent, bool createdDuringViewFixup) { - FactTypeShape factTypeShape = (FactTypeShape)parent; - FactType factType; - Objectification objectification; AutoResize(); - SizeD size = Size; - double yOffset; - if (factTypeShape.ConstraintDisplayPosition == ConstraintDisplayPosition.Bottom && - (null == (factType = factTypeShape.AssociatedFactType) || - null == (objectification = factType.Objectification) || - objectification.IsImplied)) + if (createdDuringViewFixup) { - yOffset = -1.5 * size.Height; + FactTypeShape factTypeShape = (FactTypeShape)parent; + FactType factType; + Objectification objectification; + SizeD size = Size; + double yOffset; + if (factTypeShape.ConstraintDisplayPosition == ConstraintDisplayPosition.Bottom && + (null == (factType = factTypeShape.AssociatedFactType) || + null == (objectification = factType.Objectification) || + objectification.IsImplied)) + { + yOffset = -1.5 * size.Height; + } + else + { + yOffset = factTypeShape.Size.Height + .5 * size.Height; + } + Location = new PointD(0, yOffset); } - else - { - yOffset = factTypeShape.Size.Height + .5 * size.Height; - } - Location = new PointD(0, yOffset); } /// <summary> /// Overrides default implemenation to instantiate an Reading specific one. Modified: trunk/ORMModel/ShapeModel/RoleNameShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/RoleNameShape.cs 2012-10-04 01:16:54 UTC (rev 1492) +++ trunk/ORMModel/ShapeModel/RoleNameShape.cs 2012-10-04 01:30:28 UTC (rev 1493) @@ -96,19 +96,22 @@ /// <param name="createdDuringViewFixup">Whether this shape was created as part of a view fixup</param> public override void PlaceAsChildOf(NodeShape parent, bool createdDuringViewFixup) { - FactTypeShape factShape = (FactTypeShape)parent; - double x = -0.2; - double y = -0.2; - FactType factType = factShape.AssociatedFactType; - // Cascades RoleNameShapes for facts that contain more than one role - LinkedElementCollection<RoleBase> roles = factShape.DisplayedRoleOrder; - int roleIndex = roles.IndexOf((RoleBase)ModelElement); - if (roleIndex != -1) + if (createdDuringViewFixup) { - x += roleIndex * 0.15; - y -= roleIndex * 0.15; + FactTypeShape factShape = (FactTypeShape)parent; + double x = -0.2; + double y = -0.2; + FactType factType = factShape.AssociatedFactType; + // Cascades RoleNameShapes for facts that contain more than one role + LinkedElementCollection<RoleBase> roles = factShape.DisplayedRoleOrder; + int roleIndex = roles.IndexOf((RoleBase)ModelElement); + if (roleIndex != -1) + { + x += roleIndex * 0.15; + y -= roleIndex * 0.15; + } + Location = new PointD(x, y); } - Location = new PointD(x, y); } /// <summary> /// Highlight both the name shape and the corresponding role box. Modified: trunk/ORMModel/ShapeModel/ValueRangeShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/ValueRangeShape.cs 2012-10-04 01:16:54 UTC (rev 1492) +++ trunk/ORMModel/ShapeModel/ValueRangeShape.cs 2012-10-04 01:30:28 UTC (rev 1493) @@ -180,12 +180,15 @@ public override void PlaceAsChildOf(NodeShape parent, bool createdDuringViewFixup) { AutoResize(); - SizeD size = Size; - RectangleD parentBounds = ParentShape.AbsoluteBoundingBox; - // Place slightly to the right. This will cause the label to - // track in this position due to a horizontal resize of the - // shape because of rename, etc - Location = new PointD(parentBounds.Width + .06, -1 * size.Height); + if (createdDuringViewFixup) + { + SizeD size = Size; + RectangleD parentBounds = ParentShape.AbsoluteBoundingBox; + // Place slightly to the right. This will cause the label to + // track in this position due to a horizontal resize of the + // shape because of rename, etc + Location = new PointD(parentBounds.Width + .06, -1 * size.Height); + } } /// <summary> /// Overrides default implemenation to instantiate an value constraint specific one. Modified: trunk/ORMModel/ShapeModel/ViewFixupRules.cs =================================================================== --- trunk/ORMModel/ShapeModel/ViewFixupRules.cs 2012-10-04 01:16:54 UTC (rev 1492) +++ trunk/ORMModel/ShapeModel/ViewFixupRules.cs 2012-10-04 01:30:28 UTC (rev 1493) @@ -794,8 +794,6 @@ ORMModel model = factType.Model; if (model != null) { - Diagram.FixUpDiagram(factType, roleValueConstraint); - object AllowMultipleShapes; Dictionary<object, object> topLevelContextInfo; bool containedAllowMultipleShapes; @@ -804,6 +802,8 @@ topLevelContextInfo.Add(AllowMultipleShapes, null); } + Diagram.FixUpDiagram(factType, roleValueConstraint); + foreach (PresentationViewsSubject presentationViewsSubject in DomainRoleInfo.GetElementLinks<PresentationViewsSubject>(model, PresentationViewsSubject.SubjectDomainRoleId)) { ORMDiagram diagram; @@ -813,7 +813,6 @@ foreach (ValueConstraintShape shapeElement in MultiShapeUtility.FindAllShapesForElement<ValueConstraintShape>(diagram, roleValueConstraint)) { diagram.FixUpLocalDiagram(link); - break; } } } @@ -880,7 +879,20 @@ if (null != (objectType = valueConstraint.ValueType) && null != (model = objectType.Model)) { + object AllowMultipleShapes; + Dictionary<object, object> topLevelContextInfo; + bool containedAllowMultipleShapes; + if (!(containedAllowMultipleShapes = (topLevelContextInfo = link.Store.TransactionManager.CurrentTransaction.TopLevelTransaction.Context.ContextInfo).ContainsKey(AllowMultipleShapes = MultiShapeUtility.AllowMultipleShapes))) + { + topLevelContextInfo.Add(AllowMultipleShapes, null); + } + Diagram.FixUpDiagram(objectType, valueConstraint); + + if (!containedAllowMultipleShapes) + { + topLevelContextInfo.Remove(AllowMultipleShapes); + } } } /// <summary> @@ -901,8 +913,6 @@ null != (objectType = uniquenessConstraint.PreferredIdentifierFor) && null != (model = objectType.Model)) { - Diagram.FixUpDiagram(objectType, roleValueConstraint); - object AllowMultipleShapes; Dictionary<object, object> topLevelContextInfo; bool containedAllowMultipleShapes; @@ -911,6 +921,7 @@ topLevelContextInfo.Add(AllowMultipleShapes, null); } + Diagram.FixUpDiagram(objectType, roleValueConstraint); Diagram.FixUpDiagram(model, link); if (!containedAllowMultipleShapes) @@ -1231,9 +1242,66 @@ } } #endregion // ModelNote fixup - #region ForceClearViewFixupDataListRuleClass - partial class ForceClearViewFixupDataListRuleClass + #region Auto populated diagram fixup + #region DisplayAutoPopulatedShapesFixupListener class + /// <summary> + /// A fixup class to create top-level shapes for auotmatically populated ORM diagrams. + /// </summary> + /// <remarks>This used to happen automatically when fixup listeners for implicit + /// links verified the existence of the shapes they were attaching too. However, this + /// had too many side effects, so we now check this condition explicitly on load.</remarks> + private sealed class DisplayAutoPopulatedShapesFixupListener : DeserializationFixupListener<ORMDiagram> { + /// <summary> + /// Create a new DisplayAutoPopulatedShapesFixupListener + /// </summary> + public DisplayAutoPopulatedShapesFixupListener() + : base((int)ORMDeserializationFixupPhase.AutoCreateStoredPresentationElements) + { + } + /// <summary> + /// Add top-level auto populated shapes to a diagram + /// </summary> + /// <param name="element">An ORMDiagram instance</param> + /// <param name="store">The context store</param> + /// <param name="notifyAdded">The listener to notify if elements are added during fixup</param> + protected sealed override void ProcessElement(ORMDiagram element, Store store, INotifyElementAdded notifyAdded) + { + if (element.AutoPopulateShapes) + { + IElementDirectory elementDir = store.ElementDirectory; + ShapeElement shape; + foreach (ObjectType objectType in elementDir.FindElements<ObjectType>(false)) + { + Objectification objectification; + if (!objectType.IsImplicitBooleanValue && + (null == (objectification = objectType.Objectification) || !objectification.IsImplied)) + { + if (null != (shape = element.FixUpLocalDiagram(element, objectType))) + { + notifyAdded.ElementAdded(shape, true); + } + } + } + foreach (FactType factType in elementDir.FindElements<FactType>(false)) + { + if (null == factType.ImpliedByObjectification) + { + if (null != (shape = element.FixUpLocalDiagram(element, factType))) + { + notifyAdded.ElementAdded(shape, true); + } + } + + } + } + } + } + #endregion // DisplayModelNoteLinksFixupListener class + #endregion // Auto populated diagram fixup + #region ForceClearViewFixupDataListRuleClass + partial class ForceClearViewFixupDataListRuleClass + { #region Dynamic Microsoft.VisualStudio.Modeling.Diagrams.Diagram.GetViewFixupDataListCount implementation private delegate int GetViewFixupDataListCountDelegate(Diagram @this); private static readonly GetViewFixupDataListCountDelegate GetViewFixupDataListCount = CreateGetViewFixupDataListCount(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2012-10-04 01:17:01
|
Revision: 1492 http://orm.svn.sourceforge.net/orm/?rev=1492&view=rev Author: mcurland Date: 2012-10-04 01:16:54 +0000 (Thu, 04 Oct 2012) Log Message: ----------- Finished enabling project build on 64-bit platforms * Use HKCU\Software keys without Wow6432Node redirect * Redirect HKLM\Software keys to Wow6432Node only when running in 64-bit script, not when invoked by 32-bit project Build * Do not make preliminary calls to SetupEnvironment.bat before invoking build system, call only as needed * Register VS2010 extension as an installed add-in so it is not initially disabled Modified Paths: -------------- trunk/Build.bat trunk/BuildAll.bat trunk/BuildDevTools.bat trunk/BuildHelp.bat trunk/BuildTests.bat trunk/CodeSmith/DILSchemaProvider/Install.bat trunk/FirstTimeBuild.bat trunk/FirstTimeBuildAll.bat trunk/FirstTimeBuildAllVS2008.bat trunk/FirstTimeBuildVS2008.bat trunk/FirstTimeBuildVS2010.bat trunk/ORM2CommandLineTest/install.bat trunk/SetupEnvironment.bat trunk/TestSuites/RegressionTests/TestHost.bat trunk/TestSuites/RegressionTests/VSEnvironmentSnapshot.bat trunk/Tools/DisableRuleDirectiveProcessor/Install.bat trunk/Tools/NUBuildVS/Install.bat trunk/install.bat Modified: trunk/Build.bat =================================================================== --- trunk/Build.bat 2012-09-10 23:19:43 UTC (rev 1491) +++ trunk/Build.bat 2012-10-04 01:16:54 UTC (rev 1492) @@ -1,8 +1,12 @@ @ECHO OFF SETLOCAL -SET RootDir=%~dp0. -CALL "%RootDir%\SetupEnvironment.bat" %* +::Do not call SetupEnvironment.bat. For 64-bit systems, the environment +::variables differ depending on whether the installation batch files are +::launched directly from the command line or indirectly by the 32-bit +::build process. Therefore, any environment variables designed for registry +::use that include Wow6432Node will be correct here, but incorrect when they +::are used by the batch scripts invoked during build. -MSBuild.exe /nologo "%RootDir%\Main.proj" %* +MSBuild.exe /nologo "%~dp0Main.proj" %* GOTO:EOF Modified: trunk/BuildAll.bat =================================================================== --- trunk/BuildAll.bat 2012-09-10 23:19:43 UTC (rev 1491) +++ trunk/BuildAll.bat 2012-10-04 01:16:54 UTC (rev 1492) @@ -1,7 +1,6 @@ @ECHO OFF SETLOCAL SET RootDir=%~dp0. -CALL "%RootDir%\SetupEnvironment.bat" %* CALL "%RootDir%\BuildSetup.bat" %* CALL "%RootDir%\BuildTests.bat" %* Modified: trunk/BuildDevTools.bat =================================================================== --- trunk/BuildDevTools.bat 2012-09-10 23:19:43 UTC (rev 1491) +++ trunk/BuildDevTools.bat 2012-10-04 01:16:54 UTC (rev 1492) @@ -1,7 +1,6 @@ @ECHO OFF SETLOCAL SET RootDir=%~dp0. -CALL "%RootDir%\SetupEnvironment.bat" %* :: NUBuild and NUBuildVS need to be built separately, before any other projects, since all of the later projects depend on them. MSBuild.exe /nologo "%RootDir%\Tools\NUBuild\NUBuild.sln" %* Modified: trunk/BuildHelp.bat =================================================================== --- trunk/BuildHelp.bat 2012-09-10 23:19:43 UTC (rev 1491) +++ trunk/BuildHelp.bat 2012-10-04 01:16:54 UTC (rev 1492) @@ -1,9 +1,9 @@ -@ECHO OFF +@ECHO ON SETLOCAL SET RootDir=%~dp0. CALL "%RootDir%\SetupEnvironment.bat" %* -CALL "%TrunkDir%\SetFromRegistry.bat" "HSLiteInstallDir" "HKLM\SOFTWARE%WOWRegistryRoot%\Innovasys\HelpStudio2" "LiteInstallDir" "f" +CALL "%TrunkDir%\SetFromRegistry.bat" "HSLiteInstallDir" "HKLM\SOFTWARE%WOWRegistryAdjust%\Innovasys\HelpStudio2" "LiteInstallDir" "f" ECHO Building help project. This may take several minutes... PUSHD "%TrunkDir%\Documentation\Help Project" Modified: trunk/BuildTests.bat =================================================================== --- trunk/BuildTests.bat 2012-09-10 23:19:43 UTC (rev 1491) +++ trunk/BuildTests.bat 2012-10-04 01:16:54 UTC (rev 1492) @@ -1,7 +1,6 @@ @ECHO OFF SETLOCAL SET RootDir=%~dp0. -CALL "%RootDir%\SetupEnvironment.bat" %* MSBuild.exe /nologo "%RootDir%\Tests.proj" %* Modified: trunk/CodeSmith/DILSchemaProvider/Install.bat =================================================================== --- trunk/CodeSmith/DILSchemaProvider/Install.bat 2012-09-10 23:19:43 UTC (rev 1491) +++ trunk/CodeSmith/DILSchemaProvider/Install.bat 2012-10-04 01:16:54 UTC (rev 1492) @@ -6,7 +6,11 @@ IF "%ProgramFiles(X86)%"=="" ( SET WOWRegistryAdjust= ) ELSE ( - SET WOWRegistryAdjust=\Wow6432Node + IF DEFINED PROCESSOR_ARCHITEW6432 ( + SET WOWRegistryAdjust= + ) ELSE ( + SET WOWRegistryAdjust=\Wow6432Node + ) ) FOR /F "usebackq skip=2 tokens=2*" %%A IN (`REG QUERY "HKLM\SOFTWARE%WOWRegistryAdjust%\CodeSmith\v3.2" /v "ApplicationDirectory"`) DO SET CodeSmithDir=%%~fB Modified: trunk/FirstTimeBuild.bat =================================================================== --- trunk/FirstTimeBuild.bat 2012-09-10 23:19:43 UTC (rev 1491) +++ trunk/FirstTimeBuild.bat 2012-10-04 01:16:54 UTC (rev 1492) @@ -1,11 +1,11 @@ @ECHO OFF SETLOCAL SET RootDir=%~dp0. -CALL "%RootDir%\SetupEnvironment.bat" %* CALL "%RootDir%\BuildDevTools.bat" %* CALL "%RootDir%\Build.bat" %* +CALL "%RootDir%\SetupEnvironment.bat" %* ECHO. ECHO Running 'devenv.exe /RootSuffix "%VSRegistryRootSuffix%" /Setup'... This may take a few minutes... "%VSEnvironmentPath%" /RootSuffix "%VSRegistryRootSuffix%" /Setup Modified: trunk/FirstTimeBuildAll.bat =================================================================== --- trunk/FirstTimeBuildAll.bat 2012-09-10 23:19:43 UTC (rev 1491) +++ trunk/FirstTimeBuildAll.bat 2012-10-04 01:16:54 UTC (rev 1492) @@ -1,11 +1,11 @@ @ECHO OFF SETLOCAL SET RootDir=%~dp0. -CALL "%RootDir%\SetupEnvironment.bat" %* CALL "%RootDir%\BuildDevTools.bat" %* CALL "%RootDir%\BuildAll.bat" %* +CALL "%RootDir%\SetupEnvironment.bat" %* ECHO. ECHO Running 'devenv.exe /RootSuffix "%VSRegistryRootSuffix%" /Setup'... This may take a few minutes... "%VSEnvironmentPath%" /RootSuffix "%VSRegistryRootSuffix%" /Setup Modified: trunk/FirstTimeBuildAllVS2008.bat =================================================================== --- trunk/FirstTimeBuildAllVS2008.bat 2012-09-10 23:19:43 UTC (rev 1491) +++ trunk/FirstTimeBuildAllVS2008.bat 2012-10-04 01:16:54 UTC (rev 1492) @@ -2,28 +2,33 @@ SETLOCAL SET RootDir=%~dp0. +SETLOCAL IF "%ProgramFiles(X86)%"=="" ( SET WOWRegistryAdjust= ) ELSE ( - SET WOWRegistryAdjust=\Wow6432Node + IF DEFINED PROCESSOR_ARCHITEW6432 ( + SET WOWRegistryAdjust= + ) ELSE ( + SET WOWRegistryAdjust=\Wow6432Node + ) ) +REG QUERY "HKLM\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\9.0Exp" /v ApplicationID 1>NUL 2>&1 +IF ERRORLEVEL 1 (CALL:_SetupExpHive) +REG QUERY "HKLM\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\9.0Exp" /v ApplicationID 1>NUL 2>&1 +IF ERRORLEVEL 1 (ECHO Could not find experimental registry hive for Visual Studio 2008. Aborting... && GOTO:EOF) +ENDLOCAL + IF "%TargetVisualStudioVersion%"=="v8.0" ( SET DegradeToolsVersion=/toolsversion:2.0 ) ELSE ( SET TargetVisualStudioVersion=v9.0 ) -REG QUERY "HKLM\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\9.0Exp" /v ApplicationID 1>NUL 2>&1 -IF ERRORLEVEL 1 (CALL:_SetupExpHive) -REG QUERY "HKLM\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\9.0Exp" /v ApplicationID 1>NUL 2>&1 -IF ERRORLEVEL 1 (ECHO Could not find experimental registry hive for Visual Studio 2008. Aborting... && GOTO:EOF) - -CALL "%RootDir%\SetupEnvironment.bat" %* - CALL "%RootDir%\BuildDevTools.bat" %* /consoleloggerparameters:DisableMPLogging %DegradeToolsVersion% CALL "%RootDir%\BuildAll.bat" %* /consoleloggerparameters:DisableMPLogging %DegradeToolsVersion% +CALL "%RootDir%\SetupEnvironment.bat" %* ECHO. ECHO Running 'devenv.exe /RootSuffix "%VSRegistryRootSuffix%" /Setup'... This may take a few minutes... "%VSEnvironmentPath%" /RootSuffix "%VSRegistryRootSuffix%" /Setup @@ -35,14 +40,14 @@ IF "%VSIPDir%"=="" (ECHO Please install the Microsoft Visual Studio 2008 SDK. See README.txt. && PAUSE && EXIT) ECHO Setting up machine-level experimental registry hive for Visual Studio 2008... This may take a few minutes... "%VSIPDir%\VisualStudioIntegration\Tools\Bin\VSRegEx.exe" GetOrig 9.0 Exp -REG QUERY "HKCU\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\9.0Exp\Configuration" /v ApplicationID 1>NUL 2>&1 +REG QUERY "HKCU\Software\Microsoft\VisualStudio\9.0Exp\Configuration" /v ApplicationID 1>NUL 2>&1 IF NOT ERRORLEVEL 1 (CALL:_BackupUserConfiguration) GOTO:EOF :_BackupUserConfiguration ECHO Backing up user-level experimental registry hive for Visual Studio 2008... This may take a minute... REG DELETE "HCKU\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\9.0Exp\Configuration_Backup" /f 1>NUL 2>&1 -REG ADD "HKCU\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\9.0Exp\Configuration_Backup" 1>NUL 2>&1 -REG COPY "HKCU\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\9.0Exp\Configuration" "HKCU\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\9.0Exp\Configuration_Backup" /s /f -REG DELETE "HKCU\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\9.0Exp\Configuration" /f 1>NUL 2>&1 +REG ADD "HKCU\Software\Microsoft\VisualStudio\9.0Exp\Configuration_Backup" 1>NUL 2>&1 +REG COPY "HKCU\Software\Microsoft\VisualStudio\9.0Exp\Configuration" "HKCU\Software\Microsoft\VisualStudio\9.0Exp\Configuration_Backup" /s /f +REG DELETE "HKCU\Software\Microsoft\VisualStudio\9.0Exp\Configuration" /f 1>NUL 2>&1 GOTO:EOF Modified: trunk/FirstTimeBuildVS2008.bat =================================================================== --- trunk/FirstTimeBuildVS2008.bat 2012-09-10 23:19:43 UTC (rev 1491) +++ trunk/FirstTimeBuildVS2008.bat 2012-10-04 01:16:54 UTC (rev 1492) @@ -2,12 +2,23 @@ SETLOCAL SET RootDir=%~dp0. +SETLOCAL IF "%ProgramFiles(X86)%"=="" ( SET WOWRegistryAdjust= ) ELSE ( - SET WOWRegistryAdjust=\Wow6432Node + IF DEFINED PROCESSOR_ARCHITEW6432 ( + SET WOWRegistryAdjust= + ) ELSE ( + SET WOWRegistryAdjust=\Wow6432Node + ) ) +REG QUERY "HKLM\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\9.0Exp" /v ApplicationID 1>NUL 2>&1 +IF ERRORLEVEL 1 (CALL:_SetupExpHive) +REG QUERY "HKLM\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\9.0Exp" /v ApplicationID 1>NUL 2>&1 +IF ERRORLEVEL 1 (ECHO Could not find experimental registry hive for Visual Studio 2008. Aborting... && GOTO:EOF) +ENDLOCAL + IF "%TargetVisualStudioVersion%"=="v8.0" ( SET DegradeToolsVersion=/toolsversion:2.0 ) ELSE ( @@ -15,16 +26,10 @@ SET DegradeToolsVersion=/toolsversion:3.5 ) -REG QUERY "HKLM\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\9.0Exp" /v ApplicationID 1>NUL 2>&1 -IF ERRORLEVEL 1 (CALL:_SetupExpHive) -REG QUERY "HKLM\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\9.0Exp" /v ApplicationID 1>NUL 2>&1 -IF ERRORLEVEL 1 (ECHO Could not find experimental registry hive for Visual Studio 2008. Aborting... && GOTO:EOF) - -CALL "%RootDir%\SetupEnvironment.bat" %* - CALL "%RootDir%\BuildDevTools.bat" %* /consoleloggerparameters:DisableMPLogging %DegradeToolsVersion% CALL "%RootDir%\Build.bat" %* /consoleloggerparameters:DisableMPLogging %DegradeToolsVersion% +CALL "%RootDir%\SetupEnvironment.bat" %* ECHO. ECHO Running 'devenv.exe /RootSuffix "%VSRegistryRootSuffix%" /Setup'... This may take a few minutes... "%VSEnvironmentPath%" /RootSuffix "%VSRegistryRootSuffix%" /Setup @@ -36,14 +41,14 @@ IF "%VSIPDir%"=="" (ECHO Please install the Microsoft Visual Studio 2008 SDK. See README.txt. && PAUSE && EXIT) ECHO Setting up machine-level experimental registry hive for Visual Studio 2008... This may take a few minutes... "%VSIPDir%\VisualStudioIntegration\Tools\Bin\VSRegEx.exe" GetOrig 9.0 Exp -REG QUERY "HKCU\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\9.0Exp\Configuration" /v ApplicationID 1>NUL 2>&1 +REG QUERY "HKCU\Software\Microsoft\VisualStudio\9.0Exp\Configuration" /v ApplicationID 1>NUL 2>&1 IF NOT ERRORLEVEL 1 (CALL:_BackupUserConfiguration) GOTO:EOF :_BackupUserConfiguration ECHO Backing up user-level experimental registry hive for Visual Studio 2008... This may take a minute... REG DELETE "HCKU\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\9.0Exp\Configuration_Backup" /f 1>NUL 2>&1 -REG ADD "HKCU\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\9.0Exp\Configuration_Backup" 1>NUL 2>&1 -REG COPY "HKCU\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\9.0Exp\Configuration" "HKCU\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\9.0Exp\Configuration_Backup" /s /f -REG DELETE "HKCU\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\9.0Exp\Configuration" /f 1>NUL 2>&1 +REG ADD "HKCU\Software\Microsoft\VisualStudio\9.0Exp\Configuration_Backup" 1>NUL 2>&1 +REG COPY "HKCU\Software\Microsoft\VisualStudio\9.0Exp\Configuration" "HKCU\Software\Microsoft\VisualStudio\9.0Exp\Configuration_Backup" /s /f +REG DELETE "HKCU\Software\Microsoft\VisualStudio\9.0Exp\Configuration" /f 1>NUL 2>&1 GOTO:EOF Modified: trunk/FirstTimeBuildVS2010.bat =================================================================== --- trunk/FirstTimeBuildVS2010.bat 2012-09-10 23:19:43 UTC (rev 1491) +++ trunk/FirstTimeBuildVS2010.bat 2012-10-04 01:16:54 UTC (rev 1492) @@ -1,7 +1,6 @@ @ECHO OFF SETLOCAL SET RootDir=%~dp0. -CALL "%RootDir%\SetupEnvironment.bat" %* IF "%TargetVisualStudioVersion%"=="v8.0" ( SET DegradeToolsVersion=/toolsversion:2.0 @@ -11,7 +10,7 @@ SET TargetVisualStudioVersion=v10.0 ) -CALL "%RootDir%\BuildDevTools.bat" %* -CALL "%RootDir%\Build.bat" %* +CALL "%RootDir%\BuildDevTools.bat" %* /consoleloggerparameters:DisableMPLogging %DegradeToolsVersion% +CALL "%RootDir%\Build.bat" %* /consoleloggerparameters:DisableMPLogging %DegradeToolsVersion% GOTO:EOF Modified: trunk/ORM2CommandLineTest/install.bat =================================================================== --- trunk/ORM2CommandLineTest/install.bat 2012-09-10 23:19:43 UTC (rev 1491) +++ trunk/ORM2CommandLineTest/install.bat 2012-10-04 01:16:54 UTC (rev 1492) @@ -83,5 +83,9 @@ :SET6432 ::Do this somewhere the resolved parens will not cause problems. SET ResolvedProgramFiles=%ProgramFiles(X86)% -SET WOWRegistryAdjust=\Wow6432Node +IF DEFINED PROCESSOR_ARCHITEW6432 ( + SET WOWRegistryAdjust= +) ELSE ( + SET WOWRegistryAdjust=\Wow6432Node +) GOTO:EOF Modified: trunk/SetupEnvironment.bat =================================================================== --- trunk/SetupEnvironment.bat 2012-09-10 23:19:43 UTC (rev 1491) +++ trunk/SetupEnvironment.bat 2012-10-04 01:16:54 UTC (rev 1492) @@ -41,7 +41,14 @@ IF NOT DEFINED VSRegistryRootBase (SET VSRegistryRootBase=SOFTWARE%WOWRegistryAdjust%\Microsoft\VisualStudio) IF NOT DEFINED VSRegistryRootVersion (SET VSRegistryRootVersion=%TargetVisualStudioMajorMinorVersion%) IF NOT DEFINED VSRegistryRoot (SET VSRegistryRoot=%VSRegistryRootBase%\%VSRegistryRootVersion%%VSRegistryRootSuffix%) -IF NOT DEFINED VSRegistryConfigRoot (SET VSRegistryConfigRoot=%VSRegistryRootBase%\%VSRegistryRootVersion%%VSRegistryRootSuffix%%VSRegistryConfigDecorator%) +IF NOT DEFINED VSRegistryConfigRootBase ( + IF "%VSRegistryConfigHive%"=="HKCU" ( + SET VSRegistryConfigRootBase=SOFTWARE\Microsoft\VisualStudio + ) ELSE ( + SET VSRegistryConfigRootBase=%VSRegistryRootBase% + ) +) +IF NOT DEFINED VSRegistryConfigRoot (SET VSRegistryConfigRoot=%VSRegistryConfigRootBase%\%VSRegistryRootVersion%%VSRegistryRootSuffix%%VSRegistryConfigDecorator%) CALL "%TrunkDir%\SetFromRegistry.bat" "VSEnvironmentPath" "%VSRegistryConfigHive%\%VSRegistryConfigRoot%\Setup\VS" "EnvironmentPath" "f" CALL "%TrunkDir%\SetFromRegistry.bat" "VSEnvironmentDir" "%VSRegistryConfigHive%\%VSRegistryConfigRoot%\Setup\VS" "EnvironmentDirectory" "f" @@ -50,9 +57,9 @@ IF NOT DEFINED LocalAppData SET LocalAppData=%UserProfile%\Local Settings\Application Data IF NOT "%VSIXExtensionDir%"=="" ( IF "%VSRegistryRootSuffix%"=="" ( - SET VSIXInstallDir=%VSEnvironmentDir%\%VSIXExtensionDir% + CALL:SETVAR "VSIXInstallDir" "%VSEnvironmentDir%\%VSIXExtensionDir%" ) ELSE ( - SET VSIXInstallDir=%LocalAppData%\Microsoft\VisualStudio\%VSRegistryRootVersion%%VSRegistryRootSuffix%\%VSIXExtensionDir% + CALL:SETVAR "VSIXInstallDir" "%LocalAppData%\Microsoft\VisualStudio\%VSRegistryRootVersion%%VSRegistryRootSuffix%\%VSIXExtensionDir%" ) ) ELSE ( SET VSIXInstallDir= @@ -126,7 +133,15 @@ ::Do this somewhere the resolved parens will not cause problems. SET ResolvedProgramFiles=%ProgramFiles(x86)% SET ResolvedCommonProgramFiles=%CommonProgramFiles(x86)% -SET WOWRegistryAdjust=\Wow6432Node +::If this batch file is already running under a 32 bit process, then the +::reg utility will choose the appropriate registry keys without our help. +::This also means that this file should not be called to pre-set environment +::variables before invoking 32-bit processes that use these variables. +IF DEFINED PROCESSOR_ARCHITEW6432 ( + SET WOWRegistryAdjust= +) ELSE ( + SET WOWRegistryAdjust=\Wow6432Node +) GOTO:EOF :SETVAR Modified: trunk/TestSuites/RegressionTests/TestHost.bat =================================================================== --- trunk/TestSuites/RegressionTests/TestHost.bat 2012-09-10 23:19:43 UTC (rev 1491) +++ trunk/TestSuites/RegressionTests/TestHost.bat 2012-10-04 01:16:54 UTC (rev 1492) @@ -27,14 +27,18 @@ IF "%ProgramFiles(X86)%"=="" ( SET WOWRegistryAdjust= ) ELSE ( - SET WOWRegistryAdjust=\Wow6432Node + IF DEFINED PROCESSOR_ARCHITEW6432 ( + SET WOWRegistryAdjust= + ) ELSE ( + SET WOWRegistryAdjust=\Wow6432Node + ) ) REM Get the Visual Studio environment install location FOR /F "usebackq eol=! tokens=2*" %%A IN (`REG QUERY "HKLM\SOFTWARE%WOWRegistryAdjust%\Microsoft\VisualStudio\8.0%RootSuffix%" /v "InstallDir"`) DO call set LaunchDevenv=%%~dpsBdevenv REM Clear the current add-in file, it may not load -FOR /F "usebackq eol=! tokens=2*" %%A IN (`REG QUERY "HKCU\SOFTWARE%WOWRegistryAdjust%\Microsoft\VisualStudio\8.0%RootSuffix%" /v "VisualStudioLocation"`) DO call set VSFileLocation=%%B +FOR /F "usebackq eol=! tokens=2*" %%A IN (`REG QUERY "HKCU\SOFTWARE\Microsoft\VisualStudio\8.0%RootSuffix%" /v "VisualStudioLocation"`) DO call set VSFileLocation=%%B if not exist "%VSFileLocation%\Addins" (md "%VSFileLocation%\Addins") del /F "%VSFileLocation%\Addins\%TestAddin%.Addin" 1>NUL 2>&1 @@ -48,22 +52,22 @@ call:RestoreDir %UserSettingsDir%" "Backup" goto:eof ) -reg save HKCU\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\8.0%RootSuffix% "%~dp0CurrentUserSettings.hiv" 1>NUL +reg save HKCU\Software\Microsoft\VisualStudio\8.0%RootSuffix% "%~dp0CurrentUserSettings.hiv" 1>NUL REM Establish the test environment xcopy /y /q /e /d "%~dp0%CachedSettings%" "%UserSettingsDir%\" 1>NUL -reg delete HKCU\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\8.0%RootSuffix% /f 1>NUL 2>&1 -reg add HKCU\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\8.0%RootSuffix% 1>NUL -reg restore HKCU\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\8.0%RootSuffix% "%~dp0%CachedSettings%.hiv" 1>NUL +reg delete HKCU\Software\Microsoft\VisualStudio\8.0%RootSuffix% /f 1>NUL 2>&1 +reg add HKCU\Software\Microsoft\VisualStudio\8.0%RootSuffix% 1>NUL +reg restore HKCU\Software\Microsoft\VisualStudio\8.0%RootSuffix% "%~dp0%CachedSettings%.hiv" 1>NUL del /f "%~dp0%CachedSettings%.copy.vssettings" 1>NUL 2>&1 copy /y "%~dp0%CachedSettings%.vssettings" "%~dp0%CachedSettings%.copy.vssettings" 1>NUL -reg add HKCU\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\8.0%RootSuffix%\Profile /v AutoSaveFile /t REG_SZ /f /d "%~dp0%CachedSettings%.copy.vssettings" 1>NUL +reg add HKCU\Software\Microsoft\VisualStudio\8.0%RootSuffix%\Profile /v AutoSaveFile /t REG_SZ /f /d "%~dp0%CachedSettings%.copy.vssettings" 1>NUL REM Run VS once to make sure all directories are in line start /wait /min %LaunchDevenv%.exe /Command File.Exit /RootSuffix %RootSuffix% REM Install the add-in file so VS knows its there -FOR /F "usebackq eol=! tokens=2*" %%A IN (`REG QUERY "HKCU\SOFTWARE%WOWRegistryAdjust%\Microsoft\VisualStudio\8.0%RootSuffix%" /v "VisualStudioLocation"`) DO call set VSFileLocation=%%B +FOR /F "usebackq eol=! tokens=2*" %%A IN (`REG QUERY "HKCU\SOFTWARE\Microsoft\VisualStudio\8.0%RootSuffix%" /v "VisualStudioLocation"`) DO call set VSFileLocation=%%B SET InstallAddin="%VSFileLocation%\Addins\%TestAddin%.AddIn" type "%~dp0%TestAddin%\%TestAddin%.AddIn.start" > %InstallAddin% echo %~dp0%TestAddin%\bin\%TestAddin%.dll >> %InstallAddin% @@ -82,9 +86,9 @@ REM type "%TestLog%" REM Restore registry settings, application data, and .vssettings files -reg delete HKCU\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\8.0%RootSuffix% /f 1>NUL 2>&1 -reg add HKCU\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\8.0%RootSuffix% 1>NUL -reg restore HKCU\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\8.0%RootSuffix% "%~dp0CurrentUserSettings.hiv" 1>NUL +reg delete HKCU\Software\Microsoft\VisualStudio\8.0%RootSuffix% /f 1>NUL 2>&1 +reg add HKCU\Software\Microsoft\VisualStudio\8.0%RootSuffix% 1>NUL +reg restore HKCU\Software\Microsoft\VisualStudio\8.0%RootSuffix% "%~dp0CurrentUserSettings.hiv" 1>NUL del /f "%~dp0CurrentUserSettings.hiv" del /f "%~dp0%CachedSettings%.copy.vssettings" 1>NUL 2>&1 call:RestoreDir "%UserSettingsDir%" "Backup" Modified: trunk/TestSuites/RegressionTests/VSEnvironmentSnapshot.bat =================================================================== --- trunk/TestSuites/RegressionTests/VSEnvironmentSnapshot.bat 2012-09-10 23:19:43 UTC (rev 1491) +++ trunk/TestSuites/RegressionTests/VSEnvironmentSnapshot.bat 2012-10-04 01:16:54 UTC (rev 1492) @@ -7,15 +7,9 @@ if exist "%~dp0%BaseName%.vssettings" del /f "%~dp0%BaseName%.vssettings" if exist "%~dp0%BaseName%" rd /s /q "%~dp0%BaseName%" -IF "%ProgramFiles(X86)%"=="" ( - SET WOWRegistryAdjust= -) ELSE ( - SET WOWRegistryAdjust=\Wow6432Node -) - -FOR /F "usebackq eol=! tokens=2*" %%A IN (`REG QUERY "HKCU\SOFTWARE%WOWRegistryAdjust%\Microsoft\VisualStudio\8.0%RootSuffix%" /v "VisualStudioLocation"`) DO call set VSFileLocation=%%B -reg save HKCU\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\8.0%RootSuffix% "%~dp0%BaseName%.hiv" 1>NUL -FOR /F "usebackq eol=! tokens=2* delims=%%" %%A IN (`REG QUERY "HKCU\SOFTWARE%WOWRegistryAdjust%\Microsoft\VisualStudio\8.0%RootSuffix%\Profile" /v "AutoSaveFile"`) DO ( +FOR /F "usebackq eol=! tokens=2*" %%A IN (`REG QUERY "HKCU\SOFTWARE\Microsoft\VisualStudio\8.0%RootSuffix%" /v "VisualStudioLocation"`) DO call set VSFileLocation=%%B +reg save HKCU\Software\Microsoft\VisualStudio\8.0%RootSuffix% "%~dp0%BaseName%.hiv" 1>NUL +FOR /F "usebackq eol=! tokens=2* delims=%%" %%A IN (`REG QUERY "HKCU\SOFTWARE\Microsoft\VisualStudio\8.0%RootSuffix%\Profile" /v "AutoSaveFile"`) DO ( copy /y "%VSFileLocation%%%B" "%~dp0%BaseName%.vssettings" 1>NUL ) xcopy /y /q /e /d "%AppData%\Microsoft\VisualStudio\8.0%RootSuffix%" "%~dp0%BaseName%\" 1>NUL Modified: trunk/Tools/DisableRuleDirectiveProcessor/Install.bat =================================================================== --- trunk/Tools/DisableRuleDirectiveProcessor/Install.bat 2012-09-10 23:19:43 UTC (rev 1491) +++ trunk/Tools/DisableRuleDirectiveProcessor/Install.bat 2012-10-04 01:16:54 UTC (rev 1492) @@ -15,7 +15,7 @@ GOTO:EOF :_AddTextTemplateReg -REG ADD "%~1\%VSRegistryRootBase%\%~2\TextTemplating\DirectiveProcessors\%~3" /f /ve /d "A directive processor that disables Rules." -REG ADD "%~1\%VSRegistryRootBase%\%~2\TextTemplating\DirectiveProcessors\%~3" /f /v "Class" /d "Neumont.Tools.Modeling.%~3" -REG ADD "%~1\%VSRegistryRootBase%\%~2\TextTemplating\DirectiveProcessors\%~3" /f /v "Assembly" /d "Neumont.Tools.Modeling.DisableRuleDirectiveProcessor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=957d5b7d5e79e25f" +REG ADD "%~1\%VSRegistryConfigRootBase%\%~2\TextTemplating\DirectiveProcessors\%~3" /f /ve /d "A directive processor that disables Rules." +REG ADD "%~1\%VSRegistryConfigRootBase%\%~2\TextTemplating\DirectiveProcessors\%~3" /f /v "Class" /d "Neumont.Tools.Modeling.%~3" +REG ADD "%~1\%VSRegistryConfigRootBase%\%~2\TextTemplating\DirectiveProcessors\%~3" /f /v "Assembly" /d "Neumont.Tools.Modeling.DisableRuleDirectiveProcessor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=957d5b7d5e79e25f" GOTO:EOF Modified: trunk/Tools/NUBuildVS/Install.bat =================================================================== --- trunk/Tools/NUBuildVS/Install.bat 2012-09-10 23:19:43 UTC (rev 1491) +++ trunk/Tools/NUBuildVS/Install.bat 2012-10-04 01:16:54 UTC (rev 1492) @@ -7,9 +7,9 @@ :: for there to be parentheses in the %VSIPDir% path (and there are by default on x64), which :: causes a syntax error. Therefore, we leave the parentheses off here. IF /I "%TargetVisualStudioVersion%"=="v8.0" ( - IF EXIST "%VSIPDir%\Prerelease\VSCT" SET VsSDKVsctDir=%VSIPDir%\Prerelease\VSCT + IF EXIST "%VSIPDir%\Prerelease\VSCT" CALL:SETVAR "VsSDKVsctDir" "%VSIPDir%\Prerelease\VSCT" ) -IF NOT DEFINED VsSDKVsctDir SET VsSDKVsctDir=%VSIPDir%\VisualStudioIntegration\Tools\Bin +IF NOT DEFINED VsSDKVsctDir CALL:SETVAR "VsSDKVsctDir" "%VSIPDir%\VisualStudioIntegration\Tools\Bin" :: GAC the VSCT compiler so that we can use it. gacutil.exe /nologo /f /i "%VsSDKVsctDir%\VSCTCompress.dll" @@ -38,3 +38,7 @@ IF ERRORLEVEL 1 %COMSPEC% /c GOTO:EOF + +:SETVAR +SET %~1=%~2 +GOTO:EOF Modified: trunk/install.bat =================================================================== --- trunk/install.bat 2012-09-10 23:19:43 UTC (rev 1491) +++ trunk/install.bat 2012-10-04 01:16:54 UTC (rev 1492) @@ -2,7 +2,11 @@ SETLOCAL SET RootDir=%~dp0. IF NOT "%~2"=="" (SET TargetVisualStudioVersion=%~2) -CALL "%RootDir%\SetupEnvironment.bat" %* +CALL "%RootDir%\SetupEnvironment.bat" +IF NOT EXIST "%RootDir%\Version.bat" ( + CALL:_GenerateVersion +) +CALL "%RootDir%\Version.bat" %* IF "%VSIXInstallDir%"=="" ( IF EXIST "%OldNORMADir%\bin\Neumont.Tools.ORM.dll" (%RegPkg% /unregister "%NORMADir%\bin\Neumont.Tools.ORM.dll") @@ -150,6 +154,7 @@ XCOPY /Y /D /V /Q "%RootDir%\VSIXInstall\%TargetVisualStudioShortProductName%\ORMDesigner.pkgdef" "%VSIXInstallDir%\" XCOPY /Y /D /V /Q "%RootDir%\VSIXInstall\ORMDesignerIcon.png" "%VSIXInstallDir%\" XCOPY /Y /D /V /Q "%RootDir%\VSIXInstall\ORMDesignerPreview.png" "%VSIXInstallDir%\" + REG ADD "%VSRegistryConfigHive%\%VSRegistryConfigRootBase%\%VSRegistryRootVersion%%VSRegistryRootSuffix%\ExtensionManager\EnabledExtensions" /v "efddc549-1646-4451-8a51-e5a5e94d647c,%ProductMajorVersion%.%ProductMinorVersion%" /d "%VSIXInstallDir%\\" /f 1>NUL ) REG ADD "%DesignerRegistryRoot%\DesignerSettings\Core" /v "SettingsFile" /d "%NORMADir%\Xml\ORMDesignerSettings.xml" /f 1>NUL @@ -163,7 +168,7 @@ REG ADD "HKCR\ormfile" /ve /d "Object-Role Modeling File" /f 1>NUL REG ADD "HKCR\ormfile\DefaultIcon" /ve /d "%NORMADir%\bin\%TargetBaseName%.dll,0" /f 1>NUL REG ADD "HKCR\ormfile\shell\open" /ve /d "&Open" /f 1>NUL - REG ADD "HKCR\ormfile\shell\open\command" /ve /d "\"%VSEnvironmentPath%\" /RootSuffix \"%VSRegistryRootSuffix%\" /dde" /f 1>NUL + CALL:_SetShellCommand REG ADD "HKCR\ormfile\shell\open\ddeexec" /ve /d "Open(\"%%1\")" /f 1>NUL REG ADD "HKCR\ormfile\shell\open\ddeexec\application" /ve /d "VisualStudio.%TargetVisualStudioMajorMinorVersion%" /f 1>NUL REG ADD "HKCR\ormfile\shell\open\ddeexec\topic" /ve /d "system" /f 1>NUL @@ -174,6 +179,10 @@ GOTO:EOF +:_SetShellCommand +::Hack to handle parentheses in environment path +REG ADD "HKCR\ormfile\shell\open\command" /ve /d "\"%VSEnvironmentPath%\" /RootSuffix \"%VSRegistryRootSuffix%\" /dde" /f 1>NUL +GOTO:EOF :_MakeDir IF NOT EXIST "%~1" (MKDIR "%~1") @@ -195,3 +204,7 @@ :_CleanupFile IF EXIST "%~1" (DEL /F /Q "%~1") GOTO:EOF + +:_GenerateVersion +"%RootDir%\VersionGenerator.exe" +GOTO:EOF \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2012-09-10 23:19:49
|
Revision: 1491 http://orm.svn.sourceforge.net/orm/?rev=1491&view=rev Author: mcurland Date: 2012-09-10 23:19:43 +0000 (Mon, 10 Sep 2012) Log Message: ----------- Set comparison constraint paired columns in non-joined rows did not pair compatible but unequal variables. 'some A that is that B' was rendered incorrectly as 'some A'. Bug introduced in [1490] Modified Paths: -------------- trunk/ORMModel/ObjectModel/Verbalization.cs Modified: trunk/ORMModel/ObjectModel/Verbalization.cs =================================================================== --- trunk/ORMModel/ObjectModel/Verbalization.cs 2012-09-08 03:59:31 UTC (rev 1490) +++ trunk/ORMModel/ObjectModel/Verbalization.cs 2012-09-10 23:19:43 UTC (rev 1491) @@ -8968,13 +8968,14 @@ } if (joinToVariable != null) { - if (joinedToCustomCorrelatedVariable && !existingVariable.IsCustomCorrelated) + if (joinedToExternalVariable && !existingVariable.IsExternalVariable) { + existingVariable.IsExternalVariable = true; CustomCorrelateVariables(joinToVariable, existingVariable); } - if (joinedToExternalVariable && !existingVariable.IsExternalVariable) + else if (joinedToCustomCorrelatedVariable && !existingVariable.IsCustomCorrelated) { - existingVariable.IsExternalVariable = true; + CustomCorrelateVariables(joinToVariable, existingVariable); } } existingVariable.Use(myLatestUsePhase, false); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2012-05-19 05:13:13
|
Revision: 1488 http://orm.svn.sourceforge.net/orm/?rev=1488&view=rev Author: mcurland Date: 2012-05-19 05:13:06 +0000 (Sat, 19 May 2012) Log Message: ----------- * Fix crash attempting to verbalizer internal uniqueness constraints with no roles. * Switch ORMBaseShape.DisplaysMultiplePresentations to IDisplayMultiplePresentations in diagram framework code. Enables 'select on other diagram' commands to work with any shape type. Modified Paths: -------------- trunk/ORMModel/Framework/Diagrams/MultiShapeUtility.cs trunk/ORMModel/ObjectModel/Constraint.cs trunk/ORMModel/ShapeModel/FactTypeShape.cs trunk/ORMModel/ShapeModel/ModelNoteShape.cs trunk/ORMModel/ShapeModel/ORMBaseShape.cs trunk/ORMModel/ShapeModel/ObjectTypeShape.cs trunk/ORMModel/Shell/ORMDesignerCommandManager.cs trunk/ORMModel/Shell/ORMModelBrowser.cs Modified: trunk/ORMModel/Framework/Diagrams/MultiShapeUtility.cs =================================================================== --- trunk/ORMModel/Framework/Diagrams/MultiShapeUtility.cs 2012-04-25 04:01:27 UTC (rev 1487) +++ trunk/ORMModel/Framework/Diagrams/MultiShapeUtility.cs 2012-05-19 05:13:06 UTC (rev 1488) @@ -1257,6 +1257,97 @@ return retVal ?? shape; } #endregion //Link Configuration + #region Utility Methods + /// <summary> + /// Determines if a the model element backing the shape element + /// is represented by a shape of the same type elsewhere in the presentation + /// layer. If a derived shape displays multiple presentations, they should + /// implement the<see cref="IDisplayMultiplePresentations"/> interface. + /// </summary> + public static bool ElementHasMultiplePresentations(ShapeElement shapeElement) + { + ModelElement modelElement; + if (null != shapeElement && + null != (modelElement = shapeElement.ModelElement)) + { + LinkedElementCollection<PresentationElement> presentationElements = PresentationViewsSubject.GetPresentation(modelElement); + int pelCount = presentationElements.Count; + if (pelCount != 0) + { + Partition shapePartition = shapeElement.Partition; + Type thisType = shapeElement.GetType(); + for (int i = 0; i < pelCount; ++i) + { + PresentationElement pel = presentationElements[i]; + if (shapeElement != pel && shapePartition == pel.Partition && thisType.IsAssignableFrom(pel.GetType())) + { + return true; + } + } + } + } + return false; + } + /// <summary> + /// Iterate shapes associated with a given element + /// </summary> + /// <param name="modelElement">The parent element to iterate. Can be <see langword="null"/> if <paramref name="shapeElement"/> is specified.</param> + /// <param name="shapeElement">The shape to reference. Can be <see langword="null"/> if <paramref name="modelElement"/> is specified.</param> + /// <param name="onePerDiagram">True to filter the shapes to one per diagram</param> + /// <param name="visitor">A <see cref="Predicate{ShapeElement}"/> callback. + /// Return <see langword="true"/> to continue iteration.</param> + public static void VisitAssociatedShapes(ModelElement modelElement, ShapeElement shapeElement, bool onePerDiagram, Predicate<ShapeElement> visitor) + { + if (modelElement == null && shapeElement != null) + { + modelElement = shapeElement.ModelElement; + } + if (modelElement != null) + { + LinkedElementCollection<PresentationElement> presentationElements = PresentationViewsSubject.GetPresentation(modelElement); + int pelCount = presentationElements.Count; + if (pelCount != 0) + { + List<Diagram> visitedDiagrams = null; + Diagram visitedDiagram = null; + + Partition shapePartition = (shapeElement != null) ? shapeElement.Partition : modelElement.Partition; + Type thisType = (shapeElement != null) ? shapeElement.GetType() : typeof(ShapeElement); + for (int i = 0; i < pelCount; ++i) + { + PresentationElement pel = presentationElements[i]; + if (shapePartition == pel.Partition && thisType.IsAssignableFrom(pel.GetType())) + { + ShapeElement sel = pel as ShapeElement; + Diagram selDiagram = sel.Diagram; + if (!onePerDiagram || (visitedDiagram != selDiagram && (visitedDiagrams == null || !visitedDiagrams.Contains(selDiagram)))) + { + if (!visitor(sel)) + { + return; + } + if (onePerDiagram) + { + if (visitedDiagram == null) + { + visitedDiagram = selDiagram; + } + else + { + if (visitedDiagrams == null) + { + visitedDiagrams = new List<Diagram>(); + } + visitedDiagrams.Add(selDiagram); + } + } + } + } + } + } + } + } + #endregion // Utility Methods } #region Interfaces @@ -1349,5 +1440,15 @@ /// <returns>NodeShape</returns> NodeShape GetUniqueConnectorShape(ShapeElement oppositeShape, ModelElement ignoreLinkShapesFor); } + /// <summary> + /// Indicate that the shape changes its display when more + /// than one presentation is visible. Derived shapes should + /// use the <see cref="MultiShapeUtility.ElementHasMultiplePresentations"/> + /// method to determine when multiple presentations should be displayed. + /// </summary> + public interface IDisplayMultiplePresentations + { + // No methods + } #endregion //Interfaces } Modified: trunk/ORMModel/ObjectModel/Constraint.cs =================================================================== --- trunk/ORMModel/ObjectModel/Constraint.cs 2012-04-25 04:01:27 UTC (rev 1487) +++ trunk/ORMModel/ObjectModel/Constraint.cs 2012-05-19 05:13:06 UTC (rev 1488) @@ -7791,34 +7791,37 @@ #endregion // UniquenessConstraintChangeRule #region Verbalization /// <summary> - /// Helper function to defer mandatory verbalization by constraint arity + /// Helper function to defer uniqueness verbalization parts /// </summary> private void VerbalizeParts(TextWriter writer, IDictionary<Type, IVerbalizationSets> snippetsDictionary, IVerbalizationContext verbalizationContext, VerbalizationSign sign) { - UniquenessVerbalizerBase verbalize; - if ((bool)verbalizationContext.VerbalizationOptions[CoreVerbalizationOption.ShowDefaultConstraint]) + if (this.RoleCollection.Count != 0) { - verbalize = UniquenessPossibilityVerbalizer.GetVerbalizer(); - using ((IDisposable)verbalize) + UniquenessVerbalizerBase verbalize; + if ((bool)verbalizationContext.VerbalizationOptions[CoreVerbalizationOption.ShowDefaultConstraint]) { - verbalize.Initialize(this); - verbalizationContext.DeferVerbalization(verbalize, DeferVerbalizationOptions.None, null); + verbalize = UniquenessPossibilityVerbalizer.GetVerbalizer(); + using ((IDisposable)verbalize) + { + verbalize.Initialize(this); + verbalizationContext.DeferVerbalization(verbalize, DeferVerbalizationOptions.None, null); + } } - } - verbalize = UniquenessConstraintVerbalizer.GetVerbalizer(); - using ((IDisposable)verbalize) - { - verbalize.Initialize(this); - verbalizationContext.DeferVerbalization(verbalize, DeferVerbalizationOptions.None, null); - } - if (this.PreferredIdentifierFor != null) - { - verbalize = UniquenessPreferredVerbalizer.GetVerbalizer(); + verbalize = UniquenessConstraintVerbalizer.GetVerbalizer(); using ((IDisposable)verbalize) { verbalize.Initialize(this); verbalizationContext.DeferVerbalization(verbalize, DeferVerbalizationOptions.None, null); } + if (this.PreferredIdentifierFor != null) + { + verbalize = UniquenessPreferredVerbalizer.GetVerbalizer(); + using ((IDisposable)verbalize) + { + verbalize.Initialize(this); + verbalizationContext.DeferVerbalization(verbalize, DeferVerbalizationOptions.None, null); + } + } } } #region UniquenessVerbalizerBase class and partials for each mandatory classification Modified: trunk/ORMModel/ShapeModel/FactTypeShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/FactTypeShape.cs 2012-04-25 04:01:27 UTC (rev 1487) +++ trunk/ORMModel/ShapeModel/FactTypeShape.cs 2012-05-19 05:13:06 UTC (rev 1488) @@ -42,7 +42,7 @@ namespace ORMSolutions.ORMArchitect.Core.ShapeModel { #region FactTypeShape class - public partial class FactTypeShape : ICustomShapeFolding, IModelErrorActivation, IProvideConnectorShape, IProxyDisplayProvider, IRedirectVerbalization, IConfigureAsChildShape, IDynamicColorGeometryHost, IDynamicColorAlsoUsedBy, IConfigureableLinkEndpoint + public partial class FactTypeShape : ICustomShapeFolding, IModelErrorActivation, IProvideConnectorShape, IProxyDisplayProvider, IRedirectVerbalization, IConfigureAsChildShape, IDynamicColorGeometryHost, IDynamicColorAlsoUsedBy, IConfigureableLinkEndpoint, IDisplayMultiplePresentations { #region ConstraintBoxRoleActivity enum /// <summary> @@ -3280,20 +3280,10 @@ { get { - return OptionsPage.CurrentDisplayShadows && ORMBaseShape.ElementHasMultiplePresentations(this); + return OptionsPage.CurrentDisplayShadows && MultiShapeUtility.ElementHasMultiplePresentations(this); } } /// <summary> - /// Support automatic appearance updating when multiple presentations are present. - /// </summary> - public override bool DisplaysMultiplePresentations - { - get - { - return true; - } - } - /// <summary> /// Always highlight /// </summary> public override bool HasHighlighting Modified: trunk/ORMModel/ShapeModel/ModelNoteShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/ModelNoteShape.cs 2012-04-25 04:01:27 UTC (rev 1487) +++ trunk/ORMModel/ShapeModel/ModelNoteShape.cs 2012-05-19 05:13:06 UTC (rev 1488) @@ -32,7 +32,7 @@ namespace ORMSolutions.ORMArchitect.Core.ShapeModel { #region ModelNoteShape class - public partial class ModelNoteShape : IConfigureAsChildShape, IDynamicColorGeometryHost + public partial class ModelNoteShape : IConfigureAsChildShape, IDynamicColorGeometryHost, IDisplayMultiplePresentations { private static AutoSizeTextField myTextField; // Now combined in DSL InitialWidth and InitialHeight @@ -99,20 +99,10 @@ { get { - return OptionsPage.CurrentDisplayShadows && ORMBaseShape.ElementHasMultiplePresentations(this); + return OptionsPage.CurrentDisplayShadows && MultiShapeUtility.ElementHasMultiplePresentations(this); } } /// <summary> - /// Support automatic appearance updating when multiple presentations are present. - /// </summary> - public override bool DisplaysMultiplePresentations - { - get - { - return true; - } - } - /// <summary> /// Connect lines to the edge of the rectangular shape /// </summary> public override ShapeGeometry ShapeGeometry Modified: trunk/ORMModel/ShapeModel/ORMBaseShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/ORMBaseShape.cs 2012-04-25 04:01:27 UTC (rev 1487) +++ trunk/ORMModel/ShapeModel/ORMBaseShape.cs 2012-05-19 05:13:06 UTC (rev 1488) @@ -98,95 +98,6 @@ #endregion // MultipleShapesSupport #region Customize appearance /// <summary> - /// Determines if a the model element backing the shape element - /// is represented by a shape of the same type elsewhere in the presentation - /// layer. If a derived shape displays multiple presentations, they should - /// also override the <see cref="DisplaysMultiplePresentations"/> property. - /// </summary> - public static bool ElementHasMultiplePresentations(ShapeElement shapeElement) - { - ModelElement modelElement; - if (null != shapeElement && - null != (modelElement = shapeElement.ModelElement)) - { - LinkedElementCollection<PresentationElement> presentationElements = PresentationViewsSubject.GetPresentation(modelElement); - int pelCount = presentationElements.Count; - if (pelCount != 0) - { - Partition shapePartition = shapeElement.Partition; - Type thisType = shapeElement.GetType(); - for (int i = 0; i < pelCount; ++i) - { - PresentationElement pel = presentationElements[i]; - if (shapeElement != pel && shapePartition == pel.Partition && thisType.IsAssignableFrom(pel.GetType())) - { - return true; - } - } - } - } - return false; - } - /// <summary> - /// Iterate shapes associated with a given element - /// </summary> - /// <param name="modelElement">The parent element to iterate. Can be <see langword="null"/> if <paramref name="shapeElement"/> is specified.</param> - /// <param name="shapeElement">The shape to reference. Can be <see langword="null"/> if <paramref name="modelElement"/> is specified.</param> - /// <param name="onePerDiagram">True to filter the shapes to one per diagram</param> - /// <param name="visitor">A <see cref="Predicate{ShapeElement}"/> callback. - /// Return <see langword="true"/> to continue iteration.</param> - public static void VisitAssociatedShapes(ModelElement modelElement, ShapeElement shapeElement, bool onePerDiagram, Predicate<ShapeElement> visitor) - { - if (modelElement == null && shapeElement != null) - { - modelElement = shapeElement.ModelElement; - } - if (modelElement != null) - { - LinkedElementCollection<PresentationElement> presentationElements = PresentationViewsSubject.GetPresentation(modelElement); - int pelCount = presentationElements.Count; - if (pelCount != 0) - { - List<Diagram> visitedDiagrams = null; - Diagram visitedDiagram = null; - - Partition shapePartition = (shapeElement != null) ? shapeElement.Partition : modelElement.Partition; - Type thisType = (shapeElement != null) ? shapeElement.GetType() : typeof(ShapeElement); - for (int i = 0; i < pelCount; ++i) - { - PresentationElement pel = presentationElements[i]; - if (shapePartition == pel.Partition && thisType.IsAssignableFrom(pel.GetType())) - { - ShapeElement sel = pel as ShapeElement; - Diagram selDiagram = sel.Diagram; - if (!onePerDiagram || (visitedDiagram != selDiagram && (visitedDiagrams == null || !visitedDiagrams.Contains(selDiagram)))) - { - if (!visitor(sel)) - { - return; - } - if (onePerDiagram) - { - if (visitedDiagram == null) - { - visitedDiagram = selDiagram; - } - else - { - if (visitedDiagrams == null) - { - visitedDiagrams = new List<Diagram>(); - } - visitedDiagrams.Add(selDiagram); - } - } - } - } - } - } - } - } - /// <summary> /// Turn off the shadow by default /// </summary> /// <value>false</value> @@ -195,20 +106,6 @@ get { return false; } } /// <summary> - /// Indicate that the shape changes its display when more - /// than one presentation is visible. Derived shapes should - /// use the <see cref="ElementHasMultiplePresentations"/> method - /// to determine when multiple presentations should be displayed. - /// Default is <see langword="false"/> - /// </summary> - public virtual bool DisplaysMultiplePresentations - { - get - { - return false; - } - } - /// <summary> /// Default to no sides being resizable. /// </summary> public override NodeSides ResizableSides @@ -552,7 +449,7 @@ { ORMBaseShape shape = e.ModelElement as ORMBaseShape; ModelElement backingElement; - if (shape.DisplaysMultiplePresentations && + if (shape is IDisplayMultiplePresentations && null != (backingElement = shape.ModelElement)) { InvalidateRemainingShapes(backingElement, shape); @@ -561,16 +458,14 @@ private static void ShapeDeletedEvent(object sender, ElementDeletedEventArgs e) { PresentationViewsSubject link = e.ModelElement as PresentationViewsSubject; - ORMBaseShape shape; ModelElement backingElement; if (!(backingElement = link.Subject).IsDeleted && - null != (shape = link.Presentation as ORMBaseShape) && - shape.DisplaysMultiplePresentations) + link.Presentation is IDisplayMultiplePresentations) { InvalidateRemainingShapes(backingElement, null); } } - private static void InvalidateRemainingShapes(ModelElement backingElement, ORMBaseShape ignoreShape) + private static void InvalidateRemainingShapes(ModelElement backingElement, ShapeElement ignoreShape) { LinkedElementCollection<PresentationElement> pels = PresentationViewsSubject.GetPresentation(backingElement); int pelCount = pels.Count; @@ -579,9 +474,10 @@ for (int i = 0; i < pelCount; ++i) { PresentationElement pel = pels[i]; - ORMBaseShape updateShape; + ShapeElement updateShape; if (pel != ignoreShape && - null != (updateShape = pel as ORMBaseShape)) + null != (updateShape = pel as ShapeElement) && + updateShape is IDisplayMultiplePresentations) { updateShape.Invalidate(); } Modified: trunk/ORMModel/ShapeModel/ObjectTypeShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/ObjectTypeShape.cs 2012-04-25 04:01:27 UTC (rev 1487) +++ trunk/ORMModel/ShapeModel/ObjectTypeShape.cs 2012-05-19 05:13:06 UTC (rev 1488) @@ -36,7 +36,7 @@ namespace ORMSolutions.ORMArchitect.Core.ShapeModel { - public partial class ObjectTypeShape : IModelErrorActivation, IDynamicColorGeometryHost, IDynamicColorAlsoUsedBy, IConfigureableLinkEndpoint + public partial class ObjectTypeShape : IModelErrorActivation, IDynamicColorGeometryHost, IDynamicColorAlsoUsedBy, IConfigureableLinkEndpoint, IDisplayMultiplePresentations { #region Member Variables private static AutoSizeTextField myTextShapeField; @@ -104,20 +104,10 @@ { get { - return OptionsPage.CurrentDisplayShadows && ORMBaseShape.ElementHasMultiplePresentations(this); + return OptionsPage.CurrentDisplayShadows && MultiShapeUtility.ElementHasMultiplePresentations(this); } } /// <summary> - /// Support automatic appearance updating when multiple presentations are present. - /// </summary> - public override bool DisplaysMultiplePresentations - { - get - { - return true; - } - } - /// <summary> /// Switch between the standard solid pen and /// a dashed pen depending on the objectification settings /// </summary> Modified: trunk/ORMModel/Shell/ORMDesignerCommandManager.cs =================================================================== --- trunk/ORMModel/Shell/ORMDesignerCommandManager.cs 2012-04-25 04:01:27 UTC (rev 1487) +++ trunk/ORMModel/Shell/ORMDesignerCommandManager.cs 2012-05-19 05:13:06 UTC (rev 1488) @@ -34,6 +34,7 @@ using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Shell.Interop; using ORMSolutions.ORMArchitect.Framework; +using ORMSolutions.ORMArchitect.Framework.Diagrams; using ORMSolutions.ORMArchitect.Framework.Design; using ORMSolutions.ORMArchitect.Core.ObjectModel; using ORMSolutions.ORMArchitect.Core.ObjectModel.Design; @@ -978,10 +979,10 @@ toleratedCommands |= ORMDesignerCommands.AlignShapes; } } - ORMBaseShape shape; - if (null != (shape = (presentationElement as ORMBaseShape)) && - shape.DisplaysMultiplePresentations && - ORMBaseShape.ElementHasMultiplePresentations(shape)) + ShapeElement shape; + if (null != (shape = presentationElement as ShapeElement) && + shape is IDisplayMultiplePresentations && + MultiShapeUtility.ElementHasMultiplePresentations(shape)) { visibleCommands |= ORMDesignerCommands.DiagramList; enabledCommands |= ORMDesignerCommands.DiagramList; @@ -2797,7 +2798,7 @@ // other shapes on the first diagram ShapeElement firstShape = null; bool seenCurrent = false; - ORMBaseShape.VisitAssociatedShapes( + MultiShapeUtility.VisitAssociatedShapes( null, shape, false, @@ -2841,17 +2842,19 @@ IList selectedElements = myDesignerView.SelectedElements; if (selectedElements.Count >= 1) // Single-select command { - ORMBaseShape shape = selectedElements[0] as ORMBaseShape; - if (shape != null) + ShapeElement shape = selectedElements[0] as ShapeElement; + if (shape != null && + shape is IDisplayMultiplePresentations) { Diagram shapeDiagram = shape.Diagram; - ORMBaseShape.VisitAssociatedShapes( + MultiShapeUtility.VisitAssociatedShapes( null, shape, true, delegate(ShapeElement testShape) { - if (testShape.Diagram != shapeDiagram) + if (testShape.Diagram != shapeDiagram && + testShape is IDisplayMultiplePresentations) { if (diagramIndex == 0) { Modified: trunk/ORMModel/Shell/ORMModelBrowser.cs =================================================================== --- trunk/ORMModel/Shell/ORMModelBrowser.cs 2012-04-25 04:01:27 UTC (rev 1487) +++ trunk/ORMModel/Shell/ORMModelBrowser.cs 2012-05-19 05:13:06 UTC (rev 1488) @@ -33,6 +33,7 @@ using Microsoft.VisualStudio.VirtualTreeGrid; using ORMSolutions.ORMArchitect.Framework; using ORMSolutions.ORMArchitect.Framework.Design; +using ORMSolutions.ORMArchitect.Framework.Diagrams; using ORMSolutions.ORMArchitect.Framework.Shell; using ORMSolutions.ORMArchitect.Framework.Shell.DynamicSurveyTreeGrid; using ORMSolutions.ORMArchitect.Core.ObjectModel; @@ -173,7 +174,7 @@ null != (element = selectedNode as ModelElement)) { int diagramIndex = cmd.MatchedCommandId; - ORMBaseShape.VisitAssociatedShapes( + MultiShapeUtility.VisitAssociatedShapes( element, null, true, @@ -669,7 +670,7 @@ null != (element = elementReference.ReferencedElement as ModelElement) : null != (element = selectedNode as ModelElement)) { - ORMBaseShape.VisitAssociatedShapes( + MultiShapeUtility.VisitAssociatedShapes( element, null, true, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2012-04-25 04:01:34
|
Revision: 1487 http://orm.svn.sourceforge.net/orm/?rev=1487&view=rev Author: mcurland Date: 2012-04-25 04:01:27 +0000 (Wed, 25 Apr 2012) Log Message: ----------- * Modified automatic join path generation to check for shared-opposite-role-player cases for set comparison constraint sequences with 3 or more roles. * Check for and blocked invalid backtracking down previously pathed roles in linear automatic join path detection. Modified Paths: -------------- trunk/ORMModel/ObjectModel/Constraint.cs trunk/Setup/Readme.htm Modified: trunk/ORMModel/ObjectModel/Constraint.cs =================================================================== --- trunk/ORMModel/ObjectModel/Constraint.cs 2012-04-16 19:05:07 UTC (rev 1486) +++ trunk/ORMModel/ObjectModel/Constraint.cs 2012-04-25 04:01:27 UTC (rev 1487) @@ -4690,7 +4690,7 @@ /// </summary> private void ValidateJoinPath(INotifyElementAdded notifyAdded, bool verifyError, bool verifyAutomaticPath) { - bool checkBinaryOppositeRolePlayerPattern = false; + int checkBinaryOppositeRolePlayerPatternMinArity = int.MaxValue; bool joinNotNeeded = false; bool allowStepOverRolePlayer = true; IConstraint constraint = Constraint; @@ -4718,9 +4718,14 @@ break; case ConstraintType.Frequency: case ConstraintType.ExternalUniqueness: - checkBinaryOppositeRolePlayerPattern = true; + checkBinaryOppositeRolePlayerPatternMinArity = 1; allowStepOverRolePlayer = false; break; + case ConstraintType.Equality: + case ConstraintType.Exclusion: + case ConstraintType.Subset: + checkBinaryOppositeRolePlayerPatternMinArity = 3; + break; } } ConstraintRoleSequenceJoinPath joinPath = JoinPath; @@ -4742,6 +4747,7 @@ bool usesOppositeObjectification = false; #endif // BLOCK_TRIVIAL_JOINPATHS BitTracker usedObjectifyingRole = new BitTracker(constraintRoleCount); + bool checkBinaryOppositeRolePlayerPattern = constraintRoleCount >= checkBinaryOppositeRolePlayerPatternMinArity; for (int i = 1; i < constraintRoleCount; ++i) { Role currentRole = constraintRoles[i].Role; @@ -5047,6 +5053,7 @@ int constraintRoleCount = constraintRoles.Count; ConstraintRoleSequenceHasRole constraintRole = constraintRoles[0]; Role previousRole = constraintRole.Role; + Role otherRole; if (previousRole.RolePlayer == null) { if (existingJoinPath != null) @@ -5056,12 +5063,14 @@ return null; } List<AutomaticJoinPathData> pathData = new List<AutomaticJoinPathData>(3 * constraintRoleCount); // Plenty of space + Dictionary<Role, object> usedRoles = new Dictionary<Role, object>(); FactType previousFactType = previousRole.FactType; ObjectType previousFactTypeObjectifiedBy = previousFactType.NestingType; LinkedElementCollection<RoleBase> previousFactTypeRoles = null; int previousFactTypeRoleCount = 0; int? previousFactTypeUnaryRoleIndex = null; pathData.Add(new AutomaticJoinPathData(constraintRole, previousRole, PathedRolePurpose.PostInnerJoin)); + usedRoles[previousRole] = null; int lastFactTypeEntryIndex = 0; bool incompleteOrAmbiguousPath = false; BitTracker processedConstraintRoles = new BitTracker(constraintRoleCount); @@ -5082,6 +5091,7 @@ break; } pathData.Add(new AutomaticJoinPathData(constraintRole, currentRole, PathedRolePurpose.SameFactType)); + usedRoles[currentRole] = null; previousRole = currentRole; } else @@ -5136,13 +5146,16 @@ // context represents a use in the link fact type, not the objectified fact type, // so it needs to be repeated with a join. pathData.Add(new AutomaticJoinPathData(null, previousRole, PathedRolePurpose.PostInnerJoin)); + usedRoles[previousRole] = null; // Note that we do not need to deal with unary objectification here because // a unary fact type cannot have more than one constrained role. - pathData.Add(new AutomaticJoinPathData(null, previousRole.OppositeRoleAlwaysResolveProxy.Role, PathedRolePurpose.SameFactType)); + pathData.Add(new AutomaticJoinPathData(null, otherRole = previousRole.OppositeRoleAlwaysResolveProxy.Role, PathedRolePurpose.SameFactType)); + usedRoles[otherRole] = null; } // Shared role player from a SameFactTypeRole to a target. Note that a projection from a // PostInnerJoin will back up later to project from the start or entry role this is joined to. pathData.Add(new AutomaticJoinPathData(constraintRole, currentRole, PathedRolePurpose.PostInnerJoin)); + usedRoles[currentRole] = null; previousFactType = currentFactType; previousFactTypeObjectifiedBy = currentFactTypeObjectifiedBy; previousFactTypeRoles = null; // Also invalidates unary and count locals @@ -5234,12 +5247,15 @@ if (currentFactTypeUnaryRoleIndex.HasValue) { Role objectifiedUnaryRole = currentRole.ObjectifiedUnaryRole; - pathData.Add(new AutomaticJoinPathData(null, objectifiedUnaryRole.OppositeRole.Role, PathedRolePurpose.PostInnerJoin)); + pathData.Add(new AutomaticJoinPathData(null, otherRole = objectifiedUnaryRole.OppositeRole.Role, PathedRolePurpose.PostInnerJoin)); pathData.Add(new AutomaticJoinPathData(constraintRole, objectifiedUnaryRole, PathedRolePurpose.SameFactType)); + usedRoles[otherRole] = null; + usedRoles[objectifiedUnaryRole] = null; } else { - pathData.Add(new AutomaticJoinPathData(null, currentRole.OppositeRoleAlwaysResolveProxy.Role, PathedRolePurpose.PostInnerJoin)); + pathData.Add(new AutomaticJoinPathData(null, otherRole = currentRole.OppositeRoleAlwaysResolveProxy.Role, PathedRolePurpose.PostInnerJoin)); + usedRoles[otherRole] = null; if (constrainedRoleCountInCurrentFactType > 1) { // Step across the link fact type then join into the objectified fact type @@ -5251,11 +5267,13 @@ // Project directly on the link fact type pathData.Add(new AutomaticJoinPathData(constraintRole, currentRole, PathedRolePurpose.SameFactType)); } + usedRoles[currentRole] = null; } } else if (matchedRole == currentRole) // Unary case { pathData.Add(new AutomaticJoinPathData(constraintRole, currentRole, PathedRolePurpose.PostInnerJoin)); + usedRoles[currentRole] = null; } else { @@ -5264,8 +5282,10 @@ if (currentFactTypeUnaryRoleIndex.HasValue) { Role objectifiedUnaryRole = currentRole.ObjectifiedUnaryRole; - pathData.Add(new AutomaticJoinPathData(null, objectifiedUnaryRole.OppositeRole.Role, PathedRolePurpose.PostInnerJoin)); + pathData.Add(new AutomaticJoinPathData(null, otherRole = objectifiedUnaryRole.OppositeRole.Role, PathedRolePurpose.PostInnerJoin)); pathData.Add(new AutomaticJoinPathData(constraintRole, objectifiedUnaryRole, PathedRolePurpose.SameFactType)); + usedRoles[otherRole] = null; + usedRoles[objectifiedUnaryRole] = null; } else { @@ -5276,21 +5296,27 @@ // If only one role was used in the objectified fact type, then not adding an additional // join step switches the path to use the link fact type. pathData.Add(new AutomaticJoinPathData(null, previousRole, PathedRolePurpose.PostInnerJoin)); + usedRoles[previousRole] = null; } // Prepare to step into the next fact type and distinguish a step // in the link fact type from the objectified fact type by stepping // over the objectified role. - pathData.Add(new AutomaticJoinPathData(null, previousRole.OppositeRoleAlwaysResolveProxy.Role, PathedRolePurpose.SameFactType)); + pathData.Add(new AutomaticJoinPathData(null, otherRole = previousRole.OppositeRoleAlwaysResolveProxy.Role, PathedRolePurpose.SameFactType)); // Join with the current fact type pathData.Add(new AutomaticJoinPathData(null, matchedRole, PathedRolePurpose.PostInnerJoin)); // Project on the current role pathData.Add(new AutomaticJoinPathData(constraintRole, currentRole, PathedRolePurpose.SameFactType)); + usedRoles[otherRole] = null; + usedRoles[matchedRole] = null; + usedRoles[currentRole] = null; } } else { pathData.Add(new AutomaticJoinPathData(null, matchedRole, PathedRolePurpose.PostInnerJoin)); pathData.Add(new AutomaticJoinPathData(constraintRole, currentRole, PathedRolePurpose.SameFactType)); + usedRoles[matchedRole] = null; + usedRoles[currentRole] = null; } } previousFactType = currentFactType; @@ -5444,6 +5470,11 @@ incompleteOrAmbiguousPath = true; break; } + else if (usedRoles.ContainsKey(testLeftRole)) + { + // Don't allow backtracking in automatic join paths. + continue; + } if (currentFactTypeObjectifiedBy == testLeftRolePlayer) { if (matchedLeftRole == null && matchedRightRole == null) @@ -5562,7 +5593,7 @@ AutomaticJoinPathData unaryRoleData = pathData[replaceIndex]; unaryRoleData.Role = objectifiedUnaryRole; pathData[replaceIndex] = unaryRoleData; - pathData.Add(new AutomaticJoinPathData(null, objectifiedUnaryRole.OppositeRole.Role, PathedRolePurpose.SameFactType)); + pathData.Add(new AutomaticJoinPathData(null, otherRole = objectifiedUnaryRole.OppositeRole.Role, PathedRolePurpose.SameFactType)); } else { @@ -5571,18 +5602,22 @@ if (constrainedInPreviousFactTypeCount > 1) { pathData.Add(new AutomaticJoinPathData(null, previousRole, PathedRolePurpose.PostInnerJoin)); + usedRoles[previousRole] = null; } - pathData.Add(new AutomaticJoinPathData(null, previousRole.OppositeRoleAlwaysResolveProxy.Role, PathedRolePurpose.SameFactType)); + pathData.Add(new AutomaticJoinPathData(null, otherRole = previousRole.OppositeRoleAlwaysResolveProxy.Role, PathedRolePurpose.SameFactType)); } + usedRoles[otherRole] = null; } else if (!previousFactTypeUnaryRoleIndex.HasValue && matchedLeftRole != previousRole) { pathData.Add(new AutomaticJoinPathData(null, matchedLeftRole, PathedRolePurpose.SameFactType)); + usedRoles[matchedLeftRole] = null; } if (matchedRightRole == currentRole) { pathData.Add(new AutomaticJoinPathData(constraintRole, currentRole, PathedRolePurpose.PostInnerJoin)); + usedRoles[currentRole] = null; } else if (matchedRightRole != null) { @@ -5596,6 +5631,8 @@ pathData.Add(new AutomaticJoinPathData(null, matchedRightRole, PathedRolePurpose.PostInnerJoin)); } pathData.Add(new AutomaticJoinPathData(constraintRole, currentRole, PathedRolePurpose.SameFactType)); + usedRoles[matchedRightRole] = null; + usedRoles[currentRole] = null; } else { @@ -5609,13 +5646,16 @@ { // Objectified unary pattern Role objectifiedUnaryRole = currentRole.ObjectifiedUnaryRole; - pathData.Add(new AutomaticJoinPathData(null, objectifiedUnaryRole.OppositeRole.Role, PathedRolePurpose.PostInnerJoin)); + pathData.Add(new AutomaticJoinPathData(null, otherRole = objectifiedUnaryRole.OppositeRole.Role, PathedRolePurpose.PostInnerJoin)); pathData.Add(new AutomaticJoinPathData(constraintRole, objectifiedUnaryRole, PathedRolePurpose.SameFactType)); + usedRoles[otherRole] = null; + usedRoles[objectifiedUnaryRole] = null; } else { // Objectified binary or n-ary pattern - pathData.Add(new AutomaticJoinPathData(null, currentRole.OppositeRoleAlwaysResolveProxy.Role, PathedRolePurpose.PostInnerJoin)); + pathData.Add(new AutomaticJoinPathData(null, otherRole = currentRole.OppositeRoleAlwaysResolveProxy.Role, PathedRolePurpose.PostInnerJoin)); + usedRoles[otherRole] = null; if (constrainedRoleCountInCurrentFactType == 1) { pathData.Add(new AutomaticJoinPathData(constraintRole, currentRole, PathedRolePurpose.SameFactType)); @@ -5625,6 +5665,7 @@ pathData.Add(new AutomaticJoinPathData(null, currentRole, PathedRolePurpose.SameFactType)); pathData.Add(new AutomaticJoinPathData(constraintRole, currentRole, PathedRolePurpose.PostInnerJoin)); } + usedRoles[currentRole] = null; } } previousFactType = currentFactType; Modified: trunk/Setup/Readme.htm =================================================================== --- trunk/Setup/Readme.htm 2012-04-16 19:05:07 UTC (rev 1486) +++ trunk/Setup/Readme.htm 2012-04-25 04:01:27 UTC (rev 1487) @@ -45,7 +45,7 @@ <hr/> <h2>April 2012 CTP Changes</h2> -<div>The January 2012 CTP release includes all modifications through changeset 1486. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<div>The April 2012 CTP release includes all modifications through changeset 1487. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> <ul> <li><a href="#VerbalizePossiblePopulationsOption 2012-04">Verbalize possible populations option</a> </li> <li>Other Features: @@ -59,6 +59,7 @@ <ol> <li>Reloading a model with an unconstrained unary fact type would display a two-role fact type with no uniqueness constraints.</li> <li>Reloading a model with a collapsed shape for an objectified fact type (FactTypeShape.DisplayAsObjectType = true) would incorrectly add role name shapes to the collapsed shape.</li> +<li>Invalid automatic join paths could be created for set comparison constraint role sequences with a shared opposite role player and more than 2 roles. Fixed the invalid path generation by blocking back tracking in an automatic path and enabled opposite-shared-role-player detection for these cases.</li> </ol> </li> </ul> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2012-03-26 22:42:04
|
Revision: 1483 http://orm.svn.sourceforge.net/orm/?rev=1483&view=rev Author: mcurland Date: 2012-03-26 22:41:58 +0000 (Mon, 26 Mar 2012) Log Message: ----------- * Fix unconstrained unary fact types displaying as binary fact types on reload. * Fix role name shapes appearing for fact types displayed as object types on reload. * Add option in 'Appearance' category to not display shape shadows if shape appears more than once. Modified Paths: -------------- trunk/ORMModel/Resources/ResourceStrings.cs trunk/ORMModel/ShapeModel/FactTypeShape.cs trunk/ORMModel/ShapeModel/ModelNoteShape.cs trunk/ORMModel/ShapeModel/ORMDiagram.resx trunk/ORMModel/ShapeModel/ObjectTypeShape.cs trunk/ORMModel/ShapeModel/RoleNameShape.cs trunk/ORMModel/Shell/OptionsPage.cs Modified: trunk/ORMModel/Resources/ResourceStrings.cs =================================================================== --- trunk/ORMModel/Resources/ResourceStrings.cs 2012-01-23 19:35:08 UTC (rev 1482) +++ trunk/ORMModel/Resources/ResourceStrings.cs 2012-03-26 22:41:58 UTC (rev 1483) @@ -349,6 +349,14 @@ /// </summary> public const string OptionsPagePropertyRoleNameDisplayDisplayNameId = "OptionsPage.Property.RoleNameDisplay.DisplayName"; /// <summary> + /// Description of the Role Name Display option + /// </summary> + public const string OptionsPagePropertyDisplayShadowsDescriptionId = "OptionsPage.Property.DisplayShadows.Description"; + /// <summary> + /// Display Name of the Role Name Display option + /// </summary> + public const string OptionsPagePropertyDisplayShadowsDisplayNameId = "OptionsPage.Property.DisplayShadows.DisplayName"; + /// <summary> /// Description of the Primary Delete Behavior /// </summary> public const string OptionsPagePropertyPrimaryDeleteBehaviorDescriptionId = "OptionsPage.Property.PrimaryDeleteBehavior.Description"; Modified: trunk/ORMModel/ShapeModel/FactTypeShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/FactTypeShape.cs 2012-01-23 19:35:08 UTC (rev 1482) +++ trunk/ORMModel/ShapeModel/FactTypeShape.cs 2012-03-26 22:41:58 UTC (rev 1483) @@ -572,6 +572,10 @@ /// </summary> protected void ConfiguringAsChildOf(NodeShape parentShape, bool createdDuringViewFixup) { + EnsureUnaryRoleDisplayOrder(); + } + private void EnsureUnaryRoleDisplayOrder() + { // Make sure the factType shape is prepared to display as a unary FactType factType; Role unaryRole; @@ -3276,7 +3280,7 @@ { get { - return ORMBaseShape.ElementHasMultiplePresentations(this); + return OptionsPage.CurrentDisplayShadows && ORMBaseShape.ElementHasMultiplePresentations(this); } } /// <summary> @@ -6852,6 +6856,7 @@ /// </summary> protected sealed override void ProcessElement(FactTypeShape element, Store store, INotifyElementAdded notifyAdded) { + element.EnsureUnaryRoleDisplayOrder(); PointD centerPoint = RolesShape.GetBounds(element).Center; element.RolesPosition = (element.DisplayOrientation != DisplayOrientation.Horizontal) ? centerPoint.X : centerPoint.Y; } Modified: trunk/ORMModel/ShapeModel/ModelNoteShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/ModelNoteShape.cs 2012-01-23 19:35:08 UTC (rev 1482) +++ trunk/ORMModel/ShapeModel/ModelNoteShape.cs 2012-03-26 22:41:58 UTC (rev 1483) @@ -99,7 +99,7 @@ { get { - return ORMBaseShape.ElementHasMultiplePresentations(this); + return OptionsPage.CurrentDisplayShadows && ORMBaseShape.ElementHasMultiplePresentations(this); } } /// <summary> Modified: trunk/ORMModel/ShapeModel/ORMDiagram.resx =================================================================== --- trunk/ORMModel/ShapeModel/ORMDiagram.resx 2012-01-23 19:35:08 UTC (rev 1482) +++ trunk/ORMModel/ShapeModel/ORMDiagram.resx 2012-03-26 22:41:58 UTC (rev 1483) @@ -719,6 +719,14 @@ <value xml:space="preserve">Show Description Tooltips</value> <comment xml:space="preserve">The display name for the display definition tooltips property.</comment> </data> + <data name="OptionsPage.Property.DisplayShadows.Description"> + <value xml:space="preserve">Control if shape shadows are displayed when an element is represented by multiple shapes.</value> + <comment xml:space="preserve">The description for the Display Role Names option.</comment> + </data> + <data name="OptionsPage.Property.DisplayShadows.DisplayName"> + <value xml:space="preserve">Display Shadows</value> + <comment xml:space="preserve">The display name for the Display Shadows option.</comment> + </data> <data name="OptionsPage.Property.DelayActivateModelBrowserLabelEdits.Description"> <value xml:space="preserve">Automatically activate inline text editors in the ORM Model Browser after a short delay when selected with the mouse. Text edits can be explicitly activated with the View.EditLabel command (generally associated with the F2 key).</value> <comment xml:space="preserve">The delay activate model browser label edits description.</comment> Modified: trunk/ORMModel/ShapeModel/ObjectTypeShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/ObjectTypeShape.cs 2012-01-23 19:35:08 UTC (rev 1482) +++ trunk/ORMModel/ShapeModel/ObjectTypeShape.cs 2012-03-26 22:41:58 UTC (rev 1483) @@ -104,7 +104,7 @@ { get { - return ORMBaseShape.ElementHasMultiplePresentations(this); + return OptionsPage.CurrentDisplayShadows && ORMBaseShape.ElementHasMultiplePresentations(this); } } /// <summary> Modified: trunk/ORMModel/ShapeModel/RoleNameShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/RoleNameShape.cs 2012-01-23 19:35:08 UTC (rev 1482) +++ trunk/ORMModel/ShapeModel/RoleNameShape.cs 2012-03-26 22:41:58 UTC (rev 1483) @@ -262,21 +262,10 @@ FactTypeShape fts = element as FactTypeShape; if (fts != null) { - bool shouldDisplay = false; - bool shouldRemove = false; - if (fts.DisplayRoleNames == DisplayRoleNames.UserDefault - && OptionsPage.CurrentRoleNameDisplay == RoleNameDisplay.On) - { - shouldDisplay = true; - } - else if (fts.DisplayRoleNames == DisplayRoleNames.On) - { - shouldDisplay = true; - } - else if (fts.DisplayRoleNames == DisplayRoleNames.Off) - { - shouldRemove = true; - } + DisplayRoleNames display = fts.DisplayRoleNames; + bool asObjectType = fts.DisplayAsObjectType; + bool shouldDisplay = !asObjectType && display == DisplayRoleNames.On || (display == DisplayRoleNames.UserDefault && OptionsPage.CurrentRoleNameDisplay == RoleNameDisplay.On); + bool shouldRemove = asObjectType || display == DisplayRoleNames.Off; foreach (RoleBase roleBase in fact.RoleCollection) { Role role = roleBase as Role; Modified: trunk/ORMModel/Shell/OptionsPage.cs =================================================================== --- trunk/ORMModel/Shell/OptionsPage.cs 2012-01-23 19:35:08 UTC (rev 1482) +++ trunk/ORMModel/Shell/OptionsPage.cs 2012-03-26 22:41:58 UTC (rev 1483) @@ -351,6 +351,10 @@ private static RoleNameDisplay myCurrentRoleNameDisplay = RoleNameDisplay_Default; private RoleNameDisplay myRoleNameDisplay = RoleNameDisplay_Default; + private const bool DisplayShadows_Default = true; + private static bool myCurrentDisplayShadows = DisplayShadows_Default; + private bool myDisplayShadows = DisplayShadows_Default; + private const PortableDataType DefaultDataType_Default = PortableDataType.Unspecified; private static PortableDataType myCurrentDefaultDataType = DefaultDataType_Default; private PortableDataType myDefaultDataType = DefaultDataType_Default; @@ -449,6 +453,7 @@ myCurrentObjectifiedFactDisplayShape = myObjectifiedFactDisplayShape; myCurrentMandatoryDotPlacement = myMandatoryDotPlacement; myCurrentRoleNameDisplay = myRoleNameDisplay; + myCurrentDisplayShadows = myDisplayShadows; myCurrentDefaultDataType = myDefaultDataType; myCurrentExternalConstraintRoleBarDisplay = myExternalConstraintRoleBarDisplay; myCurrentPrimaryDeleteBehavior = myPrimaryDeleteBehavior; @@ -477,6 +482,7 @@ myObjectifiedFactDisplayShape = myCurrentObjectifiedFactDisplayShape; myMandatoryDotPlacement = myCurrentMandatoryDotPlacement; myRoleNameDisplay = myCurrentRoleNameDisplay; + myDisplayShadows = myCurrentDisplayShadows; myDefaultDataType = myCurrentDefaultDataType; myExternalConstraintRoleBarDisplay = myCurrentExternalConstraintRoleBarDisplay; myPrimaryDeleteBehavior = myCurrentPrimaryDeleteBehavior; @@ -512,6 +518,7 @@ myCurrentObjectifiedFactDisplayShape == myObjectifiedFactDisplayShape && myCurrentObjectTypeDisplayShape == myObjectTypeDisplayShape && myCurrentRoleNameDisplay == myRoleNameDisplay && + myCurrentDisplayShadows == myDisplayShadows && myCurrentExternalConstraintRoleBarDisplay == myExternalConstraintRoleBarDisplay && myCurrentPreferredInternalUniquenessConstraintDisplay == myPreferredInternalUniquenessConstraintDisplay && myCurrentReadingDirectionIndicatorDisplay == myReadingDirectionIndicatorDisplay && @@ -547,6 +554,7 @@ myCurrentObjectifiedFactDisplayShape = myObjectifiedFactDisplayShape; myCurrentObjectTypeDisplayShape = myObjectTypeDisplayShape; myCurrentRoleNameDisplay = myRoleNameDisplay; + myCurrentDisplayShadows = myDisplayShadows; myCurrentExternalConstraintRoleBarDisplay = myExternalConstraintRoleBarDisplay; myCurrentDefaultDataType = myDefaultDataType; myCurrentPrimaryDeleteBehavior = myPrimaryDeleteBehavior; @@ -720,6 +728,27 @@ } /// <summary> + /// Display of shape shadow + /// </summary> + [DefaultValue(DisplayShadows_Default)] + [LocalizedCategory(ResourceStrings.OptionsPageCategoryAppearanceId)] + [LocalizedDescription(ResourceStrings.OptionsPagePropertyDisplayShadowsDescriptionId)] + [LocalizedDisplayName(ResourceStrings.OptionsPagePropertyDisplayShadowsDisplayNameId)] + public bool DisplayShadows + { + get { return myDisplayShadows; } + set { myDisplayShadows = value; } + } + + /// <summary> + /// Current VS session-wide setting for DisplayShadows + /// </summary> + public static bool CurrentDisplayShadows + { + get { return myCurrentDisplayShadows; } + } + + /// <summary> /// Default data type for value types /// </summary> [DefaultValue(DefaultDataType_Default)] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2012-01-23 19:35:14
|
Revision: 1482 http://orm.svn.sourceforge.net/orm/?rev=1482&view=rev Author: mcurland Date: 2012-01-23 19:35:08 +0000 (Mon, 23 Jan 2012) Log Message: ----------- Objectifying unary and non-spanning binary fact types created phantom fact types shapes on unrelated diagrams * Remove most cases of fixing up parent shapes during link shape fixup (the parent shapes should be there already). This eliminates the unnecessary 'ShouldAddShapeForElement' requests that were allowing the phantom shape creation. * Add missing extender hooks to ShouldAddShapeForElement overrides Modified Paths: -------------- trunk/ORMModel/ShapeModel/FactTypeShape.cs trunk/ORMModel/ShapeModel/ObjectTypeShape.cs trunk/ORMModel/ShapeModel/ViewFixupRules.cs trunk/Setup/Readme.htm Modified: trunk/ORMModel/ShapeModel/FactTypeShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/FactTypeShape.cs 2012-01-17 04:23:16 UTC (rev 1481) +++ trunk/ORMModel/ShapeModel/FactTypeShape.cs 2012-01-23 19:35:08 UTC (rev 1482) @@ -4056,18 +4056,14 @@ // Support ValueType objectification return valueTypeValueConstraint.ValueType == objectType; } + else if (element is ObjectType || element is ReadingOrder) + { + return false; + } } - return false; } - if (null != (objectType = element as ObjectType)) + if (null != (readingOrder = element as ReadingOrder)) { - if (objectType.NestedFactType != AssociatedFactType) - { - return false; - } - } - else if (null != (readingOrder = element as ReadingOrder)) - { if (readingOrder.FactType != AssociatedFactType) { return false; @@ -4080,6 +4076,7 @@ return false; } } + return true; } else if (null != (role = element as Role)) { @@ -4093,14 +4090,26 @@ } return !string.IsNullOrEmpty(role.Name) && (role != AssociatedFactType.ImplicitBooleanRole); } + else if (null != (objectType = element as ObjectType)) + { + return objectType.NestedFactType == AssociatedFactType; + } else if (null != (roleValueConstraint = element as RoleValueConstraint)) { - if (roleValueConstraint.Role.FactType != AssociatedFactType) + return roleValueConstraint.Role.FactType == AssociatedFactType; + } + IShapeExtender<FactTypeShape>[] extenders = ((IFrameworkServices)Store).GetTypedDomainModelProviders<IShapeExtender<FactTypeShape>>(); + if (extenders != null) + { + for (int i = 0; i < extenders.Length; ++i) { - return false; + if (extenders[i].ShouldAddShapeForElement(this, element)) + { + return true; + } } } - return true; + return base.ShouldAddShapeForElement(element); } /// <summary> /// Makes an ObjectifiedFactTypeNameShape, ReadingShape, RoleNameShape, or ValueConstraintShape a @@ -6918,6 +6927,17 @@ return valueTypeValueConstraint.ValueType == objectType; } } + IShapeExtender<ObjectifiedFactTypeNameShape>[] extenders = ((IFrameworkServices)Store).GetTypedDomainModelProviders<IShapeExtender<ObjectifiedFactTypeNameShape>>(); + if (extenders != null) + { + for (int i = 0; i < extenders.Length; ++i) + { + if (extenders[i].ShouldAddShapeForElement(this, element)) + { + return true; + } + } + } return base.ShouldAddShapeForElement(element); } /// <summary> Modified: trunk/ORMModel/ShapeModel/ObjectTypeShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/ObjectTypeShape.cs 2012-01-17 04:23:16 UTC (rev 1481) +++ trunk/ORMModel/ShapeModel/ObjectTypeShape.cs 2012-01-23 19:35:08 UTC (rev 1482) @@ -388,6 +388,17 @@ refModeFactType == roleValueConstraint.Role.FactType; } } + IShapeExtender<ObjectTypeShape>[] extenders = ((IFrameworkServices)Store).GetTypedDomainModelProviders<IShapeExtender<ObjectTypeShape>>(); + if (extenders != null) + { + for (int i = 0; i < extenders.Length; ++i) + { + if (extenders[i].ShouldAddShapeForElement(this, element)) + { + return true; + } + } + } return base.ShouldAddShapeForElement(element); } /// <summary> Modified: trunk/ORMModel/ShapeModel/ViewFixupRules.cs =================================================================== --- trunk/ORMModel/ShapeModel/ViewFixupRules.cs 2012-01-17 04:23:16 UTC (rev 1481) +++ trunk/ORMModel/ShapeModel/ViewFixupRules.cs 2012-01-23 19:35:08 UTC (rev 1482) @@ -3,6 +3,7 @@ * Natural Object-Role Modeling Architect for Visual Studio * * * * Copyright \xA9 Neumont University. All rights reserved. * +* Copyright \xA9 ORM Solutions, LLC. All rights reserved. * * * * The use and distribution terms for this software are covered by the * * Common Public License 1.0 (http://opensource.org/licenses/cpl) which * @@ -671,25 +672,6 @@ { proxy = role.Proxy; associatedProxyFactType = (proxy != null) ? proxy.FactType : null; - FactType nestedFactType; - if (FactTypeShape.ShouldDrawObjectification(nestedFactType = rolePlayer.NestedFactType)) - { - if (AllowElementFixup(nestedFactType)) - { - Diagram.FixUpDiagram(model, nestedFactType); - } - Diagram.FixUpDiagram(nestedFactType, rolePlayer); - } - else if (AllowElementFixup(rolePlayer)) - { - Diagram.FixUpDiagram(model, rolePlayer); - } - if (AllowElementFixup(associatedFactType)) - { - Diagram.FixUpDiagram(model, associatedFactType); - } - // Do no fix up the link fact type (associatedProxyFactType). We never - // want to force link fact type element creation. object AllowMultipleShapes; Dictionary<object, object> topLevelContextInfo; @@ -812,10 +794,6 @@ ORMModel model = factType.Model; if (model != null) { - if (AllowElementFixup(factType)) - { - Diagram.FixUpDiagram(model, factType); - } Diagram.FixUpDiagram(factType, roleValueConstraint); object AllowMultipleShapes; @@ -902,10 +880,6 @@ if (null != (objectType = valueConstraint.ValueType) && null != (model = objectType.Model)) { - if (AllowElementFixup(objectType)) - { - Diagram.FixUpDiagram(model, objectType); - } Diagram.FixUpDiagram(objectType, valueConstraint); } } @@ -927,19 +901,6 @@ null != (objectType = uniquenessConstraint.PreferredIdentifierFor) && null != (model = objectType.Model)) { - FactType nestedFactType; - if (null != (nestedFactType = objectType.NestedFactType)) - { - if (AllowElementFixup(nestedFactType)) - { - Diagram.FixUpDiagram(model, nestedFactType); - } - Diagram.FixUpDiagram(nestedFactType, roleValueConstraint); // Handle fact type displayed as object type - } - else if (AllowElementFixup(objectType)) - { - Diagram.FixUpDiagram(model, objectType); - } Diagram.FixUpDiagram(objectType, roleValueConstraint); object AllowMultipleShapes; @@ -1109,11 +1070,6 @@ !((factType = link.FactType) is SubtypeFact) && null != (model = factType.Model)) { - if (AllowElementFixup(factType)) - { - Diagram.FixUpDiagram(model, factType); // Make sure the fact type is already there - } - object AllowMultipleShapes; Dictionary<object, object> topLevelContextInfo; bool containedAllowMultipleShapes; Modified: trunk/Setup/Readme.htm =================================================================== --- trunk/Setup/Readme.htm 2012-01-17 04:23:16 UTC (rev 1481) +++ trunk/Setup/Readme.htm 2012-01-23 19:35:08 UTC (rev 1482) @@ -44,7 +44,7 @@ <hr/> <h2>January 2012 CTP Changes</h2> -<div>The January 2012 CTP release includes all modifications through changeset 1481. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<div>The January 2012 CTP release includes all modifications through changeset 1482. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> <ul> <li><a href="#SchemaCustomization 2012-01">Custom relational names and column ordering</a> </li> <li><a href="#VerbalizedObjectTypeNameDisplay 2012-01">Verbalized object type name options</a> </li> @@ -63,6 +63,7 @@ <li>The Length property was available with a column selection for the Picture and OleObject data types, which do not support this facet.</li> <li>The data type for a column associated with a unary fact type is now read-only to avoid unwanted side-effects caused by modifying this data type.</li> <li>Fix issues with excessive model churn and extra shapes appearing when a reference mode format string is modified.</li> +<li>Fix issue where objectifying a unary or binary fact type without a spanning uniqueness constraint would extra shapes on all diagrams without the fact type.</li> </ol> </li> </ul> @@ -747,7 +748,7 @@ <hr/> <h3><a id="Version Numbers">Version Numbers</a></h3> <p>The NORMA version numbering scheme was changed in January 2011 to make better use of the available build numbers. A build number (for example, 1.0.1106.6281) has four parts separated by periods (.): Major (1), Minor (0), Revision (1106), and Build (6281). The major and minor numbers are self-explanatory. The third <em>revision</em> number is the last two digits of the year combined with the month number (1106=June 2011). The revision number is explicitly configured in the source code and generally changed once per official release. The final number is a build number that encodes the day the file was built.</p> -<p>Originally, the first two digits of the build number were a month counter beginning at 01 in January 2006, with the last two digits representing the day in the month. So, build 6031 was created on day 31 of month 60 (December 31, 2010). Starting with January 2011 (month 61), the first two digits will only be incremented on a <strong>quarterly</strong> basis, effectively tripling the available remaining revision 4-digit revision numbers. Of course, the day numbers for the three months in a quarter cannot all begin with '1', so we partition as follows:</p> +<p>Originally, the first two digits of the build number were a month counter beginning at 01 in January 2006, with the last two digits representing the day in the month. So, build 6031 was created on day 31 of month 60 (December 31, 2010). Starting with January 2011 (month 61), the first two digits will only be incremented on a <strong>quarterly</strong> basis, effectively tripling the available remaining 4-digit revision numbers. Of course, the day numbers for the three months in a quarter cannot all begin with '1', so we partition as follows:</p> <ul> <li>The first month in each quarter (January, April, July, October) gets the range 1-31 (subtract 0 to get the day).</li> <li>The second month in each quarter (February, May, August, November) gets the range 34-64 (subtract 33 to get the day).</li> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |