Sunday, October 23, 2011

Configuring SharePoint 2010 Foundation for Internet-facing publishing

style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 13px; PADDING-RIGHT: 0px; COLOR: #e9ab17; FONT-WEIGHT: bold; PADDING-TOP: 10px">Introduction


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">I
am starting a set of posts regarding the ability of SharePoint 2010 foundation
to be used to build Internet-facing web sites. In this one we are just going to
perform configuration and creation operations so as we can obtain a SharePoint
Foundation site collection that can be used to publish content on the Internet
and therefore, available for anonymous users.


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 13px; PADDING-RIGHT: 0px; COLOR: #e9ab17; FONT-WEIGHT: bold; PADDING-TOP: 10px">Business
benefits - The "why" part of the post

style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">In
SharePoint 2007 the Internet-facing publishing was rather based on the use of
the publishing part of SharePoint, its CMS.

However, the team sites that
were a part of the collaboration area of SharePoint 2007 are now with the new
wiki pages of SharePoint 2010 a way to help people to publish formal content.
The team sites are now described in the SharePoint 2010 documentation as a
solution to encourage one-to-many communication and also a solution to offer a
structured exchange of information.

Therefore the team sites of
SharePoint Foundation are now mature enough to be used as a base to build
Internet-facing web sites and are a new and more cost effective opportunity
offered by SharePoint 2010 to publish content on the Internet. The free
SharePoint Foundation team sites can be now seen as a severe competitor to the
licensed SharePoint CMS!


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">For
further information, see the Microsoft documentation:


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">href="http://msdn.microsoft.com/en-us/library/ee721051.aspx#section1">Comparison
of Enterprise Wikis with Team Sites


href="http://technet.microsoft.com/en-us/library/cc288638.aspx#Section2c">Plan
Internet presence sites
(SharePoint 2010 Foundation)


And this
Ted Pattison's video:

href="http://msdn.microsoft.com/en-us/SP2010DevTrainingCourse_SitesasCollectionsofPages.aspx">Sites
as Collections of Pages

(See how Sites in SharePoint 2010 just become a
collection of pages. Unlike before pages now play a key role in the structure of
a site... )


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">

I have just found
elements of comparison when considering SharePoint Server 2010 Publishing Sites
vs. SharePoint Foundation 2010 Sites:

SharePoint Server 2010 Publishing
Sites vs. SharePoint Foundation 2010 Sites

After requirements gathering
is complete, first decide whether to base the website on Microsoft SharePoint
Foundation 2010, or on a server running Microsoft SharePoint Server 2010 with
the Publishing Features enabled. Publishing sites are built on SharePoint
Foundation, and there are many advantages to building engaging Internet-facing
websites with publishing sites. Some of the benefits of creating a brand with
SharePoint Server publishing sites and SharePoint Foundation sites include the
following:

Enables content authors to create webpages with a more robust
rich-text editing experience than SharePoint Foundation sites offer.


Includes master pages that target publishing sites and that use specific
code assemblies that take advantage of publishing Features.

Easier
control of web navigation from the web UI, and more options are available to the
designer.

Uses the Web UI to easily change a master page and to apply
master pages to all subsites below the current site.

Uses page layouts
to create templates at the page level. Uses text layouts to accomplish a form of
simple page layout. Text layouts are not configurable.

Use the $SPUrl
token to target HTML assets with URLs that are relative to either the site
collection ($SPUrl;~sitecollection/) or site root ($SPUrl:~site/)


source: href="http://msdn.microsoft.com/en-us/library/gg430141.aspx">Real World Branding
with SharePoint 2010 Publishing Sites


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 13px; PADDING-RIGHT: 0px; COLOR: #e9ab17; FONT-WEIGHT: bold; PADDING-TOP: 10px">Audience


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">I
will avoid using development operations in this first post in order it can be
useful to system administrators. Of course it is also targetted for developers
so as they can configure their development machine, but they won't have to
launch Visual Studio here.


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 13px; PADDING-RIGHT: 0px; COLOR: #e9ab17; FONT-WEIGHT: bold; PADDING-TOP: 10px">1
- Extending an existing SharePoint Foundation Web Application

style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Assume
you have created a SharePoint Foundation web application using NTLM
authentication (that is the default mode).
Go to the SharePoint 2010 Central
Administration of your SharePoint Farm, click the "Manage web applications" link
then on the displayed list of the available
web application select the one you want to open to anonymous users.


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">The
buttons of the SharePoint 2010 ribbon are now  usable, so click on
Extend.
The Extend pop-up appears.


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Type
the name of the new web application
Type 80 for port
Define a host
header
Select Allow Anonymous because we are planning anonymous access
For
the zone, choose Internet, because we plan to extend the existing web
application for an Internet access.


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">So
as you will obtain the following screen shots


