Wednesday, March 31, 2010
HIbernate 3.5 release
Announcement of Hibernate 3.5 release. Please see detail: http://in.relation.to/Bloggers/Hibernate350FinalRelease
Tuesday, March 23, 2010
Friday, March 19, 2010
Configuring the look of reference attributes in the HMC
So basically the question is this:
How can I change/configure the looks of reference attributes in the hmc if the reference is an item of my own type? I can only see the 'PK' in corresponding editors.
Suppose you have your own type named "MyType" and you have an attribute of this type in, for example, the Product's editor. If you have no hmc configuration whatsoever for your own type then the hmc will take the default configuration which is made for the "Item" type. And since "Item" has only one useful attribute - the PK - this attribute is by default configured to be shown in reference editors.
Now you only need to provide a configuration for your own type in your extension's hmc.xml file. For reference editors only the tag is needed, but it makes sense to at least provide similar configurations for the search and searchresult.
So if your type has an attribute named 'code' (the attribute you think is the most unique to your type) you could provide the following hmc.xml configuration snippet:
<type name="MyType" mode="append"><organizer><search mode="replace"><condition attribute="code"/></search><result><listview mode="replace"><itemlayout><attribute name="code"/></itemlayout></listview></result></organizer><defaultreference searchattribute="code" mode="replace"><itemlayout><attribute name="code"/></itemlayout></defaultreference></type>
For your request the relevant part is the tag in which you provide the 'searchattribute'.
Here you tell the hmc to use the attribute named 'code' to provide a reference editor (which then even allows for search-as-you-type functionality based on 'code').
The tag inside is responsible for the looks of item references in any non-editor context (for example inside display-only lists).
And, as I said, the configurations for and are actually not necessary for your intention, but if you ever want to search for instances of your type then they will be quite useful (or you will, again, be confronted with meaningless pk's).
Thursday, March 18, 2010
Medicore programmer
Mediocre programmer - A programmer who has a limited toolset. He knows the syntax of only the simplest commands, but he knows where to find the syntax for more complex commands. He doesn’t know how to write the most efficient code, but he knows how to rewrite and test the code for greater efficiency if he must. He runs into more roadblocks along his passage to success, but he views each as a challenge and is confident that he will find a path around each roadblock. He may take longer to get there, but he always reaches his goal. He doesn’t know how to create a DLL, but he knows he can if necessary. Like most programmers, he doesn’t particularly like documenting his work but does so anyway because he is a professional.
Subscribe to:
Comments (Atom)