您的位置:首页 > 产品设计 > UI/UE

MOSS 2007 CMS Project Technical Issues: Custom Field Type

2007-12-24 15:19 417 查看
Until now, I have been in the CMS team for almost six monthes. During this past period, I knew a lot about MOSS 2007 with SP1, that's a not good experience because of both the technique lack and some weird places in it. Below I list the issues I met in our project, and hope it could be userful for your future project.

1) Custom field type. In MOSS 2007, there is the possibility you can create your own field type using "custom field type". Here, I met two points should be mentioned: First is you shold add some code to handle the custom property, because the property will lost with only once-save-action. Sample:

Normally, you should set/get the custom property like below way:

public override void Update()
{
this.SetCustomProperty("SourceWeb", this.SourceWeb);
base.Update(); }

Unfortunately, you should do it like below way: public override void Update()
{
this.SetCustomProperty("SourceWeb", this.SourceWeb);
base.Update(); if (updatedSourceWeb.ContainsKey(ContextId))
{
updatedSourceWeb.Remove(ContextId);
} }

private string sourceWeb;
public string SourceWeb
{
get
{
return updatedSourceWeb.ContainsKey(ContextId) ? updatedSourceWeb[ContextId] : sourceWeb;
}

set
{
this.sourceWeb = value;
}
} public int ContextId
{
get
{
return SPContext.Current.GetHashCode();
}
} public void UpdateSourceWeb(string value)
{
updatedSourceWeb[ContextId] = value;
} 2) There is a known issue about the custom field type. After the custom field is deployed on the server, you can find the properties in the editor page correctly, but when you new a document, in the pop-up property dialog window, you can not find the corresponding fields. About this bug of Microsoft , you can solve it using sp1 of MOSS 2007. Now the sp1 has been available. 3) About the deployment of custom fields, some pages/controls/xmls are necessary, you can find the related documents from googling sites. Because it's difficult to know what happens when it goes live, the detailed log service are strongly recommanded here, certainly you alos can refer to the huge logs from MOSS 2007 (.../1033/logs/...).
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: