not the last of his kind
News
SharePoint Custom List Definition Recipes
Feb 19th
If you want a tutorial on how to create a custom ist definition in SharePoint, check MSDN or Andrew Connell’s post. Here, I’ll just provide several short recipes for some scenarios.
1. How to rename the Title column in the list definition?
Often, you want to rename the Title column in your list definition. Don’t do it, because many internal SharePoint functions requires it. Instead, just change the display name of the column.
You need to do this in the list definition’s schema.xml, not in the content type definition file. In fact, don’t mention the Title column in the content type. If you do, the Title column will appear twice in your list.
Here is what you should modify in your schema.xml:
<Fields>
<Field ID="{82642EC8-EF9B-478F-ACF9-31F7D45FBC31}"
Type="Computed"
Name="LinkTitle"
DisplayName="My Own Title" />
<Field ID="{BC91A437-52E7-49E1-8C4E-4698904B2B6D}"
Type="Computed"
Name="LinkTitleNoMenu"
DisplayName="My Own Title" />
<Field ID="{FA564E0F-0C70-4AB9-B863-0177E6DDD247}"
Type="Text"
Name="Title"
DisplayName="My Own Title"
Required="TRUE" />
<!-- Other fields declaration -->
</Fields>
Keep in mind that you will need those three columns declaration, one for the plain Title data, the others for the Title with link and menu which are displayed in the standard form. You can put your own text inside the DisplayName attribute.
2. What are the required attributes in the List and ListTemplate elements?
The List element in schema.xml is similar to the ListTemplate element in the feature manifest in the sense that they both have a similar set of attributes. A lot of attributes are duplicated and it often cause confusion. Usually, I would put every attributes I needed in both elements. But this is not a good practice, since if you need to change some attributes, you have to do it for both elements. So it’s better to put only the required attributes in each element. What are they?
MSDN actually has listed the required attributes for the List and ListTemplate elements. But, at least in my case, it’s not so accurate. So here is what I found:
Required on the List element:
- BaseType
- Direction
- Name
- Url
The MSDN article suggested that this attribute is optional. But if you don’t include this, you might get the following error when creating an instance of the list:
Exception occurred. (Exception from HRESULT: 0×80020009 (DISP_E_EXCEPTION)) at Microsoft.SharePoint.Library.SPRequestInternalClass.CreateListFromFormPost(String bstrUrl, String& pbstrGuid, String& pbstrNextUrl)
at Microsoft.SharePoint.Library.SPRequest.CreateListFromFormPost(String bstrUrl, String& pbstrGuid, String& pbstrNextUrl)
Required on the ListTemplate element:
- BaseType
- DisplayName
- Name
- Type
C# 4.0 and Dynamic Programming
Nov 2nd
In Microsoft PDC2008, Anders Hejlsberg — C# lead designer and Microsoft Technical Fellow — introduces the future of C#, dubbed C# 4.0. You can watch his recorded presentation at Channel 9. The following is a brief summary on dynamic programming, one of C# 4.0 new features.
C# Evolution
- C# 1.0: Managed Code
- C# 2.0: Generics
- C# 3.0: Language Integrated Query
- C# 4.0: Dynamic Programming
Nowadays, codes can reside in any kind of form, i.e., .NET objects, JavaScript, Python, Ruby, COM. In order to use the codes written in different form, currently we have some different approaches.
For example, to call a .NET object, we will write the following:
Calculator calc = GetCalculator(); int sum = calc.Add(10, 20);
Now we try to call a .NET object too, but we don’t know which class exactly having the code:
object calc = GetCalculator(); Type calcType = calc.GetType(); object res = calcType.InvokeMember("Add", BindingFlags.InvokeMethod, null, new object[] { 10, 20 }); int sum = Convert.ToInt32(res);
While this is for calling a JavaScript object:
ScriptObject calc = GetCalculator(); object res = calc.Invoke("Add", 10, 20); int sum = Convert.ToInt32(res);
Observe that there are different procedures to call different objects. With C# 4.0 dynamic keyword, we can use this instead of all those above:
dynamic calc = GetCalculator(); int sum = calc.Add(10, 20);
The compiler will not check whether there is an “Add” method in the “calc” object. Instead, the DLR will bind the method call to the responsible object on runtime as shown in the following picture:

