• Home
  • About
Subscribe: Posts | Comments | E-mail
  • SharePointTopics on Microsoft SharePoint Technology
  • Silverlight, WPFSilverlight, Windows Presentation Foundation
  • MiscellaneousRandom bits and rants

Rouslan Grabar on NET, SharePoint, SilverLight, WPF and other technology related topics

Archive for March, 2009


Posted on March 30, 2009 - by Rouslan Grabar

Fix HTTP 404.3 web service error after installing VSeWSS 1.3

I have encountered weird web service 404 error after I installed and configured the March CTP of VSeWSS 1.3. I call it weird, because I was expecting access denied error, but not the dreaded “File Not Found” billboard on my way to use the latest version of VSeWSS. :)

Some people have the same problem, too.

Anyway,  given the fact that I was setting up the development environment on a fresh installation of Windows 2008 Web Server I figured out that  the problem is caused by the fact that IIS does not know how to handle the request addressed to the service. So here is the solution:

Win+R > cmd

cd "%SystemRoot%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\"
ServiceModelReg.exe -i

Enjoy!


Posted on March 30, 2009 - by Rouslan Grabar

SharePoint: Разворачиваем среду для разработки – Часть 2

Часть 1. Установка WSS 3.0

Часть 2

Разрабатывая для платформы SharePoint, вы будете создавать некий продукт, который вы должны предоставить потребителю. В этой части я раскажу, каким образом плоды вашего труда могут быть использованы у вашего клиента.

Введение в понятие «Решений» и «Возможностей» SharePoint

В словаре SharePoint разработчика есть два термина Solution (Решение) и Feature (Возможность). Решение включает в себя одину или несколько Возможностей. Возможность представляет из себя набор кода, разметки и ресурсов, которые, объединенные вместе, добавляют некий функционал на ферме серверов.

Конечный пользователь, в лице администратора фермы северов, получает от разработчика решение в виде пакета с расширением WSP. Этот пакет не что иное, как zip-архив, включающий в себя все необходимые файлы для нормальной работы решения на серверах пользователя.

(more…)


Posted on March 29, 2009 - by Rouslan Grabar

Ferrari.com portal on SharePoint

People at the user group asked me for sites that use SharePoint for publishing. Well, Ferrari.com does use it too.

ferrari_com_uses_sharepoint

Cool snappy site BTW :)


Posted on March 25, 2009 - by Rouslan Grabar

SharePoint: Разворачиваем среду для разработки – Часть 1

О серии статей “SharePoint: Разворачиваем среду для разработки”

В этой серии статей я рассказываю о том, как настроить среду для разработки под Windows SharePoint Services 3.0/Microsoft Office Sharepoint Server 2007. В первой статье из серии будет подробно, по шагам и с иллюстрациями, описан процесс установки бесплатного пакета Windows SharePoint Services 3.0 на рабочей машине разработчика.

Я буду использовать следущие компоненты:

(more…)


Posted on March 18, 2009 - by Rouslan Grabar

How to hide SharePoint list item columns

There are situations when you have to hide certain columns from customers’ eyes. Today I am going to show one way to do that.

Let’s go!

When its time to display item on a form, SharePoint takes the following actions:

  • looks into list schema to determine what custom template to use by looking at the “Template” attribute in Forms\Form element.
    <Forms>
      <Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
      <Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" Template="MyCustomForm" WebPartZoneID="Main" />
      <Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" Template="MyCustomForm" WebPartZoneID="Main" />
    </Forms>
  • or it looks into list schema to determine item’s content type to look into for FormTemplates element in content type schema to find what control template to use to display the item for a given mode. For example, here is the exert  from default list schema and Item content type
     <XmlDocuments>
             <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
                          <FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
                                      <Display>ListForm</Display>
                                      <Edit>ListForm</Edit>
                                      <New>ListForm</New>
                          </FormTemplates>
                </XmlDocument>
    </XmlDocuments>
  • opens Program files\common files\microsoft shared\web server extensions\12\template\controltemplates and looks for control template’s aspx file
  • if the control template is not defined by either way,  SharePoint uses default control templates from DefaultTemplates.ascx

This gives us the ability to provide our own template that will dictate to SharePoint how to display the list item. Lets look at the default ListForm control template for Item content type:

