User Meta Data File

Any template questions or comments or suggestions

User Meta Data File

Postby mkamoski on Tue Jun 15, 2004 5:21 pm

Hi--

What exactly is the User Meta Data File?

It is referenced in the MyGeneration GUI here...

>Edit, >Default Settings, >User Meta Data File

...and I am just curious what it is because my setup has this value...

C:\\Program Files\\MyGeneration\\Settings\\UserMetaData.xml

...and that file does not exist.

I could not find a help topic on this.

What is it and how can I use it?

(I am hoping that this might allow me to store globally accessible name/value pairs, like a \"web.config\" file in ASP.NET does.)

Please advise.

Thank you very much.

--Mark
User avatar
mkamoski
Colonel
 
Posts: 111
Joined: Wed May 26, 2004 3:24 pm
Location: Massachusetts, USA

Postby mike.griffin on Tue Jun 15, 2004 5:33 pm

Yes, user meta data is key/value pairs you can attach globally to object types, ie, table or column or specific objects like column \"EmployeeID\".
Suppose you had user meta data stored at the table level, you can loop through it like this:

Code: Select all
For Each objColumn in objTable.Columns
    Set prop = objColumn.Properties(objColumn.Name)
    output.writeLn prop.Key & \" = \" & prop.Value
Next

or if you had data an object you can access it directly like this
Code: Select all
Dim str
str = objTable.Columns(\"HireDate\").Properties(\"MyKey\").Value
output.writeLn(str)

There are no business entity templates that use it because it's user meta data, it wouldn't know what to do with it, this might help you though:

Each Meta object such as a Column has these three collections

obj.Properties
A collection that can hold key/value pairs of your choosing

obj.GlobalProperties
A collection that can hold key/value pairs of your choosing for all Columns with the same Database

obj.AllProperties
A collection that combines the Properties and GlobalProperties Collections

There are two docking windows that you can use to enter data, one for Global and one for Local user data as well. Look for the buttons on the main toolbar with \"G\" and \"L\" on the them. There is a template in the other directory that demonstrates this as well.
User avatar
mike.griffin
Site Admin
 
Posts: 3290
Joined: Sat Apr 03, 2004 6:10 am
Location: Indianapolis, IN

Postby mkamoski on Tue Jun 15, 2004 5:44 pm

mike.griffin wrote:Yes, user meta data is key/value pairs you can attach globally to object types, ie, table or column or specific objects like column "EmployeeID"....

There are two docking windows that you can use to enter data, one for Global and one for Local user data as well. Look for the buttons on the main toolbar with "G" and "L" on the them. There is a template in the other directory that demonstrates this as well.

Mike--

Great.

Thank you.

And, I am sorry for not reading through the documents.

Now, I have no file called "C:\\Program Files\\MyGeneration\\Settings\\UserMetaData.xml" so I guess that I have to put one there?

What structure is required?

Please advise

Thank you.

--Mark
User avatar
mkamoski
Colonel
 
Posts: 111
Joined: Wed May 26, 2004 3:24 pm
Location: Massachusetts, USA

Postby mike.griffin on Tue Jun 15, 2004 6:13 pm

It is created for you, you never manually create or edit it. Just play around with the toolbar buttons with \"L\" and \"G\" on them and hit the save icon after you enter some data and then go look at the file
User avatar
mike.griffin
Site Admin
 
Posts: 3290
Joined: Sat Apr 03, 2004 6:10 am
Location: Indianapolis, IN

Re:

Postby CList on Tue Oct 04, 2005 7:39 pm

mike.griffin wrote:There are two docking windows that you can use to enter data, one for Global and one for Local user data as well. Look for the buttons on the main toolbar with "G" and "L" on the them. There is a template in the other directory that demonstrates this as well.


Could you qualify what you mean by "Global" vs "Local"? Is "Local" saved at the project level? It seems like having meta-data settings at the project level would be a GoodThing(tm).


Also, I am totally new to MyGeneration (and enjoying it so far) - but I have to say that one of my biggest gripes so far is the use of toolbars. I hate toolbars - I can't imagine there are many programmers, who spend so much time on the keyboard and so little on the mouse who like them. Having cryptic image buttons for functions is (IMHO) not a good UI when they could be text-based menu items (with short-cuts!) that new users can see the full name of at a glance with-out having to mouse-hover them. Every toolbar button should have a corresponding menu item - at the very least. Similarly, the lack of windows-standard keyboard short cuts (Ctrl-Q for close file??? - it's Ctrl-F4!) is also an annoyance.

- CList
CList
Lurker
 
Posts: 1
Joined: Tue Oct 04, 2005 6:46 pm

Postby mike.griffin on Wed Oct 05, 2005 1:29 am

Well, I agree the UI could be better and for 2.0 we are using Actipro's Docking Suite and Syntax Editor, they are very professional and toolbars will be available but everything can be done via the keyboard, toolbars can be turned off.

Here is the definition of the IColumn.GlobalProperties Property.
The Properties for all Columns within the same Database. These are user defined and are typically stored in 'UserMetaData.xml' unless changed in the Default Settings dialog. Properties consist of key/value pairs. You can populate this collection during your script or via the Dockable window.

Thus Global Properties are global to all of a given type for a particular Database. In the snippet below I added a key/value pair on a Table in the Northwind Database. Notice that all tables share the same data.

Code: Select all
<MyMeta>
  <Global>
    <Databases>
      <Database p=\"Northwind\">
        <Table>
          <Properties>
            <Property k=\"GlobalKey\" v=\"GlobalValue\" />
          </Properties>
        </Table>
      </Database>
    </Databases>
  </Global>

However, Local Meta data is attached to a single and specific area. Here I typed a key/value pair in on a particular column in the local meta data window:

Code: Select all
<MyMeta>
  <Global>
     yada yada ...
  </Global>
  <Databases>
    <Database p=\"DemoDatabase\" n=\"\">
      <Tables>
        <Table p=\"Customers\" n=\"\">
          <Columns>
            <Column p=\"CustomerID\" n=\"\">
              <Properties>
                <Property k=\"LKey\" v=\"LValue\" />
              </Properties>
            </Column>
          </Columns>
        </Table>
      </Tables>
    </Database>
  </Databases>
</MyMeta>


Also, in the Local Meta Data window if you click on a collection like Columns you can give them alias's and the dOOdad templates will use those as your property names. This is a good way to make DBA's stuck in 1985 irrelevant. :wink:
User avatar
mike.griffin
Site Admin
 
Posts: 3290
Joined: Sat Apr 03, 2004 6:10 am
Location: Indianapolis, IN


Return to General Template Questions/Comments

Who is online

Users browsing this forum: No registered users and 1 guest