The i-Technology Media!
Register | Log in
   
 
.NET  ·  AJAX  ·  CLOUD  ·  ECLIPSE  ·  FLEX  ·  OPEN WEB  ·  iPHONE  ·  JAVA  ·  LINUX  ·  OPEN SOURCE  ·  ORACLE  ·  PBDJ  ·  SEARCH  ·  SILVERLIGHT  ·  SOA  ·  VIRTUALIZATION  ·  WEB 2.0  ·  WIRELESS  ·  XML
Comments
Drool, Britannia? Is the UK Failing the Cloud?
By Roger Strukhoff
Richard Davies wrote: The UK has a good crop of technology pioneers in cloud computing - for example ElasticHosts, FlexiScale, Flexiant, OnApp - and also some strong government initiatives such as G-Cloud. We will have to see whether this kind of technical leadership converts into swift mass-market adoption or not.
Jan. 8, 2012 11:38 AM EST
read more & respond »
Cloud Expo on Google News
Did you read today's front page stories & breaking news?

Cloud Expo & Virtualization 2011 West
Keynotes
Oracle
Opening Keynote | An Enterprise Cloud for Business-Critical Applications
Abiquo
Day 2 Keynote | The Enterprise Cloud Tightrope - Balancing for Success
Akamai
Day 3 Keynote | The DNA of an Enterprise Cloud
DIAMOND SPONSOR:
Oracle
Many Clouds, Many Choices'Cloud
PLATINUM PLUS SPONSORS:
Abiquo
Enterprise Cloud Best Practices - Town Hall - Join the discussion…
PLATINUM SPONSORS:
Intel
Progressing Toward the Federated, Automated and Client-Aware Cloud
New Relic
How to build an app with Twitter-like throughput
Rackspace
Computing in the Cloud Era
GOLD SPONSORS:
Gale Technologies
Practical Cloud Migration
IBM
Re-think IT. Re-inventing Business.
Intel/McAfee
Identity Driven Security in the Cloud
PerspecSys
Hackers Hackers Everywhere, Is My Public Cloud That Safe?
Red Hat
Unlock the Value of the Cloud
SHI
Mission Critical Applications and the Cloud - Myth or Reality?
SoftLayer
Not Your Grandpa's Cloud
Terremark
Integrating Enterprise Clouds
VMware
Upgrade to a vCloud
POWER PANELS:
Cloud Expo Silicon Valley: CTO Power Panel
Cloud Expo Silicon Valley: CEO Power Panel
Cloud Expo Silicon Valley: Cloud SuperStars Panel
Cloud Expo Silicon Valley: CloudNOW Panel
Click For 2010 West
Event Webcasts
Cloud Expo & Virtualization 2011 East
DIAMOND SPONSOR:
Dell
Dell & VMware Deliver the Enterprise Hybrid Cloud
PLATINUM PLUS SPONSORS:
Abiquo
Are Financial Services Organizations Risking Security by Avoiding Cloud Computing?
Oracle
From Consolidation to Enterprise Private PaaS
PLATINUM SPONSORS:
Intel
Driving the Transformation to Next Generation Cloud Data Centers
Rackspace
The Inevitability of an Open Cloud
GOLD SPONSORS:
CA Technologies
Follow YOUR path to Cloud Computing
Interxion
Who Keeps the Cloud in the Air?
Microsoft
Patterns for Cloud Computing
PerspecSys
War in the Clouds: Are you ready?
ServiceMesh
The Big Win: Stop Playing Small-Ball with Your Cloud Strategy
Terremark
Evaluating Enterprise Clouds
Xiotech
Cloud Storage: Myths and Realities
POWER PANELS:
Cloud Expo New York: CTO Power Panel
Cloud Expo New York: CEO Power Panel
Cloud Expo New York: CMO Power Panel
Cloud Expo New York: Wrap-Up Power Panel
Click For 2010 West
Event Webcasts
Live Google News by SYS-CON!
Top Three Links You Must Click On


Custom Item Layouts Using Custom Form Templates

By: Andrew Gelina
Nov. 10, 2008 04:04 PM

Earlier this year I worked on a workflow project that required the fields of a list item be hidden based on the status of the record and the users application rights. After some digging around I found the ListFieldIterator class (see http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.listfielditerator_methods.aspx) which has a IsFieldExcluded method (see http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.listfielditerator.isfieldexcluded.aspx).  This allows you to exclude fields from being displayed when iterating over the fields in a list item.

The next problem was how to create my own field iterator  and use it with my content type. This led me to Custom Form Templates: Form Templates are the method by which SharePoint displays a content type in display, new, and edit form. By default lists all use the same template. The template is a combination of HTML markup and server control references; some of the controls are standard ASP.Net control and some are SharePoint TemplateBasedcControl controls (see http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.templatebasedcontrol.aspx). The TemplateBasedControls can take a template which is a combination of HTML markup, ASP.Net server controls and SharePoint TemplateBasedControl controls - and so it repeats. This is the way in which SharePoint builds the UI. You can find the templates, all of which have a name, in the 12\Template\ControlTemplates directory; most of them in one file - defaulttemplates.ascx.

Searching through this file you can find template for laying out such things as document items, standard toolbars, view selectors etc. You can modify the default behavior for a given template by creating a new template with the same name and deploying it to the 12 hive and restarting IIS. You should never modify the installed files in the 12 hive as the files are used by all sites on the farm and you could break functionality.

By creating custom form layouts it is possible to layout list items in any way you need, for example the SharePoint KPI edit pages are just custom layout forms. You can change the markup and control order in the template, additionally  you can define alternate templates for use with a particular control - this separation of UI markup from the control code is very powerful and flexible.

Attaching a Form template to a content type

For our application we were defining new content types using CAML and a feature definition. Attaching the custom form is achieved by adding some additional CAML markup to the type declaration:

 

<Elements  xmlns="http://schemas.microsoft.com/sharepoint/" >
    <ContentType Description="Licensing Task Content Type"
                 ID="0x01008F4414E2376E47d2A84745642AFA85E3"
                 Name="LicensingTask"
                 Group="Syrinx"
                 Version="0">
...
        <XmlDocuments>
            <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
                <FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
                    <Display>LicenseDisplayForm</Display>
                    <Edit>LicenseEditForm</Edit>
                    <New>LicenseEditForm</New>
                </FormTemplates>
            </XmlDocument>

In the above example the LicensingTask content type uses a form called LicenseEditForm for new and edit and LicenseDisplay form for displaying items.

The content of the template is :

   1:  <SharePoint:RenderingTemplate ID="LTCLicenseEditForm" runat="server">
   2:      <Template>
   3:          <wssuc:ToolBar CssClass="ms-formtoolbar" id="toolBarTbltop" RightButtonSeparator="&nbsp;" runat="server">
   4:              <template_rightbuttons>
   5:                  <SharePoint:SaveButton runat="server"/>
   6:                  <SharePoint:GoBackButton runat="server"/>
   7:              </template_rightbuttons>
   8:          </wssuc:ToolBar>
   9:          <table class="ms-formtable" style="margin-top: 8px;" border="0" cellpadding="0" id="formTbl"
  10:              cellspacing="0" width="100%">
  11:              <ltc:TaskListFieldIterator runat="server" />
  12:          </table>
  13:          <SharePoint:CreatedModifiedInfo ID="CreatedModifiedInfo1" runat="server" />
  14:          <wssuc:ToolBar CssClass="ms-formtoolbar" id="toolBarTblbottom" RightButtonSeparator="&nbsp;"
  15:              runat="server">
  16:              <template_rightbuttons>
  17:                  <SharePoint:SaveButton runat="server"/>
  18:                  <SharePoint:GoBackButton runat="server"/>
  19:              </template_rightbuttons>
  20:          </wssuc:ToolBar>
  21:      </Template>
  22:  </SharePoint:RenderingTemplate>
  23:   

Line 11 is where the use of the custom field iterator is defined. The prefix ltc is used to identify the control to be used is from a specific assembly and namespace, at the top of the template ascx file there is a prefix definition:

<%@ Register TagPrefix="ltc" Assembly="Licensing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6c1fd21dbc7fb55e"
    Namespace="syrinx.SharePoint.Licensing.WebControls" %>

For more information on layout forms see http://msdn.microsoft.com/en-us/library/aa544142.aspx 

Read the original blog entry...

Published Nov. 10, 2008— Reads 746
Copyright © 2008 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
About Andrew Gelina
Andrew Gelina brings over 12 years of software architecture and development experience to his role as CEO of Syrinx Consulting, where he is responsible for the strategic direction, technology focus, operations management, and growth of the firm.

