Codebender

not the last of his kind

Follow me on TwitterRSS Feeds

  • Home
  • About Codebender
  • LiquidSilver SharePoint Framework

Introducing LiquidSilver SharePoint Framework

Dec 23rd

Posted by denni in News

2 comments

This is an introductory post to LiquidSilver SharePoint Framework that I’ve been developing with my friend, Riwut Libinuko.

LiquidSilver is a SharePoint Framework that provides various classes and functions to deal with common tasks in any SharePoint development to help you work much easier, faster, more object-oriented, and more productive. LiquidSilver is compatible with WSS 3.0 and MOSS 2007.

The project is hosted in CodePlex where you can download the source code as well as report issues.

We have put a lot of our experience — in Riwut’s case, years of experience that got him an MVP award — in SharePoint development into this framework and been using it in our projects. We love it and benefit greatly from it. So, we hope you will too.

Enough with the introduction, let’s get started with LiquidSilver or visit the LiquidSilver page to look for more resources.

liquidsilver, sharepoint

SharePoint Custom List Definition Recipes

Feb 19th

Posted by denni in News

4 comments

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
sharepoint

C# 4.0 and Dynamic Programming

Nov 2nd

Posted by denni in News

No comments

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:

Dynamic Language Runtime

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.

c#, dynamic language, linq
« First...«34567»...Last »
  • Recent Posts

    • InfoPath 2010 breaks SharePoint 2007 installation
    • Common coding issues when working with anonymous SharePoint sites
    • Office 2010 breaks stsadm -o copyappbincontent
    • Flowchart: which open source license should I use?
    • System.Net.WebException: An exception occurred during a WebClient request
  • Recent Comments

    • sunny on Common coding issues when working with anonymous SharePoint sites
    • denni on Change Your Fonts, Change Your Mood
    • Deb Ramirez on Change Your Fonts, Change Your Mood
    • Yuva on Flowchart: which open source license should I use?
    • Office 2010 breaks stsadm -o copyappbincontent on InfoPath 2010 breaks SharePoint 2007 installation
  • Tags

    adobe best practices c# codeplex css design design pattern dynamic language flash flowchart font forefront freehand internet explorer javascript linq linq to sql linux liquidsilver mercurial office 2010 rdesktop security sharepoint subsonic tips visual studio windows windows 2003
  • Archives

    • User Login






      • Lost your password?
    • Links

      • Denni on LinkedIn My LinkedIn Profile
      • Denniland My personal blog
      • Ragnarok Online Database A database for the Ragnarok Online MMORPG
Mystique theme by digitalnature | Powered by WordPress
RSS Feeds XHTML 1.1 Top