href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcHIs9uXTiGWQggVXSRrNurgGF8h6jM6Jn3PdI24fN_KU30TYd7EZJDdNwWuM-cHTapr4HT23eimWIwd7pZk_bt-5DtBNjQcESQr5MqifrE6hWRt-11KyYCv_Hi3IILtHq8sOicNhDJM9P/s1600/configuring+sharepoint+foundation+for+Internet+facing+-+010+-+Extending+the+web+application+1.jpg">style="WIDTH: 320px; HEIGHT: 154px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5666739129036206162 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcHIs9uXTiGWQggVXSRrNurgGF8h6jM6Jn3PdI24fN_KU30TYd7EZJDdNwWuM-cHTapr4HT23eimWIwd7pZk_bt-5DtBNjQcESQr5MqifrE6hWRt-11KyYCv_Hi3IILtHq8sOicNhDJM9P/s320/configuring+sharepoint+foundation+for+Internet+facing+-+010+-+Extending+the+web+application+1.jpg">


 


href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-gR36Wzww-sfCBYVoXT2rpwg_qWFFFHhz6X0BbQyRQT-qezoaQYnnTCVjduHSjHauIGhan-_trAeuvXF6oeKEUukmgPxLd7sk3Wkbj93tCydKUsjRRYhH5UPNCyCvyaErCsU5Ll3Arcx8/s1600/configuring+sharepoint+foundation+for+Internet+facing+-+020+-+Extending+the+web+application+2.jpg">style="WIDTH: 320px; HEIGHT: 154px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5666739124739848914 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-gR36Wzww-sfCBYVoXT2rpwg_qWFFFHhz6X0BbQyRQT-qezoaQYnnTCVjduHSjHauIGhan-_trAeuvXF6oeKEUukmgPxLd7sk3Wkbj93tCydKUsjRRYhH5UPNCyCvyaErCsU5Ll3Arcx8/s320/configuring+sharepoint+foundation+for+Internet+facing+-+020+-+Extending+the+web+application+2.jpg">


 


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Then,
 click the "OK" button to create the web application.
Nothing has
changed in the web application list, but if you navigate to the Alternate Access
Mappings page of the central administration (in the System Settings
section), then click on the "Edit Public Zone URLs" link and select the
extended web application you will notice taht the zone was properly created.


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px"> 


href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi569XQ9PYPNbDMuz0n2la04gPD9qiGL2cLTpVx0lPoPEHUvigaopNnUKHFq1gGATo9koCn14ANty_ikT2XT5lnK0zG4z7a-Me136P4Ed8ihwhd6zWsAmoOTniQV87a8C-YgF4lnwFcy9zf/s1600/configuring+sharepoint+foundation+for+Internet+facing+-+030+-+alternate+access+mapping+_+edit+zone+ursl+_+Internet+zone+created.jpg">style="WIDTH: 320px; HEIGHT: 212px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5666739114760204386 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi569XQ9PYPNbDMuz0n2la04gPD9qiGL2cLTpVx0lPoPEHUvigaopNnUKHFq1gGATo9koCn14ANty_ikT2XT5lnK0zG4z7a-Me136P4Ed8ihwhd6zWsAmoOTniQV87a8C-YgF4lnwFcy9zf/s320/configuring+sharepoint+foundation+for+Internet+facing+-+030+-+alternate+access+mapping+_+edit+zone+ursl+_+Internet+zone+created.jpg">


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px"> 


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">You
can also check in IIS7 that the IIS web site for the Internet zone is now
available


href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEyoZpVUi3IsHwcsRNTKlFvM2omUdSMKDLhBAA-02WwP2IwqA_vwmgCpYT2UOsC1t5-7uYLbRwC8bZ82_mcyduhude-m9MH_byXIG6DNHAfKP4NGNUGkgTzn7bsVjMXPU9W5bCgqdtgcI5/s1600/configuring+sharepoint+foundation+for+Internet+facing+-+040+-+IIS7+_++Internet+zone+IIS+web+site+created.jpg">style="WIDTH: 320px; HEIGHT: 151px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5666739108514598754 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEyoZpVUi3IsHwcsRNTKlFvM2omUdSMKDLhBAA-02WwP2IwqA_vwmgCpYT2UOsC1t5-7uYLbRwC8bZ82_mcyduhude-m9MH_byXIG6DNHAfKP4NGNUGkgTzn7bsVjMXPU9W5bCgqdtgcI5/s320/configuring+sharepoint+foundation+for+Internet+facing+-+040+-+IIS7+_++Internet+zone+IIS+web+site+created.jpg">


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 13px; PADDING-RIGHT: 0px; COLOR: #e9ab17; FONT-WEIGHT: bold; PADDING-TOP: 10px">2 -
Testing the anonymous acces


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">As
we have defined previously a custom host header for our Internet site we have to
modify the host file of our development machine in order to be able to acces the
site as an anonymous user.
So open the hosts file of your machine located at
:


