in

The ORM Foundation

Get the facts!

adding norma items to vs10 *.modelproj items set

Last post Tue, Jan 18 2011 1:53 by Matthew Curland. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • Thu, Jan 13 2011 2:56

    • robertob
    • Top 150 Contributor
    • Joined on Mon, Jan 10 2011
    • Posts 3

    adding norma items to vs10 *.modelproj items set

    This natural object role modeling architecture extension for vs10 is currently accessible form the context of a class library project when i use
    < project > | add | new item | visual c# items | general | object-role modeling file & object-role modeling (db import).   Since this
    extension is about creating and maintaining model artifacts could you do what is necessary in the installer to have it also, or instead, show up under vs10 modeling projects | modeling project | | add | new item list so that the artifacts can be maintained in a *.modelproj along side the out of the box provided uml diagram offerings.
  • Sat, Jan 15 2011 21:21 In reply to

    • mnnoon
    • Top 10 Contributor
      Male
    • Joined on Wed, Apr 16 2008
    • Lawndale, CA
    • Posts 60

    Re: adding norma items to vs10 *.modelproj items set

    I've noticed that it doesn't work in asp.net project or several other different project templates.  It seems to work well in c# windows library project and c# application projects such as console or winform for the most part.   For best results try to report the issue to the dev team using the following link.   I think once the foundation mulls over these reports they will come out with a new version in a few weeks.

  • Sun, Jan 16 2011 0:05 In reply to

    Re: adding norma items to vs10 *.modelproj items set

    Hi All,

    As mentioned in the readme, the initial VS2010 is a straight port of the existing code with no additional features. I am aware that there are additional project types, but I don't have them all installed on my machine (nor am I likely to given the prohibitive cost of the higher-end Visual Studio SKUs).

    VS adds item templates two different ways (directories starting from C:\Program Files\Microsoft Visual Studio 10\, or C:\Program Files (x86)\Microsoft Visual Studio 10\ on a 64-bit system):

    1. Item templates are placed in subdirectories of the .\Common7\IDE\ItemTemplates directory. Here, you'll find directories such as CSharp, VisualBasic, Web, etc. The directory names represent different project types.
    2. Additional item templates can be specified on a per-extension basis. For example, the NORMA templates are added in subdirectories of .\Common7\IDE\Extensions\ORM Solutions\Natural ORM Architect\1.0\ItemTemplates. Here you'll find subdirectories with the same names as those in the primary ItemTemplates directory mentioned in #1. The actual name of the 'ItemTemplates' directory is in the extension.vsixmanifest file in the extension directory.

    So, if want additional item templates, then you can help me by doing the research to figure out the directory name for the other project types. You can test as follows:

    1. Make a directory with the correct type in the NORMA ItemTemplates directory.
    2. Expand the ORMModel.zip file from one of the other item template directories.
    3. Edit the ORMModel.vstemplate file by changing the project type in the XML (look at one of the other .vstemplate files for this project type to get the correct project type)
    4. Rezip as ORMModel.zip
    5. Copy this ORMModel.zip into a new directory with the correct name under the NORMA ItemTemplates directory
    6. Possibly delete the VS-generated .\Common7\IDE\Extensions\ORM Solutions\Natural ORM Architect\1.0\~IC directory to force VS to regenerate the template cache when it restarts.
    7. Restart VS and verify

    So, if you can help me with the investigation and get the correct subdirectory and project type for the projects you're using then I'd be happy to add item templates for each of these project types.

    -Matt

  • Sun, Jan 16 2011 11:44 In reply to

    • robertob
    • Top 150 Contributor
    • Joined on Mon, Jan 10 2011
    • Posts 3

    Re: adding norma items to vs10 *.modelproj items set

    I carried out the following steps and afterwards the "Object-Role Modeling File" and "Object-Role Modeling (DB Import)" files showed up in my vs10 ultimate | Modeling Project | add | new items list.

    1.  C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\ORM Solutions\Natural ORM Architect\1.0\ItemTemplates\CSharp | *.zip to d:\temp
    2.  expanded ORMModel.zip and ORMModelFromDatabase.zip
    3.  changed .vstemplate | <ProjectType>CSharp</ProjectType> to <ProjectType>Modeling</ProjectType>
    4.  recreated ORMModel.zip and ORMModelFromDatabase.zip
    5.  copied new zips into new directory C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\ORM Solutions\Natural ORM Architect\1.0\ItemTemplates\Modeling
    6.  did not need to delete C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\ORM Solutions\Natural ORM Architect\1.0\~IC directory to get vs to regenerate template cache

  • Sun, Jan 16 2011 11:58 In reply to

    • robertob
    • Top 150 Contributor
    • Joined on Mon, Jan 10 2011
    • Posts 3

    Re: adding norma items to vs10 *.modelproj items set

    The Modeling Project type, at least in the case of users with a vs10 sku that provides it, would seem to be the more natural place for extension items that have to do with modeling artificats given its where the out of the box layer diagram, directed graph markup language and uml diagram experiences are created and maintained with full tfs version control support.  

    I also noticed that when i create an "Object-Role Modeling (DB Import)" artifact that every time i open the file i reprompts me with three dialogs "RequireReadingModification" = False(false)/True + "AutoPopulateShapes" = True(default)/False + "The file format of "<path>\ObjectModelFromDatabase1.orm" has automatically been upgraded to a new version.  Should the 'Save' command be disabled to preserve the original file contents? The 'Save As' command will remain enabled" = Yes(default)/No.   Is this an expected behavior of the current release?

  • Tue, Jan 18 2011 1:53 In reply to

    Re: adding norma items to vs10 *.modelproj items set

    Thanks for the information on the Modeling project type. I'll add these additional files to VS2010 setup for the next release (regardless of SKU, they won't hurt anything in the pro SKU). 

    I'm not necessarily a big fan of isolating 'modeling' files from other source files. I think the model is an integral part of the source code and having a model associated with (and the primary source of) generated code directly in a project is a good thing. That being said, I'll repeat that the initial VS2010 release is a straight port and that any investigations into special integration for new VS2010 plug-in points have not been started. I'm certainly not ruling out tight integration with the modeling projects, but given the high-end nature of the VS SKU that contains these elements I think there are a lot of other things we need to cover first (like major advances in the relational generation).

    The first two import dialogs are expected. I believe we keep the previously chosen value within a VS session. You'll see these parameters listed in the NORMADIR\Xml\ORMDesignerSettings.xml file. If you want different defaults, then change them, or comment out the parameters and use or change the defaults in the corresponding xslt files (in the Xml\Transforms\Converters directory). You can also copy this directory and redirect with the HKLM\SOFTWARE\ORM Solutions\Natural ORM Architect for Visual Studio 2010\Designer\DesignerSettings\Core registry key (insert \Wow6432Node after SOFTWARE on a 64-bit machine), which will let you play around without touching the original files.

    You should not see the final message. The NORMA designer uses the same mechanism for an XML import as a file format upgrade, and distinguishes the 'new' vs 'import' case by checking the hierarchy item (hierarchy items are displayed in the Solution Explorer) for the VSHPROPID_IsNewUnsavedItem property. The third dialog you're seeing should not be shown for a new item, so apparently this mechanism has changed in VS2010 and I'll need to figure out another way to get this information. In the meantime, the dialog is easily bypassed (don't disable the save button).

    Thanks again for investigating the modeling project.

    -Matt

Page 1 of 1 (6 items)
© 2008-2024 ------- Terms of Service