<SharePoint:RenderingTemplate ID="ListForm" runat="server">
	<Template>
		<SPAN id='part1'>
			<SharePoint:InformationBar runat="server"/>
			<wssuc:ToolBar CssClass="ms-formtoolbar" id="toolBarTbltop" RightButtonSeparator="&nbsp;" runat="server">
					<Template_RightButtons>
						<SharePoint:NextPageButton runat="server"/>
						<SharePoint:SaveButton runat="server"/>
						<SharePoint:GoBackButton runat="server"/>
					</Template_RightButtons>
			</wssuc:ToolBar>
			<SharePoint:FormToolBar runat="server"/>
			<TABLE class="ms-formtable" style="margin-top: 8px;" border=0 cellpadding=0 cellspacing=0 width=100%>
			<SharePoint:ChangeContentType runat="server"/>
			<SharePoint:FolderFormFields runat="server"/>
			<SharePoint:ListFieldIterator runat="server"/>
			<SharePoint:ApprovalStatus runat="server"/>
			<SharePoint:FormComponent TemplateName="AttachmentRows" runat="server"/>
			</TABLE>
			<table cellpadding=0 cellspacing=0 width=100%><tr><td class="ms-formline"><IMG SRC="/_layouts/images/blank.gif" width=1 height=1 alt=""></td></tr></table>
			<TABLE cellpadding=0 cellspacing=0 width=100% style="padding-top: 7px"><tr><td width=100%>
			<SharePoint:ItemHiddenVersion runat="server"/>
			<SharePoint:ParentInformationField runat="server"/>
			<SharePoint:InitContentType runat="server"/>
			<wssuc:ToolBar CssClass="ms-formtoolbar" id="toolBarTbl" RightButtonSeparator="&nbsp;" runat="server">
					<Template_Buttons>
						<SharePoint:CreatedModifiedInfo runat="server"/>
					</Template_Buttons>
					<Template_RightButtons>
						<SharePoint:SaveButton runat="server"/>
						<SharePoint:GoBackButton runat="server"/>
					</Template_RightButtons>
			</wssuc:ToolBar>
			</td></tr></TABLE>
		</SPAN>
		<SharePoint:AttachmentUpload runat="server"/>
	</Template>
</SharePoint:RenderingTemplate>

In the above xml markup please note the undelined element which represents type Microsoft.SharePoint.WebControls.ListFieldIterator. This is the class that renders the fields on the form page and the SDK sports this exhaustive description for the type:

Renders each field in a list item, with some possible exceptions.

Well, it really iterates trough the collection of fields and [according to Reflector's output] generates required HTML according to field type and current control mode. For example, textual field is being rendered as a text box in “edit” and “new” mode and as a plain text label when in “display” mode.

The ListFieldIterator class has an overridable method IsFieldExcluded. If the method returns true, the field is not rendered at all.

Got an idea? Yes, we just override this method and use business  logic  to decide whether  to render field  or hide it completely from the user.

As a summary, here are the steps required to make the whole coulmn hiding thing work:

  1. Use (copy and paste) the original  ListForm rendering template from as a (duh!) template and save it to, for example, as FilteringListForm.aspx along with @Control, @Assembly and @Register directives to the controltemplates  folder in the 12 hive.
  2. Change the id of the template
    <SharePoint:RenderingTemplate ID="FilteringListForm" runat="server">
  3. In the customized template, replace SharePoint:ListFieldIterator element with class name of your own implementation of the Microsoft.SharePoint.WebControls.ListFieldIterator type.
  4. Create a class that inherits from ListFieldIterator class and override the method IsFieldExcluded.
  5. Apply your business rules in overriden method IsFieldExcluded.
  6. Reference the the new control template in either the Forms section of your list schema or in the  XmlDocuments node if you are customizing content type.

Enjoy!


« Older Entries

  • Recent Posts

    • Доклад по PerformancePoint Server 2007 на сайте TechDays.ru
    • How to allow only Folder items to be created in the List root folder
    • Move list item into a subfolder in the same list
    • Краткий обзор возможностей SharePoint 2010 для конечных пользователей
    • Get Free Typemock licenses – ASP.NET bundle launch
  • Tags

    Для новичков Customization Developer Utility Fileds For Beginners IIS mac os x Misc MOSS MSDN photosynth Powershell Russian Screencast SharePoint SharePoint Designer Silverlight, WPF Snippet SPItemEventReceiver techdays timer job Toolbox tricks troubleshooting Virtualisation VSeWSS wcf web service Windows windows authentication WPF WSS
  • Blogroll

    • My personal journal in Russian.
    • Picture Downloader Software
    • Russian SharePoint Community
  • Archives

    • November 2009
    • October 2009
    • July 2009
    • May 2009
    • April 2009
    • March 2009
© 2009 Rouslan Grabar. All Rights Reserved.