C:\Windows\System32\drivers\etc


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">and
add the following entry:


 127.0.0.1       www.mycompany.com


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Now
open a browser and browse to this url. You access your SharePoint team site as
an anonymous user and simulate an Internet acces.


href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_FIbyIUe_Ya4EIyCTrWoppPaOt-NIrxzhutHgIH0A4NaexbWfCcnmiNhi33hWrzR7dILJC2gxsyHFNKOeIhG6tBSHYDX_RFSh7OhB9dtL0ZEXoQ_o_k0_TEhuBbOA2nriKD0TEhizC5-y/s1600/configuring+sharepoint+foundation+for+Internet+facing+-+050+-++accessing+sharepoint+foundation+team+site+through+the+Internet.jpg">style="WIDTH: 320px; HEIGHT: 152px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5666761106370893106 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_FIbyIUe_Ya4EIyCTrWoppPaOt-NIrxzhutHgIH0A4NaexbWfCcnmiNhi33hWrzR7dILJC2gxsyHFNKOeIhG6tBSHYDX_RFSh7OhB9dtL0ZEXoQ_o_k0_TEhuBbOA2nriKD0TEhizC5-y/s320/configuring+sharepoint+foundation+for+Internet+facing+-+050+-++accessing+sharepoint+foundation+team+site+through+the+Internet.jpg">


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">if
you cannot access to the site with an anonymous access, browse to the
http://www.mycompany.com/_layouts/setanon.aspx page, you will be prompted for
authentication, use the site coll administrator to authenticate in NTLM mode,
switch anonymous access to Entire site, click OK (in the screen shot, url is
wrong, sorry).


 href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTpoOLert4dH_a_pT0jYh_PrdkC2tHzxSGp3ny_QNygpsnpkRrFUDMN-0kaO6ZhS7qQt5RU59gIQjRqfy4zWqnbIRcxsz3nc8Hi3woqQVMNlYbx-dxijHO1ZAl8e9jgr0xG_vYjMrNMVBc/s1600/configuring+sharepoint+foundation+for+Internet+facing+-+060+-++disabling+reenabling+anonymous+access.jpg">style="WIDTH: 320px; HEIGHT: 157px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5666827519415665938 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTpoOLert4dH_a_pT0jYh_PrdkC2tHzxSGp3ny_QNygpsnpkRrFUDMN-0kaO6ZhS7qQt5RU59gIQjRqfy4zWqnbIRcxsz3nc8Hi3woqQVMNlYbx-dxijHO1ZAl8e9jgr0xG_vYjMrNMVBc/s320/configuring+sharepoint+foundation+for+Internet+facing+-+060+-++disabling+reenabling+anonymous+access.jpg">


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">If
you select Lists and libraries, anonymous users will be able to view items only
for those lists and libraries that have enabled permissions for anonymous users.


href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNi8EWXSkQiA10_Wak20FUZ3Zxdx1aZDdQ-kowozX_kX6tImyL3zakryWGWbUE4uoq-41igkZaUhSwQogZf0cMwkJAb3Hsvp_YLNC-xjefzWcSc_RH3BdsztBmY516TJSJLPFfZnXtHM24/s1600/configuring+sharepoint+foundation+for+Internet+facing+-+061+-++giving+specific+permissions+to+anonymous+access.jpg">style="WIDTH: 320px; HEIGHT: 202px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5666868492816238834 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNi8EWXSkQiA10_Wak20FUZ3Zxdx1aZDdQ-kowozX_kX6tImyL3zakryWGWbUE4uoq-41igkZaUhSwQogZf0cMwkJAb3Hsvp_YLNC-xjefzWcSc_RH3BdsztBmY516TJSJLPFfZnXtHM24/s320/configuring+sharepoint+foundation+for+Internet+facing+-+061+-++giving+specific+permissions+to+anonymous+access.jpg">


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">However
how interesting this option is, it will force administrator to break inheritance
for each lists for those they want to grant access for anonymous
users. You will also notice that for those lists, the SharePoint Forms pages are
also accessible to anonymous users. For example, if you grant access to
anonymous users for the site pages library of a Foundation team site, anonymous
users might be able to get to http://www.mycompany.com/SitePages/Forms/AllPages.aspx.

Typically
you don't want this, so how do you prevent anonymous users from accessing these
pages?   
In SharePoint Server, where the publishing features
are available we would activate the lockdown feature especially
provided by Microsoft for avoiding this problem.  


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">By
the way, It is amazing to think to activate
within SharePoint Foundation the lockdown feature which was formerly
reserved to the SharePoint CMS .
Yes and no.
Now the team sites must be
seen as a collection of pages. They get closer to the SharePoint CMS a lot.

On this subject you should watch the href="http://msdn.microsoft.com/en-us/SP2010DevTrainingCourse_SitesasCollectionsofPages.aspx">Ted
Pattison's video
(See how Sites in SharePoint 2010 just become a collection
of pages. Unlike before pages now play a key role in the structure of a site.).






style="COLOR: red">Updated 2011 october 26th




style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 13px; PADDING-RIGHT: 0px; COLOR: #e9ab17; FONT-WEIGHT: bold; PADDING-TOP: 10px">3 -
An alternative to the lockdown Feature


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Unfortunately,
this feature is not available for SharePoint foundation. So I made an adaptation
for WSS 3.0 and SharePoint Foudation 2010 that you can download as a SharePoint
solution (.wsp) on Codeplex:


Custom lockdown feature for wss
3.0 and SharePoint 2010 Foundation


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">If
you want to use it, download the .wsp and deploy it. It will be globally
deployed anyway because the feature handler .dll will be placed in the
GAC.
Then you should not need to install the feature because it will be
automatically installed at deployment time, but if the automatic
 installation had failled, you could install it by excuting this within a
command prompt:


stsadm -o installfeature -name viewformpageslockdowncustom


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">then
activate the feature for your site collection with this other instruction:


stsadm -o activatefeature -name viewformpageslockdowncustom -url
http://www.mycompany.com


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">But,
beacause we already have anonymous access enabled, we need to go disable
it, then enable it again. Go to the _layouts/setanon.aspx page, switch anonymous
access off, click OK, then go back and set it to entire site, then click OK.


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Anonymous
users should now get an authentication prompt when they try to navigate to a
forms page. For example, http://www.mycompany.com/SitePages/Forms/AllPages.aspx.


href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGUa4uUsTMA9ggM_CJWplHNkrlFhRyJO7Y915F8kYu4Yqx-GlpJLMr3BJINcj1tr_AsxZ3lG_Me0mKZpHTeMTvWYCYwzGan1YhQJklCs_JUWAi-xtB9nh8Fgo8wYiDVK6wUWJG2sXwoz3T/s1600/configuring+sharepoint+foundation+for+Internet+facing+-+070+-++Locdown+feature+enabled.jpg">style="WIDTH: 320px; HEIGHT: 153px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5666827513434902882 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGUa4uUsTMA9ggM_CJWplHNkrlFhRyJO7Y915F8kYu4Yqx-GlpJLMr3BJINcj1tr_AsxZ3lG_Me0mKZpHTeMTvWYCYwzGan1YhQJklCs_JUWAi-xtB9nh8Fgo8wYiDVK6wUWJG2sXwoz3T/s320/configuring+sharepoint+foundation+for+Internet+facing+-+070+-++Locdown+feature+enabled.jpg">
 


 


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 13px; PADDING-RIGHT: 0px; COLOR: #e9ab17; FONT-WEIGHT: bold; PADDING-TOP: 10px">4 -
Setting custom error page for error 401 (forbidden) within Sharepoint 2010


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">(The
following section is dedicated to Sharepoint 2010 since you will not find the
following xml tags in the web.config of wss 3.0.)

Now we are going to do
an amazing thing. We are going to change the web.config file of the web
application corresponding to the Internet access so as anonymous user won't
be prompted anymore for authentication if they try to acces to an unauthorized
url but be redirected on a custom 401 error page within the site.


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">So
first go to your site with at least contributor permissions by using NTLM access
and create a custom 401 error page in the site pages library of your site.
Assume we call it unauthorized so as its url will be href="http://www.mycompany.com/sitepages/unauthorized.aspx">http://www.mycompany.com/sitepages/unauthorized.aspx.
Type a meessage of access denied and save the page.


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Then, open
the web.config file of the Internet zone web application and locate the handlers
end tag within the system.webSever and paste the following httpErrors
sequence.


    
</handlers>
       
<httpErrors errorMode="Custom"
existingResponse="Auto">
           
<remove statusCode="401"
/>
           
<error statusCode="401" prefixLanguageFilePath=""
path="/sitepages/unauthorized.aspx" responseMode="ExecuteURL"
/>
        </httpErrors>
color=#c0c0c0>  </system.webServer>


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px"> After
restarting your application pool by reloading a page of your site with anonymous
acces, you will notice an amazing thing: each time an anonymous user will try to
access to a non authorized ressource, instead of being prompted for an NTLM
authentification, he will be redirected to the custom 401 error page of your
site and he will still have your site navigation links available and be
able to keep browsing.


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">And
the most amazing is you will have the same result while clicking the sign in
link.
So of course don't do that if you plan to use an Internet access for
contributing on your site or for administrating it...

And don't forget
that this will have an impact on the whole web application since we have
modified the web.config, so it won't be possible to obtain a different behaviour
for another site collection within this web application.


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px"> The
next screen shot show my 401 unauthorized custom error page after having clicked
the Sign in link.


href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY53yApJZC95_Mor5CIgudvS4OqNHyTcU-MXpuckO2_wrxpQzKfUI_DAIjfdoAHu5C05woO40Y1vhyphenhyphenTg644SwH7RqTjmAKrOzatLLGx-cOXFnssLmBT-L1XstgqntLqAPUsH7CkLd7Ctcy/s1600/configuring+sharepoint+foundation+for+Internet+facing+-+080+-++401+unauthorized+custom+error+page+after+having+clicked+the+sign+in+link+.jpg">style="WIDTH: 320px; HEIGHT: 205px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5666827515542953874 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY53yApJZC95_Mor5CIgudvS4OqNHyTcU-MXpuckO2_wrxpQzKfUI_DAIjfdoAHu5C05woO40Y1vhyphenhyphenTg644SwH7RqTjmAKrOzatLLGx-cOXFnssLmBT-L1XstgqntLqAPUsH7CkLd7Ctcy/s320/configuring+sharepoint+foundation+for+Internet+facing+-+080+-++401+unauthorized+custom+error+page+after+having+clicked+the+sign+in+link+.jpg">



style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">It
is all that we can do for now by just performing configuration operations.

Of course, don't forget to modify the navigation within the SharePoint 2010
UI to hide all the links that could lead to an access denied for anonymous
users. In short, you should let only the links pointing on a subsite, a Site
Page or a specific document.


In the next post, we are going to use
Visual Studio to start customizing our site...


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 13px; PADDING-RIGHT: 0px; COLOR: #e9ab17; FONT-WEIGHT: bold; PADDING-TOP: 10px">5 -
Aknowledgements


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Thanks
to :

href="http://www.ngpixel.com/2010/12/23/sharepoint-2010-custom-error-pages/">Nick
whose article helped me for custom errors, I have just noticed that he also
lives and works in Montreal...

href="http://blogs.msdn.com/b/ecm/archive/2007/05/12/anonymous-users-forms-pages-and-the-lockdown-feature.aspx">Tyler
Butler
of the ECM team blog who was by his publications of a big help in the
realization of my projects for the internet and who made me discover the
existence of the lockdown feature...

Ted Pattison for his href="http://msdn.microsoft.com/en-us/SP2010DevTrainingCourse_SitesasCollectionsofPages.aspx">video
which opens many new horizons regarding the use of SharePoint 2010. I will
publish more about it someday...


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px"> 


 

Saturday, October 22, 2011

Creating a custom document library for SharePoint 2010

style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 13px; PADDING-RIGHT: 0px; COLOR: #e9ab17; FONT-WEIGHT: bold; PADDING-TOP: 10px">Introduction


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 5px; MARGIN: 1px 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">It
seems that it is not that obvious to find clear documentation to create a
custom document library for SharePoint 2010.
Most of the Microsoft
documentation is now based on using Visual Studio 2010 and are more focused on
the lists than on the document libraries.


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 5px; MARGIN: 1px 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">By
the way document libraries in SharePoint 2010 seems to has become lists, but the
lack of documentation regarding the creation of custom lists remains anyway, so
after having perform some successful trials I have decided to publish a step by
step guide.


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 13px; PADDING-RIGHT: 0px; COLOR: #e9ab17; FONT-WEIGHT: bold; PADDING-TOP: 10px">Functional
benefits


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 5px; MARGIN: 1px 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">I
won't spend much time in this post explaining the functional benefits of
creating a custom document library because I plan to publish soon a new post
explaining the difference between a custom list and a list instance and the
functional benefits and drawbacks of each. But think carefully before
creating a custom document library.
I have created one in a previous project
for MOSS 2007 and had serious problems when migrating to SharePoint 2010.
In
most of the cases, a list instance is enough so if it is possible, avoid
creating a custom list or document library. In a general way, avoid as much as
possible to create custom CAML definitions for sites, lists and so
on... 


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 13px; PADDING-RIGHT: 0px; COLOR: #e9ab17; FONT-WEIGHT: bold; PADDING-TOP: 10px">Required
steps for creating a custom SharePoint 2010 document library


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 5px; MARGIN: 1px 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">1
- Duplicate the native DocumentLibrary feature
2 - Change the attributes
of the Feature tag of the Feature.xml file
3 - Change the attributes of the
ListTemplate tag of the DocumentLibrary.xml file
4 - Rename the DocLib folder
located in the DocumentLibrary folder
5 - Install the feature
6 - Activate
the feature for a specific site
7 -Test


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 13px; PADDING-RIGHT: 0px; COLOR: #e9ab17; FONT-WEIGHT: bold; PADDING-TOP: 10px">Detailed
operations


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 26px; COLOR: #e9ab17; FONT-WEIGHT: normal; PADDING-TOP: 10px">1
- Duplicating the native DocumentLibrary feature


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 5px; MARGIN: 1px 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Locate
the folder of th DocumentLibrary feature located in: C:\Program Files\Common
Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES
Copy and
paste the folder and rename it. Assume we rename it
MyCompany.MyCustomDocumentLibrary.


 


href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7CIfvK_TpTVVY9U7ENAQDVJy5A7tawBuw2UEwV4xjd27MAZLhLNCDE9HL8UIA4KibLV5_Q9dHiud51_vo6E-Ii5OW_TWUt5c29iR-p0SiqEF2_ZziQSou__EUivP8LHVxRk_e7frD5EjO/s1600/Creating+a+custom+document+library+for+sharepoint+2010+-+010+-+duplicating+DocuementLibrary+folder.jpg">style="WIDTH: 320px; HEIGHT: 239px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5666374063853351122 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7CIfvK_TpTVVY9U7ENAQDVJy5A7tawBuw2UEwV4xjd27MAZLhLNCDE9HL8UIA4KibLV5_Q9dHiud51_vo6E-Ii5OW_TWUt5c29iR-p0SiqEF2_ZziQSou__EUivP8LHVxRk_e7frD5EjO/s320/Creating+a+custom+document+library+for+sharepoint+2010+-+010+-+duplicating+DocuementLibrary+folder.jpg">


 


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 26px; COLOR: #e9ab17; FONT-WEIGHT: normal; PADDING-TOP: 10px">2
- Changing the attributes of the Feature tag of the Feature.xml file and adding
some more attributes


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Open
the Feature.xml file with Visual Studio or a text editor, and change these
attributes:


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">ID
Change
the ID of the feature. I usually change the last figures by the new type of the
list. Assume the new type is 10001 (it is not recommended to use a new type
smaller than 10000), the new ID of the feature of my custom document library
will be 00BFEA71-E717-4E80-AA17-D0C71B310001.


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Title
The
title will appear in the UI of SharePoint 2010 in the "Manage Site Features"
page (because the attribute Scope is set to Web).


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Description
The
description will also appear in the UI of SharePoint 2010 in the "Manage Site
Features" page (Because the attribute Scope is set to Web).


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Hidden
Change
the value of the attribute to FALSE in order to see the feature in the "Manage
Features" page of your SharePoint 2010 so as you can activate it manually and
allow a site administrator to activate it.


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Add
the following attributes


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">AlwaysForceInstall="TRUE"
This
will avoid having an error at deployment time if you deploy this feature in a
SharePoint solution (.wsp file) by retracting, removing the old version of your
solution and re-deploying a new one.


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">ImageUrl
I
have created a folder for MyCompany located in the SharePoint 2010 IMAGES folder
located at:
C:\Program Files\Common Files\Microsoft Shared\Web Server
Extensions\14\TEMPLATE\IMAGES
(I use a part of the SharePoint summit logo
because I was speaker at this summit last year in Quebec and plan to be speaker
on 2012 at Toronto and Quebec.)


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Here
is the new xml after the changes has been performed:


size=2><?size=2>xml
size=2>versionsize=2>="color=#0000ff size=2>1.0"size=2> size=2>encodingsize=2>="color=#0000ff size=2>utf-8size=2>"size=2>?>
<
size=2>Featuresize=2> size=2>Idsize=2>="color=#0000ff size=2>00BFEA71-E717-4E80-AA17-D0C71B310001size=2>"

size=2>                 
Title
size=2>="color=#0000ff size=2>MyCompany MyCustom Document Librarysize=2>"
size=2>                 
Description
size=2>="color=#0000ff size=2>Allow a custom document library to be created within this
site
"
color=#ff0000
size=2>                 
Version
size=2>="color=#0000ff size=2>1.0.0.0"
color=#ff0000 size=2>size=2>                 
Scope
size=2>="color=#0000ff size=2>Web"
color=#ff0000 size=2>size=2>                 
Hidden
size=2>="color=#0000ff size=2>False"
color=#ff0000 size=2>size=2>                 
AlwaysForceInstall
size=2> ="color=#0000ff size=2>TRUE"
color=#ff0000 size=2>size=2>                 
ImageUrl

=
"color=#0000ff size=2>MyCompany/sharePointSummitLogo.jpgsize=2>"
size=2>                 
DefaultResourceFile
size=2>="color=#0000ff size=2>core"size=2>
size=2>size=2>                
xmlns
size=2>=color=#0000ff size=2>href="http://schemas.microsoft.com/sharepoint/">http://schemas.microsoft.com/sharepoint/size=2>size=2>>
                 <
color=#a31515 size=2>size=2>ElementManifestscolor=#0000ff
size=2>>
                        
 
size=2><size=2>ElementManifestcolor=#0000ff size=2> color=#ff0000 size=2>Locationcolor=#0000ff size=2>="size=2>size=2>ListTemplates\DocumentLibrary.xml"color=#0000ff size=2>
/>
                
</
size=2>ElementManifestscolor=#0000ff size=2>>
</
color=#a31515 size=2>Featurecolor=#0000ff size=2>>


 


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 26px; COLOR: #e9ab17; FONT-WEIGHT: normal; PADDING-TOP: 10px">3
- Changing the attributes of the ListTemplate tag of the DocumentLibrary.xml
file


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Name
This
is the important key. This name and the name of the folder where the schema.xml
file of the custom library is located MUST be the SAME !
I use
customdoclib1


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Type
As
written before the new type will be 10001. The type can for example be used in a
feature that will place a custom button in a document library ribbon so as when
you activate the feature for the new button, only the document libraries with
the 10001 type will have the new button. Changing the type is one of the good
reasons to choose to create a custom document library rather to create a list
instance. But it can also cause many problems later for example when migrating
to a new version of SharePoint so be careful.
The base type will not be
changed, BaseType 1 means the list is a document library...


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">DisplayName
This
name will appear in your SharePoint site in the create page when you want to
create a custom document library within your site.


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Description
The
description will appear in your SharePoint site below the display name in
the create page when you want to create a custom document library within your
site.


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Here
is the new xml after the changes has been performed:

size=2>

<?size=2>xml
size=2>versionsize=2>="color=#0000ff size=2>1.0"size=2> size=2>encodingsize=2>="color=#0000ff size=2>utf-8size=2>"size=2>?>
<
size=2>Elementssize=2> size=2>xmlnssize=2>="color=#0000ff size=2>http://schemas.microsoft.com/sharepoint/size=2>"size=2>>
      <
color=#a31515 size=2>size=2>ListTemplate
color=#ff0000 size=2>         
Name
size=2>="color=#0000ff size=2>customdoclib1"
color=#ff0000 size=2>size=2>         
Type
size=2>="color=#0000ff size=2>10001"
color=#ff0000 size=2>size=2>          
BaseType
size=2>="color=#0000ff size=2>1"
size=2>size=2>          
OnQuickLaunch
size=2>="color=#0000ff size=2>TRUE"
color=#ff0000 size=2>size=2>          
SecurityBits
size=2>="color=#0000ff size=2>11"
color=#ff0000 size=2>size=2>          
Sequence
size=2>="color=#0000ff size=2>110"
color=#ff0000 size=2>size=2>          
DisplayName
size=2>="color=#0000ff size=2>My Company Document Librarysize=2>"
size=2>          
Description
size=2>="color=#0000ff size=2>Create a document library with xyz
functionalities
"
size=2>size=2>          
Image
size=2>="color=#0000ff size=2>/_layouts/images/itdl.pngsize=2>"
size=2>          
DocumentTemplate
size=2>="color=#0000ff size=2>121"size=2>/>
</
color=#a31515 size=2>Elementscolor=#0000ff size=2>>


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 26px; COLOR: #e9ab17; FONT-WEIGHT: normal; PADDING-TOP: 10px">4
- Renaming the DocLib folder located in the DocumentLibrary folder


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">As
written before, the important key is now to rename the folder where the document
library schema.xml file is located so as it has the same name than the name
attribute of the custom document library template.


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">So
we rename the folder to customdoclib1


 


href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-F-1AaqA53HJRcPpobfSWKKSLd8HHE3RRHLS6xDK3nT6agQ6CiGUYiA5CpF5YU8k3VIF_Exp_n9l80UW4omlJ4ql7gjAdpM1aX2lOhHwGmxKGIw2rQaRptPcUThQOwSDqVy1iTHLnXpBi/s1600/Creating+a+custom+document+library+for+sharepoint+2010+-+020+-+renaming+Doclib+folder.jpg">style="WIDTH: 320px; HEIGHT: 199px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5666374060315019298 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-F-1AaqA53HJRcPpobfSWKKSLd8HHE3RRHLS6xDK3nT6agQ6CiGUYiA5CpF5YU8k3VIF_Exp_n9l80UW4omlJ4ql7gjAdpM1aX2lOhHwGmxKGIw2rQaRptPcUThQOwSDqVy1iTHLnXpBi/s320/Creating+a+custom+document+library+for+sharepoint+2010+-+020+-+renaming+Doclib+folder.jpg">


 


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 26px; COLOR: #e9ab17; FONT-WEIGHT: normal; PADDING-TOP: 10px">5
- Installing the feature


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Now,
all we have to do is install the feature so open a command prompt and be sure to
have the administrator permissions on the machine. If the stsadm.exe
path is referenced in the system variables of the machine you just have to
type the following:


stsadm -o installfeature -name MyCompany.MyCustomDocumentLibrary


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">In
order to obtain this screen


 