Anders stated that he did not have any intention to ask all developers to rewrite all their codes to be dynamic. In fact, he is a strong believer of static language strong features: statement completion, refactoring, compilation type check, and performance. But he also embraces the flexibility and productivity of dynamic languages such as Python and Ruby. And there are an increasing numbers of things that your application needs to talk to, that is not statically typed. You may need to talk to a JavaScript code, or maybe a Python or Ruby codes. The question is, should we make it painful to talk to them or make it easier?
For Anders, he wants the later. As LINQ intends to provide a unified way to access all kind of data source, dynamic in C# intends to provide a unified way to talk to all kind of codes, be it statically or dynamically typed.
Interesting Flash and FreeHand Stories
Apr 26th
Adobe Systems—the well-known software company, creator of Acrobat, Photoshop, Postscript—do not create all their software by themselves. It is true that they create their own flagship products such as Acrobat, Illustrator, Photoshop, and Postscript. But they—like Microsoft—also acquired products from their competitors. Some notable acquisitions include when Adobe took over Aldus Corporation in 1994 to acquire PageMaker—the popular Windows desktop publishing (DTP) software—along with the TIFF file format, and when in 1995 they bought FrameMaker—also a DTP software—from Frame Technologies. The latest and biggest acquisition is in 2005 when Adobe acquired their main rival Macromedia in a stock swap valued at about USD 3.4 billion.
I notice there are at least two interesting stories related to Adobe’s acquisitions.
The Flash Story
Flash is a light weight multimedia application suitable for Web and mobile devices. Flash consists of two parts: the authoring tool (Adobe Flash Professional) and the player (Adobe Flash Player).
In case you do not aware, Macromedia was not the first creator of Flash. In fact, Macromedia had Shockwave as their multimedia application for the Web. The problem is Shockwave movies were often slow-to-download with the Internet connections back then. At the mean time, FutureWave—a small software company—had a drawing application product called SmartSketch. As many became aware of the Internet, in 1995 FutureWave decided to add frame-by-frame animation features to SmartSketch and re-released it as FutureSplash Animator for PC and Macintosh, which successfully challenged Shockwave.
FutureSplash Animator was originally offered to Adobe, but Macromedia got it in an acquisition in December 1996. Later, Macromedia released it as Macromedia Flash 1.0. Macromedia continued to develop Flash and their last release was Macromedia Flash 8 in 2005.
As Adobe bought Macromedia, Flash finally fell in Adobe’s hands. Starting from version 9, Flash was rebranded as Adobe Flash and the authoring tool was integrated into Adobe Creative Suite 3 as Adobe Flash CS3.
The FreeHand Story
FreeHand is a vector graphics drawing program.
Unlike Flash, FreeHand’s story was rather sad. In the beginning, FreeHand was created by Altsys but licensed to Aldus which released versions 1 to 4 under the name Aldus FreeHand. Aldus later was merged with Adobe along with all Aldus’ product lines—including FreeHand. Unfortunately, by that time, Adobe already had their own product serving the same purpose called Adobe Illustrator. Because of the overlapping market, Adobe returned FreeHand to Altsys.
Later, Altsys were bought by Macromedia. Macromedia released versions 5 to 11 of FreeHand with the Macromedia FreeHand brand. Macromedia used the brand Macromedia FreeHand MX to signify version 11. Since 2004, FreeHand didn’t get significant update since Macromedia favored Macromedia Fireworks and chose to leave FreeHand out of their bundled suite called Macromedia Studio 8. Though the intention of the two products were different—i.e. Fireworks for Web, FreeHand not for Web—most of FreeHand features were already incorporated into Fireworks, there were no needs to own both programs.
After Adobe’s acquisition over Macromedia, FreeHand once again returned to Adobe. But FreeHand’s future didn’t seem to brighten up. Adobe Creative Suite only included Illustrator and Fireworks while FreeHand’s users were allowed to upgrade to Adobe Illustrator CS3.
~~~
Morale of the story:
We have an idiom in Indonesian language saying: “Kalau Jodoh Tak Kemana”. I don’t have any idea how to say this in English, but it means that if something or someone is destined to be with you, it will return to you at last anyway.
Recent Comments