Prior to joining Syrinx in 2003, Andrew helped build Web Technology Partners into a leading software engineering consulting firm before selling it in 2000 to Monster.com, the global online career and recruitment resource. During the next three years at Monster, he developed software and managed projects for virtually every area of Monster's operations, from CRM integration to e-commerce to high-traffic, high-volume Web development. He also worked closely with Microsoft to scale its .NET platform to Monster's huge transaction volumes.

Andrew has also worked in several other areas of technology leadership, performing technical due diligence for companies considering acquisitions and selling professional services. He started his career at EDS, helping them develop cellular billing and switch interface software to support the emerging wireless industry.

He graduated cum laude from the University of Massachusetts at Amherst, where he received a bachelor's degree in operations management. Andrew is a member of the CEO Roundtable of the Massachusetts Technology Leadership Council.

Andrew and his 35-member team work on-site with clients all over New England.

Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON Featured Whitepapers

ADS BY GOOGLE

Breaking Java News
McLane Advanced Technologies Adds Distinguished Retired General to Board of Advisors
Orex Grants Stock Options
WWW.MONEY.CA Launches; New Canadian Money Site for Personal Finance
New Book About Brand Rituals Reaches No. 1 in Marketing Category on Amazon
Judicial Watch Statement on Court Ruling Allowing Maryland DREAM Act to Remain on 2012 Ballot
Former #OWS Working Group Announces a "National General Assembly" to Convene in Philadelphia the Week of July 4, 2012 for the Purpose of Ratifying a Petition for the Redress of Grievances
News Conference: FRC's Tony Perkins Releases Letter Signed By 2,500 Religious Leaders Opposing Contraceptive Mandate February 17, 2012
Pipeline Tensions: Frustration Mounts at Review Hearings as Enbridge Lawyers Try to Limit Testimony of Elected Representatives
Prima Games Releases The Elder Scrolls V: Skyrim® Official World Interactive Map App for the iPad and iPhone
Meridian Health Plan to Serve Iowa Medicaid Population

ADVERTISE   |   MAGAZINE SUBSCRIPTIONS   |   FREE BREAKING-NEWSLETTERS!   |   SYS-CON.TV   |   BLOG-N-PLAY!   |   WEBCAST   |   EDUCATION   |   RESEARCH

.NET Developer's Journal - .NETDJ   |   ColdFusion Developer's Journal - CFDJ   |   Eclipse Developer's Journal - EDJ   |   Enterprise Open Source Magazine - EOS
Open Web Developer's Journal - OPENWEB   |   iPhone Developer's Journal - iPHONE   |   Virtualization - Virtualization   |   Java Developer's Journal - JDJ   |   Linux.SYS-CON.com
PowerBuilder Developer's Journal - PBDJ   |   SEO / SEM Journal - SJ   |   SOAWorld Magazine - SOAWM   |   IT Solutions Guide - ITSG   |   Symbian Developer's Journal - SDJ
WebLogic Developer's Journal - WLDJ   |   WebSphere Journal - WJ   |   Wireless Business & Technology - WBT   |   XML-Journal - XMLJ   |   Internet Video - iTV
Flex Developer's Journal - Flex   |   AJAXWorld Magazine - AWM   |   Silverlight Developer's Journal - SLDJ   |   PHP.SYS-CON.com   |   Web 2.0 Journal - WEB2
Apache   |   CMS   |   CRM   |   HP   |   Oracle Journal   |   Perl   |   Python   |   Red Hat   |   Ruby on Rails   |   SAP   |   SaaS

SYS-CON MEDIA:   ABOUT US   |   CONTACT US   |   COMPANY NEWS   |   CAREERS   |   SITE MAP
SYS-CON EVENTS:   |  AJAXWorld Conference & Expo  |  iPhone Developer Summit  |  Cloud Computing Conference & Expo  |  SOA World Conference & Expo  |  Virtualization Conference & Expo
INTERNATIONAL SITES:   India  |  U.K.  |  Canada  |  Germany  |  France  |  Australia  |  Italy  |  Spain  |  Netherlands  |  Brazil  |  Belgium
 Terms of Use & Our Privacy Statement     About Newsfeeds / Video Feeds
Copyright ©1994-2008 SYS-CON Publications, Inc. All Rights Reserved. All marks are trademarks of SYS-CON Media.
Reproduction in whole or in part in any form or medium without express written permission of SYS-CON Publications, Inc. is prohibited.
 
close this window