href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh45n_b5P6ut-GBb6cuaMrrIA8BXWjqeSuCylUE7b4LWRAy9k76bQnhzxIv8DMDbdpoICLbNm-ysMmu0V0XkQ5nvCFfKTwUT-8-nnHbWbEpnT_kRNQtc77YGAkhv1faoNlaZp5BHgs7x0zd/s1600/Creating+a+custom+document+library+for+sharepoint+2010+-+030+-+installing+the+feature.jpg">style="WIDTH: 320px; HEIGHT: 160px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5666374051135403458 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh45n_b5P6ut-GBb6cuaMrrIA8BXWjqeSuCylUE7b4LWRAy9k76bQnhzxIv8DMDbdpoICLbNm-ysMmu0V0XkQ5nvCFfKTwUT-8-nnHbWbEpnT_kRNQtc77YGAkhv1faoNlaZp5BHgs7x0zd/s320/Creating+a+custom+document+library+for+sharepoint+2010+-+030+-+installing+the+feature.jpg">


 


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 26px; COLOR: #e9ab17; FONT-WEIGHT: normal; PADDING-TOP: 10px">6
- Activating the feature for a specific site


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">So
now, open a site and you should see your feature in the "Manage Site Features"
page as shown in the next screen shot.


 


href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvn3lUYi5UpeBk5MZPeH0sFZQktQTK7TMa0DATCJBHOso66zaBwsHVIiQ6DJV7flGTyljF9YZiF19cvKvWrIqtpSEpikq9EzYkMC_vDsPAfpAlnN5E0jVXON0lduMyy9CE0gGuTjXb7XGP/s1600/Creating+a+custom+document+library+for+sharepoint+2010+-+040+-+feature+installed.jpg">style="WIDTH: 320px; HEIGHT: 152px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5666374046463454482 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvn3lUYi5UpeBk5MZPeH0sFZQktQTK7TMa0DATCJBHOso66zaBwsHVIiQ6DJV7flGTyljF9YZiF19cvKvWrIqtpSEpikq9EzYkMC_vDsPAfpAlnN5E0jVXON0lduMyy9CE0gGuTjXb7XGP/s320/Creating+a+custom+document+library+for+sharepoint+2010+-+040+-+feature+installed.jpg">


 


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Notice
that the description filled in the feature.xml file is displayed on the
page.
Click the Activate button to enable the custom library creation within
this site.


 


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 26px; COLOR: #e9ab17; FONT-WEIGHT: normal; PADDING-TOP: 10px">7
-Testing


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Now
if you navigate to the SharePoint 2010 Create pop up using the "Site Actions"
menu and clicking "More Options..." then selecting Library in the pop up you
will notice that the references to the custom library are actually displayed by
the pop up.


href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh51Sr6hXvaMiyyIQcQcut1FXr2hP2B4D8K2Xo2lM_rsF0kyZCLnjXqmRf84AmnZKw2gBVn2H0jj6_bJcB_QE6xynLG60i_SzgbTrub1gHNUAsivkhQTifLaaom4dxa4ww4NhlfnA-_Kvpo/s1600/Creating+a+custom+document+library+for+sharepoint+2010+-+050+-+creating+the+custom+library+within+a+SharePoint+2010+site.jpg">style="WIDTH: 320px; HEIGHT: 152px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5666374046951971602 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh51Sr6hXvaMiyyIQcQcut1FXr2hP2B4D8K2Xo2lM_rsF0kyZCLnjXqmRf84AmnZKw2gBVn2H0jj6_bJcB_QE6xynLG60i_SzgbTrub1gHNUAsivkhQTifLaaom4dxa4ww4NhlfnA-_Kvpo/s320/Creating+a+custom+document+library+for+sharepoint+2010+-+050+-+creating+the+custom+library+within+a+SharePoint+2010+site.jpg">


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Notice
that the name and description typed previously in the documentlibrary.xml file
are properly displayed.


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">So
type a name for your new custom document library for SharePoint
2010 and check it is correctly provisioned within your site.


href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxVh-RdMui_88eNiCtph1mUK4p1UxH6sGSttW4XHMRX0m2mtkfDxl5hffRCOnuUCHXZwAuHfIQgPde0NC3VsYeJzJx30c3-nM8p5WtDzQfyNlStJlU1EXxysuSquviJCLpeog6wbT07NKh/s1600/Creating+a+custom+document+library+for+sharepoint+2010+-+060+-+custom+document+library+within+a+SharePoint+2010+site+created.jpg">style="WIDTH: 320px; HEIGHT: 218px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5666376901611298594 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxVh-RdMui_88eNiCtph1mUK4p1UxH6sGSttW4XHMRX0m2mtkfDxl5hffRCOnuUCHXZwAuHfIQgPde0NC3VsYeJzJx30c3-nM8p5WtDzQfyNlStJlU1EXxysuSquviJCLpeog6wbT07NKh/s320/Creating+a+custom+document+library+for+sharepoint+2010+-+060+-+custom+document+library+within+a+SharePoint+2010+site+created.jpg">


 


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Well
done !!!